@kardalum/plugin-sdk 0.19.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 +211 -0
- package/README.md +19 -0
- package/dist/admin-section-registry.d.ts +16 -1
- package/dist/admin-section-registry.js +23 -0
- package/dist/built-in-editor-ids.d.ts +1 -1
- package/dist/built-in-editor-ids.js +2 -20
- package/dist/built-in-settings-schemas.d.ts +10 -0
- package/dist/built-in-settings-schemas.js +86 -0
- package/dist/built-in-value-schemas.js +35 -0
- package/dist/built-ins.js +38 -7
- 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 +7 -1
- package/dist/datatype-validation.d.ts +4 -9
- package/dist/datatype-validation.js +139 -1
- 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 +36 -4
- package/dist/index.js +50 -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 +285 -23
- package/dist/manifest.d.ts +450 -51
- package/dist/manifest.js +1 -1
- package/dist/media/media-picker.js +31 -18
- 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-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/richtext/block-panel.js +11 -6
- package/dist/richtext/insert-menu.js +9 -6
- package/dist/richtext/style-listbox.js +6 -4
- 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 +24 -24
- package/dist/structured-storage-types.d.ts +309 -9
- 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/views/asset-view.js +4 -1
- 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 +4 -1
- 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-view.js +7 -6
- package/dist/views/image-view.js +37 -19
- 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 +28 -13
- 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-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/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/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 +115 -3
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.js +58 -11
- 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-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 +8 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.js +1 -1
- 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 +180 -15
- package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +41 -5
- 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 +90 -5
- 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 +117 -41
- package/node_modules/@kardalum/api-schemas/dist/index.js +89 -26
- 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/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 +312 -8
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +43 -3
- 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 +13 -1
- 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 +4 -0
- 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.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 +335 -6
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +242 -2
- 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-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 +47 -4
- 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/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 +90 -8
- package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.js +59 -1
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +110 -0
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.js +34 -2
- 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/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.schema.d.ts +1 -0
- package/node_modules/@kardalum/api-schemas/dist/template.schema.js +3 -0
- 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 +34 -3
- 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.js +6 -0
- 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/tokens.css +15 -3
- package/node_modules/@kardalum/design-tokens/dist/tokens.d.ts +1 -1
- package/node_modules/@kardalum/design-tokens/dist/tokens.js +12 -3
- package/node_modules/@kardalum/design-tokens/dist/tokens.json +8 -3
- package/node_modules/@kardalum/design-tokens/dist/types.d.ts +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 +25 -4
- 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/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/ui/dist/components/switch.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/tooltip.js +1 -2
- package/node_modules/@kardalum/ui/dist/components/truncated-text.d.ts +6 -1
- package/node_modules/@kardalum/ui/dist/components/truncated-text.js +5 -4
- package/package.json +12 -2
|
@@ -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>;
|
|
@@ -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";
|
|
@@ -62,6 +62,17 @@ export interface LicenseVerdictEnvelope {
|
|
|
62
62
|
/** S317: the licence's term, covered by `termSignature` like `planId`. A
|
|
63
63
|
* verdict without it reads as plan unknown, term active. */
|
|
64
64
|
term?: LicenseVerdictTerm;
|
|
65
|
+
/** S367b: where the licence key was refused while a sharing case of the
|
|
66
|
+
* licence is under 30 days old. Covered by `noticeSignature` only, never by
|
|
67
|
+
* `signature` or `termSignature`, so every verifier built before it checks
|
|
68
|
+
* the bytes it always did and ignores this field. */
|
|
69
|
+
notice?: LicenseVerdictNotice;
|
|
70
|
+
/** Part I6f: what the licence's end does to the plugin, and whether it
|
|
71
|
+
* ended by a refund. Covered by `endSignature` only, never by `signature`,
|
|
72
|
+
* `termSignature` or `noticeSignature`, so every verifier built before it
|
|
73
|
+
* checks the bytes it always did and ignores this field. Signed only on a
|
|
74
|
+
* `valid` answer. */
|
|
75
|
+
end?: LicenseVerdictEnd;
|
|
65
76
|
}
|
|
66
77
|
/** The longest `detail` a verdict may carry. */
|
|
67
78
|
export declare const LICENSE_VERDICT_DETAIL_MAX = 500;
|
|
@@ -92,6 +103,10 @@ export interface SignedLicenseVerdict {
|
|
|
92
103
|
signature: string;
|
|
93
104
|
/** S317: base64 Ed25519 over canonicalizeLicenseVerdictTerm; present only when the envelope carries planId or term. */
|
|
94
105
|
termSignature?: string;
|
|
106
|
+
/** S367b: base64 Ed25519 over canonicalizeLicenseVerdictNotice; present only when the envelope carries a notice. */
|
|
107
|
+
noticeSignature?: string;
|
|
108
|
+
/** Part I6f: base64 Ed25519 over canonicalizeLicenseVerdictEnd; present only when the envelope carries an end. */
|
|
109
|
+
endSignature?: string;
|
|
95
110
|
}
|
|
96
111
|
/**
|
|
97
112
|
* A `LicenseChallenge` is the only way to obtain a nonce, and the only
|
|
@@ -193,6 +208,45 @@ export declare function canonicalizeLicenseVerdict(envelope: LicenseVerdictEnvel
|
|
|
193
208
|
* hold a `planId` key, which the version 1 bytes never do, so neither
|
|
194
209
|
* signature can stand in for the other. */
|
|
195
210
|
export declare function canonicalizeLicenseVerdictTerm(envelope: LicenseVerdictEnvelope): Buffer;
|
|
211
|
+
/** S367b: what the buyer's own CMS is told while a sharing case of the
|
|
212
|
+
* licence is under 30 days old. Covered by `noticeSignature` only, so
|
|
213
|
+
* `signature` and `termSignature` keep their bytes and every verifier built
|
|
214
|
+
* before this field ignores it. S367c: `staging-site` tells a staging site's
|
|
215
|
+
* CMS which seated site it belongs to (`domain`) and when it was named
|
|
216
|
+
* (`at`). S367d: `service-closing` tells every CMS the licence service ends at
|
|
217
|
+
* `at`; a CMS that verifies it stops checking (licence terms `updates`). */
|
|
218
|
+
export interface LicenseVerdictNotice {
|
|
219
|
+
kind: "key-seen-elsewhere" | "staging-site" | "service-closing";
|
|
220
|
+
domain: string;
|
|
221
|
+
at: string;
|
|
222
|
+
}
|
|
223
|
+
/** The longest domain a notice carries. */
|
|
224
|
+
export declare const LICENSE_VERDICT_NOTICE_DOMAIN_MAX = 253;
|
|
225
|
+
/** Every reason an `invalid` verdict carries. `domain_mismatch` is no longer
|
|
226
|
+
* answered by the marketplace (S367b) but stays readable on a verdict stored
|
|
227
|
+
* before it. S367d: `public_visitors` is a local or unset domain on a site
|
|
228
|
+
* that answers public visitors (licence terms `local`). S367e: `key_replaced` is
|
|
229
|
+
* a key the operator replaced (licence terms `revocation`); soft, like a full
|
|
230
|
+
* set of seats. */
|
|
231
|
+
export declare const LICENSE_INVALID_REASONS: readonly ["unknown_key", "plugin_mismatch", "domain_mismatch", "domain_blocked", "seat_limit", "seat_move", "key_shared", "licence_locked", "public_visitors", "key_replaced"];
|
|
232
|
+
/** S367b: what `noticeSignature` covers: the version 1 fields, then
|
|
233
|
+
* `notice`. These bytes always hold a `notice` key, which neither the
|
|
234
|
+
* version 1 nor the term bytes do, so no signature can stand in for
|
|
235
|
+
* another. */
|
|
236
|
+
export declare function canonicalizeLicenseVerdictNotice(envelope: LicenseVerdictEnvelope): Buffer;
|
|
237
|
+
/** Part I6f: what a licence's end does to the plugin. `read_only` keeps its
|
|
238
|
+
* reads and refuses its writes; `off` deactivates it. */
|
|
239
|
+
export declare const LICENSE_VERDICT_END_EFFECTS: readonly ["read_only", "off"];
|
|
240
|
+
/** Part I6f: the end the marketplace signs on a `valid` answer: the author's
|
|
241
|
+
* effect for how the licence ended, and whether it ended by a refund. */
|
|
242
|
+
export interface LicenseVerdictEnd {
|
|
243
|
+
effect: (typeof LICENSE_VERDICT_END_EFFECTS)[number];
|
|
244
|
+
refunded: boolean;
|
|
245
|
+
}
|
|
246
|
+
/** Part I6f: what `endSignature` covers: the version 1 fields, then `end`.
|
|
247
|
+
* These bytes always hold an `end` key, which none of the version 1, term or
|
|
248
|
+
* notice bytes do, so no signature can stand in for another. */
|
|
249
|
+
export declare function canonicalizeLicenseVerdictEnd(envelope: LicenseVerdictEnvelope): string;
|
|
196
250
|
export declare function signLicenseVerdict(envelope: LicenseVerdictEnvelope, privateKeyBase64: string): string;
|
|
197
251
|
/** S317: what the marketplace's validation route returns. `signature` is
|
|
198
252
|
* signLicenseVerdict's, byte for byte (Ed25519 is deterministic), so every
|
|
@@ -200,6 +254,17 @@ export declare function signLicenseVerdict(envelope: LicenseVerdictEnvelope, pri
|
|
|
200
254
|
* the envelope carries a plan or a term. Throws RangeError for a malformed
|
|
201
255
|
* plan or term: the marketplace never signs one. */
|
|
202
256
|
export declare function signLicenseVerdictWithTerm(envelope: LicenseVerdictEnvelope, privateKeyBase64: string): SignedLicenseVerdict;
|
|
257
|
+
/** S367b: signLicenseVerdictWithTerm's answer, plus `noticeSignature` when
|
|
258
|
+
* the envelope carries a notice. `signature` and `termSignature` are the
|
|
259
|
+
* same bytes as without the notice. Throws RangeError for a malformed
|
|
260
|
+
* notice: the marketplace never signs one. */
|
|
261
|
+
export declare function signLicenseVerdictWithNotice(envelope: LicenseVerdictEnvelope, privateKeyBase64: string): SignedLicenseVerdict;
|
|
262
|
+
/** Part I6f: signLicenseVerdictWithNotice's answer, plus `endSignature`
|
|
263
|
+
* when the envelope carries an end. `signature`, `termSignature` and
|
|
264
|
+
* `noticeSignature` are the same bytes as without the end. Throws RangeError
|
|
265
|
+
* for a malformed end or an end on an answer that is not `valid`: the
|
|
266
|
+
* marketplace never signs one. */
|
|
267
|
+
export declare function signLicenseVerdictWithEnd(envelope: LicenseVerdictEnvelope, privateKeyBase64: string): SignedLicenseVerdict;
|
|
203
268
|
export type LicenseVerdictSignatureResult = {
|
|
204
269
|
ok: true;
|
|
205
270
|
envelope: LicenseVerdictEnvelope;
|
|
@@ -220,3 +285,13 @@ export declare function verifyLicenseVerdictSignature(signed: unknown, trustedKe
|
|
|
220
285
|
maxAgeMs?: number;
|
|
221
286
|
}): LicenseVerdictSignatureResult;
|
|
222
287
|
export declare function verifyLicenseVerdict(signedVerdict: unknown, challenge: LicenseChallenge, trustedKeys: TrustedKey[], now?: Date): LicenseVerdictResult;
|
|
288
|
+
/** S367b: the notice when it is well formed and `noticeSignature` verifies
|
|
289
|
+
* over it with a trusted key; null otherwise, which reads as a verdict
|
|
290
|
+
* without one. It checks nothing else (freshness, subject): the caller has
|
|
291
|
+
* already verified the verdict itself. */
|
|
292
|
+
export declare function verifyLicenseVerdictNotice(signed: unknown, trustedKeys: TrustedKey[]): LicenseVerdictNotice | null;
|
|
293
|
+
/** Part I6f: the end when it is well formed and `endSignature` verifies over
|
|
294
|
+
* it with a trusted key; null otherwise, which reads as an answer without
|
|
295
|
+
* one. It checks nothing else (freshness, subject, status): the caller has
|
|
296
|
+
* already verified the answer itself. */
|
|
297
|
+
export declare function verifyLicenseVerdictEnd(signed: unknown, trustedKeys: TrustedKey[]): LicenseVerdictEnd | null;
|