@kardalum/plugin-sdk 0.17.0 → 0.19.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 +109 -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-serializers.js +1 -1
- package/dist/built-in-settings-schemas.d.ts +2 -0
- package/dist/built-in-settings-schemas.js +31 -4
- package/dist/built-in-value-schemas.js +3 -0
- package/dist/built-ins.js +20 -11
- package/dist/capabilities.js +5 -0
- package/dist/data-type-plugin.d.ts +2 -2
- package/dist/datatype-validation.d.ts +2 -2
- package/dist/datatype-validation.js +20 -6
- package/dist/datatypes-entry.d.ts +1 -0
- package/dist/datatypes-entry.js +1 -0
- package/dist/define-plugin.d.ts +4 -4
- package/dist/define-plugin.js +5 -5
- 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 +8 -1
- package/dist/index.js +11 -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 +14 -2
- package/dist/manifest.d.ts +21 -1
- package/dist/media/media-picker.js +34 -34
- package/dist/notify.d.ts +17 -0
- package/dist/notify.js +17 -0
- package/dist/plugin-context.js +3 -3
- package/dist/register-built-ins.js +6 -6
- package/dist/registry.js +1 -1
- package/dist/richtext/block-panel.js +19 -20
- package/dist/richtext/extensions.js +17 -8
- package/dist/richtext/insert-menu.js +4 -4
- package/dist/richtext/kardalum-block.js +17 -17
- package/dist/richtext/style-listbox.js +2 -2
- package/dist/richtext/text-style-class.js +1 -1
- package/dist/richtext-html-entry.d.ts +35 -0
- package/dist/richtext-html-entry.js +73 -0
- package/dist/simple-storage-value-provider.js +3 -3
- package/dist/structured-storage-types.d.ts +12 -1
- package/dist/structured-storage-types.js +2 -2
- 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/ui-entry.js +3 -3
- 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/date-range-view.js +5 -5
- package/dist/views/html-code-editor.js +2 -3
- package/dist/views/html-view.js +7 -7
- package/dist/views/image-view.js +5 -5
- package/dist/views/rich-text-view.js +33 -32
- package/node_modules/@kardalum/api-schemas/README.md +1 -1
- package/node_modules/@kardalum/api-schemas/dist/api-error.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.js +17 -15
- 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/auth.schema.js +1 -1
- 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 +13 -0
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.js +30 -9
- package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.js +3 -3
- package/node_modules/@kardalum/api-schemas/dist/content-trash.schema.js +1 -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 +26 -6
- 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 +6 -3
- 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.d.ts +90 -0
- package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +56 -6
- package/node_modules/@kardalum/api-schemas/dist/document-type.schema.js +8 -8
- 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 +48 -19
- package/node_modules/@kardalum/api-schemas/dist/index.js +34 -12
- 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/listing-categories.schema.d.ts +46 -0
- package/node_modules/@kardalum/api-schemas/dist/listing-categories.schema.js +52 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.d.ts +162 -1
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +144 -9
- 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 +15 -9
- 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/media.schema.js +5 -5
- 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-docs-text.js +1 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.d.ts +251 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +196 -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-registry-api.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.js +3 -3
- 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/render-editing.js +4 -4
- package/node_modules/@kardalum/api-schemas/dist/render-settings-api.schema.js +1 -1
- 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/server-settings-api.schema.d.ts +207 -0
- package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.js +147 -0
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +11 -0
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.js +17 -8
- 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/snapshot.schema.js +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 +27 -12
- 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/theme-api.schema.d.ts +1 -1
- package/node_modules/@kardalum/api-schemas/dist/theme-api.schema.js +1 -1
- 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 +6 -1
- 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-css.d.ts +1 -1
- package/node_modules/@kardalum/design-tokens/dist/build-css.js +2 -2
- 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/tailwind-theme.js +3 -3
- package/node_modules/@kardalum/design-tokens/dist/theme-css.d.ts +2 -2
- package/node_modules/@kardalum/design-tokens/dist/theme-css.js +2 -2
- package/node_modules/@kardalum/design-tokens/dist/theme-types.d.ts +2 -2
- package/node_modules/@kardalum/design-tokens/dist/themes/dark.d.ts +3 -3
- package/node_modules/@kardalum/design-tokens/dist/themes/dark.js +3 -3
- package/node_modules/@kardalum/design-tokens/dist/themes/light.d.ts +1 -1
- package/node_modules/@kardalum/design-tokens/dist/themes/light.js +1 -1
- package/node_modules/@kardalum/design-tokens/dist/tokens.css +1 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.d.ts +3 -3
- package/node_modules/@kardalum/design-tokens/dist/tokens.js +6 -5
- package/node_modules/@kardalum/design-tokens/dist/tokens.json +2 -1
- package/node_modules/@kardalum/design-tokens/dist/types.d.ts +2 -1
- package/node_modules/@kardalum/design-tokens/dist/types.js +1 -1
- 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 +9 -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/envelope.d.ts +2 -2
- package/node_modules/@kardalum/plugin-package/dist/envelope.js +2 -2
- package/node_modules/@kardalum/plugin-package/dist/extract.d.ts +3 -3
- package/node_modules/@kardalum/plugin-package/dist/extract.js +10 -10
- package/node_modules/@kardalum/plugin-package/dist/hash.d.ts +1 -1
- package/node_modules/@kardalum/plugin-package/dist/hash.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/package-contract.d.ts +2 -2
- package/node_modules/@kardalum/plugin-package/dist/package-contract.js +5 -5
- package/node_modules/@kardalum/plugin-package/dist/types.d.ts +1 -1
- 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/alert-dialog.d.ts +1 -1
- package/node_modules/@kardalum/ui/dist/components/alert-dialog.js +8 -3
- package/node_modules/@kardalum/ui/dist/components/badge.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/button.js +2 -2
- package/node_modules/@kardalum/ui/dist/components/checkbox.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/dialog.d.ts +1 -1
- package/node_modules/@kardalum/ui/dist/components/dialog.js +52 -4
- package/node_modules/@kardalum/ui/dist/components/dropdown-menu.d.ts +5 -1
- package/node_modules/@kardalum/ui/dist/components/dropdown-menu.js +20 -7
- package/node_modules/@kardalum/ui/dist/components/empty-state.d.ts +4 -4
- package/node_modules/@kardalum/ui/dist/components/input.js +6 -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/property-field.js +3 -3
- package/node_modules/@kardalum/ui/dist/components/sheet.d.ts +1 -1
- package/node_modules/@kardalum/ui/dist/components/sheet.js +15 -9
- package/node_modules/@kardalum/ui/dist/components/skeleton.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/switch.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/tab-strip.d.ts +3 -3
- package/node_modules/@kardalum/ui/dist/components/tab-strip.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/toast.js +4 -3
- package/node_modules/@kardalum/ui/dist/components/tooltip.d.ts +27 -0
- package/node_modules/@kardalum/ui/dist/components/tooltip.js +82 -0
- package/node_modules/@kardalum/ui/dist/components/truncated-text.d.ts +11 -0
- package/node_modules/@kardalum/ui/dist/components/truncated-text.js +94 -0
- package/node_modules/@kardalum/ui/dist/components/use-toast.js +2 -2
- package/node_modules/@kardalum/ui/dist/index.d.ts +4 -1
- package/node_modules/@kardalum/ui/dist/index.js +4 -1
- package/node_modules/@kardalum/ui/dist/lib/menu-host.d.ts +5 -0
- package/node_modules/@kardalum/ui/dist/lib/menu-host.js +17 -0
- package/node_modules/@kardalum/ui/package.json +8 -6
- package/package.json +21 -7
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { ReadOnlyFieldSchema } from "./plugin-read-only.schema.js";
|
|
2
3
|
import { RESERVED_ROOT_SLUGS, isReservedRootSlug } from "./reserved-slugs.js";
|
|
3
4
|
import { ContentNodeSchema, NodeCultureSchema } from "./content.schema.js";
|
|
4
5
|
import { ContentVersionSchema } from "./content-version.schema.js";
|
|
5
6
|
import { NodeAccessFlagsSchema } from "./node-access.schema.js";
|
|
6
|
-
// createdBy is deliberately absent from mutation request bodies
|
|
7
|
+
// createdBy is deliberately absent from mutation request bodies: it comes
|
|
7
8
|
// from the authenticated JWT (sub claim), never from the caller.
|
|
8
9
|
// The culture is a BCP 47 language tag, the same shape Accept-Language is
|
|
9
10
|
// matched against.
|
|
@@ -36,7 +37,13 @@ export const CreateContentRequestSchema = z.object({
|
|
|
36
37
|
path: ["slug"],
|
|
37
38
|
});
|
|
38
39
|
export const ContentItemResponseSchema = z.object({
|
|
39
|
-
|
|
40
|
+
// S318: fields kept because their plugin is read-only.
|
|
41
|
+
readOnlyFields: z.array(ReadOnlyFieldSchema).optional(),
|
|
42
|
+
// S314o (D3): the node with the display name the list rows carry
|
|
43
|
+
// (ContentNodeWithNameSchema), so a create, a read by id and a copy
|
|
44
|
+
// answer the name where a list does. Optional, and absent rather than
|
|
45
|
+
// empty, for the same reason as there.
|
|
46
|
+
node: ContentNodeSchema.extend({ name: z.string().min(1).optional() }),
|
|
40
47
|
// S277c: the address a visitor would use for this node in the culture
|
|
41
48
|
// this response is for: the stored path with the default site's own
|
|
42
49
|
// segment hidden, and the culture prefix on a site with more than one
|
|
@@ -54,7 +61,7 @@ export const ContentItemResponseSchema = z.object({
|
|
|
54
61
|
// What the signed-in person may do on this node (S276).
|
|
55
62
|
access: NodeAccessFlagsSchema,
|
|
56
63
|
});
|
|
57
|
-
// S156 admin by-path lookup
|
|
64
|
+
// S156 admin by-path lookup: the admin origin's honest-headless view
|
|
58
65
|
// resolves a pasted URL against the content tree. Drafts ARE visible here
|
|
59
66
|
// (this is the back office); the public no-leak rule lives on the server
|
|
60
67
|
// origin's bridge, not on this authenticated route.
|
|
@@ -102,6 +109,8 @@ export const SaveContentRequestSchema = z.object({
|
|
|
102
109
|
baseVersion: z.number().int().positive().optional(),
|
|
103
110
|
});
|
|
104
111
|
export const SaveContentResponseSchema = z.object({
|
|
112
|
+
// S318: fields kept because their plugin is read-only.
|
|
113
|
+
readOnlyFields: z.array(ReadOnlyFieldSchema).optional(),
|
|
105
114
|
version: ContentVersionSchema,
|
|
106
115
|
// S277e: the node as it is after this save. A save can rename the node,
|
|
107
116
|
// which moves its stored path, so the editor replaces the node it holds
|
|
@@ -131,18 +140,30 @@ export const LatestVersionQuerySchema = z.object({ locale: CultureSchema.optiona
|
|
|
131
140
|
export const VersionQuerySchema = LatestVersionQuerySchema;
|
|
132
141
|
export const LatestVersionResponseSchema = z.object({
|
|
133
142
|
version: ContentVersionSchema,
|
|
143
|
+
// S314o (D1): the site's default culture, so a client that patches the
|
|
144
|
+
// newest save (the CLI's --field) knows which culture's view it merges
|
|
145
|
+
// over without asking settings.read. This server always answers it, on
|
|
146
|
+
// the latest read and on the one-version read alike; it is optional so a
|
|
147
|
+
// client reading an older server, or a test double, need not carry it.
|
|
148
|
+
defaultCulture: CultureSchema.optional(),
|
|
149
|
+
// S366c: true when a save that names no `_name` keeps the page's name and
|
|
150
|
+
// does not move it (S366 D3), in every culture. A client patching the
|
|
151
|
+
// newest save (the CLI's --field) then leaves the name out unless it was
|
|
152
|
+
// given; a server older than S366 says nothing, and there a default
|
|
153
|
+
// culture's save without the name would drop it.
|
|
154
|
+
saveKeepsName: z.literal(true).optional(),
|
|
134
155
|
// With ?locale=: the varying field ids this language has no value for,
|
|
135
156
|
// whether or not the default language has one. Unlike the public read,
|
|
136
157
|
// where fellBack lists only the fields actually filled from the default.
|
|
137
158
|
// Absent without locale.
|
|
138
159
|
fellBack: z.array(z.string()).optional(),
|
|
139
160
|
});
|
|
140
|
-
// Version history list: metadata only
|
|
161
|
+
// Version history list: metadata only: `data` can be arbitrarily large
|
|
141
162
|
// and the history view only needs the row facts; the full snapshot is one
|
|
142
163
|
// GET /api/manage/v1/content/:id/versions/:version away.
|
|
143
164
|
export const ContentVersionMetaSchema = ContentVersionSchema.omit({ data: true });
|
|
144
165
|
// Newest-first pages. Version numbers are contiguous (1..latest, rows are
|
|
145
|
-
// never deleted
|
|
166
|
+
// never deleted: immutability), so the cursor is simply the last version
|
|
146
167
|
// number of the previous page.
|
|
147
168
|
export const VersionListQuerySchema = z.object({
|
|
148
169
|
cursor: z.coerce.number().int().positive().optional(),
|
|
@@ -189,7 +210,7 @@ export const PublishAllResponseSchema = z.object({ results: z.array(PublishAllRe
|
|
|
189
210
|
// short-TTL, single-content-id preview token (see
|
|
190
211
|
// apps/server/src/auth/preview-tokens.ts). Any existing content id may be
|
|
191
212
|
// minted for, published or not; `expiresAt` is an ISO datetime string.
|
|
192
|
-
// Session 117: added `previewUrl
|
|
213
|
+
// Session 117: added `previewUrl`: the full preview URL (including token),
|
|
193
214
|
// or null if KARDALUM_PREVIEW_BASE_URL is not configured.
|
|
194
215
|
export const PreviewTokenResponseSchema = z.object({
|
|
195
216
|
token: z.string(),
|
|
@@ -278,7 +299,7 @@ export const ContentChildrenResponseSchema = z.object({
|
|
|
278
299
|
// null = no more pages.
|
|
279
300
|
nextCursor: z.string().uuid().nullable(),
|
|
280
301
|
});
|
|
281
|
-
// Whole-array reorder (mirrors the document-type fields/tabs pattern)
|
|
302
|
+
// Whole-array reorder (mirrors the document-type fields/tabs pattern):
|
|
282
303
|
// orderedIds must exactly match the current children of the parent (or
|
|
283
304
|
// root nodes, for /api/manage/v1/content/roots/reorder); the adapter rejects
|
|
284
305
|
// otherwise. Only practical for a fully-loaded sibling list, so the admin
|
|
@@ -290,14 +311,14 @@ export const ReorderNodesResponseSchema = z.object({
|
|
|
290
311
|
success: z.literal(true),
|
|
291
312
|
});
|
|
292
313
|
// The one deliberate exception to ApiErrorSchema's "every route, same
|
|
293
|
-
// shape" rule (api-error.schema.ts)
|
|
314
|
+
// shape" rule (api-error.schema.ts): field validation failures are
|
|
294
315
|
// per-field by nature, and the admin editor needs that structure to
|
|
295
316
|
// eventually highlight the right field/tab, not just show a string.
|
|
296
317
|
//
|
|
297
318
|
// Two reporting routes (S198): a webmaster-configured rule and a built-in
|
|
298
319
|
// datatype's hook both report `key` (a translation key the admin already
|
|
299
320
|
// renders); a third-party datatype's hook reports `message` (its own
|
|
300
|
-
// string
|
|
321
|
+
// string: plugin-message i18n is a later concern). Exactly one of the two
|
|
301
322
|
// is always present, and `path` names a sub-key inside a composite value
|
|
302
323
|
// (a date range's "end") so the form can mark the precise sub-input rather
|
|
303
324
|
// than the whole field.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
// S154 content trash. The DELETE is two-step like the structured-data
|
|
3
3
|
// uninstall gate: unconfirmed → 409 naming the blast radius (the count
|
|
4
|
-
// the confirm dialog renders), confirmed → trash. Trash is SOFT
|
|
5
|
-
// reversible via the restore route
|
|
4
|
+
// the confirm dialog renders), confirmed → trash. Trash is SOFT:
|
|
5
|
+
// reversible via the restore route, so this is a plain confirmation,
|
|
6
6
|
// not the snapshot-gate treatment.
|
|
7
7
|
//
|
|
8
8
|
// Fastify substitutes `null` for a genuinely absent body before handing it
|
|
9
|
-
// to the validator
|
|
9
|
+
// to the validator: a DELETE sent with no payload at all lands here as
|
|
10
10
|
// `null`, not `undefined`. `.nullish()` (not `.optional()`) is required so
|
|
11
11
|
// an absent body validates; `request.body?.confirm` in the route handler
|
|
12
12
|
// already tolerates both null and undefined.
|
|
@@ -2,7 +2,7 @@ import { z } from "zod";
|
|
|
2
2
|
import { TrashCursorSchema } from "./trash-cursor.schema.js";
|
|
3
3
|
import { NodeAccessFlagsSchema } from "./node-access.schema.js";
|
|
4
4
|
// S161: the trash browse surface. Separate from content-trash-api.schema.ts
|
|
5
|
-
// (S154's trash/restore confirmation bodies)
|
|
5
|
+
// (S154's trash/restore confirmation bodies); this file is the list route
|
|
6
6
|
// and the restore-blocked 409, added a session later.
|
|
7
7
|
export const ContentTrashListQuerySchema = z.object({
|
|
8
8
|
cursor: TrashCursorSchema.optional(),
|
|
@@ -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, GET /api/manage/v1/settings/server";
|
|
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, PUT /api/manage/v1/settings/server";
|
|
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, GET /api/manage/v1/settings/server" },
|
|
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, PUT /api/manage/v1/settings/server" },
|
|
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),
|
|
@@ -7,7 +9,7 @@ export const CreateDataTypeRequestSchema = z
|
|
|
7
9
|
settings: z.record(z.string(), z.unknown()).default({}),
|
|
8
10
|
})
|
|
9
11
|
.strict();
|
|
10
|
-
// editorId is deliberately absent
|
|
12
|
+
// editorId is deliberately absent, being immutable after creation (see
|
|
11
13
|
// DataTypeConfigSchema). At least the route merges partial updates onto
|
|
12
14
|
// the loaded config, so both fields are optional here.
|
|
13
15
|
export const UpdateDataTypeRequestSchema = z
|
|
@@ -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[];
|
|
@@ -2,7 +2,7 @@ import { z } from "zod";
|
|
|
2
2
|
// A Data Type is a named, admin-created CONFIGURATION of a registry
|
|
3
3
|
// editor (Umbraco's split: the editor is the input-control code shipped
|
|
4
4
|
// by core/plugins; the Data Type is "Richtext: limited toolbar").
|
|
5
|
-
// Document type fields reference a Data Type's id
|
|
5
|
+
// Document type fields reference a Data Type's id: configure once,
|
|
6
6
|
// reuse across document types. Settings are validated against the
|
|
7
7
|
// editor's settingsSchema when the plugin settings pipeline lands
|
|
8
8
|
// (Month 6); until then they are a free-form record.
|
|
@@ -11,14 +11,17 @@ export const DataTypeConfigSchema = z
|
|
|
11
11
|
id: z.string().uuid(),
|
|
12
12
|
name: z.string().min(1),
|
|
13
13
|
// Registry editor id, e.g. 'com.kardalum.richtext'. Immutable after
|
|
14
|
-
// creation
|
|
14
|
+
// creation: swapping the editor under fields that already store
|
|
15
15
|
// values in the old editor's shape is a data footgun.
|
|
16
16
|
editorId: z.string().min(1),
|
|
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
|
-
// 0006_data_types, with these FIXED ids
|
|
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
|
|
23
26
|
// Text data type" without a lookup. Version-4/variant-8 shaped so
|
|
24
27
|
// z.string().uuid() accepts them.
|
|
@@ -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
|
+
}
|
|
@@ -205,6 +205,93 @@ export declare const DocumentTypeListQuerySchema: z.ZodObject<{
|
|
|
205
205
|
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
206
206
|
}, z.core.$strip>;
|
|
207
207
|
export type DocumentTypeListQuery = z.infer<typeof DocumentTypeListQuerySchema>;
|
|
208
|
+
export declare const DocumentTypeListItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
209
|
+
id: z.ZodString;
|
|
210
|
+
name: z.ZodString;
|
|
211
|
+
icon: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
212
|
+
kind: z.ZodLiteral<"page">;
|
|
213
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
214
|
+
id: z.ZodString;
|
|
215
|
+
name: z.ZodString;
|
|
216
|
+
datatypeId: z.ZodString;
|
|
217
|
+
validation: z.ZodOptional<z.ZodObject<{
|
|
218
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
219
|
+
minLength: z.ZodOptional<z.ZodNumber>;
|
|
220
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
221
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
222
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
223
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
224
|
+
}, z.core.$strict>>;
|
|
225
|
+
tabId: z.ZodOptional<z.ZodString>;
|
|
226
|
+
varies: z.ZodOptional<z.ZodBoolean>;
|
|
227
|
+
}, z.core.$strict>>;
|
|
228
|
+
treeRules: z.ZodObject<{
|
|
229
|
+
allowedAtRoot: z.ZodBoolean;
|
|
230
|
+
allowedParentTypes: z.ZodArray<z.ZodString>;
|
|
231
|
+
allowedChildTypes: z.ZodArray<z.ZodString>;
|
|
232
|
+
}, z.core.$strip>;
|
|
233
|
+
tabs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
234
|
+
id: z.ZodString;
|
|
235
|
+
name: z.ZodString;
|
|
236
|
+
}, z.core.$strict>>>;
|
|
237
|
+
defaultTemplateId: z.ZodOptional<z.ZodString>;
|
|
238
|
+
translationMandatory: z.ZodOptional<z.ZodBoolean>;
|
|
239
|
+
collection: z.ZodOptional<z.ZodBoolean>;
|
|
240
|
+
ownedBy: z.ZodNullable<z.ZodString>;
|
|
241
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
242
|
+
id: z.ZodString;
|
|
243
|
+
name: z.ZodString;
|
|
244
|
+
icon: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
245
|
+
kind: z.ZodLiteral<"element">;
|
|
246
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
247
|
+
id: z.ZodString;
|
|
248
|
+
name: z.ZodString;
|
|
249
|
+
datatypeId: z.ZodString;
|
|
250
|
+
validation: z.ZodOptional<z.ZodObject<{
|
|
251
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
252
|
+
minLength: z.ZodOptional<z.ZodNumber>;
|
|
253
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
254
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
255
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
256
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
257
|
+
}, z.core.$strict>>;
|
|
258
|
+
tabId: z.ZodOptional<z.ZodString>;
|
|
259
|
+
varies: z.ZodOptional<z.ZodBoolean>;
|
|
260
|
+
}, z.core.$strict>>;
|
|
261
|
+
tabs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
262
|
+
id: z.ZodString;
|
|
263
|
+
name: z.ZodString;
|
|
264
|
+
}, z.core.$strict>>>;
|
|
265
|
+
ownedBy: z.ZodNullable<z.ZodString>;
|
|
266
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
267
|
+
id: z.ZodString;
|
|
268
|
+
name: z.ZodString;
|
|
269
|
+
icon: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
270
|
+
kind: z.ZodLiteral<"media">;
|
|
271
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
272
|
+
id: z.ZodString;
|
|
273
|
+
name: z.ZodString;
|
|
274
|
+
datatypeId: z.ZodString;
|
|
275
|
+
validation: z.ZodOptional<z.ZodObject<{
|
|
276
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
277
|
+
minLength: z.ZodOptional<z.ZodNumber>;
|
|
278
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
279
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
280
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
281
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
282
|
+
}, z.core.$strict>>;
|
|
283
|
+
tabId: z.ZodOptional<z.ZodString>;
|
|
284
|
+
varies: z.ZodOptional<z.ZodBoolean>;
|
|
285
|
+
}, z.core.$strict>>;
|
|
286
|
+
tabs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
287
|
+
id: z.ZodString;
|
|
288
|
+
name: z.ZodString;
|
|
289
|
+
}, z.core.$strict>>>;
|
|
290
|
+
sortOrder: z.ZodOptional<z.ZodNumber>;
|
|
291
|
+
catchAll: z.ZodOptional<z.ZodBoolean>;
|
|
292
|
+
ownedBy: z.ZodNullable<z.ZodString>;
|
|
293
|
+
}, z.core.$strict>], "kind">;
|
|
294
|
+
export type DocumentTypeListItem = z.infer<typeof DocumentTypeListItemSchema>;
|
|
208
295
|
export declare const DocumentTypeListResponseSchema: z.ZodObject<{
|
|
209
296
|
items: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
210
297
|
id: z.ZodString;
|
|
@@ -238,6 +325,7 @@ export declare const DocumentTypeListResponseSchema: z.ZodObject<{
|
|
|
238
325
|
defaultTemplateId: z.ZodOptional<z.ZodString>;
|
|
239
326
|
translationMandatory: z.ZodOptional<z.ZodBoolean>;
|
|
240
327
|
collection: z.ZodOptional<z.ZodBoolean>;
|
|
328
|
+
ownedBy: z.ZodNullable<z.ZodString>;
|
|
241
329
|
}, z.core.$strict>, z.ZodObject<{
|
|
242
330
|
id: z.ZodString;
|
|
243
331
|
name: z.ZodString;
|
|
@@ -262,6 +350,7 @@ export declare const DocumentTypeListResponseSchema: z.ZodObject<{
|
|
|
262
350
|
id: z.ZodString;
|
|
263
351
|
name: z.ZodString;
|
|
264
352
|
}, z.core.$strict>>>;
|
|
353
|
+
ownedBy: z.ZodNullable<z.ZodString>;
|
|
265
354
|
}, z.core.$strict>, z.ZodObject<{
|
|
266
355
|
id: z.ZodString;
|
|
267
356
|
name: z.ZodString;
|
|
@@ -288,6 +377,7 @@ export declare const DocumentTypeListResponseSchema: z.ZodObject<{
|
|
|
288
377
|
}, z.core.$strict>>>;
|
|
289
378
|
sortOrder: z.ZodOptional<z.ZodNumber>;
|
|
290
379
|
catchAll: z.ZodOptional<z.ZodBoolean>;
|
|
380
|
+
ownedBy: z.ZodNullable<z.ZodString>;
|
|
291
381
|
}, z.core.$strict>], "kind">>;
|
|
292
382
|
nextCursor: z.ZodNullable<z.ZodString>;
|
|
293
383
|
}, z.core.$strip>;
|