@kardalum/plugin-sdk 0.0.0-stage → 0.16.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 +118 -0
- package/LICENSE +202 -0
- package/README.md +80 -2
- package/dist/admin-section-registry.d.ts +34 -0
- package/dist/admin-section-registry.js +49 -0
- package/dist/built-in-serializers.d.ts +3 -0
- package/dist/built-in-serializers.js +18 -0
- package/dist/built-in-settings-schemas.d.ts +14 -0
- package/dist/built-in-settings-schemas.js +225 -0
- package/dist/built-in-value-schemas.d.ts +4 -0
- package/dist/built-in-value-schemas.js +47 -0
- package/dist/built-ins.d.ts +1 -0
- package/dist/built-ins.js +257 -0
- package/dist/capabilities.d.ts +29 -0
- package/dist/capabilities.js +67 -0
- package/dist/data-type-plugin.d.ts +28 -0
- package/dist/data-type-plugin.js +1 -0
- package/dist/datatype-validation.d.ts +26 -0
- package/dist/datatype-validation.js +110 -0
- package/dist/datatypes-entry.d.ts +4 -0
- package/dist/datatypes-entry.js +18 -0
- package/dist/define-plugin.d.ts +25 -0
- package/dist/define-plugin.js +51 -0
- package/dist/entitlement-entry.d.ts +5 -0
- package/dist/entitlement-entry.js +24 -0
- package/dist/entitlement-gate.d.ts +36 -0
- package/dist/entitlement-gate.js +201 -0
- package/dist/entitlement-types.d.ts +39 -0
- package/dist/entitlement-types.js +1 -0
- package/dist/entitlement.d.ts +57 -0
- package/dist/entitlement.js +170 -0
- package/dist/host-entry.d.ts +1 -0
- package/dist/host-entry.js +11 -0
- package/dist/icon-name.d.ts +1 -0
- package/dist/icon-name.js +1 -0
- package/dist/icons.d.ts +2 -0
- package/dist/icons.js +10 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.js +94 -0
- package/dist/license-verdict-keys.d.ts +18 -0
- package/dist/license-verdict-keys.js +26 -0
- package/dist/local-host.d.ts +3 -0
- package/dist/local-host.js +38 -0
- package/dist/manifest-entry.d.ts +8 -0
- package/dist/manifest-entry.js +13 -0
- package/dist/manifest-schema.d.ts +476 -0
- package/dist/manifest-schema.js +823 -0
- package/dist/manifest.d.ts +611 -0
- package/dist/manifest.js +86 -0
- package/dist/media/media-picker.d.ts +39 -0
- package/dist/media/media-picker.js +447 -0
- package/dist/media/upload-error.d.ts +12 -0
- package/dist/media/upload-error.js +30 -0
- package/dist/plugin-context.d.ts +82 -0
- package/dist/plugin-context.js +77 -0
- package/dist/plugin-screen-context.d.ts +71 -0
- package/dist/plugin-screen-context.js +41 -0
- package/dist/read-all-pages.d.ts +23 -0
- package/dist/read-all-pages.js +30 -0
- package/dist/register-built-ins.d.ts +1 -0
- package/dist/register-built-ins.js +41 -0
- package/dist/registry.d.ts +4 -0
- package/dist/registry.js +17 -0
- package/dist/rendition-eligibility.d.ts +24 -0
- package/dist/rendition-eligibility.js +40 -0
- package/dist/richtext/block-panel.d.ts +27 -0
- package/dist/richtext/block-panel.js +232 -0
- package/dist/richtext/extensions.d.ts +19 -0
- package/dist/richtext/extensions.js +56 -0
- package/dist/richtext/insert-menu.d.ts +24 -0
- package/dist/richtext/insert-menu.js +142 -0
- package/dist/richtext/kardalum-block.d.ts +33 -0
- package/dist/richtext/kardalum-block.js +282 -0
- package/dist/richtext/style-listbox.d.ts +10 -0
- package/dist/richtext/style-listbox.js +69 -0
- package/dist/richtext/text-style-class.d.ts +18 -0
- package/dist/richtext/text-style-class.js +36 -0
- package/dist/simple-storage-value-provider.d.ts +9 -0
- package/dist/simple-storage-value-provider.js +96 -0
- package/dist/structured-storage-types.d.ts +61 -0
- package/dist/structured-storage-types.js +11 -0
- package/dist/tailwind.d.ts +1 -0
- package/dist/tailwind.js +5 -0
- package/dist/tokens/system-dark.css +75 -0
- package/dist/tokens/tokens.css +239 -0
- package/dist/tokens/tokens.json +212 -0
- package/dist/tokens.d.ts +1 -0
- package/dist/tokens.js +11 -0
- package/dist/ui-entry.d.ts +5 -0
- package/dist/ui-entry.js +42 -0
- package/dist/views/content-list-preview.d.ts +1 -0
- package/dist/views/content-list-preview.js +14 -0
- package/dist/views/content-list-settings-view.d.ts +1 -0
- package/dist/views/content-list-settings-view.js +97 -0
- package/dist/views/content-list-view.d.ts +19 -0
- package/dist/views/content-list-view.js +248 -0
- package/dist/views/crop-view.d.ts +55 -0
- package/dist/views/crop-view.js +161 -0
- package/dist/views/date-range-view.d.ts +6 -0
- package/dist/views/date-range-view.js +55 -0
- package/dist/views/file-upload-view.d.ts +43 -0
- package/dist/views/file-upload-view.js +104 -0
- package/dist/views/html-code-editor.d.ts +10 -0
- package/dist/views/html-code-editor.js +101 -0
- package/dist/views/html-view.d.ts +3 -0
- package/dist/views/html-view.js +53 -0
- package/dist/views/image-view.d.ts +3 -0
- package/dist/views/image-view.js +372 -0
- package/dist/views/rich-text-view.d.ts +2 -0
- package/dist/views/rich-text-view.js +429 -0
- package/node_modules/@kardalum/api-schemas/LICENSE +202 -0
- package/node_modules/@kardalum/api-schemas/README.md +56 -0
- package/node_modules/@kardalum/api-schemas/dist/action.schema.d.ts +30 -0
- package/node_modules/@kardalum/api-schemas/dist/action.schema.js +88 -0
- package/node_modules/@kardalum/api-schemas/dist/api-error.schema.d.ts +17 -0
- package/node_modules/@kardalum/api-schemas/dist/api-error.schema.js +25 -0
- package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.d.ts +93 -0
- package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.js +88 -0
- package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.d.ts +89 -0
- package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.js +60 -0
- package/node_modules/@kardalum/api-schemas/dist/asset.schema.d.ts +24 -0
- package/node_modules/@kardalum/api-schemas/dist/asset.schema.js +47 -0
- package/node_modules/@kardalum/api-schemas/dist/auth.schema.d.ts +38 -0
- package/node_modules/@kardalum/api-schemas/dist/auth.schema.js +38 -0
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.d.ts +542 -0
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.js +357 -0
- package/node_modules/@kardalum/api-schemas/dist/content-list.schema.d.ts +158 -0
- package/node_modules/@kardalum/api-schemas/dist/content-list.schema.js +139 -0
- package/node_modules/@kardalum/api-schemas/dist/content-path.d.ts +125 -0
- package/node_modules/@kardalum/api-schemas/dist/content-path.js +260 -0
- package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.d.ts +20 -0
- package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.js +23 -0
- package/node_modules/@kardalum/api-schemas/dist/content-trash.schema.d.ts +152 -0
- package/node_modules/@kardalum/api-schemas/dist/content-trash.schema.js +82 -0
- package/node_modules/@kardalum/api-schemas/dist/content-version.schema.d.ts +18 -0
- package/node_modules/@kardalum/api-schemas/dist/content-version.schema.js +22 -0
- package/node_modules/@kardalum/api-schemas/dist/content.schema.d.ts +17 -0
- package/node_modules/@kardalum/api-schemas/dist/content.schema.js +20 -0
- package/node_modules/@kardalum/api-schemas/dist/core-actions.d.ts +352 -0
- package/node_modules/@kardalum/api-schemas/dist/core-actions.js +133 -0
- package/node_modules/@kardalum/api-schemas/dist/culture-direction.d.ts +1 -0
- package/node_modules/@kardalum/api-schemas/dist/culture-direction.js +9 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.d.ts +37 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.js +32 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.d.ts +9 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.js +32 -0
- package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.d.ts +298 -0
- package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +138 -0
- package/node_modules/@kardalum/api-schemas/dist/document-type.schema.d.ts +121 -0
- package/node_modules/@kardalum/api-schemas/dist/document-type.schema.js +147 -0
- package/node_modules/@kardalum/api-schemas/dist/health.schema.d.ts +6 -0
- package/node_modules/@kardalum/api-schemas/dist/health.schema.js +5 -0
- package/node_modules/@kardalum/api-schemas/dist/html-entities.d.ts +4 -0
- package/node_modules/@kardalum/api-schemas/dist/html-entities.js +250 -0
- package/node_modules/@kardalum/api-schemas/dist/index.d.ts +113 -0
- package/node_modules/@kardalum/api-schemas/dist/index.js +64 -0
- package/node_modules/@kardalum/api-schemas/dist/licensing.schema.d.ts +15 -0
- package/node_modules/@kardalum/api-schemas/dist/licensing.schema.js +14 -0
- package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.d.ts +73 -0
- package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.js +104 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.d.ts +682 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +269 -0
- package/node_modules/@kardalum/api-schemas/dist/media-api.schema.d.ts +177 -0
- package/node_modules/@kardalum/api-schemas/dist/media-api.schema.js +222 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference-api.schema.d.ts +77 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference-api.schema.js +53 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference-use.d.ts +75 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference-use.js +117 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference.d.ts +27 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference.js +279 -0
- package/node_modules/@kardalum/api-schemas/dist/media-rendition.schema.d.ts +74 -0
- package/node_modules/@kardalum/api-schemas/dist/media-rendition.schema.js +157 -0
- package/node_modules/@kardalum/api-schemas/dist/media.schema.d.ts +80 -0
- package/node_modules/@kardalum/api-schemas/dist/media.schema.js +156 -0
- package/node_modules/@kardalum/api-schemas/dist/nav.schema.d.ts +23 -0
- package/node_modules/@kardalum/api-schemas/dist/nav.schema.js +55 -0
- package/node_modules/@kardalum/api-schemas/dist/node-access.schema.d.ts +846 -0
- package/node_modules/@kardalum/api-schemas/dist/node-access.schema.js +356 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.d.ts +20 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.js +27 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.d.ts +249 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.js +84 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-text.d.ts +65 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-text.js +889 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs.d.ts +172 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs.js +196 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.d.ts +31 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.js +38 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.d.ts +69 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.js +59 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-install.d.ts +585 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-install.js +536 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-locales.d.ts +75 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-locales.js +213 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.d.ts +391 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +413 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.d.ts +29 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.js +100 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.d.ts +44 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.js +162 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.d.ts +31 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.js +25 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.d.ts +15 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.js +24 -0
- package/node_modules/@kardalum/api-schemas/dist/public-api.schema.d.ts +314 -0
- package/node_modules/@kardalum/api-schemas/dist/public-api.schema.js +338 -0
- package/node_modules/@kardalum/api-schemas/dist/render-editing.d.ts +79 -0
- package/node_modules/@kardalum/api-schemas/dist/render-editing.js +50 -0
- package/node_modules/@kardalum/api-schemas/dist/render-settings-api.schema.d.ts +9 -0
- package/node_modules/@kardalum/api-schemas/dist/render-settings-api.schema.js +13 -0
- package/node_modules/@kardalum/api-schemas/dist/reserved-slugs.d.ts +2 -0
- package/node_modules/@kardalum/api-schemas/dist/reserved-slugs.js +16 -0
- package/node_modules/@kardalum/api-schemas/dist/role.schema.d.ts +96 -0
- package/node_modules/@kardalum/api-schemas/dist/role.schema.js +75 -0
- package/node_modules/@kardalum/api-schemas/dist/sample-content-outcome.schema.d.ts +17 -0
- package/node_modules/@kardalum/api-schemas/dist/sample-content-outcome.schema.js +27 -0
- package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.d.ts +35 -0
- package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.js +79 -0
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +138 -0
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.js +105 -0
- package/node_modules/@kardalum/api-schemas/dist/sites.schema.d.ts +243 -0
- package/node_modules/@kardalum/api-schemas/dist/sites.schema.js +296 -0
- package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.d.ts +47 -0
- package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.js +27 -0
- package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.d.ts +30 -0
- package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.js +19 -0
- package/node_modules/@kardalum/api-schemas/dist/template-api.schema.d.ts +112 -0
- package/node_modules/@kardalum/api-schemas/dist/template-api.schema.js +74 -0
- package/node_modules/@kardalum/api-schemas/dist/template.schema.d.ts +41 -0
- package/node_modules/@kardalum/api-schemas/dist/template.schema.js +39 -0
- package/node_modules/@kardalum/api-schemas/dist/theme-api.schema.d.ts +21 -0
- package/node_modules/@kardalum/api-schemas/dist/theme-api.schema.js +14 -0
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.d.ts +97 -0
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +73 -0
- package/node_modules/@kardalum/api-schemas/package.json +35 -0
- package/node_modules/@kardalum/design-tokens/LICENSE +202 -0
- package/node_modules/@kardalum/design-tokens/README.md +29 -0
- package/node_modules/@kardalum/design-tokens/dist/build-css.d.ts +32 -0
- package/node_modules/@kardalum/design-tokens/dist/build-css.js +88 -0
- package/node_modules/@kardalum/design-tokens/dist/generate.d.ts +1 -0
- package/node_modules/@kardalum/design-tokens/dist/generate.js +18 -0
- package/node_modules/@kardalum/design-tokens/dist/index.d.ts +6 -0
- package/node_modules/@kardalum/design-tokens/dist/index.js +4 -0
- package/node_modules/@kardalum/design-tokens/dist/system-dark.css +75 -0
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.d.ts +33 -0
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.js +54 -0
- package/node_modules/@kardalum/design-tokens/dist/theme-css.d.ts +12 -0
- package/node_modules/@kardalum/design-tokens/dist/theme-css.js +42 -0
- package/node_modules/@kardalum/design-tokens/dist/theme-types.d.ts +43 -0
- package/node_modules/@kardalum/design-tokens/dist/theme-types.js +1 -0
- package/node_modules/@kardalum/design-tokens/dist/themes/dark.d.ts +13 -0
- package/node_modules/@kardalum/design-tokens/dist/themes/dark.js +120 -0
- package/node_modules/@kardalum/design-tokens/dist/themes/index.d.ts +5 -0
- package/node_modules/@kardalum/design-tokens/dist/themes/index.js +4 -0
- package/node_modules/@kardalum/design-tokens/dist/themes/light.d.ts +9 -0
- package/node_modules/@kardalum/design-tokens/dist/themes/light.js +13 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.css +239 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.d.ts +25 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.js +276 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.json +212 -0
- package/node_modules/@kardalum/design-tokens/dist/types.d.ts +91 -0
- package/node_modules/@kardalum/design-tokens/dist/types.js +5 -0
- package/node_modules/@kardalum/design-tokens/package.json +42 -0
- package/node_modules/@kardalum/plugin-package/LICENSE +202 -0
- package/node_modules/@kardalum/plugin-package/README.md +71 -0
- package/node_modules/@kardalum/plugin-package/dist/build-reference.d.ts +111 -0
- package/node_modules/@kardalum/plugin-package/dist/build-reference.js +61 -0
- package/node_modules/@kardalum/plugin-package/dist/capabilities.d.ts +103 -0
- package/node_modules/@kardalum/plugin-package/dist/capabilities.js +351 -0
- package/node_modules/@kardalum/plugin-package/dist/docs-contract.d.ts +50 -0
- package/node_modules/@kardalum/plugin-package/dist/docs-contract.js +659 -0
- package/node_modules/@kardalum/plugin-package/dist/envelope.d.ts +19 -0
- package/node_modules/@kardalum/plugin-package/dist/envelope.js +104 -0
- package/node_modules/@kardalum/plugin-package/dist/extract.d.ts +37 -0
- package/node_modules/@kardalum/plugin-package/dist/extract.js +199 -0
- package/node_modules/@kardalum/plugin-package/dist/hash.d.ts +17 -0
- package/node_modules/@kardalum/plugin-package/dist/hash.js +69 -0
- package/node_modules/@kardalum/plugin-package/dist/index.d.ts +13 -0
- package/node_modules/@kardalum/plugin-package/dist/index.js +8 -0
- package/node_modules/@kardalum/plugin-package/dist/license-verdict.d.ts +185 -0
- package/node_modules/@kardalum/plugin-package/dist/license-verdict.js +236 -0
- package/node_modules/@kardalum/plugin-package/dist/package-contract.d.ts +50 -0
- package/node_modules/@kardalum/plugin-package/dist/package-contract.js +115 -0
- package/node_modules/@kardalum/plugin-package/dist/reference-entry.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/reference-entry.js +6 -0
- package/node_modules/@kardalum/plugin-package/dist/sample-content.d.ts +20 -0
- package/node_modules/@kardalum/plugin-package/dist/sample-content.js +57 -0
- package/node_modules/@kardalum/plugin-package/dist/types.d.ts +43 -0
- package/node_modules/@kardalum/plugin-package/dist/types.js +15 -0
- package/node_modules/@kardalum/plugin-package/package.json +54 -0
- package/node_modules/@kardalum/ui/LICENSE +202 -0
- package/node_modules/@kardalum/ui/README.md +35 -0
- package/node_modules/@kardalum/ui/dist/components/alert-dialog.d.ts +14 -0
- package/node_modules/@kardalum/ui/dist/components/alert-dialog.js +38 -0
- package/node_modules/@kardalum/ui/dist/components/badge.d.ts +9 -0
- package/node_modules/@kardalum/ui/dist/components/badge.js +30 -0
- package/node_modules/@kardalum/ui/dist/components/button.d.ts +11 -0
- package/node_modules/@kardalum/ui/dist/components/button.js +37 -0
- package/node_modules/@kardalum/ui/dist/components/checkbox.d.ts +5 -0
- package/node_modules/@kardalum/ui/dist/components/checkbox.js +7 -0
- package/node_modules/@kardalum/ui/dist/components/dialog.d.ts +17 -0
- package/node_modules/@kardalum/ui/dist/components/dialog.js +48 -0
- package/node_modules/@kardalum/ui/dist/components/dropdown-menu.d.ts +18 -0
- package/node_modules/@kardalum/ui/dist/components/dropdown-menu.js +53 -0
- package/node_modules/@kardalum/ui/dist/components/empty-state.d.ts +30 -0
- package/node_modules/@kardalum/ui/dist/components/empty-state.js +9 -0
- package/node_modules/@kardalum/ui/dist/components/input.d.ts +4 -0
- package/node_modules/@kardalum/ui/dist/components/input.js +6 -0
- package/node_modules/@kardalum/ui/dist/components/panel.d.ts +5 -0
- package/node_modules/@kardalum/ui/dist/components/panel.js +6 -0
- package/node_modules/@kardalum/ui/dist/components/property-field.d.ts +19 -0
- package/node_modules/@kardalum/ui/dist/components/property-field.js +89 -0
- package/node_modules/@kardalum/ui/dist/components/sheet.d.ts +17 -0
- package/node_modules/@kardalum/ui/dist/components/sheet.js +55 -0
- package/node_modules/@kardalum/ui/dist/components/skeleton.d.ts +3 -0
- package/node_modules/@kardalum/ui/dist/components/skeleton.js +9 -0
- package/node_modules/@kardalum/ui/dist/components/switch.d.ts +5 -0
- package/node_modules/@kardalum/ui/dist/components/switch.js +7 -0
- package/node_modules/@kardalum/ui/dist/components/tab-strip.d.ts +34 -0
- package/node_modules/@kardalum/ui/dist/components/tab-strip.js +72 -0
- package/node_modules/@kardalum/ui/dist/components/toast.d.ts +18 -0
- package/node_modules/@kardalum/ui/dist/components/toast.js +42 -0
- package/node_modules/@kardalum/ui/dist/components/toaster.d.ts +12 -0
- package/node_modules/@kardalum/ui/dist/components/toaster.js +11 -0
- package/node_modules/@kardalum/ui/dist/components/use-toast.d.ts +17 -0
- package/node_modules/@kardalum/ui/dist/components/use-toast.js +62 -0
- package/node_modules/@kardalum/ui/dist/index.d.ts +18 -0
- package/node_modules/@kardalum/ui/dist/index.js +18 -0
- package/node_modules/@kardalum/ui/dist/lib/cn.d.ts +2 -0
- package/node_modules/@kardalum/ui/dist/lib/cn.js +5 -0
- package/node_modules/@kardalum/ui/package.json +63 -0
- package/package.json +146 -4
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const CreateDataTypeRequestSchema: z.ZodObject<{
|
|
3
|
+
name: z.ZodString;
|
|
4
|
+
editorId: z.ZodString;
|
|
5
|
+
settings: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
6
|
+
}, z.core.$strict>;
|
|
7
|
+
export type CreateDataTypeRequest = z.infer<typeof CreateDataTypeRequestSchema>;
|
|
8
|
+
export type CreateDataTypeRequestInput = z.input<typeof CreateDataTypeRequestSchema>;
|
|
9
|
+
export declare const UpdateDataTypeRequestSchema: z.ZodObject<{
|
|
10
|
+
name: z.ZodOptional<z.ZodString>;
|
|
11
|
+
settings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
12
|
+
}, z.core.$strict>;
|
|
13
|
+
export type UpdateDataTypeRequest = z.infer<typeof UpdateDataTypeRequestSchema>;
|
|
14
|
+
export declare const DataTypeResponseSchema: z.ZodObject<{
|
|
15
|
+
dataType: z.ZodObject<{
|
|
16
|
+
id: z.ZodString;
|
|
17
|
+
name: z.ZodString;
|
|
18
|
+
editorId: z.ZodString;
|
|
19
|
+
settings: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
20
|
+
}, z.core.$strict>;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
export type DataTypeResponse = z.infer<typeof DataTypeResponseSchema>;
|
|
23
|
+
export declare const DataTypeListQuerySchema: z.ZodObject<{
|
|
24
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
25
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
export type DataTypeListQuery = z.infer<typeof DataTypeListQuerySchema>;
|
|
28
|
+
export declare const DataTypeListResponseSchema: z.ZodObject<{
|
|
29
|
+
items: z.ZodArray<z.ZodObject<{
|
|
30
|
+
id: z.ZodString;
|
|
31
|
+
name: z.ZodString;
|
|
32
|
+
editorId: z.ZodString;
|
|
33
|
+
settings: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
34
|
+
}, z.core.$strict>>;
|
|
35
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
36
|
+
}, z.core.$strip>;
|
|
37
|
+
export type DataTypeListResponse = z.infer<typeof DataTypeListResponseSchema>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { DataTypeConfigSchema } from "./data-type-config.schema.js";
|
|
3
|
+
export const CreateDataTypeRequestSchema = z
|
|
4
|
+
.object({
|
|
5
|
+
name: z.string().min(1),
|
|
6
|
+
editorId: z.string().min(1),
|
|
7
|
+
settings: z.record(z.string(), z.unknown()).default({}),
|
|
8
|
+
})
|
|
9
|
+
.strict();
|
|
10
|
+
// editorId is deliberately absent — immutable after creation (see
|
|
11
|
+
// DataTypeConfigSchema). At least the route merges partial updates onto
|
|
12
|
+
// the loaded config, so both fields are optional here.
|
|
13
|
+
export const UpdateDataTypeRequestSchema = z
|
|
14
|
+
.object({
|
|
15
|
+
name: z.string().min(1).optional(),
|
|
16
|
+
settings: z.record(z.string(), z.unknown()).optional(),
|
|
17
|
+
})
|
|
18
|
+
.strict();
|
|
19
|
+
export const DataTypeResponseSchema = z.object({
|
|
20
|
+
dataType: DataTypeConfigSchema,
|
|
21
|
+
});
|
|
22
|
+
// Ordered name ASC (id ASC tiebreak) for the Settings tree; cursor = id
|
|
23
|
+
// of the previous page's last config.
|
|
24
|
+
export const DataTypeListQuerySchema = z.object({
|
|
25
|
+
cursor: z.string().uuid().optional(),
|
|
26
|
+
limit: z.coerce.number().int().min(1).max(100).default(50),
|
|
27
|
+
});
|
|
28
|
+
export const DataTypeListResponseSchema = z.object({
|
|
29
|
+
items: z.array(DataTypeConfigSchema),
|
|
30
|
+
// null = no more pages.
|
|
31
|
+
nextCursor: z.string().uuid().nullable(),
|
|
32
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const DataTypeConfigSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
name: z.ZodString;
|
|
5
|
+
editorId: z.ZodString;
|
|
6
|
+
settings: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
7
|
+
}, z.core.$strict>;
|
|
8
|
+
export type DataTypeConfig = z.infer<typeof DataTypeConfigSchema>;
|
|
9
|
+
export declare const BUILT_IN_DATA_TYPE_CONFIGS: readonly DataTypeConfig[];
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// A Data Type is a named, admin-created CONFIGURATION of a registry
|
|
3
|
+
// editor (Umbraco's split: the editor is the input-control code shipped
|
|
4
|
+
// by core/plugins; the Data Type is "Richtext: limited toolbar").
|
|
5
|
+
// Document type fields reference a Data Type's id — configure once,
|
|
6
|
+
// reuse across document types. Settings are validated against the
|
|
7
|
+
// editor's settingsSchema when the plugin settings pipeline lands
|
|
8
|
+
// (Month 6); until then they are a free-form record.
|
|
9
|
+
export const DataTypeConfigSchema = z
|
|
10
|
+
.object({
|
|
11
|
+
id: z.string().uuid(),
|
|
12
|
+
name: z.string().min(1),
|
|
13
|
+
// Registry editor id, e.g. 'com.kardalum.richtext'. Immutable after
|
|
14
|
+
// creation — swapping the editor under fields that already store
|
|
15
|
+
// values in the old editor's shape is a data footgun.
|
|
16
|
+
editorId: z.string().min(1),
|
|
17
|
+
settings: z.record(z.string(), z.unknown()).default({}),
|
|
18
|
+
})
|
|
19
|
+
.strict();
|
|
20
|
+
// Every built-in editor seeds one default config in migration
|
|
21
|
+
// 0006_data_types, with these FIXED ids — the single source of truth
|
|
22
|
+
// shared by the migrations, tests, and any code that needs "the plain
|
|
23
|
+
// Text data type" without a lookup. Version-4/variant-8 shaped so
|
|
24
|
+
// z.string().uuid() accepts them.
|
|
25
|
+
export const BUILT_IN_DATA_TYPE_CONFIGS = [
|
|
26
|
+
{ id: "b1e00000-0000-4000-8000-000000000001", name: "Text", editorId: "com.kardalum.text", settings: {} },
|
|
27
|
+
{ id: "b1e00000-0000-4000-8000-000000000002", name: "Number", editorId: "com.kardalum.number", settings: {} },
|
|
28
|
+
{ id: "b1e00000-0000-4000-8000-000000000003", name: "Boolean", editorId: "com.kardalum.boolean", settings: {} },
|
|
29
|
+
{ id: "b1e00000-0000-4000-8000-000000000004", name: "Date", editorId: "com.kardalum.date", settings: {} },
|
|
30
|
+
{ id: "b1e00000-0000-4000-8000-000000000005", name: "Image", editorId: "com.kardalum.image", settings: {} },
|
|
31
|
+
{ id: "b1e00000-0000-4000-8000-000000000006", name: "Rich Text", editorId: "com.kardalum.richtext", settings: {} },
|
|
32
|
+
];
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const CreateDocumentTypeRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
3
|
+
name: z.ZodString;
|
|
4
|
+
icon: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
5
|
+
kind: z.ZodLiteral<"page">;
|
|
6
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
7
|
+
id: z.ZodString;
|
|
8
|
+
name: z.ZodString;
|
|
9
|
+
datatypeId: z.ZodString;
|
|
10
|
+
validation: z.ZodOptional<z.ZodObject<{
|
|
11
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
12
|
+
minLength: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
17
|
+
}, z.core.$strict>>;
|
|
18
|
+
tabId: z.ZodOptional<z.ZodString>;
|
|
19
|
+
varies: z.ZodOptional<z.ZodBoolean>;
|
|
20
|
+
}, z.core.$strict>>;
|
|
21
|
+
treeRules: z.ZodObject<{
|
|
22
|
+
allowedAtRoot: z.ZodBoolean;
|
|
23
|
+
allowedParentTypes: z.ZodArray<z.ZodString>;
|
|
24
|
+
allowedChildTypes: z.ZodArray<z.ZodString>;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
tabs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
27
|
+
id: z.ZodString;
|
|
28
|
+
name: z.ZodString;
|
|
29
|
+
}, z.core.$strict>>>;
|
|
30
|
+
translationMandatory: z.ZodOptional<z.ZodBoolean>;
|
|
31
|
+
collection: z.ZodOptional<z.ZodBoolean>;
|
|
32
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
33
|
+
name: z.ZodString;
|
|
34
|
+
icon: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
35
|
+
kind: z.ZodLiteral<"element">;
|
|
36
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
37
|
+
id: z.ZodString;
|
|
38
|
+
name: z.ZodString;
|
|
39
|
+
datatypeId: z.ZodString;
|
|
40
|
+
validation: z.ZodOptional<z.ZodObject<{
|
|
41
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
42
|
+
minLength: z.ZodOptional<z.ZodNumber>;
|
|
43
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
44
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
45
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
46
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
47
|
+
}, z.core.$strict>>;
|
|
48
|
+
tabId: z.ZodOptional<z.ZodString>;
|
|
49
|
+
varies: z.ZodOptional<z.ZodBoolean>;
|
|
50
|
+
}, z.core.$strict>>;
|
|
51
|
+
tabs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
52
|
+
id: z.ZodString;
|
|
53
|
+
name: z.ZodString;
|
|
54
|
+
}, z.core.$strict>>>;
|
|
55
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
56
|
+
name: z.ZodString;
|
|
57
|
+
icon: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
58
|
+
kind: z.ZodLiteral<"media">;
|
|
59
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
60
|
+
id: z.ZodString;
|
|
61
|
+
name: z.ZodString;
|
|
62
|
+
datatypeId: z.ZodString;
|
|
63
|
+
validation: z.ZodOptional<z.ZodObject<{
|
|
64
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
65
|
+
minLength: z.ZodOptional<z.ZodNumber>;
|
|
66
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
67
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
68
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
69
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
70
|
+
}, z.core.$strict>>;
|
|
71
|
+
tabId: z.ZodOptional<z.ZodString>;
|
|
72
|
+
varies: z.ZodOptional<z.ZodBoolean>;
|
|
73
|
+
}, z.core.$strict>>;
|
|
74
|
+
tabs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
75
|
+
id: z.ZodString;
|
|
76
|
+
name: z.ZodString;
|
|
77
|
+
}, z.core.$strict>>>;
|
|
78
|
+
sortOrder: z.ZodOptional<z.ZodNumber>;
|
|
79
|
+
catchAll: z.ZodOptional<z.ZodBoolean>;
|
|
80
|
+
}, z.core.$strict>], "kind">;
|
|
81
|
+
export type CreateDocumentTypeRequest = z.infer<typeof CreateDocumentTypeRequestSchema>;
|
|
82
|
+
export type CreateDocumentTypeRequestInput = z.input<typeof CreateDocumentTypeRequestSchema>;
|
|
83
|
+
export declare const UpdateDocumentTypeRequestSchema: z.ZodObject<{
|
|
84
|
+
name: z.ZodString;
|
|
85
|
+
icon: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
86
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
87
|
+
id: z.ZodString;
|
|
88
|
+
name: z.ZodString;
|
|
89
|
+
datatypeId: z.ZodString;
|
|
90
|
+
validation: z.ZodOptional<z.ZodObject<{
|
|
91
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
92
|
+
minLength: z.ZodOptional<z.ZodNumber>;
|
|
93
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
94
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
95
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
96
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
97
|
+
}, z.core.$strict>>;
|
|
98
|
+
tabId: z.ZodOptional<z.ZodString>;
|
|
99
|
+
varies: z.ZodOptional<z.ZodBoolean>;
|
|
100
|
+
}, z.core.$strict>>;
|
|
101
|
+
tabs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
102
|
+
id: z.ZodString;
|
|
103
|
+
name: z.ZodString;
|
|
104
|
+
}, z.core.$strict>>>;
|
|
105
|
+
treeRules: z.ZodOptional<z.ZodObject<{
|
|
106
|
+
allowedAtRoot: z.ZodBoolean;
|
|
107
|
+
allowedParentTypes: z.ZodArray<z.ZodString>;
|
|
108
|
+
allowedChildTypes: z.ZodArray<z.ZodString>;
|
|
109
|
+
}, z.core.$strip>>;
|
|
110
|
+
translationMandatory: z.ZodOptional<z.ZodBoolean>;
|
|
111
|
+
collection: z.ZodOptional<z.ZodBoolean>;
|
|
112
|
+
sortOrder: z.ZodOptional<z.ZodNumber>;
|
|
113
|
+
catchAll: z.ZodOptional<z.ZodBoolean>;
|
|
114
|
+
}, z.core.$strict>;
|
|
115
|
+
export type UpdateDocumentTypeRequest = z.infer<typeof UpdateDocumentTypeRequestSchema>;
|
|
116
|
+
export type UpdateDocumentTypeRequestInput = z.input<typeof UpdateDocumentTypeRequestSchema>;
|
|
117
|
+
export declare const CreateDocumentTypeResponseSchema: z.ZodObject<{
|
|
118
|
+
documentType: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
119
|
+
id: z.ZodString;
|
|
120
|
+
name: z.ZodString;
|
|
121
|
+
icon: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
122
|
+
kind: z.ZodLiteral<"page">;
|
|
123
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
124
|
+
id: z.ZodString;
|
|
125
|
+
name: z.ZodString;
|
|
126
|
+
datatypeId: z.ZodString;
|
|
127
|
+
validation: z.ZodOptional<z.ZodObject<{
|
|
128
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
129
|
+
minLength: z.ZodOptional<z.ZodNumber>;
|
|
130
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
131
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
132
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
133
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
134
|
+
}, z.core.$strict>>;
|
|
135
|
+
tabId: z.ZodOptional<z.ZodString>;
|
|
136
|
+
varies: z.ZodOptional<z.ZodBoolean>;
|
|
137
|
+
}, z.core.$strict>>;
|
|
138
|
+
treeRules: z.ZodObject<{
|
|
139
|
+
allowedAtRoot: z.ZodBoolean;
|
|
140
|
+
allowedParentTypes: z.ZodArray<z.ZodString>;
|
|
141
|
+
allowedChildTypes: z.ZodArray<z.ZodString>;
|
|
142
|
+
}, z.core.$strip>;
|
|
143
|
+
tabs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
144
|
+
id: z.ZodString;
|
|
145
|
+
name: z.ZodString;
|
|
146
|
+
}, z.core.$strict>>>;
|
|
147
|
+
defaultTemplateId: z.ZodOptional<z.ZodString>;
|
|
148
|
+
translationMandatory: z.ZodOptional<z.ZodBoolean>;
|
|
149
|
+
collection: z.ZodOptional<z.ZodBoolean>;
|
|
150
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
151
|
+
id: z.ZodString;
|
|
152
|
+
name: z.ZodString;
|
|
153
|
+
icon: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
154
|
+
kind: z.ZodLiteral<"element">;
|
|
155
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
156
|
+
id: z.ZodString;
|
|
157
|
+
name: z.ZodString;
|
|
158
|
+
datatypeId: z.ZodString;
|
|
159
|
+
validation: z.ZodOptional<z.ZodObject<{
|
|
160
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
161
|
+
minLength: z.ZodOptional<z.ZodNumber>;
|
|
162
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
163
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
164
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
165
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
166
|
+
}, z.core.$strict>>;
|
|
167
|
+
tabId: z.ZodOptional<z.ZodString>;
|
|
168
|
+
varies: z.ZodOptional<z.ZodBoolean>;
|
|
169
|
+
}, z.core.$strict>>;
|
|
170
|
+
tabs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
171
|
+
id: z.ZodString;
|
|
172
|
+
name: z.ZodString;
|
|
173
|
+
}, z.core.$strict>>>;
|
|
174
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
175
|
+
id: z.ZodString;
|
|
176
|
+
name: z.ZodString;
|
|
177
|
+
icon: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
178
|
+
kind: z.ZodLiteral<"media">;
|
|
179
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
180
|
+
id: z.ZodString;
|
|
181
|
+
name: z.ZodString;
|
|
182
|
+
datatypeId: z.ZodString;
|
|
183
|
+
validation: z.ZodOptional<z.ZodObject<{
|
|
184
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
185
|
+
minLength: z.ZodOptional<z.ZodNumber>;
|
|
186
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
187
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
188
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
189
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
190
|
+
}, z.core.$strict>>;
|
|
191
|
+
tabId: z.ZodOptional<z.ZodString>;
|
|
192
|
+
varies: z.ZodOptional<z.ZodBoolean>;
|
|
193
|
+
}, z.core.$strict>>;
|
|
194
|
+
tabs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
195
|
+
id: z.ZodString;
|
|
196
|
+
name: z.ZodString;
|
|
197
|
+
}, z.core.$strict>>>;
|
|
198
|
+
sortOrder: z.ZodOptional<z.ZodNumber>;
|
|
199
|
+
catchAll: z.ZodOptional<z.ZodBoolean>;
|
|
200
|
+
}, z.core.$strict>], "kind">;
|
|
201
|
+
}, z.core.$strip>;
|
|
202
|
+
export type CreateDocumentTypeResponse = z.infer<typeof CreateDocumentTypeResponseSchema>;
|
|
203
|
+
export declare const DocumentTypeListQuerySchema: z.ZodObject<{
|
|
204
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
205
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
206
|
+
}, z.core.$strip>;
|
|
207
|
+
export type DocumentTypeListQuery = z.infer<typeof DocumentTypeListQuerySchema>;
|
|
208
|
+
export declare const DocumentTypeListResponseSchema: z.ZodObject<{
|
|
209
|
+
items: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
210
|
+
id: z.ZodString;
|
|
211
|
+
name: z.ZodString;
|
|
212
|
+
icon: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
213
|
+
kind: z.ZodLiteral<"page">;
|
|
214
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
215
|
+
id: z.ZodString;
|
|
216
|
+
name: z.ZodString;
|
|
217
|
+
datatypeId: z.ZodString;
|
|
218
|
+
validation: z.ZodOptional<z.ZodObject<{
|
|
219
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
220
|
+
minLength: z.ZodOptional<z.ZodNumber>;
|
|
221
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
222
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
223
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
224
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
225
|
+
}, z.core.$strict>>;
|
|
226
|
+
tabId: z.ZodOptional<z.ZodString>;
|
|
227
|
+
varies: z.ZodOptional<z.ZodBoolean>;
|
|
228
|
+
}, z.core.$strict>>;
|
|
229
|
+
treeRules: z.ZodObject<{
|
|
230
|
+
allowedAtRoot: z.ZodBoolean;
|
|
231
|
+
allowedParentTypes: z.ZodArray<z.ZodString>;
|
|
232
|
+
allowedChildTypes: z.ZodArray<z.ZodString>;
|
|
233
|
+
}, z.core.$strip>;
|
|
234
|
+
tabs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
235
|
+
id: z.ZodString;
|
|
236
|
+
name: z.ZodString;
|
|
237
|
+
}, z.core.$strict>>>;
|
|
238
|
+
defaultTemplateId: z.ZodOptional<z.ZodString>;
|
|
239
|
+
translationMandatory: z.ZodOptional<z.ZodBoolean>;
|
|
240
|
+
collection: z.ZodOptional<z.ZodBoolean>;
|
|
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
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
266
|
+
id: z.ZodString;
|
|
267
|
+
name: z.ZodString;
|
|
268
|
+
icon: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
269
|
+
kind: z.ZodLiteral<"media">;
|
|
270
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
271
|
+
id: z.ZodString;
|
|
272
|
+
name: z.ZodString;
|
|
273
|
+
datatypeId: z.ZodString;
|
|
274
|
+
validation: z.ZodOptional<z.ZodObject<{
|
|
275
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
276
|
+
minLength: z.ZodOptional<z.ZodNumber>;
|
|
277
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
278
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
279
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
280
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
281
|
+
}, z.core.$strict>>;
|
|
282
|
+
tabId: z.ZodOptional<z.ZodString>;
|
|
283
|
+
varies: z.ZodOptional<z.ZodBoolean>;
|
|
284
|
+
}, z.core.$strict>>;
|
|
285
|
+
tabs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
286
|
+
id: z.ZodString;
|
|
287
|
+
name: z.ZodString;
|
|
288
|
+
}, z.core.$strict>>>;
|
|
289
|
+
sortOrder: z.ZodOptional<z.ZodNumber>;
|
|
290
|
+
catchAll: z.ZodOptional<z.ZodBoolean>;
|
|
291
|
+
}, z.core.$strict>], "kind">>;
|
|
292
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
293
|
+
}, z.core.$strip>;
|
|
294
|
+
export type DocumentTypeListResponse = z.infer<typeof DocumentTypeListResponseSchema>;
|
|
295
|
+
export declare const DeleteDocumentTypeResponseSchema: z.ZodObject<{
|
|
296
|
+
success: z.ZodLiteral<true>;
|
|
297
|
+
}, z.core.$strip>;
|
|
298
|
+
export type DeleteDocumentTypeResponse = z.infer<typeof DeleteDocumentTypeResponseSchema>;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { DocumentTypeDefinitionSchema, FieldDefinitionSchema, TabDefinitionSchema, TreeRulesSchema, } from "./document-type.schema.js";
|
|
3
|
+
// Shared by create AND update: duplicate field keys within one document
|
|
4
|
+
// type would silently collide in ContentVersion.data later, and a tabId
|
|
5
|
+
// must reference a tab declared in the same payload.
|
|
6
|
+
function validateFieldsAndTabs(value, ctx) {
|
|
7
|
+
const seen = new Set();
|
|
8
|
+
for (const [index, field] of value.fields.entries()) {
|
|
9
|
+
if (seen.has(field.id)) {
|
|
10
|
+
ctx.addIssue({
|
|
11
|
+
code: "custom",
|
|
12
|
+
message: `Duplicate field id "${field.id}": field ids must be unique within a document type`,
|
|
13
|
+
path: ["fields", index, "id"],
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
seen.add(field.id);
|
|
17
|
+
}
|
|
18
|
+
const tabIds = new Set(value.tabs.map((tab) => tab.id));
|
|
19
|
+
for (const [index, field] of value.fields.entries()) {
|
|
20
|
+
if (field.tabId !== undefined && !tabIds.has(field.tabId)) {
|
|
21
|
+
ctx.addIssue({
|
|
22
|
+
code: "custom",
|
|
23
|
+
message: `Field references unknown tab id "${field.tabId}"`,
|
|
24
|
+
path: ["fields", index, "tabId"],
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
// Same shape as DocumentTypeDefinitionSchema minus `id` — the server
|
|
30
|
+
// mints that. `defaultTemplateId` is deliberately absent even on the
|
|
31
|
+
// 'page' branch — it's only ever set afterward via the dedicated
|
|
32
|
+
// default-template endpoint, since a template can't exist before its
|
|
33
|
+
// document type does.
|
|
34
|
+
export const CreateDocumentTypeRequestSchema = z
|
|
35
|
+
.discriminatedUnion("kind", [
|
|
36
|
+
z
|
|
37
|
+
.object({
|
|
38
|
+
name: z.string().min(1),
|
|
39
|
+
// Optional since S183: absent/empty renders the default document
|
|
40
|
+
// icon in the admin. Stored values stay untouched.
|
|
41
|
+
icon: z.string().optional().default(""),
|
|
42
|
+
kind: z.literal("page"),
|
|
43
|
+
fields: z.array(FieldDefinitionSchema),
|
|
44
|
+
treeRules: TreeRulesSchema,
|
|
45
|
+
tabs: z.array(TabDefinitionSchema).default([]),
|
|
46
|
+
// S230c: refuse publishing a language whose required varying
|
|
47
|
+
// fields are unfilled. Page types only.
|
|
48
|
+
translationMandatory: z.boolean().optional(),
|
|
49
|
+
// S232: the tree draws this type's pages as a single row with a
|
|
50
|
+
// child count and lists their children as a table instead of
|
|
51
|
+
// expanding them. Page types only.
|
|
52
|
+
collection: z.boolean().optional(),
|
|
53
|
+
})
|
|
54
|
+
.strict(),
|
|
55
|
+
z
|
|
56
|
+
.object({
|
|
57
|
+
name: z.string().min(1),
|
|
58
|
+
// Optional since S183: absent/empty renders the default document
|
|
59
|
+
// icon in the admin. Stored values stay untouched.
|
|
60
|
+
icon: z.string().optional().default(""),
|
|
61
|
+
kind: z.literal("element"),
|
|
62
|
+
fields: z.array(FieldDefinitionSchema),
|
|
63
|
+
tabs: z.array(TabDefinitionSchema).default([]),
|
|
64
|
+
})
|
|
65
|
+
.strict(),
|
|
66
|
+
// S234a: the third kind. No treeRules, no translationMandatory and no
|
|
67
|
+
// collection, for the same reason the 'element' branch has none: media
|
|
68
|
+
// has no tree presence at all. The two keys it does add are the upload
|
|
69
|
+
// router's, not the tree's: see apps/server/src/media/media-type-router.ts.
|
|
70
|
+
z
|
|
71
|
+
.object({
|
|
72
|
+
name: z.string().min(1),
|
|
73
|
+
// Optional since S183: absent/empty renders the default document
|
|
74
|
+
// icon in the admin. Stored values stay untouched.
|
|
75
|
+
icon: z.string().optional().default(""),
|
|
76
|
+
kind: z.literal("media"),
|
|
77
|
+
fields: z.array(FieldDefinitionSchema),
|
|
78
|
+
tabs: z.array(TabDefinitionSchema).default([]),
|
|
79
|
+
// Which type claims an uploaded file when more than one accepts
|
|
80
|
+
// its extension: lower sorts first, and a type with no number at
|
|
81
|
+
// all sorts after every type that has one.
|
|
82
|
+
sortOrder: z.number().int().nonnegative().optional(),
|
|
83
|
+
// The type an upload lands on when nothing else claims the
|
|
84
|
+
// extension. A singleton: the route moves it rather than letting
|
|
85
|
+
// a second type claim it, and refuses to leave an install with
|
|
86
|
+
// none.
|
|
87
|
+
catchAll: z.boolean().optional(),
|
|
88
|
+
})
|
|
89
|
+
.strict(),
|
|
90
|
+
])
|
|
91
|
+
.superRefine(validateFieldsAndTabs);
|
|
92
|
+
// PUT /api/manage/v1/document-types/:id: the mutable subset only. `kind` is
|
|
93
|
+
// immutable after creation (a payload carrying it fails .strict() — the
|
|
94
|
+
// intended behavior, not an accident) and `defaultTemplateId` stays with
|
|
95
|
+
// its dedicated pointer endpoint. `treeRules` is optional HERE because
|
|
96
|
+
// the schema can't know the stored kind; the route requires it for
|
|
97
|
+
// 'page' types and rejects it for 'element' types.
|
|
98
|
+
export const UpdateDocumentTypeRequestSchema = z
|
|
99
|
+
.object({
|
|
100
|
+
name: z.string().min(1),
|
|
101
|
+
// Optional since S183: absent/empty renders the default document
|
|
102
|
+
// icon in the admin. Stored values stay untouched.
|
|
103
|
+
icon: z.string().optional().default(""),
|
|
104
|
+
fields: z.array(FieldDefinitionSchema),
|
|
105
|
+
tabs: z.array(TabDefinitionSchema).default([]),
|
|
106
|
+
treeRules: TreeRulesSchema.optional(),
|
|
107
|
+
// S230c: refuse publishing a language whose required varying
|
|
108
|
+
// fields are unfilled. Page types only.
|
|
109
|
+
translationMandatory: z.boolean().optional(),
|
|
110
|
+
// S232: page types only, the same as translationMandatory. Optional
|
|
111
|
+
// here because the schema cannot know the stored kind; the route
|
|
112
|
+
// rejects it for an 'element' type and treats omission as "keep".
|
|
113
|
+
collection: z.boolean().optional(),
|
|
114
|
+
// S234a: media types only, and optional here for exactly the same
|
|
115
|
+
// reason as the two above: the schema cannot know the stored kind.
|
|
116
|
+
// The route rejects both for a non-media type, treats omission as
|
|
117
|
+
// "keep" (the adapter writes them verbatim, so omission would
|
|
118
|
+
// otherwise clear the File type's catch-all on a plain rename), and
|
|
119
|
+
// owns the singleton rule for catchAll.
|
|
120
|
+
sortOrder: z.number().int().nonnegative().optional(),
|
|
121
|
+
catchAll: z.boolean().optional(),
|
|
122
|
+
})
|
|
123
|
+
.strict()
|
|
124
|
+
.superRefine(validateFieldsAndTabs);
|
|
125
|
+
export const CreateDocumentTypeResponseSchema = z.object({
|
|
126
|
+
documentType: DocumentTypeDefinitionSchema,
|
|
127
|
+
});
|
|
128
|
+
export const DocumentTypeListQuerySchema = z.object({
|
|
129
|
+
cursor: z.string().uuid().optional(),
|
|
130
|
+
limit: z.coerce.number().int().min(1).max(100).default(50),
|
|
131
|
+
});
|
|
132
|
+
export const DocumentTypeListResponseSchema = z.object({
|
|
133
|
+
items: z.array(DocumentTypeDefinitionSchema),
|
|
134
|
+
nextCursor: z.string().uuid().nullable(),
|
|
135
|
+
});
|
|
136
|
+
export const DeleteDocumentTypeResponseSchema = z.object({
|
|
137
|
+
success: z.literal(true),
|
|
138
|
+
});
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const FieldValidationSchema: z.ZodObject<{
|
|
3
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
4
|
+
minLength: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
6
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
7
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
8
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
9
|
+
}, z.core.$strict>;
|
|
10
|
+
export type FieldValidation = z.infer<typeof FieldValidationSchema>;
|
|
11
|
+
export declare const TabDefinitionSchema: z.ZodObject<{
|
|
12
|
+
id: z.ZodString;
|
|
13
|
+
name: z.ZodString;
|
|
14
|
+
}, z.core.$strict>;
|
|
15
|
+
export type TabDefinition = z.infer<typeof TabDefinitionSchema>;
|
|
16
|
+
export declare const FieldDefinitionSchema: z.ZodObject<{
|
|
17
|
+
id: z.ZodString;
|
|
18
|
+
name: z.ZodString;
|
|
19
|
+
datatypeId: z.ZodString;
|
|
20
|
+
validation: z.ZodOptional<z.ZodObject<{
|
|
21
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
22
|
+
minLength: z.ZodOptional<z.ZodNumber>;
|
|
23
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
24
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
25
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
26
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
27
|
+
}, z.core.$strict>>;
|
|
28
|
+
tabId: z.ZodOptional<z.ZodString>;
|
|
29
|
+
varies: z.ZodOptional<z.ZodBoolean>;
|
|
30
|
+
}, z.core.$strict>;
|
|
31
|
+
export type FieldDefinition = z.infer<typeof FieldDefinitionSchema>;
|
|
32
|
+
export declare const TreeRulesSchema: z.ZodObject<{
|
|
33
|
+
allowedAtRoot: z.ZodBoolean;
|
|
34
|
+
allowedParentTypes: z.ZodArray<z.ZodString>;
|
|
35
|
+
allowedChildTypes: z.ZodArray<z.ZodString>;
|
|
36
|
+
}, z.core.$strip>;
|
|
37
|
+
export type TreeRules = z.infer<typeof TreeRulesSchema>;
|
|
38
|
+
export declare const DocumentTypeDefinitionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
39
|
+
id: z.ZodString;
|
|
40
|
+
name: z.ZodString;
|
|
41
|
+
icon: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
42
|
+
kind: z.ZodLiteral<"page">;
|
|
43
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
44
|
+
id: z.ZodString;
|
|
45
|
+
name: z.ZodString;
|
|
46
|
+
datatypeId: z.ZodString;
|
|
47
|
+
validation: z.ZodOptional<z.ZodObject<{
|
|
48
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
49
|
+
minLength: z.ZodOptional<z.ZodNumber>;
|
|
50
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
51
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
52
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
53
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
54
|
+
}, z.core.$strict>>;
|
|
55
|
+
tabId: z.ZodOptional<z.ZodString>;
|
|
56
|
+
varies: z.ZodOptional<z.ZodBoolean>;
|
|
57
|
+
}, z.core.$strict>>;
|
|
58
|
+
treeRules: z.ZodObject<{
|
|
59
|
+
allowedAtRoot: z.ZodBoolean;
|
|
60
|
+
allowedParentTypes: z.ZodArray<z.ZodString>;
|
|
61
|
+
allowedChildTypes: z.ZodArray<z.ZodString>;
|
|
62
|
+
}, z.core.$strip>;
|
|
63
|
+
tabs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
64
|
+
id: z.ZodString;
|
|
65
|
+
name: z.ZodString;
|
|
66
|
+
}, z.core.$strict>>>;
|
|
67
|
+
defaultTemplateId: z.ZodOptional<z.ZodString>;
|
|
68
|
+
translationMandatory: z.ZodOptional<z.ZodBoolean>;
|
|
69
|
+
collection: z.ZodOptional<z.ZodBoolean>;
|
|
70
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
71
|
+
id: z.ZodString;
|
|
72
|
+
name: z.ZodString;
|
|
73
|
+
icon: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
74
|
+
kind: z.ZodLiteral<"element">;
|
|
75
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
76
|
+
id: z.ZodString;
|
|
77
|
+
name: z.ZodString;
|
|
78
|
+
datatypeId: z.ZodString;
|
|
79
|
+
validation: z.ZodOptional<z.ZodObject<{
|
|
80
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
81
|
+
minLength: z.ZodOptional<z.ZodNumber>;
|
|
82
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
83
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
84
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
85
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
86
|
+
}, z.core.$strict>>;
|
|
87
|
+
tabId: z.ZodOptional<z.ZodString>;
|
|
88
|
+
varies: z.ZodOptional<z.ZodBoolean>;
|
|
89
|
+
}, z.core.$strict>>;
|
|
90
|
+
tabs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
91
|
+
id: z.ZodString;
|
|
92
|
+
name: z.ZodString;
|
|
93
|
+
}, z.core.$strict>>>;
|
|
94
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
95
|
+
id: z.ZodString;
|
|
96
|
+
name: z.ZodString;
|
|
97
|
+
icon: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
98
|
+
kind: z.ZodLiteral<"media">;
|
|
99
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
100
|
+
id: z.ZodString;
|
|
101
|
+
name: z.ZodString;
|
|
102
|
+
datatypeId: z.ZodString;
|
|
103
|
+
validation: z.ZodOptional<z.ZodObject<{
|
|
104
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
105
|
+
minLength: z.ZodOptional<z.ZodNumber>;
|
|
106
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
107
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
108
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
109
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
110
|
+
}, z.core.$strict>>;
|
|
111
|
+
tabId: z.ZodOptional<z.ZodString>;
|
|
112
|
+
varies: z.ZodOptional<z.ZodBoolean>;
|
|
113
|
+
}, z.core.$strict>>;
|
|
114
|
+
tabs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
115
|
+
id: z.ZodString;
|
|
116
|
+
name: z.ZodString;
|
|
117
|
+
}, z.core.$strict>>>;
|
|
118
|
+
sortOrder: z.ZodOptional<z.ZodNumber>;
|
|
119
|
+
catchAll: z.ZodOptional<z.ZodBoolean>;
|
|
120
|
+
}, z.core.$strict>], "kind">;
|
|
121
|
+
export type DocumentTypeDefinition = z.infer<typeof DocumentTypeDefinitionSchema>;
|