@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
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { ActionStringSchema } from "./action.schema.js";
|
|
3
3
|
import { HomeCountSchema } from "./home.schema.js";
|
|
4
|
+
import { BUILT_IN_RAIL_SECTIONS, SLOT_ID_MAX } from "./plugin-id-rules.js";
|
|
4
5
|
import { RoleIdSchema } from "./role.schema.js";
|
|
5
6
|
import { ADMIN_LOCALES } from "./user-api.schema.js";
|
|
6
7
|
// S314n2 (2026-10-28-s314n2-user-notifications-design.md): the inbox every signed-in
|
|
@@ -29,8 +30,8 @@ export const NOTIFICATION_AUDIENCE_SEARCH_MAX = 20;
|
|
|
29
30
|
export const NOTIFICATION_RETENTION_DEFAULT_DAYS = 90;
|
|
30
31
|
export const NOTIFICATION_RETENTION_MIN_DAYS = 7;
|
|
31
32
|
export const NOTIFICATION_RETENTION_MAX_DAYS = 3650;
|
|
32
|
-
/** `kardalumUpdate` (S314n3, D4): a newer Kardalum is out. */
|
|
33
|
-
export const NOTIFICATION_KINDS = ["message", "pluginUpdate", "kardalumUpdate"];
|
|
33
|
+
/** `kardalumUpdate` (S314n3, D4): a newer Kardalum is out. `licence` (M32 I6f): a notice about a plugin licence's end. */
|
|
34
|
+
export const NOTIFICATION_KINDS = ["message", "pluginUpdate", "kardalumUpdate", "licence", "plugin"];
|
|
34
35
|
export const NotificationKindSchema = z.enum(NOTIFICATION_KINDS);
|
|
35
36
|
/** `system` is Kardalum itself; `plugin` (S314n3) a plugin that declared notifications. */
|
|
36
37
|
export const NOTIFICATION_SENDER_KINDS = ["person", "key", "system", "plugin"];
|
|
@@ -58,6 +59,48 @@ export const NotificationLinkInputSchema = z.discriminatedUnion("kind", [
|
|
|
58
59
|
z.object({ kind: z.literal("page"), nodeId: z.string().uuid() }).strict(),
|
|
59
60
|
z.object({ kind: z.literal("url"), url: httpsUrl() }).strict(),
|
|
60
61
|
]);
|
|
62
|
+
/** M33 K6: the longest row id a screen link carries. */
|
|
63
|
+
export const NOTIFICATION_SCREEN_ITEM_MAX = 100;
|
|
64
|
+
/**
|
|
65
|
+
* M33 K6: a screen link's row id is 1 to 100 ASCII letters, digits, "-" and "_", so it needs
|
|
66
|
+
* no encoding and can never be read as a path, a query or an address. A linear scan with the
|
|
67
|
+
* length checked first; the server applies it to a plugin's send and the admin to the query
|
|
68
|
+
* a screen is opened with.
|
|
69
|
+
*/
|
|
70
|
+
export function isNotificationScreenItem(value) {
|
|
71
|
+
if (typeof value !== "string")
|
|
72
|
+
return false;
|
|
73
|
+
const length = value.length;
|
|
74
|
+
if (length < 1 || length > NOTIFICATION_SCREEN_ITEM_MAX)
|
|
75
|
+
return false;
|
|
76
|
+
for (let i = 0; i < length; i++) {
|
|
77
|
+
const code = value.charCodeAt(i);
|
|
78
|
+
const allowed = (code >= 48 && code <= 57) || (code >= 65 && code <= 90) || (code >= 97 && code <= 122) || code === 45 || code === 95;
|
|
79
|
+
if (!allowed)
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
return true;
|
|
83
|
+
}
|
|
84
|
+
const screenSlotId = () => z.string().min(1).max(SLOT_ID_MAX);
|
|
85
|
+
/** Bounded here; whether it is a row id a screen can open is the send's check (`unknownTarget`). */
|
|
86
|
+
const screenItem = () => z.string().max(NOTIFICATION_SCREEN_ITEM_MAX, `A row id has at most ${NOTIFICATION_SCREEN_ITEM_MAX} characters.`);
|
|
87
|
+
/**
|
|
88
|
+
* M33 K6: a plugin's notification opens one of the plugin's own admin screens, named by its
|
|
89
|
+
* ids, never by an address: its own section (and a rail entry of it), or its entry in a
|
|
90
|
+
* built-in section's rail. The send refuses a screen the plugin does not declare
|
|
91
|
+
* (`unknownTarget`); the inbox resolves it for each reader. Only a plugin's send takes it: the
|
|
92
|
+
* people-to-people sheet keeps its three kinds.
|
|
93
|
+
*/
|
|
94
|
+
export const NotificationScreenLinkInputSchema = z.union([
|
|
95
|
+
z
|
|
96
|
+
.object({ kind: z.literal("screen"), section: screenSlotId(), entry: screenSlotId().optional(), item: screenItem().optional() })
|
|
97
|
+
.strict(),
|
|
98
|
+
z
|
|
99
|
+
.object({ kind: z.literal("screen"), builtIn: z.enum(BUILT_IN_RAIL_SECTIONS), entry: screenSlotId(), item: screenItem().optional() })
|
|
100
|
+
.strict(),
|
|
101
|
+
]);
|
|
102
|
+
/** M33 K6: what a plugin's send may link: the three kinds of the sheet, or one of its own screens. */
|
|
103
|
+
export const PluginNotificationLinkInputSchema = z.union([NotificationLinkInputSchema, NotificationScreenLinkInputSchema]);
|
|
61
104
|
export const NotificationTargetsSchema = z
|
|
62
105
|
.object({
|
|
63
106
|
roles: z.array(RoleIdSchema).max(NOTIFICATION_ROLES_MAX, `A notification names at most ${NOTIFICATION_ROLES_MAX} roles.`).default([]),
|
|
@@ -129,10 +172,15 @@ export const NotificationPageSummarySchema = z.object({
|
|
|
129
172
|
name: z.string().nullable(),
|
|
130
173
|
path: z.string().nullable(),
|
|
131
174
|
});
|
|
175
|
+
/** M33 K6: a screen link as one reader sees it: `noAccess` names nothing. */
|
|
176
|
+
export const NOTIFICATION_SCREEN_STATES = ["open", "noAccess"];
|
|
132
177
|
export const NotificationLinkSchema = z.discriminatedUnion("kind", [
|
|
133
178
|
z.object({ kind: z.literal("none") }),
|
|
134
179
|
z.object({ kind: z.literal("page"), nodeId: z.string().uuid(), page: NotificationPageSummarySchema }),
|
|
135
180
|
z.object({ kind: z.literal("url"), url: z.string() }),
|
|
181
|
+
/** M33 K6: `href` is the admin path of the plugin's screen, at its row, when this reader may open it now; null for
|
|
182
|
+
* `noAccess` (the reader lacks the screen's actions, the plugin is off, or it no longer declares the screen). */
|
|
183
|
+
z.object({ kind: z.literal("screen"), state: z.enum(NOTIFICATION_SCREEN_STATES), href: z.string().nullable() }),
|
|
136
184
|
]);
|
|
137
185
|
/** `name` is null for a person with no name (S314n3, 3e); the admin says "Unnamed person". */
|
|
138
186
|
export const NotificationSenderSchema = z.object({ kind: NotificationSenderKindSchema, name: z.string().nullable() });
|
|
@@ -143,23 +191,61 @@ export const NotificationPluginUpdateDataSchema = z.object({
|
|
|
143
191
|
installedVersion: z.string(),
|
|
144
192
|
version: z.string(),
|
|
145
193
|
});
|
|
146
|
-
/**
|
|
194
|
+
/** M32 B (D21): how many uncovered plugins a Kardalum update notice names. */
|
|
195
|
+
export const KARDALUM_UPDATE_UNCOVERED_MAX = 5;
|
|
196
|
+
/** An installed plugin whose cmsVersion range does not include the new Kardalum. */
|
|
197
|
+
export const NotificationUncoveredPluginSchema = z.object({
|
|
198
|
+
pluginId: z.string(),
|
|
199
|
+
pluginName: z.string(),
|
|
200
|
+
cmsVersion: z.string(),
|
|
201
|
+
});
|
|
202
|
+
/** S314n3 (D4): what a Kardalum update notice is about. M32 B: and, when
|
|
203
|
+
* there are any, the installed plugins the new version is outside the range
|
|
204
|
+
* of (at most KARDALUM_UPDATE_UNCOVERED_MAX, with the full count). */
|
|
147
205
|
export const NotificationKardalumUpdateDataSchema = z.object({
|
|
148
206
|
installedVersion: z.string(),
|
|
149
207
|
version: z.string(),
|
|
208
|
+
uncoveredPlugins: z.array(NotificationUncoveredPluginSchema).max(KARDALUM_UPDATE_UNCOVERED_MAX).optional(),
|
|
209
|
+
uncoveredCount: z.number().int().nonnegative().optional(),
|
|
210
|
+
});
|
|
211
|
+
/** M32 I6f (S13): the moments a licence notice is sent for. */
|
|
212
|
+
export const LICENCE_NOTICE_CASES = ["ending", "ended-off", "read-only", "revoked-off", "no-answer", "grace-off"];
|
|
213
|
+
/** M32 I6f (S13): why a licence ended, where the words differ. */
|
|
214
|
+
export const LICENCE_NOTICE_CAUSES = ["refunded", "revoked", "blocked"];
|
|
215
|
+
/** The most plugin names one licence notice lists (a bundle's members, the sign-in plugins). */
|
|
216
|
+
export const LICENCE_NOTICE_NAMES_MAX = 200;
|
|
217
|
+
/**
|
|
218
|
+
* M32 I6f (S13): what a licence notice is about, so the admin and the email word it in the
|
|
219
|
+
* reader's language. `date` is a day (YYYY-MM-DD): the term's end, or the switch-off day of a
|
|
220
|
+
* licence that gets no answer. `members` names a bundle's member plugins that the end reaches
|
|
221
|
+
* with it; `signIn` names each plugin whose sign-in stops working; `effect` is what the end of
|
|
222
|
+
* an `ending` term does; `days` is the grace period of a `grace-off`.
|
|
223
|
+
*/
|
|
224
|
+
export const NotificationLicenceDataSchema = z.object({
|
|
225
|
+
pluginId: z.string(),
|
|
226
|
+
pluginName: z.string(),
|
|
227
|
+
kase: z.enum(LICENCE_NOTICE_CASES),
|
|
228
|
+
date: z.string().nullable(),
|
|
229
|
+
members: z.array(z.string()).max(LICENCE_NOTICE_NAMES_MAX),
|
|
230
|
+
effect: z.enum(["read_only", "off"]).optional(),
|
|
231
|
+
cause: z.enum(LICENCE_NOTICE_CAUSES).optional(),
|
|
232
|
+
days: z.number().int().positive().optional(),
|
|
233
|
+
signIn: z.array(z.string()).max(LICENCE_NOTICE_NAMES_MAX).optional(),
|
|
150
234
|
});
|
|
151
235
|
/** The facts of a system notice, by its kind; null for a message. */
|
|
152
|
-
export const NotificationDataSchema = z.union([NotificationPluginUpdateDataSchema, NotificationKardalumUpdateDataSchema]);
|
|
236
|
+
export const NotificationDataSchema = z.union([NotificationPluginUpdateDataSchema, NotificationKardalumUpdateDataSchema, NotificationLicenceDataSchema]);
|
|
153
237
|
/** One person's copy of a notification. */
|
|
154
238
|
export const NotificationItemSchema = z.object({
|
|
155
239
|
id: z.string().uuid(),
|
|
156
240
|
kind: NotificationKindSchema,
|
|
241
|
+
/** M32 G (G2): the kind within its source; a plugin kind is `pluginId/kindId`. */
|
|
242
|
+
kindId: z.string(),
|
|
157
243
|
title: z.string(),
|
|
158
244
|
text: z.string(),
|
|
159
245
|
link: NotificationLinkSchema,
|
|
160
246
|
sender: NotificationSenderSchema,
|
|
161
247
|
audience: NotificationAudienceSchema,
|
|
162
|
-
/** A system notice's facts (a plugin update's
|
|
248
|
+
/** A system notice's facts (a plugin update's, a Kardalum update's or, M32 I6f, a licence notice's); null for a message. `title` and `text` are its English form, for API readers. */
|
|
163
249
|
data: NotificationDataSchema.nullable(),
|
|
164
250
|
createdAt: z.string().datetime(),
|
|
165
251
|
readAt: z.string().datetime().nullable(),
|
|
@@ -185,6 +271,11 @@ export const NotificationStateSchema = z.object({
|
|
|
185
271
|
readAt: z.string().datetime().nullable(),
|
|
186
272
|
archivedAt: z.string().datetime().nullable(),
|
|
187
273
|
});
|
|
274
|
+
/** M32 I (R11): the most archived copies one delete call removes. */
|
|
275
|
+
export const ARCHIVED_DELETE_BATCH = 500;
|
|
276
|
+
export const DeleteArchivedResponseSchema = z.object({ deleted: z.number().int().nonnegative(), more: z.boolean() });
|
|
277
|
+
export const DeleteNotificationCopyResponseSchema = z.object({ deleted: z.literal(true) });
|
|
278
|
+
export const NOT_ARCHIVED_MESSAGE = "Archive the notification before deleting it";
|
|
188
279
|
export const NotificationReadAllResponseSchema = z.object({ marked: z.number().int().min(0) });
|
|
189
280
|
export const NotificationRetentionSchema = z
|
|
190
281
|
.object({
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** A published language of a page and its address. */
|
|
2
|
+
export type PageAddress = {
|
|
3
|
+
culture: string;
|
|
4
|
+
url: string;
|
|
5
|
+
};
|
|
6
|
+
/** A language of the site, with the page's address in it and whether the page is published there
|
|
7
|
+
* (the element of a list that names every language of the site, published or not). */
|
|
8
|
+
export type PageAddressState = PageAddress & {
|
|
9
|
+
published: boolean;
|
|
10
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// M33 K22 (core part 2, task 2.1): a page's address in one language, as a visitor reaches it. The
|
|
2
|
+
// type of the `cultures` on each `listPublishedPages` item and of the published page reader's
|
|
3
|
+
// `addresses`: both list the published languages only, so neither carries a `published` member
|
|
4
|
+
// that would always be true. Every one is made by the visitor URL maker (`createVisitorUrls`), so
|
|
5
|
+
// for a published page the two lists are equal. `url` is a full URL when the site has a domain,
|
|
6
|
+
// else a site path.
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const AUDIENCE_MODES: readonly ["everyone", "signed_in", "groups"];
|
|
3
|
+
export type AudienceMode = (typeof AUDIENCE_MODES)[number];
|
|
4
|
+
/** Live nodes that may carry an entry (the node access bound). */
|
|
5
|
+
export declare const MAX_AUDIENCE_NODES = 1000;
|
|
6
|
+
/** Nodes that may carry an entry, those in the trash included: what one load reads at most. */
|
|
7
|
+
export declare const MAX_AUDIENCE_NODES_WITH_TRASH = 1250;
|
|
8
|
+
export declare const AUDIENCE_GROUPS_MAX = 20;
|
|
9
|
+
/** The most paths (branches and reopenings) one published read's filter carries. */
|
|
10
|
+
export declare const AUDIENCE_FILTER_PATHS_MAX = 1250;
|
|
11
|
+
export declare const PageAudienceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
12
|
+
mode: z.ZodLiteral<"everyone">;
|
|
13
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
14
|
+
mode: z.ZodLiteral<"signed_in">;
|
|
15
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
16
|
+
mode: z.ZodLiteral<"groups">;
|
|
17
|
+
groupIds: z.ZodArray<z.ZodString>;
|
|
18
|
+
}, z.core.$strict>], "mode">;
|
|
19
|
+
export type PageAudience = z.infer<typeof PageAudienceSchema>;
|
|
20
|
+
/** As stored: a groups entry whose every group was deleted keeps the mode with no id, and admits nobody. */
|
|
21
|
+
export declare const StoredPageAudienceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
22
|
+
mode: z.ZodLiteral<"everyone">;
|
|
23
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
24
|
+
mode: z.ZodLiteral<"signed_in">;
|
|
25
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
26
|
+
mode: z.ZodLiteral<"groups">;
|
|
27
|
+
groupIds: z.ZodArray<z.ZodString>;
|
|
28
|
+
}, z.core.$strip>], "mode">;
|
|
29
|
+
/** The one definition of the stored shape: `@kardalum/db-adapter` re-exports this type, it never writes it again. */
|
|
30
|
+
export type StoredPageAudience = z.infer<typeof StoredPageAudienceSchema>;
|
|
31
|
+
export declare function normalGroupIds(ids: readonly string[]): string[];
|
|
32
|
+
export declare const SetPageAudienceRequestSchema: z.ZodObject<{
|
|
33
|
+
audience: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
34
|
+
mode: z.ZodLiteral<"everyone">;
|
|
35
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
36
|
+
mode: z.ZodLiteral<"signed_in">;
|
|
37
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
38
|
+
mode: z.ZodLiteral<"groups">;
|
|
39
|
+
groupIds: z.ZodArray<z.ZodString>;
|
|
40
|
+
}, z.core.$strict>], "mode">>;
|
|
41
|
+
}, z.core.$strict>;
|
|
42
|
+
export declare const PageAudienceResponseSchema: z.ZodObject<{
|
|
43
|
+
nodeId: z.ZodString;
|
|
44
|
+
own: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
45
|
+
mode: z.ZodLiteral<"everyone">;
|
|
46
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
47
|
+
mode: z.ZodLiteral<"signed_in">;
|
|
48
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
49
|
+
mode: z.ZodLiteral<"groups">;
|
|
50
|
+
groupIds: z.ZodArray<z.ZodString>;
|
|
51
|
+
}, z.core.$strip>], "mode">>;
|
|
52
|
+
decidedBy: z.ZodNullable<z.ZodObject<{
|
|
53
|
+
nodeId: z.ZodString;
|
|
54
|
+
path: z.ZodString;
|
|
55
|
+
audience: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
56
|
+
mode: z.ZodLiteral<"everyone">;
|
|
57
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
58
|
+
mode: z.ZodLiteral<"signed_in">;
|
|
59
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
60
|
+
mode: z.ZodLiteral<"groups">;
|
|
61
|
+
groupIds: z.ZodArray<z.ZodString>;
|
|
62
|
+
}, z.core.$strip>], "mode">;
|
|
63
|
+
}, z.core.$strip>>;
|
|
64
|
+
accountsOn: z.ZodBoolean;
|
|
65
|
+
groups: z.ZodArray<z.ZodObject<{
|
|
66
|
+
id: z.ZodString;
|
|
67
|
+
siteId: z.ZodNullable<z.ZodString>;
|
|
68
|
+
key: z.ZodString;
|
|
69
|
+
label: z.ZodPreprocess<z.ZodObject<{
|
|
70
|
+
en: z.ZodString;
|
|
71
|
+
}, z.core.$catchall<z.ZodString>>, unknown>;
|
|
72
|
+
ownerPluginId: z.ZodNullable<z.ZodString>;
|
|
73
|
+
members: z.ZodNumber;
|
|
74
|
+
}, z.core.$strip>>;
|
|
75
|
+
}, z.core.$strip>;
|
|
76
|
+
export type PageAudienceResponse = z.infer<typeof PageAudienceResponseSchema>;
|
|
77
|
+
export declare const AUDIENCE_REFUSAL_REASONS: readonly ["sign_in", "not_included", "unavailable"];
|
|
78
|
+
export type AudienceRefusalReason = (typeof AUDIENCE_REFUSAL_REASONS)[number];
|
|
79
|
+
export declare const AUDIENCE_LIMIT_CODE = "audience_limit";
|
|
80
|
+
export declare const AUDIENCE_GROUP_NOT_OF_SITE_CODE = "group_not_of_site";
|
|
81
|
+
export declare const AudienceConflictSchema: z.ZodObject<{
|
|
82
|
+
code: z.ZodEnum<{
|
|
83
|
+
group_not_of_site: "group_not_of_site";
|
|
84
|
+
audience_limit: "audience_limit";
|
|
85
|
+
}>;
|
|
86
|
+
message: z.ZodString;
|
|
87
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { VisitorGroupSchema } from "./visitor-groups.js";
|
|
3
|
+
// M35 U2b (W8, design 4.12): who may see a page on the public site. An entry is inherited down the tree by
|
|
4
|
+
// the stored path and the nearest one decides (packages/content-service/src/page-audience.ts), so
|
|
5
|
+
// `everyone` reopens a subtree. The adapter keeps the entries (content_node_audiences, migration 0041).
|
|
6
|
+
export const AUDIENCE_MODES = ["everyone", "signed_in", "groups"];
|
|
7
|
+
/** Live nodes that may carry an entry (the node access bound). */
|
|
8
|
+
export const MAX_AUDIENCE_NODES = 1000;
|
|
9
|
+
/** Nodes that may carry an entry, those in the trash included: what one load reads at most. */
|
|
10
|
+
export const MAX_AUDIENCE_NODES_WITH_TRASH = 1250;
|
|
11
|
+
export const AUDIENCE_GROUPS_MAX = 20;
|
|
12
|
+
/** The most paths (branches and reopenings) one published read's filter carries. */
|
|
13
|
+
export const AUDIENCE_FILTER_PATHS_MAX = MAX_AUDIENCE_NODES_WITH_TRASH;
|
|
14
|
+
const GroupId = z.string().max(36).uuid();
|
|
15
|
+
export const PageAudienceSchema = z.discriminatedUnion("mode", [
|
|
16
|
+
z.strictObject({ mode: z.literal("everyone") }),
|
|
17
|
+
z.strictObject({ mode: z.literal("signed_in") }),
|
|
18
|
+
z.strictObject({ mode: z.literal("groups"), groupIds: z.array(GroupId).min(1).max(AUDIENCE_GROUPS_MAX) }),
|
|
19
|
+
]);
|
|
20
|
+
/** As stored: a groups entry whose every group was deleted keeps the mode with no id, and admits nobody. */
|
|
21
|
+
export const StoredPageAudienceSchema = z.discriminatedUnion("mode", [
|
|
22
|
+
z.object({ mode: z.literal("everyone") }),
|
|
23
|
+
z.object({ mode: z.literal("signed_in") }),
|
|
24
|
+
z.object({ mode: z.literal("groups"), groupIds: z.array(z.string()).max(AUDIENCE_GROUPS_MAX) }),
|
|
25
|
+
]);
|
|
26
|
+
export function normalGroupIds(ids) {
|
|
27
|
+
return [...new Set(ids.map((id) => id.toLowerCase()))].sort();
|
|
28
|
+
}
|
|
29
|
+
export const SetPageAudienceRequestSchema = z.strictObject({ audience: PageAudienceSchema.nullable() });
|
|
30
|
+
export const PageAudienceResponseSchema = z.object({
|
|
31
|
+
nodeId: z.string().uuid(),
|
|
32
|
+
/** The page's own entry; null when it inherits. */
|
|
33
|
+
own: StoredPageAudienceSchema.nullable(),
|
|
34
|
+
/** The entry that decides for the page (its own or the nearest above it); null: everyone. */
|
|
35
|
+
decidedBy: z.object({ nodeId: z.string(), path: z.string(), audience: StoredPageAudienceSchema }).nullable(),
|
|
36
|
+
/** Whether the page's site has visitor accounts on. Off, a page that is not for everyone is shown to nobody. */
|
|
37
|
+
accountsOn: z.boolean(),
|
|
38
|
+
/** The groups an entry on this page may name: the site's own and every plugin's. */
|
|
39
|
+
groups: z.array(VisitorGroupSchema),
|
|
40
|
+
});
|
|
41
|
+
export const AUDIENCE_REFUSAL_REASONS = ["sign_in", "not_included", "unavailable"];
|
|
42
|
+
export const AUDIENCE_LIMIT_CODE = "audience_limit";
|
|
43
|
+
export const AUDIENCE_GROUP_NOT_OF_SITE_CODE = "group_not_of_site";
|
|
44
|
+
export const AudienceConflictSchema = z.object({ code: z.enum([AUDIENCE_LIMIT_CODE, AUDIENCE_GROUP_NOT_OF_SITE_CODE]), message: z.string() });
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const PASSWORD_MIN = 8;
|
|
3
|
+
/** bcrypt reads 72 bytes and no more, so a longer password would silently lose its end. */
|
|
4
|
+
export declare const PASSWORD_MAX_BYTES = 72;
|
|
5
|
+
export declare const NewPasswordSchema: z.ZodString;
|
|
6
|
+
export declare const PASSWORD_RESET_TTL_MS = 3600000;
|
|
7
|
+
export declare const PASSWORD_RESETS_PER_ACCOUNT_HOUR = 3;
|
|
8
|
+
/** base64url of 16 and 32 bytes. */
|
|
9
|
+
export declare const RESET_SELECTOR_LENGTH = 22;
|
|
10
|
+
export declare const RESET_VERIFIER_LENGTH = 43;
|
|
11
|
+
/** H14: `<selector>.<verifier>`: length first, one ".", base64url by loop. Never throws. */
|
|
12
|
+
export declare function parseResetToken(value: string): {
|
|
13
|
+
selector: string;
|
|
14
|
+
verifier: string;
|
|
15
|
+
} | null;
|
|
16
|
+
export declare const PasswordResetRequestSchema: z.ZodObject<{
|
|
17
|
+
email: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
18
|
+
}, z.core.$strict>;
|
|
19
|
+
export type PasswordResetRequest = z.infer<typeof PasswordResetRequestSchema>;
|
|
20
|
+
export declare const PasswordResetConfirmSchema: z.ZodObject<{
|
|
21
|
+
token: z.ZodString;
|
|
22
|
+
password: z.ZodString;
|
|
23
|
+
}, z.core.$strict>;
|
|
24
|
+
export type PasswordResetConfirm = z.infer<typeof PasswordResetConfirmSchema>;
|
|
25
|
+
export declare const PASSWORD_RESET_INVALID_CODE = "reset_link_invalid";
|
|
26
|
+
export declare const PASSWORD_RESET_UNAVAILABLE_CODE = "password_reset_unavailable";
|
|
27
|
+
export declare const PasswordResetRefusalSchema: z.ZodObject<{
|
|
28
|
+
code: z.ZodEnum<{
|
|
29
|
+
reset_link_invalid: "reset_link_invalid";
|
|
30
|
+
password_reset_unavailable: "password_reset_unavailable";
|
|
31
|
+
}>;
|
|
32
|
+
message: z.ZodString;
|
|
33
|
+
}, z.core.$strip>;
|
|
34
|
+
export type PasswordResetRefusal = z.infer<typeof PasswordResetRefusalSchema>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { MAIL_ADDRESS_MAX, isMailAddress } from "./mail-rules.js";
|
|
3
|
+
import { lowerAscii } from "./sign-in.schema.js";
|
|
4
|
+
// M32 H (H13 to H16): the password rule every door shares, and the wire shapes of a password reset.
|
|
5
|
+
export const PASSWORD_MIN = 8;
|
|
6
|
+
/** bcrypt reads 72 bytes and no more, so a longer password would silently lose its end. */
|
|
7
|
+
export const PASSWORD_MAX_BYTES = 72;
|
|
8
|
+
export const NewPasswordSchema = z
|
|
9
|
+
.string()
|
|
10
|
+
.min(PASSWORD_MIN, { message: `The password takes at least ${PASSWORD_MIN} characters and at most ${PASSWORD_MAX_BYTES} bytes.` })
|
|
11
|
+
.refine((value) => new TextEncoder().encode(value).length <= PASSWORD_MAX_BYTES, {
|
|
12
|
+
message: `The password takes at least ${PASSWORD_MIN} characters and at most ${PASSWORD_MAX_BYTES} bytes.`,
|
|
13
|
+
});
|
|
14
|
+
export const PASSWORD_RESET_TTL_MS = 3_600_000;
|
|
15
|
+
export const PASSWORD_RESETS_PER_ACCOUNT_HOUR = 3;
|
|
16
|
+
/** base64url of 16 and 32 bytes. */
|
|
17
|
+
export const RESET_SELECTOR_LENGTH = 22;
|
|
18
|
+
export const RESET_VERIFIER_LENGTH = 43;
|
|
19
|
+
function isBase64Url(value) {
|
|
20
|
+
for (let i = 0; i < value.length; i++) {
|
|
21
|
+
const code = value.charCodeAt(i);
|
|
22
|
+
const ok = (code >= 0x30 && code <= 0x39) || (code >= 0x41 && code <= 0x5a) || (code >= 0x61 && code <= 0x7a) || code === 0x2d || code === 0x5f;
|
|
23
|
+
if (!ok)
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
/** H14: `<selector>.<verifier>`: length first, one ".", base64url by loop. Never throws. */
|
|
29
|
+
export function parseResetToken(value) {
|
|
30
|
+
try {
|
|
31
|
+
if (typeof value !== "string" || value.length !== RESET_SELECTOR_LENGTH + 1 + RESET_VERIFIER_LENGTH)
|
|
32
|
+
return null;
|
|
33
|
+
if (value.charCodeAt(RESET_SELECTOR_LENGTH) !== 0x2e)
|
|
34
|
+
return null;
|
|
35
|
+
const selector = value.slice(0, RESET_SELECTOR_LENGTH);
|
|
36
|
+
const verifier = value.slice(RESET_SELECTOR_LENGTH + 1);
|
|
37
|
+
if (!isBase64Url(selector) || !isBase64Url(verifier))
|
|
38
|
+
return null;
|
|
39
|
+
return { selector, verifier };
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
export const PasswordResetRequestSchema = z
|
|
46
|
+
.object({
|
|
47
|
+
email: z
|
|
48
|
+
.string()
|
|
49
|
+
.max(MAIL_ADDRESS_MAX)
|
|
50
|
+
.transform((value) => lowerAscii(value.trim()))
|
|
51
|
+
.refine((value) => isMailAddress(value), { message: "Enter a valid email address." }),
|
|
52
|
+
})
|
|
53
|
+
.strict();
|
|
54
|
+
export const PasswordResetConfirmSchema = z.object({ token: z.string().max(80), password: NewPasswordSchema }).strict();
|
|
55
|
+
export const PASSWORD_RESET_INVALID_CODE = "reset_link_invalid";
|
|
56
|
+
export const PASSWORD_RESET_UNAVAILABLE_CODE = "password_reset_unavailable";
|
|
57
|
+
export const PasswordResetRefusalSchema = z.object({
|
|
58
|
+
code: z.enum([PASSWORD_RESET_INVALID_CODE, PASSWORD_RESET_UNAVAILABLE_CODE]),
|
|
59
|
+
message: z.string(),
|
|
60
|
+
});
|
|
@@ -2,9 +2,19 @@ import { z } from "zod";
|
|
|
2
2
|
export declare const PLAN_KEY_MAX = 64;
|
|
3
3
|
export declare const PLAN_NAME_MAX = 200;
|
|
4
4
|
export declare const PLAN_DESCRIPTION_MAX = 2000;
|
|
5
|
-
/**
|
|
6
|
-
|
|
5
|
+
/** The minimum price of a paid plan (the operator's decision, 2026-11-13:
|
|
6
|
+
* a lower price leaves too little after the payment provider's fee) and a
|
|
7
|
+
* sanity cap. Every sentence that names either reads it from here. */
|
|
8
|
+
export declare const PLAN_MIN_PRICE_CENTS = 500;
|
|
7
9
|
export declare const PLAN_MAX_PRICE_CENTS = 1000000;
|
|
10
|
+
/** A plan price as a sentence names it: US dollars, two decimals and the
|
|
11
|
+
* thousands grouped ("$5.00", "$10,000.00"). Whole cents in, integer
|
|
12
|
+
* arithmetic only. */
|
|
13
|
+
export declare function planPriceText(cents: number): string;
|
|
14
|
+
/** The sentences that name the price limits, built from the constants. */
|
|
15
|
+
export declare const PLAN_PRICE_RANGE_MESSAGE: string;
|
|
16
|
+
export declare const PLAN_MIN_PRICE_MESSAGE: string;
|
|
17
|
+
export declare const PLAN_MAX_PRICE_MESSAGE: string;
|
|
8
18
|
export declare const PLAN_SHAPE_VALUES: readonly ["free", "one_time", "monthly", "yearly"];
|
|
9
19
|
export type PlanShapeValue = (typeof PLAN_SHAPE_VALUES)[number];
|
|
10
20
|
/**
|
|
@@ -13,7 +23,8 @@ export type PlanShapeValue = (typeof PLAN_SHAPE_VALUES)[number];
|
|
|
13
23
|
* scan with the length checked first, never a regex (untrusted text).
|
|
14
24
|
*/
|
|
15
25
|
export declare function isPlanKey(value: string): boolean;
|
|
16
|
-
/** S315 section 3a: a free plan costs 0, every other shape whole cents from
|
|
26
|
+
/** S315 section 3a: a free plan costs 0, every other shape whole cents from
|
|
27
|
+
* PLAN_MIN_PRICE_CENTS to PLAN_MAX_PRICE_CENTS. */
|
|
17
28
|
export declare function planPriceAgrees(shape: string, priceCents: number): boolean;
|
|
18
29
|
export declare const PlanKeySchema: z.ZodString;
|
|
19
30
|
export declare const PlanNameSchema: z.ZodString;
|
|
@@ -24,6 +35,18 @@ export declare const PlanShapeSchema: z.ZodEnum<{
|
|
|
24
35
|
monthly: "monthly";
|
|
25
36
|
yearly: "yearly";
|
|
26
37
|
}>;
|
|
38
|
+
/** S367c (licence terms `seats`): how many sites a plan holds; null is any number. */
|
|
39
|
+
export declare const PLAN_SEATS_MAX = 1000;
|
|
40
|
+
export declare const PlanSeatsSchema: z.ZodNullable<z.ZodNumber>;
|
|
41
|
+
/** The form's Sites field: the box "Any number of sites" wins; otherwise at
|
|
42
|
+
* most 4 characters, every one a digit, read digit by digit. */
|
|
43
|
+
export declare function readSeatsInput(raw: string, any: boolean): {
|
|
44
|
+
ok: true;
|
|
45
|
+
seats: number | null;
|
|
46
|
+
} | {
|
|
47
|
+
ok: false;
|
|
48
|
+
message: string;
|
|
49
|
+
};
|
|
27
50
|
export declare const PlanAddInputSchema: z.ZodObject<{
|
|
28
51
|
listingId: z.ZodString;
|
|
29
52
|
key: z.ZodString;
|
|
@@ -36,6 +59,7 @@ export declare const PlanAddInputSchema: z.ZodObject<{
|
|
|
36
59
|
yearly: "yearly";
|
|
37
60
|
}>;
|
|
38
61
|
priceCents: z.ZodNumber;
|
|
62
|
+
seats: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
39
63
|
}, z.core.$strict>;
|
|
40
64
|
export type PlanAddInput = z.infer<typeof PlanAddInputSchema>;
|
|
41
65
|
/** Name and description always; key, shape and price only while the plan was never held (D4, S315 D8). */
|
|
@@ -51,6 +75,7 @@ export declare const PlanEditInputSchema: z.ZodObject<{
|
|
|
51
75
|
yearly: "yearly";
|
|
52
76
|
}>>;
|
|
53
77
|
priceCents: z.ZodOptional<z.ZodNumber>;
|
|
78
|
+
seats: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
54
79
|
}, z.core.$strict>;
|
|
55
80
|
export type PlanEditInput = z.infer<typeof PlanEditInputSchema>;
|
|
56
81
|
export declare const PlanRefInputSchema: z.ZodObject<{
|
|
@@ -6,9 +6,30 @@ import { z } from "zod";
|
|
|
6
6
|
export const PLAN_KEY_MAX = 64;
|
|
7
7
|
export const PLAN_NAME_MAX = 200;
|
|
8
8
|
export const PLAN_DESCRIPTION_MAX = 2000;
|
|
9
|
-
/**
|
|
10
|
-
|
|
9
|
+
/** The minimum price of a paid plan (the operator's decision, 2026-11-13:
|
|
10
|
+
* a lower price leaves too little after the payment provider's fee) and a
|
|
11
|
+
* sanity cap. Every sentence that names either reads it from here. */
|
|
12
|
+
export const PLAN_MIN_PRICE_CENTS = 500;
|
|
11
13
|
export const PLAN_MAX_PRICE_CENTS = 1_000_000;
|
|
14
|
+
/** A plan price as a sentence names it: US dollars, two decimals and the
|
|
15
|
+
* thousands grouped ("$5.00", "$10,000.00"). Whole cents in, integer
|
|
16
|
+
* arithmetic only. */
|
|
17
|
+
export function planPriceText(cents) {
|
|
18
|
+
const whole = Math.floor(cents / 100);
|
|
19
|
+
const rest = String(cents % 100).padStart(2, "0");
|
|
20
|
+
const digits = String(whole);
|
|
21
|
+
let grouped = "";
|
|
22
|
+
for (let i = 0; i < digits.length; i++) {
|
|
23
|
+
if (i > 0 && (digits.length - i) % 3 === 0)
|
|
24
|
+
grouped += ",";
|
|
25
|
+
grouped += digits[i];
|
|
26
|
+
}
|
|
27
|
+
return `$${grouped}.${rest}`;
|
|
28
|
+
}
|
|
29
|
+
/** The sentences that name the price limits, built from the constants. */
|
|
30
|
+
export const PLAN_PRICE_RANGE_MESSAGE = `A free plan costs 0; any other plan costs from ${planPriceText(PLAN_MIN_PRICE_CENTS)} to ${planPriceText(PLAN_MAX_PRICE_CENTS)}`;
|
|
31
|
+
export const PLAN_MIN_PRICE_MESSAGE = `A paid plan costs at least ${planPriceText(PLAN_MIN_PRICE_CENTS)}`;
|
|
32
|
+
export const PLAN_MAX_PRICE_MESSAGE = `Maximum price is ${planPriceText(PLAN_MAX_PRICE_CENTS)}`;
|
|
12
33
|
export const PLAN_SHAPE_VALUES = ["free", "one_time", "monthly", "yearly"];
|
|
13
34
|
/**
|
|
14
35
|
* A plan key: 1 to 64 characters, lowercase ASCII letters, digits and single
|
|
@@ -32,7 +53,8 @@ export function isPlanKey(value) {
|
|
|
32
53
|
}
|
|
33
54
|
return true;
|
|
34
55
|
}
|
|
35
|
-
/** S315 section 3a: a free plan costs 0, every other shape whole cents from
|
|
56
|
+
/** S315 section 3a: a free plan costs 0, every other shape whole cents from
|
|
57
|
+
* PLAN_MIN_PRICE_CENTS to PLAN_MAX_PRICE_CENTS. */
|
|
36
58
|
export function planPriceAgrees(shape, priceCents) {
|
|
37
59
|
if (!Number.isInteger(priceCents))
|
|
38
60
|
return false;
|
|
@@ -40,7 +62,6 @@ export function planPriceAgrees(shape, priceCents) {
|
|
|
40
62
|
return priceCents === 0;
|
|
41
63
|
return priceCents >= PLAN_MIN_PRICE_CENTS && priceCents <= PLAN_MAX_PRICE_CENTS;
|
|
42
64
|
}
|
|
43
|
-
const PRICE_SHAPE_MESSAGE = "A free plan costs 0; any other plan costs from $1.00 to $10,000.00";
|
|
44
65
|
// A listing or plan id is never validated beyond its length: a wrong one
|
|
45
66
|
// reads as "not found" from the owner-scoped query, like someone else's.
|
|
46
67
|
const RowIdSchema = z.string().min(1).max(64);
|
|
@@ -51,11 +72,36 @@ export const PlanKeySchema = z
|
|
|
51
72
|
export const PlanNameSchema = z.string().trim().min(1, "Give the plan a name").max(PLAN_NAME_MAX, `A plan name is at most ${PLAN_NAME_MAX} characters`);
|
|
52
73
|
export const PlanDescriptionSchema = z.string().trim().max(PLAN_DESCRIPTION_MAX, `A plan description is at most ${PLAN_DESCRIPTION_MAX} characters`);
|
|
53
74
|
export const PlanShapeSchema = z.enum(PLAN_SHAPE_VALUES, "Choose free, one-time, monthly or yearly");
|
|
54
|
-
const PlanCentsSchema = z.number().int().min(0).max(PLAN_MAX_PRICE_CENTS,
|
|
75
|
+
const PlanCentsSchema = z.number().int().min(0).max(PLAN_MAX_PRICE_CENTS, PLAN_MAX_PRICE_MESSAGE);
|
|
76
|
+
/** S367c (licence terms `seats`): how many sites a plan holds; null is any number. */
|
|
77
|
+
export const PLAN_SEATS_MAX = 1000;
|
|
78
|
+
export const PlanSeatsSchema = z
|
|
79
|
+
.number()
|
|
80
|
+
.int("A plan holds a whole number of sites")
|
|
81
|
+
.min(1, "A plan holds at least 1 site")
|
|
82
|
+
.max(PLAN_SEATS_MAX, `A plan holds at most ${PLAN_SEATS_MAX} sites, or any number`)
|
|
83
|
+
.nullable();
|
|
84
|
+
/** The form's Sites field: the box "Any number of sites" wins; otherwise at
|
|
85
|
+
* most 4 characters, every one a digit, read digit by digit. */
|
|
86
|
+
export function readSeatsInput(raw, any) {
|
|
87
|
+
if (any)
|
|
88
|
+
return { ok: true, seats: null };
|
|
89
|
+
const message = `Enter a number of sites from 1 to ${PLAN_SEATS_MAX}, or tick Any number of sites`;
|
|
90
|
+
if (raw.length < 1 || raw.length > 4)
|
|
91
|
+
return { ok: false, message };
|
|
92
|
+
let n = 0;
|
|
93
|
+
for (let i = 0; i < raw.length; i++) {
|
|
94
|
+
const c = raw.charCodeAt(i);
|
|
95
|
+
if (c < 48 || c > 57)
|
|
96
|
+
return { ok: false, message };
|
|
97
|
+
n = n * 10 + (c - 48);
|
|
98
|
+
}
|
|
99
|
+
return n >= 1 && n <= PLAN_SEATS_MAX ? { ok: true, seats: n } : { ok: false, message };
|
|
100
|
+
}
|
|
55
101
|
export const PlanAddInputSchema = z
|
|
56
|
-
.object({ listingId: RowIdSchema, key: PlanKeySchema, name: PlanNameSchema, description: PlanDescriptionSchema, shape: PlanShapeSchema, priceCents: PlanCentsSchema })
|
|
102
|
+
.object({ listingId: RowIdSchema, key: PlanKeySchema, name: PlanNameSchema, description: PlanDescriptionSchema, shape: PlanShapeSchema, priceCents: PlanCentsSchema, seats: PlanSeatsSchema.default(1) })
|
|
57
103
|
.strict()
|
|
58
|
-
.refine((input) => planPriceAgrees(input.shape, input.priceCents), { message:
|
|
104
|
+
.refine((input) => planPriceAgrees(input.shape, input.priceCents), { message: PLAN_PRICE_RANGE_MESSAGE, path: ["priceCents"] });
|
|
59
105
|
/** Name and description always; key, shape and price only while the plan was never held (D4, S315 D8). */
|
|
60
106
|
export const PlanEditInputSchema = z
|
|
61
107
|
.object({
|
|
@@ -65,6 +111,7 @@ export const PlanEditInputSchema = z
|
|
|
65
111
|
key: PlanKeySchema.optional(),
|
|
66
112
|
shape: PlanShapeSchema.optional(),
|
|
67
113
|
priceCents: PlanCentsSchema.optional(),
|
|
114
|
+
seats: PlanSeatsSchema.optional(),
|
|
68
115
|
})
|
|
69
116
|
.strict();
|
|
70
117
|
export const PlanRefInputSchema = z.object({ planId: RowIdSchema }).strict();
|
|
@@ -72,7 +119,7 @@ export const PlanMoveInputSchema = z.object({ planId: RowIdSchema, direction: z.
|
|
|
72
119
|
export const PlanPriceInputSchema = z
|
|
73
120
|
.object({
|
|
74
121
|
planId: RowIdSchema,
|
|
75
|
-
priceCents: z.number().int().min(PLAN_MIN_PRICE_CENTS,
|
|
122
|
+
priceCents: z.number().int().min(PLAN_MIN_PRICE_CENTS, PLAN_MIN_PRICE_MESSAGE).max(PLAN_MAX_PRICE_CENTS, PLAN_MAX_PRICE_MESSAGE),
|
|
76
123
|
})
|
|
77
124
|
.strict();
|
|
78
125
|
/** S321c (spec 3c): a price change's background notices as the plans page
|
|
@@ -4,6 +4,12 @@ export declare const PluginActionDeclarationSchema: z.ZodObject<{
|
|
|
4
4
|
label: z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
|
|
5
5
|
en: z.ZodString;
|
|
6
6
|
}, z.core.$catchall<z.ZodString>>, unknown>]>;
|
|
7
|
+
offerTo: z.ZodOptional<z.ZodEnum<{
|
|
8
|
+
"content.read": "content.read";
|
|
9
|
+
"content.update": "content.update";
|
|
10
|
+
"content.publish": "content.publish";
|
|
11
|
+
"media.read": "media.read";
|
|
12
|
+
}>>;
|
|
7
13
|
}, z.core.$strip>;
|
|
8
14
|
export type PluginActionDeclaration = z.infer<typeof PluginActionDeclarationSchema>;
|
|
9
15
|
/** A role a plugin offers. Never applied unasked: the operator accepts it
|
|
@@ -22,3 +28,9 @@ export declare const OfferedRoleParamsSchema: z.ZodObject<{
|
|
|
22
28
|
roleId: z.ZodString;
|
|
23
29
|
}, z.core.$strip>;
|
|
24
30
|
export type OfferedRoleParams = z.infer<typeof OfferedRoleParamsSchema>;
|
|
31
|
+
/** M33 K29: the Apply route's path: the plugin and the action it offers. */
|
|
32
|
+
export declare const ActionOfferParamsSchema: z.ZodObject<{
|
|
33
|
+
pluginId: z.ZodString;
|
|
34
|
+
action: z.ZodString;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
export type ActionOfferParams = z.infer<typeof ActionOfferParamsSchema>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { ActionStringSchema } from "./action.schema.js";
|
|
3
3
|
import { PluginLabelSchema } from "./plugin-labels.js";
|
|
4
|
+
import { PLUGIN_ACTION_OFFER_TARGETS } from "./plugin-manifest-actions.js";
|
|
4
5
|
import { RoleIdSchema } from "./role.schema.js";
|
|
5
6
|
// S273: what a plugin declares about permissions. These two shapes are the
|
|
6
7
|
// one definition the SDK manifest schema, the marketplace listing and the
|
|
@@ -11,9 +12,15 @@ import { RoleIdSchema } from "./role.schema.js";
|
|
|
11
12
|
// (PluginLabelSchema, the shape a section's label has) or a plain string; the
|
|
12
13
|
// server stores one string per action and per role, the map resolved to the
|
|
13
14
|
// site's default language when the plugin is installed.
|
|
15
|
+
// M33 K29 (SEO 2.16 C7): `offerTo` offers the action to the roles that hold one core action
|
|
16
|
+
// (PLUGIN_ACTION_OFFER_TARGETS). Never applied unasked: a person who holds `roles.update` and the
|
|
17
|
+
// action accepts it at install or later from the installed plugins, and what it adds is ordinary
|
|
18
|
+
// grants, editable in Settings, Roles.
|
|
19
|
+
const OFFER_TARGETS_MESSAGE = `an action is offered to one of ${PLUGIN_ACTION_OFFER_TARGETS.map((target) => `"${target}"`).join(", ")}`;
|
|
14
20
|
export const PluginActionDeclarationSchema = z.object({
|
|
15
21
|
id: ActionStringSchema,
|
|
16
22
|
label: PluginLabelSchema,
|
|
23
|
+
offerTo: z.enum(PLUGIN_ACTION_OFFER_TARGETS, { error: OFFER_TARGETS_MESSAGE }).optional(),
|
|
17
24
|
});
|
|
18
25
|
/** A role a plugin offers. Never applied unasked: the operator accepts it
|
|
19
26
|
* on the install screen or later from the installed-plugins view, and the
|
|
@@ -27,3 +34,9 @@ export const OfferedRoleParamsSchema = z.object({
|
|
|
27
34
|
pluginId: z.string().min(1),
|
|
28
35
|
roleId: RoleIdSchema,
|
|
29
36
|
});
|
|
37
|
+
/** M33 K29: the Apply route's path: the plugin and the action it offers. */
|
|
38
|
+
export const ActionOfferParamsSchema = z.object({
|
|
39
|
+
pluginId: z.string().min(1).meta({ example: "com.example.words" }),
|
|
40
|
+
// A plugin offers only its own action, so the reference's example names one (never a core action).
|
|
41
|
+
action: ActionStringSchema.meta({ example: "com.example.words.panel.view" }),
|
|
42
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type EditorExtensionIssue } from "./plugin-editor-extensions.js";
|
|
2
|
+
export declare const ADMIN_SLOT_PLACES: readonly ["topBar.item", "users.panel", "account.panel", "documentType.panel", "media.panel"];
|
|
3
|
+
export type AdminSlotPlace = (typeof ADMIN_SLOT_PLACES)[number];
|
|
4
|
+
/** The most admin slot entries one plugin may declare. */
|
|
5
|
+
export declare const ADMIN_SLOTS_MAX = 8;
|
|
6
|
+
/** The most entries one plugin may put in one place. */
|
|
7
|
+
export declare const ADMIN_SLOTS_PER_PLACE_MAX = 2;
|
|
8
|
+
/** The shape rules for `adminSlots` beyond label, action and view (the manifest schema checks those). */
|
|
9
|
+
export declare function checkAdminSlotDeclarations(manifest: {
|
|
10
|
+
contributions?: unknown;
|
|
11
|
+
}): EditorExtensionIssue[];
|