@kardalum/plugin-sdk 0.18.0 → 0.20.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 +253 -0
- package/README.md +20 -1
- package/dist/admin-section-registry.d.ts +16 -1
- package/dist/admin-section-registry.js +23 -0
- package/dist/assets/asset-picker.js +3 -3
- package/dist/built-in-editor-ids.d.ts +1 -1
- package/dist/built-in-editor-ids.js +2 -20
- package/dist/built-in-serializers.js +1 -1
- package/dist/built-in-settings-schemas.d.ts +10 -0
- package/dist/built-in-settings-schemas.js +90 -4
- package/dist/built-in-value-schemas.js +35 -0
- package/dist/built-ins.js +48 -17
- package/dist/capabilities.d.ts +11 -1
- package/dist/capabilities.js +55 -3
- package/dist/cli.d.ts +66 -0
- package/dist/cli.js +22 -0
- package/dist/content-library.d.ts +85 -0
- package/dist/content-library.js +15 -0
- package/dist/content-picker/page-picker-sheet.d.ts +13 -0
- package/dist/content-picker/page-picker-sheet.js +105 -0
- package/dist/content-picker/page-tree.d.ts +25 -0
- package/dist/content-picker/page-tree.js +132 -0
- package/dist/data-type-plugin.d.ts +9 -3
- package/dist/datatype-validation.d.ts +6 -11
- package/dist/datatype-validation.js +141 -3
- package/dist/define-plugin.d.ts +4 -4
- package/dist/define-plugin.js +5 -5
- package/dist/entitlement-entry.d.ts +1 -1
- package/dist/entitlement-entry.js +1 -1
- package/dist/entitlement-gate.d.ts +14 -0
- package/dist/entitlement-gate.js +64 -7
- package/dist/entitlement-plan.d.ts +6 -0
- package/dist/entitlement-plan.js +10 -0
- package/dist/entitlement-types.d.ts +36 -12
- package/dist/entitlement.d.ts +31 -4
- package/dist/entitlement.js +58 -17
- package/dist/hook-entry.d.ts +5 -0
- package/dist/hook-entry.js +30 -0
- package/dist/host-entry.d.ts +1 -1
- package/dist/host-entry.js +1 -1
- package/dist/index.d.ts +38 -4
- package/dist/index.js +54 -3
- package/dist/mail.d.ts +30 -0
- package/dist/mail.js +1 -0
- package/dist/manifest-entry.d.ts +29 -4
- package/dist/manifest-entry.js +39 -2
- package/dist/manifest-schema.d.ts +443 -29
- package/dist/manifest-schema.js +292 -24
- package/dist/manifest.d.ts +450 -51
- package/dist/manifest.js +1 -1
- package/dist/media/media-picker.js +33 -20
- package/dist/media/upload-error.d.ts +5 -1
- package/dist/media/upload-error.js +14 -2
- package/dist/media-library.d.ts +32 -0
- package/dist/media-library.js +15 -0
- package/dist/nested-field-host.d.ts +76 -0
- package/dist/nested-field-host.js +90 -0
- package/dist/notify.d.ts +12 -4
- package/dist/notify.js +1 -1
- package/dist/outbound.d.ts +47 -0
- package/dist/outbound.js +1 -0
- package/dist/plugin-context.d.ts +5 -0
- package/dist/plugin-context.js +3 -3
- package/dist/plugin-screen-context.d.ts +112 -0
- package/dist/plugin-screen-context.js +26 -0
- package/dist/providers.d.ts +268 -0
- package/dist/providers.js +74 -0
- package/dist/read-all-pages.d.ts +5 -0
- package/dist/read-all-pages.js +3 -2
- package/dist/register-built-ins.js +6 -6
- package/dist/registry.js +1 -1
- package/dist/richtext/block-panel.js +12 -7
- package/dist/richtext/extensions.js +7 -7
- package/dist/richtext/insert-menu.js +12 -9
- package/dist/richtext/style-listbox.js +7 -5
- package/dist/richtext/text-style-class.js +1 -1
- package/dist/sdk-strings.d.ts +285 -0
- package/dist/sdk-strings.js +347 -0
- package/dist/sealing.d.ts +14 -0
- package/dist/sealing.js +1 -0
- package/dist/simple-storage-value-provider.js +27 -27
- package/dist/structured-storage-types.d.ts +309 -9
- package/dist/structured-storage-types.js +2 -2
- package/dist/text-entry.d.ts +1 -0
- package/dist/text-entry.js +6 -0
- package/dist/tokens/tailwind-theme.css +5 -0
- package/dist/tokens/tokens.css +15 -3
- package/dist/tokens/tokens.json +8 -3
- package/dist/ui-entry.js +3 -3
- package/dist/views/asset-view.js +6 -3
- package/dist/views/content-list-preview.js +3 -1
- package/dist/views/content-list-settings-view.js +11 -7
- package/dist/views/content-list-view.d.ts +5 -3
- package/dist/views/content-list-view.js +38 -34
- package/dist/views/content-picker-view.d.ts +3 -0
- package/dist/views/content-picker-view.js +143 -0
- package/dist/views/crop-view.d.ts +4 -6
- package/dist/views/crop-view.js +22 -13
- package/dist/views/date-range-view.js +9 -6
- package/dist/views/file-upload-view.d.ts +5 -7
- package/dist/views/file-upload-view.js +16 -7
- package/dist/views/group-view.d.ts +8 -0
- package/dist/views/group-view.js +123 -0
- package/dist/views/html-code-editor.js +2 -2
- package/dist/views/html-view.js +12 -11
- package/dist/views/image-view.js +40 -22
- package/dist/views/link-view.d.ts +3 -0
- package/dist/views/link-view.js +150 -0
- package/dist/views/options-list-view.d.ts +3 -0
- package/dist/views/options-list-view.js +104 -0
- package/dist/views/repeatable-list-view.d.ts +3 -0
- package/dist/views/repeatable-list-view.js +113 -0
- package/dist/views/rich-text-view.js +32 -16
- package/dist/views/suggest-key.d.ts +17 -0
- package/dist/views/suggest-key.js +55 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-connections.schema.d.ts +215 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-connections.schema.js +179 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-context.schema.d.ts +12 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-context.schema.js +10 -0
- package/node_modules/@kardalum/api-schemas/dist/api-error.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.d.ts +10 -0
- package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.js +5 -0
- package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.d.ts +7 -1
- package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.js +4 -2
- package/node_modules/@kardalum/api-schemas/dist/auth.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/built-in-editor-ids.d.ts +1 -0
- package/node_modules/@kardalum/api-schemas/dist/built-in-editor-ids.js +27 -0
- package/node_modules/@kardalum/api-schemas/dist/capability-detail.d.ts +65 -0
- package/node_modules/@kardalum/api-schemas/dist/capability-detail.js +126 -0
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.d.ts +116 -3
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.js +71 -18
- package/node_modules/@kardalum/api-schemas/dist/content-list.schema.d.ts +57 -2
- package/node_modules/@kardalum/api-schemas/dist/content-list.schema.js +137 -0
- package/node_modules/@kardalum/api-schemas/dist/content-path.d.ts +1 -1
- package/node_modules/@kardalum/api-schemas/dist/content-path.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/content-search.schema.d.ts +50 -0
- package/node_modules/@kardalum/api-schemas/dist/content-search.schema.js +42 -0
- package/node_modules/@kardalum/api-schemas/dist/content-summary.schema.d.ts +37 -0
- package/node_modules/@kardalum/api-schemas/dist/content-summary.schema.js +19 -0
- package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.js +3 -3
- package/node_modules/@kardalum/api-schemas/dist/content-trash.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/content-unpublish.schema.d.ts +23 -0
- package/node_modules/@kardalum/api-schemas/dist/content-unpublish.schema.js +13 -0
- package/node_modules/@kardalum/api-schemas/dist/content.schema.d.ts +3 -0
- package/node_modules/@kardalum/api-schemas/dist/content.schema.js +10 -0
- package/node_modules/@kardalum/api-schemas/dist/contract-cancel.schema.d.ts +41 -0
- package/node_modules/@kardalum/api-schemas/dist/contract-cancel.schema.js +86 -0
- package/node_modules/@kardalum/api-schemas/dist/core-actions.d.ts +10 -5
- package/node_modules/@kardalum/api-schemas/dist/core-actions.js +7 -4
- package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.d.ts +25 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.js +9 -1
- package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.js +4 -4
- package/node_modules/@kardalum/api-schemas/dist/data-type-issue.d.ts +35 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-issue.js +60 -0
- package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.d.ts +267 -12
- package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +54 -8
- package/node_modules/@kardalum/api-schemas/dist/document-type.schema.d.ts +24 -6
- package/node_modules/@kardalum/api-schemas/dist/document-type.schema.js +98 -13
- package/node_modules/@kardalum/api-schemas/dist/form-protection.d.ts +23 -0
- package/node_modules/@kardalum/api-schemas/dist/form-protection.js +12 -0
- package/node_modules/@kardalum/api-schemas/dist/graphql-limits.d.ts +12 -0
- package/node_modules/@kardalum/api-schemas/dist/graphql-limits.js +14 -0
- package/node_modules/@kardalum/api-schemas/dist/held-embed-words.d.ts +23 -0
- package/node_modules/@kardalum/api-schemas/dist/held-embed-words.js +70 -0
- package/node_modules/@kardalum/api-schemas/dist/index.d.ts +122 -43
- package/node_modules/@kardalum/api-schemas/dist/index.js +92 -27
- package/node_modules/@kardalum/api-schemas/dist/install-sign-in-switched-off.schema.d.ts +9 -0
- package/node_modules/@kardalum/api-schemas/dist/install-sign-in-switched-off.schema.js +9 -0
- package/node_modules/@kardalum/api-schemas/dist/legal-anchors.d.ts +8 -0
- package/node_modules/@kardalum/api-schemas/dist/legal-anchors.js +9 -0
- package/node_modules/@kardalum/api-schemas/dist/licensing.schema.d.ts +63 -0
- package/node_modules/@kardalum/api-schemas/dist/licensing.schema.js +54 -0
- package/node_modules/@kardalum/api-schemas/dist/listing-categories.schema.d.ts +46 -0
- package/node_modules/@kardalum/api-schemas/dist/listing-categories.schema.js +52 -0
- package/node_modules/@kardalum/api-schemas/dist/mail-rules.d.ts +224 -0
- package/node_modules/@kardalum/api-schemas/dist/mail-rules.js +404 -0
- package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.d.ts +8 -0
- package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.js +4 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-leaks.schema.d.ts +145 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-leaks.schema.js +154 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.d.ts +359 -8
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +85 -11
- package/node_modules/@kardalum/api-schemas/dist/marketplace-package-api.schema.d.ts +15 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-package-api.schema.js +14 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-payouts.schema.d.ts +131 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-payouts.schema.js +272 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-profile.schema.d.ts +84 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-profile.schema.js +138 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-revocation.schema.d.ts +20 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-revocation.schema.js +49 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-sites.schema.d.ts +211 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-sites.schema.js +424 -0
- package/node_modules/@kardalum/api-schemas/dist/mcp-plugins.schema.d.ts +78 -0
- package/node_modules/@kardalum/api-schemas/dist/mcp-plugins.schema.js +27 -0
- package/node_modules/@kardalum/api-schemas/dist/mcp-tool-inputs.schema.d.ts +70 -0
- package/node_modules/@kardalum/api-schemas/dist/mcp-tool-inputs.schema.js +43 -0
- package/node_modules/@kardalum/api-schemas/dist/media-api.schema.d.ts +22 -0
- package/node_modules/@kardalum/api-schemas/dist/media-api.schema.js +22 -10
- package/node_modules/@kardalum/api-schemas/dist/media-move.schema.d.ts +75 -0
- package/node_modules/@kardalum/api-schemas/dist/media-move.schema.js +53 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference-api.schema.d.ts +2 -2
- package/node_modules/@kardalum/api-schemas/dist/media-reference.d.ts +2 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference.js +55 -0
- package/node_modules/@kardalum/api-schemas/dist/media.schema.d.ts +1 -0
- package/node_modules/@kardalum/api-schemas/dist/media.schema.js +9 -5
- package/node_modules/@kardalum/api-schemas/dist/nested-fields.schema.d.ts +204 -0
- package/node_modules/@kardalum/api-schemas/dist/nested-fields.schema.js +370 -0
- package/node_modules/@kardalum/api-schemas/dist/nested-validation.d.ts +53 -0
- package/node_modules/@kardalum/api-schemas/dist/nested-validation.js +284 -0
- package/node_modules/@kardalum/api-schemas/dist/news.schema.d.ts +5 -5
- package/node_modules/@kardalum/api-schemas/dist/node-access.schema.d.ts +1 -2
- package/node_modules/@kardalum/api-schemas/dist/node-access.schema.js +1 -2
- package/node_modules/@kardalum/api-schemas/dist/notification-kinds.d.ts +145 -0
- package/node_modules/@kardalum/api-schemas/dist/notification-kinds.js +177 -0
- package/node_modules/@kardalum/api-schemas/dist/notification.schema.d.ts +258 -7
- package/node_modules/@kardalum/api-schemas/dist/notification.schema.js +96 -5
- package/node_modules/@kardalum/api-schemas/dist/page-address.d.ts +10 -0
- package/node_modules/@kardalum/api-schemas/dist/page-address.js +7 -0
- package/node_modules/@kardalum/api-schemas/dist/password-reset.schema.d.ts +34 -0
- package/node_modules/@kardalum/api-schemas/dist/password-reset.schema.js +60 -0
- package/node_modules/@kardalum/api-schemas/dist/plan-editor.schema.d.ts +28 -3
- package/node_modules/@kardalum/api-schemas/dist/plan-editor.schema.js +55 -8
- package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.d.ts +12 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.js +13 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-caller.d.ts +23 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-caller.js +16 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-cli-commands.d.ts +76 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-cli-commands.js +316 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-content-access.d.ts +42 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-content-access.js +74 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-data-type-configs.d.ts +31 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-data-type-configs.js +131 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.d.ts +26 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-text.js +1 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs.d.ts +26 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs.js +13 -5
- package/node_modules/@kardalum/api-schemas/dist/plugin-document-types.d.ts +228 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-document-types.js +41 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-durable-hooks.d.ts +26 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-durable-hooks.js +55 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-editor-extensions.d.ts +40 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-editor-extensions.js +124 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-field-info.d.ts +41 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-field-info.js +51 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-graphql-fields.d.ts +32 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-graphql-fields.js +102 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-held-embeds.d.ts +107 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-held-embeds.js +213 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-https-origin.d.ts +5 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-https-origin.js +21 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.d.ts +4 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.js +3 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.d.ts +44 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.js +38 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-install.d.ts +237 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-install.js +205 -6
- package/node_modules/@kardalum/api-schemas/dist/plugin-labels.d.ts +26 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-labels.js +29 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-locales.d.ts +32 -8
- package/node_modules/@kardalum/api-schemas/dist/plugin-locales.js +120 -14
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.d.ts +357 -4
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +279 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.d.ts +16 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.js +34 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-ai.d.ts +40 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-ai.js +139 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.d.ts +22 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.js +31 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-media-access.d.ts +25 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-media-access.js +43 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-outbound.d.ts +107 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-outbound.js +150 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-package-build.schema.d.ts +5 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-package-build.schema.js +7 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-providers.d.ts +310 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-providers.js +430 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-read-only.schema.d.ts +4 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-read-only.schema.js +2 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-sealed-values.d.ts +45 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-sealed-values.js +99 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-secrets.d.ts +68 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-secrets.js +114 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-settings.d.ts +342 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-settings.js +400 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-site-extensions.d.ts +180 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-site-extensions.js +612 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.d.ts +7 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.js +50 -7
- package/node_modules/@kardalum/api-schemas/dist/plugin-tasks.d.ts +45 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-tasks.js +197 -0
- package/node_modules/@kardalum/api-schemas/dist/plural-rules.d.ts +9 -0
- package/node_modules/@kardalum/api-schemas/dist/plural-rules.js +41 -0
- package/node_modules/@kardalum/api-schemas/dist/public-api.schema.d.ts +41 -0
- package/node_modules/@kardalum/api-schemas/dist/public-api.schema.js +100 -12
- package/node_modules/@kardalum/api-schemas/dist/refund-request.schema.d.ts +189 -0
- package/node_modules/@kardalum/api-schemas/dist/refund-request.schema.js +164 -0
- package/node_modules/@kardalum/api-schemas/dist/render-editing.d.ts +4 -4
- package/node_modules/@kardalum/api-schemas/dist/render-editing.js +4 -4
- package/node_modules/@kardalum/api-schemas/dist/render-settings-api.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/revenue-view.schema.js +7 -3
- package/node_modules/@kardalum/api-schemas/dist/rich-text-shape.d.ts +6 -0
- package/node_modules/@kardalum/api-schemas/dist/rich-text-shape.js +82 -0
- package/node_modules/@kardalum/api-schemas/dist/rich-text-text.d.ts +66 -0
- package/node_modules/@kardalum/api-schemas/dist/rich-text-text.js +497 -0
- package/node_modules/@kardalum/api-schemas/dist/sale-conditions.schema.d.ts +82 -0
- package/node_modules/@kardalum/api-schemas/dist/sale-conditions.schema.js +99 -0
- package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.d.ts +13 -0
- package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.js +28 -0
- package/node_modules/@kardalum/api-schemas/dist/sandbox-attach.schema.d.ts +91 -1
- package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.d.ts +289 -0
- package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.js +205 -0
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +121 -0
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.js +51 -10
- package/node_modules/@kardalum/api-schemas/dist/sign-in.schema.d.ts +384 -0
- package/node_modules/@kardalum/api-schemas/dist/sign-in.schema.js +616 -0
- package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.d.ts +3 -3
- package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.d.ts +1 -1
- package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/structured-duplicate-key.d.ts +13 -0
- package/node_modules/@kardalum/api-schemas/dist/structured-duplicate-key.js +26 -0
- package/node_modules/@kardalum/api-schemas/dist/structured-fields.schema.d.ts +66 -0
- package/node_modules/@kardalum/api-schemas/dist/structured-fields.schema.js +160 -0
- package/node_modules/@kardalum/api-schemas/dist/template-api.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/template.schema.d.ts +1 -0
- package/node_modules/@kardalum/api-schemas/dist/template.schema.js +3 -0
- package/node_modules/@kardalum/api-schemas/dist/theme-api.schema.d.ts +1 -1
- package/node_modules/@kardalum/api-schemas/dist/theme-api.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/transaction-rolled-back.d.ts +13 -0
- package/node_modules/@kardalum/api-schemas/dist/transaction-rolled-back.js +29 -0
- package/node_modules/@kardalum/api-schemas/dist/trash-purge.schema.d.ts +13 -0
- package/node_modules/@kardalum/api-schemas/dist/trash-purge.schema.js +6 -0
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.d.ts +58 -1
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +35 -4
- package/node_modules/@kardalum/api-schemas/dist/vendor-service.schema.d.ts +5 -1
- package/node_modules/@kardalum/api-schemas/dist/vendor-service.schema.js +4 -3
- package/node_modules/@kardalum/api-schemas/package.json +1 -0
- package/node_modules/@kardalum/design-tokens/dist/build-css.d.ts +1 -1
- package/node_modules/@kardalum/design-tokens/dist/build-css.js +8 -2
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.css +5 -0
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.d.ts +1 -1
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.js +3 -3
- package/node_modules/@kardalum/design-tokens/dist/theme-css.d.ts +2 -2
- package/node_modules/@kardalum/design-tokens/dist/theme-css.js +2 -2
- package/node_modules/@kardalum/design-tokens/dist/theme-types.d.ts +2 -2
- package/node_modules/@kardalum/design-tokens/dist/themes/dark.d.ts +3 -3
- package/node_modules/@kardalum/design-tokens/dist/themes/dark.js +3 -3
- package/node_modules/@kardalum/design-tokens/dist/themes/light.d.ts +1 -1
- package/node_modules/@kardalum/design-tokens/dist/themes/light.js +1 -1
- package/node_modules/@kardalum/design-tokens/dist/tokens.css +15 -3
- package/node_modules/@kardalum/design-tokens/dist/tokens.d.ts +4 -4
- package/node_modules/@kardalum/design-tokens/dist/tokens.js +17 -8
- package/node_modules/@kardalum/design-tokens/dist/tokens.json +8 -3
- package/node_modules/@kardalum/design-tokens/dist/types.d.ts +2 -2
- package/node_modules/@kardalum/design-tokens/dist/types.js +1 -1
- package/node_modules/@kardalum/plugin-package/dist/build-reference.d.ts +21 -2
- package/node_modules/@kardalum/plugin-package/dist/build-reference.js +8 -2
- package/node_modules/@kardalum/plugin-package/dist/capabilities.d.ts +17 -10
- package/node_modules/@kardalum/plugin-package/dist/capabilities.js +355 -22
- package/node_modules/@kardalum/plugin-package/dist/client-bundle.d.ts +1 -1
- package/node_modules/@kardalum/plugin-package/dist/client-bundle.js +2 -0
- package/node_modules/@kardalum/plugin-package/dist/cms-range.d.ts +17 -0
- package/node_modules/@kardalum/plugin-package/dist/cms-range.js +353 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/ai-declarations.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/ai-declarations.js +26 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.d.ts +1 -1
- package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.js +3 -2
- package/node_modules/@kardalum/plugin-package/dist/delivery/content-access.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/content-access.js +34 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.js +2 -2
- package/node_modules/@kardalum/plugin-package/dist/delivery/editor-extensions.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/editor-extensions.js +27 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/graphql-fields.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/graphql-fields.js +22 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/index.d.ts +1 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/index.js +1 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/label-languages.js +47 -5
- package/node_modules/@kardalum/plugin-package/dist/delivery/licence-check.d.ts +27 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/licence-check.js +95 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/locales.js +9 -4
- package/node_modules/@kardalum/plugin-package/dist/delivery/plugin-settings.d.ts +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/plugin-settings.js +68 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/providers.d.ts +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/providers.js +298 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/registry.js +27 -5
- package/node_modules/@kardalum/plugin-package/dist/delivery/sample-content.js +91 -2
- package/node_modules/@kardalum/plugin-package/dist/delivery/server-powers.d.ts +6 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/server-powers.js +140 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/site-extensions.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/site-extensions.js +36 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/templates.d.ts +1 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/templates.js +21 -1
- package/node_modules/@kardalum/plugin-package/dist/delivery/types.d.ts +10 -0
- package/node_modules/@kardalum/plugin-package/dist/envelope.d.ts +2 -2
- package/node_modules/@kardalum/plugin-package/dist/envelope.js +2 -2
- package/node_modules/@kardalum/plugin-package/dist/extract.d.ts +3 -3
- package/node_modules/@kardalum/plugin-package/dist/extract.js +9 -9
- package/node_modules/@kardalum/plugin-package/dist/hash.d.ts +1 -1
- package/node_modules/@kardalum/plugin-package/dist/hash.js +1 -1
- package/node_modules/@kardalum/plugin-package/dist/index.d.ts +4 -2
- package/node_modules/@kardalum/plugin-package/dist/index.js +2 -1
- package/node_modules/@kardalum/plugin-package/dist/license-verdict.d.ts +75 -0
- package/node_modules/@kardalum/plugin-package/dist/license-verdict.js +123 -0
- package/node_modules/@kardalum/plugin-package/dist/package-contract.d.ts +2 -2
- package/node_modules/@kardalum/plugin-package/dist/package-contract.js +5 -5
- package/node_modules/@kardalum/plugin-package/dist/types.d.ts +1 -1
- package/node_modules/@kardalum/ui/dist/components/alert-dialog.d.ts +1 -1
- package/node_modules/@kardalum/ui/dist/components/alert-dialog.js +8 -3
- package/node_modules/@kardalum/ui/dist/components/badge.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/button.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/dialog.d.ts +1 -1
- package/node_modules/@kardalum/ui/dist/components/dialog.js +49 -4
- package/node_modules/@kardalum/ui/dist/components/dropdown-menu.d.ts +5 -1
- package/node_modules/@kardalum/ui/dist/components/dropdown-menu.js +18 -5
- package/node_modules/@kardalum/ui/dist/components/empty-state.d.ts +4 -4
- package/node_modules/@kardalum/ui/dist/components/input.js +6 -1
- package/node_modules/@kardalum/ui/dist/components/property-field.js +3 -3
- package/node_modules/@kardalum/ui/dist/components/sheet.d.ts +1 -1
- package/node_modules/@kardalum/ui/dist/components/sheet.js +12 -7
- package/node_modules/@kardalum/ui/dist/components/skeleton.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/switch.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/tab-strip.d.ts +3 -3
- package/node_modules/@kardalum/ui/dist/components/toast.js +4 -3
- package/node_modules/@kardalum/ui/dist/components/tooltip.d.ts +27 -0
- package/node_modules/@kardalum/ui/dist/components/tooltip.js +81 -0
- package/node_modules/@kardalum/ui/dist/components/truncated-text.d.ts +16 -0
- package/node_modules/@kardalum/ui/dist/components/truncated-text.js +95 -0
- package/node_modules/@kardalum/ui/dist/components/use-toast.js +2 -2
- package/node_modules/@kardalum/ui/dist/index.d.ts +3 -1
- package/node_modules/@kardalum/ui/dist/index.js +3 -1
- package/node_modules/@kardalum/ui/dist/lib/menu-host.d.ts +5 -0
- package/node_modules/@kardalum/ui/dist/lib/menu-host.js +17 -0
- package/node_modules/@kardalum/ui/package.json +8 -6
- package/package.json +18 -7
|
@@ -1,9 +1,76 @@
|
|
|
1
|
-
import { installInterfaceFor, installOptionNeedsAnswer } from "@kardalum/api-schemas";
|
|
1
|
+
import { BUILT_IN_DATA_TYPE_CONFIGS, RICHTEXT_EDITOR_ID, installInterfaceFor, installOptionNeedsAnswer, richTextShapeProblem, sampleDeferredFieldIds, samplePageTokens, } from "@kardalum/api-schemas";
|
|
2
2
|
import { SAMPLE_CONTENT_MAX_BYTES, hasSampleContentConsumer, installFactsOf, readShippedSampleContent } from "../sample-content.js";
|
|
3
3
|
import { createShippedLookup } from "../shipped-files.js";
|
|
4
4
|
import { formatBinarySize } from "./limits.js";
|
|
5
5
|
import { contributionsOf, failed, list, listCapped, passed, plural, record } from "./support.js";
|
|
6
6
|
const declaredTypeNames = (manifest) => new Set(list(contributionsOf(manifest).documentTypes).map((entry) => record(entry)?.name).filter((name) => typeof name === "string"));
|
|
7
|
+
/** The id of the rich text data type, read from the built-in list by editor id. */
|
|
8
|
+
const RICH_TEXT_ID = BUILT_IN_DATA_TYPE_CONFIGS.find((config) => config.editorId === RICHTEXT_EDITOR_ID)?.id;
|
|
9
|
+
/** Each document type's rich text field ids, by the type's name (M32 I5b, E14). */
|
|
10
|
+
function richTextFieldsByType(manifest) {
|
|
11
|
+
const byType = new Map();
|
|
12
|
+
const contributions = contributionsOf(manifest);
|
|
13
|
+
// M32 J (J3): a field may name a data type the manifest declares, so a declared rich text data
|
|
14
|
+
// type's name counts like the built-in's id (the name as the rule reads it, trimmed).
|
|
15
|
+
const declaredRichText = new Set();
|
|
16
|
+
for (const entry of list(contributions.dataTypeConfigs)) {
|
|
17
|
+
const config = record(entry);
|
|
18
|
+
if (config && config.editorId === RICHTEXT_EDITOR_ID && typeof config.name === "string")
|
|
19
|
+
declaredRichText.add(config.name.trim());
|
|
20
|
+
}
|
|
21
|
+
const isRichText = (datatypeId) => datatypeId === RICH_TEXT_ID || (typeof datatypeId === "string" && declaredRichText.has(datatypeId));
|
|
22
|
+
for (const entry of list(contributions.documentTypes)) {
|
|
23
|
+
const type = record(entry);
|
|
24
|
+
if (!type || typeof type.name !== "string" || byType.has(type.name))
|
|
25
|
+
continue;
|
|
26
|
+
const ids = [];
|
|
27
|
+
for (const field of list(type.fields)) {
|
|
28
|
+
const declared = record(field);
|
|
29
|
+
if (declared && isRichText(declared.datatypeId) && typeof declared.id === "string")
|
|
30
|
+
ids.push(declared.id);
|
|
31
|
+
}
|
|
32
|
+
byType.set(type.name, ids);
|
|
33
|
+
}
|
|
34
|
+
return byType;
|
|
35
|
+
}
|
|
36
|
+
/** Each document type's required field ids, by the type's name (M32 J, J10), read with type checks. */
|
|
37
|
+
function requiredFieldsByType(manifest) {
|
|
38
|
+
const byType = new Map();
|
|
39
|
+
for (const entry of list(contributionsOf(manifest).documentTypes)) {
|
|
40
|
+
const type = record(entry);
|
|
41
|
+
if (!type || typeof type.name !== "string" || byType.has(type.name))
|
|
42
|
+
continue;
|
|
43
|
+
const ids = new Set();
|
|
44
|
+
for (const field of list(type.fields)) {
|
|
45
|
+
const declared = record(field);
|
|
46
|
+
if (declared && typeof declared.id === "string" && record(declared.validation)?.required === true)
|
|
47
|
+
ids.add(declared.id);
|
|
48
|
+
}
|
|
49
|
+
byType.set(type.name, ids);
|
|
50
|
+
}
|
|
51
|
+
return byType;
|
|
52
|
+
}
|
|
53
|
+
/** M32 J (J10): the first page token that names no other slug of the file, or that fills a
|
|
54
|
+
* required field (the seeder creates the page without it and saves it after), as the refusal. */
|
|
55
|
+
function pageTokenProblem(nodes, manifest) {
|
|
56
|
+
const slugs = new Set(nodes.map((node) => node.slug));
|
|
57
|
+
for (const node of nodes) {
|
|
58
|
+
for (const slug of samplePageTokens(node.data)) {
|
|
59
|
+
if (slug === node.slug || !slugs.has(slug)) {
|
|
60
|
+
return `sample-content.json node "${node.slug}" names the page "${slug}", which is not another slug of the file`;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
const required = requiredFieldsByType(manifest);
|
|
65
|
+
for (const node of nodes) {
|
|
66
|
+
for (const fieldId of sampleDeferredFieldIds(node.data)) {
|
|
67
|
+
if (required.get(node.documentType)?.has(fieldId) === true) {
|
|
68
|
+
return `sample-content.json node "${node.slug}" field "${fieldId}": a page token cannot fill a required field: the page is created first and the field is saved after`;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
7
74
|
/** The run's one read of sample-content.json: the gate's, or this check's own
|
|
8
75
|
* when it runs outside a gate. */
|
|
9
76
|
function sampleOf({ dir, sampleContent }) {
|
|
@@ -32,6 +99,9 @@ function checkSampleContent(sample, dir, manifest) {
|
|
|
32
99
|
if (unknown.length > 0) {
|
|
33
100
|
return failed(`sample-content.json references documentType(s) not in this manifest's documentTypes: ${listCapped(unknown, "names")}`);
|
|
34
101
|
}
|
|
102
|
+
const tokenProblem = pageTokenProblem(nodes, manifest);
|
|
103
|
+
if (tokenProblem !== null)
|
|
104
|
+
return failed(tokenProblem);
|
|
35
105
|
const problems = [];
|
|
36
106
|
const whyNotShipped = createShippedLookup(dir);
|
|
37
107
|
for (const entry of media) {
|
|
@@ -42,13 +112,32 @@ function checkSampleContent(sample, dir, manifest) {
|
|
|
42
112
|
if (problems.length > 0) {
|
|
43
113
|
return failed(`sample-content.json declares ${plural(problems.length, "media file")} the package does not carry`, problems);
|
|
44
114
|
}
|
|
115
|
+
// A pure read of the file already in memory. A value written as an object on a rich text
|
|
116
|
+
// field is an editor document and must have a shape the editor can open; an HTML string or
|
|
117
|
+
// any other value is not this check's business. richTextShapeProblem is bounded (depth and
|
|
118
|
+
// node counts, no recursion).
|
|
119
|
+
const richFields = richTextFieldsByType(manifest);
|
|
120
|
+
const shapeProblems = [];
|
|
121
|
+
for (const sampleNode of nodes) {
|
|
122
|
+
for (const fieldId of richFields.get(sampleNode.documentType) ?? []) {
|
|
123
|
+
const value = sampleNode.data[fieldId];
|
|
124
|
+
if (value === null || typeof value !== "object")
|
|
125
|
+
continue;
|
|
126
|
+
const problem = richTextShapeProblem(value);
|
|
127
|
+
if (problem !== null)
|
|
128
|
+
shapeProblems.push(`${sampleNode.slug}.${fieldId}: ${problem}`);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
if (shapeProblems.length > 0) {
|
|
132
|
+
return failed(`sample-content.json holds ${plural(shapeProblems.length, "rich text value")} the editor cannot open`, shapeProblems);
|
|
133
|
+
}
|
|
45
134
|
return passed(media.length > 0
|
|
46
135
|
? `${plural(nodes.length, "sample content node")} valid, ${plural(media.length, "media file")} present`
|
|
47
136
|
: `${plural(nodes.length, "sample content node")} valid`);
|
|
48
137
|
}
|
|
49
138
|
export const sampleContentCheck = {
|
|
50
139
|
name: "sample content valid",
|
|
51
|
-
rule: `\`sample-content.json\` is a regular file within ${formatBinarySize(SAMPLE_CONTENT_MAX_BYTES)} that parses, names only document types the manifest declares,
|
|
140
|
+
rule: `\`sample-content.json\` is a regular file within ${formatBinarySize(SAMPLE_CONTENT_MAX_BYTES)} that parses, names only document types the manifest declares, whose media files are files under \`media/\` the build carries, and whose rich text values written as editor documents have a shape the editor can open. A string that is exactly \`{{page:<slug>}}\` names another page of the file, declared before or after it, and becomes its id; it cannot fill a required field.`,
|
|
52
141
|
gates: ["cli", "door"],
|
|
53
142
|
needsManifest: true,
|
|
54
143
|
run: (context) => checkSampleContent(sampleOf(context), context.dir, context.manifest),
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { DeliveryCheck } from "./types.js";
|
|
2
|
+
export declare const SERVER_POWERS_CHECK_NAME = "outbound, sealing and durable hooks";
|
|
3
|
+
/** The first CMS that runs `context.outbound`, `context.sealing` and durable hooks, and writes a
|
|
4
|
+
* tag's held embed (M33 K42, core part 6: the floor widened to `heldEmbeds`, no new check). */
|
|
5
|
+
export declare const SERVER_POWERS_CMS_FLOOR = "0.20.0";
|
|
6
|
+
export declare const serverPowersCheck: DeliveryCheck;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { DURABLE_EVENT_TRIES, OUTBOUND_METHODS, OUTBOUND_REASON_MAX, PLUGIN_HOOK_EVENTS, PLUGIN_SEALED_KINDS_MAX, PLUGIN_SEALED_KIND_ID_MAX, PLUGIN_SEALED_VALUE_MAX_BYTES, PluginOutboundRequestsSchema, PluginSealedValuesSchema, } from "@kardalum/api-schemas";
|
|
2
|
+
import { cmsRangeAdmitsBelow } from "../cms-range.js";
|
|
3
|
+
import { contributionsOf, failed, listCapped, passed, plural, record } from "./support.js";
|
|
4
|
+
// M33 K16, K17, K18 (core part 3): the 42nd delivery check. `outboundRequests` and `sealedValues` are
|
|
5
|
+
// checked by the schemas the SDK's manifest schema runs (api-schemas), and `hooks` by the events the SDK
|
|
6
|
+
// lists. The live manifest and the redacted one at the door read alike: a hook is an event name or
|
|
7
|
+
// `{ event, durable: true }` in manifest.json, and an event key with a handler or `{ handler, durable: true }`
|
|
8
|
+
// live. A message names the declaration by position and quotes only the event name an author wrote there.
|
|
9
|
+
export const SERVER_POWERS_CHECK_NAME = "outbound, sealing and durable hooks";
|
|
10
|
+
/** The first CMS that runs `context.outbound`, `context.sealing` and durable hooks, and writes a
|
|
11
|
+
* tag's held embed (M33 K42, core part 6: the floor widened to `heldEmbeds`, no new check). */
|
|
12
|
+
export const SERVER_POWERS_CMS_FLOOR = "0.20.0";
|
|
13
|
+
const CMS_RANGE_QUOTED_MAX = 64;
|
|
14
|
+
const EVENTS = new Set(PLUGIN_HOOK_EVENTS);
|
|
15
|
+
const EVENT_NAME_QUOTED_MAX = 64;
|
|
16
|
+
function quoted(event) {
|
|
17
|
+
return JSON.stringify(event.length > EVENT_NAME_QUOTED_MAX ? `${event.slice(0, EVENT_NAME_QUOTED_MAX)}...` : event);
|
|
18
|
+
}
|
|
19
|
+
function atPath(root, path) {
|
|
20
|
+
return path.reduce((out, part) => (typeof part === "number" ? `${out}[${part}]` : `${out}.${String(part)}`), root);
|
|
21
|
+
}
|
|
22
|
+
/** The durable events of a `hooks` declaration, and what is wrong with it. */
|
|
23
|
+
function readHooks(value) {
|
|
24
|
+
const issues = [];
|
|
25
|
+
const seen = new Set();
|
|
26
|
+
let durable = 0;
|
|
27
|
+
const take = (event, where) => {
|
|
28
|
+
if (typeof event !== "string" || !EVENTS.has(event)) {
|
|
29
|
+
issues.push(`${where} names ${typeof event === "string" ? quoted(event) : "no event"}, which is not an event a plugin can hook`);
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
if (seen.has(event)) {
|
|
33
|
+
issues.push(`${where} names ${quoted(event)}, which is named twice`);
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
seen.add(event);
|
|
37
|
+
return true;
|
|
38
|
+
};
|
|
39
|
+
if (Array.isArray(value)) {
|
|
40
|
+
value.forEach((entry, index) => {
|
|
41
|
+
const where = `contributions.hooks[${index}]`;
|
|
42
|
+
if (typeof entry === "string") {
|
|
43
|
+
take(entry, where);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const plain = record(entry);
|
|
47
|
+
const keys = plain === null ? [] : Object.keys(plain);
|
|
48
|
+
if (plain === null || keys.length !== 2 || plain.durable !== true || typeof plain.event !== "string") {
|
|
49
|
+
issues.push(`${where} must be an event name or { event, durable: true }`);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
if (take(plain.event, where))
|
|
53
|
+
durable += 1;
|
|
54
|
+
});
|
|
55
|
+
return { durable, issues };
|
|
56
|
+
}
|
|
57
|
+
const plain = record(value);
|
|
58
|
+
if (plain === null)
|
|
59
|
+
return { durable, issues: ["contributions.hooks must be a list of events or an object of handlers by event"] };
|
|
60
|
+
for (const [event, entry] of Object.entries(plain)) {
|
|
61
|
+
const where = `contributions.hooks[${quoted(event)}]`;
|
|
62
|
+
if (!take(event, where))
|
|
63
|
+
continue;
|
|
64
|
+
if (typeof entry === "function")
|
|
65
|
+
continue;
|
|
66
|
+
const shape = record(entry);
|
|
67
|
+
if (shape === null || shape.durable !== true || typeof shape.handler !== "function" || Object.keys(shape).length !== 2) {
|
|
68
|
+
issues.push(`${where} must be a handler or { handler, durable: true }`);
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
durable += 1;
|
|
72
|
+
}
|
|
73
|
+
return { durable, issues };
|
|
74
|
+
}
|
|
75
|
+
export const serverPowersCheck = {
|
|
76
|
+
name: SERVER_POWERS_CHECK_NAME,
|
|
77
|
+
rule: `\`outboundRequests\` has a \`reason\` of 1 to ${OUTBOUND_REASON_MAX} characters in each language, with English, and 1 to ${OUTBOUND_METHODS.length} \`methods\` from ${OUTBOUND_METHODS.join(", ")}, each once; ` +
|
|
78
|
+
`\`sealedValues\` lists 1 to ${PLUGIN_SEALED_KINDS_MAX} kinds, each with an \`id\` of 1 to ${PLUGIN_SEALED_KIND_ID_MAX} characters used once and a \`label\`, and a sealed value is at most ${PLUGIN_SEALED_VALUE_MAX_BYTES} bytes; ` +
|
|
79
|
+
`a \`hooks\` entry names an event a plugin can hook once, and is durable only as \`{ handler, durable: true }\` (\`{ event, durable: true }\` in \`manifest.json\`), which keeps the event until the handler finishes and tries it ${DURABLE_EVENT_TRIES} times; ` +
|
|
80
|
+
`a package that uses any of the three, declares \`heldEmbeds\`, has a form protection provider with a \`widgetScript\` or has a sign-in entry with a \`hostedDomainClaim\`, has a \`cmsVersion\` admitting no version below ${SERVER_POWERS_CMS_FLOOR}, because an older CMS cannot run them.`,
|
|
81
|
+
gates: ["cli", "door"],
|
|
82
|
+
needsManifest: true,
|
|
83
|
+
run: ({ manifest }) => {
|
|
84
|
+
const contributions = contributionsOf(manifest);
|
|
85
|
+
const issues = [];
|
|
86
|
+
const outboundDeclared = contributions.outboundRequests !== undefined;
|
|
87
|
+
if (outboundDeclared) {
|
|
88
|
+
const parsed = PluginOutboundRequestsSchema.safeParse(contributions.outboundRequests);
|
|
89
|
+
if (!parsed.success) {
|
|
90
|
+
for (const issue of parsed.error.issues.slice(0, 3))
|
|
91
|
+
issues.push(`${atPath("contributions.outboundRequests", issue.path)} ${issue.message}`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
const sealed = contributions.sealedValues;
|
|
95
|
+
if (sealed !== undefined) {
|
|
96
|
+
if (!Array.isArray(sealed)) {
|
|
97
|
+
issues.push("contributions.sealedValues must be a list");
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
const parsed = PluginSealedValuesSchema.safeParse(sealed);
|
|
101
|
+
if (!parsed.success) {
|
|
102
|
+
for (const issue of parsed.error.issues.slice(0, 3))
|
|
103
|
+
issues.push(`${atPath("contributions.sealedValues", issue.path)} ${issue.message}`);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
const hooks = contributions.hooks === undefined ? { durable: 0, issues: [] } : readHooks(contributions.hooks);
|
|
108
|
+
issues.push(...hooks.issues);
|
|
109
|
+
if (issues.length > 0)
|
|
110
|
+
return failed(`manifest.json declares its outbound requests, sealed values or durable hooks wrongly: ${listCapped(issues)}`);
|
|
111
|
+
// Core part 3 fix wave: an older CMS refuses these keys at its own schema step with a message
|
|
112
|
+
// that does not say why, so the package states the version that runs them.
|
|
113
|
+
// M33 K42: an older CMS ignores `heldEmbeds` and writes nothing for a tag's `{ embed }`.
|
|
114
|
+
const heldDeclared = contributions.heldEmbeds !== undefined;
|
|
115
|
+
// M33 K51 (part 7): an older CMS ignores a provider's `widgetScript`, so its widget loads no script.
|
|
116
|
+
const providers = contributions.protectionProviders;
|
|
117
|
+
const scriptDeclared = Array.isArray(providers) &&
|
|
118
|
+
providers.some((entry) => entry !== null && typeof entry === "object" && entry.widgetScript !== undefined);
|
|
119
|
+
// M33 K58 (part 7): an older CMS ignores a sign-in entry's `hostedDomainClaim` and would let a private
|
|
120
|
+
// account at a listed domain make or reach an account. `mark` is not held: an older CMS draws the icon.
|
|
121
|
+
const signIn = contributions.signInProviders;
|
|
122
|
+
const claimDeclared = Array.isArray(signIn) &&
|
|
123
|
+
signIn.some((entry) => entry !== null && typeof entry === "object" && entry.hostedDomainClaim !== undefined);
|
|
124
|
+
if (outboundDeclared || sealed !== undefined || hooks.durable > 0 || heldDeclared || scriptDeclared || claimDeclared) {
|
|
125
|
+
const range = typeof manifest.cmsVersion === "string" ? manifest.cmsVersion : null;
|
|
126
|
+
if (range === null || cmsRangeAdmitsBelow(range, SERVER_POWERS_CMS_FLOOR)) {
|
|
127
|
+
const named = range === null ? "no cmsVersion" : `cmsVersion ${JSON.stringify(range.length > CMS_RANGE_QUOTED_MAX ? `${range.slice(0, CMS_RANGE_QUOTED_MAX)}...` : range)}`;
|
|
128
|
+
return failed(`manifest.json uses outbound requests, sealed values, durable hooks, held embeds, a form protection widget script or a sign-in hosted domain claim with ${named}, which admits a version below ${SERVER_POWERS_CMS_FLOOR}: an older CMS cannot run them, so the range must start at ${SERVER_POWERS_CMS_FLOOR} (for example ">=${SERVER_POWERS_CMS_FLOOR}")`);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
const parts = [
|
|
132
|
+
...(outboundDeclared ? ["outbound requests"] : []),
|
|
133
|
+
...(Array.isArray(sealed) ? [plural(sealed.length, "sealed value kind")] : []),
|
|
134
|
+
...(hooks.durable > 0 ? [plural(hooks.durable, "durable hook")] : []),
|
|
135
|
+
];
|
|
136
|
+
if (parts.length === 0)
|
|
137
|
+
return passed("no outbound requests, sealed values or durable hooks declared");
|
|
138
|
+
return passed(parts.length === 1 ? parts[0] : `${parts.slice(0, -1).join(", ")} and ${parts[parts.length - 1]}`);
|
|
139
|
+
},
|
|
140
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { HELD_EMBEDS_DECLARED_MAX, HELD_EMBED_PATH_PREFIX_MAX, PAGE_HEAD_SCRIPT_ORIGINS_MAX, SITE_ROUTES_MAX, TEMPLATE_EXTENSIONS_MAX, checkSiteExtensionDeclarations, listIssues, } from "@kardalum/api-schemas";
|
|
2
|
+
import { contributionsOf, failed, list, passed, record } from "./support.js";
|
|
3
|
+
const count = (n, one, many) => `${n} ${n === 1 ? one : many}`;
|
|
4
|
+
// M32 F2: the rules the SDK's manifest schema runs, read here from manifest.json so the CLI and the
|
|
5
|
+
// marketplace door cannot disagree.
|
|
6
|
+
export const siteExtensionsCheck = {
|
|
7
|
+
name: "site extensions",
|
|
8
|
+
rule: `\`siteRoutes\` (at most ${SITE_ROUTES_MAX}) are fixed GET or POST site addresses outside the server's own, a GET one holding a "." in some segment; ` +
|
|
9
|
+
`\`templateFilters\` and \`templateTags\` (at most ${TEMPLATE_EXTENSIONS_MAX} each) have lower-case names used as <the id's last segment>_<name>; ` +
|
|
10
|
+
`\`pageHead.scriptOrigins\` (at most ${PAGE_HEAD_SCRIPT_ORIGINS_MAX}) are bare https origins; ` +
|
|
11
|
+
`\`heldEmbeds\` (at most ${HELD_EMBEDS_DECLARED_MAX}) each name a bare https origin, a path prefix of at most ${HELD_EMBED_PATH_PREFIX_MAX} characters that starts and ends with "/", holds no "..", "%2e", "%2f" or "%5c" and is written as the URL parser writes it, a provider, an https privacy notice and a kind.`,
|
|
12
|
+
gates: ["cli", "door"],
|
|
13
|
+
needsManifest: true,
|
|
14
|
+
run: ({ manifest }) => {
|
|
15
|
+
const issues = checkSiteExtensionDeclarations(manifest);
|
|
16
|
+
if (issues.length > 0)
|
|
17
|
+
return failed(`manifest.json declares its site extensions wrongly: ${listIssues(issues)}`);
|
|
18
|
+
const contributions = contributionsOf(manifest);
|
|
19
|
+
const parts = [];
|
|
20
|
+
const routes = list(contributions.siteRoutes).length;
|
|
21
|
+
if (routes > 0)
|
|
22
|
+
parts.push(count(routes, "site route", "site routes"));
|
|
23
|
+
if (contributions.siteFallback !== undefined)
|
|
24
|
+
parts.push("a fallback");
|
|
25
|
+
const names = list(contributions.templateFilters).length + list(contributions.templateTags).length;
|
|
26
|
+
if (names > 0)
|
|
27
|
+
parts.push(count(names, "template name", "template names"));
|
|
28
|
+
const head = record(contributions.pageHead);
|
|
29
|
+
if (head !== null)
|
|
30
|
+
parts.push(`page head with ${count(list(head.scriptOrigins).length, "script origin", "script origins")}${head.setsTitle === true ? " that sets the page title" : ""}`);
|
|
31
|
+
const held = list(contributions.heldEmbeds).length;
|
|
32
|
+
if (held > 0)
|
|
33
|
+
parts.push(count(held, "held embed", "held embeds"));
|
|
34
|
+
return parts.length === 0 ? passed("no site extensions declared") : passed(parts.join(", "));
|
|
35
|
+
},
|
|
36
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { DeliveryCheck } from "./types.js";
|
|
2
2
|
export declare const templateDeclarationsCheck: DeliveryCheck;
|
|
3
|
+
export declare const declaredDataTypesCheck: DeliveryCheck;
|
|
3
4
|
export declare const templateFilesCheck: DeliveryCheck;
|
|
4
5
|
export declare const templateWiringCheck: DeliveryCheck;
|
|
5
6
|
export declare const assetsCheck: DeliveryCheck;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { lstatSync } from "node:fs";
|
|
2
2
|
import { join } from "node:path";
|
|
3
|
-
import { MAX_ASSET_CONTENT_BYTES, MAX_TEMPLATE_CONTENT_BYTES, MAX_TEMPLATE_PAYLOAD_ENTRIES, PluginAssetPathSchema, PluginTemplateFileSchema, PluginTemplatePayloadSchema, RESERVED_ASSET_ROOTS, TEMPLATE_KINDS, checkTemplateAndAssetDeclarations, effectiveDocsPages, isAssetTextPath, listIssues, } from "@kardalum/api-schemas";
|
|
3
|
+
import { MAX_ASSET_CONTENT_BYTES, MAX_TEMPLATE_CONTENT_BYTES, MAX_TEMPLATE_PAYLOAD_ENTRIES, PLUGIN_DATA_TYPE_CONFIGS_MAX, PluginAssetPathSchema, PluginTemplateFileSchema, PluginTemplatePayloadSchema, RESERVED_ASSET_ROOTS, TEMPLATE_KINDS, checkDataTypeConfigDeclarations, checkTemplateAndAssetDeclarations, effectiveDocsPages, isAssetTextPath, listIssues, } from "@kardalum/api-schemas";
|
|
4
4
|
import { docsFilesToShip } from "../docs-contract.js";
|
|
5
5
|
import { createShippedLookup, walkShipped } from "../shipped-files.js";
|
|
6
6
|
import { formatBinarySize } from "./limits.js";
|
|
@@ -67,6 +67,26 @@ export const templateDeclarationsCheck = {
|
|
|
67
67
|
return passed(`${plural(list(c.templates).length, "template")}, ${plural(list(c.assets).length, "asset")}: declarations valid`);
|
|
68
68
|
},
|
|
69
69
|
};
|
|
70
|
+
// M32 K (J6): the declared data types are their own check, by the one rule the SDK's manifest schema
|
|
71
|
+
// and the install read (moved out of template declarations valid, unchanged).
|
|
72
|
+
export const declaredDataTypesCheck = {
|
|
73
|
+
name: "declared data types",
|
|
74
|
+
rule: `Declared data types (\`dataTypeConfigs\`, at most ${PLUGIN_DATA_TYPE_CONFIGS_MAX}) have unique names that are not ids, a built-in editor or one of the plugin's own, ` +
|
|
75
|
+
"references only to data types declared before them, pickers that name the manifest's own document types and no start node, " +
|
|
76
|
+
"and, for a group, a repeatable list, a content picker, an options list and a link, settings their editor accepts " +
|
|
77
|
+
"(the install checks the settings of the other built-in editors only where the editor has a settings schema; for number, boolean, date, richtext and daterange, and for the plugin's own editors, the server stores the settings as declared).",
|
|
78
|
+
gates: ["cli", "door"],
|
|
79
|
+
needsManifest: true,
|
|
80
|
+
run: ({ manifest }) => {
|
|
81
|
+
const declared = contributionsOf(manifest).dataTypeConfigs;
|
|
82
|
+
if (declared === undefined)
|
|
83
|
+
return passed("no data types declared");
|
|
84
|
+
const issues = checkDataTypeConfigDeclarations(manifest);
|
|
85
|
+
if (issues.length > 0)
|
|
86
|
+
return failed(listIssues(issues, 10));
|
|
87
|
+
return passed(`${plural(list(declared).length, "declared data type")} valid`);
|
|
88
|
+
},
|
|
89
|
+
};
|
|
70
90
|
// S311 fix wave (W1): a declared file is there when the build carries it into
|
|
71
91
|
// the package (whyNotShipped, the rule the CLI's copy follows), not merely when
|
|
72
92
|
// it is on disk: a file under a left-out folder such as dist/, or behind a
|
|
@@ -34,6 +34,16 @@ export interface DeliveryContext {
|
|
|
34
34
|
* here, so a gate parses the file once. The door hands its own read on to
|
|
35
35
|
* the stored install interface. */
|
|
36
36
|
sampleContent?: ShippedSampleContent;
|
|
37
|
+
/** S367d (D8): the door's answer to "is this a paid plugin": a live plan
|
|
38
|
+
* with a price above 0. The manifest's `price` counts at both gates. */
|
|
39
|
+
paid?: boolean;
|
|
40
|
+
/** S367d (D8): where server/plugin.js is when not under `dir`/server: the
|
|
41
|
+
* CLI bundles the server entry for the licence check, with the error when
|
|
42
|
+
* that failed. The door's package holds its own server folder. */
|
|
43
|
+
server?: {
|
|
44
|
+
dir: string;
|
|
45
|
+
buildError?: string;
|
|
46
|
+
};
|
|
37
47
|
}
|
|
38
48
|
export interface DeliveryRunContext extends Omit<DeliveryContext, "manifest"> {
|
|
39
49
|
manifest: Record<string, unknown>;
|
|
@@ -5,7 +5,7 @@ export declare function generateSigningKeyPair(): {
|
|
|
5
5
|
publicKey: string;
|
|
6
6
|
keyId: string;
|
|
7
7
|
};
|
|
8
|
-
/** Deterministic serialization. Deliberately NOT full JCS
|
|
8
|
+
/** Deterministic serialization. Deliberately NOT full JCS, since we own both
|
|
9
9
|
* ends, and a fixed-order literal is the entire requirement. */
|
|
10
10
|
export declare function canonicalizeEnvelope(envelope: SignatureEnvelope): Buffer;
|
|
11
11
|
export declare function signEnvelope(envelope: SignatureEnvelope, privateKeyBase64: string): string;
|
|
@@ -13,7 +13,7 @@ export declare function signEnvelope(envelope: SignatureEnvelope, privateKeyBase
|
|
|
13
13
|
* Check order is deliberate and produces better diagnostics than the
|
|
14
14
|
* reverse: authenticate the envelope FIRST (bad-signature = forged or
|
|
15
15
|
* corrupt), then compare it to the artifact we actually have
|
|
16
|
-
* (hash-mismatch = authentic envelope, tampered bytes
|
|
16
|
+
* (hash-mismatch = authentic envelope, tampered bytes: the flipped-byte
|
|
17
17
|
* case). Never throws.
|
|
18
18
|
*/
|
|
19
19
|
export declare function verifyEnvelope(sidecar: unknown, tarballSha256: string, trustedKeys: TrustedKey[]): VerifyResult;
|
|
@@ -20,7 +20,7 @@ export function generateSigningKeyPair() {
|
|
|
20
20
|
const publicKey = pair.publicKey.export({ format: "der", type: "spki" }).toString("base64");
|
|
21
21
|
return { privateKey, publicKey, keyId: deriveKeyId(publicKey) };
|
|
22
22
|
}
|
|
23
|
-
/** Deterministic serialization. Deliberately NOT full JCS
|
|
23
|
+
/** Deterministic serialization. Deliberately NOT full JCS, since we own both
|
|
24
24
|
* ends, and a fixed-order literal is the entire requirement. */
|
|
25
25
|
export function canonicalizeEnvelope(envelope) {
|
|
26
26
|
return Buffer.from(JSON.stringify({
|
|
@@ -60,7 +60,7 @@ function isSidecar(value) {
|
|
|
60
60
|
* Check order is deliberate and produces better diagnostics than the
|
|
61
61
|
* reverse: authenticate the envelope FIRST (bad-signature = forged or
|
|
62
62
|
* corrupt), then compare it to the artifact we actually have
|
|
63
|
-
* (hash-mismatch = authentic envelope, tampered bytes
|
|
63
|
+
* (hash-mismatch = authentic envelope, tampered bytes: the flipped-byte
|
|
64
64
|
* case). Never throws.
|
|
65
65
|
*/
|
|
66
66
|
export function verifyEnvelope(sidecar, tarballSha256, trustedKeys) {
|
|
@@ -14,7 +14,7 @@ export declare const ENTRY_NAME_MAX = 260;
|
|
|
14
14
|
/** The most segments, folders and a file, one name may have. */
|
|
15
15
|
export declare const ENTRY_SEGMENTS_MAX = 32;
|
|
16
16
|
/** Pure gate over one entry's (path, type, declaredSize). Returns the
|
|
17
|
-
* violation message or null. Exported for direct unit testing
|
|
17
|
+
* violation message or null. Exported for direct unit testing: a
|
|
18
18
|
* well-formed writer can't produce hostile names, but attackers hand-craft
|
|
19
19
|
* archives directly. The path rules are nameViolation's: what a Linux
|
|
20
20
|
* extraction and a Windows or macOS one would read as different files is
|
|
@@ -24,7 +24,7 @@ export declare const ENTRY_SEGMENTS_MAX = 32;
|
|
|
24
24
|
* "OldFile" and "ContiguousFile" are accepted alongside "File" for
|
|
25
25
|
* historical (tar-era) compatibility with entries this gate has always
|
|
26
26
|
* allowed; the ZIP reader below only ever derives "File" or "Directory"
|
|
27
|
-
* for an entry, so those two never occur in practice post-migration
|
|
27
|
+
* for an entry, so those two never occur in practice post-migration: the
|
|
28
28
|
* allow-list simply isn't narrowed, since narrowing it wouldn't change zip
|
|
29
29
|
* behavior and would only risk breaking direct callers of this exported
|
|
30
30
|
* function. */
|
|
@@ -114,7 +114,7 @@ export declare function plannedEntryRefusal(entries: readonly PlannedEntry[]): s
|
|
|
114
114
|
* written to disk incrementally as the archive streams in, so anything
|
|
115
115
|
* admitted before the violation was detected is already sitting under
|
|
116
116
|
* `targetDir`. Callers MUST treat `{ ok: false }` as fatal and delete
|
|
117
|
-
* `targetDir` themselves
|
|
117
|
+
* `targetDir` themselves. This function does not roll back a partial
|
|
118
118
|
* extraction.
|
|
119
119
|
*/
|
|
120
120
|
export declare function extractArtifact(archivePath: string, targetDir: string): Promise<{
|
|
@@ -81,7 +81,7 @@ function nameViolation(path) {
|
|
|
81
81
|
return null;
|
|
82
82
|
}
|
|
83
83
|
/** Pure gate over one entry's (path, type, declaredSize). Returns the
|
|
84
|
-
* violation message or null. Exported for direct unit testing
|
|
84
|
+
* violation message or null. Exported for direct unit testing: a
|
|
85
85
|
* well-formed writer can't produce hostile names, but attackers hand-craft
|
|
86
86
|
* archives directly. The path rules are nameViolation's: what a Linux
|
|
87
87
|
* extraction and a Windows or macOS one would read as different files is
|
|
@@ -91,7 +91,7 @@ function nameViolation(path) {
|
|
|
91
91
|
* "OldFile" and "ContiguousFile" are accepted alongside "File" for
|
|
92
92
|
* historical (tar-era) compatibility with entries this gate has always
|
|
93
93
|
* allowed; the ZIP reader below only ever derives "File" or "Directory"
|
|
94
|
-
* for an entry, so those two never occur in practice post-migration
|
|
94
|
+
* for an entry, so those two never occur in practice post-migration: the
|
|
95
95
|
* allow-list simply isn't narrowed, since narrowing it wouldn't change zip
|
|
96
96
|
* behavior and would only risk breaking direct callers of this exported
|
|
97
97
|
* function. */
|
|
@@ -268,14 +268,14 @@ export function plannedEntryRefusal(entries) {
|
|
|
268
268
|
* written to disk incrementally as the archive streams in, so anything
|
|
269
269
|
* admitted before the violation was detected is already sitting under
|
|
270
270
|
* `targetDir`. Callers MUST treat `{ ok: false }` as fatal and delete
|
|
271
|
-
* `targetDir` themselves
|
|
271
|
+
* `targetDir` themselves. This function does not roll back a partial
|
|
272
272
|
* extraction.
|
|
273
273
|
*/
|
|
274
274
|
export function extractArtifact(archivePath, targetDir) {
|
|
275
275
|
return new Promise((resolve) => {
|
|
276
276
|
// Guards resolve() against firing twice (e.g. a stray 'readEntry'
|
|
277
|
-
// continuation racing an already-settled violation). Harmless
|
|
278
|
-
// Promise settlement is idempotent regardless
|
|
277
|
+
// continuation racing an already-settled violation). Harmless:
|
|
278
|
+
// Promise settlement is idempotent regardless, but noted since it's
|
|
279
279
|
// not load-bearing for the contract, just defensive.
|
|
280
280
|
let settled = false;
|
|
281
281
|
const settle = (value) => {
|
|
@@ -292,7 +292,7 @@ export function extractArtifact(archivePath, targetDir) {
|
|
|
292
292
|
return;
|
|
293
293
|
}
|
|
294
294
|
const resolvedTargetDir = resolvePath(targetDir);
|
|
295
|
-
// decodeStrings: false
|
|
295
|
+
// decodeStrings: false: yauzl's own string decoding path runs its own
|
|
296
296
|
// absolute-path/".."/backslash filename validation before ever emitting
|
|
297
297
|
// an 'entry' event, and rejects by emitting 'error' on the whole
|
|
298
298
|
// zipfile with its own message text. That would make yauzl's built-in
|
|
@@ -308,7 +308,7 @@ export function extractArtifact(archivePath, targetDir) {
|
|
|
308
308
|
}
|
|
309
309
|
// Fast upfront rejection: ZIP's central directory declares its entry
|
|
310
310
|
// count in the end-of-central-directory record, read during open()
|
|
311
|
-
// itself
|
|
311
|
+
// itself, unlike tar's PAX/meta-entry bypass, there is no way for a
|
|
312
312
|
// zip to hide entries from this count (yauzl only ever iterates
|
|
313
313
|
// exactly this many central directory records). Checking it here
|
|
314
314
|
// means a too-many-entries archive is rejected before writing a
|
|
@@ -342,7 +342,7 @@ export function extractArtifact(archivePath, targetDir) {
|
|
|
342
342
|
// This is an assertion, not a second gate: entryViolation (inside the
|
|
343
343
|
// gate) already rejects a leading "/" or "\\", a drive letter, and any
|
|
344
344
|
// ".." segment, so resolving fileName against targetDir can never
|
|
345
|
-
// land outside it
|
|
345
|
+
// land outside it: this branch must be unreachable. It stays
|
|
346
346
|
// because it is a two-line check against the one failure mode
|
|
347
347
|
// (zip-slip) that would actually write files outside targetDir, so
|
|
348
348
|
// the cost of keeping it is negligible next to what a silent
|
|
@@ -352,7 +352,7 @@ export function extractArtifact(archivePath, targetDir) {
|
|
|
352
352
|
fail(`unsafe entry path ${quoteEntryName(fileName)}`);
|
|
353
353
|
return;
|
|
354
354
|
}
|
|
355
|
-
// The filesystem calls below can throw
|
|
355
|
+
// The filesystem calls below can throw, most concretely EEXIST
|
|
356
356
|
// from mkdirSync when a hostile or malformed archive declares a
|
|
357
357
|
// file entry and a directory entry at the same path (e.g. "a" then
|
|
358
358
|
// "a/b", or a directory entry "a/" arriving after a file "a"). An
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** One definition of "the artifact's hash" for signer and verifier alike
|
|
1
|
+
/** One definition of "the artifact's hash" for signer and verifier alike:
|
|
2
2
|
* the same value S126 records as PluginVersion.artifactSha256. */
|
|
3
3
|
export declare function hashBuffer(buffer: Buffer): string;
|
|
4
4
|
export declare function hashArchive(path: string): Promise<string>;
|
|
@@ -2,7 +2,7 @@ import { createHash } from "node:crypto";
|
|
|
2
2
|
import { createReadStream } from "node:fs";
|
|
3
3
|
import { readdir, readFile, stat } from "node:fs/promises";
|
|
4
4
|
import { join } from "node:path";
|
|
5
|
-
/** One definition of "the artifact's hash" for signer and verifier alike
|
|
5
|
+
/** One definition of "the artifact's hash" for signer and verifier alike:
|
|
6
6
|
* the same value S126 records as PluginVersion.artifactSha256. */
|
|
7
7
|
export function hashBuffer(buffer) {
|
|
8
8
|
return createHash("sha256").update(buffer).digest("hex");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export type { PackageSignatureSidecar, SignatureEnvelope, TrustedKey, VerifyFailureReason, VerifyResult, } from "./types.js";
|
|
2
2
|
export { VERIFY_FAILURE_REASONS } from "./types.js";
|
|
3
3
|
export { canonicalizeEnvelope, deriveKeyId, generateSigningKeyPair, signEnvelope, verifyEnvelope, } from "./envelope.js";
|
|
4
|
-
export type { LicenseChallenge, LicenseTermState, LicenseVerdictEnvelope, LicenseVerdictResult, LicenseVerdictSignatureResult, LicenseVerdictTerm, SignedLicenseVerdict, TamperKind, } from "./license-verdict.js";
|
|
5
|
-
export { canonicalizeLicenseVerdict, canonicalizeLicenseVerdictTerm, createLicenseChallenge, ENTITLEMENT_MAX_AGE_MS, hashLicenseKey, LICENSE_TERM_STATES, LICENSE_VERDICT_DETAIL_MAX, LICENSE_VERDICT_PLAN_ID_MAX, MAX_VERDICT_AGE_MS, signLicenseVerdict, signLicenseVerdictWithTerm, verifyLicenseVerdict, verifyLicenseVerdictSignature, } from "./license-verdict.js";
|
|
4
|
+
export type { LicenseChallenge, LicenseTermState, LicenseVerdictEnd, LicenseVerdictEnvelope, LicenseVerdictNotice, LicenseVerdictResult, LicenseVerdictSignatureResult, LicenseVerdictTerm, SignedLicenseVerdict, TamperKind, } from "./license-verdict.js";
|
|
5
|
+
export { canonicalizeLicenseVerdict, canonicalizeLicenseVerdictEnd, canonicalizeLicenseVerdictNotice, canonicalizeLicenseVerdictTerm, createLicenseChallenge, ENTITLEMENT_MAX_AGE_MS, hashLicenseKey, LICENSE_INVALID_REASONS, LICENSE_TERM_STATES, LICENSE_VERDICT_END_EFFECTS, LICENSE_VERDICT_DETAIL_MAX, LICENSE_VERDICT_NOTICE_DOMAIN_MAX, LICENSE_VERDICT_PLAN_ID_MAX, MAX_VERDICT_AGE_MS, signLicenseVerdict, signLicenseVerdictWithEnd, signLicenseVerdictWithNotice, signLicenseVerdictWithTerm, verifyLicenseVerdict, verifyLicenseVerdictEnd, verifyLicenseVerdictNotice, verifyLicenseVerdictSignature, } from "./license-verdict.js";
|
|
6
6
|
export { VENDOR_TOKEN_LEEWAY_SECONDS, VENDOR_TOKEN_SIGNING_PREFIX, signVendorToken, verifyVendorToken } from "./vendor-token.js";
|
|
7
7
|
export type { VendorTokenFailure, VendorTokenVerifyResult } from "./vendor-token.js";
|
|
8
8
|
export { hashBuffer, hashArchive, hashDirectories } from "./hash.js";
|
|
@@ -20,3 +20,5 @@ export { capViolations, checkDocsContract, countRemoteImages, docsFilesToShip, M
|
|
|
20
20
|
export { VIEW_BEARING_CONTRIBUTIONS, declaresClientBundle } from "./client-bundle.js";
|
|
21
21
|
export { resolvePluginManifestEntry } from "./manifest-entry.js";
|
|
22
22
|
export * from "./delivery/index.js";
|
|
23
|
+
export type { CmsRangeAgainstBuilt } from "./cms-range.js";
|
|
24
|
+
export { builtCmsRange, cmsRangeAgainstBuilt, cmsRangeAllows } from "./cms-range.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { VERIFY_FAILURE_REASONS } from "./types.js";
|
|
2
2
|
export { canonicalizeEnvelope, deriveKeyId, generateSigningKeyPair, signEnvelope, verifyEnvelope, } from "./envelope.js";
|
|
3
|
-
export { canonicalizeLicenseVerdict, canonicalizeLicenseVerdictTerm, createLicenseChallenge, ENTITLEMENT_MAX_AGE_MS, hashLicenseKey, LICENSE_TERM_STATES, LICENSE_VERDICT_DETAIL_MAX, LICENSE_VERDICT_PLAN_ID_MAX, MAX_VERDICT_AGE_MS, signLicenseVerdict, signLicenseVerdictWithTerm, verifyLicenseVerdict, verifyLicenseVerdictSignature, } from "./license-verdict.js";
|
|
3
|
+
export { canonicalizeLicenseVerdict, canonicalizeLicenseVerdictEnd, canonicalizeLicenseVerdictNotice, canonicalizeLicenseVerdictTerm, createLicenseChallenge, ENTITLEMENT_MAX_AGE_MS, hashLicenseKey, LICENSE_INVALID_REASONS, LICENSE_TERM_STATES, LICENSE_VERDICT_END_EFFECTS, LICENSE_VERDICT_DETAIL_MAX, LICENSE_VERDICT_NOTICE_DOMAIN_MAX, LICENSE_VERDICT_PLAN_ID_MAX, MAX_VERDICT_AGE_MS, signLicenseVerdict, signLicenseVerdictWithEnd, signLicenseVerdictWithNotice, signLicenseVerdictWithTerm, verifyLicenseVerdict, verifyLicenseVerdictEnd, verifyLicenseVerdictNotice, verifyLicenseVerdictSignature, } from "./license-verdict.js";
|
|
4
4
|
// S320: the vendor token (spec 3a).
|
|
5
5
|
export { VENDOR_TOKEN_LEEWAY_SECONDS, VENDOR_TOKEN_SIGNING_PREFIX, signVendorToken, verifyVendorToken } from "./vendor-token.js";
|
|
6
6
|
export { hashBuffer, hashArchive, hashDirectories } from "./hash.js";
|
|
@@ -13,3 +13,4 @@ export { capViolations, checkDocsContract, countRemoteImages, docsFilesToShip, M
|
|
|
13
13
|
export { VIEW_BEARING_CONTRIBUTIONS, declaresClientBundle } from "./client-bundle.js";
|
|
14
14
|
export { resolvePluginManifestEntry } from "./manifest-entry.js";
|
|
15
15
|
export * from "./delivery/index.js";
|
|
16
|
+
export { builtCmsRange, cmsRangeAgainstBuilt, cmsRangeAllows } from "./cms-range.js";
|