0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

Removed versioned confg from URL Service

refs: https://github.com/TryGhost/Toolbox/issues/228
refs: https://github.com/TryGhost/Toolbox/issues/229

- we are getting rid of the concept of having multiple api versions in a single ghost install
- this means the url service doesn't need to be versioned any more
This commit is contained in:
Hannah Wolfe 2022-04-06 13:03:22 +01:00 committed by Daniel Lockyer
parent 608258747a
commit 5eaa1938c7
No known key found for this signature in database
GPG key ID: D21186F0B47295AD
6 changed files with 2 additions and 427 deletions

View file

@ -1,4 +1,4 @@
const debug = require('@tryghost/debug')('routing');
const debug = require('@tryghost/debug')('frontend:routes');
const routing = require('../services/routing');
const urlService = require('../../server/services/url');

View file

@ -59,7 +59,7 @@ class Resources {
return;
}
this.resourcesConfig = require('./configs/canary');
this.resourcesConfig = require('./config');
}
/**

View file

@ -1,141 +0,0 @@
/*
* These are the default resources and filters.
* They contain minimum filters for public accessibility of resources.
*/
module.exports = [
{
type: 'posts',
modelOptions: {
modelName: 'Post',
filter: 'status:published+type:post',
exclude: [
'title',
'mobiledoc',
'html',
'plaintext',
// @TODO: https://github.com/TryGhost/Ghost/issues/10335
// 'page',
'status',
'amp',
'codeinjection_head',
'codeinjection_foot',
'meta_title',
'meta_description',
'custom_excerpt',
'og_image',
'og_title',
'og_description',
'twitter_image',
'twitter_title',
'twitter_description',
'custom_template',
'locale'
],
withRelated: ['tags', 'authors'],
withRelatedPrimary: {
primary_tag: 'tags',
primary_author: 'authors'
},
withRelatedFields: {
tags: ['tags.id', 'tags.slug'],
authors: ['users.id', 'users.slug']
}
},
events: {
add: 'post.published',
update: 'post.published.edited',
remove: 'post.unpublished'
}
},
{
type: 'pages',
modelOptions: {
modelName: 'Post',
exclude: [
'title',
'mobiledoc',
'html',
'plaintext',
// @TODO: https://github.com/TryGhost/Ghost/issues/10335
// 'page',
// 'status',
'amp',
'codeinjection_head',
'codeinjection_foot',
'meta_title',
'meta_description',
'custom_excerpt',
'og_image',
'og_title',
'og_description',
'twitter_image',
'twitter_title',
'twitter_description',
'custom_template',
'locale',
'tags',
'authors',
'primary_tag',
'primary_author'
],
filter: 'status:published+type:page'
},
events: {
add: 'page.published',
update: 'page.published.edited',
remove: 'page.unpublished'
}
},
{
type: 'tags',
keep: ['id', 'slug'],
modelOptions: {
modelName: 'Tag',
exclude: [
'description',
'meta_title',
'meta_description',
'parent_id'
],
filter: 'visibility:public',
shouldHavePosts: {
joinTo: 'tag_id',
joinTable: 'posts_tags'
}
},
events: {
add: 'tag.added',
update: ['tag.edited', 'tag.attached', 'tag.detached'],
remove: 'tag.deleted'
}
},
{
type: 'authors',
modelOptions: {
modelName: 'User',
exclude: [
'bio',
'website',
'location',
'facebook',
'twitter',
'locale',
'accessibility',
'meta_title',
'meta_description',
'tour'
],
filter: 'visibility:public',
shouldHavePosts: {
joinTo: 'author_id',
joinTable: 'posts_authors'
}
},
events: {
add: 'user.activated',
update: ['user.activated.edited', 'user.attached', 'user.detached'],
remove: 'user.deleted'
}
}
];

View file

