@kardalum/plugin-sdk 0.20.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 +70 -0
- package/dist/admin-section-registry.d.ts +33 -1
- package/dist/admin-section-registry.js +67 -0
- package/dist/capabilities.js +46 -1
- package/dist/consent-entry.d.ts +11 -0
- package/dist/consent-entry.js +18 -0
- package/dist/content-library.d.ts +17 -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 +2 -0
- package/dist/content-picker/page-picker-sheet.js +1 -1
- package/dist/content-picker/page-picker.d.ts +18 -0
- package/dist/content-picker/page-picker.js +20 -0
- package/dist/datatype-validation.js +10 -2
- package/dist/datatypes-entry.d.ts +1 -0
- package/dist/datatypes-entry.js +2 -0
- package/dist/entitlement-types.d.ts +18 -1
- package/dist/host-entry.d.ts +7 -1
- package/dist/host-entry.js +14 -1
- package/dist/index.d.ts +35 -7
- package/dist/index.js +46 -5
- package/dist/mail.d.ts +6 -2
- package/dist/manifest-entry.d.ts +22 -4
- package/dist/manifest-entry.js +25 -1
- package/dist/manifest-schema.d.ts +570 -31
- package/dist/manifest-schema.js +240 -12
- package/dist/manifest.d.ts +757 -32
- package/dist/manifest.js +8 -4
- package/dist/plugin-context.d.ts +47 -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 +152 -11
- package/dist/plugin-screen-context.js +30 -0
- package/dist/providers.d.ts +47 -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 +27 -21
- 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 +38 -18
- 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/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 +59 -0
- package/dist/sdk-strings.js +64 -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/structured-storage-types.d.ts +124 -4
- 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 -1
- package/dist/text-entry.js +3 -2
- package/dist/tokens/system-dark.css +1 -0
- package/dist/tokens/tailwind-theme.css +2 -0
- package/dist/tokens/tokens.css +4 -0
- package/dist/tokens/tokens.json +5 -1
- 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/content-list-view.js +207 -8
- package/dist/views/content-picker-view.js +1 -1
- package/dist/views/rich-text-view.d.ts +2 -0
- package/dist/views/rich-text-view.js +182 -24
- 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 +127 -8
- package/node_modules/@kardalum/api-schemas/dist/ai-connections.schema.js +82 -7
- package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.d.ts +5 -1
- package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.js +2 -2
- package/node_modules/@kardalum/api-schemas/dist/built-in-editor-ids.d.ts +7 -0
- package/node_modules/@kardalum/api-schemas/dist/built-in-editor-ids.js +11 -0
- package/node_modules/@kardalum/api-schemas/dist/capability-detail.d.ts +1 -1
- package/node_modules/@kardalum/api-schemas/dist/capability-detail.js +18 -0
- package/node_modules/@kardalum/api-schemas/dist/content-list.schema.d.ts +80 -0
- package/node_modules/@kardalum/api-schemas/dist/content-list.schema.js +41 -2
- 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/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 +50 -13
- package/node_modules/@kardalum/api-schemas/dist/core-actions.js +19 -10
- package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.d.ts +77 -0
- package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +37 -0
- 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/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 +52 -14
- package/node_modules/@kardalum/api-schemas/dist/index.js +53 -9
- 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/mail-rules.d.ts +4 -2
- package/node_modules/@kardalum/api-schemas/dist/mail-rules.js +6 -1
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.d.ts +178 -2
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +10 -0
- package/node_modules/@kardalum/api-schemas/dist/mcp-plugins.schema.d.ts +3 -3
- package/node_modules/@kardalum/api-schemas/dist/media-api.schema.d.ts +16 -0
- package/node_modules/@kardalum/api-schemas/dist/media.schema.d.ts +4 -0
- package/node_modules/@kardalum/api-schemas/dist/media.schema.js +4 -0
- package/node_modules/@kardalum/api-schemas/dist/nested-validation.d.ts +7 -0
- package/node_modules/@kardalum/api-schemas/dist/nested-validation.js +51 -2
- 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/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-content-access.d.ts +4 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-content-access.js +12 -2
- 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-docs-api.schema.d.ts +18 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs.d.ts +18 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs.js +5 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-durable-hooks.d.ts +10 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-durable-hooks.js +48 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-editor-extensions.d.ts +5 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-editor-extensions.js +6 -4
- 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-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 +12 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-held-embeds.js +3 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.d.ts +2 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.js +3 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-install.d.ts +67 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-install.js +15 -0
- 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-management-api.schema.d.ts +80 -15
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +67 -23
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.d.ts +10 -3
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.js +33 -8
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.d.ts +2 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.js +7 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-outbound.d.ts +1 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-providers.d.ts +43 -7
- package/node_modules/@kardalum/api-schemas/dist/plugin-providers.js +36 -5
- 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-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 +10 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-settings.js +10 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-site-extensions.d.ts +171 -4
- package/node_modules/@kardalum/api-schemas/dist/plugin-site-extensions.js +406 -42
- 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-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-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/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 +303 -0
- package/node_modules/@kardalum/api-schemas/dist/render-editing.js +61 -0
- 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 +66 -1
- package/node_modules/@kardalum/api-schemas/dist/rich-text-shape.js +465 -7
- package/node_modules/@kardalum/api-schemas/dist/rich-text-text.js +15 -118
- package/node_modules/@kardalum/api-schemas/dist/sandbox-attach.schema.d.ts +110 -0
- 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 +9 -2
- package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.js +7 -2
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +26 -0
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.js +19 -0
- 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 +5 -3
- package/node_modules/@kardalum/api-schemas/dist/sign-in.schema.js +3 -1
- 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/structured-fields.schema.d.ts +4 -0
- package/node_modules/@kardalum/api-schemas/dist/structured-fields.schema.js +28 -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/user-api.schema.d.ts +14 -0
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +2 -0
- 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 +1 -0
- package/node_modules/@kardalum/design-tokens/dist/build-css.js +9 -1
- package/node_modules/@kardalum/design-tokens/dist/system-dark.css +1 -0
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.css +2 -0
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.d.ts +1 -0
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.js +2 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.css +4 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.js +6 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.json +5 -1
- package/node_modules/@kardalum/design-tokens/dist/types.d.ts +4 -0
- package/node_modules/@kardalum/plugin-package/dist/build-reference.d.ts +17 -0
- package/node_modules/@kardalum/plugin-package/dist/build-reference.js +9 -0
- package/node_modules/@kardalum/plugin-package/dist/capabilities.d.ts +1 -1
- package/node_modules/@kardalum/plugin-package/dist/capabilities.js +276 -19
- package/node_modules/@kardalum/plugin-package/dist/client-bundle.d.ts +1 -1
- package/node_modules/@kardalum/plugin-package/dist/client-bundle.js +23 -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/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.js +21 -8
- package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.js +1 -1
- package/node_modules/@kardalum/plugin-package/dist/delivery/editor-extensions.js +23 -10
- package/node_modules/@kardalum/plugin-package/dist/delivery/icons.js +3 -2
- package/node_modules/@kardalum/plugin-package/dist/delivery/index.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/index.js +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/label-languages.js +30 -2
- package/node_modules/@kardalum/plugin-package/dist/delivery/licence-check.js +6 -2
- 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/providers.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/providers.js +24 -6
- package/node_modules/@kardalum/plugin-package/dist/delivery/registry.js +15 -0
- 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 +1 -1
- package/node_modules/@kardalum/plugin-package/dist/delivery/server-powers.js +14 -4
- 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.js +44 -11
- package/node_modules/@kardalum/plugin-package/dist/delivery/types.d.ts +7 -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 +4 -0
- package/node_modules/@kardalum/plugin-package/dist/index.js +5 -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/textarea.d.ts +6 -0
- package/node_modules/@kardalum/ui/dist/components/textarea.js +7 -0
- package/node_modules/@kardalum/ui/dist/index.d.ts +2 -0
- package/node_modules/@kardalum/ui/dist/index.js +2 -0
- package/package.json +15 -3
package/dist/manifest.d.ts
CHANGED
|
@@ -1,20 +1,30 @@
|
|
|
1
1
|
import type { ComponentType } from "react";
|
|
2
|
-
import type {
|
|
2
|
+
import type { DataTypeValidatorIssue, RichTextButton, RichTextMarkDeclaration, RichTextNodeDeclaration } from "@kardalum/api-schemas";
|
|
3
|
+
import type { AdminSlotPlace, BadgeTone, PluginActionOfferTarget, PluginDataTypeConfig, PluginDocumentType, PluginDocsPage, PluginNotificationKind, PluginInstallDeclaration, PluginLabel, PluginSettingField, PluginUserAccess, PluginUserField, PluginVendorServiceDeclaration, ResolvedInstallAnswers } from "@kardalum/api-schemas";
|
|
3
4
|
export type { InstallChoice, InstallOption, InstallStep, PluginInstallDeclaration, ResolvedInstallAnswers } from "@kardalum/api-schemas";
|
|
4
5
|
export type { PluginDataTypeConfig } from "@kardalum/api-schemas";
|
|
5
6
|
import type { ThemeTokenOverrides } from "@kardalum/design-tokens";
|
|
6
7
|
import { VIEW_BEARING_CONTRIBUTIONS, declaresClientBundle } from "@kardalum/plugin-package/reference";
|
|
7
8
|
import type { ZodType } from "zod";
|
|
8
9
|
import type { DataTypePlugin } from "./data-type-plugin.js";
|
|
10
|
+
import type { IconName } from "./icon-name.js";
|
|
9
11
|
import type { BUILT_IN_RAIL_SECTIONS } from "./manifest-schema.js";
|
|
10
|
-
import type { PluginAddressLookup, PluginApiRouteContext, PluginServerContextBase, ScopedStructuredStorage } from "./structured-storage-types.js";
|
|
12
|
+
import type { PluginAddressLookup, PluginApiRouteContext, PluginRenderCache, PluginRenderPage, PluginServerContextBase, ScopedStructuredStorage } from "./structured-storage-types.js";
|
|
11
13
|
import type { PluginMail } from "./mail.js";
|
|
12
14
|
import type { OutboundRequestsContribution, PluginOutbound } from "./outbound.js";
|
|
13
15
|
import type { PluginSealing, SealedValueContribution } from "./sealing.js";
|
|
14
|
-
|
|
16
|
+
import type { PluginUserFields } from "./user-library.js";
|
|
17
|
+
import type { ExposedServiceContribution, PluginEventContribution, PluginEventKey, PluginEvents, PluginServices, ServiceContractContribution, UsedServiceContribution } from "./services.js";
|
|
18
|
+
export type * from "./services.js";
|
|
19
|
+
import type { PluginVisitor, PluginVisitorAccountSectionContribution, PluginVisitorDataContribution, PluginVisitorGroupContribution, PluginVisitorIdentityContribution, PluginVisitors, VisitorGroupHookPayload, VisitorHookPayload, VisitorSignInHookPayload } from "./visitors.js";
|
|
20
|
+
export type * from "./visitors.js";
|
|
21
|
+
import type { RouteUploadsDeclaration } from "./uploads.js";
|
|
22
|
+
export type { PluginKeepResult, PluginUploadedFile, PluginUploads, RouteUploadsDeclaration } from "./uploads.js";
|
|
23
|
+
export type { GetPublishedContentOptions, ListPublishedPagesOptions, PageReadAsOptions, PageAddresses, PageAddressTarget, PageAtAddressAnswer, PluginAddressLookup, PluginServerContextBase, PluginSimpleStorage, PublishedContent, PublishedPageItem, PublishedPagesPage, SiteOfHost, SiteOfHostOptions } from "./structured-storage-types.js";
|
|
24
|
+
export type { ListPublishedOptions, PublishedFilter, PublishedListItem, PublishedListPage, PublishedSearchPage, SearchPublishedOptions } from "@kardalum/api-schemas";
|
|
15
25
|
import type { Entitlement, PluginTaskContext } from "./entitlement-types.js";
|
|
16
|
-
import type { AuditActorKind, HeldEmbedRequest, PageAddress, PageHeadEntry, PluginHeldEmbed, PluginContentAccess, PluginFieldInfo, PluginMediaAccess, SettingsChangeArea, SiteFallbackAnswer, TemplateData } from "@kardalum/api-schemas";
|
|
17
|
-
import type { MailSenderContribution, MediaStoreContribution, PluginSettingsReader, ProtectionProviderContribution, SearchProviderContribution, SecretDeclaration, SignInProviderContribution } from "./providers.js";
|
|
26
|
+
import type { AuditActorKind, GuardFailureMode, GuardOperation, GuardPoint, GuardSubject, HeldEmbedRequest, PageAddress, PageAddressState, PageCacheAnswer, PageHeadEntry, PluginConsentView, PluginHeldEmbed, PluginContentAccess, PluginFieldInfo, PluginMediaAccess, SettingsChangeArea, SiteFallbackAnswer, RequestGuardAnswer, SiteRequestSurface, TemplateBlockOnFailure, TemplateBlockWrapElement, TemplateData, TemplateFilterOnFailure } from "@kardalum/api-schemas";
|
|
27
|
+
import type { ConsentToolContribution, MailSenderContribution, MediaStoreContribution, PluginSettingsReader, ProtectionProviderContribution, SearchProviderContribution, SecretDeclaration, SignInProviderContribution, SignInStepContribution } from "./providers.js";
|
|
18
28
|
/**
|
|
19
29
|
* The seven plugin types. Since S268 this is a marketplace listing and
|
|
20
30
|
* filter label only: it does not decide which contributions a plugin may
|
|
@@ -131,8 +141,9 @@ export interface PluginMigrationHooks {
|
|
|
131
141
|
* content:afterRestore and content:afterUnpublish (ContentLifecycleHookPayload). The media events
|
|
132
142
|
* (MediaHookPayload), user:afterCreate and user:afterDelete (UserHookPayload), user:afterLogin
|
|
133
143
|
* (UserLoginHookPayload), settings:afterChange (SettingsHookPayload), the five plugin lifecycle
|
|
134
|
-
* events (PluginLifecycleHookPayload) and audit:afterRecord (AuditHookPayload).
|
|
135
|
-
|
|
144
|
+
* events (PluginLifecycleHookPayload) and audit:afterRecord (AuditHookPayload).
|
|
145
|
+
* M35 B2: eleven more, experimental: the content model, people, site, page view and system events. */
|
|
146
|
+
export type HookEvent = "content:afterSave" | "content:afterPublish" | "content:afterTrash" | "content:afterRestore" | "content:afterUnpublish" | "content:afterMove" | "media:afterUpload" | "media:afterTrash" | "media:afterDelete" | "user:afterLogin" | "user:afterCreate" | "user:afterDelete" | "settings:afterChange" | "plugin:afterInstall" | "plugin:afterUninstall" | "plugin:afterUpdate" | "plugin:afterActivate" | "plugin:afterDeactivate" | "audit:afterRecord" | "content:afterSort" | "content:afterAccessChange" | "documentType:afterChange" | "dataType:afterChange" | "role:afterChange" | "user:afterChange" | "site:afterAddressChange" | "site:afterPageViews" | "system:afterStart" | "system:beforeShutdown" | "system:afterError" | "visitor:afterRegister" | "visitor:afterConfirm" | "visitor:afterSignIn" | "visitor:afterGroupChange" | "visitor:afterDelete";
|
|
136
147
|
export interface ContentLifecycleHookPayload {
|
|
137
148
|
event: "content:afterPublish" | "content:afterTrash" | "content:afterRestore" | "content:afterUnpublish";
|
|
138
149
|
contentId: string;
|
|
@@ -161,6 +172,8 @@ export interface UserLoginHookPayload {
|
|
|
161
172
|
userId: string;
|
|
162
173
|
method: "password" | "provider";
|
|
163
174
|
provider: string | null;
|
|
175
|
+
/** M35 U3a (D12, experimental): the steps passed, `<pluginId>/<stepId>`; absent when none was asked. */
|
|
176
|
+
steps?: string[];
|
|
164
177
|
occurredAt: string;
|
|
165
178
|
}
|
|
166
179
|
/** M32 F3: a media item was uploaded, moved to the trash or deleted for good. */
|
|
@@ -173,7 +186,9 @@ export interface MediaHookPayload {
|
|
|
173
186
|
}
|
|
174
187
|
/** M32 F3: a settings area changed. `keys` names what changed, never the values. M32 F4d (D6): in
|
|
175
188
|
* the `plugin` area, `pluginId` names the plugin whose settings changed and `keys` its field ids.
|
|
176
|
-
* M32 H: in the `mail` area, a form reply switch carries the plugin's `pluginId` and `keys: ["on"]`.
|
|
189
|
+
* M32 H: in the `mail` area, a form reply switch carries the plugin's `pluginId` and `keys: ["on"]`.
|
|
190
|
+
* M35 U1: in the `server` area, the form protection chosen for one plugin's visitor sends carries that
|
|
191
|
+
* plugin's `pluginId` and `keys: ["formProtectionCallers"]`; it is not a change to its settings. */
|
|
177
192
|
export interface SettingsHookPayload {
|
|
178
193
|
event: "settings:afterChange";
|
|
179
194
|
area: SettingsChangeArea;
|
|
@@ -212,6 +227,12 @@ export interface ContentMoveHookPayload {
|
|
|
212
227
|
path: string;
|
|
213
228
|
previousPath: string;
|
|
214
229
|
reason: "move" | "rename";
|
|
230
|
+
/** M35 B2 (experimental, evidence 93): the page's address in every language of the site as it was
|
|
231
|
+
* before the move, read just before the write; null when no plugin hooked the move or the old
|
|
232
|
+
* place had no address a visitor reaches. Absent when the site has more than EVENT_ADDRESSES_MAX
|
|
233
|
+
* languages (never a cut list), and from an event an older server raised: read the old place then.
|
|
234
|
+
* @experimental */
|
|
235
|
+
previousAddresses?: PageAddressState[] | null;
|
|
215
236
|
occurredAt: string;
|
|
216
237
|
}
|
|
217
238
|
/** M32 F4c: an audit entry was recorded. No email, address or person's name. */
|
|
@@ -235,8 +256,157 @@ export interface AuditHookPayload {
|
|
|
235
256
|
* checked list of keys exists yet, so none is handed over; a later release may add allowed keys. */
|
|
236
257
|
summary: Record<string, unknown> | null;
|
|
237
258
|
}
|
|
259
|
+
/** Who made a write the event reports: the audit's actor kinds, and the user, key or plugin id (null for the site itself).
|
|
260
|
+
* @experimental */
|
|
261
|
+
export interface HookActor {
|
|
262
|
+
actorKind: AuditActorKind;
|
|
263
|
+
actorId: string | null;
|
|
264
|
+
}
|
|
265
|
+
/** M35 B2 (experimental): the order of a parent's children, or of the sites, changed.
|
|
266
|
+
* @experimental */
|
|
267
|
+
export interface ContentSortHookPayload extends HookActor {
|
|
268
|
+
event: "content:afterSort";
|
|
269
|
+
/** Null for the top level (the sites). */
|
|
270
|
+
parentId: string | null;
|
|
271
|
+
parentPath: string | null;
|
|
272
|
+
/** How many pages the new order named. */
|
|
273
|
+
count: number;
|
|
274
|
+
occurredAt: string;
|
|
275
|
+
}
|
|
276
|
+
/** M35 B2 (experimental): who may read or change a page was changed. Never the grants themselves.
|
|
277
|
+
* @experimental */
|
|
278
|
+
export interface ContentAccessHookPayload extends HookActor {
|
|
279
|
+
event: "content:afterAccessChange";
|
|
280
|
+
contentId: string;
|
|
281
|
+
path: string;
|
|
282
|
+
/** M35 U2b: "audience" when who may see the page on the public site changed. */
|
|
283
|
+
change: "permissions" | "restrictions" | "audience";
|
|
284
|
+
occurredAt: string;
|
|
285
|
+
}
|
|
286
|
+
/** M35 B2 (experimental): a document type was created, changed or deleted. Field ids only, never a setting's value.
|
|
287
|
+
* @experimental */
|
|
288
|
+
export interface DocumentTypeHookPayload extends HookActor {
|
|
289
|
+
event: "documentType:afterChange";
|
|
290
|
+
documentTypeId: string;
|
|
291
|
+
name: string;
|
|
292
|
+
kind: "page" | "element" | "media";
|
|
293
|
+
change: "create" | "update" | "delete";
|
|
294
|
+
/** The ids of the fields added, removed or changed, sorted, at most DOCUMENT_TYPE_EVENT_FIELDS_MAX; empty for a delete. */
|
|
295
|
+
fieldIds: string[];
|
|
296
|
+
occurredAt: string;
|
|
297
|
+
}
|
|
298
|
+
/** M35 B2 (experimental): a data type was created, changed or deleted. Never its settings.
|
|
299
|
+
* @experimental */
|
|
300
|
+
export interface DataTypeHookPayload extends HookActor {
|
|
301
|
+
event: "dataType:afterChange";
|
|
302
|
+
dataTypeId: string;
|
|
303
|
+
name: string;
|
|
304
|
+
editorId: string;
|
|
305
|
+
change: "create" | "update" | "delete";
|
|
306
|
+
occurredAt: string;
|
|
307
|
+
}
|
|
308
|
+
/** M35 B2 (experimental): a role was created, changed or deleted, with the actions it gained and lost.
|
|
309
|
+
* @experimental */
|
|
310
|
+
export interface RoleHookPayload extends HookActor {
|
|
311
|
+
event: "role:afterChange";
|
|
312
|
+
roleId: string;
|
|
313
|
+
label: string;
|
|
314
|
+
change: "create" | "update" | "delete";
|
|
315
|
+
/** Sorted, at most ROLE_EVENT_ACTIONS_MAX each. */
|
|
316
|
+
actionsAdded: string[];
|
|
317
|
+
actionsRemoved: string[];
|
|
318
|
+
occurredAt: string;
|
|
319
|
+
}
|
|
320
|
+
/** M35 B2 (experimental): a user's role changed, the account was disabled or enabled, or (M35 U2a, carried
|
|
321
|
+
* from 35-U1) a plugin's account fields of the person changed. The user event's own shape: `name` is the
|
|
322
|
+
* stored name (null for none), never an email, an address or a field's value.
|
|
323
|
+
* @experimental */
|
|
324
|
+
export interface UserChangeHookPayload {
|
|
325
|
+
event: "user:afterChange";
|
|
326
|
+
userId: string;
|
|
327
|
+
name: string | null;
|
|
328
|
+
role: string;
|
|
329
|
+
change: "role" | "disabled" | "enabled" | "fields";
|
|
330
|
+
/** The role before a role change; null for the other changes. */
|
|
331
|
+
previousRole: string | null;
|
|
332
|
+
/** For a `fields` change, the plugin whose fields changed; null for the other changes. */
|
|
333
|
+
pluginId: string | null;
|
|
334
|
+
/** For a `fields` change, the ids of the fields whose value changed, sorted; empty for the other changes. Never a value. */
|
|
335
|
+
fieldIds: string[];
|
|
336
|
+
actorId: string | null;
|
|
337
|
+
occurredAt: string;
|
|
338
|
+
}
|
|
339
|
+
/** M35 B2 (experimental, evidence 104): a site's addresses changed without a page move (its domains,
|
|
340
|
+
* or which site is the default). The site root's address in every language before and after.
|
|
341
|
+
* @experimental */
|
|
342
|
+
export interface SiteAddressHookPayload extends HookActor {
|
|
343
|
+
event: "site:afterAddressChange";
|
|
344
|
+
siteId: string;
|
|
345
|
+
change: "hostnames" | "default";
|
|
346
|
+
previousAddresses: PageAddressState[] | null;
|
|
347
|
+
addresses: PageAddressState[] | null;
|
|
348
|
+
occurredAt: string;
|
|
349
|
+
}
|
|
350
|
+
/** M35 B2 (experimental, W4): one page and language's views in a batch.
|
|
351
|
+
* @experimental */
|
|
352
|
+
export interface PageViewCount {
|
|
353
|
+
pageId: string;
|
|
354
|
+
path: string;
|
|
355
|
+
documentTypeId: string;
|
|
356
|
+
siteId: string | null;
|
|
357
|
+
culture: string;
|
|
358
|
+
views: number;
|
|
359
|
+
/** Of `views`, those whose user agent read as a bot, a script or nothing. */
|
|
360
|
+
likelyBotViews: number;
|
|
361
|
+
}
|
|
362
|
+
/** M35 B2 (experimental, W4): the public pages served by this instance since the last batch,
|
|
363
|
+
* counted. Never an address, agent, cookie, referrer or the time of one view.
|
|
364
|
+
* @experimental */
|
|
365
|
+
export interface SitePageViewsHookPayload {
|
|
366
|
+
event: "site:afterPageViews";
|
|
367
|
+
instanceId: string;
|
|
368
|
+
/** The first counted view's time and the batch's end. */
|
|
369
|
+
from: string;
|
|
370
|
+
to: string;
|
|
371
|
+
pages: PageViewCount[];
|
|
372
|
+
/** Views past PAGE_VIEW_BATCH_PAGES_MAX pairs, counted but not itemised. */
|
|
373
|
+
otherViews: number;
|
|
374
|
+
occurredAt: string;
|
|
375
|
+
}
|
|
376
|
+
/** M35 B2 (experimental, W31): this server instance answers requests. Once per process.
|
|
377
|
+
* @experimental */
|
|
378
|
+
export interface SystemStartHookPayload {
|
|
379
|
+
event: "system:afterStart";
|
|
380
|
+
/** This process's boot id: the same in every event it raises, new at every start. */
|
|
381
|
+
instanceId: string;
|
|
382
|
+
/** The running Kardalum version. */
|
|
383
|
+
version: string;
|
|
384
|
+
occurredAt: string;
|
|
385
|
+
}
|
|
386
|
+
/** M35 B2 (experimental, W31): this instance is shutting down; handlers get HOOK_DRAIN_WAIT_MS. Never durable.
|
|
387
|
+
* @experimental */
|
|
388
|
+
export interface SystemShutdownHookPayload {
|
|
389
|
+
event: "system:beforeShutdown";
|
|
390
|
+
instanceId: string;
|
|
391
|
+
occurredAt: string;
|
|
392
|
+
}
|
|
393
|
+
/** M35 B2 (experimental, W31): a request was answered with a 5xx status. Never the message, stack, body or query.
|
|
394
|
+
* @experimental */
|
|
395
|
+
export interface SystemErrorHookPayload {
|
|
396
|
+
event: "system:afterError";
|
|
397
|
+
requestId: string;
|
|
398
|
+
method: string;
|
|
399
|
+
/** The route pattern (`/api/manage/v1/content/:id`), "" when no route matched; at most SYSTEM_ERROR_ROUTE_MAX characters. */
|
|
400
|
+
route: string;
|
|
401
|
+
status: number;
|
|
402
|
+
/** The error's class name (errorClassOf), "Error" when unreadable. */
|
|
403
|
+
errorClass: string;
|
|
404
|
+
/** Errors not raised since the last event because of SYSTEM_ERROR_EVENTS_PER_MINUTE. */
|
|
405
|
+
suppressed: number;
|
|
406
|
+
occurredAt: string;
|
|
407
|
+
}
|
|
238
408
|
/** Every payload the hook engine hands a handler. */
|
|
239
|
-
export type HookPayload = ContentLifecycleHookPayload | ContentSaveHookPayload | ContentMoveHookPayload | UserHookPayload | UserLoginHookPayload | MediaHookPayload | SettingsHookPayload | PluginLifecycleHookPayload | AuditHookPayload;
|
|
409
|
+
export type HookPayload = ContentLifecycleHookPayload | ContentSaveHookPayload | ContentMoveHookPayload | UserHookPayload | UserLoginHookPayload | MediaHookPayload | SettingsHookPayload | PluginLifecycleHookPayload | AuditHookPayload | ContentSortHookPayload | ContentAccessHookPayload | DocumentTypeHookPayload | DataTypeHookPayload | RoleHookPayload | UserChangeHookPayload | SiteAddressHookPayload | SitePageViewsHookPayload | SystemStartHookPayload | SystemShutdownHookPayload | SystemErrorHookPayload | VisitorHookPayload | VisitorSignInHookPayload | VisitorGroupHookPayload;
|
|
240
410
|
export interface PluginHookContext extends PluginServerContextBase, PluginAddressLookup {
|
|
241
411
|
/** M33 K19: the id of this occurrence of the event, minted once when it is raised: the same for
|
|
242
412
|
* every plugin that hears it and on every replay of a durable event, so a handler recognises an
|
|
@@ -251,6 +421,18 @@ export interface PluginHookContext extends PluginServerContextBase, PluginAddres
|
|
|
251
421
|
/** M33 K17: seals values the plugin makes under a key of its own for each declared kind (`seal`, `open`).
|
|
252
422
|
* Present only for a plugin that declares `sealedValues`; a call after the plugin is switched off answers `inactive`. */
|
|
253
423
|
sealing?: PluginSealing;
|
|
424
|
+
/** @experimental M35 U1 (W6): this plugin's own account fields. Present only when the manifest declares userFields. */
|
|
425
|
+
userFields?: PluginUserFields;
|
|
426
|
+
/** @experimental M35 B1a: another plugin's services, for the contracts this plugin uses. */
|
|
427
|
+
services?: PluginServices;
|
|
428
|
+
/** @experimental M35 B1a: this plugin's own declared events. */
|
|
429
|
+
events?: PluginEvents;
|
|
430
|
+
/** @experimental M35 P4 (W53): renders a published page to HTML (PluginRenderPage). Set by the host. */
|
|
431
|
+
renderPage?: PluginRenderPage;
|
|
432
|
+
/** @experimental M35 P4 (W32): the core's render cache (PluginRenderCache). Set by the host. */
|
|
433
|
+
renderCache?: PluginRenderCache;
|
|
434
|
+
/** @experimental M35 U2b (W8): the site's visitor accounts by id. Present only when the manifest declares visitorIdentity. */
|
|
435
|
+
visitors?: PluginVisitors;
|
|
254
436
|
}
|
|
255
437
|
/** M33 K1: what a site fallback's `resolve` receives. Today the members every server context has;
|
|
256
438
|
* a member a fallback must not get (an event id, a caller) is declared on the other contexts only. */
|
|
@@ -266,7 +448,71 @@ export type DurableHookEntry = {
|
|
|
266
448
|
};
|
|
267
449
|
/** M33 K18: a `hooks` value: a handler, or a durable one. */
|
|
268
450
|
export type PluginHookEntry = HookHandler | DurableHookEntry;
|
|
269
|
-
|
|
451
|
+
/** M35 B1a (experimental): another plugin's events are heard under `<plugin id>:<event name>`, plain or durable. */
|
|
452
|
+
export type PluginHooks = Partial<Record<HookEvent, PluginHookEntry>> & {
|
|
453
|
+
[event: PluginEventKey]: PluginHookEntry | undefined;
|
|
454
|
+
};
|
|
455
|
+
/** M35 B2 (experimental, W1): what a guard is asked. A frozen copy made for this guard alone.
|
|
456
|
+
* @experimental */
|
|
457
|
+
export interface ContentGuardRequest {
|
|
458
|
+
point: GuardPoint;
|
|
459
|
+
operation: GuardOperation;
|
|
460
|
+
/** Null for a create. */
|
|
461
|
+
contentId: string | null;
|
|
462
|
+
documentTypeId: string;
|
|
463
|
+
/** The document type's name, as `contentAccess` and `documentTypes` name it. */
|
|
464
|
+
documentType: string;
|
|
465
|
+
/** The page's tree path now; null for a create. */
|
|
466
|
+
path: string | null;
|
|
467
|
+
/** Where the page goes: a create, a copy, a move or a restore under a parent (parentId null for the top level). */
|
|
468
|
+
destination: {
|
|
469
|
+
parentId: string | null;
|
|
470
|
+
parentPath: string | null;
|
|
471
|
+
} | null;
|
|
472
|
+
/** A save that renames the page, and so moves it and its subtree. */
|
|
473
|
+
renames: boolean;
|
|
474
|
+
culture: string | null;
|
|
475
|
+
/** publishAll and an unpublish of every language: the languages; otherwise null. */
|
|
476
|
+
cultures: readonly string[] | null;
|
|
477
|
+
/** A publish: the version it puts live. */
|
|
478
|
+
version: number | null;
|
|
479
|
+
/** create, save, publish and publishAll only, and only for a plugin whose contentAccess declares
|
|
480
|
+
* content.read for this type: the values being saved, or the version being published (the default
|
|
481
|
+
* language's for publishAll), private fields included, as context.content would read them. */
|
|
482
|
+
values?: Readonly<Record<string, unknown>>;
|
|
483
|
+
subject: Readonly<GuardSubject>;
|
|
484
|
+
requestedAt: string;
|
|
485
|
+
}
|
|
486
|
+
/** Allow, or refuse with a snake_case code and a message (plain text, or a map with `en`).
|
|
487
|
+
* @experimental */
|
|
488
|
+
export type GuardAnswer = {
|
|
489
|
+
allow: true;
|
|
490
|
+
} | {
|
|
491
|
+
allow: false;
|
|
492
|
+
code: string;
|
|
493
|
+
message: string | Readonly<Record<string, string>>;
|
|
494
|
+
};
|
|
495
|
+
/** M35 B2: what a guard's handler receives beside the request.
|
|
496
|
+
* @experimental */
|
|
497
|
+
export interface PluginGuardContext extends PluginServerContextBase {
|
|
498
|
+
/** Aborted when GUARD_TIME_MS has passed: the write no longer waits for this answer. */
|
|
499
|
+
signal: AbortSignal;
|
|
500
|
+
/** Present only for a plugin that declares `outboundRequests`. */
|
|
501
|
+
outbound?: PluginOutbound;
|
|
502
|
+
}
|
|
503
|
+
/** M35 B2: a guard's handler.
|
|
504
|
+
* @experimental */
|
|
505
|
+
export type GuardHandler = (request: ContentGuardRequest, context: PluginGuardContext) => GuardAnswer | Promise<GuardAnswer>;
|
|
506
|
+
/** M35 B2 (experimental): one guard. At most one per point. `documentTypes` (names) limits it to
|
|
507
|
+
* those types; `onFailure` says what a timeout, a throw or an answer out of shape means
|
|
508
|
+
* (`refuse`, the default, or `allow`).
|
|
509
|
+
* @experimental */
|
|
510
|
+
export interface GuardContribution {
|
|
511
|
+
point: GuardPoint;
|
|
512
|
+
handler: GuardHandler;
|
|
513
|
+
documentTypes?: string[];
|
|
514
|
+
onFailure?: GuardFailureMode;
|
|
515
|
+
}
|
|
270
516
|
/** A slot's label: a map of language code to text, `en` required (spec D5).
|
|
271
517
|
* Each key is a language code such as `en`, `de` or `pt-BR`. The admin
|
|
272
518
|
* shows the active language's text, else English; `resolveLabel` in
|
|
@@ -362,6 +608,113 @@ export interface TreeActionContribution {
|
|
|
362
608
|
documentTypes?: string[];
|
|
363
609
|
view: ComponentType;
|
|
364
610
|
}
|
|
611
|
+
/** M35 C2 (W5, experimental): one row a content slot function is handed. A frozen copy; no field value.
|
|
612
|
+
* @experimental */
|
|
613
|
+
export interface ContentSlotRow {
|
|
614
|
+
id: string;
|
|
615
|
+
path: string;
|
|
616
|
+
name: string;
|
|
617
|
+
parentId: string | null;
|
|
618
|
+
documentTypeId: string;
|
|
619
|
+
/** The document type's name, as `documentTypes` names it. */
|
|
620
|
+
documentType: string;
|
|
621
|
+
/** The content language the screen shows. */
|
|
622
|
+
culture: string;
|
|
623
|
+
}
|
|
624
|
+
/** M35 C2: what a column's or a badge's `values` receives: at most CONTENT_SLOT_ROWS_MAX rows the person may
|
|
625
|
+
* read, of the entry's documentTypes when it names some, and the admin's language for the plugin's own words.
|
|
626
|
+
* @experimental */
|
|
627
|
+
export interface ContentSlotInput {
|
|
628
|
+
rows: ReadonlyArray<Readonly<ContentSlotRow>>;
|
|
629
|
+
/** The content language the screen shows (the default language where none is given). */
|
|
630
|
+
culture: string;
|
|
631
|
+
/** The admin's language, for the plugin's own words. */
|
|
632
|
+
language: string;
|
|
633
|
+
}
|
|
634
|
+
/** M35 C2: a list filter's `match` input: the rows of one scanned page and the chosen option value.
|
|
635
|
+
* @experimental */
|
|
636
|
+
export interface ListFilterInput extends ContentSlotInput {
|
|
637
|
+
value: string;
|
|
638
|
+
}
|
|
639
|
+
/** M35 C2: the context of a content slot call. `signal` is aborted once CONTENT_SLOT_CALL_TIME_MS has passed.
|
|
640
|
+
* A value is read from the plugin's own storage or published content, never fetched from outside while a
|
|
641
|
+
* list waits.
|
|
642
|
+
* @experimental */
|
|
643
|
+
export interface PluginContentSlotContext extends PluginServerContextBase {
|
|
644
|
+
signal: AbortSignal;
|
|
645
|
+
}
|
|
646
|
+
/** M35 C2 (experimental): a column of the Content List table. `values` answers plain text per row id (at most
|
|
647
|
+
* CONTENT_COLUMN_TEXT_MAX characters) or null; the core trims, cuts and drops what is not text.
|
|
648
|
+
* @experimental */
|
|
649
|
+
export interface ContentColumnContribution {
|
|
650
|
+
id: string;
|
|
651
|
+
label: SlotLabel;
|
|
652
|
+
/** The named permission action a subject must hold to see the column, prefixed with this plugin's own id. */
|
|
653
|
+
action: string;
|
|
654
|
+
documentTypes?: string[];
|
|
655
|
+
values: (input: ContentSlotInput, context: PluginContentSlotContext) => Record<string, string | null> | Promise<Record<string, string | null>>;
|
|
656
|
+
}
|
|
657
|
+
/** M35 C2 (experimental): a badge on rows of the content tree. `values` answers `{ text, tone? }` per row id
|
|
658
|
+
* (text at most TREE_BADGE_TEXT_MAX characters, `tone` one of BADGE_TONES, `neutral` when left out) or null.
|
|
659
|
+
* The text always carries the meaning; the tone only colours it.
|
|
660
|
+
* @experimental */
|
|
661
|
+
export interface TreeBadgeContribution {
|
|
662
|
+
id: string;
|
|
663
|
+
label: SlotLabel;
|
|
664
|
+
/** The named permission action a subject must hold to see the badge, prefixed with this plugin's own id. */
|
|
665
|
+
action: string;
|
|
666
|
+
documentTypes?: string[];
|
|
667
|
+
values: (input: ContentSlotInput, context: PluginContentSlotContext) => Record<string, {
|
|
668
|
+
text: string;
|
|
669
|
+
tone?: BadgeTone;
|
|
670
|
+
} | null> | Promise<Record<string, {
|
|
671
|
+
text: string;
|
|
672
|
+
tone?: BadgeTone;
|
|
673
|
+
} | null>>;
|
|
674
|
+
}
|
|
675
|
+
/** M35 C2 (experimental): a choice in the Content List table's filter. `options` are 1 to
|
|
676
|
+
* LIST_FILTER_OPTIONS_MAX choices (each value unique, the id rule); `match` answers the ids of the rows it
|
|
677
|
+
* is handed that match the chosen value. The core scans the list a page at a time and bounds the scan.
|
|
678
|
+
* `match` answers at most LIST_FILTER_ANSWER_MAX (200) ids; a longer array fails the call (503
|
|
679
|
+
* `list_filter_unavailable`), so answer only ids of the rows you were handed.
|
|
680
|
+
* @experimental */
|
|
681
|
+
export interface ListFilterContribution {
|
|
682
|
+
id: string;
|
|
683
|
+
label: SlotLabel;
|
|
684
|
+
/** The named permission action a subject must hold to use the filter, prefixed with this plugin's own id. */
|
|
685
|
+
action: string;
|
|
686
|
+
documentTypes?: string[];
|
|
687
|
+
options: Array<{
|
|
688
|
+
value: string;
|
|
689
|
+
label: SlotLabel;
|
|
690
|
+
}>;
|
|
691
|
+
match: (input: ListFilterInput, context: PluginContentSlotContext) => string[] | Promise<string[]>;
|
|
692
|
+
}
|
|
693
|
+
/** M35 C2 (experimental): a button over the Content List table while rows are selected. Its `view` opens in
|
|
694
|
+
* a dialog and reads the selected rows through `usePluginBulkAction()`; it acts through the plugin's own
|
|
695
|
+
* routes, within its `contentAccess`.
|
|
696
|
+
* @experimental */
|
|
697
|
+
export interface BulkActionContribution {
|
|
698
|
+
id: string;
|
|
699
|
+
label: SlotLabel;
|
|
700
|
+
/** The named permission action a subject must hold to see the button, prefixed with this plugin's own id. */
|
|
701
|
+
action: string;
|
|
702
|
+
documentTypes?: string[];
|
|
703
|
+
view: ComponentType;
|
|
704
|
+
}
|
|
705
|
+
/** M35 C2 (W26, experimental): a view in one of the core's own screens, one of ADMIN_SLOT_PLACES. It reads
|
|
706
|
+
* where it sits through `usePluginAdminSlot()`. A `topBar.item` needs an `icon` (a Lucide name) and opens
|
|
707
|
+
* its view in a dialog; no other place takes one.
|
|
708
|
+
* @experimental */
|
|
709
|
+
export interface AdminSlotContribution {
|
|
710
|
+
id: string;
|
|
711
|
+
slot: AdminSlotPlace;
|
|
712
|
+
label: SlotLabel;
|
|
713
|
+
/** The named permission action a subject must hold to see the view, prefixed with this plugin's own id. */
|
|
714
|
+
action: string;
|
|
715
|
+
icon?: IconName;
|
|
716
|
+
view: ComponentType;
|
|
717
|
+
}
|
|
365
718
|
/** M31.5 D (D1): marks an "apiKey" route as a tool an MCP host may call. */
|
|
366
719
|
export interface McpToolDeclaration {
|
|
367
720
|
/** 1 to 40 lower-case letters, digits and "_", starting with a letter. The host sees
|
|
@@ -460,6 +813,11 @@ export interface ApiRouteContribution {
|
|
|
460
813
|
* body still runs: the parse, its refusal of prototype poisoning, and `schema.body`. The
|
|
461
814
|
* install screen notes that the route reads the request exactly as sent. */
|
|
462
815
|
rawBody?: true;
|
|
816
|
+
/** @experimental M35 B3 (W17): the files this route takes, as `multipart/form-data`. Only on a POST, PUT or
|
|
817
|
+
* PATCH route, never beside `rawBody`. The core reads the body within these limits and the site's media
|
|
818
|
+
* size setting, checks each file's type by its first bytes, and hands the handler `request.files` and
|
|
819
|
+
* `context.uploads`. A multipart body to a route without it answers 415. The install screen notes it. */
|
|
820
|
+
uploads?: RouteUploadsDeclaration;
|
|
463
821
|
/** M31.5 D (D1, D2): this route as a tool of an MCP host. Only an "apiKey" route can be one;
|
|
464
822
|
* its `action` decides which keys are offered it, and its `schema` (params, querystring and
|
|
465
823
|
* body, each a z.object) is the tool's input, so nothing is declared twice. */
|
|
@@ -485,14 +843,6 @@ export interface MediaProcessorContribution {
|
|
|
485
843
|
name: PluginLabel;
|
|
486
844
|
process: (file: unknown) => unknown | Promise<unknown>;
|
|
487
845
|
}
|
|
488
|
-
/** A service an integration plugin exposes for other plugins to consume
|
|
489
|
-
* (e.g. a Stripe client). Shape intentionally opaque until the
|
|
490
|
-
* cross-plugin service registry exists. */
|
|
491
|
-
export interface ExposedServiceContribution {
|
|
492
|
-
id: string;
|
|
493
|
-
name: PluginLabel;
|
|
494
|
-
service: unknown;
|
|
495
|
-
}
|
|
496
846
|
/** A ready-made frontend starter shipped alongside a plugin (a Next.js
|
|
497
847
|
* storefront, say), one marketplace listing, working site immediately. */
|
|
498
848
|
export interface BundledTemplateContribution {
|
|
@@ -566,6 +916,60 @@ export interface MailKindContribution {
|
|
|
566
916
|
label: PluginLabel;
|
|
567
917
|
description?: PluginLabel;
|
|
568
918
|
}
|
|
919
|
+
/**
|
|
920
|
+
* M35 C4a (W9, design D3): what a node's `validate` is told. `v` is the item's stored version, `culture` the save's
|
|
921
|
+
* language for a field that varies and null for a shared one.
|
|
922
|
+
* @experimental
|
|
923
|
+
*/
|
|
924
|
+
export interface RichTextItemValidateContext {
|
|
925
|
+
v: number;
|
|
926
|
+
culture: string | null;
|
|
927
|
+
}
|
|
928
|
+
/**
|
|
929
|
+
* M35 C4a (design D3): a node a plugin adds to rich text. The serializable members are api-schemas'
|
|
930
|
+
* (`RichTextNodeDeclaration`); `validate` is server only, pure and synchronous, and is called only for an item that is
|
|
931
|
+
* new or changed against the version the save starts from, while the plugin is switched on. A partial must never
|
|
932
|
+
* assume it passed: data stored while the plugin was off was never judged.
|
|
933
|
+
* @experimental
|
|
934
|
+
*/
|
|
935
|
+
export interface RichTextNodeContribution extends Omit<RichTextNodeDeclaration, "hasView"> {
|
|
936
|
+
validate?: (data: Readonly<Record<string, unknown>>, context: RichTextItemValidateContext) => DataTypeValidatorIssue[] | undefined;
|
|
937
|
+
/** M35 C4b (design D15): the item's own view in its side panel, instead of the core form. It reads useRichTextItem().
|
|
938
|
+
* @experimental */
|
|
939
|
+
view?: ComponentType;
|
|
940
|
+
}
|
|
941
|
+
/**
|
|
942
|
+
* M35 C4b (design D15): a mark a plugin adds, with its own view when the core's small form will not do.
|
|
943
|
+
* @experimental
|
|
944
|
+
*/
|
|
945
|
+
export interface RichTextMarkContribution extends Omit<RichTextMarkDeclaration, "hasView"> {
|
|
946
|
+
view?: ComponentType;
|
|
947
|
+
}
|
|
948
|
+
/**
|
|
949
|
+
* M35 C4b (design D16): a toolbar button inserts a node, toggles a mark, or opens the plugin's view in a dialog, which
|
|
950
|
+
* reads useRichTextEditorHandle(); a view names a plugin-prefixed action, and a person without it does not see it.
|
|
951
|
+
* @experimental
|
|
952
|
+
*/
|
|
953
|
+
export interface RichTextButtonContribution extends Omit<RichTextButton, "does"> {
|
|
954
|
+
does: {
|
|
955
|
+
insert: string;
|
|
956
|
+
} | {
|
|
957
|
+
toggle: string;
|
|
958
|
+
} | {
|
|
959
|
+
view: ComponentType;
|
|
960
|
+
action: string;
|
|
961
|
+
};
|
|
962
|
+
}
|
|
963
|
+
/**
|
|
964
|
+
* M35 C4a (design D1): items, marks and toolbar buttons a plugin adds to rich text. The core draws and stores every
|
|
965
|
+
* one; no plugin code runs inside the editor (a view runs in the admin's view host, M35 C4b).
|
|
966
|
+
* @experimental
|
|
967
|
+
*/
|
|
968
|
+
export interface RichTextExtensionsContribution {
|
|
969
|
+
nodes?: RichTextNodeContribution[];
|
|
970
|
+
marks?: RichTextMarkContribution[];
|
|
971
|
+
buttons?: RichTextButtonContribution[];
|
|
972
|
+
}
|
|
569
973
|
export interface PluginContributions {
|
|
570
974
|
/** The Month 3 datatype contract, referenced verbatim: a plugin can
|
|
571
975
|
* ship several field types (id/version on each entry are the
|
|
@@ -584,11 +988,38 @@ export interface PluginContributions {
|
|
|
584
988
|
editorPanels?: EditorPanelContribution[];
|
|
585
989
|
/** M32 F3 (D7): items in a content tree row's menu (at most 5). Derives `admin.treeAction`. */
|
|
586
990
|
treeActions?: TreeActionContribution[];
|
|
991
|
+
/** M35 C4a (W9): rich text items. @experimental */
|
|
992
|
+
richTextExtensions?: RichTextExtensionsContribution;
|
|
993
|
+
/** M35 C2 (W5, experimental): columns of the Content List table (at most 3). Derives `admin.contentColumn`.
|
|
994
|
+
* @experimental */
|
|
995
|
+
contentColumns?: ContentColumnContribution[];
|
|
996
|
+
/** M35 C2 (W5, experimental): a badge on content tree rows (at most 1). Derives `admin.treeBadge`.
|
|
997
|
+
* @experimental */
|
|
998
|
+
treeBadges?: TreeBadgeContribution[];
|
|
999
|
+
/** M35 C2 (W5, experimental): choices of the Content List table's filter (at most 2). Derives `admin.listFilter`.
|
|
1000
|
+
* @experimental */
|
|
1001
|
+
listFilters?: ListFilterContribution[];
|
|
1002
|
+
/** M35 C2 (W5, experimental): actions on the selected rows of the Content List table (at most 3). Derives `admin.bulkAction`.
|
|
1003
|
+
* @experimental */
|
|
1004
|
+
bulkActions?: BulkActionContribution[];
|
|
1005
|
+
/** M35 C2 (W26, experimental): views in the core's own screens, one of ADMIN_SLOT_PLACES each. Derives `admin.slot`.
|
|
1006
|
+
* @experimental */
|
|
1007
|
+
adminSlots?: AdminSlotContribution[];
|
|
587
1008
|
apiRoutes?: ApiRouteContribution[];
|
|
588
1009
|
hooks?: PluginHooks;
|
|
1010
|
+
/** M35 B2 (experimental, W1): before-points that may refuse a content write. Derives `server.guard`.
|
|
1011
|
+
* @experimental */
|
|
1012
|
+
guards?: GuardContribution[];
|
|
589
1013
|
scheduledTasks?: ScheduledTaskContribution[];
|
|
590
1014
|
mediaProcessors?: MediaProcessorContribution[];
|
|
1015
|
+
/** @experimental M35 B1a (W16): contracts this plugin owns, which others may offer and use. Derives `service.contract`. */
|
|
1016
|
+
serviceContracts?: ServiceContractContribution[];
|
|
1017
|
+
/** @experimental M35 B1a: implementations of a contract this plugin offers. Derives `service.offer`. */
|
|
591
1018
|
exposedServices?: ExposedServiceContribution[];
|
|
1019
|
+
/** @experimental M35 B1a: contracts this plugin calls through `context.services`. Derives `service.use`. */
|
|
1020
|
+
usedServices?: UsedServiceContribution[];
|
|
1021
|
+
/** @experimental M35 B1a: events this plugin raises through `context.events`. Derives `event.raise`. */
|
|
1022
|
+
events?: PluginEventContribution[];
|
|
592
1023
|
serializers?: SerializerContribution;
|
|
593
1024
|
/** Document types the plugin provisions at install: the creation shape
|
|
594
1025
|
* (server mints ids) the admin's builder POSTs, except that a field's
|
|
@@ -635,18 +1066,52 @@ export interface PluginContributions {
|
|
|
635
1066
|
* `context.media`: `media.read` reads every file, private ones included, and `media.create`
|
|
636
1067
|
* adds files. Each action once. It derives the `media.access` capability. */
|
|
637
1068
|
mediaAccess?: PluginMediaAccess;
|
|
1069
|
+
/** @experimental M35 U1 (W6): what this plugin's code may do with the site's admin accounts through
|
|
1070
|
+
* `context.users`: `users.read` lists and reads accounts, `users.update` moves people between the
|
|
1071
|
+
* roles this plugin offered and Editor, `roles.read` lists roles. Derives `users.access`. */
|
|
1072
|
+
userAccess?: PluginUserAccess;
|
|
1073
|
+
/** @experimental M35 U1 (W6): fields this plugin keeps on each admin account (at most 16, the plugin
|
|
1074
|
+
* settings field types without `secret`). The core stores, checks and draws them on a person's
|
|
1075
|
+
* Details and hands them back through `context.userFields`. Derives `users.fields`. */
|
|
1076
|
+
userFields?: PluginUserField[];
|
|
1077
|
+
/** @experimental M35 U2b (W8): hands this plugin the signed-in visitor of the site (`context.visitor`) and the
|
|
1078
|
+
* accounts by id (`context.visitors`); `{ email: true }` adds the email. Derives `visitors.identify`. */
|
|
1079
|
+
visitorIdentity?: PluginVisitorIdentityContribution;
|
|
1080
|
+
/** @experimental M35 U2b (W8): 1 to 20 groups of the plugin's own, whose members only it changes (needs
|
|
1081
|
+
* visitorIdentity). Derives `visitors.groups`. */
|
|
1082
|
+
visitorGroups?: PluginVisitorGroupContribution[];
|
|
1083
|
+
/** @experimental M35 U2b (W8): 1 to 3 sections of the visitor's account page, each drawn with one of the plugin's
|
|
1084
|
+
* own partials (needs visitorIdentity). Derives `visitors.accountSections`. */
|
|
1085
|
+
visitorAccountSections?: PluginVisitorAccountSectionContribution[];
|
|
1086
|
+
/** @experimental M35 U2b (W8): the plugin's part of a visitor's data download and of an account's deletion (needs
|
|
1087
|
+
* visitorIdentity). Derives `visitors.data`. */
|
|
1088
|
+
visitorData?: PluginVisitorDataContribution;
|
|
638
1089
|
/** M32 F2 (D2): fixed site addresses the plugin answers (at most 20). Derives `site.route`. */
|
|
639
1090
|
siteRoutes?: SiteRouteContribution[];
|
|
640
1091
|
/** M32 F2 (D10): answers an address no page holds. Derives `site.fallback`. */
|
|
641
1092
|
siteFallback?: SiteFallbackContribution;
|
|
1093
|
+
/** @experimental M35 P2 (W2): asked about every request for the site's pages and files, public media and the
|
|
1094
|
+
* delivery API before anything answers it; may refuse or redirect it. Derives `site.requestGuard`, a promised capability. */
|
|
1095
|
+
requestGuard?: RequestGuardContribution;
|
|
1096
|
+
/** @experimental M35 P2 (W2): adds headers from a fixed list (a content security policy, transport security,
|
|
1097
|
+
* robots) to those answers. Derives `site.responseHeaders`. */
|
|
1098
|
+
responseHeaders?: ResponseHeadersContribution;
|
|
1099
|
+
/** @experimental M35 P4 (W46): asked before a live page is sent, with the page's id, type and language; may
|
|
1100
|
+
* redirect it or answer it as gone. Derives `site.pageGate`, a promised capability. */
|
|
1101
|
+
pageGate?: PageGateContribution;
|
|
642
1102
|
/** M32 F2 (D14): template filters under the plugin's prefix (at most 20). Derives `render.templateFilter`. */
|
|
643
1103
|
templateFilters?: TemplateFilterContribution[];
|
|
644
|
-
/** M32 F2 (D14): template tags under the plugin's prefix (at most 20). Derives `render.templateTag`. */
|
|
645
|
-
templateTags?: TemplateTagContribution
|
|
1104
|
+
/** M32 F2 (D14): template tags under the plugin's prefix (at most 20; M35 P3: a tag may be a block, experimental). Derives `render.templateTag`. */
|
|
1105
|
+
templateTags?: Array<TemplateTagContribution | TemplateBlockTagContribution>;
|
|
646
1106
|
/** M32 F2 (D20): entries for every page's head. Derives `render.pageHead`. */
|
|
647
1107
|
pageHead?: PageHeadContribution;
|
|
648
1108
|
/** M33 K42: content from other sites (at most HELD_EMBEDS_DECLARED_MAX) a template tag may show, held until a visitor clicks: the core writes the placeholder and its words and builds the frame from the declared origin and path prefix only. Derives `render.heldEmbed`. */
|
|
649
1109
|
heldEmbeds?: HeldEmbedContribution[];
|
|
1110
|
+
/** M35 P1 (W3), experimental: changes the HTML of every public page Kardalum renders, after the render. Derives `render.pageOutput`, a promised capability. */
|
|
1111
|
+
pageOutput?: PageOutputContribution;
|
|
1112
|
+
/** @experimental M35 P4 (W32): says how long caches and CDNs may keep a rendered page and labels it with tags; the
|
|
1113
|
+
* core writes the headers. Derives `render.pageCache`. */
|
|
1114
|
+
pageCache?: PageCacheContribution;
|
|
650
1115
|
/** M32 F4 (D1, D15): form protection providers (at most 3), run after the built-in checks. Derives `provider.formProtection`. */
|
|
651
1116
|
protectionProviders?: ProtectionProviderContribution[];
|
|
652
1117
|
/** M32 F4 (D1, D19): search providers (at most 3) for the delivery API's `?q=`. Derives `provider.search`. */
|
|
@@ -655,12 +1120,16 @@ export interface PluginContributions {
|
|
|
655
1120
|
mediaStores?: MediaStoreContribution[];
|
|
656
1121
|
/** M32 H (H1): mail senders (at most 3) the site owner may send every email through, instead of the built-in SMTP one. Derives `provider.mail`. */
|
|
657
1122
|
mailSenders?: MailSenderContribution[];
|
|
1123
|
+
/** @experimental M35 P5 (W37): consent tools (at most 3) the site owner may choose, one for the whole site. Derives `provider.consent`, a promised capability. */
|
|
1124
|
+
consentTools?: ConsentToolContribution[];
|
|
658
1125
|
/** M32 H (H19): the plugin may send one reply email to the address a visitor typed into a protected form, once the site owner switches it on. Derives `mail.formReplies`. */
|
|
659
1126
|
formReplies?: FormRepliesContribution;
|
|
660
1127
|
/** M33 K11: the kinds of email (at most 10) the plugin sends, each to one person, with `context.mail.send` in its hooks, routes, site routes and scheduled tasks. Each kind is off until the site owner switches it on. Derives `mail.direct`, a promised capability: send only to a person a completed transaction or the person's own request names, and never put a visitor's words into an email to someone else. */
|
|
661
1128
|
mailKinds?: MailKindContribution[];
|
|
662
1129
|
/** M32 F4b (D33): sign-in providers (at most 3) the admin's login page offers, OpenID Connect or OAuth 2, the protocol run by the core. Derives `provider.signIn`. */
|
|
663
1130
|
signInProviders?: SignInProviderContribution[];
|
|
1131
|
+
/** M35 U3a (experimental): sign-in steps (at most 3) asked after the password or a sign-in provider, before the session exists; a factor step is offered only to people who set it up. Derives `provider.signInStep`, a promised capability. */
|
|
1132
|
+
signInSteps?: SignInStepContribution[];
|
|
664
1133
|
/** M33 K16: the plugin may call web addresses through `context.outbound`, the server's checked connection, with the methods it names. Derives `network.outbound`. */
|
|
665
1134
|
outboundRequests?: OutboundRequestsContribution;
|
|
666
1135
|
/** M33 K17: kinds of value (at most 10) the plugin makes and seals under the server's key with `context.sealing`. Derives `secrets.sealedValues`. */
|
|
@@ -670,23 +1139,38 @@ export interface PluginContributions {
|
|
|
670
1139
|
/** M32 F4d (D1): plugin settings fields (at most 32) the core draws, checks, stores and hands back. Derives nothing. */
|
|
671
1140
|
settings?: PluginSettingField[];
|
|
672
1141
|
}
|
|
673
|
-
export type { TemplateData, PageHeadEntry, SiteFallbackAnswer };
|
|
1142
|
+
export type { TemplateData, PageHeadEntry, SiteFallbackAnswer, RequestGuardAnswer, SiteRequestSurface, PageCacheAnswer, PluginConsentView };
|
|
674
1143
|
/**
|
|
675
|
-
* M32 F2 (D2, D3): a
|
|
676
|
-
* some segment (a file such as /sitemap.xml)
|
|
677
|
-
* a POST route takes a form post.
|
|
678
|
-
* and a GET path
|
|
679
|
-
*
|
|
1144
|
+
* M32 F2 (D2, D3): a site address a plugin answers beside the pages. A fixed path, a GET one with a "."
|
|
1145
|
+
* in some segment (a file such as /sitemap.xml) or a POST one without a parameter, answers before the
|
|
1146
|
+
* pages, and GET also answers HEAD; a POST route takes a form post. M35 P3 (W18, experimental): a path
|
|
1147
|
+
* with `:name` parameters and a last `*`, or a GET path with no "." (a clean address such as /shop/cart),
|
|
1148
|
+
* answers after the pages, so a page at the same address always wins; its first segment is a fixed name
|
|
1149
|
+
* no other plugin's route starts with. The path is outside the server's own addresses
|
|
1150
|
+
* (siteRoutePathProblem), and a GET path is no .html or .htm file, which a page or the owner's public/
|
|
1151
|
+
* folder answers. The handler returns its answer or sends one through the reply; one that does neither
|
|
1152
|
+
* gets a logged 500.
|
|
680
1153
|
*/
|
|
681
1154
|
export interface SiteRouteContribution {
|
|
682
1155
|
method: "GET" | "POST";
|
|
683
|
-
/** A
|
|
1156
|
+
/** A site address such as "/sitemap.xml" or "/shop/products/:slug" (api-schemas' readSiteRoutePath). GET also answers HEAD. */
|
|
684
1157
|
path: string;
|
|
685
1158
|
schema?: {
|
|
686
1159
|
querystring?: ZodType;
|
|
687
1160
|
body?: ZodType;
|
|
1161
|
+
/** M35 P3 (W18, experimental): checks request.params; only on a path with a parameter or "*". */
|
|
1162
|
+
params?: ZodType;
|
|
688
1163
|
};
|
|
689
1164
|
handler: (request: unknown, reply: unknown, context: PluginApiRouteContext) => unknown;
|
|
1165
|
+
/** @experimental M35 P2 (W21): `true` hands a POST route `request.rawBody`, a fresh copy of the request's exact
|
|
1166
|
+
* bytes (a JSON, plain text or form-encoded body), beside the parsed `body`, so it can check a signature over
|
|
1167
|
+
* them. POST only. The install screen notes that the route reads the request exactly as sent. */
|
|
1168
|
+
rawBody?: true;
|
|
1169
|
+
/** @experimental M35 B3 (W17): the files this route takes, as `multipart/form-data`. Only on a POST site
|
|
1170
|
+
* route, never beside `rawBody`. The core reads the body within these limits and the site's media size
|
|
1171
|
+
* setting, checks each file's type by its first bytes, and hands the handler `request.files` and
|
|
1172
|
+
* `context.uploads`. A multipart body to a route without it answers 415. The install screen notes it. */
|
|
1173
|
+
uploads?: RouteUploadsDeclaration;
|
|
690
1174
|
}
|
|
691
1175
|
/** M32 F2 (D10): the address a site fallback is asked about. */
|
|
692
1176
|
export interface SiteFallbackAddress {
|
|
@@ -701,6 +1185,125 @@ export interface SiteFallbackAddress {
|
|
|
701
1185
|
export interface SiteFallbackContribution {
|
|
702
1186
|
resolve(address: SiteFallbackAddress, context: SiteFallbackContext): SiteFallbackAnswer | null | Promise<SiteFallbackAnswer | null>;
|
|
703
1187
|
}
|
|
1188
|
+
/**
|
|
1189
|
+
* M35 P2 (W2): a public request as a request guard sees it. One frozen object for every guard of the
|
|
1190
|
+
* request. `path` is decoded, `query` is the raw query without "?", `host` and `ip` are read as the
|
|
1191
|
+
* server reads them behind its trusted proxy, and `headers` is a frozen copy without `authorization`
|
|
1192
|
+
* and `proxy-authorization`, whose `cookie` header leaves the visitor cookies out (the visitor session
|
|
1193
|
+
* and the provider sign-in binding, M35 U2a); a header holding nothing else is left out.
|
|
1194
|
+
* @experimental
|
|
1195
|
+
*/
|
|
1196
|
+
export interface SiteRequest {
|
|
1197
|
+
readonly surface: SiteRequestSurface;
|
|
1198
|
+
readonly method: string;
|
|
1199
|
+
readonly path: string;
|
|
1200
|
+
readonly query: string;
|
|
1201
|
+
readonly host: string;
|
|
1202
|
+
readonly ip: string;
|
|
1203
|
+
readonly headers: Readonly<Record<string, string | readonly string[] | undefined>>;
|
|
1204
|
+
}
|
|
1205
|
+
/**
|
|
1206
|
+
* M35 P2 (W2): a public answer as a response headers function sees it, frozen. `contentType` is the
|
|
1207
|
+
* media type in lower case, without parameters. `page` is the rendered public page, else null.
|
|
1208
|
+
* `inlineHashes` are the `sha256-<base64>` sources a Content-Security-Policy names the answer's inline
|
|
1209
|
+
* code by: a rendered page's inline snippets, or the core notice page's one stylesheet; null otherwise.
|
|
1210
|
+
* Null on a rendered page (`page` set) means the page carries no plugin inline snippet, so there is no
|
|
1211
|
+
* inline code to allow: a policy still applies to that page.
|
|
1212
|
+
* @experimental
|
|
1213
|
+
*/
|
|
1214
|
+
export interface SiteResponse {
|
|
1215
|
+
readonly surface: SiteRequestSurface;
|
|
1216
|
+
readonly method: string;
|
|
1217
|
+
readonly path: string;
|
|
1218
|
+
readonly status: number;
|
|
1219
|
+
readonly contentType: string | null;
|
|
1220
|
+
readonly page: {
|
|
1221
|
+
readonly id: string;
|
|
1222
|
+
readonly path: string;
|
|
1223
|
+
readonly culture: string;
|
|
1224
|
+
} | null;
|
|
1225
|
+
readonly inlineHashes: {
|
|
1226
|
+
readonly scripts: readonly string[];
|
|
1227
|
+
readonly styles: readonly string[];
|
|
1228
|
+
} | null;
|
|
1229
|
+
}
|
|
1230
|
+
/** M35 P2 (W2): what a request guard and a response headers function may read: read-only storage, the
|
|
1231
|
+
* licence answer, the plugin's settings (read once for the request before the call's time starts) and the host.
|
|
1232
|
+
* @experimental */
|
|
1233
|
+
export interface SiteRequestContext {
|
|
1234
|
+
structuredStorage: Pick<ScopedStructuredStorage, "query">;
|
|
1235
|
+
/** Check it with requireEntitlement. */
|
|
1236
|
+
entitlement: Entitlement;
|
|
1237
|
+
settings: PluginSettingsReader;
|
|
1238
|
+
requestHost: string;
|
|
1239
|
+
}
|
|
1240
|
+
/**
|
|
1241
|
+
* M35 P2 (W2): asked about every request for the site's own addresses, `/media/` and `/api/v1/`, before
|
|
1242
|
+
* anything answers it; never about the admin, sign-in, the management API, `/api/plugins/`, the docs,
|
|
1243
|
+
* plugin assets or the on-page editor. Answers null to let it through, `{ block: { status, message?,
|
|
1244
|
+
* retryAfterSeconds? } }` (403, 404, 410, 429, 451 or 503; the core writes its own page or JSON) or a
|
|
1245
|
+
* redirect checked like a site fallback's. Guards are asked in plugin id order, at most
|
|
1246
|
+
* REQUEST_GUARDS_MAX a request, each within REQUEST_GUARD_TIME_MS and all within
|
|
1247
|
+
* REQUEST_GUARD_TIME_PER_REQUEST_MS; the first answer that is not null answers. A guard that throws, is
|
|
1248
|
+
* slow or answers anything else lets the request through. It runs on every request: keep it fast, and
|
|
1249
|
+
* let a scheduled task write what it reads. Heavy synchronous work cannot be stopped and blocks the server.
|
|
1250
|
+
* @experimental
|
|
1251
|
+
*/
|
|
1252
|
+
export interface RequestGuardContribution {
|
|
1253
|
+
check(request: SiteRequest, context: SiteRequestContext): RequestGuardAnswer | null | Promise<RequestGuardAnswer | null>;
|
|
1254
|
+
}
|
|
1255
|
+
/**
|
|
1256
|
+
* M35 P2 (W2): asked for headers of every answer on the surfaces a request guard sees. Answers null or
|
|
1257
|
+
* an object of header names (RESPONSE_HEADER_NAMES, any case) to values (printable ASCII, at most
|
|
1258
|
+
* RESPONSE_HEADER_VALUE_MAX), at most RESPONSE_HEADERS_PER_PLUGIN_MAX names. A header the answer already
|
|
1259
|
+
* carries is kept; of two plugins naming one header the earlier plugin id wins. Within
|
|
1260
|
+
* RESPONSE_HEADERS_TIME_MS each and RESPONSE_HEADERS_TIME_PER_RESPONSE_MS together.
|
|
1261
|
+
* @experimental
|
|
1262
|
+
*/
|
|
1263
|
+
export interface ResponseHeadersContribution {
|
|
1264
|
+
headers(response: SiteResponse, context: SiteRequestContext): Record<string, string> | null | Promise<Record<string, string> | null>;
|
|
1265
|
+
}
|
|
1266
|
+
/** M35 P4 (W32): the rendered public page a page cache function is asked about, frozen. `dependencies` are the
|
|
1267
|
+
* core's tags of what the render read (`page:<id>`, `list:<id>`, `type:<id>`, `under:<id>` for each ancestor,
|
|
1268
|
+
* `all`). @experimental */
|
|
1269
|
+
export interface PageCachePage {
|
|
1270
|
+
readonly id: string;
|
|
1271
|
+
readonly path: string;
|
|
1272
|
+
readonly documentTypeId: string;
|
|
1273
|
+
readonly culture: string;
|
|
1274
|
+
readonly dependencies: readonly string[];
|
|
1275
|
+
}
|
|
1276
|
+
/**
|
|
1277
|
+
* M35 P4 (W32): asked for every rendered public page that may be shared (never a signed-in visitor's, an edit
|
|
1278
|
+
* render or any other answer), in plugin id order, at most PAGE_CACHE_PLUGINS_MAX, within PAGE_CACHE_TIME_MS each
|
|
1279
|
+
* and PAGE_CACHE_TIME_PER_RESPONSE_MS together. Answers null or a PageCacheAnswer; several answers merge to the
|
|
1280
|
+
* strictest, and the core writes Cache-Control, Vary, Surrogate-Key and Cache-Tag itself. It is asked only while a
|
|
1281
|
+
* public URL is configured (Server settings, else KARDALUM_PUBLIC_URL): without one a page prints the request's own
|
|
1282
|
+
* origin, so a site behind a CDN sets its public URL. The full rule is the manifest reference's pageCache section,
|
|
1283
|
+
* "When it is asked". @experimental
|
|
1284
|
+
*/
|
|
1285
|
+
export interface PageCacheContribution {
|
|
1286
|
+
headers(page: PageCachePage, context: SiteRequestContext): PageCacheAnswer | null | Promise<PageCacheAnswer | null>;
|
|
1287
|
+
}
|
|
1288
|
+
/** M35 P4 (W46): the live page a gate is asked about, frozen. `address` is the visitor's (the query without
|
|
1289
|
+
* credential values), null when `context.renderPage` asks. @experimental */
|
|
1290
|
+
export interface PageGatePage {
|
|
1291
|
+
readonly id: string;
|
|
1292
|
+
readonly path: string;
|
|
1293
|
+
readonly documentTypeId: string;
|
|
1294
|
+
readonly culture: string;
|
|
1295
|
+
readonly address: Readonly<SiteFallbackAddress> | null;
|
|
1296
|
+
}
|
|
1297
|
+
/**
|
|
1298
|
+
* M35 P4 (W46): asked before a live public page is sent, on a render and a cache hit alike, in plugin id order, at
|
|
1299
|
+
* most PAGE_GATES_MAX, within PAGE_GATE_TIME_MS each and PAGE_GATE_TIME_PER_REQUEST_MS together. Answers null (the
|
|
1300
|
+
* page is sent), a redirect or `{ gone: true }`, checked as a site fallback's answer. A gate that throws, is slow,
|
|
1301
|
+
* answers anything else or redirects to the address asked lets the page through. It runs on every page view: keep it
|
|
1302
|
+
* fast and let a scheduled task write what it reads. @experimental
|
|
1303
|
+
*/
|
|
1304
|
+
export interface PageGateContribution {
|
|
1305
|
+
check(page: PageGatePage, context: SiteRequestContext): SiteFallbackAnswer | null | Promise<SiteFallbackAnswer | null>;
|
|
1306
|
+
}
|
|
704
1307
|
/** M32 F2 (D15): what a template filter or tag may read while it runs: read-only storage only. */
|
|
705
1308
|
export interface TemplateCallContext {
|
|
706
1309
|
culture: string | null;
|
|
@@ -715,6 +1318,27 @@ export interface TemplateCallContext {
|
|
|
715
1318
|
settings: PluginSettingsReader;
|
|
716
1319
|
/** The host the page is rendered for; null when no request (the block preview). Pass it to requireEntitlement. */
|
|
717
1320
|
requestHost: string | null;
|
|
1321
|
+
/** @experimental M35 P3 (W19): a published page, as on a route (PluginServerContextBase). Each read takes one of the
|
|
1322
|
+
* render's list reads and of TEMPLATE_PLUGIN_READS_PER_RENDER_MAX; past them, or after the call ended, it throws
|
|
1323
|
+
* TemplateReadRefusedError. */
|
|
1324
|
+
getPublishedContent: PluginServerContextBase["getPublishedContent"];
|
|
1325
|
+
/** @experimental M35 P3 (W19): published pages sorted and filtered, a cursor at a time, on the same budget. */
|
|
1326
|
+
listPublished: PluginServerContextBase["listPublished"];
|
|
1327
|
+
/** @experimental M35 P3 (W19): the delivery search, on the same budget and TEMPLATE_PLUGIN_SEARCHES_PER_RENDER_MAX. */
|
|
1328
|
+
searchPublished: PluginServerContextBase["searchPublished"];
|
|
1329
|
+
/** @experimental M35 P3 (W19): the addresses of pages in every language (a language switcher), on the same budget. */
|
|
1330
|
+
pageAddresses: PluginServerContextBase["pageAddresses"];
|
|
1331
|
+
/** @experimental M35 P3 (W19): a public media item's address, on the same budget. */
|
|
1332
|
+
publicMediaUrl: PluginServerContextBase["publicMediaUrl"];
|
|
1333
|
+
/** @experimental M35 U2b (W8): the signed-in visitor the page is rendered for, null for none. Present only for a
|
|
1334
|
+
* plugin that declares visitorIdentity. A render with a visitor is never cached. */
|
|
1335
|
+
visitor?: PluginVisitor | null;
|
|
1336
|
+
/** @experimental M35 P5 (W37): the visitor's consent as the request's cookie carries it (undecided in an edit render,
|
|
1337
|
+
* a preview, `renderPage` and while no consent tool is chosen). Reading it makes this render answer for that cookie
|
|
1338
|
+
* alone: it is never stored for another request carrying a consent cookie and never handed to a page cache, so read
|
|
1339
|
+
* it only when the HTML itself must differ; a head script waits for a category with `consent` on its entry instead.
|
|
1340
|
+
* Present from the CMS that ships 35-P5. */
|
|
1341
|
+
consent?: PluginConsentView;
|
|
718
1342
|
}
|
|
719
1343
|
/**
|
|
720
1344
|
* M32 F2 (D14): a template filter, used as <the id's last segment>_<name>. Its value and result are
|
|
@@ -722,6 +1346,8 @@ export interface TemplateCallContext {
|
|
|
722
1346
|
*/
|
|
723
1347
|
export interface TemplateFilterContribution {
|
|
724
1348
|
name: string;
|
|
1349
|
+
/** @experimental M35 P3 (evidence 116): what the filter prints when it cannot answer; "value" by default. */
|
|
1350
|
+
onFailure?: TemplateFilterOnFailure;
|
|
725
1351
|
filter(value: TemplateData, args: TemplateData[], context: TemplateCallContext): TemplateData | Promise<TemplateData>;
|
|
726
1352
|
}
|
|
727
1353
|
/**
|
|
@@ -748,11 +1374,39 @@ export type TemplateTagOutput = string | {
|
|
|
748
1374
|
embed: HeldEmbedRequest;
|
|
749
1375
|
html?: string;
|
|
750
1376
|
};
|
|
751
|
-
/** M32 F2 (D14, D16): a template tag, named like a filter, with its named arguments as plain data. */
|
|
1377
|
+
/** M32 F2 (D14, D16): a template tag, named like a filter, with its named arguments as plain data; no body. */
|
|
752
1378
|
export interface TemplateTagContribution {
|
|
753
1379
|
name: string;
|
|
1380
|
+
block?: undefined;
|
|
754
1381
|
render(args: Record<string, TemplateData>, context: TemplateCallContext): TemplateTagOutput | Promise<TemplateTagOutput>;
|
|
755
1382
|
}
|
|
1383
|
+
/**
|
|
1384
|
+
* M35 P3 (W19): what a block tag gives back: a TemplateTagOutput (it replaces the body, cleaned), or
|
|
1385
|
+
* `{ keepBody: true, before?, after?, wrap? }`: the cleaned `before`, the author's body exactly as rendered
|
|
1386
|
+
* (inside one `wrap` element of TEMPLATE_BLOCK_WRAP_ELEMENTS with an optional class), the cleaned `after`.
|
|
1387
|
+
* @experimental
|
|
1388
|
+
*/
|
|
1389
|
+
export type TemplateBlockTagOutput = TemplateTagOutput | {
|
|
1390
|
+
keepBody: true;
|
|
1391
|
+
before?: string;
|
|
1392
|
+
after?: string;
|
|
1393
|
+
wrap?: {
|
|
1394
|
+
element: TemplateBlockWrapElement;
|
|
1395
|
+
class?: string;
|
|
1396
|
+
};
|
|
1397
|
+
};
|
|
1398
|
+
/**
|
|
1399
|
+
* M35 P3 (W19): a block tag, written `{% <prefix>_<name> args %}...{% end<prefix>_<name> %}`. The core renders the
|
|
1400
|
+
* body first and hands it over as HTML (null over TEMPLATE_BLOCK_BODY_MAX_BYTES). `onFailure` says what is written
|
|
1401
|
+
* when the call cannot answer: the body ("body", the default) or nothing.
|
|
1402
|
+
* @experimental
|
|
1403
|
+
*/
|
|
1404
|
+
export interface TemplateBlockTagContribution {
|
|
1405
|
+
name: string;
|
|
1406
|
+
block: true;
|
|
1407
|
+
onFailure?: TemplateBlockOnFailure;
|
|
1408
|
+
render(args: Record<string, TemplateData>, context: TemplateCallContext, body: string | null): TemplateBlockTagOutput | Promise<TemplateBlockTagOutput>;
|
|
1409
|
+
}
|
|
756
1410
|
/** M32 F2 (D24): what the page head function is told about the page being rendered. */
|
|
757
1411
|
export interface PageHeadContext {
|
|
758
1412
|
culture: string;
|
|
@@ -787,6 +1441,15 @@ export interface PageHeadContext {
|
|
|
787
1441
|
* own public address when it has one); null for a private, trashed, missing or malformed id, and
|
|
788
1442
|
* from the fifth call in one render (PAGE_HEAD_MEDIA_READS_MAX). Never a private file's address. */
|
|
789
1443
|
publicMediaUrl(id: string): Promise<string | null>;
|
|
1444
|
+
/** @experimental M35 U2b (W8): the signed-in visitor the page is rendered for, null for none. Present only for a
|
|
1445
|
+
* plugin that declares visitorIdentity. */
|
|
1446
|
+
visitor?: PluginVisitor | null;
|
|
1447
|
+
/** @experimental M35 P5 (W37): the visitor's consent as the request's cookie carries it (undecided in an edit render,
|
|
1448
|
+
* a preview, `renderPage` and while no consent tool is chosen). Reading it makes this render answer for that cookie
|
|
1449
|
+
* alone: it is never stored for another request carrying a consent cookie and never handed to a page cache, so read
|
|
1450
|
+
* it only when the HTML itself must differ; a head script waits for a category with `consent` on its entry instead.
|
|
1451
|
+
* Present from the CMS that ships 35-P5. */
|
|
1452
|
+
consent?: PluginConsentView;
|
|
790
1453
|
}
|
|
791
1454
|
/**
|
|
792
1455
|
* M32 F2 (D20, D21): entries added to the head of every page. A script or stylesheet comes from the
|
|
@@ -800,25 +1463,87 @@ export interface PageHeadContext {
|
|
|
800
1463
|
* <head>, or inserts a <title> before </head>. Only on a page whose layout writes {% plugin_head %},
|
|
801
1464
|
* never in the on-page editor. A title entry from a plugin without the declaration is dropped and
|
|
802
1465
|
* logged. The install screen notes "may set the page title".
|
|
1466
|
+
*
|
|
1467
|
+
* M35 P1 (W40): with `inlineSnippets: true`, inline code (at most PAGE_HEAD_INLINE_SNIPPETS_MAX entries
|
|
1468
|
+
* a render, each at most PAGE_HEAD_INLINE_TEXT_MAX_BYTES) that holds nothing that could end its element
|
|
1469
|
+
* (`inlineSnippetProblem`); the core writes each text with its line breaks as LF, records the sha256
|
|
1470
|
+
* hash of that text for a Content-Security-Policy, and writes none in the on-page editor.
|
|
803
1471
|
*/
|
|
804
1472
|
export interface PageHeadContribution {
|
|
805
1473
|
scriptOrigins?: string[];
|
|
806
1474
|
setsTitle?: true;
|
|
1475
|
+
/** M35 P1 (W40), experimental: lets `entries` give `{ tag: "inlineScript", text, module? }` and
|
|
1476
|
+
* `{ tag: "inlineStyle", text, media? }`, written into the page as given. Read once, when the plugin
|
|
1477
|
+
* is attached. The install screen notes "writes its own code into every page". */
|
|
1478
|
+
inlineSnippets?: true;
|
|
807
1479
|
entries(context: PageHeadContext): PageHeadEntry[] | Promise<PageHeadEntry[]>;
|
|
808
1480
|
}
|
|
1481
|
+
/**
|
|
1482
|
+
* M35 P1 (W3): what a page output transform is told about the page. No visitor data (no cookie,
|
|
1483
|
+
* query string, address or header): the answer is kept in the render cache and served to every
|
|
1484
|
+
* visitor of the page, language and base address.
|
|
1485
|
+
* @experimental
|
|
1486
|
+
*/
|
|
1487
|
+
export interface PageOutputContext {
|
|
1488
|
+
culture: string;
|
|
1489
|
+
page: {
|
|
1490
|
+
id: string;
|
|
1491
|
+
/** The tree path, not the public address. */
|
|
1492
|
+
path: string;
|
|
1493
|
+
documentType: string;
|
|
1494
|
+
/** The page's address as the page prints it; null when no link can be made. */
|
|
1495
|
+
url: string | null;
|
|
1496
|
+
};
|
|
1497
|
+
structuredStorage: Pick<ScopedStructuredStorage, "query">;
|
|
1498
|
+
/** The host's licence answer for this plugin; check it with requireEntitlement. */
|
|
1499
|
+
entitlement: Entitlement;
|
|
1500
|
+
/** The plugin's settings, read once a render before the transform's time starts. */
|
|
1501
|
+
settings: PluginSettingsReader;
|
|
1502
|
+
/** The host the page is rendered for. Pass it to requireEntitlement. While no site has a domain,
|
|
1503
|
+
* the answer is cached by `baseUrl` alone and served to every host that shares it. */
|
|
1504
|
+
requestHost: string | null;
|
|
1505
|
+
/** The base URL the page's own links are written with, without the closing slash, for example
|
|
1506
|
+
* "https://www.example.com". It is part of the render cache's key for every page, so an answer
|
|
1507
|
+
* that depends on the site's own address reads it here. */
|
|
1508
|
+
baseUrl: string;
|
|
1509
|
+
/** The address of the plugin's own public/ folder at its installed version, with the closing slash. */
|
|
1510
|
+
assetBase: string;
|
|
1511
|
+
}
|
|
1512
|
+
/**
|
|
1513
|
+
* M35 P1 (W3): a transform of every public page Kardalum renders, run after the template and its
|
|
1514
|
+
* blocks, in plugin id order, each handed the previous answer. It answers the new HTML, or null to
|
|
1515
|
+
* leave the page as it is. It never runs in the on-page editor, on a cache hit, on the 404 or error
|
|
1516
|
+
* pages, a public/ file or a site route, and it never sees the response's headers or status. Each
|
|
1517
|
+
* transform has PAGE_OUTPUT_TIME_MS and all of one render PAGE_OUTPUT_TIME_PER_RENDER_MS; at most
|
|
1518
|
+
* PAGE_OUTPUT_TRANSFORMS_MAX run a render, on pages of at most PAGE_OUTPUT_INPUT_MAX_BYTES, and an
|
|
1519
|
+
* answer may add at most PAGE_OUTPUT_GROWTH_MAX_BYTES. The head the layout writes through
|
|
1520
|
+
* {% plugin_head %} reaches the transform as a `<!--kardalum-slot:...-->` comment, which the answer
|
|
1521
|
+
* keeps exactly as often as it found it. One that throws, is slow, answers something else, grows the
|
|
1522
|
+
* page too much or loses a slot is skipped, and the page is always served. Read tags with
|
|
1523
|
+
* `rewriteStartTags` from `@kardalum/plugin-sdk/text`, never a regular expression. Heavy synchronous
|
|
1524
|
+
* work cannot be stopped and blocks the server.
|
|
1525
|
+
* @experimental
|
|
1526
|
+
*/
|
|
1527
|
+
export interface PageOutputContribution {
|
|
1528
|
+
transform(html: string, context: PageOutputContext): string | null | undefined | Promise<string | null | undefined>;
|
|
1529
|
+
}
|
|
809
1530
|
/**
|
|
810
1531
|
* The contributions that put code in the browser, and so the ones that
|
|
811
1532
|
* make a plugin ship a client bundle (S267 section 5, implemented by
|
|
812
1533
|
* S268 Task 3). `dataTypes`, `adminSections`, `railEntries` (S280) and
|
|
813
|
-
* `dashboardWidgets`, `editorPanels` and `
|
|
1534
|
+
* `dashboardWidgets`, `editorPanels`, `treeActions`, `bulkActions` and `adminSlots` carry React views;
|
|
1535
|
+
* `contentColumns`, `treeBadges` and `listFilters` (M35 C2) carry none, but the admin registers them
|
|
1536
|
+
* for their labels and options. S313b retired `settingsPages`,
|
|
814
1537
|
* `contentTreeActions` and `editorToolbar`, which no admin screen hosted;
|
|
815
1538
|
* the last two return when a host and an editor-handle API are designed.
|
|
1539
|
+
* M35 C4a: rich text gained `richTextExtensions` (the 35-C4 design); `editorToolbar` is not revived.
|
|
816
1540
|
*
|
|
817
1541
|
* Everything else is absent on purpose: `apiRoutes`, `hooks`,
|
|
818
1542
|
* `scheduledTasks`, `mediaProcessors` and `serializers` run on the
|
|
819
|
-
* server, and `documentTypes`, `themeTokens`, `templates
|
|
820
|
-
*
|
|
821
|
-
*
|
|
1543
|
+
* server, and `documentTypes`, `themeTokens`, `templates` and `assets` are
|
|
1544
|
+
* data the host consumes rather than code the browser runs.
|
|
1545
|
+
* `bundledPlugins` and `bundledTemplate` are data the marketplace resolves;
|
|
1546
|
+
* `exposedServices` (M35 B1a) carries functions, like `apiRoutes`.
|
|
822
1547
|
*
|
|
823
1548
|
* This replaces the type-keyed CLIENT_BUNDLE_TYPES. It is more correct
|
|
824
1549
|
* than that list was, not merely equivalent: a plugin listed as
|