@kardalum/plugin-sdk 0.18.0 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +253 -0
- package/README.md +20 -1
- package/dist/admin-section-registry.d.ts +16 -1
- package/dist/admin-section-registry.js +23 -0
- package/dist/assets/asset-picker.js +3 -3
- package/dist/built-in-editor-ids.d.ts +1 -1
- package/dist/built-in-editor-ids.js +2 -20
- package/dist/built-in-serializers.js +1 -1
- package/dist/built-in-settings-schemas.d.ts +10 -0
- package/dist/built-in-settings-schemas.js +90 -4
- package/dist/built-in-value-schemas.js +35 -0
- package/dist/built-ins.js +48 -17
- package/dist/capabilities.d.ts +11 -1
- package/dist/capabilities.js +55 -3
- package/dist/cli.d.ts +66 -0
- package/dist/cli.js +22 -0
- package/dist/content-library.d.ts +85 -0
- package/dist/content-library.js +15 -0
- package/dist/content-picker/page-picker-sheet.d.ts +13 -0
- package/dist/content-picker/page-picker-sheet.js +105 -0
- package/dist/content-picker/page-tree.d.ts +25 -0
- package/dist/content-picker/page-tree.js +132 -0
- package/dist/data-type-plugin.d.ts +9 -3
- package/dist/datatype-validation.d.ts +6 -11
- package/dist/datatype-validation.js +141 -3
- package/dist/define-plugin.d.ts +4 -4
- package/dist/define-plugin.js +5 -5
- package/dist/entitlement-entry.d.ts +1 -1
- package/dist/entitlement-entry.js +1 -1
- package/dist/entitlement-gate.d.ts +14 -0
- package/dist/entitlement-gate.js +64 -7
- package/dist/entitlement-plan.d.ts +6 -0
- package/dist/entitlement-plan.js +10 -0
- package/dist/entitlement-types.d.ts +36 -12
- package/dist/entitlement.d.ts +31 -4
- package/dist/entitlement.js +58 -17
- package/dist/hook-entry.d.ts +5 -0
- package/dist/hook-entry.js +30 -0
- package/dist/host-entry.d.ts +1 -1
- package/dist/host-entry.js +1 -1
- package/dist/index.d.ts +38 -4
- package/dist/index.js +54 -3
- package/dist/mail.d.ts +30 -0
- package/dist/mail.js +1 -0
- package/dist/manifest-entry.d.ts +29 -4
- package/dist/manifest-entry.js +39 -2
- package/dist/manifest-schema.d.ts +443 -29
- package/dist/manifest-schema.js +292 -24
- package/dist/manifest.d.ts +450 -51
- package/dist/manifest.js +1 -1
- package/dist/media/media-picker.js +33 -20
- package/dist/media/upload-error.d.ts +5 -1
- package/dist/media/upload-error.js +14 -2
- package/dist/media-library.d.ts +32 -0
- package/dist/media-library.js +15 -0
- package/dist/nested-field-host.d.ts +76 -0
- package/dist/nested-field-host.js +90 -0
- package/dist/notify.d.ts +12 -4
- package/dist/notify.js +1 -1
- package/dist/outbound.d.ts +47 -0
- package/dist/outbound.js +1 -0
- package/dist/plugin-context.d.ts +5 -0
- package/dist/plugin-context.js +3 -3
- package/dist/plugin-screen-context.d.ts +112 -0
- package/dist/plugin-screen-context.js +26 -0
- package/dist/providers.d.ts +268 -0
- package/dist/providers.js +74 -0
- package/dist/read-all-pages.d.ts +5 -0
- package/dist/read-all-pages.js +3 -2
- package/dist/register-built-ins.js +6 -6
- package/dist/registry.js +1 -1
- package/dist/richtext/block-panel.js +12 -7
- package/dist/richtext/extensions.js +7 -7
- package/dist/richtext/insert-menu.js +12 -9
- package/dist/richtext/style-listbox.js +7 -5
- package/dist/richtext/text-style-class.js +1 -1
- package/dist/sdk-strings.d.ts +285 -0
- package/dist/sdk-strings.js +347 -0
- package/dist/sealing.d.ts +14 -0
- package/dist/sealing.js +1 -0
- package/dist/simple-storage-value-provider.js +27 -27
- package/dist/structured-storage-types.d.ts +309 -9
- package/dist/structured-storage-types.js +2 -2
- package/dist/text-entry.d.ts +1 -0
- package/dist/text-entry.js +6 -0
- package/dist/tokens/tailwind-theme.css +5 -0
- package/dist/tokens/tokens.css +15 -3
- package/dist/tokens/tokens.json +8 -3
- package/dist/ui-entry.js +3 -3
- package/dist/views/asset-view.js +6 -3
- package/dist/views/content-list-preview.js +3 -1
- package/dist/views/content-list-settings-view.js +11 -7
- package/dist/views/content-list-view.d.ts +5 -3
- package/dist/views/content-list-view.js +38 -34
- package/dist/views/content-picker-view.d.ts +3 -0
- package/dist/views/content-picker-view.js +143 -0
- package/dist/views/crop-view.d.ts +4 -6
- package/dist/views/crop-view.js +22 -13
- package/dist/views/date-range-view.js +9 -6
- package/dist/views/file-upload-view.d.ts +5 -7
- package/dist/views/file-upload-view.js +16 -7
- package/dist/views/group-view.d.ts +8 -0
- package/dist/views/group-view.js +123 -0
- package/dist/views/html-code-editor.js +2 -2
- package/dist/views/html-view.js +12 -11
- package/dist/views/image-view.js +40 -22
- package/dist/views/link-view.d.ts +3 -0
- package/dist/views/link-view.js +150 -0
- package/dist/views/options-list-view.d.ts +3 -0
- package/dist/views/options-list-view.js +104 -0
- package/dist/views/repeatable-list-view.d.ts +3 -0
- package/dist/views/repeatable-list-view.js +113 -0
- package/dist/views/rich-text-view.js +32 -16
- package/dist/views/suggest-key.d.ts +17 -0
- package/dist/views/suggest-key.js +55 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-connections.schema.d.ts +215 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-connections.schema.js +179 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-context.schema.d.ts +12 -0
- package/node_modules/@kardalum/api-schemas/dist/ai-context.schema.js +10 -0
- package/node_modules/@kardalum/api-schemas/dist/api-error.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.d.ts +10 -0
- package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.js +5 -0
- package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.d.ts +7 -1
- package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.js +4 -2
- package/node_modules/@kardalum/api-schemas/dist/auth.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/built-in-editor-ids.d.ts +1 -0
- package/node_modules/@kardalum/api-schemas/dist/built-in-editor-ids.js +27 -0
- package/node_modules/@kardalum/api-schemas/dist/capability-detail.d.ts +65 -0
- package/node_modules/@kardalum/api-schemas/dist/capability-detail.js +126 -0
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.d.ts +116 -3
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.js +71 -18
- package/node_modules/@kardalum/api-schemas/dist/content-list.schema.d.ts +57 -2
- package/node_modules/@kardalum/api-schemas/dist/content-list.schema.js +137 -0
- package/node_modules/@kardalum/api-schemas/dist/content-path.d.ts +1 -1
- package/node_modules/@kardalum/api-schemas/dist/content-path.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/content-search.schema.d.ts +50 -0
- package/node_modules/@kardalum/api-schemas/dist/content-search.schema.js +42 -0
- package/node_modules/@kardalum/api-schemas/dist/content-summary.schema.d.ts +37 -0
- package/node_modules/@kardalum/api-schemas/dist/content-summary.schema.js +19 -0
- package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.js +3 -3
- package/node_modules/@kardalum/api-schemas/dist/content-trash.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/content-unpublish.schema.d.ts +23 -0
- package/node_modules/@kardalum/api-schemas/dist/content-unpublish.schema.js +13 -0
- package/node_modules/@kardalum/api-schemas/dist/content.schema.d.ts +3 -0
- package/node_modules/@kardalum/api-schemas/dist/content.schema.js +10 -0
- package/node_modules/@kardalum/api-schemas/dist/contract-cancel.schema.d.ts +41 -0
- package/node_modules/@kardalum/api-schemas/dist/contract-cancel.schema.js +86 -0
- package/node_modules/@kardalum/api-schemas/dist/core-actions.d.ts +10 -5
- package/node_modules/@kardalum/api-schemas/dist/core-actions.js +7 -4
- package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.d.ts +25 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.js +9 -1
- package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.js +4 -4
- package/node_modules/@kardalum/api-schemas/dist/data-type-issue.d.ts +35 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-issue.js +60 -0
- package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.d.ts +267 -12
- package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +54 -8
- package/node_modules/@kardalum/api-schemas/dist/document-type.schema.d.ts +24 -6
- package/node_modules/@kardalum/api-schemas/dist/document-type.schema.js +98 -13
- package/node_modules/@kardalum/api-schemas/dist/form-protection.d.ts +23 -0
- package/node_modules/@kardalum/api-schemas/dist/form-protection.js +12 -0
- package/node_modules/@kardalum/api-schemas/dist/graphql-limits.d.ts +12 -0
- package/node_modules/@kardalum/api-schemas/dist/graphql-limits.js +14 -0
- package/node_modules/@kardalum/api-schemas/dist/held-embed-words.d.ts +23 -0
- package/node_modules/@kardalum/api-schemas/dist/held-embed-words.js +70 -0
- package/node_modules/@kardalum/api-schemas/dist/index.d.ts +122 -43
- package/node_modules/@kardalum/api-schemas/dist/index.js +92 -27
- package/node_modules/@kardalum/api-schemas/dist/install-sign-in-switched-off.schema.d.ts +9 -0
- package/node_modules/@kardalum/api-schemas/dist/install-sign-in-switched-off.schema.js +9 -0
- package/node_modules/@kardalum/api-schemas/dist/legal-anchors.d.ts +8 -0
- package/node_modules/@kardalum/api-schemas/dist/legal-anchors.js +9 -0
- package/node_modules/@kardalum/api-schemas/dist/licensing.schema.d.ts +63 -0
- package/node_modules/@kardalum/api-schemas/dist/licensing.schema.js +54 -0
- package/node_modules/@kardalum/api-schemas/dist/listing-categories.schema.d.ts +46 -0
- package/node_modules/@kardalum/api-schemas/dist/listing-categories.schema.js +52 -0
- package/node_modules/@kardalum/api-schemas/dist/mail-rules.d.ts +224 -0
- package/node_modules/@kardalum/api-schemas/dist/mail-rules.js +404 -0
- package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.d.ts +8 -0
- package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.js +4 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-leaks.schema.d.ts +145 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-leaks.schema.js +154 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.d.ts +359 -8
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +85 -11
- package/node_modules/@kardalum/api-schemas/dist/marketplace-package-api.schema.d.ts +15 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-package-api.schema.js +14 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-payouts.schema.d.ts +131 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-payouts.schema.js +272 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-profile.schema.d.ts +84 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-profile.schema.js +138 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-revocation.schema.d.ts +20 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-revocation.schema.js +49 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-sites.schema.d.ts +211 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-sites.schema.js +424 -0
- package/node_modules/@kardalum/api-schemas/dist/mcp-plugins.schema.d.ts +78 -0
- package/node_modules/@kardalum/api-schemas/dist/mcp-plugins.schema.js +27 -0
- package/node_modules/@kardalum/api-schemas/dist/mcp-tool-inputs.schema.d.ts +70 -0
- package/node_modules/@kardalum/api-schemas/dist/mcp-tool-inputs.schema.js +43 -0
- package/node_modules/@kardalum/api-schemas/dist/media-api.schema.d.ts +22 -0
- package/node_modules/@kardalum/api-schemas/dist/media-api.schema.js +22 -10
- package/node_modules/@kardalum/api-schemas/dist/media-move.schema.d.ts +75 -0
- package/node_modules/@kardalum/api-schemas/dist/media-move.schema.js +53 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference-api.schema.d.ts +2 -2
- package/node_modules/@kardalum/api-schemas/dist/media-reference.d.ts +2 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference.js +55 -0
- package/node_modules/@kardalum/api-schemas/dist/media.schema.d.ts +1 -0
- package/node_modules/@kardalum/api-schemas/dist/media.schema.js +9 -5
- package/node_modules/@kardalum/api-schemas/dist/nested-fields.schema.d.ts +204 -0
- package/node_modules/@kardalum/api-schemas/dist/nested-fields.schema.js +370 -0
- package/node_modules/@kardalum/api-schemas/dist/nested-validation.d.ts +53 -0
- package/node_modules/@kardalum/api-schemas/dist/nested-validation.js +284 -0
- package/node_modules/@kardalum/api-schemas/dist/news.schema.d.ts +5 -5
- package/node_modules/@kardalum/api-schemas/dist/node-access.schema.d.ts +1 -2
- package/node_modules/@kardalum/api-schemas/dist/node-access.schema.js +1 -2
- package/node_modules/@kardalum/api-schemas/dist/notification-kinds.d.ts +145 -0
- package/node_modules/@kardalum/api-schemas/dist/notification-kinds.js +177 -0
- package/node_modules/@kardalum/api-schemas/dist/notification.schema.d.ts +258 -7
- package/node_modules/@kardalum/api-schemas/dist/notification.schema.js +96 -5
- package/node_modules/@kardalum/api-schemas/dist/page-address.d.ts +10 -0
- package/node_modules/@kardalum/api-schemas/dist/page-address.js +7 -0
- package/node_modules/@kardalum/api-schemas/dist/password-reset.schema.d.ts +34 -0
- package/node_modules/@kardalum/api-schemas/dist/password-reset.schema.js +60 -0
- package/node_modules/@kardalum/api-schemas/dist/plan-editor.schema.d.ts +28 -3
- package/node_modules/@kardalum/api-schemas/dist/plan-editor.schema.js +55 -8
- package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.d.ts +12 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.js +13 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-caller.d.ts +23 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-caller.js +16 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-cli-commands.d.ts +76 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-cli-commands.js +316 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-content-access.d.ts +42 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-content-access.js +74 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-data-type-configs.d.ts +31 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-data-type-configs.js +131 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.d.ts +26 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-text.js +1 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs.d.ts +26 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs.js +13 -5
- package/node_modules/@kardalum/api-schemas/dist/plugin-document-types.d.ts +228 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-document-types.js +41 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-durable-hooks.d.ts +26 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-durable-hooks.js +55 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-editor-extensions.d.ts +40 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-editor-extensions.js +124 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-field-info.d.ts +41 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-field-info.js +51 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-graphql-fields.d.ts +32 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-graphql-fields.js +102 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-held-embeds.d.ts +107 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-held-embeds.js +213 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-https-origin.d.ts +5 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-https-origin.js +21 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.d.ts +4 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.js +3 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.d.ts +44 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.js +38 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-install.d.ts +237 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-install.js +205 -6
- package/node_modules/@kardalum/api-schemas/dist/plugin-labels.d.ts +26 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-labels.js +29 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-locales.d.ts +32 -8
- package/node_modules/@kardalum/api-schemas/dist/plugin-locales.js +120 -14
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.d.ts +357 -4
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +279 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.d.ts +16 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.js +34 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-ai.d.ts +40 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-ai.js +139 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.d.ts +22 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.js +31 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-media-access.d.ts +25 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-media-access.js +43 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-outbound.d.ts +107 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-outbound.js +150 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-package-build.schema.d.ts +5 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-package-build.schema.js +7 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-providers.d.ts +310 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-providers.js +430 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-read-only.schema.d.ts +4 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-read-only.schema.js +2 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-sealed-values.d.ts +45 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-sealed-values.js +99 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-secrets.d.ts +68 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-secrets.js +114 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-settings.d.ts +342 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-settings.js +400 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-site-extensions.d.ts +180 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-site-extensions.js +612 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.d.ts +7 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.js +50 -7
- package/node_modules/@kardalum/api-schemas/dist/plugin-tasks.d.ts +45 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-tasks.js +197 -0
- package/node_modules/@kardalum/api-schemas/dist/plural-rules.d.ts +9 -0
- package/node_modules/@kardalum/api-schemas/dist/plural-rules.js +41 -0
- package/node_modules/@kardalum/api-schemas/dist/public-api.schema.d.ts +41 -0
- package/node_modules/@kardalum/api-schemas/dist/public-api.schema.js +100 -12
- package/node_modules/@kardalum/api-schemas/dist/refund-request.schema.d.ts +189 -0
- package/node_modules/@kardalum/api-schemas/dist/refund-request.schema.js +164 -0
- package/node_modules/@kardalum/api-schemas/dist/render-editing.d.ts +4 -4
- package/node_modules/@kardalum/api-schemas/dist/render-editing.js +4 -4
- package/node_modules/@kardalum/api-schemas/dist/render-settings-api.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/revenue-view.schema.js +7 -3
- package/node_modules/@kardalum/api-schemas/dist/rich-text-shape.d.ts +6 -0
- package/node_modules/@kardalum/api-schemas/dist/rich-text-shape.js +82 -0
- package/node_modules/@kardalum/api-schemas/dist/rich-text-text.d.ts +66 -0
- package/node_modules/@kardalum/api-schemas/dist/rich-text-text.js +497 -0
- package/node_modules/@kardalum/api-schemas/dist/sale-conditions.schema.d.ts +82 -0
- package/node_modules/@kardalum/api-schemas/dist/sale-conditions.schema.js +99 -0
- package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.d.ts +13 -0
- package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.js +28 -0
- package/node_modules/@kardalum/api-schemas/dist/sandbox-attach.schema.d.ts +91 -1
- package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.d.ts +289 -0
- package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.js +205 -0
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +121 -0
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.js +51 -10
- package/node_modules/@kardalum/api-schemas/dist/sign-in.schema.d.ts +384 -0
- package/node_modules/@kardalum/api-schemas/dist/sign-in.schema.js +616 -0
- package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.d.ts +3 -3
- package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.d.ts +1 -1
- package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/structured-duplicate-key.d.ts +13 -0
- package/node_modules/@kardalum/api-schemas/dist/structured-duplicate-key.js +26 -0
- package/node_modules/@kardalum/api-schemas/dist/structured-fields.schema.d.ts +66 -0
- package/node_modules/@kardalum/api-schemas/dist/structured-fields.schema.js +160 -0
- package/node_modules/@kardalum/api-schemas/dist/template-api.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/template.schema.d.ts +1 -0
- package/node_modules/@kardalum/api-schemas/dist/template.schema.js +3 -0
- package/node_modules/@kardalum/api-schemas/dist/theme-api.schema.d.ts +1 -1
- package/node_modules/@kardalum/api-schemas/dist/theme-api.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/transaction-rolled-back.d.ts +13 -0
- package/node_modules/@kardalum/api-schemas/dist/transaction-rolled-back.js +29 -0
- package/node_modules/@kardalum/api-schemas/dist/trash-purge.schema.d.ts +13 -0
- package/node_modules/@kardalum/api-schemas/dist/trash-purge.schema.js +6 -0
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.d.ts +58 -1
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +35 -4
- package/node_modules/@kardalum/api-schemas/dist/vendor-service.schema.d.ts +5 -1
- package/node_modules/@kardalum/api-schemas/dist/vendor-service.schema.js +4 -3
- package/node_modules/@kardalum/api-schemas/package.json +1 -0
- package/node_modules/@kardalum/design-tokens/dist/build-css.d.ts +1 -1
- package/node_modules/@kardalum/design-tokens/dist/build-css.js +8 -2
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.css +5 -0
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.d.ts +1 -1
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.js +3 -3
- package/node_modules/@kardalum/design-tokens/dist/theme-css.d.ts +2 -2
- package/node_modules/@kardalum/design-tokens/dist/theme-css.js +2 -2
- package/node_modules/@kardalum/design-tokens/dist/theme-types.d.ts +2 -2
- package/node_modules/@kardalum/design-tokens/dist/themes/dark.d.ts +3 -3
- package/node_modules/@kardalum/design-tokens/dist/themes/dark.js +3 -3
- package/node_modules/@kardalum/design-tokens/dist/themes/light.d.ts +1 -1
- package/node_modules/@kardalum/design-tokens/dist/themes/light.js +1 -1
- package/node_modules/@kardalum/design-tokens/dist/tokens.css +15 -3
- package/node_modules/@kardalum/design-tokens/dist/tokens.d.ts +4 -4
- package/node_modules/@kardalum/design-tokens/dist/tokens.js +17 -8
- package/node_modules/@kardalum/design-tokens/dist/tokens.json +8 -3
- package/node_modules/@kardalum/design-tokens/dist/types.d.ts +2 -2
- package/node_modules/@kardalum/design-tokens/dist/types.js +1 -1
- package/node_modules/@kardalum/plugin-package/dist/build-reference.d.ts +21 -2
- package/node_modules/@kardalum/plugin-package/dist/build-reference.js +8 -2
- package/node_modules/@kardalum/plugin-package/dist/capabilities.d.ts +17 -10
- package/node_modules/@kardalum/plugin-package/dist/capabilities.js +355 -22
- package/node_modules/@kardalum/plugin-package/dist/client-bundle.d.ts +1 -1
- package/node_modules/@kardalum/plugin-package/dist/client-bundle.js +2 -0
- package/node_modules/@kardalum/plugin-package/dist/cms-range.d.ts +17 -0
- package/node_modules/@kardalum/plugin-package/dist/cms-range.js +353 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/ai-declarations.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/ai-declarations.js +26 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.d.ts +1 -1
- package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.js +3 -2
- package/node_modules/@kardalum/plugin-package/dist/delivery/content-access.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/content-access.js +34 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.js +2 -2
- package/node_modules/@kardalum/plugin-package/dist/delivery/editor-extensions.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/editor-extensions.js +27 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/graphql-fields.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/graphql-fields.js +22 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/index.d.ts +1 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/index.js +1 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/label-languages.js +47 -5
- package/node_modules/@kardalum/plugin-package/dist/delivery/licence-check.d.ts +27 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/licence-check.js +95 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/locales.js +9 -4
- package/node_modules/@kardalum/plugin-package/dist/delivery/plugin-settings.d.ts +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/plugin-settings.js +68 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/providers.d.ts +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/providers.js +298 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/registry.js +27 -5
- package/node_modules/@kardalum/plugin-package/dist/delivery/sample-content.js +91 -2
- package/node_modules/@kardalum/plugin-package/dist/delivery/server-powers.d.ts +6 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/server-powers.js +140 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/site-extensions.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/site-extensions.js +36 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/templates.d.ts +1 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/templates.js +21 -1
- package/node_modules/@kardalum/plugin-package/dist/delivery/types.d.ts +10 -0
- package/node_modules/@kardalum/plugin-package/dist/envelope.d.ts +2 -2
- package/node_modules/@kardalum/plugin-package/dist/envelope.js +2 -2
- package/node_modules/@kardalum/plugin-package/dist/extract.d.ts +3 -3
- package/node_modules/@kardalum/plugin-package/dist/extract.js +9 -9
- package/node_modules/@kardalum/plugin-package/dist/hash.d.ts +1 -1
- package/node_modules/@kardalum/plugin-package/dist/hash.js +1 -1
- package/node_modules/@kardalum/plugin-package/dist/index.d.ts +4 -2
- package/node_modules/@kardalum/plugin-package/dist/index.js +2 -1
- package/node_modules/@kardalum/plugin-package/dist/license-verdict.d.ts +75 -0
- package/node_modules/@kardalum/plugin-package/dist/license-verdict.js +123 -0
- package/node_modules/@kardalum/plugin-package/dist/package-contract.d.ts +2 -2
- package/node_modules/@kardalum/plugin-package/dist/package-contract.js +5 -5
- package/node_modules/@kardalum/plugin-package/dist/types.d.ts +1 -1
- package/node_modules/@kardalum/ui/dist/components/alert-dialog.d.ts +1 -1
- package/node_modules/@kardalum/ui/dist/components/alert-dialog.js +8 -3
- package/node_modules/@kardalum/ui/dist/components/badge.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/button.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/dialog.d.ts +1 -1
- package/node_modules/@kardalum/ui/dist/components/dialog.js +49 -4
- package/node_modules/@kardalum/ui/dist/components/dropdown-menu.d.ts +5 -1
- package/node_modules/@kardalum/ui/dist/components/dropdown-menu.js +18 -5
- package/node_modules/@kardalum/ui/dist/components/empty-state.d.ts +4 -4
- package/node_modules/@kardalum/ui/dist/components/input.js +6 -1
- package/node_modules/@kardalum/ui/dist/components/property-field.js +3 -3
- package/node_modules/@kardalum/ui/dist/components/sheet.d.ts +1 -1
- package/node_modules/@kardalum/ui/dist/components/sheet.js +12 -7
- package/node_modules/@kardalum/ui/dist/components/skeleton.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/switch.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/tab-strip.d.ts +3 -3
- package/node_modules/@kardalum/ui/dist/components/toast.js +4 -3
- package/node_modules/@kardalum/ui/dist/components/tooltip.d.ts +27 -0
- package/node_modules/@kardalum/ui/dist/components/tooltip.js +81 -0
- package/node_modules/@kardalum/ui/dist/components/truncated-text.d.ts +16 -0
- package/node_modules/@kardalum/ui/dist/components/truncated-text.js +95 -0
- package/node_modules/@kardalum/ui/dist/components/use-toast.js +2 -2
- package/node_modules/@kardalum/ui/dist/index.d.ts +3 -1
- package/node_modules/@kardalum/ui/dist/index.js +3 -1
- package/node_modules/@kardalum/ui/dist/lib/menu-host.d.ts +5 -0
- package/node_modules/@kardalum/ui/dist/lib/menu-host.js +17 -0
- package/node_modules/@kardalum/ui/package.json +8 -6
- package/package.json +18 -7
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { cleanPluginText, hasHiddenPluginCharacter } from "./plugin-cli-commands.js";
|
|
2
|
+
import { apiRoutePathParams } from "./plugin-manifest-api-routes.js";
|
|
3
|
+
import { PLUGIN_TOOL_DESCRIPTION_MAX, PLUGIN_TOOL_NAME_MAX, isPluginToolName, pluginToolShortName } from "./plugin-manifest-ai.js";
|
|
4
|
+
// M32 F3b (D12, D17): a plugin `apiRoutes` entry offered as a field on the delivery API's GraphQL
|
|
5
|
+
// `Query` type, and the limits such a field runs under. The SDK's manifest schema and the
|
|
6
|
+
// marketplace door, which reads manifest.json without the SDK's Zod, read this one rule. Every
|
|
7
|
+
// check is a length or a character scan, and a message names only values that passed their check.
|
|
8
|
+
/** D12: the most GraphQL fields one plugin offers. */
|
|
9
|
+
export const PLUGIN_GRAPHQL_FIELDS_MAX = 10;
|
|
10
|
+
/** D14: the most arguments one field takes. */
|
|
11
|
+
export const PLUGIN_GRAPHQL_ARGUMENTS_MAX = 30;
|
|
12
|
+
/** D17: what one plugin field selection costs in the complexity rule (a core field costs 1). */
|
|
13
|
+
export const PLUGIN_GRAPHQL_FIELD_COST = 25;
|
|
14
|
+
/** D17: the most plugin field selections one operation makes, aliases counted. */
|
|
15
|
+
export const PLUGIN_GRAPHQL_FIELDS_PER_OPERATION = 10;
|
|
16
|
+
/** D17: how long a field waits for its route before it errors. */
|
|
17
|
+
export const PLUGIN_GRAPHQL_FIELD_TIMEOUT_MS = 10_000;
|
|
18
|
+
/** D17: the largest route answer a field resolves to (1 MiB). */
|
|
19
|
+
export const PLUGIN_GRAPHQL_ANSWER_MAX_BYTES = 1_048_576;
|
|
20
|
+
/** D16: the longest route message a field's error carries. */
|
|
21
|
+
export const PLUGIN_GRAPHQL_MESSAGE_MAX = 200;
|
|
22
|
+
/** D15: the longest query string a field's arguments make; a longer call is refused before the route runs. */
|
|
23
|
+
export const PLUGIN_GRAPHQL_QUERY_MAX = 8192;
|
|
24
|
+
const FIELD_KEYS = new Set(["name", "description"]);
|
|
25
|
+
const isRecord = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
26
|
+
/** D12: the field's name on `Query`, the MCP tool's prefix, "_" and the field's own name. */
|
|
27
|
+
export function pluginGraphqlFieldName(pluginId, name) {
|
|
28
|
+
return `${pluginToolShortName(pluginId)}_${name}`;
|
|
29
|
+
}
|
|
30
|
+
function cleanKey(key) {
|
|
31
|
+
return cleanPluginText(key, 64);
|
|
32
|
+
}
|
|
33
|
+
function hasPathParameter(path) {
|
|
34
|
+
return path.includes("*") || apiRoutePathParams(path).length > 0;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* D12: every route marking `graphqlField` is an `apiKey` `GET` route with an action and no `:` or
|
|
38
|
+
* `*` parameter in its path; the field has a name of the tool alphabet used once in the plugin and
|
|
39
|
+
* a description of 1 to 500 characters, not blank and with no hidden character; `graphqlField` holds
|
|
40
|
+
* no other key; a plugin offers at most 10 fields.
|
|
41
|
+
*/
|
|
42
|
+
export function checkPluginGraphqlFields(manifest) {
|
|
43
|
+
const issues = [];
|
|
44
|
+
const contributions = isRecord(manifest.contributions) ? manifest.contributions : {};
|
|
45
|
+
const routes = Array.isArray(contributions.apiRoutes) ? contributions.apiRoutes : [];
|
|
46
|
+
const seen = new Map();
|
|
47
|
+
let fields = 0;
|
|
48
|
+
routes.forEach((route, index) => {
|
|
49
|
+
if (!isRecord(route) || route.graphqlField === undefined)
|
|
50
|
+
return;
|
|
51
|
+
const at = ["contributions", "apiRoutes", index, "graphqlField"];
|
|
52
|
+
fields++;
|
|
53
|
+
if (fields > PLUGIN_GRAPHQL_FIELDS_MAX) {
|
|
54
|
+
issues.push({ path: at, message: `a plugin offers at most ${PLUGIN_GRAPHQL_FIELDS_MAX} GraphQL fields` });
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
if (route.access !== "apiKey") {
|
|
58
|
+
issues.push({ path: at, message: `apiRoutes.${index} marks graphqlField, but only an "apiKey" route can be a GraphQL field: the delivery API is always called with a key` });
|
|
59
|
+
}
|
|
60
|
+
if (route.method !== "GET") {
|
|
61
|
+
issues.push({ path: at, message: `apiRoutes.${index} marks graphqlField, but only a "GET" route can be a GraphQL field: a field only reads` });
|
|
62
|
+
}
|
|
63
|
+
if (typeof route.action !== "string" || route.action === "") {
|
|
64
|
+
issues.push({ path: at, message: `apiRoutes.${index} marks graphqlField, but a GraphQL field's route must declare an action` });
|
|
65
|
+
}
|
|
66
|
+
if (typeof route.path === "string" && hasPathParameter(route.path)) {
|
|
67
|
+
issues.push({ path: at, message: `apiRoutes.${index} marks graphqlField, but its path has a ":" or "*" parameter: a field's arguments come from the query string only` });
|
|
68
|
+
}
|
|
69
|
+
const field = route.graphqlField;
|
|
70
|
+
if (!isRecord(field)) {
|
|
71
|
+
issues.push({ path: at, message: "graphqlField must be an object with a name and a description" });
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
for (const key of Object.keys(field)) {
|
|
75
|
+
if (!FIELD_KEYS.has(key))
|
|
76
|
+
issues.push({ path: [...at, cleanKey(key)], message: "graphqlField holds only name and description" });
|
|
77
|
+
}
|
|
78
|
+
const { name, description } = field;
|
|
79
|
+
if (typeof name !== "string" || !isPluginToolName(name)) {
|
|
80
|
+
issues.push({ path: [...at, "name"], message: `graphqlField.name must be 1 to ${PLUGIN_TOOL_NAME_MAX} lower-case letters, digits and "_", starting with a letter` });
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
const earlier = seen.get(name);
|
|
84
|
+
if (earlier !== undefined) {
|
|
85
|
+
issues.push({ path: [...at, "name"], message: `the GraphQL field name "${name}" is also apiRoutes.${earlier}'s: each field of a plugin needs its own name` });
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
seen.set(name, index);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
if (typeof description !== "string" ||
|
|
92
|
+
description.length > PLUGIN_TOOL_DESCRIPTION_MAX ||
|
|
93
|
+
description.trim().length === 0 ||
|
|
94
|
+
hasHiddenPluginCharacter(description)) {
|
|
95
|
+
issues.push({
|
|
96
|
+
path: [...at, "description"],
|
|
97
|
+
message: `graphqlField.description must be 1 to ${PLUGIN_TOOL_DESCRIPTION_MAX} characters, not blank, with no zero-width or direction character`,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
return issues;
|
|
102
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** The longest id of a held embed. */
|
|
3
|
+
export declare const HELD_EMBED_ID_MAX = 40;
|
|
4
|
+
/** The longest path prefix of a held embed. */
|
|
5
|
+
export declare const HELD_EMBED_PATH_PREFIX_MAX = 200;
|
|
6
|
+
/** The longest provider name, in characters, in each language. */
|
|
7
|
+
export declare const HELD_EMBED_PROVIDER_MAX = 80;
|
|
8
|
+
/** The longest privacy notice address. */
|
|
9
|
+
export declare const HELD_EMBED_PRIVACY_URL_MAX = 500;
|
|
10
|
+
/** The most held embeds one plugin declares. */
|
|
11
|
+
export declare const HELD_EMBEDS_DECLARED_MAX = 5;
|
|
12
|
+
/** The longest frame address a tag may ask for. */
|
|
13
|
+
export declare const HELD_EMBED_SRC_MAX = 4096;
|
|
14
|
+
/** The longest frame title, in code points. */
|
|
15
|
+
export declare const HELD_EMBED_TITLE_MAX = 200;
|
|
16
|
+
/** The most held embeds one render writes; a request past it writes only the tag's `html`. */
|
|
17
|
+
export declare const HELD_EMBEDS_PER_RENDER_MAX = 20;
|
|
18
|
+
/** The largest the core's loader script may be, in bytes. */
|
|
19
|
+
export declare const HELD_EMBED_LOADER_MAX_BYTES = 4096;
|
|
20
|
+
/** The sandbox the core's loader gives every held frame: the frame's own page runs, but it cannot
|
|
21
|
+
* move the visitor's page. The one core value that may change after Google Maps' live check. */
|
|
22
|
+
export declare const HELD_EMBED_FRAME_SANDBOX = "allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox";
|
|
23
|
+
/** The referrer policy of every held frame: the site's address is sent, never the page's path. */
|
|
24
|
+
export declare const HELD_EMBED_FRAME_REFERRER_POLICY = "strict-origin-when-cross-origin";
|
|
25
|
+
/** The kinds of held content, each with its own words in held-embed-words.ts; `content` is the generic one. */
|
|
26
|
+
export declare const HELD_EMBED_KINDS: readonly ["map", "content"];
|
|
27
|
+
export type HeldEmbedKind = (typeof HELD_EMBED_KINDS)[number];
|
|
28
|
+
/** What a held frame may be allowed, each written into the frame's `allow`. */
|
|
29
|
+
export declare const HELD_EMBED_ALLOW: readonly ["fullscreen", "picture-in-picture", "encrypted-media"];
|
|
30
|
+
export type HeldEmbedAllow = (typeof HELD_EMBED_ALLOW)[number];
|
|
31
|
+
/** The shapes a held frame may take, each a class of the core's stylesheet. */
|
|
32
|
+
export declare const HELD_EMBED_RATIOS: readonly ["16:9", "4:3", "3:2", "1:1", "3:4", "9:16"];
|
|
33
|
+
export type HeldEmbedRatio = (typeof HELD_EMBED_RATIOS)[number];
|
|
34
|
+
export declare const HELD_EMBED_RATIO_DEFAULT: HeldEmbedRatio;
|
|
35
|
+
/**
|
|
36
|
+
* Why a path prefix is refused, or null. It starts and ends with "/", is at most
|
|
37
|
+
* HELD_EMBED_PATH_PREFIX_MAX, holds no "..", "%2e", "%2f" or "%5c" (any case), and is written the
|
|
38
|
+
* way the URL parser writes a path, so a frame address's parsed path can be compared with it as
|
|
39
|
+
* text (no space, backslash, "?", "#", control character or dot segment).
|
|
40
|
+
*/
|
|
41
|
+
export declare function heldEmbedPathPrefixProblem(prefix: string): string | null;
|
|
42
|
+
/**
|
|
43
|
+
* One held embed a plugin declares. Beyond the design's field limits, the two values the install
|
|
44
|
+
* line shows as the core's notes (`embedFrom`: origin and path prefix; `privacyNoticeAt`: the
|
|
45
|
+
* notice's host) must each fit CAPABILITY_NOTE_VALUE_MAX, or a listing carrying the line would not
|
|
46
|
+
* parse.
|
|
47
|
+
*/
|
|
48
|
+
export declare const PluginHeldEmbedSchema: z.ZodObject<{
|
|
49
|
+
id: z.ZodString;
|
|
50
|
+
origin: z.ZodString;
|
|
51
|
+
pathPrefix: z.ZodString;
|
|
52
|
+
provider: z.ZodPreprocess<z.ZodObject<{
|
|
53
|
+
en: z.ZodString;
|
|
54
|
+
}, z.core.$catchall<z.ZodString>>, unknown>;
|
|
55
|
+
privacyNotice: z.ZodString;
|
|
56
|
+
kind: z.ZodEnum<{
|
|
57
|
+
map: "map";
|
|
58
|
+
content: "content";
|
|
59
|
+
}>;
|
|
60
|
+
allow: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
61
|
+
fullscreen: "fullscreen";
|
|
62
|
+
"picture-in-picture": "picture-in-picture";
|
|
63
|
+
"encrypted-media": "encrypted-media";
|
|
64
|
+
}>>>;
|
|
65
|
+
}, z.core.$strict>;
|
|
66
|
+
export type PluginHeldEmbed = z.infer<typeof PluginHeldEmbedSchema>;
|
|
67
|
+
/** `contributions.heldEmbeds`: 1 to HELD_EMBEDS_DECLARED_MAX entries, each id once. */
|
|
68
|
+
export declare const PluginHeldEmbedsSchema: z.ZodArray<z.ZodObject<{
|
|
69
|
+
id: z.ZodString;
|
|
70
|
+
origin: z.ZodString;
|
|
71
|
+
pathPrefix: z.ZodString;
|
|
72
|
+
provider: z.ZodPreprocess<z.ZodObject<{
|
|
73
|
+
en: z.ZodString;
|
|
74
|
+
}, z.core.$catchall<z.ZodString>>, unknown>;
|
|
75
|
+
privacyNotice: z.ZodString;
|
|
76
|
+
kind: z.ZodEnum<{
|
|
77
|
+
map: "map";
|
|
78
|
+
content: "content";
|
|
79
|
+
}>;
|
|
80
|
+
allow: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
81
|
+
fullscreen: "fullscreen";
|
|
82
|
+
"picture-in-picture": "picture-in-picture";
|
|
83
|
+
"encrypted-media": "encrypted-media";
|
|
84
|
+
}>>>;
|
|
85
|
+
}, z.core.$strict>>;
|
|
86
|
+
/** What a template tag answers to show held content: one of its plugin's declared ids, the frame's address and title, and its shape. */
|
|
87
|
+
export interface HeldEmbedRequest {
|
|
88
|
+
id: string;
|
|
89
|
+
src: string;
|
|
90
|
+
title: string;
|
|
91
|
+
ratio?: HeldEmbedRatio;
|
|
92
|
+
}
|
|
93
|
+
/** Why a request is refused: a reason to log, never a value. */
|
|
94
|
+
export declare const HELD_EMBED_REQUEST_PROBLEMS: readonly ["shape", "id", "src", "title", "ratio"];
|
|
95
|
+
export type HeldEmbedRequestProblem = (typeof HELD_EMBED_REQUEST_PROBLEMS)[number];
|
|
96
|
+
/**
|
|
97
|
+
* Why a tag's `{ embed }` is refused, checked against its own plugin's declarations, or null when
|
|
98
|
+
* the core may write its placeholder. `src` is parsed with the URL parser: https, no user or
|
|
99
|
+
* password, its origin the declared one, its parsed path starting with the declared prefix and
|
|
100
|
+
* holding no escaped dot, slash or backslash, at most HELD_EMBED_SRC_MAX. Members the request
|
|
101
|
+
* does not define are ignored: the core writes only these four.
|
|
102
|
+
*/
|
|
103
|
+
export declare function heldEmbedRequestProblem(request: unknown, declarations: ReadonlyArray<{
|
|
104
|
+
id: string;
|
|
105
|
+
origin: string;
|
|
106
|
+
pathPrefix: string;
|
|
107
|
+
}>): HeldEmbedRequestProblem | null;
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { CAPABILITY_NOTE_VALUE_MAX } from "./capability-detail.js";
|
|
3
|
+
import { labelMapSchema } from "./plugin-labels.js";
|
|
4
|
+
import { PageHeadScriptOriginSchema } from "./plugin-https-origin.js";
|
|
5
|
+
import { hasNoControlCharacter } from "./strict-url.js";
|
|
6
|
+
// M33 K42 (Google Maps 2.10 C1): held content from other sites. A plugin declares under
|
|
7
|
+
// `contributions.heldEmbeds` the origins and paths it may show a frame from; a template tag
|
|
8
|
+
// answers `{ embed }` naming one of them, and the core writes a placeholder with its own words
|
|
9
|
+
// (held-embed-words.ts) and builds the frame only after a visitor clicks. The declaration's rules,
|
|
10
|
+
// the request check and every limit live here, so the SDK, the door, the server, the CLI and the
|
|
11
|
+
// marketplace read one list. Addresses are parsed with the WHATWG `URL` parser; everything else is
|
|
12
|
+
// a linear scan under a length cap, and no regular expression reads a plugin's value.
|
|
13
|
+
/** The longest id of a held embed. */
|
|
14
|
+
export const HELD_EMBED_ID_MAX = 40;
|
|
15
|
+
/** The longest path prefix of a held embed. */
|
|
16
|
+
export const HELD_EMBED_PATH_PREFIX_MAX = 200;
|
|
17
|
+
/** The longest provider name, in characters, in each language. */
|
|
18
|
+
export const HELD_EMBED_PROVIDER_MAX = 80;
|
|
19
|
+
/** The longest privacy notice address. */
|
|
20
|
+
export const HELD_EMBED_PRIVACY_URL_MAX = 500;
|
|
21
|
+
/** The most held embeds one plugin declares. */
|
|
22
|
+
export const HELD_EMBEDS_DECLARED_MAX = 5;
|
|
23
|
+
/** The longest frame address a tag may ask for. */
|
|
24
|
+
export const HELD_EMBED_SRC_MAX = 4096;
|
|
25
|
+
/** The longest frame title, in code points. */
|
|
26
|
+
export const HELD_EMBED_TITLE_MAX = 200;
|
|
27
|
+
/** The most held embeds one render writes; a request past it writes only the tag's `html`. */
|
|
28
|
+
export const HELD_EMBEDS_PER_RENDER_MAX = 20;
|
|
29
|
+
/** The largest the core's loader script may be, in bytes. */
|
|
30
|
+
export const HELD_EMBED_LOADER_MAX_BYTES = 4096;
|
|
31
|
+
/** The sandbox the core's loader gives every held frame: the frame's own page runs, but it cannot
|
|
32
|
+
* move the visitor's page. The one core value that may change after Google Maps' live check. */
|
|
33
|
+
export const HELD_EMBED_FRAME_SANDBOX = "allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox";
|
|
34
|
+
/** The referrer policy of every held frame: the site's address is sent, never the page's path. */
|
|
35
|
+
export const HELD_EMBED_FRAME_REFERRER_POLICY = "strict-origin-when-cross-origin";
|
|
36
|
+
/** The kinds of held content, each with its own words in held-embed-words.ts; `content` is the generic one. */
|
|
37
|
+
export const HELD_EMBED_KINDS = ["map", "content"];
|
|
38
|
+
/** What a held frame may be allowed, each written into the frame's `allow`. */
|
|
39
|
+
export const HELD_EMBED_ALLOW = ["fullscreen", "picture-in-picture", "encrypted-media"];
|
|
40
|
+
/** The shapes a held frame may take, each a class of the core's stylesheet. */
|
|
41
|
+
export const HELD_EMBED_RATIOS = ["16:9", "4:3", "3:2", "1:1", "3:4", "9:16"];
|
|
42
|
+
export const HELD_EMBED_RATIO_DEFAULT = "16:9";
|
|
43
|
+
const isLetter = (c) => (c >= "a" && c <= "z") || (c >= "A" && c <= "Z");
|
|
44
|
+
const isDigit = (c) => c >= "0" && c <= "9";
|
|
45
|
+
/** A letter, then letters, digits and "_", 1 to HELD_EMBED_ID_MAX. */
|
|
46
|
+
function isHeldEmbedId(value) {
|
|
47
|
+
if (value.length === 0 || value.length > HELD_EMBED_ID_MAX || !isLetter(value[0]))
|
|
48
|
+
return false;
|
|
49
|
+
for (const c of value)
|
|
50
|
+
if (!isLetter(c) && !isDigit(c) && c !== "_")
|
|
51
|
+
return false;
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
/** Whether the text holds `part`, ASCII case-insensitively (a linear scan; the text is bounded first by its caller). */
|
|
55
|
+
function holdsIgnoringCase(text, part) {
|
|
56
|
+
return text.toLowerCase().includes(part);
|
|
57
|
+
}
|
|
58
|
+
/** An escaped dot, slash or backslash in a path: a server that decodes it before routing may read
|
|
59
|
+
* a path outside the prefix that the parsed path seemed to stay in. */
|
|
60
|
+
function holdsEscapedSeparator(path) {
|
|
61
|
+
return holdsIgnoringCase(path, "%2e") || holdsIgnoringCase(path, "%2f") || holdsIgnoringCase(path, "%5c");
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Why a path prefix is refused, or null. It starts and ends with "/", is at most
|
|
65
|
+
* HELD_EMBED_PATH_PREFIX_MAX, holds no "..", "%2e", "%2f" or "%5c" (any case), and is written the
|
|
66
|
+
* way the URL parser writes a path, so a frame address's parsed path can be compared with it as
|
|
67
|
+
* text (no space, backslash, "?", "#", control character or dot segment).
|
|
68
|
+
*/
|
|
69
|
+
export function heldEmbedPathPrefixProblem(prefix) {
|
|
70
|
+
if (prefix.length === 0 || prefix.length > HELD_EMBED_PATH_PREFIX_MAX)
|
|
71
|
+
return `a path prefix is 1 to ${HELD_EMBED_PATH_PREFIX_MAX} characters`;
|
|
72
|
+
if (!prefix.startsWith("/") || !prefix.endsWith("/"))
|
|
73
|
+
return 'a path prefix starts and ends with "/"';
|
|
74
|
+
if (prefix.includes(".."))
|
|
75
|
+
return 'a path prefix holds no ".."';
|
|
76
|
+
if (holdsEscapedSeparator(prefix))
|
|
77
|
+
return 'a path prefix holds no "%2e", "%2f" or "%5c"';
|
|
78
|
+
let parsed;
|
|
79
|
+
try {
|
|
80
|
+
parsed = new URL(prefix, "https://held-embed.invalid");
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
return "a path prefix is a plain path";
|
|
84
|
+
}
|
|
85
|
+
// A control character, space, backslash, "?", "#" or dot segment makes the parsed path differ.
|
|
86
|
+
if (parsed.pathname !== prefix)
|
|
87
|
+
return "a path prefix is written as the URL parser writes it";
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
/** The host of an https address with no user or password, or null. */
|
|
91
|
+
function httpsHostOf(value) {
|
|
92
|
+
if (!hasNoControlCharacter(value))
|
|
93
|
+
return null;
|
|
94
|
+
let url;
|
|
95
|
+
try {
|
|
96
|
+
url = new URL(value);
|
|
97
|
+
}
|
|
98
|
+
catch {
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
return url.protocol === "https:" && url.username === "" && url.password === "" ? url.host : null;
|
|
102
|
+
}
|
|
103
|
+
const allowList = z.array(z.enum(HELD_EMBED_ALLOW)).superRefine((items, ctx) => {
|
|
104
|
+
const seen = new Set();
|
|
105
|
+
items.forEach((item, index) => {
|
|
106
|
+
if (seen.has(item))
|
|
107
|
+
ctx.addIssue({ code: "custom", message: `"${item}" is named twice`, path: [index] });
|
|
108
|
+
seen.add(item);
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
/**
|
|
112
|
+
* One held embed a plugin declares. Beyond the design's field limits, the two values the install
|
|
113
|
+
* line shows as the core's notes (`embedFrom`: origin and path prefix; `privacyNoticeAt`: the
|
|
114
|
+
* notice's host) must each fit CAPABILITY_NOTE_VALUE_MAX, or a listing carrying the line would not
|
|
115
|
+
* parse.
|
|
116
|
+
*/
|
|
117
|
+
export const PluginHeldEmbedSchema = z
|
|
118
|
+
.object({
|
|
119
|
+
id: z.string().refine(isHeldEmbedId, { message: `a letter, then letters, digits and "_", 1 to ${HELD_EMBED_ID_MAX} characters` }),
|
|
120
|
+
origin: PageHeadScriptOriginSchema,
|
|
121
|
+
pathPrefix: z.string().superRefine((value, ctx) => {
|
|
122
|
+
const problem = heldEmbedPathPrefixProblem(value);
|
|
123
|
+
if (problem !== null)
|
|
124
|
+
ctx.addIssue({ code: "custom", message: problem });
|
|
125
|
+
}),
|
|
126
|
+
provider: labelMapSchema({ max: HELD_EMBED_PROVIDER_MAX }),
|
|
127
|
+
privacyNotice: z
|
|
128
|
+
.string()
|
|
129
|
+
.max(HELD_EMBED_PRIVACY_URL_MAX, { message: `is at most ${HELD_EMBED_PRIVACY_URL_MAX} characters` })
|
|
130
|
+
.superRefine((value, ctx) => {
|
|
131
|
+
const host = httpsHostOf(value);
|
|
132
|
+
if (host === null)
|
|
133
|
+
ctx.addIssue({ code: "custom", message: "an https address with no user name or password" });
|
|
134
|
+
else if (host.length > CAPABILITY_NOTE_VALUE_MAX)
|
|
135
|
+
ctx.addIssue({ code: "custom", message: `its host is at most ${CAPABILITY_NOTE_VALUE_MAX} characters` });
|
|
136
|
+
}),
|
|
137
|
+
kind: z.enum(HELD_EMBED_KINDS),
|
|
138
|
+
allow: allowList.optional(),
|
|
139
|
+
})
|
|
140
|
+
.strict()
|
|
141
|
+
.superRefine((entry, ctx) => {
|
|
142
|
+
if (entry.origin.length + entry.pathPrefix.length > CAPABILITY_NOTE_VALUE_MAX) {
|
|
143
|
+
ctx.addIssue({ code: "custom", message: `the origin and path prefix together are at most ${CAPABILITY_NOTE_VALUE_MAX} characters`, path: ["pathPrefix"] });
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
/** `contributions.heldEmbeds`: 1 to HELD_EMBEDS_DECLARED_MAX entries, each id once. */
|
|
147
|
+
export const PluginHeldEmbedsSchema = z
|
|
148
|
+
.array(PluginHeldEmbedSchema)
|
|
149
|
+
.min(1, { message: "declares at least one held embed" })
|
|
150
|
+
.max(HELD_EMBEDS_DECLARED_MAX, { message: `declares at most ${HELD_EMBEDS_DECLARED_MAX} held embeds` })
|
|
151
|
+
.superRefine((entries, ctx) => {
|
|
152
|
+
const seen = new Set();
|
|
153
|
+
entries.forEach((entry, index) => {
|
|
154
|
+
if (seen.has(entry.id))
|
|
155
|
+
ctx.addIssue({ code: "custom", message: "declares each id once", path: [index, "id"] });
|
|
156
|
+
seen.add(entry.id);
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
/** Why a request is refused: a reason to log, never a value. */
|
|
160
|
+
export const HELD_EMBED_REQUEST_PROBLEMS = ["shape", "id", "src", "title", "ratio"];
|
|
161
|
+
/** A C0 or C1 control character, or DEL. */
|
|
162
|
+
function isControl(code) {
|
|
163
|
+
return code < 0x20 || (code >= 0x7f && code <= 0x9f);
|
|
164
|
+
}
|
|
165
|
+
/** 1 to HELD_EMBED_TITLE_MAX code points, not only white space, no control character. */
|
|
166
|
+
function titleFits(value) {
|
|
167
|
+
if (value.length === 0 || value.length > HELD_EMBED_TITLE_MAX * 2 || value.trim() === "")
|
|
168
|
+
return false;
|
|
169
|
+
let points = 0;
|
|
170
|
+
for (const c of value) {
|
|
171
|
+
points += 1;
|
|
172
|
+
if (points > HELD_EMBED_TITLE_MAX || isControl(c.codePointAt(0)))
|
|
173
|
+
return false;
|
|
174
|
+
}
|
|
175
|
+
return true;
|
|
176
|
+
}
|
|
177
|
+
/** Whether `src` is an https address on the declared origin whose parsed path stays under the prefix. */
|
|
178
|
+
function srcFits(src, declared) {
|
|
179
|
+
if (src.length > HELD_EMBED_SRC_MAX || !hasNoControlCharacter(src))
|
|
180
|
+
return false;
|
|
181
|
+
let url;
|
|
182
|
+
try {
|
|
183
|
+
url = new URL(src);
|
|
184
|
+
}
|
|
185
|
+
catch {
|
|
186
|
+
return false;
|
|
187
|
+
}
|
|
188
|
+
if (url.protocol !== "https:" || url.username !== "" || url.password !== "" || url.origin !== declared.origin)
|
|
189
|
+
return false;
|
|
190
|
+
return url.pathname.startsWith(declared.pathPrefix) && !holdsEscapedSeparator(url.pathname);
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Why a tag's `{ embed }` is refused, checked against its own plugin's declarations, or null when
|
|
194
|
+
* the core may write its placeholder. `src` is parsed with the URL parser: https, no user or
|
|
195
|
+
* password, its origin the declared one, its parsed path starting with the declared prefix and
|
|
196
|
+
* holding no escaped dot, slash or backslash, at most HELD_EMBED_SRC_MAX. Members the request
|
|
197
|
+
* does not define are ignored: the core writes only these four.
|
|
198
|
+
*/
|
|
199
|
+
export function heldEmbedRequestProblem(request, declarations) {
|
|
200
|
+
if (request === null || typeof request !== "object" || Array.isArray(request))
|
|
201
|
+
return "shape";
|
|
202
|
+
const value = request;
|
|
203
|
+
const declared = typeof value.id === "string" ? declarations.find((entry) => entry.id === value.id) : undefined;
|
|
204
|
+
if (declared === undefined)
|
|
205
|
+
return "id";
|
|
206
|
+
if (typeof value.src !== "string" || !srcFits(value.src, declared))
|
|
207
|
+
return "src";
|
|
208
|
+
if (typeof value.title !== "string" || !titleFits(value.title))
|
|
209
|
+
return "title";
|
|
210
|
+
if (value.ratio !== undefined && !HELD_EMBED_RATIOS.includes(value.ratio))
|
|
211
|
+
return "ratio";
|
|
212
|
+
return null;
|
|
213
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** The longest site address a fallback may answer with; an origin is never longer. */
|
|
3
|
+
export declare const SITE_LOCATION_MAX = 2000;
|
|
4
|
+
/** An origin a plugin may load page head scripts and stylesheets from: https, no path, no trailing "/". Its length cap is the location cap: an origin is never longer than an address. */
|
|
5
|
+
export declare const PageHeadScriptOriginSchema: z.ZodString;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { hasNoControlCharacter } from "./strict-url.js";
|
|
3
|
+
// M33 K42: the bare https origin rule, kept apart from plugin-site-extensions so the held embed
|
|
4
|
+
// rules (plugin-held-embeds.ts) can use it while plugin-site-extensions runs them, with no import
|
|
5
|
+
// cycle. plugin-site-extensions re-exports both names, so every import of them stays as it was.
|
|
6
|
+
/** The longest site address a fallback may answer with; an origin is never longer. */
|
|
7
|
+
export const SITE_LOCATION_MAX = 2_000;
|
|
8
|
+
function originMatches(value) {
|
|
9
|
+
if (!hasNoControlCharacter(value))
|
|
10
|
+
return false;
|
|
11
|
+
let url;
|
|
12
|
+
try {
|
|
13
|
+
url = new URL(value);
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
return url.protocol === "https:" && url.username === "" && url.password === "" && url.origin === value;
|
|
19
|
+
}
|
|
20
|
+
/** An origin a plugin may load page head scripts and stylesheets from: https, no path, no trailing "/". Its length cap is the location cap: an origin is never longer than an address. */
|
|
21
|
+
export const PageHeadScriptOriginSchema = z.string().max(SITE_LOCATION_MAX).refine(originMatches, { message: "an https origin with no path, user name or trailing slash" });
|
|
@@ -39,3 +39,7 @@ export declare function isPluginManifestId(id: string): boolean;
|
|
|
39
39
|
export declare const SLOT_ID_REGEX: RegExp;
|
|
40
40
|
/** The longest a slot's id may be. */
|
|
41
41
|
export declare const SLOT_ID_MAX = 64;
|
|
42
|
+
/** The built-in admin sections whose rails a plugin may add an entry to (S280). Each one's
|
|
43
|
+
* plugin entries open at `/<section>/plugins/<plugin id>/<entry id>`. */
|
|
44
|
+
export declare const BUILT_IN_RAIL_SECTIONS: readonly ["content", "media", "settings", "users"];
|
|
45
|
+
export type BuiltInRailSectionId = (typeof BUILT_IN_RAIL_SECTIONS)[number];
|
|
@@ -46,3 +46,6 @@ export function isPluginManifestId(id) {
|
|
|
46
46
|
export const SLOT_ID_REGEX = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
47
47
|
/** The longest a slot's id may be. */
|
|
48
48
|
export const SLOT_ID_MAX = 64;
|
|
49
|
+
/** The built-in admin sections whose rails a plugin may add an entry to (S280). Each one's
|
|
50
|
+
* plugin entries open at `/<section>/plugins/<plugin id>/<entry id>`. */
|
|
51
|
+
export const BUILT_IN_RAIL_SECTIONS = ["content", "media", "settings", "users"];
|
|
@@ -9,13 +9,16 @@ export declare const PluginInstallRecordSchema: z.ZodObject<{
|
|
|
9
9
|
answers: z.ZodObject<{
|
|
10
10
|
sampleContent: z.ZodBoolean;
|
|
11
11
|
roles: z.ZodArray<z.ZodString>;
|
|
12
|
+
grants: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
12
13
|
options: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodBoolean, z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
14
|
+
settings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
|
|
13
15
|
}, z.core.$strict>;
|
|
14
16
|
created: z.ZodObject<{
|
|
15
17
|
sampleContentNodeIds: z.ZodArray<z.ZodString>;
|
|
16
18
|
mediaIds: z.ZodArray<z.ZodString>;
|
|
17
19
|
roleIds: z.ZodArray<z.ZodString>;
|
|
18
20
|
}, z.core.$strict>;
|
|
21
|
+
offersApplied: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
19
22
|
}, z.core.$strict>;
|
|
20
23
|
export type PluginInstallRecord = z.infer<typeof PluginInstallRecordSchema>;
|
|
21
24
|
/** A fresh `created`, never a shared one. */
|
|
@@ -45,12 +48,27 @@ export declare const InstallAnswersRefusedSchema: z.ZodObject<{
|
|
|
45
48
|
export type InstallAnswersRefused = z.infer<typeof InstallAnswersRefusedSchema>;
|
|
46
49
|
/** The most page titles a record summary names. */
|
|
47
50
|
export declare const INSTALL_RECORD_SUMMARY_TITLES = 20;
|
|
51
|
+
/** M33 K41: before an uninstall the core reads at most this many templates for the plugin's
|
|
52
|
+
* template names, in pages; past it the answer says the scan stopped early. */
|
|
53
|
+
export declare const UNINSTALL_TEMPLATES_SCANNED_MAX = 2000;
|
|
54
|
+
/** M33 K41: at most this many of the templates found are named; the answer counts the rest. */
|
|
55
|
+
export declare const UNINSTALL_TEMPLATES_LISTED_MAX = 50;
|
|
56
|
+
/** M33 K41: one template whose source names one of the plugin's full template names (a tag or a
|
|
57
|
+
* filter, by whole name), shaped like a data type's holder: its id and name, and the names it uses. */
|
|
58
|
+
export declare const TemplateUsingPluginSchema: z.ZodObject<{
|
|
59
|
+
id: z.ZodString;
|
|
60
|
+
name: z.ZodString;
|
|
61
|
+
uses: z.ZodArray<z.ZodString>;
|
|
62
|
+
}, z.core.$strip>;
|
|
63
|
+
export type TemplateUsingPlugin = z.infer<typeof TemplateUsingPluginSchema>;
|
|
48
64
|
/** What the admin is told about a plugin's record (the uninstall dialog, an update). */
|
|
49
65
|
export declare const PluginInstallRecordSummarySchema: z.ZodObject<{
|
|
50
66
|
answers: z.ZodNullable<z.ZodObject<{
|
|
51
67
|
sampleContent: z.ZodBoolean;
|
|
52
68
|
roles: z.ZodArray<z.ZodString>;
|
|
69
|
+
grants: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
53
70
|
options: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodBoolean, z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
71
|
+
settings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
|
|
54
72
|
}, z.core.$strict>>;
|
|
55
73
|
pages: z.ZodObject<{
|
|
56
74
|
liveCount: z.ZodNumber;
|
|
@@ -65,5 +83,31 @@ export declare const PluginInstallRecordSummarySchema: z.ZodObject<{
|
|
|
65
83
|
label: z.ZodString;
|
|
66
84
|
userCount: z.ZodNumber;
|
|
67
85
|
}, z.core.$strip>>;
|
|
86
|
+
leftoverObjects: z.ZodOptional<z.ZodNumber>;
|
|
87
|
+
heldByTemplates: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
88
|
+
id: z.ZodString;
|
|
89
|
+
name: z.ZodString;
|
|
90
|
+
uses: z.ZodArray<z.ZodString>;
|
|
91
|
+
}, z.core.$strip>>>;
|
|
92
|
+
templatesNotListed: z.ZodOptional<z.ZodNumber>;
|
|
93
|
+
templatesScanStopped: z.ZodOptional<z.ZodBoolean>;
|
|
68
94
|
}, z.core.$strip>;
|
|
69
95
|
export type PluginInstallRecordSummary = z.infer<typeof PluginInstallRecordSummarySchema>;
|
|
96
|
+
/** M33 K29: what applying one accepted action offer did. `applied`: the roles holding its target
|
|
97
|
+
* (the administrator left out) now hold it, `roles` naming those that gained it; `not-held`: the
|
|
98
|
+
* caller does not hold the action, so it could not give it and the offer waits; `not-offered`: the
|
|
99
|
+
* installed manifest offers no such action; `not-synced`: the action has no row yet; `failed`: the
|
|
100
|
+
* write failed and was logged. */
|
|
101
|
+
export declare const ACTION_OFFER_OUTCOMES: readonly ["applied", "not-held", "not-offered", "not-synced", "failed"];
|
|
102
|
+
export declare const ActionOfferOutcomeSchema: z.ZodObject<{
|
|
103
|
+
action: z.ZodString;
|
|
104
|
+
outcome: z.ZodEnum<{
|
|
105
|
+
failed: "failed";
|
|
106
|
+
applied: "applied";
|
|
107
|
+
"not-held": "not-held";
|
|
108
|
+
"not-offered": "not-offered";
|
|
109
|
+
"not-synced": "not-synced";
|
|
110
|
+
}>;
|
|
111
|
+
roles: z.ZodArray<z.ZodString>;
|
|
112
|
+
}, z.core.$strip>;
|
|
113
|
+
export type ActionOfferOutcome = z.infer<typeof ActionOfferOutcomeSchema>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { ActionStringSchema } from "./action.schema.js";
|
|
2
3
|
import { ResolvedInstallAnswersSchema } from "./plugin-install.js";
|
|
3
4
|
import { RoleIdSchema } from "./role.schema.js";
|
|
4
5
|
// S293 (2026-10-13-s293-the-wizard-installed-design.md 3.1): what a plugin's
|
|
@@ -18,7 +19,13 @@ export const PluginInstallCreatedSchema = z
|
|
|
18
19
|
})
|
|
19
20
|
.strict();
|
|
20
21
|
export const PluginInstallRecordSchema = z
|
|
21
|
-
.object({
|
|
22
|
+
.object({
|
|
23
|
+
answers: ResolvedInstallAnswersSchema,
|
|
24
|
+
created: PluginInstallCreatedSchema,
|
|
25
|
+
/** M33 K29: the offered actions given to the roles holding their target, at install or by
|
|
26
|
+
* Apply; an offer the manifest makes and this list lacks waits under Plugins, Installed. */
|
|
27
|
+
offersApplied: z.array(ActionStringSchema).optional(),
|
|
28
|
+
})
|
|
22
29
|
.strict();
|
|
23
30
|
/** A fresh `created`, never a shared one. */
|
|
24
31
|
export function emptyInstallCreated() {
|
|
@@ -43,6 +50,18 @@ export const InstallAnswersRefusedSchema = z.object({
|
|
|
43
50
|
});
|
|
44
51
|
/** The most page titles a record summary names. */
|
|
45
52
|
export const INSTALL_RECORD_SUMMARY_TITLES = 20;
|
|
53
|
+
/** M33 K41: before an uninstall the core reads at most this many templates for the plugin's
|
|
54
|
+
* template names, in pages; past it the answer says the scan stopped early. */
|
|
55
|
+
export const UNINSTALL_TEMPLATES_SCANNED_MAX = 2000;
|
|
56
|
+
/** M33 K41: at most this many of the templates found are named; the answer counts the rest. */
|
|
57
|
+
export const UNINSTALL_TEMPLATES_LISTED_MAX = 50;
|
|
58
|
+
/** M33 K41: one template whose source names one of the plugin's full template names (a tag or a
|
|
59
|
+
* filter, by whole name), shaped like a data type's holder: its id and name, and the names it uses. */
|
|
60
|
+
export const TemplateUsingPluginSchema = z.object({
|
|
61
|
+
id: z.string(),
|
|
62
|
+
name: z.string(),
|
|
63
|
+
uses: z.array(z.string()),
|
|
64
|
+
}).meta({ example: { id: "5b0f7a52-3c1e-4c58-9a57-0c7d8f6e2a11", name: "Venue page", uses: ["acme_map"] } });
|
|
46
65
|
/** What the admin is told about a plugin's record (the uninstall dialog, an update). */
|
|
47
66
|
export const PluginInstallRecordSummarySchema = z.object({
|
|
48
67
|
/** Null for a plugin installed before S293. */
|
|
@@ -56,4 +75,22 @@ export const PluginInstallRecordSummarySchema = z.object({
|
|
|
56
75
|
mediaCount: z.number().int().nonnegative(),
|
|
57
76
|
/** The recorded roles that still exist. */
|
|
58
77
|
roles: z.array(z.object({ id: RoleIdSchema, label: z.string(), userCount: z.number().int().nonnegative() })),
|
|
78
|
+
/** M32 F4e (E3): the records of objects the plugin's media stores could not delete; an uninstall removes them. */
|
|
79
|
+
leftoverObjects: z.number().int().nonnegative().optional(),
|
|
80
|
+
/** M33 K41: the site's templates, other than the plugin's own (an uninstall removes those), whose
|
|
81
|
+
* source still names one of its template tags or filters; such a page fails to render once the
|
|
82
|
+
* plugin is gone. Read only: the uninstall changes no template. Sent by the install record read. */
|
|
83
|
+
heldByTemplates: z.array(TemplateUsingPluginSchema).max(UNINSTALL_TEMPLATES_LISTED_MAX).optional(),
|
|
84
|
+
/** M33 K41: how many more templates were found than heldByTemplates names. */
|
|
85
|
+
templatesNotListed: z.number().int().nonnegative().optional(),
|
|
86
|
+
/** M33 K41: true when the scan stopped at UNINSTALL_TEMPLATES_SCANNED_MAX with templates left
|
|
87
|
+
* unread, so not every template was checked. */
|
|
88
|
+
templatesScanStopped: z.boolean().optional().meta({ example: false }),
|
|
59
89
|
});
|
|
90
|
+
/** M33 K29: what applying one accepted action offer did. `applied`: the roles holding its target
|
|
91
|
+
* (the administrator left out) now hold it, `roles` naming those that gained it; `not-held`: the
|
|
92
|
+
* caller does not hold the action, so it could not give it and the offer waits; `not-offered`: the
|
|
93
|
+
* installed manifest offers no such action; `not-synced`: the action has no row yet; `failed`: the
|
|
94
|
+
* write failed and was logged. */
|
|
95
|
+
export const ACTION_OFFER_OUTCOMES = ["applied", "not-held", "not-offered", "not-synced", "failed"];
|
|
96
|
+
export const ActionOfferOutcomeSchema = z.object({ action: ActionStringSchema, outcome: z.enum(ACTION_OFFER_OUTCOMES), roles: z.array(RoleIdSchema) });
|