2019-01-03 22:30:35 +03:00
|
|
|
/*
|
|
|
|
* These are the default resources and filters.
|
|
|
|
* They contain minimum filters for public accessibility of resources.
|
|
|
|
*/
|
|
|
|
|
|
|
|
module.exports = [
|
|
|
|
{
|
|
|
|
type: 'posts',
|
|
|
|
modelOptions: {
|
|
|
|
modelName: 'Post',
|
2019-10-20 21:56:47 +03:00
|
|
|
filter: 'status:published+type:post',
|
2019-01-03 22:30:35 +03:00
|
|
|
exclude: [
|
|
|
|
'title',
|
|
|
|
'mobiledoc',
|
|
|
|
'html',
|
|
|
|
'plaintext',
|
2019-01-04 22:05:50 +03:00
|
|
|
// @TODO: https://github.com/TryGhost/Ghost/issues/10335
|
|
|
|
// 'page',
|
2019-01-05 14:11:27 +03:00
|
|
|
'status',
|
2019-01-03 22:30:35 +03:00
|
|
|
'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',
|
2019-01-04 22:05:50 +03:00
|
|
|
// @TODO: https://github.com/TryGhost/Ghost/issues/10335
|
|
|
|
// 'page',
|
|
|
|
// 'status',
|
2019-01-03 22:30:35 +03:00
|
|
|
'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'
|
|
|
|
],
|
2019-10-20 21:56:47 +03:00
|
|
|
filter: 'status:published+type:page'
|
2019-01-03 22:30:35 +03:00
|
|
|
},
|
|
|
|
events: {
|
|
|
|
add: 'page.published',
|
|
|
|
update: 'page.published.edited',
|
|
|
|
remove: 'page.unpublished'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'tags',
|
2019-01-04 14:21:21 +03:00
|
|
|
keep: ['id', 'slug'],
|
2019-01-03 22:30:35 +03:00
|
|
|
modelOptions: {
|
|
|
|
modelName: 'Tag',
|
2019-01-04 14:21:21 +03:00
|
|
|
exclude: [
|
|
|
|
'description',
|
|
|
|
'meta_title',
|
|
|
|
'meta_description',
|
2019-04-09 10:13:07 +03:00
|
|
|
'parent_id'
|
2019-01-04 14:21:21 +03:00
|
|
|
],
|
2019-01-03 22:30:35 +03:00
|
|
|
filter: 'visibility:public',
|
|
|
|
shouldHavePosts: {
|
|
|
|
joinTo: 'tag_id',
|
|
|
|
joinTable: 'posts_tags'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
events: {
|
|
|
|
add: 'tag.added',
|
2019-01-08 12:48:53 +03:00
|
|
|
update: ['tag.edited', 'tag.attached', 'tag.detached'],
|
2019-01-03 22:30:35 +03:00
|
|
|
remove: 'tag.deleted'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'authors',
|
|
|
|
modelOptions: {
|
|
|
|
modelName: 'User',
|
|
|
|
exclude: [
|
|
|
|
'bio',
|
|
|
|
'website',
|
|
|
|
'location',
|
|
|
|
'facebook',
|
|
|
|
'twitter',
|
2019-01-04 14:21:21 +03:00
|
|
|
'locale',
|
2019-01-03 22:30:35 +03:00
|
|
|
'accessibility',
|
|
|
|
'meta_title',
|
|
|
|
'meta_description',
|
|
|
|
'tour'
|
|
|
|
],
|
|
|
|
filter: 'visibility:public',
|
|
|
|
shouldHavePosts: {
|
|
|
|
joinTo: 'author_id',
|
|
|
|
joinTable: 'posts_authors'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
events: {
|
|
|
|
add: 'user.activated',
|
2019-01-08 12:48:53 +03:00
|
|
|
update: ['user.activated.edited', 'user.attached', 'user.detached'],
|
2019-01-28 12:08:31 +03:00
|
|
|
remove: 'user.deleted'
|
2019-01-03 22:30:35 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
];
|