@kardalum/plugin-sdk 0.19.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 +211 -0
- package/README.md +19 -0
- package/dist/admin-section-registry.d.ts +16 -1
- package/dist/admin-section-registry.js +23 -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 +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 +7 -1
- package/dist/datatype-validation.d.ts +4 -9
- package/dist/datatype-validation.js +139 -1
- 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 +36 -4
- package/dist/index.js +50 -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 +285 -23
- package/dist/manifest.d.ts +450 -51
- package/dist/manifest.js +1 -1
- 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 +5 -0
- 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/richtext/block-panel.js +11 -6
- package/dist/richtext/insert-menu.js +9 -6
- package/dist/richtext/style-listbox.js +6 -4
- 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 +24 -24
- package/dist/structured-storage-types.d.ts +309 -9
- 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/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 +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 +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.js +28 -13
- 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-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 +7 -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 +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 +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 +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-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 +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 +180 -15
- package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +41 -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/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 +117 -41
- package/node_modules/@kardalum/api-schemas/dist/index.js +89 -26
- 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/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 +312 -8
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +43 -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 +22 -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 +1 -0
- package/node_modules/@kardalum/api-schemas/dist/media.schema.js +4 -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 +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.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 +335 -6
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +242 -2
- 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-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 +47 -4
- 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/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 +90 -8
- package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.js +59 -1
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +110 -0
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.js +34 -2
- 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/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.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 +58 -1
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +34 -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/package.json +1 -0
- package/node_modules/@kardalum/design-tokens/dist/build-css.js +6 -0
- 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/tokens.css +15 -3
- package/node_modules/@kardalum/design-tokens/dist/tokens.d.ts +1 -1
- package/node_modules/@kardalum/design-tokens/dist/tokens.js +12 -3
- package/node_modules/@kardalum/design-tokens/dist/tokens.json +8 -3
- package/node_modules/@kardalum/design-tokens/dist/types.d.ts +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 +25 -4
- 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/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/ui/dist/components/switch.js +1 -1
- 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/package.json +12 -2
|
@@ -44,6 +44,7 @@ export declare const MediaFileResponseSchema: z.ZodObject<{
|
|
|
44
44
|
currentVersion: z.ZodDefault<z.ZodNumber>;
|
|
45
45
|
hasRendition: z.ZodOptional<z.ZodBoolean>;
|
|
46
46
|
deletedAt: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
47
|
+
storeAddress: z.ZodOptional<z.ZodBoolean>;
|
|
47
48
|
downloadUrl: z.ZodString;
|
|
48
49
|
}, z.core.$strip>;
|
|
49
50
|
export type MediaFileResponse = z.infer<typeof MediaFileResponseSchema>;
|
|
@@ -65,6 +66,7 @@ export declare const MediaItemSaveResponseSchema: z.ZodObject<{
|
|
|
65
66
|
currentVersion: z.ZodDefault<z.ZodNumber>;
|
|
66
67
|
hasRendition: z.ZodOptional<z.ZodBoolean>;
|
|
67
68
|
deletedAt: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
69
|
+
storeAddress: z.ZodOptional<z.ZodBoolean>;
|
|
68
70
|
downloadUrl: z.ZodString;
|
|
69
71
|
readOnlyFields: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
70
72
|
fieldAlias: z.ZodString;
|
|
@@ -118,6 +120,7 @@ export declare const MediaListResponseSchema: z.ZodObject<{
|
|
|
118
120
|
currentVersion: z.ZodDefault<z.ZodNumber>;
|
|
119
121
|
hasRendition: z.ZodOptional<z.ZodBoolean>;
|
|
120
122
|
deletedAt: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
123
|
+
storeAddress: z.ZodOptional<z.ZodBoolean>;
|
|
121
124
|
downloadUrl: z.ZodString;
|
|
122
125
|
}, z.core.$strip>>;
|
|
123
126
|
nextCursor: z.ZodNullable<z.ZodString>;
|
|
@@ -187,6 +190,7 @@ export declare const MediaTrashListResponseSchema: z.ZodObject<{
|
|
|
187
190
|
currentVersion: z.ZodDefault<z.ZodNumber>;
|
|
188
191
|
hasRendition: z.ZodOptional<z.ZodBoolean>;
|
|
189
192
|
deletedAt: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
193
|
+
storeAddress: z.ZodOptional<z.ZodBoolean>;
|
|
190
194
|
}, z.core.$strip>>;
|
|
191
195
|
nextCursor: z.ZodNullable<z.ZodString>;
|
|
192
196
|
}, z.core.$strip>;
|
|
@@ -201,3 +205,21 @@ export declare const MediaEmptyTrashResponseSchema: z.ZodObject<{
|
|
|
201
205
|
truncated: z.ZodBoolean;
|
|
202
206
|
}, z.core.$strip>;
|
|
203
207
|
export type MediaEmptyTrashResponse = z.infer<typeof MediaEmptyTrashResponseSchema>;
|
|
208
|
+
/** M32 I4 (C3): a write to a plugin media store whose plugin was switched off while the file was saved; the write was undone. */
|
|
209
|
+
export declare const MEDIA_STORE_SWITCHED_OFF_CODE: "media_store_switched_off";
|
|
210
|
+
export declare const MediaWriteConflictCodeSchema: z.ZodEnum<{
|
|
211
|
+
media_store_switched_off: "media_store_switched_off";
|
|
212
|
+
}>;
|
|
213
|
+
export type MediaWriteConflictCode = z.infer<typeof MediaWriteConflictCodeSchema>;
|
|
214
|
+
/**
|
|
215
|
+
* M32 I4 (C3): the 409 of the upload, replace and rendition cut routes. The error shape with an
|
|
216
|
+
* optional `code` a client reads instead of the sentence (which is English); a 409 these routes
|
|
217
|
+
* answer for another reason (a lost claim, a moved version, an unavailable store) carries none.
|
|
218
|
+
*/
|
|
219
|
+
export declare const MediaWriteConflictErrorSchema: z.ZodObject<{
|
|
220
|
+
message: z.ZodString;
|
|
221
|
+
code: z.ZodOptional<z.ZodEnum<{
|
|
222
|
+
media_store_switched_off: "media_store_switched_off";
|
|
223
|
+
}>>;
|
|
224
|
+
}, z.core.$strip>;
|
|
225
|
+
export type MediaWriteConflictError = z.infer<typeof MediaWriteConflictErrorSchema>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ReadOnlyFieldSchema } from "./plugin-read-only.schema.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
+
import { ApiErrorSchema } from "./api-error.schema.js";
|
|
3
4
|
import { MediaFileSchema, MediaFolderSchema, MediaVersionSchema, MediaVisibilitySchema } from "./media.schema.js";
|
|
4
5
|
import { MediaRenditionSchema } from "./media-rendition.schema.js";
|
|
5
6
|
// POST /api/manage/v1/media/folders body (S186e §2): name required, parentId
|
|
@@ -119,7 +120,7 @@ export const MediaDeleteResponseSchema = z.object({
|
|
|
119
120
|
// nothing about that column, so the column keeps whatever it already had
|
|
120
121
|
// rather than being cleared to a default. Unticking the privacy toggle is
|
|
121
122
|
// sending the alias as `false`, exactly like any other field a form
|
|
122
|
-
// clears. See MediaService.
|
|
123
|
+
// clears. See MediaService.saveItem's own doc comment for the full
|
|
123
124
|
// reasoning; this note exists because Tasks 6 and 7 read this schema
|
|
124
125
|
// rather than the service.
|
|
125
126
|
export const UpdateMediaRequestSchema = z
|
|
@@ -226,3 +227,14 @@ export const MediaEmptyTrashResponseSchema = z.object({
|
|
|
226
227
|
// accounted for" from "there is more in there and this pass gave up".
|
|
227
228
|
truncated: z.boolean(),
|
|
228
229
|
});
|
|
230
|
+
/** M32 I4 (C3): a write to a plugin media store whose plugin was switched off while the file was saved; the write was undone. */
|
|
231
|
+
export const MEDIA_STORE_SWITCHED_OFF_CODE = "media_store_switched_off";
|
|
232
|
+
export const MediaWriteConflictCodeSchema = z.enum([MEDIA_STORE_SWITCHED_OFF_CODE]);
|
|
233
|
+
/**
|
|
234
|
+
* M32 I4 (C3): the 409 of the upload, replace and rendition cut routes. The error shape with an
|
|
235
|
+
* optional `code` a client reads instead of the sentence (which is English); a 409 these routes
|
|
236
|
+
* answer for another reason (a lost claim, a moved version, an unavailable store) carries none.
|
|
237
|
+
*/
|
|
238
|
+
export const MediaWriteConflictErrorSchema = ApiErrorSchema.extend({
|
|
239
|
+
code: MediaWriteConflictCodeSchema.optional(),
|
|
240
|
+
});
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** E2: the media items one batch of the move walks. */
|
|
3
|
+
export declare const MEDIA_MOVE_BATCH = 50;
|
|
4
|
+
export declare const MediaMoveStateSchema: z.ZodEnum<{
|
|
5
|
+
waiting: "waiting";
|
|
6
|
+
running: "running";
|
|
7
|
+
done: "done";
|
|
8
|
+
}>;
|
|
9
|
+
export type MediaMoveState = z.infer<typeof MediaMoveStateSchema>;
|
|
10
|
+
/** The longest run tag a move keeps: lowercase hex, part of every copy's key. */
|
|
11
|
+
export declare const MEDIA_MOVE_TAG_MAX = 16;
|
|
12
|
+
export declare const MediaMoveProgressSchema: z.ZodObject<{
|
|
13
|
+
target: z.ZodString;
|
|
14
|
+
after: z.ZodNullable<z.ZodString>;
|
|
15
|
+
moved: z.ZodNumber;
|
|
16
|
+
skipped: z.ZodNumber;
|
|
17
|
+
failed: z.ZodNumber;
|
|
18
|
+
startedAt: z.ZodString;
|
|
19
|
+
finishedAt: z.ZodNullable<z.ZodString>;
|
|
20
|
+
state: z.ZodEnum<{
|
|
21
|
+
waiting: "waiting";
|
|
22
|
+
running: "running";
|
|
23
|
+
done: "done";
|
|
24
|
+
}>;
|
|
25
|
+
tag: z.ZodOptional<z.ZodString>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
export type MediaMoveProgress = z.infer<typeof MediaMoveProgressSchema>;
|
|
28
|
+
export declare const MediaLeftoverCountSchema: z.ZodObject<{
|
|
29
|
+
total: z.ZodNumber;
|
|
30
|
+
byStore: z.ZodArray<z.ZodObject<{
|
|
31
|
+
store: z.ZodString;
|
|
32
|
+
count: z.ZodNumber;
|
|
33
|
+
}, z.core.$strip>>;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
export type MediaLeftoverCount = z.infer<typeof MediaLeftoverCountSchema>;
|
|
36
|
+
/** E2, E3: `GET` and `POST /providers/media/move`: the move's progress (null when none has run) and the leftover objects. */
|
|
37
|
+
export declare const MediaMoveResponseSchema: z.ZodObject<{
|
|
38
|
+
move: z.ZodNullable<z.ZodObject<{
|
|
39
|
+
target: z.ZodString;
|
|
40
|
+
after: z.ZodNullable<z.ZodString>;
|
|
41
|
+
moved: z.ZodNumber;
|
|
42
|
+
skipped: z.ZodNumber;
|
|
43
|
+
failed: z.ZodNumber;
|
|
44
|
+
startedAt: z.ZodString;
|
|
45
|
+
finishedAt: z.ZodNullable<z.ZodString>;
|
|
46
|
+
state: z.ZodEnum<{
|
|
47
|
+
waiting: "waiting";
|
|
48
|
+
running: "running";
|
|
49
|
+
done: "done";
|
|
50
|
+
}>;
|
|
51
|
+
tag: z.ZodOptional<z.ZodString>;
|
|
52
|
+
}, z.core.$strip>>;
|
|
53
|
+
leftovers: z.ZodObject<{
|
|
54
|
+
total: z.ZodNumber;
|
|
55
|
+
byStore: z.ZodArray<z.ZodObject<{
|
|
56
|
+
store: z.ZodString;
|
|
57
|
+
count: z.ZodNumber;
|
|
58
|
+
}, z.core.$strip>>;
|
|
59
|
+
}, z.core.$strip>;
|
|
60
|
+
}, z.core.$strip>;
|
|
61
|
+
export type MediaMoveResponse = z.infer<typeof MediaMoveResponseSchema>;
|
|
62
|
+
/** E2: the 409 of `POST /providers/media/move`; `code` tells the admin which refusal it is, whatever the language. */
|
|
63
|
+
export declare const MediaMoveRefusalCodeSchema: z.ZodEnum<{
|
|
64
|
+
busy: "busy";
|
|
65
|
+
target_unavailable: "target_unavailable";
|
|
66
|
+
}>;
|
|
67
|
+
export type MediaMoveRefusalCode = z.infer<typeof MediaMoveRefusalCodeSchema>;
|
|
68
|
+
export declare const MediaMoveRefusalSchema: z.ZodObject<{
|
|
69
|
+
message: z.ZodString;
|
|
70
|
+
code: z.ZodEnum<{
|
|
71
|
+
busy: "busy";
|
|
72
|
+
target_unavailable: "target_unavailable";
|
|
73
|
+
}>;
|
|
74
|
+
}, z.core.$strip>;
|
|
75
|
+
export type MediaMoveRefusal = z.infer<typeof MediaMoveRefusalSchema>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// M32 F4e (E2): moving media files to the chosen store in the background. Every object of a media
|
|
3
|
+
// item (its versions, their renditions and the item's mirror columns) in another store is copied
|
|
4
|
+
// to the chosen one and its row switched; the walk is `media_files` by id, trashed items included.
|
|
5
|
+
// The progress is the `server.mediaMove` setting row, written after each batch.
|
|
6
|
+
/** E2: the media items one batch of the move walks. */
|
|
7
|
+
export const MEDIA_MOVE_BATCH = 50;
|
|
8
|
+
export const MediaMoveStateSchema = z.enum(["running", "waiting", "done"]);
|
|
9
|
+
/** The longest run tag a move keeps: lowercase hex, part of every copy's key. */
|
|
10
|
+
export const MEDIA_MOVE_TAG_MAX = 16;
|
|
11
|
+
function isMoveTag(value) {
|
|
12
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
13
|
+
const code = value.charCodeAt(index);
|
|
14
|
+
if (!((code >= 48 && code <= 57) || (code >= 97 && code <= 102)))
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
export const MediaMoveProgressSchema = z.object({
|
|
20
|
+
/** The store the files move to: `core` or a plugin store's provider key. */
|
|
21
|
+
target: z.string().min(1),
|
|
22
|
+
/** The id of the last media item handled; the walk continues after it. */
|
|
23
|
+
after: z.string().min(1).nullable(),
|
|
24
|
+
moved: z.number().int().nonnegative(),
|
|
25
|
+
/** Objects whose store was unavailable when the walk reached them. */
|
|
26
|
+
skipped: z.number().int().nonnegative(),
|
|
27
|
+
/** Objects that could not be read, written or checked; their rows stay on their own store. */
|
|
28
|
+
failed: z.number().int().nonnegative(),
|
|
29
|
+
startedAt: z.string().datetime(),
|
|
30
|
+
finishedAt: z.string().datetime().nullable(),
|
|
31
|
+
/** `waiting`: the target became unavailable; the move resumes at the next boot or start. */
|
|
32
|
+
state: MediaMoveStateSchema,
|
|
33
|
+
/**
|
|
34
|
+
* The run tag in every copy's key, kept so a resumed move writes its copies under the same keys
|
|
35
|
+
* and overwrites a copy a crash left between its put and its switch.
|
|
36
|
+
*/
|
|
37
|
+
tag: z.string().min(1).max(MEDIA_MOVE_TAG_MAX).refine(isMoveTag).optional(),
|
|
38
|
+
});
|
|
39
|
+
export const MediaLeftoverCountSchema = z.object({
|
|
40
|
+
total: z.number().int().nonnegative(),
|
|
41
|
+
byStore: z.array(z.object({ store: z.string().min(1), count: z.number().int().nonnegative() })),
|
|
42
|
+
});
|
|
43
|
+
/** E2, E3: `GET` and `POST /providers/media/move`: the move's progress (null when none has run) and the leftover objects. */
|
|
44
|
+
export const MediaMoveResponseSchema = z.object({
|
|
45
|
+
move: MediaMoveProgressSchema.nullable(),
|
|
46
|
+
leftovers: MediaLeftoverCountSchema,
|
|
47
|
+
});
|
|
48
|
+
/** E2: the 409 of `POST /providers/media/move`; `code` tells the admin which refusal it is, whatever the language. */
|
|
49
|
+
export const MediaMoveRefusalCodeSchema = z.enum(["busy", "target_unavailable"]);
|
|
50
|
+
export const MediaMoveRefusalSchema = z.object({
|
|
51
|
+
message: z.string(),
|
|
52
|
+
code: MediaMoveRefusalCodeSchema,
|
|
53
|
+
});
|
|
@@ -28,8 +28,8 @@ export declare const MediaReferenceUseSchema: z.ZodObject<{
|
|
|
28
28
|
version: z.ZodNumber;
|
|
29
29
|
state: z.ZodEnum<{
|
|
30
30
|
live: "live";
|
|
31
|
-
history: "history";
|
|
32
31
|
trashed: "trashed";
|
|
32
|
+
history: "history";
|
|
33
33
|
}>;
|
|
34
34
|
}, z.core.$strip>;
|
|
35
35
|
export type MediaReferenceUse = z.infer<typeof MediaReferenceUseSchema>;
|
|
@@ -52,8 +52,8 @@ export declare const MediaReferenceListResponseSchema: z.ZodObject<{
|
|
|
52
52
|
version: z.ZodNumber;
|
|
53
53
|
state: z.ZodEnum<{
|
|
54
54
|
live: "live";
|
|
55
|
-
history: "history";
|
|
56
55
|
trashed: "trashed";
|
|
56
|
+
history: "history";
|
|
57
57
|
}>;
|
|
58
58
|
}, z.core.$strip>>;
|
|
59
59
|
nextCursor: z.ZodNullable<z.ZodString>;
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* that version forever. That is what lets the answer be stored once at
|
|
11
11
|
* write time instead of searched for on every question.
|
|
12
12
|
*/
|
|
13
|
+
import type { DataTypeTree } from "./nested-fields.schema.js";
|
|
13
14
|
export interface MediaReference {
|
|
14
15
|
mediaId: string;
|
|
15
16
|
/** The key in the version's data. Not always a declared field: a pasted
|
|
@@ -24,4 +25,5 @@ export interface MediaReference {
|
|
|
24
25
|
export declare function mediaReferencesIn(fields: ReadonlyArray<{
|
|
25
26
|
id: string;
|
|
26
27
|
editorId: string;
|
|
28
|
+
tree?: DataTypeTree | null;
|
|
27
29
|
}>, data: Record<string, unknown>, cultureData: Record<string, Record<string, unknown>> | null | undefined): MediaReference[];
|
|
@@ -25,6 +25,7 @@ export function mediaReferencesIn(fields, data, cultureData) {
|
|
|
25
25
|
// One field that refuses to be read costs only that field's entry, not
|
|
26
26
|
// the whole lookup.
|
|
27
27
|
const editorById = new Map();
|
|
28
|
+
const treeById = new Map();
|
|
28
29
|
{
|
|
29
30
|
let fieldCount;
|
|
30
31
|
try {
|
|
@@ -47,6 +48,9 @@ export function mediaReferencesIn(fields, data, cultureData) {
|
|
|
47
48
|
const { id, editorId } = field;
|
|
48
49
|
if (typeof id === "string" && typeof editorId === "string")
|
|
49
50
|
editorById.set(id, editorId);
|
|
51
|
+
const tree = field.tree;
|
|
52
|
+
if (typeof id === "string" && tree && (tree.group || tree.list))
|
|
53
|
+
treeById.set(id, tree);
|
|
50
54
|
}
|
|
51
55
|
catch {
|
|
52
56
|
// A field descriptor whose id or editorId refuses to be read
|
|
@@ -91,6 +95,10 @@ export function mediaReferencesIn(fields, data, cultureData) {
|
|
|
91
95
|
if (editorById.get(fieldId) === IMAGE_EDITOR_ID && typeof value === "string" && BARE_UUID.test(value)) {
|
|
92
96
|
add(value);
|
|
93
97
|
}
|
|
98
|
+
// Nested rule: a bare uuid at an Image leaf inside a Group or Repeatable list.
|
|
99
|
+
const tree = treeById.get(fieldId);
|
|
100
|
+
if (tree)
|
|
101
|
+
walkTree(tree, value, 0, add);
|
|
94
102
|
// Rules 2 and 3 apply to every field, whatever its editor, because
|
|
95
103
|
// a URL can be pasted anywhere and a rich text tree can live under
|
|
96
104
|
// a data type this function has never heard of.
|
|
@@ -122,6 +130,53 @@ export function mediaReferencesIn(fields, data, cultureData) {
|
|
|
122
130
|
}
|
|
123
131
|
return [...found.values()];
|
|
124
132
|
}
|
|
133
|
+
/** Follows a Group or Repeatable list tree along the value and adds every bare uuid at an Image leaf. Never throws. */
|
|
134
|
+
function walkTree(tree, value, depth, add) {
|
|
135
|
+
try {
|
|
136
|
+
if (depth > MAX_DEPTH)
|
|
137
|
+
return;
|
|
138
|
+
if (tree.group) {
|
|
139
|
+
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
140
|
+
return;
|
|
141
|
+
const record = value;
|
|
142
|
+
for (const sub of tree.group.fields) {
|
|
143
|
+
if (!sub.type)
|
|
144
|
+
continue;
|
|
145
|
+
let inner;
|
|
146
|
+
try {
|
|
147
|
+
inner = record[sub.alias];
|
|
148
|
+
}
|
|
149
|
+
catch {
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
walkTree(sub.type, inner, depth + 1, add);
|
|
153
|
+
}
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
if (tree.list) {
|
|
157
|
+
const item = tree.list.item;
|
|
158
|
+
if (!item || !Array.isArray(value))
|
|
159
|
+
return;
|
|
160
|
+
const count = Math.min(value.length, tree.list.max);
|
|
161
|
+
for (let i = 0; i < count; i++) {
|
|
162
|
+
let inner;
|
|
163
|
+
try {
|
|
164
|
+
inner = value[i];
|
|
165
|
+
}
|
|
166
|
+
catch {
|
|
167
|
+
continue;
|
|
168
|
+
}
|
|
169
|
+
walkTree(item, inner, depth + 1, add);
|
|
170
|
+
}
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
if (tree.editorId === IMAGE_EDITOR_ID && typeof value === "string" && BARE_UUID.test(value))
|
|
174
|
+
add(value);
|
|
175
|
+
}
|
|
176
|
+
catch {
|
|
177
|
+
// A value that refuses to be read yields no reference.
|
|
178
|
+
}
|
|
179
|
+
}
|
|
125
180
|
/**
|
|
126
181
|
* Rules 2 and 3, over any value at all.
|
|
127
182
|
*
|
|
@@ -22,6 +22,7 @@ export declare const MediaFileSchema: z.ZodObject<{
|
|
|
22
22
|
currentVersion: z.ZodDefault<z.ZodNumber>;
|
|
23
23
|
hasRendition: z.ZodOptional<z.ZodBoolean>;
|
|
24
24
|
deletedAt: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
25
|
+
storeAddress: z.ZodOptional<z.ZodBoolean>;
|
|
25
26
|
}, z.core.$strip>;
|
|
26
27
|
export type MediaFile = z.infer<typeof MediaFileSchema>;
|
|
27
28
|
export declare const MediaVersionSchema: z.ZodObject<{
|
|
@@ -70,6 +70,10 @@ export const MediaFileSchema = z.object({
|
|
|
70
70
|
// trashed one (the bin's listing, and the item screen's read of a file
|
|
71
71
|
// that was trashed while it was open).
|
|
72
72
|
deletedAt: z.string().datetime().nullable().default(null),
|
|
73
|
+
// M32 F4e (E1): whether the store this item's bytes live in gives a public address now. Set on
|
|
74
|
+
// the management item (the admin warns that making such an item private cannot withdraw the
|
|
75
|
+
// copy the store serves); absent everywhere else. Never the address itself.
|
|
76
|
+
storeAddress: z.boolean().optional(),
|
|
73
77
|
});
|
|
74
78
|
// S234b: one set of bytes. A media item has one of these per version, and
|
|
75
79
|
// `MediaFile.currentVersion` says which one it serves.
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type DataTypeConfig } from "./data-type-config.schema.js";
|
|
3
|
+
export declare const GROUP_EDITOR_ID = "com.kardalum.group";
|
|
4
|
+
export declare const REPEATABLE_LIST_EDITOR_ID = "com.kardalum.list";
|
|
5
|
+
export declare const GROUP_FIELDS_MAX = 20;
|
|
6
|
+
export declare const LIST_ITEMS_MAX = 100;
|
|
7
|
+
export declare const NESTING_DEPTH_MAX = 2;
|
|
8
|
+
export declare const NESTED_PICKED_PAGES_MAX = 200;
|
|
9
|
+
export declare const NESTED_ISSUES_MAX = 50;
|
|
10
|
+
export declare const SUB_FIELD_ALIAS_MAX = 64;
|
|
11
|
+
export declare const SUB_FIELD_NAME_MAX = 200;
|
|
12
|
+
export declare const NESTABLE_EDITOR_IDS: ReadonlySet<string>;
|
|
13
|
+
/** M32 I2 (A4): a list of Groups holding rich text would be a list of up to 100 editors, so a save
|
|
14
|
+
* is refused both ways (a list naming such a Group, a Group a list repeats gaining rich text), and
|
|
15
|
+
* the tree reads rich text below a list as unreadable. */
|
|
16
|
+
export declare const RICH_TEXT_IN_LIST_MESSAGE = "Rich text can sit in a group, but not in a group that a repeatable list repeats.";
|
|
17
|
+
/** M32 I5 (D9): every reason a Group or list save is refused for its nesting, as a code the admin
|
|
18
|
+
* words in its own language. The server's English sentence stays the 400's `message`. */
|
|
19
|
+
export declare const NESTING_PROBLEM_CODES: readonly ["sub_field_gone", "sub_field_not_nestable", "sub_field_plugin_not_nestable", "sub_field_switched_off", "item_gone", "item_not_nestable", "item_plugin_not_nestable", "item_switched_off", "rich_text_in_list", "holds_itself", "too_deep", "too_deep_through", "scan_incomplete"];
|
|
20
|
+
export type NestingProblemCode = (typeof NESTING_PROBLEM_CODES)[number];
|
|
21
|
+
/** M32 I5 (D9): one reason a Group or list cannot be saved, for the admin to word. The values are
|
|
22
|
+
* plain data (names as stored), shown as text. */
|
|
23
|
+
export declare const NestingProblemSchema: z.ZodObject<{
|
|
24
|
+
code: z.ZodEnum<{
|
|
25
|
+
sub_field_gone: "sub_field_gone";
|
|
26
|
+
sub_field_not_nestable: "sub_field_not_nestable";
|
|
27
|
+
sub_field_plugin_not_nestable: "sub_field_plugin_not_nestable";
|
|
28
|
+
sub_field_switched_off: "sub_field_switched_off";
|
|
29
|
+
item_gone: "item_gone";
|
|
30
|
+
item_not_nestable: "item_not_nestable";
|
|
31
|
+
item_plugin_not_nestable: "item_plugin_not_nestable";
|
|
32
|
+
item_switched_off: "item_switched_off";
|
|
33
|
+
rich_text_in_list: "rich_text_in_list";
|
|
34
|
+
holds_itself: "holds_itself";
|
|
35
|
+
too_deep: "too_deep";
|
|
36
|
+
too_deep_through: "too_deep_through";
|
|
37
|
+
scan_incomplete: "scan_incomplete";
|
|
38
|
+
}>;
|
|
39
|
+
field: z.ZodOptional<z.ZodString>;
|
|
40
|
+
type: z.ZodOptional<z.ZodString>;
|
|
41
|
+
plugin: z.ZodOptional<z.ZodString>;
|
|
42
|
+
through: z.ZodOptional<z.ZodString>;
|
|
43
|
+
}, z.core.$strip>;
|
|
44
|
+
export type NestingProblem = z.infer<typeof NestingProblemSchema>;
|
|
45
|
+
/** M32 I5 (D9): the reasons a Group or list's own settings are refused (GroupSettingsSchema,
|
|
46
|
+
* RepeatableListSettingsSchema), as codes the admin words. Not nesting refusals, so a sibling list. */
|
|
47
|
+
export declare const DATA_TYPE_SETTINGS_PROBLEM_CODES: readonly ["alias_invalid", "name_required", "alias_duplicate", "min_above_max", "limit_out_of_range", "sub_field_type_required"];
|
|
48
|
+
export type DataTypeSettingsProblemCode = (typeof DATA_TYPE_SETTINGS_PROBLEM_CODES)[number];
|
|
49
|
+
/** M32 I5 (D9): one reason a data type save is refused, a nesting code or a settings code. */
|
|
50
|
+
export declare const DataTypeSettingsProblemSchema: z.ZodObject<{
|
|
51
|
+
field: z.ZodOptional<z.ZodString>;
|
|
52
|
+
type: z.ZodOptional<z.ZodString>;
|
|
53
|
+
plugin: z.ZodOptional<z.ZodString>;
|
|
54
|
+
through: z.ZodOptional<z.ZodString>;
|
|
55
|
+
code: z.ZodEnum<{
|
|
56
|
+
sub_field_gone: "sub_field_gone";
|
|
57
|
+
sub_field_not_nestable: "sub_field_not_nestable";
|
|
58
|
+
sub_field_plugin_not_nestable: "sub_field_plugin_not_nestable";
|
|
59
|
+
sub_field_switched_off: "sub_field_switched_off";
|
|
60
|
+
item_gone: "item_gone";
|
|
61
|
+
item_not_nestable: "item_not_nestable";
|
|
62
|
+
item_plugin_not_nestable: "item_plugin_not_nestable";
|
|
63
|
+
item_switched_off: "item_switched_off";
|
|
64
|
+
rich_text_in_list: "rich_text_in_list";
|
|
65
|
+
holds_itself: "holds_itself";
|
|
66
|
+
too_deep: "too_deep";
|
|
67
|
+
too_deep_through: "too_deep_through";
|
|
68
|
+
scan_incomplete: "scan_incomplete";
|
|
69
|
+
alias_invalid: "alias_invalid";
|
|
70
|
+
name_required: "name_required";
|
|
71
|
+
alias_duplicate: "alias_duplicate";
|
|
72
|
+
min_above_max: "min_above_max";
|
|
73
|
+
limit_out_of_range: "limit_out_of_range";
|
|
74
|
+
sub_field_type_required: "sub_field_type_required";
|
|
75
|
+
}>;
|
|
76
|
+
alias: z.ZodOptional<z.ZodString>;
|
|
77
|
+
count: z.ZodOptional<z.ZodNumber>;
|
|
78
|
+
}, z.core.$strip>;
|
|
79
|
+
export type DataTypeSettingsProblem = z.infer<typeof DataTypeSettingsProblemSchema>;
|
|
80
|
+
/** M32 I5 (D9): the data type POST and PATCH 400: the English message, and the problems when the
|
|
81
|
+
* nesting checks or a Group or list's settings refused it (absent for every other 400, and for a
|
|
82
|
+
* settings refusal with a part no code names). */
|
|
83
|
+
export declare const DataTypeSettingsErrorSchema: z.ZodObject<{
|
|
84
|
+
message: z.ZodString;
|
|
85
|
+
problems: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
86
|
+
field: z.ZodOptional<z.ZodString>;
|
|
87
|
+
type: z.ZodOptional<z.ZodString>;
|
|
88
|
+
plugin: z.ZodOptional<z.ZodString>;
|
|
89
|
+
through: z.ZodOptional<z.ZodString>;
|
|
90
|
+
code: z.ZodEnum<{
|
|
91
|
+
sub_field_gone: "sub_field_gone";
|
|
92
|
+
sub_field_not_nestable: "sub_field_not_nestable";
|
|
93
|
+
sub_field_plugin_not_nestable: "sub_field_plugin_not_nestable";
|
|
94
|
+
sub_field_switched_off: "sub_field_switched_off";
|
|
95
|
+
item_gone: "item_gone";
|
|
96
|
+
item_not_nestable: "item_not_nestable";
|
|
97
|
+
item_plugin_not_nestable: "item_plugin_not_nestable";
|
|
98
|
+
item_switched_off: "item_switched_off";
|
|
99
|
+
rich_text_in_list: "rich_text_in_list";
|
|
100
|
+
holds_itself: "holds_itself";
|
|
101
|
+
too_deep: "too_deep";
|
|
102
|
+
too_deep_through: "too_deep_through";
|
|
103
|
+
scan_incomplete: "scan_incomplete";
|
|
104
|
+
alias_invalid: "alias_invalid";
|
|
105
|
+
name_required: "name_required";
|
|
106
|
+
alias_duplicate: "alias_duplicate";
|
|
107
|
+
min_above_max: "min_above_max";
|
|
108
|
+
limit_out_of_range: "limit_out_of_range";
|
|
109
|
+
sub_field_type_required: "sub_field_type_required";
|
|
110
|
+
}>;
|
|
111
|
+
alias: z.ZodOptional<z.ZodString>;
|
|
112
|
+
count: z.ZodOptional<z.ZodNumber>;
|
|
113
|
+
}, z.core.$strip>>>;
|
|
114
|
+
}, z.core.$strip>;
|
|
115
|
+
export type DataTypeSettingsError = z.infer<typeof DataTypeSettingsErrorSchema>;
|
|
116
|
+
export declare function isCompositeEditor(editorId: string): boolean;
|
|
117
|
+
export declare const GroupSubFieldSchema: z.ZodObject<{
|
|
118
|
+
alias: z.ZodString;
|
|
119
|
+
name: z.ZodString;
|
|
120
|
+
dataTypeId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
121
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
122
|
+
}, z.core.$strict>;
|
|
123
|
+
export type GroupSubField = z.output<typeof GroupSubFieldSchema>;
|
|
124
|
+
export declare const GroupSettingsSchema: z.ZodObject<{
|
|
125
|
+
fields: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
126
|
+
alias: z.ZodString;
|
|
127
|
+
name: z.ZodString;
|
|
128
|
+
dataTypeId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
129
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
130
|
+
}, z.core.$strict>>>;
|
|
131
|
+
}, z.core.$strict>;
|
|
132
|
+
export type GroupSettings = z.output<typeof GroupSettingsSchema>;
|
|
133
|
+
export declare const RepeatableListSettingsSchema: z.ZodObject<{
|
|
134
|
+
itemDataTypeId: z.ZodDefault<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
|
|
135
|
+
min: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
136
|
+
max: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
137
|
+
}, z.core.$strict>;
|
|
138
|
+
export type RepeatableListSettings = z.output<typeof RepeatableListSettingsSchema>;
|
|
139
|
+
export declare function isPlainRecord(value: unknown): value is Record<string, unknown>;
|
|
140
|
+
export declare function readGroupSettings(raw: unknown): GroupSettings;
|
|
141
|
+
export declare function readRepeatableListSettings(raw: unknown): RepeatableListSettings;
|
|
142
|
+
export interface DataTypeTreeSubField {
|
|
143
|
+
alias: string;
|
|
144
|
+
name: string;
|
|
145
|
+
required: boolean;
|
|
146
|
+
/** null: the sub-type is missing, not nestable, or too deep. Its value is ignored. */
|
|
147
|
+
type: DataTypeTree | null;
|
|
148
|
+
/** M32 I5 (D12): `type` is null because no data type answers the id (deleted, or removed with
|
|
149
|
+
* its plugin). A sub-type that only cannot nest (its plugin switched off) is not missing. */
|
|
150
|
+
missing?: true;
|
|
151
|
+
}
|
|
152
|
+
export interface DataTypeTree {
|
|
153
|
+
dataTypeId: string;
|
|
154
|
+
editorId: string;
|
|
155
|
+
/** As stored; a consumer applies its editor's defaults to `{}` as at the top level. */
|
|
156
|
+
settings: Record<string, unknown>;
|
|
157
|
+
/** M32 I5 (D12): a top-level id no data type answers, read as an editor id as before. */
|
|
158
|
+
missing?: true;
|
|
159
|
+
group?: {
|
|
160
|
+
fields: DataTypeTreeSubField[];
|
|
161
|
+
};
|
|
162
|
+
/** `itemMissing` (M32 I5, D12): the list names no item type, or no data type answers it. */
|
|
163
|
+
list?: {
|
|
164
|
+
item: DataTypeTree | null;
|
|
165
|
+
min: number | null;
|
|
166
|
+
max: number;
|
|
167
|
+
itemMissing?: true;
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
type ConfigLookup = (id: string) => DataTypeConfig | null | undefined;
|
|
171
|
+
/** M32 F4d (D15): which editors may sit inside a Group or list. The server adds the attached plugin
|
|
172
|
+
* data types declaring `nestable: true`; without it, the core set. An answer that throws is "no". */
|
|
173
|
+
export interface DataTypeTreeOptions {
|
|
174
|
+
isNestable?: (editorId: string) => boolean;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* A field's data type with its sub-types resolved. A top-level id with no config is a legacy
|
|
178
|
+
* field naming its editor directly (as every resolver treats it); a missing nested one is null.
|
|
179
|
+
*/
|
|
180
|
+
export declare function buildDataTypeTree(dataTypeId: string, lookup: ConfigLookup, options?: DataTypeTreeOptions): DataTypeTree | null;
|
|
181
|
+
/** Reads each distinct config once (sub-types level by level), then builds every tree. */
|
|
182
|
+
export declare function loadDataTypeTrees(ids: readonly string[], getConfig: (id: string) => Promise<DataTypeConfig | null>, cache?: Map<string, Promise<DataTypeConfig | null>>, options?: DataTypeTreeOptions): Promise<Map<string, DataTypeTree | null>>;
|
|
183
|
+
/** D5: 0 for a plain type, 1 + the deepest sub-type for a composite; "cycle" when it holds itself. */
|
|
184
|
+
export declare function compositeDepth(dataTypeId: string, lookup: ConfigLookup): number | "cycle";
|
|
185
|
+
/**
|
|
186
|
+
* D7: keeps only the current aliases of every group inside the value; any other shape is kept as is.
|
|
187
|
+
* M32 E (m11): `capLists` cuts each list at its maximum (at most LIST_ITEMS_MAX) for a read; a write
|
|
188
|
+
* leaves it whole so validation can still answer that the list has too many items.
|
|
189
|
+
*/
|
|
190
|
+
export declare function pruneNestedValue(tree: DataTypeTree | null, value: unknown, options?: {
|
|
191
|
+
capLists?: boolean;
|
|
192
|
+
}): unknown;
|
|
193
|
+
/** D10, D18: the item numbers and sub-field names a failure path names; the sub-type's own path is not spelled out. */
|
|
194
|
+
export declare function nestedPathParts(tree: DataTypeTree | null, path: string): Array<{
|
|
195
|
+
kind: "item";
|
|
196
|
+
n: number;
|
|
197
|
+
} | {
|
|
198
|
+
kind: "field";
|
|
199
|
+
alias: string;
|
|
200
|
+
name: string;
|
|
201
|
+
}>;
|
|
202
|
+
/** D9: the JSON Schema of a nested value, built from the tree; a leaf asks `leafSchema`. */
|
|
203
|
+
export declare function nestedValueSchema(tree: DataTypeTree, leafSchema: (editorId: string) => Record<string, unknown> | null): Record<string, unknown> | null;
|
|
204
|
+
export {};
|