@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/sdk-strings.js
CHANGED
|
@@ -46,6 +46,19 @@ export const SDK_STRINGS_EN = {
|
|
|
46
46
|
"contentList.noMatches": "Nothing matches.",
|
|
47
47
|
"contentList.noChildren": "No children yet.",
|
|
48
48
|
"contentList.loadMore": "Load more",
|
|
49
|
+
"contentList.filter": "Filter",
|
|
50
|
+
"contentList.filterAll": "All pages",
|
|
51
|
+
"contentList.filterUnavailable": "This filter could not be applied. Try again, or choose All pages.",
|
|
52
|
+
"contentList.scanCapped": "Only part of the list was checked. Load more to keep looking.",
|
|
53
|
+
"contentList.cellUnavailable": "Not available",
|
|
54
|
+
"contentList.rowActions": "Actions for {{name}}",
|
|
55
|
+
"contentList.rowActionsHeader": "Actions",
|
|
56
|
+
"contentList.select": "Select {{name}}",
|
|
57
|
+
"contentList.selectLoaded": "Select the loaded pages",
|
|
58
|
+
"contentList.selectedCount": "Selected: {{selected}}",
|
|
59
|
+
"contentList.selectionLimit": "At most {{max}} pages can be selected.",
|
|
60
|
+
"contentList.clearSelection": "Clear selection",
|
|
61
|
+
"contentList.bulkActionsLabel": "With the selected pages",
|
|
49
62
|
"contentListSettings.fieldColumn": "{{alias}} ({{type}}: {{field}})",
|
|
50
63
|
"contentListSettings.label": "Label",
|
|
51
64
|
"contentListSettings.moveUp": "Move up",
|
|
@@ -165,6 +178,9 @@ export const SDK_STRINGS_EN = {
|
|
|
165
178
|
"richText.editOnPage": "Edit on page",
|
|
166
179
|
"richText.sourceStale": "Content changed elsewhere. Leaving source view will overwrite it.",
|
|
167
180
|
"richText.sourceLabel": "HTML source",
|
|
181
|
+
"richText.fromPlugins": "From plugins",
|
|
182
|
+
"richText.pluginTools": "Plugin tools",
|
|
183
|
+
"richText.more": "More",
|
|
168
184
|
"styleMenu.label": "Text styles",
|
|
169
185
|
"styleMenu.loading": "Loading…",
|
|
170
186
|
"styleMenu.none": "No theme styles declared",
|
|
@@ -185,7 +201,39 @@ export const SDK_STRINGS_EN = {
|
|
|
185
201
|
"blockPanel.fieldsUnavailable": "This block's fields couldn't be loaded. Its template declaration may be missing or the render service is unavailable.",
|
|
186
202
|
"blockPanel.previewLabel": "Preview: {{partial}}",
|
|
187
203
|
"blockPanel.previewLoading": "Loading preview…",
|
|
204
|
+
"richText.itemOff": "From {{plugin}}, which is switched off. It is kept as it is. You can move or delete it.",
|
|
205
|
+
"richText.itemNotInstalled": "From a plugin that is not installed ({{id}}). It is kept as it is. You can move or delete it.",
|
|
206
|
+
"richText.itemDropped": "{{plugin}} no longer offers this item. It is kept as it is.",
|
|
207
|
+
"richText.itemDetailsFailed": "The plugin details could not be loaded. This item is kept as it is.",
|
|
208
|
+
"richText.unreadable": "This text holds content the editor cannot open, so it is not opened and nothing is changed. Its plain text is shown below.",
|
|
209
|
+
"richText.unreadableEarlierVersion": "Open an earlier version",
|
|
210
|
+
"richText.unreadableKeepText": "Keep the text only",
|
|
211
|
+
"richText.unreadableKeepTextHint": "Puts the plain text into the editor as paragraphs, without formatting or plugin items. Nothing is stored until you save, and the stored version stays in the history.",
|
|
212
|
+
"richText.unreadableShortened": "The plain text is longer than {{max}} characters, so only its start is shown here, and Keep the text only keeps only that start. The whole value stays in the stored version.",
|
|
188
213
|
"blockPanel.previewFailed": "Failed to render preview ({{status}})",
|
|
214
|
+
"itemPanel.remove": "Remove item",
|
|
215
|
+
"itemPanel.done": "Done",
|
|
216
|
+
"itemPanel.clear": "Clear",
|
|
217
|
+
"itemPanel.choosePage": "Choose a page",
|
|
218
|
+
"itemPanel.noPage": "No page chosen",
|
|
219
|
+
"itemPanel.addImages": "Add a picture",
|
|
220
|
+
"itemPanel.removeImage": "Remove picture",
|
|
221
|
+
"itemPanel.badAddress": "Enter an address that starts with https://, http://, mailto:, tel: or a single /.",
|
|
222
|
+
// M35 C4b (design D16): a button view's dialog and the editor handle's refusals.
|
|
223
|
+
"richText.handleRefused": "The plugin could not change the text: {{reason}}.",
|
|
224
|
+
"richText.handleReasonReadOnly": "the text cannot be changed now",
|
|
225
|
+
"richText.handleReasonInvalid": "what it sent does not fit",
|
|
226
|
+
"richText.handleReasonTooLarge": "the text would pass its limits",
|
|
227
|
+
"richText.handleReasonNotOwnItem": "it may change only its own items",
|
|
228
|
+
"richText.handleReasonGone": "the item or the tool is no longer open",
|
|
229
|
+
"richText.buttonViewClose": "Close",
|
|
230
|
+
// M35 C4b (design D17): the menu a pasted address opens when two plugins' items list its host.
|
|
231
|
+
"richText.pasteChoose": "Paste this address as",
|
|
232
|
+
"richText.pasteAsLink": "Link",
|
|
233
|
+
// M35 C4b (C4b-D6): an item with its own view, outside the admin's host.
|
|
234
|
+
"itemPanel.viewUnavailable": "This item's own editor is not available here. Its data is kept as it is.",
|
|
235
|
+
"markForm.apply": "Apply",
|
|
236
|
+
"markForm.remove": "Remove",
|
|
189
237
|
"simpleStorage.loadFailed": "Failed to load plugin value ({{status}})",
|
|
190
238
|
"simpleStorage.saveFailed": "Failed to save plugin value ({{status}})",
|
|
191
239
|
"simpleStorage.roleCannotRead": "Could not save this field. Your role cannot view pages.",
|
|
@@ -202,6 +250,22 @@ export const SDK_STRINGS_EN = {
|
|
|
202
250
|
"simpleStorage.aUser": "a user",
|
|
203
251
|
"simpleStorage.adminsOnly": "admins only",
|
|
204
252
|
"simpleStorage.listSeparator": ", ",
|
|
253
|
+
// M35 C3 (W25): the words of the SDK's PagePicker, the admin's builtInViews.contentPicker sheet texts.
|
|
254
|
+
"pagePicker.atMax": "Maximum reached: {{max}}",
|
|
255
|
+
"pagePicker.sheetTitle": "Choose a page",
|
|
256
|
+
"pagePicker.sheetTitleMany": "Choose pages",
|
|
257
|
+
"pagePicker.sheetHint": "Pages you can choose are shown in full; others are dimmed.",
|
|
258
|
+
"pagePicker.expand": "Show the pages under {{name}}",
|
|
259
|
+
"pagePicker.collapse": "Hide the pages under {{name}}",
|
|
260
|
+
"pagePicker.chosen": "Chosen",
|
|
261
|
+
"pagePicker.loadMore": "Load more",
|
|
262
|
+
"pagePicker.loading": "Loading…",
|
|
263
|
+
"pagePicker.loadFailed": "The pages could not be read.",
|
|
264
|
+
"pagePicker.cancel": "Cancel",
|
|
265
|
+
"pagePicker.done": "Done",
|
|
266
|
+
// M35 C3 (W25): useCopyText's two toasts.
|
|
267
|
+
"copy.done": "Copied",
|
|
268
|
+
"copy.failed": "Could not copy. Select the text and copy it yourself.",
|
|
205
269
|
};
|
|
206
270
|
/** Placeholder names an SDK string may not use. The admin hands a view's
|
|
207
271
|
* `vars` straight to i18next as its options, and i18next reads these names as
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z, type ZodType } from "zod";
|
|
2
|
+
import type { ServiceMethodContribution } from "./services.js";
|
|
3
|
+
/** @experimental A field holding personal data (design 4.2): listed on the install screen; never in an event. */
|
|
4
|
+
export declare function personal<T extends ZodType>(schema: T): T;
|
|
5
|
+
/** @experimental A page, by id: the reader reads the page through its own published reads (design 4.7). */
|
|
6
|
+
export declare const pageIdSchema: z.ZodString;
|
|
7
|
+
/** @experimental The contract subset's JSON Schema of an object schema, or a TypeError naming what is outside it. */
|
|
8
|
+
export declare function toContractSchema(schema: ZodType): Record<string, unknown>;
|
|
9
|
+
/** @experimental One method, its schemas made from Zod. */
|
|
10
|
+
export declare function contractMethod(method: {
|
|
11
|
+
input: ZodType;
|
|
12
|
+
output: ZodType;
|
|
13
|
+
timeMs?: number;
|
|
14
|
+
writes?: boolean;
|
|
15
|
+
refusals?: string[];
|
|
16
|
+
addedIn?: string;
|
|
17
|
+
}): ServiceMethodContribution;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { readContractSchema } from "@kardalum/api-schemas";
|
|
3
|
+
// M35 B1a (plan decision 1): a contract's schemas travel as JSON Schema, made here from Zod inside the
|
|
4
|
+
// plugin's own bundle, so the server checks every call with its own checker and never runs plugin code
|
|
5
|
+
// to do it. A schema outside the contract subset throws while the manifest is built.
|
|
6
|
+
/** @experimental A field holding personal data (design 4.2): listed on the install screen; never in an event. */
|
|
7
|
+
export function personal(schema) {
|
|
8
|
+
return schema.meta({ personal: true });
|
|
9
|
+
}
|
|
10
|
+
/** @experimental A page, by id: the reader reads the page through its own published reads (design 4.7). */
|
|
11
|
+
export const pageIdSchema = z.string().uuid().describe("A page id. Read the page through getPublishedContent or context.content.");
|
|
12
|
+
/** @experimental The contract subset's JSON Schema of an object schema, or a TypeError naming what is outside it. */
|
|
13
|
+
export function toContractSchema(schema) {
|
|
14
|
+
const json = z.toJSONSchema(schema, {
|
|
15
|
+
unrepresentable: "throw",
|
|
16
|
+
// Copies the personal mark from the registry, so it reaches the JSON Schema in every Zod 4 version.
|
|
17
|
+
override: (ctx) => {
|
|
18
|
+
const meta = z.globalRegistry.get(ctx.zodSchema);
|
|
19
|
+
if (meta?.personal === true)
|
|
20
|
+
ctx.jsonSchema.personal = true;
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
delete json.$schema;
|
|
24
|
+
const read = readContractSchema(json, { root: "object" });
|
|
25
|
+
if (!read.ok)
|
|
26
|
+
throw new TypeError(`A contract schema: ${read.problem}`);
|
|
27
|
+
return json;
|
|
28
|
+
}
|
|
29
|
+
/** @experimental One method, its schemas made from Zod. */
|
|
30
|
+
export function contractMethod(method) {
|
|
31
|
+
return {
|
|
32
|
+
input: toContractSchema(method.input),
|
|
33
|
+
output: toContractSchema(method.output),
|
|
34
|
+
...(method.timeMs !== undefined ? { timeMs: method.timeMs } : {}),
|
|
35
|
+
...(method.writes !== undefined ? { writes: method.writes } : {}),
|
|
36
|
+
...(method.refusals !== undefined ? { refusals: [...method.refusals] } : {}),
|
|
37
|
+
...(method.addedIn !== undefined ? { addedIn: method.addedIn } : {}),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type { PluginEventRefusal, PluginLabel, ServiceFailure, ServiceProviderState } from "@kardalum/api-schemas";
|
|
2
|
+
import type { PluginTaskContext } from "./entitlement-types.js";
|
|
3
|
+
/** @experimental One implementation of a contract, as `context.services.list` answers it. */
|
|
4
|
+
export interface ServiceProviderInfo {
|
|
5
|
+
provider: string;
|
|
6
|
+
label: PluginLabel;
|
|
7
|
+
version: string;
|
|
8
|
+
state: ServiceProviderState;
|
|
9
|
+
}
|
|
10
|
+
/** @experimental A call's answer: a value, or why there is none. Never a throw. */
|
|
11
|
+
export type ServiceResult<T = unknown> = {
|
|
12
|
+
ok: true;
|
|
13
|
+
value: T;
|
|
14
|
+
} | {
|
|
15
|
+
ok: false;
|
|
16
|
+
reason: ServiceFailure;
|
|
17
|
+
code?: string;
|
|
18
|
+
};
|
|
19
|
+
/** @experimental `{ contract }` asks the one provider there is; `{ contract, provider }` asks that one. */
|
|
20
|
+
export interface ServiceTarget {
|
|
21
|
+
contract: string;
|
|
22
|
+
provider?: string;
|
|
23
|
+
}
|
|
24
|
+
/** @experimental Present on route, site route, hook and scheduled task contexts and inside a service. */
|
|
25
|
+
export interface PluginServices {
|
|
26
|
+
/** The providers of a contract this plugin declares under `usedServices`, in plugin id order. Another contract throws TypeError. */
|
|
27
|
+
list(contract: string): Promise<ServiceProviderInfo[]>;
|
|
28
|
+
/** Calls one method through the core: the owner's schemas, size caps and time limit apply. `timeMs` may only shorten the limit. */
|
|
29
|
+
call<T = unknown>(target: ServiceTarget, method: string, input: unknown, options?: {
|
|
30
|
+
timeMs?: number;
|
|
31
|
+
}): Promise<ServiceResult<T>>;
|
|
32
|
+
}
|
|
33
|
+
/** @experimental */
|
|
34
|
+
export type PluginEventRaised = {
|
|
35
|
+
raised: true;
|
|
36
|
+
eventId: string;
|
|
37
|
+
} | {
|
|
38
|
+
raised: false;
|
|
39
|
+
reason: PluginEventRefusal;
|
|
40
|
+
};
|
|
41
|
+
/** @experimental Present where `services` is. Raises one of this plugin's declared `events`. */
|
|
42
|
+
export interface PluginEvents {
|
|
43
|
+
raise(name: string, payload: unknown): Promise<PluginEventRaised>;
|
|
44
|
+
}
|
|
45
|
+
/** @experimental Who called, set by the core; a consumer cannot forge it. */
|
|
46
|
+
export interface PluginServiceCaller {
|
|
47
|
+
pluginId: string;
|
|
48
|
+
version: string;
|
|
49
|
+
}
|
|
50
|
+
/** @experimental What an implementation receives beside its input: its own plugin's context, a scheduled
|
|
51
|
+
* task's members without `task`, plus `caller`; `signal` aborts at the method's time limit, and after it
|
|
52
|
+
* every library of this context refuses. */
|
|
53
|
+
export interface PluginServiceContext extends Omit<PluginTaskContext, "task"> {
|
|
54
|
+
caller: PluginServiceCaller;
|
|
55
|
+
}
|
|
56
|
+
/** @experimental */
|
|
57
|
+
export type ServiceImplementation = (input: unknown, context: PluginServiceContext) => unknown;
|
|
58
|
+
/** @experimental One method of a contract. `input` and `output` are JSON Schema of the contract subset: build them with `contractMethod`. */
|
|
59
|
+
export interface ServiceMethodContribution {
|
|
60
|
+
input: Record<string, unknown>;
|
|
61
|
+
output: Record<string, unknown>;
|
|
62
|
+
/** SERVICE_CALL_TIME_MS_MIN to SERVICE_CALL_TIME_MS_MAX, default SERVICE_CALL_TIME_MS_DEFAULT. */
|
|
63
|
+
timeMs?: number;
|
|
64
|
+
writes?: boolean;
|
|
65
|
+
/** The codes a provider may answer with `{ refused: "<code>" }`. */
|
|
66
|
+
refusals?: string[];
|
|
67
|
+
/** The minor version that added this method; providers built earlier answer `notImplemented`. */
|
|
68
|
+
addedIn?: string;
|
|
69
|
+
}
|
|
70
|
+
/** @experimental A contract this plugin owns: `<this plugin's id>/<name>`. */
|
|
71
|
+
export interface ServiceContractContribution {
|
|
72
|
+
name: string;
|
|
73
|
+
version: string;
|
|
74
|
+
label: PluginLabel;
|
|
75
|
+
description?: PluginLabel;
|
|
76
|
+
methods: Record<string, ServiceMethodContribution>;
|
|
77
|
+
/** @experimental The uses a provider of this contract needs for it to work: the scaffold adds them to an offer (M35 B1c). */
|
|
78
|
+
providersUse?: Array<{
|
|
79
|
+
contract: string;
|
|
80
|
+
range: string;
|
|
81
|
+
}>;
|
|
82
|
+
}
|
|
83
|
+
/** @experimental An implementation of a contract, this plugin's own or another's. */
|
|
84
|
+
export interface ExposedServiceContribution {
|
|
85
|
+
contract: string;
|
|
86
|
+
version: string;
|
|
87
|
+
label: PluginLabel;
|
|
88
|
+
implementation: Record<string, ServiceImplementation>;
|
|
89
|
+
}
|
|
90
|
+
/** @experimental A contract this plugin calls. `optional: false` (the default) makes the owner a dependency. */
|
|
91
|
+
export interface UsedServiceContribution {
|
|
92
|
+
contract: string;
|
|
93
|
+
range: string;
|
|
94
|
+
optional?: boolean;
|
|
95
|
+
}
|
|
96
|
+
/** @experimental An event this plugin raises; others hear it as `<this plugin's id>:<name>`. No personal fields. */
|
|
97
|
+
export interface PluginEventContribution {
|
|
98
|
+
name: string;
|
|
99
|
+
label: PluginLabel;
|
|
100
|
+
description?: PluginLabel;
|
|
101
|
+
payload: Record<string, unknown>;
|
|
102
|
+
}
|
|
103
|
+
/** @experimental A plugin event's hook key. A core event never has a "." before its ":". */
|
|
104
|
+
export type PluginEventKey = `${string}.${string}:${string}`;
|
|
105
|
+
/** @experimental What a handler of a plugin event receives. `data` is the raiser's payload, checked against its schema. */
|
|
106
|
+
export interface PluginEventHookPayload {
|
|
107
|
+
event: PluginEventKey;
|
|
108
|
+
raisedBy: string;
|
|
109
|
+
name: string;
|
|
110
|
+
data: unknown;
|
|
111
|
+
/** 0 when raised outside a plugin event's handler; a raise inside such a handler carries one more. */
|
|
112
|
+
depth: number;
|
|
113
|
+
occurredAt: string;
|
|
114
|
+
}
|
package/dist/services.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -41,16 +41,21 @@ export interface ScopedStructuredStorage {
|
|
|
41
41
|
query<T = Record<string, unknown>>(tableName: string): StructuredQueryBuilder<T>;
|
|
42
42
|
transaction(fn: (tx: StructuredStorageTransaction) => Promise<void>): Promise<void>;
|
|
43
43
|
}
|
|
44
|
-
import type {
|
|
44
|
+
import type { PluginVisitor, PluginVisitors } from "./visitors.js";
|
|
45
|
+
import type { ListPublishedOptions, PageAddress, PageAddressState, PluginCaller, PluginFieldInfo, ProtectionWidgetInfo, PublishedListPage, PublishedSearchPage, SearchPublishedOptions } from "@kardalum/api-schemas";
|
|
46
|
+
import type { RenderCachePurgeTarget } from "@kardalum/api-schemas";
|
|
45
47
|
import type { Entitlement } from "./entitlement-types.js";
|
|
46
48
|
import type { PluginContentLibrary, ProtectionFields, ProtectionResult } from "./content-library.js";
|
|
47
49
|
import type { PluginMediaLibrary } from "./media-library.js";
|
|
50
|
+
import type { PluginUploadedFile, PluginUploads } from "./uploads.js";
|
|
48
51
|
import type { PluginNotify } from "./notify.js";
|
|
49
52
|
import type { PluginMail } from "./mail.js";
|
|
50
53
|
import type { PluginOutbound } from "./outbound.js";
|
|
51
54
|
import type { PluginSealing } from "./sealing.js";
|
|
55
|
+
import type { PluginUserFields, PluginUserLibrary } from "./user-library.js";
|
|
52
56
|
import type { PluginVendorService } from "./vendor-service.js";
|
|
53
57
|
import type { PluginSecrets, PluginSettingsReader } from "./providers.js";
|
|
58
|
+
import type { PluginEvents, PluginServices } from "./services.js";
|
|
54
59
|
/** A published page as any visitor reads it, in one language (`getPublishedContent`). */
|
|
55
60
|
export interface PublishedContent {
|
|
56
61
|
id: string;
|
|
@@ -69,6 +74,10 @@ export interface PublishedContent {
|
|
|
69
74
|
* `data` may hold. `dataType` is the editor id (the id a plugin declares under `dataTypes`),
|
|
70
75
|
* never a data type row id. */
|
|
71
76
|
fields: PluginFieldInfo[];
|
|
77
|
+
/** @experimental M35 P4 (G67): whether the server answers this page with a page, as listPublishedPages'
|
|
78
|
+
* `rendered` says: true when the render would choose a template for it, false when it would find none, null
|
|
79
|
+
* on a server that renders no site. */
|
|
80
|
+
rendered: boolean | null;
|
|
72
81
|
}
|
|
73
82
|
/** M33 K22: what `getPublishedContent` takes. */
|
|
74
83
|
export interface GetPublishedContentOptions {
|
|
@@ -76,6 +85,10 @@ export interface GetPublishedContentOptions {
|
|
|
76
85
|
* first published one when the default is not published. A language the page is not published
|
|
77
86
|
* in answers null, never another language. */
|
|
78
87
|
culture?: string;
|
|
88
|
+
/** @experimental M35 U2b (W8): read as this visitor: the `context.visitor` the core handed this request. Absent, or
|
|
89
|
+
* any other object (a copy, one kept past its request, one `context.visitors.get` answered): an anonymous reader,
|
|
90
|
+
* so a members-only page answers null. */
|
|
91
|
+
visitor?: PluginVisitor;
|
|
79
92
|
}
|
|
80
93
|
/** M32 F4c (D2): one page `listPublishedPages` answers: published, live, and with an address. */
|
|
81
94
|
export interface PublishedPageItem {
|
|
@@ -119,6 +132,14 @@ export interface ListPublishedPagesOptions {
|
|
|
119
132
|
after?: string;
|
|
120
133
|
/** 1 to 500 (PUBLISHED_PAGES_LIMIT_MAX), default 100. */
|
|
121
134
|
limit?: number;
|
|
135
|
+
/** @experimental M35 U2b (W8): list as this visitor, as `GetPublishedContentOptions.visitor` reads it; absent,
|
|
136
|
+
* members-only pages are left out. */
|
|
137
|
+
visitor?: PluginVisitor;
|
|
138
|
+
}
|
|
139
|
+
/** @experimental M35 U2b (W8): what `pageAddresses` and `pageAtAddress` take: read as this visitor, as
|
|
140
|
+
* `GetPublishedContentOptions.visitor` reads it; absent, a members-only page answers as a missing one. */
|
|
141
|
+
export interface PageReadAsOptions {
|
|
142
|
+
visitor?: PluginVisitor;
|
|
122
143
|
}
|
|
123
144
|
/** M33 K23: what `siteOfHost` takes. */
|
|
124
145
|
export interface SiteOfHostOptions {
|
|
@@ -197,7 +218,7 @@ export interface PluginAddressLookup {
|
|
|
197
218
|
* scheme, a host that is no domain). A non-string or one over `SITE_LOCATION_MAX` (2,000)
|
|
198
219
|
* characters throws TypeError. Open to every plugin: it is the answer the delivery API gives
|
|
199
220
|
* anyone. */
|
|
200
|
-
pageAtAddress(address: string): Promise<PageAtAddressAnswer | null>;
|
|
221
|
+
pageAtAddress(address: string, options?: PageReadAsOptions): Promise<PageAtAddressAnswer | null>;
|
|
201
222
|
}
|
|
202
223
|
/**
|
|
203
224
|
* M32 F2 (D27): what a handler receives instead of the Fastify request and reply. Plugin code runs in
|
|
@@ -212,8 +233,12 @@ export interface PluginRequestView {
|
|
|
212
233
|
readonly body: unknown;
|
|
213
234
|
/** M33 K4: the request's exact bytes, a fresh copy for this handler (changing it changes
|
|
214
235
|
* neither `body` nor what the host read). Present only on a route that declares
|
|
215
|
-
* `rawBody: true`, when the request carried a body the host parses
|
|
236
|
+
* `rawBody: true`, when the request carried a body the host parses: JSON, plain text, or since
|
|
237
|
+
* M35 P2 a form-encoded body. M35 P2: a POST site route may declare it too (experimental). */
|
|
216
238
|
readonly rawBody?: Uint8Array;
|
|
239
|
+
/** @experimental M35 B3 (W17): the files the request carried, checked by the core, on a route that declares
|
|
240
|
+
* `uploads` (empty when it carried none); absent on any other route. Read or keep them with `context.uploads`. */
|
|
241
|
+
readonly files?: readonly PluginUploadedFile[];
|
|
217
242
|
readonly headers: Record<string, string | string[] | undefined>;
|
|
218
243
|
readonly ip: string;
|
|
219
244
|
readonly ips: readonly string[];
|
|
@@ -286,6 +311,32 @@ export interface PluginServerContextBase {
|
|
|
286
311
|
* set, a domain stored without a scheme is printed with the request's scheme; in a hook or a
|
|
287
312
|
* scheduled task, which have no request, with https. */
|
|
288
313
|
listPublishedPages(opts?: ListPublishedPagesOptions): Promise<PublishedPagesPage>;
|
|
314
|
+
/**
|
|
315
|
+
* M35 C1 (W15, W13): published pages sorted and filtered, a cursor at a time. Open to every plugin, as
|
|
316
|
+
* listPublishedPages is. `opts` names a `type` (the plugin's own type of that name first, else the one site
|
|
317
|
+
* type of that name) or a `typeId`, a `parent` or an `under` page, at least one; `sort` is "published"
|
|
318
|
+
* (newest first by default; needs a type or a parent), "order" (needs a parent), "_tree" (the tree's order)
|
|
319
|
+
* or a field id, each with " asc" or " desc"; `where` holds up to PUBLISHED_QUERY_WHERE_MAX tests of the
|
|
320
|
+
* type's fields (`{ field, eq }`, `{ field, in }`, `{ field, gte?, lt? }`, `{ field, has }`), of text, date,
|
|
321
|
+
* number, boolean, picker and options fields only; a private or missing field throws the same TypeError.
|
|
322
|
+
* A call examines at most PUBLISHED_QUERY_SCAN_MAX rows of its order: when that ends before `limit` matched,
|
|
323
|
+
* the page is short, `scanCapped` is true and `nextCursor` reads on. Items carry no field values: read them
|
|
324
|
+
* with getPublishedContent. A bad option throws TypeError; a field sort over more than
|
|
325
|
+
* CONTENT_LIST_FIELD_SORT_MAX pages throws RangeError. `nextCursor` is a position in the order, readable by
|
|
326
|
+
* anyone who holds it: after a short page it can be the last row examined, which may be a page that is not
|
|
327
|
+
* published (its stored path and id). Keep it in server code, or hand a visitor only a position of an item
|
|
328
|
+
* the call answered.
|
|
329
|
+
* @experimental
|
|
330
|
+
*/
|
|
331
|
+
listPublished(opts: ListPublishedOptions): Promise<PublishedListPage>;
|
|
332
|
+
/**
|
|
333
|
+
* M35 C1 (W13): the delivery search (the chosen search provider, else the built-in search) over published
|
|
334
|
+
* pages, by text (2 to PUBLISHED_SEARCH_TEXT_MAX characters), optionally of one type and under one page.
|
|
335
|
+
* Its items are listPublished's, but the search covers every published language: `culture` picks only each
|
|
336
|
+
* item's `url`. Open to every plugin.
|
|
337
|
+
* @experimental
|
|
338
|
+
*/
|
|
339
|
+
searchPublished(opts: SearchPublishedOptions): Promise<PublishedSearchPage>;
|
|
289
340
|
/** M33 K23: which site `host` (a request's `Host`, its port included) belongs to, or null for a
|
|
290
341
|
* host that cannot be read (empty, over 300 characters, a path, a user, a bad port). Open to
|
|
291
342
|
* every plugin: site addresses are public. A bad `scheme` throws TypeError. */
|
|
@@ -307,7 +358,7 @@ export interface PluginServerContextBase {
|
|
|
307
358
|
* Open to every plugin: addresses are public; no content is read. On a route or site route,
|
|
308
359
|
* when no public URL is set, a domain stored without a scheme is printed with the request's
|
|
309
360
|
* scheme; in a hook or a scheduled task, which have no request, with https. */
|
|
310
|
-
pageAddresses(targets: ReadonlyArray<PageAddressTarget
|
|
361
|
+
pageAddresses(targets: ReadonlyArray<PageAddressTarget>, options?: PageReadAsOptions): Promise<Array<PageAddresses | null>>;
|
|
311
362
|
/** S284b: the host's latest licence verdict for this plugin, exactly as
|
|
312
363
|
* the marketplace signed it (`kind: "verdict"`), `kind: "exempt"` on a
|
|
313
364
|
* non-production install, `kind: "none"` when the host holds no verdict.
|
|
@@ -330,6 +381,45 @@ export interface PluginServerContextBase {
|
|
|
330
381
|
/** M32 F4d (D7): the plugin's settings values, read with `get(id)` or `all()`. Set by the host. */
|
|
331
382
|
settings?: PluginSettingsReader;
|
|
332
383
|
}
|
|
384
|
+
/** M35 P3 (W18): where a site route that answers after the pages was asked: the language the address was read
|
|
385
|
+
* in (its prefix, else the visitor's Accept-Language among the site's languages, else the default), whether the
|
|
386
|
+
* address carried the prefix, and the decoded path the route matched, without the prefix. @experimental */
|
|
387
|
+
export interface SiteRouteAddress {
|
|
388
|
+
culture: string;
|
|
389
|
+
prefixed: boolean;
|
|
390
|
+
path: string;
|
|
391
|
+
}
|
|
392
|
+
/** M35 P4 (W53): what `context.renderPage` takes. `culture` is one of the site's languages (compared in lower
|
|
393
|
+
* case); absent, the default language. @experimental */
|
|
394
|
+
export interface RenderPageOptions {
|
|
395
|
+
culture?: string;
|
|
396
|
+
}
|
|
397
|
+
/** M35 P4 (W53): a rendered page and the language it was rendered in. @experimental */
|
|
398
|
+
export interface RenderedPageHtml {
|
|
399
|
+
html: string;
|
|
400
|
+
culture: string;
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* M35 P4 (W53): the published page's HTML as an anonymous visitor gets it, through the normal render (published
|
|
404
|
+
* values only, private fields left out, the template, blocks and page output transforms), on the configured public
|
|
405
|
+
* URL, never cached and never counted as a view. Null for no such page, a draft, a trashed page, a page whose site
|
|
406
|
+
* is not published, a page not served in `culture`, a page with no template, or a page gate that answered. A page
|
|
407
|
+
* id that is no UUID or a `culture` that is no site language throws TypeError; the limits throw
|
|
408
|
+
* RenderPageRefusedError. @experimental
|
|
409
|
+
*/
|
|
410
|
+
export type PluginRenderPage = (pageId: string, options?: RenderPageOptions) => Promise<RenderedPageHtml | null>;
|
|
411
|
+
/**
|
|
412
|
+
* M35 P4 (W32): the core's render cache on this server. `tagsOf(pageId)` answers the tags a change of that page
|
|
413
|
+
* touches (`page:<id>`, its type's `type:<id>`, `under:<id>` for every page below it, a `list:<id>` for its parent
|
|
414
|
+
* and every ancestor, and `all`), the
|
|
415
|
+
* tags the core writes beside a page cache answer, so a CDN is purged by exactly them; [] for an unknown page, and a
|
|
416
|
+
* page id that is no UUID throws TypeError. `purge({ tags })` (core tags only) or `purge({ all: true })` removes the
|
|
417
|
+
* matching rendered pages and answers how many; another server's copies live out their second. @experimental
|
|
418
|
+
*/
|
|
419
|
+
export interface PluginRenderCache {
|
|
420
|
+
purge(target: RenderCachePurgeTarget): number;
|
|
421
|
+
tagsOf(pageId: string): Promise<string[]>;
|
|
422
|
+
}
|
|
333
423
|
export interface PluginApiRouteContext extends PluginServerContextBase, PluginAddressLookup {
|
|
334
424
|
/** M32 F (D8): the content half of the management client, acting as this plugin within its
|
|
335
425
|
* `contentAccess`. Present only when the manifest declares contentAccess. A call outside the
|
|
@@ -339,6 +429,8 @@ export interface PluginApiRouteContext extends PluginServerContextBase, PluginAd
|
|
|
339
429
|
* (media.create) and `get` (media.read). Present only when the manifest declares mediaAccess. A
|
|
340
430
|
* call outside the declaration throws MediaAccessRefusedError and sends nothing. */
|
|
341
431
|
media?: PluginMediaLibrary;
|
|
432
|
+
/** @experimental M35 B3 (W17): this request's files (PluginUploads). Present only on a route that declares `uploads`. */
|
|
433
|
+
uploads?: PluginUploads;
|
|
342
434
|
/** M32 F (D17): the built-in form protection for the request this route was called with.
|
|
343
435
|
* M32 F2 (D27): a site route passes the PluginRequestView it received. On
|
|
344
436
|
* M32 H (H19): an `ok` answer may carry `reply`, present only when the plugin declares `formReplies`.
|
|
@@ -369,4 +461,32 @@ export interface PluginApiRouteContext extends PluginServerContextBase, PluginAd
|
|
|
369
461
|
/** M33 K17: seals values the plugin makes under a key of its own for each declared kind (`seal`, `open`).
|
|
370
462
|
* Present only for a plugin that declares `sealedValues`; a call after the plugin is switched off answers `inactive`. */
|
|
371
463
|
sealing?: PluginSealing;
|
|
464
|
+
/** @experimental M35 U1 (W6): the admin accounts, within `userAccess`. Present only when the manifest declares it. */
|
|
465
|
+
users?: PluginUserLibrary;
|
|
466
|
+
/** @experimental M35 U1 (W6): this plugin's own account fields. Present only when the manifest declares userFields. */
|
|
467
|
+
userFields?: PluginUserFields;
|
|
468
|
+
/** @experimental M35 U1 (W52): whether the caller holds `action` (a core action or one of this
|
|
469
|
+
* plugin's own; another plugin's throws TypeError), answered by the core's one gate. On "admin" and
|
|
470
|
+
* "apiKey" routes only. */
|
|
471
|
+
can?: (action: string) => Promise<boolean>;
|
|
472
|
+
/** @experimental M35 U1 (W52): whether the caller may read, or edit, one page, by the role's action and
|
|
473
|
+
* the page's restrictions; false for a missing or trashed page. On "admin" and "apiKey" routes only. */
|
|
474
|
+
canAccessPage?: (pageId: string, mode: "read" | "edit") => Promise<boolean>;
|
|
475
|
+
/** @experimental M35 B1a: another plugin's services, for the contracts this plugin uses. */
|
|
476
|
+
services?: PluginServices;
|
|
477
|
+
/** @experimental M35 B1a: this plugin's own declared events. */
|
|
478
|
+
events?: PluginEvents;
|
|
479
|
+
/** @experimental M35 P3 (W18): on a site route that answers after the pages only. */
|
|
480
|
+
address?: SiteRouteAddress;
|
|
481
|
+
/** @experimental M35 P4 (W53): renders a published page to HTML (PluginRenderPage). Set by the host. */
|
|
482
|
+
renderPage?: PluginRenderPage;
|
|
483
|
+
/** @experimental M35 P4 (W32): the core's render cache (PluginRenderCache). Set by the host. */
|
|
484
|
+
renderCache?: PluginRenderCache;
|
|
485
|
+
/** @experimental M35 U2b (W8): the signed-in visitor of the site, on site routes and "public" routes only, for a
|
|
486
|
+
* plugin that declares visitorIdentity (absent otherwise). Null for an anonymous request, a site with visitor
|
|
487
|
+
* accounts off, or a POST whose Origin or Sec-Fetch-Site is not the site itself. Frozen, and only for this request:
|
|
488
|
+
* kept past it, it opens no members-only page. */
|
|
489
|
+
visitor?: PluginVisitor | null;
|
|
490
|
+
/** @experimental M35 U2b (W8): the site's visitor accounts by id. Present only when the manifest declares visitorIdentity. */
|
|
491
|
+
visitors?: PluginVisitors;
|
|
372
492
|
}
|
package/dist/tailwind.js
CHANGED
|
@@ -3,10 +3,15 @@
|
|
|
3
3
|
// Tailwind 3. Use it as `theme` in the plugin's tailwind.config, so the
|
|
4
4
|
// plugin's classes map to the same CSS variables as the admin's.
|
|
5
5
|
//
|
|
6
|
-
// On Tailwind 4,
|
|
7
|
-
// `@
|
|
8
|
-
// `@import "tailwindcss/
|
|
6
|
+
// On Tailwind 4 (the admin's version, 4.3.3), import
|
|
7
|
+
// `@kardalum/plugin-sdk/tailwind/theme.css` between
|
|
8
|
+
// `@import "tailwindcss/theme.css" layer(theme) theme(reference);` and
|
|
9
|
+
// `@import "tailwindcss/utilities.css" layer(utilities) source(none);`, then an
|
|
10
|
+
// `@source` line for the plugin's own files (never the whole
|
|
9
11
|
// `@import "tailwindcss"`, whose base reset would leak into the admin): the
|
|
10
|
-
// same scales as an `@theme` block, generated from the same source.
|
|
11
|
-
//
|
|
12
|
+
// same scales as an `@theme` block, generated from the same source.
|
|
13
|
+
// `theme(reference)` writes no `:root, :host` block, which the "admin styles"
|
|
14
|
+
// delivery check refuses; `kardalum plugin build` puts the stylesheet in the
|
|
15
|
+
// plugin's own layer. It only references variables, so a standalone preview
|
|
16
|
+
// also needs `tokens.css`.
|
|
12
17
|
export { tailwindTheme } from "@kardalum/design-tokens";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { TemplateReadRefusal } from "@kardalum/api-schemas";
|
|
2
|
+
/**
|
|
3
|
+
* M35 P3 (W19): thrown by a template call's published reads (`context.getPublishedContent` and the
|
|
4
|
+
* four beside it on TemplateCallContext) when the read cannot run: `spent` (the render's list read
|
|
5
|
+
* budget, TEMPLATE_PLUGIN_READS_PER_RENDER_MAX or TEMPLATE_PLUGIN_SEARCHES_PER_RENDER_MAX), `ended`
|
|
6
|
+
* (the call already timed out), `unavailable` (no reader where the call runs). Catch it to write
|
|
7
|
+
* something else; uncaught, the call is dropped like any failing call. Test it with
|
|
8
|
+
* isTemplateReadRefusedError, never `instanceof`.
|
|
9
|
+
* @experimental
|
|
10
|
+
*/
|
|
11
|
+
export declare class TemplateReadRefusedError extends Error {
|
|
12
|
+
readonly reason: TemplateReadRefusal;
|
|
13
|
+
constructor(reason: TemplateReadRefusal);
|
|
14
|
+
}
|
|
15
|
+
/** True for a TemplateReadRefusedError from ANY copy of this SDK (a plugin bundles its own copy). */
|
|
16
|
+
export declare function isTemplateReadRefusedError(value: unknown): value is TemplateReadRefusedError;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* M35 P3 (W19): thrown by a template call's published reads (`context.getPublishedContent` and the
|
|
3
|
+
* four beside it on TemplateCallContext) when the read cannot run: `spent` (the render's list read
|
|
4
|
+
* budget, TEMPLATE_PLUGIN_READS_PER_RENDER_MAX or TEMPLATE_PLUGIN_SEARCHES_PER_RENDER_MAX), `ended`
|
|
5
|
+
* (the call already timed out), `unavailable` (no reader where the call runs). Catch it to write
|
|
6
|
+
* something else; uncaught, the call is dropped like any failing call. Test it with
|
|
7
|
+
* isTemplateReadRefusedError, never `instanceof`.
|
|
8
|
+
* @experimental
|
|
9
|
+
*/
|
|
10
|
+
export class TemplateReadRefusedError extends Error {
|
|
11
|
+
reason;
|
|
12
|
+
constructor(reason) {
|
|
13
|
+
super(`template read refused: ${reason}`);
|
|
14
|
+
this.name = "TemplateReadRefusedError";
|
|
15
|
+
this.reason = reason;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/** True for a TemplateReadRefusedError from ANY copy of this SDK (a plugin bundles its own copy). */
|
|
19
|
+
export function isTemplateReadRefusedError(value) {
|
|
20
|
+
return value instanceof Error && value.name === "TemplateReadRefusedError";
|
|
21
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type ServiceFailure } from "@kardalum/api-schemas";
|
|
2
|
+
import type { PluginServiceContext, PluginServices, ServiceResult } from "./services.js";
|
|
3
|
+
/** @experimental A contract document (a copy's schema.json) or an owner's own declaration. */
|
|
4
|
+
export type HarnessContract = unknown;
|
|
5
|
+
/** @experimental */
|
|
6
|
+
export declare function serviceHarness(contract: HarnessContract, implementation: Record<string, (input: never, context: PluginServiceContext) => unknown>, options?: {
|
|
7
|
+
context?: Partial<PluginServiceContext>;
|
|
8
|
+
caller?: {
|
|
9
|
+
pluginId: string;
|
|
10
|
+
version: string;
|
|
11
|
+
};
|
|
12
|
+
setTimer?: (fn: () => void, ms: number) => {
|
|
13
|
+
clear(): void;
|
|
14
|
+
};
|
|
15
|
+
}): {
|
|
16
|
+
call<T = unknown>(method: string, input: unknown, callOptions?: {
|
|
17
|
+
timeMs?: number;
|
|
18
|
+
}): Promise<ServiceResult<T>>;
|
|
19
|
+
};
|
|
20
|
+
declare const FAIL: unique symbol;
|
|
21
|
+
type FailAnswer = {
|
|
22
|
+
[FAIL]: ServiceFailure;
|
|
23
|
+
};
|
|
24
|
+
/** @experimental A stand-in provider for a consumer's tests: pass it as `context.services`. */
|
|
25
|
+
export declare function fakeProvider(contract: HarnessContract, answers: Record<string, unknown>, options?: {
|
|
26
|
+
provider?: string;
|
|
27
|
+
}): PluginServices & {
|
|
28
|
+
calls: Array<{
|
|
29
|
+
method: string;
|
|
30
|
+
input: unknown;
|
|
31
|
+
}>;
|
|
32
|
+
};
|
|
33
|
+
export declare namespace fakeProvider {
|
|
34
|
+
var fail: (reason: ServiceFailure) => FailAnswer;
|
|
35
|
+
}
|
|
36
|
+
/** @experimental The smallest value a method's input admits: a starting point for a test. */
|
|
37
|
+
export declare function sampleInput(contract: HarnessContract, method: string): unknown;
|
|
38
|
+
export {};
|