@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,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# @kardalum/plugin-package
|
|
2
|
+
|
|
3
|
+
The archive format and signing toolchain behind [Kardalum CMS](https://kardalum.com)
|
|
4
|
+
plugins: turning a built plugin into a signed, verifiable package, and
|
|
5
|
+
safely unpacking one back out. `kardalum plugin pack`/`publish` build
|
|
6
|
+
packages with it; `@kardalum/server` and the marketplace verify them
|
|
7
|
+
with it before anything on disk is trusted.
|
|
8
|
+
|
|
9
|
+
This is an internal package. It is private, never published on its own
|
|
10
|
+
and never installed on its own: it ships inside `@kardalum/server`, `@kardalum/plugin-sdk` and the `kardalum` CLI, which bundle it.
|
|
11
|
+
|
|
12
|
+
## Who this is for
|
|
13
|
+
|
|
14
|
+
Plugin authors don't call this package directly: `kardalum plugin pack`
|
|
15
|
+
and `kardalum plugin publish` (see the [`kardalum`](https://www.npmjs.com/package/kardalum)
|
|
16
|
+
CLI, published under that name in a coming release) do it for you. This package is for tooling that verifies or extracts
|
|
17
|
+
plugin archives itself: a CMS host, a private marketplace, or a script
|
|
18
|
+
auditing a `.zip` before installing it.
|
|
19
|
+
|
|
20
|
+
## What's in it
|
|
21
|
+
|
|
22
|
+
**Signing.** Plugin archives are signed with Ed25519 and verified against
|
|
23
|
+
a list of trusted keys. A package is only trusted if its signature
|
|
24
|
+
checks out against a key the host actually trusts, not just against any
|
|
25
|
+
signature:
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
import { generateSigningKeyPair, hashArchive, signEnvelope, verifyEnvelope } from "@kardalum/plugin-package";
|
|
29
|
+
|
|
30
|
+
const { privateKey, publicKey, keyId } = generateSigningKeyPair();
|
|
31
|
+
const sha256 = await hashArchive("./my-plugin-1.0.0.zip");
|
|
32
|
+
|
|
33
|
+
const envelope = { v: 1 as const, alg: "ed25519" as const, keyId, pluginId: "com.me.my-plugin", version: "1.0.0", sha256 };
|
|
34
|
+
const signature = signEnvelope(envelope, privateKey);
|
|
35
|
+
|
|
36
|
+
const result = verifyEnvelope({ envelope, signature }, sha256, [{ keyId, publicKey }]);
|
|
37
|
+
// result.status: "verified" | "unsigned" | "failed"
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
**Safe extraction.** `extractArtifact` unpacks a plugin `.zip` with hard
|
|
41
|
+
limits on entry count, per-entry size, and total size, and rejects
|
|
42
|
+
zip-slip-style paths (leading `/`, drive letters, `..` segments) before
|
|
43
|
+
anything is written to disk:
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
import { extractArtifact } from "@kardalum/plugin-package";
|
|
47
|
+
|
|
48
|
+
const result = await extractArtifact("./my-plugin-1.0.0.zip", "./extracted");
|
|
49
|
+
if (!result.ok) throw new Error(result.reason);
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**Package contract checks** (`checkPackageContract`, and the narrower
|
|
53
|
+
`checkReadmeContract`/`checkCoverContract`) validate that a plugin
|
|
54
|
+
directory has what the marketplace requires (a README, a correctly
|
|
55
|
+
sized cover image) before it's packed. **License verdicts**
|
|
56
|
+
(`createLicenseChallenge`, `signLicenseVerdict`, `verifyLicenseVerdict`)
|
|
57
|
+
are the signed envelope format a paid plugin's license check runs on.
|
|
58
|
+
|
|
59
|
+
## Relationship to the rest of Kardalum
|
|
60
|
+
|
|
61
|
+
`kardalum plugin` uses this package to sign and pack; `@kardalum/server`
|
|
62
|
+
and the marketplace use it to verify an archive's signature before
|
|
63
|
+
trusting it and to extract it safely on install. A plugin sideloaded as
|
|
64
|
+
a raw `.zip` (rather than installed from the marketplace) skips signature
|
|
65
|
+
verification entirely by design: that's the documented difference
|
|
66
|
+
between the two install paths, not a gap in this package.
|
|
67
|
+
|
|
68
|
+
## Source & support
|
|
69
|
+
|
|
70
|
+
Source: [kardalum-starter](https://github.com/kardalum/kardalum-starter).
|
|
71
|
+
Docs: https://docs.kardalum.com. Apache-2.0.
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import type { PluginInstallDeclaration, PluginReference } from "@kardalum/api-schemas";
|
|
2
|
+
type LabelMap = {
|
|
3
|
+
en: string;
|
|
4
|
+
[locale: string]: string;
|
|
5
|
+
};
|
|
6
|
+
/** What buildReference reads from a manifest, named structurally because this
|
|
7
|
+
* package cannot import the SDK (the SDK depends on it). The SDK asserts that
|
|
8
|
+
* its PluginManifest is assignable to this, so a field the builder cannot
|
|
9
|
+
* read is an SDK compile error (spec D3). */
|
|
10
|
+
export interface ReferenceManifestInput {
|
|
11
|
+
actions?: ReadonlyArray<{
|
|
12
|
+
id: string;
|
|
13
|
+
label: string;
|
|
14
|
+
}>;
|
|
15
|
+
roles?: ReadonlyArray<{
|
|
16
|
+
id: string;
|
|
17
|
+
label: string;
|
|
18
|
+
actions: readonly string[];
|
|
19
|
+
}>;
|
|
20
|
+
databaseCompatibility?: {
|
|
21
|
+
storageType?: string;
|
|
22
|
+
};
|
|
23
|
+
assertions?: {
|
|
24
|
+
externalNetwork?: {
|
|
25
|
+
reason: string;
|
|
26
|
+
};
|
|
27
|
+
filesystemAccess?: {
|
|
28
|
+
reason: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
migrations?: ReadonlyArray<{
|
|
32
|
+
id: string;
|
|
33
|
+
name: string;
|
|
34
|
+
}>;
|
|
35
|
+
install?: PluginInstallDeclaration;
|
|
36
|
+
contributions: {
|
|
37
|
+
apiRoutes?: ReadonlyArray<{
|
|
38
|
+
method: string;
|
|
39
|
+
path: string;
|
|
40
|
+
access?: string;
|
|
41
|
+
action?: string;
|
|
42
|
+
}>;
|
|
43
|
+
documentTypes?: ReadonlyArray<{
|
|
44
|
+
name: string;
|
|
45
|
+
kind: string;
|
|
46
|
+
}>;
|
|
47
|
+
dataTypes?: ReadonlyArray<{
|
|
48
|
+
id: string;
|
|
49
|
+
name: string;
|
|
50
|
+
icon?: string;
|
|
51
|
+
version?: string;
|
|
52
|
+
schema?: unknown;
|
|
53
|
+
settingsSchema?: unknown;
|
|
54
|
+
defaultSettings?: unknown;
|
|
55
|
+
}>;
|
|
56
|
+
templates?: ReadonlyArray<{
|
|
57
|
+
name: string;
|
|
58
|
+
alias: string;
|
|
59
|
+
kind: string;
|
|
60
|
+
documentType?: string;
|
|
61
|
+
}>;
|
|
62
|
+
settingsPages?: ReadonlyArray<{
|
|
63
|
+
id: string;
|
|
64
|
+
name: string;
|
|
65
|
+
action: string;
|
|
66
|
+
}>;
|
|
67
|
+
adminSections?: ReadonlyArray<{
|
|
68
|
+
id: string;
|
|
69
|
+
label: LabelMap;
|
|
70
|
+
action: string;
|
|
71
|
+
rail?: ReadonlyArray<{
|
|
72
|
+
id: string;
|
|
73
|
+
label: LabelMap;
|
|
74
|
+
action: string;
|
|
75
|
+
}>;
|
|
76
|
+
}>;
|
|
77
|
+
railEntries?: ReadonlyArray<{
|
|
78
|
+
id: string;
|
|
79
|
+
label: LabelMap;
|
|
80
|
+
section: string;
|
|
81
|
+
action: string;
|
|
82
|
+
}>;
|
|
83
|
+
dashboardWidgets?: ReadonlyArray<{
|
|
84
|
+
id: string;
|
|
85
|
+
name: string;
|
|
86
|
+
action: string;
|
|
87
|
+
}>;
|
|
88
|
+
editorToolbar?: ReadonlyArray<{
|
|
89
|
+
id: string;
|
|
90
|
+
label: string;
|
|
91
|
+
action: string;
|
|
92
|
+
}>;
|
|
93
|
+
contentTreeActions?: ReadonlyArray<{
|
|
94
|
+
id: string;
|
|
95
|
+
label: string;
|
|
96
|
+
action: string;
|
|
97
|
+
}>;
|
|
98
|
+
hooks?: object;
|
|
99
|
+
scheduledTasks?: ReadonlyArray<{
|
|
100
|
+
id: string;
|
|
101
|
+
name: string;
|
|
102
|
+
cron: string;
|
|
103
|
+
}>;
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
/** The serialisable facts the seven generated Reference pages are rendered
|
|
107
|
+
* from (spec 3.2). Only plain data: never a view, a handler or a hook. The
|
|
108
|
+
* CLI writes it to reference.json; the server builds it live from the
|
|
109
|
+
* attached manifest. */
|
|
110
|
+
export declare function buildReference(manifest: ReferenceManifestInput): PluginReference;
|
|
111
|
+
export {};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { ASSERTION_KEYS, deriveCapabilities } from "./capabilities.js";
|
|
2
|
+
/** Drops functions, components and undefined values by a JSON round trip. */
|
|
3
|
+
function plain(value) {
|
|
4
|
+
return JSON.parse(JSON.stringify(value));
|
|
5
|
+
}
|
|
6
|
+
/** A slot label's string entries only. */
|
|
7
|
+
function labelMap(label) {
|
|
8
|
+
return Object.fromEntries(Object.entries(label).filter(([, text]) => typeof text === "string"));
|
|
9
|
+
}
|
|
10
|
+
/** The serialisable facts the seven generated Reference pages are rendered
|
|
11
|
+
* from (spec 3.2). Only plain data: never a view, a handler or a hook. The
|
|
12
|
+
* CLI writes it to reference.json; the server builds it live from the
|
|
13
|
+
* attached manifest. */
|
|
14
|
+
export function buildReference(manifest) {
|
|
15
|
+
const c = manifest.contributions;
|
|
16
|
+
return {
|
|
17
|
+
actions: (manifest.actions ?? []).map(({ id, label }) => ({ id, label })),
|
|
18
|
+
roles: (manifest.roles ?? []).map(({ id, label, actions }) => ({ id, label, actions: [...actions] })),
|
|
19
|
+
apiRoutes: (c.apiRoutes ?? []).map((route) => ({
|
|
20
|
+
method: route.method,
|
|
21
|
+
path: route.path,
|
|
22
|
+
// Anything but the three named tiers falls back to "admin" at dispatch.
|
|
23
|
+
access: route.access ?? "admin",
|
|
24
|
+
...(route.action ? { action: route.action } : {}),
|
|
25
|
+
})),
|
|
26
|
+
capabilities: deriveCapabilities(manifest).map(({ id, mediation, payload }) => ({ id, mediation, payload: { count: payload.count, details: [...payload.details] } })),
|
|
27
|
+
documentTypes: plain(c.documentTypes ?? []),
|
|
28
|
+
dataTypes: (c.dataTypes ?? []).map((type) => plain({ id: type.id, name: type.name, icon: type.icon, version: type.version, schema: type.schema, settingsSchema: type.settingsSchema, defaultSettings: type.defaultSettings })),
|
|
29
|
+
templates: (c.templates ?? []).map((t) => ({ name: t.name, alias: t.alias, kind: t.kind, ...(t.documentType ? { documentType: t.documentType } : {}) })),
|
|
30
|
+
settingsPages: (c.settingsPages ?? []).map(({ id, name, action }) => ({ id, name, action })),
|
|
31
|
+
adminSections: (c.adminSections ?? []).map((s) => ({
|
|
32
|
+
id: s.id,
|
|
33
|
+
label: labelMap(s.label),
|
|
34
|
+
action: s.action,
|
|
35
|
+
rail: (s.rail ?? []).map((e) => ({ id: e.id, label: labelMap(e.label), action: e.action })),
|
|
36
|
+
})),
|
|
37
|
+
railEntries: (c.railEntries ?? []).map((e) => ({ id: e.id, label: labelMap(e.label), section: e.section, action: e.action })),
|
|
38
|
+
dashboardWidgets: (c.dashboardWidgets ?? []).map(({ id, name, action }) => ({ id, name, action })),
|
|
39
|
+
editorToolbar: (c.editorToolbar ?? []).map(({ id, label, action }) => ({ id, label, action })),
|
|
40
|
+
contentTreeActions: (c.contentTreeActions ?? []).map(({ id, label, action }) => ({ id, label, action })),
|
|
41
|
+
hooks: Object.keys(c.hooks ?? {}),
|
|
42
|
+
scheduledTasks: (c.scheduledTasks ?? []).map(({ id, name, cron }) => ({ id, name, cron })),
|
|
43
|
+
migrations: (manifest.migrations ?? []).map(({ id, name }) => ({ id, name })),
|
|
44
|
+
assertions: ASSERTION_KEYS.flatMap((key) => {
|
|
45
|
+
const reason = manifest.assertions?.[key]?.reason;
|
|
46
|
+
return typeof reason === "string" && reason.trim() ? [{ key, reason }] : [];
|
|
47
|
+
}),
|
|
48
|
+
installOptions: (manifest.install?.steps ?? []).flatMap((step) => step.options.map((option) => ({
|
|
49
|
+
step: labelMap(step.label),
|
|
50
|
+
id: option.id,
|
|
51
|
+
label: labelMap(option.label),
|
|
52
|
+
kind: option.kind,
|
|
53
|
+
choices: option.kind === "boolean" ? [] : option.choices.map((choice) => ({ id: choice.id, label: labelMap(choice.label) })),
|
|
54
|
+
default: option.kind === "select" ? (option.default ?? null) : option.kind === "multiSelect" ? [...option.default] : option.default,
|
|
55
|
+
// installOptionNeedsAnswer in @kardalum/api-schemas, written inline
|
|
56
|
+
// because this module may take only types from there
|
|
57
|
+
// (reference-entry.test.ts); build-reference.test.ts pins the two.
|
|
58
|
+
required: option.kind === "select" && option.default === undefined && option.required !== false,
|
|
59
|
+
}))),
|
|
60
|
+
};
|
|
61
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a plugin can do, computed from what it declares (S267, section 3,
|
|
3
|
+
* implemented by S268 Task 5, moved here from the SDK by S289 so the one
|
|
4
|
+
* reference builder can call it; the SDK re-exports it and keeps the labels).
|
|
5
|
+
*
|
|
6
|
+
* **A capability is derived, not declared.** The author writes
|
|
7
|
+
* `contributions` (concrete, carrying payloads), `assertions` (the short
|
|
8
|
+
* list of claims nothing can check) and `databaseCompatibility`. This
|
|
9
|
+
* module reads those and produces the list. One source of truth, three
|
|
10
|
+
* renderings: the install screen shows it as consent items, the review
|
|
11
|
+
* queue highlights its promised entries for the reviewer, and the
|
|
12
|
+
* generated reference page prints it. An author cannot claim a capability
|
|
13
|
+
* they do not have, and cannot quietly have one they did not claim.
|
|
14
|
+
*
|
|
15
|
+
* **Disclosure, not enforcement** (S267 section 7). Plugin backend code
|
|
16
|
+
* runs unsandboxed and in-process, so this list is what the author says
|
|
17
|
+
* and what review checks, never what the runtime confines. The mediated
|
|
18
|
+
* entries are genuinely enforced, because the host owns the decision. The
|
|
19
|
+
* promised ones are promises.
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* `mediated`: the host bounds the outcome. It decides where the view
|
|
23
|
+
* renders, which gate the route sits behind, whether the action passes.
|
|
24
|
+
* The host enforces a mediated capability, so there is nothing in the
|
|
25
|
+
* plugin's code to read it against.
|
|
26
|
+
*
|
|
27
|
+
* `promised`: only the plugin's own code can honour it, so a reviewer reads
|
|
28
|
+
* it against that code.
|
|
29
|
+
*/
|
|
30
|
+
export type CapabilityMediation = "mediated" | "promised";
|
|
31
|
+
/**
|
|
32
|
+
* The part of the declaration that produced a capability which is safe to
|
|
33
|
+
* store and to render: never a live function, never a Zod schema.
|
|
34
|
+
*
|
|
35
|
+
* `details` is a list of plain identifying strings, not sentences, so each
|
|
36
|
+
* of the three readers can put its own heading in front of them and none
|
|
37
|
+
* has to re-derive them from the manifest. For an assertion the detail IS
|
|
38
|
+
* the author's reason, because a reason is the whole content of an
|
|
39
|
+
* assertion.
|
|
40
|
+
*/
|
|
41
|
+
export interface CapabilityPayload {
|
|
42
|
+
/** How many declarations produced this capability. 1 for a declaration
|
|
43
|
+
* that is not a list (themeTokens, an assertion, structured storage). */
|
|
44
|
+
count: number;
|
|
45
|
+
/** One line per declaration, in declaration order. Empty when the
|
|
46
|
+
* declaration carries no readable per-entry detail. */
|
|
47
|
+
details: string[];
|
|
48
|
+
}
|
|
49
|
+
export interface Capability {
|
|
50
|
+
/** Stable, dotted, and never reused for a different meaning. Persisted
|
|
51
|
+
* on a marketplace version row and rendered by three surfaces, so a
|
|
52
|
+
* renamed id is a data migration, not a cosmetic change. */
|
|
53
|
+
id: string;
|
|
54
|
+
payload: CapabilityPayload;
|
|
55
|
+
mediation: CapabilityMediation;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Every contribution key, in the order capabilities are emitted, fixed here
|
|
59
|
+
* rather than taken from the manifest's own key order. Two manifests
|
|
60
|
+
* declaring the same things in a different order must produce the same
|
|
61
|
+
* list, or the install screen, the review queue and the reference page
|
|
62
|
+
* would each print a different ordering of one fact.
|
|
63
|
+
*
|
|
64
|
+
* Storage leads because it is the heaviest thing an operator consents to.
|
|
65
|
+
* The assertions trail because they are the claims with nothing behind
|
|
66
|
+
* them, and they read as a closing caveat rather than as a feature.
|
|
67
|
+
*
|
|
68
|
+
* This package cannot name the SDK's `PluginContributions` (the SDK depends
|
|
69
|
+
* on it), so the SDK asserts at the type level that these 19 keys are
|
|
70
|
+
* exactly `keyof PluginContributions`: a twentieth contribution added to the
|
|
71
|
+
* contract and not classified here is a compile error in the SDK's build.
|
|
72
|
+
*/
|
|
73
|
+
export declare const CONTRIBUTION_EMISSION_ORDER: readonly ["dataTypes", "documentTypes", "adminSections", "railEntries", "dashboardWidgets", "settingsPages", "contentTreeActions", "editorToolbar", "templates", "assets", "themeTokens", "hooks", "scheduledTasks", "mediaProcessors", "serializers", "apiRoutes", "exposedServices", "bundledPlugins", "bundledTemplate"];
|
|
74
|
+
export type ContributionKey = (typeof CONTRIBUTION_EMISSION_ORDER)[number];
|
|
75
|
+
/** The assertion kinds, in emission order. The SDK asserts these are
|
|
76
|
+
* exactly `keyof PluginAssertions`, for the reason above. */
|
|
77
|
+
export declare const ASSERTION_KEYS: readonly ["externalNetwork", "filesystemAccess"];
|
|
78
|
+
export type AssertionKey = (typeof ASSERTION_KEYS)[number];
|
|
79
|
+
/** Whether this contribution kind sits behind a named permission action.
|
|
80
|
+
* Lives on CONTRIBUTION_RULES rather than in a separate list, because that
|
|
81
|
+
* record is compiler-total over the 19 contribution keys: a twentieth key
|
|
82
|
+
* cannot be added without classifying it here. */
|
|
83
|
+
export declare function isActionGated(key: ContributionKey): boolean;
|
|
84
|
+
/** Every capability id this contract can produce, for the readers that
|
|
85
|
+
* need to be pinned against it (the marketplace's static mirror) and for
|
|
86
|
+
* the reference page S289 generates. */
|
|
87
|
+
export declare const CAPABILITY_IDS: readonly string[];
|
|
88
|
+
/**
|
|
89
|
+
* Compute a manifest's capability list.
|
|
90
|
+
*
|
|
91
|
+
* Accepts both a live `PluginManifest` and the redacted, JSON-safe summary
|
|
92
|
+
* kardalum plugin writes into a package's `manifest.json`, for the same
|
|
93
|
+
* reason `declaresClientBundle` does: the marketplace never executes
|
|
94
|
+
* plugin code, so the only manifest it can read is the redacted one, and
|
|
95
|
+
* the two sides of an install must not disagree about what a package
|
|
96
|
+
* declares.
|
|
97
|
+
*
|
|
98
|
+
* Defensive about its input rather than trusting it. It is handed parsed
|
|
99
|
+
* JSON from an artifact an author built, so a missing or wrongly-shaped
|
|
100
|
+
* field degrades to "declares nothing" for that field instead of throwing
|
|
101
|
+
* inside a review queue listing.
|
|
102
|
+
*/
|
|
103
|
+
export declare function deriveCapabilities(manifest: unknown): Capability[];
|