@kardalum/plugin-sdk 0.19.0 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +281 -0
- package/README.md +19 -0
- package/dist/admin-section-registry.d.ts +48 -1
- package/dist/admin-section-registry.js +90 -0
- package/dist/built-in-editor-ids.d.ts +1 -1
- package/dist/built-in-editor-ids.js +2 -20
- package/dist/built-in-settings-schemas.d.ts +10 -0
- package/dist/built-in-settings-schemas.js +86 -0
- package/dist/built-in-value-schemas.js +35 -0
- package/dist/built-ins.js +38 -7
- package/dist/capabilities.d.ts +11 -1
- package/dist/capabilities.js +101 -4
- package/dist/cli.d.ts +66 -0
- package/dist/cli.js +22 -0
- package/dist/consent-entry.d.ts +11 -0
- package/dist/consent-entry.js +18 -0
- package/dist/content-library.d.ts +102 -0
- package/dist/content-library.js +15 -0
- package/dist/content-list-extensions.d.ts +50 -0
- package/dist/content-list-extensions.js +11 -0
- package/dist/content-picker/page-picker-sheet.d.ts +15 -0
- package/dist/content-picker/page-picker-sheet.js +105 -0
- package/dist/content-picker/page-picker.d.ts +18 -0
- package/dist/content-picker/page-picker.js +20 -0
- package/dist/content-picker/page-tree.d.ts +25 -0
- package/dist/content-picker/page-tree.js +132 -0
- package/dist/data-type-plugin.d.ts +7 -1
- package/dist/datatype-validation.d.ts +4 -9
- package/dist/datatype-validation.js +147 -1
- package/dist/datatypes-entry.d.ts +1 -0
- package/dist/datatypes-entry.js +2 -0
- package/dist/entitlement-entry.d.ts +1 -1
- package/dist/entitlement-entry.js +1 -1
- package/dist/entitlement-gate.d.ts +14 -0
- package/dist/entitlement-gate.js +64 -7
- package/dist/entitlement-plan.d.ts +6 -0
- package/dist/entitlement-plan.js +10 -0
- package/dist/entitlement-types.d.ts +53 -12
- package/dist/entitlement.d.ts +31 -4
- package/dist/entitlement.js +58 -17
- package/dist/hook-entry.d.ts +5 -0
- package/dist/hook-entry.js +30 -0
- package/dist/host-entry.d.ts +7 -1
- package/dist/host-entry.js +14 -1
- package/dist/index.d.ts +67 -7
- package/dist/index.js +94 -6
- package/dist/mail.d.ts +34 -0
- package/dist/mail.js +1 -0
- package/dist/manifest-entry.d.ts +47 -4
- package/dist/manifest-entry.js +63 -2
- package/dist/manifest-schema.d.ts +993 -40
- package/dist/manifest-schema.js +516 -26
- package/dist/manifest.d.ts +1186 -62
- package/dist/manifest.js +8 -4
- package/dist/media/media-picker.js +31 -18
- package/dist/media/upload-error.d.ts +5 -1
- package/dist/media/upload-error.js +14 -2
- package/dist/media-library.d.ts +32 -0
- package/dist/media-library.js +15 -0
- package/dist/nested-field-host.d.ts +76 -0
- package/dist/nested-field-host.js +90 -0
- package/dist/notify.d.ts +12 -4
- package/dist/notify.js +1 -1
- package/dist/outbound.d.ts +47 -0
- package/dist/outbound.js +1 -0
- package/dist/plugin-context.d.ts +52 -0
- package/dist/plugin-context.js +27 -0
- package/dist/plugin-permissions.d.ts +18 -0
- package/dist/plugin-permissions.js +25 -0
- package/dist/plugin-screen-context.d.ts +262 -9
- package/dist/plugin-screen-context.js +56 -0
- package/dist/providers.d.ts +313 -0
- package/dist/providers.js +74 -0
- package/dist/read-all-pages.d.ts +5 -0
- package/dist/read-all-pages.js +3 -2
- package/dist/render-page.d.ts +15 -0
- package/dist/render-page.js +20 -0
- package/dist/richtext/block-panel.d.ts +12 -1
- package/dist/richtext/block-panel.js +36 -25
- package/dist/richtext/button-view.d.ts +11 -0
- package/dist/richtext/button-view.js +45 -0
- package/dist/richtext/content-guard.d.ts +4 -0
- package/dist/richtext/content-guard.js +27 -0
- package/dist/richtext/editor-handle.d.ts +34 -0
- package/dist/richtext/editor-handle.js +225 -0
- package/dist/richtext/extensions.d.ts +6 -0
- package/dist/richtext/extensions.js +16 -0
- package/dist/richtext/insert-menu.d.ts +6 -1
- package/dist/richtext/insert-menu.js +45 -22
- package/dist/richtext/item-attributes.d.ts +6 -0
- package/dist/richtext/item-attributes.js +19 -0
- package/dist/richtext/item-panel.d.ts +25 -0
- package/dist/richtext/item-panel.js +118 -0
- package/dist/richtext/item-view.d.ts +58 -0
- package/dist/richtext/item-view.js +172 -0
- package/dist/richtext/mark-form.d.ts +10 -0
- package/dist/richtext/mark-form.js +38 -0
- package/dist/richtext/paste-choice.d.ts +9 -0
- package/dist/richtext/paste-choice.js +13 -0
- package/dist/richtext/plugin-items.d.ts +72 -0
- package/dist/richtext/plugin-items.js +562 -0
- package/dist/richtext/plugin-mark-tooltips.d.ts +5 -0
- package/dist/richtext/plugin-mark-tooltips.js +44 -0
- package/dist/richtext/plugin-toolbar.d.ts +57 -0
- package/dist/richtext/plugin-toolbar.js +186 -0
- package/dist/richtext/rich-item-icons.d.ts +5 -0
- package/dist/richtext/rich-item-icons.js +42 -0
- package/dist/richtext/rich-items.d.ts +42 -0
- package/dist/richtext/rich-items.js +68 -0
- package/dist/richtext/rich-text-view-host.d.ts +24 -0
- package/dist/richtext/rich-text-view-host.js +11 -0
- package/dist/richtext/style-listbox.js +6 -4
- package/dist/richtext/toolbar-button.d.ts +16 -0
- package/dist/richtext/toolbar-button.js +9 -0
- package/dist/richtext/url-paste.d.ts +20 -0
- package/dist/richtext/url-paste.js +82 -0
- package/dist/richtext-html-entry.d.ts +5 -0
- package/dist/richtext-html-entry.js +11 -0
- package/dist/sdk-strings.d.ts +344 -0
- package/dist/sdk-strings.js +411 -0
- package/dist/sealing.d.ts +14 -0
- package/dist/sealing.js +1 -0
- package/dist/service-contract.d.ts +17 -0
- package/dist/service-contract.js +39 -0
- package/dist/services.d.ts +114 -0
- package/dist/services.js +1 -0
- package/dist/simple-storage-value-provider.js +24 -24
- package/dist/structured-storage-types.d.ts +429 -9
- package/dist/tailwind.js +10 -5
- package/dist/template-reads.d.ts +16 -0
- package/dist/template-reads.js +21 -0
- package/dist/testing-entry.d.ts +38 -0
- package/dist/testing-entry.js +173 -0
- package/dist/text-entry.d.ts +1 -0
- package/dist/text-entry.js +7 -0
- package/dist/tokens/system-dark.css +1 -0
- package/dist/tokens/tailwind-theme.css +7 -0
- package/dist/tokens/tokens.css +19 -3
- package/dist/tokens/tokens.json +13 -4
- package/dist/uploads.d.ts +43 -0
- package/dist/uploads.js +1 -0
- package/dist/user-library.d.ts +51 -0
- package/dist/user-library.js +15 -0
- package/dist/view-helpers.d.ts +18 -0
- package/dist/view-helpers.js +64 -0
- package/dist/views/asset-view.js +4 -1
- package/dist/views/content-list-preview.js +3 -1
- package/dist/views/content-list-settings-view.js +11 -7
- package/dist/views/content-list-view.d.ts +5 -3
- package/dist/views/content-list-view.js +243 -40
- package/dist/views/content-picker-view.d.ts +3 -0
- package/dist/views/content-picker-view.js +143 -0
- package/dist/views/crop-view.d.ts +4 -6
- package/dist/views/crop-view.js +22 -13
- package/dist/views/date-range-view.js +4 -1
- package/dist/views/file-upload-view.d.ts +5 -7
- package/dist/views/file-upload-view.js +16 -7
- package/dist/views/group-view.d.ts +8 -0
- package/dist/views/group-view.js +123 -0
- package/dist/views/html-view.js +7 -6
- package/dist/views/image-view.js +37 -19
- package/dist/views/link-view.d.ts +3 -0
- package/dist/views/link-view.js +150 -0
- package/dist/views/options-list-view.d.ts +3 -0
- package/dist/views/options-list-view.js +104 -0
- package/dist/views/repeatable-list-view.d.ts +3 -0
- package/dist/views/repeatable-list-view.js +113 -0
- package/dist/views/rich-text-view.d.ts +2 -0
- package/dist/views/rich-text-view.js +208 -35
- package/dist/views/suggest-key.d.ts +17 -0
- package/dist/views/suggest-key.js +55 -0
- package/dist/views/unreadable-rich-text.d.ts +17 -0
- package/dist/views/unreadable-rich-text.js +40 -0
- package/dist/visitors.d.ts +81 -0
- package/dist/visitors.js +1 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-app-hosts.d.ts +21 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-app-hosts.js +39 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-app-redirects.d.ts +2 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-app-redirects.js +31 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-connections.schema.d.ts +334 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-connections.schema.js +254 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-context.schema.d.ts +12 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-context.schema.js +10 -0
- package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.d.ts +10 -0
- package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.js +5 -0
- package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.d.ts +11 -1
- package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.js +4 -2
- package/node_modules/@kardalum/api-schemas/dist/built-in-editor-ids.d.ts +8 -0
- package/node_modules/@kardalum/api-schemas/dist/built-in-editor-ids.js +38 -0
- package/node_modules/@kardalum/api-schemas/dist/capability-detail.d.ts +65 -0
- package/node_modules/@kardalum/api-schemas/dist/capability-detail.js +144 -0
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.d.ts +115 -3
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.js +58 -11
- package/node_modules/@kardalum/api-schemas/dist/content-list.schema.d.ts +137 -2
- package/node_modules/@kardalum/api-schemas/dist/content-list.schema.js +178 -2
- package/node_modules/@kardalum/api-schemas/dist/content-path.d.ts +1 -1
- package/node_modules/@kardalum/api-schemas/dist/content-path.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/content-reads.schema.d.ts +213 -0
- package/node_modules/@kardalum/api-schemas/dist/content-reads.schema.js +234 -0
- package/node_modules/@kardalum/api-schemas/dist/content-search.schema.d.ts +50 -0
- package/node_modules/@kardalum/api-schemas/dist/content-search.schema.js +42 -0
- package/node_modules/@kardalum/api-schemas/dist/content-summary.schema.d.ts +37 -0
- package/node_modules/@kardalum/api-schemas/dist/content-summary.schema.js +19 -0
- package/node_modules/@kardalum/api-schemas/dist/content-unpublish.schema.d.ts +23 -0
- package/node_modules/@kardalum/api-schemas/dist/content-unpublish.schema.js +13 -0
- package/node_modules/@kardalum/api-schemas/dist/content.schema.d.ts +3 -0
- package/node_modules/@kardalum/api-schemas/dist/content.schema.js +10 -0
- package/node_modules/@kardalum/api-schemas/dist/contract-cancel.schema.d.ts +41 -0
- package/node_modules/@kardalum/api-schemas/dist/contract-cancel.schema.js +86 -0
- package/node_modules/@kardalum/api-schemas/dist/contribution-issues.d.ts +11 -0
- package/node_modules/@kardalum/api-schemas/dist/contribution-issues.js +14 -0
- package/node_modules/@kardalum/api-schemas/dist/core-actions.d.ts +55 -13
- package/node_modules/@kardalum/api-schemas/dist/core-actions.js +22 -10
- package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.d.ts +25 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.js +8 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/data-type-issue.d.ts +35 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-issue.js +60 -0
- package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.d.ts +257 -15
- package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +78 -5
- package/node_modules/@kardalum/api-schemas/dist/document-type.schema.d.ts +24 -6
- package/node_modules/@kardalum/api-schemas/dist/document-type.schema.js +90 -5
- package/node_modules/@kardalum/api-schemas/dist/experimental-points.d.ts +19 -0
- package/node_modules/@kardalum/api-schemas/dist/experimental-points.js +250 -0
- package/node_modules/@kardalum/api-schemas/dist/form-protection-callers.d.ts +29 -0
- package/node_modules/@kardalum/api-schemas/dist/form-protection-callers.js +31 -0
- package/node_modules/@kardalum/api-schemas/dist/form-protection.d.ts +23 -0
- package/node_modules/@kardalum/api-schemas/dist/form-protection.js +12 -0
- package/node_modules/@kardalum/api-schemas/dist/graphql-limits.d.ts +12 -0
- package/node_modules/@kardalum/api-schemas/dist/graphql-limits.js +14 -0
- package/node_modules/@kardalum/api-schemas/dist/held-embed-words.d.ts +23 -0
- package/node_modules/@kardalum/api-schemas/dist/held-embed-words.js +70 -0
- package/node_modules/@kardalum/api-schemas/dist/html-scan.d.ts +22 -0
- package/node_modules/@kardalum/api-schemas/dist/html-scan.js +122 -0
- package/node_modules/@kardalum/api-schemas/dist/html-start-tags.d.ts +48 -0
- package/node_modules/@kardalum/api-schemas/dist/html-start-tags.js +381 -0
- package/node_modules/@kardalum/api-schemas/dist/index.d.ts +162 -48
- package/node_modules/@kardalum/api-schemas/dist/index.js +137 -30
- package/node_modules/@kardalum/api-schemas/dist/install-sign-in-switched-off.schema.d.ts +9 -0
- package/node_modules/@kardalum/api-schemas/dist/install-sign-in-switched-off.schema.js +9 -0
- package/node_modules/@kardalum/api-schemas/dist/json-depth.d.ts +3 -0
- package/node_modules/@kardalum/api-schemas/dist/json-depth.js +20 -0
- package/node_modules/@kardalum/api-schemas/dist/legal-anchors.d.ts +8 -0
- package/node_modules/@kardalum/api-schemas/dist/legal-anchors.js +9 -0
- package/node_modules/@kardalum/api-schemas/dist/licensing.schema.d.ts +63 -0
- package/node_modules/@kardalum/api-schemas/dist/licensing.schema.js +54 -0
- package/node_modules/@kardalum/api-schemas/dist/mail-rules.d.ts +226 -0
- package/node_modules/@kardalum/api-schemas/dist/mail-rules.js +409 -0
- package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.d.ts +8 -0
- package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.js +4 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-leaks.schema.d.ts +145 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-leaks.schema.js +154 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.d.ts +490 -10
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +53 -3
- package/node_modules/@kardalum/api-schemas/dist/marketplace-package-api.schema.d.ts +15 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-package-api.schema.js +14 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-payouts.schema.d.ts +131 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-payouts.schema.js +272 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-profile.schema.d.ts +84 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-profile.schema.js +138 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-revocation.schema.d.ts +20 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-revocation.schema.js +49 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-sites.schema.d.ts +211 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-sites.schema.js +424 -0
- package/node_modules/@kardalum/api-schemas/dist/mcp-plugins.schema.d.ts +78 -0
- package/node_modules/@kardalum/api-schemas/dist/mcp-plugins.schema.js +27 -0
- package/node_modules/@kardalum/api-schemas/dist/mcp-tool-inputs.schema.d.ts +70 -0
- package/node_modules/@kardalum/api-schemas/dist/mcp-tool-inputs.schema.js +43 -0
- package/node_modules/@kardalum/api-schemas/dist/media-api.schema.d.ts +38 -0
- package/node_modules/@kardalum/api-schemas/dist/media-api.schema.js +13 -1
- package/node_modules/@kardalum/api-schemas/dist/media-move.schema.d.ts +75 -0
- package/node_modules/@kardalum/api-schemas/dist/media-move.schema.js +53 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference-api.schema.d.ts +2 -2
- package/node_modules/@kardalum/api-schemas/dist/media-reference.d.ts +2 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference.js +55 -0
- package/node_modules/@kardalum/api-schemas/dist/media.schema.d.ts +5 -0
- package/node_modules/@kardalum/api-schemas/dist/media.schema.js +8 -0
- package/node_modules/@kardalum/api-schemas/dist/nested-fields.schema.d.ts +204 -0
- package/node_modules/@kardalum/api-schemas/dist/nested-fields.schema.js +370 -0
- package/node_modules/@kardalum/api-schemas/dist/nested-validation.d.ts +60 -0
- package/node_modules/@kardalum/api-schemas/dist/nested-validation.js +333 -0
- package/node_modules/@kardalum/api-schemas/dist/news.schema.d.ts +5 -5
- package/node_modules/@kardalum/api-schemas/dist/node-access.schema.d.ts +1 -2
- package/node_modules/@kardalum/api-schemas/dist/node-access.schema.js +1 -2
- package/node_modules/@kardalum/api-schemas/dist/notification-kinds.d.ts +145 -0
- package/node_modules/@kardalum/api-schemas/dist/notification-kinds.js +177 -0
- package/node_modules/@kardalum/api-schemas/dist/notification.schema.d.ts +258 -7
- package/node_modules/@kardalum/api-schemas/dist/notification.schema.js +96 -5
- package/node_modules/@kardalum/api-schemas/dist/page-address.d.ts +10 -0
- package/node_modules/@kardalum/api-schemas/dist/page-address.js +7 -0
- package/node_modules/@kardalum/api-schemas/dist/page-audience.schema.d.ts +87 -0
- package/node_modules/@kardalum/api-schemas/dist/page-audience.schema.js +44 -0
- package/node_modules/@kardalum/api-schemas/dist/password-reset.schema.d.ts +34 -0
- package/node_modules/@kardalum/api-schemas/dist/password-reset.schema.js +60 -0
- package/node_modules/@kardalum/api-schemas/dist/plan-editor.schema.d.ts +28 -3
- package/node_modules/@kardalum/api-schemas/dist/plan-editor.schema.js +55 -8
- package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.d.ts +12 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.js +13 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-admin-slots.d.ts +11 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-admin-slots.js +61 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-caller.d.ts +23 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-caller.js +16 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-cli-commands.d.ts +76 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-cli-commands.js +316 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-content-access.d.ts +44 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-content-access.js +84 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-content-slots.d.ts +136 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-content-slots.js +254 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-contract-checks.d.ts +22 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-contract-checks.js +66 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-contract-document.d.ts +130 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-contract-document.js +173 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-contract-fetch.d.ts +16 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-contract-fetch.js +112 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-contract-schema.d.ts +70 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-contract-schema.js +380 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-contract-types.d.ts +3 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-contract-types.js +68 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-data-type-configs.d.ts +31 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-data-type-configs.js +131 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.d.ts +44 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs.d.ts +44 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs.js +16 -5
- package/node_modules/@kardalum/api-schemas/dist/plugin-document-types.d.ts +228 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-document-types.js +41 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-durable-hooks.d.ts +34 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-durable-hooks.js +102 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-editor-extensions.d.ts +43 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-editor-extensions.js +126 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-events.d.ts +24 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-events.js +53 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-field-info.d.ts +41 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-field-info.js +51 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-graphql-fields.d.ts +32 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-graphql-fields.js +102 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-guards.d.ts +112 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-guards.js +118 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-held-embeds.d.ts +119 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-held-embeds.js +216 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-https-origin.d.ts +5 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-https-origin.js +21 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.d.ts +4 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.js +3 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.d.ts +46 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.js +41 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-install.d.ts +304 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-install.js +220 -6
- package/node_modules/@kardalum/api-schemas/dist/plugin-kept-parts.d.ts +138 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-kept-parts.js +110 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-labels.d.ts +26 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-labels.js +29 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-locales.d.ts +32 -8
- package/node_modules/@kardalum/api-schemas/dist/plugin-locales.js +120 -14
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.d.ts +408 -14
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +307 -23
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.d.ts +23 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.js +61 -3
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-ai.d.ts +40 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-ai.js +139 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.d.ts +23 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.js +37 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-media-access.d.ts +25 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-media-access.js +43 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-outbound.d.ts +107 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-outbound.js +150 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-package-build.schema.d.ts +5 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-package-build.schema.js +7 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-providers.d.ts +346 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-providers.js +461 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-read-only.schema.d.ts +4 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-read-only.schema.js +2 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-rich-text.d.ts +638 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-rich-text.js +533 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-sealed-values.d.ts +45 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-sealed-values.js +99 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-secrets.d.ts +68 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-secrets.js +114 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-service-call.d.ts +36 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-service-call.js +32 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-service-connections.d.ts +193 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-service-connections.js +123 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-service-declarations.d.ts +209 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-service-declarations.js +372 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-services.d.ts +90 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-services.js +204 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-settings.d.ts +352 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-settings.js +409 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-site-extensions.d.ts +347 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-site-extensions.js +976 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-site-requests.d.ts +69 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-site-requests.js +149 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.d.ts +7 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.js +47 -4
- package/node_modules/@kardalum/api-schemas/dist/plugin-styles.d.ts +5 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-styles.js +13 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-tasks.d.ts +45 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-tasks.js +197 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-uploads.d.ts +96 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-uploads.js +185 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-user-accounts.d.ts +213 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-user-accounts.js +131 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-view-kit.d.ts +54 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-view-kit.js +154 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-visitor-points.d.ts +37 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-visitor-points.js +124 -0
- package/node_modules/@kardalum/api-schemas/dist/plural-rules.d.ts +9 -0
- package/node_modules/@kardalum/api-schemas/dist/plural-rules.js +41 -0
- package/node_modules/@kardalum/api-schemas/dist/public-api.schema.d.ts +41 -0
- package/node_modules/@kardalum/api-schemas/dist/public-api.schema.js +100 -12
- package/node_modules/@kardalum/api-schemas/dist/refund-request.schema.d.ts +189 -0
- package/node_modules/@kardalum/api-schemas/dist/refund-request.schema.js +164 -0
- package/node_modules/@kardalum/api-schemas/dist/render-cache.d.ts +126 -0
- package/node_modules/@kardalum/api-schemas/dist/render-cache.js +263 -0
- package/node_modules/@kardalum/api-schemas/dist/render-editing.d.ts +307 -4
- package/node_modules/@kardalum/api-schemas/dist/render-editing.js +61 -0
- package/node_modules/@kardalum/api-schemas/dist/revenue-view.schema.js +7 -3
- package/node_modules/@kardalum/api-schemas/dist/rich-text-paste-hosts.d.ts +14 -0
- package/node_modules/@kardalum/api-schemas/dist/rich-text-paste-hosts.js +108 -0
- package/node_modules/@kardalum/api-schemas/dist/rich-text-shape.d.ts +71 -0
- package/node_modules/@kardalum/api-schemas/dist/rich-text-shape.js +540 -0
- package/node_modules/@kardalum/api-schemas/dist/rich-text-text.d.ts +66 -0
- package/node_modules/@kardalum/api-schemas/dist/rich-text-text.js +394 -0
- package/node_modules/@kardalum/api-schemas/dist/sale-conditions.schema.d.ts +82 -0
- package/node_modules/@kardalum/api-schemas/dist/sale-conditions.schema.js +99 -0
- package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.d.ts +13 -0
- package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.js +28 -0
- package/node_modules/@kardalum/api-schemas/dist/sandbox-attach.schema.d.ts +201 -1
- package/node_modules/@kardalum/api-schemas/dist/sandbox-attach.schema.js +36 -0
- package/node_modules/@kardalum/api-schemas/dist/security-overview.schema.d.ts +64 -0
- package/node_modules/@kardalum/api-schemas/dist/security-overview.schema.js +38 -0
- package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.d.ts +97 -8
- package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.js +64 -1
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +136 -0
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.js +53 -2
- package/node_modules/@kardalum/api-schemas/dist/sign-in-steps.d.ts +724 -0
- package/node_modules/@kardalum/api-schemas/dist/sign-in-steps.js +408 -0
- package/node_modules/@kardalum/api-schemas/dist/sign-in.schema.d.ts +386 -0
- package/node_modules/@kardalum/api-schemas/dist/sign-in.schema.js +618 -0
- package/node_modules/@kardalum/api-schemas/dist/site-consent.d.ts +77 -0
- package/node_modules/@kardalum/api-schemas/dist/site-consent.js +122 -0
- package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.d.ts +3 -3
- package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.d.ts +1 -1
- package/node_modules/@kardalum/api-schemas/dist/structured-duplicate-key.d.ts +13 -0
- package/node_modules/@kardalum/api-schemas/dist/structured-duplicate-key.js +26 -0
- package/node_modules/@kardalum/api-schemas/dist/structured-fields.schema.d.ts +70 -0
- package/node_modules/@kardalum/api-schemas/dist/structured-fields.schema.js +188 -0
- package/node_modules/@kardalum/api-schemas/dist/template-api.schema.d.ts +33 -0
- package/node_modules/@kardalum/api-schemas/dist/template-api.schema.js +26 -1
- package/node_modules/@kardalum/api-schemas/dist/template.schema.d.ts +1 -0
- package/node_modules/@kardalum/api-schemas/dist/template.schema.js +3 -0
- package/node_modules/@kardalum/api-schemas/dist/transaction-rolled-back.d.ts +13 -0
- package/node_modules/@kardalum/api-schemas/dist/transaction-rolled-back.js +29 -0
- package/node_modules/@kardalum/api-schemas/dist/trash-purge.schema.d.ts +13 -0
- package/node_modules/@kardalum/api-schemas/dist/trash-purge.schema.js +6 -0
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.d.ts +72 -1
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +36 -3
- package/node_modules/@kardalum/api-schemas/dist/vendor-service.schema.d.ts +5 -1
- package/node_modules/@kardalum/api-schemas/dist/vendor-service.schema.js +4 -3
- package/node_modules/@kardalum/api-schemas/dist/visitor-accounts.d.ts +482 -0
- package/node_modules/@kardalum/api-schemas/dist/visitor-accounts.js +380 -0
- package/node_modules/@kardalum/api-schemas/dist/visitor-groups.d.ts +109 -0
- package/node_modules/@kardalum/api-schemas/dist/visitor-groups.js +62 -0
- package/node_modules/@kardalum/api-schemas/package.json +2 -0
- package/node_modules/@kardalum/design-tokens/dist/build-css.js +15 -1
- package/node_modules/@kardalum/design-tokens/dist/system-dark.css +1 -0
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.css +7 -0
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.d.ts +2 -1
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.js +2 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.css +19 -3
- package/node_modules/@kardalum/design-tokens/dist/tokens.d.ts +1 -1
- package/node_modules/@kardalum/design-tokens/dist/tokens.js +18 -3
- package/node_modules/@kardalum/design-tokens/dist/tokens.json +13 -4
- package/node_modules/@kardalum/design-tokens/dist/types.d.ts +5 -1
- package/node_modules/@kardalum/plugin-package/dist/build-reference.d.ts +38 -2
- package/node_modules/@kardalum/plugin-package/dist/build-reference.js +17 -2
- package/node_modules/@kardalum/plugin-package/dist/capabilities.d.ts +17 -10
- package/node_modules/@kardalum/plugin-package/dist/capabilities.js +625 -35
- package/node_modules/@kardalum/plugin-package/dist/client-bundle.d.ts +1 -1
- package/node_modules/@kardalum/plugin-package/dist/client-bundle.js +25 -0
- package/node_modules/@kardalum/plugin-package/dist/cms-range.d.ts +17 -0
- package/node_modules/@kardalum/plugin-package/dist/cms-range.js +353 -0
- package/node_modules/@kardalum/plugin-package/dist/contract-fingerprint.d.ts +17 -0
- package/node_modules/@kardalum/plugin-package/dist/contract-fingerprint.js +39 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/admin-styles.d.ts +23 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/admin-styles.js +351 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/ai-declarations.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/ai-declarations.js +26 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.d.ts +1 -1
- package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.js +3 -2
- package/node_modules/@kardalum/plugin-package/dist/delivery/bundle.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/bundle.js +1 -1
- package/node_modules/@kardalum/plugin-package/dist/delivery/content-access.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/content-access.js +47 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.js +2 -2
- package/node_modules/@kardalum/plugin-package/dist/delivery/editor-extensions.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/editor-extensions.js +40 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/graphql-fields.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/graphql-fields.js +22 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/icons.js +3 -2
- package/node_modules/@kardalum/plugin-package/dist/delivery/index.d.ts +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/index.js +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/label-languages.js +76 -6
- package/node_modules/@kardalum/plugin-package/dist/delivery/licence-check.d.ts +27 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/licence-check.js +99 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/limits.d.ts +6 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/limits.js +6 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/locales.js +9 -4
- package/node_modules/@kardalum/plugin-package/dist/delivery/plugin-settings.d.ts +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/plugin-settings.js +68 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/providers.d.ts +5 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/providers.js +316 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/registry.js +40 -4
- package/node_modules/@kardalum/plugin-package/dist/delivery/rich-text.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/rich-text.js +173 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/sample-content.js +91 -2
- package/node_modules/@kardalum/plugin-package/dist/delivery/server-powers.d.ts +6 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/server-powers.js +150 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/services-events.d.ts +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/services-events.js +35 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/sign-in-steps.d.ts +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/sign-in-steps.js +71 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/site-extensions.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/site-extensions.js +69 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/templates.d.ts +1 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/templates.js +21 -1
- package/node_modules/@kardalum/plugin-package/dist/delivery/types.d.ts +17 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/user-accounts.d.ts +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/user-accounts.js +36 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/visitor-points.d.ts +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/visitor-points.js +33 -0
- package/node_modules/@kardalum/plugin-package/dist/index.d.ts +8 -2
- package/node_modules/@kardalum/plugin-package/dist/index.js +7 -1
- package/node_modules/@kardalum/plugin-package/dist/license-verdict.d.ts +75 -0
- package/node_modules/@kardalum/plugin-package/dist/license-verdict.js +123 -0
- package/node_modules/@kardalum/plugin-package/dist/public-suffix.d.ts +7 -0
- package/node_modules/@kardalum/plugin-package/dist/public-suffix.js +23 -0
- package/node_modules/@kardalum/plugin-package/dist/rich-text-summary.d.ts +1 -0
- package/node_modules/@kardalum/plugin-package/dist/rich-text-summary.js +27 -0
- package/node_modules/@kardalum/plugin-package/dist/stylesheet-load-hook.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/stylesheet-load-hook.js +28 -0
- package/node_modules/@kardalum/plugin-package/package.json +4 -0
- package/node_modules/@kardalum/ui/dist/components/select.d.ts +6 -0
- package/node_modules/@kardalum/ui/dist/components/select.js +7 -0
- package/node_modules/@kardalum/ui/dist/components/switch.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/textarea.d.ts +6 -0
- package/node_modules/@kardalum/ui/dist/components/textarea.js +7 -0
- package/node_modules/@kardalum/ui/dist/components/tooltip.js +1 -2
- package/node_modules/@kardalum/ui/dist/components/truncated-text.d.ts +6 -1
- package/node_modules/@kardalum/ui/dist/components/truncated-text.js +5 -4
- package/node_modules/@kardalum/ui/dist/index.d.ts +2 -0
- package/node_modules/@kardalum/ui/dist/index.js +2 -0
- package/package.json +25 -3
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type EditorExtensionIssue } from "./plugin-editor-extensions.js";
|
|
3
|
+
/** The most content list columns one plugin may declare. */
|
|
4
|
+
export declare const CONTENT_COLUMNS_MAX = 3;
|
|
5
|
+
/** The most tree badges one plugin may declare. */
|
|
6
|
+
export declare const TREE_BADGES_MAX = 1;
|
|
7
|
+
/** The most content list filters one plugin may declare. */
|
|
8
|
+
export declare const LIST_FILTERS_MAX = 2;
|
|
9
|
+
/** The most bulk actions one plugin may declare. */
|
|
10
|
+
export declare const BULK_ACTIONS_MAX = 3;
|
|
11
|
+
/** The most options one list filter may offer. */
|
|
12
|
+
export declare const LIST_FILTER_OPTIONS_MAX = 12;
|
|
13
|
+
/** The most rows one value or match call is handed: one page of the tree or the list. */
|
|
14
|
+
export declare const CONTENT_SLOT_ROWS_MAX = 50;
|
|
15
|
+
/** How long one value or match call may take before it is answered as failed. */
|
|
16
|
+
export declare const CONTENT_SLOT_CALL_TIME_MS = 1000;
|
|
17
|
+
/** The longest text a column cell shows. */
|
|
18
|
+
export declare const CONTENT_COLUMN_TEXT_MAX = 80;
|
|
19
|
+
/** The longest text a tree badge shows. */
|
|
20
|
+
export declare const TREE_BADGE_TEXT_MAX = 24;
|
|
21
|
+
/** The longest one filtered list call scans before it answers what it found. Checked before each page
|
|
22
|
+
* is read, so a call can run past it by one page's read and one match call: a soft bound. */
|
|
23
|
+
export declare const CONTENT_LIST_FILTER_TIME_MS = 3000;
|
|
24
|
+
/** The most rows a bulk action is handed. */
|
|
25
|
+
export declare const BULK_ACTION_ROWS_MAX = 100;
|
|
26
|
+
export declare const CONTENT_SLOT_KINDS: readonly ["column", "badge"];
|
|
27
|
+
export type ContentSlotKind = (typeof CONTENT_SLOT_KINDS)[number];
|
|
28
|
+
export declare const BADGE_TONES: readonly ["neutral", "primary", "success", "warning", "danger"];
|
|
29
|
+
export type BadgeTone = (typeof BADGE_TONES)[number];
|
|
30
|
+
export interface BadgeCell {
|
|
31
|
+
text: string;
|
|
32
|
+
tone: BadgeTone;
|
|
33
|
+
}
|
|
34
|
+
export declare const LIST_FILTER_UNAVAILABLE_CODE = "list_filter_unavailable";
|
|
35
|
+
export declare const LIST_FILTER_REFUSED_CODE = "list_filter_refused";
|
|
36
|
+
export declare const LIST_FILTER_UNKNOWN_CODE = "list_filter_unknown";
|
|
37
|
+
/** A filtered list's refusal (403, 404, 503): `ApiErrorSchema` is a plain object schema, so the
|
|
38
|
+
* serializer would strip `code` from a body answered through it. Coded, as plugin-guards'
|
|
39
|
+
* `plugin_refused` body is. */
|
|
40
|
+
export declare const ListFilterErrorSchema: z.ZodObject<{
|
|
41
|
+
message: z.ZodString;
|
|
42
|
+
code: z.ZodEnum<{
|
|
43
|
+
list_filter_unavailable: "list_filter_unavailable";
|
|
44
|
+
list_filter_refused: "list_filter_refused";
|
|
45
|
+
list_filter_unknown: "list_filter_unknown";
|
|
46
|
+
}>;
|
|
47
|
+
}, z.core.$strip>;
|
|
48
|
+
export type ListFilterError = z.infer<typeof ListFilterErrorSchema>;
|
|
49
|
+
export declare const CONTENT_SLOT_KEYS: readonly [{
|
|
50
|
+
readonly key: "contentColumns";
|
|
51
|
+
readonly max: 3;
|
|
52
|
+
readonly noun: "content column";
|
|
53
|
+
}, {
|
|
54
|
+
readonly key: "treeBadges";
|
|
55
|
+
readonly max: 1;
|
|
56
|
+
readonly noun: "tree badge";
|
|
57
|
+
}, {
|
|
58
|
+
readonly key: "listFilters";
|
|
59
|
+
readonly max: 2;
|
|
60
|
+
readonly noun: "list filter";
|
|
61
|
+
}, {
|
|
62
|
+
readonly key: "bulkActions";
|
|
63
|
+
readonly max: 3;
|
|
64
|
+
readonly noun: "bulk action";
|
|
65
|
+
}];
|
|
66
|
+
/** The shape rules for the four content slot keys beyond label, action and the functions (the manifest schema checks those). */
|
|
67
|
+
export declare function checkContentSlotDeclarations(manifest: {
|
|
68
|
+
contributions?: unknown;
|
|
69
|
+
}): EditorExtensionIssue[];
|
|
70
|
+
/** A column's answer: every asked id with its text or null; null when the answer is not a plain object, a getter throws or a Proxy trap throws. */
|
|
71
|
+
export declare function readColumnAnswer(answer: unknown, asked: readonly string[]): Record<string, string | null> | null;
|
|
72
|
+
/** A badge's answer: every asked id with `{ text, tone }` or null; null as readColumnAnswer. */
|
|
73
|
+
export declare function readBadgeAnswer(answer: unknown, asked: readonly string[]): Record<string, BadgeCell | null> | null;
|
|
74
|
+
/** The longest array a filter may answer: the asked page, with room for repeats and ids not asked. */
|
|
75
|
+
export declare const LIST_FILTER_ANSWER_MAX: number;
|
|
76
|
+
/** A filter's answer: the asked ids it names; null when it is not an array of strings, is longer than
|
|
77
|
+
* LIST_FILTER_ANSWER_MAX, or a getter or Proxy trap throws. Read by index with the length taken once,
|
|
78
|
+
* never through the array's own iterator, so the loop has a bound of its own. */
|
|
79
|
+
export declare function readFilterAnswer(answer: unknown, asked: readonly string[]): Set<string> | null;
|
|
80
|
+
/** `ids` of the slot read: 1 to CONTENT_SLOT_ROWS_MAX distinct uuids, comma separated, lower-cased; else null. */
|
|
81
|
+
export declare function parseSlotRowIds(text: string): string[] | null;
|
|
82
|
+
/** The admin's language for a plugin's words: 2 to 35 letters, digits and "-", else "en". */
|
|
83
|
+
export declare function slotLanguageOf(value: unknown): string;
|
|
84
|
+
export declare const ContentSlotValuesQuerySchema: z.ZodObject<{
|
|
85
|
+
kind: z.ZodEnum<{
|
|
86
|
+
column: "column";
|
|
87
|
+
badge: "badge";
|
|
88
|
+
}>;
|
|
89
|
+
ids: z.ZodString;
|
|
90
|
+
culture: z.ZodOptional<z.ZodString>;
|
|
91
|
+
lang: z.ZodOptional<z.ZodString>;
|
|
92
|
+
}, z.core.$strict>;
|
|
93
|
+
export declare const BadgeCellSchema: z.ZodObject<{
|
|
94
|
+
text: z.ZodString;
|
|
95
|
+
tone: z.ZodEnum<{
|
|
96
|
+
success: "success";
|
|
97
|
+
neutral: "neutral";
|
|
98
|
+
primary: "primary";
|
|
99
|
+
warning: "warning";
|
|
100
|
+
danger: "danger";
|
|
101
|
+
}>;
|
|
102
|
+
}, z.core.$strict>;
|
|
103
|
+
export declare const ContentSlotValuesSlotSchema: z.ZodObject<{
|
|
104
|
+
pluginId: z.ZodString;
|
|
105
|
+
slotId: z.ZodString;
|
|
106
|
+
failed: z.ZodBoolean;
|
|
107
|
+
cells: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
108
|
+
text: z.ZodString;
|
|
109
|
+
tone: z.ZodEnum<{
|
|
110
|
+
success: "success";
|
|
111
|
+
neutral: "neutral";
|
|
112
|
+
primary: "primary";
|
|
113
|
+
warning: "warning";
|
|
114
|
+
danger: "danger";
|
|
115
|
+
}>;
|
|
116
|
+
}, z.core.$strict>, z.ZodNull]>>;
|
|
117
|
+
}, z.core.$strict>;
|
|
118
|
+
export type ContentSlotValuesSlot = z.infer<typeof ContentSlotValuesSlotSchema>;
|
|
119
|
+
export declare const ContentSlotValuesResponseSchema: z.ZodObject<{
|
|
120
|
+
slots: z.ZodArray<z.ZodObject<{
|
|
121
|
+
pluginId: z.ZodString;
|
|
122
|
+
slotId: z.ZodString;
|
|
123
|
+
failed: z.ZodBoolean;
|
|
124
|
+
cells: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
125
|
+
text: z.ZodString;
|
|
126
|
+
tone: z.ZodEnum<{
|
|
127
|
+
success: "success";
|
|
128
|
+
neutral: "neutral";
|
|
129
|
+
primary: "primary";
|
|
130
|
+
warning: "warning";
|
|
131
|
+
danger: "danger";
|
|
132
|
+
}>;
|
|
133
|
+
}, z.core.$strict>, z.ZodNull]>>;
|
|
134
|
+
}, z.core.$strict>>;
|
|
135
|
+
}, z.core.$strict>;
|
|
136
|
+
export type ContentSlotValuesResponse = z.infer<typeof ContentSlotValuesResponseSchema>;
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { EDITOR_SLOT_ID_MAX, editorSlotDocumentTypesIssue, isEditorSlotId } from "./plugin-editor-extensions.js";
|
|
3
|
+
import { SlotLabelSchema } from "./plugin-labels.js";
|
|
4
|
+
import { hasNoControlCharacter } from "./strict-url.js";
|
|
5
|
+
import { UuidStringSchema } from "./uuid.schema.js";
|
|
6
|
+
// M35 C2 (W5, experimental): what a plugin adds to the content list and the content tree. A column
|
|
7
|
+
// and a badge carry a server function the core calls with one page of rows; a filter carries
|
|
8
|
+
// declared options and a server function that answers the matching ids; a bulk action carries a
|
|
9
|
+
// view. Every character rule below is a loop over a length-capped string, never a pattern.
|
|
10
|
+
/** The most content list columns one plugin may declare. */
|
|
11
|
+
export const CONTENT_COLUMNS_MAX = 3;
|
|
12
|
+
/** The most tree badges one plugin may declare. */
|
|
13
|
+
export const TREE_BADGES_MAX = 1;
|
|
14
|
+
/** The most content list filters one plugin may declare. */
|
|
15
|
+
export const LIST_FILTERS_MAX = 2;
|
|
16
|
+
/** The most bulk actions one plugin may declare. */
|
|
17
|
+
export const BULK_ACTIONS_MAX = 3;
|
|
18
|
+
/** The most options one list filter may offer. */
|
|
19
|
+
export const LIST_FILTER_OPTIONS_MAX = 12;
|
|
20
|
+
/** The most rows one value or match call is handed: one page of the tree or the list. */
|
|
21
|
+
export const CONTENT_SLOT_ROWS_MAX = 50;
|
|
22
|
+
/** How long one value or match call may take before it is answered as failed. */
|
|
23
|
+
export const CONTENT_SLOT_CALL_TIME_MS = 1_000;
|
|
24
|
+
/** The longest text a column cell shows. */
|
|
25
|
+
export const CONTENT_COLUMN_TEXT_MAX = 80;
|
|
26
|
+
/** The longest text a tree badge shows. */
|
|
27
|
+
export const TREE_BADGE_TEXT_MAX = 24;
|
|
28
|
+
// The most rows one filtered list call examines before it answers what it found is
|
|
29
|
+
// CONTENT_LIST_FILTER_SCAN_MAX (content-reads.schema.ts, 500): one limit for a template's filtered
|
|
30
|
+
// list and the admin's filtered Content List, so it is not declared a second time here.
|
|
31
|
+
/** The longest one filtered list call scans before it answers what it found. Checked before each page
|
|
32
|
+
* is read, so a call can run past it by one page's read and one match call: a soft bound. */
|
|
33
|
+
export const CONTENT_LIST_FILTER_TIME_MS = 3_000;
|
|
34
|
+
/** The most rows a bulk action is handed. */
|
|
35
|
+
export const BULK_ACTION_ROWS_MAX = 100;
|
|
36
|
+
export const CONTENT_SLOT_KINDS = ["column", "badge"];
|
|
37
|
+
export const BADGE_TONES = ["neutral", "primary", "success", "warning", "danger"];
|
|
38
|
+
export const LIST_FILTER_UNAVAILABLE_CODE = "list_filter_unavailable";
|
|
39
|
+
export const LIST_FILTER_REFUSED_CODE = "list_filter_refused";
|
|
40
|
+
export const LIST_FILTER_UNKNOWN_CODE = "list_filter_unknown";
|
|
41
|
+
/** A filtered list's refusal (403, 404, 503): `ApiErrorSchema` is a plain object schema, so the
|
|
42
|
+
* serializer would strip `code` from a body answered through it. Coded, as plugin-guards'
|
|
43
|
+
* `plugin_refused` body is. */
|
|
44
|
+
export const ListFilterErrorSchema = z.object({
|
|
45
|
+
message: z.string(),
|
|
46
|
+
code: z.enum([LIST_FILTER_UNAVAILABLE_CODE, LIST_FILTER_REFUSED_CODE, LIST_FILTER_UNKNOWN_CODE]),
|
|
47
|
+
});
|
|
48
|
+
export const CONTENT_SLOT_KEYS = [
|
|
49
|
+
{ key: "contentColumns", max: CONTENT_COLUMNS_MAX, noun: "content column" },
|
|
50
|
+
{ key: "treeBadges", max: TREE_BADGES_MAX, noun: "tree badge" },
|
|
51
|
+
{ key: "listFilters", max: LIST_FILTERS_MAX, noun: "list filter" },
|
|
52
|
+
{ key: "bulkActions", max: BULK_ACTIONS_MAX, noun: "bulk action" },
|
|
53
|
+
];
|
|
54
|
+
/** An option's label as the other slot labels are read: a non-empty text, or a label map with English. */
|
|
55
|
+
function optionLabelIsUsable(label) {
|
|
56
|
+
if (typeof label === "string")
|
|
57
|
+
return label.trim().length > 0 && hasNoControlCharacter(label);
|
|
58
|
+
return label !== null && typeof label === "object" && SlotLabelSchema.safeParse(label).success;
|
|
59
|
+
}
|
|
60
|
+
function optionsIssue(value) {
|
|
61
|
+
if (!Array.isArray(value) || value.length < 1 || value.length > LIST_FILTER_OPTIONS_MAX) {
|
|
62
|
+
return `options must list 1 to ${LIST_FILTER_OPTIONS_MAX} choices`;
|
|
63
|
+
}
|
|
64
|
+
const seen = new Set();
|
|
65
|
+
for (const option of value) {
|
|
66
|
+
const optionValue = option?.value;
|
|
67
|
+
if (typeof optionValue !== "string" || !isEditorSlotId(optionValue)) {
|
|
68
|
+
return `an option value must be 1 to ${EDITOR_SLOT_ID_MAX} lower-case letters, digits and "-", starting with a letter`;
|
|
69
|
+
}
|
|
70
|
+
if (seen.has(optionValue))
|
|
71
|
+
return `option value "${optionValue}" is listed more than once`;
|
|
72
|
+
seen.add(optionValue);
|
|
73
|
+
if (!optionLabelIsUsable(option.label)) {
|
|
74
|
+
return `option "${optionValue}" needs a label: a text, or a map of language code to text with "en"`;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
/** The shape rules for the four content slot keys beyond label, action and the functions (the manifest schema checks those). */
|
|
80
|
+
export function checkContentSlotDeclarations(manifest) {
|
|
81
|
+
const issues = [];
|
|
82
|
+
const contributions = manifest.contributions;
|
|
83
|
+
if (!contributions || typeof contributions !== "object")
|
|
84
|
+
return issues;
|
|
85
|
+
const record = contributions;
|
|
86
|
+
for (const { key, max, noun } of CONTENT_SLOT_KEYS) {
|
|
87
|
+
if (!(key in record) || record[key] === undefined)
|
|
88
|
+
continue;
|
|
89
|
+
const entries = record[key];
|
|
90
|
+
const keyPath = ["contributions", key];
|
|
91
|
+
if (!Array.isArray(entries)) {
|
|
92
|
+
issues.push({ path: keyPath, message: `${key} must be a list` });
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
const seen = new Set();
|
|
96
|
+
entries.forEach((entry, index) => {
|
|
97
|
+
if (!entry || typeof entry !== "object" || Array.isArray(entry)) {
|
|
98
|
+
issues.push({ path: [...keyPath, index], message: `each ${noun} must be an object` });
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const item = entry;
|
|
102
|
+
if (typeof item.id !== "string" || !isEditorSlotId(item.id)) {
|
|
103
|
+
issues.push({ path: [...keyPath, index, "id"], message: `${noun} id must be 1 to ${EDITOR_SLOT_ID_MAX} lower-case letters, digits and "-", starting with a letter` });
|
|
104
|
+
}
|
|
105
|
+
else if (seen.has(item.id)) {
|
|
106
|
+
issues.push({ path: [...keyPath, index, "id"], message: `${noun} "${item.id}" is declared more than once` });
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
seen.add(item.id);
|
|
110
|
+
}
|
|
111
|
+
if ("documentTypes" in item && item.documentTypes !== undefined) {
|
|
112
|
+
const problem = editorSlotDocumentTypesIssue(item.documentTypes);
|
|
113
|
+
if (problem)
|
|
114
|
+
issues.push({ path: [...keyPath, index, "documentTypes"], message: problem });
|
|
115
|
+
}
|
|
116
|
+
if (key === "listFilters") {
|
|
117
|
+
const problem = optionsIssue(item.options);
|
|
118
|
+
if (problem)
|
|
119
|
+
issues.push({ path: [...keyPath, index, "options"], message: problem });
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
if (entries.length > max) {
|
|
123
|
+
issues.push({ path: keyPath, message: `a plugin may declare at most ${max} ${noun}${max === 1 ? "" : "s"}; this one declares ${entries.length}` });
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return issues;
|
|
127
|
+
}
|
|
128
|
+
/** Trimmed, refused with a control character, cut at a code point to `max`; empty is null. */
|
|
129
|
+
function cellText(value, max) {
|
|
130
|
+
if (typeof value !== "string")
|
|
131
|
+
return null;
|
|
132
|
+
const trimmed = value.trim();
|
|
133
|
+
if (trimmed.length === 0 || !hasNoControlCharacter(trimmed))
|
|
134
|
+
return null;
|
|
135
|
+
if (trimmed.length <= max)
|
|
136
|
+
return trimmed;
|
|
137
|
+
const code = trimmed.charCodeAt(max - 1);
|
|
138
|
+
return code >= 0xd800 && code <= 0xdbff ? trimmed.slice(0, max - 1) : trimmed.slice(0, max);
|
|
139
|
+
}
|
|
140
|
+
function plainObject(value) {
|
|
141
|
+
if (value === null || typeof value !== "object" || Array.isArray(value))
|
|
142
|
+
return false;
|
|
143
|
+
const proto = Object.getPrototypeOf(value);
|
|
144
|
+
return proto === Object.prototype || proto === null;
|
|
145
|
+
}
|
|
146
|
+
// The shape checks sit inside the try: Array.isArray and Object.getPrototypeOf throw on a revoked
|
|
147
|
+
// Proxy or on one whose trap throws, and such an answer fails only its own slot.
|
|
148
|
+
function readCells(answer, asked, read) {
|
|
149
|
+
const out = {};
|
|
150
|
+
try {
|
|
151
|
+
if (!plainObject(answer))
|
|
152
|
+
return null;
|
|
153
|
+
for (const id of asked)
|
|
154
|
+
out[id] = Object.hasOwn(answer, id) ? read(answer[id]) : null;
|
|
155
|
+
}
|
|
156
|
+
catch {
|
|
157
|
+
return null;
|
|
158
|
+
}
|
|
159
|
+
return out;
|
|
160
|
+
}
|
|
161
|
+
/** A column's answer: every asked id with its text or null; null when the answer is not a plain object, a getter throws or a Proxy trap throws. */
|
|
162
|
+
export function readColumnAnswer(answer, asked) {
|
|
163
|
+
return readCells(answer, asked, (value) => cellText(value, CONTENT_COLUMN_TEXT_MAX));
|
|
164
|
+
}
|
|
165
|
+
/** A badge's answer: every asked id with `{ text, tone }` or null; null as readColumnAnswer. */
|
|
166
|
+
export function readBadgeAnswer(answer, asked) {
|
|
167
|
+
return readCells(answer, asked, (value) => {
|
|
168
|
+
if (!plainObject(value))
|
|
169
|
+
return null;
|
|
170
|
+
const text = cellText(value.text, TREE_BADGE_TEXT_MAX);
|
|
171
|
+
if (text === null)
|
|
172
|
+
return null;
|
|
173
|
+
if (value.tone === undefined)
|
|
174
|
+
return { text, tone: "neutral" };
|
|
175
|
+
return typeof value.tone === "string" && BADGE_TONES.includes(value.tone) ? { text, tone: value.tone } : null;
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
/** The longest array a filter may answer: the asked page, with room for repeats and ids not asked. */
|
|
179
|
+
export const LIST_FILTER_ANSWER_MAX = CONTENT_SLOT_ROWS_MAX * 4;
|
|
180
|
+
/** A filter's answer: the asked ids it names; null when it is not an array of strings, is longer than
|
|
181
|
+
* LIST_FILTER_ANSWER_MAX, or a getter or Proxy trap throws. Read by index with the length taken once,
|
|
182
|
+
* never through the array's own iterator, so the loop has a bound of its own. */
|
|
183
|
+
export function readFilterAnswer(answer, asked) {
|
|
184
|
+
const allowed = new Set(asked);
|
|
185
|
+
const out = new Set();
|
|
186
|
+
try {
|
|
187
|
+
if (!Array.isArray(answer))
|
|
188
|
+
return null;
|
|
189
|
+
const length = answer.length;
|
|
190
|
+
if (typeof length !== "number" || !Number.isInteger(length) || length < 0 || length > LIST_FILTER_ANSWER_MAX)
|
|
191
|
+
return null;
|
|
192
|
+
for (let index = 0; index < length; index += 1) {
|
|
193
|
+
const id = answer[index];
|
|
194
|
+
if (typeof id !== "string")
|
|
195
|
+
return null;
|
|
196
|
+
if (allowed.has(id))
|
|
197
|
+
out.add(id);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
catch {
|
|
201
|
+
return null;
|
|
202
|
+
}
|
|
203
|
+
return out;
|
|
204
|
+
}
|
|
205
|
+
/** `ids` of the slot read: 1 to CONTENT_SLOT_ROWS_MAX distinct uuids, comma separated, lower-cased; else null. */
|
|
206
|
+
export function parseSlotRowIds(text) {
|
|
207
|
+
if (text.length === 0)
|
|
208
|
+
return null;
|
|
209
|
+
const out = [];
|
|
210
|
+
const seen = new Set();
|
|
211
|
+
for (const part of text.split(",")) {
|
|
212
|
+
const id = part.trim().toLowerCase();
|
|
213
|
+
if (!UuidStringSchema.safeParse(id).success)
|
|
214
|
+
return null;
|
|
215
|
+
if (seen.has(id))
|
|
216
|
+
continue;
|
|
217
|
+
seen.add(id);
|
|
218
|
+
out.push(id);
|
|
219
|
+
if (out.length > CONTENT_SLOT_ROWS_MAX)
|
|
220
|
+
return null;
|
|
221
|
+
}
|
|
222
|
+
return out.length === 0 ? null : out;
|
|
223
|
+
}
|
|
224
|
+
/** The admin's language for a plugin's words: 2 to 35 letters, digits and "-", else "en". */
|
|
225
|
+
export function slotLanguageOf(value) {
|
|
226
|
+
if (typeof value !== "string" || value.length < 2 || value.length > 35)
|
|
227
|
+
return "en";
|
|
228
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
229
|
+
const code = value.charCodeAt(index);
|
|
230
|
+
const ok = (code >= 0x61 && code <= 0x7a) || (code >= 0x41 && code <= 0x5a) || (code >= 0x30 && code <= 0x39) || code === 0x2d;
|
|
231
|
+
if (!ok)
|
|
232
|
+
return "en";
|
|
233
|
+
}
|
|
234
|
+
return value;
|
|
235
|
+
}
|
|
236
|
+
// GET /api/manage/v1/content/slot-values (M35 C2). `ids` is parsed by the route with parseSlotRowIds.
|
|
237
|
+
export const ContentSlotValuesQuerySchema = z
|
|
238
|
+
.object({
|
|
239
|
+
kind: z.enum(CONTENT_SLOT_KINDS),
|
|
240
|
+
ids: z.string().min(1).max(CONTENT_SLOT_ROWS_MAX * 40),
|
|
241
|
+
culture: z.string().min(2).max(35).optional(),
|
|
242
|
+
lang: z.string().max(35).optional(),
|
|
243
|
+
})
|
|
244
|
+
.strict();
|
|
245
|
+
export const BadgeCellSchema = z.object({ text: z.string(), tone: z.enum(BADGE_TONES) }).strict();
|
|
246
|
+
export const ContentSlotValuesSlotSchema = z
|
|
247
|
+
.object({
|
|
248
|
+
pluginId: z.string(),
|
|
249
|
+
slotId: z.string(),
|
|
250
|
+
failed: z.boolean(),
|
|
251
|
+
cells: z.record(z.string(), z.union([z.string(), BadgeCellSchema, z.null()])),
|
|
252
|
+
})
|
|
253
|
+
.strict();
|
|
254
|
+
export const ContentSlotValuesResponseSchema = z.object({ slots: z.array(ContentSlotValuesSlotSchema) }).strict();
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ContractDocument } from "./plugin-contract-document.js";
|
|
2
|
+
import type { ServiceOffer, ServiceUse } from "./plugin-service-declarations.js";
|
|
3
|
+
export interface ContractCheckNames {
|
|
4
|
+
plugin: string;
|
|
5
|
+
owner: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function contractOfferProblems(offer: ServiceOffer, document: ContractDocument, names: ContractCheckNames): string[];
|
|
8
|
+
export declare function contractUseProblems(use: ServiceUse, document: ContractDocument): string[];
|
|
9
|
+
export declare function contractCopyMismatchMessage(contract: string, version: string, ownerName: string): string;
|
|
10
|
+
/** The online warning: the owner published a newer minor than the one declared (an offer's version, or a use's range's minimum). */
|
|
11
|
+
export declare function contractNewerMinorNotice(declared: {
|
|
12
|
+
kind: "offer" | "use";
|
|
13
|
+
contract: string;
|
|
14
|
+
versionOrRange: string;
|
|
15
|
+
}, latest: ContractDocument): string | null;
|
|
16
|
+
/** `<contract>@<version>` or `<contract>@<range>`, split at the last "@", length capped first. The cap is defence
|
|
17
|
+
* in depth: every spec over it already fails parseContractId's or the version's own length rule, so no test can
|
|
18
|
+
* turn it red; it keeps the split and the parses from ever walking a long string. */
|
|
19
|
+
export declare function parseContractSpec(spec: string, kind: "version" | "range"): {
|
|
20
|
+
contract: string;
|
|
21
|
+
select: string;
|
|
22
|
+
} | null;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { PLUGIN_ID_MAX } from "./plugin-id-rules.js";
|
|
2
|
+
import { SERVICE_NAME_MAX, contractRangeAllows, formatContractVersion, parseContractId, parseContractRange, parseContractVersion } from "./plugin-services.js";
|
|
3
|
+
function publishedRangeText(document) {
|
|
4
|
+
const versions = document.published.map((entry) => entry.version);
|
|
5
|
+
return versions.length === 1 ? versions[0] : `${versions[0]} to ${versions[versions.length - 1]}`;
|
|
6
|
+
}
|
|
7
|
+
export function contractOfferProblems(offer, document, names) {
|
|
8
|
+
const version = formatContractVersion(offer.version);
|
|
9
|
+
const name = parseContractId(offer.contract).name;
|
|
10
|
+
const entry = document.published.find((candidate) => candidate.version === version);
|
|
11
|
+
if (entry === undefined) {
|
|
12
|
+
return [`${names.plugin} offers ${offer.contract} ${version}, but ${names.owner} has published ${publishedRangeText(document)}. Change the version, or run kardalum plugin contract add ${offer.contract}@^${offer.version.major}.0.`];
|
|
13
|
+
}
|
|
14
|
+
const problems = [];
|
|
15
|
+
for (const method of entry.methods) {
|
|
16
|
+
if (offer.implements.includes(method))
|
|
17
|
+
continue;
|
|
18
|
+
const without = [...document.published].reverse().find((candidate) => parseContractVersion(candidate.version).minor < offer.version.minor && !candidate.methods.includes(method));
|
|
19
|
+
problems.push(`${name} ${version} has the method ${method}; ${names.plugin}'s implementation does not. ${without === undefined ? "Add it." : `Add it, or offer ${without.version}, which has no ${method}.`}`);
|
|
20
|
+
}
|
|
21
|
+
return problems;
|
|
22
|
+
}
|
|
23
|
+
export function contractUseProblems(use, document) {
|
|
24
|
+
if (document.published.some((entry) => contractRangeAllows(use.rangeText, entry.version)))
|
|
25
|
+
return [];
|
|
26
|
+
return [`no version of ${use.contract} matches ${use.rangeText} (published: ${publishedRangeText(document)}).`];
|
|
27
|
+
}
|
|
28
|
+
export function contractCopyMismatchMessage(contract, version, ownerName) {
|
|
29
|
+
const name = parseContractId(contract)?.name ?? contract;
|
|
30
|
+
return `your copy of ${name} ${version} is not the one ${ownerName} published. Run kardalum plugin contract add to refresh it.`;
|
|
31
|
+
}
|
|
32
|
+
/** The online warning: the owner published a newer minor than the one declared (an offer's version, or a use's range's minimum). */
|
|
33
|
+
export function contractNewerMinorNotice(declared, latest) {
|
|
34
|
+
const own = declared.kind === "offer" ? parseContractVersion(declared.versionOrRange) : parseContractRange(declared.versionOrRange);
|
|
35
|
+
const newest = parseContractVersion(latest.version);
|
|
36
|
+
if (own === null || own.major !== newest.major || newest.minor <= own.minor)
|
|
37
|
+
return null;
|
|
38
|
+
const before = latest.published.find((entry) => entry.version === formatContractVersion(own));
|
|
39
|
+
const added = latest.published[latest.published.length - 1].methods.filter((method) => !(before?.methods ?? []).includes(method));
|
|
40
|
+
const name = parseContractId(declared.contract)?.name ?? declared.contract;
|
|
41
|
+
const what = added.length === 0 ? "" : ` (new: the method${added.length === 1 ? "" : "s"} ${added.join(", ")})`;
|
|
42
|
+
// An exact range (`1.2`) admits only its own minor, so it does not pick up the newer one; a caret range does.
|
|
43
|
+
const exact = declared.kind === "use" && parseContractRange(declared.versionOrRange).exact;
|
|
44
|
+
const tail = declared.kind === "offer"
|
|
45
|
+
? `Your offer of ${declared.versionOrRange} keeps working.`
|
|
46
|
+
: exact
|
|
47
|
+
? `Your range ${declared.versionOrRange} does not admit it; widen it to ^${declared.versionOrRange} to use it.`
|
|
48
|
+
: `Your range ${declared.versionOrRange} already admits it.`;
|
|
49
|
+
return `${latest.owner.name} has published ${name} ${latest.version}${what}. ${tail}`;
|
|
50
|
+
}
|
|
51
|
+
/** `<contract>@<version>` or `<contract>@<range>`, split at the last "@", length capped first. The cap is defence
|
|
52
|
+
* in depth: every spec over it already fails parseContractId's or the version's own length rule, so no test can
|
|
53
|
+
* turn it red; it keeps the split and the parses from ever walking a long string. */
|
|
54
|
+
export function parseContractSpec(spec, kind) {
|
|
55
|
+
if (typeof spec !== "string" || spec.length > PLUGIN_ID_MAX + 1 + SERVICE_NAME_MAX + 1 + 8)
|
|
56
|
+
return null;
|
|
57
|
+
const at = spec.lastIndexOf("@");
|
|
58
|
+
if (at <= 0)
|
|
59
|
+
return null;
|
|
60
|
+
const contract = spec.slice(0, at);
|
|
61
|
+
const select = spec.slice(at + 1);
|
|
62
|
+
if (parseContractId(contract) === null)
|
|
63
|
+
return null;
|
|
64
|
+
const ok = kind === "version" ? parseContractVersion(select) !== null : parseContractRange(select) !== null;
|
|
65
|
+
return ok ? { contract, select } : null;
|
|
66
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { CONTRACT_FINGERPRINT_PREFIX, isContractFingerprint } from "./plugin-services.js";
|
|
3
|
+
import { CONTRACT_PROVIDERS_USE_MAX, type ServiceContract } from "./plugin-service-declarations.js";
|
|
4
|
+
export declare const CONTRACT_DOCUMENT_FORMAT = 1;
|
|
5
|
+
/** The most minor versions of one major a document lists. */
|
|
6
|
+
export declare const CONTRACT_HISTORY_MAX = 64;
|
|
7
|
+
/** The largest contract route answer the tools read, in bytes. */
|
|
8
|
+
export declare const CONTRACT_DOWNLOAD_BYTES_MAX = 524288;
|
|
9
|
+
export declare const CONTRACTS_FOLDER = "contracts";
|
|
10
|
+
export declare const CONTRACT_SCHEMA_FILE = "schema.json";
|
|
11
|
+
export declare const CONTRACT_TYPES_FILE = "types.ts";
|
|
12
|
+
/** The longest owner name a document or an owner list carries. */
|
|
13
|
+
export declare const CONTRACT_OWNER_NAME_MAX = 80;
|
|
14
|
+
/** An owner's name cut to CONTRACT_OWNER_NAME_MAX UTF-16 units at a whole character, never inside a pair: the one cut
|
|
15
|
+
* the marketplace's contract route and `kardalum plugin contract export` both make. */
|
|
16
|
+
export declare function ownerNameOf(name: string): string;
|
|
17
|
+
/** The most contracts an owner list names. */
|
|
18
|
+
export declare const CONTRACT_OWNER_LIST_MAX = 64;
|
|
19
|
+
export { CONTRACT_FINGERPRINT_PREFIX, CONTRACT_PROVIDERS_USE_MAX, isContractFingerprint };
|
|
20
|
+
/** An owner's name as the tools print it to a terminal or a README: 1 to CONTRACT_OWNER_NAME_MAX characters with
|
|
21
|
+
* no control (C0 or C1, an 8-bit CSI included), zero-width or direction-override character, read by a linear
|
|
22
|
+
* scan because it is the network's text. */
|
|
23
|
+
export declare function isContractDisplayName(value: unknown): value is string;
|
|
24
|
+
export declare const ContractDocumentSchema: z.ZodObject<{
|
|
25
|
+
format: z.ZodLiteral<1>;
|
|
26
|
+
contract: z.ZodString;
|
|
27
|
+
version: z.ZodString;
|
|
28
|
+
owner: z.ZodObject<{
|
|
29
|
+
id: z.ZodString;
|
|
30
|
+
name: z.ZodString;
|
|
31
|
+
paid: z.ZodBoolean;
|
|
32
|
+
}, z.core.$strict>;
|
|
33
|
+
pluginVersion: z.ZodString;
|
|
34
|
+
label: z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
|
|
35
|
+
en: z.ZodString;
|
|
36
|
+
}, z.core.$catchall<z.ZodString>>, unknown>]>;
|
|
37
|
+
description: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
|
|
38
|
+
en: z.ZodString;
|
|
39
|
+
}, z.core.$catchall<z.ZodString>>, unknown>]>>;
|
|
40
|
+
methods: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
41
|
+
input: z.ZodCustom<Record<string, unknown>, Record<string, unknown>>;
|
|
42
|
+
output: z.ZodCustom<Record<string, unknown>, Record<string, unknown>>;
|
|
43
|
+
timeMs: z.ZodOptional<z.ZodNumber>;
|
|
44
|
+
writes: z.ZodOptional<z.ZodBoolean>;
|
|
45
|
+
refusals: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
46
|
+
addedIn: z.ZodOptional<z.ZodString>;
|
|
47
|
+
}, z.core.$strict>>;
|
|
48
|
+
providersUse: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
49
|
+
contract: z.ZodString;
|
|
50
|
+
range: z.ZodString;
|
|
51
|
+
}, z.core.$strict>>>;
|
|
52
|
+
published: z.ZodArray<z.ZodObject<{
|
|
53
|
+
version: z.ZodString;
|
|
54
|
+
methods: z.ZodArray<z.ZodString>;
|
|
55
|
+
}, z.core.$strict>>;
|
|
56
|
+
fingerprint: z.ZodString;
|
|
57
|
+
}, z.core.$strict>;
|
|
58
|
+
export type ContractDocument = z.infer<typeof ContractDocumentSchema>;
|
|
59
|
+
export declare const ContractDownloadSchema: z.ZodObject<{
|
|
60
|
+
document: z.ZodObject<{
|
|
61
|
+
format: z.ZodLiteral<1>;
|
|
62
|
+
contract: z.ZodString;
|
|
63
|
+
version: z.ZodString;
|
|
64
|
+
owner: z.ZodObject<{
|
|
65
|
+
id: z.ZodString;
|
|
66
|
+
name: z.ZodString;
|
|
67
|
+
paid: z.ZodBoolean;
|
|
68
|
+
}, z.core.$strict>;
|
|
69
|
+
pluginVersion: z.ZodString;
|
|
70
|
+
label: z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
|
|
71
|
+
en: z.ZodString;
|
|
72
|
+
}, z.core.$catchall<z.ZodString>>, unknown>]>;
|
|
73
|
+
description: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
|
|
74
|
+
en: z.ZodString;
|
|
75
|
+
}, z.core.$catchall<z.ZodString>>, unknown>]>>;
|
|
76
|
+
methods: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
77
|
+
input: z.ZodCustom<Record<string, unknown>, Record<string, unknown>>;
|
|
78
|
+
output: z.ZodCustom<Record<string, unknown>, Record<string, unknown>>;
|
|
79
|
+
timeMs: z.ZodOptional<z.ZodNumber>;
|
|
80
|
+
writes: z.ZodOptional<z.ZodBoolean>;
|
|
81
|
+
refusals: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
82
|
+
addedIn: z.ZodOptional<z.ZodString>;
|
|
83
|
+
}, z.core.$strict>>;
|
|
84
|
+
providersUse: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
85
|
+
contract: z.ZodString;
|
|
86
|
+
range: z.ZodString;
|
|
87
|
+
}, z.core.$strict>>>;
|
|
88
|
+
published: z.ZodArray<z.ZodObject<{
|
|
89
|
+
version: z.ZodString;
|
|
90
|
+
methods: z.ZodArray<z.ZodString>;
|
|
91
|
+
}, z.core.$strict>>;
|
|
92
|
+
fingerprint: z.ZodString;
|
|
93
|
+
}, z.core.$strict>;
|
|
94
|
+
types: z.ZodString;
|
|
95
|
+
}, z.core.$strict>;
|
|
96
|
+
export type ContractDownload = z.infer<typeof ContractDownloadSchema>;
|
|
97
|
+
export declare const OwnerContractsSchema: z.ZodObject<{
|
|
98
|
+
owner: z.ZodObject<{
|
|
99
|
+
id: z.ZodString;
|
|
100
|
+
name: z.ZodString;
|
|
101
|
+
paid: z.ZodBoolean;
|
|
102
|
+
}, z.core.$strict>;
|
|
103
|
+
contracts: z.ZodArray<z.ZodObject<{
|
|
104
|
+
name: z.ZodString;
|
|
105
|
+
label: z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
|
|
106
|
+
en: z.ZodString;
|
|
107
|
+
}, z.core.$catchall<z.ZodString>>, unknown>]>;
|
|
108
|
+
latest: z.ZodString;
|
|
109
|
+
versions: z.ZodArray<z.ZodString>;
|
|
110
|
+
}, z.core.$strict>>;
|
|
111
|
+
}, z.core.$strict>;
|
|
112
|
+
export type OwnerContracts = z.infer<typeof OwnerContractsSchema>;
|
|
113
|
+
/** The document read back as the owner's contract, or null when a method does not read. */
|
|
114
|
+
export declare function contractOfDocument(document: ContractDocument): ServiceContract | null;
|
|
115
|
+
export interface ContractHistoryEntry {
|
|
116
|
+
version: string;
|
|
117
|
+
methods: string[];
|
|
118
|
+
pluginVersion: string;
|
|
119
|
+
/** The serviceContracts entry as that plugin version's manifest.json wrote it. */
|
|
120
|
+
declaration: unknown;
|
|
121
|
+
}
|
|
122
|
+
/** Each minor of one contract's major once, oldest first, from published plugin versions given newest first. */
|
|
123
|
+
export declare function publishedContractHistory(rows: ReadonlyArray<{
|
|
124
|
+
pluginVersion: string;
|
|
125
|
+
contracts: unknown;
|
|
126
|
+
}>, ownerId: string, name: string, major: number): ContractHistoryEntry[];
|
|
127
|
+
/** Plan decision 3: what the fingerprint hashes. Labels and descriptions are not part of it. */
|
|
128
|
+
export declare function contractFingerprintText(contract: ServiceContract): string;
|
|
129
|
+
/** `["contracts", "<owner id>", "<name>@<version>"]` from a checked id and version, or null. */
|
|
130
|
+
export declare function contractFolderSegments(contract: string, version: string): [string, string, string] | null;
|