@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
|
@@ -1,40 +1,39 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
3
|
import { PluginValueProvider, usePluginApi } from "./plugin-context.js";
|
|
4
|
+
import { useSdkString } from "./sdk-strings.js";
|
|
4
5
|
// S278b (D5): the node refusal a refused write answers (403): the refused
|
|
5
6
|
// action, and the entry that decided, labelled. Its page is named only when
|
|
6
7
|
// the server sent its name, which is only when the person may view it.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"content.
|
|
11
|
-
"content.
|
|
12
|
-
"content.
|
|
8
|
+
// M33 K35: every word is an SDK string, so inside the admin the refusal reads
|
|
9
|
+
// in the admin's language, from its locale files.
|
|
10
|
+
const ACTION_KEYS = {
|
|
11
|
+
"content.read": { roleCannot: "simpleStorage.roleCannotRead", restricted: "simpleStorage.restrictedRead" },
|
|
12
|
+
"content.create": { roleCannot: "simpleStorage.roleCannotCreate", restricted: "simpleStorage.restrictedCreate" },
|
|
13
|
+
"content.update": { roleCannot: "simpleStorage.roleCannotUpdate", restricted: "simpleStorage.restrictedUpdate" },
|
|
14
|
+
"content.publish": { roleCannot: "simpleStorage.roleCannotPublish", restricted: "simpleStorage.restrictedPublish" },
|
|
15
|
+
"content.delete": { roleCannot: "simpleStorage.roleCannotDelete", restricted: "simpleStorage.restrictedDelete" },
|
|
13
16
|
};
|
|
14
|
-
|
|
15
|
-
"content.read": "view",
|
|
16
|
-
"content.create": "create",
|
|
17
|
-
"content.update": "edit",
|
|
18
|
-
"content.publish": "publish",
|
|
19
|
-
"content.delete": "delete",
|
|
20
|
-
};
|
|
21
|
-
function refusalSentence(body) {
|
|
17
|
+
function refusalSentence(body, t) {
|
|
22
18
|
if (!body || typeof body !== "object")
|
|
23
19
|
return null;
|
|
24
20
|
const { action, access } = body;
|
|
25
|
-
if (typeof action !== "string" || !(action
|
|
21
|
+
if (typeof action !== "string" || !Object.prototype.hasOwnProperty.call(ACTION_KEYS, action) || !access || typeof access !== "object")
|
|
26
22
|
return null;
|
|
23
|
+
const keys = ACTION_KEYS[action];
|
|
27
24
|
const entry = access.decidedAt ?? null;
|
|
28
|
-
if (access.reason === "role-lacks-action" || entry === null)
|
|
29
|
-
return
|
|
30
|
-
|
|
31
|
-
const place = entry.name ?? entry.path?.split("/").filter(Boolean).pop() ?? "a page you cannot view";
|
|
25
|
+
if (access.reason === "role-lacks-action" || entry === null)
|
|
26
|
+
return t(keys.roleCannot);
|
|
27
|
+
const place = entry.name ?? entry.path?.split("/").filter(Boolean).pop() ?? t("simpleStorage.pageYouCannotView");
|
|
32
28
|
// A user the server does not name (no display name; the email is never
|
|
33
29
|
// sent) is "a user"; a role keeps its id when its label is missing.
|
|
34
30
|
const labels = (entry.grants ?? [])
|
|
35
|
-
.map((grant) => grant.label || (grant.subjectKind === "user" ? "
|
|
31
|
+
.map((grant) => grant.label || (grant.subjectKind === "user" ? t("simpleStorage.aUser") : grant.subjectId))
|
|
36
32
|
.filter(Boolean);
|
|
37
|
-
return
|
|
33
|
+
return t(keys.restricted, {
|
|
34
|
+
place,
|
|
35
|
+
who: labels.length > 0 ? labels.join(t("simpleStorage.listSeparator")) : t("simpleStorage.adminsOnly"),
|
|
36
|
+
});
|
|
38
37
|
}
|
|
39
38
|
// The only SDK code path that ever hits /api/plugins/:pluginId/storage/...
|
|
40
39
|
// (SimpleStorageAPI, Session 68): a plugin's view code (and usePluginValue()
|
|
@@ -51,6 +50,7 @@ function refusalSentence(body) {
|
|
|
51
50
|
// {value: null} is the normal "never set" state, not an error.
|
|
52
51
|
export function SimpleStorageValueProvider({ contentId, fieldId, pluginId, children, }) {
|
|
53
52
|
const fetchApi = usePluginApi();
|
|
53
|
+
const t = useSdkString();
|
|
54
54
|
const [value, setValue] = useState(null);
|
|
55
55
|
const [error, setError] = useState(null);
|
|
56
56
|
const path = `/api/plugins/${pluginId}/storage/${contentId}/${fieldId}`;
|
|
@@ -60,7 +60,7 @@ export function SimpleStorageValueProvider({ contentId, fieldId, pluginId, child
|
|
|
60
60
|
fetchApi(path)
|
|
61
61
|
.then(async (response) => {
|
|
62
62
|
if (!response.ok)
|
|
63
|
-
throw new Error(
|
|
63
|
+
throw new Error(t("simpleStorage.loadFailed", { status: response.status }));
|
|
64
64
|
const body = (await response.json());
|
|
65
65
|
if (!cancelled)
|
|
66
66
|
setValue(body.value);
|
|
@@ -83,8 +83,8 @@ export function SimpleStorageValueProvider({ contentId, fieldId, pluginId, child
|
|
|
83
83
|
.then(async (response) => {
|
|
84
84
|
if (!response.ok) {
|
|
85
85
|
// S278b (D5): a restriction's refusal says why, from its body.
|
|
86
|
-
const refusal = response.status === 403 ? refusalSentence(await response.json().catch(() => null)) : null;
|
|
87
|
-
throw new Error(refusal ??
|
|
86
|
+
const refusal = response.status === 403 ? refusalSentence(await response.json().catch(() => null), t) : null;
|
|
87
|
+
throw new Error(refusal ?? t("simpleStorage.saveFailed", { status: response.status }));
|
|
88
88
|
}
|
|
89
89
|
setError(null);
|
|
90
90
|
})
|
|
@@ -19,9 +19,12 @@ export interface StructuredQueryBuilder<T = Record<string, unknown>> extends Pro
|
|
|
19
19
|
where(conditions: Record<string, unknown>): this;
|
|
20
20
|
orderBy(column: string, direction?: "asc" | "desc"): this;
|
|
21
21
|
limit(n: number): this;
|
|
22
|
+
/** M33 K3: pages by the primary key, `direction` "asc" (the default) or "desc"; the next
|
|
23
|
+
* cursor is the last row's key either way. */
|
|
22
24
|
paginate(options: {
|
|
23
25
|
cursor?: string;
|
|
24
26
|
limit: number;
|
|
27
|
+
direction?: "asc" | "desc";
|
|
25
28
|
}): this;
|
|
26
29
|
}
|
|
27
30
|
export interface StructuredStorageTransaction {
|
|
@@ -38,35 +41,452 @@ export interface ScopedStructuredStorage {
|
|
|
38
41
|
query<T = Record<string, unknown>>(tableName: string): StructuredQueryBuilder<T>;
|
|
39
42
|
transaction(fn: (tx: StructuredStorageTransaction) => Promise<void>): Promise<void>;
|
|
40
43
|
}
|
|
44
|
+
import type { PluginVisitor, PluginVisitors } from "./visitors.js";
|
|
45
|
+
import type { ListPublishedOptions, PageAddress, PageAddressState, PluginCaller, PluginFieldInfo, ProtectionWidgetInfo, PublishedListPage, PublishedSearchPage, SearchPublishedOptions } from "@kardalum/api-schemas";
|
|
46
|
+
import type { RenderCachePurgeTarget } from "@kardalum/api-schemas";
|
|
41
47
|
import type { Entitlement } from "./entitlement-types.js";
|
|
48
|
+
import type { PluginContentLibrary, ProtectionFields, ProtectionResult } from "./content-library.js";
|
|
49
|
+
import type { PluginMediaLibrary } from "./media-library.js";
|
|
50
|
+
import type { PluginUploadedFile, PluginUploads } from "./uploads.js";
|
|
42
51
|
import type { PluginNotify } from "./notify.js";
|
|
52
|
+
import type { PluginMail } from "./mail.js";
|
|
53
|
+
import type { PluginOutbound } from "./outbound.js";
|
|
54
|
+
import type { PluginSealing } from "./sealing.js";
|
|
55
|
+
import type { PluginUserFields, PluginUserLibrary } from "./user-library.js";
|
|
43
56
|
import type { PluginVendorService } from "./vendor-service.js";
|
|
57
|
+
import type { PluginSecrets, PluginSettingsReader } from "./providers.js";
|
|
58
|
+
import type { PluginEvents, PluginServices } from "./services.js";
|
|
59
|
+
/** A published page as any visitor reads it, in one language (`getPublishedContent`). */
|
|
44
60
|
export interface PublishedContent {
|
|
45
61
|
id: string;
|
|
46
62
|
documentTypeId: string;
|
|
63
|
+
/** The field values in `culture`, published values only, private fields left out (M32 J7). */
|
|
47
64
|
data: Record<string, unknown>;
|
|
65
|
+
/** M33 K22: the language this answer is in. */
|
|
66
|
+
culture: string;
|
|
67
|
+
/** M33 K22: each published language with its own address, in the site's language order; the
|
|
68
|
+
* same list as the page's `cultures` on `listPublishedPages`. On a route or site route, when no
|
|
69
|
+
* public URL is set, a domain stored without a scheme is printed with the request's scheme; in a
|
|
70
|
+
* hook or a scheduled task, which have no request, with https. */
|
|
71
|
+
addresses: PageAddress[];
|
|
72
|
+
/** M33 K21: the document type's fields in order, with what a Group or a list holds (`group`,
|
|
73
|
+
* `list`), private fields and a field whose data type row is gone left out, so every entry is one
|
|
74
|
+
* `data` may hold. `dataType` is the editor id (the id a plugin declares under `dataTypes`),
|
|
75
|
+
* never a data type row id. */
|
|
76
|
+
fields: PluginFieldInfo[];
|
|
77
|
+
/** @experimental M35 P4 (G67): whether the server answers this page with a page, as listPublishedPages'
|
|
78
|
+
* `rendered` says: true when the render would choose a template for it, false when it would find none, null
|
|
79
|
+
* on a server that renders no site. */
|
|
80
|
+
rendered: boolean | null;
|
|
48
81
|
}
|
|
49
|
-
|
|
82
|
+
/** M33 K22: what `getPublishedContent` takes. */
|
|
83
|
+
export interface GetPublishedContentOptions {
|
|
84
|
+
/** One of the site's languages (compared in lower case). Absent: the default language, or the
|
|
85
|
+
* first published one when the default is not published. A language the page is not published
|
|
86
|
+
* in answers null, never another language. */
|
|
87
|
+
culture?: string;
|
|
88
|
+
/** @experimental M35 U2b (W8): read as this visitor: the `context.visitor` the core handed this request. Absent, or
|
|
89
|
+
* any other object (a copy, one kept past its request, one `context.visitors.get` answered): an anonymous reader,
|
|
90
|
+
* so a members-only page answers null. */
|
|
91
|
+
visitor?: PluginVisitor;
|
|
92
|
+
}
|
|
93
|
+
/** M32 F4c (D2): one page `listPublishedPages` answers: published, live, and with an address. */
|
|
94
|
+
export interface PublishedPageItem {
|
|
95
|
+
id: string;
|
|
96
|
+
path: string;
|
|
97
|
+
/**
|
|
98
|
+
* The default language's address: a full URL when the site has a domain, else a site path.
|
|
99
|
+
* When the default language is not published, it is the first published language's address.
|
|
100
|
+
*/
|
|
101
|
+
url: string;
|
|
102
|
+
/** The document type's name. */
|
|
103
|
+
documentType: string;
|
|
104
|
+
/** When the page was published, ISO. */
|
|
105
|
+
updatedAt: string;
|
|
106
|
+
/** Each published language with its own address, in the site's language order. */
|
|
107
|
+
cultures: PageAddress[];
|
|
108
|
+
/** M33 K24: whether the server answers this page with a page: true when the render would choose
|
|
109
|
+
* a template for it (its document type's, else the site's catch-all), false when it would find
|
|
110
|
+
* none (nothing is served at its address), null on a server that renders no site. */
|
|
111
|
+
rendered: boolean | null;
|
|
112
|
+
}
|
|
113
|
+
/** M32 F4c (D2): one page of `listPublishedPages`. */
|
|
114
|
+
export interface PublishedPagesPage {
|
|
115
|
+
items: PublishedPageItem[];
|
|
116
|
+
/** Hand it back as `after` for the next page; null when the walk is done. */
|
|
117
|
+
nextCursor: string | null;
|
|
118
|
+
/** True when the cursor's page was gone, trashed or outside the walk, so the walk started again. */
|
|
119
|
+
restarted: boolean;
|
|
120
|
+
}
|
|
121
|
+
/** M32 F4c (D2): what `listPublishedPages` takes. */
|
|
122
|
+
export interface ListPublishedPagesOptions {
|
|
123
|
+
/** A top-level page's id: only that site's pages, the top-level page included. Absent: every site. */
|
|
124
|
+
site?: string;
|
|
125
|
+
/** M33 K24: a request's host (`request.host`): only the pages whose printed address is on it, by
|
|
126
|
+
* the core's address rule, as `siteOfHost` reads the host. A site's domain (its first or another)
|
|
127
|
+
* lists that site; the default address lists the default site and every site without a domain;
|
|
128
|
+
* a host the install does not name lists nothing while the default address has a name. Not with
|
|
129
|
+
* `site`; a host `siteOfHost` answers null for throws TypeError. */
|
|
130
|
+
host?: string;
|
|
131
|
+
/** The `nextCursor` of the previous page. */
|
|
132
|
+
after?: string;
|
|
133
|
+
/** 1 to 500 (PUBLISHED_PAGES_LIMIT_MAX), default 100. */
|
|
134
|
+
limit?: number;
|
|
135
|
+
/** @experimental M35 U2b (W8): list as this visitor, as `GetPublishedContentOptions.visitor` reads it; absent,
|
|
136
|
+
* members-only pages are left out. */
|
|
137
|
+
visitor?: PluginVisitor;
|
|
138
|
+
}
|
|
139
|
+
/** @experimental M35 U2b (W8): what `pageAddresses` and `pageAtAddress` take: read as this visitor, as
|
|
140
|
+
* `GetPublishedContentOptions.visitor` reads it; absent, a members-only page answers as a missing one. */
|
|
141
|
+
export interface PageReadAsOptions {
|
|
142
|
+
visitor?: PluginVisitor;
|
|
143
|
+
}
|
|
144
|
+
/** M33 K23: what `siteOfHost` takes. */
|
|
145
|
+
export interface SiteOfHostOptions {
|
|
146
|
+
/** The scheme the host was reached on (a request's `protocol`): `"http"` or `"https"`. Used for
|
|
147
|
+
* `origin` only when neither the domain nor the public URL names one. Anything else throws
|
|
148
|
+
* TypeError. */
|
|
149
|
+
scheme?: "http" | "https";
|
|
150
|
+
}
|
|
151
|
+
/** M33 K23: which site a host belongs to, by the core's own address rule (the one the server uses
|
|
152
|
+
* to answer a request on that host). */
|
|
153
|
+
export interface SiteOfHost {
|
|
154
|
+
/** The top-level page id of the site whose domain claims the host; null on the default address
|
|
155
|
+
* (the default site and every site without a domain of its own). It names the claiming site
|
|
156
|
+
* whatever its state, as the server's own address rule does: an unpublished or binned site still
|
|
157
|
+
* claims its domain, and listPublishedPages lists nothing for it. */
|
|
158
|
+
site: string | null;
|
|
159
|
+
/** The scheme and main domain this host's pages are printed with, as an origin
|
|
160
|
+
* (`https://example.com`, a port when one is stored). The stored domain's own scheme, else the
|
|
161
|
+
* public URL's, else the `scheme` asked with, else https. */
|
|
162
|
+
origin: string;
|
|
163
|
+
/** False on a site's other domains (and on a host the install does not name while the default
|
|
164
|
+
* address has a name): a visitor there is sent on to `origin`. */
|
|
165
|
+
isMainHost: boolean;
|
|
166
|
+
/** True when `origin` comes from a stored domain or the public URL; false on the default address
|
|
167
|
+
* when it has no stored name, so `origin` was made from the host asked (whatever a visitor's
|
|
168
|
+
* `Host` header said). Print no address from an answer whose `named` is false. */
|
|
169
|
+
named: boolean;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* M33 K31: one target of `pageAddresses`. `{ page }` is a page's id: its current tree position.
|
|
173
|
+
* `{ path }` is a tree path (a stored `path`, starting with "/", no empty segment, at most
|
|
174
|
+
* `SITE_LOCATION_MAX` (2,000) characters), also one no page holds any more. `site` names the
|
|
175
|
+
* top-level page whose site record (domains, default flag) applies when the path's first segment no
|
|
176
|
+
* longer names one: the `previousPath` of a top-level page that was renamed or moved (a move hook
|
|
177
|
+
* passes the event's `contentId` when `previousPath` has one segment). The site's path is then the
|
|
178
|
+
* first segment of `path`.
|
|
179
|
+
*/
|
|
180
|
+
export type PageAddressTarget = {
|
|
181
|
+
page: string;
|
|
182
|
+
} | {
|
|
183
|
+
path: string;
|
|
184
|
+
site?: string;
|
|
185
|
+
};
|
|
186
|
+
/** M33 K31: what `pageAddresses` answers for one target. */
|
|
187
|
+
export interface PageAddresses {
|
|
188
|
+
/** The tree path asked, or the page's current one for a `{ page }` target. */
|
|
189
|
+
path: string;
|
|
190
|
+
/** Every language of the site, in its order, each with its `url` (made as listPublishedPages
|
|
191
|
+
* makes its `cultures`: a full URL when the site has a domain, with listPublishedPages' scheme
|
|
192
|
+
* rule, else the path with the language prefix) and `published`: true when a page is stored at that path (for `{ page }`, that page),
|
|
193
|
+
* is not in the trash, is published in that language, and its site is served to visitors. */
|
|
194
|
+
addresses: PageAddressState[];
|
|
195
|
+
}
|
|
196
|
+
/** M33 K32: what `pageAtAddress` answers: the page, the language and whether a visitor is sent on. */
|
|
197
|
+
export interface PageAtAddressAnswer {
|
|
198
|
+
/** The page's id. */
|
|
199
|
+
page: string;
|
|
200
|
+
/** The language the address is in: its prefix (the site's own code), else the default one. */
|
|
201
|
+
culture: string;
|
|
202
|
+
/** True when the core would first send a visitor on to the page's one address (a site's second
|
|
203
|
+
* domain, a default-site page's long form, a language root written with a trailing "/"). */
|
|
204
|
+
redirected: boolean;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* M33 K32: the page at a visitor's address, on the hook, scheduled task, route and site route
|
|
208
|
+
* contexts, never a site fallback's (a fallback runs where no page answers, and one lookup costs up
|
|
209
|
+
* to four address resolutions).
|
|
210
|
+
*/
|
|
211
|
+
export interface PluginAddressLookup {
|
|
212
|
+
/** The published page a visitor gets at `address`, read as the delivery API's lookup by address
|
|
213
|
+
* reads one: a site path is read on the default address; an absolute `http` or `https` URL's
|
|
214
|
+
* host selects the site (a host no site claims reads as the default address, so ask `siteOfHost`
|
|
215
|
+
* first to know whether a URL is this installation's own); the language prefix is read as the
|
|
216
|
+
* renderer reads it; the query and fragment are ignored. Null for no page, a draft, a reserved
|
|
217
|
+
* first segment ("/api", "/media") or an address that cannot be read (an empty segment, another
|
|
218
|
+
* scheme, a host that is no domain). A non-string or one over `SITE_LOCATION_MAX` (2,000)
|
|
219
|
+
* characters throws TypeError. Open to every plugin: it is the answer the delivery API gives
|
|
220
|
+
* anyone. */
|
|
221
|
+
pageAtAddress(address: string, options?: PageReadAsOptions): Promise<PageAtAddressAnswer | null>;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* M32 F2 (D27): what a handler receives instead of the Fastify request and reply. Plugin code runs in
|
|
225
|
+
* process with the server's privileges; the views remove the accidental path to server objects, and
|
|
226
|
+
* the door's review is the boundary.
|
|
227
|
+
*/
|
|
228
|
+
export interface PluginRequestView {
|
|
229
|
+
readonly method: string;
|
|
230
|
+
readonly url: string;
|
|
231
|
+
readonly params: unknown;
|
|
232
|
+
readonly query: unknown;
|
|
233
|
+
readonly body: unknown;
|
|
234
|
+
/** M33 K4: the request's exact bytes, a fresh copy for this handler (changing it changes
|
|
235
|
+
* neither `body` nor what the host read). Present only on a route that declares
|
|
236
|
+
* `rawBody: true`, when the request carried a body the host parses: JSON, plain text, or since
|
|
237
|
+
* M35 P2 a form-encoded body. M35 P2: a POST site route may declare it too (experimental). */
|
|
238
|
+
readonly rawBody?: Uint8Array;
|
|
239
|
+
/** @experimental M35 B3 (W17): the files the request carried, checked by the core, on a route that declares
|
|
240
|
+
* `uploads` (empty when it carried none); absent on any other route. Read or keep them with `context.uploads`. */
|
|
241
|
+
readonly files?: readonly PluginUploadedFile[];
|
|
242
|
+
readonly headers: Record<string, string | string[] | undefined>;
|
|
243
|
+
readonly ip: string;
|
|
244
|
+
readonly ips: readonly string[];
|
|
245
|
+
readonly host: string;
|
|
246
|
+
readonly hostname: string;
|
|
247
|
+
readonly protocol: "http" | "https";
|
|
248
|
+
readonly id: string;
|
|
249
|
+
readonly log: {
|
|
250
|
+
info(...a: unknown[]): void;
|
|
251
|
+
warn(...a: unknown[]): void;
|
|
252
|
+
error(...a: unknown[]): void;
|
|
253
|
+
debug(...a: unknown[]): void;
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
/** M32 F2 (D27): the reply a site route's handler writes to; see PluginRequestView. */
|
|
257
|
+
export interface PluginReplyView {
|
|
258
|
+
code(status: number): PluginReplyView;
|
|
259
|
+
status(status: number): PluginReplyView;
|
|
260
|
+
header(name: string, value: string | number | readonly string[]): PluginReplyView;
|
|
261
|
+
headers(values: Record<string, string | number | readonly string[]>): PluginReplyView;
|
|
262
|
+
getHeader(name: string): string | number | string[] | undefined;
|
|
263
|
+
type(contentType: string): PluginReplyView;
|
|
264
|
+
send(body?: unknown): PluginReplyView;
|
|
265
|
+
readonly statusCode: number;
|
|
266
|
+
readonly sent: boolean;
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* M33 K1: what every server context a plugin receives has: a hook's, a site fallback's, a
|
|
270
|
+
* scheduled task's and a route's (PluginHookContext, SiteFallbackContext, PluginTaskContext and
|
|
271
|
+
* PluginApiRouteContext are each built from it). A member only some of them get is declared on
|
|
272
|
+
* those types, never here.
|
|
273
|
+
*/
|
|
274
|
+
/**
|
|
275
|
+
* M33 K30: `context.simpleStorage`, the plugin's own value per page and field, the store a view's
|
|
276
|
+
* `SimpleStorageValueProvider` reads and writes (the same key), bound to the calling plugin: it
|
|
277
|
+
* never reaches another plugin's values. `contentId` is a page's UUID (a missing or binned page
|
|
278
|
+
* throws TypeError); `fieldId` is a letter, then letters, digits and "_", at most 64 characters
|
|
279
|
+
* (`CONTENT_LIST_FIELD_ID_MAX`), else TypeError; `value` is JSON-serialisable and at most 65,536
|
|
280
|
+
* bytes serialised (`SIMPLE_STORAGE_VALUE_MAX_BYTES`), else TypeError. A plugin that is switched off
|
|
281
|
+
* gets PluginNotActiveError, a read-only plugin's `set` PluginReadOnlyError. On an admin or API key
|
|
282
|
+
* route the caller's access to the page is applied as the HTTP door applies it (`get` needs the page
|
|
283
|
+
* readable, `set` editable), else PluginPageAccessError; a hook, task or site fallback acts for no
|
|
284
|
+
* person and has no such check. Test the errors with their `is...` functions, never `instanceof`.
|
|
285
|
+
*/
|
|
286
|
+
export interface PluginSimpleStorage {
|
|
287
|
+
/** The stored value, or null when it was never set. */
|
|
288
|
+
get(contentId: string, fieldId: string): Promise<unknown>;
|
|
289
|
+
/** Stores `value`, replacing the one before. */
|
|
290
|
+
set(contentId: string, fieldId: string, value: unknown): Promise<void>;
|
|
291
|
+
}
|
|
292
|
+
export interface PluginServerContextBase {
|
|
293
|
+
/** The plugin's own tables, scoped to its id by the host. */
|
|
50
294
|
structuredStorage: ScopedStructuredStorage;
|
|
51
|
-
/**
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
*
|
|
55
|
-
|
|
295
|
+
/** M33 K30: the plugin's own value per page and field (PluginSimpleStorage). */
|
|
296
|
+
simpleStorage: PluginSimpleStorage;
|
|
297
|
+
/** A published page in one language (M33 K22), or null if the content id doesn't exist, isn't
|
|
298
|
+
* published (a draft-only save never satisfies this), or isn't published in the asked `culture`.
|
|
299
|
+
* It deliberately conflates "missing" and "not yet purchasable," since callers treat both the
|
|
300
|
+
* same way. With no `culture`, the default language, else the first published one; the answer's
|
|
301
|
+
* `culture` says which came back. A `culture` that is not one of the site's languages throws
|
|
302
|
+
* TypeError. On a route or site route, when no public URL is set, a domain stored without a
|
|
303
|
+
* scheme is printed in `addresses` with the request's scheme; in a hook or a scheduled task,
|
|
304
|
+
* which have no request, with https. */
|
|
305
|
+
getPublishedContent(contentId: string, options?: GetPublishedContentOptions): Promise<PublishedContent | null>;
|
|
306
|
+
/** M32 F4c (D2): the published pages a visitor can reach, in path order, with their addresses
|
|
307
|
+
* (drafts, trashed pages and pages with no address are left out). Open to every plugin, as
|
|
308
|
+
* getPublishedContent is. A bad `site`, `host`, `after` or `limit`, or `site` with `host`, throws
|
|
309
|
+
* TypeError. Each item says whether the server renders it (M33 K24). The public URL's scheme
|
|
310
|
+
* prints every full address when one is set. On a route or site route, when no public URL is
|
|
311
|
+
* set, a domain stored without a scheme is printed with the request's scheme; in a hook or a
|
|
312
|
+
* scheduled task, which have no request, with https. */
|
|
313
|
+
listPublishedPages(opts?: ListPublishedPagesOptions): Promise<PublishedPagesPage>;
|
|
314
|
+
/**
|
|
315
|
+
* M35 C1 (W15, W13): published pages sorted and filtered, a cursor at a time. Open to every plugin, as
|
|
316
|
+
* listPublishedPages is. `opts` names a `type` (the plugin's own type of that name first, else the one site
|
|
317
|
+
* type of that name) or a `typeId`, a `parent` or an `under` page, at least one; `sort` is "published"
|
|
318
|
+
* (newest first by default; needs a type or a parent), "order" (needs a parent), "_tree" (the tree's order)
|
|
319
|
+
* or a field id, each with " asc" or " desc"; `where` holds up to PUBLISHED_QUERY_WHERE_MAX tests of the
|
|
320
|
+
* type's fields (`{ field, eq }`, `{ field, in }`, `{ field, gte?, lt? }`, `{ field, has }`), of text, date,
|
|
321
|
+
* number, boolean, picker and options fields only; a private or missing field throws the same TypeError.
|
|
322
|
+
* A call examines at most PUBLISHED_QUERY_SCAN_MAX rows of its order: when that ends before `limit` matched,
|
|
323
|
+
* the page is short, `scanCapped` is true and `nextCursor` reads on. Items carry no field values: read them
|
|
324
|
+
* with getPublishedContent. A bad option throws TypeError; a field sort over more than
|
|
325
|
+
* CONTENT_LIST_FIELD_SORT_MAX pages throws RangeError. `nextCursor` is a position in the order, readable by
|
|
326
|
+
* anyone who holds it: after a short page it can be the last row examined, which may be a page that is not
|
|
327
|
+
* published (its stored path and id). Keep it in server code, or hand a visitor only a position of an item
|
|
328
|
+
* the call answered.
|
|
329
|
+
* @experimental
|
|
330
|
+
*/
|
|
331
|
+
listPublished(opts: ListPublishedOptions): Promise<PublishedListPage>;
|
|
332
|
+
/**
|
|
333
|
+
* M35 C1 (W13): the delivery search (the chosen search provider, else the built-in search) over published
|
|
334
|
+
* pages, by text (2 to PUBLISHED_SEARCH_TEXT_MAX characters), optionally of one type and under one page.
|
|
335
|
+
* Its items are listPublished's, but the search covers every published language: `culture` picks only each
|
|
336
|
+
* item's `url`. Open to every plugin.
|
|
337
|
+
* @experimental
|
|
338
|
+
*/
|
|
339
|
+
searchPublished(opts: SearchPublishedOptions): Promise<PublishedSearchPage>;
|
|
340
|
+
/** M33 K23: which site `host` (a request's `Host`, its port included) belongs to, or null for a
|
|
341
|
+
* host that cannot be read (empty, over 300 characters, a path, a user, a bad port). Open to
|
|
342
|
+
* every plugin: site addresses are public. A bad `scheme` throws TypeError. */
|
|
343
|
+
siteOfHost(host: string, options?: SiteOfHostOptions): Promise<SiteOfHost | null>;
|
|
344
|
+
/** M33 K26: a public, live media item's address, the store's own public address when it has one,
|
|
345
|
+
* else on the public URL, else on the default address when it has a name, else a site path; null
|
|
346
|
+
* for a private, trashed, missing or malformed id. Never a private file's address: read a private
|
|
347
|
+
* file through `media`. Open to every plugin: public items only. On a route or site route, when
|
|
348
|
+
* no public URL is set, a domain stored without a scheme is printed with the request's scheme;
|
|
349
|
+
* in a hook or a scheduled task, which have no request, with https. */
|
|
350
|
+
publicMediaUrl(id: string): Promise<string | null>;
|
|
351
|
+
/** M33 K31: the addresses of 1 to 100 (`PAGE_ADDRESSES_TARGETS_MAX`) pages or tree positions,
|
|
352
|
+
* also of a position a page has left and in languages a page is not published in, in the order
|
|
353
|
+
* asked. An entry is null for an unknown or trashed page id, for a path whose first segment names
|
|
354
|
+
* no top-level page when no `site` is given, and for a site a visitor cannot reach (an
|
|
355
|
+
* unpublished top-level page, or an unpublished site with a domain). Anything else wrong (no
|
|
356
|
+
* targets or more than 100, a path not starting with "/", with an empty segment or over 2,000
|
|
357
|
+
* characters, an id that is no UUID, both `page` and `path`) throws TypeError before any read.
|
|
358
|
+
* Open to every plugin: addresses are public; no content is read. On a route or site route,
|
|
359
|
+
* when no public URL is set, a domain stored without a scheme is printed with the request's
|
|
360
|
+
* scheme; in a hook or a scheduled task, which have no request, with https. */
|
|
361
|
+
pageAddresses(targets: ReadonlyArray<PageAddressTarget>, options?: PageReadAsOptions): Promise<Array<PageAddresses | null>>;
|
|
56
362
|
/** S284b: the host's latest licence verdict for this plugin, exactly as
|
|
57
363
|
* the marketplace signed it (`kind: "verdict"`), `kind: "exempt"` on a
|
|
58
364
|
* non-production install, `kind: "none"` when the host holds no verdict.
|
|
59
365
|
* Check it with `requireEntitlement` from
|
|
60
|
-
* `@kardalum/plugin-sdk/entitlement`; a thrown EntitlementError
|
|
61
|
-
* answers 403 `{ code: "entitlement", reason }
|
|
366
|
+
* `@kardalum/plugin-sdk/entitlement`; in a route a thrown EntitlementError
|
|
367
|
+
* answers 403 `{ code: "entitlement", reason }`, and a hook that throws it
|
|
368
|
+
* is skipped with one log line. */
|
|
62
369
|
entitlement: Entitlement;
|
|
63
370
|
/** S318: true while the plugin's licence term is lapsed: the host refuses its writes (403 plugin_read_only), so a route or hook can skip them. Set by the host; absent reads as false. */
|
|
64
371
|
readOnly?: boolean;
|
|
65
372
|
/** S314n3: sends a notification to people in the admin. Present only for a plugin that
|
|
66
|
-
* declares `contributions.notifications
|
|
373
|
+
* declares `contributions.notifications` (a list of kinds) and is active; a refusal throws
|
|
67
374
|
* NotificationRefusedError (check it with `isNotificationRefusedError`). */
|
|
68
375
|
notify?: PluginNotify;
|
|
69
376
|
/** S320: calls the plugin's declared vendor service with a 5-minute licence
|
|
70
377
|
* token. Present only when the manifest declares `vendorService`. */
|
|
71
378
|
vendorService?: PluginVendorService;
|
|
379
|
+
/** M32 F4 (D12): the plugin's declared secrets, read with `get(name)`. Set by the host. */
|
|
380
|
+
secrets?: PluginSecrets;
|
|
381
|
+
/** M32 F4d (D7): the plugin's settings values, read with `get(id)` or `all()`. Set by the host. */
|
|
382
|
+
settings?: PluginSettingsReader;
|
|
383
|
+
}
|
|
384
|
+
/** M35 P3 (W18): where a site route that answers after the pages was asked: the language the address was read
|
|
385
|
+
* in (its prefix, else the visitor's Accept-Language among the site's languages, else the default), whether the
|
|
386
|
+
* address carried the prefix, and the decoded path the route matched, without the prefix. @experimental */
|
|
387
|
+
export interface SiteRouteAddress {
|
|
388
|
+
culture: string;
|
|
389
|
+
prefixed: boolean;
|
|
390
|
+
path: string;
|
|
391
|
+
}
|
|
392
|
+
/** M35 P4 (W53): what `context.renderPage` takes. `culture` is one of the site's languages (compared in lower
|
|
393
|
+
* case); absent, the default language. @experimental */
|
|
394
|
+
export interface RenderPageOptions {
|
|
395
|
+
culture?: string;
|
|
396
|
+
}
|
|
397
|
+
/** M35 P4 (W53): a rendered page and the language it was rendered in. @experimental */
|
|
398
|
+
export interface RenderedPageHtml {
|
|
399
|
+
html: string;
|
|
400
|
+
culture: string;
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* M35 P4 (W53): the published page's HTML as an anonymous visitor gets it, through the normal render (published
|
|
404
|
+
* values only, private fields left out, the template, blocks and page output transforms), on the configured public
|
|
405
|
+
* URL, never cached and never counted as a view. Null for no such page, a draft, a trashed page, a page whose site
|
|
406
|
+
* is not published, a page not served in `culture`, a page with no template, or a page gate that answered. A page
|
|
407
|
+
* id that is no UUID or a `culture` that is no site language throws TypeError; the limits throw
|
|
408
|
+
* RenderPageRefusedError. @experimental
|
|
409
|
+
*/
|
|
410
|
+
export type PluginRenderPage = (pageId: string, options?: RenderPageOptions) => Promise<RenderedPageHtml | null>;
|
|
411
|
+
/**
|
|
412
|
+
* M35 P4 (W32): the core's render cache on this server. `tagsOf(pageId)` answers the tags a change of that page
|
|
413
|
+
* touches (`page:<id>`, its type's `type:<id>`, `under:<id>` for every page below it, a `list:<id>` for its parent
|
|
414
|
+
* and every ancestor, and `all`), the
|
|
415
|
+
* tags the core writes beside a page cache answer, so a CDN is purged by exactly them; [] for an unknown page, and a
|
|
416
|
+
* page id that is no UUID throws TypeError. `purge({ tags })` (core tags only) or `purge({ all: true })` removes the
|
|
417
|
+
* matching rendered pages and answers how many; another server's copies live out their second. @experimental
|
|
418
|
+
*/
|
|
419
|
+
export interface PluginRenderCache {
|
|
420
|
+
purge(target: RenderCachePurgeTarget): number;
|
|
421
|
+
tagsOf(pageId: string): Promise<string[]>;
|
|
422
|
+
}
|
|
423
|
+
export interface PluginApiRouteContext extends PluginServerContextBase, PluginAddressLookup {
|
|
424
|
+
/** M32 F (D8): the content half of the management client, acting as this plugin within its
|
|
425
|
+
* `contentAccess`. Present only when the manifest declares contentAccess. A call outside the
|
|
426
|
+
* declaration throws ContentAccessRefusedError and sends nothing. */
|
|
427
|
+
content?: PluginContentLibrary;
|
|
428
|
+
/** M32 F4c (D10): the media library, acting as this plugin within its `mediaAccess`: `upload`
|
|
429
|
+
* (media.create) and `get` (media.read). Present only when the manifest declares mediaAccess. A
|
|
430
|
+
* call outside the declaration throws MediaAccessRefusedError and sends nothing. */
|
|
431
|
+
media?: PluginMediaLibrary;
|
|
432
|
+
/** @experimental M35 B3 (W17): this request's files (PluginUploads). Present only on a route that declares `uploads`. */
|
|
433
|
+
uploads?: PluginUploads;
|
|
434
|
+
/** M32 F (D17): the built-in form protection for the request this route was called with.
|
|
435
|
+
* M32 F2 (D27): a site route passes the PluginRequestView it received. On
|
|
436
|
+
* M32 H (H19): an `ok` answer may carry `reply`, present only when the plugin declares `formReplies`.
|
|
437
|
+
* `rate` answer 429; on the other checks answer what a success answers and store nothing. */
|
|
438
|
+
protect(request: unknown): Promise<ProtectionResult>;
|
|
439
|
+
/** M32 F (D21): the two field names and a fresh time token, for a headless form. M33 (Forms
|
|
440
|
+
* review): with `minSeconds`, the built-in check's live minimum time, read on every call, so a
|
|
441
|
+
* front end that sends with this token waits at least so long. */
|
|
442
|
+
protectionFields(): Promise<ProtectionFields>;
|
|
443
|
+
/** M33 K52: the chosen form protection provider's widget for a front end the site builds itself:
|
|
444
|
+
* `{ provider, fieldPrefix, widget, script }`, or `null` while the built-in check serves alone. The
|
|
445
|
+
* parts are what `{% form_protection %}` writes (a class, `data-*` values, the visible `fallbackText`),
|
|
446
|
+
* asked with no language (`culture` is `null`), and `script` is the provider's script address under
|
|
447
|
+
* its asset folder. It answers what any page shows a visitor, so it asks for no capability. Read once a call. */
|
|
448
|
+
protectionWidget(): Promise<ProtectionWidgetInfo | null>;
|
|
449
|
+
/** M33 K5: who called this route, as the core authenticated them, frozen: a user (`userId`, and
|
|
450
|
+
* `name` when the account has one) on an "admin" route, a key (`keyId`, `keyName`) on an
|
|
451
|
+
* "apiKey" route. Absent on a "public" route and a site route, which have no caller. It never
|
|
452
|
+
* holds an email, an address, a token or a secret. A plugin that keeps it in its own history
|
|
453
|
+
* keeps personal data, and says so in its privacy notice. */
|
|
454
|
+
caller?: PluginCaller;
|
|
455
|
+
/** M33 K11: one email to one person, of a kind the manifest declares under `mailKinds` and the
|
|
456
|
+
* site owner switched on. Present only for a plugin that declares `mailKinds`. */
|
|
457
|
+
mail?: PluginMail;
|
|
458
|
+
/** M33 K16: calls web addresses through the server's checked connection (`check`, `request`). Present only
|
|
459
|
+
* for a plugin that declares `outboundRequests`; a call after the plugin is switched off answers `inactive`. */
|
|
460
|
+
outbound?: PluginOutbound;
|
|
461
|
+
/** M33 K17: seals values the plugin makes under a key of its own for each declared kind (`seal`, `open`).
|
|
462
|
+
* Present only for a plugin that declares `sealedValues`; a call after the plugin is switched off answers `inactive`. */
|
|
463
|
+
sealing?: PluginSealing;
|
|
464
|
+
/** @experimental M35 U1 (W6): the admin accounts, within `userAccess`. Present only when the manifest declares it. */
|
|
465
|
+
users?: PluginUserLibrary;
|
|
466
|
+
/** @experimental M35 U1 (W6): this plugin's own account fields. Present only when the manifest declares userFields. */
|
|
467
|
+
userFields?: PluginUserFields;
|
|
468
|
+
/** @experimental M35 U1 (W52): whether the caller holds `action` (a core action or one of this
|
|
469
|
+
* plugin's own; another plugin's throws TypeError), answered by the core's one gate. On "admin" and
|
|
470
|
+
* "apiKey" routes only. */
|
|
471
|
+
can?: (action: string) => Promise<boolean>;
|
|
472
|
+
/** @experimental M35 U1 (W52): whether the caller may read, or edit, one page, by the role's action and
|
|
473
|
+
* the page's restrictions; false for a missing or trashed page. On "admin" and "apiKey" routes only. */
|
|
474
|
+
canAccessPage?: (pageId: string, mode: "read" | "edit") => Promise<boolean>;
|
|
475
|
+
/** @experimental M35 B1a: another plugin's services, for the contracts this plugin uses. */
|
|
476
|
+
services?: PluginServices;
|
|
477
|
+
/** @experimental M35 B1a: this plugin's own declared events. */
|
|
478
|
+
events?: PluginEvents;
|
|
479
|
+
/** @experimental M35 P3 (W18): on a site route that answers after the pages only. */
|
|
480
|
+
address?: SiteRouteAddress;
|
|
481
|
+
/** @experimental M35 P4 (W53): renders a published page to HTML (PluginRenderPage). Set by the host. */
|
|
482
|
+
renderPage?: PluginRenderPage;
|
|
483
|
+
/** @experimental M35 P4 (W32): the core's render cache (PluginRenderCache). Set by the host. */
|
|
484
|
+
renderCache?: PluginRenderCache;
|
|
485
|
+
/** @experimental M35 U2b (W8): the signed-in visitor of the site, on site routes and "public" routes only, for a
|
|
486
|
+
* plugin that declares visitorIdentity (absent otherwise). Null for an anonymous request, a site with visitor
|
|
487
|
+
* accounts off, or a POST whose Origin or Sec-Fetch-Site is not the site itself. Frozen, and only for this request:
|
|
488
|
+
* kept past it, it opens no members-only page. */
|
|
489
|
+
visitor?: PluginVisitor | null;
|
|
490
|
+
/** @experimental M35 U2b (W8): the site's visitor accounts by id. Present only when the manifest declares visitorIdentity. */
|
|
491
|
+
visitors?: PluginVisitors;
|
|
72
492
|
}
|
package/dist/tailwind.js
CHANGED
|
@@ -3,10 +3,15 @@
|
|
|
3
3
|
// Tailwind 3. Use it as `theme` in the plugin's tailwind.config, so the
|
|
4
4
|
// plugin's classes map to the same CSS variables as the admin's.
|
|
5
5
|
//
|
|
6
|
-
// On Tailwind 4,
|
|
7
|
-
// `@
|
|
8
|
-
// `@import "tailwindcss/
|
|
6
|
+
// On Tailwind 4 (the admin's version, 4.3.3), import
|
|
7
|
+
// `@kardalum/plugin-sdk/tailwind/theme.css` between
|
|
8
|
+
// `@import "tailwindcss/theme.css" layer(theme) theme(reference);` and
|
|
9
|
+
// `@import "tailwindcss/utilities.css" layer(utilities) source(none);`, then an
|
|
10
|
+
// `@source` line for the plugin's own files (never the whole
|
|
9
11
|
// `@import "tailwindcss"`, whose base reset would leak into the admin): the
|
|
10
|
-
// same scales as an `@theme` block, generated from the same source.
|
|
11
|
-
//
|
|
12
|
+
// same scales as an `@theme` block, generated from the same source.
|
|
13
|
+
// `theme(reference)` writes no `:root, :host` block, which the "admin styles"
|
|
14
|
+
// delivery check refuses; `kardalum plugin build` puts the stylesheet in the
|
|
15
|
+
// plugin's own layer. It only references variables, so a standalone preview
|
|
16
|
+
// also needs `tokens.css`.
|
|
12
17
|
export { tailwindTheme } from "@kardalum/design-tokens";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { TemplateReadRefusal } from "@kardalum/api-schemas";
|
|
2
|
+
/**
|
|
3
|
+
* M35 P3 (W19): thrown by a template call's published reads (`context.getPublishedContent` and the
|
|
4
|
+
* four beside it on TemplateCallContext) when the read cannot run: `spent` (the render's list read
|
|
5
|
+
* budget, TEMPLATE_PLUGIN_READS_PER_RENDER_MAX or TEMPLATE_PLUGIN_SEARCHES_PER_RENDER_MAX), `ended`
|
|
6
|
+
* (the call already timed out), `unavailable` (no reader where the call runs). Catch it to write
|
|
7
|
+
* something else; uncaught, the call is dropped like any failing call. Test it with
|
|
8
|
+
* isTemplateReadRefusedError, never `instanceof`.
|
|
9
|
+
* @experimental
|
|
10
|
+
*/
|
|
11
|
+
export declare class TemplateReadRefusedError extends Error {
|
|
12
|
+
readonly reason: TemplateReadRefusal;
|
|
13
|
+
constructor(reason: TemplateReadRefusal);
|
|
14
|
+
}
|
|
15
|
+
/** True for a TemplateReadRefusedError from ANY copy of this SDK (a plugin bundles its own copy). */
|
|
16
|
+
export declare function isTemplateReadRefusedError(value: unknown): value is TemplateReadRefusedError;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* M35 P3 (W19): thrown by a template call's published reads (`context.getPublishedContent` and the
|
|
3
|
+
* four beside it on TemplateCallContext) when the read cannot run: `spent` (the render's list read
|
|
4
|
+
* budget, TEMPLATE_PLUGIN_READS_PER_RENDER_MAX or TEMPLATE_PLUGIN_SEARCHES_PER_RENDER_MAX), `ended`
|
|
5
|
+
* (the call already timed out), `unavailable` (no reader where the call runs). Catch it to write
|
|
6
|
+
* something else; uncaught, the call is dropped like any failing call. Test it with
|
|
7
|
+
* isTemplateReadRefusedError, never `instanceof`.
|
|
8
|
+
* @experimental
|
|
9
|
+
*/
|
|
10
|
+
export class TemplateReadRefusedError extends Error {
|
|
11
|
+
reason;
|
|
12
|
+
constructor(reason) {
|
|
13
|
+
super(`template read refused: ${reason}`);
|
|
14
|
+
this.name = "TemplateReadRefusedError";
|
|
15
|
+
this.reason = reason;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/** True for a TemplateReadRefusedError from ANY copy of this SDK (a plugin bundles its own copy). */
|
|
19
|
+
export function isTemplateReadRefusedError(value) {
|
|
20
|
+
return value instanceof Error && value.name === "TemplateReadRefusedError";
|
|
21
|
+
}
|