@kardalum/plugin-sdk 0.19.0 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +281 -0
- package/README.md +19 -0
- package/dist/admin-section-registry.d.ts +48 -1
- package/dist/admin-section-registry.js +90 -0
- package/dist/built-in-editor-ids.d.ts +1 -1
- package/dist/built-in-editor-ids.js +2 -20
- package/dist/built-in-settings-schemas.d.ts +10 -0
- package/dist/built-in-settings-schemas.js +86 -0
- package/dist/built-in-value-schemas.js +35 -0
- package/dist/built-ins.js +38 -7
- package/dist/capabilities.d.ts +11 -1
- package/dist/capabilities.js +101 -4
- package/dist/cli.d.ts +66 -0
- package/dist/cli.js +22 -0
- package/dist/consent-entry.d.ts +11 -0
- package/dist/consent-entry.js +18 -0
- package/dist/content-library.d.ts +102 -0
- package/dist/content-library.js +15 -0
- package/dist/content-list-extensions.d.ts +50 -0
- package/dist/content-list-extensions.js +11 -0
- package/dist/content-picker/page-picker-sheet.d.ts +15 -0
- package/dist/content-picker/page-picker-sheet.js +105 -0
- package/dist/content-picker/page-picker.d.ts +18 -0
- package/dist/content-picker/page-picker.js +20 -0
- package/dist/content-picker/page-tree.d.ts +25 -0
- package/dist/content-picker/page-tree.js +132 -0
- package/dist/data-type-plugin.d.ts +7 -1
- package/dist/datatype-validation.d.ts +4 -9
- package/dist/datatype-validation.js +147 -1
- package/dist/datatypes-entry.d.ts +1 -0
- package/dist/datatypes-entry.js +2 -0
- package/dist/entitlement-entry.d.ts +1 -1
- package/dist/entitlement-entry.js +1 -1
- package/dist/entitlement-gate.d.ts +14 -0
- package/dist/entitlement-gate.js +64 -7
- package/dist/entitlement-plan.d.ts +6 -0
- package/dist/entitlement-plan.js +10 -0
- package/dist/entitlement-types.d.ts +53 -12
- package/dist/entitlement.d.ts +31 -4
- package/dist/entitlement.js +58 -17
- package/dist/hook-entry.d.ts +5 -0
- package/dist/hook-entry.js +30 -0
- package/dist/host-entry.d.ts +7 -1
- package/dist/host-entry.js +14 -1
- package/dist/index.d.ts +67 -7
- package/dist/index.js +94 -6
- package/dist/mail.d.ts +34 -0
- package/dist/mail.js +1 -0
- package/dist/manifest-entry.d.ts +47 -4
- package/dist/manifest-entry.js +63 -2
- package/dist/manifest-schema.d.ts +993 -40
- package/dist/manifest-schema.js +516 -26
- package/dist/manifest.d.ts +1186 -62
- package/dist/manifest.js +8 -4
- package/dist/media/media-picker.js +31 -18
- package/dist/media/upload-error.d.ts +5 -1
- package/dist/media/upload-error.js +14 -2
- package/dist/media-library.d.ts +32 -0
- package/dist/media-library.js +15 -0
- package/dist/nested-field-host.d.ts +76 -0
- package/dist/nested-field-host.js +90 -0
- package/dist/notify.d.ts +12 -4
- package/dist/notify.js +1 -1
- package/dist/outbound.d.ts +47 -0
- package/dist/outbound.js +1 -0
- package/dist/plugin-context.d.ts +52 -0
- package/dist/plugin-context.js +27 -0
- package/dist/plugin-permissions.d.ts +18 -0
- package/dist/plugin-permissions.js +25 -0
- package/dist/plugin-screen-context.d.ts +262 -9
- package/dist/plugin-screen-context.js +56 -0
- package/dist/providers.d.ts +313 -0
- package/dist/providers.js +74 -0
- package/dist/read-all-pages.d.ts +5 -0
- package/dist/read-all-pages.js +3 -2
- package/dist/render-page.d.ts +15 -0
- package/dist/render-page.js +20 -0
- package/dist/richtext/block-panel.d.ts +12 -1
- package/dist/richtext/block-panel.js +36 -25
- package/dist/richtext/button-view.d.ts +11 -0
- package/dist/richtext/button-view.js +45 -0
- package/dist/richtext/content-guard.d.ts +4 -0
- package/dist/richtext/content-guard.js +27 -0
- package/dist/richtext/editor-handle.d.ts +34 -0
- package/dist/richtext/editor-handle.js +225 -0
- package/dist/richtext/extensions.d.ts +6 -0
- package/dist/richtext/extensions.js +16 -0
- package/dist/richtext/insert-menu.d.ts +6 -1
- package/dist/richtext/insert-menu.js +45 -22
- package/dist/richtext/item-attributes.d.ts +6 -0
- package/dist/richtext/item-attributes.js +19 -0
- package/dist/richtext/item-panel.d.ts +25 -0
- package/dist/richtext/item-panel.js +118 -0
- package/dist/richtext/item-view.d.ts +58 -0
- package/dist/richtext/item-view.js +172 -0
- package/dist/richtext/mark-form.d.ts +10 -0
- package/dist/richtext/mark-form.js +38 -0
- package/dist/richtext/paste-choice.d.ts +9 -0
- package/dist/richtext/paste-choice.js +13 -0
- package/dist/richtext/plugin-items.d.ts +72 -0
- package/dist/richtext/plugin-items.js +562 -0
- package/dist/richtext/plugin-mark-tooltips.d.ts +5 -0
- package/dist/richtext/plugin-mark-tooltips.js +44 -0
- package/dist/richtext/plugin-toolbar.d.ts +57 -0
- package/dist/richtext/plugin-toolbar.js +186 -0
- package/dist/richtext/rich-item-icons.d.ts +5 -0
- package/dist/richtext/rich-item-icons.js +42 -0
- package/dist/richtext/rich-items.d.ts +42 -0
- package/dist/richtext/rich-items.js +68 -0
- package/dist/richtext/rich-text-view-host.d.ts +24 -0
- package/dist/richtext/rich-text-view-host.js +11 -0
- package/dist/richtext/style-listbox.js +6 -4
- package/dist/richtext/toolbar-button.d.ts +16 -0
- package/dist/richtext/toolbar-button.js +9 -0
- package/dist/richtext/url-paste.d.ts +20 -0
- package/dist/richtext/url-paste.js +82 -0
- package/dist/richtext-html-entry.d.ts +5 -0
- package/dist/richtext-html-entry.js +11 -0
- package/dist/sdk-strings.d.ts +344 -0
- package/dist/sdk-strings.js +411 -0
- package/dist/sealing.d.ts +14 -0
- package/dist/sealing.js +1 -0
- package/dist/service-contract.d.ts +17 -0
- package/dist/service-contract.js +39 -0
- package/dist/services.d.ts +114 -0
- package/dist/services.js +1 -0
- package/dist/simple-storage-value-provider.js +24 -24
- package/dist/structured-storage-types.d.ts +429 -9
- package/dist/tailwind.js +10 -5
- package/dist/template-reads.d.ts +16 -0
- package/dist/template-reads.js +21 -0
- package/dist/testing-entry.d.ts +38 -0
- package/dist/testing-entry.js +173 -0
- package/dist/text-entry.d.ts +1 -0
- package/dist/text-entry.js +7 -0
- package/dist/tokens/system-dark.css +1 -0
- package/dist/tokens/tailwind-theme.css +7 -0
- package/dist/tokens/tokens.css +19 -3
- package/dist/tokens/tokens.json +13 -4
- package/dist/uploads.d.ts +43 -0
- package/dist/uploads.js +1 -0
- package/dist/user-library.d.ts +51 -0
- package/dist/user-library.js +15 -0
- package/dist/view-helpers.d.ts +18 -0
- package/dist/view-helpers.js +64 -0
- package/dist/views/asset-view.js +4 -1
- package/dist/views/content-list-preview.js +3 -1
- package/dist/views/content-list-settings-view.js +11 -7
- package/dist/views/content-list-view.d.ts +5 -3
- package/dist/views/content-list-view.js +243 -40
- package/dist/views/content-picker-view.d.ts +3 -0
- package/dist/views/content-picker-view.js +143 -0
- package/dist/views/crop-view.d.ts +4 -6
- package/dist/views/crop-view.js +22 -13
- package/dist/views/date-range-view.js +4 -1
- package/dist/views/file-upload-view.d.ts +5 -7
- package/dist/views/file-upload-view.js +16 -7
- package/dist/views/group-view.d.ts +8 -0
- package/dist/views/group-view.js +123 -0
- package/dist/views/html-view.js +7 -6
- package/dist/views/image-view.js +37 -19
- package/dist/views/link-view.d.ts +3 -0
- package/dist/views/link-view.js +150 -0
- package/dist/views/options-list-view.d.ts +3 -0
- package/dist/views/options-list-view.js +104 -0
- package/dist/views/repeatable-list-view.d.ts +3 -0
- package/dist/views/repeatable-list-view.js +113 -0
- package/dist/views/rich-text-view.d.ts +2 -0
- package/dist/views/rich-text-view.js +208 -35
- package/dist/views/suggest-key.d.ts +17 -0
- package/dist/views/suggest-key.js +55 -0
- package/dist/views/unreadable-rich-text.d.ts +17 -0
- package/dist/views/unreadable-rich-text.js +40 -0
- package/dist/visitors.d.ts +81 -0
- package/dist/visitors.js +1 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-app-hosts.d.ts +21 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-app-hosts.js +39 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-app-redirects.d.ts +2 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-app-redirects.js +31 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-connections.schema.d.ts +334 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-connections.schema.js +254 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-context.schema.d.ts +12 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-context.schema.js +10 -0
- package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.d.ts +10 -0
- package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.js +5 -0
- package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.d.ts +11 -1
- package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.js +4 -2
- package/node_modules/@kardalum/api-schemas/dist/built-in-editor-ids.d.ts +8 -0
- package/node_modules/@kardalum/api-schemas/dist/built-in-editor-ids.js +38 -0
- package/node_modules/@kardalum/api-schemas/dist/capability-detail.d.ts +65 -0
- package/node_modules/@kardalum/api-schemas/dist/capability-detail.js +144 -0
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.d.ts +115 -3
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.js +58 -11
- package/node_modules/@kardalum/api-schemas/dist/content-list.schema.d.ts +137 -2
- package/node_modules/@kardalum/api-schemas/dist/content-list.schema.js +178 -2
- package/node_modules/@kardalum/api-schemas/dist/content-path.d.ts +1 -1
- package/node_modules/@kardalum/api-schemas/dist/content-path.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/content-reads.schema.d.ts +213 -0
- package/node_modules/@kardalum/api-schemas/dist/content-reads.schema.js +234 -0
- package/node_modules/@kardalum/api-schemas/dist/content-search.schema.d.ts +50 -0
- package/node_modules/@kardalum/api-schemas/dist/content-search.schema.js +42 -0
- package/node_modules/@kardalum/api-schemas/dist/content-summary.schema.d.ts +37 -0
- package/node_modules/@kardalum/api-schemas/dist/content-summary.schema.js +19 -0
- package/node_modules/@kardalum/api-schemas/dist/content-unpublish.schema.d.ts +23 -0
- package/node_modules/@kardalum/api-schemas/dist/content-unpublish.schema.js +13 -0
- package/node_modules/@kardalum/api-schemas/dist/content.schema.d.ts +3 -0
- package/node_modules/@kardalum/api-schemas/dist/content.schema.js +10 -0
- package/node_modules/@kardalum/api-schemas/dist/contract-cancel.schema.d.ts +41 -0
- package/node_modules/@kardalum/api-schemas/dist/contract-cancel.schema.js +86 -0
- package/node_modules/@kardalum/api-schemas/dist/contribution-issues.d.ts +11 -0
- package/node_modules/@kardalum/api-schemas/dist/contribution-issues.js +14 -0
- package/node_modules/@kardalum/api-schemas/dist/core-actions.d.ts +55 -13
- package/node_modules/@kardalum/api-schemas/dist/core-actions.js +22 -10
- package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.d.ts +25 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.js +8 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/data-type-issue.d.ts +35 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-issue.js +60 -0
- package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.d.ts +257 -15
- package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +78 -5
- package/node_modules/@kardalum/api-schemas/dist/document-type.schema.d.ts +24 -6
- package/node_modules/@kardalum/api-schemas/dist/document-type.schema.js +90 -5
- package/node_modules/@kardalum/api-schemas/dist/experimental-points.d.ts +19 -0
- package/node_modules/@kardalum/api-schemas/dist/experimental-points.js +250 -0
- package/node_modules/@kardalum/api-schemas/dist/form-protection-callers.d.ts +29 -0
- package/node_modules/@kardalum/api-schemas/dist/form-protection-callers.js +31 -0
- package/node_modules/@kardalum/api-schemas/dist/form-protection.d.ts +23 -0
- package/node_modules/@kardalum/api-schemas/dist/form-protection.js +12 -0
- package/node_modules/@kardalum/api-schemas/dist/graphql-limits.d.ts +12 -0
- package/node_modules/@kardalum/api-schemas/dist/graphql-limits.js +14 -0
- package/node_modules/@kardalum/api-schemas/dist/held-embed-words.d.ts +23 -0
- package/node_modules/@kardalum/api-schemas/dist/held-embed-words.js +70 -0
- package/node_modules/@kardalum/api-schemas/dist/html-scan.d.ts +22 -0
- package/node_modules/@kardalum/api-schemas/dist/html-scan.js +122 -0
- package/node_modules/@kardalum/api-schemas/dist/html-start-tags.d.ts +48 -0
- package/node_modules/@kardalum/api-schemas/dist/html-start-tags.js +381 -0
- package/node_modules/@kardalum/api-schemas/dist/index.d.ts +162 -48
- package/node_modules/@kardalum/api-schemas/dist/index.js +137 -30
- package/node_modules/@kardalum/api-schemas/dist/install-sign-in-switched-off.schema.d.ts +9 -0
- package/node_modules/@kardalum/api-schemas/dist/install-sign-in-switched-off.schema.js +9 -0
- package/node_modules/@kardalum/api-schemas/dist/json-depth.d.ts +3 -0
- package/node_modules/@kardalum/api-schemas/dist/json-depth.js +20 -0
- package/node_modules/@kardalum/api-schemas/dist/legal-anchors.d.ts +8 -0
- package/node_modules/@kardalum/api-schemas/dist/legal-anchors.js +9 -0
- package/node_modules/@kardalum/api-schemas/dist/licensing.schema.d.ts +63 -0
- package/node_modules/@kardalum/api-schemas/dist/licensing.schema.js +54 -0
- package/node_modules/@kardalum/api-schemas/dist/mail-rules.d.ts +226 -0
- package/node_modules/@kardalum/api-schemas/dist/mail-rules.js +409 -0
- package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.d.ts +8 -0
- package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.js +4 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-leaks.schema.d.ts +145 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-leaks.schema.js +154 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.d.ts +490 -10
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +53 -3
- package/node_modules/@kardalum/api-schemas/dist/marketplace-package-api.schema.d.ts +15 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-package-api.schema.js +14 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-payouts.schema.d.ts +131 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-payouts.schema.js +272 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-profile.schema.d.ts +84 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-profile.schema.js +138 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-revocation.schema.d.ts +20 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-revocation.schema.js +49 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-sites.schema.d.ts +211 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-sites.schema.js +424 -0
- package/node_modules/@kardalum/api-schemas/dist/mcp-plugins.schema.d.ts +78 -0
- package/node_modules/@kardalum/api-schemas/dist/mcp-plugins.schema.js +27 -0
- package/node_modules/@kardalum/api-schemas/dist/mcp-tool-inputs.schema.d.ts +70 -0
- package/node_modules/@kardalum/api-schemas/dist/mcp-tool-inputs.schema.js +43 -0
- package/node_modules/@kardalum/api-schemas/dist/media-api.schema.d.ts +38 -0
- package/node_modules/@kardalum/api-schemas/dist/media-api.schema.js +13 -1
- package/node_modules/@kardalum/api-schemas/dist/media-move.schema.d.ts +75 -0
- package/node_modules/@kardalum/api-schemas/dist/media-move.schema.js +53 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference-api.schema.d.ts +2 -2
- package/node_modules/@kardalum/api-schemas/dist/media-reference.d.ts +2 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference.js +55 -0
- package/node_modules/@kardalum/api-schemas/dist/media.schema.d.ts +5 -0
- package/node_modules/@kardalum/api-schemas/dist/media.schema.js +8 -0
- package/node_modules/@kardalum/api-schemas/dist/nested-fields.schema.d.ts +204 -0
- package/node_modules/@kardalum/api-schemas/dist/nested-fields.schema.js +370 -0
- package/node_modules/@kardalum/api-schemas/dist/nested-validation.d.ts +60 -0
- package/node_modules/@kardalum/api-schemas/dist/nested-validation.js +333 -0
- package/node_modules/@kardalum/api-schemas/dist/news.schema.d.ts +5 -5
- package/node_modules/@kardalum/api-schemas/dist/node-access.schema.d.ts +1 -2
- package/node_modules/@kardalum/api-schemas/dist/node-access.schema.js +1 -2
- package/node_modules/@kardalum/api-schemas/dist/notification-kinds.d.ts +145 -0
- package/node_modules/@kardalum/api-schemas/dist/notification-kinds.js +177 -0
- package/node_modules/@kardalum/api-schemas/dist/notification.schema.d.ts +258 -7
- package/node_modules/@kardalum/api-schemas/dist/notification.schema.js +96 -5
- package/node_modules/@kardalum/api-schemas/dist/page-address.d.ts +10 -0
- package/node_modules/@kardalum/api-schemas/dist/page-address.js +7 -0
- package/node_modules/@kardalum/api-schemas/dist/page-audience.schema.d.ts +87 -0
- package/node_modules/@kardalum/api-schemas/dist/page-audience.schema.js +44 -0
- package/node_modules/@kardalum/api-schemas/dist/password-reset.schema.d.ts +34 -0
- package/node_modules/@kardalum/api-schemas/dist/password-reset.schema.js +60 -0
- package/node_modules/@kardalum/api-schemas/dist/plan-editor.schema.d.ts +28 -3
- package/node_modules/@kardalum/api-schemas/dist/plan-editor.schema.js +55 -8
- package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.d.ts +12 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.js +13 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-admin-slots.d.ts +11 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-admin-slots.js +61 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-caller.d.ts +23 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-caller.js +16 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-cli-commands.d.ts +76 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-cli-commands.js +316 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-content-access.d.ts +44 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-content-access.js +84 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-content-slots.d.ts +136 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-content-slots.js +254 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-contract-checks.d.ts +22 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-contract-checks.js +66 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-contract-document.d.ts +130 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-contract-document.js +173 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-contract-fetch.d.ts +16 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-contract-fetch.js +112 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-contract-schema.d.ts +70 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-contract-schema.js +380 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-contract-types.d.ts +3 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-contract-types.js +68 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-data-type-configs.d.ts +31 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-data-type-configs.js +131 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.d.ts +44 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs.d.ts +44 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs.js +16 -5
- package/node_modules/@kardalum/api-schemas/dist/plugin-document-types.d.ts +228 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-document-types.js +41 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-durable-hooks.d.ts +34 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-durable-hooks.js +102 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-editor-extensions.d.ts +43 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-editor-extensions.js +126 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-events.d.ts +24 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-events.js +53 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-field-info.d.ts +41 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-field-info.js +51 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-graphql-fields.d.ts +32 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-graphql-fields.js +102 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-guards.d.ts +112 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-guards.js +118 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-held-embeds.d.ts +119 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-held-embeds.js +216 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-https-origin.d.ts +5 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-https-origin.js +21 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.d.ts +4 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.js +3 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.d.ts +46 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.js +41 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-install.d.ts +304 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-install.js +220 -6
- package/node_modules/@kardalum/api-schemas/dist/plugin-kept-parts.d.ts +138 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-kept-parts.js +110 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-labels.d.ts +26 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-labels.js +29 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-locales.d.ts +32 -8
- package/node_modules/@kardalum/api-schemas/dist/plugin-locales.js +120 -14
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.d.ts +408 -14
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +307 -23
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.d.ts +23 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.js +61 -3
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-ai.d.ts +40 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-ai.js +139 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.d.ts +23 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.js +37 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-media-access.d.ts +25 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-media-access.js +43 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-outbound.d.ts +107 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-outbound.js +150 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-package-build.schema.d.ts +5 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-package-build.schema.js +7 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-providers.d.ts +346 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-providers.js +461 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-read-only.schema.d.ts +4 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-read-only.schema.js +2 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-rich-text.d.ts +638 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-rich-text.js +533 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-sealed-values.d.ts +45 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-sealed-values.js +99 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-secrets.d.ts +68 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-secrets.js +114 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-service-call.d.ts +36 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-service-call.js +32 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-service-connections.d.ts +193 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-service-connections.js +123 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-service-declarations.d.ts +209 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-service-declarations.js +372 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-services.d.ts +90 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-services.js +204 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-settings.d.ts +352 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-settings.js +409 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-site-extensions.d.ts +347 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-site-extensions.js +976 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-site-requests.d.ts +69 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-site-requests.js +149 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.d.ts +7 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.js +47 -4
- package/node_modules/@kardalum/api-schemas/dist/plugin-styles.d.ts +5 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-styles.js +13 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-tasks.d.ts +45 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-tasks.js +197 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-uploads.d.ts +96 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-uploads.js +185 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-user-accounts.d.ts +213 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-user-accounts.js +131 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-view-kit.d.ts +54 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-view-kit.js +154 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-visitor-points.d.ts +37 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-visitor-points.js +124 -0
- package/node_modules/@kardalum/api-schemas/dist/plural-rules.d.ts +9 -0
- package/node_modules/@kardalum/api-schemas/dist/plural-rules.js +41 -0
- package/node_modules/@kardalum/api-schemas/dist/public-api.schema.d.ts +41 -0
- package/node_modules/@kardalum/api-schemas/dist/public-api.schema.js +100 -12
- package/node_modules/@kardalum/api-schemas/dist/refund-request.schema.d.ts +189 -0
- package/node_modules/@kardalum/api-schemas/dist/refund-request.schema.js +164 -0
- package/node_modules/@kardalum/api-schemas/dist/render-cache.d.ts +126 -0
- package/node_modules/@kardalum/api-schemas/dist/render-cache.js +263 -0
- package/node_modules/@kardalum/api-schemas/dist/render-editing.d.ts +307 -4
- package/node_modules/@kardalum/api-schemas/dist/render-editing.js +61 -0
- package/node_modules/@kardalum/api-schemas/dist/revenue-view.schema.js +7 -3
- package/node_modules/@kardalum/api-schemas/dist/rich-text-paste-hosts.d.ts +14 -0
- package/node_modules/@kardalum/api-schemas/dist/rich-text-paste-hosts.js +108 -0
- package/node_modules/@kardalum/api-schemas/dist/rich-text-shape.d.ts +71 -0
- package/node_modules/@kardalum/api-schemas/dist/rich-text-shape.js +540 -0
- package/node_modules/@kardalum/api-schemas/dist/rich-text-text.d.ts +66 -0
- package/node_modules/@kardalum/api-schemas/dist/rich-text-text.js +394 -0
- package/node_modules/@kardalum/api-schemas/dist/sale-conditions.schema.d.ts +82 -0
- package/node_modules/@kardalum/api-schemas/dist/sale-conditions.schema.js +99 -0
- package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.d.ts +13 -0
- package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.js +28 -0
- package/node_modules/@kardalum/api-schemas/dist/sandbox-attach.schema.d.ts +201 -1
- package/node_modules/@kardalum/api-schemas/dist/sandbox-attach.schema.js +36 -0
- package/node_modules/@kardalum/api-schemas/dist/security-overview.schema.d.ts +64 -0
- package/node_modules/@kardalum/api-schemas/dist/security-overview.schema.js +38 -0
- package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.d.ts +97 -8
- package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.js +64 -1
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +136 -0
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.js +53 -2
- package/node_modules/@kardalum/api-schemas/dist/sign-in-steps.d.ts +724 -0
- package/node_modules/@kardalum/api-schemas/dist/sign-in-steps.js +408 -0
- package/node_modules/@kardalum/api-schemas/dist/sign-in.schema.d.ts +386 -0
- package/node_modules/@kardalum/api-schemas/dist/sign-in.schema.js +618 -0
- package/node_modules/@kardalum/api-schemas/dist/site-consent.d.ts +77 -0
- package/node_modules/@kardalum/api-schemas/dist/site-consent.js +122 -0
- package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.d.ts +3 -3
- package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.d.ts +1 -1
- package/node_modules/@kardalum/api-schemas/dist/structured-duplicate-key.d.ts +13 -0
- package/node_modules/@kardalum/api-schemas/dist/structured-duplicate-key.js +26 -0
- package/node_modules/@kardalum/api-schemas/dist/structured-fields.schema.d.ts +70 -0
- package/node_modules/@kardalum/api-schemas/dist/structured-fields.schema.js +188 -0
- package/node_modules/@kardalum/api-schemas/dist/template-api.schema.d.ts +33 -0
- package/node_modules/@kardalum/api-schemas/dist/template-api.schema.js +26 -1
- package/node_modules/@kardalum/api-schemas/dist/template.schema.d.ts +1 -0
- package/node_modules/@kardalum/api-schemas/dist/template.schema.js +3 -0
- package/node_modules/@kardalum/api-schemas/dist/transaction-rolled-back.d.ts +13 -0
- package/node_modules/@kardalum/api-schemas/dist/transaction-rolled-back.js +29 -0
- package/node_modules/@kardalum/api-schemas/dist/trash-purge.schema.d.ts +13 -0
- package/node_modules/@kardalum/api-schemas/dist/trash-purge.schema.js +6 -0
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.d.ts +72 -1
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +36 -3
- package/node_modules/@kardalum/api-schemas/dist/vendor-service.schema.d.ts +5 -1
- package/node_modules/@kardalum/api-schemas/dist/vendor-service.schema.js +4 -3
- package/node_modules/@kardalum/api-schemas/dist/visitor-accounts.d.ts +482 -0
- package/node_modules/@kardalum/api-schemas/dist/visitor-accounts.js +380 -0
- package/node_modules/@kardalum/api-schemas/dist/visitor-groups.d.ts +109 -0
- package/node_modules/@kardalum/api-schemas/dist/visitor-groups.js +62 -0
- package/node_modules/@kardalum/api-schemas/package.json +2 -0
- package/node_modules/@kardalum/design-tokens/dist/build-css.js +15 -1
- package/node_modules/@kardalum/design-tokens/dist/system-dark.css +1 -0
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.css +7 -0
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.d.ts +2 -1
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.js +2 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.css +19 -3
- package/node_modules/@kardalum/design-tokens/dist/tokens.d.ts +1 -1
- package/node_modules/@kardalum/design-tokens/dist/tokens.js +18 -3
- package/node_modules/@kardalum/design-tokens/dist/tokens.json +13 -4
- package/node_modules/@kardalum/design-tokens/dist/types.d.ts +5 -1
- package/node_modules/@kardalum/plugin-package/dist/build-reference.d.ts +38 -2
- package/node_modules/@kardalum/plugin-package/dist/build-reference.js +17 -2
- package/node_modules/@kardalum/plugin-package/dist/capabilities.d.ts +17 -10
- package/node_modules/@kardalum/plugin-package/dist/capabilities.js +625 -35
- package/node_modules/@kardalum/plugin-package/dist/client-bundle.d.ts +1 -1
- package/node_modules/@kardalum/plugin-package/dist/client-bundle.js +25 -0
- package/node_modules/@kardalum/plugin-package/dist/cms-range.d.ts +17 -0
- package/node_modules/@kardalum/plugin-package/dist/cms-range.js +353 -0
- package/node_modules/@kardalum/plugin-package/dist/contract-fingerprint.d.ts +17 -0
- package/node_modules/@kardalum/plugin-package/dist/contract-fingerprint.js +39 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/admin-styles.d.ts +23 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/admin-styles.js +351 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/ai-declarations.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/ai-declarations.js +26 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.d.ts +1 -1
- package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.js +3 -2
- package/node_modules/@kardalum/plugin-package/dist/delivery/bundle.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/bundle.js +1 -1
- package/node_modules/@kardalum/plugin-package/dist/delivery/content-access.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/content-access.js +47 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.js +2 -2
- package/node_modules/@kardalum/plugin-package/dist/delivery/editor-extensions.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/editor-extensions.js +40 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/graphql-fields.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/graphql-fields.js +22 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/icons.js +3 -2
- package/node_modules/@kardalum/plugin-package/dist/delivery/index.d.ts +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/index.js +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/label-languages.js +76 -6
- package/node_modules/@kardalum/plugin-package/dist/delivery/licence-check.d.ts +27 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/licence-check.js +99 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/limits.d.ts +6 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/limits.js +6 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/locales.js +9 -4
- package/node_modules/@kardalum/plugin-package/dist/delivery/plugin-settings.d.ts +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/plugin-settings.js +68 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/providers.d.ts +5 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/providers.js +316 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/registry.js +40 -4
- package/node_modules/@kardalum/plugin-package/dist/delivery/rich-text.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/rich-text.js +173 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/sample-content.js +91 -2
- package/node_modules/@kardalum/plugin-package/dist/delivery/server-powers.d.ts +6 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/server-powers.js +150 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/services-events.d.ts +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/services-events.js +35 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/sign-in-steps.d.ts +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/sign-in-steps.js +71 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/site-extensions.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/site-extensions.js +69 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/templates.d.ts +1 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/templates.js +21 -1
- package/node_modules/@kardalum/plugin-package/dist/delivery/types.d.ts +17 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/user-accounts.d.ts +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/user-accounts.js +36 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/visitor-points.d.ts +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/visitor-points.js +33 -0
- package/node_modules/@kardalum/plugin-package/dist/index.d.ts +8 -2
- package/node_modules/@kardalum/plugin-package/dist/index.js +7 -1
- package/node_modules/@kardalum/plugin-package/dist/license-verdict.d.ts +75 -0
- package/node_modules/@kardalum/plugin-package/dist/license-verdict.js +123 -0
- package/node_modules/@kardalum/plugin-package/dist/public-suffix.d.ts +7 -0
- package/node_modules/@kardalum/plugin-package/dist/public-suffix.js +23 -0
- package/node_modules/@kardalum/plugin-package/dist/rich-text-summary.d.ts +1 -0
- package/node_modules/@kardalum/plugin-package/dist/rich-text-summary.js +27 -0
- package/node_modules/@kardalum/plugin-package/dist/stylesheet-load-hook.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/stylesheet-load-hook.js +28 -0
- package/node_modules/@kardalum/plugin-package/package.json +4 -0
- package/node_modules/@kardalum/ui/dist/components/select.d.ts +6 -0
- package/node_modules/@kardalum/ui/dist/components/select.js +7 -0
- package/node_modules/@kardalum/ui/dist/components/switch.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/textarea.d.ts +6 -0
- package/node_modules/@kardalum/ui/dist/components/textarea.js +7 -0
- package/node_modules/@kardalum/ui/dist/components/tooltip.js +1 -2
- package/node_modules/@kardalum/ui/dist/components/truncated-text.d.ts +6 -1
- package/node_modules/@kardalum/ui/dist/components/truncated-text.js +5 -4
- package/node_modules/@kardalum/ui/dist/index.d.ts +2 -0
- package/node_modules/@kardalum/ui/dist/index.js +2 -0
- package/package.json +25 -3
|
@@ -0,0 +1,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
|
+
});
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** The longest id of a held embed. */
|
|
3
|
+
export declare const HELD_EMBED_ID_MAX = 40;
|
|
4
|
+
/** The longest path prefix of a held embed. */
|
|
5
|
+
export declare const HELD_EMBED_PATH_PREFIX_MAX = 200;
|
|
6
|
+
/** The longest provider name, in characters, in each language. */
|
|
7
|
+
export declare const HELD_EMBED_PROVIDER_MAX = 80;
|
|
8
|
+
/** The longest privacy notice address. */
|
|
9
|
+
export declare const HELD_EMBED_PRIVACY_URL_MAX = 500;
|
|
10
|
+
/** The most held embeds one plugin declares. */
|
|
11
|
+
export declare const HELD_EMBEDS_DECLARED_MAX = 5;
|
|
12
|
+
/** The longest frame address a tag may ask for. */
|
|
13
|
+
export declare const HELD_EMBED_SRC_MAX = 4096;
|
|
14
|
+
/** The longest frame title, in code points. */
|
|
15
|
+
export declare const HELD_EMBED_TITLE_MAX = 200;
|
|
16
|
+
/** The most held embeds one render writes; a request past it writes only the tag's `html`. */
|
|
17
|
+
export declare const HELD_EMBEDS_PER_RENDER_MAX = 20;
|
|
18
|
+
/** The largest the core's loader script may be, in bytes. */
|
|
19
|
+
export declare const HELD_EMBED_LOADER_MAX_BYTES = 4096;
|
|
20
|
+
/** The sandbox the core's loader gives every held frame: the frame's own page runs, but it cannot
|
|
21
|
+
* move the visitor's page. The one core value that may change after Google Maps' live check. */
|
|
22
|
+
export declare const HELD_EMBED_FRAME_SANDBOX = "allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox";
|
|
23
|
+
/** The referrer policy of every held frame: the site's address is sent, never the page's path. */
|
|
24
|
+
export declare const HELD_EMBED_FRAME_REFERRER_POLICY = "strict-origin-when-cross-origin";
|
|
25
|
+
/** The kinds of held content, each with its own words in held-embed-words.ts; `content` is the generic one. */
|
|
26
|
+
export declare const HELD_EMBED_KINDS: readonly ["map", "content"];
|
|
27
|
+
export type HeldEmbedKind = (typeof HELD_EMBED_KINDS)[number];
|
|
28
|
+
/** What a held frame may be allowed, each written into the frame's `allow`. */
|
|
29
|
+
export declare const HELD_EMBED_ALLOW: readonly ["fullscreen", "picture-in-picture", "encrypted-media"];
|
|
30
|
+
export type HeldEmbedAllow = (typeof HELD_EMBED_ALLOW)[number];
|
|
31
|
+
/** The shapes a held frame may take, each a class of the core's stylesheet. */
|
|
32
|
+
export declare const HELD_EMBED_RATIOS: readonly ["16:9", "4:3", "3:2", "1:1", "3:4", "9:16"];
|
|
33
|
+
export type HeldEmbedRatio = (typeof HELD_EMBED_RATIOS)[number];
|
|
34
|
+
export declare const HELD_EMBED_RATIO_DEFAULT: HeldEmbedRatio;
|
|
35
|
+
/**
|
|
36
|
+
* Why a path prefix is refused, or null. It starts and ends with "/", is at most
|
|
37
|
+
* HELD_EMBED_PATH_PREFIX_MAX, holds no "..", "%2e", "%2f" or "%5c" (any case), and is written the
|
|
38
|
+
* way the URL parser writes a path, so a frame address's parsed path can be compared with it as
|
|
39
|
+
* text (no space, backslash, "?", "#", control character or dot segment).
|
|
40
|
+
*/
|
|
41
|
+
export declare function heldEmbedPathPrefixProblem(prefix: string): string | null;
|
|
42
|
+
/**
|
|
43
|
+
* One held embed a plugin declares. Beyond the design's field limits, the two values the install
|
|
44
|
+
* line shows as the core's notes (`embedFrom`: origin and path prefix; `privacyNoticeAt`: the
|
|
45
|
+
* notice's host) must each fit CAPABILITY_NOTE_VALUE_MAX, or a listing carrying the line would not
|
|
46
|
+
* parse.
|
|
47
|
+
*/
|
|
48
|
+
export declare const PluginHeldEmbedSchema: z.ZodObject<{
|
|
49
|
+
id: z.ZodString;
|
|
50
|
+
origin: z.ZodString;
|
|
51
|
+
pathPrefix: z.ZodString;
|
|
52
|
+
provider: z.ZodPreprocess<z.ZodObject<{
|
|
53
|
+
en: z.ZodString;
|
|
54
|
+
}, z.core.$catchall<z.ZodString>>, unknown>;
|
|
55
|
+
privacyNotice: z.ZodString;
|
|
56
|
+
kind: z.ZodEnum<{
|
|
57
|
+
map: "map";
|
|
58
|
+
content: "content";
|
|
59
|
+
}>;
|
|
60
|
+
allow: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
61
|
+
fullscreen: "fullscreen";
|
|
62
|
+
"picture-in-picture": "picture-in-picture";
|
|
63
|
+
"encrypted-media": "encrypted-media";
|
|
64
|
+
}>>>;
|
|
65
|
+
consent: z.ZodOptional<z.ZodEnum<{
|
|
66
|
+
media: "media";
|
|
67
|
+
preferences: "preferences";
|
|
68
|
+
statistics: "statistics";
|
|
69
|
+
marketing: "marketing";
|
|
70
|
+
}>>;
|
|
71
|
+
}, z.core.$strict>;
|
|
72
|
+
export type PluginHeldEmbed = z.infer<typeof PluginHeldEmbedSchema>;
|
|
73
|
+
/** `contributions.heldEmbeds`: 1 to HELD_EMBEDS_DECLARED_MAX entries, each id once. */
|
|
74
|
+
export declare const PluginHeldEmbedsSchema: z.ZodArray<z.ZodObject<{
|
|
75
|
+
id: z.ZodString;
|
|
76
|
+
origin: z.ZodString;
|
|
77
|
+
pathPrefix: z.ZodString;
|
|
78
|
+
provider: z.ZodPreprocess<z.ZodObject<{
|
|
79
|
+
en: z.ZodString;
|
|
80
|
+
}, z.core.$catchall<z.ZodString>>, unknown>;
|
|
81
|
+
privacyNotice: z.ZodString;
|
|
82
|
+
kind: z.ZodEnum<{
|
|
83
|
+
map: "map";
|
|
84
|
+
content: "content";
|
|
85
|
+
}>;
|
|
86
|
+
allow: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
87
|
+
fullscreen: "fullscreen";
|
|
88
|
+
"picture-in-picture": "picture-in-picture";
|
|
89
|
+
"encrypted-media": "encrypted-media";
|
|
90
|
+
}>>>;
|
|
91
|
+
consent: z.ZodOptional<z.ZodEnum<{
|
|
92
|
+
media: "media";
|
|
93
|
+
preferences: "preferences";
|
|
94
|
+
statistics: "statistics";
|
|
95
|
+
marketing: "marketing";
|
|
96
|
+
}>>;
|
|
97
|
+
}, z.core.$strict>>;
|
|
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. */
|
|
99
|
+
export interface HeldEmbedRequest {
|
|
100
|
+
id: string;
|
|
101
|
+
src: string;
|
|
102
|
+
title: string;
|
|
103
|
+
ratio?: HeldEmbedRatio;
|
|
104
|
+
}
|
|
105
|
+
/** Why a request is refused: a reason to log, never a value. */
|
|
106
|
+
export declare const HELD_EMBED_REQUEST_PROBLEMS: readonly ["shape", "id", "src", "title", "ratio"];
|
|
107
|
+
export type HeldEmbedRequestProblem = (typeof HELD_EMBED_REQUEST_PROBLEMS)[number];
|
|
108
|
+
/**
|
|
109
|
+
* Why a tag's `{ embed }` is refused, checked against its own plugin's declarations, or null when
|
|
110
|
+
* the core may write its placeholder. `src` is parsed with the URL parser: https, no user or
|
|
111
|
+
* password, its origin the declared one, its parsed path starting with the declared prefix and
|
|
112
|
+
* holding no escaped dot, slash or backslash, at most HELD_EMBED_SRC_MAX. Members the request
|
|
113
|
+
* does not define are ignored: the core writes only these four.
|
|
114
|
+
*/
|
|
115
|
+
export declare function heldEmbedRequestProblem(request: unknown, declarations: ReadonlyArray<{
|
|
116
|
+
id: string;
|
|
117
|
+
origin: string;
|
|
118
|
+
pathPrefix: string;
|
|
119
|
+
}>): HeldEmbedRequestProblem | null;
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { CAPABILITY_NOTE_VALUE_MAX } from "./capability-detail.js";
|
|
3
|
+
import { labelMapSchema } from "./plugin-labels.js";
|
|
4
|
+
import { CONSENT_CATEGORIES } from "./site-consent.js";
|
|
5
|
+
import { PageHeadScriptOriginSchema } from "./plugin-https-origin.js";
|
|
6
|
+
import { hasNoControlCharacter } from "./strict-url.js";
|
|
7
|
+
// M33 K42 (Google Maps 2.10 C1): held content from other sites. A plugin declares under
|
|
8
|
+
// `contributions.heldEmbeds` the origins and paths it may show a frame from; a template tag
|
|
9
|
+
// answers `{ embed }` naming one of them, and the core writes a placeholder with its own words
|
|
10
|
+
// (held-embed-words.ts) and builds the frame only after a visitor clicks. The declaration's rules,
|
|
11
|
+
// the request check and every limit live here, so the SDK, the door, the server, the CLI and the
|
|
12
|
+
// marketplace read one list. Addresses are parsed with the WHATWG `URL` parser; everything else is
|
|
13
|
+
// a linear scan under a length cap, and no regular expression reads a plugin's value.
|
|
14
|
+
/** The longest id of a held embed. */
|
|
15
|
+
export const HELD_EMBED_ID_MAX = 40;
|
|
16
|
+
/** The longest path prefix of a held embed. */
|
|
17
|
+
export const HELD_EMBED_PATH_PREFIX_MAX = 200;
|
|
18
|
+
/** The longest provider name, in characters, in each language. */
|
|
19
|
+
export const HELD_EMBED_PROVIDER_MAX = 80;
|
|
20
|
+
/** The longest privacy notice address. */
|
|
21
|
+
export const HELD_EMBED_PRIVACY_URL_MAX = 500;
|
|
22
|
+
/** The most held embeds one plugin declares. */
|
|
23
|
+
export const HELD_EMBEDS_DECLARED_MAX = 5;
|
|
24
|
+
/** The longest frame address a tag may ask for. */
|
|
25
|
+
export const HELD_EMBED_SRC_MAX = 4096;
|
|
26
|
+
/** The longest frame title, in code points. */
|
|
27
|
+
export const HELD_EMBED_TITLE_MAX = 200;
|
|
28
|
+
/** The most held embeds one render writes; a request past it writes only the tag's `html`. */
|
|
29
|
+
export const HELD_EMBEDS_PER_RENDER_MAX = 20;
|
|
30
|
+
/** The largest the core's loader script may be, in bytes. */
|
|
31
|
+
export const HELD_EMBED_LOADER_MAX_BYTES = 4096;
|
|
32
|
+
/** The sandbox the core's loader gives every held frame: the frame's own page runs, but it cannot
|
|
33
|
+
* move the visitor's page. The one core value that may change after Google Maps' live check. */
|
|
34
|
+
export const HELD_EMBED_FRAME_SANDBOX = "allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox";
|
|
35
|
+
/** The referrer policy of every held frame: the site's address is sent, never the page's path. */
|
|
36
|
+
export const HELD_EMBED_FRAME_REFERRER_POLICY = "strict-origin-when-cross-origin";
|
|
37
|
+
/** The kinds of held content, each with its own words in held-embed-words.ts; `content` is the generic one. */
|
|
38
|
+
export const HELD_EMBED_KINDS = ["map", "content"];
|
|
39
|
+
/** What a held frame may be allowed, each written into the frame's `allow`. */
|
|
40
|
+
export const HELD_EMBED_ALLOW = ["fullscreen", "picture-in-picture", "encrypted-media"];
|
|
41
|
+
/** The shapes a held frame may take, each a class of the core's stylesheet. */
|
|
42
|
+
export const HELD_EMBED_RATIOS = ["16:9", "4:3", "3:2", "1:1", "3:4", "9:16"];
|
|
43
|
+
export const HELD_EMBED_RATIO_DEFAULT = "16:9";
|
|
44
|
+
const isLetter = (c) => (c >= "a" && c <= "z") || (c >= "A" && c <= "Z");
|
|
45
|
+
const isDigit = (c) => c >= "0" && c <= "9";
|
|
46
|
+
/** A letter, then letters, digits and "_", 1 to HELD_EMBED_ID_MAX. */
|
|
47
|
+
function isHeldEmbedId(value) {
|
|
48
|
+
if (value.length === 0 || value.length > HELD_EMBED_ID_MAX || !isLetter(value[0]))
|
|
49
|
+
return false;
|
|
50
|
+
for (const c of value)
|
|
51
|
+
if (!isLetter(c) && !isDigit(c) && c !== "_")
|
|
52
|
+
return false;
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
/** Whether the text holds `part`, ASCII case-insensitively (a linear scan; the text is bounded first by its caller). */
|
|
56
|
+
function holdsIgnoringCase(text, part) {
|
|
57
|
+
return text.toLowerCase().includes(part);
|
|
58
|
+
}
|
|
59
|
+
/** An escaped dot, slash or backslash in a path: a server that decodes it before routing may read
|
|
60
|
+
* a path outside the prefix that the parsed path seemed to stay in. */
|
|
61
|
+
function holdsEscapedSeparator(path) {
|
|
62
|
+
return holdsIgnoringCase(path, "%2e") || holdsIgnoringCase(path, "%2f") || holdsIgnoringCase(path, "%5c");
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Why a path prefix is refused, or null. It starts and ends with "/", is at most
|
|
66
|
+
* HELD_EMBED_PATH_PREFIX_MAX, holds no "..", "%2e", "%2f" or "%5c" (any case), and is written the
|
|
67
|
+
* way the URL parser writes a path, so a frame address's parsed path can be compared with it as
|
|
68
|
+
* text (no space, backslash, "?", "#", control character or dot segment).
|
|
69
|
+
*/
|
|
70
|
+
export function heldEmbedPathPrefixProblem(prefix) {
|
|
71
|
+
if (prefix.length === 0 || prefix.length > HELD_EMBED_PATH_PREFIX_MAX)
|
|
72
|
+
return `a path prefix is 1 to ${HELD_EMBED_PATH_PREFIX_MAX} characters`;
|
|
73
|
+
if (!prefix.startsWith("/") || !prefix.endsWith("/"))
|
|
74
|
+
return 'a path prefix starts and ends with "/"';
|
|
75
|
+
if (prefix.includes(".."))
|
|
76
|
+
return 'a path prefix holds no ".."';
|
|
77
|
+
if (holdsEscapedSeparator(prefix))
|
|
78
|
+
return 'a path prefix holds no "%2e", "%2f" or "%5c"';
|
|
79
|
+
let parsed;
|
|
80
|
+
try {
|
|
81
|
+
parsed = new URL(prefix, "https://held-embed.invalid");
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
return "a path prefix is a plain path";
|
|
85
|
+
}
|
|
86
|
+
// A control character, space, backslash, "?", "#" or dot segment makes the parsed path differ.
|
|
87
|
+
if (parsed.pathname !== prefix)
|
|
88
|
+
return "a path prefix is written as the URL parser writes it";
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
/** The host of an https address with no user or password, or null. */
|
|
92
|
+
function httpsHostOf(value) {
|
|
93
|
+
if (!hasNoControlCharacter(value))
|
|
94
|
+
return null;
|
|
95
|
+
let url;
|
|
96
|
+
try {
|
|
97
|
+
url = new URL(value);
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
return url.protocol === "https:" && url.username === "" && url.password === "" ? url.host : null;
|
|
103
|
+
}
|
|
104
|
+
const allowList = z.array(z.enum(HELD_EMBED_ALLOW)).superRefine((items, ctx) => {
|
|
105
|
+
const seen = new Set();
|
|
106
|
+
items.forEach((item, index) => {
|
|
107
|
+
if (seen.has(item))
|
|
108
|
+
ctx.addIssue({ code: "custom", message: `"${item}" is named twice`, path: [index] });
|
|
109
|
+
seen.add(item);
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
/**
|
|
113
|
+
* One held embed a plugin declares. Beyond the design's field limits, the two values the install
|
|
114
|
+
* line shows as the core's notes (`embedFrom`: origin and path prefix; `privacyNoticeAt`: the
|
|
115
|
+
* notice's host) must each fit CAPABILITY_NOTE_VALUE_MAX, or a listing carrying the line would not
|
|
116
|
+
* parse.
|
|
117
|
+
*/
|
|
118
|
+
export const PluginHeldEmbedSchema = z
|
|
119
|
+
.object({
|
|
120
|
+
id: z.string().refine(isHeldEmbedId, { message: `a letter, then letters, digits and "_", 1 to ${HELD_EMBED_ID_MAX} characters` }),
|
|
121
|
+
origin: PageHeadScriptOriginSchema,
|
|
122
|
+
pathPrefix: z.string().superRefine((value, ctx) => {
|
|
123
|
+
const problem = heldEmbedPathPrefixProblem(value);
|
|
124
|
+
if (problem !== null)
|
|
125
|
+
ctx.addIssue({ code: "custom", message: problem });
|
|
126
|
+
}),
|
|
127
|
+
provider: labelMapSchema({ max: HELD_EMBED_PROVIDER_MAX }),
|
|
128
|
+
privacyNotice: z
|
|
129
|
+
.string()
|
|
130
|
+
.max(HELD_EMBED_PRIVACY_URL_MAX, { message: `is at most ${HELD_EMBED_PRIVACY_URL_MAX} characters` })
|
|
131
|
+
.superRefine((value, ctx) => {
|
|
132
|
+
const host = httpsHostOf(value);
|
|
133
|
+
if (host === null)
|
|
134
|
+
ctx.addIssue({ code: "custom", message: "an https address with no user name or password" });
|
|
135
|
+
else if (host.length > CAPABILITY_NOTE_VALUE_MAX)
|
|
136
|
+
ctx.addIssue({ code: "custom", message: `its host is at most ${CAPABILITY_NOTE_VALUE_MAX} characters` });
|
|
137
|
+
}),
|
|
138
|
+
kind: z.enum(HELD_EMBED_KINDS),
|
|
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(),
|
|
142
|
+
})
|
|
143
|
+
.strict()
|
|
144
|
+
.superRefine((entry, ctx) => {
|
|
145
|
+
if (entry.origin.length + entry.pathPrefix.length > CAPABILITY_NOTE_VALUE_MAX) {
|
|
146
|
+
ctx.addIssue({ code: "custom", message: `the origin and path prefix together are at most ${CAPABILITY_NOTE_VALUE_MAX} characters`, path: ["pathPrefix"] });
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
/** `contributions.heldEmbeds`: 1 to HELD_EMBEDS_DECLARED_MAX entries, each id once. */
|
|
150
|
+
export const PluginHeldEmbedsSchema = z
|
|
151
|
+
.array(PluginHeldEmbedSchema)
|
|
152
|
+
.min(1, { message: "declares at least one held embed" })
|
|
153
|
+
.max(HELD_EMBEDS_DECLARED_MAX, { message: `declares at most ${HELD_EMBEDS_DECLARED_MAX} held embeds` })
|
|
154
|
+
.superRefine((entries, ctx) => {
|
|
155
|
+
const seen = new Set();
|
|
156
|
+
entries.forEach((entry, index) => {
|
|
157
|
+
if (seen.has(entry.id))
|
|
158
|
+
ctx.addIssue({ code: "custom", message: "declares each id once", path: [index, "id"] });
|
|
159
|
+
seen.add(entry.id);
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
/** Why a request is refused: a reason to log, never a value. */
|
|
163
|
+
export const HELD_EMBED_REQUEST_PROBLEMS = ["shape", "id", "src", "title", "ratio"];
|
|
164
|
+
/** A C0 or C1 control character, or DEL. */
|
|
165
|
+
function isControl(code) {
|
|
166
|
+
return code < 0x20 || (code >= 0x7f && code <= 0x9f);
|
|
167
|
+
}
|
|
168
|
+
/** 1 to HELD_EMBED_TITLE_MAX code points, not only white space, no control character. */
|
|
169
|
+
function titleFits(value) {
|
|
170
|
+
if (value.length === 0 || value.length > HELD_EMBED_TITLE_MAX * 2 || value.trim() === "")
|
|
171
|
+
return false;
|
|
172
|
+
let points = 0;
|
|
173
|
+
for (const c of value) {
|
|
174
|
+
points += 1;
|
|
175
|
+
if (points > HELD_EMBED_TITLE_MAX || isControl(c.codePointAt(0)))
|
|
176
|
+
return false;
|
|
177
|
+
}
|
|
178
|
+
return true;
|
|
179
|
+
}
|
|
180
|
+
/** Whether `src` is an https address on the declared origin whose parsed path stays under the prefix. */
|
|
181
|
+
function srcFits(src, declared) {
|
|
182
|
+
if (src.length > HELD_EMBED_SRC_MAX || !hasNoControlCharacter(src))
|
|
183
|
+
return false;
|
|
184
|
+
let url;
|
|
185
|
+
try {
|
|
186
|
+
url = new URL(src);
|
|
187
|
+
}
|
|
188
|
+
catch {
|
|
189
|
+
return false;
|
|
190
|
+
}
|
|
191
|
+
if (url.protocol !== "https:" || url.username !== "" || url.password !== "" || url.origin !== declared.origin)
|
|
192
|
+
return false;
|
|
193
|
+
return url.pathname.startsWith(declared.pathPrefix) && !holdsEscapedSeparator(url.pathname);
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Why a tag's `{ embed }` is refused, checked against its own plugin's declarations, or null when
|
|
197
|
+
* the core may write its placeholder. `src` is parsed with the URL parser: https, no user or
|
|
198
|
+
* password, its origin the declared one, its parsed path starting with the declared prefix and
|
|
199
|
+
* holding no escaped dot, slash or backslash, at most HELD_EMBED_SRC_MAX. Members the request
|
|
200
|
+
* does not define are ignored: the core writes only these four.
|
|
201
|
+
*/
|
|
202
|
+
export function heldEmbedRequestProblem(request, declarations) {
|
|
203
|
+
if (request === null || typeof request !== "object" || Array.isArray(request))
|
|
204
|
+
return "shape";
|
|
205
|
+
const value = request;
|
|
206
|
+
const declared = typeof value.id === "string" ? declarations.find((entry) => entry.id === value.id) : undefined;
|
|
207
|
+
if (declared === undefined)
|
|
208
|
+
return "id";
|
|
209
|
+
if (typeof value.src !== "string" || !srcFits(value.src, declared))
|
|
210
|
+
return "src";
|
|
211
|
+
if (typeof value.title !== "string" || !titleFits(value.title))
|
|
212
|
+
return "title";
|
|
213
|
+
if (value.ratio !== undefined && !HELD_EMBED_RATIOS.includes(value.ratio))
|
|
214
|
+
return "ratio";
|
|
215
|
+
return null;
|
|
216
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** The longest site address a fallback may answer with; an origin is never longer. */
|
|
3
|
+
export declare const SITE_LOCATION_MAX = 2000;
|
|
4
|
+
/** An origin a plugin may load page head scripts and stylesheets from: https, no path, no trailing "/". Its length cap is the location cap: an origin is never longer than an address. */
|
|
5
|
+
export declare const PageHeadScriptOriginSchema: z.ZodString;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { hasNoControlCharacter } from "./strict-url.js";
|
|
3
|
+
// M33 K42: the bare https origin rule, kept apart from plugin-site-extensions so the held embed
|
|
4
|
+
// rules (plugin-held-embeds.ts) can use it while plugin-site-extensions runs them, with no import
|
|
5
|
+
// cycle. plugin-site-extensions re-exports both names, so every import of them stays as it was.
|
|
6
|
+
/** The longest site address a fallback may answer with; an origin is never longer. */
|
|
7
|
+
export const SITE_LOCATION_MAX = 2_000;
|
|
8
|
+
function originMatches(value) {
|
|
9
|
+
if (!hasNoControlCharacter(value))
|
|
10
|
+
return false;
|
|
11
|
+
let url;
|
|
12
|
+
try {
|
|
13
|
+
url = new URL(value);
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
return url.protocol === "https:" && url.username === "" && url.password === "" && url.origin === value;
|
|
19
|
+
}
|
|
20
|
+
/** An origin a plugin may load page head scripts and stylesheets from: https, no path, no trailing "/". Its length cap is the location cap: an origin is never longer than an address. */
|
|
21
|
+
export const PageHeadScriptOriginSchema = z.string().max(SITE_LOCATION_MAX).refine(originMatches, { message: "an https origin with no path, user name or trailing slash" });
|
|
@@ -39,3 +39,7 @@ export declare function isPluginManifestId(id: string): boolean;
|
|
|
39
39
|
export declare const SLOT_ID_REGEX: RegExp;
|
|
40
40
|
/** The longest a slot's id may be. */
|
|
41
41
|
export declare const SLOT_ID_MAX = 64;
|
|
42
|
+
/** The built-in admin sections whose rails a plugin may add an entry to (S280). Each one's
|
|
43
|
+
* plugin entries open at `/<section>/plugins/<plugin id>/<entry id>`. */
|
|
44
|
+
export declare const BUILT_IN_RAIL_SECTIONS: readonly ["content", "media", "settings", "users"];
|
|
45
|
+
export type BuiltInRailSectionId = (typeof BUILT_IN_RAIL_SECTIONS)[number];
|
|
@@ -46,3 +46,6 @@ export function isPluginManifestId(id) {
|
|
|
46
46
|
export const SLOT_ID_REGEX = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
47
47
|
/** The longest a slot's id may be. */
|
|
48
48
|
export const SLOT_ID_MAX = 64;
|
|
49
|
+
/** The built-in admin sections whose rails a plugin may add an entry to (S280). Each one's
|
|
50
|
+
* plugin entries open at `/<section>/plugins/<plugin id>/<entry id>`. */
|
|
51
|
+
export const BUILT_IN_RAIL_SECTIONS = ["content", "media", "settings", "users"];
|
|
@@ -4,18 +4,23 @@ 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<{
|
|
10
11
|
sampleContent: z.ZodBoolean;
|
|
11
12
|
roles: z.ZodArray<z.ZodString>;
|
|
13
|
+
grants: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
12
14
|
options: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodBoolean, z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
15
|
+
settings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
|
|
13
16
|
}, z.core.$strict>;
|
|
14
17
|
created: z.ZodObject<{
|
|
15
18
|
sampleContentNodeIds: z.ZodArray<z.ZodString>;
|
|
16
19
|
mediaIds: z.ZodArray<z.ZodString>;
|
|
17
20
|
roleIds: z.ZodArray<z.ZodString>;
|
|
21
|
+
sampleContentVersions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
18
22
|
}, z.core.$strict>;
|
|
23
|
+
offersApplied: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
19
24
|
}, z.core.$strict>;
|
|
20
25
|
export type PluginInstallRecord = z.infer<typeof PluginInstallRecordSchema>;
|
|
21
26
|
/** A fresh `created`, never a shared one. */
|
|
@@ -45,12 +50,27 @@ export declare const InstallAnswersRefusedSchema: z.ZodObject<{
|
|
|
45
50
|
export type InstallAnswersRefused = z.infer<typeof InstallAnswersRefusedSchema>;
|
|
46
51
|
/** The most page titles a record summary names. */
|
|
47
52
|
export declare const INSTALL_RECORD_SUMMARY_TITLES = 20;
|
|
53
|
+
/** M33 K41: before an uninstall the core reads at most this many templates for the plugin's
|
|
54
|
+
* template names, in pages; past it the answer says the scan stopped early. */
|
|
55
|
+
export declare const UNINSTALL_TEMPLATES_SCANNED_MAX = 2000;
|
|
56
|
+
/** M33 K41: at most this many of the templates found are named; the answer counts the rest. */
|
|
57
|
+
export declare const UNINSTALL_TEMPLATES_LISTED_MAX = 50;
|
|
58
|
+
/** M33 K41: one template whose source names one of the plugin's full template names (a tag or a
|
|
59
|
+
* filter, by whole name), shaped like a data type's holder: its id and name, and the names it uses. */
|
|
60
|
+
export declare const TemplateUsingPluginSchema: z.ZodObject<{
|
|
61
|
+
id: z.ZodString;
|
|
62
|
+
name: z.ZodString;
|
|
63
|
+
uses: z.ZodArray<z.ZodString>;
|
|
64
|
+
}, z.core.$strip>;
|
|
65
|
+
export type TemplateUsingPlugin = z.infer<typeof TemplateUsingPluginSchema>;
|
|
48
66
|
/** What the admin is told about a plugin's record (the uninstall dialog, an update). */
|
|
49
67
|
export declare const PluginInstallRecordSummarySchema: z.ZodObject<{
|
|
50
68
|
answers: z.ZodNullable<z.ZodObject<{
|
|
51
69
|
sampleContent: z.ZodBoolean;
|
|
52
70
|
roles: z.ZodArray<z.ZodString>;
|
|
71
|
+
grants: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
53
72
|
options: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodBoolean, z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
73
|
+
settings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
|
|
54
74
|
}, z.core.$strict>>;
|
|
55
75
|
pages: z.ZodObject<{
|
|
56
76
|
liveCount: z.ZodNumber;
|
|
@@ -65,5 +85,31 @@ export declare const PluginInstallRecordSummarySchema: z.ZodObject<{
|
|
|
65
85
|
label: z.ZodString;
|
|
66
86
|
userCount: z.ZodNumber;
|
|
67
87
|
}, z.core.$strip>>;
|
|
88
|
+
leftoverObjects: z.ZodOptional<z.ZodNumber>;
|
|
89
|
+
heldByTemplates: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
90
|
+
id: z.ZodString;
|
|
91
|
+
name: z.ZodString;
|
|
92
|
+
uses: z.ZodArray<z.ZodString>;
|
|
93
|
+
}, z.core.$strip>>>;
|
|
94
|
+
templatesNotListed: z.ZodOptional<z.ZodNumber>;
|
|
95
|
+
templatesScanStopped: z.ZodOptional<z.ZodBoolean>;
|
|
68
96
|
}, z.core.$strip>;
|
|
69
97
|
export type PluginInstallRecordSummary = z.infer<typeof PluginInstallRecordSummarySchema>;
|
|
98
|
+
/** M33 K29: what applying one accepted action offer did. `applied`: the roles holding its target
|
|
99
|
+
* (the administrator left out) now hold it, `roles` naming those that gained it; `not-held`: the
|
|
100
|
+
* caller does not hold the action, so it could not give it and the offer waits; `not-offered`: the
|
|
101
|
+
* installed manifest offers no such action; `not-synced`: the action has no row yet; `failed`: the
|
|
102
|
+
* write failed and was logged. */
|
|
103
|
+
export declare const ACTION_OFFER_OUTCOMES: readonly ["applied", "not-held", "not-offered", "not-synced", "failed"];
|
|
104
|
+
export declare const ActionOfferOutcomeSchema: z.ZodObject<{
|
|
105
|
+
action: z.ZodString;
|
|
106
|
+
outcome: z.ZodEnum<{
|
|
107
|
+
failed: "failed";
|
|
108
|
+
applied: "applied";
|
|
109
|
+
"not-held": "not-held";
|
|
110
|
+
"not-offered": "not-offered";
|
|
111
|
+
"not-synced": "not-synced";
|
|
112
|
+
}>;
|
|
113
|
+
roles: z.ZodArray<z.ZodString>;
|
|
114
|
+
}, z.core.$strip>;
|
|
115
|
+
export type ActionOfferOutcome = z.infer<typeof ActionOfferOutcomeSchema>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { ActionStringSchema } from "./action.schema.js";
|
|
2
3
|
import { ResolvedInstallAnswersSchema } from "./plugin-install.js";
|
|
3
4
|
import { RoleIdSchema } from "./role.schema.js";
|
|
4
5
|
// S293 (2026-10-13-s293-the-wizard-installed-design.md 3.1): what a plugin's
|
|
@@ -15,10 +16,19 @@ export const PluginInstallCreatedSchema = z
|
|
|
15
16
|
mediaIds: z.array(z.string().min(1)),
|
|
16
17
|
/** The offered roles this install created. */
|
|
17
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(),
|
|
18
22
|
})
|
|
19
23
|
.strict();
|
|
20
24
|
export const PluginInstallRecordSchema = z
|
|
21
|
-
.object({
|
|
25
|
+
.object({
|
|
26
|
+
answers: ResolvedInstallAnswersSchema,
|
|
27
|
+
created: PluginInstallCreatedSchema,
|
|
28
|
+
/** M33 K29: the offered actions given to the roles holding their target, at install or by
|
|
29
|
+
* Apply; an offer the manifest makes and this list lacks waits under Plugins, Installed. */
|
|
30
|
+
offersApplied: z.array(ActionStringSchema).optional(),
|
|
31
|
+
})
|
|
22
32
|
.strict();
|
|
23
33
|
/** A fresh `created`, never a shared one. */
|
|
24
34
|
export function emptyInstallCreated() {
|
|
@@ -43,6 +53,18 @@ export const InstallAnswersRefusedSchema = z.object({
|
|
|
43
53
|
});
|
|
44
54
|
/** The most page titles a record summary names. */
|
|
45
55
|
export const INSTALL_RECORD_SUMMARY_TITLES = 20;
|
|
56
|
+
/** M33 K41: before an uninstall the core reads at most this many templates for the plugin's
|
|
57
|
+
* template names, in pages; past it the answer says the scan stopped early. */
|
|
58
|
+
export const UNINSTALL_TEMPLATES_SCANNED_MAX = 2000;
|
|
59
|
+
/** M33 K41: at most this many of the templates found are named; the answer counts the rest. */
|
|
60
|
+
export const UNINSTALL_TEMPLATES_LISTED_MAX = 50;
|
|
61
|
+
/** M33 K41: one template whose source names one of the plugin's full template names (a tag or a
|
|
62
|
+
* filter, by whole name), shaped like a data type's holder: its id and name, and the names it uses. */
|
|
63
|
+
export const TemplateUsingPluginSchema = z.object({
|
|
64
|
+
id: z.string(),
|
|
65
|
+
name: z.string(),
|
|
66
|
+
uses: z.array(z.string()),
|
|
67
|
+
}).meta({ example: { id: "5b0f7a52-3c1e-4c58-9a57-0c7d8f6e2a11", name: "Venue page", uses: ["acme_map"] } });
|
|
46
68
|
/** What the admin is told about a plugin's record (the uninstall dialog, an update). */
|
|
47
69
|
export const PluginInstallRecordSummarySchema = z.object({
|
|
48
70
|
/** Null for a plugin installed before S293. */
|
|
@@ -56,4 +78,22 @@ export const PluginInstallRecordSummarySchema = z.object({
|
|
|
56
78
|
mediaCount: z.number().int().nonnegative(),
|
|
57
79
|
/** The recorded roles that still exist. */
|
|
58
80
|
roles: z.array(z.object({ id: RoleIdSchema, label: z.string(), userCount: z.number().int().nonnegative() })),
|
|
81
|
+
/** M32 F4e (E3): the records of objects the plugin's media stores could not delete; an uninstall removes them. */
|
|
82
|
+
leftoverObjects: z.number().int().nonnegative().optional(),
|
|
83
|
+
/** M33 K41: the site's templates, other than the plugin's own (an uninstall removes those), whose
|
|
84
|
+
* source still names one of its template tags or filters; such a page fails to render once the
|
|
85
|
+
* plugin is gone. Read only: the uninstall changes no template. Sent by the install record read. */
|
|
86
|
+
heldByTemplates: z.array(TemplateUsingPluginSchema).max(UNINSTALL_TEMPLATES_LISTED_MAX).optional(),
|
|
87
|
+
/** M33 K41: how many more templates were found than heldByTemplates names. */
|
|
88
|
+
templatesNotListed: z.number().int().nonnegative().optional(),
|
|
89
|
+
/** M33 K41: true when the scan stopped at UNINSTALL_TEMPLATES_SCANNED_MAX with templates left
|
|
90
|
+
* unread, so not every template was checked. */
|
|
91
|
+
templatesScanStopped: z.boolean().optional().meta({ example: false }),
|
|
59
92
|
});
|
|
93
|
+
/** M33 K29: what applying one accepted action offer did. `applied`: the roles holding its target
|
|
94
|
+
* (the administrator left out) now hold it, `roles` naming those that gained it; `not-held`: the
|
|
95
|
+
* caller does not hold the action, so it could not give it and the offer waits; `not-offered`: the
|
|
96
|
+
* installed manifest offers no such action; `not-synced`: the action has no row yet; `failed`: the
|
|
97
|
+
* write failed and was logged. */
|
|
98
|
+
export const ACTION_OFFER_OUTCOMES = ["applied", "not-held", "not-offered", "not-synced", "failed"];
|
|
99
|
+
export const ActionOfferOutcomeSchema = z.object({ action: ActionStringSchema, outcome: z.enum(ACTION_OFFER_OUTCOMES), roles: z.array(RoleIdSchema) });
|