@kardalum/plugin-sdk 0.17.0 → 0.18.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.
- package/CHANGELOG.md +67 -0
- package/README.md +4 -3
- package/dist/assets/asset-picker.d.ts +11 -0
- package/dist/assets/asset-picker.js +109 -0
- package/dist/assets/asset-tree.d.ts +30 -0
- package/dist/assets/asset-tree.js +150 -0
- package/dist/built-in-editor-ids.d.ts +1 -0
- package/dist/built-in-editor-ids.js +20 -0
- package/dist/built-in-settings-schemas.d.ts +2 -0
- package/dist/built-in-settings-schemas.js +27 -0
- package/dist/built-in-value-schemas.js +3 -0
- package/dist/built-ins.js +10 -1
- package/dist/capabilities.js +5 -0
- package/dist/datatype-validation.js +18 -4
- package/dist/datatypes-entry.d.ts +1 -0
- package/dist/datatypes-entry.js +1 -0
- package/dist/entitlement-entry.d.ts +3 -2
- package/dist/entitlement-entry.js +13 -1
- package/dist/entitlement-gate.d.ts +18 -0
- package/dist/entitlement-gate.js +95 -21
- package/dist/entitlement-plan.d.ts +21 -0
- package/dist/entitlement-plan.js +26 -0
- package/dist/entitlement-types.d.ts +21 -4
- package/dist/entitlement.d.ts +29 -1
- package/dist/entitlement.js +39 -0
- package/dist/grid-arrow-step.d.ts +7 -0
- package/dist/grid-arrow-step.js +20 -0
- package/dist/index.d.ts +6 -1
- package/dist/index.js +7 -12
- package/dist/manifest-entry.d.ts +4 -0
- package/dist/manifest-entry.js +4 -0
- package/dist/manifest-schema.d.ts +5 -1
- package/dist/manifest-schema.js +7 -1
- package/dist/manifest.d.ts +21 -1
- package/dist/media/media-picker.js +32 -32
- package/dist/notify.d.ts +17 -0
- package/dist/notify.js +17 -0
- package/dist/richtext/block-panel.js +17 -18
- package/dist/richtext/extensions.js +10 -1
- package/dist/richtext/insert-menu.js +1 -1
- package/dist/richtext/kardalum-block.js +17 -17
- package/dist/richtext/style-listbox.js +1 -1
- package/dist/richtext-html-entry.d.ts +35 -0
- package/dist/richtext-html-entry.js +73 -0
- package/dist/structured-storage-types.d.ts +11 -0
- package/dist/tailwind.js +10 -3
- package/dist/tokens/tailwind-theme.css +176 -0
- package/dist/tokens/tokens.css +1 -0
- package/dist/tokens/tokens.json +2 -1
- package/dist/vendor-check.d.ts +39 -0
- package/dist/vendor-check.js +79 -0
- package/dist/vendor-entry.d.ts +3 -0
- package/dist/vendor-entry.js +9 -0
- package/dist/vendor-service.d.ts +20 -0
- package/dist/vendor-service.js +20 -0
- package/dist/views/asset-view.d.ts +6 -0
- package/dist/views/asset-view.js +55 -0
- package/dist/views/content-list-settings-view.js +1 -1
- package/dist/views/content-list-view.js +1 -1
- package/dist/views/html-code-editor.js +0 -1
- package/dist/views/image-view.js +1 -1
- package/dist/views/rich-text-view.js +30 -30
- package/node_modules/@kardalum/api-schemas/README.md +1 -1
- package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.js +16 -14
- package/node_modules/@kardalum/api-schemas/dist/asset-field.schema.d.ts +21 -0
- package/node_modules/@kardalum/api-schemas/dist/asset-field.schema.js +42 -0
- package/node_modules/@kardalum/api-schemas/dist/asset.schema.d.ts +1 -0
- package/node_modules/@kardalum/api-schemas/dist/asset.schema.js +10 -3
- package/node_modules/@kardalum/api-schemas/dist/checkout-shown.schema.d.ts +36 -0
- package/node_modules/@kardalum/api-schemas/dist/checkout-shown.schema.js +46 -0
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.d.ts +12 -0
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.js +16 -1
- package/node_modules/@kardalum/api-schemas/dist/core-actions.d.ts +12 -6
- package/node_modules/@kardalum/api-schemas/dist/core-actions.js +11 -6
- package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.d.ts +50 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.js +25 -5
- package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.d.ts +1 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.js +3 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-cursor.d.ts +11 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-cursor.js +28 -0
- package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +42 -2
- package/node_modules/@kardalum/api-schemas/dist/home.schema.d.ts +130 -0
- package/node_modules/@kardalum/api-schemas/dist/home.schema.js +87 -0
- package/node_modules/@kardalum/api-schemas/dist/index.d.ts +41 -15
- package/node_modules/@kardalum/api-schemas/dist/index.js +30 -10
- package/node_modules/@kardalum/api-schemas/dist/kardalum-latest.schema.d.ts +7 -0
- package/node_modules/@kardalum/api-schemas/dist/kardalum-latest.schema.js +9 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.d.ts +115 -1
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +102 -1
- package/node_modules/@kardalum/api-schemas/dist/marketplace-package-api.schema.d.ts +17 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-package-api.schema.js +16 -0
- package/node_modules/@kardalum/api-schemas/dist/media-api.schema.d.ts +26 -0
- package/node_modules/@kardalum/api-schemas/dist/media-api.schema.js +6 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference-use.d.ts +10 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference-use.js +4 -4
- package/node_modules/@kardalum/api-schemas/dist/news.schema.d.ts +93 -0
- package/node_modules/@kardalum/api-schemas/dist/news.schema.js +86 -0
- package/node_modules/@kardalum/api-schemas/dist/node-access.schema.js +13 -0
- package/node_modules/@kardalum/api-schemas/dist/notification.schema.d.ts +410 -0
- package/node_modules/@kardalum/api-schemas/dist/notification.schema.js +193 -0
- package/node_modules/@kardalum/api-schemas/dist/plan-editor.schema.d.ts +86 -0
- package/node_modules/@kardalum/api-schemas/dist/plan-editor.schema.js +92 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.d.ts +7 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.js +7 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.d.ts +227 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +157 -31
- package/node_modules/@kardalum/api-schemas/dist/plugin-read-only.schema.d.ts +19 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-read-only.schema.js +33 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-template-payload.d.ts +10 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-template-payload.js +24 -4
- package/node_modules/@kardalum/api-schemas/dist/public-api.schema.d.ts +5 -0
- package/node_modules/@kardalum/api-schemas/dist/public-api.schema.js +23 -20
- package/node_modules/@kardalum/api-schemas/dist/revenue-view.schema.d.ts +83 -0
- package/node_modules/@kardalum/api-schemas/dist/revenue-view.schema.js +73 -0
- package/node_modules/@kardalum/api-schemas/dist/sites.schema.d.ts +14 -0
- package/node_modules/@kardalum/api-schemas/dist/sites.schema.js +7 -0
- package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.d.ts +3 -3
- package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.d.ts +1 -1
- package/node_modules/@kardalum/api-schemas/dist/template-api.schema.d.ts +10 -0
- package/node_modules/@kardalum/api-schemas/dist/template-api.schema.js +26 -11
- package/node_modules/@kardalum/api-schemas/dist/template.schema.d.ts +7 -0
- package/node_modules/@kardalum/api-schemas/dist/template.schema.js +22 -10
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.d.ts +12 -0
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +5 -0
- package/node_modules/@kardalum/api-schemas/dist/uuid.schema.d.ts +2 -0
- package/node_modules/@kardalum/api-schemas/dist/uuid.schema.js +4 -0
- package/node_modules/@kardalum/api-schemas/dist/vendor-service.schema.d.ts +88 -0
- package/node_modules/@kardalum/api-schemas/dist/vendor-service.schema.js +100 -0
- package/node_modules/@kardalum/api-schemas/dist/whoami-api.schema.d.ts +13 -0
- package/node_modules/@kardalum/api-schemas/dist/whoami-api.schema.js +5 -0
- package/node_modules/@kardalum/design-tokens/README.md +1 -1
- package/node_modules/@kardalum/design-tokens/dist/build-theme-css.d.ts +16 -0
- package/node_modules/@kardalum/design-tokens/dist/build-theme-css.js +76 -0
- package/node_modules/@kardalum/design-tokens/dist/generate.js +4 -1
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.css +176 -0
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.d.ts +1 -1
- package/node_modules/@kardalum/design-tokens/dist/tokens.css +1 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.js +1 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.json +2 -1
- package/node_modules/@kardalum/design-tokens/dist/types.d.ts +1 -0
- package/node_modules/@kardalum/design-tokens/package.json +6 -3
- package/node_modules/@kardalum/plugin-package/README.md +1 -1
- package/node_modules/@kardalum/plugin-package/dist/capabilities.d.ts +4 -4
- package/node_modules/@kardalum/plugin-package/dist/capabilities.js +54 -6
- package/node_modules/@kardalum/plugin-package/dist/delivery/bundle.js +1 -1
- package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.d.ts +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.js +18 -1
- package/node_modules/@kardalum/plugin-package/dist/delivery/limits.d.ts +1 -1
- package/node_modules/@kardalum/plugin-package/dist/delivery/limits.js +1 -1
- package/node_modules/@kardalum/plugin-package/dist/delivery/registry.js +8 -4
- package/node_modules/@kardalum/plugin-package/dist/delivery/templates.d.ts +1 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/templates.js +58 -1
- package/node_modules/@kardalum/plugin-package/dist/extract.js +1 -1
- package/node_modules/@kardalum/plugin-package/dist/index.d.ts +4 -2
- package/node_modules/@kardalum/plugin-package/dist/index.js +3 -1
- package/node_modules/@kardalum/plugin-package/dist/license-verdict.d.ts +56 -19
- package/node_modules/@kardalum/plugin-package/dist/license-verdict.js +119 -25
- package/node_modules/@kardalum/plugin-package/dist/vendor-token.d.ts +24 -0
- package/node_modules/@kardalum/plugin-package/dist/vendor-token.js +118 -0
- package/node_modules/@kardalum/ui/README.md +1 -1
- package/node_modules/@kardalum/ui/dist/components/button.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/checkbox.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/dialog.js +5 -2
- package/node_modules/@kardalum/ui/dist/components/dropdown-menu.js +2 -2
- package/node_modules/@kardalum/ui/dist/components/input.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/popover-panel.d.ts +4 -0
- package/node_modules/@kardalum/ui/dist/components/popover-panel.js +13 -0
- package/node_modules/@kardalum/ui/dist/components/sheet.js +5 -4
- package/node_modules/@kardalum/ui/dist/components/switch.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/tab-strip.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/toast.js +1 -1
- package/node_modules/@kardalum/ui/dist/index.d.ts +1 -0
- package/node_modules/@kardalum/ui/dist/index.js +1 -0
- package/package.json +17 -4
|
@@ -20,7 +20,7 @@ export declare const CORE_ACTIONS: readonly [{
|
|
|
20
20
|
readonly adminGatedToday: false;
|
|
21
21
|
readonly label: "View content and mint preview links";
|
|
22
22
|
readonly keyNote: "On the management API this also reads drafts, every saved version and preview links, not only published content.";
|
|
23
|
-
readonly route: "GET /api/manage/v1/content/by-path, GET /api/manage/v1/content/by-address, GET /api/manage/v1/content/:id, GET /api/manage/v1/content/roots, GET /api/manage/v1/content/:id/children, GET /api/manage/v1/content/:id/list, GET /api/manage/v1/content/:id/url-impact, GET /api/manage/v1/content/:id/move-impact, GET /api/manage/v1/content/:id/versions, GET /api/manage/v1/content/:id/versions/latest, GET /api/manage/v1/content/:id/versions/:version, POST /api/manage/v1/content/:id/preview-token, GET /api/plugins/:pluginId/storage/:contentId/:fieldId";
|
|
23
|
+
readonly route: "GET /api/manage/v1/content/by-path, GET /api/manage/v1/content/by-address, GET /api/manage/v1/content/:id, GET /api/manage/v1/content/roots, GET /api/manage/v1/content/:id/children, GET /api/manage/v1/content/:id/list, GET /api/manage/v1/content/:id/url-impact, GET /api/manage/v1/content/:id/move-impact, GET /api/manage/v1/content/:id/versions, GET /api/manage/v1/content/:id/versions/latest, GET /api/manage/v1/content/:id/versions/:version, POST /api/manage/v1/content/:id/preview-token, GET /api/manage/v1/home/drafts, GET /api/manage/v1/home/recent-edits, GET /api/manage/v1/home/published, GET /api/plugins/:pluginId/storage/:contentId/:fieldId";
|
|
24
24
|
}, {
|
|
25
25
|
readonly action: "content.create";
|
|
26
26
|
readonly adminGatedToday: false;
|
|
@@ -45,7 +45,7 @@ export declare const CORE_ACTIONS: readonly [{
|
|
|
45
45
|
readonly action: "content.readTrash";
|
|
46
46
|
readonly adminGatedToday: true;
|
|
47
47
|
readonly label: "View trashed content";
|
|
48
|
-
readonly route: "GET /api/manage/v1/content/trash";
|
|
48
|
+
readonly route: "GET /api/manage/v1/content/trash, GET /api/manage/v1/home/trash-count";
|
|
49
49
|
}, {
|
|
50
50
|
readonly action: "content.restore";
|
|
51
51
|
readonly adminGatedToday: true;
|
|
@@ -213,12 +213,12 @@ export declare const CORE_ACTIONS: readonly [{
|
|
|
213
213
|
readonly action: "settings.read";
|
|
214
214
|
readonly adminGatedToday: false;
|
|
215
215
|
readonly label: "View settings";
|
|
216
|
-
readonly route: "GET /api/manage/v1/settings/render, GET /api/manage/v1/settings/cultures, GET /api/manage/v1/settings/sites, GET /api/manage/v1/settings/nav, GET /api/manage/v1/settings/audit-retention";
|
|
216
|
+
readonly route: "GET /api/manage/v1/settings/render, GET /api/manage/v1/settings/cultures, GET /api/manage/v1/settings/sites, GET /api/manage/v1/settings/nav, GET /api/manage/v1/settings/audit-retention, GET /api/manage/v1/home/news, GET /api/manage/v1/settings/notification-retention";
|
|
217
217
|
}, {
|
|
218
218
|
readonly action: "settings.update";
|
|
219
219
|
readonly adminGatedToday: true;
|
|
220
220
|
readonly label: "Change settings";
|
|
221
|
-
readonly route: "PUT /api/manage/v1/settings/render, PUT /api/manage/v1/settings/cultures, PUT /api/manage/v1/settings/nav";
|
|
221
|
+
readonly route: "PUT /api/manage/v1/settings/render, PUT /api/manage/v1/settings/cultures, PUT /api/manage/v1/settings/nav, PUT /api/manage/v1/settings/notification-retention";
|
|
222
222
|
}, {
|
|
223
223
|
readonly action: "sites.manage";
|
|
224
224
|
readonly adminGatedToday: true;
|
|
@@ -315,6 +315,12 @@ export declare const CORE_ACTIONS: readonly [{
|
|
|
315
315
|
readonly label: "Set audit log retention and remove archived months";
|
|
316
316
|
readonly keyNote: "A key is refused here: retention and pruning take a session, so this matters only to a session's role.";
|
|
317
317
|
readonly route: "PUT /api/manage/v1/settings/audit-retention, POST /api/manage/v1/audit/prune";
|
|
318
|
+
}, {
|
|
319
|
+
readonly action: "notifications.send";
|
|
320
|
+
readonly adminGatedToday: false;
|
|
321
|
+
readonly label: "Send notifications";
|
|
322
|
+
readonly keyNote: "Sends a notification to the inbox of everyone who holds the roles it names, and of the people it names, and lists every role and person to choose from.";
|
|
323
|
+
readonly route: "POST /api/manage/v1/notifications, GET /api/manage/v1/notifications/audience, POST /api/manage/v1/notifications/reach";
|
|
318
324
|
}, {
|
|
319
325
|
readonly action: "managementApi.use";
|
|
320
326
|
readonly adminGatedToday: true;
|
|
@@ -325,7 +331,7 @@ export declare const CORE_ACTIONS: readonly [{
|
|
|
325
331
|
readonly action: "plugins.read";
|
|
326
332
|
readonly adminGatedToday: true;
|
|
327
333
|
readonly label: "View installed plugins";
|
|
328
|
-
readonly route: "GET /api/manage/v1/plugins, GET /api/manage/v1/marketplace/status, GET /api/manage/v1/plugins/:pluginId/snapshot-groups, GET /api/manage/v1/plugins/:pluginId/install-record, GET /api/manage/v1/plugin-docs, GET /api/manage/v1/plugin-docs/search-index, GET /api/manage/v1/plugin-docs/:pluginId/pages/:slug, GET /api/manage/v1/plugin-docs/:pluginId/reference";
|
|
334
|
+
readonly route: "GET /api/manage/v1/plugins, GET /api/manage/v1/marketplace/status, GET /api/manage/v1/plugins/:pluginId/snapshot-groups, GET /api/manage/v1/plugins/:pluginId/install-record, GET /api/manage/v1/plugin-docs, GET /api/manage/v1/plugin-docs/search-index, GET /api/manage/v1/plugin-docs/:pluginId/pages/:slug, GET /api/manage/v1/plugin-docs/:pluginId/reference, GET /api/manage/v1/home/plugin-fees";
|
|
329
335
|
}, {
|
|
330
336
|
readonly action: "plugins.browse";
|
|
331
337
|
readonly adminGatedToday: true;
|
|
@@ -352,7 +358,7 @@ export declare const CORE_ACTIONS: readonly [{
|
|
|
352
358
|
readonly action: "plugins.restore";
|
|
353
359
|
readonly adminGatedToday: true;
|
|
354
360
|
readonly label: "Restore a plugin from a snapshot";
|
|
355
|
-
readonly route: "POST /api/manage/v1/plugins/:pluginId/snapshot-groups/restore";
|
|
361
|
+
readonly route: "POST /api/manage/v1/plugins/:pluginId/snapshot-groups/restore, POST /api/manage/v1/plugins/:pluginId/data-types/restore";
|
|
356
362
|
}, {
|
|
357
363
|
readonly action: "snapshots.read";
|
|
358
364
|
readonly adminGatedToday: true;
|
|
@@ -28,12 +28,12 @@
|
|
|
28
28
|
// string. The role editor renders this, the same way CAPABILITY_LABELS
|
|
29
29
|
// renders capabilities.
|
|
30
30
|
export const CORE_ACTIONS = [
|
|
31
|
-
{ action: "content.read", adminGatedToday: false, label: "View content and mint preview links", keyNote: "On the management API this also reads drafts, every saved version and preview links, not only published content.", route: "GET /api/manage/v1/content/by-path, GET /api/manage/v1/content/by-address, GET /api/manage/v1/content/:id, GET /api/manage/v1/content/roots, GET /api/manage/v1/content/:id/children, GET /api/manage/v1/content/:id/list, GET /api/manage/v1/content/:id/url-impact, GET /api/manage/v1/content/:id/move-impact, GET /api/manage/v1/content/:id/versions, GET /api/manage/v1/content/:id/versions/latest, GET /api/manage/v1/content/:id/versions/:version, POST /api/manage/v1/content/:id/preview-token, GET /api/plugins/:pluginId/storage/:contentId/:fieldId" },
|
|
31
|
+
{ action: "content.read", adminGatedToday: false, label: "View content and mint preview links", keyNote: "On the management API this also reads drafts, every saved version and preview links, not only published content.", route: "GET /api/manage/v1/content/by-path, GET /api/manage/v1/content/by-address, GET /api/manage/v1/content/:id, GET /api/manage/v1/content/roots, GET /api/manage/v1/content/:id/children, GET /api/manage/v1/content/:id/list, GET /api/manage/v1/content/:id/url-impact, GET /api/manage/v1/content/:id/move-impact, GET /api/manage/v1/content/:id/versions, GET /api/manage/v1/content/:id/versions/latest, GET /api/manage/v1/content/:id/versions/:version, POST /api/manage/v1/content/:id/preview-token, GET /api/manage/v1/home/drafts, GET /api/manage/v1/home/recent-edits, GET /api/manage/v1/home/published, GET /api/plugins/:pluginId/storage/:contentId/:fieldId" },
|
|
32
32
|
{ action: "content.create", adminGatedToday: false, label: "Create and copy content", route: "POST /api/manage/v1/content, POST /api/manage/v1/content/:id/copy" },
|
|
33
33
|
{ action: "content.update", adminGatedToday: false, label: "Edit, move and reorder content", route: "PUT /api/manage/v1/content/:id, POST /api/manage/v1/content/:id/move, POST /api/manage/v1/content/roots/reorder, POST /api/manage/v1/content/:id/children/reorder, PUT /api/plugins/:pluginId/storage/:contentId/:fieldId" },
|
|
34
34
|
{ action: "content.publish", adminGatedToday: false, label: "Publish content", route: "POST /api/manage/v1/content/:id/publish, POST /api/manage/v1/content/:id/publish-all" },
|
|
35
35
|
{ action: "content.delete", adminGatedToday: true, label: "Move content to the trash", route: "DELETE /api/manage/v1/content/:id" },
|
|
36
|
-
{ action: "content.readTrash", adminGatedToday: true, label: "View trashed content", route: "GET /api/manage/v1/content/trash" },
|
|
36
|
+
{ action: "content.readTrash", adminGatedToday: true, label: "View trashed content", route: "GET /api/manage/v1/content/trash, GET /api/manage/v1/home/trash-count" },
|
|
37
37
|
{ action: "content.restore", adminGatedToday: true, label: "Restore trashed content", route: "POST /api/manage/v1/content/:id/restore" },
|
|
38
38
|
// S278: reading and saving a node's restrictions, and the search for the
|
|
39
39
|
// roles and users a restriction can name. New with the permissions tab, so
|
|
@@ -75,8 +75,8 @@ export const CORE_ACTIONS = [
|
|
|
75
75
|
{ action: "render.preview", adminGatedToday: true, label: "Render a block preview", route: "POST /api/manage/v1/render/block" },
|
|
76
76
|
// S300a: the app bar's order read in the shell (GET /api/settings/nav) is open to every signed-in user on purpose (S281) and asks no action;
|
|
77
77
|
// its management read (GET /api/manage/v1/settings/nav, S309) asks settings.read, and its write is settings.update.
|
|
78
|
-
{ action: "settings.read", adminGatedToday: false, label: "View settings", route: "GET /api/manage/v1/settings/render, GET /api/manage/v1/settings/cultures, GET /api/manage/v1/settings/sites, GET /api/manage/v1/settings/nav, GET /api/manage/v1/settings/audit-retention" },
|
|
79
|
-
{ action: "settings.update", adminGatedToday: true, label: "Change settings", route: "PUT /api/manage/v1/settings/render, PUT /api/manage/v1/settings/cultures, PUT /api/manage/v1/settings/nav" },
|
|
78
|
+
{ action: "settings.read", adminGatedToday: false, label: "View settings", route: "GET /api/manage/v1/settings/render, GET /api/manage/v1/settings/cultures, GET /api/manage/v1/settings/sites, GET /api/manage/v1/settings/nav, GET /api/manage/v1/settings/audit-retention, GET /api/manage/v1/home/news, GET /api/manage/v1/settings/notification-retention" },
|
|
79
|
+
{ action: "settings.update", adminGatedToday: true, label: "Change settings", route: "PUT /api/manage/v1/settings/render, PUT /api/manage/v1/settings/cultures, PUT /api/manage/v1/settings/nav, PUT /api/manage/v1/settings/notification-retention" },
|
|
80
80
|
// S277d: a site's domains and the choice of default site. New with the
|
|
81
81
|
// Site tab, so there was no earlier gate to read; admin-gated because it
|
|
82
82
|
// decides which content every address of the install shows.
|
|
@@ -110,6 +110,11 @@ export const CORE_ACTIONS = [
|
|
|
110
110
|
// refuses every key, so no script removes entries; the note says so. Reading the setting
|
|
111
111
|
// asks settings.read.
|
|
112
112
|
{ action: "audit.prune", adminGatedToday: true, label: "Set audit log retention and remove archived months", keyNote: "A key is refused here: retention and pruning take a session, so this matters only to a session's role.", route: "PUT /api/manage/v1/settings/audit-retention, POST /api/manage/v1/audit/prune" },
|
|
113
|
+
// S314n2 (3b): sending a notification to roles and people, and the two reads the
|
|
114
|
+
// compose sheet asks (the audience search and the reach). Not admin-gated, so the
|
|
115
|
+
// seeded editor is offered it (EDITOR_ACTIONS_ADDED_AFTER_SEED in seed-roles.ts); a
|
|
116
|
+
// site's administrator grants it to any other role on the Roles screen.
|
|
117
|
+
{ action: "notifications.send", adminGatedToday: false, label: "Send notifications", keyNote: "Sends a notification to the inbox of everyone who holds the roles it names, and of the people it names, and lists every role and person to choose from.", route: "POST /api/manage/v1/notifications, GET /api/manage/v1/notifications/audience, POST /api/manage/v1/notifications/reach" },
|
|
113
118
|
// Row C2 of 2026-10-16-s300a-management-routes-the-structure-side-design.md
|
|
114
119
|
// (section 4b): what an API key must hold, beside the route's own action, to
|
|
115
120
|
// reach any route under /api/manage/v1, hence the wildcard. requireAction
|
|
@@ -123,12 +128,12 @@ export const CORE_ACTIONS = [
|
|
|
123
128
|
label: "Let API keys use the management API", keyNote: "Lets a key call the management API with the actions it also holds. Never give it to a key that ships in a browser.",
|
|
124
129
|
route: "GET /api/manage/v1/*, POST /api/manage/v1/*, PUT /api/manage/v1/*, PATCH /api/manage/v1/*, DELETE /api/manage/v1/*",
|
|
125
130
|
},
|
|
126
|
-
{ action: "plugins.read", adminGatedToday: true, label: "View installed plugins", route: "GET /api/manage/v1/plugins, GET /api/manage/v1/marketplace/status, GET /api/manage/v1/plugins/:pluginId/snapshot-groups, GET /api/manage/v1/plugins/:pluginId/install-record, GET /api/manage/v1/plugin-docs, GET /api/manage/v1/plugin-docs/search-index, GET /api/manage/v1/plugin-docs/:pluginId/pages/:slug, GET /api/manage/v1/plugin-docs/:pluginId/reference" },
|
|
131
|
+
{ action: "plugins.read", adminGatedToday: true, label: "View installed plugins", route: "GET /api/manage/v1/plugins, GET /api/manage/v1/marketplace/status, GET /api/manage/v1/plugins/:pluginId/snapshot-groups, GET /api/manage/v1/plugins/:pluginId/install-record, GET /api/manage/v1/plugin-docs, GET /api/manage/v1/plugin-docs/search-index, GET /api/manage/v1/plugin-docs/:pluginId/pages/:slug, GET /api/manage/v1/plugin-docs/:pluginId/reference, GET /api/manage/v1/home/plugin-fees" },
|
|
127
132
|
{ action: "plugins.browse", adminGatedToday: true, label: "Browse the plugin marketplace", route: "GET /api/manage/v1/marketplace/listings, GET /api/manage/v1/marketplace/listings/:pluginId" },
|
|
128
133
|
{ action: "plugins.install", adminGatedToday: true, label: "Install plugins", keyNote: "Puts code into the server process. An unsigned package is not refused.", route: "POST /api/manage/v1/marketplace/install, POST /api/manage/v1/plugins/upload" },
|
|
129
134
|
{ action: "plugins.update", adminGatedToday: true, label: "Enable or disable plugins", route: "POST /api/manage/v1/plugins/:pluginId/activate, POST /api/manage/v1/plugins/:pluginId/deactivate, POST /api/manage/v1/plugins/:pluginId/license/recheck" },
|
|
130
135
|
{ action: "plugins.delete", adminGatedToday: true, label: "Uninstall plugins", keyNote: "Removes an installed plugin from the site.", route: "DELETE /api/manage/v1/plugins/:pluginId" },
|
|
131
|
-
{ action: "plugins.restore", adminGatedToday: true, label: "Restore a plugin from a snapshot", route: "POST /api/manage/v1/plugins/:pluginId/snapshot-groups/restore" },
|
|
136
|
+
{ action: "plugins.restore", adminGatedToday: true, label: "Restore a plugin from a snapshot", route: "POST /api/manage/v1/plugins/:pluginId/snapshot-groups/restore, POST /api/manage/v1/plugins/:pluginId/data-types/restore" },
|
|
132
137
|
{ action: "snapshots.read", adminGatedToday: true, label: "View snapshots", route: "GET /api/manage/v1/snapshots" },
|
|
133
138
|
{ action: "snapshots.create", adminGatedToday: true, label: "Create snapshots", route: "POST /api/manage/v1/snapshots" },
|
|
134
139
|
{ action: "snapshots.restore", adminGatedToday: true, label: "Restore a snapshot", route: "POST /api/manage/v1/snapshots/:id/restore" },
|
|
@@ -25,12 +25,62 @@ export declare const DataTypeListQuerySchema: z.ZodObject<{
|
|
|
25
25
|
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
26
26
|
}, z.core.$strip>;
|
|
27
27
|
export type DataTypeListQuery = z.infer<typeof DataTypeListQuerySchema>;
|
|
28
|
+
export declare const DataTypeEditorPluginSchema: z.ZodObject<{
|
|
29
|
+
readOnly: z.ZodOptional<z.ZodObject<{
|
|
30
|
+
code: z.ZodLiteral<"plugin_read_only">;
|
|
31
|
+
pluginId: z.ZodString;
|
|
32
|
+
pluginName: z.ZodString;
|
|
33
|
+
canRenew: z.ZodBoolean;
|
|
34
|
+
message: z.ZodString;
|
|
35
|
+
renewUrl: z.ZodOptional<z.ZodString>;
|
|
36
|
+
lapsedAt: z.ZodOptional<z.ZodString>;
|
|
37
|
+
}, z.core.$strip>>;
|
|
38
|
+
pluginId: z.ZodString;
|
|
39
|
+
name: z.ZodString;
|
|
40
|
+
enabled: z.ZodBoolean;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
export type DataTypeEditorPlugin = z.infer<typeof DataTypeEditorPluginSchema>;
|
|
43
|
+
export declare const DataTypeListItemSchema: z.ZodObject<{
|
|
44
|
+
id: z.ZodString;
|
|
45
|
+
name: z.ZodString;
|
|
46
|
+
editorId: z.ZodString;
|
|
47
|
+
settings: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
48
|
+
editorPlugin: z.ZodOptional<z.ZodObject<{
|
|
49
|
+
readOnly: z.ZodOptional<z.ZodObject<{
|
|
50
|
+
code: z.ZodLiteral<"plugin_read_only">;
|
|
51
|
+
pluginId: z.ZodString;
|
|
52
|
+
pluginName: z.ZodString;
|
|
53
|
+
canRenew: z.ZodBoolean;
|
|
54
|
+
message: z.ZodString;
|
|
55
|
+
renewUrl: z.ZodOptional<z.ZodString>;
|
|
56
|
+
lapsedAt: z.ZodOptional<z.ZodString>;
|
|
57
|
+
}, z.core.$strip>>;
|
|
58
|
+
pluginId: z.ZodString;
|
|
59
|
+
name: z.ZodString;
|
|
60
|
+
enabled: z.ZodBoolean;
|
|
61
|
+
}, z.core.$strip>>;
|
|
62
|
+
}, z.core.$strict>;
|
|
63
|
+
export type DataTypeListItem = z.infer<typeof DataTypeListItemSchema>;
|
|
28
64
|
export declare const DataTypeListResponseSchema: z.ZodObject<{
|
|
29
65
|
items: z.ZodArray<z.ZodObject<{
|
|
30
66
|
id: z.ZodString;
|
|
31
67
|
name: z.ZodString;
|
|
32
68
|
editorId: z.ZodString;
|
|
33
69
|
settings: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
70
|
+
editorPlugin: z.ZodOptional<z.ZodObject<{
|
|
71
|
+
readOnly: z.ZodOptional<z.ZodObject<{
|
|
72
|
+
code: z.ZodLiteral<"plugin_read_only">;
|
|
73
|
+
pluginId: z.ZodString;
|
|
74
|
+
pluginName: z.ZodString;
|
|
75
|
+
canRenew: z.ZodBoolean;
|
|
76
|
+
message: z.ZodString;
|
|
77
|
+
renewUrl: z.ZodOptional<z.ZodString>;
|
|
78
|
+
lapsedAt: z.ZodOptional<z.ZodString>;
|
|
79
|
+
}, z.core.$strip>>;
|
|
80
|
+
pluginId: z.ZodString;
|
|
81
|
+
name: z.ZodString;
|
|
82
|
+
enabled: z.ZodBoolean;
|
|
83
|
+
}, z.core.$strip>>;
|
|
34
84
|
}, z.core.$strict>>;
|
|
35
85
|
nextCursor: z.ZodNullable<z.ZodString>;
|
|
36
86
|
}, z.core.$strip>;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { PluginReadOnlyNoticeSchema } from "./plugin-read-only.schema.js";
|
|
2
3
|
import { DataTypeConfigSchema } from "./data-type-config.schema.js";
|
|
4
|
+
import { DATA_TYPE_CURSOR_MAX, decodeDataTypeCursor } from "./data-type-cursor.js";
|
|
3
5
|
export const CreateDataTypeRequestSchema = z
|
|
4
6
|
.object({
|
|
5
7
|
name: z.string().min(1),
|
|
@@ -19,14 +21,32 @@ export const UpdateDataTypeRequestSchema = z
|
|
|
19
21
|
export const DataTypeResponseSchema = z.object({
|
|
20
22
|
dataType: DataTypeConfigSchema,
|
|
21
23
|
});
|
|
22
|
-
// Ordered name ASC (id ASC tiebreak) for the Settings tree
|
|
23
|
-
// of the previous page's last
|
|
24
|
+
// Ordered name ASC (id ASC tiebreak) for the Settings tree. S314c5 (D3): the cursor is opaque
|
|
25
|
+
// (dataTypeCursor of the previous page's last row); one that does not decode is a 400.
|
|
24
26
|
export const DataTypeListQuerySchema = z.object({
|
|
25
|
-
cursor: z
|
|
27
|
+
cursor: z
|
|
28
|
+
.string()
|
|
29
|
+
.max(DATA_TYPE_CURSOR_MAX)
|
|
30
|
+
.refine((value) => decodeDataTypeCursor(value) !== null, { message: "Not a data type list cursor" })
|
|
31
|
+
.optional(),
|
|
26
32
|
limit: z.coerce.number().int().min(1).max(100).default(50),
|
|
27
33
|
});
|
|
34
|
+
// S314o3 (D3, D4): the plugin a data type's editor comes from, as the list names it: its id, its
|
|
35
|
+
// name and whether it is switched on. Absent for a built-in editor and for an editor no installed
|
|
36
|
+
// plugin contributes. A data type whose plugin is off cannot be used for a new field, and the
|
|
37
|
+
// admin's pickers say so.
|
|
38
|
+
export const DataTypeEditorPluginSchema = z.object({
|
|
39
|
+
// S318: present only when the plugin is read-only.
|
|
40
|
+
readOnly: PluginReadOnlyNoticeSchema.optional(),
|
|
41
|
+
pluginId: z.string(),
|
|
42
|
+
name: z.string(),
|
|
43
|
+
enabled: z.boolean(),
|
|
44
|
+
});
|
|
45
|
+
export const DataTypeListItemSchema = DataTypeConfigSchema.extend({
|
|
46
|
+
editorPlugin: DataTypeEditorPluginSchema.optional(),
|
|
47
|
+
}).strict();
|
|
28
48
|
export const DataTypeListResponseSchema = z.object({
|
|
29
|
-
items: z.array(
|
|
49
|
+
items: z.array(DataTypeListItemSchema),
|
|
30
50
|
// null = no more pages.
|
|
31
|
-
nextCursor: z.string().
|
|
51
|
+
nextCursor: z.string().nullable(),
|
|
32
52
|
});
|
|
@@ -6,4 +6,5 @@ export declare const DataTypeConfigSchema: z.ZodObject<{
|
|
|
6
6
|
settings: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
7
7
|
}, z.core.$strict>;
|
|
8
8
|
export type DataTypeConfig = z.infer<typeof DataTypeConfigSchema>;
|
|
9
|
+
export declare const RICHTEXT_EDITOR_ID = "com.kardalum.richtext";
|
|
9
10
|
export declare const BUILT_IN_DATA_TYPE_CONFIGS: readonly DataTypeConfig[];
|
|
@@ -17,6 +17,9 @@ export const DataTypeConfigSchema = z
|
|
|
17
17
|
settings: z.record(z.string(), z.unknown()).default({}),
|
|
18
18
|
})
|
|
19
19
|
.strict();
|
|
20
|
+
// S314p (D1): the rich text editor's id, which the server's content writes look for when a value
|
|
21
|
+
// arrives as HTML.
|
|
22
|
+
export const RICHTEXT_EDITOR_ID = "com.kardalum.richtext";
|
|
20
23
|
// Every built-in editor seeds one default config in migration
|
|
21
24
|
// 0006_data_types, with these FIXED ids — the single source of truth
|
|
22
25
|
// shared by the migrations, tests, and any code that needs "the plain
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** The longest cursor decoded: a name and an id fit far inside it, and a longer string is not read. */
|
|
2
|
+
export declare const DATA_TYPE_CURSOR_MAX = 8192;
|
|
3
|
+
export declare function dataTypeCursor(row: {
|
|
4
|
+
name: string;
|
|
5
|
+
id: string;
|
|
6
|
+
}): string;
|
|
7
|
+
/** Null for anything this module did not mint: never throws, so a typed cursor is a 400, never a 500. */
|
|
8
|
+
export declare function decodeDataTypeCursor(cursor: string): {
|
|
9
|
+
name: string;
|
|
10
|
+
id: string;
|
|
11
|
+
} | null;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { base64UrlDecode, base64UrlEncode, utf8Bytes, utf8String } from "./media-reference-use.js";
|
|
2
|
+
// S314c5 (D3): the data type list is ordered by (name, id), so its cursor carries both of the
|
|
3
|
+
// previous page's last row. A cursor that named only the id looked the name up again, and a
|
|
4
|
+
// deleted cursor row then gave an empty page. Opaque, base64url of a JSON pair as the media
|
|
5
|
+
// reference cursor is: a name may hold any character, so no separator is safe. Minted here and
|
|
6
|
+
// decoded by the adapter and the list query; nothing else parses it.
|
|
7
|
+
/** The longest cursor decoded: a name and an id fit far inside it, and a longer string is not read. */
|
|
8
|
+
export const DATA_TYPE_CURSOR_MAX = 8192;
|
|
9
|
+
export function dataTypeCursor(row) {
|
|
10
|
+
return base64UrlEncode(utf8Bytes(JSON.stringify([row.name, row.id])));
|
|
11
|
+
}
|
|
12
|
+
/** Null for anything this module did not mint: never throws, so a typed cursor is a 400, never a 500. */
|
|
13
|
+
export function decodeDataTypeCursor(cursor) {
|
|
14
|
+
if (cursor.length === 0 || cursor.length > DATA_TYPE_CURSOR_MAX)
|
|
15
|
+
return null;
|
|
16
|
+
try {
|
|
17
|
+
const bytes = base64UrlDecode(cursor);
|
|
18
|
+
if (!bytes)
|
|
19
|
+
return null;
|
|
20
|
+
const parsed = JSON.parse(utf8String(bytes));
|
|
21
|
+
if (!Array.isArray(parsed) || parsed.length !== 2 || typeof parsed[0] !== "string" || typeof parsed[1] !== "string")
|
|
22
|
+
return null;
|
|
23
|
+
return { name: parsed[0], id: parsed[1] };
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -88,7 +88,28 @@ export const CreateDocumentTypeRequestSchema = z
|
|
|
88
88
|
})
|
|
89
89
|
.strict(),
|
|
90
90
|
])
|
|
91
|
-
.superRefine(validateFieldsAndTabs)
|
|
91
|
+
.superRefine(validateFieldsAndTabs)
|
|
92
|
+
// S314c6 (D6): a generated field names a tab id the generated (empty) tab list does not
|
|
93
|
+
// declare, which the refinement refuses; the example declares the tab its field sits on.
|
|
94
|
+
.meta({
|
|
95
|
+
example: {
|
|
96
|
+
name: "Article",
|
|
97
|
+
icon: "document",
|
|
98
|
+
kind: "page",
|
|
99
|
+
fields: [
|
|
100
|
+
{
|
|
101
|
+
id: "title",
|
|
102
|
+
name: "Title",
|
|
103
|
+
datatypeId: "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
|
|
104
|
+
validation: { required: true, maxLength: 120 },
|
|
105
|
+
tabId: "f47ac10b-58cc-4372-a567-0e02b2c3d479",
|
|
106
|
+
varies: true,
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
treeRules: { allowedAtRoot: true, allowedParentTypes: [], allowedChildTypes: [] },
|
|
110
|
+
tabs: [{ id: "f47ac10b-58cc-4372-a567-0e02b2c3d479", name: "Content" }],
|
|
111
|
+
},
|
|
112
|
+
});
|
|
92
113
|
// PUT /api/manage/v1/document-types/:id: the mutable subset only. `kind` is
|
|
93
114
|
// immutable after creation (a payload carrying it fails .strict() — the
|
|
94
115
|
// intended behavior, not an accident) and `defaultTemplateId` stays with
|
|
@@ -121,7 +142,26 @@ export const UpdateDocumentTypeRequestSchema = z
|
|
|
121
142
|
catchAll: z.boolean().optional(),
|
|
122
143
|
})
|
|
123
144
|
.strict()
|
|
124
|
-
.superRefine(validateFieldsAndTabs)
|
|
145
|
+
.superRefine(validateFieldsAndTabs)
|
|
146
|
+
// S314c6 (D6): as on create, the example declares the tab its field sits on.
|
|
147
|
+
.meta({
|
|
148
|
+
example: {
|
|
149
|
+
name: "Article",
|
|
150
|
+
icon: "document",
|
|
151
|
+
fields: [
|
|
152
|
+
{
|
|
153
|
+
id: "title",
|
|
154
|
+
name: "Title",
|
|
155
|
+
datatypeId: "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
|
|
156
|
+
validation: { required: true, maxLength: 120 },
|
|
157
|
+
tabId: "f47ac10b-58cc-4372-a567-0e02b2c3d479",
|
|
158
|
+
varies: true,
|
|
159
|
+
}
|
|
160
|
+
],
|
|
161
|
+
tabs: [{ id: "f47ac10b-58cc-4372-a567-0e02b2c3d479", name: "Content" }],
|
|
162
|
+
treeRules: { allowedAtRoot: true, allowedParentTypes: [], allowedChildTypes: [] },
|
|
163
|
+
},
|
|
164
|
+
});
|
|
125
165
|
export const CreateDocumentTypeResponseSchema = z.object({
|
|
126
166
|
documentType: DocumentTypeDefinitionSchema,
|
|
127
167
|
});
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** The most rows a Home list shows (D4). */
|
|
3
|
+
export declare const HOME_LIST_ROWS = 5;
|
|
4
|
+
/** The highest count Home states exactly; beyond it the count reads "99+" (D4). */
|
|
5
|
+
export declare const HOME_COUNT_CAP = 99;
|
|
6
|
+
/** A count as Home states it: exact up to HOME_COUNT_CAP; `more` when there may be more than `count`. */
|
|
7
|
+
export declare const HomeCountSchema: z.ZodObject<{
|
|
8
|
+
count: z.ZodNumber;
|
|
9
|
+
more: z.ZodBoolean;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
export type HomeCount = z.infer<typeof HomeCountSchema>;
|
|
12
|
+
/** A page whose newest version is not live in some language (D5). */
|
|
13
|
+
export declare const HomeDraftRowSchema: z.ZodObject<{
|
|
14
|
+
cultures: z.ZodArray<z.ZodString>;
|
|
15
|
+
editedAt: z.ZodString;
|
|
16
|
+
nodeId: z.ZodString;
|
|
17
|
+
name: z.ZodString;
|
|
18
|
+
path: z.ZodString;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
export type HomeDraftRow = z.infer<typeof HomeDraftRowSchema>;
|
|
21
|
+
export declare const HomeDraftsResponseSchema: z.ZodObject<{
|
|
22
|
+
items: z.ZodArray<z.ZodObject<{
|
|
23
|
+
cultures: z.ZodArray<z.ZodString>;
|
|
24
|
+
editedAt: z.ZodString;
|
|
25
|
+
nodeId: z.ZodString;
|
|
26
|
+
name: z.ZodString;
|
|
27
|
+
path: z.ZodString;
|
|
28
|
+
}, z.core.$strip>>;
|
|
29
|
+
}, z.core.$strict>;
|
|
30
|
+
export type HomeDraftsResponse = z.infer<typeof HomeDraftsResponseSchema>;
|
|
31
|
+
/** A page at its newest save. */
|
|
32
|
+
export declare const HomeRecentEditRowSchema: z.ZodObject<{
|
|
33
|
+
editedAt: z.ZodString;
|
|
34
|
+
authorName: z.ZodNullable<z.ZodString>;
|
|
35
|
+
nodeId: z.ZodString;
|
|
36
|
+
name: z.ZodString;
|
|
37
|
+
path: z.ZodString;
|
|
38
|
+
}, z.core.$strip>;
|
|
39
|
+
export type HomeRecentEditRow = z.infer<typeof HomeRecentEditRowSchema>;
|
|
40
|
+
export declare const HomeRecentEditsResponseSchema: z.ZodObject<{
|
|
41
|
+
items: z.ZodArray<z.ZodObject<{
|
|
42
|
+
editedAt: z.ZodString;
|
|
43
|
+
authorName: z.ZodNullable<z.ZodString>;
|
|
44
|
+
nodeId: z.ZodString;
|
|
45
|
+
name: z.ZodString;
|
|
46
|
+
path: z.ZodString;
|
|
47
|
+
}, z.core.$strip>>;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
export type HomeRecentEditsResponse = z.infer<typeof HomeRecentEditsResponseSchema>;
|
|
50
|
+
/** One language of a page published in the last seven days. */
|
|
51
|
+
export declare const HomePublishedRowSchema: z.ZodObject<{
|
|
52
|
+
culture: z.ZodString;
|
|
53
|
+
publishedAt: z.ZodString;
|
|
54
|
+
authorName: z.ZodNullable<z.ZodString>;
|
|
55
|
+
nodeId: z.ZodString;
|
|
56
|
+
name: z.ZodString;
|
|
57
|
+
path: z.ZodString;
|
|
58
|
+
}, z.core.$strip>;
|
|
59
|
+
export type HomePublishedRow = z.infer<typeof HomePublishedRowSchema>;
|
|
60
|
+
export declare const HomePublishedResponseSchema: z.ZodObject<{
|
|
61
|
+
items: z.ZodArray<z.ZodObject<{
|
|
62
|
+
culture: z.ZodString;
|
|
63
|
+
publishedAt: z.ZodString;
|
|
64
|
+
authorName: z.ZodNullable<z.ZodString>;
|
|
65
|
+
nodeId: z.ZodString;
|
|
66
|
+
name: z.ZodString;
|
|
67
|
+
path: z.ZodString;
|
|
68
|
+
}, z.core.$strip>>;
|
|
69
|
+
total: z.ZodObject<{
|
|
70
|
+
count: z.ZodNumber;
|
|
71
|
+
more: z.ZodBoolean;
|
|
72
|
+
}, z.core.$strip>;
|
|
73
|
+
since: z.ZodString;
|
|
74
|
+
}, z.core.$strip>;
|
|
75
|
+
export type HomePublishedResponse = z.infer<typeof HomePublishedResponseSchema>;
|
|
76
|
+
/** How many pages are in the trash. */
|
|
77
|
+
export declare const HomeTrashCountResponseSchema: z.ZodObject<{
|
|
78
|
+
count: z.ZodNumber;
|
|
79
|
+
more: z.ZodBoolean;
|
|
80
|
+
}, z.core.$strip>;
|
|
81
|
+
export type HomeTrashCountResponse = HomeCount;
|
|
82
|
+
/** S317 (plan P15): the most plugin fees Home's route answers. */
|
|
83
|
+
export declare const HOME_PLUGIN_FEES_MAX = 50;
|
|
84
|
+
export declare const HomePluginFeeSchema: z.ZodObject<{
|
|
85
|
+
pluginId: z.ZodString;
|
|
86
|
+
name: z.ZodString;
|
|
87
|
+
planId: z.ZodNullable<z.ZodString>;
|
|
88
|
+
termState: z.ZodString;
|
|
89
|
+
termEndsAt: z.ZodString;
|
|
90
|
+
renewalAmountCents: z.ZodNullable<z.ZodNumber>;
|
|
91
|
+
cancelAtPeriodEnd: z.ZodBoolean;
|
|
92
|
+
refreshedAt: z.ZodNullable<z.ZodString>;
|
|
93
|
+
}, z.core.$strip>;
|
|
94
|
+
export type HomePluginFee = z.infer<typeof HomePluginFeeSchema>;
|
|
95
|
+
export declare const HomePluginFeesResponseSchema: z.ZodObject<{
|
|
96
|
+
items: z.ZodArray<z.ZodObject<{
|
|
97
|
+
pluginId: z.ZodString;
|
|
98
|
+
name: z.ZodString;
|
|
99
|
+
planId: z.ZodNullable<z.ZodString>;
|
|
100
|
+
termState: z.ZodString;
|
|
101
|
+
termEndsAt: z.ZodString;
|
|
102
|
+
renewalAmountCents: z.ZodNullable<z.ZodNumber>;
|
|
103
|
+
cancelAtPeriodEnd: z.ZodBoolean;
|
|
104
|
+
refreshedAt: z.ZodNullable<z.ZodString>;
|
|
105
|
+
}, z.core.$strip>>;
|
|
106
|
+
}, z.core.$strip>;
|
|
107
|
+
export type HomePluginFeesResponse = z.infer<typeof HomePluginFeesResponseSchema>;
|
|
108
|
+
/** The most widgets a saved layout names. */
|
|
109
|
+
export declare const HOME_LAYOUT_MAX = 200;
|
|
110
|
+
/**
|
|
111
|
+
* One widget in a person's Home layout (D8): `builtin:<name>` for a built-in
|
|
112
|
+
* widget, `plugin:<pluginId>/<widgetId>` for a plugin's.
|
|
113
|
+
*/
|
|
114
|
+
export declare const HomeLayoutEntrySchema: z.ZodObject<{
|
|
115
|
+
id: z.ZodString;
|
|
116
|
+
shown: z.ZodBoolean;
|
|
117
|
+
}, z.core.$strict>;
|
|
118
|
+
export type HomeLayoutEntry = z.infer<typeof HomeLayoutEntrySchema>;
|
|
119
|
+
/**
|
|
120
|
+
* A person's Home layout (D8): the widgets in their order, each shown or
|
|
121
|
+
* hidden. The admin places a widget the layout does not name at the end,
|
|
122
|
+
* shown, and drops an id that names no widget. An empty list is the default.
|
|
123
|
+
*/
|
|
124
|
+
export declare const HomeLayoutSchema: z.ZodObject<{
|
|
125
|
+
widgets: z.ZodArray<z.ZodObject<{
|
|
126
|
+
id: z.ZodString;
|
|
127
|
+
shown: z.ZodBoolean;
|
|
128
|
+
}, z.core.$strict>>;
|
|
129
|
+
}, z.core.$strict>;
|
|
130
|
+
export type HomeLayout = z.infer<typeof HomeLayoutSchema>;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// S314n (2026-10-28-s314n-home-with-built-in-widgets-design.md): the answers
|
|
3
|
+
// of Home's built-in widgets and the Home layout each person keeps with their
|
|
4
|
+
// own preferences. News from Kardalum has its own module, news.schema.ts.
|
|
5
|
+
/** The most rows a Home list shows (D4). */
|
|
6
|
+
export const HOME_LIST_ROWS = 5;
|
|
7
|
+
/** The highest count Home states exactly; beyond it the count reads "99+" (D4). */
|
|
8
|
+
export const HOME_COUNT_CAP = 99;
|
|
9
|
+
/** A count as Home states it: exact up to HOME_COUNT_CAP; `more` when there may be more than `count`. */
|
|
10
|
+
export const HomeCountSchema = z.object({
|
|
11
|
+
count: z.number().int().min(0).max(HOME_COUNT_CAP),
|
|
12
|
+
more: z.boolean(),
|
|
13
|
+
});
|
|
14
|
+
const pageRow = {
|
|
15
|
+
nodeId: z.string().uuid(),
|
|
16
|
+
/** The page's name in the site's languages, else the last segment of its path: never empty. */
|
|
17
|
+
name: z.string().min(1),
|
|
18
|
+
path: z.string().min(1),
|
|
19
|
+
};
|
|
20
|
+
/** A page whose newest version is not live in some language (D5). */
|
|
21
|
+
export const HomeDraftRowSchema = z.object({
|
|
22
|
+
...pageRow,
|
|
23
|
+
/** The languages whose newest version is not live, in the site's order. */
|
|
24
|
+
cultures: z.array(z.string().min(1)).min(1),
|
|
25
|
+
/** When the newest version was saved. */
|
|
26
|
+
editedAt: z.string().datetime(),
|
|
27
|
+
});
|
|
28
|
+
export const HomeDraftsResponseSchema = z.object({
|
|
29
|
+
items: z.array(HomeDraftRowSchema).max(HOME_LIST_ROWS),
|
|
30
|
+
}).strict();
|
|
31
|
+
/** A page at its newest save. */
|
|
32
|
+
export const HomeRecentEditRowSchema = z.object({
|
|
33
|
+
...pageRow,
|
|
34
|
+
editedAt: z.string().datetime(),
|
|
35
|
+
/** The name of whoever saved it; null for an account that is gone or has no name, and on every row for an API key. */
|
|
36
|
+
authorName: z.string().nullable(),
|
|
37
|
+
});
|
|
38
|
+
export const HomeRecentEditsResponseSchema = z.object({
|
|
39
|
+
items: z.array(HomeRecentEditRowSchema).max(HOME_LIST_ROWS),
|
|
40
|
+
});
|
|
41
|
+
/** One language of a page published in the last seven days. */
|
|
42
|
+
export const HomePublishedRowSchema = z.object({
|
|
43
|
+
...pageRow,
|
|
44
|
+
culture: z.string().min(1),
|
|
45
|
+
publishedAt: z.string().datetime(),
|
|
46
|
+
/** Who saved the version that went live (the publisher is recorded in the audit log only); null for an account that is gone or has no name, and on every row for an API key. */
|
|
47
|
+
authorName: z.string().nullable(),
|
|
48
|
+
});
|
|
49
|
+
export const HomePublishedResponseSchema = z.object({
|
|
50
|
+
items: z.array(HomePublishedRowSchema).max(HOME_LIST_ROWS),
|
|
51
|
+
total: HomeCountSchema,
|
|
52
|
+
/** The start of the window: seven days before the request. */
|
|
53
|
+
since: z.string().datetime(),
|
|
54
|
+
});
|
|
55
|
+
/** How many pages are in the trash. */
|
|
56
|
+
export const HomeTrashCountResponseSchema = HomeCountSchema;
|
|
57
|
+
/** S317 (plan P15): the most plugin fees Home's route answers. */
|
|
58
|
+
export const HOME_PLUGIN_FEES_MAX = 50;
|
|
59
|
+
// S317 (spec 3e): one subscribed plugin's upcoming fee, read from the
|
|
60
|
+
// licence's stored verdict: its plan, term state ("active", "renewing",
|
|
61
|
+
// "past_due" or "lapsed"; a string so a newer state is tolerated), the
|
|
62
|
+
// term's end, the next charge in USD cents (null when nothing renews), the
|
|
63
|
+
// cancel flag, and when the marketplace issued that verdict.
|
|
64
|
+
export const HomePluginFeeSchema = z.object({
|
|
65
|
+
pluginId: z.string(),
|
|
66
|
+
name: z.string(),
|
|
67
|
+
planId: z.string().nullable(),
|
|
68
|
+
termState: z.string(),
|
|
69
|
+
termEndsAt: z.string(),
|
|
70
|
+
renewalAmountCents: z.number().int().nullable(),
|
|
71
|
+
cancelAtPeriodEnd: z.boolean(),
|
|
72
|
+
refreshedAt: z.string().nullable(),
|
|
73
|
+
});
|
|
74
|
+
export const HomePluginFeesResponseSchema = z.object({ items: z.array(HomePluginFeeSchema).max(HOME_PLUGIN_FEES_MAX) });
|
|
75
|
+
/** The most widgets a saved layout names. */
|
|
76
|
+
export const HOME_LAYOUT_MAX = 200;
|
|
77
|
+
/**
|
|
78
|
+
* One widget in a person's Home layout (D8): `builtin:<name>` for a built-in
|
|
79
|
+
* widget, `plugin:<pluginId>/<widgetId>` for a plugin's.
|
|
80
|
+
*/
|
|
81
|
+
export const HomeLayoutEntrySchema = z.object({ id: z.string().min(1).max(400), shown: z.boolean() }).strict();
|
|
82
|
+
/**
|
|
83
|
+
* A person's Home layout (D8): the widgets in their order, each shown or
|
|
84
|
+
* hidden. The admin places a widget the layout does not name at the end,
|
|
85
|
+
* shown, and drops an id that names no widget. An empty list is the default.
|
|
86
|
+
*/
|
|
87
|
+
export const HomeLayoutSchema = z.object({ widgets: z.array(HomeLayoutEntrySchema).max(HOME_LAYOUT_MAX) }).strict();
|