@ -1,141 +0,0 @@
/*
* These are the default resources and filters.
* They contain minimum filters for public accessibility of resources.
*/
module.exports = [
{
type: 'posts',
modelOptions: {
modelName: 'Post',
filter: 'status:published+type:post',
exclude: [
'title',
'mobiledoc',
'html',
'plaintext',
// @TODO: https://github.com/TryGhost/Ghost/issues/10335
// 'page',
'status',
'amp',
'codeinjection_head',
'codeinjection_foot',
'meta_title',
'meta_description',
'custom_excerpt',
'og_image',
'og_title',
'og_description',
'twitter_image',
'twitter_title',
'twitter_description',
'custom_template',
'locale'
],
withRelated: ['tags', 'authors'],
withRelatedPrimary: {
primary_tag: 'tags',
primary_author: 'authors'
},
withRelatedFields: {
tags: ['tags.id', 'tags.slug'],
authors: ['users.id', 'users.slug']
}
},
events: {
add: 'post.published',
update: 'post.published.edited',
remove: 'post.unpublished'
}
},
{
type: 'pages',
modelOptions: {
modelName: 'Post',
exclude: [
'title',
'mobiledoc',
'html',
'plaintext',
// @TODO: https://github.com/TryGhost/Ghost/issues/10335
// 'page',
// 'status',
'amp',
'codeinjection_head',
'codeinjection_foot',
'meta_title',
'meta_description',
'custom_excerpt',
'og_image',
'og_title',
'og_description',
'twitter_image',
'twitter_title',
'twitter_description',
'custom_template',
'locale',
'tags',
'authors',
'primary_tag',
'primary_author'
],
filter: 'status:published+type:page'
},
events: {
add: 'page.published',
update: 'page.published.edited',
remove: 'page.unpublished'
}
},
{
type: 'tags',
keep: ['id', 'slug'],
modelOptions: {
modelName: 'Tag',
exclude: [
'description',
'meta_title',
'meta_description',
'parent_id'
],
filter: 'visibility:public',
shouldHavePosts: {
joinTo: 'tag_id',
joinTable: 'posts_tags'
}
},
events: {
add: 'tag.added',
update: ['tag.edited', 'tag.attached', 'tag.detached'],
remove: 'tag.deleted'
}
},
{
type: 'authors',
modelOptions: {
modelName: 'User',
exclude: [
'bio',
'website',
'location',
'facebook',
'twitter',
'locale',
'accessibility',
'meta_title',
'meta_description',
'tour'
],
filter: 'visibility:public',
shouldHavePosts: {
joinTo: 'author_id',
joinTable: 'posts_authors'
}
},
events: {
add: 'user.activated',
update: ['user.activated.edited', 'user.attached', 'user.detached'],
remove: 'user.deleted'
}
}
];

View file

@ -1,143 +0,0 @@
/*
* These are the default resources and filters.
* They contain minimum filters for public accessibility of resources.
*/
// @TODO: keep this similar to ./canary.js until the v5 release
module.exports = [
{
type: 'posts',
modelOptions: {
modelName: 'Post',
filter: 'status:published+type:post',
exclude: [
'title',
'mobiledoc',
'html',
'plaintext',
// @TODO: https://github.com/TryGhost/Ghost/issues/10335
// 'page',
'status',
'amp',
'codeinjection_head',
'codeinjection_foot',
'meta_title',
'meta_description',
'custom_excerpt',
'og_image',
'og_title',
'og_description',
'twitter_image',
'twitter_title',
'twitter_description',
'custom_template',
'locale'
],
withRelated: ['tags', 'authors'],
withRelatedPrimary: {
primary_tag: 'tags',
primary_author: 'authors'
},
withRelatedFields: {
tags: ['tags.id', 'tags.slug'],
authors: ['users.id', 'users.slug']
}
},
events: {
add: 'post.published',
update: 'post.published.edited',
remove: 'post.unpublished'
}
},
{
type: 'pages',
modelOptions: {
modelName: 'Post',
exclude: [
'title',
'mobiledoc',
'html',
'plaintext',
// @TODO: https://github.com/TryGhost/Ghost/issues/10335
// 'page',
// 'status',
'amp',
'codeinjection_head',
'codeinjection_foot',
'meta_title',
'meta_description',
'custom_excerpt',
'og_image',
'og_title',
'og_description',
'twitter_image',
'twitter_title',
'twitter_description',
'custom_template',
'locale',
'tags',
'authors',
'primary_tag',
'primary_author'
],
filter: 'status:published+type:page'
},
events: {
add: 'page.published',
update: 'page.published.edited',
remove: 'page.unpublished'
}
},
{
type: 'tags',
keep: ['id', 'slug'],
modelOptions: {
modelName: 'Tag',
exclude: [
'description',
'meta_title',
'meta_description',
'parent_id'
],
filter: 'visibility:public',
shouldHavePosts: {
joinTo: 'tag_id',
joinTable: 'posts_tags'
}
},
events: {
add: 'tag.added',
update: ['tag.edited', 'tag.attached', 'tag.detached'],
remove: 'tag.deleted'
}
},
{
type: 'authors',
modelOptions: {
modelName: 'User',
exclude: [
'bio',
'website',
'location',
'facebook',
'twitter',
'locale',
'accessibility',
'meta_title',
'meta_description',
'tour'
],
filter: 'visibility:public',
shouldHavePosts: {
joinTo: 'author_id',
joinTable: 'posts_authors'
}
},
events: {
add: 'user.activated',
update: ['user.activated.edited', 'user.attached', 'user.detached'],
remove: 'user.deleted'
}
}
];