@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
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type CreateDocumentTypeRequest } from "./document-type-api.schema.js";
|
|
3
|
+
/** A field's or a tab's name: a plain string as the core API takes it, or a label map. */
|
|
4
|
+
export declare const PluginFieldNameSchema: z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
|
|
5
|
+
en: z.ZodString;
|
|
6
|
+
}, z.core.$catchall<z.ZodString>>, unknown>]>;
|
|
7
|
+
/** A field's help for AI: a note as the core API takes it, or a map of notes of the same length. */
|
|
8
|
+
export declare const PluginHelpLabelSchema: z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
|
|
9
|
+
en: z.ZodString;
|
|
10
|
+
}, z.core.$catchall<z.ZodString>>, unknown>]>;
|
|
11
|
+
export declare const PluginDocumentTypeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
12
|
+
name: z.ZodString;
|
|
13
|
+
icon: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
14
|
+
kind: z.ZodLiteral<"page">;
|
|
15
|
+
treeRules: z.ZodObject<{
|
|
16
|
+
allowedAtRoot: z.ZodBoolean;
|
|
17
|
+
allowedParents: z.ZodUnion<readonly [z.ZodLiteral<"any">, z.ZodArray<z.ZodString>]>;
|
|
18
|
+
allowedChildren: z.ZodUnion<readonly [z.ZodLiteral<"any">, z.ZodArray<z.ZodString>]>;
|
|
19
|
+
}, z.core.$strict>;
|
|
20
|
+
help: z.ZodOptional<z.ZodString>;
|
|
21
|
+
translationMandatory: z.ZodOptional<z.ZodBoolean>;
|
|
22
|
+
collection: z.ZodOptional<z.ZodBoolean>;
|
|
23
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
24
|
+
id: z.ZodString;
|
|
25
|
+
datatypeId: z.ZodString;
|
|
26
|
+
validation: z.ZodOptional<z.ZodObject<{
|
|
27
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
28
|
+
minLength: z.ZodOptional<z.ZodNumber>;
|
|
29
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
30
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
31
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
32
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
33
|
+
}, z.core.$strict>>;
|
|
34
|
+
tabId: z.ZodOptional<z.ZodString>;
|
|
35
|
+
varies: z.ZodOptional<z.ZodBoolean>;
|
|
36
|
+
private: z.ZodOptional<z.ZodBoolean>;
|
|
37
|
+
name: z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
|
|
38
|
+
en: z.ZodString;
|
|
39
|
+
}, z.core.$catchall<z.ZodString>>, unknown>]>;
|
|
40
|
+
help: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
|
|
41
|
+
en: z.ZodString;
|
|
42
|
+
}, z.core.$catchall<z.ZodString>>, unknown>]>>;
|
|
43
|
+
}, z.core.$strict>>;
|
|
44
|
+
tabs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
45
|
+
id: z.ZodString;
|
|
46
|
+
name: z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
|
|
47
|
+
en: z.ZodString;
|
|
48
|
+
}, z.core.$catchall<z.ZodString>>, unknown>]>;
|
|
49
|
+
}, z.core.$strict>>>;
|
|
50
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
51
|
+
name: z.ZodString;
|
|
52
|
+
icon: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
53
|
+
kind: z.ZodLiteral<"element">;
|
|
54
|
+
help: z.ZodOptional<z.ZodString>;
|
|
55
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
56
|
+
id: z.ZodString;
|
|
57
|
+
datatypeId: z.ZodString;
|
|
58
|
+
validation: z.ZodOptional<z.ZodObject<{
|
|
59
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
60
|
+
minLength: z.ZodOptional<z.ZodNumber>;
|
|
61
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
62
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
63
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
64
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
65
|
+
}, z.core.$strict>>;
|
|
66
|
+
tabId: z.ZodOptional<z.ZodString>;
|
|
67
|
+
varies: z.ZodOptional<z.ZodBoolean>;
|
|
68
|
+
private: z.ZodOptional<z.ZodBoolean>;
|
|
69
|
+
name: z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
|
|
70
|
+
en: z.ZodString;
|
|
71
|
+
}, z.core.$catchall<z.ZodString>>, unknown>]>;
|
|
72
|
+
help: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
|
|
73
|
+
en: z.ZodString;
|
|
74
|
+
}, z.core.$catchall<z.ZodString>>, unknown>]>>;
|
|
75
|
+
}, z.core.$strict>>;
|
|
76
|
+
tabs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
77
|
+
id: z.ZodString;
|
|
78
|
+
name: z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
|
|
79
|
+
en: z.ZodString;
|
|
80
|
+
}, z.core.$catchall<z.ZodString>>, unknown>]>;
|
|
81
|
+
}, z.core.$strict>>>;
|
|
82
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
83
|
+
name: z.ZodString;
|
|
84
|
+
icon: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
85
|
+
kind: z.ZodLiteral<"media">;
|
|
86
|
+
help: z.ZodOptional<z.ZodString>;
|
|
87
|
+
sortOrder: z.ZodOptional<z.ZodNumber>;
|
|
88
|
+
catchAll: z.ZodOptional<z.ZodBoolean>;
|
|
89
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
90
|
+
id: z.ZodString;
|
|
91
|
+
datatypeId: z.ZodString;
|
|
92
|
+
validation: z.ZodOptional<z.ZodObject<{
|
|
93
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
94
|
+
minLength: z.ZodOptional<z.ZodNumber>;
|
|
95
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
96
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
97
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
98
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
99
|
+
}, z.core.$strict>>;
|
|
100
|
+
tabId: z.ZodOptional<z.ZodString>;
|
|
101
|
+
varies: z.ZodOptional<z.ZodBoolean>;
|
|
102
|
+
private: z.ZodOptional<z.ZodBoolean>;
|
|
103
|
+
name: z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
|
|
104
|
+
en: z.ZodString;
|
|
105
|
+
}, z.core.$catchall<z.ZodString>>, unknown>]>;
|
|
106
|
+
help: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
|
|
107
|
+
en: z.ZodString;
|
|
108
|
+
}, z.core.$catchall<z.ZodString>>, unknown>]>>;
|
|
109
|
+
}, z.core.$strict>>;
|
|
110
|
+
tabs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
111
|
+
id: z.ZodString;
|
|
112
|
+
name: z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
|
|
113
|
+
en: z.ZodString;
|
|
114
|
+
}, z.core.$catchall<z.ZodString>>, unknown>]>;
|
|
115
|
+
}, z.core.$strict>>>;
|
|
116
|
+
}, z.core.$strict>], "kind">;
|
|
117
|
+
export declare const PluginDocumentTypesSchema: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
118
|
+
name: z.ZodString;
|
|
119
|
+
icon: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
120
|
+
kind: z.ZodLiteral<"page">;
|
|
121
|
+
treeRules: z.ZodObject<{
|
|
122
|
+
allowedAtRoot: z.ZodBoolean;
|
|
123
|
+
allowedParents: z.ZodUnion<readonly [z.ZodLiteral<"any">, z.ZodArray<z.ZodString>]>;
|
|
124
|
+
allowedChildren: z.ZodUnion<readonly [z.ZodLiteral<"any">, z.ZodArray<z.ZodString>]>;
|
|
125
|
+
}, z.core.$strict>;
|
|
126
|
+
help: z.ZodOptional<z.ZodString>;
|
|
127
|
+
translationMandatory: z.ZodOptional<z.ZodBoolean>;
|
|
128
|
+
collection: z.ZodOptional<z.ZodBoolean>;
|
|
129
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
130
|
+
id: z.ZodString;
|
|
131
|
+
datatypeId: z.ZodString;
|
|
132
|
+
validation: z.ZodOptional<z.ZodObject<{
|
|
133
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
134
|
+
minLength: z.ZodOptional<z.ZodNumber>;
|
|
135
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
136
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
137
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
138
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
139
|
+
}, z.core.$strict>>;
|
|
140
|
+
tabId: z.ZodOptional<z.ZodString>;
|
|
141
|
+
varies: z.ZodOptional<z.ZodBoolean>;
|
|
142
|
+
private: z.ZodOptional<z.ZodBoolean>;
|
|
143
|
+
name: z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
|
|
144
|
+
en: z.ZodString;
|
|
145
|
+
}, z.core.$catchall<z.ZodString>>, unknown>]>;
|
|
146
|
+
help: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
|
|
147
|
+
en: z.ZodString;
|
|
148
|
+
}, z.core.$catchall<z.ZodString>>, unknown>]>>;
|
|
149
|
+
}, z.core.$strict>>;
|
|
150
|
+
tabs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
151
|
+
id: z.ZodString;
|
|
152
|
+
name: z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
|
|
153
|
+
en: z.ZodString;
|
|
154
|
+
}, z.core.$catchall<z.ZodString>>, unknown>]>;
|
|
155
|
+
}, z.core.$strict>>>;
|
|
156
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
157
|
+
name: z.ZodString;
|
|
158
|
+
icon: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
159
|
+
kind: z.ZodLiteral<"element">;
|
|
160
|
+
help: z.ZodOptional<z.ZodString>;
|
|
161
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
162
|
+
id: z.ZodString;
|
|
163
|
+
datatypeId: z.ZodString;
|
|
164
|
+
validation: z.ZodOptional<z.ZodObject<{
|
|
165
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
166
|
+
minLength: z.ZodOptional<z.ZodNumber>;
|
|
167
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
168
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
169
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
170
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
171
|
+
}, z.core.$strict>>;
|
|
172
|
+
tabId: z.ZodOptional<z.ZodString>;
|
|
173
|
+
varies: z.ZodOptional<z.ZodBoolean>;
|
|
174
|
+
private: z.ZodOptional<z.ZodBoolean>;
|
|
175
|
+
name: z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
|
|
176
|
+
en: z.ZodString;
|
|
177
|
+
}, z.core.$catchall<z.ZodString>>, unknown>]>;
|
|
178
|
+
help: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
|
|
179
|
+
en: z.ZodString;
|
|
180
|
+
}, z.core.$catchall<z.ZodString>>, unknown>]>>;
|
|
181
|
+
}, z.core.$strict>>;
|
|
182
|
+
tabs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
183
|
+
id: z.ZodString;
|
|
184
|
+
name: z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
|
|
185
|
+
en: z.ZodString;
|
|
186
|
+
}, z.core.$catchall<z.ZodString>>, unknown>]>;
|
|
187
|
+
}, z.core.$strict>>>;
|
|
188
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
189
|
+
name: z.ZodString;
|
|
190
|
+
icon: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
191
|
+
kind: z.ZodLiteral<"media">;
|
|
192
|
+
help: z.ZodOptional<z.ZodString>;
|
|
193
|
+
sortOrder: z.ZodOptional<z.ZodNumber>;
|
|
194
|
+
catchAll: z.ZodOptional<z.ZodBoolean>;
|
|
195
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
196
|
+
id: z.ZodString;
|
|
197
|
+
datatypeId: z.ZodString;
|
|
198
|
+
validation: z.ZodOptional<z.ZodObject<{
|
|
199
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
200
|
+
minLength: z.ZodOptional<z.ZodNumber>;
|
|
201
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
202
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
203
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
204
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
205
|
+
}, z.core.$strict>>;
|
|
206
|
+
tabId: z.ZodOptional<z.ZodString>;
|
|
207
|
+
varies: z.ZodOptional<z.ZodBoolean>;
|
|
208
|
+
private: z.ZodOptional<z.ZodBoolean>;
|
|
209
|
+
name: z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
|
|
210
|
+
en: z.ZodString;
|
|
211
|
+
}, z.core.$catchall<z.ZodString>>, unknown>]>;
|
|
212
|
+
help: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
|
|
213
|
+
en: z.ZodString;
|
|
214
|
+
}, z.core.$catchall<z.ZodString>>, unknown>]>>;
|
|
215
|
+
}, z.core.$strict>>;
|
|
216
|
+
tabs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
217
|
+
id: z.ZodString;
|
|
218
|
+
name: z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
|
|
219
|
+
en: z.ZodString;
|
|
220
|
+
}, z.core.$catchall<z.ZodString>>, unknown>]>;
|
|
221
|
+
}, z.core.$strict>>>;
|
|
222
|
+
}, z.core.$strict>], "kind">>;
|
|
223
|
+
export type PluginDocumentType = z.output<typeof PluginDocumentTypeSchema>;
|
|
224
|
+
export type PluginFieldName = z.output<typeof PluginFieldNameSchema>;
|
|
225
|
+
/** Whether a value is a field's help as a manifest may write it (a note, or a map of notes). */
|
|
226
|
+
export declare function isPluginHelpLabel(value: unknown): boolean;
|
|
227
|
+
/** The type as the core API takes it: each map resolved in `language` (else English, which every map carries). */
|
|
228
|
+
export declare function resolvePluginDocumentType(type: PluginDocumentType, language: string): CreateDocumentTypeRequest;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { CreateDocumentTypeRequestSchema, validateFieldsAndTabs } from "./document-type-api.schema.js";
|
|
3
|
+
import { FieldDefinitionSchema, HelpForAiSchema, TabDefinitionSchema } from "./document-type.schema.js";
|
|
4
|
+
import { MCP_HELP_MAX_CHARS } from "./mcp-tool-inputs.schema.js";
|
|
5
|
+
import { labelMapSchema, pluginLabelMapSchema, resolveLabel } from "./plugin-labels.js";
|
|
6
|
+
// M33 K12 (Shop 4.1 C4, consolidation 3.16): the document types a plugin's manifest declares. A
|
|
7
|
+
// field's `name` and `help` and a tab's `name` may be a label map (`{ en, de?, ar?, ... }`, English
|
|
8
|
+
// required), resolved to plain strings in the site's default language when the install or an update
|
|
9
|
+
// writes the type. The type's own `name` stays a plain string, because it is an identifier
|
|
10
|
+
// (`contentAccess`, `templates` and code name the type by it), and so does every field id. The core
|
|
11
|
+
// document type API (CreateDocumentTypeRequestSchema) stays plain strings: this schema is the
|
|
12
|
+
// manifest's only. Declared data types (`dataTypeConfigs`) keep plain names: there the name is the
|
|
13
|
+
// key other declarations reference.
|
|
14
|
+
/** A field's or a tab's name: a plain string as the core API takes it, or a label map. */
|
|
15
|
+
export const PluginFieldNameSchema = z.union([z.string().min(1), pluginLabelMapSchema()]);
|
|
16
|
+
/** A field's help for AI: a note as the core API takes it, or a map of notes of the same length. */
|
|
17
|
+
export const PluginHelpLabelSchema = z.union([HelpForAiSchema, labelMapSchema({ max: MCP_HELP_MAX_CHARS })]);
|
|
18
|
+
const PluginFieldSchema = FieldDefinitionSchema.extend({ name: PluginFieldNameSchema, help: PluginHelpLabelSchema.optional() });
|
|
19
|
+
const PluginTabSchema = TabDefinitionSchema.extend({ name: PluginFieldNameSchema });
|
|
20
|
+
const labelled = { fields: z.array(PluginFieldSchema), tabs: z.array(PluginTabSchema).default([]) };
|
|
21
|
+
const [pageBranch, elementBranch, mediaBranch] = CreateDocumentTypeRequestSchema.options;
|
|
22
|
+
export const PluginDocumentTypeSchema = z
|
|
23
|
+
.discriminatedUnion("kind", [pageBranch.extend(labelled), elementBranch.extend(labelled), mediaBranch.extend(labelled)])
|
|
24
|
+
.superRefine(validateFieldsAndTabs);
|
|
25
|
+
export const PluginDocumentTypesSchema = z.array(PluginDocumentTypeSchema);
|
|
26
|
+
/** Whether a value is a field's help as a manifest may write it (a note, or a map of notes). */
|
|
27
|
+
export function isPluginHelpLabel(value) {
|
|
28
|
+
return PluginHelpLabelSchema.safeParse(value).success;
|
|
29
|
+
}
|
|
30
|
+
/** The type as the core API takes it: each map resolved in `language` (else English, which every map carries). */
|
|
31
|
+
export function resolvePluginDocumentType(type, language) {
|
|
32
|
+
const text = (label) => resolveLabel(label, language);
|
|
33
|
+
return {
|
|
34
|
+
...type,
|
|
35
|
+
fields: type.fields.map((field) => {
|
|
36
|
+
const { help, ...rest } = field;
|
|
37
|
+
return help === undefined ? { ...rest, name: text(field.name) } : { ...rest, name: text(field.name), help: text(help) };
|
|
38
|
+
}),
|
|
39
|
+
...(type.tabs === undefined ? {} : { tabs: type.tabs.map((tab) => ({ ...tab, name: text(tab.name) })) }),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** Tries an event gets before it is given up (and audited as `plugin.event.givenUp`). */
|
|
2
|
+
export declare const DURABLE_EVENT_TRIES = 4;
|
|
3
|
+
/** The wait before the next try after the first, second and third failed one. */
|
|
4
|
+
export declare const DURABLE_RETRY_DELAYS_MS: readonly [60000, 300000, 1800000];
|
|
5
|
+
/** The write batch is flushed this often ... */
|
|
6
|
+
export declare const DURABLE_FLUSH_MS = 200;
|
|
7
|
+
/** ... or as soon as it holds this many rows, in one insert. */
|
|
8
|
+
export declare const DURABLE_FLUSH_ROWS = 100;
|
|
9
|
+
/** How long a running try holds its row before the replay may take it again. */
|
|
10
|
+
export declare const DURABLE_CLAIM_MS = 300000;
|
|
11
|
+
/** How often the replay runs, on the instance holding the lease. */
|
|
12
|
+
export declare const DURABLE_REPLAY_EVERY_MS = 30000;
|
|
13
|
+
/** The most rows one replay pass takes. */
|
|
14
|
+
export declare const DURABLE_REPLAY_BATCH = 500;
|
|
15
|
+
/** A row is deleted this long after the replay first offered it to its handler (`offeredAt`). */
|
|
16
|
+
export declare const DURABLE_ROW_MAX_AGE_MS = 86400000;
|
|
17
|
+
/** The most rows one plugin keeps waiting; past it a live event runs in memory only and a held one (its lane was full) is dropped. */
|
|
18
|
+
export declare const DURABLE_WAITING_MAX = 10000;
|
|
19
|
+
/**
|
|
20
|
+
* The wait before the next try once `failedTries` tries have failed (1, 2 or 3), or null when the
|
|
21
|
+
* event is given up (`failedTries` of DURABLE_EVENT_TRIES or more) or the count is no whole
|
|
22
|
+
* number of at least 1.
|
|
23
|
+
*/
|
|
24
|
+
export declare function durableRetryDelayMs(failedTries: number): number | null;
|
|
25
|
+
/** The 19 events a plugin may hook (the SDK's HOOK_EVENTS is this list), and the only ones a `hooks` entry may name, durable or not. */
|
|
26
|
+
export declare const PLUGIN_HOOK_EVENTS: readonly ["content:afterSave", "content:afterPublish", "content:afterTrash", "content:afterRestore", "content:afterUnpublish", "content:afterMove", "media:afterUpload", "media:afterTrash", "media:afterDelete", "user:afterLogin", "user:afterCreate", "user:afterDelete", "settings:afterChange", "plugin:afterInstall", "plugin:afterUninstall", "plugin:afterUpdate", "plugin:afterActivate", "plugin:afterDeactivate", "audit:afterRecord"];
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// M33 K18 (Webhooks 2.11 C3): durable hook events. A `hooks` value written
|
|
2
|
+
// `{ handler, durable: true }` keeps each raised event in the core table `plugin_hook_outbox` until
|
|
3
|
+
// the handler settles: written in batches, replayed on one instance, retried after 1, 5 and 30
|
|
4
|
+
// minutes, given up after the fourth failed try. Delivery is at least once. These are the limits the
|
|
5
|
+
// server's outbox writer and replay read, and the docs print.
|
|
6
|
+
/** Tries an event gets before it is given up (and audited as `plugin.event.givenUp`). */
|
|
7
|
+
export const DURABLE_EVENT_TRIES = 4;
|
|
8
|
+
/** The wait before the next try after the first, second and third failed one. */
|
|
9
|
+
export const DURABLE_RETRY_DELAYS_MS = [60_000, 300_000, 1_800_000];
|
|
10
|
+
/** The write batch is flushed this often ... */
|
|
11
|
+
export const DURABLE_FLUSH_MS = 200;
|
|
12
|
+
/** ... or as soon as it holds this many rows, in one insert. */
|
|
13
|
+
export const DURABLE_FLUSH_ROWS = 100;
|
|
14
|
+
/** How long a running try holds its row before the replay may take it again. */
|
|
15
|
+
export const DURABLE_CLAIM_MS = 300_000;
|
|
16
|
+
/** How often the replay runs, on the instance holding the lease. */
|
|
17
|
+
export const DURABLE_REPLAY_EVERY_MS = 30_000;
|
|
18
|
+
/** The most rows one replay pass takes. */
|
|
19
|
+
export const DURABLE_REPLAY_BATCH = 500;
|
|
20
|
+
/** A row is deleted this long after the replay first offered it to its handler (`offeredAt`). */
|
|
21
|
+
export const DURABLE_ROW_MAX_AGE_MS = 86_400_000;
|
|
22
|
+
/** The most rows one plugin keeps waiting; past it a live event runs in memory only and a held one (its lane was full) is dropped. */
|
|
23
|
+
export const DURABLE_WAITING_MAX = 10_000;
|
|
24
|
+
/**
|
|
25
|
+
* The wait before the next try once `failedTries` tries have failed (1, 2 or 3), or null when the
|
|
26
|
+
* event is given up (`failedTries` of DURABLE_EVENT_TRIES or more) or the count is no whole
|
|
27
|
+
* number of at least 1.
|
|
28
|
+
*/
|
|
29
|
+
export function durableRetryDelayMs(failedTries) {
|
|
30
|
+
if (!Number.isInteger(failedTries) || failedTries < 1 || failedTries >= DURABLE_EVENT_TRIES)
|
|
31
|
+
return null;
|
|
32
|
+
return DURABLE_RETRY_DELAYS_MS[failedTries - 1];
|
|
33
|
+
}
|
|
34
|
+
/** The 19 events a plugin may hook (the SDK's HOOK_EVENTS is this list), and the only ones a `hooks` entry may name, durable or not. */
|
|
35
|
+
export const PLUGIN_HOOK_EVENTS = [
|
|
36
|
+
"content:afterSave",
|
|
37
|
+
"content:afterPublish",
|
|
38
|
+
"content:afterTrash",
|
|
39
|
+
"content:afterRestore",
|
|
40
|
+
"content:afterUnpublish",
|
|
41
|
+
"content:afterMove",
|
|
42
|
+
"media:afterUpload",
|
|
43
|
+
"media:afterTrash",
|
|
44
|
+
"media:afterDelete",
|
|
45
|
+
"user:afterLogin",
|
|
46
|
+
"user:afterCreate",
|
|
47
|
+
"user:afterDelete",
|
|
48
|
+
"settings:afterChange",
|
|
49
|
+
"plugin:afterInstall",
|
|
50
|
+
"plugin:afterUninstall",
|
|
51
|
+
"plugin:afterUpdate",
|
|
52
|
+
"plugin:afterActivate",
|
|
53
|
+
"plugin:afterDeactivate",
|
|
54
|
+
"audit:afterRecord",
|
|
55
|
+
];
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** M32 F3 (D1): the most editor panels one plugin may declare. */
|
|
2
|
+
export declare const EDITOR_PANELS_MAX = 5;
|
|
3
|
+
/** M32 F3 (D7): the most tree actions one plugin may declare. */
|
|
4
|
+
export declare const TREE_ACTIONS_MAX = 5;
|
|
5
|
+
/** M32 F3 (D1): the longest editor panel or tree action id. */
|
|
6
|
+
export declare const EDITOR_SLOT_ID_MAX = 40;
|
|
7
|
+
/** M32 F3 (D1): the most document type names one panel or tree action may list. */
|
|
8
|
+
export declare const EDITOR_SLOT_TYPES_MAX = 50;
|
|
9
|
+
/** M32 F3 (D1): the longest document type name a panel or tree action may list. */
|
|
10
|
+
export declare const EDITOR_SLOT_TYPE_NAME_MAX = 100;
|
|
11
|
+
/** M32 F3 (D4): how long the editor waits after the last change before it hands a panel the new values. */
|
|
12
|
+
export declare const EDITOR_PANEL_VALUES_DEBOUNCE_MS = 300;
|
|
13
|
+
/** M32 F4c (D11): the most fields one `propose` call from an editor panel checks; the rest are refused. */
|
|
14
|
+
export declare const PANEL_PROPOSE_FIELDS_MAX = 20;
|
|
15
|
+
/** M32 F4c (D11): the largest value, as UTF-8 JSON, an editor panel may propose for one field. */
|
|
16
|
+
export declare const PANEL_PROPOSE_VALUE_BYTES_MAX = 262144;
|
|
17
|
+
/** M32 F4c (D11): why the editor refused a field an editor panel proposed. */
|
|
18
|
+
export declare const PANEL_PROPOSE_REFUSALS: readonly ["unknownField", "notAllowed", "invalid", "tooLarge", "readOnly", "focused"];
|
|
19
|
+
/** M32 F4c (D11): one reason a proposed field was refused. */
|
|
20
|
+
export type PanelProposeRefusal = (typeof PANEL_PROPOSE_REFUSALS)[number];
|
|
21
|
+
/** M32 F3 (D10): the longest message a tree action's view may show when it closes. */
|
|
22
|
+
export declare const TREE_ACTION_MESSAGE_MAX = 200;
|
|
23
|
+
/** M32 F3 (D14): the settings areas a settings write route reports its change under. M32 F4d (D6):
|
|
24
|
+
* `plugin` is one plugin's own settings, reported with its `pluginId`. M32 H: `mail` is Server
|
|
25
|
+
* settings, Mail (the SMTP settings, and a plugin's form reply switch with its `pluginId`). */
|
|
26
|
+
export declare const SETTINGS_CHANGE_AREAS: readonly ["render", "cultures", "nav", "aiContext", "sites", "server", "auditRetention", "notificationRetention", "siteReach", "signIn", "plugin", "mail"];
|
|
27
|
+
/** M32 F3 (D14): one settings area. */
|
|
28
|
+
export type SettingsChangeArea = (typeof SETTINGS_CHANGE_AREAS)[number];
|
|
29
|
+
/** M32 F3 (D1): an issue found in a plugin's editor panels or tree actions. */
|
|
30
|
+
export interface EditorExtensionIssue {
|
|
31
|
+
path: (string | number)[];
|
|
32
|
+
message: string;
|
|
33
|
+
}
|
|
34
|
+
/** M32 F3 (D1): true for 1 to 40 lower-case letters, digits and "-", starting with a letter. */
|
|
35
|
+
export declare function isEditorSlotId(value: string): boolean;
|
|
36
|
+
/** M32 F3 (D1, D7): the shape rules for a manifest's editorPanels and treeActions beyond label, action and view. */
|
|
37
|
+
export declare function checkEditorExtensionDeclarations(manifest: {
|
|
38
|
+
id?: unknown;
|
|
39
|
+
contributions?: unknown;
|
|
40
|
+
}): EditorExtensionIssue[];
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { hasNoControlCharacter } from "./strict-url.js";
|
|
2
|
+
// M32 F3: the rules and limits for what a plugin adds to the content editor
|
|
3
|
+
// and the content tree. An editor panel shows beside an existing page's
|
|
4
|
+
// editor; a tree action adds an item to a tree row's menu. Both name an
|
|
5
|
+
// action (the action machinery in plugin-manifest-actions.ts checks it) and
|
|
6
|
+
// a view (the manifest schema checks it); this module checks the rest. Every
|
|
7
|
+
// character rule below is a loop over a length-capped string, never a
|
|
8
|
+
// pattern match.
|
|
9
|
+
/** M32 F3 (D1): the most editor panels one plugin may declare. */
|
|
10
|
+
export const EDITOR_PANELS_MAX = 5;
|
|
11
|
+
/** M32 F3 (D7): the most tree actions one plugin may declare. */
|
|
12
|
+
export const TREE_ACTIONS_MAX = 5;
|
|
13
|
+
/** M32 F3 (D1): the longest editor panel or tree action id. */
|
|
14
|
+
export const EDITOR_SLOT_ID_MAX = 40;
|
|
15
|
+
/** M32 F3 (D1): the most document type names one panel or tree action may list. */
|
|
16
|
+
export const EDITOR_SLOT_TYPES_MAX = 50;
|
|
17
|
+
/** M32 F3 (D1): the longest document type name a panel or tree action may list. */
|
|
18
|
+
export const EDITOR_SLOT_TYPE_NAME_MAX = 100;
|
|
19
|
+
/** M32 F3 (D4): how long the editor waits after the last change before it hands a panel the new values. */
|
|
20
|
+
export const EDITOR_PANEL_VALUES_DEBOUNCE_MS = 300;
|
|
21
|
+
/** M32 F4c (D11): the most fields one `propose` call from an editor panel checks; the rest are refused. */
|
|
22
|
+
export const PANEL_PROPOSE_FIELDS_MAX = 20;
|
|
23
|
+
/** M32 F4c (D11): the largest value, as UTF-8 JSON, an editor panel may propose for one field. */
|
|
24
|
+
export const PANEL_PROPOSE_VALUE_BYTES_MAX = 262_144;
|
|
25
|
+
/** M32 F4c (D11): why the editor refused a field an editor panel proposed. */
|
|
26
|
+
export const PANEL_PROPOSE_REFUSALS = ["unknownField", "notAllowed", "invalid", "tooLarge", "readOnly", "focused"];
|
|
27
|
+
/** M32 F3 (D10): the longest message a tree action's view may show when it closes. */
|
|
28
|
+
export const TREE_ACTION_MESSAGE_MAX = 200;
|
|
29
|
+
/** M32 F3 (D14): the settings areas a settings write route reports its change under. M32 F4d (D6):
|
|
30
|
+
* `plugin` is one plugin's own settings, reported with its `pluginId`. M32 H: `mail` is Server
|
|
31
|
+
* settings, Mail (the SMTP settings, and a plugin's form reply switch with its `pluginId`). */
|
|
32
|
+
export const SETTINGS_CHANGE_AREAS = [
|
|
33
|
+
"render", "cultures", "nav", "aiContext", "sites", "server",
|
|
34
|
+
"auditRetention", "notificationRetention", "siteReach", "signIn", "plugin", "mail",
|
|
35
|
+
];
|
|
36
|
+
/** M32 F3 (D1): true for 1 to 40 lower-case letters, digits and "-", starting with a letter. */
|
|
37
|
+
export function isEditorSlotId(value) {
|
|
38
|
+
if (value.length < 1 || value.length > EDITOR_SLOT_ID_MAX)
|
|
39
|
+
return false;
|
|
40
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
41
|
+
const code = value.charCodeAt(index);
|
|
42
|
+
const letter = code >= 0x61 && code <= 0x7a;
|
|
43
|
+
if (index === 0) {
|
|
44
|
+
if (!letter)
|
|
45
|
+
return false;
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
const digit = code >= 0x30 && code <= 0x39;
|
|
49
|
+
if (!letter && !digit && code !== 0x2d)
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
const KEYS = [
|
|
55
|
+
{ key: "editorPanels", max: EDITOR_PANELS_MAX, noun: "editor panel" },
|
|
56
|
+
{ key: "treeActions", max: TREE_ACTIONS_MAX, noun: "tree action" },
|
|
57
|
+
];
|
|
58
|
+
function documentTypesIssue(value) {
|
|
59
|
+
if (!Array.isArray(value))
|
|
60
|
+
return "documentTypes must be a list of document type names";
|
|
61
|
+
if (value.length < 1 || value.length > EDITOR_SLOT_TYPES_MAX) {
|
|
62
|
+
return `documentTypes must list 1 to ${EDITOR_SLOT_TYPES_MAX} document type names; leave it out to mean every type`;
|
|
63
|
+
}
|
|
64
|
+
const seen = new Set();
|
|
65
|
+
for (const name of value) {
|
|
66
|
+
if (typeof name !== "string" || name.length < 1 || name.length > EDITOR_SLOT_TYPE_NAME_MAX) {
|
|
67
|
+
return `each document type name must be 1 to ${EDITOR_SLOT_TYPE_NAME_MAX} characters`;
|
|
68
|
+
}
|
|
69
|
+
if (!hasNoControlCharacter(name))
|
|
70
|
+
return "a document type name must hold no control character";
|
|
71
|
+
if (seen.has(name))
|
|
72
|
+
return `document type "${name}" is listed more than once`;
|
|
73
|
+
seen.add(name);
|
|
74
|
+
}
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
/** M32 F3 (D1, D7): the shape rules for a manifest's editorPanels and treeActions beyond label, action and view. */
|
|
78
|
+
export function checkEditorExtensionDeclarations(manifest) {
|
|
79
|
+
const issues = [];
|
|
80
|
+
const contributions = manifest.contributions;
|
|
81
|
+
if (!contributions || typeof contributions !== "object")
|
|
82
|
+
return issues;
|
|
83
|
+
const record = contributions;
|
|
84
|
+
for (const { key, max, noun } of KEYS) {
|
|
85
|
+
if (!(key in record) || record[key] === undefined)
|
|
86
|
+
continue;
|
|
87
|
+
const entries = record[key];
|
|
88
|
+
const keyPath = ["contributions", key];
|
|
89
|
+
if (!Array.isArray(entries)) {
|
|
90
|
+
issues.push({ path: keyPath, message: `${key} must be a list` });
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
if (entries.length > max) {
|
|
94
|
+
issues.push({ path: keyPath, message: `a plugin may declare at most ${max} ${noun}s; this one declares ${entries.length}` });
|
|
95
|
+
}
|
|
96
|
+
const seen = new Set();
|
|
97
|
+
entries.forEach((entry, index) => {
|
|
98
|
+
if (!entry || typeof entry !== "object" || Array.isArray(entry)) {
|
|
99
|
+
issues.push({ path: [...keyPath, index], message: `each ${noun} must be an object` });
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
const item = entry;
|
|
103
|
+
const entryId = item.id;
|
|
104
|
+
if (typeof entryId !== "string" || !isEditorSlotId(entryId)) {
|
|
105
|
+
issues.push({
|
|
106
|
+
path: [...keyPath, index, "id"],
|
|
107
|
+
message: `${noun} id must be 1 to ${EDITOR_SLOT_ID_MAX} lower-case letters, digits and "-", starting with a letter`,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
else if (seen.has(entryId)) {
|
|
111
|
+
issues.push({ path: [...keyPath, index, "id"], message: `${noun} "${entryId}" is declared more than once` });
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
seen.add(entryId);
|
|
115
|
+
}
|
|
116
|
+
if ("documentTypes" in item && item.documentTypes !== undefined) {
|
|
117
|
+
const problem = documentTypesIssue(item.documentTypes);
|
|
118
|
+
if (problem)
|
|
119
|
+
issues.push({ path: [...keyPath, index, "documentTypes"], message: problem });
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
return issues;
|
|
124
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { FieldDefinition } from "./document-type.schema.js";
|
|
2
|
+
import type { DataTypeTree } from "./nested-fields.schema.js";
|
|
3
|
+
/** What a field holds: its editor id, and for a Group or a list what is inside it (core part 5). */
|
|
4
|
+
export interface PluginFieldShape {
|
|
5
|
+
/** The editor id a plugin declares under `dataTypes`, never a data type row id. */
|
|
6
|
+
dataType: string;
|
|
7
|
+
/** A Group's sub-fields, in order; `shape` is null for a sub-type that is missing or cannot nest. */
|
|
8
|
+
group?: {
|
|
9
|
+
fields: Array<{
|
|
10
|
+
alias: string;
|
|
11
|
+
name: string;
|
|
12
|
+
shape: PluginFieldShape | null;
|
|
13
|
+
}>;
|
|
14
|
+
};
|
|
15
|
+
/** A list's item type; null when the list names none or it is missing. */
|
|
16
|
+
list?: {
|
|
17
|
+
item: PluginFieldShape | null;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/** One field of a page's document type: its id (the key in `data`), its name, and what it holds. */
|
|
21
|
+
export interface PluginFieldInfo extends PluginFieldShape {
|
|
22
|
+
id: string;
|
|
23
|
+
name: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* M33 K21 step 3: what a data type tree tells a plugin, by an allow-list copy: the editor id, and
|
|
27
|
+
* for a Group its sub-fields' aliases, names and shapes, for a list its item's shape. No settings,
|
|
28
|
+
* data type ids, bounds or requiredness at any level. Null for no tree or a data type that is gone.
|
|
29
|
+
* A top-level id no data type answers is a legacy field naming its editor (as every resolver reads
|
|
30
|
+
* it) unless it is a data type row id, whose row is gone.
|
|
31
|
+
*/
|
|
32
|
+
export declare function pluginFieldShape(tree: DataTypeTree | null | undefined): PluginFieldShape | null;
|
|
33
|
+
/**
|
|
34
|
+
* M33 K21: the one builder of a public read's `fields` (the published page reader, the page head
|
|
35
|
+
* and the serializer context): the type's fields in order, its private fields left out (month 32
|
|
36
|
+
* J7, as the read's `data` leaves them out), and a field whose data type is gone left out.
|
|
37
|
+
* `treeOf` answers a field's data type tree by its data type id.
|
|
38
|
+
*/
|
|
39
|
+
export declare function publicPluginFields(fields: readonly FieldDefinition[], treeOf: (dataTypeId: string) => DataTypeTree | null | undefined): PluginFieldInfo[];
|
|
40
|
+
/** A frozen copy of `fields`, every level frozen, so a plugin that writes to it changes nothing. */
|
|
41
|
+
export declare function frozenPluginFields(fields: readonly PluginFieldInfo[]): ReadonlyArray<Readonly<PluginFieldInfo>>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { UuidStringSchema } from "./uuid.schema.js";
|
|
2
|
+
/**
|
|
3
|
+
* M33 K21 step 3: what a data type tree tells a plugin, by an allow-list copy: the editor id, and
|
|
4
|
+
* for a Group its sub-fields' aliases, names and shapes, for a list its item's shape. No settings,
|
|
5
|
+
* data type ids, bounds or requiredness at any level. Null for no tree or a data type that is gone.
|
|
6
|
+
* A top-level id no data type answers is a legacy field naming its editor (as every resolver reads
|
|
7
|
+
* it) unless it is a data type row id, whose row is gone.
|
|
8
|
+
*/
|
|
9
|
+
export function pluginFieldShape(tree) {
|
|
10
|
+
if (!tree)
|
|
11
|
+
return null;
|
|
12
|
+
if (tree.missing === true)
|
|
13
|
+
return UuidStringSchema.safeParse(tree.dataTypeId).success ? null : { dataType: tree.editorId };
|
|
14
|
+
const shape = { dataType: tree.editorId };
|
|
15
|
+
if (tree.group) {
|
|
16
|
+
shape.group = { fields: tree.group.fields.map((field) => ({ alias: field.alias, name: field.name, shape: pluginFieldShape(field.type) })) };
|
|
17
|
+
}
|
|
18
|
+
if (tree.list)
|
|
19
|
+
shape.list = { item: pluginFieldShape(tree.list.item) };
|
|
20
|
+
return shape;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* M33 K21: the one builder of a public read's `fields` (the published page reader, the page head
|
|
24
|
+
* and the serializer context): the type's fields in order, its private fields left out (month 32
|
|
25
|
+
* J7, as the read's `data` leaves them out), and a field whose data type is gone left out.
|
|
26
|
+
* `treeOf` answers a field's data type tree by its data type id.
|
|
27
|
+
*/
|
|
28
|
+
export function publicPluginFields(fields, treeOf) {
|
|
29
|
+
const listed = [];
|
|
30
|
+
for (const field of fields) {
|
|
31
|
+
if (field.private === true)
|
|
32
|
+
continue;
|
|
33
|
+
const shape = pluginFieldShape(treeOf(field.datatypeId));
|
|
34
|
+
if (shape)
|
|
35
|
+
listed.push({ id: field.id, name: field.name, ...shape });
|
|
36
|
+
}
|
|
37
|
+
return listed;
|
|
38
|
+
}
|
|
39
|
+
/** A frozen copy of `fields`, every level frozen, so a plugin that writes to it changes nothing. */
|
|
40
|
+
export function frozenPluginFields(fields) {
|
|
41
|
+
// Plain JSON at every level (strings, null, arrays, objects), so a JSON copy is a whole copy.
|
|
42
|
+
const freeze = (value) => {
|
|
43
|
+
if (value !== null && typeof value === "object") {
|
|
44
|
+
for (const inner of Object.values(value))
|
|
45
|
+
freeze(inner);
|
|
46
|
+
Object.freeze(value);
|
|
47
|
+
}
|
|
48
|
+
return value;
|
|
49
|
+
};
|
|
50
|
+
return freeze(JSON.parse(JSON.stringify(fields)));
|
|
51
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/** D12: the most GraphQL fields one plugin offers. */
|
|
2
|
+
export declare const PLUGIN_GRAPHQL_FIELDS_MAX = 10;
|
|
3
|
+
/** D14: the most arguments one field takes. */
|
|
4
|
+
export declare const PLUGIN_GRAPHQL_ARGUMENTS_MAX = 30;
|
|
5
|
+
/** D17: what one plugin field selection costs in the complexity rule (a core field costs 1). */
|
|
6
|
+
export declare const PLUGIN_GRAPHQL_FIELD_COST = 25;
|
|
7
|
+
/** D17: the most plugin field selections one operation makes, aliases counted. */
|
|
8
|
+
export declare const PLUGIN_GRAPHQL_FIELDS_PER_OPERATION = 10;
|
|
9
|
+
/** D17: how long a field waits for its route before it errors. */
|
|
10
|
+
export declare const PLUGIN_GRAPHQL_FIELD_TIMEOUT_MS = 10000;
|
|
11
|
+
/** D17: the largest route answer a field resolves to (1 MiB). */
|
|
12
|
+
export declare const PLUGIN_GRAPHQL_ANSWER_MAX_BYTES = 1048576;
|
|
13
|
+
/** D16: the longest route message a field's error carries. */
|
|
14
|
+
export declare const PLUGIN_GRAPHQL_MESSAGE_MAX = 200;
|
|
15
|
+
/** D15: the longest query string a field's arguments make; a longer call is refused before the route runs. */
|
|
16
|
+
export declare const PLUGIN_GRAPHQL_QUERY_MAX = 8192;
|
|
17
|
+
export interface PluginGraphqlFieldIssue {
|
|
18
|
+
path: (string | number)[];
|
|
19
|
+
message: string;
|
|
20
|
+
}
|
|
21
|
+
/** D12: the field's name on `Query`, the MCP tool's prefix, "_" and the field's own name. */
|
|
22
|
+
export declare function pluginGraphqlFieldName(pluginId: string, name: string): string;
|
|
23
|
+
/**
|
|
24
|
+
* D12: every route marking `graphqlField` is an `apiKey` `GET` route with an action and no `:` or
|
|
25
|
+
* `*` parameter in its path; the field has a name of the tool alphabet used once in the plugin and
|
|
26
|
+
* a description of 1 to 500 characters, not blank and with no hidden character; `graphqlField` holds
|
|
27
|
+
* no other key; a plugin offers at most 10 fields.
|
|
28
|
+
*/
|
|
29
|
+
export declare function checkPluginGraphqlFields(manifest: {
|
|
30
|
+
id?: unknown;
|
|
31
|
+
contributions?: unknown;
|
|
32
|
+
}): PluginGraphqlFieldIssue[];
|