@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,611 @@
|
|
|
1
|
+
import type { ComponentType } from "react";
|
|
2
|
+
import type { CreateDocumentTypeRequest, PluginDocsPage, PluginInstallDeclaration, ResolvedInstallAnswers } from "@kardalum/api-schemas";
|
|
3
|
+
export type { InstallChoice, InstallOption, InstallStep, PluginInstallDeclaration, ResolvedInstallAnswers } from "@kardalum/api-schemas";
|
|
4
|
+
import type { ThemeTokenOverrides } from "@kardalum/design-tokens";
|
|
5
|
+
import type { ZodType } from "zod";
|
|
6
|
+
import type { DataTypePlugin } from "./data-type-plugin.js";
|
|
7
|
+
import type { BUILT_IN_RAIL_SECTIONS } from "./manifest-schema.js";
|
|
8
|
+
import type { PluginApiRouteContext, PublishedContent, ScopedStructuredStorage } from "./structured-storage-types.js";
|
|
9
|
+
import type { Entitlement, PluginTaskContext } from "./entitlement-types.js";
|
|
10
|
+
/**
|
|
11
|
+
* The seven plugin types. Since S268 this is a marketplace listing and
|
|
12
|
+
* filter label only: it does not decide which contributions a plugin may
|
|
13
|
+
* declare (see PluginContributions below), and it never did decide what a
|
|
14
|
+
* plugin may do at runtime. Plugin backend code runs unsandboxed and
|
|
15
|
+
* in-process, so what a plugin may do is what the derived capability list
|
|
16
|
+
* discloses and what marketplace review checks.
|
|
17
|
+
*/
|
|
18
|
+
export type PluginType = "datatype" | "section" | "template" | "theme" | "integration" | "utility" | "bundle";
|
|
19
|
+
/**
|
|
20
|
+
* Databases a plugin can declare support for. Deliberately NOT
|
|
21
|
+
* db-adapter's DatabaseDialect: that union includes 'mock' (the in-memory
|
|
22
|
+
* test adapter), which no plugin may target — and the SDK is a published
|
|
23
|
+
* package that must not depend on the unpublished adapter internals.
|
|
24
|
+
*/
|
|
25
|
+
export type DatabaseDialect = "postgresql" | "mysql" | "sqlite" | "mssql" | "mongodb";
|
|
26
|
+
/**
|
|
27
|
+
* How the plugin stores data and where it can run. Required on every
|
|
28
|
+
* manifest (plugin-sdk.md) — the marketplace pre-filters by the site's
|
|
29
|
+
* active database and install is blocked with a clear reason, never a
|
|
30
|
+
* silent failure.
|
|
31
|
+
*/
|
|
32
|
+
export interface DatabaseCompatibility {
|
|
33
|
+
/** 'simple' = JSON key-value SimpleStorageAPI (default, ~80% of
|
|
34
|
+
* plugins); 'structured' = relational StructuredStorageAPI. Declaring
|
|
35
|
+
* 'structured' IS the declaration that this plugin owns real tables:
|
|
36
|
+
* it derives the `storage.structured` capability, which is a promised
|
|
37
|
+
* capability, so a reviewer reads it against your code (S267 section 6).
|
|
38
|
+
* There is deliberately no boolean beside it, because a second place to
|
|
39
|
+
* say the same thing is a second place for the manifest to disagree with
|
|
40
|
+
* itself. */
|
|
41
|
+
storageType: "simple" | "structured";
|
|
42
|
+
supported: DatabaseDialect[];
|
|
43
|
+
/** Optional human-readable reason per UNSUPPORTED dialect (shown on the
|
|
44
|
+
* blocked-install screen) — hence Partial: supported dialects carry no
|
|
45
|
+
* reason. */
|
|
46
|
+
unsupportedReason?: Partial<Record<DatabaseDialect, string>>;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* A claim the author makes about what the plugin's code does at runtime,
|
|
50
|
+
* with the reason they make it.
|
|
51
|
+
*
|
|
52
|
+
* A bare boolean is not something an operator can consent to or a
|
|
53
|
+
* reviewer can check. "Calls the Stripe API to create checkout sessions"
|
|
54
|
+
* is. The install screen shows the reason and the generated reference
|
|
55
|
+
* page prints it, so write a sentence about this plugin, not a restating
|
|
56
|
+
* of the assertion's name.
|
|
57
|
+
*/
|
|
58
|
+
export interface PluginAssertion {
|
|
59
|
+
reason: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The short list of claims nothing in the manifest can verify (S267,
|
|
63
|
+
* section 4.2). Everything else a plugin may do is DERIVED from what it
|
|
64
|
+
* declares in `contributions` and `databaseCompatibility`, so it cannot
|
|
65
|
+
* be claimed falsely or held quietly.
|
|
66
|
+
*
|
|
67
|
+
* These two survive as explicit assertions precisely because no
|
|
68
|
+
* declaration can derive what a plugin's code does at runtime, and each
|
|
69
|
+
* is a promised capability, so a reviewer reads it against your code, for
|
|
70
|
+
* the same reason: they are the only claims in the manifest with nothing
|
|
71
|
+
* behind them.
|
|
72
|
+
*
|
|
73
|
+
* Presence is the claim. There is no `false`: a key that is absent is an
|
|
74
|
+
* assertion not made. The whole field is optional, so a plugin that
|
|
75
|
+
* makes neither claim writes nothing.
|
|
76
|
+
*
|
|
77
|
+
* Disclosure, not enforcement: plugin server code runs unsandboxed and
|
|
78
|
+
* in-process, so an omitted assertion is a promise broken, not an action
|
|
79
|
+
* blocked. Marketplace review is the layer that checks these against the
|
|
80
|
+
* code.
|
|
81
|
+
*/
|
|
82
|
+
export interface PluginAssertions {
|
|
83
|
+
/** The plugin reaches hosts other than this site. */
|
|
84
|
+
externalNetwork?: PluginAssertion;
|
|
85
|
+
/** The plugin reads or writes files outside the storage APIs. */
|
|
86
|
+
filesystemAccess?: PluginAssertion;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* The storage surface a plugin migration runs against. Deliberately empty
|
|
90
|
+
* for now: plugins never construct raw SQL (non-negotiable), so this is
|
|
91
|
+
* NOT db-adapter's TransactionContext: Month 6's plugin-storage work
|
|
92
|
+
* fills it in (defineTable etc.). Widening a parameter the plugin
|
|
93
|
+
* receives is backward-compatible for plugin authors.
|
|
94
|
+
*/
|
|
95
|
+
export interface PluginMigrationContext {
|
|
96
|
+
}
|
|
97
|
+
/** A database change applied at plugin install/update time. */
|
|
98
|
+
export interface PluginMigration {
|
|
99
|
+
id: string;
|
|
100
|
+
name: string;
|
|
101
|
+
up: (ctx: PluginMigrationContext) => void | Promise<void>;
|
|
102
|
+
down: (ctx: PluginMigrationContext) => void | Promise<void>;
|
|
103
|
+
}
|
|
104
|
+
/** Result of a plugin's validateMigration hook. */
|
|
105
|
+
export interface PluginMigrationValidation {
|
|
106
|
+
compatible: boolean;
|
|
107
|
+
issues: string[];
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Participation in a site-wide dialect migration (e.g. SQLite →
|
|
111
|
+
* PostgreSQL, the v1.x wizard): a plugin with its own stored data can
|
|
112
|
+
* veto, transform rows in flight, and run before/after steps.
|
|
113
|
+
*/
|
|
114
|
+
export interface PluginMigrationHooks {
|
|
115
|
+
beforeMigration?: (from: DatabaseDialect, to: DatabaseDialect) => void | Promise<void>;
|
|
116
|
+
transformRow?: (table: string, row: Record<string, unknown>, from: DatabaseDialect, to: DatabaseDialect) => Record<string, unknown> | Promise<Record<string, unknown>>;
|
|
117
|
+
afterMigration?: (from: DatabaseDialect, to: DatabaseDialect) => void | Promise<void>;
|
|
118
|
+
validateMigration?: (from: DatabaseDialect, to: DatabaseDialect) => PluginMigrationValidation | Promise<PluginMigrationValidation>;
|
|
119
|
+
}
|
|
120
|
+
/** The events a plugin can hook. The hook engine (S159) actually FIRES
|
|
121
|
+
* only three of these — content:afterPublish (including rollbacks),
|
|
122
|
+
* content:afterTrash, content:afterRestore — with the
|
|
123
|
+
* ContentLifecycleHookPayload shape declared below; every other event in
|
|
124
|
+
* this catalog is declared for forward compatibility and stays inert. */
|
|
125
|
+
export type HookEvent = "content:beforeSave" | "content:afterSave" | "content:beforePublish" | "content:afterPublish" | "content:afterTrash" | "content:afterRestore" | "content:beforeDelete" | "media:afterUpload" | "user:afterLogin" | "api:beforeResponse";
|
|
126
|
+
export interface ContentLifecycleHookPayload {
|
|
127
|
+
event: "content:afterPublish" | "content:afterTrash" | "content:afterRestore";
|
|
128
|
+
contentId: string;
|
|
129
|
+
path: string;
|
|
130
|
+
documentTypeId: string;
|
|
131
|
+
occurredAt: string;
|
|
132
|
+
}
|
|
133
|
+
export interface PluginHookContext {
|
|
134
|
+
structuredStorage: ScopedStructuredStorage;
|
|
135
|
+
getPublishedContent(contentId: string): Promise<PublishedContent | null>;
|
|
136
|
+
/** S284b: the host's latest licence verdict for this plugin
|
|
137
|
+
* (`kind: "verdict"`), `kind: "exempt"` on a non-production install,
|
|
138
|
+
* `kind: "none"` when the host holds no verdict. Check it with
|
|
139
|
+
* `requireEntitlement` from `@kardalum/plugin-sdk/entitlement`; a hook
|
|
140
|
+
* that throws its EntitlementError is skipped with one log line. */
|
|
141
|
+
entitlement: Entitlement;
|
|
142
|
+
}
|
|
143
|
+
export type HookHandler = (payload: unknown, context?: PluginHookContext) => void | Promise<void>;
|
|
144
|
+
export type PluginHooks = Partial<Record<HookEvent, HookHandler>>;
|
|
145
|
+
/** A slot's label: a map of language code to text, `en` required (spec D5).
|
|
146
|
+
* Each key is a language code such as `en`, `de` or `pt-BR`. The admin
|
|
147
|
+
* shows the active language's text, else English; `slotLabel` is the one
|
|
148
|
+
* place that choice is made. */
|
|
149
|
+
export interface SlotLabel {
|
|
150
|
+
en: string;
|
|
151
|
+
[locale: string]: string;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* The text of a slot's label for a locale: the locale as given, else its
|
|
155
|
+
* primary subtag (`de-AT` reads `de`), else `en`, which every label carries.
|
|
156
|
+
* Locale codes compare case-insensitively, since BCP 47 tags are
|
|
157
|
+
* case-insensitive and a label written `pt-BR` must answer `pt-br`.
|
|
158
|
+
*/
|
|
159
|
+
export declare function slotLabel(label: SlotLabel, locale: string): string;
|
|
160
|
+
/** The built-in sections a plugin may add a rail entry to. The plugin
|
|
161
|
+
* management screen is not one: it is the operator's, not a host. */
|
|
162
|
+
export type BuiltInRailSection = (typeof BUILT_IN_RAIL_SECTIONS)[number];
|
|
163
|
+
/** An entry in a rail: inside a plugin section's own rail, or (as
|
|
164
|
+
* BuiltInRailEntryContribution) in a built-in section's rail. `id` is
|
|
165
|
+
* unique within its rail, and is the last segment of its URL, so it is
|
|
166
|
+
* lowercase letters, digits and single hyphens (`refunds`,
|
|
167
|
+
* `order-reports`), at most 64 characters. */
|
|
168
|
+
export interface RailEntryContribution {
|
|
169
|
+
id: string;
|
|
170
|
+
label: SlotLabel;
|
|
171
|
+
/** Optional: a rail entry may be text only. A Lucide name when given. */
|
|
172
|
+
icon?: string;
|
|
173
|
+
/** The named permission action a subject must hold to see this entry and
|
|
174
|
+
* open its URL; a subject without it gets the admin's not-found view
|
|
175
|
+
* (spec D4). Prefixed with this plugin's id and declared in `actions`. */
|
|
176
|
+
action: string;
|
|
177
|
+
view: ComponentType;
|
|
178
|
+
}
|
|
179
|
+
/** A top-level section in the admin's app bar (e.g. Forms). Its `view` is
|
|
180
|
+
* the section's landing page; `rail` lists entries in the section's own
|
|
181
|
+
* rail. `id` is unique within this plugin, and two plugins may use the same
|
|
182
|
+
* one, since a section's URL is namespaced by its plugin's id (spec D3, D8).
|
|
183
|
+
* The id is a segment of that URL, so it is lowercase letters, digits and
|
|
184
|
+
* single hyphens (`orders`, `order-reports`), at most 64 characters. */
|
|
185
|
+
export interface AdminSectionContribution {
|
|
186
|
+
id: string;
|
|
187
|
+
label: SlotLabel;
|
|
188
|
+
icon: string;
|
|
189
|
+
/** The named permission action a subject must hold to reach this
|
|
190
|
+
* (S270, theme G1). Required: a contribution that declares no action
|
|
191
|
+
* would be a gate nobody chose, and omission is how a permission
|
|
192
|
+
* silently loosens. Must be prefixed with this plugin's own id, so one
|
|
193
|
+
* plugin cannot declare an action in another's namespace or in core's. */
|
|
194
|
+
action: string;
|
|
195
|
+
view: ComponentType;
|
|
196
|
+
rail?: RailEntryContribution[];
|
|
197
|
+
}
|
|
198
|
+
/** A rail entry in one of the built-in sections' rails. A plugin cannot
|
|
199
|
+
* take over a built-in section's landing page, only add to its rail
|
|
200
|
+
* (spec D2). */
|
|
201
|
+
export interface BuiltInRailEntryContribution extends RailEntryContribution {
|
|
202
|
+
section: BuiltInRailSection;
|
|
203
|
+
}
|
|
204
|
+
export interface DashboardWidgetContribution {
|
|
205
|
+
id: string;
|
|
206
|
+
name: string;
|
|
207
|
+
view: ComponentType;
|
|
208
|
+
/** The named permission action a subject must hold to reach this
|
|
209
|
+
* (S270, theme G1). Required: a contribution that declares no action
|
|
210
|
+
* would be a gate nobody chose, and omission is how a permission
|
|
211
|
+
* silently loosens. Must be prefixed with this plugin's own id, so one
|
|
212
|
+
* plugin cannot declare an action in another's namespace or in core's. */
|
|
213
|
+
action: string;
|
|
214
|
+
}
|
|
215
|
+
/** Mounted under /api/plugins/:pluginId/… so two plugins can never
|
|
216
|
+
* collide on a path (api-design.md). The host routes every declaration
|
|
217
|
+
* through Fastify's own router, rebuilt whenever a plugin is attached or
|
|
218
|
+
* detached (S295, 2026-10-14-s295-routes-fastify-knows-about-design.md).
|
|
219
|
+
* `handler` stays untyped at the SDK boundary (the same cross-boundary
|
|
220
|
+
* erasure as view ComponentType fields): the host casts to real Fastify
|
|
221
|
+
* types internally, since it always passes real FastifyRequest and
|
|
222
|
+
* FastifyReply instances. */
|
|
223
|
+
export interface ApiRouteContribution {
|
|
224
|
+
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
225
|
+
/** Relative to /api/plugins/:pluginId/: starting with "/" and holding one or
|
|
226
|
+
* more segments, each letters, digits, "-" and "_", or a parameter ":name"
|
|
227
|
+
* (a letter, then letters, digits or "_") matching one segment of the
|
|
228
|
+
* request; at most 200 characters. Two routes of one method that the
|
|
229
|
+
* router would read as one, or that one request could match both of, are
|
|
230
|
+
* refused (api-schemas' checkApiRouteDeclarations). */
|
|
231
|
+
path: string;
|
|
232
|
+
/** Who may call this route.
|
|
233
|
+
* - "admin" (the default when omitted) requires a JWT session whose role
|
|
234
|
+
* holds `action`: for admin-facing plugin UIs like Commerce Orders or
|
|
235
|
+
* the Forms builder.
|
|
236
|
+
* - "apiKey" requires a live API key that holds `action`, for a read and a
|
|
237
|
+
* write alike (S299): for credentialed headless callers like a
|
|
238
|
+
* storefront checkout.
|
|
239
|
+
* - "public" requires NO credentials: for genuinely anonymous browser
|
|
240
|
+
* traffic such as a contact-form submission (Session 160's Forms plugin
|
|
241
|
+
* was the first consumer). A public route owns its own abuse controls
|
|
242
|
+
* (honeypot, per-IP bucket, body caps) and only reaches browsers
|
|
243
|
+
* cross-origin when the operator allowlists their origin in
|
|
244
|
+
* KARDALUM_CORS_ORIGINS.
|
|
245
|
+
* Anything unrecognized falls back to "admin": secure by default. */
|
|
246
|
+
access?: "admin" | "apiKey" | "public";
|
|
247
|
+
/** Optional validation, compiled with the host's validator compiler when the
|
|
248
|
+
* host routes the plugin (again on every attach or detach), never per
|
|
249
|
+
* request; the handler receives the parsed values. `response` is the other
|
|
250
|
+
* direction (S297): the success bodies the handler answers, which the host
|
|
251
|
+
* checks and documents. */
|
|
252
|
+
schema?: {
|
|
253
|
+
body?: ZodType;
|
|
254
|
+
querystring?: ZodType;
|
|
255
|
+
/** The path's parameters: a Zod object keyed by the names the path
|
|
256
|
+
* declares. Without it each parameter reaches request.params as a
|
|
257
|
+
* string. */
|
|
258
|
+
params?: ZodType;
|
|
259
|
+
/** The success responses, keyed by status code written as a string,
|
|
260
|
+
* "200" to "299", at most four. When the handler RETURNS a value (it does
|
|
261
|
+
* not send it with `reply.send`), the value is checked against the
|
|
262
|
+
* schema for the status the reply carries (200 unless the handler set
|
|
263
|
+
* another with `reply.code`), and the PARSED value is what is sent:
|
|
264
|
+
* unknown keys dropped, defaults and transforms applied. A value that
|
|
265
|
+
* does not match answers a 500 and is logged with the problems. A status
|
|
266
|
+
* with no entry is sent unchecked, and so is anything the handler sends
|
|
267
|
+
* through `reply.send`. The schemas also document the response in the
|
|
268
|
+
* server's OpenAPI documents. */
|
|
269
|
+
response?: Record<string, ZodType>;
|
|
270
|
+
};
|
|
271
|
+
/** Third argument added Month 8, Session 90 — the first server-side
|
|
272
|
+
* consumer needing privileged host access. Existing two-argument (or
|
|
273
|
+
* fewer) handlers remain perfectly valid: TypeScript allows a function
|
|
274
|
+
* with fewer declared parameters to satisfy a type expecting more. */
|
|
275
|
+
handler: (request: unknown, reply: unknown, context: PluginApiRouteContext) => unknown;
|
|
276
|
+
/** The named permission action a caller must hold (S270, theme G1).
|
|
277
|
+
* Required unless `access` is "public": on an "admin" route (or one that
|
|
278
|
+
* omits `access`) the session's role must hold it, and on an "apiKey"
|
|
279
|
+
* route the key must hold it, for a read and a write alike (S299). Only a
|
|
280
|
+
* "public" route, which needs no credential, may omit it.
|
|
281
|
+
* `access` decides WHICH CREDENTIAL reaches the handler; this decides
|
|
282
|
+
* WHAT THAT SUBJECT MAY DO. They are orthogonal. */
|
|
283
|
+
action?: string;
|
|
284
|
+
}
|
|
285
|
+
export interface ScheduledTaskContribution {
|
|
286
|
+
id: string;
|
|
287
|
+
name: string;
|
|
288
|
+
/** Standard 5-field cron expression. */
|
|
289
|
+
cron: string;
|
|
290
|
+
run: (context?: PluginTaskContext) => void | Promise<void>;
|
|
291
|
+
}
|
|
292
|
+
/** Media pipeline processor (thumbnails, optimization). The file/result
|
|
293
|
+
* contract firms up when the BullMQ media pipeline lands. */
|
|
294
|
+
export interface MediaProcessorContribution {
|
|
295
|
+
id: string;
|
|
296
|
+
name: string;
|
|
297
|
+
process: (file: unknown) => unknown | Promise<unknown>;
|
|
298
|
+
}
|
|
299
|
+
export interface SettingsPageContribution {
|
|
300
|
+
id: string;
|
|
301
|
+
name: string;
|
|
302
|
+
view: ComponentType;
|
|
303
|
+
/** The named permission action a subject must hold to reach this
|
|
304
|
+
* (S270, theme G1). Required: a contribution that declares no action
|
|
305
|
+
* would be a gate nobody chose, and omission is how a permission
|
|
306
|
+
* silently loosens. Must be prefixed with this plugin's own id, so one
|
|
307
|
+
* plugin cannot declare an action in another's namespace or in core's. */
|
|
308
|
+
action: string;
|
|
309
|
+
}
|
|
310
|
+
export interface ContentTreeActionContribution {
|
|
311
|
+
id: string;
|
|
312
|
+
label: string;
|
|
313
|
+
onSelect: (nodeId: string) => void | Promise<void>;
|
|
314
|
+
/** The named permission action a subject must hold to reach this
|
|
315
|
+
* (S270, theme G1). Required: a contribution that declares no action
|
|
316
|
+
* would be a gate nobody chose, and omission is how a permission
|
|
317
|
+
* silently loosens. Must be prefixed with this plugin's own id, so one
|
|
318
|
+
* plugin cannot declare an action in another's namespace or in core's. */
|
|
319
|
+
action: string;
|
|
320
|
+
}
|
|
321
|
+
/** A button in the rich-text editor's toolbar. TipTap wiring comes with
|
|
322
|
+
* the first consumer. */
|
|
323
|
+
export interface EditorToolbarContribution {
|
|
324
|
+
id: string;
|
|
325
|
+
label: string;
|
|
326
|
+
icon: string;
|
|
327
|
+
onClick: () => void | Promise<void>;
|
|
328
|
+
/** The named permission action a subject must hold to reach this
|
|
329
|
+
* (S270, theme G1). Required: a contribution that declares no action
|
|
330
|
+
* would be a gate nobody chose, and omission is how a permission
|
|
331
|
+
* silently loosens. Must be prefixed with this plugin's own id, so one
|
|
332
|
+
* plugin cannot declare an action in another's namespace or in core's. */
|
|
333
|
+
action: string;
|
|
334
|
+
}
|
|
335
|
+
/** A service an integration plugin exposes for other plugins to consume
|
|
336
|
+
* (e.g. a Stripe client). Shape intentionally opaque until the
|
|
337
|
+
* cross-plugin service registry exists. */
|
|
338
|
+
export interface ExposedServiceContribution {
|
|
339
|
+
id: string;
|
|
340
|
+
name: string;
|
|
341
|
+
service: unknown;
|
|
342
|
+
}
|
|
343
|
+
/** A ready-made frontend starter shipped alongside a plugin (e.g. the
|
|
344
|
+
* Commerce plugin's "Online Store" Next.js starter) — one marketplace
|
|
345
|
+
* listing, working site immediately. Packaging lands Month 13. */
|
|
346
|
+
export interface BundledTemplateContribution {
|
|
347
|
+
name: string;
|
|
348
|
+
description?: string;
|
|
349
|
+
/** Where the starter's source lives until marketplace packaging exists. */
|
|
350
|
+
repository?: string;
|
|
351
|
+
}
|
|
352
|
+
/** One render template a plugin ships under its own `templates/` dir —
|
|
353
|
+
* per S192 §8 ("a new `templates` contribution — template files declared
|
|
354
|
+
* with alias/kind and, for pages, which contributed document type they
|
|
355
|
+
* render"). Any plugin may declare templates (S268): a `page` kind entry
|
|
356
|
+
* may only name a document type this same manifest declares. */
|
|
357
|
+
export interface TemplateContribution {
|
|
358
|
+
/** Relative path under the plugin's `templates/` directory, forward
|
|
359
|
+
* slashes, ending in `.liquid` — this is the file S192 §5 says the
|
|
360
|
+
* developer edits and the mirror-on-edit versioning tracks. */
|
|
361
|
+
file: string;
|
|
362
|
+
name: string;
|
|
363
|
+
/** The cross-reference key other templates use to `{% layout %}` /
|
|
364
|
+
* `{% render %}` this one (S192 §3/§4). */
|
|
365
|
+
alias: string;
|
|
366
|
+
kind: "page" | "layout" | "partial";
|
|
367
|
+
/** `page` kind only: a NAME from THIS manifest's own `documentTypes`
|
|
368
|
+
* contribution — the document type this page template renders.
|
|
369
|
+
* Optional: a catch-all-ish page template with no specific type is
|
|
370
|
+
* legal (S193 allows a null `documentTypeId`). Forbidden on
|
|
371
|
+
* `layout`/`partial` entries, which never render a document type. */
|
|
372
|
+
documentType?: string;
|
|
373
|
+
}
|
|
374
|
+
export interface SerializerContext {
|
|
375
|
+
/** The public core item, post field-serialization. */
|
|
376
|
+
item: {
|
|
377
|
+
id: string;
|
|
378
|
+
documentTypeId: string;
|
|
379
|
+
locale: string;
|
|
380
|
+
publishedAt: string | null;
|
|
381
|
+
version: number;
|
|
382
|
+
};
|
|
383
|
+
/** SERIALIZED field data — contributions run after core serialization. */
|
|
384
|
+
data: Record<string, unknown>;
|
|
385
|
+
documentType: {
|
|
386
|
+
id: string;
|
|
387
|
+
name: string;
|
|
388
|
+
};
|
|
389
|
+
}
|
|
390
|
+
export interface CustomFormatContribution {
|
|
391
|
+
/** Plugin-scoped name, /^[a-z0-9-]+$/ — addressed as `<pluginId>:<name>`. */
|
|
392
|
+
name: string;
|
|
393
|
+
build: (context: SerializerContext) => unknown | Promise<unknown>;
|
|
394
|
+
}
|
|
395
|
+
export interface SerializerContribution {
|
|
396
|
+
extendContentResponse?: (context: SerializerContext) => Record<string, unknown> | Promise<Record<string, unknown>>;
|
|
397
|
+
customFormats?: CustomFormatContribution[];
|
|
398
|
+
}
|
|
399
|
+
export interface PluginContributions {
|
|
400
|
+
/** The Month 3 datatype contract, referenced verbatim: a plugin can
|
|
401
|
+
* ship several field types (id/version on each entry are the
|
|
402
|
+
* datatype's own, distinct from the plugin's). */
|
|
403
|
+
dataTypes?: DataTypePlugin[];
|
|
404
|
+
adminSections?: AdminSectionContribution[];
|
|
405
|
+
/** Rail entries in the built-in sections' rails (S280). */
|
|
406
|
+
railEntries?: BuiltInRailEntryContribution[];
|
|
407
|
+
dashboardWidgets?: DashboardWidgetContribution[];
|
|
408
|
+
apiRoutes?: ApiRouteContribution[];
|
|
409
|
+
hooks?: PluginHooks;
|
|
410
|
+
scheduledTasks?: ScheduledTaskContribution[];
|
|
411
|
+
mediaProcessors?: MediaProcessorContribution[];
|
|
412
|
+
settingsPages?: SettingsPageContribution[];
|
|
413
|
+
contentTreeActions?: ContentTreeActionContribution[];
|
|
414
|
+
editorToolbar?: EditorToolbarContribution[];
|
|
415
|
+
exposedServices?: ExposedServiceContribution[];
|
|
416
|
+
serializers?: SerializerContribution;
|
|
417
|
+
/** Document types the plugin provisions at install: the creation shape
|
|
418
|
+
* (server mints ids), same schema the admin's builder POSTs. */
|
|
419
|
+
documentTypes?: CreateDocumentTypeRequest[];
|
|
420
|
+
/** Tokens only, never components: the same ThemeTokenOverrides shape
|
|
421
|
+
* the built-in Light/Dark themes use (color scales + radius, enforced
|
|
422
|
+
* structurally by @kardalum/design-tokens). */
|
|
423
|
+
themeTokens?: ThemeTokenOverrides;
|
|
424
|
+
/** Render templates the plugin ships (S192 §8). A `page` kind entry may
|
|
425
|
+
* only name a document type this same manifest declares in
|
|
426
|
+
* `documentTypes`, which manifest-schema.ts cross-checks. */
|
|
427
|
+
templates?: TemplateContribution[];
|
|
428
|
+
/** Paths relative to the plugin's public/ directory (e.g.
|
|
429
|
+
* "styles/site.css") that the CMS registers as admin-editable text
|
|
430
|
+
* assets (S192 §5): bare, never "public/"-prefixed (manifest-schema.ts
|
|
431
|
+
* rejects a leading "public/" segment). Shipped files it does not list
|
|
432
|
+
* here stay unregistered: still served and referenceable, just not
|
|
433
|
+
* surfaced in the Assets editor. */
|
|
434
|
+
assets?: string[];
|
|
435
|
+
/** Plugin ids installed together, resolved by the marketplace. */
|
|
436
|
+
bundledPlugins?: string[];
|
|
437
|
+
bundledTemplate?: BundledTemplateContribution;
|
|
438
|
+
}
|
|
439
|
+
/**
|
|
440
|
+
* The contributions that put code in the browser, and so the ones that
|
|
441
|
+
* make a plugin ship a client bundle (S267 section 5, implemented by
|
|
442
|
+
* S268 Task 3). `dataTypes`, `adminSections`, `railEntries` (S280),
|
|
443
|
+
* `dashboardWidgets` and `settingsPages` carry React views; `contentTreeActions` and
|
|
444
|
+
* `editorToolbar` carry client callbacks (`onSelect`, `onClick`), which
|
|
445
|
+
* is just as much browser code even though neither has a `view` key.
|
|
446
|
+
*
|
|
447
|
+
* Everything else is absent on purpose: `apiRoutes`, `hooks`,
|
|
448
|
+
* `scheduledTasks`, `mediaProcessors` and `serializers` run on the
|
|
449
|
+
* server, and `documentTypes`, `themeTokens`, `templates`, `assets`,
|
|
450
|
+
* `bundledPlugins`, `bundledTemplate` and `exposedServices` are data the
|
|
451
|
+
* host consumes rather than code the browser runs.
|
|
452
|
+
*
|
|
453
|
+
* This replaces the type-keyed CLIENT_BUNDLE_TYPES. It is more correct
|
|
454
|
+
* than that list was, not merely equivalent: a plugin listed as
|
|
455
|
+
* `section` with no views had to ship a remoteEntry.js it did not have.
|
|
456
|
+
*/
|
|
457
|
+
export declare const VIEW_BEARING_CONTRIBUTIONS: readonly ["dataTypes", "adminSections", "railEntries", "dashboardWidgets", "settingsPages", "contentTreeActions", "editorToolbar"];
|
|
458
|
+
export type ViewBearingContribution = (typeof VIEW_BEARING_CONTRIBUTIONS)[number];
|
|
459
|
+
/**
|
|
460
|
+
* Whether a manifest's declared contributions require a client bundle:
|
|
461
|
+
* whether a built artifact must contain a `remoteEntry.js`, and whether
|
|
462
|
+
* the Module Federation build runs at all.
|
|
463
|
+
*
|
|
464
|
+
* Accepts both a live `PluginContributions` and the redacted, JSON-safe
|
|
465
|
+
* summary kardalum plugin writes into a package's `manifest.json` (which
|
|
466
|
+
* keeps every contribution key and every array's length, dropping only
|
|
467
|
+
* the function-valued fields inside each entry), so both sides of an
|
|
468
|
+
* install answer this identically.
|
|
469
|
+
*
|
|
470
|
+
* An empty array declares nothing and therefore buys no bundle.
|
|
471
|
+
*
|
|
472
|
+
* NAMED `declaresClientBundle`, not `hasClientBundle`, on purpose. The
|
|
473
|
+
* S144 predicate of that name took a `type` string and answered `true`
|
|
474
|
+
* for `"datatype"`; this one takes an object and answers `false` for the
|
|
475
|
+
* same argument, silently, because a string is not an object. All three
|
|
476
|
+
* things a `false` decides are quiet (skip the federation build, stop
|
|
477
|
+
* requiring a remoteEntry.js, hand out `remoteUrl: ""`), so a caller left
|
|
478
|
+
* on the old shape produced a package that reported "Built" and shipped
|
|
479
|
+
* nothing, which is how this bit during S268 Task 3 itself: a stale
|
|
480
|
+
* `kardalum/dist/plugin/build.js` passed a string and the gap surfaced only
|
|
481
|
+
* as a downstream server test. Under the new name that same stale caller
|
|
482
|
+
* fails at module load with "does not provide an export named
|
|
483
|
+
* 'hasClientBundle'", before it can decide anything. The old name is
|
|
484
|
+
* gone rather than aliased: a name that outlives its meaning is how these
|
|
485
|
+
* get recombined later. A caller passing a string to THIS name is a
|
|
486
|
+
* compile error against the signature below.
|
|
487
|
+
*/
|
|
488
|
+
export declare function declaresClientBundle(contributions: PluginContributions | Record<string, unknown> | null | undefined): boolean;
|
|
489
|
+
/** S292: what onInstall is told. */
|
|
490
|
+
export interface PluginInstallContext {
|
|
491
|
+
/** The install's answers with every default filled: what the operator
|
|
492
|
+
* chose for the sample content, the offered roles and the plugin's own
|
|
493
|
+
* `install` options (resolveInstallAnswers in @kardalum/api-schemas). */
|
|
494
|
+
answers: ResolvedInstallAnswers;
|
|
495
|
+
/** S293: the plugin's own structured storage, for a manifest declaring
|
|
496
|
+
* `storageType: 'structured'`, scoped to this plugin as a route's is and
|
|
497
|
+
* usable before it is active (onInstall runs before its row exists). A
|
|
498
|
+
* table onInstall defines is dropped again if the install fails. The handle
|
|
499
|
+
* is for the hook alone: once onInstall returns or throws it refuses while
|
|
500
|
+
* the plugin is not active, like any plugin storage, so keeping it for later
|
|
501
|
+
* gains nothing. Absent for a simple-storage plugin. */
|
|
502
|
+
structuredStorage?: ScopedStructuredStorage;
|
|
503
|
+
}
|
|
504
|
+
/** S292: what onUpdate is told. */
|
|
505
|
+
export interface PluginUpdateContext {
|
|
506
|
+
/** The version that was installed before. */
|
|
507
|
+
fromVersion: string;
|
|
508
|
+
answers: ResolvedInstallAnswers;
|
|
509
|
+
/** S293: the plugin's own structured storage, for a manifest declaring
|
|
510
|
+
* `storageType: 'structured'`, scoped to this plugin as a route's is and
|
|
511
|
+
* usable while it is not active (an update may run while the plugin is
|
|
512
|
+
* off). A table onUpdate defines is kept if the update fails: storage only
|
|
513
|
+
* grows, and an uninstall snapshots and drops it. The handle is for the
|
|
514
|
+
* hook alone: once onUpdate returns or throws it refuses while the plugin
|
|
515
|
+
* is not active, like any plugin storage, so keeping it for later gains
|
|
516
|
+
* nothing. Absent for a simple-storage plugin. */
|
|
517
|
+
structuredStorage?: ScopedStructuredStorage;
|
|
518
|
+
}
|
|
519
|
+
/** Fields shared by every plugin type. */
|
|
520
|
+
export interface PluginManifestBase {
|
|
521
|
+
/** Reverse domain, e.g. 'com.yourname.googlemaps'. */
|
|
522
|
+
id: string;
|
|
523
|
+
name: string;
|
|
524
|
+
/** The plugin's own semver. */
|
|
525
|
+
version: string;
|
|
526
|
+
type: PluginType;
|
|
527
|
+
description: string;
|
|
528
|
+
author: string;
|
|
529
|
+
license: string;
|
|
530
|
+
/** Marketplace price; 0 or absent = free. */
|
|
531
|
+
price?: number;
|
|
532
|
+
/**
|
|
533
|
+
* Marketplace verification hash. Optional BY DESIGN, not oversight:
|
|
534
|
+
* per the Trust model, sideloaded/local dev plugins are unsigned by
|
|
535
|
+
* definition (Tier 2 'unverified') — only marketplace-signed plugins
|
|
536
|
+
* carry one. Signing is authenticity, not a sandbox; the safety layer
|
|
537
|
+
* is identical for both tiers.
|
|
538
|
+
*/
|
|
539
|
+
signature?: string;
|
|
540
|
+
/** Semver range of compatible CMS versions, e.g. '^1.0.0'. */
|
|
541
|
+
cmsVersion: string;
|
|
542
|
+
/** Ids of plugins this one requires. */
|
|
543
|
+
pluginDependencies?: string[];
|
|
544
|
+
databaseCompatibility: DatabaseCompatibility;
|
|
545
|
+
assertions?: PluginAssertions;
|
|
546
|
+
/** DB changes applied on install (through plugin storage — never raw
|
|
547
|
+
* SQL). */
|
|
548
|
+
migrations?: PluginMigration[];
|
|
549
|
+
onInstall?: (ctx: PluginInstallContext) => void | Promise<void>;
|
|
550
|
+
onUninstall?: () => void | Promise<void>;
|
|
551
|
+
onActivate?: () => void | Promise<void>;
|
|
552
|
+
onDeactivate?: () => void | Promise<void>;
|
|
553
|
+
/** S274c: runs when an installed plugin is updated to this version, after
|
|
554
|
+
* the new migrations and document types and before the new actions sync.
|
|
555
|
+
* A throw rolls the update back and the old version stays installed.
|
|
556
|
+
* `onInstall` never runs on an update. */
|
|
557
|
+
onUpdate?: (ctx: PluginUpdateContext) => void | Promise<void>;
|
|
558
|
+
migrationHooks?: PluginMigrationHooks;
|
|
559
|
+
/**
|
|
560
|
+
* The actions this plugin brings (S273). Each gated contribution above
|
|
561
|
+
* names one of these, and each of these is named by at least one, so the
|
|
562
|
+
* install screen shows exactly what installing adds to the permission
|
|
563
|
+
* surface. Ids carry this plugin's prefix and have a label, because
|
|
564
|
+
* nothing ever shows an operator a raw action string.
|
|
565
|
+
*/
|
|
566
|
+
actions?: Array<{
|
|
567
|
+
id: string;
|
|
568
|
+
label: string;
|
|
569
|
+
}>;
|
|
570
|
+
/**
|
|
571
|
+
* Roles this plugin offers (S273). An offer is never applied unasked: the
|
|
572
|
+
* operator accepts it on the install screen or from the installed-plugins
|
|
573
|
+
* view, and the result is an ordinary editable role holding exactly these
|
|
574
|
+
* actions: the plugin's own and, beside them, only the built-in read rights
|
|
575
|
+
* an offer may grant (S293, OFFERABLE_BUILT_IN_ACTIONS in
|
|
576
|
+
* @kardalum/api-schemas).
|
|
577
|
+
*/
|
|
578
|
+
roles?: Array<{
|
|
579
|
+
id: string;
|
|
580
|
+
label: string;
|
|
581
|
+
actions: string[];
|
|
582
|
+
}>;
|
|
583
|
+
/** S286: the plugin's docs pages, in reading order. Omit it and the
|
|
584
|
+
* README is the one page (the overview). Which roles the marketplace
|
|
585
|
+
* requires is derived from what the manifest declares, never listed
|
|
586
|
+
* here: a "setup" page when the plugin has migrations, dependencies, a
|
|
587
|
+
* price or document types; a "configuration" page when it has settings
|
|
588
|
+
* pages. */
|
|
589
|
+
docs?: PluginDocsPage[];
|
|
590
|
+
/** S291: the language the docs pages are written in, as a language code
|
|
591
|
+
* such as "en", "de" or "pt-BR". Absent means English. The marketplace
|
|
592
|
+
* shows it on the listing and the docs index. One language per plugin
|
|
593
|
+
* before v1: translated docs pages are not supported yet. */
|
|
594
|
+
docsLanguage?: string;
|
|
595
|
+
/** S292: what the plugin's install asks, as plain data, so a person, a
|
|
596
|
+
* script and the CLI can answer it before any of the plugin's code runs.
|
|
597
|
+
* The built-in questions (the sample content, the offered roles) are never
|
|
598
|
+
* declared here: they follow from what the package ships. */
|
|
599
|
+
install?: PluginInstallDeclaration;
|
|
600
|
+
}
|
|
601
|
+
/**
|
|
602
|
+
* The full plugin manifest. One shape for every plugin: `type` is a
|
|
603
|
+
* marketplace listing label, and any plugin may declare any contribution
|
|
604
|
+
* (S268, per the S267 capability design). What a plugin may DO is decided
|
|
605
|
+
* by the capability list derived from these contributions and by
|
|
606
|
+
* marketplace review, not by its listing label. Built-ins and Module
|
|
607
|
+
* Federation remotes both register through this same contract.
|
|
608
|
+
*/
|
|
609
|
+
export interface PluginManifest extends PluginManifestBase {
|
|
610
|
+
contributions: PluginContributions;
|
|
611
|
+
}
|