@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
|
@@ -130,6 +130,24 @@ export declare const PluginReferenceSchema: z.ZodObject<{
|
|
|
130
130
|
id: z.ZodString;
|
|
131
131
|
action: z.ZodString;
|
|
132
132
|
}, z.core.$strict>>>;
|
|
133
|
+
contentSlots: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
134
|
+
kind: z.ZodEnum<{
|
|
135
|
+
filter: "filter";
|
|
136
|
+
column: "column";
|
|
137
|
+
badge: "badge";
|
|
138
|
+
bulkAction: "bulkAction";
|
|
139
|
+
}>;
|
|
140
|
+
label: z.ZodString;
|
|
141
|
+
documentTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
142
|
+
id: z.ZodString;
|
|
143
|
+
action: z.ZodString;
|
|
144
|
+
}, z.core.$strict>>>;
|
|
145
|
+
adminSlots: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
146
|
+
slot: z.ZodString;
|
|
147
|
+
label: z.ZodString;
|
|
148
|
+
id: z.ZodString;
|
|
149
|
+
action: z.ZodString;
|
|
150
|
+
}, z.core.$strict>>>;
|
|
133
151
|
hooks: z.ZodArray<z.ZodString>;
|
|
134
152
|
scheduledTasks: z.ZodArray<z.ZodObject<{
|
|
135
153
|
id: z.ZodString;
|
|
@@ -158,6 +158,9 @@ export const PluginReferenceSchema = z
|
|
|
158
158
|
// M32 F3: default to empty, so a reference.json written before editor panels existed still parses.
|
|
159
159
|
editorPanels: z.array(z.object({ ...gated, label: z.string(), documentTypes: z.array(z.string()).optional() }).strict()).default([]),
|
|
160
160
|
treeActions: z.array(z.object({ ...gated, label: z.string(), documentTypes: z.array(z.string()).optional() }).strict()).default([]),
|
|
161
|
+
// M35 C2: columns, badges, filters and bulk actions; and views in the core's own screens.
|
|
162
|
+
contentSlots: z.array(z.object({ ...gated, kind: z.enum(["column", "badge", "filter", "bulkAction"]), label: z.string(), documentTypes: z.array(z.string()).optional() }).strict()).default([]),
|
|
163
|
+
adminSlots: z.array(z.object({ ...gated, slot: z.string(), label: z.string() }).strict()).default([]),
|
|
161
164
|
hooks: z.array(z.string()),
|
|
162
165
|
scheduledTasks: z.array(z.object({ id: z.string(), name: z.string(), cron: z.string() }).strict()),
|
|
163
166
|
// M32 F4d (D8): the settings fields a plugin declares; defaults to empty so older references still parse.
|
|
@@ -170,7 +173,7 @@ export const PluginReferenceSchema = z
|
|
|
170
173
|
export function emptyPluginReference() {
|
|
171
174
|
return {
|
|
172
175
|
actions: [], roles: [], apiRoutes: [], capabilities: [], documentTypes: [], dataTypes: [], templates: [],
|
|
173
|
-
adminSections: [], railEntries: [], dashboardWidgets: [], editorPanels: [], treeActions: [], hooks: [], scheduledTasks: [], settings: [], migrations: [], assertions: [], installOptions: [],
|
|
176
|
+
adminSections: [], railEntries: [], dashboardWidgets: [], editorPanels: [], treeActions: [], contentSlots: [], adminSlots: [], hooks: [], scheduledTasks: [], settings: [], migrations: [], assertions: [], installOptions: [],
|
|
174
177
|
};
|
|
175
178
|
}
|
|
176
179
|
export const REFERENCE_PAGE_SLUGS = ["permissions", "api-routes", "capabilities", "content", "admin-surfaces", "lifecycle"];
|
|
@@ -182,7 +185,7 @@ export const REFERENCE_PAGE_TABLES = {
|
|
|
182
185
|
"api-routes": ["apiRoutes"],
|
|
183
186
|
capabilities: ["capabilities"],
|
|
184
187
|
content: ["documentTypes", "dataTypes", "templates"],
|
|
185
|
-
"admin-surfaces": ["adminSections", "railEntries", "dashboardWidgets", "editorPanels", "treeActions"],
|
|
188
|
+
"admin-surfaces": ["adminSections", "railEntries", "dashboardWidgets", "editorPanels", "treeActions", "contentSlots", "adminSlots"],
|
|
186
189
|
lifecycle: ["installOptions", "settings", "hooks", "scheduledTasks", "migrations", "assertions"],
|
|
187
190
|
};
|
|
188
191
|
export function isReferencePageSlug(slug) {
|
|
@@ -22,5 +22,13 @@ export declare const DURABLE_WAITING_MAX = 10000;
|
|
|
22
22
|
* number of at least 1.
|
|
23
23
|
*/
|
|
24
24
|
export declare function durableRetryDelayMs(failedTries: number): number | null;
|
|
25
|
-
/** The
|
|
26
|
-
|
|
25
|
+
/** The 35 events a plugin may hook (the SDK's HOOK_EVENTS is this list), and the only ones a `hooks`
|
|
26
|
+
* entry may name, durable or not. The first 19 are those of release 0.20.0; the rest came with
|
|
27
|
+
* month 35's sessions B2 and U2b and are experimental (experimental-points.ts). */
|
|
28
|
+
export declare const PLUGIN_HOOK_EVENTS: readonly ["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"];
|
|
29
|
+
/** M35 B2: events whose moment is gone after a restart, so a hook on them is never durable. */
|
|
30
|
+
export declare const NON_DURABLE_HOOK_EVENTS: readonly ["system:beforeShutdown"];
|
|
31
|
+
/** Whether a `hooks` entry for this event may be written `{ handler, durable: true }`. */
|
|
32
|
+
export declare function isDurableAllowed(event: string): boolean;
|
|
33
|
+
/** The hook events release 0.20.0 shipped: under the promise. Every other event is experimental (experimental-points.ts). */
|
|
34
|
+
export declare const PROMISED_HOOK_EVENTS: readonly ["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"];
|
|
@@ -31,7 +31,9 @@ export function durableRetryDelayMs(failedTries) {
|
|
|
31
31
|
return null;
|
|
32
32
|
return DURABLE_RETRY_DELAYS_MS[failedTries - 1];
|
|
33
33
|
}
|
|
34
|
-
/** The
|
|
34
|
+
/** The 35 events a plugin may hook (the SDK's HOOK_EVENTS is this list), and the only ones a `hooks`
|
|
35
|
+
* entry may name, durable or not. The first 19 are those of release 0.20.0; the rest came with
|
|
36
|
+
* month 35's sessions B2 and U2b and are experimental (experimental-points.ts). */
|
|
35
37
|
export const PLUGIN_HOOK_EVENTS = [
|
|
36
38
|
"content:afterSave",
|
|
37
39
|
"content:afterPublish",
|
|
@@ -52,4 +54,49 @@ export const PLUGIN_HOOK_EVENTS = [
|
|
|
52
54
|
"plugin:afterActivate",
|
|
53
55
|
"plugin:afterDeactivate",
|
|
54
56
|
"audit:afterRecord",
|
|
57
|
+
"content:afterSort",
|
|
58
|
+
"content:afterAccessChange",
|
|
59
|
+
"documentType:afterChange",
|
|
60
|
+
"dataType:afterChange",
|
|
61
|
+
"role:afterChange",
|
|
62
|
+
"user:afterChange",
|
|
63
|
+
"site:afterAddressChange",
|
|
64
|
+
"site:afterPageViews",
|
|
65
|
+
"system:afterStart",
|
|
66
|
+
"system:beforeShutdown",
|
|
67
|
+
"system:afterError",
|
|
68
|
+
// M35 U2b (W8): site visitor accounts. Payloads carry ids and keys, never an email.
|
|
69
|
+
"visitor:afterRegister",
|
|
70
|
+
"visitor:afterConfirm",
|
|
71
|
+
"visitor:afterSignIn",
|
|
72
|
+
"visitor:afterGroupChange",
|
|
73
|
+
"visitor:afterDelete",
|
|
74
|
+
];
|
|
75
|
+
/** M35 B2: events whose moment is gone after a restart, so a hook on them is never durable. */
|
|
76
|
+
export const NON_DURABLE_HOOK_EVENTS = ["system:beforeShutdown"];
|
|
77
|
+
/** Whether a `hooks` entry for this event may be written `{ handler, durable: true }`. */
|
|
78
|
+
export function isDurableAllowed(event) {
|
|
79
|
+
return !NON_DURABLE_HOOK_EVENTS.includes(event);
|
|
80
|
+
}
|
|
81
|
+
/** The hook events release 0.20.0 shipped: under the promise. Every other event is experimental (experimental-points.ts). */
|
|
82
|
+
export const PROMISED_HOOK_EVENTS = [
|
|
83
|
+
"content:afterSave",
|
|
84
|
+
"content:afterPublish",
|
|
85
|
+
"content:afterTrash",
|
|
86
|
+
"content:afterRestore",
|
|
87
|
+
"content:afterUnpublish",
|
|
88
|
+
"content:afterMove",
|
|
89
|
+
"media:afterUpload",
|
|
90
|
+
"media:afterTrash",
|
|
91
|
+
"media:afterDelete",
|
|
92
|
+
"user:afterLogin",
|
|
93
|
+
"user:afterCreate",
|
|
94
|
+
"user:afterDelete",
|
|
95
|
+
"settings:afterChange",
|
|
96
|
+
"plugin:afterInstall",
|
|
97
|
+
"plugin:afterUninstall",
|
|
98
|
+
"plugin:afterUpdate",
|
|
99
|
+
"plugin:afterActivate",
|
|
100
|
+
"plugin:afterDeactivate",
|
|
101
|
+
"audit:afterRecord",
|
|
55
102
|
];
|
|
@@ -22,8 +22,9 @@ export type PanelProposeRefusal = (typeof PANEL_PROPOSE_REFUSALS)[number];
|
|
|
22
22
|
export declare const TREE_ACTION_MESSAGE_MAX = 200;
|
|
23
23
|
/** M32 F3 (D14): the settings areas a settings write route reports its change under. M32 F4d (D6):
|
|
24
24
|
* `plugin` is one plugin's own settings, reported with its `pluginId`. M32 H: `mail` is Server
|
|
25
|
-
* settings, Mail (the SMTP settings, and a plugin's form reply switch with its `pluginId`).
|
|
26
|
-
|
|
25
|
+
* settings, Mail (the SMTP settings, and a plugin's form reply switch with its `pluginId`).
|
|
26
|
+
* M35 U2a: visitorAccounts is one site's visitor account settings and the visitor switches of the sign-in providers. */
|
|
27
|
+
export declare const SETTINGS_CHANGE_AREAS: readonly ["render", "cultures", "nav", "aiContext", "sites", "server", "auditRetention", "notificationRetention", "siteReach", "signIn", "plugin", "mail", "visitorAccounts"];
|
|
27
28
|
/** M32 F3 (D14): one settings area. */
|
|
28
29
|
export type SettingsChangeArea = (typeof SETTINGS_CHANGE_AREAS)[number];
|
|
29
30
|
/** M32 F3 (D1): an issue found in a plugin's editor panels or tree actions. */
|
|
@@ -33,6 +34,8 @@ export interface EditorExtensionIssue {
|
|
|
33
34
|
}
|
|
34
35
|
/** M32 F3 (D1): true for 1 to 40 lower-case letters, digits and "-", starting with a letter. */
|
|
35
36
|
export declare function isEditorSlotId(value: string): boolean;
|
|
37
|
+
/** The one rule for every slot's `documentTypes` (editor slots, and M35 C2's content slots). */
|
|
38
|
+
export declare function editorSlotDocumentTypesIssue(value: unknown): string | null;
|
|
36
39
|
/** M32 F3 (D1, D7): the shape rules for a manifest's editorPanels and treeActions beyond label, action and view. */
|
|
37
40
|
export declare function checkEditorExtensionDeclarations(manifest: {
|
|
38
41
|
id?: unknown;
|
|
@@ -28,10 +28,11 @@ export const PANEL_PROPOSE_REFUSALS = ["unknownField", "notAllowed", "invalid",
|
|
|
28
28
|
export const TREE_ACTION_MESSAGE_MAX = 200;
|
|
29
29
|
/** M32 F3 (D14): the settings areas a settings write route reports its change under. M32 F4d (D6):
|
|
30
30
|
* `plugin` is one plugin's own settings, reported with its `pluginId`. M32 H: `mail` is Server
|
|
31
|
-
* settings, Mail (the SMTP settings, and a plugin's form reply switch with its `pluginId`).
|
|
31
|
+
* settings, Mail (the SMTP settings, and a plugin's form reply switch with its `pluginId`).
|
|
32
|
+
* M35 U2a: visitorAccounts is one site's visitor account settings and the visitor switches of the sign-in providers. */
|
|
32
33
|
export const SETTINGS_CHANGE_AREAS = [
|
|
33
34
|
"render", "cultures", "nav", "aiContext", "sites", "server",
|
|
34
|
-
"auditRetention", "notificationRetention", "siteReach", "signIn", "plugin", "mail",
|
|
35
|
+
"auditRetention", "notificationRetention", "siteReach", "signIn", "plugin", "mail", "visitorAccounts",
|
|
35
36
|
];
|
|
36
37
|
/** M32 F3 (D1): true for 1 to 40 lower-case letters, digits and "-", starting with a letter. */
|
|
37
38
|
export function isEditorSlotId(value) {
|
|
@@ -55,7 +56,8 @@ const KEYS = [
|
|
|
55
56
|
{ key: "editorPanels", max: EDITOR_PANELS_MAX, noun: "editor panel" },
|
|
56
57
|
{ key: "treeActions", max: TREE_ACTIONS_MAX, noun: "tree action" },
|
|
57
58
|
];
|
|
58
|
-
|
|
59
|
+
/** The one rule for every slot's `documentTypes` (editor slots, and M35 C2's content slots). */
|
|
60
|
+
export function editorSlotDocumentTypesIssue(value) {
|
|
59
61
|
if (!Array.isArray(value))
|
|
60
62
|
return "documentTypes must be a list of document type names";
|
|
61
63
|
if (value.length < 1 || value.length > EDITOR_SLOT_TYPES_MAX) {
|
|
@@ -114,7 +116,7 @@ export function checkEditorExtensionDeclarations(manifest) {
|
|
|
114
116
|
seen.add(entryId);
|
|
115
117
|
}
|
|
116
118
|
if ("documentTypes" in item && item.documentTypes !== undefined) {
|
|
117
|
-
const problem =
|
|
119
|
+
const problem = editorSlotDocumentTypesIssue(item.documentTypes);
|
|
118
120
|
if (problem)
|
|
119
121
|
issues.push({ path: [...keyPath, index, "documentTypes"], message: problem });
|
|
120
122
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** The most field ids a documentType:afterChange event names. */
|
|
2
|
+
export declare const DOCUMENT_TYPE_EVENT_FIELDS_MAX = 100;
|
|
3
|
+
/** The most action names each of role:afterChange's two lists carries. */
|
|
4
|
+
export declare const ROLE_EVENT_ACTIONS_MAX = 200;
|
|
5
|
+
/** The most system:afterError events one instance raises a minute; the rest are counted into the next one's `suppressed`. */
|
|
6
|
+
export declare const SYSTEM_ERROR_EVENTS_PER_MINUTE = 30;
|
|
7
|
+
/** The longest error class name passed on; a longer or stranger name is passed as "Error". */
|
|
8
|
+
export declare const SYSTEM_ERROR_CLASS_MAX = 64;
|
|
9
|
+
/** The longest route pattern passed on in system:afterError; a longer one is cut. */
|
|
10
|
+
export declare const SYSTEM_ERROR_ROUTE_MAX = 200;
|
|
11
|
+
/** How long page views wait in memory before one site:afterPageViews event carries them. */
|
|
12
|
+
export declare const PAGE_VIEW_BATCH_MS = 10000;
|
|
13
|
+
/** The most page and language pairs one site:afterPageViews event itemises; views past it add to `otherViews`. */
|
|
14
|
+
export declare const PAGE_VIEW_BATCH_PAGES_MAX = 500;
|
|
15
|
+
/** The most characters of a user agent the core reads to tell a likely bot; the agent itself is never passed on. */
|
|
16
|
+
export declare const USER_AGENT_SCAN_MAX = 512;
|
|
17
|
+
/** The most languages an address list in an event carries (previousAddresses, addresses). */
|
|
18
|
+
export declare const EVENT_ADDRESSES_MAX = 64;
|
|
19
|
+
/** Lower-case words whose presence in a user agent marks a likely bot. Matched with `includes`. */
|
|
20
|
+
export declare const LIKELY_BOT_MARKERS: readonly ["bot", "crawl", "spider", "slurp", "curl", "wget", "python", "httpclient", "headless", "preview", "facebookexternalhit"];
|
|
21
|
+
/** An error's class name when it is 1 to SYSTEM_ERROR_CLASS_MAX letters, digits or `_`; otherwise "Error". Never the message. */
|
|
22
|
+
export declare function errorClassOf(value: unknown): string;
|
|
23
|
+
/** Whether a request's user agent reads as a bot, a script or nothing at all. Reads at most USER_AGENT_SCAN_MAX characters. */
|
|
24
|
+
export declare function isLikelyBotAgent(userAgent: unknown): boolean;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// M35 B2 (W30, W31, W4): the limits of the events the core raises beyond the content ones, and the
|
|
2
|
+
// two readers the server uses to build their payloads. Every reader here is a linear scan over a
|
|
3
|
+
// bounded length; none uses a regular expression, because the values come from outside (an error a
|
|
4
|
+
// plugin threw, a visitor's user agent).
|
|
5
|
+
/** The most field ids a documentType:afterChange event names. */
|
|
6
|
+
export const DOCUMENT_TYPE_EVENT_FIELDS_MAX = 100;
|
|
7
|
+
/** The most action names each of role:afterChange's two lists carries. */
|
|
8
|
+
export const ROLE_EVENT_ACTIONS_MAX = 200;
|
|
9
|
+
/** The most system:afterError events one instance raises a minute; the rest are counted into the next one's `suppressed`. */
|
|
10
|
+
export const SYSTEM_ERROR_EVENTS_PER_MINUTE = 30;
|
|
11
|
+
/** The longest error class name passed on; a longer or stranger name is passed as "Error". */
|
|
12
|
+
export const SYSTEM_ERROR_CLASS_MAX = 64;
|
|
13
|
+
/** The longest route pattern passed on in system:afterError; a longer one is cut. */
|
|
14
|
+
export const SYSTEM_ERROR_ROUTE_MAX = 200;
|
|
15
|
+
/** How long page views wait in memory before one site:afterPageViews event carries them. */
|
|
16
|
+
export const PAGE_VIEW_BATCH_MS = 10_000;
|
|
17
|
+
/** The most page and language pairs one site:afterPageViews event itemises; views past it add to `otherViews`. */
|
|
18
|
+
export const PAGE_VIEW_BATCH_PAGES_MAX = 500;
|
|
19
|
+
/** The most characters of a user agent the core reads to tell a likely bot; the agent itself is never passed on. */
|
|
20
|
+
export const USER_AGENT_SCAN_MAX = 512;
|
|
21
|
+
/** The most languages an address list in an event carries (previousAddresses, addresses). */
|
|
22
|
+
export const EVENT_ADDRESSES_MAX = 64;
|
|
23
|
+
/** Lower-case words whose presence in a user agent marks a likely bot. Matched with `includes`. */
|
|
24
|
+
export const LIKELY_BOT_MARKERS = ["bot", "crawl", "spider", "slurp", "curl", "wget", "python", "httpclient", "headless", "preview", "facebookexternalhit"];
|
|
25
|
+
function isClassChar(code) {
|
|
26
|
+
return (code >= 65 && code <= 90) || (code >= 97 && code <= 122) || (code >= 48 && code <= 57) || code === 95;
|
|
27
|
+
}
|
|
28
|
+
/** An error's class name when it is 1 to SYSTEM_ERROR_CLASS_MAX letters, digits or `_`; otherwise "Error". Never the message. */
|
|
29
|
+
export function errorClassOf(value) {
|
|
30
|
+
let name;
|
|
31
|
+
try {
|
|
32
|
+
name = value !== null && typeof value === "object" ? value.name : undefined;
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
return "Error";
|
|
36
|
+
}
|
|
37
|
+
if (typeof name !== "string" || name.length < 1 || name.length > SYSTEM_ERROR_CLASS_MAX)
|
|
38
|
+
return "Error";
|
|
39
|
+
for (let index = 0; index < name.length; index += 1)
|
|
40
|
+
if (!isClassChar(name.charCodeAt(index)))
|
|
41
|
+
return "Error";
|
|
42
|
+
return name;
|
|
43
|
+
}
|
|
44
|
+
/** Whether a request's user agent reads as a bot, a script or nothing at all. Reads at most USER_AGENT_SCAN_MAX characters. */
|
|
45
|
+
export function isLikelyBotAgent(userAgent) {
|
|
46
|
+
if (typeof userAgent !== "string" || userAgent.length === 0)
|
|
47
|
+
return true;
|
|
48
|
+
const scanned = userAgent.slice(0, USER_AGENT_SCAN_MAX).toLowerCase();
|
|
49
|
+
for (const marker of LIKELY_BOT_MARKERS)
|
|
50
|
+
if (scanned.includes(marker))
|
|
51
|
+
return true;
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { AuditActorKind } from "./audit-api.schema.js";
|
|
3
|
+
export declare const GUARD_POINTS: readonly ["content:beforeSave", "content:beforePublish", "content:beforeUnpublish", "content:beforeMove", "content:beforeTrash", "content:beforeRestore"];
|
|
4
|
+
export type GuardPoint = (typeof GUARD_POINTS)[number];
|
|
5
|
+
export declare const GUARD_OPERATIONS: readonly ["create", "save", "copy", "publish", "publishAll", "unpublish", "move", "trash", "restore"];
|
|
6
|
+
export type GuardOperation = (typeof GUARD_OPERATIONS)[number];
|
|
7
|
+
/** What a timeout, a throw or an answer out of shape means for the write. */
|
|
8
|
+
export declare const GUARD_FAILURE_MODES: readonly ["refuse", "allow"];
|
|
9
|
+
export type GuardFailureMode = (typeof GUARD_FAILURE_MODES)[number];
|
|
10
|
+
/** How long a write waits for its guards, all asked at once; at the limit each guard's signal is aborted. */
|
|
11
|
+
export declare const GUARD_TIME_MS = 2000;
|
|
12
|
+
export declare const GUARD_REFUSAL_CODE_MAX = 64;
|
|
13
|
+
export declare const GUARD_REFUSAL_MESSAGE_MAX = 300;
|
|
14
|
+
export declare const GUARD_MESSAGE_LANGUAGES_MAX = 20;
|
|
15
|
+
export declare const GUARD_DOCUMENT_TYPES_MAX = 20;
|
|
16
|
+
/** The refusal code the core writes when a guard failed and its declaration says refuse. */
|
|
17
|
+
export declare const GUARD_UNAVAILABLE_CODE = "guard_unavailable";
|
|
18
|
+
/** The error body's code for every guard refusal. */
|
|
19
|
+
export declare const PLUGIN_REFUSED_CODE = "plugin_refused";
|
|
20
|
+
/** A lower-case letter, then lower-case letters, digits and `_`, 1 to GUARD_REFUSAL_CODE_MAX. A scan, no pattern. */
|
|
21
|
+
export declare function isGuardRefusalCode(value: unknown): value is string;
|
|
22
|
+
/** Plain text, or a map of language code to text with English required. */
|
|
23
|
+
export declare const GuardMessageSchema: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>;
|
|
24
|
+
export declare const PluginGuardAnswerSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
25
|
+
allow: z.ZodLiteral<true>;
|
|
26
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
27
|
+
allow: z.ZodLiteral<false>;
|
|
28
|
+
code: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
29
|
+
message: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>;
|
|
30
|
+
}, z.core.$strict>]>;
|
|
31
|
+
export declare const PluginGuardDeclarationSchema: z.ZodObject<{
|
|
32
|
+
point: z.ZodEnum<{
|
|
33
|
+
"content:beforeSave": "content:beforeSave";
|
|
34
|
+
"content:beforePublish": "content:beforePublish";
|
|
35
|
+
"content:beforeUnpublish": "content:beforeUnpublish";
|
|
36
|
+
"content:beforeMove": "content:beforeMove";
|
|
37
|
+
"content:beforeTrash": "content:beforeTrash";
|
|
38
|
+
"content:beforeRestore": "content:beforeRestore";
|
|
39
|
+
}>;
|
|
40
|
+
documentTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
41
|
+
onFailure: z.ZodOptional<z.ZodEnum<{
|
|
42
|
+
allow: "allow";
|
|
43
|
+
refuse: "refuse";
|
|
44
|
+
}>>;
|
|
45
|
+
}, z.core.$strict>;
|
|
46
|
+
export declare const PluginGuardDeclarationsSchema: z.ZodArray<z.ZodObject<{
|
|
47
|
+
point: z.ZodEnum<{
|
|
48
|
+
"content:beforeSave": "content:beforeSave";
|
|
49
|
+
"content:beforePublish": "content:beforePublish";
|
|
50
|
+
"content:beforeUnpublish": "content:beforeUnpublish";
|
|
51
|
+
"content:beforeMove": "content:beforeMove";
|
|
52
|
+
"content:beforeTrash": "content:beforeTrash";
|
|
53
|
+
"content:beforeRestore": "content:beforeRestore";
|
|
54
|
+
}>;
|
|
55
|
+
documentTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
56
|
+
onFailure: z.ZodOptional<z.ZodEnum<{
|
|
57
|
+
allow: "allow";
|
|
58
|
+
refuse: "refuse";
|
|
59
|
+
}>>;
|
|
60
|
+
}, z.core.$strict>>;
|
|
61
|
+
/** The rule over a manifest (live or manifest.json), as `path: message` issues. A live entry's
|
|
62
|
+
* `handler` is left out before the shape is read; that it is a function is the SDK schema's rule. */
|
|
63
|
+
export declare function checkGuardDeclarations(manifest: {
|
|
64
|
+
contributions?: unknown;
|
|
65
|
+
}): Array<{
|
|
66
|
+
path: (string | number)[];
|
|
67
|
+
message: string;
|
|
68
|
+
}>;
|
|
69
|
+
/** Who made the write a guard is asked about: the audit's actor kind, the user, key or plugin id, and a session's role. */
|
|
70
|
+
export interface GuardSubject {
|
|
71
|
+
kind: AuditActorKind;
|
|
72
|
+
id: string | null;
|
|
73
|
+
role: string | null;
|
|
74
|
+
}
|
|
75
|
+
export declare const PluginRefusalSchema: z.ZodObject<{
|
|
76
|
+
pluginId: z.ZodString;
|
|
77
|
+
pluginName: z.ZodString;
|
|
78
|
+
point: z.ZodEnum<{
|
|
79
|
+
"content:beforeSave": "content:beforeSave";
|
|
80
|
+
"content:beforePublish": "content:beforePublish";
|
|
81
|
+
"content:beforeUnpublish": "content:beforeUnpublish";
|
|
82
|
+
"content:beforeMove": "content:beforeMove";
|
|
83
|
+
"content:beforeTrash": "content:beforeTrash";
|
|
84
|
+
"content:beforeRestore": "content:beforeRestore";
|
|
85
|
+
}>;
|
|
86
|
+
code: z.ZodString;
|
|
87
|
+
message: z.ZodString;
|
|
88
|
+
messages: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
89
|
+
failed: z.ZodBoolean;
|
|
90
|
+
}, z.core.$strip>;
|
|
91
|
+
export type PluginRefusal = z.infer<typeof PluginRefusalSchema>;
|
|
92
|
+
/** The 409 a refused write answers. */
|
|
93
|
+
export declare const PluginRefusalBodySchema: z.ZodObject<{
|
|
94
|
+
message: z.ZodString;
|
|
95
|
+
code: z.ZodLiteral<"plugin_refused">;
|
|
96
|
+
refusal: z.ZodObject<{
|
|
97
|
+
pluginId: z.ZodString;
|
|
98
|
+
pluginName: z.ZodString;
|
|
99
|
+
point: z.ZodEnum<{
|
|
100
|
+
"content:beforeSave": "content:beforeSave";
|
|
101
|
+
"content:beforePublish": "content:beforePublish";
|
|
102
|
+
"content:beforeUnpublish": "content:beforeUnpublish";
|
|
103
|
+
"content:beforeMove": "content:beforeMove";
|
|
104
|
+
"content:beforeTrash": "content:beforeTrash";
|
|
105
|
+
"content:beforeRestore": "content:beforeRestore";
|
|
106
|
+
}>;
|
|
107
|
+
code: z.ZodString;
|
|
108
|
+
message: z.ZodString;
|
|
109
|
+
messages: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
110
|
+
failed: z.ZodBoolean;
|
|
111
|
+
}, z.core.$strip>;
|
|
112
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// M35 B2 (W1, experimental): guards, the before-points that may refuse a content write. A plugin
|
|
3
|
+
// declares at most one guard per point in `contributions.guards`; the server asks every listening
|
|
4
|
+
// guard at once, waits at most GUARD_TIME_MS, and answers the first refusal in plugin id order with
|
|
5
|
+
// 409 { message, code: "plugin_refused", refusal }. A guard never changes what is saved: its answer
|
|
6
|
+
// has no field that could carry content. The SDK's manifest schema, the `content access` delivery
|
|
7
|
+
// check and the server read this one file.
|
|
8
|
+
export const GUARD_POINTS = [
|
|
9
|
+
"content:beforeSave",
|
|
10
|
+
"content:beforePublish",
|
|
11
|
+
"content:beforeUnpublish",
|
|
12
|
+
"content:beforeMove",
|
|
13
|
+
"content:beforeTrash",
|
|
14
|
+
"content:beforeRestore",
|
|
15
|
+
];
|
|
16
|
+
export const GUARD_OPERATIONS = ["create", "save", "copy", "publish", "publishAll", "unpublish", "move", "trash", "restore"];
|
|
17
|
+
/** What a timeout, a throw or an answer out of shape means for the write. */
|
|
18
|
+
export const GUARD_FAILURE_MODES = ["refuse", "allow"];
|
|
19
|
+
/** How long a write waits for its guards, all asked at once; at the limit each guard's signal is aborted. */
|
|
20
|
+
export const GUARD_TIME_MS = 2_000;
|
|
21
|
+
export const GUARD_REFUSAL_CODE_MAX = 64;
|
|
22
|
+
export const GUARD_REFUSAL_MESSAGE_MAX = 300;
|
|
23
|
+
export const GUARD_MESSAGE_LANGUAGES_MAX = 20;
|
|
24
|
+
export const GUARD_DOCUMENT_TYPES_MAX = 20;
|
|
25
|
+
const GUARD_DOCUMENT_TYPE_NAME_MAX = 200;
|
|
26
|
+
const LANGUAGE_CODE_MAX = 35;
|
|
27
|
+
/** The refusal code the core writes when a guard failed and its declaration says refuse. */
|
|
28
|
+
export const GUARD_UNAVAILABLE_CODE = "guard_unavailable";
|
|
29
|
+
/** The error body's code for every guard refusal. */
|
|
30
|
+
export const PLUGIN_REFUSED_CODE = "plugin_refused";
|
|
31
|
+
/** A lower-case letter, then lower-case letters, digits and `_`, 1 to GUARD_REFUSAL_CODE_MAX. A scan, no pattern. */
|
|
32
|
+
export function isGuardRefusalCode(value) {
|
|
33
|
+
if (typeof value !== "string" || value.length < 1 || value.length > GUARD_REFUSAL_CODE_MAX)
|
|
34
|
+
return false;
|
|
35
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
36
|
+
const code = value.charCodeAt(index);
|
|
37
|
+
const lower = code >= 97 && code <= 122;
|
|
38
|
+
if (index === 0 ? !lower : !lower && !(code >= 48 && code <= 57) && code !== 95)
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
const messageText = z.string().min(1).max(GUARD_REFUSAL_MESSAGE_MAX);
|
|
44
|
+
/** Plain text, or a map of language code to text with English required. */
|
|
45
|
+
export const GuardMessageSchema = z.union([
|
|
46
|
+
messageText,
|
|
47
|
+
z
|
|
48
|
+
.record(z.string().min(2).max(LANGUAGE_CODE_MAX), messageText)
|
|
49
|
+
.refine((map) => typeof map.en === "string", { message: "a message map has English (en)" })
|
|
50
|
+
.refine((map) => Object.keys(map).length <= GUARD_MESSAGE_LANGUAGES_MAX, { message: `at most ${GUARD_MESSAGE_LANGUAGES_MAX} languages` }),
|
|
51
|
+
]);
|
|
52
|
+
export const PluginGuardAnswerSchema = z.union([
|
|
53
|
+
z.object({ allow: z.literal(true) }).strict(),
|
|
54
|
+
z
|
|
55
|
+
.object({
|
|
56
|
+
allow: z.literal(false),
|
|
57
|
+
code: z.string().refine(isGuardRefusalCode, { message: `a code is snake_case, 1 to ${GUARD_REFUSAL_CODE_MAX} characters, starting with a letter` }),
|
|
58
|
+
message: GuardMessageSchema,
|
|
59
|
+
})
|
|
60
|
+
.strict(),
|
|
61
|
+
]);
|
|
62
|
+
export const PluginGuardDeclarationSchema = z
|
|
63
|
+
.object({
|
|
64
|
+
point: z.enum(GUARD_POINTS),
|
|
65
|
+
documentTypes: z
|
|
66
|
+
.array(z.string().min(1).max(GUARD_DOCUMENT_TYPE_NAME_MAX))
|
|
67
|
+
.min(1)
|
|
68
|
+
.max(GUARD_DOCUMENT_TYPES_MAX)
|
|
69
|
+
.refine((names) => new Set(names).size === names.length, { message: "names each document type once" })
|
|
70
|
+
.optional(),
|
|
71
|
+
onFailure: z.enum(GUARD_FAILURE_MODES).optional(),
|
|
72
|
+
})
|
|
73
|
+
.strict();
|
|
74
|
+
export const PluginGuardDeclarationsSchema = z
|
|
75
|
+
.array(PluginGuardDeclarationSchema)
|
|
76
|
+
.min(1, { error: "declares at least one guard (leave guards out when the plugin guards nothing)" })
|
|
77
|
+
.max(GUARD_POINTS.length)
|
|
78
|
+
.refine((entries) => new Set(entries.map((entry) => entry.point)).size === entries.length, { message: "declares each point once" });
|
|
79
|
+
/** The rule over a manifest (live or manifest.json), as `path: message` issues. A live entry's
|
|
80
|
+
* `handler` is left out before the shape is read; that it is a function is the SDK schema's rule. */
|
|
81
|
+
export function checkGuardDeclarations(manifest) {
|
|
82
|
+
const contributions = manifest.contributions;
|
|
83
|
+
if (contributions === null || typeof contributions !== "object")
|
|
84
|
+
return [];
|
|
85
|
+
const value = contributions.guards;
|
|
86
|
+
if (value === undefined)
|
|
87
|
+
return [];
|
|
88
|
+
const declared = Array.isArray(value)
|
|
89
|
+
? value.map((entry) => {
|
|
90
|
+
if (entry === null || typeof entry !== "object" || Array.isArray(entry))
|
|
91
|
+
return entry;
|
|
92
|
+
const { handler: _handler, ...rest } = entry;
|
|
93
|
+
return rest;
|
|
94
|
+
})
|
|
95
|
+
: value;
|
|
96
|
+
const parsed = PluginGuardDeclarationsSchema.safeParse(declared);
|
|
97
|
+
if (parsed.success)
|
|
98
|
+
return [];
|
|
99
|
+
return parsed.error.issues.map((issue) => ({ path: ["contributions", "guards", ...issue.path.map((p) => (typeof p === "symbol" ? String(p) : p))], message: issue.message }));
|
|
100
|
+
}
|
|
101
|
+
export const PluginRefusalSchema = z.object({
|
|
102
|
+
pluginId: z.string(),
|
|
103
|
+
pluginName: z.string(),
|
|
104
|
+
point: z.enum(GUARD_POINTS),
|
|
105
|
+
code: z.string(),
|
|
106
|
+
/** English, or the plugin's plain text. */
|
|
107
|
+
message: z.string(),
|
|
108
|
+
/** The plugin's message map, when it gave one. */
|
|
109
|
+
messages: z.record(z.string(), z.string()).optional(),
|
|
110
|
+
/** True when the guard did not answer (timeout, throw, answer out of shape) and its declaration says refuse. */
|
|
111
|
+
failed: z.boolean(),
|
|
112
|
+
});
|
|
113
|
+
/** The 409 a refused write answers. */
|
|
114
|
+
export const PluginRefusalBodySchema = z.object({
|
|
115
|
+
message: z.string(),
|
|
116
|
+
code: z.literal(PLUGIN_REFUSED_CODE),
|
|
117
|
+
refusal: PluginRefusalSchema,
|
|
118
|
+
});
|
|
@@ -62,6 +62,12 @@ export declare const PluginHeldEmbedSchema: z.ZodObject<{
|
|
|
62
62
|
"picture-in-picture": "picture-in-picture";
|
|
63
63
|
"encrypted-media": "encrypted-media";
|
|
64
64
|
}>>>;
|
|
65
|
+
consent: z.ZodOptional<z.ZodEnum<{
|
|
66
|
+
media: "media";
|
|
67
|
+
preferences: "preferences";
|
|
68
|
+
statistics: "statistics";
|
|
69
|
+
marketing: "marketing";
|
|
70
|
+
}>>;
|
|
65
71
|
}, z.core.$strict>;
|
|
66
72
|
export type PluginHeldEmbed = z.infer<typeof PluginHeldEmbedSchema>;
|
|
67
73
|
/** `contributions.heldEmbeds`: 1 to HELD_EMBEDS_DECLARED_MAX entries, each id once. */
|
|
@@ -82,6 +88,12 @@ export declare const PluginHeldEmbedsSchema: z.ZodArray<z.ZodObject<{
|
|
|
82
88
|
"picture-in-picture": "picture-in-picture";
|
|
83
89
|
"encrypted-media": "encrypted-media";
|
|
84
90
|
}>>>;
|
|
91
|
+
consent: z.ZodOptional<z.ZodEnum<{
|
|
92
|
+
media: "media";
|
|
93
|
+
preferences: "preferences";
|
|
94
|
+
statistics: "statistics";
|
|
95
|
+
marketing: "marketing";
|
|
96
|
+
}>>;
|
|
85
97
|
}, z.core.$strict>>;
|
|
86
98
|
/** What a template tag answers to show held content: one of its plugin's declared ids, the frame's address and title, and its shape. */
|
|
87
99
|
export interface HeldEmbedRequest {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { CAPABILITY_NOTE_VALUE_MAX } from "./capability-detail.js";
|
|
3
3
|
import { labelMapSchema } from "./plugin-labels.js";
|
|
4
|
+
import { CONSENT_CATEGORIES } from "./site-consent.js";
|
|
4
5
|
import { PageHeadScriptOriginSchema } from "./plugin-https-origin.js";
|
|
5
6
|
import { hasNoControlCharacter } from "./strict-url.js";
|
|
6
7
|
// M33 K42 (Google Maps 2.10 C1): held content from other sites. A plugin declares under
|
|
@@ -136,6 +137,8 @@ export const PluginHeldEmbedSchema = z
|
|
|
136
137
|
}),
|
|
137
138
|
kind: z.enum(HELD_EMBED_KINDS),
|
|
138
139
|
allow: allowList.optional(),
|
|
140
|
+
/** M35 P5 (P5-D7): shown on every page once the visitor grants this category in the chosen consent tool. */
|
|
141
|
+
consent: z.enum(CONSENT_CATEGORIES).optional(),
|
|
139
142
|
})
|
|
140
143
|
.strict()
|
|
141
144
|
.superRefine((entry, ctx) => {
|
|
@@ -4,6 +4,7 @@ export declare const PluginInstallCreatedSchema: z.ZodObject<{
|
|
|
4
4
|
sampleContentNodeIds: z.ZodArray<z.ZodString>;
|
|
5
5
|
mediaIds: z.ZodArray<z.ZodString>;
|
|
6
6
|
roleIds: z.ZodArray<z.ZodString>;
|
|
7
|
+
sampleContentVersions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
7
8
|
}, z.core.$strict>;
|
|
8
9
|
export declare const PluginInstallRecordSchema: z.ZodObject<{
|
|
9
10
|
answers: z.ZodObject<{
|
|
@@ -17,6 +18,7 @@ export declare const PluginInstallRecordSchema: z.ZodObject<{
|
|
|
17
18
|
sampleContentNodeIds: z.ZodArray<z.ZodString>;
|
|
18
19
|
mediaIds: z.ZodArray<z.ZodString>;
|
|
19
20
|
roleIds: z.ZodArray<z.ZodString>;
|
|
21
|
+
sampleContentVersions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
20
22
|
}, z.core.$strict>;
|
|
21
23
|
offersApplied: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
22
24
|
}, z.core.$strict>;
|
|
@@ -16,6 +16,9 @@ export const PluginInstallCreatedSchema = z
|
|
|
16
16
|
mediaIds: z.array(z.string().min(1)),
|
|
17
17
|
/** The offered roles this install created. */
|
|
18
18
|
roleIds: z.array(RoleIdSchema),
|
|
19
|
+
/** M35: each sample page's latest version number when seeding finished, so an uninstall can
|
|
20
|
+
* tell a page the site owner edited (a newer version) from one left as seeded. */
|
|
21
|
+
sampleContentVersions: z.record(z.string().min(1), z.number().int().positive()).optional(),
|
|
19
22
|
})
|
|
20
23
|
.strict();
|
|
21
24
|
export const PluginInstallRecordSchema = z
|