@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,461 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { PluginLabelSchema, labelMapSchema, labelTextSchema, labelUnionError } from "./plugin-labels.js";
|
|
3
|
+
import { hasHiddenPluginCharacter } from "./plugin-cli-commands.js";
|
|
4
|
+
import { PLUGIN_ID_MAX, isPluginManifestId } from "./plugin-id-rules.js";
|
|
5
|
+
import { isPluginPublicFilePath } from "./plugin-site-extensions.js";
|
|
6
|
+
// M32 F4 (D1 to D3, D15, D16, D19, D24): the provider point. A plugin adds a choice beside a built-in
|
|
7
|
+
// the core always has (`core`); the site owner picks one per kind in Server settings. The SDK's
|
|
8
|
+
// manifest check, the server's registry and the admin read these rules from one place. Every
|
|
9
|
+
// checker caps the length first and then reads the text in one loop: no pattern meets an author's
|
|
10
|
+
// text, and no message quotes a value.
|
|
11
|
+
/** D1: the kinds of provider. F4b adds "signIn", H adds "mail", M35 P5 adds "consent". */
|
|
12
|
+
export const PROVIDER_KINDS = ["formProtection", "search", "mediaStore", "mail", "consent"];
|
|
13
|
+
/** D1: the `contributions` key each kind is declared under. */
|
|
14
|
+
export const PROVIDER_CONTRIBUTION_KEYS = Object.freeze({
|
|
15
|
+
formProtection: "protectionProviders",
|
|
16
|
+
search: "searchProviders",
|
|
17
|
+
mediaStore: "mediaStores",
|
|
18
|
+
mail: "mailSenders",
|
|
19
|
+
consent: "consentTools",
|
|
20
|
+
});
|
|
21
|
+
/** D1: per kind, the functions a provider entry must have and the ones it may have. */
|
|
22
|
+
export const PROVIDER_FUNCTIONS = Object.freeze({
|
|
23
|
+
formProtection: Object.freeze({ required: Object.freeze(["verify"]), optional: Object.freeze(["widget"]) }),
|
|
24
|
+
search: Object.freeze({ required: Object.freeze(["index", "remove", "query"]), optional: Object.freeze(["clear"]) }),
|
|
25
|
+
mediaStore: Object.freeze({ required: Object.freeze(["put", "open", "delete", "exists"]), optional: Object.freeze(["ready", "publicBaseUrl"]) }),
|
|
26
|
+
mail: Object.freeze({ required: Object.freeze(["send"]), optional: Object.freeze(["ready"]) }),
|
|
27
|
+
// M35 P5 (W37): a consent tool runs in the visitor's browser only; the core writes its files and calls nothing.
|
|
28
|
+
consent: Object.freeze({ required: Object.freeze([]), optional: Object.freeze([]) }),
|
|
29
|
+
});
|
|
30
|
+
/**
|
|
31
|
+
* M32 F4b (D43): sign-in is a table kind, not a choice kind: several sign-in providers are switched
|
|
32
|
+
* on at once, so it stays out of PROVIDER_KINDS (the kinds with one active choice) and the providers
|
|
33
|
+
* table derives every table kind from these lists instead.
|
|
34
|
+
*/
|
|
35
|
+
export const SIGN_IN_PROVIDER_KIND = "signIn";
|
|
36
|
+
/** M35 U3a (D5): a step in the admin sign-in. A table kind too: several steps are switched on at once. */
|
|
37
|
+
export const SIGN_IN_STEP_PROVIDER_KIND = "signInStep";
|
|
38
|
+
export const PROVIDER_TABLE_KINDS = [...PROVIDER_KINDS, SIGN_IN_PROVIDER_KIND, SIGN_IN_STEP_PROVIDER_KIND];
|
|
39
|
+
/** D43: the `contributions` key each table kind is declared under. */
|
|
40
|
+
export const PROVIDER_TABLE_CONTRIBUTION_KEYS = Object.freeze({
|
|
41
|
+
...PROVIDER_CONTRIBUTION_KEYS,
|
|
42
|
+
signIn: "signInProviders",
|
|
43
|
+
signInStep: "signInSteps",
|
|
44
|
+
});
|
|
45
|
+
/** D43: per table kind, the functions an entry must have and may have; a sign-in entry's `profile` is for oauth2 only.
|
|
46
|
+
* M35 U3a: which of a step's optional functions its kind needs is signInStepFunctionsProblem's (sign-in-steps.ts). */
|
|
47
|
+
export const PROVIDER_TABLE_FUNCTIONS = Object.freeze({
|
|
48
|
+
...PROVIDER_FUNCTIONS,
|
|
49
|
+
signIn: Object.freeze({ required: Object.freeze([]), optional: Object.freeze(["profile"]) }),
|
|
50
|
+
signInStep: Object.freeze({
|
|
51
|
+
required: Object.freeze(["status"]),
|
|
52
|
+
optional: Object.freeze(["challenge", "verify", "setupBegin", "setupFinish", "setupRemove"]),
|
|
53
|
+
}),
|
|
54
|
+
});
|
|
55
|
+
/** D2: the built-in provider's key, every kind's default and fallback. */
|
|
56
|
+
export const CORE_PROVIDER_KEY = "core";
|
|
57
|
+
/** D1: the most entries one plugin declares for one kind. */
|
|
58
|
+
export const PROVIDERS_PER_KIND_MAX = 3;
|
|
59
|
+
/** D1: a provider id, 1 to 40 characters. */
|
|
60
|
+
export const PROVIDER_ID_MAX = 40;
|
|
61
|
+
/** D1: a provider's label and description, shown to the site owner. */
|
|
62
|
+
export const PROVIDER_LABEL_MAX = 80;
|
|
63
|
+
export const PROVIDER_DESCRIPTION_MAX = 300;
|
|
64
|
+
/** A provider text as a label (a string, or a map with `en`), each text trimmed and 1 to `max`
|
|
65
|
+
* characters. A fresh instance each call, because the OpenAPI conversion drops a schema instance
|
|
66
|
+
* that a second union reuses (see pluginLabelMapSchema). */
|
|
67
|
+
function providerTextSchema(max) {
|
|
68
|
+
return z.union([labelTextSchema({ max, trim: true }), labelMapSchema({ max, trim: true })], { error: labelUnionError });
|
|
69
|
+
}
|
|
70
|
+
/** D1: a provider entry's label in the manifest schema, at the door's PROVIDER_LABEL_MAX. */
|
|
71
|
+
export function providerLabelSchema() {
|
|
72
|
+
return providerTextSchema(PROVIDER_LABEL_MAX);
|
|
73
|
+
}
|
|
74
|
+
/** D1: a provider entry's description in the manifest schema, at the door's PROVIDER_DESCRIPTION_MAX
|
|
75
|
+
* (a sign-in entry's own is signInDescriptionSchema, narrower). */
|
|
76
|
+
export function providerDescriptionSchema() {
|
|
77
|
+
return providerTextSchema(PROVIDER_DESCRIPTION_MAX);
|
|
78
|
+
}
|
|
79
|
+
/** The longest a stored choice may be: a provider key never comes near it (PLUGIN_ID_MAX + 1 + PROVIDER_ID_MAX). */
|
|
80
|
+
const PROVIDER_CHOICE_MAX = 200;
|
|
81
|
+
/** D15: a protection provider's form field prefix, 3 to 24 characters. */
|
|
82
|
+
export const PROTECTION_FIELD_PREFIX_MIN = 3;
|
|
83
|
+
export const PROTECTION_FIELD_PREFIX_MAX = 24;
|
|
84
|
+
/** D15: the most posted fields under the prefix a provider's `verify` gets, and their total size. */
|
|
85
|
+
export const PROTECTION_FIELDS_MAX = 8;
|
|
86
|
+
export const PROTECTION_FIELDS_BYTES_MAX = 8192;
|
|
87
|
+
/** D16: the most `data-*` attributes a widget's `<div>` carries. */
|
|
88
|
+
export const PROTECTION_WIDGET_DATA_MAX = 10;
|
|
89
|
+
/** M33 K50: the longest `fallbackText` a widget may answer, the visible sentence a visitor reads when its script does not run. */
|
|
90
|
+
export const PROTECTION_WIDGET_FALLBACK_MAX = 300;
|
|
91
|
+
/** D16: the longest widget class name, and the longest `data-*` value, a provider's widget may answer. */
|
|
92
|
+
export const PROTECTION_WIDGET_CLASS_MAX = 64;
|
|
93
|
+
export const PROTECTION_WIDGET_VALUE_MAX = 1000;
|
|
94
|
+
/**
|
|
95
|
+
* M33 K53: the words a form protection provider's refusal may tell the calling plugin (`verify`'s
|
|
96
|
+
* `tell`), so the plugin can show its visitor one fixed sentence. A closed list that only grows; no
|
|
97
|
+
* provider text ever reaches a visitor. `needsScript`: the send came without the check's script's answer.
|
|
98
|
+
* `expired` (D5): the answer was for a challenge whose time had run out, so a fresh send can pass.
|
|
99
|
+
* `unavailable` (D5): the provider could not check at all (its own service did not answer), and says so
|
|
100
|
+
* rather than throwing. A wrong or reused answer carries no word: a sender written to get past the check
|
|
101
|
+
* must learn nothing from its refusal. The core's own `provider_unavailable` (a throw, a timeout, a
|
|
102
|
+
* malformed answer) is the same case as `unavailable`, and a caller answers the two alike.
|
|
103
|
+
*/
|
|
104
|
+
export const PROTECTION_TELL_WORDS = ["needsScript", "expired", "unavailable"];
|
|
105
|
+
/** M33 K53: whether a value is exactly one listed tell word (compared as written, never by a lookup that a prototype name could pass). */
|
|
106
|
+
export function isProtectionTellWord(value) {
|
|
107
|
+
return typeof value === "string" && PROTECTION_TELL_WORDS.some((word) => word === value);
|
|
108
|
+
}
|
|
109
|
+
/** M33 K52: the longest script address `context.protectionWidget()` answers (the asset base and a public/ path). */
|
|
110
|
+
export const PROTECTION_WIDGET_SCRIPT_URL_MAX = 1024;
|
|
111
|
+
const WIDGET_DATA_NAME_MAX = 40;
|
|
112
|
+
/** D19: the most documents one `index` call gets. */
|
|
113
|
+
export const SEARCH_INDEX_BATCH = 100;
|
|
114
|
+
/** D19: the longest `nextCursor` a search provider may answer. */
|
|
115
|
+
export const SEARCH_PROVIDER_CURSOR_MAX = 512;
|
|
116
|
+
/** D23, D24: a provider's cursor is handed to the reader wrapped as `p.<pluginId>/<providerId>.<cursor>`. */
|
|
117
|
+
export const SEARCH_CURSOR_PREFIX = "p.";
|
|
118
|
+
/** D24: the longest wrapped cursor: the prefix, a provider key, ".", and the provider's own cursor. */
|
|
119
|
+
export const PROVIDER_SEARCH_CURSOR_MAX = SEARCH_CURSOR_PREFIX.length + PLUGIN_ID_MAX + 1 + PROVIDER_ID_MAX + 1 + SEARCH_PROVIDER_CURSOR_MAX;
|
|
120
|
+
/** M35 U3a (D5, D9): how long the core waits for each sign-in step call. */
|
|
121
|
+
export const SIGN_IN_STEP_TIME_MS = 5000;
|
|
122
|
+
/** D6: how long the core waits for each provider call, in milliseconds. */
|
|
123
|
+
export const PROVIDER_TIME_MS = Object.freeze({
|
|
124
|
+
protection: 3000,
|
|
125
|
+
searchQuery: 2000,
|
|
126
|
+
searchIndex: 10000,
|
|
127
|
+
mediaPut: 60000,
|
|
128
|
+
mediaOpen: 10000,
|
|
129
|
+
mediaDelete: 10000,
|
|
130
|
+
/** M32 F4e (E1): a media store's `publicBaseUrl`. */
|
|
131
|
+
mediaPublicBase: 2000,
|
|
132
|
+
/** M32 F4b (D33): an oauth2 sign-in provider's `profile`. */
|
|
133
|
+
signInProfile: 5000,
|
|
134
|
+
/** M32 H (H1): a mail sender's `send` and `ready`. */
|
|
135
|
+
mailSend: 30000,
|
|
136
|
+
mailReady: 2000,
|
|
137
|
+
/** M35 U3a (D5, D9): each sign-in step call (the documented limit of evidence 9 holds: a late answer is dropped). */
|
|
138
|
+
signInStepStatus: SIGN_IN_STEP_TIME_MS,
|
|
139
|
+
signInStepChallenge: SIGN_IN_STEP_TIME_MS,
|
|
140
|
+
signInStepVerify: SIGN_IN_STEP_TIME_MS,
|
|
141
|
+
signInStepSetupBegin: SIGN_IN_STEP_TIME_MS,
|
|
142
|
+
signInStepSetupFinish: SIGN_IN_STEP_TIME_MS,
|
|
143
|
+
signInStepSetupRemove: SIGN_IN_STEP_TIME_MS,
|
|
144
|
+
});
|
|
145
|
+
/** M32 F4e (E1): the longest public base a media store may answer. */
|
|
146
|
+
export const STORE_PUBLIC_BASE_MAX = 1024;
|
|
147
|
+
/** M32 F4e (E1): the longest public address built from a base and a key. */
|
|
148
|
+
export const STORE_PUBLIC_URL_MAX = 2048;
|
|
149
|
+
/** M32 F4e (E1): how long the core remembers a store's public base. */
|
|
150
|
+
export const STORE_PUBLIC_BASE_MEMO_MS = 5_000;
|
|
151
|
+
/** The checked base without one trailing "/", or null: https only, no user or password, no query, no fragment, length first. Never throws. */
|
|
152
|
+
export function readStorePublicBase(value) {
|
|
153
|
+
try {
|
|
154
|
+
if (typeof value !== "string" || value.length === 0 || value.length > STORE_PUBLIC_BASE_MAX)
|
|
155
|
+
return null;
|
|
156
|
+
const url = new URL(value);
|
|
157
|
+
if (url.protocol !== "https:" || url.username !== "" || url.password !== "" || url.search !== "" || url.hash !== "")
|
|
158
|
+
return null;
|
|
159
|
+
if (value.includes("?") || value.includes("#"))
|
|
160
|
+
return null;
|
|
161
|
+
const text = url.toString();
|
|
162
|
+
const base = text.endsWith("/") ? text.slice(0, -1) : text;
|
|
163
|
+
return base.length > STORE_PUBLIC_BASE_MAX ? null : base;
|
|
164
|
+
}
|
|
165
|
+
catch {
|
|
166
|
+
return null;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
/** base + "/" + each key segment encodeURIComponent'd, or null past STORE_PUBLIC_URL_MAX. */
|
|
170
|
+
export function storePublicUrl(base, key) {
|
|
171
|
+
try {
|
|
172
|
+
const url = `${base}/${key.split("/").map(encodeURIComponent).join("/")}`;
|
|
173
|
+
return url.length > STORE_PUBLIC_URL_MAX ? null : url;
|
|
174
|
+
}
|
|
175
|
+
catch {
|
|
176
|
+
return null;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
const HYPHEN = 45;
|
|
180
|
+
const UNDERSCORE = 95;
|
|
181
|
+
const DOT = 46;
|
|
182
|
+
const SLASH = 47;
|
|
183
|
+
/** A C0 control character, DEL, or a C1 control character. */
|
|
184
|
+
export function isControlCode(code) {
|
|
185
|
+
return code < 0x20 || code === 0x7f || (code >= 0x80 && code <= 0x9f);
|
|
186
|
+
}
|
|
187
|
+
function isLowerLetter(code) {
|
|
188
|
+
return code >= 97 && code <= 122;
|
|
189
|
+
}
|
|
190
|
+
function isDigit(code) {
|
|
191
|
+
return code >= 48 && code <= 57;
|
|
192
|
+
}
|
|
193
|
+
/** 1 to `max` characters: a-z first, then a-z, 0-9 and `extra`; `extra` last only when `extraLast`. The one loop every name rule here shares. */
|
|
194
|
+
export function isLowerToken(text, max, extra, extraLast) {
|
|
195
|
+
if (text.length === 0 || text.length > max)
|
|
196
|
+
return false;
|
|
197
|
+
if (!isLowerLetter(text.charCodeAt(0)))
|
|
198
|
+
return false;
|
|
199
|
+
if (!extraLast && text.charCodeAt(text.length - 1) === extra)
|
|
200
|
+
return false;
|
|
201
|
+
for (let i = 1; i < text.length; i++) {
|
|
202
|
+
const code = text.charCodeAt(i);
|
|
203
|
+
if (!isLowerLetter(code) && !isDigit(code) && code !== extra)
|
|
204
|
+
return false;
|
|
205
|
+
}
|
|
206
|
+
return true;
|
|
207
|
+
}
|
|
208
|
+
/** D1: a provider's id: a-z first, then a-z, 0-9 and "-", 1 to 40, no "-" last (the action id alphabet). */
|
|
209
|
+
export function isProviderId(id) {
|
|
210
|
+
return isLowerToken(id, PROVIDER_ID_MAX, HYPHEN, false);
|
|
211
|
+
}
|
|
212
|
+
/** D1: a provider's key, `<pluginId>/<id>`. */
|
|
213
|
+
export function providerKey(pluginId, id) {
|
|
214
|
+
return `${pluginId}/${id}`;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* D1: a key split into its plugin id and provider id, or null for `core` and for anything that is
|
|
218
|
+
* not one manifest id, one "/" and one provider id. The length is capped before anything else reads it.
|
|
219
|
+
*/
|
|
220
|
+
export function parseProviderKey(key) {
|
|
221
|
+
if (key.length === 0 || key.length > PLUGIN_ID_MAX + 1 + PROVIDER_ID_MAX)
|
|
222
|
+
return null;
|
|
223
|
+
const slash = key.indexOf("/");
|
|
224
|
+
if (slash <= 0 || key.indexOf("/", slash + 1) !== -1)
|
|
225
|
+
return null;
|
|
226
|
+
const pluginId = key.slice(0, slash);
|
|
227
|
+
const id = key.slice(slash + 1);
|
|
228
|
+
if (!isProviderId(id) || !isPluginManifestId(pluginId))
|
|
229
|
+
return null;
|
|
230
|
+
return { pluginId, id };
|
|
231
|
+
}
|
|
232
|
+
/** D3: a stored choice, `core` or a valid provider key. Whether that provider is attached is the server's check. */
|
|
233
|
+
export const ProviderChoiceSchema = z
|
|
234
|
+
.string()
|
|
235
|
+
.max(PROVIDER_CHOICE_MAX, { message: `A provider choice is at most ${PROVIDER_CHOICE_MAX} characters.` })
|
|
236
|
+
.refine((value) => value === CORE_PROVIDER_KEY || parseProviderKey(value) !== null, {
|
|
237
|
+
message: 'Choose "core" or a provider key such as "com.vendor.plugin/provider".',
|
|
238
|
+
});
|
|
239
|
+
/**
|
|
240
|
+
* D15: a protection provider's field prefix: 3 to 24 of a-z, 0-9 and "_", a letter first and "_"
|
|
241
|
+
* last, never starting "kp". `verify` gets every posted field under it, so a short prefix ("e",
|
|
242
|
+
* "n") would hand a provider the visitor's email or name from every form, and "kp" would hand it
|
|
243
|
+
* the built-in check's own fields (kp_website, kp_token).
|
|
244
|
+
*/
|
|
245
|
+
export function isProtectionFieldPrefix(prefix) {
|
|
246
|
+
if (prefix.length < PROTECTION_FIELD_PREFIX_MIN || !isLowerToken(prefix, PROTECTION_FIELD_PREFIX_MAX, UNDERSCORE, true))
|
|
247
|
+
return false;
|
|
248
|
+
if (prefix.charCodeAt(prefix.length - 1) !== UNDERSCORE)
|
|
249
|
+
return false;
|
|
250
|
+
return prefix.slice(0, 2).toLowerCase() !== "kp";
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* M33 K50: a widget's `fallbackText`, shown to every visitor of the public page: a string of 1 to
|
|
254
|
+
* PROTECTION_WIDGET_FALLBACK_MAX characters, not blank, with no control, direction or other hidden
|
|
255
|
+
* character and no lone surrogate (isProviderText), so the sentence cannot reorder the page's text.
|
|
256
|
+
* One linear scan; the length is checked first.
|
|
257
|
+
*/
|
|
258
|
+
export function isProtectionWidgetFallbackText(text) {
|
|
259
|
+
return typeof text === "string" && isProviderText(text, PROTECTION_WIDGET_FALLBACK_MAX);
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* M33 K51: a protection provider's `widgetScript`: a file of the plugin's own `public/` folder by the
|
|
263
|
+
* one rule (isPluginPublicFilePath) whose name ends ".js" and is more than ".js". The core writes it
|
|
264
|
+
* as `<script src defer>` under the plugin's asset mount, so no origin and no other kind of file.
|
|
265
|
+
*/
|
|
266
|
+
export function isProtectionWidgetScript(path) {
|
|
267
|
+
if (typeof path !== "string" || !isPluginPublicFilePath(path) || !path.endsWith(".js"))
|
|
268
|
+
return false;
|
|
269
|
+
const nameStart = path.lastIndexOf("/") + 1;
|
|
270
|
+
return path.length - nameStart > 3;
|
|
271
|
+
}
|
|
272
|
+
/** M35 P5 (P5-D5): a consent tool's script (".js") or stylesheet (".css"): a file of the plugin's public/ folder by the
|
|
273
|
+
* one rule, with a name before the extension. */
|
|
274
|
+
export function isConsentToolFile(path, extension) {
|
|
275
|
+
if (typeof path !== "string" || !isPluginPublicFilePath(path) || !path.endsWith(extension))
|
|
276
|
+
return false;
|
|
277
|
+
const nameStart = path.lastIndexOf("/") + 1;
|
|
278
|
+
return path.length - nameStart > extension.length;
|
|
279
|
+
}
|
|
280
|
+
/** D16: one CSS class name: 1 to PROTECTION_WIDGET_CLASS_MAX of a-z, A-Z, 0-9, "-" and "_". One linear scan, the length first. */
|
|
281
|
+
export function isProtectionWidgetClass(name) {
|
|
282
|
+
if (typeof name !== "string" || name.length === 0 || name.length > PROTECTION_WIDGET_CLASS_MAX)
|
|
283
|
+
return false;
|
|
284
|
+
for (let i = 0; i < name.length; i++) {
|
|
285
|
+
const code = name.charCodeAt(i);
|
|
286
|
+
const letter = (code >= 97 && code <= 122) || (code >= 65 && code <= 90);
|
|
287
|
+
const digit = code >= 48 && code <= 57;
|
|
288
|
+
if (!letter && !digit && code !== 45 && code !== 95)
|
|
289
|
+
return false;
|
|
290
|
+
}
|
|
291
|
+
return true;
|
|
292
|
+
}
|
|
293
|
+
/** D16: a widget attribute's name, written as `data-<name>`: a-z first, then a-z, 0-9 and "-", 1 to 40. */
|
|
294
|
+
export function isWidgetDataName(name) {
|
|
295
|
+
return isLowerToken(name, WIDGET_DATA_NAME_MAX, HYPHEN, true);
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* M33 K52: what `context.protectionWidget()` answers a front end the site builds itself: the chosen
|
|
299
|
+
* provider's key, its field prefix, the widget's checked parts (the same ones `{% form_protection %}`
|
|
300
|
+
* writes) and its script's address, with `widget` and `script` null when the provider has none.
|
|
301
|
+
* The whole answer is `null` while the built-in check serves alone, so this schema is the non-null shape.
|
|
302
|
+
*/
|
|
303
|
+
export const ProtectionWidgetInfoSchema = z
|
|
304
|
+
.object({
|
|
305
|
+
provider: z
|
|
306
|
+
.string()
|
|
307
|
+
.max(PROVIDER_CHOICE_MAX)
|
|
308
|
+
.refine((key) => parseProviderKey(key) !== null, { message: "A provider key such as \"com.vendor.plugin/provider\"." }),
|
|
309
|
+
fieldPrefix: z.string().refine((prefix) => isProtectionFieldPrefix(prefix), { message: "A protection provider's field prefix." }),
|
|
310
|
+
widget: z
|
|
311
|
+
.object({
|
|
312
|
+
class: z.string().refine((name) => isProtectionWidgetClass(name), { message: "One CSS class name." }).optional(),
|
|
313
|
+
data: z
|
|
314
|
+
.record(z.string().refine((name) => isWidgetDataName(name), { message: "A data attribute name." }), z.string().max(PROTECTION_WIDGET_VALUE_MAX))
|
|
315
|
+
.refine((data) => Object.keys(data).length <= PROTECTION_WIDGET_DATA_MAX, { message: `At most ${PROTECTION_WIDGET_DATA_MAX} data attributes.` })
|
|
316
|
+
.optional(),
|
|
317
|
+
fallbackText: z.string().refine((text) => isProtectionWidgetFallbackText(text), { message: "A visible sentence of 1 to 300 characters." }).optional(),
|
|
318
|
+
})
|
|
319
|
+
.strict()
|
|
320
|
+
.nullable(),
|
|
321
|
+
script: z.string().min(1).max(PROTECTION_WIDGET_SCRIPT_URL_MAX).nullable(),
|
|
322
|
+
})
|
|
323
|
+
.strict();
|
|
324
|
+
/**
|
|
325
|
+
* A label or description a plugin wrote for a person to read (a provider's, a secret's): 1 to `max`
|
|
326
|
+
* UTF-16 units on its raw length, not blank, and no control character, hidden character
|
|
327
|
+
* (`hasHiddenPluginCharacter`) or lone surrogate, so what the reader sees is what was checked.
|
|
328
|
+
*/
|
|
329
|
+
export function isProviderText(text, max) {
|
|
330
|
+
if (text.length === 0 || text.length > max)
|
|
331
|
+
return false;
|
|
332
|
+
if (hasHiddenPluginCharacter(text))
|
|
333
|
+
return false;
|
|
334
|
+
let blank = true;
|
|
335
|
+
for (let i = 0; i < text.length; i++) {
|
|
336
|
+
const code = text.charCodeAt(i);
|
|
337
|
+
if (isControlCode(code))
|
|
338
|
+
return false;
|
|
339
|
+
if (code >= 0xd800 && code <= 0xdbff) {
|
|
340
|
+
const next = i + 1 < text.length ? text.charCodeAt(i + 1) : 0;
|
|
341
|
+
if (next < 0xdc00 || next > 0xdfff)
|
|
342
|
+
return false;
|
|
343
|
+
i++;
|
|
344
|
+
blank = false;
|
|
345
|
+
continue;
|
|
346
|
+
}
|
|
347
|
+
if (code >= 0xdc00 && code <= 0xdfff)
|
|
348
|
+
return false;
|
|
349
|
+
if (code !== 0x20 && code !== 0xa0 && code !== 0x3000 && !(code >= 0x2000 && code <= 0x200a))
|
|
350
|
+
blank = false;
|
|
351
|
+
}
|
|
352
|
+
return !blank;
|
|
353
|
+
}
|
|
354
|
+
/** The first index of `code` in `text` from `from`, looking at most `span` characters, or -1. */
|
|
355
|
+
function indexWithin(text, code, from, span) {
|
|
356
|
+
const end = Math.min(text.length, from + span);
|
|
357
|
+
for (let i = from; i < end; i++)
|
|
358
|
+
if (text.charCodeAt(i) === code)
|
|
359
|
+
return i;
|
|
360
|
+
return -1;
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* D23, D24: a wrapped search cursor split into the provider that issued it (its plugin id and
|
|
364
|
+
* provider id, the provider's whole key, so two plugins' providers of one id never share a cursor)
|
|
365
|
+
* and the provider's own cursor (1 to SEARCH_PROVIDER_CURSOR_MAX characters, no control
|
|
366
|
+
* character), or null. The length is capped before anything reads it, and each separator is looked
|
|
367
|
+
* for only as far as its part may reach. The search answers 400 cursor_expired when the key is not
|
|
368
|
+
* the current choice.
|
|
369
|
+
*/
|
|
370
|
+
export function parseProviderSearchCursor(value) {
|
|
371
|
+
if (value.length > PROVIDER_SEARCH_CURSOR_MAX || !value.startsWith(SEARCH_CURSOR_PREFIX))
|
|
372
|
+
return null;
|
|
373
|
+
const start = SEARCH_CURSOR_PREFIX.length;
|
|
374
|
+
const slash = indexWithin(value, SLASH, start, PLUGIN_ID_MAX + 1);
|
|
375
|
+
if (slash === -1)
|
|
376
|
+
return null;
|
|
377
|
+
const dot = indexWithin(value, DOT, slash + 1, PROVIDER_ID_MAX + 1);
|
|
378
|
+
if (dot === -1)
|
|
379
|
+
return null;
|
|
380
|
+
const pluginId = value.slice(start, slash);
|
|
381
|
+
const providerId = value.slice(slash + 1, dot);
|
|
382
|
+
const cursor = value.slice(dot + 1);
|
|
383
|
+
if (cursor.length === 0 || cursor.length > SEARCH_PROVIDER_CURSOR_MAX)
|
|
384
|
+
return null;
|
|
385
|
+
if (!isProviderId(providerId) || !isPluginManifestId(pluginId))
|
|
386
|
+
return null;
|
|
387
|
+
for (let i = 0; i < cursor.length; i++)
|
|
388
|
+
if (isControlCode(cursor.charCodeAt(i)))
|
|
389
|
+
return null;
|
|
390
|
+
return { pluginId, providerId, cursor };
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* D23: the reader's cursor for a provider's own `nextCursor`, `p.<pluginId>/<providerId>.<cursor>`,
|
|
394
|
+
* or null when the provider key or its cursor is not one `parseProviderSearchCursor` reads back
|
|
395
|
+
* (too long, empty, a control character), so a cursor the core hands out always parses.
|
|
396
|
+
*/
|
|
397
|
+
export function wrapProviderSearchCursor(key, cursor) {
|
|
398
|
+
const parsed = parseProviderKey(key);
|
|
399
|
+
if (parsed === null || typeof cursor !== "string" || cursor.length === 0 || cursor.length > SEARCH_PROVIDER_CURSOR_MAX)
|
|
400
|
+
return null;
|
|
401
|
+
const wrapped = `${SEARCH_CURSOR_PREFIX}${key}.${cursor}`;
|
|
402
|
+
const back = parseProviderSearchCursor(wrapped);
|
|
403
|
+
return back !== null && back.cursor === cursor && back.pluginId === parsed.pluginId && back.providerId === parsed.id ? wrapped : null;
|
|
404
|
+
}
|
|
405
|
+
/** D24: the code a search answers (400) for a wrapped cursor whose provider is not the one serving now. */
|
|
406
|
+
export const SEARCH_CURSOR_EXPIRED_CODE = "cursor_expired";
|
|
407
|
+
export const SearchCursorExpiredErrorSchema = z.object({
|
|
408
|
+
code: z.literal(SEARCH_CURSOR_EXPIRED_CODE),
|
|
409
|
+
message: z.string(),
|
|
410
|
+
});
|
|
411
|
+
/** D24: whether `value` is a wrapped provider search cursor (`parseProviderSearchCursor`). */
|
|
412
|
+
export function isProviderSearchCursor(value) {
|
|
413
|
+
return parseProviderSearchCursor(value) !== null;
|
|
414
|
+
}
|
|
415
|
+
/** One attached provider in the providers answer: its key, its plugin, its label, whether its plugin is
|
|
416
|
+
* switched on, and (M35 U1) whether it was demoted by a failed trust check, so it cannot be chosen. */
|
|
417
|
+
export const ProviderEntrySchema = z.object({
|
|
418
|
+
key: z.string(),
|
|
419
|
+
pluginId: z.string(),
|
|
420
|
+
label: PluginLabelSchema,
|
|
421
|
+
available: z.boolean(),
|
|
422
|
+
demoted: z.boolean(),
|
|
423
|
+
});
|
|
424
|
+
/**
|
|
425
|
+
* M32 F4 (D4): one kind's state. `chosen` is the choice as stored (a provider key, or `core`);
|
|
426
|
+
* `active` is the key serving now, which is `core` when the chosen provider is no longer attached
|
|
427
|
+
* or its plugin is off; `fallsBack` is true then, so the screen can say the choice runs on the core.
|
|
428
|
+
*/
|
|
429
|
+
export const ProviderKindStateSchema = z.object({
|
|
430
|
+
chosen: z.string(),
|
|
431
|
+
active: z.string(),
|
|
432
|
+
fallsBack: z.boolean(),
|
|
433
|
+
entries: z.array(ProviderEntrySchema),
|
|
434
|
+
});
|
|
435
|
+
export const ProvidersResponseSchema = z.object({
|
|
436
|
+
kinds: z.object({
|
|
437
|
+
formProtection: ProviderKindStateSchema,
|
|
438
|
+
search: ProviderKindStateSchema,
|
|
439
|
+
mediaStore: ProviderKindStateSchema,
|
|
440
|
+
mail: ProviderKindStateSchema,
|
|
441
|
+
consent: ProviderKindStateSchema,
|
|
442
|
+
}),
|
|
443
|
+
});
|
|
444
|
+
/**
|
|
445
|
+
* M32 F4 (D22): a search index rebuild's progress, as the `server.searchRebuild` setting row holds
|
|
446
|
+
* it. `after` is the id of the last page sent (the walk goes by path, then id), null before the
|
|
447
|
+
* first batch; `count` the documents sent; `finishedAt` null while it runs or waits to be resumed.
|
|
448
|
+
*/
|
|
449
|
+
export const SearchRebuildProgressSchema = z.object({
|
|
450
|
+
provider: z.string().min(1),
|
|
451
|
+
after: z.string().uuid().nullable(),
|
|
452
|
+
/** The path `after` had when it was read; the walk goes on after (afterPath, after) by value, wherever the page is now. */
|
|
453
|
+
afterPath: z.string().min(1).nullable(),
|
|
454
|
+
count: z.number().int().nonnegative(),
|
|
455
|
+
startedAt: z.string().datetime(),
|
|
456
|
+
finishedAt: z.string().datetime().nullable(),
|
|
457
|
+
});
|
|
458
|
+
/** M32 F4 (D22): `GET` and `POST /providers/search/rebuild`: the rebuild's progress, null when none has run for the chosen provider. */
|
|
459
|
+
export const SearchRebuildResponseSchema = z.object({
|
|
460
|
+
rebuild: SearchRebuildProgressSchema.nullable(),
|
|
461
|
+
});
|
|
@@ -8,6 +8,10 @@ export declare const PluginReadOnlyNoticeSchema: z.ZodObject<{
|
|
|
8
8
|
message: z.ZodString;
|
|
9
9
|
renewUrl: z.ZodOptional<z.ZodString>;
|
|
10
10
|
lapsedAt: z.ZodOptional<z.ZodString>;
|
|
11
|
+
cause: z.ZodOptional<z.ZodEnum<{
|
|
12
|
+
lapsed: "lapsed";
|
|
13
|
+
refunded: "refunded";
|
|
14
|
+
}>>;
|
|
11
15
|
}, z.core.$strip>;
|
|
12
16
|
export type PluginReadOnlyNotice = z.infer<typeof PluginReadOnlyNoticeSchema>;
|
|
13
17
|
export declare function isPluginReadOnlyNotice(value: unknown): value is PluginReadOnlyNotice;
|
|
@@ -17,6 +17,8 @@ export const PluginReadOnlyNoticeSchema = z.object({
|
|
|
17
17
|
renewUrl: z.string().optional(),
|
|
18
18
|
/** The lapsed term's end (ISO). */
|
|
19
19
|
lapsedAt: z.string().optional(),
|
|
20
|
+
/** M32 I6f: why it is read-only; absent reads as lapsed. */
|
|
21
|
+
cause: z.enum(["lapsed", "refunded"]).optional(),
|
|
20
22
|
});
|
|
21
23
|
export function isPluginReadOnlyNotice(value) {
|
|
22
24
|
return PluginReadOnlyNoticeSchema.safeParse(value).success;
|