@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,112 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const MAX_TEMPLATE_CONTENT_BYTES = 1048576;
|
|
3
|
+
export declare const CreateTemplateRequestSchema: z.ZodObject<{
|
|
4
|
+
name: z.ZodString;
|
|
5
|
+
alias: z.ZodOptional<z.ZodString>;
|
|
6
|
+
kind: z.ZodDefault<z.ZodEnum<{
|
|
7
|
+
page: "page";
|
|
8
|
+
layout: "layout";
|
|
9
|
+
partial: "partial";
|
|
10
|
+
}>>;
|
|
11
|
+
documentTypeId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
12
|
+
content: z.ZodDefault<z.ZodString>;
|
|
13
|
+
}, z.core.$strict>;
|
|
14
|
+
export type CreateTemplateRequest = z.infer<typeof CreateTemplateRequestSchema>;
|
|
15
|
+
export type CreateTemplateRequestInput = z.input<typeof CreateTemplateRequestSchema>;
|
|
16
|
+
export declare const UpdateTemplateRequestSchema: z.ZodObject<{
|
|
17
|
+
name: z.ZodOptional<z.ZodString>;
|
|
18
|
+
content: z.ZodOptional<z.ZodString>;
|
|
19
|
+
baseVersion: z.ZodOptional<z.ZodNumber>;
|
|
20
|
+
}, z.core.$strict>;
|
|
21
|
+
export type UpdateTemplateRequest = z.infer<typeof UpdateTemplateRequestSchema>;
|
|
22
|
+
export type UpdateTemplateRequestInput = z.input<typeof UpdateTemplateRequestSchema>;
|
|
23
|
+
export declare const TemplateConflictResponseSchema: z.ZodObject<{
|
|
24
|
+
message: z.ZodString;
|
|
25
|
+
currentVersion: z.ZodNumber;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
export type TemplateConflictResponse = z.infer<typeof TemplateConflictResponseSchema>;
|
|
28
|
+
export declare const TemplateDeleteBlockedResponseSchema: z.ZodObject<{
|
|
29
|
+
requiresConfirmation: z.ZodLiteral<true>;
|
|
30
|
+
documentTypesUsingDefault: z.ZodArray<z.ZodObject<{
|
|
31
|
+
id: z.ZodString;
|
|
32
|
+
name: z.ZodString;
|
|
33
|
+
}, z.core.$strip>>;
|
|
34
|
+
isCatchAll: z.ZodBoolean;
|
|
35
|
+
message: z.ZodString;
|
|
36
|
+
}, z.core.$strip>;
|
|
37
|
+
export type TemplateDeleteBlockedResponse = z.infer<typeof TemplateDeleteBlockedResponseSchema>;
|
|
38
|
+
export declare const DeleteTemplateQuerySchema: z.ZodObject<{
|
|
39
|
+
confirm: z.ZodOptional<z.ZodEnum<{
|
|
40
|
+
true: "true";
|
|
41
|
+
}>>;
|
|
42
|
+
}, z.core.$strip>;
|
|
43
|
+
export type DeleteTemplateQuery = z.infer<typeof DeleteTemplateQuerySchema>;
|
|
44
|
+
export declare const TemplateResponseSchema: z.ZodObject<{
|
|
45
|
+
template: z.ZodObject<{
|
|
46
|
+
id: z.ZodString;
|
|
47
|
+
name: z.ZodString;
|
|
48
|
+
alias: z.ZodString;
|
|
49
|
+
kind: z.ZodEnum<{
|
|
50
|
+
page: "page";
|
|
51
|
+
layout: "layout";
|
|
52
|
+
partial: "partial";
|
|
53
|
+
}>;
|
|
54
|
+
documentTypeId: z.ZodNullable<z.ZodString>;
|
|
55
|
+
currentVersion: z.ZodNumber;
|
|
56
|
+
}, z.core.$strict>;
|
|
57
|
+
content: z.ZodString;
|
|
58
|
+
}, z.core.$strip>;
|
|
59
|
+
export type TemplateResponse = z.infer<typeof TemplateResponseSchema>;
|
|
60
|
+
export declare const CreateTemplateResponseSchema: z.ZodObject<{
|
|
61
|
+
template: z.ZodObject<{
|
|
62
|
+
id: z.ZodString;
|
|
63
|
+
name: z.ZodString;
|
|
64
|
+
alias: z.ZodString;
|
|
65
|
+
kind: z.ZodEnum<{
|
|
66
|
+
page: "page";
|
|
67
|
+
layout: "layout";
|
|
68
|
+
partial: "partial";
|
|
69
|
+
}>;
|
|
70
|
+
documentTypeId: z.ZodNullable<z.ZodString>;
|
|
71
|
+
currentVersion: z.ZodNumber;
|
|
72
|
+
}, z.core.$strict>;
|
|
73
|
+
content: z.ZodString;
|
|
74
|
+
}, z.core.$strip>;
|
|
75
|
+
export type CreateTemplateResponse = z.infer<typeof CreateTemplateResponseSchema>;
|
|
76
|
+
export declare const TemplateListQuerySchema: z.ZodObject<{
|
|
77
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
78
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
79
|
+
documentTypeId: z.ZodOptional<z.ZodString>;
|
|
80
|
+
}, z.core.$strip>;
|
|
81
|
+
export type TemplateListQuery = z.infer<typeof TemplateListQuerySchema>;
|
|
82
|
+
export declare const TemplateListResponseSchema: z.ZodObject<{
|
|
83
|
+
items: z.ZodArray<z.ZodObject<{
|
|
84
|
+
id: z.ZodString;
|
|
85
|
+
name: z.ZodString;
|
|
86
|
+
alias: z.ZodString;
|
|
87
|
+
kind: z.ZodEnum<{
|
|
88
|
+
page: "page";
|
|
89
|
+
layout: "layout";
|
|
90
|
+
partial: "partial";
|
|
91
|
+
}>;
|
|
92
|
+
documentTypeId: z.ZodNullable<z.ZodString>;
|
|
93
|
+
currentVersion: z.ZodNumber;
|
|
94
|
+
}, z.core.$strict>>;
|
|
95
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
96
|
+
}, z.core.$strip>;
|
|
97
|
+
export type TemplateListResponse = z.infer<typeof TemplateListResponseSchema>;
|
|
98
|
+
export declare const SetDefaultTemplateRequestSchema: z.ZodObject<{
|
|
99
|
+
templateId: z.ZodNullable<z.ZodString>;
|
|
100
|
+
}, z.core.$strip>;
|
|
101
|
+
export type SetDefaultTemplateRequest = z.infer<typeof SetDefaultTemplateRequestSchema>;
|
|
102
|
+
export declare const TemplateSyncReportSchema: z.ZodObject<{
|
|
103
|
+
checked: z.ZodNumber;
|
|
104
|
+
updated: z.ZodArray<z.ZodObject<{
|
|
105
|
+
id: z.ZodString;
|
|
106
|
+
alias: z.ZodString;
|
|
107
|
+
version: z.ZodNumber;
|
|
108
|
+
}, z.core.$strip>>;
|
|
109
|
+
healed: z.ZodArray<z.ZodString>;
|
|
110
|
+
unmatched: z.ZodArray<z.ZodString>;
|
|
111
|
+
}, z.core.$strip>;
|
|
112
|
+
export type TemplateSyncReport = z.infer<typeof TemplateSyncReportSchema>;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { TemplateAliasSchema, TemplateDefinitionSchema, TemplateKindSchema, } from "./template.schema.js";
|
|
3
|
+
// One template source file is capped at 1MB — kin of the render budget:
|
|
4
|
+
// a template is code a human edits, not a data blob.
|
|
5
|
+
export const MAX_TEMPLATE_CONTENT_BYTES = 1_048_576;
|
|
6
|
+
// alias is optional: when omitted the server derives it from `name`
|
|
7
|
+
// (slugify + uniqueness suffix) so the pre-existing admin-UI call shape
|
|
8
|
+
// {name, documentTypeId} keeps working unchanged.
|
|
9
|
+
export const CreateTemplateRequestSchema = z
|
|
10
|
+
.object({
|
|
11
|
+
name: z.string().min(1),
|
|
12
|
+
alias: TemplateAliasSchema.optional(),
|
|
13
|
+
kind: TemplateKindSchema.default("page"),
|
|
14
|
+
documentTypeId: z.string().uuid().nullable().optional(),
|
|
15
|
+
content: z.string().max(MAX_TEMPLATE_CONTENT_BYTES).default(""),
|
|
16
|
+
})
|
|
17
|
+
.strict();
|
|
18
|
+
// baseVersion is optional-conflict-detection only (S195): it never enters
|
|
19
|
+
// the name/content refine below — a request with only a baseVersion still
|
|
20
|
+
// fails that check, same as before this field existed.
|
|
21
|
+
export const UpdateTemplateRequestSchema = z
|
|
22
|
+
.object({
|
|
23
|
+
name: z.string().min(1).optional(),
|
|
24
|
+
content: z.string().max(MAX_TEMPLATE_CONTENT_BYTES).optional(),
|
|
25
|
+
baseVersion: z.number().int().min(1).optional(),
|
|
26
|
+
})
|
|
27
|
+
.strict()
|
|
28
|
+
.refine((v) => v.name !== undefined || v.content !== undefined, {
|
|
29
|
+
message: "Provide name or content",
|
|
30
|
+
});
|
|
31
|
+
export const TemplateConflictResponseSchema = z.object({
|
|
32
|
+
message: z.string(),
|
|
33
|
+
currentVersion: z.number().int().min(1),
|
|
34
|
+
});
|
|
35
|
+
// DELETE /api/manage/v1/templates/:id two-step confirm gate, same shape as content
|
|
36
|
+
// trash / plugin uninstall: 409 names the blast radius, then a literal
|
|
37
|
+
// "true" query string confirm re-issues the delete.
|
|
38
|
+
export const TemplateDeleteBlockedResponseSchema = z.object({
|
|
39
|
+
requiresConfirmation: z.literal(true),
|
|
40
|
+
documentTypesUsingDefault: z.array(z.object({ id: z.string().uuid(), name: z.string() })),
|
|
41
|
+
isCatchAll: z.boolean(),
|
|
42
|
+
message: z.string(),
|
|
43
|
+
});
|
|
44
|
+
export const DeleteTemplateQuerySchema = z.object({ confirm: z.enum(["true"]).optional() });
|
|
45
|
+
export const TemplateResponseSchema = z.object({
|
|
46
|
+
template: TemplateDefinitionSchema,
|
|
47
|
+
content: z.string(),
|
|
48
|
+
});
|
|
49
|
+
// Same shape under the historical name: POST /api/manage/v1/templates responds 201
|
|
50
|
+
// with it and the admin UI imports this name today.
|
|
51
|
+
export const CreateTemplateResponseSchema = TemplateResponseSchema;
|
|
52
|
+
// Per api-design.md, list endpoints are always cursor-paginated. The
|
|
53
|
+
// optional documentTypeId filter is what the builder's template picker
|
|
54
|
+
// uses to list "templates for this document type."
|
|
55
|
+
export const TemplateListQuerySchema = z.object({
|
|
56
|
+
cursor: z.string().uuid().optional(),
|
|
57
|
+
limit: z.coerce.number().int().min(1).max(100).default(50),
|
|
58
|
+
documentTypeId: z.string().uuid().optional(),
|
|
59
|
+
});
|
|
60
|
+
export const TemplateListResponseSchema = z.object({
|
|
61
|
+
items: z.array(TemplateDefinitionSchema),
|
|
62
|
+
nextCursor: z.string().uuid().nullable(),
|
|
63
|
+
});
|
|
64
|
+
// Body for PATCH /api/manage/v1/document-types/:id/default-template.
|
|
65
|
+
export const SetDefaultTemplateRequestSchema = z.object({
|
|
66
|
+
templateId: z.string().uuid().nullable(),
|
|
67
|
+
});
|
|
68
|
+
// POST /api/manage/v1/templates/sync: the "Sync files" action's report.
|
|
69
|
+
export const TemplateSyncReportSchema = z.object({
|
|
70
|
+
checked: z.number().int().min(0),
|
|
71
|
+
updated: z.array(z.object({ id: z.string().uuid(), alias: z.string(), version: z.number().int() })),
|
|
72
|
+
healed: z.array(z.string()),
|
|
73
|
+
unmatched: z.array(z.string()),
|
|
74
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const TemplateKindSchema: z.ZodEnum<{
|
|
3
|
+
page: "page";
|
|
4
|
+
layout: "layout";
|
|
5
|
+
partial: "partial";
|
|
6
|
+
}>;
|
|
7
|
+
export type TemplateKind = z.infer<typeof TemplateKindSchema>;
|
|
8
|
+
export declare const TemplateAliasSchema: z.ZodString;
|
|
9
|
+
export declare const TemplateDefinitionSchema: z.ZodObject<{
|
|
10
|
+
id: z.ZodString;
|
|
11
|
+
name: z.ZodString;
|
|
12
|
+
alias: z.ZodString;
|
|
13
|
+
kind: z.ZodEnum<{
|
|
14
|
+
page: "page";
|
|
15
|
+
layout: "layout";
|
|
16
|
+
partial: "partial";
|
|
17
|
+
}>;
|
|
18
|
+
documentTypeId: z.ZodNullable<z.ZodString>;
|
|
19
|
+
currentVersion: z.ZodNumber;
|
|
20
|
+
}, z.core.$strict>;
|
|
21
|
+
export type TemplateDefinition = z.infer<typeof TemplateDefinitionSchema>;
|
|
22
|
+
export declare const TemplateVersionSourceSchema: z.ZodEnum<{
|
|
23
|
+
"plugin-install": "plugin-install";
|
|
24
|
+
admin: "admin";
|
|
25
|
+
"file-sync": "file-sync";
|
|
26
|
+
}>;
|
|
27
|
+
export type TemplateVersionSource = z.infer<typeof TemplateVersionSourceSchema>;
|
|
28
|
+
export declare const TemplateVersionSchema: z.ZodObject<{
|
|
29
|
+
id: z.ZodString;
|
|
30
|
+
templateId: z.ZodString;
|
|
31
|
+
version: z.ZodNumber;
|
|
32
|
+
content: z.ZodString;
|
|
33
|
+
hash: z.ZodString;
|
|
34
|
+
source: z.ZodEnum<{
|
|
35
|
+
"plugin-install": "plugin-install";
|
|
36
|
+
admin: "admin";
|
|
37
|
+
"file-sync": "file-sync";
|
|
38
|
+
}>;
|
|
39
|
+
createdAt: z.ZodString;
|
|
40
|
+
}, z.core.$strict>;
|
|
41
|
+
export type TemplateVersion = z.infer<typeof TemplateVersionSchema>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// A template's persisted identity. Content does NOT live here: the source
|
|
3
|
+
// of a template is its file (`templates/<alias>.liquid`) mirrored into
|
|
4
|
+
// immutable template_versions rows — see the S192 spec §5. currentVersion
|
|
5
|
+
// is a pointer, exactly like content_nodes.current_version.
|
|
6
|
+
export const TemplateKindSchema = z.enum(["page", "layout", "partial"]);
|
|
7
|
+
// The alias is the cross-reference key ({% layout 'x' %} / {% render 'x' %})
|
|
8
|
+
// AND the file stem (<alias>.liquid). The regex is deliberately narrow —
|
|
9
|
+
// lowercase kebab only — so an alias can never traverse paths or collide
|
|
10
|
+
// case-insensitively on Windows filesystems.
|
|
11
|
+
export const TemplateAliasSchema = z
|
|
12
|
+
.string()
|
|
13
|
+
.min(1)
|
|
14
|
+
.max(120)
|
|
15
|
+
.regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/, "lowercase kebab-case only");
|
|
16
|
+
export const TemplateDefinitionSchema = z
|
|
17
|
+
.object({
|
|
18
|
+
id: z.string().uuid(),
|
|
19
|
+
name: z.string().min(1),
|
|
20
|
+
alias: TemplateAliasSchema,
|
|
21
|
+
kind: TemplateKindSchema,
|
|
22
|
+
// Only meaningful for kind "page"; layouts and partials carry null.
|
|
23
|
+
documentTypeId: z.string().uuid().nullable(),
|
|
24
|
+
currentVersion: z.number().int().min(1),
|
|
25
|
+
})
|
|
26
|
+
.strict();
|
|
27
|
+
export const TemplateVersionSourceSchema = z.enum(["plugin-install", "admin", "file-sync"]);
|
|
28
|
+
// Insert-only, mirroring ContentVersion: no mutable state on version rows.
|
|
29
|
+
export const TemplateVersionSchema = z
|
|
30
|
+
.object({
|
|
31
|
+
id: z.string().uuid(),
|
|
32
|
+
templateId: z.string().uuid(),
|
|
33
|
+
version: z.number().int().min(1),
|
|
34
|
+
content: z.string(),
|
|
35
|
+
hash: z.string().length(64), // sha256 hex
|
|
36
|
+
source: TemplateVersionSourceSchema,
|
|
37
|
+
createdAt: z.string().min(1),
|
|
38
|
+
})
|
|
39
|
+
.strict();
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** GET /api/themes — installed, enabled theme plugins' token overrides.
|
|
3
|
+
* tokens is the manifest's contributions.themeTokens passed through
|
|
4
|
+
* verbatim; its inner shape is validated at install time by the SDK's
|
|
5
|
+
* themeTokensSchema, so here it is an opaque record (color/radius). */
|
|
6
|
+
export declare const ThemeListItemSchema: z.ZodObject<{
|
|
7
|
+
pluginId: z.ZodString;
|
|
8
|
+
name: z.ZodString;
|
|
9
|
+
author: z.ZodString;
|
|
10
|
+
tokens: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
export declare const ThemeListResponseSchema: z.ZodObject<{
|
|
13
|
+
items: z.ZodArray<z.ZodObject<{
|
|
14
|
+
pluginId: z.ZodString;
|
|
15
|
+
name: z.ZodString;
|
|
16
|
+
author: z.ZodString;
|
|
17
|
+
tokens: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
18
|
+
}, z.core.$strip>>;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
export type ThemeListItem = z.infer<typeof ThemeListItemSchema>;
|
|
21
|
+
export type ThemeListResponse = z.infer<typeof ThemeListResponseSchema>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** GET /api/themes — installed, enabled theme plugins' token overrides.
|
|
3
|
+
* tokens is the manifest's contributions.themeTokens passed through
|
|
4
|
+
* verbatim; its inner shape is validated at install time by the SDK's
|
|
5
|
+
* themeTokensSchema, so here it is an opaque record (color/radius). */
|
|
6
|
+
export const ThemeListItemSchema = z.object({
|
|
7
|
+
pluginId: z.string(),
|
|
8
|
+
name: z.string(),
|
|
9
|
+
author: z.string(),
|
|
10
|
+
tokens: z.record(z.string(), z.unknown()),
|
|
11
|
+
});
|
|
12
|
+
export const ThemeListResponseSchema = z.object({
|
|
13
|
+
items: z.array(ThemeListItemSchema),
|
|
14
|
+
});
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const UserSummarySchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
email: z.ZodString;
|
|
5
|
+
name: z.ZodNullable<z.ZodString>;
|
|
6
|
+
role: z.ZodString;
|
|
7
|
+
createdAt: z.ZodString;
|
|
8
|
+
system: z.ZodBoolean;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export type UserSummary = z.infer<typeof UserSummarySchema>;
|
|
11
|
+
export declare const UserParamsSchema: z.ZodObject<{
|
|
12
|
+
id: z.ZodString;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export type UserParams = z.infer<typeof UserParamsSchema>;
|
|
15
|
+
export declare const UserListQuerySchema: z.ZodObject<{
|
|
16
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
17
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
export type UserListQuery = z.infer<typeof UserListQuerySchema>;
|
|
20
|
+
export declare const UserListResponseSchema: z.ZodObject<{
|
|
21
|
+
items: z.ZodArray<z.ZodObject<{
|
|
22
|
+
id: z.ZodString;
|
|
23
|
+
email: z.ZodString;
|
|
24
|
+
name: z.ZodNullable<z.ZodString>;
|
|
25
|
+
role: z.ZodString;
|
|
26
|
+
createdAt: z.ZodString;
|
|
27
|
+
system: z.ZodBoolean;
|
|
28
|
+
}, z.core.$strip>>;
|
|
29
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
export type UserListResponse = z.infer<typeof UserListResponseSchema>;
|
|
32
|
+
export declare const CreateUserRequestSchema: z.ZodObject<{
|
|
33
|
+
email: z.ZodString;
|
|
34
|
+
name: z.ZodOptional<z.ZodString>;
|
|
35
|
+
password: z.ZodString;
|
|
36
|
+
role: z.ZodString;
|
|
37
|
+
}, z.core.$strip>;
|
|
38
|
+
export type CreateUserRequest = z.infer<typeof CreateUserRequestSchema>;
|
|
39
|
+
export declare const CreateUserResponseSchema: z.ZodObject<{
|
|
40
|
+
user: z.ZodObject<{
|
|
41
|
+
id: z.ZodString;
|
|
42
|
+
email: z.ZodString;
|
|
43
|
+
name: z.ZodNullable<z.ZodString>;
|
|
44
|
+
role: z.ZodString;
|
|
45
|
+
createdAt: z.ZodString;
|
|
46
|
+
system: z.ZodBoolean;
|
|
47
|
+
}, z.core.$strip>;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
export type CreateUserResponse = z.infer<typeof CreateUserResponseSchema>;
|
|
50
|
+
export declare const UpdateUserRoleRequestSchema: z.ZodObject<{
|
|
51
|
+
role: z.ZodString;
|
|
52
|
+
}, z.core.$strip>;
|
|
53
|
+
export type UpdateUserRoleRequest = z.infer<typeof UpdateUserRoleRequestSchema>;
|
|
54
|
+
export declare const UpdateUserRoleResponseSchema: z.ZodObject<{
|
|
55
|
+
user: z.ZodObject<{
|
|
56
|
+
id: z.ZodString;
|
|
57
|
+
email: z.ZodString;
|
|
58
|
+
name: z.ZodNullable<z.ZodString>;
|
|
59
|
+
role: z.ZodString;
|
|
60
|
+
createdAt: z.ZodString;
|
|
61
|
+
system: z.ZodBoolean;
|
|
62
|
+
}, z.core.$strip>;
|
|
63
|
+
}, z.core.$strip>;
|
|
64
|
+
export type UpdateUserRoleResponse = z.infer<typeof UpdateUserRoleResponseSchema>;
|
|
65
|
+
export declare const ADMIN_LOCALES: readonly ["en", "de"];
|
|
66
|
+
export type AdminLocale = (typeof ADMIN_LOCALES)[number];
|
|
67
|
+
export declare const ThemeModeSchema: z.ZodEnum<{
|
|
68
|
+
system: "system";
|
|
69
|
+
light: "light";
|
|
70
|
+
dark: "dark";
|
|
71
|
+
}>;
|
|
72
|
+
export declare const UserPreferencesSchema: z.ZodObject<{
|
|
73
|
+
locale: z.ZodNullable<z.ZodEnum<{
|
|
74
|
+
en: "en";
|
|
75
|
+
de: "de";
|
|
76
|
+
}>>;
|
|
77
|
+
themeMode: z.ZodNullable<z.ZodEnum<{
|
|
78
|
+
system: "system";
|
|
79
|
+
light: "light";
|
|
80
|
+
dark: "dark";
|
|
81
|
+
}>>;
|
|
82
|
+
themeId: z.ZodNullable<z.ZodString>;
|
|
83
|
+
}, z.core.$strip>;
|
|
84
|
+
export type UserPreferences = z.infer<typeof UserPreferencesSchema>;
|
|
85
|
+
export declare const UpdateUserPreferencesSchema: z.ZodObject<{
|
|
86
|
+
locale: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
87
|
+
en: "en";
|
|
88
|
+
de: "de";
|
|
89
|
+
}>>>;
|
|
90
|
+
themeMode: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
91
|
+
system: "system";
|
|
92
|
+
light: "light";
|
|
93
|
+
dark: "dark";
|
|
94
|
+
}>>>;
|
|
95
|
+
themeId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
96
|
+
}, z.core.$strip>;
|
|
97
|
+
export type UpdateUserPreferences = z.infer<typeof UpdateUserPreferencesSchema>;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { RoleIdSchema } from "./role.schema.js";
|
|
3
|
+
// S272: `role` is the id of a row in `roles`, validated as a slug here and
|
|
4
|
+
// for existence on the server. Before S272 it was a two-value enum.
|
|
5
|
+
// What user management reads — never the passwordHash.
|
|
6
|
+
export const UserSummarySchema = z.object({
|
|
7
|
+
id: z.string().uuid(),
|
|
8
|
+
email: z.string().email(),
|
|
9
|
+
name: z.string().nullable(),
|
|
10
|
+
role: RoleIdSchema,
|
|
11
|
+
createdAt: z.string().datetime(),
|
|
12
|
+
// S301: true for the one account the server writes under for an API key (the
|
|
13
|
+
// system account, api-author@kardalum.internal). A person's account is false.
|
|
14
|
+
system: z.boolean(),
|
|
15
|
+
});
|
|
16
|
+
// S301: the params of PATCH /users/:id/role, moved here from the route file.
|
|
17
|
+
export const UserParamsSchema = z.object({ id: z.string().uuid() });
|
|
18
|
+
export const UserListQuerySchema = z.object({
|
|
19
|
+
cursor: z.string().uuid().optional(),
|
|
20
|
+
limit: z.coerce.number().int().min(1).max(100).default(50),
|
|
21
|
+
});
|
|
22
|
+
export const UserListResponseSchema = z.object({
|
|
23
|
+
items: z.array(UserSummarySchema),
|
|
24
|
+
// null = no more pages.
|
|
25
|
+
nextCursor: z.string().uuid().nullable(),
|
|
26
|
+
});
|
|
27
|
+
export const CreateUserRequestSchema = z.object({
|
|
28
|
+
email: z.string().email(),
|
|
29
|
+
name: z.string().min(1).optional(),
|
|
30
|
+
password: z.string().min(8),
|
|
31
|
+
role: RoleIdSchema,
|
|
32
|
+
});
|
|
33
|
+
export const CreateUserResponseSchema = z.object({
|
|
34
|
+
user: UserSummarySchema,
|
|
35
|
+
});
|
|
36
|
+
export const UpdateUserRoleRequestSchema = z.object({
|
|
37
|
+
role: RoleIdSchema,
|
|
38
|
+
});
|
|
39
|
+
export const UpdateUserRoleResponseSchema = z.object({
|
|
40
|
+
user: UserSummarySchema,
|
|
41
|
+
});
|
|
42
|
+
// The admin interface languages that actually ship. ONE list, here,
|
|
43
|
+
// because three consumers have to agree: the server validates against
|
|
44
|
+
// it, the admin registers a bundle per entry, and the user menu offers
|
|
45
|
+
// exactly these. A locale absent from this list is one the admin has no
|
|
46
|
+
// strings for, so persisting it would leave a user stuck reading
|
|
47
|
+
// fallback English with no way back.
|
|
48
|
+
//
|
|
49
|
+
// The admin's own registration (apps/admin-ui/src/i18n/index.ts) and the
|
|
50
|
+
// user menu's option list (dashboard/user-menu.tsx) do not read this
|
|
51
|
+
// array; they are hand-written and derived from it in name only. Nothing
|
|
52
|
+
// in this package can enforce that from here, so the agreement is
|
|
53
|
+
// checked from the consuming side instead:
|
|
54
|
+
// apps/admin-ui/src/i18n/registered-locales.test.ts compares what
|
|
55
|
+
// index.ts registers against this list and fails if they diverge.
|
|
56
|
+
//
|
|
57
|
+
// This is NOT the site's content cultures (the Setting table, the
|
|
58
|
+
// Languages screen). See the spec's section 1: that is what language the
|
|
59
|
+
// site's CONTENT is written in, this is what language the admin's own
|
|
60
|
+
// chrome renders in.
|
|
61
|
+
export const ADMIN_LOCALES = ["en", "de"];
|
|
62
|
+
export const ThemeModeSchema = z.enum(["light", "dark", "system"]);
|
|
63
|
+
export const UserPreferencesSchema = z.object({
|
|
64
|
+
locale: z.enum(ADMIN_LOCALES).nullable(),
|
|
65
|
+
themeMode: ThemeModeSchema.nullable(),
|
|
66
|
+
// A built-in id or an installed theme plugin's reverse-domain id. Not
|
|
67
|
+
// enumerated: the set is open, since a theme plugin can add one.
|
|
68
|
+
themeId: z.string().min(1).max(200).nullable(),
|
|
69
|
+
});
|
|
70
|
+
// Every field optional: a PATCH that sets only the language must not
|
|
71
|
+
// clear the theme. An explicit null is different from an absent key and
|
|
72
|
+
// means "reset this one to the default".
|
|
73
|
+
export const UpdateUserPreferencesSchema = UserPreferencesSchema.partial();
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kardalum/api-schemas",
|
|
3
|
+
"version": "0.14.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"description": "Zod schemas for Kardalum's API shapes: the single source of truth for request/response validation, TypeScript types, and OpenAPI generation.",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=22.12"
|
|
9
|
+
},
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/kardalum/kardalum-starter/issues"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"main": "dist/index.js",
|
|
15
|
+
"types": "dist/index.d.ts",
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"!dist/**/*.test.*"
|
|
19
|
+
],
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/kardalum/kardalum-starter.git"
|
|
23
|
+
},
|
|
24
|
+
"homepage": "https://kardalum.com",
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"zod": "4.4.3"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"zod": "4.4.3"
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p .",
|
|
33
|
+
"test": "vitest run"
|
|
34
|
+
}
|
|
35
|
+
}
|