@kardalum/plugin-sdk 0.18.0 → 0.20.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 +253 -0
- package/README.md +20 -1
- package/dist/admin-section-registry.d.ts +16 -1
- package/dist/admin-section-registry.js +23 -0
- package/dist/assets/asset-picker.js +3 -3
- package/dist/built-in-editor-ids.d.ts +1 -1
- package/dist/built-in-editor-ids.js +2 -20
- package/dist/built-in-serializers.js +1 -1
- package/dist/built-in-settings-schemas.d.ts +10 -0
- package/dist/built-in-settings-schemas.js +90 -4
- package/dist/built-in-value-schemas.js +35 -0
- package/dist/built-ins.js +48 -17
- package/dist/capabilities.d.ts +11 -1
- package/dist/capabilities.js +55 -3
- package/dist/cli.d.ts +66 -0
- package/dist/cli.js +22 -0
- package/dist/content-library.d.ts +85 -0
- package/dist/content-library.js +15 -0
- package/dist/content-picker/page-picker-sheet.d.ts +13 -0
- package/dist/content-picker/page-picker-sheet.js +105 -0
- package/dist/content-picker/page-tree.d.ts +25 -0
- package/dist/content-picker/page-tree.js +132 -0
- package/dist/data-type-plugin.d.ts +9 -3
- package/dist/datatype-validation.d.ts +6 -11
- package/dist/datatype-validation.js +141 -3
- package/dist/define-plugin.d.ts +4 -4
- package/dist/define-plugin.js +5 -5
- package/dist/entitlement-entry.d.ts +1 -1
- package/dist/entitlement-entry.js +1 -1
- package/dist/entitlement-gate.d.ts +14 -0
- package/dist/entitlement-gate.js +64 -7
- package/dist/entitlement-plan.d.ts +6 -0
- package/dist/entitlement-plan.js +10 -0
- package/dist/entitlement-types.d.ts +36 -12
- package/dist/entitlement.d.ts +31 -4
- package/dist/entitlement.js +58 -17
- package/dist/hook-entry.d.ts +5 -0
- package/dist/hook-entry.js +30 -0
- package/dist/host-entry.d.ts +1 -1
- package/dist/host-entry.js +1 -1
- package/dist/index.d.ts +38 -4
- package/dist/index.js +54 -3
- package/dist/mail.d.ts +30 -0
- package/dist/mail.js +1 -0
- package/dist/manifest-entry.d.ts +29 -4
- package/dist/manifest-entry.js +39 -2
- package/dist/manifest-schema.d.ts +443 -29
- package/dist/manifest-schema.js +292 -24
- package/dist/manifest.d.ts +450 -51
- package/dist/manifest.js +1 -1
- package/dist/media/media-picker.js +33 -20
- package/dist/media/upload-error.d.ts +5 -1
- package/dist/media/upload-error.js +14 -2
- package/dist/media-library.d.ts +32 -0
- package/dist/media-library.js +15 -0
- package/dist/nested-field-host.d.ts +76 -0
- package/dist/nested-field-host.js +90 -0
- package/dist/notify.d.ts +12 -4
- package/dist/notify.js +1 -1
- package/dist/outbound.d.ts +47 -0
- package/dist/outbound.js +1 -0
- package/dist/plugin-context.d.ts +5 -0
- package/dist/plugin-context.js +3 -3
- package/dist/plugin-screen-context.d.ts +112 -0
- package/dist/plugin-screen-context.js +26 -0
- package/dist/providers.d.ts +268 -0
- package/dist/providers.js +74 -0
- package/dist/read-all-pages.d.ts +5 -0
- package/dist/read-all-pages.js +3 -2
- package/dist/register-built-ins.js +6 -6
- package/dist/registry.js +1 -1
- package/dist/richtext/block-panel.js +12 -7
- package/dist/richtext/extensions.js +7 -7
- package/dist/richtext/insert-menu.js +12 -9
- package/dist/richtext/style-listbox.js +7 -5
- package/dist/richtext/text-style-class.js +1 -1
- package/dist/sdk-strings.d.ts +285 -0
- package/dist/sdk-strings.js +347 -0
- package/dist/sealing.d.ts +14 -0
- package/dist/sealing.js +1 -0
- package/dist/simple-storage-value-provider.js +27 -27
- package/dist/structured-storage-types.d.ts +309 -9
- package/dist/structured-storage-types.js +2 -2
- package/dist/text-entry.d.ts +1 -0
- package/dist/text-entry.js +6 -0
- package/dist/tokens/tailwind-theme.css +5 -0
- package/dist/tokens/tokens.css +15 -3
- package/dist/tokens/tokens.json +8 -3
- package/dist/ui-entry.js +3 -3
- package/dist/views/asset-view.js +6 -3
- package/dist/views/content-list-preview.js +3 -1
- package/dist/views/content-list-settings-view.js +11 -7
- package/dist/views/content-list-view.d.ts +5 -3
- package/dist/views/content-list-view.js +38 -34
- package/dist/views/content-picker-view.d.ts +3 -0
- package/dist/views/content-picker-view.js +143 -0
- package/dist/views/crop-view.d.ts +4 -6
- package/dist/views/crop-view.js +22 -13
- package/dist/views/date-range-view.js +9 -6
- package/dist/views/file-upload-view.d.ts +5 -7
- package/dist/views/file-upload-view.js +16 -7
- package/dist/views/group-view.d.ts +8 -0
- package/dist/views/group-view.js +123 -0
- package/dist/views/html-code-editor.js +2 -2
- package/dist/views/html-view.js +12 -11
- package/dist/views/image-view.js +40 -22
- package/dist/views/link-view.d.ts +3 -0
- package/dist/views/link-view.js +150 -0
- package/dist/views/options-list-view.d.ts +3 -0
- package/dist/views/options-list-view.js +104 -0
- package/dist/views/repeatable-list-view.d.ts +3 -0
- package/dist/views/repeatable-list-view.js +113 -0
- package/dist/views/rich-text-view.js +32 -16
- package/dist/views/suggest-key.d.ts +17 -0
- package/dist/views/suggest-key.js +55 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-connections.schema.d.ts +215 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-connections.schema.js +179 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-context.schema.d.ts +12 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-context.schema.js +10 -0
- package/node_modules/@kardalum/api-schemas/dist/api-error.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.d.ts +10 -0
- package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.js +5 -0
- package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.d.ts +7 -1
- package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.js +4 -2
- package/node_modules/@kardalum/api-schemas/dist/auth.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/built-in-editor-ids.d.ts +1 -0
- package/node_modules/@kardalum/api-schemas/dist/built-in-editor-ids.js +27 -0
- package/node_modules/@kardalum/api-schemas/dist/capability-detail.d.ts +65 -0
- package/node_modules/@kardalum/api-schemas/dist/capability-detail.js +126 -0
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.d.ts +116 -3
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.js +71 -18
- package/node_modules/@kardalum/api-schemas/dist/content-list.schema.d.ts +57 -2
- package/node_modules/@kardalum/api-schemas/dist/content-list.schema.js +137 -0
- package/node_modules/@kardalum/api-schemas/dist/content-path.d.ts +1 -1
- package/node_modules/@kardalum/api-schemas/dist/content-path.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/content-search.schema.d.ts +50 -0
- package/node_modules/@kardalum/api-schemas/dist/content-search.schema.js +42 -0
- package/node_modules/@kardalum/api-schemas/dist/content-summary.schema.d.ts +37 -0
- package/node_modules/@kardalum/api-schemas/dist/content-summary.schema.js +19 -0
- 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/content-unpublish.schema.d.ts +23 -0
- package/node_modules/@kardalum/api-schemas/dist/content-unpublish.schema.js +13 -0
- package/node_modules/@kardalum/api-schemas/dist/content.schema.d.ts +3 -0
- package/node_modules/@kardalum/api-schemas/dist/content.schema.js +10 -0
- package/node_modules/@kardalum/api-schemas/dist/contract-cancel.schema.d.ts +41 -0
- package/node_modules/@kardalum/api-schemas/dist/contract-cancel.schema.js +86 -0
- package/node_modules/@kardalum/api-schemas/dist/core-actions.d.ts +10 -5
- package/node_modules/@kardalum/api-schemas/dist/core-actions.js +7 -4
- package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.d.ts +25 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.js +9 -1
- package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.js +4 -4
- package/node_modules/@kardalum/api-schemas/dist/data-type-issue.d.ts +35 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-issue.js +60 -0
- package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.d.ts +267 -12
- package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +54 -8
- package/node_modules/@kardalum/api-schemas/dist/document-type.schema.d.ts +24 -6
- package/node_modules/@kardalum/api-schemas/dist/document-type.schema.js +98 -13
- package/node_modules/@kardalum/api-schemas/dist/form-protection.d.ts +23 -0
- package/node_modules/@kardalum/api-schemas/dist/form-protection.js +12 -0
- package/node_modules/@kardalum/api-schemas/dist/graphql-limits.d.ts +12 -0
- package/node_modules/@kardalum/api-schemas/dist/graphql-limits.js +14 -0
- package/node_modules/@kardalum/api-schemas/dist/held-embed-words.d.ts +23 -0
- package/node_modules/@kardalum/api-schemas/dist/held-embed-words.js +70 -0
- package/node_modules/@kardalum/api-schemas/dist/index.d.ts +122 -43
- package/node_modules/@kardalum/api-schemas/dist/index.js +92 -27
- package/node_modules/@kardalum/api-schemas/dist/install-sign-in-switched-off.schema.d.ts +9 -0
- package/node_modules/@kardalum/api-schemas/dist/install-sign-in-switched-off.schema.js +9 -0
- package/node_modules/@kardalum/api-schemas/dist/legal-anchors.d.ts +8 -0
- package/node_modules/@kardalum/api-schemas/dist/legal-anchors.js +9 -0
- package/node_modules/@kardalum/api-schemas/dist/licensing.schema.d.ts +63 -0
- package/node_modules/@kardalum/api-schemas/dist/licensing.schema.js +54 -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/mail-rules.d.ts +224 -0
- package/node_modules/@kardalum/api-schemas/dist/mail-rules.js +404 -0
- package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.d.ts +8 -0
- package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.js +4 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-leaks.schema.d.ts +145 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-leaks.schema.js +154 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.d.ts +359 -8
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +85 -11
- package/node_modules/@kardalum/api-schemas/dist/marketplace-package-api.schema.d.ts +15 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-package-api.schema.js +14 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-payouts.schema.d.ts +131 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-payouts.schema.js +272 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-profile.schema.d.ts +84 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-profile.schema.js +138 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-revocation.schema.d.ts +20 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-revocation.schema.js +49 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-sites.schema.d.ts +211 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-sites.schema.js +424 -0
- package/node_modules/@kardalum/api-schemas/dist/mcp-plugins.schema.d.ts +78 -0
- package/node_modules/@kardalum/api-schemas/dist/mcp-plugins.schema.js +27 -0
- package/node_modules/@kardalum/api-schemas/dist/mcp-tool-inputs.schema.d.ts +70 -0
- package/node_modules/@kardalum/api-schemas/dist/mcp-tool-inputs.schema.js +43 -0
- package/node_modules/@kardalum/api-schemas/dist/media-api.schema.d.ts +22 -0
- package/node_modules/@kardalum/api-schemas/dist/media-api.schema.js +22 -10
- package/node_modules/@kardalum/api-schemas/dist/media-move.schema.d.ts +75 -0
- package/node_modules/@kardalum/api-schemas/dist/media-move.schema.js +53 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference-api.schema.d.ts +2 -2
- package/node_modules/@kardalum/api-schemas/dist/media-reference.d.ts +2 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference.js +55 -0
- package/node_modules/@kardalum/api-schemas/dist/media.schema.d.ts +1 -0
- package/node_modules/@kardalum/api-schemas/dist/media.schema.js +9 -5
- package/node_modules/@kardalum/api-schemas/dist/nested-fields.schema.d.ts +204 -0
- package/node_modules/@kardalum/api-schemas/dist/nested-fields.schema.js +370 -0
- package/node_modules/@kardalum/api-schemas/dist/nested-validation.d.ts +53 -0
- package/node_modules/@kardalum/api-schemas/dist/nested-validation.js +284 -0
- package/node_modules/@kardalum/api-schemas/dist/news.schema.d.ts +5 -5
- package/node_modules/@kardalum/api-schemas/dist/node-access.schema.d.ts +1 -2
- package/node_modules/@kardalum/api-schemas/dist/node-access.schema.js +1 -2
- package/node_modules/@kardalum/api-schemas/dist/notification-kinds.d.ts +145 -0
- package/node_modules/@kardalum/api-schemas/dist/notification-kinds.js +177 -0
- package/node_modules/@kardalum/api-schemas/dist/notification.schema.d.ts +258 -7
- package/node_modules/@kardalum/api-schemas/dist/notification.schema.js +96 -5
- package/node_modules/@kardalum/api-schemas/dist/page-address.d.ts +10 -0
- package/node_modules/@kardalum/api-schemas/dist/page-address.js +7 -0
- package/node_modules/@kardalum/api-schemas/dist/password-reset.schema.d.ts +34 -0
- package/node_modules/@kardalum/api-schemas/dist/password-reset.schema.js +60 -0
- package/node_modules/@kardalum/api-schemas/dist/plan-editor.schema.d.ts +28 -3
- package/node_modules/@kardalum/api-schemas/dist/plan-editor.schema.js +55 -8
- package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.d.ts +12 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.js +13 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-caller.d.ts +23 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-caller.js +16 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-cli-commands.d.ts +76 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-cli-commands.js +316 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-content-access.d.ts +42 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-content-access.js +74 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-data-type-configs.d.ts +31 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-data-type-configs.js +131 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.d.ts +26 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-text.js +1 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs.d.ts +26 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs.js +13 -5
- package/node_modules/@kardalum/api-schemas/dist/plugin-document-types.d.ts +228 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-document-types.js +41 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-durable-hooks.d.ts +26 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-durable-hooks.js +55 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-editor-extensions.d.ts +40 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-editor-extensions.js +124 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-field-info.d.ts +41 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-field-info.js +51 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-graphql-fields.d.ts +32 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-graphql-fields.js +102 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-held-embeds.d.ts +107 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-held-embeds.js +213 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-https-origin.d.ts +5 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-https-origin.js +21 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.d.ts +4 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.js +3 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.d.ts +44 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.js +38 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-install.d.ts +237 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-install.js +205 -6
- package/node_modules/@kardalum/api-schemas/dist/plugin-labels.d.ts +26 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-labels.js +29 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-locales.d.ts +32 -8
- package/node_modules/@kardalum/api-schemas/dist/plugin-locales.js +120 -14
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.d.ts +357 -4
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +279 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.d.ts +16 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.js +34 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-ai.d.ts +40 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-ai.js +139 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.d.ts +22 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.js +31 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-media-access.d.ts +25 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-media-access.js +43 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-outbound.d.ts +107 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-outbound.js +150 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-package-build.schema.d.ts +5 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-package-build.schema.js +7 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-providers.d.ts +310 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-providers.js +430 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-read-only.schema.d.ts +4 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-read-only.schema.js +2 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-sealed-values.d.ts +45 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-sealed-values.js +99 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-secrets.d.ts +68 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-secrets.js +114 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-settings.d.ts +342 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-settings.js +400 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-site-extensions.d.ts +180 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-site-extensions.js +612 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.d.ts +7 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.js +50 -7
- package/node_modules/@kardalum/api-schemas/dist/plugin-tasks.d.ts +45 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-tasks.js +197 -0
- package/node_modules/@kardalum/api-schemas/dist/plural-rules.d.ts +9 -0
- package/node_modules/@kardalum/api-schemas/dist/plural-rules.js +41 -0
- package/node_modules/@kardalum/api-schemas/dist/public-api.schema.d.ts +41 -0
- package/node_modules/@kardalum/api-schemas/dist/public-api.schema.js +100 -12
- package/node_modules/@kardalum/api-schemas/dist/refund-request.schema.d.ts +189 -0
- package/node_modules/@kardalum/api-schemas/dist/refund-request.schema.js +164 -0
- package/node_modules/@kardalum/api-schemas/dist/render-editing.d.ts +4 -4
- 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.js +7 -3
- package/node_modules/@kardalum/api-schemas/dist/rich-text-shape.d.ts +6 -0
- package/node_modules/@kardalum/api-schemas/dist/rich-text-shape.js +82 -0
- package/node_modules/@kardalum/api-schemas/dist/rich-text-text.d.ts +66 -0
- package/node_modules/@kardalum/api-schemas/dist/rich-text-text.js +497 -0
- package/node_modules/@kardalum/api-schemas/dist/sale-conditions.schema.d.ts +82 -0
- package/node_modules/@kardalum/api-schemas/dist/sale-conditions.schema.js +99 -0
- package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.d.ts +13 -0
- package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.js +28 -0
- package/node_modules/@kardalum/api-schemas/dist/sandbox-attach.schema.d.ts +91 -1
- package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.d.ts +289 -0
- package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.js +205 -0
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +121 -0
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.js +51 -10
- package/node_modules/@kardalum/api-schemas/dist/sign-in.schema.d.ts +384 -0
- package/node_modules/@kardalum/api-schemas/dist/sign-in.schema.js +616 -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/structured-duplicate-key.d.ts +13 -0
- package/node_modules/@kardalum/api-schemas/dist/structured-duplicate-key.js +26 -0
- package/node_modules/@kardalum/api-schemas/dist/structured-fields.schema.d.ts +66 -0
- package/node_modules/@kardalum/api-schemas/dist/structured-fields.schema.js +160 -0
- package/node_modules/@kardalum/api-schemas/dist/template-api.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/template.schema.d.ts +1 -0
- package/node_modules/@kardalum/api-schemas/dist/template.schema.js +3 -0
- 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/transaction-rolled-back.d.ts +13 -0
- package/node_modules/@kardalum/api-schemas/dist/transaction-rolled-back.js +29 -0
- package/node_modules/@kardalum/api-schemas/dist/trash-purge.schema.d.ts +13 -0
- package/node_modules/@kardalum/api-schemas/dist/trash-purge.schema.js +6 -0
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.d.ts +58 -1
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +35 -4
- package/node_modules/@kardalum/api-schemas/dist/vendor-service.schema.d.ts +5 -1
- package/node_modules/@kardalum/api-schemas/dist/vendor-service.schema.js +4 -3
- package/node_modules/@kardalum/api-schemas/package.json +1 -0
- package/node_modules/@kardalum/design-tokens/dist/build-css.d.ts +1 -1
- package/node_modules/@kardalum/design-tokens/dist/build-css.js +8 -2
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.css +5 -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 +15 -3
- package/node_modules/@kardalum/design-tokens/dist/tokens.d.ts +4 -4
- package/node_modules/@kardalum/design-tokens/dist/tokens.js +17 -8
- package/node_modules/@kardalum/design-tokens/dist/tokens.json +8 -3
- package/node_modules/@kardalum/design-tokens/dist/types.d.ts +2 -2
- package/node_modules/@kardalum/design-tokens/dist/types.js +1 -1
- package/node_modules/@kardalum/plugin-package/dist/build-reference.d.ts +21 -2
- package/node_modules/@kardalum/plugin-package/dist/build-reference.js +8 -2
- package/node_modules/@kardalum/plugin-package/dist/capabilities.d.ts +17 -10
- package/node_modules/@kardalum/plugin-package/dist/capabilities.js +355 -22
- package/node_modules/@kardalum/plugin-package/dist/client-bundle.d.ts +1 -1
- package/node_modules/@kardalum/plugin-package/dist/client-bundle.js +2 -0
- package/node_modules/@kardalum/plugin-package/dist/cms-range.d.ts +17 -0
- package/node_modules/@kardalum/plugin-package/dist/cms-range.js +353 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/ai-declarations.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/ai-declarations.js +26 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.d.ts +1 -1
- package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.js +3 -2
- package/node_modules/@kardalum/plugin-package/dist/delivery/content-access.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/content-access.js +34 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.js +2 -2
- package/node_modules/@kardalum/plugin-package/dist/delivery/editor-extensions.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/editor-extensions.js +27 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/graphql-fields.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/graphql-fields.js +22 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/index.d.ts +1 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/index.js +1 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/label-languages.js +47 -5
- package/node_modules/@kardalum/plugin-package/dist/delivery/licence-check.d.ts +27 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/licence-check.js +95 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/locales.js +9 -4
- package/node_modules/@kardalum/plugin-package/dist/delivery/plugin-settings.d.ts +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/plugin-settings.js +68 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/providers.d.ts +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/providers.js +298 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/registry.js +27 -5
- package/node_modules/@kardalum/plugin-package/dist/delivery/sample-content.js +91 -2
- package/node_modules/@kardalum/plugin-package/dist/delivery/server-powers.d.ts +6 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/server-powers.js +140 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/site-extensions.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/site-extensions.js +36 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/templates.d.ts +1 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/templates.js +21 -1
- package/node_modules/@kardalum/plugin-package/dist/delivery/types.d.ts +10 -0
- 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 +9 -9
- 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 +2 -1
- package/node_modules/@kardalum/plugin-package/dist/license-verdict.d.ts +75 -0
- package/node_modules/@kardalum/plugin-package/dist/license-verdict.js +123 -0
- 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/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 +1 -1
- package/node_modules/@kardalum/ui/dist/components/dialog.d.ts +1 -1
- package/node_modules/@kardalum/ui/dist/components/dialog.js +49 -4
- package/node_modules/@kardalum/ui/dist/components/dropdown-menu.d.ts +5 -1
- package/node_modules/@kardalum/ui/dist/components/dropdown-menu.js +18 -5
- 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/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 +12 -7
- 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/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 +81 -0
- package/node_modules/@kardalum/ui/dist/components/truncated-text.d.ts +16 -0
- package/node_modules/@kardalum/ui/dist/components/truncated-text.js +95 -0
- package/node_modules/@kardalum/ui/dist/components/use-toast.js +2 -2
- package/node_modules/@kardalum/ui/dist/index.d.ts +3 -1
- package/node_modules/@kardalum/ui/dist/index.js +3 -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 +18 -7
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { SlotLabelMap } from "./plugin-labels.js";
|
|
3
|
+
/** The core's notes. The list only grows: an id is persisted on a
|
|
4
|
+
* marketplace version row and read by three surfaces, so a removed or
|
|
5
|
+
* renamed id is a data change, not a cosmetic one. */
|
|
6
|
+
export declare const CAPABILITY_NOTES: readonly ["rawBody", "identifiesPeople", "durable", "methods", "leavesServer", "setsTitle", "embedFrom", "embedKindMap", "embedKindContent", "privacyNoticeAt", "addsScript"];
|
|
7
|
+
export type CapabilityNote = (typeof CAPABILITY_NOTES)[number];
|
|
8
|
+
/** The longest value a note may carry (a method list, an origin, a host). */
|
|
9
|
+
export declare const CAPABILITY_NOTE_VALUE_MAX = 200;
|
|
10
|
+
export type CapabilityDetail = string | {
|
|
11
|
+
text: string | SlotLabelMap;
|
|
12
|
+
notes?: Array<CapabilityNote | {
|
|
13
|
+
id: CapabilityNote;
|
|
14
|
+
value: string;
|
|
15
|
+
}>;
|
|
16
|
+
};
|
|
17
|
+
/** A detail as a response carries it (the marketplace's listing, which a
|
|
18
|
+
* CMS proxies): a note may be an id this build has no words for. A CMS and
|
|
19
|
+
* its marketplace deploy apart, so a newer marketplace's note reaches an
|
|
20
|
+
* older CMS as one id it prints generically (formatCapabilityDetail), never
|
|
21
|
+
* as a listing that fails to parse. What a plugin or the door declares stays
|
|
22
|
+
* CapabilityDetail, with the closed list. */
|
|
23
|
+
export type CapabilityDetailRead = string | {
|
|
24
|
+
text: string | SlotLabelMap;
|
|
25
|
+
notes?: Array<string | {
|
|
26
|
+
id: string;
|
|
27
|
+
value: string;
|
|
28
|
+
}>;
|
|
29
|
+
};
|
|
30
|
+
/** The longest note id a response may carry; the closed list's ids are far shorter. */
|
|
31
|
+
export declare const CAPABILITY_NOTE_ID_READ_MAX = 64;
|
|
32
|
+
/** Whether this build has words for a note id. */
|
|
33
|
+
export declare function isCapabilityNote(id: string): id is CapabilityNote;
|
|
34
|
+
/** A detail, as the derivation writes it and every stored listing and
|
|
35
|
+
* reference carries it. A plain string stays unbounded, as before K2; a
|
|
36
|
+
* text map follows the label map rule (`en` required); a note's value is
|
|
37
|
+
* shown as written, so it is a bounded text with no control character. */
|
|
38
|
+
export declare const CapabilityDetailSchema: z.ZodType<CapabilityDetail>;
|
|
39
|
+
/** A detail as a response carries it: every rule of CapabilityDetailSchema
|
|
40
|
+
* except the closed note list, so an unknown note is kept, not refused. M33
|
|
41
|
+
* part 1 fix wave (critic-2): not strict either, so a key a newer marketplace
|
|
42
|
+
* adds to a detail or a note is dropped, not refused. */
|
|
43
|
+
export declare const CapabilityDetailReadSchema: z.ZodType<CapabilityDetailRead>;
|
|
44
|
+
/** The longest generic line readCapabilityDetail makes of a shape it does not know. */
|
|
45
|
+
export declare const CAPABILITY_DETAIL_GENERIC_MAX = 200;
|
|
46
|
+
/** M33 part 1 fix wave (critic-2): any value a marketplace sends as a detail, as one this build
|
|
47
|
+
* reads. A known shape is read by CapabilityDetailReadSchema (unknown keys dropped); a note in a
|
|
48
|
+
* shape this build does not know is left out of an otherwise readable detail; any other shape is
|
|
49
|
+
* shown generically, as its JSON text cut to CAPABILITY_DETAIL_GENERIC_MAX characters, so drift is
|
|
50
|
+
* visible and never fails the listing. */
|
|
51
|
+
export declare function readCapabilityDetail(raw: unknown): CapabilityDetailRead;
|
|
52
|
+
/** The identifier a detail names, in the reader's language: a plain string
|
|
53
|
+
* as written, else its `text` (a map read as resolveLabel reads it). For a
|
|
54
|
+
* reader that takes the detail as a value, such as a vendor host. */
|
|
55
|
+
export declare function capabilityDetailText(detail: CapabilityDetailRead, language?: string): string;
|
|
56
|
+
/** One detail line as every reader prints it: a plain string as written; an
|
|
57
|
+
* object's text in the reader's language, then its notes in brackets, each
|
|
58
|
+
* in the words `noteWords` gives for it (the reader's own language, held
|
|
59
|
+
* where its capability names are held). A note's value is printed as
|
|
60
|
+
* written in place of its words' `{{value}}`; a detail with an empty text
|
|
61
|
+
* prints its notes alone; the result is text, never
|
|
62
|
+
* markup. A note with no value drops the slot. A note this build has no
|
|
63
|
+
* words for (a newer marketplace's) is printed as its id, then its value
|
|
64
|
+
* after a colon. */
|
|
65
|
+
export declare function formatCapabilityDetail(detail: CapabilityDetailRead, language: string, noteWords: (note: CapabilityNote) => string): string;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { labelMapSchema, labelTextSchema, resolveLabel } from "./plugin-labels.js";
|
|
3
|
+
// M33 K2: one detail line of a derived capability. A plain string is an
|
|
4
|
+
// identifier shown as written (every detail before K2, still valid). An
|
|
5
|
+
// object carries the plugin's own words (`text`, one string or a map read
|
|
6
|
+
// in the reader's language) and the core's words (`notes`), each note an id
|
|
7
|
+
// from a closed list whose words live where capability labels live: English
|
|
8
|
+
// in the SDK's capabilities file, three languages in the admin's locale
|
|
9
|
+
// files and the marketplace's dictionaries. The core's sentences are never
|
|
10
|
+
// carried inside the derivation, so a reader in a fourth language still
|
|
11
|
+
// reads them in its own words once they are worded there.
|
|
12
|
+
/** The core's notes. The list only grows: an id is persisted on a
|
|
13
|
+
* marketplace version row and read by three surfaces, so a removed or
|
|
14
|
+
* renamed id is a data change, not a cosmetic one. */
|
|
15
|
+
export const CAPABILITY_NOTES = [
|
|
16
|
+
"rawBody",
|
|
17
|
+
"identifiesPeople",
|
|
18
|
+
"durable",
|
|
19
|
+
"methods",
|
|
20
|
+
"leavesServer",
|
|
21
|
+
"setsTitle",
|
|
22
|
+
"embedFrom",
|
|
23
|
+
"embedKindMap",
|
|
24
|
+
"embedKindContent",
|
|
25
|
+
"privacyNoticeAt",
|
|
26
|
+
"addsScript",
|
|
27
|
+
];
|
|
28
|
+
/** The longest value a note may carry (a method list, an origin, a host). */
|
|
29
|
+
export const CAPABILITY_NOTE_VALUE_MAX = 200;
|
|
30
|
+
/** The longest note id a response may carry; the closed list's ids are far shorter. */
|
|
31
|
+
export const CAPABILITY_NOTE_ID_READ_MAX = 64;
|
|
32
|
+
const CapabilityNoteSchema = z.enum(CAPABILITY_NOTES);
|
|
33
|
+
const CAPABILITY_NOTE_SET = new Set(CAPABILITY_NOTES);
|
|
34
|
+
/** Whether this build has words for a note id. */
|
|
35
|
+
export function isCapabilityNote(id) {
|
|
36
|
+
return CAPABILITY_NOTE_SET.has(id);
|
|
37
|
+
}
|
|
38
|
+
/** A detail, as the derivation writes it and every stored listing and
|
|
39
|
+
* reference carries it. A plain string stays unbounded, as before K2; a
|
|
40
|
+
* text map follows the label map rule (`en` required); a note's value is
|
|
41
|
+
* shown as written, so it is a bounded text with no control character. */
|
|
42
|
+
export const CapabilityDetailSchema = z.union([
|
|
43
|
+
z.string(),
|
|
44
|
+
z
|
|
45
|
+
.object({
|
|
46
|
+
text: z.union([z.string(), labelMapSchema()]),
|
|
47
|
+
notes: z
|
|
48
|
+
.array(z.union([CapabilityNoteSchema, z.object({ id: CapabilityNoteSchema, value: labelTextSchema({ max: CAPABILITY_NOTE_VALUE_MAX }) }).strict()]))
|
|
49
|
+
.optional(),
|
|
50
|
+
})
|
|
51
|
+
.strict(),
|
|
52
|
+
]);
|
|
53
|
+
const CapabilityNoteReadSchema = labelTextSchema({ max: CAPABILITY_NOTE_ID_READ_MAX });
|
|
54
|
+
/** A detail as a response carries it: every rule of CapabilityDetailSchema
|
|
55
|
+
* except the closed note list, so an unknown note is kept, not refused. M33
|
|
56
|
+
* part 1 fix wave (critic-2): not strict either, so a key a newer marketplace
|
|
57
|
+
* adds to a detail or a note is dropped, not refused. */
|
|
58
|
+
export const CapabilityDetailReadSchema = z.union([
|
|
59
|
+
z.string(),
|
|
60
|
+
z.object({
|
|
61
|
+
text: z.union([z.string(), labelMapSchema()]),
|
|
62
|
+
notes: z
|
|
63
|
+
.array(z.union([CapabilityNoteReadSchema, z.object({ id: CapabilityNoteReadSchema, value: labelTextSchema({ max: CAPABILITY_NOTE_VALUE_MAX }) })]))
|
|
64
|
+
.optional(),
|
|
65
|
+
}),
|
|
66
|
+
]);
|
|
67
|
+
/** The longest generic line readCapabilityDetail makes of a shape it does not know. */
|
|
68
|
+
export const CAPABILITY_DETAIL_GENERIC_MAX = 200;
|
|
69
|
+
/** M33 part 1 fix wave (critic-2): any value a marketplace sends as a detail, as one this build
|
|
70
|
+
* reads. A known shape is read by CapabilityDetailReadSchema (unknown keys dropped); a note in a
|
|
71
|
+
* shape this build does not know is left out of an otherwise readable detail; any other shape is
|
|
72
|
+
* shown generically, as its JSON text cut to CAPABILITY_DETAIL_GENERIC_MAX characters, so drift is
|
|
73
|
+
* visible and never fails the listing. */
|
|
74
|
+
export function readCapabilityDetail(raw) {
|
|
75
|
+
const parsed = CapabilityDetailReadSchema.safeParse(raw);
|
|
76
|
+
if (parsed.success)
|
|
77
|
+
return parsed.data;
|
|
78
|
+
if (raw !== null && typeof raw === "object" && !Array.isArray(raw)) {
|
|
79
|
+
const { text, notes } = raw;
|
|
80
|
+
const readNotes = Array.isArray(notes)
|
|
81
|
+
? notes.filter((note) => CapabilityDetailReadSchema.safeParse({ text: "x", notes: [note] }).success)
|
|
82
|
+
: [];
|
|
83
|
+
const known = CapabilityDetailReadSchema.safeParse({ text, ...(readNotes.length > 0 ? { notes: readNotes } : {}) });
|
|
84
|
+
if (known.success)
|
|
85
|
+
return known.data;
|
|
86
|
+
}
|
|
87
|
+
let generic;
|
|
88
|
+
try {
|
|
89
|
+
generic = JSON.stringify(raw) ?? String(raw);
|
|
90
|
+
}
|
|
91
|
+
catch {
|
|
92
|
+
generic = String(raw);
|
|
93
|
+
}
|
|
94
|
+
return generic.slice(0, CAPABILITY_DETAIL_GENERIC_MAX);
|
|
95
|
+
}
|
|
96
|
+
/** The place in a note's words where its value is printed. */
|
|
97
|
+
const NOTE_VALUE_SLOT = "{{value}}";
|
|
98
|
+
/** The identifier a detail names, in the reader's language: a plain string
|
|
99
|
+
* as written, else its `text` (a map read as resolveLabel reads it). For a
|
|
100
|
+
* reader that takes the detail as a value, such as a vendor host. */
|
|
101
|
+
export function capabilityDetailText(detail, language = "en") {
|
|
102
|
+
return typeof detail === "string" ? detail : resolveLabel(detail.text, language);
|
|
103
|
+
}
|
|
104
|
+
/** One detail line as every reader prints it: a plain string as written; an
|
|
105
|
+
* object's text in the reader's language, then its notes in brackets, each
|
|
106
|
+
* in the words `noteWords` gives for it (the reader's own language, held
|
|
107
|
+
* where its capability names are held). A note's value is printed as
|
|
108
|
+
* written in place of its words' `{{value}}`; a detail with an empty text
|
|
109
|
+
* prints its notes alone; the result is text, never
|
|
110
|
+
* markup. A note with no value drops the slot. A note this build has no
|
|
111
|
+
* words for (a newer marketplace's) is printed as its id, then its value
|
|
112
|
+
* after a colon. */
|
|
113
|
+
export function formatCapabilityDetail(detail, language, noteWords) {
|
|
114
|
+
if (typeof detail === "string")
|
|
115
|
+
return detail;
|
|
116
|
+
const text = resolveLabel(detail.text, language);
|
|
117
|
+
const notes = (detail.notes ?? []).map((note) => {
|
|
118
|
+
if (typeof note === "string")
|
|
119
|
+
return isCapabilityNote(note) ? noteWords(note).split(NOTE_VALUE_SLOT).join("").trim() : note;
|
|
120
|
+
return isCapabilityNote(note.id) ? noteWords(note.id).split(NOTE_VALUE_SLOT).join(note.value) : `${note.id}: ${note.value}`;
|
|
121
|
+
});
|
|
122
|
+
if (notes.length === 0)
|
|
123
|
+
return text;
|
|
124
|
+
// M33 K27: a detail that is only the core's note (the page head's `setsTitle`) prints its words alone.
|
|
125
|
+
return text === "" ? notes.join(", ") : `${text} (${notes.join(", ")})`;
|
|
126
|
+
}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export declare const CultureSchema: z.ZodString;
|
|
3
|
+
/**
|
|
4
|
+
* L3 fix wave: a language tag a write stores on a page: CultureSchema, at most CULTURE_TAG_STORED_MAX characters,
|
|
5
|
+
* the longest tag a page's language pointer holds on every database. Checked here, at the request's boundary, so a
|
|
6
|
+
* longer tag is the ordinary 400 every other refused tag is, never the adapter's refusal surfacing as a 500.
|
|
7
|
+
*/
|
|
8
|
+
export declare const StoredCultureSchema: z.ZodString;
|
|
3
9
|
export declare const CreateContentRequestSchema: z.ZodObject<{
|
|
4
10
|
documentTypeId: z.ZodString;
|
|
5
11
|
parentId: z.ZodNullable<z.ZodString>;
|
|
@@ -136,6 +142,21 @@ export declare const ContentByAddressQuerySchema: z.ZodObject<{
|
|
|
136
142
|
host: z.ZodOptional<z.ZodString>;
|
|
137
143
|
}, z.core.$strip>;
|
|
138
144
|
export type ContentByAddressQuery = z.infer<typeof ContentByAddressQuerySchema>;
|
|
145
|
+
export declare const ContentServingSchema: z.ZodObject<{
|
|
146
|
+
pages: z.ZodBoolean;
|
|
147
|
+
api: z.ZodBoolean;
|
|
148
|
+
publicReads: z.ZodBoolean;
|
|
149
|
+
pageUrl: z.ZodNullable<z.ZodString>;
|
|
150
|
+
reach: z.ZodEnum<{
|
|
151
|
+
unknown: "unknown";
|
|
152
|
+
shown: "shown";
|
|
153
|
+
notPublished: "notPublished";
|
|
154
|
+
notPublishedInLanguage: "notPublishedInLanguage";
|
|
155
|
+
siteNotPublished: "siteNotPublished";
|
|
156
|
+
}>;
|
|
157
|
+
apiPath: z.ZodNullable<z.ZodString>;
|
|
158
|
+
}, z.core.$strip>;
|
|
159
|
+
export type ContentServing = z.infer<typeof ContentServingSchema>;
|
|
139
160
|
export declare const ContentByAddressResponseSchema: z.ZodObject<{
|
|
140
161
|
node: z.ZodObject<{
|
|
141
162
|
id: z.ZodString;
|
|
@@ -182,8 +203,22 @@ export declare const ContentByAddressResponseSchema: z.ZodObject<{
|
|
|
182
203
|
}, z.core.$strip>>;
|
|
183
204
|
}, z.core.$strip>>;
|
|
184
205
|
}, z.core.$strip>;
|
|
206
|
+
serving: z.ZodObject<{
|
|
207
|
+
pages: z.ZodBoolean;
|
|
208
|
+
api: z.ZodBoolean;
|
|
209
|
+
publicReads: z.ZodBoolean;
|
|
210
|
+
pageUrl: z.ZodNullable<z.ZodString>;
|
|
211
|
+
reach: z.ZodEnum<{
|
|
212
|
+
unknown: "unknown";
|
|
213
|
+
shown: "shown";
|
|
214
|
+
notPublished: "notPublished";
|
|
215
|
+
notPublishedInLanguage: "notPublishedInLanguage";
|
|
216
|
+
siteNotPublished: "siteNotPublished";
|
|
217
|
+
}>;
|
|
218
|
+
apiPath: z.ZodNullable<z.ZodString>;
|
|
219
|
+
}, z.core.$strip>;
|
|
185
220
|
}, z.core.$strip>;
|
|
186
|
-
export type ContentByAddressResponse =
|
|
221
|
+
export type ContentByAddressResponse = z.infer<typeof ContentByAddressResponseSchema>;
|
|
187
222
|
export declare const SaveContentRequestSchema: z.ZodObject<{
|
|
188
223
|
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
189
224
|
culture: z.ZodOptional<z.ZodString>;
|
|
@@ -236,16 +271,17 @@ export declare const LatestVersionResponseSchema: z.ZodObject<{
|
|
|
236
271
|
createdBy: z.ZodString;
|
|
237
272
|
}, z.core.$strip>;
|
|
238
273
|
defaultCulture: z.ZodOptional<z.ZodString>;
|
|
274
|
+
saveKeepsName: z.ZodOptional<z.ZodLiteral<true>>;
|
|
239
275
|
fellBack: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
240
276
|
}, z.core.$strip>;
|
|
241
277
|
export type LatestVersionResponse = z.infer<typeof LatestVersionResponseSchema>;
|
|
242
278
|
export declare const ContentVersionMetaSchema: z.ZodObject<{
|
|
243
279
|
id: z.ZodString;
|
|
244
280
|
createdAt: z.ZodString;
|
|
281
|
+
createdBy: z.ZodString;
|
|
245
282
|
version: z.ZodNumber;
|
|
246
283
|
contentId: z.ZodString;
|
|
247
284
|
cultureData: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
|
|
248
|
-
createdBy: z.ZodString;
|
|
249
285
|
}, z.core.$strip>;
|
|
250
286
|
export type ContentVersionMeta = z.infer<typeof ContentVersionMetaSchema>;
|
|
251
287
|
export declare const VersionListQuerySchema: z.ZodObject<{
|
|
@@ -257,10 +293,10 @@ export declare const VersionListResponseSchema: z.ZodObject<{
|
|
|
257
293
|
items: z.ZodArray<z.ZodObject<{
|
|
258
294
|
id: z.ZodString;
|
|
259
295
|
createdAt: z.ZodString;
|
|
296
|
+
createdBy: z.ZodString;
|
|
260
297
|
version: z.ZodNumber;
|
|
261
298
|
contentId: z.ZodString;
|
|
262
299
|
cultureData: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
|
|
263
|
-
createdBy: z.ZodString;
|
|
264
300
|
}, z.core.$strip>>;
|
|
265
301
|
nextCursor: z.ZodNullable<z.ZodNumber>;
|
|
266
302
|
}, z.core.$strip>;
|
|
@@ -393,6 +429,77 @@ export declare const CopyContentRequestSchema: z.ZodObject<{
|
|
|
393
429
|
}, z.core.$strip>;
|
|
394
430
|
export type CopyContentRequest = z.infer<typeof CopyContentRequestSchema>;
|
|
395
431
|
export type CopyContentRequestInput = z.input<typeof CopyContentRequestSchema>;
|
|
432
|
+
export declare const CopyContentResponseSchema: z.ZodObject<{
|
|
433
|
+
readOnlyFields: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
434
|
+
fieldAlias: z.ZodString;
|
|
435
|
+
pluginId: z.ZodString;
|
|
436
|
+
message: z.ZodString;
|
|
437
|
+
}, z.core.$strip>>>;
|
|
438
|
+
node: z.ZodObject<{
|
|
439
|
+
id: z.ZodString;
|
|
440
|
+
parentId: z.ZodNullable<z.ZodString>;
|
|
441
|
+
path: z.ZodString;
|
|
442
|
+
depth: z.ZodNumber;
|
|
443
|
+
sortOrder: z.ZodNumber;
|
|
444
|
+
documentTypeId: z.ZodString;
|
|
445
|
+
publishedAt: z.ZodNullable<z.ZodString>;
|
|
446
|
+
name: z.ZodOptional<z.ZodString>;
|
|
447
|
+
}, z.core.$strip>;
|
|
448
|
+
url: z.ZodNullable<z.ZodString>;
|
|
449
|
+
version: z.ZodObject<{
|
|
450
|
+
id: z.ZodString;
|
|
451
|
+
contentId: z.ZodString;
|
|
452
|
+
version: z.ZodNumber;
|
|
453
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
454
|
+
cultureData: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
|
|
455
|
+
createdAt: z.ZodString;
|
|
456
|
+
createdBy: z.ZodString;
|
|
457
|
+
}, z.core.$strip>;
|
|
458
|
+
culture: z.ZodNullable<z.ZodObject<{
|
|
459
|
+
culture: z.ZodString;
|
|
460
|
+
currentVersion: z.ZodNumber;
|
|
461
|
+
publishedAt: z.ZodNullable<z.ZodString>;
|
|
462
|
+
}, z.core.$strip>>;
|
|
463
|
+
access: z.ZodObject<{
|
|
464
|
+
read: z.ZodBoolean;
|
|
465
|
+
create: z.ZodBoolean;
|
|
466
|
+
update: z.ZodBoolean;
|
|
467
|
+
publish: z.ZodBoolean;
|
|
468
|
+
delete: z.ZodBoolean;
|
|
469
|
+
denied: z.ZodRecord<z.ZodEnum<{
|
|
470
|
+
"content.read": "content.read";
|
|
471
|
+
"content.create": "content.create";
|
|
472
|
+
"content.update": "content.update";
|
|
473
|
+
"content.publish": "content.publish";
|
|
474
|
+
"content.delete": "content.delete";
|
|
475
|
+
}> & z.core.$partial, z.ZodObject<{
|
|
476
|
+
reason: z.ZodEnum<{
|
|
477
|
+
"role-lacks-action": "role-lacks-action";
|
|
478
|
+
"not-granted": "not-granted";
|
|
479
|
+
}>;
|
|
480
|
+
decidedAt: z.ZodNullable<z.ZodObject<{
|
|
481
|
+
nodeId: z.ZodString;
|
|
482
|
+
path: z.ZodNullable<z.ZodString>;
|
|
483
|
+
name: z.ZodNullable<z.ZodString>;
|
|
484
|
+
mode: z.ZodEnum<{
|
|
485
|
+
restricted: "restricted";
|
|
486
|
+
open: "open";
|
|
487
|
+
}>;
|
|
488
|
+
grants: z.ZodArray<z.ZodObject<{
|
|
489
|
+
subjectKind: z.ZodEnum<{
|
|
490
|
+
role: "role";
|
|
491
|
+
user: "user";
|
|
492
|
+
}>;
|
|
493
|
+
subjectId: z.ZodString;
|
|
494
|
+
label: z.ZodNullable<z.ZodString>;
|
|
495
|
+
}, z.core.$strip>>;
|
|
496
|
+
}, z.core.$strip>>;
|
|
497
|
+
}, z.core.$strip>>;
|
|
498
|
+
}, z.core.$strip>;
|
|
499
|
+
prunedPicks: z.ZodNumber;
|
|
500
|
+
prunedUntyped: z.ZodNumber;
|
|
501
|
+
}, z.core.$strip>;
|
|
502
|
+
export type CopyContentResponse = z.infer<typeof CopyContentResponseSchema>;
|
|
396
503
|
export declare const MoveContentRequestSchema: z.ZodObject<{
|
|
397
504
|
targetParentId: z.ZodNullable<z.ZodString>;
|
|
398
505
|
}, z.core.$strip>;
|
|
@@ -520,10 +627,13 @@ export declare const FieldValidationFailureSchema: z.ZodUnion<readonly [z.ZodObj
|
|
|
520
627
|
key: z.ZodString;
|
|
521
628
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
522
629
|
path: z.ZodOptional<z.ZodString>;
|
|
630
|
+
text: z.ZodOptional<z.ZodString>;
|
|
631
|
+
plugin: z.ZodOptional<z.ZodString>;
|
|
523
632
|
}, z.core.$strip>, z.ZodObject<{
|
|
524
633
|
fieldId: z.ZodString;
|
|
525
634
|
message: z.ZodString;
|
|
526
635
|
path: z.ZodOptional<z.ZodString>;
|
|
636
|
+
plugin: z.ZodOptional<z.ZodString>;
|
|
527
637
|
}, z.core.$strip>]>;
|
|
528
638
|
export type FieldValidationFailureResponse = z.infer<typeof FieldValidationFailureSchema>;
|
|
529
639
|
export declare const ContentValidationErrorSchema: z.ZodObject<{
|
|
@@ -533,10 +643,13 @@ export declare const ContentValidationErrorSchema: z.ZodObject<{
|
|
|
533
643
|
key: z.ZodString;
|
|
534
644
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
535
645
|
path: z.ZodOptional<z.ZodString>;
|
|
646
|
+
text: z.ZodOptional<z.ZodString>;
|
|
647
|
+
plugin: z.ZodOptional<z.ZodString>;
|
|
536
648
|
}, z.core.$strip>, z.ZodObject<{
|
|
537
649
|
fieldId: z.ZodString;
|
|
538
650
|
message: z.ZodString;
|
|
539
651
|
path: z.ZodOptional<z.ZodString>;
|
|
652
|
+
plugin: z.ZodOptional<z.ZodString>;
|
|
540
653
|
}, z.core.$strip>]>>;
|
|
541
654
|
heldByPath: z.ZodOptional<z.ZodString>;
|
|
542
655
|
}, z.core.$strip>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { ReadOnlyFieldSchema } from "./plugin-read-only.schema.js";
|
|
3
3
|
import { RESERVED_ROOT_SLUGS, isReservedRootSlug } from "./reserved-slugs.js";
|
|
4
|
-
import { ContentNodeSchema, NodeCultureSchema } from "./content.schema.js";
|
|
4
|
+
import { CULTURE_TAG_STORED_MAX, ContentNodeSchema, NodeCultureSchema } from "./content.schema.js";
|
|
5
5
|
import { ContentVersionSchema } from "./content-version.schema.js";
|
|
6
6
|
import { NodeAccessFlagsSchema } from "./node-access.schema.js";
|
|
7
|
-
// createdBy is deliberately absent from mutation request bodies
|
|
7
|
+
// createdBy is deliberately absent from mutation request bodies: it comes
|
|
8
8
|
// from the authenticated JWT (sub claim), never from the caller.
|
|
9
9
|
// The culture is a BCP 47 language tag, the same shape Accept-Language is
|
|
10
10
|
// matched against.
|
|
@@ -19,6 +19,12 @@ import { NodeAccessFlagsSchema } from "./node-access.schema.js";
|
|
|
19
19
|
export const CultureSchema = z
|
|
20
20
|
.string()
|
|
21
21
|
.regex(/^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$/, "Use a language tag such as en, de or pt-BR.");
|
|
22
|
+
/**
|
|
23
|
+
* L3 fix wave: a language tag a write stores on a page: CultureSchema, at most CULTURE_TAG_STORED_MAX characters,
|
|
24
|
+
* the longest tag a page's language pointer holds on every database. Checked here, at the request's boundary, so a
|
|
25
|
+
* longer tag is the ordinary 400 every other refused tag is, never the adapter's refusal surfacing as a 500.
|
|
26
|
+
*/
|
|
27
|
+
export const StoredCultureSchema = CultureSchema.max(CULTURE_TAG_STORED_MAX, `A language tag is at most ${CULTURE_TAG_STORED_MAX} characters.`);
|
|
22
28
|
export const CreateContentRequestSchema = z.object({
|
|
23
29
|
documentTypeId: z.string().uuid(),
|
|
24
30
|
parentId: z.string().uuid().nullable(),
|
|
@@ -61,7 +67,7 @@ export const ContentItemResponseSchema = z.object({
|
|
|
61
67
|
// What the signed-in person may do on this node (S276).
|
|
62
68
|
access: NodeAccessFlagsSchema,
|
|
63
69
|
});
|
|
64
|
-
// S156 admin by-path lookup
|
|
70
|
+
// S156 admin by-path lookup: the admin origin's honest-headless view
|
|
65
71
|
// resolves a pasted URL against the content tree. Drafts ARE visible here
|
|
66
72
|
// (this is the back office); the public no-leak rule lives on the server
|
|
67
73
|
// origin's bridge, not on this authenticated route.
|
|
@@ -76,8 +82,8 @@ export const ContentByPathResponseSchema = z.object({
|
|
|
76
82
|
});
|
|
77
83
|
// S277c: the admin's by-address lookup reads `path` as a visitor's address
|
|
78
84
|
// (GET /api/manage/v1/content/by-address), where by-path reads it as a stored path.
|
|
79
|
-
// The
|
|
80
|
-
//
|
|
85
|
+
// The node it finds is described exactly as by-path describes it, stored path
|
|
86
|
+
// included; the answer adds `serving` (below).
|
|
81
87
|
//
|
|
82
88
|
// S277d: an address is a host and a path once a site can have its own
|
|
83
89
|
// domain. `host` is the host to read the address on; without it the
|
|
@@ -94,14 +100,41 @@ export const ContentByAddressQuerySchema = z.object({
|
|
|
94
100
|
.optional()
|
|
95
101
|
.describe("The host to read the address on: a host name or an IPv4 address with an optional port. A port selects a site whose domain was stored with that port; a scheme in front is ignored. Defaults to the host of this request."),
|
|
96
102
|
});
|
|
97
|
-
|
|
103
|
+
// M33 Reading time task 1: what this install serves, so the admin's screen for a content URL says
|
|
104
|
+
// where the page really is. The admin cannot read the switches itself without settings.read.
|
|
105
|
+
export const ContentServingSchema = z.object({
|
|
106
|
+
/** True when this server registered its page rendering at start-up (KARDALUM_RENDER). */
|
|
107
|
+
pages: z.boolean(),
|
|
108
|
+
/** True when this server registered the delivery API (/api/v1) at start-up (KARDALUM_HEADLESS). */
|
|
109
|
+
api: z.boolean(),
|
|
110
|
+
/** True when the delivery API reads published content with no key (KARDALUM_PUBLIC_READS, with api). */
|
|
111
|
+
publicReads: z.boolean(),
|
|
112
|
+
/** Where a visitor reads the page, in the language the address named (else the default one): a
|
|
113
|
+
* full URL when the server knows its public URL or the site has a domain, otherwise the visitor
|
|
114
|
+
* path. Null while pages is false, and for a page no visitor reaches (not published, or of an
|
|
115
|
+
* unpublished site with a domain of its own) or one the asker may not read. */
|
|
116
|
+
pageUrl: z.string().nullable(),
|
|
117
|
+
/** Whether a visitor reads the page at the address asked about, by the renderer's own rule: in
|
|
118
|
+
* the address's language when it is published in that language or in the default one.
|
|
119
|
+
* `shown`: it is (`pageUrl` may still be null, when no link can be made from the admin's own
|
|
120
|
+
* address); `notPublished`: published in no language; `notPublishedInLanguage`: published only
|
|
121
|
+
* in other languages; `siteNotPublished`: published, but its site is not and has a domain of
|
|
122
|
+
* its own, so no address serves it; `unknown`: the asker may not read the page, so nothing more
|
|
123
|
+
* is said about it. */
|
|
124
|
+
reach: z.enum(["shown", "notPublished", "notPublishedInLanguage", "siteNotPublished", "unknown"]),
|
|
125
|
+
/** The delivery API address that answers this page, a path on this server (the stored path, and
|
|
126
|
+
* the language when the address named one other than the default). Null while api is false,
|
|
127
|
+
* for a page the API answers 404 for in that language, and for one the asker may not read. */
|
|
128
|
+
apiPath: z.string().nullable(),
|
|
129
|
+
});
|
|
130
|
+
export const ContentByAddressResponseSchema = ContentByPathResponseSchema.extend({ serving: ContentServingSchema });
|
|
98
131
|
export const SaveContentRequestSchema = z.object({
|
|
99
132
|
data: z.record(z.string(), z.unknown()),
|
|
100
133
|
// S230: which culture the varying fields in `data` belong to. Omitted
|
|
101
134
|
// means the site's default culture. Publish already took a culture; save
|
|
102
135
|
// did not, so there was no route by which German content could be saved
|
|
103
136
|
// at all, only published.
|
|
104
|
-
culture:
|
|
137
|
+
culture: StoredCultureSchema.optional(),
|
|
105
138
|
// S233: the version the editor had loaded when it saved. The other
|
|
106
139
|
// languages' slices are carried from this version instead of the latest,
|
|
107
140
|
// so a save from a loaded old version stores what every language tab
|
|
@@ -146,18 +179,24 @@ export const LatestVersionResponseSchema = z.object({
|
|
|
146
179
|
// the latest read and on the one-version read alike; it is optional so a
|
|
147
180
|
// client reading an older server, or a test double, need not carry it.
|
|
148
181
|
defaultCulture: CultureSchema.optional(),
|
|
182
|
+
// S366c: true when a save that names no `_name` keeps the page's name and
|
|
183
|
+
// does not move it (S366 D3), in every culture. A client patching the
|
|
184
|
+
// newest save (the CLI's --field) then leaves the name out unless it was
|
|
185
|
+
// given; a server older than S366 says nothing, and there a default
|
|
186
|
+
// culture's save without the name would drop it.
|
|
187
|
+
saveKeepsName: z.literal(true).optional(),
|
|
149
188
|
// With ?locale=: the varying field ids this language has no value for,
|
|
150
189
|
// whether or not the default language has one. Unlike the public read,
|
|
151
190
|
// where fellBack lists only the fields actually filled from the default.
|
|
152
191
|
// Absent without locale.
|
|
153
192
|
fellBack: z.array(z.string()).optional(),
|
|
154
193
|
});
|
|
155
|
-
// Version history list: metadata only
|
|
194
|
+
// Version history list: metadata only: `data` can be arbitrarily large
|
|
156
195
|
// and the history view only needs the row facts; the full snapshot is one
|
|
157
196
|
// GET /api/manage/v1/content/:id/versions/:version away.
|
|
158
197
|
export const ContentVersionMetaSchema = ContentVersionSchema.omit({ data: true });
|
|
159
198
|
// Newest-first pages. Version numbers are contiguous (1..latest, rows are
|
|
160
|
-
// never deleted
|
|
199
|
+
// never deleted: immutability), so the cursor is simply the last version
|
|
161
200
|
// number of the previous page.
|
|
162
201
|
export const VersionListQuerySchema = z.object({
|
|
163
202
|
cursor: z.coerce.number().int().positive().optional(),
|
|
@@ -173,7 +212,7 @@ export const PublishContentRequestSchema = z.object({
|
|
|
173
212
|
version: z.number().int().positive().optional(),
|
|
174
213
|
// S229b: which culture's pointer to move. Omitted = the site's default
|
|
175
214
|
// culture, resolved server-side from Settings.
|
|
176
|
-
culture:
|
|
215
|
+
culture: StoredCultureSchema.optional(),
|
|
177
216
|
});
|
|
178
217
|
// S233: publish-all at a version other than the latest, the whole-node
|
|
179
218
|
// rollback. Omitted = the latest saved version, as before.
|
|
@@ -204,7 +243,7 @@ export const PublishAllResponseSchema = z.object({ results: z.array(PublishAllRe
|
|
|
204
243
|
// short-TTL, single-content-id preview token (see
|
|
205
244
|
// apps/server/src/auth/preview-tokens.ts). Any existing content id may be
|
|
206
245
|
// minted for, published or not; `expiresAt` is an ISO datetime string.
|
|
207
|
-
// Session 117: added `previewUrl
|
|
246
|
+
// Session 117: added `previewUrl`: the full preview URL (including token),
|
|
208
247
|
// or null if KARDALUM_PREVIEW_BASE_URL is not configured.
|
|
209
248
|
export const PreviewTokenResponseSchema = z.object({
|
|
210
249
|
token: z.string(),
|
|
@@ -269,6 +308,12 @@ export const CopyContentRequestSchema = z.object({
|
|
|
269
308
|
// is the common case and stays the default.
|
|
270
309
|
includeChildren: z.boolean().default(false),
|
|
271
310
|
});
|
|
311
|
+
// M32 I2 (A5): a copy answers how many picked pages it took out of the copy. M32 I5 (D12):
|
|
312
|
+
// `prunedUntyped` counts the stored values it left out because no data type can read them.
|
|
313
|
+
export const CopyContentResponseSchema = ContentItemResponseSchema.extend({
|
|
314
|
+
prunedPicks: z.number().int().nonnegative(),
|
|
315
|
+
prunedUntyped: z.number().int().nonnegative(),
|
|
316
|
+
});
|
|
272
317
|
export const MoveContentRequestSchema = z.object({
|
|
273
318
|
targetParentId: z.string().uuid().nullable(),
|
|
274
319
|
});
|
|
@@ -293,7 +338,7 @@ export const ContentChildrenResponseSchema = z.object({
|
|
|
293
338
|
// null = no more pages.
|
|
294
339
|
nextCursor: z.string().uuid().nullable(),
|
|
295
340
|
});
|
|
296
|
-
// Whole-array reorder (mirrors the document-type fields/tabs pattern)
|
|
341
|
+
// Whole-array reorder (mirrors the document-type fields/tabs pattern):
|
|
297
342
|
// orderedIds must exactly match the current children of the parent (or
|
|
298
343
|
// root nodes, for /api/manage/v1/content/roots/reorder); the adapter rejects
|
|
299
344
|
// otherwise. Only practical for a fully-loaded sibling list, so the admin
|
|
@@ -305,28 +350,34 @@ export const ReorderNodesResponseSchema = z.object({
|
|
|
305
350
|
success: z.literal(true),
|
|
306
351
|
});
|
|
307
352
|
// The one deliberate exception to ApiErrorSchema's "every route, same
|
|
308
|
-
// shape" rule (api-error.schema.ts)
|
|
353
|
+
// shape" rule (api-error.schema.ts): field validation failures are
|
|
309
354
|
// per-field by nature, and the admin editor needs that structure to
|
|
310
355
|
// eventually highlight the right field/tab, not just show a string.
|
|
311
356
|
//
|
|
312
357
|
// Two reporting routes (S198): a webmaster-configured rule and a built-in
|
|
313
358
|
// datatype's hook both report `key` (a translation key the admin already
|
|
314
359
|
// renders); a third-party datatype's hook reports `message` (its own
|
|
315
|
-
// string
|
|
316
|
-
//
|
|
317
|
-
//
|
|
318
|
-
//
|
|
360
|
+
// string), or since M33 K46 a `key` from its own locales with `plugin`, the
|
|
361
|
+
// plugin's id the core sets, naming the namespace the key is read in. Exactly
|
|
362
|
+
// one of `key` and `message` is present, and `path` names a sub-key inside a
|
|
363
|
+
// composite value (a date range's "end") so the form can mark the precise
|
|
364
|
+
// sub-input rather than the whole field.
|
|
319
365
|
export const FieldValidationFailureSchema = z.union([
|
|
320
366
|
z.object({
|
|
321
367
|
fieldId: z.string(),
|
|
322
368
|
key: z.string(),
|
|
323
369
|
params: z.record(z.string(), z.unknown()).optional(),
|
|
324
370
|
path: z.string().optional(),
|
|
371
|
+
// M32 I5 (D14): the key in English, beside the key, for a caller with no locale of its own.
|
|
372
|
+
// M33 K46: for a plugin's key, its own English message, or a generic sentence; never the key.
|
|
373
|
+
text: z.string().optional(),
|
|
374
|
+
plugin: z.string().optional().describe("Set on a plugin data type's failure: the plugin's id, whose own locales hold the key. Set by the server, never by the plugin."),
|
|
325
375
|
}),
|
|
326
376
|
z.object({
|
|
327
377
|
fieldId: z.string(),
|
|
328
378
|
message: z.string(),
|
|
329
379
|
path: z.string().optional(),
|
|
380
|
+
plugin: z.string().optional().describe("Set on a plugin data type's failure: the plugin's id. Set by the server, never by the plugin."),
|
|
330
381
|
}),
|
|
331
382
|
]);
|
|
332
383
|
export const ContentValidationErrorSchema = z.object({
|
|
@@ -342,7 +393,9 @@ export const ContentValidationErrorSchema = z.object({
|
|
|
342
393
|
// language dimension at all.
|
|
343
394
|
export const CultureSettingsSchema = z
|
|
344
395
|
.object({
|
|
345
|
-
|
|
396
|
+
// M32 L3: a page's language pointer stores at most CULTURE_TAG_STORED_MAX characters on every dialect, so
|
|
397
|
+
// the site never lists a language its pages could not be saved in.
|
|
398
|
+
cultures: z.array(StoredCultureSchema).min(1),
|
|
346
399
|
defaultCulture: CultureSchema,
|
|
347
400
|
})
|
|
348
401
|
.refine((value) => value.cultures.includes(value.defaultCulture), {
|