@kardalum/plugin-sdk 0.18.0 → 0.20.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 +253 -0
- package/README.md +20 -1
- package/dist/admin-section-registry.d.ts +16 -1
- package/dist/admin-section-registry.js +23 -0
- package/dist/assets/asset-picker.js +3 -3
- package/dist/built-in-editor-ids.d.ts +1 -1
- package/dist/built-in-editor-ids.js +2 -20
- package/dist/built-in-serializers.js +1 -1
- package/dist/built-in-settings-schemas.d.ts +10 -0
- package/dist/built-in-settings-schemas.js +90 -4
- package/dist/built-in-value-schemas.js +35 -0
- package/dist/built-ins.js +48 -17
- package/dist/capabilities.d.ts +11 -1
- package/dist/capabilities.js +55 -3
- package/dist/cli.d.ts +66 -0
- package/dist/cli.js +22 -0
- package/dist/content-library.d.ts +85 -0
- package/dist/content-library.js +15 -0
- package/dist/content-picker/page-picker-sheet.d.ts +13 -0
- package/dist/content-picker/page-picker-sheet.js +105 -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 +9 -3
- package/dist/datatype-validation.d.ts +6 -11
- package/dist/datatype-validation.js +141 -3
- package/dist/define-plugin.d.ts +4 -4
- package/dist/define-plugin.js +5 -5
- 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 +36 -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 +1 -1
- package/dist/host-entry.js +1 -1
- package/dist/index.d.ts +38 -4
- package/dist/index.js +54 -3
- package/dist/mail.d.ts +30 -0
- package/dist/mail.js +1 -0
- package/dist/manifest-entry.d.ts +29 -4
- package/dist/manifest-entry.js +39 -2
- package/dist/manifest-schema.d.ts +443 -29
- package/dist/manifest-schema.js +292 -24
- package/dist/manifest.d.ts +450 -51
- package/dist/manifest.js +1 -1
- package/dist/media/media-picker.js +33 -20
- 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 +5 -0
- package/dist/plugin-context.js +3 -3
- package/dist/plugin-screen-context.d.ts +112 -0
- package/dist/plugin-screen-context.js +26 -0
- package/dist/providers.d.ts +268 -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/register-built-ins.js +6 -6
- package/dist/registry.js +1 -1
- package/dist/richtext/block-panel.js +12 -7
- package/dist/richtext/extensions.js +7 -7
- package/dist/richtext/insert-menu.js +12 -9
- package/dist/richtext/style-listbox.js +7 -5
- package/dist/richtext/text-style-class.js +1 -1
- package/dist/sdk-strings.d.ts +285 -0
- package/dist/sdk-strings.js +347 -0
- package/dist/sealing.d.ts +14 -0
- package/dist/sealing.js +1 -0
- package/dist/simple-storage-value-provider.js +27 -27
- package/dist/structured-storage-types.d.ts +309 -9
- package/dist/structured-storage-types.js +2 -2
- package/dist/text-entry.d.ts +1 -0
- package/dist/text-entry.js +6 -0
- package/dist/tokens/tailwind-theme.css +5 -0
- package/dist/tokens/tokens.css +15 -3
- package/dist/tokens/tokens.json +8 -3
- package/dist/ui-entry.js +3 -3
- package/dist/views/asset-view.js +6 -3
- 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 +38 -34
- 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 +9 -6
- 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-code-editor.js +2 -2
- package/dist/views/html-view.js +12 -11
- package/dist/views/image-view.js +40 -22
- 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.js +32 -16
- package/dist/views/suggest-key.d.ts +17 -0
- package/dist/views/suggest-key.js +55 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-connections.schema.d.ts +215 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-connections.schema.js +179 -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-error.schema.js +1 -1
- 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/asset-api.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.d.ts +7 -1
- package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.js +4 -2
- package/node_modules/@kardalum/api-schemas/dist/auth.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/built-in-editor-ids.d.ts +1 -0
- package/node_modules/@kardalum/api-schemas/dist/built-in-editor-ids.js +27 -0
- package/node_modules/@kardalum/api-schemas/dist/capability-detail.d.ts +65 -0
- package/node_modules/@kardalum/api-schemas/dist/capability-detail.js +126 -0
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.d.ts +116 -3
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.js +71 -18
- package/node_modules/@kardalum/api-schemas/dist/content-list.schema.d.ts +57 -2
- package/node_modules/@kardalum/api-schemas/dist/content-list.schema.js +137 -0
- 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-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-trash-api.schema.js +3 -3
- package/node_modules/@kardalum/api-schemas/dist/content-trash.schema.js +1 -1
- 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/core-actions.d.ts +10 -5
- package/node_modules/@kardalum/api-schemas/dist/core-actions.js +7 -4
- 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 +9 -1
- package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.js +4 -4
- 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 +267 -12
- package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +54 -8
- 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 +98 -13
- 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/index.d.ts +122 -43
- package/node_modules/@kardalum/api-schemas/dist/index.js +92 -27
- 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/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/listing-categories.schema.d.ts +46 -0
- package/node_modules/@kardalum/api-schemas/dist/listing-categories.schema.js +52 -0
- package/node_modules/@kardalum/api-schemas/dist/mail-rules.d.ts +224 -0
- package/node_modules/@kardalum/api-schemas/dist/mail-rules.js +404 -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 +359 -8
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +85 -11
- 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 +22 -0
- package/node_modules/@kardalum/api-schemas/dist/media-api.schema.js +22 -10
- 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 +1 -0
- package/node_modules/@kardalum/api-schemas/dist/media.schema.js +9 -5
- 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 +53 -0
- package/node_modules/@kardalum/api-schemas/dist/nested-validation.js +284 -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/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-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 +42 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-content-access.js +74 -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 +26 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-text.js +1 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs.d.ts +26 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs.js +13 -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 +26 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-durable-hooks.js +55 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-editor-extensions.d.ts +40 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-editor-extensions.js +124 -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-held-embeds.d.ts +107 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-held-embeds.js +213 -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 +44 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.js +38 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-install.d.ts +237 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-install.js +205 -6
- 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 +357 -4
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +279 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.d.ts +16 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.js +34 -1
- 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 +22 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.js +31 -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 +310 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-providers.js +430 -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-registry-api.schema.js +1 -1
- 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-settings.d.ts +342 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-settings.js +400 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-site-extensions.d.ts +180 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-site-extensions.js +612 -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 +50 -7
- 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/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-editing.d.ts +4 -4
- package/node_modules/@kardalum/api-schemas/dist/render-editing.js +4 -4
- package/node_modules/@kardalum/api-schemas/dist/render-settings-api.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/revenue-view.schema.js +7 -3
- package/node_modules/@kardalum/api-schemas/dist/rich-text-shape.d.ts +6 -0
- package/node_modules/@kardalum/api-schemas/dist/rich-text-shape.js +82 -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 +497 -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 +91 -1
- package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.d.ts +289 -0
- package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.js +205 -0
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +121 -0
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.js +51 -10
- package/node_modules/@kardalum/api-schemas/dist/sign-in.schema.d.ts +384 -0
- package/node_modules/@kardalum/api-schemas/dist/sign-in.schema.js +616 -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/snapshot.schema.js +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 +66 -0
- package/node_modules/@kardalum/api-schemas/dist/structured-fields.schema.js +160 -0
- package/node_modules/@kardalum/api-schemas/dist/template-api.schema.js +1 -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/theme-api.schema.d.ts +1 -1
- package/node_modules/@kardalum/api-schemas/dist/theme-api.schema.js +1 -1
- 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 +58 -1
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +35 -4
- 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/package.json +1 -0
- package/node_modules/@kardalum/design-tokens/dist/build-css.d.ts +1 -1
- package/node_modules/@kardalum/design-tokens/dist/build-css.js +8 -2
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.css +5 -0
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.d.ts +1 -1
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.js +3 -3
- package/node_modules/@kardalum/design-tokens/dist/theme-css.d.ts +2 -2
- package/node_modules/@kardalum/design-tokens/dist/theme-css.js +2 -2
- package/node_modules/@kardalum/design-tokens/dist/theme-types.d.ts +2 -2
- package/node_modules/@kardalum/design-tokens/dist/themes/dark.d.ts +3 -3
- package/node_modules/@kardalum/design-tokens/dist/themes/dark.js +3 -3
- package/node_modules/@kardalum/design-tokens/dist/themes/light.d.ts +1 -1
- package/node_modules/@kardalum/design-tokens/dist/themes/light.js +1 -1
- package/node_modules/@kardalum/design-tokens/dist/tokens.css +15 -3
- package/node_modules/@kardalum/design-tokens/dist/tokens.d.ts +4 -4
- package/node_modules/@kardalum/design-tokens/dist/tokens.js +17 -8
- package/node_modules/@kardalum/design-tokens/dist/tokens.json +8 -3
- package/node_modules/@kardalum/design-tokens/dist/types.d.ts +2 -2
- package/node_modules/@kardalum/design-tokens/dist/types.js +1 -1
- package/node_modules/@kardalum/plugin-package/dist/build-reference.d.ts +21 -2
- package/node_modules/@kardalum/plugin-package/dist/build-reference.js +8 -2
- package/node_modules/@kardalum/plugin-package/dist/capabilities.d.ts +17 -10
- package/node_modules/@kardalum/plugin-package/dist/capabilities.js +355 -22
- package/node_modules/@kardalum/plugin-package/dist/client-bundle.d.ts +1 -1
- package/node_modules/@kardalum/plugin-package/dist/client-bundle.js +2 -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/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/content-access.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/content-access.js +34 -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 +27 -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/index.d.ts +1 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/index.js +1 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/label-languages.js +47 -5
- 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 +95 -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 +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/providers.js +298 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/registry.js +27 -5
- 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 +140 -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 +36 -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 +10 -0
- package/node_modules/@kardalum/plugin-package/dist/envelope.d.ts +2 -2
- package/node_modules/@kardalum/plugin-package/dist/envelope.js +2 -2
- package/node_modules/@kardalum/plugin-package/dist/extract.d.ts +3 -3
- package/node_modules/@kardalum/plugin-package/dist/extract.js +9 -9
- package/node_modules/@kardalum/plugin-package/dist/hash.d.ts +1 -1
- package/node_modules/@kardalum/plugin-package/dist/hash.js +1 -1
- package/node_modules/@kardalum/plugin-package/dist/index.d.ts +4 -2
- package/node_modules/@kardalum/plugin-package/dist/index.js +2 -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/package-contract.d.ts +2 -2
- package/node_modules/@kardalum/plugin-package/dist/package-contract.js +5 -5
- package/node_modules/@kardalum/plugin-package/dist/types.d.ts +1 -1
- package/node_modules/@kardalum/ui/dist/components/alert-dialog.d.ts +1 -1
- package/node_modules/@kardalum/ui/dist/components/alert-dialog.js +8 -3
- package/node_modules/@kardalum/ui/dist/components/badge.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/button.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/dialog.d.ts +1 -1
- package/node_modules/@kardalum/ui/dist/components/dialog.js +49 -4
- package/node_modules/@kardalum/ui/dist/components/dropdown-menu.d.ts +5 -1
- package/node_modules/@kardalum/ui/dist/components/dropdown-menu.js +18 -5
- package/node_modules/@kardalum/ui/dist/components/empty-state.d.ts +4 -4
- package/node_modules/@kardalum/ui/dist/components/input.js +6 -1
- package/node_modules/@kardalum/ui/dist/components/property-field.js +3 -3
- package/node_modules/@kardalum/ui/dist/components/sheet.d.ts +1 -1
- package/node_modules/@kardalum/ui/dist/components/sheet.js +12 -7
- package/node_modules/@kardalum/ui/dist/components/skeleton.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/switch.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/tab-strip.d.ts +3 -3
- package/node_modules/@kardalum/ui/dist/components/toast.js +4 -3
- package/node_modules/@kardalum/ui/dist/components/tooltip.d.ts +27 -0
- package/node_modules/@kardalum/ui/dist/components/tooltip.js +81 -0
- package/node_modules/@kardalum/ui/dist/components/truncated-text.d.ts +16 -0
- package/node_modules/@kardalum/ui/dist/components/truncated-text.js +95 -0
- package/node_modules/@kardalum/ui/dist/components/use-toast.js +2 -2
- package/node_modules/@kardalum/ui/dist/index.d.ts +3 -1
- package/node_modules/@kardalum/ui/dist/index.js +3 -1
- package/node_modules/@kardalum/ui/dist/lib/menu-host.d.ts +5 -0
- package/node_modules/@kardalum/ui/dist/lib/menu-host.js +17 -0
- package/node_modules/@kardalum/ui/package.json +8 -6
- package/package.json +18 -7
|
@@ -21,20 +21,22 @@ export declare const NOTIFICATION_AUDIENCE_SEARCH_MAX = 20;
|
|
|
21
21
|
export declare const NOTIFICATION_RETENTION_DEFAULT_DAYS = 90;
|
|
22
22
|
export declare const NOTIFICATION_RETENTION_MIN_DAYS = 7;
|
|
23
23
|
export declare const NOTIFICATION_RETENTION_MAX_DAYS = 3650;
|
|
24
|
-
/** `kardalumUpdate` (S314n3, D4): a newer Kardalum is out. */
|
|
25
|
-
export declare const NOTIFICATION_KINDS: readonly ["message", "pluginUpdate", "kardalumUpdate"];
|
|
24
|
+
/** `kardalumUpdate` (S314n3, D4): a newer Kardalum is out. `licence` (M32 I6f): a notice about a plugin licence's end. */
|
|
25
|
+
export declare const NOTIFICATION_KINDS: readonly ["message", "pluginUpdate", "kardalumUpdate", "licence", "plugin"];
|
|
26
26
|
export declare const NotificationKindSchema: z.ZodEnum<{
|
|
27
27
|
message: "message";
|
|
28
|
+
plugin: "plugin";
|
|
28
29
|
pluginUpdate: "pluginUpdate";
|
|
29
30
|
kardalumUpdate: "kardalumUpdate";
|
|
31
|
+
licence: "licence";
|
|
30
32
|
}>;
|
|
31
33
|
export type NotificationKind = z.infer<typeof NotificationKindSchema>;
|
|
32
34
|
/** `system` is Kardalum itself; `plugin` (S314n3) a plugin that declared notifications. */
|
|
33
35
|
export declare const NOTIFICATION_SENDER_KINDS: readonly ["person", "key", "system", "plugin"];
|
|
34
36
|
export declare const NotificationSenderKindSchema: z.ZodEnum<{
|
|
35
37
|
key: "key";
|
|
36
|
-
system: "system";
|
|
37
38
|
plugin: "plugin";
|
|
39
|
+
system: "system";
|
|
38
40
|
person: "person";
|
|
39
41
|
}>;
|
|
40
42
|
export type NotificationSenderKind = z.infer<typeof NotificationSenderKindSchema>;
|
|
@@ -69,6 +71,65 @@ export declare const NotificationLinkInputSchema: z.ZodDiscriminatedUnion<[z.Zod
|
|
|
69
71
|
url: z.ZodURL;
|
|
70
72
|
}, z.core.$strict>], "kind">;
|
|
71
73
|
export type NotificationLinkInput = z.infer<typeof NotificationLinkInputSchema>;
|
|
74
|
+
/** M33 K6: the longest row id a screen link carries. */
|
|
75
|
+
export declare const NOTIFICATION_SCREEN_ITEM_MAX = 100;
|
|
76
|
+
/**
|
|
77
|
+
* M33 K6: a screen link's row id is 1 to 100 ASCII letters, digits, "-" and "_", so it needs
|
|
78
|
+
* no encoding and can never be read as a path, a query or an address. A linear scan with the
|
|
79
|
+
* length checked first; the server applies it to a plugin's send and the admin to the query
|
|
80
|
+
* a screen is opened with.
|
|
81
|
+
*/
|
|
82
|
+
export declare function isNotificationScreenItem(value: unknown): value is string;
|
|
83
|
+
/**
|
|
84
|
+
* M33 K6: a plugin's notification opens one of the plugin's own admin screens, named by its
|
|
85
|
+
* ids, never by an address: its own section (and a rail entry of it), or its entry in a
|
|
86
|
+
* built-in section's rail. The send refuses a screen the plugin does not declare
|
|
87
|
+
* (`unknownTarget`); the inbox resolves it for each reader. Only a plugin's send takes it: the
|
|
88
|
+
* people-to-people sheet keeps its three kinds.
|
|
89
|
+
*/
|
|
90
|
+
export declare const NotificationScreenLinkInputSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
91
|
+
kind: z.ZodLiteral<"screen">;
|
|
92
|
+
section: z.ZodString;
|
|
93
|
+
entry: z.ZodOptional<z.ZodString>;
|
|
94
|
+
item: z.ZodOptional<z.ZodString>;
|
|
95
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
96
|
+
kind: z.ZodLiteral<"screen">;
|
|
97
|
+
builtIn: z.ZodEnum<{
|
|
98
|
+
media: "media";
|
|
99
|
+
content: "content";
|
|
100
|
+
settings: "settings";
|
|
101
|
+
users: "users";
|
|
102
|
+
}>;
|
|
103
|
+
entry: z.ZodString;
|
|
104
|
+
item: z.ZodOptional<z.ZodString>;
|
|
105
|
+
}, z.core.$strict>]>;
|
|
106
|
+
export type NotificationScreenLinkInput = z.infer<typeof NotificationScreenLinkInputSchema>;
|
|
107
|
+
/** M33 K6: what a plugin's send may link: the three kinds of the sheet, or one of its own screens. */
|
|
108
|
+
export declare const PluginNotificationLinkInputSchema: z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
109
|
+
kind: z.ZodLiteral<"none">;
|
|
110
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
111
|
+
kind: z.ZodLiteral<"page">;
|
|
112
|
+
nodeId: z.ZodString;
|
|
113
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
114
|
+
kind: z.ZodLiteral<"url">;
|
|
115
|
+
url: z.ZodURL;
|
|
116
|
+
}, z.core.$strict>], "kind">, z.ZodUnion<readonly [z.ZodObject<{
|
|
117
|
+
kind: z.ZodLiteral<"screen">;
|
|
118
|
+
section: z.ZodString;
|
|
119
|
+
entry: z.ZodOptional<z.ZodString>;
|
|
120
|
+
item: z.ZodOptional<z.ZodString>;
|
|
121
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
122
|
+
kind: z.ZodLiteral<"screen">;
|
|
123
|
+
builtIn: z.ZodEnum<{
|
|
124
|
+
media: "media";
|
|
125
|
+
content: "content";
|
|
126
|
+
settings: "settings";
|
|
127
|
+
users: "users";
|
|
128
|
+
}>;
|
|
129
|
+
entry: z.ZodString;
|
|
130
|
+
item: z.ZodOptional<z.ZodString>;
|
|
131
|
+
}, z.core.$strict>]>]>;
|
|
132
|
+
export type PluginNotificationLinkInput = z.infer<typeof PluginNotificationLinkInputSchema>;
|
|
72
133
|
export declare const NotificationTargetsSchema: z.ZodObject<{
|
|
73
134
|
roles: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
74
135
|
users: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
@@ -119,6 +180,7 @@ export declare const NotificationAudienceQuerySchema: z.ZodObject<{
|
|
|
119
180
|
q: z.ZodOptional<z.ZodString>;
|
|
120
181
|
lang: z.ZodDefault<z.ZodEnum<{
|
|
121
182
|
en: "en";
|
|
183
|
+
ar: "ar";
|
|
122
184
|
de: "de";
|
|
123
185
|
}>>;
|
|
124
186
|
}, z.core.$strip>;
|
|
@@ -180,6 +242,8 @@ export declare const NotificationPageSummarySchema: z.ZodObject<{
|
|
|
180
242
|
path: z.ZodNullable<z.ZodString>;
|
|
181
243
|
}, z.core.$strip>;
|
|
182
244
|
export type NotificationPageSummary = z.infer<typeof NotificationPageSummarySchema>;
|
|
245
|
+
/** M33 K6: a screen link as one reader sees it: `noAccess` names nothing. */
|
|
246
|
+
export declare const NOTIFICATION_SCREEN_STATES: readonly ["open", "noAccess"];
|
|
183
247
|
export declare const NotificationLinkSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
184
248
|
kind: z.ZodLiteral<"none">;
|
|
185
249
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -198,14 +262,21 @@ export declare const NotificationLinkSchema: z.ZodDiscriminatedUnion<[z.ZodObjec
|
|
|
198
262
|
}, z.core.$strip>, z.ZodObject<{
|
|
199
263
|
kind: z.ZodLiteral<"url">;
|
|
200
264
|
url: z.ZodString;
|
|
265
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
266
|
+
kind: z.ZodLiteral<"screen">;
|
|
267
|
+
state: z.ZodEnum<{
|
|
268
|
+
open: "open";
|
|
269
|
+
noAccess: "noAccess";
|
|
270
|
+
}>;
|
|
271
|
+
href: z.ZodNullable<z.ZodString>;
|
|
201
272
|
}, z.core.$strip>], "kind">;
|
|
202
273
|
export type NotificationLink = z.infer<typeof NotificationLinkSchema>;
|
|
203
274
|
/** `name` is null for a person with no name (S314n3, 3e); the admin says "Unnamed person". */
|
|
204
275
|
export declare const NotificationSenderSchema: z.ZodObject<{
|
|
205
276
|
kind: z.ZodEnum<{
|
|
206
277
|
key: "key";
|
|
207
|
-
system: "system";
|
|
208
278
|
plugin: "plugin";
|
|
279
|
+
system: "system";
|
|
209
280
|
person: "person";
|
|
210
281
|
}>;
|
|
211
282
|
name: z.ZodNullable<z.ZodString>;
|
|
@@ -219,12 +290,70 @@ export declare const NotificationPluginUpdateDataSchema: z.ZodObject<{
|
|
|
219
290
|
version: z.ZodString;
|
|
220
291
|
}, z.core.$strip>;
|
|
221
292
|
export type NotificationPluginUpdateData = z.infer<typeof NotificationPluginUpdateDataSchema>;
|
|
222
|
-
/**
|
|
293
|
+
/** M32 B (D21): how many uncovered plugins a Kardalum update notice names. */
|
|
294
|
+
export declare const KARDALUM_UPDATE_UNCOVERED_MAX = 5;
|
|
295
|
+
/** An installed plugin whose cmsVersion range does not include the new Kardalum. */
|
|
296
|
+
export declare const NotificationUncoveredPluginSchema: z.ZodObject<{
|
|
297
|
+
pluginId: z.ZodString;
|
|
298
|
+
pluginName: z.ZodString;
|
|
299
|
+
cmsVersion: z.ZodString;
|
|
300
|
+
}, z.core.$strip>;
|
|
301
|
+
export type NotificationUncoveredPlugin = z.infer<typeof NotificationUncoveredPluginSchema>;
|
|
302
|
+
/** S314n3 (D4): what a Kardalum update notice is about. M32 B: and, when
|
|
303
|
+
* there are any, the installed plugins the new version is outside the range
|
|
304
|
+
* of (at most KARDALUM_UPDATE_UNCOVERED_MAX, with the full count). */
|
|
223
305
|
export declare const NotificationKardalumUpdateDataSchema: z.ZodObject<{
|
|
224
306
|
installedVersion: z.ZodString;
|
|
225
307
|
version: z.ZodString;
|
|
308
|
+
uncoveredPlugins: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
309
|
+
pluginId: z.ZodString;
|
|
310
|
+
pluginName: z.ZodString;
|
|
311
|
+
cmsVersion: z.ZodString;
|
|
312
|
+
}, z.core.$strip>>>;
|
|
313
|
+
uncoveredCount: z.ZodOptional<z.ZodNumber>;
|
|
226
314
|
}, z.core.$strip>;
|
|
227
315
|
export type NotificationKardalumUpdateData = z.infer<typeof NotificationKardalumUpdateDataSchema>;
|
|
316
|
+
/** M32 I6f (S13): the moments a licence notice is sent for. */
|
|
317
|
+
export declare const LICENCE_NOTICE_CASES: readonly ["ending", "ended-off", "read-only", "revoked-off", "no-answer", "grace-off"];
|
|
318
|
+
export type LicenceNoticeCase = (typeof LICENCE_NOTICE_CASES)[number];
|
|
319
|
+
/** M32 I6f (S13): why a licence ended, where the words differ. */
|
|
320
|
+
export declare const LICENCE_NOTICE_CAUSES: readonly ["refunded", "revoked", "blocked"];
|
|
321
|
+
export type LicenceNoticeCause = (typeof LICENCE_NOTICE_CAUSES)[number];
|
|
322
|
+
/** The most plugin names one licence notice lists (a bundle's members, the sign-in plugins). */
|
|
323
|
+
export declare const LICENCE_NOTICE_NAMES_MAX = 200;
|
|
324
|
+
/**
|
|
325
|
+
* M32 I6f (S13): what a licence notice is about, so the admin and the email word it in the
|
|
326
|
+
* reader's language. `date` is a day (YYYY-MM-DD): the term's end, or the switch-off day of a
|
|
327
|
+
* licence that gets no answer. `members` names a bundle's member plugins that the end reaches
|
|
328
|
+
* with it; `signIn` names each plugin whose sign-in stops working; `effect` is what the end of
|
|
329
|
+
* an `ending` term does; `days` is the grace period of a `grace-off`.
|
|
330
|
+
*/
|
|
331
|
+
export declare const NotificationLicenceDataSchema: z.ZodObject<{
|
|
332
|
+
pluginId: z.ZodString;
|
|
333
|
+
pluginName: z.ZodString;
|
|
334
|
+
kase: z.ZodEnum<{
|
|
335
|
+
ending: "ending";
|
|
336
|
+
"ended-off": "ended-off";
|
|
337
|
+
"read-only": "read-only";
|
|
338
|
+
"revoked-off": "revoked-off";
|
|
339
|
+
"no-answer": "no-answer";
|
|
340
|
+
"grace-off": "grace-off";
|
|
341
|
+
}>;
|
|
342
|
+
date: z.ZodNullable<z.ZodString>;
|
|
343
|
+
members: z.ZodArray<z.ZodString>;
|
|
344
|
+
effect: z.ZodOptional<z.ZodEnum<{
|
|
345
|
+
off: "off";
|
|
346
|
+
read_only: "read_only";
|
|
347
|
+
}>>;
|
|
348
|
+
cause: z.ZodOptional<z.ZodEnum<{
|
|
349
|
+
revoked: "revoked";
|
|
350
|
+
refunded: "refunded";
|
|
351
|
+
blocked: "blocked";
|
|
352
|
+
}>>;
|
|
353
|
+
days: z.ZodOptional<z.ZodNumber>;
|
|
354
|
+
signIn: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
355
|
+
}, z.core.$strip>;
|
|
356
|
+
export type NotificationLicenceData = z.infer<typeof NotificationLicenceDataSchema>;
|
|
228
357
|
/** The facts of a system notice, by its kind; null for a message. */
|
|
229
358
|
export declare const NotificationDataSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
230
359
|
pluginId: z.ZodString;
|
|
@@ -234,6 +363,36 @@ export declare const NotificationDataSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
234
363
|
}, z.core.$strip>, z.ZodObject<{
|
|
235
364
|
installedVersion: z.ZodString;
|
|
236
365
|
version: z.ZodString;
|
|
366
|
+
uncoveredPlugins: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
367
|
+
pluginId: z.ZodString;
|
|
368
|
+
pluginName: z.ZodString;
|
|
369
|
+
cmsVersion: z.ZodString;
|
|
370
|
+
}, z.core.$strip>>>;
|
|
371
|
+
uncoveredCount: z.ZodOptional<z.ZodNumber>;
|
|
372
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
373
|
+
pluginId: z.ZodString;
|
|
374
|
+
pluginName: z.ZodString;
|
|
375
|
+
kase: z.ZodEnum<{
|
|
376
|
+
ending: "ending";
|
|
377
|
+
"ended-off": "ended-off";
|
|
378
|
+
"read-only": "read-only";
|
|
379
|
+
"revoked-off": "revoked-off";
|
|
380
|
+
"no-answer": "no-answer";
|
|
381
|
+
"grace-off": "grace-off";
|
|
382
|
+
}>;
|
|
383
|
+
date: z.ZodNullable<z.ZodString>;
|
|
384
|
+
members: z.ZodArray<z.ZodString>;
|
|
385
|
+
effect: z.ZodOptional<z.ZodEnum<{
|
|
386
|
+
off: "off";
|
|
387
|
+
read_only: "read_only";
|
|
388
|
+
}>>;
|
|
389
|
+
cause: z.ZodOptional<z.ZodEnum<{
|
|
390
|
+
revoked: "revoked";
|
|
391
|
+
refunded: "refunded";
|
|
392
|
+
blocked: "blocked";
|
|
393
|
+
}>>;
|
|
394
|
+
days: z.ZodOptional<z.ZodNumber>;
|
|
395
|
+
signIn: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
237
396
|
}, z.core.$strip>]>;
|
|
238
397
|
export type NotificationData = z.infer<typeof NotificationDataSchema>;
|
|
239
398
|
/** One person's copy of a notification. */
|
|
@@ -241,9 +400,12 @@ export declare const NotificationItemSchema: z.ZodObject<{
|
|
|
241
400
|
id: z.ZodString;
|
|
242
401
|
kind: z.ZodEnum<{
|
|
243
402
|
message: "message";
|
|
403
|
+
plugin: "plugin";
|
|
244
404
|
pluginUpdate: "pluginUpdate";
|
|
245
405
|
kardalumUpdate: "kardalumUpdate";
|
|
406
|
+
licence: "licence";
|
|
246
407
|
}>;
|
|
408
|
+
kindId: z.ZodString;
|
|
247
409
|
title: z.ZodString;
|
|
248
410
|
text: z.ZodString;
|
|
249
411
|
link: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -264,12 +426,19 @@ export declare const NotificationItemSchema: z.ZodObject<{
|
|
|
264
426
|
}, z.core.$strip>, z.ZodObject<{
|
|
265
427
|
kind: z.ZodLiteral<"url">;
|
|
266
428
|
url: z.ZodString;
|
|
429
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
430
|
+
kind: z.ZodLiteral<"screen">;
|
|
431
|
+
state: z.ZodEnum<{
|
|
432
|
+
open: "open";
|
|
433
|
+
noAccess: "noAccess";
|
|
434
|
+
}>;
|
|
435
|
+
href: z.ZodNullable<z.ZodString>;
|
|
267
436
|
}, z.core.$strip>], "kind">;
|
|
268
437
|
sender: z.ZodObject<{
|
|
269
438
|
kind: z.ZodEnum<{
|
|
270
439
|
key: "key";
|
|
271
|
-
system: "system";
|
|
272
440
|
plugin: "plugin";
|
|
441
|
+
system: "system";
|
|
273
442
|
person: "person";
|
|
274
443
|
}>;
|
|
275
444
|
name: z.ZodNullable<z.ZodString>;
|
|
@@ -299,6 +468,36 @@ export declare const NotificationItemSchema: z.ZodObject<{
|
|
|
299
468
|
}, z.core.$strip>, z.ZodObject<{
|
|
300
469
|
installedVersion: z.ZodString;
|
|
301
470
|
version: z.ZodString;
|
|
471
|
+
uncoveredPlugins: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
472
|
+
pluginId: z.ZodString;
|
|
473
|
+
pluginName: z.ZodString;
|
|
474
|
+
cmsVersion: z.ZodString;
|
|
475
|
+
}, z.core.$strip>>>;
|
|
476
|
+
uncoveredCount: z.ZodOptional<z.ZodNumber>;
|
|
477
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
478
|
+
pluginId: z.ZodString;
|
|
479
|
+
pluginName: z.ZodString;
|
|
480
|
+
kase: z.ZodEnum<{
|
|
481
|
+
ending: "ending";
|
|
482
|
+
"ended-off": "ended-off";
|
|
483
|
+
"read-only": "read-only";
|
|
484
|
+
"revoked-off": "revoked-off";
|
|
485
|
+
"no-answer": "no-answer";
|
|
486
|
+
"grace-off": "grace-off";
|
|
487
|
+
}>;
|
|
488
|
+
date: z.ZodNullable<z.ZodString>;
|
|
489
|
+
members: z.ZodArray<z.ZodString>;
|
|
490
|
+
effect: z.ZodOptional<z.ZodEnum<{
|
|
491
|
+
off: "off";
|
|
492
|
+
read_only: "read_only";
|
|
493
|
+
}>>;
|
|
494
|
+
cause: z.ZodOptional<z.ZodEnum<{
|
|
495
|
+
revoked: "revoked";
|
|
496
|
+
refunded: "refunded";
|
|
497
|
+
blocked: "blocked";
|
|
498
|
+
}>>;
|
|
499
|
+
days: z.ZodOptional<z.ZodNumber>;
|
|
500
|
+
signIn: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
302
501
|
}, z.core.$strip>]>>;
|
|
303
502
|
createdAt: z.ZodString;
|
|
304
503
|
readAt: z.ZodNullable<z.ZodString>;
|
|
@@ -319,9 +518,12 @@ export declare const NotificationInboxPageSchema: z.ZodObject<{
|
|
|
319
518
|
id: z.ZodString;
|
|
320
519
|
kind: z.ZodEnum<{
|
|
321
520
|
message: "message";
|
|
521
|
+
plugin: "plugin";
|
|
322
522
|
pluginUpdate: "pluginUpdate";
|
|
323
523
|
kardalumUpdate: "kardalumUpdate";
|
|
524
|
+
licence: "licence";
|
|
324
525
|
}>;
|
|
526
|
+
kindId: z.ZodString;
|
|
325
527
|
title: z.ZodString;
|
|
326
528
|
text: z.ZodString;
|
|
327
529
|
link: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -342,12 +544,19 @@ export declare const NotificationInboxPageSchema: z.ZodObject<{
|
|
|
342
544
|
}, z.core.$strip>, z.ZodObject<{
|
|
343
545
|
kind: z.ZodLiteral<"url">;
|
|
344
546
|
url: z.ZodString;
|
|
547
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
548
|
+
kind: z.ZodLiteral<"screen">;
|
|
549
|
+
state: z.ZodEnum<{
|
|
550
|
+
open: "open";
|
|
551
|
+
noAccess: "noAccess";
|
|
552
|
+
}>;
|
|
553
|
+
href: z.ZodNullable<z.ZodString>;
|
|
345
554
|
}, z.core.$strip>], "kind">;
|
|
346
555
|
sender: z.ZodObject<{
|
|
347
556
|
kind: z.ZodEnum<{
|
|
348
557
|
key: "key";
|
|
349
|
-
system: "system";
|
|
350
558
|
plugin: "plugin";
|
|
559
|
+
system: "system";
|
|
351
560
|
person: "person";
|
|
352
561
|
}>;
|
|
353
562
|
name: z.ZodNullable<z.ZodString>;
|
|
@@ -377,6 +586,36 @@ export declare const NotificationInboxPageSchema: z.ZodObject<{
|
|
|
377
586
|
}, z.core.$strip>, z.ZodObject<{
|
|
378
587
|
installedVersion: z.ZodString;
|
|
379
588
|
version: z.ZodString;
|
|
589
|
+
uncoveredPlugins: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
590
|
+
pluginId: z.ZodString;
|
|
591
|
+
pluginName: z.ZodString;
|
|
592
|
+
cmsVersion: z.ZodString;
|
|
593
|
+
}, z.core.$strip>>>;
|
|
594
|
+
uncoveredCount: z.ZodOptional<z.ZodNumber>;
|
|
595
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
596
|
+
pluginId: z.ZodString;
|
|
597
|
+
pluginName: z.ZodString;
|
|
598
|
+
kase: z.ZodEnum<{
|
|
599
|
+
ending: "ending";
|
|
600
|
+
"ended-off": "ended-off";
|
|
601
|
+
"read-only": "read-only";
|
|
602
|
+
"revoked-off": "revoked-off";
|
|
603
|
+
"no-answer": "no-answer";
|
|
604
|
+
"grace-off": "grace-off";
|
|
605
|
+
}>;
|
|
606
|
+
date: z.ZodNullable<z.ZodString>;
|
|
607
|
+
members: z.ZodArray<z.ZodString>;
|
|
608
|
+
effect: z.ZodOptional<z.ZodEnum<{
|
|
609
|
+
off: "off";
|
|
610
|
+
read_only: "read_only";
|
|
611
|
+
}>>;
|
|
612
|
+
cause: z.ZodOptional<z.ZodEnum<{
|
|
613
|
+
revoked: "revoked";
|
|
614
|
+
refunded: "refunded";
|
|
615
|
+
blocked: "blocked";
|
|
616
|
+
}>>;
|
|
617
|
+
days: z.ZodOptional<z.ZodNumber>;
|
|
618
|
+
signIn: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
380
619
|
}, z.core.$strip>]>>;
|
|
381
620
|
createdAt: z.ZodString;
|
|
382
621
|
readAt: z.ZodNullable<z.ZodString>;
|
|
@@ -400,6 +639,18 @@ export declare const NotificationStateSchema: z.ZodObject<{
|
|
|
400
639
|
archivedAt: z.ZodNullable<z.ZodString>;
|
|
401
640
|
}, z.core.$strip>;
|
|
402
641
|
export type NotificationState = z.infer<typeof NotificationStateSchema>;
|
|
642
|
+
/** M32 I (R11): the most archived copies one delete call removes. */
|
|
643
|
+
export declare const ARCHIVED_DELETE_BATCH = 500;
|
|
644
|
+
export declare const DeleteArchivedResponseSchema: z.ZodObject<{
|
|
645
|
+
deleted: z.ZodNumber;
|
|
646
|
+
more: z.ZodBoolean;
|
|
647
|
+
}, z.core.$strip>;
|
|
648
|
+
export type DeleteArchivedResponse = z.infer<typeof DeleteArchivedResponseSchema>;
|
|
649
|
+
export declare const DeleteNotificationCopyResponseSchema: z.ZodObject<{
|
|
650
|
+
deleted: z.ZodLiteral<true>;
|
|
651
|
+
}, z.core.$strip>;
|
|
652
|
+
export type DeleteNotificationCopyResponse = z.infer<typeof DeleteNotificationCopyResponseSchema>;
|
|
653
|
+
export declare const NOT_ARCHIVED_MESSAGE = "Archive the notification before deleting it";
|
|
403
654
|
export declare const NotificationReadAllResponseSchema: z.ZodObject<{
|
|
404
655
|
marked: z.ZodNumber;
|
|
405
656
|
}, z.core.$strip>;
|
|
@@ -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,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
|
+
});
|