@basicbenframework/cms 0.7.2 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/db/migrations/043_add_private_content.js +32 -0
  2. package/db/migrations/044_add_post_autosave_key.js +20 -0
  3. package/lib/client/components/admin/MediaPicker.js +3 -1
  4. package/lib/client/components/admin/SnippetPicker.js +3 -1
  5. package/lib/client/components/admin/SocialImageField.d.ts +24 -0
  6. package/lib/client/components/admin/SocialImageField.js +70 -0
  7. package/lib/client/i18n/locales/es/content.js +2 -0
  8. package/lib/client/i18n/locales/es/editor.js +18 -1
  9. package/lib/client/pages/admin/Pages.js +2 -2
  10. package/lib/client/pages/admin/PostEditor.js +103 -9
  11. package/lib/client/pages/admin/Posts.js +2 -2
  12. package/lib/controllers/FeedController.js +2 -2
  13. package/lib/controllers/MediaController.js +18 -1
  14. package/lib/controllers/PageController.js +5 -1
  15. package/lib/controllers/PostController.d.ts +14 -0
  16. package/lib/controllers/PostController.js +83 -1
  17. package/lib/features/theme/ThemeController.js +7 -1
  18. package/lib/features/theme/templates.d.ts +6 -1
  19. package/lib/features/theme/templates.js +13 -2
  20. package/lib/helpers/autosave.d.ts +13 -0
  21. package/lib/helpers/autosave.js +19 -0
  22. package/lib/helpers/comment-mail.js +8 -3
  23. package/lib/helpers/redirects.d.ts +7 -1
  24. package/lib/helpers/redirects.js +7 -1
  25. package/lib/helpers/seo-fields.d.ts +7 -0
  26. package/lib/helpers/seo-fields.js +9 -0
  27. package/lib/models/Media.d.ts +4 -1
  28. package/lib/models/Media.js +18 -1
  29. package/lib/models/Menu.js +4 -4
  30. package/lib/models/Page.d.ts +2 -0
  31. package/lib/models/Page.js +6 -3
  32. package/lib/models/Post.d.ts +16 -0
  33. package/lib/models/Post.js +21 -1
  34. package/lib/models/PublicContent.d.ts +1 -1
  35. package/lib/models/PublicContent.js +5 -5
  36. package/lib/models/visibility.d.ts +9 -0
  37. package/lib/models/visibility.js +15 -1
  38. package/lib/routes/api/posts.js +3 -0
  39. package/lib/types/index.d.ts +4 -0
  40. package/package.json +1 -1
@@ -21,6 +21,9 @@ export default (router) => {
21
21
  router.post('/api/posts', contentWrite, requireCapability('post.create'), PostController.store);
22
22
  // Before the /:id routes, which would otherwise read `bulk` as an id.
23
23
  router.post('/api/posts/bulk', auth, PostController.bulk);
24
+ // The editor's first autosave of a post that has never been saved: a draft,
25
+ // from whatever has been typed so far. A person's, like autosave itself.
26
+ router.post('/api/posts/autosave', auth, requireCapability('post.create'), PostController.autosaveNew);
24
27
  router.get('/api/posts/:id', contentWrite, PostController.show);
25
28
  router.post('/api/posts/:id/restore', auth, PostController.restore);
26
29
  router.put('/api/posts/:id/autosave', auth, PostController.autosave);
@@ -83,6 +83,8 @@ export interface Post {
83
83
  noindex?: number | boolean;
84
84
  /** Who may read the body: `public`, or a level the access policy defines (helpers/access.ts). */
85
85
  visibility?: string;
86
+ /** 1 when private: published, but only for people who can edit it, in the admin (migration 043). */
87
+ is_private?: number | boolean;
86
88
  /** Written by the members feature: the author asked for this post to be emailed when it goes live. */
87
89
  send_newsletter?: number | boolean;
88
90
  /** Content type key (migration 038). `post` for every post that predates types. */
@@ -126,6 +128,8 @@ export interface Page {
126
128
  content_html?: string;
127
129
  template: string;
128
130
  published: boolean;
131
+ /** 1 when private: published, but only for people who can edit it, in the admin (migration 043). */
132
+ is_private?: number | boolean;
129
133
  parent_id?: number;
130
134
  menu_order: number;
131
135
  /** Foreign key into `media`. Not a filename — see `featured_image_url`. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basicbenframework/cms",
3
- "version": "0.7.2",
3
+ "version": "0.8.0",
4
4
  "type": "module",
5
5
  "description": "The BasicBen CMS. Posts, pages, media, an admin UI, and a headless content API.",
6
6
  "license": "MIT",