@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,351 @@
|
|
|
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
|
+
* Every contribution key, in the order capabilities are emitted, fixed here
|
|
23
|
+
* rather than taken from the manifest's own key order. Two manifests
|
|
24
|
+
* declaring the same things in a different order must produce the same
|
|
25
|
+
* list, or the install screen, the review queue and the reference page
|
|
26
|
+
* would each print a different ordering of one fact.
|
|
27
|
+
*
|
|
28
|
+
* Storage leads because it is the heaviest thing an operator consents to.
|
|
29
|
+
* The assertions trail because they are the claims with nothing behind
|
|
30
|
+
* them, and they read as a closing caveat rather than as a feature.
|
|
31
|
+
*
|
|
32
|
+
* This package cannot name the SDK's `PluginContributions` (the SDK depends
|
|
33
|
+
* on it), so the SDK asserts at the type level that these 19 keys are
|
|
34
|
+
* exactly `keyof PluginContributions`: a twentieth contribution added to the
|
|
35
|
+
* contract and not classified here is a compile error in the SDK's build.
|
|
36
|
+
*/
|
|
37
|
+
export const CONTRIBUTION_EMISSION_ORDER = [
|
|
38
|
+
"dataTypes",
|
|
39
|
+
"documentTypes",
|
|
40
|
+
"adminSections",
|
|
41
|
+
"railEntries",
|
|
42
|
+
"dashboardWidgets",
|
|
43
|
+
"settingsPages",
|
|
44
|
+
"contentTreeActions",
|
|
45
|
+
"editorToolbar",
|
|
46
|
+
"templates",
|
|
47
|
+
"assets",
|
|
48
|
+
"themeTokens",
|
|
49
|
+
"hooks",
|
|
50
|
+
"scheduledTasks",
|
|
51
|
+
"mediaProcessors",
|
|
52
|
+
"serializers",
|
|
53
|
+
"apiRoutes",
|
|
54
|
+
"exposedServices",
|
|
55
|
+
"bundledPlugins",
|
|
56
|
+
"bundledTemplate",
|
|
57
|
+
];
|
|
58
|
+
/** The assertion kinds, in emission order. The SDK asserts these are
|
|
59
|
+
* exactly `keyof PluginAssertions`, for the reason above. */
|
|
60
|
+
export const ASSERTION_KEYS = ["externalNetwork", "filesystemAccess"];
|
|
61
|
+
/**
|
|
62
|
+
* Every contribution key, classified. Keyed by `ContributionKey` (which the
|
|
63
|
+
* SDK pins to `keyof PluginContributions`) rather than by a loose string, so
|
|
64
|
+
* a contribution added to the contract and not classified here is a compile
|
|
65
|
+
* error rather than a capability that silently never appears on an install
|
|
66
|
+
* screen.
|
|
67
|
+
*
|
|
68
|
+
* Classification follows S267 section 6 and its stated principle: a
|
|
69
|
+
* capability is mediated when the platform decides the outcome, and promised
|
|
70
|
+
* when the plugin does. Every contribution below is mediated,
|
|
71
|
+
* because every one of them is consumed by the host: it mounts the view,
|
|
72
|
+
* dispatches the hook, runs the task, registers the template. The only
|
|
73
|
+
* contribution that is not wholly mediated is `apiRoutes`, and only for
|
|
74
|
+
* the tiers that let traffic reach a handler without an admin session.
|
|
75
|
+
*
|
|
76
|
+
* `exposedServices`, `bundledPlugins` and `bundledTemplate` are not named
|
|
77
|
+
* in section 6's automatic list, which enumerates a policy rather than the
|
|
78
|
+
* contract's keys. They are classified mediated here rather than dropped:
|
|
79
|
+
* the marketplace resolves the two bundle keys, and the cross-plugin
|
|
80
|
+
* service registry (when it exists) is the host's own lookup.
|
|
81
|
+
* `exposedServices` reads promised until you remember that plugin backend
|
|
82
|
+
* code is unsandboxed and in-process already, so handing another plugin a
|
|
83
|
+
* service adds a lookup rather than a privilege it could not otherwise
|
|
84
|
+
* reach. Emitting them highlights nothing for the reviewer, since the host
|
|
85
|
+
* enforces a mediated capability, and not emitting them would be the exact
|
|
86
|
+
* failure this design exists to prevent, a declaration the install screen
|
|
87
|
+
* does not disclose.
|
|
88
|
+
*/
|
|
89
|
+
const CONTRIBUTION_RULES = {
|
|
90
|
+
dataTypes: { derives: "one", id: "content.dataType", mediation: "mediated", actionGated: false },
|
|
91
|
+
documentTypes: { derives: "one", id: "content.documentType", mediation: "mediated", actionGated: false },
|
|
92
|
+
adminSections: { derives: "one", id: "admin.section", mediation: "mediated", actionGated: true },
|
|
93
|
+
// S280: a rail entry in a built-in section. Mediated like a section: the
|
|
94
|
+
// host decides where it renders and checks its action before it does. A
|
|
95
|
+
// section's own rail entries are part of the section's declaration, so
|
|
96
|
+
// they are disclosed under admin.section rather than counted here.
|
|
97
|
+
railEntries: { derives: "one", id: "admin.railEntry", mediation: "mediated", actionGated: true },
|
|
98
|
+
dashboardWidgets: { derives: "one", id: "admin.dashboardWidget", mediation: "mediated", actionGated: true },
|
|
99
|
+
settingsPages: { derives: "one", id: "admin.settingsPage", mediation: "mediated", actionGated: true },
|
|
100
|
+
contentTreeActions: { derives: "one", id: "admin.contentTreeAction", mediation: "mediated", actionGated: true },
|
|
101
|
+
editorToolbar: { derives: "one", id: "admin.editorToolbarItem", mediation: "mediated", actionGated: true },
|
|
102
|
+
templates: { derives: "one", id: "render.template", mediation: "mediated", actionGated: false },
|
|
103
|
+
assets: { derives: "one", id: "render.asset", mediation: "mediated", actionGated: false },
|
|
104
|
+
themeTokens: { derives: "one", id: "theme.tokens", mediation: "mediated", actionGated: false },
|
|
105
|
+
hooks: { derives: "one", id: "server.hook", mediation: "mediated", actionGated: false },
|
|
106
|
+
scheduledTasks: { derives: "one", id: "server.scheduledTask", mediation: "mediated", actionGated: false },
|
|
107
|
+
mediaProcessors: { derives: "one", id: "media.processor", mediation: "mediated", actionGated: false },
|
|
108
|
+
serializers: { derives: "one", id: "api.serializer", mediation: "mediated", actionGated: false },
|
|
109
|
+
exposedServices: { derives: "one", id: "service.exposed", mediation: "mediated", actionGated: false },
|
|
110
|
+
bundledPlugins: { derives: "one", id: "bundle.plugin", mediation: "mediated", actionGated: false },
|
|
111
|
+
bundledTemplate: { derives: "one", id: "bundle.template", mediation: "mediated", actionGated: false },
|
|
112
|
+
apiRoutes: { derives: "perApiRouteTier", actionGated: true },
|
|
113
|
+
};
|
|
114
|
+
/** Whether this contribution kind sits behind a named permission action.
|
|
115
|
+
* Lives on CONTRIBUTION_RULES rather than in a separate list, because that
|
|
116
|
+
* record is compiler-total over the 19 contribution keys: a twentieth key
|
|
117
|
+
* cannot be added without classifying it here. */
|
|
118
|
+
export function isActionGated(key) {
|
|
119
|
+
return CONTRIBUTION_RULES[key].actionGated;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* The access tiers, in emission order, with the classification S267
|
|
123
|
+
* section 6 gives each.
|
|
124
|
+
*
|
|
125
|
+
* `admin` is mediated: the host checks the JWT admin session before the
|
|
126
|
+
* handler runs. `apiKey` and `public` are promised: the host enforces the
|
|
127
|
+
* tier, but a route reachable without an admin session is an abuse surface
|
|
128
|
+
* whose handling belongs to the author.
|
|
129
|
+
*/
|
|
130
|
+
const API_ROUTE_TIERS = [
|
|
131
|
+
{ tier: "admin", id: "api.route.admin", mediation: "mediated" },
|
|
132
|
+
{ tier: "apiKey", id: "api.route.apiKey", mediation: "promised" },
|
|
133
|
+
{ tier: "public", id: "api.route.public", mediation: "promised" },
|
|
134
|
+
];
|
|
135
|
+
/**
|
|
136
|
+
* The tier a route actually runs at.
|
|
137
|
+
*
|
|
138
|
+
* This is a real coupling to `apps/server/src/routes/plugin-api-routes.ts`,
|
|
139
|
+
* which resolves `route.access ?? "admin"` and documents that anything
|
|
140
|
+
* unrecognised falls back to `admin`, secure by default. If the two
|
|
141
|
+
* disagreed, the install screen would promise a gate the runtime does not
|
|
142
|
+
* apply, or warn about one it does. The dispatcher is canonical; this
|
|
143
|
+
* follows it.
|
|
144
|
+
*/
|
|
145
|
+
function routeTier(access) {
|
|
146
|
+
const match = API_ROUTE_TIERS.find((entry) => entry.tier === access);
|
|
147
|
+
return match ?? API_ROUTE_TIERS[0];
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Capability id per assertion, in emission order. The reason the author
|
|
151
|
+
* gave is the capability's only detail, because the reason is the only
|
|
152
|
+
* checkable thing an assertion carries.
|
|
153
|
+
*
|
|
154
|
+
* Keyed by `AssertionKey` (pinned by the SDK to `keyof PluginAssertions`)
|
|
155
|
+
* for the same reason CONTRIBUTION_RULES is keyed by `ContributionKey`, and
|
|
156
|
+
* with more force: an unclassified contribution is at worst an undisclosed
|
|
157
|
+
* mediated addition, while an unclassified assertion is an undisclosed
|
|
158
|
+
* PROMISE, so it would never reach the consent list and never be
|
|
159
|
+
* highlighted for the reviewer. A third kind added to the type and not here
|
|
160
|
+
* is a compile error.
|
|
161
|
+
*/
|
|
162
|
+
const ASSERTION_RULES = {
|
|
163
|
+
externalNetwork: "network.external",
|
|
164
|
+
filesystemAccess: "filesystem.access",
|
|
165
|
+
};
|
|
166
|
+
/** The rules as the derivation walks them, in ASSERTION_KEYS order. */
|
|
167
|
+
const ASSERTION_ENTRIES = ASSERTION_KEYS.map((key) => [key, ASSERTION_RULES[key]]);
|
|
168
|
+
/**
|
|
169
|
+
* Derived from `databaseCompatibility.storageType`, and NOT from a
|
|
170
|
+
* contribution: `PluginContributions` has no storage-shaped key and the
|
|
171
|
+
* contract cannot silently grow one. Declaring structured storage IS the
|
|
172
|
+
* declaration that the plugin owns real tables. The server agrees: it
|
|
173
|
+
* persists `storageType` on the installed-plugin row, because uninstall
|
|
174
|
+
* has to answer that question without the manifest.
|
|
175
|
+
*/
|
|
176
|
+
const STRUCTURED_STORAGE_ID = "storage.structured";
|
|
177
|
+
/** Every capability id this contract can produce, for the readers that
|
|
178
|
+
* need to be pinned against it (the marketplace's static mirror) and for
|
|
179
|
+
* the reference page S289 generates. */
|
|
180
|
+
export const CAPABILITY_IDS = [
|
|
181
|
+
STRUCTURED_STORAGE_ID,
|
|
182
|
+
...CONTRIBUTION_EMISSION_ORDER.flatMap((key) => {
|
|
183
|
+
const rule = CONTRIBUTION_RULES[key];
|
|
184
|
+
return rule.derives === "one" ? [rule.id] : API_ROUTE_TIERS.map((entry) => entry.id);
|
|
185
|
+
}),
|
|
186
|
+
...ASSERTION_ENTRIES.map(([, id]) => id),
|
|
187
|
+
];
|
|
188
|
+
// ---------------------------------------------------------------------------
|
|
189
|
+
// Reading a declaration's readable detail
|
|
190
|
+
// ---------------------------------------------------------------------------
|
|
191
|
+
/** The plain string fields a contribution entry can be named by, in the
|
|
192
|
+
* order they are preferred. Every one of them survives the redaction
|
|
193
|
+
* kardalum plugin applies when it writes a package's manifest.json, which
|
|
194
|
+
* is the only form the marketplace ever sees. */
|
|
195
|
+
const ENTRY_NAME_FIELDS = ["name", "label", "alias", "file", "id"];
|
|
196
|
+
/** A slot's label is a map of language to text (S280), and the detail is a
|
|
197
|
+
* plain identifying string, so a label map reads as its English text, the
|
|
198
|
+
* one language every label must carry. A map without readable English
|
|
199
|
+
* yields nothing, and the next name field is tried. */
|
|
200
|
+
function readableField(value) {
|
|
201
|
+
if (typeof value === "string")
|
|
202
|
+
return value.trim() ? value : null;
|
|
203
|
+
if (value !== null && typeof value === "object" && !Array.isArray(value)) {
|
|
204
|
+
const en = value.en;
|
|
205
|
+
if (typeof en === "string" && en.trim())
|
|
206
|
+
return en;
|
|
207
|
+
}
|
|
208
|
+
return null;
|
|
209
|
+
}
|
|
210
|
+
function describeEntry(entry) {
|
|
211
|
+
if (typeof entry === "string")
|
|
212
|
+
return entry.trim() || null;
|
|
213
|
+
if (entry === null || typeof entry !== "object")
|
|
214
|
+
return null;
|
|
215
|
+
const record = entry;
|
|
216
|
+
// An apiRoute is named by what it exposes, not by an id it has no field
|
|
217
|
+
// for: "GET /orders" is the thing a reviewer looks up in the code.
|
|
218
|
+
if (typeof record.method === "string" && typeof record.path === "string") {
|
|
219
|
+
return `${record.method} ${record.path}`;
|
|
220
|
+
}
|
|
221
|
+
for (const field of ENTRY_NAME_FIELDS) {
|
|
222
|
+
const value = readableField(record[field]);
|
|
223
|
+
if (value !== null)
|
|
224
|
+
return value;
|
|
225
|
+
}
|
|
226
|
+
return null;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Normalises one declared contribution value into the entries that
|
|
230
|
+
* produced it, handling the three shapes the contract uses: a list, the
|
|
231
|
+
* `hooks` map (whose keys are the events, and which arrives as a plain key
|
|
232
|
+
* array once redacted), and a single object like `themeTokens`.
|
|
233
|
+
*
|
|
234
|
+
* Returns an empty list for a declaration that declares nothing, which is
|
|
235
|
+
* the same rule `declaresClientBundle` applies: a present-but-empty array
|
|
236
|
+
* or object buys nothing. The one shape that is NOT nothing is the
|
|
237
|
+
* redactor's `true`, which is a declaration stripped of its detail rather
|
|
238
|
+
* than an absent one.
|
|
239
|
+
*/
|
|
240
|
+
function declaredEntries(key, value) {
|
|
241
|
+
if (value === null || value === undefined)
|
|
242
|
+
return [];
|
|
243
|
+
if (Array.isArray(value))
|
|
244
|
+
return value;
|
|
245
|
+
// `true` is what kardalum plugin's redactor writes for a contribution it
|
|
246
|
+
// can keep no safe per-entry detail from (`serializers` is the only key
|
|
247
|
+
// that lands there today). It means "declared, nothing readable to
|
|
248
|
+
// show", which is exactly one entry with no detail, the same answer the
|
|
249
|
+
// live object form gives. Reading it as "declares nothing" is what made
|
|
250
|
+
// every marketplace surface omit a capability the SDK derived from the
|
|
251
|
+
// same plugin.
|
|
252
|
+
if (value === true)
|
|
253
|
+
return [true];
|
|
254
|
+
if (typeof value !== "object")
|
|
255
|
+
return [];
|
|
256
|
+
// `hooks` is Record<event, handler> live and string[] once redacted; the
|
|
257
|
+
// array branch above already covered the redacted form.
|
|
258
|
+
if (key === "hooks")
|
|
259
|
+
return Object.keys(value);
|
|
260
|
+
// A present-but-empty object buys nothing, which is the rule the array
|
|
261
|
+
// branch gets for free: `themeTokens: {}` declares no tokens, so it is
|
|
262
|
+
// not a theme capability.
|
|
263
|
+
return Object.keys(value).length === 0 ? [] : [value];
|
|
264
|
+
}
|
|
265
|
+
// ---------------------------------------------------------------------------
|
|
266
|
+
// The derivation
|
|
267
|
+
// ---------------------------------------------------------------------------
|
|
268
|
+
/**
|
|
269
|
+
* Compute a manifest's capability list.
|
|
270
|
+
*
|
|
271
|
+
* Accepts both a live `PluginManifest` and the redacted, JSON-safe summary
|
|
272
|
+
* kardalum plugin writes into a package's `manifest.json`, for the same
|
|
273
|
+
* reason `declaresClientBundle` does: the marketplace never executes
|
|
274
|
+
* plugin code, so the only manifest it can read is the redacted one, and
|
|
275
|
+
* the two sides of an install must not disagree about what a package
|
|
276
|
+
* declares.
|
|
277
|
+
*
|
|
278
|
+
* Defensive about its input rather than trusting it. It is handed parsed
|
|
279
|
+
* JSON from an artifact an author built, so a missing or wrongly-shaped
|
|
280
|
+
* field degrades to "declares nothing" for that field instead of throwing
|
|
281
|
+
* inside a review queue listing.
|
|
282
|
+
*/
|
|
283
|
+
export function deriveCapabilities(manifest) {
|
|
284
|
+
if (manifest === null || typeof manifest !== "object")
|
|
285
|
+
return [];
|
|
286
|
+
const source = manifest;
|
|
287
|
+
const capabilities = [];
|
|
288
|
+
const databaseCompatibility = source.databaseCompatibility;
|
|
289
|
+
const storageType = databaseCompatibility !== null && typeof databaseCompatibility === "object"
|
|
290
|
+
? databaseCompatibility.storageType
|
|
291
|
+
: undefined;
|
|
292
|
+
if (storageType === "structured") {
|
|
293
|
+
capabilities.push({
|
|
294
|
+
id: STRUCTURED_STORAGE_ID,
|
|
295
|
+
payload: { count: 1, details: [] },
|
|
296
|
+
mediation: "promised",
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
const contributions = source.contributions !== null && typeof source.contributions === "object"
|
|
300
|
+
? source.contributions
|
|
301
|
+
: {};
|
|
302
|
+
for (const key of CONTRIBUTION_EMISSION_ORDER) {
|
|
303
|
+
const entries = declaredEntries(key, contributions[key]);
|
|
304
|
+
if (entries.length === 0)
|
|
305
|
+
continue;
|
|
306
|
+
const rule = CONTRIBUTION_RULES[key];
|
|
307
|
+
if (rule.derives === "one") {
|
|
308
|
+
capabilities.push({
|
|
309
|
+
id: rule.id,
|
|
310
|
+
payload: {
|
|
311
|
+
count: entries.length,
|
|
312
|
+
details: entries.map(describeEntry).filter((detail) => detail !== null),
|
|
313
|
+
},
|
|
314
|
+
mediation: rule.mediation,
|
|
315
|
+
});
|
|
316
|
+
continue;
|
|
317
|
+
}
|
|
318
|
+
// One contribution, up to three capabilities: the routes are grouped
|
|
319
|
+
// by the tier the dispatcher will actually run them at.
|
|
320
|
+
for (const tier of API_ROUTE_TIERS) {
|
|
321
|
+
const routes = entries.filter((entry) => routeTier(entry !== null && typeof entry === "object" ? entry.access : undefined)
|
|
322
|
+
.tier === tier.tier);
|
|
323
|
+
if (routes.length === 0)
|
|
324
|
+
continue;
|
|
325
|
+
capabilities.push({
|
|
326
|
+
id: tier.id,
|
|
327
|
+
payload: {
|
|
328
|
+
count: routes.length,
|
|
329
|
+
details: routes.map(describeEntry).filter((detail) => detail !== null),
|
|
330
|
+
},
|
|
331
|
+
mediation: tier.mediation,
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
const assertions = source.assertions !== null && typeof source.assertions === "object"
|
|
336
|
+
? source.assertions
|
|
337
|
+
: {};
|
|
338
|
+
for (const [key, id] of ASSERTION_ENTRIES) {
|
|
339
|
+
const declared = assertions[key];
|
|
340
|
+
if (declared === null || typeof declared !== "object")
|
|
341
|
+
continue;
|
|
342
|
+
const reason = declared.reason;
|
|
343
|
+
// An assertion without a readable reason is not consentable and not
|
|
344
|
+
// checkable, so it is dropped rather than rendered as a blank line.
|
|
345
|
+
// The SDK schema refuses it upstream; this guards a parsed artifact.
|
|
346
|
+
if (typeof reason !== "string" || !reason.trim())
|
|
347
|
+
continue;
|
|
348
|
+
capabilities.push({ id, payload: { count: 1, details: [reason] }, mediation: "promised" });
|
|
349
|
+
}
|
|
350
|
+
return capabilities;
|
|
351
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { type DocsFacts, type PluginDocsPage, type PluginReference } from "@kardalum/api-schemas";
|
|
2
|
+
export interface DocsContractInput {
|
|
3
|
+
pages: PluginDocsPage[];
|
|
4
|
+
facts: DocsFacts;
|
|
5
|
+
referenceSlugs: string[];
|
|
6
|
+
}
|
|
7
|
+
/** The most a manifest.json or reference.json may weigh. The door parses both
|
|
8
|
+
* synchronously on the event loop, so a schema-valid file of tens of
|
|
9
|
+
* megabytes would block it on every request that reads one. */
|
|
10
|
+
export declare const MAX_PACKAGE_JSON_BYTES = 1048576;
|
|
11
|
+
/** A posix package-relative path as a native filesystem path. This is the
|
|
12
|
+
* one place such a path becomes a real one, so it is also where leaving the
|
|
13
|
+
* package is made impossible: a path that would is a defect in the checks
|
|
14
|
+
* before it, not a violation to report, and throws. */
|
|
15
|
+
export declare function packageFilePath(dir: string, posixPath: string): string;
|
|
16
|
+
/** Whether `path` is a regular file. Never throws: the doors ask this of a
|
|
17
|
+
* package nobody has vetted, where a name that should be a file can be a
|
|
18
|
+
* directory, and the other way round. */
|
|
19
|
+
export declare function isFile(path: string): boolean;
|
|
20
|
+
/** The most violations a door reports for one package. */
|
|
21
|
+
export declare const MAX_VIOLATIONS = 50;
|
|
22
|
+
/** At most MAX_VIOLATIONS lines: when there are more, the last line says how
|
|
23
|
+
* many are not shown, so one refusal stays readable whatever the package
|
|
24
|
+
* holds. */
|
|
25
|
+
export declare function capViolations(reasons: string[]): string[];
|
|
26
|
+
/** What the docs contract finds in a package: `reasons` refuse it,
|
|
27
|
+
* `warnings` are told to the author and never refuse it. */
|
|
28
|
+
export interface DocsContractResult {
|
|
29
|
+
reasons: string[];
|
|
30
|
+
warnings: string[];
|
|
31
|
+
}
|
|
32
|
+
export declare function checkDocsContract(dir: string, input: DocsContractInput): DocsContractResult;
|
|
33
|
+
/** The files a package ships for its docs: each declared page that exists,
|
|
34
|
+
* then the images those pages show, deduplicated, as posix package-relative
|
|
35
|
+
* paths. Every one has been through `packageFilePath`, so none leaves the package. */
|
|
36
|
+
export declare function docsFilesToShip(dir: string, pages: PluginDocsPage[]): string[];
|
|
37
|
+
/** How many images across the declared pages name somewhere else (the door's
|
|
38
|
+
* own `isExternal` test). No docs surface shows a remote image, so an author
|
|
39
|
+
* is told. It reads the same single-pass scan the other checks read. */
|
|
40
|
+
export declare function countRemoteImages(dir: string, pages: PluginDocsPage[]): number;
|
|
41
|
+
/** The door's inputs, from a built package. A package with no manifest.json
|
|
42
|
+
* is not this function's to refuse: every caller checks for it itself. */
|
|
43
|
+
export declare function readDocsContractInput(dir: string): {
|
|
44
|
+
ok: true;
|
|
45
|
+
input: DocsContractInput;
|
|
46
|
+
reference: PluginReference;
|
|
47
|
+
} | {
|
|
48
|
+
ok: false;
|
|
49
|
+
reasons: string[];
|
|
50
|
+
};
|