@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
|
@@ -2,6 +2,10 @@ import { z } from "zod";
|
|
|
2
2
|
import { ReadOnlyFieldSchema } from "./plugin-read-only.schema.js";
|
|
3
3
|
import { CultureSchema } from "./content-api.schema.js";
|
|
4
4
|
import { MediaVisibilitySchema } from "./media.schema.js";
|
|
5
|
+
import { PROVIDER_SEARCH_CURSOR_MAX, isProviderSearchCursor } from "./plugin-providers.js";
|
|
6
|
+
import { UuidStringSchema } from "./uuid.schema.js";
|
|
7
|
+
import { CONTENT_LIST_FIELD_ID_MAX, isContentListFieldId } from "./content-list.schema.js";
|
|
8
|
+
import { CONTENT_NAME_KEY } from "./content-path.js";
|
|
5
9
|
// Session 112: serializer-contribution output. Keyed by pluginId:
|
|
6
10
|
// structurally separate from core fields and `data`, so a contribution
|
|
7
11
|
// can never remove or overwrite either. Present only when at least one
|
|
@@ -31,7 +35,15 @@ export const PublicContentItemSchema = z.object({
|
|
|
31
35
|
// made from the domain the request named.
|
|
32
36
|
url: z.string().nullable(),
|
|
33
37
|
});
|
|
34
|
-
|
|
38
|
+
/**
|
|
39
|
+
* M32 L (access-2): the longest language tag a delivery read takes in `locale`. A language tag is far shorter; the
|
|
40
|
+
* cap keeps a list from writing an over-long tag into every row's `url`. CultureSchema itself carries no cap, since
|
|
41
|
+
* the management API reads it too.
|
|
42
|
+
*/
|
|
43
|
+
export const CULTURE_TAG_MAX = 64;
|
|
44
|
+
/** M32 L (access-2): `locale` on every content read of the delivery API: a language tag, at most CULTURE_TAG_MAX characters. */
|
|
45
|
+
const PublicCultureSchema = CultureSchema.max(CULTURE_TAG_MAX, `A language tag is at most ${CULTURE_TAG_MAX} characters.`);
|
|
46
|
+
// `locale` mirrors the backoffice contract (content-api.schema), capped at CULTURE_TAG_MAX.
|
|
35
47
|
// `previewToken` (Session 116) is a stateless signed token minted by
|
|
36
48
|
// POST /api/manage/v1/content/:id/preview-token; verified once per request against
|
|
37
49
|
// the FINAL resolved (post-locale) node id (see published-item.ts).
|
|
@@ -39,7 +51,7 @@ export const PublicContentItemQuerySchema = z.object({
|
|
|
39
51
|
// S230: validated as a language tag, identically to the backoffice
|
|
40
52
|
// route. It used to be any string of two or more characters, so a
|
|
41
53
|
// malformed locale reached the data layer instead of being refused.
|
|
42
|
-
locale:
|
|
54
|
+
locale: PublicCultureSchema.optional(),
|
|
43
55
|
format: z.string().regex(/^[a-z0-9.-]+:[a-z0-9-]+$/).optional(),
|
|
44
56
|
previewToken: z.string().optional(),
|
|
45
57
|
});
|
|
@@ -77,13 +89,55 @@ export const PublicContentByAddressQuerySchema = z.object({
|
|
|
77
89
|
// address asked is not the page's one address (a visitor would be sent on
|
|
78
90
|
// to it); `url` is that one address either way.
|
|
79
91
|
export const PublicContentByAddressResponseSchema = PublicContentItemSchema.extend({ redirected: z.boolean() });
|
|
92
|
+
/** M32 L (L2): how many distinct field ids one content list request may name in `fields`. */
|
|
93
|
+
export const PUBLIC_LIST_FIELDS_MAX = 20;
|
|
94
|
+
/** M32 L (L2): the longest `fields` value read: every id at its longest, each with a comma and a space. */
|
|
95
|
+
export const PUBLIC_LIST_FIELDS_TEXT_MAX = PUBLIC_LIST_FIELDS_MAX * (CONTENT_LIST_FIELD_ID_MAX + 2);
|
|
96
|
+
/**
|
|
97
|
+
* M32 L (L2): a content list's `fields` value as its distinct ids, in the order first named, or null when it is not
|
|
98
|
+
* one. Split on a literal comma (never a pattern), each entry trimmed and a blank entry dropped; every id is a field
|
|
99
|
+
* id's form (isContentListFieldId) or the page's name key `_name`; at least one id and at most
|
|
100
|
+
* PUBLIC_LIST_FIELDS_MAX distinct ones.
|
|
101
|
+
*/
|
|
102
|
+
export function parsePublicListFields(raw) {
|
|
103
|
+
if (raw.length > PUBLIC_LIST_FIELDS_TEXT_MAX)
|
|
104
|
+
return null;
|
|
105
|
+
const ids = [];
|
|
106
|
+
for (const entry of raw.split(",")) {
|
|
107
|
+
const id = entry.trim();
|
|
108
|
+
if (id === "")
|
|
109
|
+
continue;
|
|
110
|
+
if (id !== CONTENT_NAME_KEY && !isContentListFieldId(id))
|
|
111
|
+
return null;
|
|
112
|
+
if (ids.includes(id))
|
|
113
|
+
continue;
|
|
114
|
+
ids.push(id);
|
|
115
|
+
if (ids.length > PUBLIC_LIST_FIELDS_MAX)
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
return ids.length === 0 ? null : ids;
|
|
119
|
+
}
|
|
120
|
+
const PUBLIC_LIST_FIELDS_MESSAGE = `Name 1 to ${PUBLIC_LIST_FIELDS_MAX} field ids separated by commas: each a field id (letters, digits and _, starting with a letter, at most ${CONTENT_LIST_FIELD_ID_MAX} characters) or _name; the whole value at most ${PUBLIC_LIST_FIELDS_TEXT_MAX} characters.`;
|
|
121
|
+
// M32 L (L2): a string, so the query string's one value; refined by the reader above, so a route's handler can
|
|
122
|
+
// call parsePublicListFields on a value the schema let through and never get null.
|
|
123
|
+
const PublicListFieldsSchema = z
|
|
124
|
+
.string()
|
|
125
|
+
.max(PUBLIC_LIST_FIELDS_TEXT_MAX, { message: PUBLIC_LIST_FIELDS_MESSAGE, abort: true })
|
|
126
|
+
.refine((value) => parsePublicListFields(value) !== null, { message: PUBLIC_LIST_FIELDS_MESSAGE })
|
|
127
|
+
.describe(`Field ids whose values each row then carries in \`fields\`, separated by commas: a document type field's id of at most ${CONTENT_LIST_FIELD_ID_MAX} characters, or \`_name\` for the page's name; 1 to ${PUBLIC_LIST_FIELDS_MAX}. Each value is what GET /api/v1/content/:id serves for the page in the same language; an id the page has no value for is left out of its row.`);
|
|
128
|
+
// M32 L (L5): the item routes' own language tag, so locale reads alike on every content endpoint.
|
|
129
|
+
const PublicListLocaleSchema = PublicCultureSchema.describe("The language of each row's `fields` and `url`, as `locale` on GET /api/v1/content/:id: an untranslated field falls back to the default language. Without it, the default language.");
|
|
80
130
|
export const PublicContentListQuerySchema = z.object({
|
|
81
131
|
cursor: z.string().uuid().optional(),
|
|
82
132
|
limit: z.coerce.number().int().min(1).max(100).default(50),
|
|
133
|
+
// M32 L (L2, L5): both optional, so a list asked without them answers as before.
|
|
134
|
+
fields: PublicListFieldsSchema.optional(),
|
|
135
|
+
locale: PublicListLocaleSchema.optional(),
|
|
83
136
|
});
|
|
84
|
-
// The tree-walk row:
|
|
85
|
-
//
|
|
86
|
-
// publishedAt is non-nullable by construction
|
|
137
|
+
// The tree-walk row: what a consumer needs to render navigation; field
|
|
138
|
+
// values only when the list is asked for them with `fields` (M32 L), else
|
|
139
|
+
// fetch the full item by id. publishedAt is non-nullable by construction
|
|
140
|
+
// (published-only surface).
|
|
87
141
|
export const PublicContentNodeSummarySchema = z.object({
|
|
88
142
|
id: z.string().uuid(),
|
|
89
143
|
parentId: z.string().uuid().nullable(),
|
|
@@ -92,10 +146,15 @@ export const PublicContentNodeSummarySchema = z.object({
|
|
|
92
146
|
sortOrder: z.number().int(),
|
|
93
147
|
documentTypeId: z.string().uuid(),
|
|
94
148
|
publishedAt: z.string().datetime(),
|
|
95
|
-
// S277e: the page's one address in
|
|
149
|
+
// S277e: the page's one address, in `locale` when a content list was
|
|
150
|
+
// asked with one (M32 L, L5), else in the default language, as on
|
|
96
151
|
// PublicContentItemSchema. `path` stays the stored path, which is what
|
|
97
152
|
// by-path takes; `url` is what a link to the page is made from.
|
|
98
153
|
url: z.string().nullable(),
|
|
154
|
+
// M32 L (L3): only on a row of a list asked with `fields`: each asked id the page's served data holds, in the
|
|
155
|
+
// order asked. A list asked without `fields` has no such member. The example is what a row of
|
|
156
|
+
// `?fields=title` carries, so the generated reference shows a filled row rather than an empty map.
|
|
157
|
+
fields: z.record(z.string(), z.unknown()).meta({ example: { title: "About us" } }).optional(),
|
|
99
158
|
});
|
|
100
159
|
export const PublicContentListResponseSchema = z.object({
|
|
101
160
|
items: z.array(PublicContentNodeSummarySchema),
|
|
@@ -104,8 +163,11 @@ export const PublicContentListResponseSchema = z.object({
|
|
|
104
163
|
// S277e: GET /api/v1/sites. Every published top-level page is a site.
|
|
105
164
|
// `path` is its stored path, `hostnames` its domains in order (the first
|
|
106
165
|
// is its address), `isDefault` whether it is the site a visitor gets on
|
|
107
|
-
// the default address, and `url` its home address in the
|
|
108
|
-
// language, as `url` on a content result
|
|
166
|
+
// the default address, and `url` its home address in the `locale` asked
|
|
167
|
+
// (absent, the default language), as `url` on a content result: null when
|
|
168
|
+
// the site is served in neither (M32 L3). `name` is the `_name` an item read
|
|
169
|
+
// of the site in that language answers, so read from a published version
|
|
170
|
+
// only, never a draft's (L3 fix wave and its follow-up).
|
|
109
171
|
export const PublicSiteSchema = z.object({
|
|
110
172
|
id: z.string().uuid(),
|
|
111
173
|
path: z.string(),
|
|
@@ -114,13 +176,35 @@ export const PublicSiteSchema = z.object({
|
|
|
114
176
|
isDefault: z.boolean(),
|
|
115
177
|
url: z.string().nullable(),
|
|
116
178
|
});
|
|
117
|
-
// Paged as every public list is: the cursor is the id of the last row of
|
|
118
|
-
// the
|
|
119
|
-
|
|
179
|
+
// Paged as every public list is: the cursor is the id of the last row of the page before. Its own object since
|
|
180
|
+
// M32 L (L1): a site row already carries its name and address, so the sites list takes no `fields`. M32 L3: it
|
|
181
|
+
// takes `locale`, the language of each site's `url` and `name`, read as on every content list.
|
|
182
|
+
export const PublicSitesQuerySchema = z.object({
|
|
183
|
+
cursor: z.string().uuid().optional(),
|
|
184
|
+
limit: z.coerce.number().int().min(1).max(100).default(50),
|
|
185
|
+
locale: PublicCultureSchema.describe("The language of each site's `url` (its home in that language, the default language's when the site lacks it) and `name` (the name an item read of the site in that language answers: the default language's published one, else that language's own published one). Without it, the default language.").optional(),
|
|
186
|
+
});
|
|
120
187
|
export const PublicSitesResponseSchema = z.object({
|
|
121
188
|
items: z.array(PublicSiteSchema),
|
|
122
189
|
nextCursor: z.string().nullable(),
|
|
123
190
|
});
|
|
191
|
+
// M32 F4 (D23, D24): a search provider's cursor reaches the reader wrapped as
|
|
192
|
+
// `p.<pluginId>/<providerId>.<cursor>` (plugin-providers.ts holds the rule).
|
|
193
|
+
export { isProviderSearchCursor };
|
|
194
|
+
const SEARCH_CURSOR_MESSAGE = "A cursor is the nextCursor of the page before.";
|
|
195
|
+
// A search cursor is the id of the last row of the page before (the core search) or a wrapped
|
|
196
|
+
// provider cursor (D24: widened from a uuid, pre-v1, no shim).
|
|
197
|
+
const PublicSearchCursorSchema = z
|
|
198
|
+
.string()
|
|
199
|
+
.max(PROVIDER_SEARCH_CURSOR_MAX, { message: SEARCH_CURSOR_MESSAGE })
|
|
200
|
+
.refine((value) => isProviderSearchCursor(value) || UuidStringSchema.safeParse(value).success, { message: SEARCH_CURSOR_MESSAGE })
|
|
201
|
+
.meta({ example: "f47ac10b-58cc-4372-a567-0e02b2c3d479" });
|
|
202
|
+
// GET /api/v1/content's page: its nextCursor is the core search's last id or a wrapped provider
|
|
203
|
+
// cursor (D23), so it is the search cursor's shape rather than a uuid.
|
|
204
|
+
export const PublicContentSearchResponseSchema = z.object({
|
|
205
|
+
items: z.array(PublicContentNodeSummarySchema),
|
|
206
|
+
nextCursor: PublicSearchCursorSchema.nullable(),
|
|
207
|
+
});
|
|
124
208
|
// GET /api/v1/content: combinable filters over the published surface.
|
|
125
209
|
// `under` is a published node's id; the server resolves it to a subtree
|
|
126
210
|
// path filter (strict descendants). q is a case-insensitive substring
|
|
@@ -129,8 +213,12 @@ export const PublicContentSearchQuerySchema = z.object({
|
|
|
129
213
|
documentTypeId: z.string().uuid().optional(),
|
|
130
214
|
under: z.string().uuid().optional(),
|
|
131
215
|
q: z.string().min(2).optional(),
|
|
132
|
-
cursor:
|
|
216
|
+
cursor: PublicSearchCursorSchema.optional(),
|
|
133
217
|
limit: z.coerce.number().int().min(1).max(100).default(50),
|
|
218
|
+
// M32 L (L2, L5): as on the other content lists; `locale` chooses the language of `fields` and `url` and does
|
|
219
|
+
// not change what `q` matches.
|
|
220
|
+
fields: PublicListFieldsSchema.optional(),
|
|
221
|
+
locale: PublicListLocaleSchema.optional(),
|
|
134
222
|
});
|
|
135
223
|
// Public media (Month 9, Session 105). downloadUrl is the stable app path
|
|
136
224
|
// (S186c §3) made ABSOLUTE (S186c Task 3, mandate 1: this surface is
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const REFUND_REASON_MAX = 2000;
|
|
3
|
+
export declare const REFUND_NOTE_MAX = 1000;
|
|
4
|
+
export declare const WITHDRAWAL_NAME_MAX = 200;
|
|
5
|
+
export declare const REFUND_STATES: readonly ["open", "author-pending", "approved", "refunding", "refunded", "failed", "declined", "withdrawn"];
|
|
6
|
+
export type RefundState = (typeof REFUND_STATES)[number];
|
|
7
|
+
export declare const REFUND_DECIDERS: readonly ["promise", "author", "kardalum", "setting"];
|
|
8
|
+
export type RefundDecider = (typeof REFUND_DECIDERS)[number];
|
|
9
|
+
/** An invoice number is matched upper-cased and stored as entered; a key is matched as it is. */
|
|
10
|
+
export declare function referenceForMatch(reference: string): string;
|
|
11
|
+
/** The portal's "Ask for a refund" (D18). */
|
|
12
|
+
export declare const RefundAskInputSchema: z.ZodObject<{
|
|
13
|
+
licenseId: z.ZodString;
|
|
14
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
15
|
+
}, z.core.$strict>;
|
|
16
|
+
export type RefundAskInput = z.infer<typeof RefundAskInputSchema>;
|
|
17
|
+
/** The buyer's Withdraw of an open or pending request (D4). */
|
|
18
|
+
export declare const RefundWithdrawInputSchema: z.ZodObject<{
|
|
19
|
+
requestId: z.ZodString;
|
|
20
|
+
}, z.core.$strict>;
|
|
21
|
+
/** The author's answer on the cases page (D4): a decline needs a note, which the buyer's email names. */
|
|
22
|
+
export declare const AuthorRefundDecisionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
23
|
+
decision: z.ZodLiteral<"agree">;
|
|
24
|
+
requestId: z.ZodString;
|
|
25
|
+
note: z.ZodOptional<z.ZodString>;
|
|
26
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
27
|
+
decision: z.ZodLiteral<"decline">;
|
|
28
|
+
requestId: z.ZodString;
|
|
29
|
+
note: z.ZodString;
|
|
30
|
+
}, z.core.$strict>], "decision">;
|
|
31
|
+
export type AuthorRefundDecision = z.infer<typeof AuthorRefundDecisionSchema>;
|
|
32
|
+
/** M32 I6b (G9): the most a person's partial refund may name, one million dollars. */
|
|
33
|
+
export declare const REFUND_AMOUNT_MAX_CENTS = 100000000;
|
|
34
|
+
/** M32 I6b (G9): a person's dollar amount ("12", "12.3", "12.34") as whole
|
|
35
|
+
* cents, or null. A linear scan: digits, at most one point, at most two
|
|
36
|
+
* decimals, at most nine whole digits, at least one cent. */
|
|
37
|
+
export declare function centsFromDollarText(text: string): number | null;
|
|
38
|
+
/** A person's actions on the operator's refunds list (D4, D13): a decision
|
|
39
|
+
* in the author's place carries the reasons; Finish the refund retries; Close with a note ends an owed sale a person finished outside. */
|
|
40
|
+
export declare const OperatorRefundActionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
41
|
+
action: z.ZodLiteral<"refund">;
|
|
42
|
+
requestId: z.ZodString;
|
|
43
|
+
note: z.ZodString;
|
|
44
|
+
amountCents: z.ZodOptional<z.ZodNumber>;
|
|
45
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
46
|
+
action: z.ZodLiteral<"decline">;
|
|
47
|
+
requestId: z.ZodString;
|
|
48
|
+
note: z.ZodString;
|
|
49
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
50
|
+
action: z.ZodLiteral<"refund-anyway">;
|
|
51
|
+
requestId: z.ZodString;
|
|
52
|
+
note: z.ZodString;
|
|
53
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
54
|
+
action: z.ZodLiteral<"close">;
|
|
55
|
+
requestId: z.ZodString;
|
|
56
|
+
note: z.ZodString;
|
|
57
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
58
|
+
action: z.ZodLiteral<"finish">;
|
|
59
|
+
requestId: z.ZodString;
|
|
60
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
61
|
+
action: z.ZodLiteral<"finish-owed">;
|
|
62
|
+
purchaseId: z.ZodString;
|
|
63
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
64
|
+
action: z.ZodLiteral<"close-owed">;
|
|
65
|
+
purchaseId: z.ZodString;
|
|
66
|
+
note: z.ZodString;
|
|
67
|
+
markedAt: z.ZodString;
|
|
68
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
69
|
+
action: z.ZodLiteral<"close-outside">;
|
|
70
|
+
purchaseId: z.ZodString;
|
|
71
|
+
note: z.ZodString;
|
|
72
|
+
markedAt: z.ZodString;
|
|
73
|
+
markedId: z.ZodString;
|
|
74
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
75
|
+
action: z.ZodLiteral<"close-corrections">;
|
|
76
|
+
purchaseId: z.ZodString;
|
|
77
|
+
note: z.ZodString;
|
|
78
|
+
reachedCents: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
79
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
80
|
+
action: z.ZodLiteral<"correct-deduction">;
|
|
81
|
+
purchaseId: z.ZodString;
|
|
82
|
+
note: z.ZodString;
|
|
83
|
+
nonce: z.ZodString;
|
|
84
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
85
|
+
action: z.ZodLiteral<"check-corrections">;
|
|
86
|
+
purchaseId: z.ZodString;
|
|
87
|
+
}, z.core.$strict>], "action">;
|
|
88
|
+
export type OperatorRefundAction = z.infer<typeof OperatorRefundActionSchema>;
|
|
89
|
+
/** The accounts page's flag (D9): set by a person with reasons, cleared by a person. */
|
|
90
|
+
export declare const RefundFlagActionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
91
|
+
action: z.ZodLiteral<"flag">;
|
|
92
|
+
developerId: z.ZodString;
|
|
93
|
+
note: z.ZodString;
|
|
94
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
95
|
+
action: z.ZodLiteral<"clear">;
|
|
96
|
+
developerId: z.ZodString;
|
|
97
|
+
}, z.core.$strict>], "action">;
|
|
98
|
+
export type RefundFlagAction = z.infer<typeof RefundFlagActionSchema>;
|
|
99
|
+
/** M32 I6 (F4, D3): the licences page's "Lift the chargeback revocation":
|
|
100
|
+
* the licence and a person's note on what reversed the bank's decision. */
|
|
101
|
+
export declare const ChargebackLiftActionSchema: z.ZodObject<{
|
|
102
|
+
licenseId: z.ZodString;
|
|
103
|
+
note: z.ZodString;
|
|
104
|
+
}, z.core.$strict>;
|
|
105
|
+
export type ChargebackLiftAction = z.infer<typeof ChargebackLiftActionSchema>;
|
|
106
|
+
/** M32 I6 (F5, D4): the accounts page's "Stop accepting purchases" and
|
|
107
|
+
* "Accept purchases again" on a flagged account. */
|
|
108
|
+
export declare const PurchasesStopActionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
109
|
+
action: z.ZodLiteral<"stop">;
|
|
110
|
+
developerId: z.ZodString;
|
|
111
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
112
|
+
action: z.ZodLiteral<"resume">;
|
|
113
|
+
developerId: z.ZodString;
|
|
114
|
+
}, z.core.$strict>], "action">;
|
|
115
|
+
export type PurchasesStopAction = z.infer<typeof PurchasesStopActionSchema>;
|
|
116
|
+
/** M32 I6 (F6): the kinds of email the operator's "Emails not sent" screen
|
|
117
|
+
* lists, and what a person may do with a row of any. M32 I7 fix 2
|
|
118
|
+
* (legal-R2): "withdrawal-acknowledgement" is the withdrawal form's
|
|
119
|
+
* acknowledgement to the address the form gave. */
|
|
120
|
+
export declare const UNSENT_EMAIL_KINDS: readonly ["order-confirmation", "revocation", "withdrawal-acknowledgement"];
|
|
121
|
+
export type UnsentEmailKind = (typeof UNSENT_EMAIL_KINDS)[number];
|
|
122
|
+
export declare const UNSENT_EMAIL_ACTIONS: readonly ["resend", "sent-by-hand"];
|
|
123
|
+
export type UnsentEmailActionName = (typeof UNSENT_EMAIL_ACTIONS)[number];
|
|
124
|
+
/** M32 I6 (F6, F27): one action on one row of "Emails not sent". Both email
|
|
125
|
+
* tables' ids are uuids. `attest` is the box an order confirmation's hand
|
|
126
|
+
* mark needs; it stays optional here because the action answers a missing
|
|
127
|
+
* box with its own outcome (not-attested) rather than as an invalid form. */
|
|
128
|
+
export declare const UnsentEmailActionSchema: z.ZodObject<{
|
|
129
|
+
action: z.ZodEnum<{
|
|
130
|
+
resend: "resend";
|
|
131
|
+
"sent-by-hand": "sent-by-hand";
|
|
132
|
+
}>;
|
|
133
|
+
kind: z.ZodEnum<{
|
|
134
|
+
"order-confirmation": "order-confirmation";
|
|
135
|
+
revocation: "revocation";
|
|
136
|
+
"withdrawal-acknowledgement": "withdrawal-acknowledgement";
|
|
137
|
+
}>;
|
|
138
|
+
id: z.ZodString;
|
|
139
|
+
attest: z.ZodOptional<z.ZodLiteral<"yes">>;
|
|
140
|
+
}, z.core.$strict>;
|
|
141
|
+
export type UnsentEmailAction = z.infer<typeof UnsentEmailActionSchema>;
|
|
142
|
+
/** The no-login withdrawal form (D12): the box is the sentence "I hereby withdraw from the contract". */
|
|
143
|
+
export declare const WithdrawalFormInputSchema: z.ZodObject<{
|
|
144
|
+
name: z.ZodString;
|
|
145
|
+
email: z.ZodString;
|
|
146
|
+
reference: z.ZodString;
|
|
147
|
+
confirm: z.ZodLiteral<"yes">;
|
|
148
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
149
|
+
}, z.core.$strict>;
|
|
150
|
+
export type WithdrawalFormInput = z.infer<typeof WithdrawalFormInputSchema>;
|
|
151
|
+
/** What an author sees of a refund on their own plugin (author agreement
|
|
152
|
+
* `evidence`): the plugin, the plan, the amount, the buyer's reasons and who
|
|
153
|
+
* decided; never who bought it. Strict, so a field added to a query cannot
|
|
154
|
+
* ride along into the page. */
|
|
155
|
+
export declare const AuthorRefundRowSchema: z.ZodObject<{
|
|
156
|
+
id: z.ZodString;
|
|
157
|
+
pluginName: z.ZodString;
|
|
158
|
+
planName: z.ZodString;
|
|
159
|
+
licenceRef: z.ZodString;
|
|
160
|
+
amountCents: z.ZodNumber;
|
|
161
|
+
requestedAt: z.ZodString;
|
|
162
|
+
daysSincePurchase: z.ZodNumber;
|
|
163
|
+
downloaded: z.ZodBoolean;
|
|
164
|
+
reason: z.ZodNullable<z.ZodString>;
|
|
165
|
+
deadlineAt: z.ZodNullable<z.ZodString>;
|
|
166
|
+
state: z.ZodEnum<{
|
|
167
|
+
refunded: "refunded";
|
|
168
|
+
open: "open";
|
|
169
|
+
failed: "failed";
|
|
170
|
+
"author-pending": "author-pending";
|
|
171
|
+
approved: "approved";
|
|
172
|
+
refunding: "refunding";
|
|
173
|
+
declined: "declined";
|
|
174
|
+
withdrawn: "withdrawn";
|
|
175
|
+
}>;
|
|
176
|
+
decidedBy: z.ZodNullable<z.ZodEnum<{
|
|
177
|
+
promise: "promise";
|
|
178
|
+
kardalum: "kardalum";
|
|
179
|
+
author: "author";
|
|
180
|
+
setting: "setting";
|
|
181
|
+
}>>;
|
|
182
|
+
decidedAt: z.ZodNullable<z.ZodString>;
|
|
183
|
+
authorNote: z.ZodNullable<z.ZodString>;
|
|
184
|
+
closedByHand: z.ZodBoolean;
|
|
185
|
+
personDecides: z.ZodBoolean;
|
|
186
|
+
partialCents: z.ZodNullable<z.ZodNumber>;
|
|
187
|
+
refundCents: z.ZodNullable<z.ZodNumber>;
|
|
188
|
+
}, z.core.$strict>;
|
|
189
|
+
export type AuthorRefundRow = z.infer<typeof AuthorRefundRowSchema>;
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { CONTRACT_CANCEL_EMAIL_MAX, CONTRACT_CANCEL_REFERENCE_MAX, isInvoiceNumber, isLicenceKeyShape } from "./contract-cancel.schema.js";
|
|
3
|
+
import { isPayoutEmail } from "./marketplace-payouts.schema.js";
|
|
4
|
+
// S367f (refund policy `how-to`, § 356a BGB): the bodies of every refund
|
|
5
|
+
// action and the no-login withdrawal form. Every check over what a person
|
|
6
|
+
// types is a length cap and a character loop, never a pattern.
|
|
7
|
+
export const REFUND_REASON_MAX = 2000;
|
|
8
|
+
export const REFUND_NOTE_MAX = 1000;
|
|
9
|
+
export const WITHDRAWAL_NAME_MAX = 200;
|
|
10
|
+
export const REFUND_STATES = ["open", "author-pending", "approved", "refunding", "refunded", "failed", "declined", "withdrawn"];
|
|
11
|
+
// M32 I6f (S14): "setting" is a decline by the listing's "not refundable after a download".
|
|
12
|
+
export const REFUND_DECIDERS = ["promise", "author", "kardalum", "setting"];
|
|
13
|
+
const uuid = z.string().uuid();
|
|
14
|
+
const reason = z.string().trim().max(REFUND_REASON_MAX);
|
|
15
|
+
const note = z.string().trim().min(1).max(REFUND_NOTE_MAX);
|
|
16
|
+
/** An invoice number is matched upper-cased and stored as entered; a key is matched as it is. */
|
|
17
|
+
export function referenceForMatch(reference) {
|
|
18
|
+
return isInvoiceNumber(reference) ? reference.toUpperCase() : reference;
|
|
19
|
+
}
|
|
20
|
+
/** The portal's "Ask for a refund" (D18). */
|
|
21
|
+
export const RefundAskInputSchema = z.object({ licenseId: uuid, reason: reason.optional() }).strict();
|
|
22
|
+
/** The buyer's Withdraw of an open or pending request (D4). */
|
|
23
|
+
export const RefundWithdrawInputSchema = z.object({ requestId: uuid }).strict();
|
|
24
|
+
/** The author's answer on the cases page (D4): a decline needs a note, which the buyer's email names. */
|
|
25
|
+
export const AuthorRefundDecisionSchema = z.discriminatedUnion("decision", [
|
|
26
|
+
z.object({ decision: z.literal("agree"), requestId: uuid, note: z.string().trim().max(REFUND_NOTE_MAX).optional() }).strict(),
|
|
27
|
+
z.object({ decision: z.literal("decline"), requestId: uuid, note }).strict(),
|
|
28
|
+
]);
|
|
29
|
+
/** M32 I6b (G9): the most a person's partial refund may name, one million dollars. */
|
|
30
|
+
export const REFUND_AMOUNT_MAX_CENTS = 100_000_000;
|
|
31
|
+
/** M32 I6b (G9): a person's dollar amount ("12", "12.3", "12.34") as whole
|
|
32
|
+
* cents, or null. A linear scan: digits, at most one point, at most two
|
|
33
|
+
* decimals, at most nine whole digits, at least one cent. */
|
|
34
|
+
export function centsFromDollarText(text) {
|
|
35
|
+
const s = text.trim();
|
|
36
|
+
if (s.length === 0 || s.length > 12)
|
|
37
|
+
return null;
|
|
38
|
+
const dot = s.indexOf(".");
|
|
39
|
+
const whole = dot === -1 ? s : s.slice(0, dot);
|
|
40
|
+
const frac = dot === -1 ? "" : s.slice(dot + 1);
|
|
41
|
+
if (whole.length === 0 || whole.length > 9 || frac.length > 2 || (dot !== -1 && frac.length === 0))
|
|
42
|
+
return null;
|
|
43
|
+
for (let i = 0; i < whole.length + frac.length; i += 1) {
|
|
44
|
+
const c = (i < whole.length ? whole : frac).charCodeAt(i < whole.length ? i : i - whole.length);
|
|
45
|
+
if (c < 48 || c > 57)
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
const cents = Number(whole) * 100 + Number(frac.padEnd(2, "0"));
|
|
49
|
+
return Number.isSafeInteger(cents) && cents >= 1 && cents <= REFUND_AMOUNT_MAX_CENTS ? cents : null;
|
|
50
|
+
}
|
|
51
|
+
/** A person's actions on the operator's refunds list (D4, D13): a decision
|
|
52
|
+
* in the author's place carries the reasons; Finish the refund retries; Close with a note ends an owed sale a person finished outside. */
|
|
53
|
+
export const OperatorRefundActionSchema = z.discriminatedUnion("action", [
|
|
54
|
+
// M32 I6b (G9): a person may refund part of the sale; no amount asks for the rest.
|
|
55
|
+
z.object({ action: z.literal("refund"), requestId: uuid, note, amountCents: z.number().int().min(1).max(REFUND_AMOUNT_MAX_CENTS).optional() }).strict(),
|
|
56
|
+
z.object({ action: z.literal("decline"), requestId: uuid, note }).strict(),
|
|
57
|
+
// M32 I6f (S14, S17): a person refunds a request the listing's setting declined, with reasons.
|
|
58
|
+
z.object({ action: z.literal("refund-anyway"), requestId: uuid, note }).strict(),
|
|
59
|
+
z.object({ action: z.literal("close"), requestId: uuid, note }).strict(),
|
|
60
|
+
z.object({ action: z.literal("finish"), requestId: uuid }).strict(),
|
|
61
|
+
z.object({ action: z.literal("finish-owed"), purchaseId: uuid }).strict(),
|
|
62
|
+
// The period's owed row of a sale: a person settles it, then closes it here
|
|
63
|
+
// with a note. M32 I6c (money-6): `markedAt` is the owed mark as the page
|
|
64
|
+
// showed it, so a Close read before the mark was cleared and set again
|
|
65
|
+
// changes nothing.
|
|
66
|
+
z.object({ action: z.literal("close-owed"), purchaseId: uuid, note, markedAt: z.string().datetime() }).strict(),
|
|
67
|
+
// M32 I6c (U8, H12): a refund made outside the product that failed and
|
|
68
|
+
// that the period's row does not cover: a person makes it again at the
|
|
69
|
+
// provider, then closes this part with a note. Fix wave C (m4): `markedId`
|
|
70
|
+
// is the failing refund's id the mark showed, checked with its time.
|
|
71
|
+
z.object({ action: z.literal("close-outside"), purchaseId: uuid, note, markedAt: z.string().datetime(), markedId: z.string().min(1).max(255) }).strict(),
|
|
72
|
+
// M32 I6c (U9): a sale whose invoice's corrections or author's ledger is
|
|
73
|
+
// not level with what reached the buyer: a person settles it, then closes
|
|
74
|
+
// the row with a note. Fix wave (money-locks-8): `reachedCents` is what
|
|
75
|
+
// reached the buyer as the page showed it, so a Close read before a later
|
|
76
|
+
// check changed the figure changes nothing.
|
|
77
|
+
z.object({ action: z.literal("close-corrections"), purchaseId: uuid, note, reachedCents: z.string().regex(/^\d{1,15}$/).transform(Number) }).strict(),
|
|
78
|
+
// M32 I6c (U9): the author's deduction brought to what reached the buyer,
|
|
79
|
+
// with a note; `nonce` is the form's own id, drawn when it rendered, so a
|
|
80
|
+
// second press posts nothing more.
|
|
81
|
+
z.object({ action: z.literal("correct-deduction"), purchaseId: uuid, note, nonce: z.string().min(1).max(64) }).strict(),
|
|
82
|
+
// Fix wave C (m1): a corrections row's provider list read again, so a row
|
|
83
|
+
// whose reached amount is unknown gets its figure.
|
|
84
|
+
z.object({ action: z.literal("check-corrections"), purchaseId: uuid }).strict(),
|
|
85
|
+
]);
|
|
86
|
+
/** The accounts page's flag (D9): set by a person with reasons, cleared by a person. */
|
|
87
|
+
export const RefundFlagActionSchema = z.discriminatedUnion("action", [
|
|
88
|
+
z.object({ action: z.literal("flag"), developerId: uuid, note }).strict(),
|
|
89
|
+
z.object({ action: z.literal("clear"), developerId: uuid }).strict(),
|
|
90
|
+
]);
|
|
91
|
+
/** M32 I6 (F4, D3): the licences page's "Lift the chargeback revocation":
|
|
92
|
+
* the licence and a person's note on what reversed the bank's decision. */
|
|
93
|
+
export const ChargebackLiftActionSchema = z.object({ licenseId: uuid, note }).strict();
|
|
94
|
+
/** M32 I6 (F5, D4): the accounts page's "Stop accepting purchases" and
|
|
95
|
+
* "Accept purchases again" on a flagged account. */
|
|
96
|
+
export const PurchasesStopActionSchema = z.discriminatedUnion("action", [
|
|
97
|
+
z.object({ action: z.literal("stop"), developerId: uuid }).strict(),
|
|
98
|
+
z.object({ action: z.literal("resume"), developerId: uuid }).strict(),
|
|
99
|
+
]);
|
|
100
|
+
/** M32 I6 (F6): the kinds of email the operator's "Emails not sent" screen
|
|
101
|
+
* lists, and what a person may do with a row of any. M32 I7 fix 2
|
|
102
|
+
* (legal-R2): "withdrawal-acknowledgement" is the withdrawal form's
|
|
103
|
+
* acknowledgement to the address the form gave. */
|
|
104
|
+
export const UNSENT_EMAIL_KINDS = ["order-confirmation", "revocation", "withdrawal-acknowledgement"];
|
|
105
|
+
export const UNSENT_EMAIL_ACTIONS = ["resend", "sent-by-hand"];
|
|
106
|
+
/** M32 I6 (F6, F27): one action on one row of "Emails not sent". Both email
|
|
107
|
+
* tables' ids are uuids. `attest` is the box an order confirmation's hand
|
|
108
|
+
* mark needs; it stays optional here because the action answers a missing
|
|
109
|
+
* box with its own outcome (not-attested) rather than as an invalid form. */
|
|
110
|
+
export const UnsentEmailActionSchema = z
|
|
111
|
+
.object({
|
|
112
|
+
action: z.enum(UNSENT_EMAIL_ACTIONS),
|
|
113
|
+
kind: z.enum(UNSENT_EMAIL_KINDS),
|
|
114
|
+
id: uuid,
|
|
115
|
+
attest: z.literal("yes").optional(),
|
|
116
|
+
})
|
|
117
|
+
.strict();
|
|
118
|
+
/** The no-login withdrawal form (D12): the box is the sentence "I hereby withdraw from the contract". */
|
|
119
|
+
export const WithdrawalFormInputSchema = z
|
|
120
|
+
.object({
|
|
121
|
+
name: z.string().trim().min(1).max(WITHDRAWAL_NAME_MAX),
|
|
122
|
+
email: z.string().trim().toLowerCase().max(CONTRACT_CANCEL_EMAIL_MAX).refine(isPayoutEmail, "Enter an email address"),
|
|
123
|
+
reference: z.string().trim().max(CONTRACT_CANCEL_REFERENCE_MAX).refine((v) => isInvoiceNumber(v) || isLicenceKeyShape(v), "Enter an invoice number or a licence key"),
|
|
124
|
+
confirm: z.literal("yes"),
|
|
125
|
+
reason: reason.optional(),
|
|
126
|
+
})
|
|
127
|
+
.strict();
|
|
128
|
+
/** What an author sees of a refund on their own plugin (author agreement
|
|
129
|
+
* `evidence`): the plugin, the plan, the amount, the buyer's reasons and who
|
|
130
|
+
* decided; never who bought it. Strict, so a field added to a query cannot
|
|
131
|
+
* ride along into the page. */
|
|
132
|
+
export const AuthorRefundRowSchema = z
|
|
133
|
+
.object({
|
|
134
|
+
id: uuid,
|
|
135
|
+
pluginName: z.string(),
|
|
136
|
+
planName: z.string(),
|
|
137
|
+
licenceRef: z.string(),
|
|
138
|
+
amountCents: z.number().int(),
|
|
139
|
+
requestedAt: z.string(),
|
|
140
|
+
daysSincePurchase: z.number().int(),
|
|
141
|
+
downloaded: z.boolean(),
|
|
142
|
+
reason: z.string().nullable(),
|
|
143
|
+
deadlineAt: z.string().nullable(),
|
|
144
|
+
state: z.enum(REFUND_STATES),
|
|
145
|
+
decidedBy: z.enum(REFUND_DECIDERS).nullable(),
|
|
146
|
+
decidedAt: z.string().nullable(),
|
|
147
|
+
authorNote: z.string().nullable(),
|
|
148
|
+
/** S367h fix wave (I2): a person closed it by hand (Close). */
|
|
149
|
+
closedByHand: z.boolean(),
|
|
150
|
+
/** M32 I6 fix wave (L1, L5): a person at Kardalum decides this request,
|
|
151
|
+
* not the author (the licence changed plan or was transferred since the
|
|
152
|
+
* sale); the author's table offers no Agree or Decline. Only the flag:
|
|
153
|
+
* never who asked or who bought. */
|
|
154
|
+
personDecides: z.boolean(),
|
|
155
|
+
/** M32 I6b (G16): the part a person at Kardalum chose to refund, in
|
|
156
|
+
* cents, or null when the request asks for the rest of the sale. */
|
|
157
|
+
partialCents: z.number().int().nullable(),
|
|
158
|
+
/** Whole-part review tells-13: the amount the refund's attempt asked of
|
|
159
|
+
* the payment provider, once one was asked (it can be less than the part
|
|
160
|
+
* a person chose: never more than the sale still lacks), else null. The
|
|
161
|
+
* buyer's card shows the same figure. */
|
|
162
|
+
refundCents: z.number().int().nullable(),
|
|
163
|
+
})
|
|
164
|
+
.strict();
|