@kardalum/plugin-sdk 0.18.0 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +253 -0
- package/README.md +20 -1
- package/dist/admin-section-registry.d.ts +16 -1
- package/dist/admin-section-registry.js +23 -0
- package/dist/assets/asset-picker.js +3 -3
- package/dist/built-in-editor-ids.d.ts +1 -1
- package/dist/built-in-editor-ids.js +2 -20
- package/dist/built-in-serializers.js +1 -1
- package/dist/built-in-settings-schemas.d.ts +10 -0
- package/dist/built-in-settings-schemas.js +90 -4
- package/dist/built-in-value-schemas.js +35 -0
- package/dist/built-ins.js +48 -17
- package/dist/capabilities.d.ts +11 -1
- package/dist/capabilities.js +55 -3
- package/dist/cli.d.ts +66 -0
- package/dist/cli.js +22 -0
- package/dist/content-library.d.ts +85 -0
- package/dist/content-library.js +15 -0
- package/dist/content-picker/page-picker-sheet.d.ts +13 -0
- package/dist/content-picker/page-picker-sheet.js +105 -0
- package/dist/content-picker/page-tree.d.ts +25 -0
- package/dist/content-picker/page-tree.js +132 -0
- package/dist/data-type-plugin.d.ts +9 -3
- package/dist/datatype-validation.d.ts +6 -11
- package/dist/datatype-validation.js +141 -3
- package/dist/define-plugin.d.ts +4 -4
- package/dist/define-plugin.js +5 -5
- package/dist/entitlement-entry.d.ts +1 -1
- package/dist/entitlement-entry.js +1 -1
- package/dist/entitlement-gate.d.ts +14 -0
- package/dist/entitlement-gate.js +64 -7
- package/dist/entitlement-plan.d.ts +6 -0
- package/dist/entitlement-plan.js +10 -0
- package/dist/entitlement-types.d.ts +36 -12
- package/dist/entitlement.d.ts +31 -4
- package/dist/entitlement.js +58 -17
- package/dist/hook-entry.d.ts +5 -0
- package/dist/hook-entry.js +30 -0
- package/dist/host-entry.d.ts +1 -1
- package/dist/host-entry.js +1 -1
- package/dist/index.d.ts +38 -4
- package/dist/index.js +54 -3
- package/dist/mail.d.ts +30 -0
- package/dist/mail.js +1 -0
- package/dist/manifest-entry.d.ts +29 -4
- package/dist/manifest-entry.js +39 -2
- package/dist/manifest-schema.d.ts +443 -29
- package/dist/manifest-schema.js +292 -24
- package/dist/manifest.d.ts +450 -51
- package/dist/manifest.js +1 -1
- package/dist/media/media-picker.js +33 -20
- package/dist/media/upload-error.d.ts +5 -1
- package/dist/media/upload-error.js +14 -2
- package/dist/media-library.d.ts +32 -0
- package/dist/media-library.js +15 -0
- package/dist/nested-field-host.d.ts +76 -0
- package/dist/nested-field-host.js +90 -0
- package/dist/notify.d.ts +12 -4
- package/dist/notify.js +1 -1
- package/dist/outbound.d.ts +47 -0
- package/dist/outbound.js +1 -0
- package/dist/plugin-context.d.ts +5 -0
- package/dist/plugin-context.js +3 -3
- package/dist/plugin-screen-context.d.ts +112 -0
- package/dist/plugin-screen-context.js +26 -0
- package/dist/providers.d.ts +268 -0
- package/dist/providers.js +74 -0
- package/dist/read-all-pages.d.ts +5 -0
- package/dist/read-all-pages.js +3 -2
- package/dist/register-built-ins.js +6 -6
- package/dist/registry.js +1 -1
- package/dist/richtext/block-panel.js +12 -7
- package/dist/richtext/extensions.js +7 -7
- package/dist/richtext/insert-menu.js +12 -9
- package/dist/richtext/style-listbox.js +7 -5
- package/dist/richtext/text-style-class.js +1 -1
- package/dist/sdk-strings.d.ts +285 -0
- package/dist/sdk-strings.js +347 -0
- package/dist/sealing.d.ts +14 -0
- package/dist/sealing.js +1 -0
- package/dist/simple-storage-value-provider.js +27 -27
- package/dist/structured-storage-types.d.ts +309 -9
- package/dist/structured-storage-types.js +2 -2
- package/dist/text-entry.d.ts +1 -0
- package/dist/text-entry.js +6 -0
- package/dist/tokens/tailwind-theme.css +5 -0
- package/dist/tokens/tokens.css +15 -3
- package/dist/tokens/tokens.json +8 -3
- package/dist/ui-entry.js +3 -3
- package/dist/views/asset-view.js +6 -3
- package/dist/views/content-list-preview.js +3 -1
- package/dist/views/content-list-settings-view.js +11 -7
- package/dist/views/content-list-view.d.ts +5 -3
- package/dist/views/content-list-view.js +38 -34
- package/dist/views/content-picker-view.d.ts +3 -0
- package/dist/views/content-picker-view.js +143 -0
- package/dist/views/crop-view.d.ts +4 -6
- package/dist/views/crop-view.js +22 -13
- package/dist/views/date-range-view.js +9 -6
- package/dist/views/file-upload-view.d.ts +5 -7
- package/dist/views/file-upload-view.js +16 -7
- package/dist/views/group-view.d.ts +8 -0
- package/dist/views/group-view.js +123 -0
- package/dist/views/html-code-editor.js +2 -2
- package/dist/views/html-view.js +12 -11
- package/dist/views/image-view.js +40 -22
- package/dist/views/link-view.d.ts +3 -0
- package/dist/views/link-view.js +150 -0
- package/dist/views/options-list-view.d.ts +3 -0
- package/dist/views/options-list-view.js +104 -0
- package/dist/views/repeatable-list-view.d.ts +3 -0
- package/dist/views/repeatable-list-view.js +113 -0
- package/dist/views/rich-text-view.js +32 -16
- package/dist/views/suggest-key.d.ts +17 -0
- package/dist/views/suggest-key.js +55 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-connections.schema.d.ts +215 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-connections.schema.js +179 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-context.schema.d.ts +12 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-context.schema.js +10 -0
- package/node_modules/@kardalum/api-schemas/dist/api-error.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.d.ts +10 -0
- package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.js +5 -0
- package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.d.ts +7 -1
- package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.js +4 -2
- package/node_modules/@kardalum/api-schemas/dist/auth.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/built-in-editor-ids.d.ts +1 -0
- package/node_modules/@kardalum/api-schemas/dist/built-in-editor-ids.js +27 -0
- package/node_modules/@kardalum/api-schemas/dist/capability-detail.d.ts +65 -0
- package/node_modules/@kardalum/api-schemas/dist/capability-detail.js +126 -0
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.d.ts +116 -3
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.js +71 -18
- package/node_modules/@kardalum/api-schemas/dist/content-list.schema.d.ts +57 -2
- package/node_modules/@kardalum/api-schemas/dist/content-list.schema.js +137 -0
- package/node_modules/@kardalum/api-schemas/dist/content-path.d.ts +1 -1
- package/node_modules/@kardalum/api-schemas/dist/content-path.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/content-search.schema.d.ts +50 -0
- package/node_modules/@kardalum/api-schemas/dist/content-search.schema.js +42 -0
- package/node_modules/@kardalum/api-schemas/dist/content-summary.schema.d.ts +37 -0
- package/node_modules/@kardalum/api-schemas/dist/content-summary.schema.js +19 -0
- package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.js +3 -3
- package/node_modules/@kardalum/api-schemas/dist/content-trash.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/content-unpublish.schema.d.ts +23 -0
- package/node_modules/@kardalum/api-schemas/dist/content-unpublish.schema.js +13 -0
- package/node_modules/@kardalum/api-schemas/dist/content.schema.d.ts +3 -0
- package/node_modules/@kardalum/api-schemas/dist/content.schema.js +10 -0
- package/node_modules/@kardalum/api-schemas/dist/contract-cancel.schema.d.ts +41 -0
- package/node_modules/@kardalum/api-schemas/dist/contract-cancel.schema.js +86 -0
- package/node_modules/@kardalum/api-schemas/dist/core-actions.d.ts +10 -5
- package/node_modules/@kardalum/api-schemas/dist/core-actions.js +7 -4
- package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.d.ts +25 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.js +9 -1
- package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.js +4 -4
- package/node_modules/@kardalum/api-schemas/dist/data-type-issue.d.ts +35 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-issue.js +60 -0
- package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.d.ts +267 -12
- package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +54 -8
- package/node_modules/@kardalum/api-schemas/dist/document-type.schema.d.ts +24 -6
- package/node_modules/@kardalum/api-schemas/dist/document-type.schema.js +98 -13
- package/node_modules/@kardalum/api-schemas/dist/form-protection.d.ts +23 -0
- package/node_modules/@kardalum/api-schemas/dist/form-protection.js +12 -0
- package/node_modules/@kardalum/api-schemas/dist/graphql-limits.d.ts +12 -0
- package/node_modules/@kardalum/api-schemas/dist/graphql-limits.js +14 -0
- package/node_modules/@kardalum/api-schemas/dist/held-embed-words.d.ts +23 -0
- package/node_modules/@kardalum/api-schemas/dist/held-embed-words.js +70 -0
- package/node_modules/@kardalum/api-schemas/dist/index.d.ts +122 -43
- package/node_modules/@kardalum/api-schemas/dist/index.js +92 -27
- package/node_modules/@kardalum/api-schemas/dist/install-sign-in-switched-off.schema.d.ts +9 -0
- package/node_modules/@kardalum/api-schemas/dist/install-sign-in-switched-off.schema.js +9 -0
- package/node_modules/@kardalum/api-schemas/dist/legal-anchors.d.ts +8 -0
- package/node_modules/@kardalum/api-schemas/dist/legal-anchors.js +9 -0
- package/node_modules/@kardalum/api-schemas/dist/licensing.schema.d.ts +63 -0
- package/node_modules/@kardalum/api-schemas/dist/licensing.schema.js +54 -0
- package/node_modules/@kardalum/api-schemas/dist/listing-categories.schema.d.ts +46 -0
- package/node_modules/@kardalum/api-schemas/dist/listing-categories.schema.js +52 -0
- package/node_modules/@kardalum/api-schemas/dist/mail-rules.d.ts +224 -0
- package/node_modules/@kardalum/api-schemas/dist/mail-rules.js +404 -0
- package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.d.ts +8 -0
- package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.js +4 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-leaks.schema.d.ts +145 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-leaks.schema.js +154 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.d.ts +359 -8
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +85 -11
- package/node_modules/@kardalum/api-schemas/dist/marketplace-package-api.schema.d.ts +15 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-package-api.schema.js +14 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-payouts.schema.d.ts +131 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-payouts.schema.js +272 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-profile.schema.d.ts +84 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-profile.schema.js +138 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-revocation.schema.d.ts +20 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-revocation.schema.js +49 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-sites.schema.d.ts +211 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-sites.schema.js +424 -0
- package/node_modules/@kardalum/api-schemas/dist/mcp-plugins.schema.d.ts +78 -0
- package/node_modules/@kardalum/api-schemas/dist/mcp-plugins.schema.js +27 -0
- package/node_modules/@kardalum/api-schemas/dist/mcp-tool-inputs.schema.d.ts +70 -0
- package/node_modules/@kardalum/api-schemas/dist/mcp-tool-inputs.schema.js +43 -0
- package/node_modules/@kardalum/api-schemas/dist/media-api.schema.d.ts +22 -0
- package/node_modules/@kardalum/api-schemas/dist/media-api.schema.js +22 -10
- package/node_modules/@kardalum/api-schemas/dist/media-move.schema.d.ts +75 -0
- package/node_modules/@kardalum/api-schemas/dist/media-move.schema.js +53 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference-api.schema.d.ts +2 -2
- package/node_modules/@kardalum/api-schemas/dist/media-reference.d.ts +2 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference.js +55 -0
- package/node_modules/@kardalum/api-schemas/dist/media.schema.d.ts +1 -0
- package/node_modules/@kardalum/api-schemas/dist/media.schema.js +9 -5
- package/node_modules/@kardalum/api-schemas/dist/nested-fields.schema.d.ts +204 -0
- package/node_modules/@kardalum/api-schemas/dist/nested-fields.schema.js +370 -0
- package/node_modules/@kardalum/api-schemas/dist/nested-validation.d.ts +53 -0
- package/node_modules/@kardalum/api-schemas/dist/nested-validation.js +284 -0
- package/node_modules/@kardalum/api-schemas/dist/news.schema.d.ts +5 -5
- package/node_modules/@kardalum/api-schemas/dist/node-access.schema.d.ts +1 -2
- package/node_modules/@kardalum/api-schemas/dist/node-access.schema.js +1 -2
- package/node_modules/@kardalum/api-schemas/dist/notification-kinds.d.ts +145 -0
- package/node_modules/@kardalum/api-schemas/dist/notification-kinds.js +177 -0
- package/node_modules/@kardalum/api-schemas/dist/notification.schema.d.ts +258 -7
- package/node_modules/@kardalum/api-schemas/dist/notification.schema.js +96 -5
- package/node_modules/@kardalum/api-schemas/dist/page-address.d.ts +10 -0
- package/node_modules/@kardalum/api-schemas/dist/page-address.js +7 -0
- package/node_modules/@kardalum/api-schemas/dist/password-reset.schema.d.ts +34 -0
- package/node_modules/@kardalum/api-schemas/dist/password-reset.schema.js +60 -0
- package/node_modules/@kardalum/api-schemas/dist/plan-editor.schema.d.ts +28 -3
- package/node_modules/@kardalum/api-schemas/dist/plan-editor.schema.js +55 -8
- package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.d.ts +12 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.js +13 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-caller.d.ts +23 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-caller.js +16 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-cli-commands.d.ts +76 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-cli-commands.js +316 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-content-access.d.ts +42 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-content-access.js +74 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-data-type-configs.d.ts +31 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-data-type-configs.js +131 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.d.ts +26 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-text.js +1 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs.d.ts +26 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs.js +13 -5
- package/node_modules/@kardalum/api-schemas/dist/plugin-document-types.d.ts +228 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-document-types.js +41 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-durable-hooks.d.ts +26 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-durable-hooks.js +55 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-editor-extensions.d.ts +40 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-editor-extensions.js +124 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-field-info.d.ts +41 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-field-info.js +51 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-graphql-fields.d.ts +32 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-graphql-fields.js +102 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-held-embeds.d.ts +107 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-held-embeds.js +213 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-https-origin.d.ts +5 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-https-origin.js +21 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.d.ts +4 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.js +3 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.d.ts +44 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.js +38 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-install.d.ts +237 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-install.js +205 -6
- package/node_modules/@kardalum/api-schemas/dist/plugin-labels.d.ts +26 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-labels.js +29 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-locales.d.ts +32 -8
- package/node_modules/@kardalum/api-schemas/dist/plugin-locales.js +120 -14
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.d.ts +357 -4
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +279 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.d.ts +16 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.js +34 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-ai.d.ts +40 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-ai.js +139 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.d.ts +22 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.js +31 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-media-access.d.ts +25 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-media-access.js +43 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-outbound.d.ts +107 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-outbound.js +150 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-package-build.schema.d.ts +5 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-package-build.schema.js +7 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-providers.d.ts +310 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-providers.js +430 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-read-only.schema.d.ts +4 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-read-only.schema.js +2 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-sealed-values.d.ts +45 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-sealed-values.js +99 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-secrets.d.ts +68 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-secrets.js +114 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-settings.d.ts +342 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-settings.js +400 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-site-extensions.d.ts +180 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-site-extensions.js +612 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.d.ts +7 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.js +50 -7
- package/node_modules/@kardalum/api-schemas/dist/plugin-tasks.d.ts +45 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-tasks.js +197 -0
- package/node_modules/@kardalum/api-schemas/dist/plural-rules.d.ts +9 -0
- package/node_modules/@kardalum/api-schemas/dist/plural-rules.js +41 -0
- package/node_modules/@kardalum/api-schemas/dist/public-api.schema.d.ts +41 -0
- package/node_modules/@kardalum/api-schemas/dist/public-api.schema.js +100 -12
- package/node_modules/@kardalum/api-schemas/dist/refund-request.schema.d.ts +189 -0
- package/node_modules/@kardalum/api-schemas/dist/refund-request.schema.js +164 -0
- package/node_modules/@kardalum/api-schemas/dist/render-editing.d.ts +4 -4
- package/node_modules/@kardalum/api-schemas/dist/render-editing.js +4 -4
- package/node_modules/@kardalum/api-schemas/dist/render-settings-api.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/revenue-view.schema.js +7 -3
- package/node_modules/@kardalum/api-schemas/dist/rich-text-shape.d.ts +6 -0
- package/node_modules/@kardalum/api-schemas/dist/rich-text-shape.js +82 -0
- package/node_modules/@kardalum/api-schemas/dist/rich-text-text.d.ts +66 -0
- package/node_modules/@kardalum/api-schemas/dist/rich-text-text.js +497 -0
- package/node_modules/@kardalum/api-schemas/dist/sale-conditions.schema.d.ts +82 -0
- package/node_modules/@kardalum/api-schemas/dist/sale-conditions.schema.js +99 -0
- package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.d.ts +13 -0
- package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.js +28 -0
- package/node_modules/@kardalum/api-schemas/dist/sandbox-attach.schema.d.ts +91 -1
- package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.d.ts +289 -0
- package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.js +205 -0
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +121 -0
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.js +51 -10
- package/node_modules/@kardalum/api-schemas/dist/sign-in.schema.d.ts +384 -0
- package/node_modules/@kardalum/api-schemas/dist/sign-in.schema.js +616 -0
- package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.d.ts +3 -3
- package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.d.ts +1 -1
- package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/structured-duplicate-key.d.ts +13 -0
- package/node_modules/@kardalum/api-schemas/dist/structured-duplicate-key.js +26 -0
- package/node_modules/@kardalum/api-schemas/dist/structured-fields.schema.d.ts +66 -0
- package/node_modules/@kardalum/api-schemas/dist/structured-fields.schema.js +160 -0
- package/node_modules/@kardalum/api-schemas/dist/template-api.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/template.schema.d.ts +1 -0
- package/node_modules/@kardalum/api-schemas/dist/template.schema.js +3 -0
- package/node_modules/@kardalum/api-schemas/dist/theme-api.schema.d.ts +1 -1
- package/node_modules/@kardalum/api-schemas/dist/theme-api.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/transaction-rolled-back.d.ts +13 -0
- package/node_modules/@kardalum/api-schemas/dist/transaction-rolled-back.js +29 -0
- package/node_modules/@kardalum/api-schemas/dist/trash-purge.schema.d.ts +13 -0
- package/node_modules/@kardalum/api-schemas/dist/trash-purge.schema.js +6 -0
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.d.ts +58 -1
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +35 -4
- package/node_modules/@kardalum/api-schemas/dist/vendor-service.schema.d.ts +5 -1
- package/node_modules/@kardalum/api-schemas/dist/vendor-service.schema.js +4 -3
- package/node_modules/@kardalum/api-schemas/package.json +1 -0
- package/node_modules/@kardalum/design-tokens/dist/build-css.d.ts +1 -1
- package/node_modules/@kardalum/design-tokens/dist/build-css.js +8 -2
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.css +5 -0
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.d.ts +1 -1
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.js +3 -3
- package/node_modules/@kardalum/design-tokens/dist/theme-css.d.ts +2 -2
- package/node_modules/@kardalum/design-tokens/dist/theme-css.js +2 -2
- package/node_modules/@kardalum/design-tokens/dist/theme-types.d.ts +2 -2
- package/node_modules/@kardalum/design-tokens/dist/themes/dark.d.ts +3 -3
- package/node_modules/@kardalum/design-tokens/dist/themes/dark.js +3 -3
- package/node_modules/@kardalum/design-tokens/dist/themes/light.d.ts +1 -1
- package/node_modules/@kardalum/design-tokens/dist/themes/light.js +1 -1
- package/node_modules/@kardalum/design-tokens/dist/tokens.css +15 -3
- package/node_modules/@kardalum/design-tokens/dist/tokens.d.ts +4 -4
- package/node_modules/@kardalum/design-tokens/dist/tokens.js +17 -8
- package/node_modules/@kardalum/design-tokens/dist/tokens.json +8 -3
- package/node_modules/@kardalum/design-tokens/dist/types.d.ts +2 -2
- package/node_modules/@kardalum/design-tokens/dist/types.js +1 -1
- package/node_modules/@kardalum/plugin-package/dist/build-reference.d.ts +21 -2
- package/node_modules/@kardalum/plugin-package/dist/build-reference.js +8 -2
- package/node_modules/@kardalum/plugin-package/dist/capabilities.d.ts +17 -10
- package/node_modules/@kardalum/plugin-package/dist/capabilities.js +355 -22
- package/node_modules/@kardalum/plugin-package/dist/client-bundle.d.ts +1 -1
- package/node_modules/@kardalum/plugin-package/dist/client-bundle.js +2 -0
- package/node_modules/@kardalum/plugin-package/dist/cms-range.d.ts +17 -0
- package/node_modules/@kardalum/plugin-package/dist/cms-range.js +353 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/ai-declarations.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/ai-declarations.js +26 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.d.ts +1 -1
- package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.js +3 -2
- package/node_modules/@kardalum/plugin-package/dist/delivery/content-access.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/content-access.js +34 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.js +2 -2
- package/node_modules/@kardalum/plugin-package/dist/delivery/editor-extensions.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/editor-extensions.js +27 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/graphql-fields.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/graphql-fields.js +22 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/index.d.ts +1 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/index.js +1 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/label-languages.js +47 -5
- package/node_modules/@kardalum/plugin-package/dist/delivery/licence-check.d.ts +27 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/licence-check.js +95 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/locales.js +9 -4
- package/node_modules/@kardalum/plugin-package/dist/delivery/plugin-settings.d.ts +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/plugin-settings.js +68 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/providers.d.ts +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/providers.js +298 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/registry.js +27 -5
- package/node_modules/@kardalum/plugin-package/dist/delivery/sample-content.js +91 -2
- package/node_modules/@kardalum/plugin-package/dist/delivery/server-powers.d.ts +6 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/server-powers.js +140 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/site-extensions.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/site-extensions.js +36 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/templates.d.ts +1 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/templates.js +21 -1
- package/node_modules/@kardalum/plugin-package/dist/delivery/types.d.ts +10 -0
- package/node_modules/@kardalum/plugin-package/dist/envelope.d.ts +2 -2
- package/node_modules/@kardalum/plugin-package/dist/envelope.js +2 -2
- package/node_modules/@kardalum/plugin-package/dist/extract.d.ts +3 -3
- package/node_modules/@kardalum/plugin-package/dist/extract.js +9 -9
- package/node_modules/@kardalum/plugin-package/dist/hash.d.ts +1 -1
- package/node_modules/@kardalum/plugin-package/dist/hash.js +1 -1
- package/node_modules/@kardalum/plugin-package/dist/index.d.ts +4 -2
- package/node_modules/@kardalum/plugin-package/dist/index.js +2 -1
- package/node_modules/@kardalum/plugin-package/dist/license-verdict.d.ts +75 -0
- package/node_modules/@kardalum/plugin-package/dist/license-verdict.js +123 -0
- package/node_modules/@kardalum/plugin-package/dist/package-contract.d.ts +2 -2
- package/node_modules/@kardalum/plugin-package/dist/package-contract.js +5 -5
- package/node_modules/@kardalum/plugin-package/dist/types.d.ts +1 -1
- package/node_modules/@kardalum/ui/dist/components/alert-dialog.d.ts +1 -1
- package/node_modules/@kardalum/ui/dist/components/alert-dialog.js +8 -3
- package/node_modules/@kardalum/ui/dist/components/badge.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/button.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/dialog.d.ts +1 -1
- package/node_modules/@kardalum/ui/dist/components/dialog.js +49 -4
- package/node_modules/@kardalum/ui/dist/components/dropdown-menu.d.ts +5 -1
- package/node_modules/@kardalum/ui/dist/components/dropdown-menu.js +18 -5
- package/node_modules/@kardalum/ui/dist/components/empty-state.d.ts +4 -4
- package/node_modules/@kardalum/ui/dist/components/input.js +6 -1
- package/node_modules/@kardalum/ui/dist/components/property-field.js +3 -3
- package/node_modules/@kardalum/ui/dist/components/sheet.d.ts +1 -1
- package/node_modules/@kardalum/ui/dist/components/sheet.js +12 -7
- package/node_modules/@kardalum/ui/dist/components/skeleton.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/switch.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/tab-strip.d.ts +3 -3
- package/node_modules/@kardalum/ui/dist/components/toast.js +4 -3
- package/node_modules/@kardalum/ui/dist/components/tooltip.d.ts +27 -0
- package/node_modules/@kardalum/ui/dist/components/tooltip.js +81 -0
- package/node_modules/@kardalum/ui/dist/components/truncated-text.d.ts +16 -0
- package/node_modules/@kardalum/ui/dist/components/truncated-text.js +95 -0
- package/node_modules/@kardalum/ui/dist/components/use-toast.js +2 -2
- package/node_modules/@kardalum/ui/dist/index.d.ts +3 -1
- package/node_modules/@kardalum/ui/dist/index.js +3 -1
- package/node_modules/@kardalum/ui/dist/lib/menu-host.d.ts +5 -0
- package/node_modules/@kardalum/ui/dist/lib/menu-host.js +17 -0
- package/node_modules/@kardalum/ui/package.json +8 -6
- package/package.json +18 -7
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** D3: at most this many active plugins are answered, by id; `truncated` says when more were active. */
|
|
3
|
+
export declare const MCP_PLUGINS_MAX = 100;
|
|
4
|
+
export declare const McpPluginToolSchema: z.ZodObject<{
|
|
5
|
+
name: z.ZodString;
|
|
6
|
+
description: z.ZodString;
|
|
7
|
+
inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
8
|
+
method: z.ZodEnum<{
|
|
9
|
+
GET: "GET";
|
|
10
|
+
POST: "POST";
|
|
11
|
+
PUT: "PUT";
|
|
12
|
+
PATCH: "PATCH";
|
|
13
|
+
DELETE: "DELETE";
|
|
14
|
+
}>;
|
|
15
|
+
path: z.ZodString;
|
|
16
|
+
action: z.ZodString;
|
|
17
|
+
parts: z.ZodObject<{
|
|
18
|
+
params: z.ZodArray<z.ZodString>;
|
|
19
|
+
query: z.ZodArray<z.ZodString>;
|
|
20
|
+
body: z.ZodArray<z.ZodString>;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
export type McpPluginTool = z.infer<typeof McpPluginToolSchema>;
|
|
24
|
+
export declare const McpPluginEntrySchema: z.ZodObject<{
|
|
25
|
+
pluginId: z.ZodString;
|
|
26
|
+
name: z.ZodString;
|
|
27
|
+
version: z.ZodString;
|
|
28
|
+
context: z.ZodNullable<z.ZodString>;
|
|
29
|
+
tools: z.ZodArray<z.ZodObject<{
|
|
30
|
+
name: z.ZodString;
|
|
31
|
+
description: z.ZodString;
|
|
32
|
+
inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
33
|
+
method: z.ZodEnum<{
|
|
34
|
+
GET: "GET";
|
|
35
|
+
POST: "POST";
|
|
36
|
+
PUT: "PUT";
|
|
37
|
+
PATCH: "PATCH";
|
|
38
|
+
DELETE: "DELETE";
|
|
39
|
+
}>;
|
|
40
|
+
path: z.ZodString;
|
|
41
|
+
action: z.ZodString;
|
|
42
|
+
parts: z.ZodObject<{
|
|
43
|
+
params: z.ZodArray<z.ZodString>;
|
|
44
|
+
query: z.ZodArray<z.ZodString>;
|
|
45
|
+
body: z.ZodArray<z.ZodString>;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
}, z.core.$strip>>;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
export type McpPluginEntry = z.infer<typeof McpPluginEntrySchema>;
|
|
50
|
+
export declare const McpPluginsResponseSchema: z.ZodObject<{
|
|
51
|
+
plugins: z.ZodArray<z.ZodObject<{
|
|
52
|
+
pluginId: z.ZodString;
|
|
53
|
+
name: z.ZodString;
|
|
54
|
+
version: z.ZodString;
|
|
55
|
+
context: z.ZodNullable<z.ZodString>;
|
|
56
|
+
tools: z.ZodArray<z.ZodObject<{
|
|
57
|
+
name: z.ZodString;
|
|
58
|
+
description: z.ZodString;
|
|
59
|
+
inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
60
|
+
method: z.ZodEnum<{
|
|
61
|
+
GET: "GET";
|
|
62
|
+
POST: "POST";
|
|
63
|
+
PUT: "PUT";
|
|
64
|
+
PATCH: "PATCH";
|
|
65
|
+
DELETE: "DELETE";
|
|
66
|
+
}>;
|
|
67
|
+
path: z.ZodString;
|
|
68
|
+
action: z.ZodString;
|
|
69
|
+
parts: z.ZodObject<{
|
|
70
|
+
params: z.ZodArray<z.ZodString>;
|
|
71
|
+
query: z.ZodArray<z.ZodString>;
|
|
72
|
+
body: z.ZodArray<z.ZodString>;
|
|
73
|
+
}, z.core.$strip>;
|
|
74
|
+
}, z.core.$strip>>;
|
|
75
|
+
}, z.core.$strip>>;
|
|
76
|
+
truncated: z.ZodBoolean;
|
|
77
|
+
}, z.core.$strip>;
|
|
78
|
+
export type McpPluginsResponse = z.infer<typeof McpPluginsResponseSchema>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { API_ROUTE_METHODS } from "./plugin-manifest-api-routes.js";
|
|
3
|
+
// M31.5 D (D3): GET /api/manage/v1/mcp/plugins, what the active plugins offer an MCP host:
|
|
4
|
+
// each one's context for the AI and the tools whose action the calling credential holds, with
|
|
5
|
+
// the input schema the server derived from the route's own Zod and the input's three parts.
|
|
6
|
+
/** D3: at most this many active plugins are answered, by id; `truncated` says when more were active. */
|
|
7
|
+
export const MCP_PLUGINS_MAX = 100;
|
|
8
|
+
export const McpPluginToolSchema = z.object({
|
|
9
|
+
/** The full name the host sees, `<short name>_<name>`. */
|
|
10
|
+
name: z.string(),
|
|
11
|
+
description: z.string(),
|
|
12
|
+
inputSchema: z.record(z.string(), z.unknown()),
|
|
13
|
+
method: z.enum(API_ROUTE_METHODS),
|
|
14
|
+
/** The route's own path, relative to /api/plugins/<plugin id>, `:name` segments included. */
|
|
15
|
+
path: z.string(),
|
|
16
|
+
action: z.string(),
|
|
17
|
+
/** Which input keys go to the path, the query string and the body. */
|
|
18
|
+
parts: z.object({ params: z.array(z.string()), query: z.array(z.string()), body: z.array(z.string()) }),
|
|
19
|
+
});
|
|
20
|
+
export const McpPluginEntrySchema = z.object({
|
|
21
|
+
pluginId: z.string(),
|
|
22
|
+
name: z.string(),
|
|
23
|
+
version: z.string(),
|
|
24
|
+
context: z.string().nullable(),
|
|
25
|
+
tools: z.array(McpPluginToolSchema),
|
|
26
|
+
});
|
|
27
|
+
export const McpPluginsResponseSchema = z.object({ plugins: z.array(McpPluginEntrySchema), truncated: z.boolean() });
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const MCP_PAGE_SIZE = 50;
|
|
3
|
+
export declare const MCP_MARKDOWN_MAX_BYTES = 524288;
|
|
4
|
+
export declare const MCP_UPLOAD_MAX_BYTES = 20971520;
|
|
5
|
+
/** The reserved "help for AI" note on a type and on a field (session B stores them). */
|
|
6
|
+
export declare const MCP_HELP_MAX_CHARS = 500;
|
|
7
|
+
export declare const MCP_TOOL_INPUT_SCHEMAS: {
|
|
8
|
+
readonly list_page_types: z.ZodObject<{}, z.core.$strict>;
|
|
9
|
+
readonly find_pages: z.ZodObject<{
|
|
10
|
+
query: z.ZodOptional<z.ZodString>;
|
|
11
|
+
type: z.ZodOptional<z.ZodString>;
|
|
12
|
+
state: z.ZodOptional<z.ZodEnum<{
|
|
13
|
+
published: "published";
|
|
14
|
+
draft: "draft";
|
|
15
|
+
trashed: "trashed";
|
|
16
|
+
}>>;
|
|
17
|
+
parent: z.ZodOptional<z.ZodString>;
|
|
18
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
19
|
+
}, z.core.$strict>;
|
|
20
|
+
readonly get_page: z.ZodObject<{
|
|
21
|
+
id: z.ZodString;
|
|
22
|
+
culture: z.ZodOptional<z.ZodString>;
|
|
23
|
+
}, z.core.$strict>;
|
|
24
|
+
readonly create_page: z.ZodObject<{
|
|
25
|
+
type: z.ZodString;
|
|
26
|
+
parent: z.ZodString;
|
|
27
|
+
name: z.ZodString;
|
|
28
|
+
fields: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
29
|
+
culture: z.ZodOptional<z.ZodString>;
|
|
30
|
+
}, z.core.$strict>;
|
|
31
|
+
readonly update_page: z.ZodObject<{
|
|
32
|
+
id: z.ZodString;
|
|
33
|
+
fields: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
34
|
+
culture: z.ZodOptional<z.ZodString>;
|
|
35
|
+
}, z.core.$strict>;
|
|
36
|
+
readonly preview_page: z.ZodObject<{
|
|
37
|
+
id: z.ZodString;
|
|
38
|
+
}, z.core.$strict>;
|
|
39
|
+
readonly publish_page: z.ZodObject<{
|
|
40
|
+
id: z.ZodString;
|
|
41
|
+
}, z.core.$strict>;
|
|
42
|
+
readonly unpublish_page: z.ZodObject<{
|
|
43
|
+
id: z.ZodString;
|
|
44
|
+
}, z.core.$strict>;
|
|
45
|
+
readonly move_page: z.ZodObject<{
|
|
46
|
+
id: z.ZodString;
|
|
47
|
+
parent: z.ZodString;
|
|
48
|
+
position: z.ZodOptional<z.ZodNumber>;
|
|
49
|
+
}, z.core.$strict>;
|
|
50
|
+
readonly trash_page: z.ZodObject<{
|
|
51
|
+
id: z.ZodString;
|
|
52
|
+
}, z.core.$strict>;
|
|
53
|
+
readonly translate_page: z.ZodObject<{
|
|
54
|
+
id: z.ZodString;
|
|
55
|
+
culture: z.ZodString;
|
|
56
|
+
fields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
57
|
+
}, z.core.$strict>;
|
|
58
|
+
readonly list_media: z.ZodObject<{
|
|
59
|
+
query: z.ZodOptional<z.ZodString>;
|
|
60
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
61
|
+
}, z.core.$strict>;
|
|
62
|
+
readonly upload_media: z.ZodObject<{
|
|
63
|
+
url: z.ZodOptional<z.ZodString>;
|
|
64
|
+
file: z.ZodOptional<z.ZodString>;
|
|
65
|
+
name: z.ZodString;
|
|
66
|
+
alt: z.ZodOptional<z.ZodString>;
|
|
67
|
+
}, z.core.$strict>;
|
|
68
|
+
};
|
|
69
|
+
export type McpToolName = keyof typeof MCP_TOOL_INPUT_SCHEMAS;
|
|
70
|
+
export type McpToolInput<N extends McpToolName> = z.infer<(typeof MCP_TOOL_INPUT_SCHEMAS)[N]>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// M31.5 A (D3): the inputs of the MCP tools `kardalum mcp` offers (and session B's
|
|
3
|
+
// remote address will), fixed here so sessions B and D reuse the names. The tools
|
|
4
|
+
// package sends each as JSON Schema to the host through Zod's toJSONSchema; every
|
|
5
|
+
// object is strict, so a key the tool does not know is refused by name.
|
|
6
|
+
export const MCP_PAGE_SIZE = 50;
|
|
7
|
+
export const MCP_MARKDOWN_MAX_BYTES = 524_288;
|
|
8
|
+
export const MCP_UPLOAD_MAX_BYTES = 20_971_520;
|
|
9
|
+
/** The reserved "help for AI" note on a type and on a field (session B stores them). */
|
|
10
|
+
export const MCP_HELP_MAX_CHARS = 500;
|
|
11
|
+
const PageId = z.string().uuid();
|
|
12
|
+
/** A page id, a stored path such as /menu/soup, or "root". */
|
|
13
|
+
const ParentRef = z.string().min(1).max(2000);
|
|
14
|
+
const Culture = z.string().min(2).max(35);
|
|
15
|
+
const Fields = z.record(z.string().min(1).max(200), z.unknown());
|
|
16
|
+
const Cursor = z.string().min(1).max(300);
|
|
17
|
+
/** A file as base64: at most the upload cap once decoded. */
|
|
18
|
+
const Base64File = z.string().min(1).max(Math.ceil(MCP_UPLOAD_MAX_BYTES / 3) * 4 + 4);
|
|
19
|
+
export const MCP_TOOL_INPUT_SCHEMAS = {
|
|
20
|
+
list_page_types: z.object({}).strict(),
|
|
21
|
+
find_pages: z
|
|
22
|
+
.object({
|
|
23
|
+
query: z.string().max(200).optional(),
|
|
24
|
+
type: z.string().min(1).max(200).optional(),
|
|
25
|
+
state: z.enum(["draft", "published", "trashed"]).optional(),
|
|
26
|
+
parent: ParentRef.optional(),
|
|
27
|
+
cursor: Cursor.optional(),
|
|
28
|
+
})
|
|
29
|
+
.strict(),
|
|
30
|
+
get_page: z.object({ id: PageId, culture: Culture.optional() }).strict(),
|
|
31
|
+
create_page: z.object({ type: z.string().min(1).max(200), parent: ParentRef, name: z.string().min(1).max(200), fields: Fields, culture: Culture.optional() }).strict(),
|
|
32
|
+
update_page: z.object({ id: PageId, fields: Fields, culture: Culture.optional() }).strict(),
|
|
33
|
+
preview_page: z.object({ id: PageId }).strict(),
|
|
34
|
+
publish_page: z.object({ id: PageId }).strict(),
|
|
35
|
+
unpublish_page: z.object({ id: PageId }).strict(),
|
|
36
|
+
move_page: z.object({ id: PageId, parent: ParentRef, position: z.number().int().min(0).max(10_000).optional() }).strict(),
|
|
37
|
+
trash_page: z.object({ id: PageId }).strict(),
|
|
38
|
+
translate_page: z.object({ id: PageId, culture: Culture, fields: Fields.optional() }).strict(),
|
|
39
|
+
list_media: z.object({ query: z.string().max(200).optional(), cursor: Cursor.optional() }).strict(),
|
|
40
|
+
upload_media: z
|
|
41
|
+
.object({ url: z.string().url().max(2000).optional(), file: Base64File.optional(), name: z.string().min(1).max(255), alt: z.string().max(500).optional() })
|
|
42
|
+
.strict(),
|
|
43
|
+
};
|
|
@@ -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,11 +1,12 @@
|
|
|
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
|
|
6
7
|
// optional (omitted/undefined = create at the library root). Duplicate
|
|
7
8
|
// name under the same parent -> 409, enforced by a real database
|
|
8
|
-
// constraint as of the fix wave (HIGH-1
|
|
9
|
+
// constraint as of the fix wave (HIGH-1: see media-service.ts's
|
|
9
10
|
// MediaFolderNameConflictError doc comment and schema.prisma's
|
|
10
11
|
// MediaFolder comment), surfaced through the service, not validated
|
|
11
12
|
// here.
|
|
@@ -19,7 +20,7 @@ export const CreateMediaFolderRequestSchema = z.object({
|
|
|
19
20
|
// folder. The cycle-guard (a folder cannot move under its own descendant)
|
|
20
21
|
// and the depth cap are enforced in the service, not here. `.refine`
|
|
21
22
|
// restores a 400 on a body with NEITHER field present (F5, final-review
|
|
22
|
-
// follow-up wave)
|
|
23
|
+
// follow-up wave), same reasoning and wording as UpdateMediaRequestSchema
|
|
23
24
|
// below's own `.refine`: an empty `{}` PATCH validates fine on its own and
|
|
24
25
|
// does nothing, which looks like a successful no-op update rather than
|
|
25
26
|
// the mistake it almost certainly is.
|
|
@@ -60,7 +61,7 @@ export const MediaFolderListResponseSchema = z.object({
|
|
|
60
61
|
// response rather than trusted from storage: for a PUBLIC item it's
|
|
61
62
|
// identical to the persisted `url` field (permanent, no query string);
|
|
62
63
|
// for a PRIVATE item it's that same path plus a freshly minted,
|
|
63
|
-
// short-lived `?token=` (S186c §3's signed media link)
|
|
64
|
+
// short-lived `?token=` (S186c §3's signed media link), a new one every
|
|
64
65
|
// response, so this value is for immediate use (rendering an `<img src>`
|
|
65
66
|
// now), not for persisting.
|
|
66
67
|
export const MediaFileResponseSchema = MediaFileSchema.extend({
|
|
@@ -83,18 +84,18 @@ export const MediaDeleteResponseSchema = z.object({
|
|
|
83
84
|
success: z.literal(true),
|
|
84
85
|
});
|
|
85
86
|
// PATCH /api/manage/v1/media/:id body (S186c §2, folderId added S186e §2; renamed
|
|
86
|
-
// from UpdateMediaVisibilityRequestSchema in the fix wave
|
|
87
|
+
// from UpdateMediaVisibilityRequestSchema in the fix wave: it carries
|
|
87
88
|
// both visibility and folderId now, not just visibility, and the old
|
|
88
89
|
// name stopped describing it). Both fields optional and independent, same
|
|
89
90
|
// "absent = don't touch" idiom as UpdateMediaFolderRequestSchema above:
|
|
90
91
|
// visibility absent = don't flip it; folderId absent = don't move the
|
|
91
92
|
// file; folderId null = move to the library root; folderId a uuid = move
|
|
92
|
-
// under that folder (the service validates the folder exists first
|
|
93
|
-
// binding obligation 2 from the S186e Task 1 review
|
|
93
|
+
// under that folder (the service validates the folder exists first,
|
|
94
|
+
// binding obligation 2 from the S186e Task 1 review, rather than letting
|
|
94
95
|
// a bad id 500 out of the FK). `.refine` restores a 400 on a body with
|
|
95
96
|
// NEITHER field present: back when this schema only carried visibility
|
|
96
97
|
// (required, S186c), an empty body already 400'd for free; making both
|
|
97
|
-
// fields optional independently (S186e) silently dropped that
|
|
98
|
+
// fields optional independently (S186e) silently dropped that: an empty
|
|
98
99
|
// `{}` PATCH validated fine and did nothing. This puts it back explicitly
|
|
99
100
|
// rather than leaving a request that changes nothing looking like a
|
|
100
101
|
// successful update.
|
|
@@ -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
|
|
@@ -133,9 +134,9 @@ export const UpdateMediaRequestSchema = z
|
|
|
133
134
|
// page's last item. `search` filters by filename substring,
|
|
134
135
|
// case-insensitive. `folderId` (S186e §2) is a folder filter: ABSENT
|
|
135
136
|
// keeps the pre-S186e all-files behavior (compatibility-pinned by a
|
|
136
|
-
// dedicated test
|
|
137
|
+
// dedicated test: existing callers must see no change), "root" matches
|
|
137
138
|
// files with no folder AND files whose folderId dangles (binding
|
|
138
|
-
// obligation 3 from the S186e Task 1 review
|
|
139
|
+
// obligation 3 from the S186e Task 1 review: a damaged folderId must
|
|
139
140
|
// resurface at root, never vanish), a uuid matches exactly that folder.
|
|
140
141
|
export const MediaListQuerySchema = z.object({
|
|
141
142
|
cursor: z.string().uuid().optional(),
|
|
@@ -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<{
|