@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,8 +1,12 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import { ActionStringSchema } from "./action.schema.js";
|
|
3
|
+
import { PluginActionDeclarationSchema, PluginRoleOfferSchema } from "./plugin-actions.schema.js";
|
|
4
|
+
import { PLUGIN_ACTION_OFFER_TARGETS, actionOfferTicked } from "./plugin-manifest-actions.js";
|
|
3
5
|
import { SLOT_ID_MAX, SLOT_ID_REGEX } from "./plugin-id-rules.js";
|
|
4
6
|
import { LABEL_KEY_MAX_LENGTH, LABEL_MAX_LANGUAGES, PluginLabelSchema, labelMapSchema, labelTextSchema, pluginLabelMapSchema } from "./plugin-labels.js";
|
|
5
7
|
import { RoleIdSchema } from "./role.schema.js";
|
|
8
|
+
import { PLUGIN_SECRET_VALUE_MAX_BYTES, fitsUtf8 } from "./plugin-secrets.js";
|
|
9
|
+
import { PLUGIN_SETTINGS_FIELDS_MAX, PLUGIN_SETTING_TEXT_MAX, PluginSettingFieldSchema, declaredSettingsFieldsOf, isPluginSettingId, pluginSettingsValuesSchema, } from "./plugin-settings.js";
|
|
6
10
|
// S292 (2026-10-13-s292-what-the-wizard-may-ask-design.md): what a plugin's
|
|
7
11
|
// install asks, declared as plain data in the manifest's `install`, so the
|
|
8
12
|
// install screen, a script and the CLI can all ask it and answer it before
|
|
@@ -36,6 +40,8 @@ export const INSTALL_LABEL_KEY_MAX_LENGTH = LABEL_KEY_MAX_LENGTH;
|
|
|
36
40
|
export const INSTALL_MAX_OPTION_ANSWERS = INSTALL_MAX_STEPS * INSTALL_MAX_OPTIONS_PER_STEP;
|
|
37
41
|
/** The most offered roles one answers object may name. */
|
|
38
42
|
export const INSTALL_MAX_ROLE_ANSWERS = 64;
|
|
43
|
+
/** M33 K29: the most offered actions one answers object may accept (`grants`). */
|
|
44
|
+
export const INSTALL_MAX_GRANT_ANSWERS = 64;
|
|
39
45
|
export const INSTALL_OPTION_KINDS = ["boolean", "select", "multiSelect"];
|
|
40
46
|
/** Keys an answers object can never use for an option. "__proto__" already
|
|
41
47
|
* fails the id rule as an option id, and InstallAnswersSchema refuses it as
|
|
@@ -172,12 +178,37 @@ export const InstallAnswerValueSchema = z.union([
|
|
|
172
178
|
InstallIdSchema,
|
|
173
179
|
z.array(InstallIdSchema).max(INSTALL_MAX_CHOICES_PER_OPTION, { message: `a list answer names at most ${INSTALL_MAX_CHOICES_PER_OPTION} choices` }),
|
|
174
180
|
], { error: "an answer is true or false, a choice id, or a list of choice ids" });
|
|
181
|
+
/** M32 F4d (D5): the most bytes (UTF-8) a secret answered at install may hold: a secret's own bound. */
|
|
182
|
+
export const INSTALL_SECRET_ANSWER_MAX_BYTES = PLUGIN_SECRET_VALUE_MAX_BYTES;
|
|
183
|
+
const InstallSettingKeySchema = z.string().refine(isPluginSettingId, {
|
|
184
|
+
message: 'a settings key is a field id: a letter, then letters, digits and "_", at most 40',
|
|
185
|
+
});
|
|
186
|
+
/** A secret field's answer: the value, sent once, stored sealed, never shown again. */
|
|
187
|
+
export const InstallSecretAnswerSchema = z
|
|
188
|
+
.object({
|
|
189
|
+
secret: z
|
|
190
|
+
.string()
|
|
191
|
+
.min(1, { message: "a secret answer is not empty" })
|
|
192
|
+
.refine((value) => fitsUtf8(value, INSTALL_SECRET_ANSWER_MAX_BYTES), { message: `a secret answer is at most ${INSTALL_SECRET_ANSWER_MAX_BYTES} bytes` }),
|
|
193
|
+
})
|
|
194
|
+
.strict();
|
|
195
|
+
/** One settings field's answer: its value, or a secret field's `{ secret }`. The field's own rule
|
|
196
|
+
* runs in the resolver, against the declaration. */
|
|
197
|
+
export const InstallSettingAnswerSchema = z.union([z.string().max(PLUGIN_SETTING_TEXT_MAX), z.number().finite(), z.boolean(), z.null(), InstallSecretAnswerSchema], { error: "a settings answer is a value (text, a number, true or false, or null) or { secret }" });
|
|
175
198
|
/** The answers object every install path takes. Strict, so a misspelt key is
|
|
176
199
|
* refused rather than ignored; read by resolveInstallAnswers. */
|
|
177
200
|
export const InstallAnswersSchema = z
|
|
178
201
|
.object({
|
|
179
202
|
sampleContent: z.boolean().optional(),
|
|
180
203
|
roles: z.array(RoleIdSchema).max(INSTALL_MAX_ROLE_ANSWERS, { message: `an answers object names at most ${INSTALL_MAX_ROLE_ANSWERS} roles` }).optional(),
|
|
204
|
+
// M33 K29: the offered actions (`actions[].offerTo`) to give the roles that hold their target.
|
|
205
|
+
// A door refuses them unless the caller holds `roles.update`, and the install applies each only
|
|
206
|
+
// when the caller holds that action too; an offer not applied waits under Plugins, Installed.
|
|
207
|
+
grants: z
|
|
208
|
+
.array(ActionStringSchema)
|
|
209
|
+
.max(INSTALL_MAX_GRANT_ANSWERS, { message: `an answers object accepts at most ${INSTALL_MAX_GRANT_ANSWERS} action offers` })
|
|
210
|
+
.meta({ example: ["com.example.words.panel.view"] })
|
|
211
|
+
.optional(),
|
|
181
212
|
options: z
|
|
182
213
|
.preprocess(refuseOwnProtoKey, z
|
|
183
214
|
.record(InstallAnswerKeySchema, InstallAnswerValueSchema, {
|
|
@@ -190,6 +221,17 @@ export const InstallAnswersSchema = z
|
|
|
190
221
|
message: `an answers object answers at most ${INSTALL_MAX_OPTION_ANSWERS} options`,
|
|
191
222
|
}))
|
|
192
223
|
.optional(),
|
|
224
|
+
// M32 F4d (D5): the ask-at-install settings fields, by field id. A secret field's answer is
|
|
225
|
+
// `{ secret: value }`: it goes to the secret store, never into the resolved record.
|
|
226
|
+
settings: z
|
|
227
|
+
.preprocess(refuseOwnProtoKey, z
|
|
228
|
+
.record(InstallSettingKeySchema, InstallSettingAnswerSchema, {
|
|
229
|
+
error: (issue) => (issue.code === "invalid_key" ? issue.issues.map((inner) => inner.message).join("; ") : undefined),
|
|
230
|
+
})
|
|
231
|
+
.refine((settings) => Object.keys(settings).length <= PLUGIN_SETTINGS_FIELDS_MAX, {
|
|
232
|
+
message: `an answers object answers at most ${PLUGIN_SETTINGS_FIELDS_MAX} settings`,
|
|
233
|
+
}))
|
|
234
|
+
.optional(),
|
|
193
235
|
})
|
|
194
236
|
.strict();
|
|
195
237
|
/** The answers with every default filled: what onInstall and onUpdate are
|
|
@@ -198,9 +240,106 @@ export const ResolvedInstallAnswersSchema = z
|
|
|
198
240
|
.object({
|
|
199
241
|
sampleContent: z.boolean(),
|
|
200
242
|
roles: z.array(RoleIdSchema),
|
|
243
|
+
/** M33 K29: the offered actions the install's answers accepted; absent when they named none.
|
|
244
|
+
* What was applied is the record's `offersApplied`: an accepted offer the caller could not
|
|
245
|
+
* give (it lacks the action) is here and waits. */
|
|
246
|
+
grants: z.array(ActionStringSchema).optional(),
|
|
201
247
|
options: z.record(InstallIdSchema, InstallAnswerValueSchema),
|
|
248
|
+
/** M32 F4d (D5): the non-secret settings answered at install; absent when none was. A secret
|
|
249
|
+
* answer is never here. */
|
|
250
|
+
settings: z.record(z.string(), z.union([z.string(), z.number(), z.boolean(), z.null()])).optional(),
|
|
202
251
|
})
|
|
203
252
|
.strict();
|
|
253
|
+
function readOwn(value, key) {
|
|
254
|
+
try {
|
|
255
|
+
return value !== null && typeof value === "object" && !Array.isArray(value) ? value[key] : undefined;
|
|
256
|
+
}
|
|
257
|
+
catch {
|
|
258
|
+
return undefined;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* M32 F4d (D5): the settings fields a manifest's `contributions` declare with `askAtInstall: true`:
|
|
263
|
+
* `declaredSettingsFieldsOf` (the one list the Settings page draws) narrowed to those, so the install
|
|
264
|
+
* dialog never asks, nor stores a secret for, a field the Settings page leaves out.
|
|
265
|
+
*/
|
|
266
|
+
export function askedAtInstallFieldsOf(contributions) {
|
|
267
|
+
return declaredSettingsFieldsOf(contributions).filter((field) => field.askAtInstall === true);
|
|
268
|
+
}
|
|
269
|
+
function askedFieldsOf(manifest) {
|
|
270
|
+
return manifest.askedSettings ?? askedAtInstallFieldsOf(manifest.contributions);
|
|
271
|
+
}
|
|
272
|
+
function storedValueIds(stored) {
|
|
273
|
+
const inner = readOwn(stored, "values");
|
|
274
|
+
const values = inner !== null && typeof inner === "object" && !Array.isArray(inner) ? inner : stored;
|
|
275
|
+
if (values === null || typeof values !== "object" || Array.isArray(values))
|
|
276
|
+
return new Set();
|
|
277
|
+
return new Set(Object.keys(values));
|
|
278
|
+
}
|
|
279
|
+
/** M32 F4d (D5): the ask-at-install fields an update still asks: those with no stored value (for a
|
|
280
|
+
* secret field, its secret is not set). */
|
|
281
|
+
export function settingsNotStoredBy(fields, stored, secretsSet) {
|
|
282
|
+
const ids = storedValueIds(stored);
|
|
283
|
+
return fields.filter((field) => (field.type === "secret" ? !secretsSet.has(field.secret) : !ids.has(field.id)));
|
|
284
|
+
}
|
|
285
|
+
/** The settings answers checked against the ask-at-install fields: issues pushed in answer order,
|
|
286
|
+
* then the field rules'. A message never quotes a value. `stored`, on an update, refuses a field
|
|
287
|
+
* that already has a value. */
|
|
288
|
+
function resolveSettingsAnswers(asked, given, issues, stored) {
|
|
289
|
+
const values = {};
|
|
290
|
+
const secrets = [];
|
|
291
|
+
if (given === undefined)
|
|
292
|
+
return { values, secrets };
|
|
293
|
+
const byId = new Map(asked.map((field) => [field.id, field]));
|
|
294
|
+
const open = stored === undefined ? null : new Set(settingsNotStoredBy(asked, stored.values, stored.secretsSet).map((field) => field.id));
|
|
295
|
+
const plain = {};
|
|
296
|
+
for (const key of Object.keys(given)) {
|
|
297
|
+
const path = ["settings", key];
|
|
298
|
+
const id = JSON.stringify(key);
|
|
299
|
+
const field = byId.get(key);
|
|
300
|
+
const value = given[key];
|
|
301
|
+
if (field === undefined) {
|
|
302
|
+
issues.push({ path, message: `this plugin asks no setting ${id} at install` });
|
|
303
|
+
continue;
|
|
304
|
+
}
|
|
305
|
+
if (open !== null && !open.has(key)) {
|
|
306
|
+
issues.push({ path, message: `${id} already has a value, and an update keeps it: change it on the plugin's Settings page` });
|
|
307
|
+
continue;
|
|
308
|
+
}
|
|
309
|
+
const isSecret = value !== null && typeof value === "object";
|
|
310
|
+
if (field.type === "secret") {
|
|
311
|
+
if (isSecret)
|
|
312
|
+
secrets.push({ name: field.secret, value: value.secret });
|
|
313
|
+
else
|
|
314
|
+
issues.push({ path, message: `${id} is a secret: answer it as { "secret": "..." }` });
|
|
315
|
+
continue;
|
|
316
|
+
}
|
|
317
|
+
if (isSecret) {
|
|
318
|
+
issues.push({ path, message: `${id} is not a secret: answer its value` });
|
|
319
|
+
continue;
|
|
320
|
+
}
|
|
321
|
+
plain[key] = value;
|
|
322
|
+
}
|
|
323
|
+
const parsed = pluginSettingsValuesSchema(asked).safeParse(plain);
|
|
324
|
+
if (!parsed.success) {
|
|
325
|
+
for (const issue of parsed.error.issues) {
|
|
326
|
+
issues.push({ path: ["settings", ...issue.path.filter((part) => typeof part !== "symbol")], message: issue.message });
|
|
327
|
+
}
|
|
328
|
+
return { values, secrets };
|
|
329
|
+
}
|
|
330
|
+
for (const [key, value] of Object.entries(parsed.data))
|
|
331
|
+
if (value !== undefined)
|
|
332
|
+
values[key] = value;
|
|
333
|
+
return { values, secrets };
|
|
334
|
+
}
|
|
335
|
+
/** The ok result, its settings parts added only when there are any. */
|
|
336
|
+
function okResult(answers, settings) {
|
|
337
|
+
return {
|
|
338
|
+
ok: true,
|
|
339
|
+
answers: { ...answers, ...(Object.keys(settings.values).length > 0 ? { settings: settings.values } : {}) },
|
|
340
|
+
...(settings.secrets.length > 0 ? { secrets: settings.secrets } : {}),
|
|
341
|
+
};
|
|
342
|
+
}
|
|
204
343
|
/** One declared option's answer, or undefined with its issue pushed (or for an
|
|
205
344
|
* optional select left unanswered). `needsAnswer` words the refusal of an
|
|
206
345
|
* unanswered select that needs one, given the option's quoted id: an
|
|
@@ -287,6 +426,7 @@ export function resolveInstallAnswers(manifest, shipped, answers) {
|
|
|
287
426
|
else
|
|
288
427
|
roles.push(role);
|
|
289
428
|
});
|
|
429
|
+
const grants = resolveGrantAnswers(manifest, answers.grants, issues);
|
|
290
430
|
const declared = new Map();
|
|
291
431
|
for (const step of manifest.install?.steps ?? [])
|
|
292
432
|
for (const option of step.options)
|
|
@@ -302,7 +442,24 @@ export function resolveInstallAnswers(manifest, shipped, answers) {
|
|
|
302
442
|
if (value !== undefined)
|
|
303
443
|
options[id] = value;
|
|
304
444
|
}
|
|
305
|
-
|
|
445
|
+
const settings = resolveSettingsAnswers(askedFieldsOf(manifest), answers.settings, issues);
|
|
446
|
+
return issues.length > 0 ? { ok: false, issues } : okResult({ sampleContent, roles, options, ...(grants.length > 0 ? { grants } : {}) }, settings);
|
|
447
|
+
}
|
|
448
|
+
/** M33 K29: the offered actions `grants` names, in answer order, each one an action the manifest
|
|
449
|
+
* declares with `offerTo` and named once; every other is an issue. Who may give them is the
|
|
450
|
+
* door's and the install's to decide (roles.update and the action itself), not the answers'. */
|
|
451
|
+
function resolveGrantAnswers(manifest, given, issues) {
|
|
452
|
+
const offered = new Set((manifest.actions ?? []).filter((action) => action.offerTo !== undefined).map((action) => action.id));
|
|
453
|
+
const grants = [];
|
|
454
|
+
(given ?? []).forEach((action, index) => {
|
|
455
|
+
if (!offered.has(action))
|
|
456
|
+
issues.push({ path: ["grants", index], message: `this plugin offers no action ${JSON.stringify(action)} to a role` });
|
|
457
|
+
else if (grants.includes(action))
|
|
458
|
+
issues.push({ path: ["grants", index], message: `action ${JSON.stringify(action)} is answered more than once` });
|
|
459
|
+
else
|
|
460
|
+
grants.push(action);
|
|
461
|
+
});
|
|
462
|
+
return grants;
|
|
306
463
|
}
|
|
307
464
|
/** What a door reads from manifest.json (or the live manifest) to resolve
|
|
308
465
|
* answers. Not strict: a manifest's other keys are allowed and left out of
|
|
@@ -310,6 +467,8 @@ export function resolveInstallAnswers(manifest, shipped, answers) {
|
|
|
310
467
|
export const InstallAnswersManifestSchema = z.object({
|
|
311
468
|
install: PluginInstallDeclarationSchema.optional(),
|
|
312
469
|
roles: z.array(PluginRoleOfferSchema).optional(),
|
|
470
|
+
// M33 K29: the actions, for the ones a `grants` answer may name.
|
|
471
|
+
actions: z.array(PluginActionDeclarationSchema).optional(),
|
|
313
472
|
});
|
|
314
473
|
/** A manifest nothing has validated yet, read for its answers: the shape first,
|
|
315
474
|
* then checkInstallDeclaration on a declaration that parsed (S292 C7), because
|
|
@@ -326,7 +485,11 @@ export function parseInstallAnswersManifest(raw) {
|
|
|
326
485
|
};
|
|
327
486
|
}
|
|
328
487
|
const declarationIssues = parsed.data.install ? checkInstallDeclaration(parsed.data.install) : [];
|
|
329
|
-
|
|
488
|
+
if (declarationIssues.length > 0)
|
|
489
|
+
return { ok: false, issues: declarationIssues };
|
|
490
|
+
// M32 F4d (D5): the ask-at-install settings, read here once as copies; set only when there are any.
|
|
491
|
+
const askedSettings = askedAtInstallFieldsOf(readOwn(raw, "contributions"));
|
|
492
|
+
return { ok: true, manifest: askedSettings.length > 0 ? { ...parsed.data, askedSettings } : parsed.data };
|
|
330
493
|
}
|
|
331
494
|
function recordedValue(recorded, id) {
|
|
332
495
|
return recorded && Object.hasOwn(recorded.options, id) ? recorded.options[id] : undefined;
|
|
@@ -363,15 +526,29 @@ const updateNeedsAnswer = (id) => `${id} has no recorded answer and no default,
|
|
|
363
526
|
* and the declaration are held to what resolveInstallAnswers assumes;
|
|
364
527
|
* `recorded` is the row's record read through readInstallRecord, or null
|
|
365
528
|
* for a plugin installed before S293. */
|
|
366
|
-
|
|
529
|
+
// M32 F4d (D5): `answers.settings` on the record (and so in installRecord) is what the install and
|
|
530
|
+
// each update were answered for the ask-at-install fields, kept as asked. It is not the plugin's
|
|
531
|
+
// current settings: those live in the registry row's `settings` column, which the Settings page
|
|
532
|
+
// changes. `storedSettings` below, read from that column, is what decides which fields are still asked.
|
|
533
|
+
export function resolveUpdateAnswers(manifest, recorded, given,
|
|
534
|
+
/** M32 F4d (D5): what is already stored; an answer for a field that has a value is refused.
|
|
535
|
+
* Absent (a door's pre-check, which has not read it), nothing is taken as stored, and the
|
|
536
|
+
* registry, which reads the row, refuses it. */
|
|
537
|
+
storedSettings) {
|
|
367
538
|
const issues = [];
|
|
368
539
|
if (given.sampleContent !== undefined)
|
|
369
540
|
issues.push({ path: ["sampleContent"], message: "an update never adds sample content" });
|
|
370
541
|
if (given.roles !== undefined && given.roles.length > 0) {
|
|
371
542
|
issues.push({ path: ["roles"], message: "an update creates no roles: accept an offered role from the installed plugins list" });
|
|
372
543
|
}
|
|
544
|
+
// M33 K29: an update's new offer is shown under Plugins, Installed and never applied by the
|
|
545
|
+
// update itself, so an update's answers accept none. The install's grants stay on the record.
|
|
546
|
+
if (given.grants !== undefined && given.grants.length > 0) {
|
|
547
|
+
issues.push({ path: ["grants"], message: "an update applies no action offer: apply it from the installed plugins list" });
|
|
548
|
+
}
|
|
373
549
|
const offered = new Set((manifest.roles ?? []).map((role) => role.id));
|
|
374
550
|
const roles = (recorded?.roles ?? []).filter((role) => offered.has(role));
|
|
551
|
+
const grants = recorded?.grants;
|
|
375
552
|
const declared = new Map();
|
|
376
553
|
for (const step of manifest.install?.steps ?? [])
|
|
377
554
|
for (const option of step.options)
|
|
@@ -396,7 +573,12 @@ export function resolveUpdateAnswers(manifest, recorded, given) {
|
|
|
396
573
|
if (value !== undefined)
|
|
397
574
|
options[id] = value;
|
|
398
575
|
}
|
|
399
|
-
|
|
576
|
+
const settings = resolveSettingsAnswers(askedFieldsOf(manifest), given.settings, issues, storedSettings);
|
|
577
|
+
// The settings answered at install stay on the record beside this update's.
|
|
578
|
+
const merged = { values: { ...(recorded?.settings ?? {}), ...settings.values }, secrets: settings.secrets };
|
|
579
|
+
return issues.length > 0
|
|
580
|
+
? { ok: false, issues }
|
|
581
|
+
: okResult({ sampleContent: recorded?.sampleContent ?? false, roles, options, ...(grants !== undefined ? { grants: [...grants] } : {}) }, merged);
|
|
400
582
|
}
|
|
401
583
|
/** What installing does whatever the answers, in the order the install
|
|
402
584
|
* applies it, structured storage last (it is what an uninstall must
|
|
@@ -420,6 +602,8 @@ const InstallConsentDetailSchema = z.union([InstallConsentTextSchema, InstallCon
|
|
|
420
602
|
const consentItemShape = { id: z.string(), details: z.array(InstallConsentDetailSchema) };
|
|
421
603
|
const sampleContentShape = { default: z.literal(true), description: InstallDescriptionSchema.optional() };
|
|
422
604
|
const roleOfferShape = { id: z.string(), label: PluginLabelSchema, actions: z.array(z.string()), default: z.literal(false) };
|
|
605
|
+
// M33 K29: an action offered to the roles that hold `target`; `default` is derived (actionOfferTicked).
|
|
606
|
+
const actionOfferShape = { action: z.string().meta({ example: "com.example.words.panel.view" }), label: PluginLabelSchema, target: z.enum(PLUGIN_ACTION_OFFER_TARGETS), default: z.boolean() };
|
|
423
607
|
/** The install interface: what a screen shows and a script answers, before
|
|
424
608
|
* anything is installed. The marketplace stores it per version and its
|
|
425
609
|
* listing API carries it to the admin. A consent id is an open string on
|
|
@@ -432,7 +616,11 @@ export const InstallInterfaceSchema = z
|
|
|
432
616
|
consent: z.array(z.object(consentItemShape).strict()),
|
|
433
617
|
sampleContent: z.object(sampleContentShape).strict().nullable(),
|
|
434
618
|
roles: z.array(z.object(roleOfferShape).strict()),
|
|
619
|
+
/** M33 K29: the actions offered to the roles holding a core action; absent when none is. */
|
|
620
|
+
offers: z.array(z.object(actionOfferShape).strict()).optional(),
|
|
435
621
|
steps: z.array(InstallStepSchema),
|
|
622
|
+
/** M32 F4d (D5): the settings fields asked at install, as declared; absent when there are none. */
|
|
623
|
+
settings: z.array(PluginSettingFieldSchema).optional(),
|
|
436
624
|
})
|
|
437
625
|
.strict();
|
|
438
626
|
/** InstallInterfaceSchema as the listing wire carries it, from the
|
|
@@ -443,12 +631,18 @@ export const InstallInterfaceSchema = z
|
|
|
443
631
|
* keys are dropped on the interface, its consent items, its sample content
|
|
444
632
|
* and its roles; the steps stay on the closed InstallStepSchema (D15),
|
|
445
633
|
* because a step an older SDK cannot read belongs to a plugin that CMS
|
|
446
|
-
* refuses at install anyway.
|
|
634
|
+
* refuses at install anyway. An offer's `target` stays a closed enum for
|
|
635
|
+
* the same reason (M33 K29): a target an older CMS does not know comes from
|
|
636
|
+
* an `offerTo` its manifest check refuses, so that plugin cannot be
|
|
637
|
+
* installed there either way. Adding a target is therefore a change that
|
|
638
|
+
* ships with the CMS that reads it. */
|
|
447
639
|
export const InstallInterfaceWireSchema = z.object({
|
|
448
640
|
consent: z.array(z.object(consentItemShape)),
|
|
449
641
|
sampleContent: z.object(sampleContentShape).nullable(),
|
|
450
642
|
roles: z.array(z.object(roleOfferShape)),
|
|
643
|
+
offers: z.array(z.object(actionOfferShape)).optional(),
|
|
451
644
|
steps: z.array(InstallStepSchema),
|
|
645
|
+
settings: z.array(PluginSettingFieldSchema).optional(),
|
|
452
646
|
});
|
|
453
647
|
function asRecord(value) {
|
|
454
648
|
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
@@ -490,14 +684,19 @@ export function installInterfaceFor(manifest, shipped) {
|
|
|
490
684
|
].filter((item) => item !== null);
|
|
491
685
|
if (asRecord(manifest.databaseCompatibility)?.storageType === "structured")
|
|
492
686
|
consent.push({ id: "structuredStorage", details: [] });
|
|
687
|
+
const asked = askedAtInstallFieldsOf(manifest.contributions);
|
|
688
|
+
const offers = (manifest.actions ?? []).flatMap(({ id, label, offerTo }) => offerTo === undefined ? [] : [{ action: id, label, target: offerTo, default: actionOfferTicked(manifest.contributions, id) }]);
|
|
493
689
|
return {
|
|
494
690
|
consent,
|
|
495
691
|
sampleContent: shipped.sampleContent
|
|
496
692
|
? { default: true, ...(shipped.sampleContentDescription ? { description: shipped.sampleContentDescription } : {}) }
|
|
497
693
|
: null,
|
|
498
694
|
roles: (manifest.roles ?? []).map(({ id, label, actions }) => ({ id, label, actions: [...actions], default: false })),
|
|
695
|
+
...(offers.length > 0 ? { offers } : {}),
|
|
499
696
|
// A JSON round trip: the declaration is plain data, and the caller may
|
|
500
697
|
// change what it is handed without touching the manifest.
|
|
501
698
|
steps: manifest.install ? JSON.parse(JSON.stringify(manifest.install.steps)) : [],
|
|
699
|
+
// M32 F4d (D5): parsed copies, so the caller may change what it is handed.
|
|
700
|
+
...(asked.length > 0 ? { settings: asked } : {}),
|
|
502
701
|
};
|
|
503
702
|
}
|
|
@@ -51,10 +51,36 @@ export declare function pluginLabelMapSchema(): z.ZodPreprocess<z.ZodObject<{
|
|
|
51
51
|
export declare const PluginLabelMapSchema: z.ZodPreprocess<z.ZodObject<{
|
|
52
52
|
en: z.ZodString;
|
|
53
53
|
}, z.core.$catchall<z.ZodString>>, unknown>;
|
|
54
|
+
/** A label neither branch accepts is explained once: a map that carries its
|
|
55
|
+
* English text by the map's own first problem (too many languages, a key that
|
|
56
|
+
* is not a language code, a text that is not one), anything else by what a
|
|
57
|
+
* label is. */
|
|
58
|
+
export declare function labelUnionError(issue: {
|
|
59
|
+
code?: string;
|
|
60
|
+
input?: unknown;
|
|
61
|
+
errors?: ReadonlyArray<ReadonlyArray<{
|
|
62
|
+
path: PropertyKey[];
|
|
63
|
+
message: string;
|
|
64
|
+
}>>;
|
|
65
|
+
}): string | undefined;
|
|
54
66
|
export declare const PluginLabelSchema: z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
|
|
55
67
|
en: z.ZodString;
|
|
56
68
|
}, z.core.$catchall<z.ZodString>>, unknown>]>;
|
|
69
|
+
/** Evidence 91: a description (a plugin setting field's, a plugin secret's), at most 240 characters in
|
|
70
|
+
* each language: twice a label's PLUGIN_LABEL_MAX, room for what a value needs and what it costs
|
|
71
|
+
* beside the input. One number for both, so a secret's text is never held shorter than a setting's. */
|
|
72
|
+
export declare const PLUGIN_SETTING_DESCRIPTION_MAX = 240;
|
|
73
|
+
/** A description: a string or a language map with English, trimmed, each text at most
|
|
74
|
+
* PLUGIN_SETTING_DESCRIPTION_MAX characters (a label's rule at a longer cap). A fresh instance each
|
|
75
|
+
* call, because the OpenAPI conversion drops a schema instance that a new union reuses. */
|
|
76
|
+
export declare function pluginDescriptionSchema(): z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
|
|
77
|
+
en: z.ZodString;
|
|
78
|
+
}, z.core.$catchall<z.ZodString>>, unknown>]>;
|
|
57
79
|
/** The text of a label for a language: the language as given, else its primary
|
|
58
80
|
* subtag (`de-AT` reads `de`), else `en`, which every map carries. Codes
|
|
59
81
|
* compare case-insensitively (BCP 47 tags do). A plain string is its own text. */
|
|
60
82
|
export declare function resolveLabel(label: PluginLabel, language: string): string;
|
|
83
|
+
/** The language a label's text is in when read for a language, as resolveLabel picks it: the
|
|
84
|
+
* map's code it read (as written there), `en` when it fell back, and null for a plain string,
|
|
85
|
+
* whose language is not known. */
|
|
86
|
+
export declare function resolvedLabelLanguage(label: PluginLabel, language: string): string | null;
|
|
@@ -85,7 +85,7 @@ const LABEL_HINT = "a string, or a map with en required";
|
|
|
85
85
|
* English text by the map's own first problem (too many languages, a key that
|
|
86
86
|
* is not a language code, a text that is not one), anything else by what a
|
|
87
87
|
* label is. */
|
|
88
|
-
function labelUnionError(issue) {
|
|
88
|
+
export function labelUnionError(issue) {
|
|
89
89
|
if (issue.code !== "invalid_union")
|
|
90
90
|
return undefined;
|
|
91
91
|
const value = issue.input;
|
|
@@ -96,6 +96,16 @@ function labelUnionError(issue) {
|
|
|
96
96
|
return LABEL_HINT;
|
|
97
97
|
}
|
|
98
98
|
export const PluginLabelSchema = z.union([PluginLabelStringSchema, PluginLabelMapSchema], { error: labelUnionError });
|
|
99
|
+
/** Evidence 91: a description (a plugin setting field's, a plugin secret's), at most 240 characters in
|
|
100
|
+
* each language: twice a label's PLUGIN_LABEL_MAX, room for what a value needs and what it costs
|
|
101
|
+
* beside the input. One number for both, so a secret's text is never held shorter than a setting's. */
|
|
102
|
+
export const PLUGIN_SETTING_DESCRIPTION_MAX = 240;
|
|
103
|
+
/** A description: a string or a language map with English, trimmed, each text at most
|
|
104
|
+
* PLUGIN_SETTING_DESCRIPTION_MAX characters (a label's rule at a longer cap). A fresh instance each
|
|
105
|
+
* call, because the OpenAPI conversion drops a schema instance that a new union reuses. */
|
|
106
|
+
export function pluginDescriptionSchema() {
|
|
107
|
+
return z.union([labelTextSchema({ max: PLUGIN_SETTING_DESCRIPTION_MAX, trim: true }), labelMapSchema({ max: PLUGIN_SETTING_DESCRIPTION_MAX, trim: true })], { error: labelUnionError });
|
|
108
|
+
}
|
|
99
109
|
/** The text of a label for a language: the language as given, else its primary
|
|
100
110
|
* subtag (`de-AT` reads `de`), else `en`, which every map carries. Codes
|
|
101
111
|
* compare case-insensitively (BCP 47 tags do). A plain string is its own text. */
|
|
@@ -114,3 +124,21 @@ export function resolveLabel(label, language) {
|
|
|
114
124
|
}
|
|
115
125
|
return primaryText ?? label.en;
|
|
116
126
|
}
|
|
127
|
+
/** The language a label's text is in when read for a language, as resolveLabel picks it: the
|
|
128
|
+
* map's code it read (as written there), `en` when it fell back, and null for a plain string,
|
|
129
|
+
* whose language is not known. */
|
|
130
|
+
export function resolvedLabelLanguage(label, language) {
|
|
131
|
+
if (typeof label === "string")
|
|
132
|
+
return null;
|
|
133
|
+
const wanted = language.toLowerCase();
|
|
134
|
+
const primary = wanted.split("-")[0] ?? "";
|
|
135
|
+
let primaryCode;
|
|
136
|
+
for (const code of Object.keys(label)) {
|
|
137
|
+
const lower = code.toLowerCase();
|
|
138
|
+
if (lower === wanted)
|
|
139
|
+
return code;
|
|
140
|
+
if (primaryCode === undefined && primary !== "" && lower === primary)
|
|
141
|
+
primaryCode = code;
|
|
142
|
+
}
|
|
143
|
+
return primaryCode ?? "en";
|
|
144
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { type PluralCategory } from "./plural-rules.js";
|
|
2
3
|
/** The largest locale file a plugin may ship, in UTF-8 bytes. */
|
|
3
4
|
export declare const PLUGIN_LOCALE_MAX_BYTES: number;
|
|
4
5
|
/** The most keys one locale file may hold. */
|
|
@@ -33,17 +34,34 @@ export declare function parsePluginLocaleFile(text: string): ParsedPluginLocaleF
|
|
|
33
34
|
* parsePluginLocaleFile; the admin's own files are trusted. */
|
|
34
35
|
export declare function localePlaceholders(text: string): string[];
|
|
35
36
|
export interface LocaleFileComparison {
|
|
36
|
-
/** Keys the other file has and English lacks
|
|
37
|
+
/** Keys the other file has and English lacks (a plural form the language
|
|
38
|
+
* does not use among them), in the other file's order. */
|
|
37
39
|
extra: string[];
|
|
38
|
-
/** Keys English has and the other file lacks, in English's order
|
|
40
|
+
/** Keys English has and the other file lacks, in English's order; an
|
|
41
|
+
* English plural group is named by the language's own forms. */
|
|
39
42
|
missing: string[];
|
|
40
43
|
/** Keys both have whose placeholder lists differ, in the other file's order. */
|
|
41
44
|
mismatched: string[];
|
|
42
45
|
}
|
|
43
|
-
/**
|
|
44
|
-
*
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
/** The plural base of a key ("items_one" is "items" and "one"), or null.
|
|
47
|
+
* Linear: one lastIndexOf. */
|
|
48
|
+
export declare function pluralBase(key: string): {
|
|
49
|
+
base: string;
|
|
50
|
+
category: PluralCategory;
|
|
51
|
+
} | null;
|
|
52
|
+
/** Holds one language's flat key-to-text map to the English one (M33 K37:
|
|
53
|
+
* the rule takes the language). Keys are looked up as own properties only.
|
|
54
|
+
* An English plural group (`x_one` and `x_other`) asks the language for its
|
|
55
|
+
* own CLDR forms (Arabic all six, German `one` and `other`, Japanese only
|
|
56
|
+
* `other`); a form the language does not use is extra. Each form's
|
|
57
|
+
* placeholders are English `_other`'s, except that the zero, one and two
|
|
58
|
+
* forms may leave `{{count}}` out. An English key without a suffix that
|
|
59
|
+
* carries `{{count}}` is given as itself or as the language's full set of
|
|
60
|
+
* forms. Every other key keeps English's placeholders. */
|
|
61
|
+
export declare function compareLocaleFiles(language: string, en: Readonly<Record<string, string>>, other: Readonly<Record<string, string>>): LocaleFileComparison;
|
|
62
|
+
/** How many keys a language is asked for (M33 K37): English's keys, with
|
|
63
|
+
* each plural group counted as the language's own forms. */
|
|
64
|
+
export declare function localeKeysAsked(language: string, en: Readonly<Record<string, string>>): number;
|
|
47
65
|
/** The docs language of a plugin whose manifest names none. */
|
|
48
66
|
export declare const DEFAULT_DOCS_LANGUAGE = "en";
|
|
49
67
|
/** The longest docsLanguage a manifest may declare. */
|
|
@@ -78,5 +96,11 @@ export type PluginLanguages = z.infer<typeof PluginLanguagesSchema>;
|
|
|
78
96
|
* screens' words show English. A code is taken under DocsLanguageSchema's
|
|
79
97
|
* rule (a language code of at most 35 characters, the longest a locale
|
|
80
98
|
* file's name can carry), and one a file already lists, in any case, is not
|
|
81
|
-
* listed twice.
|
|
82
|
-
|
|
99
|
+
* listed twice.
|
|
100
|
+
*
|
|
101
|
+
* Evidence 149: `wordsInLabels` are the label languages that hold all of a
|
|
102
|
+
* plugin's words, which the caller gives only for a plugin without screens
|
|
103
|
+
* (no view-bearing contribution): the languages every label map carries.
|
|
104
|
+
* Such a language with no locale file is complete, as `kardalum plugin
|
|
105
|
+
* validate` asks it for none. A language a file lists is judged by the file. */
|
|
106
|
+
export declare function summarizePluginLanguages(bundles: ReadonlyMap<string, PluginLocaleFile>, docs: string, labelLanguages?: ReadonlyArray<string>, wordsInLabels?: ReadonlyArray<string>): PluginLanguages;
|