@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,211 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const SITE_KEY_MAX = 253;
|
|
3
|
+
/** `staging`: the one subdomain of a seated site the buyer names (licence
|
|
4
|
+
* terms `staging`). S367d: `local-name-public`, a local name on a site that
|
|
5
|
+
* answers public visitors (licence terms `local`), which takes no seat and
|
|
6
|
+
* is never local. */
|
|
7
|
+
export type SiteClass = "local" | "staging" | "public" | "local-name-public";
|
|
8
|
+
/** A site is its normalised domain: trimmed, lower case, without a port or a
|
|
9
|
+
* trailing dot, one leading "www." dropped. An IPv6 literal keeps its
|
|
10
|
+
* brackets. Null for anything else: over 253 characters, an empty label, or
|
|
11
|
+
* a character outside a-z 0-9 . - (and the IPv6 literal's own). No public
|
|
12
|
+
* suffix list: a subdomain is its own site. */
|
|
13
|
+
export declare function siteKey(domain: string): string | null;
|
|
14
|
+
/** The licence terms' local installations: localhost and its subdomains, the
|
|
15
|
+
* reserved names, a name without a dot, IPv4 loopback, private, link-local and
|
|
16
|
+
* shared space, IPv6 ::1, fc00::/7 and fe80::/10. A local site never takes a
|
|
17
|
+
* seat and never counts as sharing. */
|
|
18
|
+
export declare function classifySite(key: string): "local" | "public";
|
|
19
|
+
/** S367c (licence terms `staging`): `child` is a subdomain of `parent`, both
|
|
20
|
+
* site keys, at any depth. An IP literal is never a parent. */
|
|
21
|
+
export declare function isSubdomainOf(child: string, parent: string): boolean;
|
|
22
|
+
/** S367d (D2): how long one public request keeps a site public. */
|
|
23
|
+
export declare const SITE_REACH_WINDOW_DAYS = 30;
|
|
24
|
+
export declare const SiteReachSchema: z.ZodEnum<{
|
|
25
|
+
local: "local";
|
|
26
|
+
public: "public";
|
|
27
|
+
}>;
|
|
28
|
+
export type SiteReach = z.infer<typeof SiteReachSchema>;
|
|
29
|
+
/** The longest header value and the most entries the reach reads; anything
|
|
30
|
+
* over counts as public. */
|
|
31
|
+
export declare const REACH_VALUE_MAX = 1024;
|
|
32
|
+
export declare const REACH_ENTRIES_MAX = 32;
|
|
33
|
+
/** S367d (D1): an address as the socket or a forwarding header names it.
|
|
34
|
+
* A zone id (`%eth0`) is dropped, an IPv4-mapped `::ffff:a.b.c.d` reads as
|
|
35
|
+
* its IPv4 address and a bare IPv6 address is bracketed, then classifySite's
|
|
36
|
+
* literal rules decide. Anything that is not an address is public. */
|
|
37
|
+
export declare function classifyAddress(ip: string): "local" | "public";
|
|
38
|
+
export type ReachHeaders = Readonly<Record<string, string | string[] | undefined>>;
|
|
39
|
+
/** S367d (D1, licence terms `local`): one request is public when its peer,
|
|
40
|
+
* any address a forwarding header names (trusted proxy or not) or its host
|
|
41
|
+
* name is public. The headers are untrusted, and they can only make a
|
|
42
|
+
* request public: a forged header costs its sender a free pass, never
|
|
43
|
+
* anyone a seat. A missing host adds nothing. One linear scan, no pattern. */
|
|
44
|
+
export declare function requestReach(input: {
|
|
45
|
+
peer: string | undefined;
|
|
46
|
+
headers: ReachHeaders;
|
|
47
|
+
}): SiteReach;
|
|
48
|
+
/** `length` lowercase hex characters, by a loop. */
|
|
49
|
+
export declare function isLowerHex(value: string, length: number): boolean;
|
|
50
|
+
/** S367e (D1): a download's stamp, 16 random bytes as 32 lowercase hex. It
|
|
51
|
+
* names a download row and nothing else: no licence, no buyer. */
|
|
52
|
+
export declare const STAMP_LENGTH = 32;
|
|
53
|
+
export declare function isStamp(value: string): boolean;
|
|
54
|
+
export declare const StampSchema: z.ZodString;
|
|
55
|
+
export declare const INSTALL_ID_LENGTH = 32;
|
|
56
|
+
/** The CMS's install id: 16 random bytes as 32 lowercase hex characters. */
|
|
57
|
+
export declare function isInstallId(value: string): boolean;
|
|
58
|
+
export declare const InstallIdSchema: z.ZodString;
|
|
59
|
+
/** S367b (the key length cap) and S367d (D4): one licence key field for the
|
|
60
|
+
* validation and the vendor-token body, so neither signs or hashes megabytes. */
|
|
61
|
+
export declare const LICENCE_KEY_MAX = 256;
|
|
62
|
+
export declare const LicenceKeyFieldSchema: z.ZodString;
|
|
63
|
+
/** What a CMS reports about the package it runs (S284b), and since S367e the
|
|
64
|
+
* stamp it read from disk: `stamp` from the root file (else the code), and
|
|
65
|
+
* `codeStamp` from server/plugin.js only when it names another stamp. Every
|
|
66
|
+
* hash and stamp is read by loops. */
|
|
67
|
+
export declare const InstallReportSchema: z.ZodObject<{
|
|
68
|
+
version: z.ZodString;
|
|
69
|
+
installedSha256: z.ZodNullable<z.ZodString>;
|
|
70
|
+
currentSha256: z.ZodNullable<z.ZodString>;
|
|
71
|
+
stamp: z.ZodOptional<z.ZodString>;
|
|
72
|
+
codeStamp: z.ZodOptional<z.ZodString>;
|
|
73
|
+
}, z.core.$strip>;
|
|
74
|
+
export type InstallReportWire = z.infer<typeof InstallReportSchema>;
|
|
75
|
+
/** S367d (D4): what the CMS sends to POST /api/v1/licenses/validate. The
|
|
76
|
+
* nonce is the CMS's createLicenseChallenge value, echoed into the signed
|
|
77
|
+
* envelope; the install id and the address stay optional, so a CMS up to
|
|
78
|
+
* 0.19 still gets a verdict (absent, the name decides). */
|
|
79
|
+
export declare const LicenseValidateRequestSchema: z.ZodObject<{
|
|
80
|
+
key: z.ZodString;
|
|
81
|
+
pluginId: z.ZodString;
|
|
82
|
+
domain: z.ZodString;
|
|
83
|
+
nonce: z.ZodString;
|
|
84
|
+
installId: z.ZodOptional<z.ZodString>;
|
|
85
|
+
address: z.ZodOptional<z.ZodEnum<{
|
|
86
|
+
local: "local";
|
|
87
|
+
public: "public";
|
|
88
|
+
}>>;
|
|
89
|
+
install: z.ZodOptional<z.ZodObject<{
|
|
90
|
+
version: z.ZodString;
|
|
91
|
+
installedSha256: z.ZodNullable<z.ZodString>;
|
|
92
|
+
currentSha256: z.ZodNullable<z.ZodString>;
|
|
93
|
+
stamp: z.ZodOptional<z.ZodString>;
|
|
94
|
+
codeStamp: z.ZodOptional<z.ZodString>;
|
|
95
|
+
}, z.core.$strip>>;
|
|
96
|
+
}, z.core.$strip>;
|
|
97
|
+
export type LicenseValidateRequest = z.infer<typeof LicenseValidateRequestSchema>;
|
|
98
|
+
export declare const AddSiteInputSchema: z.ZodObject<{
|
|
99
|
+
licenseId: z.ZodString;
|
|
100
|
+
domain: z.ZodString;
|
|
101
|
+
client: z.ZodBoolean;
|
|
102
|
+
}, z.core.$strip>;
|
|
103
|
+
export type AddSiteInput = z.infer<typeof AddSiteInputSchema>;
|
|
104
|
+
export declare const NameStagingInputSchema: z.ZodObject<{
|
|
105
|
+
licenseId: z.ZodString;
|
|
106
|
+
domain: z.ZodString;
|
|
107
|
+
}, z.core.$strip>;
|
|
108
|
+
export type NameStagingInput = z.infer<typeof NameStagingInputSchema>;
|
|
109
|
+
export declare const RemoveStagingInputSchema: z.ZodObject<{
|
|
110
|
+
licenseId: z.ZodString;
|
|
111
|
+
}, z.core.$strip>;
|
|
112
|
+
export declare const LICENCE_TRANSFER_NOTE_MAX = 2000;
|
|
113
|
+
/** The operator's transfer of a one-time licence (licence terms `grant`):
|
|
114
|
+
* the recipient by email and the three written confirmations as ticked boxes. */
|
|
115
|
+
export declare const LicenceTransferInputSchema: z.ZodObject<{
|
|
116
|
+
licenseId: z.ZodString;
|
|
117
|
+
recipientEmail: z.ZodString;
|
|
118
|
+
askedInWriting: z.ZodLiteral<true>;
|
|
119
|
+
copiesDeleted: z.ZodLiteral<true>;
|
|
120
|
+
recipientAccepted: z.ZodLiteral<true>;
|
|
121
|
+
recipientAcceptedConditions: z.ZodLiteral<true>;
|
|
122
|
+
note: z.ZodString;
|
|
123
|
+
shownConditions: z.ZodString;
|
|
124
|
+
}, z.core.$strict>;
|
|
125
|
+
export type LicenceTransferInput = z.infer<typeof LicenceTransferInputSchema>;
|
|
126
|
+
export declare const RemoveSiteInputSchema: z.ZodObject<{
|
|
127
|
+
licenseId: z.ZodString;
|
|
128
|
+
siteId: z.ZodString;
|
|
129
|
+
}, z.core.$strip>;
|
|
130
|
+
/** An operator's form that names one licence (one more move, ending a
|
|
131
|
+
* revoked licence's subscription): a malformed id is refused before any read. */
|
|
132
|
+
export declare const OperatorLicenceActionSchema: z.ZodObject<{
|
|
133
|
+
licenseId: z.ZodString;
|
|
134
|
+
}, z.core.$strip>;
|
|
135
|
+
export declare const SHARING_NOTE_MAX = 2000;
|
|
136
|
+
export declare const SHARING_REASON_MAX = 500;
|
|
137
|
+
/** The operator's three actions on a sharing case. A revocation needs the
|
|
138
|
+
* reviewed box ticked: nothing revokes a licence without it. */
|
|
139
|
+
export declare const SharingCaseActionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
140
|
+
action: z.ZodLiteral<"lift">;
|
|
141
|
+
caseId: z.ZodString;
|
|
142
|
+
note: z.ZodString;
|
|
143
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
144
|
+
action: z.ZodLiteral<"dismiss">;
|
|
145
|
+
caseId: z.ZodString;
|
|
146
|
+
note: z.ZodString;
|
|
147
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
148
|
+
action: z.ZodLiteral<"revoke">;
|
|
149
|
+
caseId: z.ZodString;
|
|
150
|
+
reason: z.ZodString;
|
|
151
|
+
confirmed: z.ZodLiteral<true>;
|
|
152
|
+
}, z.core.$strip>], "action">;
|
|
153
|
+
export type SharingCaseAction = z.infer<typeof SharingCaseActionSchema>;
|
|
154
|
+
export declare const SHARING_NOTICE_KIND: "key-seen-elsewhere";
|
|
155
|
+
/** S367c (D4): the staging site's own CMS is told it is the staging site of
|
|
156
|
+
* `domain` (the seated parent), named at `at`. */
|
|
157
|
+
export declare const STAGING_NOTICE_KIND: "staging-site";
|
|
158
|
+
/** S367d (D12): while the operator closes kardalum.com, every valid verdict
|
|
159
|
+
* tells the CMS the service ends at `at` (the closing day, 00:00 UTC);
|
|
160
|
+
* `domain` is the site key the check came from. */
|
|
161
|
+
export declare const SERVICE_CLOSING_NOTICE_KIND: "service-closing";
|
|
162
|
+
/** What a valid verdict tells the buyer's own CMS while a counting case is
|
|
163
|
+
* under 30 days old: the newest case's site and when it opened, or, while the
|
|
164
|
+
* service closes, the closing day. */
|
|
165
|
+
export declare const SharingNoticeSchema: z.ZodObject<{
|
|
166
|
+
kind: z.ZodEnum<{
|
|
167
|
+
"key-seen-elsewhere": "key-seen-elsewhere";
|
|
168
|
+
"staging-site": "staging-site";
|
|
169
|
+
"service-closing": "service-closing";
|
|
170
|
+
}>;
|
|
171
|
+
domain: z.ZodString;
|
|
172
|
+
at: z.ZodString;
|
|
173
|
+
}, z.core.$strict>;
|
|
174
|
+
export type SharingNotice = z.infer<typeof SharingNoticeSchema>;
|
|
175
|
+
export declare const AUTHOR_CASE_STATES: readonly ["refused", "locked", "revoked", "lifted", "own-site", "not-sharing"];
|
|
176
|
+
/** An author's view of a case on their plugin: domains, short install ids,
|
|
177
|
+
* dates, counts and the state. Strict, so no field that could carry the
|
|
178
|
+
* buyer's name, email, account, key or own sites can ride along. */
|
|
179
|
+
export declare const AuthorCaseRowSchema: z.ZodObject<{
|
|
180
|
+
pluginId: z.ZodString;
|
|
181
|
+
pluginName: z.ZodString;
|
|
182
|
+
licenceRef: z.ZodString;
|
|
183
|
+
domain: z.ZodString;
|
|
184
|
+
installations: z.ZodArray<z.ZodString>;
|
|
185
|
+
openedAt: z.ZodString;
|
|
186
|
+
lastSeenAt: z.ZodString;
|
|
187
|
+
checks: z.ZodNumber;
|
|
188
|
+
state: z.ZodEnum<{
|
|
189
|
+
revoked: "revoked";
|
|
190
|
+
locked: "locked";
|
|
191
|
+
refused: "refused";
|
|
192
|
+
lifted: "lifted";
|
|
193
|
+
"own-site": "own-site";
|
|
194
|
+
"not-sharing": "not-sharing";
|
|
195
|
+
}>;
|
|
196
|
+
}, z.core.$strict>;
|
|
197
|
+
export type AuthorCaseRow = z.infer<typeof AuthorCaseRowSchema>;
|
|
198
|
+
export declare const AuthorTamperRowSchema: z.ZodObject<{
|
|
199
|
+
pluginId: z.ZodString;
|
|
200
|
+
pluginName: z.ZodString;
|
|
201
|
+
version: z.ZodString;
|
|
202
|
+
kind: z.ZodEnum<{
|
|
203
|
+
"foreign-package": "foreign-package";
|
|
204
|
+
sideloaded: "sideloaded";
|
|
205
|
+
"modified-on-disk": "modified-on-disk";
|
|
206
|
+
}>;
|
|
207
|
+
domain: z.ZodString;
|
|
208
|
+
ownSite: z.ZodBoolean;
|
|
209
|
+
day: z.ZodString;
|
|
210
|
+
}, z.core.$strict>;
|
|
211
|
+
export type AuthorTamperRow = z.infer<typeof AuthorTamperRowSchema>;
|
|
@@ -0,0 +1,424 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { isPayoutEmail } from "./marketplace-payouts.schema.js";
|
|
3
|
+
// S367b: what a licence's site is, and the shapes of the portal's site form,
|
|
4
|
+
// the operator's case actions, the signed notice and the authors' rows.
|
|
5
|
+
// Shared by the marketplace and the CMS. Every check over a value a caller
|
|
6
|
+
// sends is a character loop with the length capped first, never a pattern.
|
|
7
|
+
export const SITE_KEY_MAX = 253;
|
|
8
|
+
// The longest raw value worth reading: a key, a leading "www.", a trailing
|
|
9
|
+
// dot, brackets and ":65535".
|
|
10
|
+
const SITE_INPUT_MAX = 300;
|
|
11
|
+
function isPortSuffix(s) {
|
|
12
|
+
if (s.length < 2 || s.length > 6 || s.charCodeAt(0) !== 58)
|
|
13
|
+
return false;
|
|
14
|
+
let n = 0;
|
|
15
|
+
for (let i = 1; i < s.length; i++) {
|
|
16
|
+
const c = s.charCodeAt(i);
|
|
17
|
+
if (c < 48 || c > 57)
|
|
18
|
+
return false;
|
|
19
|
+
n = n * 10 + (c - 48);
|
|
20
|
+
}
|
|
21
|
+
return n <= 65535;
|
|
22
|
+
}
|
|
23
|
+
const isHostChar = (c) => (c >= 97 && c <= 122) || (c >= 48 && c <= 57) || c === 46 || c === 45;
|
|
24
|
+
const isIpv6Char = (c) => (c >= 97 && c <= 102) || (c >= 48 && c <= 57) || c === 58 || c === 46;
|
|
25
|
+
/** A site is its normalised domain: trimmed, lower case, without a port or a
|
|
26
|
+
* trailing dot, one leading "www." dropped. An IPv6 literal keeps its
|
|
27
|
+
* brackets. Null for anything else: over 253 characters, an empty label, or
|
|
28
|
+
* a character outside a-z 0-9 . - (and the IPv6 literal's own). No public
|
|
29
|
+
* suffix list: a subdomain is its own site. */
|
|
30
|
+
export function siteKey(domain) {
|
|
31
|
+
if (domain.length > SITE_INPUT_MAX)
|
|
32
|
+
return null;
|
|
33
|
+
let s = domain.trim().toLowerCase();
|
|
34
|
+
if (s === "")
|
|
35
|
+
return null;
|
|
36
|
+
if (s.charCodeAt(0) === 91) {
|
|
37
|
+
const close = s.indexOf("]");
|
|
38
|
+
if (close < 2)
|
|
39
|
+
return null;
|
|
40
|
+
const rest = s.slice(close + 1);
|
|
41
|
+
if (rest !== "" && !isPortSuffix(rest))
|
|
42
|
+
return null;
|
|
43
|
+
const inner = s.slice(1, close);
|
|
44
|
+
if (inner.indexOf(":") < 0)
|
|
45
|
+
return null;
|
|
46
|
+
for (let i = 0; i < inner.length; i++)
|
|
47
|
+
if (!isIpv6Char(inner.charCodeAt(i)))
|
|
48
|
+
return null;
|
|
49
|
+
return `[${inner}]`;
|
|
50
|
+
}
|
|
51
|
+
const colon = s.indexOf(":");
|
|
52
|
+
if (colon >= 0) {
|
|
53
|
+
if (!isPortSuffix(s.slice(colon)))
|
|
54
|
+
return null;
|
|
55
|
+
s = s.slice(0, colon);
|
|
56
|
+
}
|
|
57
|
+
if (s.endsWith("."))
|
|
58
|
+
s = s.slice(0, -1);
|
|
59
|
+
if (s.startsWith("www."))
|
|
60
|
+
s = s.slice(4);
|
|
61
|
+
if (s === "" || s.length > SITE_KEY_MAX)
|
|
62
|
+
return null;
|
|
63
|
+
let previous = 46;
|
|
64
|
+
for (let i = 0; i < s.length; i++) {
|
|
65
|
+
const c = s.charCodeAt(i);
|
|
66
|
+
if (!isHostChar(c))
|
|
67
|
+
return null;
|
|
68
|
+
if (c === 46 && previous === 46)
|
|
69
|
+
return null;
|
|
70
|
+
previous = c;
|
|
71
|
+
}
|
|
72
|
+
return s;
|
|
73
|
+
}
|
|
74
|
+
const LOCAL_SUFFIXES = [".localhost", ".local", ".test", ".internal", ".example", ".invalid", ".home.arpa"];
|
|
75
|
+
function ipv4(key) {
|
|
76
|
+
const parts = [];
|
|
77
|
+
let n = -1;
|
|
78
|
+
for (let i = 0; i <= key.length; i++) {
|
|
79
|
+
const c = i < key.length ? key.charCodeAt(i) : 46;
|
|
80
|
+
if (c === 46) {
|
|
81
|
+
if (n < 0 || parts.length === 4)
|
|
82
|
+
return null;
|
|
83
|
+
parts.push(n);
|
|
84
|
+
n = -1;
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
if (c < 48 || c > 57)
|
|
88
|
+
return null;
|
|
89
|
+
n = n < 0 ? c - 48 : n * 10 + (c - 48);
|
|
90
|
+
if (n > 255)
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
return parts.length === 4 ? parts : null;
|
|
94
|
+
}
|
|
95
|
+
function firstHextet(inner) {
|
|
96
|
+
if (inner.startsWith("::"))
|
|
97
|
+
return 0;
|
|
98
|
+
let n = 0;
|
|
99
|
+
let digits = 0;
|
|
100
|
+
for (let i = 0; i < inner.length; i++) {
|
|
101
|
+
const c = inner.charCodeAt(i);
|
|
102
|
+
if (c === 58)
|
|
103
|
+
break;
|
|
104
|
+
const v = c >= 48 && c <= 57 ? c - 48 : c >= 97 && c <= 102 ? c - 87 : -1;
|
|
105
|
+
if (v < 0 || ++digits > 4)
|
|
106
|
+
return null;
|
|
107
|
+
n = n * 16 + v;
|
|
108
|
+
}
|
|
109
|
+
return digits === 0 ? null : n;
|
|
110
|
+
}
|
|
111
|
+
/** The licence terms' local installations: localhost and its subdomains, the
|
|
112
|
+
* reserved names, a name without a dot, IPv4 loopback, private, link-local and
|
|
113
|
+
* shared space, IPv6 ::1, fc00::/7 and fe80::/10. A local site never takes a
|
|
114
|
+
* seat and never counts as sharing. */
|
|
115
|
+
export function classifySite(key) {
|
|
116
|
+
if (key.startsWith("[")) {
|
|
117
|
+
const inner = key.slice(1, -1);
|
|
118
|
+
if (inner === "::1")
|
|
119
|
+
return "local";
|
|
120
|
+
const h = firstHextet(inner);
|
|
121
|
+
if (h !== null && ((h & 0xfe00) === 0xfc00 || (h & 0xffc0) === 0xfe80))
|
|
122
|
+
return "local";
|
|
123
|
+
return "public";
|
|
124
|
+
}
|
|
125
|
+
if (key === "localhost" || key.indexOf(".") < 0)
|
|
126
|
+
return "local";
|
|
127
|
+
for (const suffix of LOCAL_SUFFIXES)
|
|
128
|
+
if (key.endsWith(suffix))
|
|
129
|
+
return "local";
|
|
130
|
+
const v4 = ipv4(key);
|
|
131
|
+
if (v4) {
|
|
132
|
+
const [a, b] = v4;
|
|
133
|
+
if (a === 127 || a === 10 || (a === 172 && b >= 16 && b <= 31) || (a === 192 && b === 168) || (a === 169 && b === 254) || (a === 100 && b >= 64 && b <= 127))
|
|
134
|
+
return "local";
|
|
135
|
+
}
|
|
136
|
+
return "public";
|
|
137
|
+
}
|
|
138
|
+
/** S367c (licence terms `staging`): `child` is a subdomain of `parent`, both
|
|
139
|
+
* site keys, at any depth. An IP literal is never a parent. */
|
|
140
|
+
export function isSubdomainOf(child, parent) {
|
|
141
|
+
if (parent.length === 0 || child.length > SITE_KEY_MAX || parent.length > SITE_KEY_MAX)
|
|
142
|
+
return false;
|
|
143
|
+
if (parent.startsWith("[") || ipv4(parent) !== null)
|
|
144
|
+
return false;
|
|
145
|
+
// The dot that joins the child's own labels to the parent; at least one
|
|
146
|
+
// character before it, so ".example.com" is no subdomain.
|
|
147
|
+
const dot = child.length - parent.length - 1;
|
|
148
|
+
if (dot < 1 || child.charCodeAt(dot) !== 46 || !child.endsWith(parent))
|
|
149
|
+
return false;
|
|
150
|
+
return child.charCodeAt(dot - 1) !== 46;
|
|
151
|
+
}
|
|
152
|
+
/** S367d (D2): how long one public request keeps a site public. */
|
|
153
|
+
export const SITE_REACH_WINDOW_DAYS = 30;
|
|
154
|
+
export const SiteReachSchema = z.enum(["local", "public"]);
|
|
155
|
+
/** The longest header value and the most entries the reach reads; anything
|
|
156
|
+
* over counts as public. */
|
|
157
|
+
export const REACH_VALUE_MAX = 1024;
|
|
158
|
+
export const REACH_ENTRIES_MAX = 32;
|
|
159
|
+
/** S367d (D1): an address as the socket or a forwarding header names it.
|
|
160
|
+
* A zone id (`%eth0`) is dropped, an IPv4-mapped `::ffff:a.b.c.d` reads as
|
|
161
|
+
* its IPv4 address and a bare IPv6 address is bracketed, then classifySite's
|
|
162
|
+
* literal rules decide. Anything that is not an address is public. */
|
|
163
|
+
export function classifyAddress(ip) {
|
|
164
|
+
if (ip.length === 0 || ip.length > REACH_VALUE_MAX)
|
|
165
|
+
return "public";
|
|
166
|
+
let s = ip.trim().toLowerCase();
|
|
167
|
+
const zone = s.indexOf("%");
|
|
168
|
+
if (zone >= 0)
|
|
169
|
+
s = s.slice(0, zone);
|
|
170
|
+
if (s.startsWith("::ffff:") && s.indexOf(".") > 0)
|
|
171
|
+
s = s.slice(7);
|
|
172
|
+
if (s.indexOf(":") >= 0) {
|
|
173
|
+
for (let i = 0; i < s.length; i++)
|
|
174
|
+
if (!isIpv6Char(s.charCodeAt(i)))
|
|
175
|
+
return "public";
|
|
176
|
+
return classifySite(`[${s}]`);
|
|
177
|
+
}
|
|
178
|
+
return ipv4(s) === null ? "public" : classifySite(s);
|
|
179
|
+
}
|
|
180
|
+
/** One entry of an address header: quotes, brackets and a port stripped by hand. */
|
|
181
|
+
function addressEntry(raw) {
|
|
182
|
+
let s = raw.trim();
|
|
183
|
+
if (s.length >= 2 && s.charCodeAt(0) === 34 && s.charCodeAt(s.length - 1) === 34)
|
|
184
|
+
s = s.slice(1, -1).trim();
|
|
185
|
+
if (s === "")
|
|
186
|
+
return "public";
|
|
187
|
+
if (s.charCodeAt(0) === 91) {
|
|
188
|
+
const close = s.indexOf("]");
|
|
189
|
+
if (close < 2)
|
|
190
|
+
return "public";
|
|
191
|
+
const rest = s.slice(close + 1);
|
|
192
|
+
if (rest !== "" && !isPortSuffix(rest))
|
|
193
|
+
return "public";
|
|
194
|
+
return classifyAddress(s.slice(1, close));
|
|
195
|
+
}
|
|
196
|
+
const colon = s.indexOf(":");
|
|
197
|
+
if (colon >= 0 && colon === s.lastIndexOf(":")) {
|
|
198
|
+
if (!isPortSuffix(s.slice(colon)))
|
|
199
|
+
return "public";
|
|
200
|
+
s = s.slice(0, colon);
|
|
201
|
+
}
|
|
202
|
+
return classifyAddress(s);
|
|
203
|
+
}
|
|
204
|
+
/** A value split on one separator, or null past the caps. */
|
|
205
|
+
function entriesOf(value, separator) {
|
|
206
|
+
if (value.length > REACH_VALUE_MAX)
|
|
207
|
+
return null;
|
|
208
|
+
const out = [];
|
|
209
|
+
let start = 0;
|
|
210
|
+
for (let i = 0; i <= value.length; i++) {
|
|
211
|
+
if (i === value.length || value.charCodeAt(i) === separator) {
|
|
212
|
+
out.push(value.slice(start, i));
|
|
213
|
+
if (out.length > REACH_ENTRIES_MAX)
|
|
214
|
+
return null;
|
|
215
|
+
start = i + 1;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
return out;
|
|
219
|
+
}
|
|
220
|
+
/** One element of `forwarded`: only its `for=` parameters count; a pair
|
|
221
|
+
* without `=` is unparsable. */
|
|
222
|
+
function forwardedElement(element) {
|
|
223
|
+
const pairs = entriesOf(element, 59);
|
|
224
|
+
if (pairs === null)
|
|
225
|
+
return "public";
|
|
226
|
+
for (const pair of pairs) {
|
|
227
|
+
const trimmed = pair.trim();
|
|
228
|
+
if (trimmed === "")
|
|
229
|
+
continue;
|
|
230
|
+
const eq = trimmed.indexOf("=");
|
|
231
|
+
if (eq <= 0)
|
|
232
|
+
return "public";
|
|
233
|
+
if (trimmed.slice(0, eq).trim().toLowerCase() !== "for")
|
|
234
|
+
continue;
|
|
235
|
+
if (addressEntry(trimmed.slice(eq + 1)) === "public")
|
|
236
|
+
return "public";
|
|
237
|
+
}
|
|
238
|
+
return "local";
|
|
239
|
+
}
|
|
240
|
+
function hostEntry(raw) {
|
|
241
|
+
const key = siteKey(raw);
|
|
242
|
+
return key === null ? "public" : classifySite(key);
|
|
243
|
+
}
|
|
244
|
+
const ADDRESS_HEADERS = ["x-forwarded-for", "x-real-ip", "cf-connecting-ip", "true-client-ip"];
|
|
245
|
+
const HOST_HEADERS = ["host", "x-forwarded-host"];
|
|
246
|
+
function valuesOf(raw) {
|
|
247
|
+
if (raw === undefined)
|
|
248
|
+
return [];
|
|
249
|
+
if (typeof raw === "string")
|
|
250
|
+
return [raw];
|
|
251
|
+
return raw.length > REACH_ENTRIES_MAX ? null : raw;
|
|
252
|
+
}
|
|
253
|
+
/** True when any entry of the header reads public under `entry`. */
|
|
254
|
+
function headerIsPublic(raw, entry) {
|
|
255
|
+
const values = valuesOf(raw);
|
|
256
|
+
if (values === null)
|
|
257
|
+
return true;
|
|
258
|
+
for (const value of values) {
|
|
259
|
+
const entries = entriesOf(value, 44);
|
|
260
|
+
if (entries === null)
|
|
261
|
+
return true;
|
|
262
|
+
for (const e of entries)
|
|
263
|
+
if (entry(e) === "public")
|
|
264
|
+
return true;
|
|
265
|
+
}
|
|
266
|
+
return false;
|
|
267
|
+
}
|
|
268
|
+
/** S367d (D1, licence terms `local`): one request is public when its peer,
|
|
269
|
+
* any address a forwarding header names (trusted proxy or not) or its host
|
|
270
|
+
* name is public. The headers are untrusted, and they can only make a
|
|
271
|
+
* request public: a forged header costs its sender a free pass, never
|
|
272
|
+
* anyone a seat. A missing host adds nothing. One linear scan, no pattern. */
|
|
273
|
+
export function requestReach(input) {
|
|
274
|
+
if (input.peer === undefined || classifyAddress(input.peer) === "public")
|
|
275
|
+
return "public";
|
|
276
|
+
for (const name of ADDRESS_HEADERS)
|
|
277
|
+
if (headerIsPublic(input.headers[name], addressEntry))
|
|
278
|
+
return "public";
|
|
279
|
+
if (headerIsPublic(input.headers.forwarded, forwardedElement))
|
|
280
|
+
return "public";
|
|
281
|
+
for (const name of HOST_HEADERS)
|
|
282
|
+
if (headerIsPublic(input.headers[name], hostEntry))
|
|
283
|
+
return "public";
|
|
284
|
+
return "local";
|
|
285
|
+
}
|
|
286
|
+
/** `length` lowercase hex characters, by a loop. */
|
|
287
|
+
export function isLowerHex(value, length) {
|
|
288
|
+
if (value.length !== length)
|
|
289
|
+
return false;
|
|
290
|
+
for (let i = 0; i < value.length; i++) {
|
|
291
|
+
const c = value.charCodeAt(i);
|
|
292
|
+
if (!((c >= 48 && c <= 57) || (c >= 97 && c <= 102)))
|
|
293
|
+
return false;
|
|
294
|
+
}
|
|
295
|
+
return true;
|
|
296
|
+
}
|
|
297
|
+
/** S367e (D1): a download's stamp, 16 random bytes as 32 lowercase hex. It
|
|
298
|
+
* names a download row and nothing else: no licence, no buyer. */
|
|
299
|
+
export const STAMP_LENGTH = 32;
|
|
300
|
+
export function isStamp(value) {
|
|
301
|
+
return isLowerHex(value, STAMP_LENGTH);
|
|
302
|
+
}
|
|
303
|
+
export const StampSchema = z.string().refine(isStamp, "must be 32 lowercase hex characters");
|
|
304
|
+
export const INSTALL_ID_LENGTH = 32;
|
|
305
|
+
/** The CMS's install id: 16 random bytes as 32 lowercase hex characters. */
|
|
306
|
+
export function isInstallId(value) {
|
|
307
|
+
if (value.length !== INSTALL_ID_LENGTH)
|
|
308
|
+
return false;
|
|
309
|
+
for (let i = 0; i < value.length; i++) {
|
|
310
|
+
const c = value.charCodeAt(i);
|
|
311
|
+
if (!((c >= 48 && c <= 57) || (c >= 97 && c <= 102)))
|
|
312
|
+
return false;
|
|
313
|
+
}
|
|
314
|
+
return true;
|
|
315
|
+
}
|
|
316
|
+
export const InstallIdSchema = z.string().refine(isInstallId, "must be 32 lowercase hex characters");
|
|
317
|
+
/** S367b (the key length cap) and S367d (D4): one licence key field for the
|
|
318
|
+
* validation and the vendor-token body, so neither signs or hashes megabytes. */
|
|
319
|
+
export const LICENCE_KEY_MAX = 256;
|
|
320
|
+
export const LicenceKeyFieldSchema = z.string().min(1).max(LICENCE_KEY_MAX);
|
|
321
|
+
const sha256Hex = z.string().refine((v) => isLowerHex(v, 64), "must be 64 lowercase hex characters");
|
|
322
|
+
/** What a CMS reports about the package it runs (S284b), and since S367e the
|
|
323
|
+
* stamp it read from disk: `stamp` from the root file (else the code), and
|
|
324
|
+
* `codeStamp` from server/plugin.js only when it names another stamp. Every
|
|
325
|
+
* hash and stamp is read by loops. */
|
|
326
|
+
export const InstallReportSchema = z.object({
|
|
327
|
+
version: z.string().min(1),
|
|
328
|
+
installedSha256: sha256Hex.nullable(),
|
|
329
|
+
currentSha256: sha256Hex.nullable(),
|
|
330
|
+
stamp: StampSchema.optional(),
|
|
331
|
+
codeStamp: StampSchema.optional(),
|
|
332
|
+
});
|
|
333
|
+
/** S367d (D4): what the CMS sends to POST /api/v1/licenses/validate. The
|
|
334
|
+
* nonce is the CMS's createLicenseChallenge value, echoed into the signed
|
|
335
|
+
* envelope; the install id and the address stay optional, so a CMS up to
|
|
336
|
+
* 0.19 still gets a verdict (absent, the name decides). */
|
|
337
|
+
export const LicenseValidateRequestSchema = z.object({
|
|
338
|
+
key: LicenceKeyFieldSchema,
|
|
339
|
+
pluginId: z.string().min(1),
|
|
340
|
+
domain: z.string().min(1),
|
|
341
|
+
nonce: z.string().refine((v) => isLowerHex(v, 32), "nonce must be 32 hex characters"),
|
|
342
|
+
installId: InstallIdSchema.optional(),
|
|
343
|
+
address: SiteReachSchema.optional(),
|
|
344
|
+
install: InstallReportSchema.optional(),
|
|
345
|
+
});
|
|
346
|
+
const uuid = z.string().uuid();
|
|
347
|
+
export const AddSiteInputSchema = z.object({ licenseId: uuid, domain: z.string().trim().min(1).max(SITE_KEY_MAX), client: z.boolean() });
|
|
348
|
+
export const NameStagingInputSchema = z.object({ licenseId: uuid, domain: z.string().trim().min(1).max(SITE_KEY_MAX) });
|
|
349
|
+
export const RemoveStagingInputSchema = z.object({ licenseId: uuid });
|
|
350
|
+
export const LICENCE_TRANSFER_NOTE_MAX = 2000;
|
|
351
|
+
/** The operator's transfer of a one-time licence (licence terms `grant`):
|
|
352
|
+
* the recipient by email and the three written confirmations as ticked boxes. */
|
|
353
|
+
export const LicenceTransferInputSchema = z
|
|
354
|
+
.object({
|
|
355
|
+
licenseId: uuid,
|
|
356
|
+
recipientEmail: z.string().trim().toLowerCase().max(254).refine(isPayoutEmail, "Enter the recipient's email address"),
|
|
357
|
+
askedInWriting: z.literal(true),
|
|
358
|
+
copiesDeleted: z.literal(true),
|
|
359
|
+
recipientAccepted: z.literal(true),
|
|
360
|
+
recipientAcceptedConditions: z.literal(true),
|
|
361
|
+
note: z.string().trim().max(LICENCE_TRANSFER_NOTE_MAX),
|
|
362
|
+
// M32 I7 (task 2, M3): the sale conditions the form showed, encoded
|
|
363
|
+
// (encodeSaleConditions). Compared with the set in force under the
|
|
364
|
+
// transfer's locks; never what the transfer records.
|
|
365
|
+
shownConditions: z.string().min(1).max(200),
|
|
366
|
+
})
|
|
367
|
+
.strict();
|
|
368
|
+
export const RemoveSiteInputSchema = z.object({ licenseId: uuid, siteId: uuid });
|
|
369
|
+
/** An operator's form that names one licence (one more move, ending a
|
|
370
|
+
* revoked licence's subscription): a malformed id is refused before any read. */
|
|
371
|
+
export const OperatorLicenceActionSchema = z.object({ licenseId: uuid });
|
|
372
|
+
export const SHARING_NOTE_MAX = 2000;
|
|
373
|
+
export const SHARING_REASON_MAX = 500;
|
|
374
|
+
const note = z.string().trim().min(1).max(SHARING_NOTE_MAX);
|
|
375
|
+
/** The operator's three actions on a sharing case. A revocation needs the
|
|
376
|
+
* reviewed box ticked: nothing revokes a licence without it. */
|
|
377
|
+
export const SharingCaseActionSchema = z.discriminatedUnion("action", [
|
|
378
|
+
z.object({ action: z.literal("lift"), caseId: uuid, note }),
|
|
379
|
+
z.object({ action: z.literal("dismiss"), caseId: uuid, note }),
|
|
380
|
+
z.object({ action: z.literal("revoke"), caseId: uuid, reason: z.string().trim().min(1).max(SHARING_REASON_MAX), confirmed: z.literal(true) }),
|
|
381
|
+
]);
|
|
382
|
+
export const SHARING_NOTICE_KIND = "key-seen-elsewhere";
|
|
383
|
+
/** S367c (D4): the staging site's own CMS is told it is the staging site of
|
|
384
|
+
* `domain` (the seated parent), named at `at`. */
|
|
385
|
+
export const STAGING_NOTICE_KIND = "staging-site";
|
|
386
|
+
/** S367d (D12): while the operator closes kardalum.com, every valid verdict
|
|
387
|
+
* tells the CMS the service ends at `at` (the closing day, 00:00 UTC);
|
|
388
|
+
* `domain` is the site key the check came from. */
|
|
389
|
+
export const SERVICE_CLOSING_NOTICE_KIND = "service-closing";
|
|
390
|
+
/** What a valid verdict tells the buyer's own CMS while a counting case is
|
|
391
|
+
* under 30 days old: the newest case's site and when it opened, or, while the
|
|
392
|
+
* service closes, the closing day. */
|
|
393
|
+
export const SharingNoticeSchema = z
|
|
394
|
+
.object({ kind: z.enum([SHARING_NOTICE_KIND, STAGING_NOTICE_KIND, SERVICE_CLOSING_NOTICE_KIND]), domain: z.string().min(1).max(SITE_KEY_MAX), at: z.string().datetime() })
|
|
395
|
+
.strict();
|
|
396
|
+
export const AUTHOR_CASE_STATES = ["refused", "locked", "revoked", "lifted", "own-site", "not-sharing"];
|
|
397
|
+
/** An author's view of a case on their plugin: domains, short install ids,
|
|
398
|
+
* dates, counts and the state. Strict, so no field that could carry the
|
|
399
|
+
* buyer's name, email, account, key or own sites can ride along. */
|
|
400
|
+
export const AuthorCaseRowSchema = z
|
|
401
|
+
.object({
|
|
402
|
+
pluginId: z.string(),
|
|
403
|
+
pluginName: z.string(),
|
|
404
|
+
licenceRef: z.string().length(10),
|
|
405
|
+
domain: z.string().max(SITE_KEY_MAX),
|
|
406
|
+
installations: z.array(z.string().length(8)).max(20),
|
|
407
|
+
openedAt: z.string().datetime(),
|
|
408
|
+
lastSeenAt: z.string().datetime(),
|
|
409
|
+
checks: z.number().int().nonnegative(),
|
|
410
|
+
state: z.enum(AUTHOR_CASE_STATES),
|
|
411
|
+
})
|
|
412
|
+
.strict();
|
|
413
|
+
export const AuthorTamperRowSchema = z
|
|
414
|
+
.object({
|
|
415
|
+
pluginId: z.string(),
|
|
416
|
+
pluginName: z.string(),
|
|
417
|
+
version: z.string(),
|
|
418
|
+
kind: z.enum(["foreign-package", "sideloaded", "modified-on-disk"]),
|
|
419
|
+
domain: z.string().max(SITE_KEY_MAX),
|
|
420
|
+
// S367b M9 (S367e D14): the report came from a site of the licence; its domain is then "".
|
|
421
|
+
ownSite: z.boolean(),
|
|
422
|
+
day: z.string().length(10),
|
|
423
|
+
})
|
|
424
|
+
.strict();
|