@kardalum/plugin-sdk 0.19.0 → 0.21.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 +281 -0
- package/README.md +19 -0
- package/dist/admin-section-registry.d.ts +48 -1
- package/dist/admin-section-registry.js +90 -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 +101 -4
- package/dist/cli.d.ts +66 -0
- package/dist/cli.js +22 -0
- package/dist/consent-entry.d.ts +11 -0
- package/dist/consent-entry.js +18 -0
- package/dist/content-library.d.ts +102 -0
- package/dist/content-library.js +15 -0
- package/dist/content-list-extensions.d.ts +50 -0
- package/dist/content-list-extensions.js +11 -0
- package/dist/content-picker/page-picker-sheet.d.ts +15 -0
- package/dist/content-picker/page-picker-sheet.js +105 -0
- package/dist/content-picker/page-picker.d.ts +18 -0
- package/dist/content-picker/page-picker.js +20 -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 +147 -1
- package/dist/datatypes-entry.d.ts +1 -0
- package/dist/datatypes-entry.js +2 -0
- 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 +53 -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 +7 -1
- package/dist/host-entry.js +14 -1
- package/dist/index.d.ts +67 -7
- package/dist/index.js +94 -6
- package/dist/mail.d.ts +34 -0
- package/dist/mail.js +1 -0
- package/dist/manifest-entry.d.ts +47 -4
- package/dist/manifest-entry.js +63 -2
- package/dist/manifest-schema.d.ts +993 -40
- package/dist/manifest-schema.js +516 -26
- package/dist/manifest.d.ts +1186 -62
- package/dist/manifest.js +8 -4
- 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 +52 -0
- package/dist/plugin-context.js +27 -0
- package/dist/plugin-permissions.d.ts +18 -0
- package/dist/plugin-permissions.js +25 -0
- package/dist/plugin-screen-context.d.ts +262 -9
- package/dist/plugin-screen-context.js +56 -0
- package/dist/providers.d.ts +313 -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/render-page.d.ts +15 -0
- package/dist/render-page.js +20 -0
- package/dist/richtext/block-panel.d.ts +12 -1
- package/dist/richtext/block-panel.js +36 -25
- package/dist/richtext/button-view.d.ts +11 -0
- package/dist/richtext/button-view.js +45 -0
- package/dist/richtext/content-guard.d.ts +4 -0
- package/dist/richtext/content-guard.js +27 -0
- package/dist/richtext/editor-handle.d.ts +34 -0
- package/dist/richtext/editor-handle.js +225 -0
- package/dist/richtext/extensions.d.ts +6 -0
- package/dist/richtext/extensions.js +16 -0
- package/dist/richtext/insert-menu.d.ts +6 -1
- package/dist/richtext/insert-menu.js +45 -22
- package/dist/richtext/item-attributes.d.ts +6 -0
- package/dist/richtext/item-attributes.js +19 -0
- package/dist/richtext/item-panel.d.ts +25 -0
- package/dist/richtext/item-panel.js +118 -0
- package/dist/richtext/item-view.d.ts +58 -0
- package/dist/richtext/item-view.js +172 -0
- package/dist/richtext/mark-form.d.ts +10 -0
- package/dist/richtext/mark-form.js +38 -0
- package/dist/richtext/paste-choice.d.ts +9 -0
- package/dist/richtext/paste-choice.js +13 -0
- package/dist/richtext/plugin-items.d.ts +72 -0
- package/dist/richtext/plugin-items.js +562 -0
- package/dist/richtext/plugin-mark-tooltips.d.ts +5 -0
- package/dist/richtext/plugin-mark-tooltips.js +44 -0
- package/dist/richtext/plugin-toolbar.d.ts +57 -0
- package/dist/richtext/plugin-toolbar.js +186 -0
- package/dist/richtext/rich-item-icons.d.ts +5 -0
- package/dist/richtext/rich-item-icons.js +42 -0
- package/dist/richtext/rich-items.d.ts +42 -0
- package/dist/richtext/rich-items.js +68 -0
- package/dist/richtext/rich-text-view-host.d.ts +24 -0
- package/dist/richtext/rich-text-view-host.js +11 -0
- package/dist/richtext/style-listbox.js +6 -4
- package/dist/richtext/toolbar-button.d.ts +16 -0
- package/dist/richtext/toolbar-button.js +9 -0
- package/dist/richtext/url-paste.d.ts +20 -0
- package/dist/richtext/url-paste.js +82 -0
- package/dist/richtext-html-entry.d.ts +5 -0
- package/dist/richtext-html-entry.js +11 -0
- package/dist/sdk-strings.d.ts +344 -0
- package/dist/sdk-strings.js +411 -0
- package/dist/sealing.d.ts +14 -0
- package/dist/sealing.js +1 -0
- package/dist/service-contract.d.ts +17 -0
- package/dist/service-contract.js +39 -0
- package/dist/services.d.ts +114 -0
- package/dist/services.js +1 -0
- package/dist/simple-storage-value-provider.js +24 -24
- package/dist/structured-storage-types.d.ts +429 -9
- package/dist/tailwind.js +10 -5
- package/dist/template-reads.d.ts +16 -0
- package/dist/template-reads.js +21 -0
- package/dist/testing-entry.d.ts +38 -0
- package/dist/testing-entry.js +173 -0
- package/dist/text-entry.d.ts +1 -0
- package/dist/text-entry.js +7 -0
- package/dist/tokens/system-dark.css +1 -0
- package/dist/tokens/tailwind-theme.css +7 -0
- package/dist/tokens/tokens.css +19 -3
- package/dist/tokens/tokens.json +13 -4
- package/dist/uploads.d.ts +43 -0
- package/dist/uploads.js +1 -0
- package/dist/user-library.d.ts +51 -0
- package/dist/user-library.js +15 -0
- package/dist/view-helpers.d.ts +18 -0
- package/dist/view-helpers.js +64 -0
- 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 +243 -40
- 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.d.ts +2 -0
- package/dist/views/rich-text-view.js +208 -35
- package/dist/views/suggest-key.d.ts +17 -0
- package/dist/views/suggest-key.js +55 -0
- package/dist/views/unreadable-rich-text.d.ts +17 -0
- package/dist/views/unreadable-rich-text.js +40 -0
- package/dist/visitors.d.ts +81 -0
- package/dist/visitors.js +1 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-app-hosts.d.ts +21 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-app-hosts.js +39 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-app-redirects.d.ts +2 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-app-redirects.js +31 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-connections.schema.d.ts +334 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-connections.schema.js +254 -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 +11 -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 +8 -0
- package/node_modules/@kardalum/api-schemas/dist/built-in-editor-ids.js +38 -0
- package/node_modules/@kardalum/api-schemas/dist/capability-detail.d.ts +65 -0
- package/node_modules/@kardalum/api-schemas/dist/capability-detail.js +144 -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 +137 -2
- package/node_modules/@kardalum/api-schemas/dist/content-list.schema.js +178 -2
- 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-reads.schema.d.ts +213 -0
- package/node_modules/@kardalum/api-schemas/dist/content-reads.schema.js +234 -0
- 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/contribution-issues.d.ts +11 -0
- package/node_modules/@kardalum/api-schemas/dist/contribution-issues.js +14 -0
- package/node_modules/@kardalum/api-schemas/dist/core-actions.d.ts +55 -13
- package/node_modules/@kardalum/api-schemas/dist/core-actions.js +22 -10
- 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 +257 -15
- package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +78 -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/experimental-points.d.ts +19 -0
- package/node_modules/@kardalum/api-schemas/dist/experimental-points.js +250 -0
- package/node_modules/@kardalum/api-schemas/dist/form-protection-callers.d.ts +29 -0
- package/node_modules/@kardalum/api-schemas/dist/form-protection-callers.js +31 -0
- 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/html-scan.d.ts +22 -0
- package/node_modules/@kardalum/api-schemas/dist/html-scan.js +122 -0
- package/node_modules/@kardalum/api-schemas/dist/html-start-tags.d.ts +48 -0
- package/node_modules/@kardalum/api-schemas/dist/html-start-tags.js +381 -0
- package/node_modules/@kardalum/api-schemas/dist/index.d.ts +162 -48
- package/node_modules/@kardalum/api-schemas/dist/index.js +137 -30
- 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/json-depth.d.ts +3 -0
- package/node_modules/@kardalum/api-schemas/dist/json-depth.js +20 -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 +226 -0
- package/node_modules/@kardalum/api-schemas/dist/mail-rules.js +409 -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 +490 -10
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +53 -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 +38 -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 +5 -0
- package/node_modules/@kardalum/api-schemas/dist/media.schema.js +8 -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 +60 -0
- package/node_modules/@kardalum/api-schemas/dist/nested-validation.js +333 -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/page-audience.schema.d.ts +87 -0
- package/node_modules/@kardalum/api-schemas/dist/page-audience.schema.js +44 -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-admin-slots.d.ts +11 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-admin-slots.js +61 -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 +44 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-content-access.js +84 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-content-slots.d.ts +136 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-content-slots.js +254 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-contract-checks.d.ts +22 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-contract-checks.js +66 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-contract-document.d.ts +130 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-contract-document.js +173 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-contract-fetch.d.ts +16 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-contract-fetch.js +112 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-contract-schema.d.ts +70 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-contract-schema.js +380 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-contract-types.d.ts +3 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-contract-types.js +68 -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 +44 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs.d.ts +44 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs.js +16 -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 +34 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-durable-hooks.js +102 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-editor-extensions.d.ts +43 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-editor-extensions.js +126 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-events.d.ts +24 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-events.js +53 -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-guards.d.ts +112 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-guards.js +118 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-held-embeds.d.ts +119 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-held-embeds.js +216 -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 +46 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.js +41 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-install.d.ts +304 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-install.js +220 -6
- package/node_modules/@kardalum/api-schemas/dist/plugin-kept-parts.d.ts +138 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-kept-parts.js +110 -0
- 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 +408 -14
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +307 -23
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.d.ts +23 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.js +61 -3
- 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 +23 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.js +37 -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 +346 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-providers.js +461 -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-rich-text.d.ts +638 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-rich-text.js +533 -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-service-call.d.ts +36 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-service-call.js +32 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-service-connections.d.ts +193 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-service-connections.js +123 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-service-declarations.d.ts +209 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-service-declarations.js +372 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-services.d.ts +90 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-services.js +204 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-settings.d.ts +352 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-settings.js +409 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-site-extensions.d.ts +347 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-site-extensions.js +976 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-site-requests.d.ts +69 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-site-requests.js +149 -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-styles.d.ts +5 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-styles.js +13 -0
- 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/plugin-uploads.d.ts +96 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-uploads.js +185 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-user-accounts.d.ts +213 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-user-accounts.js +131 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-view-kit.d.ts +54 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-view-kit.js +154 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-visitor-points.d.ts +37 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-visitor-points.js +124 -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-cache.d.ts +126 -0
- package/node_modules/@kardalum/api-schemas/dist/render-cache.js +263 -0
- package/node_modules/@kardalum/api-schemas/dist/render-editing.d.ts +307 -4
- package/node_modules/@kardalum/api-schemas/dist/render-editing.js +61 -0
- package/node_modules/@kardalum/api-schemas/dist/revenue-view.schema.js +7 -3
- package/node_modules/@kardalum/api-schemas/dist/rich-text-paste-hosts.d.ts +14 -0
- package/node_modules/@kardalum/api-schemas/dist/rich-text-paste-hosts.js +108 -0
- package/node_modules/@kardalum/api-schemas/dist/rich-text-shape.d.ts +71 -0
- package/node_modules/@kardalum/api-schemas/dist/rich-text-shape.js +540 -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 +394 -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 +201 -1
- package/node_modules/@kardalum/api-schemas/dist/sandbox-attach.schema.js +36 -0
- package/node_modules/@kardalum/api-schemas/dist/security-overview.schema.d.ts +64 -0
- package/node_modules/@kardalum/api-schemas/dist/security-overview.schema.js +38 -0
- package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.d.ts +97 -8
- package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.js +64 -1
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +136 -0
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.js +53 -2
- package/node_modules/@kardalum/api-schemas/dist/sign-in-steps.d.ts +724 -0
- package/node_modules/@kardalum/api-schemas/dist/sign-in-steps.js +408 -0
- package/node_modules/@kardalum/api-schemas/dist/sign-in.schema.d.ts +386 -0
- package/node_modules/@kardalum/api-schemas/dist/sign-in.schema.js +618 -0
- package/node_modules/@kardalum/api-schemas/dist/site-consent.d.ts +77 -0
- package/node_modules/@kardalum/api-schemas/dist/site-consent.js +122 -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 +70 -0
- package/node_modules/@kardalum/api-schemas/dist/structured-fields.schema.js +188 -0
- package/node_modules/@kardalum/api-schemas/dist/template-api.schema.d.ts +33 -0
- package/node_modules/@kardalum/api-schemas/dist/template-api.schema.js +26 -1
- package/node_modules/@kardalum/api-schemas/dist/template.schema.d.ts +1 -0
- package/node_modules/@kardalum/api-schemas/dist/template.schema.js +3 -0
- package/node_modules/@kardalum/api-schemas/dist/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 +72 -1
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +36 -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/dist/visitor-accounts.d.ts +482 -0
- package/node_modules/@kardalum/api-schemas/dist/visitor-accounts.js +380 -0
- package/node_modules/@kardalum/api-schemas/dist/visitor-groups.d.ts +109 -0
- package/node_modules/@kardalum/api-schemas/dist/visitor-groups.js +62 -0
- package/node_modules/@kardalum/api-schemas/package.json +2 -0
- package/node_modules/@kardalum/design-tokens/dist/build-css.js +15 -1
- package/node_modules/@kardalum/design-tokens/dist/system-dark.css +1 -0
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.css +7 -0
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.d.ts +2 -1
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.js +2 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.css +19 -3
- package/node_modules/@kardalum/design-tokens/dist/tokens.d.ts +1 -1
- package/node_modules/@kardalum/design-tokens/dist/tokens.js +18 -3
- package/node_modules/@kardalum/design-tokens/dist/tokens.json +13 -4
- package/node_modules/@kardalum/design-tokens/dist/types.d.ts +5 -1
- package/node_modules/@kardalum/plugin-package/dist/build-reference.d.ts +38 -2
- package/node_modules/@kardalum/plugin-package/dist/build-reference.js +17 -2
- package/node_modules/@kardalum/plugin-package/dist/capabilities.d.ts +17 -10
- package/node_modules/@kardalum/plugin-package/dist/capabilities.js +625 -35
- package/node_modules/@kardalum/plugin-package/dist/client-bundle.d.ts +1 -1
- package/node_modules/@kardalum/plugin-package/dist/client-bundle.js +25 -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/contract-fingerprint.d.ts +17 -0
- package/node_modules/@kardalum/plugin-package/dist/contract-fingerprint.js +39 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/admin-styles.d.ts +23 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/admin-styles.js +351 -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/bundle.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/bundle.js +1 -1
- 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 +47 -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 +40 -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/icons.js +3 -2
- package/node_modules/@kardalum/plugin-package/dist/delivery/index.d.ts +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/index.js +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/label-languages.js +76 -6
- 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 +99 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/limits.d.ts +6 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/limits.js +6 -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 +5 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/providers.js +316 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/registry.js +40 -4
- package/node_modules/@kardalum/plugin-package/dist/delivery/rich-text.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/rich-text.js +173 -0
- 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 +150 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/services-events.d.ts +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/services-events.js +35 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/sign-in-steps.d.ts +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/sign-in-steps.js +71 -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 +69 -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 +17 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/user-accounts.d.ts +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/user-accounts.js +36 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/visitor-points.d.ts +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/visitor-points.js +33 -0
- package/node_modules/@kardalum/plugin-package/dist/index.d.ts +8 -2
- package/node_modules/@kardalum/plugin-package/dist/index.js +7 -1
- package/node_modules/@kardalum/plugin-package/dist/license-verdict.d.ts +75 -0
- package/node_modules/@kardalum/plugin-package/dist/license-verdict.js +123 -0
- package/node_modules/@kardalum/plugin-package/dist/public-suffix.d.ts +7 -0
- package/node_modules/@kardalum/plugin-package/dist/public-suffix.js +23 -0
- package/node_modules/@kardalum/plugin-package/dist/rich-text-summary.d.ts +1 -0
- package/node_modules/@kardalum/plugin-package/dist/rich-text-summary.js +27 -0
- package/node_modules/@kardalum/plugin-package/dist/stylesheet-load-hook.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/stylesheet-load-hook.js +28 -0
- package/node_modules/@kardalum/plugin-package/package.json +4 -0
- package/node_modules/@kardalum/ui/dist/components/select.d.ts +6 -0
- package/node_modules/@kardalum/ui/dist/components/select.js +7 -0
- package/node_modules/@kardalum/ui/dist/components/switch.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/textarea.d.ts +6 -0
- package/node_modules/@kardalum/ui/dist/components/textarea.js +7 -0
- 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/node_modules/@kardalum/ui/dist/index.d.ts +2 -0
- package/node_modules/@kardalum/ui/dist/index.js +2 -0
- package/package.json +25 -3
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
import type { MailPurpose, PluginLabel, PluginSettingValue, ProtectionTellWord, SignInClientAuth, SignInIcon, SignInProtocol, SignInStepAnswerInput, SignInStepChallenge, SignInStepKind, SignInStepPerson, SignInStepStatus, SignInStepVerdict } from "@kardalum/api-schemas";
|
|
2
|
+
import type { Entitlement } from "./entitlement-types.js";
|
|
3
|
+
import type { ScopedStructuredStorage } from "./structured-storage-types.js";
|
|
4
|
+
import type { PluginSealing } from "./sealing.js";
|
|
5
|
+
export type { SignInIcon, SignInStepAnswerInput, SignInStepChallenge, SignInStepKind, SignInStepPerson, SignInStepStatus, SignInStepVerdict } from "@kardalum/api-schemas";
|
|
6
|
+
/** D12: what `context.secrets` offers plugin server code. Only a declared name is readable. */
|
|
7
|
+
export interface PluginSecrets {
|
|
8
|
+
/** The stored value, or null when the person has not entered it (or it can no longer be decrypted). An undeclared name throws PluginSecretUndeclaredError. */
|
|
9
|
+
get(name: string): Promise<string | null>;
|
|
10
|
+
}
|
|
11
|
+
/** D12: thrown by `context.secrets.get` for a name the manifest does not declare. */
|
|
12
|
+
export declare class PluginSecretUndeclaredError extends Error {
|
|
13
|
+
constructor(message: string);
|
|
14
|
+
}
|
|
15
|
+
/** True for a PluginSecretUndeclaredError from ANY copy of this SDK: a plugin bundles its own copy, so `instanceof` would miss the host's class. */
|
|
16
|
+
export declare function isPluginSecretUndeclaredError(value: unknown): value is PluginSecretUndeclaredError;
|
|
17
|
+
/**
|
|
18
|
+
* M32 F4d (D7): what `context.settings` offers plugin server code: the values a person set for the
|
|
19
|
+
* plugin's declared settings fields, each its default until set. A secret field is read with
|
|
20
|
+
* `context.secrets.get`, never here.
|
|
21
|
+
*/
|
|
22
|
+
export interface PluginSettingsReader {
|
|
23
|
+
/** One field's value (or its default). An undeclared id or a secret field's id throws PluginSettingUndeclaredError; a failed read throws PluginSettingsUnavailableError. */
|
|
24
|
+
get(id: string): Promise<PluginSettingValue>;
|
|
25
|
+
/** Every declared non-secret field's value, as a frozen copy: changing it changes nothing stored. A failed read throws PluginSettingsUnavailableError. */
|
|
26
|
+
all(): Promise<Readonly<Record<string, PluginSettingValue>>>;
|
|
27
|
+
}
|
|
28
|
+
/** M32 F4d (D7): thrown by `context.settings.get` for an id the manifest does not declare, or a secret field's id. */
|
|
29
|
+
export declare class PluginSettingUndeclaredError extends Error {
|
|
30
|
+
readonly settingId: string;
|
|
31
|
+
constructor(message: string, settingId: string);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* M32 F4d (D7): thrown by `context.settings.get` and `all` when the host could not read the stored
|
|
35
|
+
* values. Never answered as the defaults: a plugin cannot tell a default from a value a person set.
|
|
36
|
+
*/
|
|
37
|
+
export declare class PluginSettingsUnavailableError extends Error {
|
|
38
|
+
constructor(message: string);
|
|
39
|
+
}
|
|
40
|
+
/** M33 K30: thrown by `context.simpleStorage` (and the host's other doors to a plugin's storage) for a
|
|
41
|
+
* plugin that is installed but switched off. */
|
|
42
|
+
export declare class PluginNotActiveError extends Error {
|
|
43
|
+
constructor(message: string);
|
|
44
|
+
}
|
|
45
|
+
/** True for a PluginNotActiveError from ANY copy of this SDK (a plugin bundles its own copy). */
|
|
46
|
+
export declare function isPluginNotActiveError(value: unknown): value is PluginNotActiveError;
|
|
47
|
+
/** M33 K30: thrown by a write (`context.simpleStorage.set`, a structured write) of a plugin whose
|
|
48
|
+
* licence term lapsed or was refunded: the plugin is read-only, and its reads still answer. */
|
|
49
|
+
export declare class PluginReadOnlyError extends Error {
|
|
50
|
+
constructor(message: string);
|
|
51
|
+
}
|
|
52
|
+
/** True for a PluginReadOnlyError from ANY copy of this SDK (a plugin bundles its own copy). */
|
|
53
|
+
export declare function isPluginReadOnlyError(value: unknown): value is PluginReadOnlyError;
|
|
54
|
+
/** M33 K30: thrown by `context.simpleStorage` on an admin or API key route when the person (or key)
|
|
55
|
+
* calling may not read the page (`get`) or edit it (`set`), as the HTTP storage door decides. */
|
|
56
|
+
export declare class PluginPageAccessError extends Error {
|
|
57
|
+
constructor(message: string);
|
|
58
|
+
}
|
|
59
|
+
/** True for a PluginPageAccessError from ANY copy of this SDK (a plugin bundles its own copy). */
|
|
60
|
+
export declare function isPluginPageAccessError(value: unknown): value is PluginPageAccessError;
|
|
61
|
+
/** True for a PluginSettingsUnavailableError from ANY copy of this SDK (a plugin bundles its own copy). */
|
|
62
|
+
export declare function isPluginSettingsUnavailableError(value: unknown): value is PluginSettingsUnavailableError;
|
|
63
|
+
/** True for a PluginSettingUndeclaredError from ANY copy of this SDK (a plugin bundles its own copy). */
|
|
64
|
+
export declare function isPluginSettingUndeclaredError(value: unknown): value is PluginSettingUndeclaredError;
|
|
65
|
+
/** D7: the context every provider function gets, built per call. */
|
|
66
|
+
export interface ProviderContext {
|
|
67
|
+
structuredStorage: ScopedStructuredStorage;
|
|
68
|
+
entitlement: Entitlement;
|
|
69
|
+
readOnly: boolean;
|
|
70
|
+
secrets: PluginSecrets;
|
|
71
|
+
/** M32 F4d (D7): the plugin's settings values. */
|
|
72
|
+
settings: PluginSettingsReader;
|
|
73
|
+
log: {
|
|
74
|
+
info(msg: string): void;
|
|
75
|
+
warn(msg: string): void;
|
|
76
|
+
};
|
|
77
|
+
/** M33 K17 (consolidation 3.2): seals values the plugin makes under a key of its own for each declared kind.
|
|
78
|
+
* Present only for a plugin that declares `sealedValues`. */
|
|
79
|
+
sealing?: PluginSealing;
|
|
80
|
+
}
|
|
81
|
+
/** D10: one secret the plugin keeps for a person to enter in the admin. */
|
|
82
|
+
export interface SecretDeclaration {
|
|
83
|
+
name: string;
|
|
84
|
+
label: PluginLabel;
|
|
85
|
+
description?: PluginLabel;
|
|
86
|
+
}
|
|
87
|
+
/** D15, D16: a form protection provider, run after the built-in checks of `context.protect`. */
|
|
88
|
+
export interface ProtectionProviderContribution {
|
|
89
|
+
id: string;
|
|
90
|
+
label: PluginLabel;
|
|
91
|
+
description?: PluginLabel;
|
|
92
|
+
/** The provider's form field prefix: `verify` gets the posted fields under it. */
|
|
93
|
+
fieldPrefix: string;
|
|
94
|
+
verify(input: {
|
|
95
|
+
fields: Record<string, string>;
|
|
96
|
+
ip: string;
|
|
97
|
+
formPlugin: string;
|
|
98
|
+
}, context: ProviderContext): Promise<{
|
|
99
|
+
ok: true;
|
|
100
|
+
} | {
|
|
101
|
+
ok: false;
|
|
102
|
+
reason: string;
|
|
103
|
+
tell?: ProtectionTellWord;
|
|
104
|
+
}>;
|
|
105
|
+
/** The widget the form shows: a class and `data-*` attributes for a `<div>`, never markup, and
|
|
106
|
+
* (M33 K50) a visible sentence for a visitor whose browser does not run the widget's script.
|
|
107
|
+
* Synchronous: a promise is a malformed answer. M33 K50: it gets the render's context; a widget
|
|
108
|
+
* written without the parameter keeps working. */
|
|
109
|
+
widget?(context: ProtectionWidgetContext): ProtectionWidgetAnswer;
|
|
110
|
+
/** M33 K51: a `.js` file in the plugin's own `public/` folder (`"captcha.js"`). `{% form_protection %}`
|
|
111
|
+
* writes it as `<script src defer>` once a render, right after the first widget, only on a page
|
|
112
|
+
* render and only when the widget wrote its `<div>`. */
|
|
113
|
+
widgetScript?: string;
|
|
114
|
+
}
|
|
115
|
+
/** M33 K50: what a protection provider's `widget` gets, built once a render before the call. */
|
|
116
|
+
export type ProtectionWidgetContext = Readonly<{
|
|
117
|
+
/** The render's language, or null when there is none. */
|
|
118
|
+
culture: string | null;
|
|
119
|
+
/** The plugin's non-secret settings values, read once before the call; `{}` when that read failed.
|
|
120
|
+
* A plain record: `widget` is synchronous and cannot wait for the settings reader. */
|
|
121
|
+
settingsValues: Readonly<Record<string, PluginSettingValue>>;
|
|
122
|
+
/** The address of the plugin's own `public/` folder at its installed version,
|
|
123
|
+
* `/plugin-assets/<id>/<version>/public/`, with the closing slash. */
|
|
124
|
+
assetBase: string;
|
|
125
|
+
/** The built-in check's live minimum time in seconds: a send before it is refused, so a script never sends earlier. */
|
|
126
|
+
minSeconds: number;
|
|
127
|
+
}>;
|
|
128
|
+
/** D16, M33 K50: a protection widget's answer. */
|
|
129
|
+
export interface ProtectionWidgetAnswer {
|
|
130
|
+
/** One CSS class name for the widget's `<div>`. */
|
|
131
|
+
class?: string;
|
|
132
|
+
/** At most 10 `data-*` attributes for the `<div>`. */
|
|
133
|
+
data?: Record<string, string>;
|
|
134
|
+
/** M33 K50: 1 to 300 characters, not blank, no control, direction or other hidden character, written
|
|
135
|
+
* escaped and visible as the `<div>`'s only child, `<p data-protection-fallback>`, on a page render. The widget's script removes it. An
|
|
136
|
+
* invalid one is left out and logged; the rest of the answer is kept. */
|
|
137
|
+
fallbackText?: string;
|
|
138
|
+
}
|
|
139
|
+
/** D19: a published page as a search provider receives it. */
|
|
140
|
+
export interface SearchDocument {
|
|
141
|
+
id: string;
|
|
142
|
+
path: string;
|
|
143
|
+
documentTypeId: string;
|
|
144
|
+
documentType: string;
|
|
145
|
+
name: string;
|
|
146
|
+
fields: Record<string, unknown>;
|
|
147
|
+
cultures: Record<string, unknown>;
|
|
148
|
+
publishedAt: string;
|
|
149
|
+
updatedAt: string;
|
|
150
|
+
}
|
|
151
|
+
/** D19: a search provider answers the delivery API's `?q=` search. */
|
|
152
|
+
export interface SearchProviderContribution {
|
|
153
|
+
id: string;
|
|
154
|
+
label: PluginLabel;
|
|
155
|
+
description?: PluginLabel;
|
|
156
|
+
index(documents: SearchDocument[], context: ProviderContext): Promise<void>;
|
|
157
|
+
remove(ids: string[], context: ProviderContext): Promise<void>;
|
|
158
|
+
query(input: {
|
|
159
|
+
text: string;
|
|
160
|
+
documentTypeId?: string;
|
|
161
|
+
under?: string;
|
|
162
|
+
cursor?: string;
|
|
163
|
+
limit: number;
|
|
164
|
+
}, context: ProviderContext): Promise<{
|
|
165
|
+
ids: string[];
|
|
166
|
+
nextCursor: string | null;
|
|
167
|
+
}>;
|
|
168
|
+
clear?(context: ProviderContext): Promise<void>;
|
|
169
|
+
}
|
|
170
|
+
/** D25: a media store keeps the uploaded files. */
|
|
171
|
+
export interface MediaStoreContribution {
|
|
172
|
+
id: string;
|
|
173
|
+
label: PluginLabel;
|
|
174
|
+
description?: PluginLabel;
|
|
175
|
+
put(key: string, data: Uint8Array, mimeType: string, context: ProviderContext): Promise<void>;
|
|
176
|
+
/** Null when the key is missing. */
|
|
177
|
+
open(key: string, context: ProviderContext): Promise<{
|
|
178
|
+
data: Uint8Array | AsyncIterable<Uint8Array>;
|
|
179
|
+
size?: number;
|
|
180
|
+
} | null>;
|
|
181
|
+
delete(key: string, context: ProviderContext): Promise<void>;
|
|
182
|
+
exists(key: string, context: ProviderContext): Promise<boolean>;
|
|
183
|
+
ready?(context: ProviderContext): Promise<void>;
|
|
184
|
+
/** M32 F4e (E1): the https address public files are served from, or null for none. */
|
|
185
|
+
publicBaseUrl?(context: ProviderContext): Promise<string | null>;
|
|
186
|
+
}
|
|
187
|
+
/** M32 H (H1): one email a mail sender is asked to deliver. `purpose` says what it is for; the text is plain. */
|
|
188
|
+
export interface OutgoingMail {
|
|
189
|
+
purpose: MailPurpose;
|
|
190
|
+
to: string;
|
|
191
|
+
from: {
|
|
192
|
+
address: string;
|
|
193
|
+
name: string;
|
|
194
|
+
};
|
|
195
|
+
subject: string;
|
|
196
|
+
text: string;
|
|
197
|
+
/** M33 K11: where replies go, a checked address; only a plugin's email (`pluginMail`) may carry one. */
|
|
198
|
+
replyTo?: string;
|
|
199
|
+
}
|
|
200
|
+
/** M32 H (H1): `permanent` is true when trying again cannot help (a refused address); false for a failure that may pass. */
|
|
201
|
+
export type MailSendResult = {
|
|
202
|
+
ok: true;
|
|
203
|
+
} | {
|
|
204
|
+
ok: false;
|
|
205
|
+
permanent: boolean;
|
|
206
|
+
};
|
|
207
|
+
/** M32 H (H1, H2): a mail sender, chosen instead of the built-in SMTP one. It sends every email the site sends. */
|
|
208
|
+
export interface MailSenderContribution {
|
|
209
|
+
id: string;
|
|
210
|
+
label: PluginLabel;
|
|
211
|
+
description?: PluginLabel;
|
|
212
|
+
send(mail: OutgoingMail, context: ProviderContext): Promise<MailSendResult>;
|
|
213
|
+
/** True when the sender can send now; absent means always ready. */
|
|
214
|
+
ready?(context: ProviderContext): Promise<boolean>;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* @experimental M35 P5 (W37): a consent tool the site owner may choose in Server settings, Providers. While chosen, the
|
|
218
|
+
* core writes its stylesheet and its script (`<script src defer>`) in the head of every public page, right after the
|
|
219
|
+
* core's consent loader, so the script finds `window.kardalum.consent` (`KardalumConsentApi`). The script shows the
|
|
220
|
+
* banner, calls `set` and `reset`, and opens its settings on the `kardalum:consentopen` event. Only the chosen tool calls
|
|
221
|
+
* `set` and `reset`. Derives `provider.consent`, a promised capability.
|
|
222
|
+
*/
|
|
223
|
+
export interface ConsentToolContribution {
|
|
224
|
+
id: string;
|
|
225
|
+
label: PluginLabel;
|
|
226
|
+
description?: PluginLabel;
|
|
227
|
+
/** A `.js` file in the plugin's own `public/` folder, such as "consent.js". */
|
|
228
|
+
script: string;
|
|
229
|
+
/** A `.css` file in the plugin's own `public/` folder. */
|
|
230
|
+
stylesheet?: string;
|
|
231
|
+
}
|
|
232
|
+
/** M32 F4b (D33): who a person is, as an oauth2 provider's `profile` reads the userinfo answers. */
|
|
233
|
+
export interface SignInProfile {
|
|
234
|
+
/** The provider's stable id for the person, 1 to 255 characters. */
|
|
235
|
+
subject: string;
|
|
236
|
+
email?: string;
|
|
237
|
+
/** True only when the provider vouches the email belongs to the person. */
|
|
238
|
+
emailVerified: boolean;
|
|
239
|
+
name?: string;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* M32 F4b (D33, D48): a sign-in provider the admin's login page offers. The plugin describes the
|
|
243
|
+
* provider; the core runs the protocol (PKCE, state and nonce), so the plugin never receives an
|
|
244
|
+
* authorization code, a token, a cookie or the request. The rules are api-schemas'
|
|
245
|
+
* (`signInDeclarationProblems`), checked by `kardalum plugin validate` and the marketplace as
|
|
246
|
+
* `Providers and secrets`.
|
|
247
|
+
*/
|
|
248
|
+
export interface SignInProviderContribution {
|
|
249
|
+
id: string;
|
|
250
|
+
label: PluginLabel;
|
|
251
|
+
/** M33 K56: the line shown under the button on the login page, on its card and in the Connect dialog:
|
|
252
|
+
* at most 160 characters per language (`SIGN_IN_DESCRIPTION_MAX`), with no control or direction character. */
|
|
253
|
+
description?: PluginLabel;
|
|
254
|
+
/** The icon the login page draws beside the label; "key" when absent, and in place of `mark` when the picture cannot load. */
|
|
255
|
+
icon?: SignInIcon;
|
|
256
|
+
/** M33 K57: the file name of a PNG in the plugin's `public/` folder, drawn at the button's inline start: 5 to 64
|
|
257
|
+
* lower-case letters, digits and "-" ending in ".png", square, 16 to 128 pixels a side, at most 8,192 bytes. */
|
|
258
|
+
mark?: string;
|
|
259
|
+
/** M33 K58, oidc only: the name of the ID token claim (else userinfo's) that names the organisation's domain, such as
|
|
260
|
+
* Google's "hd". New accounts and connection by email then need that domain in the allowed list. */
|
|
261
|
+
hostedDomainClaim?: string;
|
|
262
|
+
protocol: SignInProtocol;
|
|
263
|
+
/** oidc: a fixed issuer address (a known service). Exactly one of `issuer` and `issuerSecret`. */
|
|
264
|
+
issuer?: string;
|
|
265
|
+
/** oidc: the name of a declared secret holding the issuer address (a company login). */
|
|
266
|
+
issuerSecret?: string;
|
|
267
|
+
/** oauth2: the authorization endpoint. */
|
|
268
|
+
authorizationUrl?: string;
|
|
269
|
+
/** oauth2: the token endpoint. */
|
|
270
|
+
tokenUrl?: string;
|
|
271
|
+
/** oauth2: 1 or 2 addresses the core reads with the access token, in order, for `profile`. */
|
|
272
|
+
userInfoUrls?: string[];
|
|
273
|
+
/** How the client secret is sent to the token endpoint; "basic" when absent. */
|
|
274
|
+
clientAuth?: SignInClientAuth;
|
|
275
|
+
scopes: string[];
|
|
276
|
+
/** The name of a declared secret holding the client id. */
|
|
277
|
+
clientIdSecret: string;
|
|
278
|
+
/** The name of a declared secret holding the client secret. */
|
|
279
|
+
clientSecretSecret: string;
|
|
280
|
+
/** oauth2 only: maps the userinfo answers the core read with the access token. Never receives a token. */
|
|
281
|
+
profile?(input: {
|
|
282
|
+
responses: unknown[];
|
|
283
|
+
}, context: ProviderContext): Promise<SignInProfile>;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* M35 U3a (experimental): a step in the admin sign-in, asked after the password or a sign-in provider and
|
|
287
|
+
* before the session exists. A factor proves the person a second time; it is offered only to people who set
|
|
288
|
+
* it up (35-U3a). The core decides when a step applies, draws it from your answer's parts (data, never
|
|
289
|
+
* markup), checks every answer against what you asked before calling `verify`, and keeps your `state`
|
|
290
|
+
* sealed. You never learn the email, the name, the password, a token, a cookie or the request.
|
|
291
|
+
* Unions may widen (an audience, a sign-in method, a kind, a part): treat an input you do not know as not
|
|
292
|
+
* yours and answer `notSetUp`. Keep a factor's secret sealed with `context.sealing` in your structured
|
|
293
|
+
* storage; never in an account field. After a `JWT_SECRET` change, answer `setUp` for any record you hold.
|
|
294
|
+
*/
|
|
295
|
+
export interface SignInStepContribution {
|
|
296
|
+
/** The provider id rule, 1 to 40. */
|
|
297
|
+
id: string;
|
|
298
|
+
/** On the step page's heading, the Steps card and Sign-in methods. */
|
|
299
|
+
label: PluginLabel;
|
|
300
|
+
/** One line for the owner and the person, at most 160 characters a language. */
|
|
301
|
+
description?: PluginLabel;
|
|
302
|
+
kind: SignInStepKind;
|
|
303
|
+
status(input: SignInStepPerson, context: ProviderContext): Promise<SignInStepStatus>;
|
|
304
|
+
/** Factor: required. Called once per pending sign-in; may send a message. */
|
|
305
|
+
challenge?(input: SignInStepPerson, context: ProviderContext): Promise<SignInStepChallenge>;
|
|
306
|
+
verify?(input: SignInStepPerson & SignInStepAnswerInput, context: ProviderContext): Promise<SignInStepVerdict>;
|
|
307
|
+
/** Factor: required. A setup's challenge may carry `setupKey` and `keepCodes`. */
|
|
308
|
+
setupBegin?(input: SignInStepPerson, context: ProviderContext): Promise<SignInStepChallenge>;
|
|
309
|
+
setupFinish?(input: SignInStepPerson & SignInStepAnswerInput, context: ProviderContext): Promise<SignInStepVerdict>;
|
|
310
|
+
setupRemove?(input: {
|
|
311
|
+
userId: string;
|
|
312
|
+
}, context: ProviderContext): Promise<void>;
|
|
313
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/** D12: thrown by `context.secrets.get` for a name the manifest does not declare. */
|
|
2
|
+
export class PluginSecretUndeclaredError extends Error {
|
|
3
|
+
constructor(message) {
|
|
4
|
+
super(message);
|
|
5
|
+
this.name = "PluginSecretUndeclaredError";
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
/** True for a PluginSecretUndeclaredError from ANY copy of this SDK: a plugin bundles its own copy, so `instanceof` would miss the host's class. */
|
|
9
|
+
export function isPluginSecretUndeclaredError(value) {
|
|
10
|
+
return value instanceof Error && value.name === "PluginSecretUndeclaredError";
|
|
11
|
+
}
|
|
12
|
+
/** M32 F4d (D7): thrown by `context.settings.get` for an id the manifest does not declare, or a secret field's id. */
|
|
13
|
+
export class PluginSettingUndeclaredError extends Error {
|
|
14
|
+
settingId;
|
|
15
|
+
constructor(message, settingId) {
|
|
16
|
+
super(message);
|
|
17
|
+
this.settingId = settingId;
|
|
18
|
+
this.name = "PluginSettingUndeclaredError";
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* M32 F4d (D7): thrown by `context.settings.get` and `all` when the host could not read the stored
|
|
23
|
+
* values. Never answered as the defaults: a plugin cannot tell a default from a value a person set.
|
|
24
|
+
*/
|
|
25
|
+
export class PluginSettingsUnavailableError extends Error {
|
|
26
|
+
constructor(message) {
|
|
27
|
+
super(message);
|
|
28
|
+
this.name = "PluginSettingsUnavailableError";
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/** M33 K30: thrown by `context.simpleStorage` (and the host's other doors to a plugin's storage) for a
|
|
32
|
+
* plugin that is installed but switched off. */
|
|
33
|
+
export class PluginNotActiveError extends Error {
|
|
34
|
+
constructor(message) {
|
|
35
|
+
super(message);
|
|
36
|
+
this.name = "PluginNotActiveError";
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/** True for a PluginNotActiveError from ANY copy of this SDK (a plugin bundles its own copy). */
|
|
40
|
+
export function isPluginNotActiveError(value) {
|
|
41
|
+
return value instanceof Error && value.name === "PluginNotActiveError";
|
|
42
|
+
}
|
|
43
|
+
/** M33 K30: thrown by a write (`context.simpleStorage.set`, a structured write) of a plugin whose
|
|
44
|
+
* licence term lapsed or was refunded: the plugin is read-only, and its reads still answer. */
|
|
45
|
+
export class PluginReadOnlyError extends Error {
|
|
46
|
+
constructor(message) {
|
|
47
|
+
super(message);
|
|
48
|
+
this.name = "PluginReadOnlyError";
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/** True for a PluginReadOnlyError from ANY copy of this SDK (a plugin bundles its own copy). */
|
|
52
|
+
export function isPluginReadOnlyError(value) {
|
|
53
|
+
return value instanceof Error && value.name === "PluginReadOnlyError";
|
|
54
|
+
}
|
|
55
|
+
/** M33 K30: thrown by `context.simpleStorage` on an admin or API key route when the person (or key)
|
|
56
|
+
* calling may not read the page (`get`) or edit it (`set`), as the HTTP storage door decides. */
|
|
57
|
+
export class PluginPageAccessError extends Error {
|
|
58
|
+
constructor(message) {
|
|
59
|
+
super(message);
|
|
60
|
+
this.name = "PluginPageAccessError";
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/** True for a PluginPageAccessError from ANY copy of this SDK (a plugin bundles its own copy). */
|
|
64
|
+
export function isPluginPageAccessError(value) {
|
|
65
|
+
return value instanceof Error && value.name === "PluginPageAccessError";
|
|
66
|
+
}
|
|
67
|
+
/** True for a PluginSettingsUnavailableError from ANY copy of this SDK (a plugin bundles its own copy). */
|
|
68
|
+
export function isPluginSettingsUnavailableError(value) {
|
|
69
|
+
return value instanceof Error && value.name === "PluginSettingsUnavailableError";
|
|
70
|
+
}
|
|
71
|
+
/** True for a PluginSettingUndeclaredError from ANY copy of this SDK (a plugin bundles its own copy). */
|
|
72
|
+
export function isPluginSettingUndeclaredError(value) {
|
|
73
|
+
return value instanceof Error && value.name === "PluginSettingUndeclaredError";
|
|
74
|
+
}
|
package/dist/read-all-pages.d.ts
CHANGED
|
@@ -12,6 +12,11 @@ export interface ReadAllPagesOptions {
|
|
|
12
12
|
limit?: number;
|
|
13
13
|
/** The most pages read before the read stops incomplete (default 20). */
|
|
14
14
|
cap?: number;
|
|
15
|
+
/** The sentence a failed read throws, in the caller's words: `status` is the HTTP status, or null for an answer
|
|
16
|
+
* that was not a listing. Without it the sentence is English, "Failed to load <what> (<status>)". */
|
|
17
|
+
failure?: (detail: {
|
|
18
|
+
status: number | null;
|
|
19
|
+
}) => string;
|
|
15
20
|
}
|
|
16
21
|
/**
|
|
17
22
|
* Every page of a cursor-paginated listing, up to the cap. The listings a view reads this way are small, admin-only
|
package/dist/read-all-pages.js
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
export async function readAllPages(fetchApi, path, what, options = {}) {
|
|
9
9
|
const { itemKey = "items", limit = 100, cap = 20 } = options;
|
|
10
|
+
const fail = (status) => new Error(options.failure ? options.failure({ status }) : `Failed to load ${what} (${status ?? "unexpected answer"})`);
|
|
10
11
|
const all = [];
|
|
11
12
|
let cursor = null;
|
|
12
13
|
for (let page = 0; page < cap; page += 1) {
|
|
@@ -16,11 +17,11 @@ export async function readAllPages(fetchApi, path, what, options = {}) {
|
|
|
16
17
|
params.set("cursor", cursor);
|
|
17
18
|
const response = await fetchApi(`${path}?${params.toString()}`);
|
|
18
19
|
if (!response.ok)
|
|
19
|
-
throw
|
|
20
|
+
throw fail(response.status);
|
|
20
21
|
const body = (await response.json());
|
|
21
22
|
const items = body[itemKey];
|
|
22
23
|
if (!Array.isArray(items))
|
|
23
|
-
throw
|
|
24
|
+
throw fail(null);
|
|
24
25
|
all.push(...items);
|
|
25
26
|
cursor = typeof body.nextCursor === "string" ? body.nextCursor : null;
|
|
26
27
|
if (cursor === null)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { RenderPageRefusal } from "@kardalum/api-schemas";
|
|
2
|
+
/**
|
|
3
|
+
* M35 P4 (W53): thrown by `context.renderPage` when the render cannot run: `unavailable` (the server renders no
|
|
4
|
+
* site), `inactive` (the plugin is switched off), `nested` (called while a render runs: a template call or a page
|
|
5
|
+
* transform cannot start another render), `busy` (RENDER_PAGE_RUNNING_PER_PLUGIN_MAX, RENDER_PAGE_RUNNING_MAX or
|
|
6
|
+
* RENDER_PAGE_PER_MINUTE_MAX), `timeout` (RENDER_PAGE_TIME_MS), `tooLarge` (RENDER_PAGE_HTML_MAX_BYTES) or `failed`
|
|
7
|
+
* (the template failed). Test it with isRenderPageRefusedError, never `instanceof`.
|
|
8
|
+
* @experimental
|
|
9
|
+
*/
|
|
10
|
+
export declare class RenderPageRefusedError extends Error {
|
|
11
|
+
readonly reason: RenderPageRefusal;
|
|
12
|
+
constructor(reason: RenderPageRefusal);
|
|
13
|
+
}
|
|
14
|
+
/** True for a RenderPageRefusedError from ANY copy of this SDK (a plugin bundles its own copy). */
|
|
15
|
+
export declare function isRenderPageRefusedError(value: unknown): value is RenderPageRefusedError;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* M35 P4 (W53): thrown by `context.renderPage` when the render cannot run: `unavailable` (the server renders no
|
|
3
|
+
* site), `inactive` (the plugin is switched off), `nested` (called while a render runs: a template call or a page
|
|
4
|
+
* transform cannot start another render), `busy` (RENDER_PAGE_RUNNING_PER_PLUGIN_MAX, RENDER_PAGE_RUNNING_MAX or
|
|
5
|
+
* RENDER_PAGE_PER_MINUTE_MAX), `timeout` (RENDER_PAGE_TIME_MS), `tooLarge` (RENDER_PAGE_HTML_MAX_BYTES) or `failed`
|
|
6
|
+
* (the template failed). Test it with isRenderPageRefusedError, never `instanceof`.
|
|
7
|
+
* @experimental
|
|
8
|
+
*/
|
|
9
|
+
export class RenderPageRefusedError extends Error {
|
|
10
|
+
reason;
|
|
11
|
+
constructor(reason) {
|
|
12
|
+
super(`render page refused: ${reason}`);
|
|
13
|
+
this.name = "RenderPageRefusedError";
|
|
14
|
+
this.reason = reason;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
/** True for a RenderPageRefusedError from ANY copy of this SDK (a plugin bundles its own copy). */
|
|
18
|
+
export function isRenderPageRefusedError(value) {
|
|
19
|
+
return value instanceof Error && value.name === "RenderPageRefusedError";
|
|
20
|
+
}
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import type { Editor } from "@tiptap/react";
|
|
2
|
-
import { type BlockListing } from "./insert-menu.js";
|
|
2
|
+
import { type BlockListing, type BlockParamSpec } from "./insert-menu.js";
|
|
3
|
+
export interface BlockParamFieldProps {
|
|
4
|
+
spec: BlockParamSpec;
|
|
5
|
+
value: unknown;
|
|
6
|
+
onChange: (next: unknown) => void;
|
|
7
|
+
error?: string;
|
|
8
|
+
/** M35 C4a: a text or textarea item attribute's declared max, so the field stops where the save would refuse. */
|
|
9
|
+
maxLength?: number;
|
|
10
|
+
/** M35 C4a: the field id's prefix, so a block's, an item's and a mark's panels open together never share an id. */
|
|
11
|
+
idPrefix?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function BlockParamField({ spec, value, onChange, error, maxLength, idPrefix }: BlockParamFieldProps): import("react").JSX.Element | null;
|
|
3
14
|
export interface BlockParamFieldsProps {
|
|
4
15
|
listing: BlockListing | null;
|
|
5
16
|
listingsError: string | null;
|
|
@@ -3,6 +3,7 @@ import { useEffect, useRef, useState } from "react";
|
|
|
3
3
|
import { Selection } from "@tiptap/pm/state";
|
|
4
4
|
import { Button, Dialog, DialogCloseButton, DialogContent, DialogFooter, DialogHeader, DialogTitle, Input, PropertyField, Switch, TruncatedText, } from "@kardalum/ui";
|
|
5
5
|
import { MANAGE_API, usePluginApi } from "../plugin-context.js";
|
|
6
|
+
import { useSdkString } from "../sdk-strings.js";
|
|
6
7
|
import { MediaPicker } from "../media/media-picker.js";
|
|
7
8
|
import { useBlockListings } from "./insert-menu.js";
|
|
8
9
|
function useMediaParamPreview(mediaId) {
|
|
@@ -40,18 +41,19 @@ function useMediaParamPreview(mediaId) {
|
|
|
40
41
|
}
|
|
41
42
|
// One field per declared param, keyed by its type (S197 Task 3 brief:
|
|
42
43
|
// text/textarea/number/boolean(switch)/image(MediaPicker)/choice(select)).
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
// M35 C4a: exported, so the item panel (item-panel.tsx) draws the six shared types with these same fields. A value
|
|
45
|
+
// is content, so its input takes the content's direction (`dir="auto"`); the label keeps the admin's.
|
|
46
|
+
// The image field is its own component, so only it reads the media API: the
|
|
47
|
+
// other five types draw outside a PluginApiProvider too.
|
|
48
|
+
export function BlockParamField({ spec, value, onChange, error, maxLength, idPrefix = "block-param" }) {
|
|
49
|
+
const fieldId = `${idPrefix}-${spec.key}`;
|
|
48
50
|
switch (spec.type) {
|
|
49
51
|
case "text":
|
|
50
|
-
return (_jsx(PropertyField, { label: spec.label, htmlFor: fieldId, error: error, children: _jsx(Input, { id: fieldId, type: "text", value: value ?? "", onChange: (event) => onChange(event.target.value) }) }));
|
|
52
|
+
return (_jsx(PropertyField, { label: spec.label, htmlFor: fieldId, error: error, children: _jsx(Input, { id: fieldId, type: "text", dir: "auto", maxLength: maxLength, value: value ?? "", onChange: (event) => onChange(event.target.value) }) }));
|
|
51
53
|
case "textarea":
|
|
52
|
-
return (_jsx(PropertyField, { label: spec.label, htmlFor: fieldId, error: error, children: _jsx("textarea", { id: fieldId, rows: 3, value: value ?? "", onChange: (event) => onChange(event.target.value), className: "w-full rounded-md border border-border-strong bg-background-elevated px-3 py-2 text-sm text-text-primary focus-visible:border-primary-600 focus-visible:outline-hidden focus-visible:ring-4 focus-visible:ring-primary-50" }) }));
|
|
54
|
+
return (_jsx(PropertyField, { label: spec.label, htmlFor: fieldId, error: error, children: _jsx("textarea", { id: fieldId, rows: 3, dir: "auto", maxLength: maxLength, value: value ?? "", onChange: (event) => onChange(event.target.value), className: "w-full rounded-md border border-border-strong bg-background-elevated px-3 py-2 text-sm text-text-primary focus-visible:border-primary-600 focus-visible:outline-hidden focus-visible:ring-4 focus-visible:ring-primary-50" }) }));
|
|
53
55
|
case "number":
|
|
54
|
-
return (_jsx(PropertyField, { label: spec.label, htmlFor: fieldId, error: error, children: _jsx(Input, { id: fieldId, type: "number", value: value ?? 0, onChange: (event) => {
|
|
56
|
+
return (_jsx(PropertyField, { label: spec.label, htmlFor: fieldId, error: error, children: _jsx(Input, { id: fieldId, type: "number", dir: "auto", value: value ?? 0, onChange: (event) => {
|
|
55
57
|
// A `type="number"` input still hands back an empty or
|
|
56
58
|
// otherwise unparseable string in plenty of real situations
|
|
57
59
|
// (cleared entirely, "-", "1e", a paste): Number() turns
|
|
@@ -67,22 +69,28 @@ function BlockParamField({ spec, value, onChange, error }) {
|
|
|
67
69
|
case "choice":
|
|
68
70
|
return (_jsx(PropertyField, { label: spec.label, htmlFor: fieldId, error: error, children: _jsx("select", { id: fieldId, value: value ?? "", onChange: (event) => onChange(event.target.value), className: "h-10 w-full rounded-md border border-border-strong bg-background-elevated px-3 text-sm text-text-primary focus-visible:border-primary-600 focus-visible:outline-hidden focus-visible:ring-4 focus-visible:ring-primary-50", children: (spec.options ?? []).map((option) => (_jsx("option", { value: option, children: option }, option))) }) }));
|
|
69
71
|
case "image":
|
|
70
|
-
return (
|
|
71
|
-
// A block param stores the media id and nothing else, so
|
|
72
|
-
// there is nowhere for alt text to go: asking for it here
|
|
73
|
-
// would be collecting something this field then discards.
|
|
74
|
-
, {
|
|
75
|
-
// A block param stores the media id and nothing else, so
|
|
76
|
-
// there is nowhere for alt text to go: asking for it here
|
|
77
|
-
// would be collecting something this field then discards.
|
|
78
|
-
collectAlt: false, onPick: (item) => {
|
|
79
|
-
onChange(item.id);
|
|
80
|
-
setPickerOpen(false);
|
|
81
|
-
}, onClose: () => setPickerOpen(false) }))] }));
|
|
72
|
+
return _jsx(ImageParamField, { spec: spec, value: value, onChange: onChange, error: error });
|
|
82
73
|
default:
|
|
83
74
|
return null;
|
|
84
75
|
}
|
|
85
76
|
}
|
|
77
|
+
function ImageParamField({ spec, value, onChange, error }) {
|
|
78
|
+
const s = useSdkString();
|
|
79
|
+
const [pickerOpen, setPickerOpen] = useState(false);
|
|
80
|
+
const { preview } = useMediaParamPreview(value ?? null);
|
|
81
|
+
return (_jsxs(PropertyField, { label: spec.label, error: error, children: [_jsxs("div", { className: "flex items-center gap-3 rounded-md border border-border-default bg-background-subtle p-2", children: [preview ? (_jsx("img", { src: preview.downloadUrl, alt: "", className: "h-10 w-10 shrink-0 rounded-md object-cover" })) : (_jsx("div", { "aria-hidden": "true", className: "h-10 w-10 shrink-0 rounded-md bg-background-hover" })), _jsx(TruncatedText, { className: "flex-1 truncate text-sm text-text-secondary", children: preview?.filename ?? s("blockPanel.noImage") }), _jsx(Button, { type: "button", variant: "outline", size: "sm", onClick: () => setPickerOpen(true), children: s("blockPanel.change") })] }), pickerOpen && (_jsx(MediaPicker
|
|
82
|
+
// A block param stores the media id and nothing else, so
|
|
83
|
+
// there is nowhere for alt text to go: asking for it here
|
|
84
|
+
// would be collecting something this field then discards.
|
|
85
|
+
, {
|
|
86
|
+
// A block param stores the media id and nothing else, so
|
|
87
|
+
// there is nowhere for alt text to go: asking for it here
|
|
88
|
+
// would be collecting something this field then discards.
|
|
89
|
+
collectAlt: false, onPick: (item) => {
|
|
90
|
+
onChange(item.id);
|
|
91
|
+
setPickerOpen(false);
|
|
92
|
+
}, onClose: () => setPickerOpen(false) }))] }));
|
|
93
|
+
}
|
|
86
94
|
// The typed param field list, extracted out of BlockPanel (S197 Task 12:
|
|
87
95
|
// same reasoning as StyleListbox's own extraction) so the on-page side
|
|
88
96
|
// panel (apps/admin-ui's block-overlay.tsx) can render the exact same
|
|
@@ -90,7 +98,8 @@ function BlockParamField({ spec, value, onChange, error }) {
|
|
|
90
98
|
// The form-view/on-page distinction is only ever about the surrounding
|
|
91
99
|
// panel shell, never about how a param is edited.
|
|
92
100
|
export function BlockParamFields({ listing, listingsError, params, onChange, fieldErrors }) {
|
|
93
|
-
|
|
101
|
+
const s = useSdkString();
|
|
102
|
+
return (_jsxs(_Fragment, { children: [!listing && listingsError && _jsx("p", { className: "text-sm text-danger-600", children: listingsError }), !listing && !listingsError && (_jsx("p", { className: "text-sm text-text-secondary", children: s("blockPanel.fieldsUnavailable") })), listing?.params.map((spec) => (_jsx(BlockParamField, { spec: spec, value: params[spec.key], onChange: (next) => onChange(spec.key, next), error: fieldErrors?.[spec.key] }, spec.key)))] }));
|
|
94
103
|
}
|
|
95
104
|
// The mockup's right-hand settings panel (screen 1) for the form view: a
|
|
96
105
|
// modal over the editor (Dialog, per packages/ui: MediaPicker moved to
|
|
@@ -105,6 +114,7 @@ export function BlockParamFields({ listing, listingsError, params, onChange, fie
|
|
|
105
114
|
// panel visibility is just a read of editor state, not separate
|
|
106
115
|
// open/close state duplicated here.
|
|
107
116
|
export function BlockPanel({ editor, pos, partial, params }) {
|
|
117
|
+
const s = useSdkString();
|
|
108
118
|
const { listings, error: listingsError } = useBlockListings();
|
|
109
119
|
const listing = listings.find((entry) => entry.alias === partial) ?? null;
|
|
110
120
|
// "at the node's position" (S197 Task 3 brief): setNodeSelection(pos)
|
|
@@ -161,7 +171,7 @@ export function BlockPanel({ editor, pos, partial, params }) {
|
|
|
161
171
|
// editor, so this is a real guard, not defensive-for-its-own-sake.
|
|
162
172
|
if (!editor.isDestroyed)
|
|
163
173
|
editor.commands.focus();
|
|
164
|
-
}, className: "flex max-h-[80vh] max-w-sm flex-col gap-0 p-0", children: [_jsxs(DialogHeader, { className: "border-b border-border-default px-4 py-3", children: [_jsxs("div", { className: "flex flex-col gap-px", children: [_jsx(DialogTitle, { children: listing?.name ?? partial }),
|
|
174
|
+
}, className: "flex max-h-[80vh] max-w-sm flex-col gap-0 p-0", children: [_jsxs(DialogHeader, { className: "border-b border-border-default px-4 py-3", children: [_jsxs("div", { className: "flex flex-col gap-px", children: [_jsx(DialogTitle, { children: listing?.name ?? partial }), _jsx("span", { className: "font-mono text-xs text-text-tertiary", children: s("blockPanel.partial", { partial }) })] }), _jsx(DialogCloseButton, { "aria-label": s("blockPanel.close") })] }), _jsxs("div", { className: "flex flex-1 flex-col gap-4 overflow-y-auto p-4", children: [_jsx(BlockParamFields, { listing: listing, listingsError: listingsError, params: params, onChange: updateParam }), _jsxs("p", { className: "rounded-md border border-border-default bg-background-subtle p-2 text-xs text-text-secondary", children: [_jsx("b", { className: "font-semibold text-text-primary", children: s("blockPanel.livePreview") }), " ", s("blockPanel.livePreviewBody")] })] }), _jsxs(DialogFooter, { className: "mt-0 justify-start border-t border-border-default p-4", children: [_jsx(Button, { type: "button", variant: "ghost", className: "text-danger-600 hover:text-danger-700", onClick: handleRemove, children: s("blockPanel.removeBlock") }), _jsx(Button, { type: "button", className: "ms-auto", onClick: moveSelectionPastBlock, children: s("blockPanel.done") })] })] }) }));
|
|
165
175
|
}
|
|
166
176
|
// The chip's "preview ⤢" affordance (S197 mockup screen 3): fetches
|
|
167
177
|
// POST /api/manage/v1/render/block for the block's CURRENT params and shows the
|
|
@@ -171,6 +181,7 @@ export function BlockPanel({ editor, pos, partial, params }) {
|
|
|
171
181
|
// which is inherently a physical measurement: plain `top`/`left` here,
|
|
172
182
|
// not logical properties, matches how that rect is expressed.
|
|
173
183
|
export function BlockPreviewPopover({ partial, params, anchorRect, onClose }) {
|
|
184
|
+
const s = useSdkString();
|
|
174
185
|
const fetchApi = usePluginApi();
|
|
175
186
|
const [html, setHtml] = useState(null);
|
|
176
187
|
const [loading, setLoading] = useState(true);
|
|
@@ -187,7 +198,7 @@ export function BlockPreviewPopover({ partial, params, anchorRect, onClose }) {
|
|
|
187
198
|
})
|
|
188
199
|
.then(async (response) => {
|
|
189
200
|
if (!response.ok)
|
|
190
|
-
throw new Error(
|
|
201
|
+
throw new Error(s("blockPanel.previewFailed", { status: response.status }));
|
|
191
202
|
const body = (await response.json());
|
|
192
203
|
if (!cancelled)
|
|
193
204
|
setHtml(body.html);
|
|
@@ -206,7 +217,7 @@ export function BlockPreviewPopover({ partial, params, anchorRect, onClose }) {
|
|
|
206
217
|
// params is a fresh object per render (rich-text-view.tsx reads it off
|
|
207
218
|
// node attrs each time): comparing it by reference would refetch on
|
|
208
219
|
// every unrelated re-render, so key on its serialized form instead.
|
|
209
|
-
}, [partial, JSON.stringify(params), fetchApi]);
|
|
220
|
+
}, [partial, JSON.stringify(params), fetchApi, s]);
|
|
210
221
|
useEffect(() => {
|
|
211
222
|
function handlePointerDown(event) {
|
|
212
223
|
if (popoverRef.current && !popoverRef.current.contains(event.target))
|
|
@@ -227,5 +238,5 @@ export function BlockPreviewPopover({ partial, params, anchorRect, onClose }) {
|
|
|
227
238
|
if (event.key === "Escape")
|
|
228
239
|
onClose();
|
|
229
240
|
}
|
|
230
|
-
return (_jsxs("div", { ref: popoverRef, role: "dialog", "aria-label":
|
|
241
|
+
return (_jsxs("div", { ref: popoverRef, role: "dialog", "aria-label": s("blockPanel.previewLabel", { partial }), onKeyDown: handleKeyDownCapture, style: { position: "fixed", top: anchorRect.bottom + 4, left: anchorRect.left }, className: "z-20 w-72 rounded-md border border-border-default bg-background-elevated p-2 shadow-xl", children: [loading && _jsx("p", { className: "text-xs text-text-secondary", children: s("blockPanel.previewLoading") }), error && _jsx("p", { className: "text-xs text-danger-600", children: error }), !loading && !error && (_jsx("iframe", { title: s("blockPanel.previewLabel", { partial }), srcDoc: html ?? "", sandbox: "", className: "h-44 w-full rounded-sm border border-border-subtle bg-background-elevated" }))] }));
|
|
231
242
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Editor } from "@tiptap/core";
|
|
2
|
+
import type { RichItemDirectory } from "./rich-items.js";
|
|
3
|
+
import type { ToolbarEntry } from "./plugin-toolbar.js";
|
|
4
|
+
export declare function PluginButtonViewDialog({ editor, entry, items, culture, returnFocusTo, onClose }: {
|
|
5
|
+
editor: Editor;
|
|
6
|
+
entry: ToolbarEntry;
|
|
7
|
+
items: RichItemDirectory;
|
|
8
|
+
culture: string | null;
|
|
9
|
+
returnFocusTo: HTMLElement | null;
|
|
10
|
+
onClose(): void;
|
|
11
|
+
}): import("react").JSX.Element | null;
|