diff --git a/test/api-acceptance/admin/utils.js b/test/api-acceptance/admin/utils.js index 7692eecf9e..be6aa7827f 100644 --- a/test/api-acceptance/admin/utils.js +++ b/test/api-acceptance/admin/utils.js @@ -70,31 +70,41 @@ const expectedProperties = { 'frontmatter' ], - page: _(schema.posts) - .keys() - .filter(key => key.indexOf('@@') === -1) - // by default we only return mobildoc - .without('html', 'plaintext') - .without('locale') - .without('page') - // v2 API doesn't return new type field - .without('type') - // deprecated - .without('author_id', 'author') - // pages are not sent as emails - .without('email_recipient_filter') - // always returns computed properties - .concat('url', 'primary_tag', 'primary_author', 'excerpt') - // returned by default - .concat('tags', 'authors') - // returns meta fields from `posts_meta` schema - .concat( - ..._(schema.posts_meta).keys() - .without('post_id', 'id') - // pages are not sent as emails - .without('email_subject') - ) - , + page: [ + 'id', + 'uuid', + 'title', + 'slug', + 'mobiledoc', + 'comment_id', + 'feature_image', + 'featured', + 'status', + 'visibility', + 'created_at', + 'updated_at', + 'published_at', + 'custom_excerpt', + 'codeinjection_head', + 'codeinjection_foot', + 'custom_template', + 'canonical_url', + 'url', + 'primary_tag', + 'primary_author', + 'excerpt', + 'tags', + 'authors', + 'og_image', + 'og_title', + 'og_description', + 'twitter_image', + 'twitter_title', + 'twitter_description', + 'meta_title', + 'meta_description', + 'frontmatter' + ], user: _(schema.users) .keys() diff --git a/test/api-acceptance/content/utils.js b/test/api-acceptance/content/utils.js index 9032668b06..c5cc928e10 100644 --- a/test/api-acceptance/content/utils.js +++ b/test/api-acceptance/content/utils.js @@ -11,33 +11,40 @@ const expectedProperties = { authors: ['authors', 'meta'], pagination: ['page', 'limit', 'pages', 'total', 'next', 'prev'], - post: _(schema.posts) - .keys() - .filter(key => key.indexOf('@@') === -1) - // by default we only return html - .without('mobiledoc', 'plaintext') - // v2 doesn't return author_id OR author - .without('author_id', 'author') - // and always returns computed properties: url - .concat('url') - // v2 API doesn't return unused fields - .without('locale') - // These fields aren't useful as they always have known values - .without('status') - // v2 API doesn't return new type field - .without('type') - // @TODO: https://github.com/TryGhost/Ghost/issues/10335 - // .without('page') - // v2 returns a calculated excerpt field - .concat('excerpt') - // Access is a calculated property in >= v3 - .concat('access') - // returns meta fields from `posts_meta` schema - .concat( - ..._(schema.posts_meta).keys().without('post_id', 'id') - ) - .concat('reading_time') - , + post: [ + 'id', + 'uuid', + 'title', + 'slug', + 'html', + 'comment_id', + 'feature_image', + 'featured', + 'visibility', + 'email_recipient_filter', + 'created_at', + 'updated_at', + 'published_at', + 'custom_excerpt', + 'codeinjection_head', + 'codeinjection_foot', + 'custom_template', + 'canonical_url', + 'url', + 'excerpt', + 'access', + 'og_image', + 'og_title', + 'og_description', + 'twitter_image', + 'twitter_title', + 'twitter_description', + 'meta_title', + 'meta_description', + 'email_subject', + 'frontmatter', + 'reading_time' + ], author: _(schema.users) .keys() .without( diff --git a/test/regression/api/canary/content/utils.js b/test/regression/api/canary/content/utils.js index b0d2f0dcef..301db76863 100644 --- a/test/regression/api/canary/content/utils.js +++ b/test/regression/api/canary/content/utils.js @@ -11,32 +11,40 @@ const expectedProperties = { authors: ['authors', 'meta'], pagination: ['page', 'limit', 'pages', 'total', 'next', 'prev'], - post: _(schema.posts) - .keys() - .filter(key => key.indexOf('@@') === -1) - // by default we only return html - .without('mobiledoc', 'plaintext') - // canary doesn't return author_id OR author - .without('author_id', 'author') - // and always returns computed properties: url, primary_tag, primary_author - .concat('url') - // canary API doesn't return unused fields - .without('locale') - // These fields aren't useful as they always have known values - .without('status') - // @TODO: https://github.com/TryGhost/Ghost/issues/10335 - // .without('page') - .without('type') - // canary returns a calculated excerpt field - .concat('excerpt') - // Access is a calculated property in >= v3 - .concat('access') - // returns meta fields from `posts_meta` schema - .concat( - ..._(schema.posts_meta).keys().without('post_id', 'id') - ) - .concat('reading_time') - , + post: [ + 'id', + 'uuid', + 'title', + 'slug', + 'html', + 'comment_id', + 'feature_image', + 'featured', + 'visibility', + 'email_recipient_filter', + 'created_at', + 'updated_at', + 'published_at', + 'custom_excerpt', + 'codeinjection_head', + 'codeinjection_foot', + 'custom_template', + 'canonical_url', + 'url', + 'excerpt', + 'access', + 'og_image', + 'og_title', + 'og_description', + 'twitter_image', + 'twitter_title', + 'twitter_description', + 'meta_title', + 'meta_description', + 'email_subject', + 'frontmatter', + 'reading_time' + ], author: _(schema.users) .keys() .without( diff --git a/test/regression/api/v2/admin/utils.js b/test/regression/api/v2/admin/utils.js index 62cbb3630f..5f3c58b23e 100644 --- a/test/regression/api/v2/admin/utils.js +++ b/test/regression/api/v2/admin/utils.js @@ -20,28 +20,41 @@ const expectedProperties = { site: ['title', 'url', 'version'], - post: _(schema.posts) - .keys() - .filter(key => key.indexOf('@@') === -1) - // by default we only return mobiledoc - .without('html', 'plaintext') - .without('visibility') - .without('locale') - .without('page') - .without('author_id', 'author') - // emails are not supported in API v2 - .without('email_recipient_filter') - // always returns computed properties - .concat('url', 'primary_tag', 'primary_author', 'excerpt') - .concat('authors', 'tags') - // returns meta fields from `posts_meta` schema - .concat( - ..._(schema.posts_meta).keys() - .without('post_id', 'id') - // emails are not supported in API v2 - .without('email_subject') - ) - , + post: [ + 'id', + 'uuid', + 'title', + 'slug', + 'mobiledoc', + 'comment_id', + 'feature_image', + 'featured', + 'type', + 'status', + 'created_at', + 'updated_at', + 'published_at', + 'custom_excerpt', + 'codeinjection_head', + 'codeinjection_foot', + 'custom_template', + 'canonical_url', + 'url', + 'primary_tag', + 'primary_author', + 'excerpt', + 'authors', + 'tags', + 'og_image', + 'og_title', + 'og_description', + 'twitter_image', + 'twitter_title', + 'twitter_description', + 'meta_title', + 'meta_description', + 'frontmatter' + ], user: _(schema.users) .keys() .without('visibility') diff --git a/test/regression/api/v2/content/utils.js b/test/regression/api/v2/content/utils.js index 8ea34cabec..d534ee01b1 100644 --- a/test/regression/api/v2/content/utils.js +++ b/test/regression/api/v2/content/utils.js @@ -11,33 +11,38 @@ const expectedProperties = { authors: ['authors', 'meta'], pagination: ['page', 'limit', 'pages', 'total', 'next', 'prev'], - post: _(schema.posts) - .keys() - .filter(key => key.indexOf('@@') === -1) - // by default we only return html - .without('mobiledoc', 'plaintext') - // v2 doesn't return author_id OR author - .without('author_id', 'author') - // and always returns computed properties: url, primary_tag, primary_author - .concat('url', 'primary_tag', 'primary_author') - // v2 API doesn't return unused fields - .without('locale', 'visibility') - // emails are not supported in API v2 - .without('email_recipient_filter') - // These fields aren't useful as they always have known values - .without('status') - .concat('page') - .without('type') - // v2 returns a calculated excerpt field - .concat('excerpt') - // returns meta fields from `posts_meta` schema - .concat( - ..._(schema.posts_meta).keys() - .without('post_id', 'id') - // emails are not supported in API v2 - .without('email_subject') - ) - , + post: [ + 'id', + 'uuid', + 'title', + 'slug', + 'html', + 'comment_id', + 'feature_image', + 'featured', + 'created_at', + 'updated_at', + 'published_at', + 'custom_excerpt', + 'codeinjection_head', + 'codeinjection_foot', + 'custom_template', + 'canonical_url', + 'url', + 'primary_tag', + 'primary_author', + 'page', + 'excerpt', + 'og_image', + 'og_title', + 'og_description', + 'twitter_image', + 'twitter_title', + 'twitter_description', + 'meta_title', + 'meta_description', + 'frontmatter' + ], author: _(schema.users) .keys() .without( diff --git a/test/regression/api/v3/admin/utils.js b/test/regression/api/v3/admin/utils.js index 90c1619521..1e93b6ab99 100644 --- a/test/regression/api/v3/admin/utils.js +++ b/test/regression/api/v3/admin/utils.js @@ -21,26 +21,45 @@ const expectedProperties = { site: ['title', 'description', 'logo', 'accent_color', 'url', 'version'], - post: _(schema.posts) - .keys() - .filter(key => key.indexOf('@@') === -1) - // by default we only return mobiledoc - .without('html', 'plaintext') - .without('locale') - .without('page') - .without('author_id', 'author') - .without('type') - // always returns computed properties - // primary_tag and primary_author properties are included - // only because authors and tags are always included - .concat('url', 'primary_tag', 'primary_author', 'excerpt') - .concat('authors', 'tags', 'email') - // returns meta fields from `posts_meta` schema - .concat( - ..._(schema.posts_meta).keys().without('post_id', 'id') - ) - .concat('send_email_when_published') - , + post: [ + 'id', + 'uuid', + 'title', + 'slug', + 'mobiledoc', + 'comment_id', + 'feature_image', + 'featured', + 'status', + 'visibility', + 'email_recipient_filter', + 'created_at', + 'updated_at', + 'published_at', + 'custom_excerpt', + 'codeinjection_head', + 'codeinjection_foot', + 'custom_template', + 'canonical_url', + 'url', + 'primary_tag', + 'primary_author', + 'excerpt', + 'authors', + 'tags', + 'email', + 'og_image', + 'og_title', + 'og_description', + 'twitter_image', + 'twitter_title', + 'twitter_description', + 'meta_title', + 'meta_description', + 'email_subject', + 'frontmatter', + 'send_email_when_published' + ], user: _(schema.users) .keys() .without('visibility') diff --git a/test/regression/api/v3/content/utils.js b/test/regression/api/v3/content/utils.js index 9ec28722ef..f785fd53a6 100644 --- a/test/regression/api/v3/content/utils.js +++ b/test/regression/api/v3/content/utils.js @@ -11,33 +11,41 @@ const expectedProperties = { authors: ['authors', 'meta'], pagination: ['page', 'limit', 'pages', 'total', 'next', 'prev'], - post: _(schema.posts) - .keys() - .filter(key => key.indexOf('@@') === -1) - // by default we only return html - .without('mobiledoc', 'plaintext') - // v3 doesn't return author_id OR author - .without('author_id', 'author') - // and always returns computed properties: url, primary_tag, primary_author - .concat('url') - // v3 API doesn't return unused fields - .without('locale') - // These fields aren't useful as they always have known values - .without('status') - // @TODO: https://github.com/TryGhost/Ghost/issues/10335 - // .without('page') - .without('type') - // v3 returns a calculated excerpt field - .concat('excerpt') - // Access is a calculated property in >= v3 - .concat('access') - // returns meta fields from `posts_meta` schema - .concat( - ..._(schema.posts_meta).keys().without('post_id', 'id') - ) - .concat('reading_time') - .concat('send_email_when_published') - , + post: [ + 'id', + 'uuid', + 'title', + 'slug', + 'html', + 'comment_id', + 'feature_image', + 'featured', + 'visibility', + 'email_recipient_filter', + 'created_at', + 'updated_at', + 'published_at', + 'custom_excerpt', + 'codeinjection_head', + 'codeinjection_foot', + 'custom_template', + 'canonical_url', + 'url', + 'excerpt', + 'access', + 'og_image', + 'og_title', + 'og_description', + 'twitter_image', + 'twitter_title', + 'twitter_description', + 'meta_title', + 'meta_description', + 'email_subject', + 'frontmatter', + 'reading_time', + 'send_email_when_published' + ], author: _(schema.users) .keys() .without(