@kardalum/plugin-sdk 0.16.0 → 0.18.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 +105 -0
- package/README.md +4 -3
- package/dist/admin-section-registry.d.ts +14 -5
- package/dist/admin-section-registry.js +14 -4
- package/dist/assets/asset-picker.d.ts +11 -0
- package/dist/assets/asset-picker.js +109 -0
- package/dist/assets/asset-tree.d.ts +30 -0
- package/dist/assets/asset-tree.js +150 -0
- package/dist/built-in-editor-ids.d.ts +1 -0
- package/dist/built-in-editor-ids.js +20 -0
- package/dist/built-in-settings-schemas.d.ts +2 -0
- package/dist/built-in-settings-schemas.js +27 -0
- package/dist/built-in-value-schemas.js +3 -0
- package/dist/built-ins.js +10 -1
- package/dist/capabilities.js +5 -3
- package/dist/datatype-validation.js +18 -4
- package/dist/datatypes-entry.d.ts +1 -0
- package/dist/datatypes-entry.js +1 -0
- package/dist/entitlement-entry.d.ts +3 -2
- package/dist/entitlement-entry.js +13 -1
- package/dist/entitlement-gate.d.ts +18 -0
- package/dist/entitlement-gate.js +95 -21
- package/dist/entitlement-plan.d.ts +21 -0
- package/dist/entitlement-plan.js +26 -0
- package/dist/entitlement-types.d.ts +21 -4
- package/dist/entitlement.d.ts +29 -1
- package/dist/entitlement.js +39 -0
- package/dist/grid-arrow-step.d.ts +7 -0
- package/dist/grid-arrow-step.js +20 -0
- package/dist/host-entry.d.ts +1 -1
- package/dist/host-entry.js +1 -1
- package/dist/index.d.ts +8 -3
- package/dist/index.js +13 -18
- package/dist/license-verdict-keys.d.ts +4 -3
- package/dist/license-verdict-keys.js +4 -7
- package/dist/manifest-entry.d.ts +6 -2
- package/dist/manifest-entry.js +5 -1
- package/dist/manifest-schema.d.ts +56 -63
- package/dist/manifest-schema.js +103 -249
- package/dist/manifest.d.ts +61 -73
- package/dist/manifest.js +13 -36
- package/dist/media/media-picker.js +32 -32
- package/dist/notify.d.ts +17 -0
- package/dist/notify.js +17 -0
- package/dist/plugin-screen-context.d.ts +11 -1
- package/dist/richtext/block-panel.js +19 -20
- package/dist/richtext/extensions.js +10 -1
- package/dist/richtext/insert-menu.js +1 -1
- package/dist/richtext/kardalum-block.js +17 -17
- package/dist/richtext/style-listbox.js +4 -4
- package/dist/richtext-html-entry.d.ts +35 -0
- package/dist/richtext-html-entry.js +73 -0
- package/dist/structured-storage-types.d.ts +11 -0
- package/dist/tailwind.js +10 -3
- package/dist/tokens/tailwind-theme.css +176 -0
- package/dist/tokens/tokens.css +2 -0
- package/dist/tokens/tokens.json +4 -2
- package/dist/type-equality.d.ts +2 -0
- package/dist/type-equality.js +1 -0
- package/dist/vendor-check.d.ts +39 -0
- package/dist/vendor-check.js +79 -0
- package/dist/vendor-entry.d.ts +3 -0
- package/dist/vendor-entry.js +9 -0
- package/dist/vendor-service.d.ts +20 -0
- package/dist/vendor-service.js +20 -0
- package/dist/views/asset-view.d.ts +6 -0
- package/dist/views/asset-view.js +55 -0
- package/dist/views/content-list-settings-view.js +1 -1
- package/dist/views/content-list-view.js +1 -1
- package/dist/views/html-code-editor.js +0 -1
- package/dist/views/html-view.js +1 -1
- package/dist/views/image-view.js +1 -1
- package/dist/views/rich-text-view.js +30 -30
- package/node_modules/@kardalum/api-schemas/README.md +1 -1
- package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.d.ts +90 -0
- package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.js +43 -10
- package/node_modules/@kardalum/api-schemas/dist/asset-field.schema.d.ts +21 -0
- package/node_modules/@kardalum/api-schemas/dist/asset-field.schema.js +42 -0
- package/node_modules/@kardalum/api-schemas/dist/asset.schema.d.ts +23 -1
- package/node_modules/@kardalum/api-schemas/dist/asset.schema.js +60 -18
- package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.d.ts +204 -0
- package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.js +134 -0
- package/node_modules/@kardalum/api-schemas/dist/checkout-shown.schema.d.ts +36 -0
- package/node_modules/@kardalum/api-schemas/dist/checkout-shown.schema.js +46 -0
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.d.ts +12 -0
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.js +22 -6
- package/node_modules/@kardalum/api-schemas/dist/content-list.schema.d.ts +2 -2
- package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.d.ts +4 -0
- package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.js +3 -0
- package/node_modules/@kardalum/api-schemas/dist/content-trash.schema.js +2 -1
- package/node_modules/@kardalum/api-schemas/dist/core-actions.d.ts +52 -10
- package/node_modules/@kardalum/api-schemas/dist/core-actions.js +33 -14
- package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.d.ts +50 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.js +25 -5
- package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.d.ts +1 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.js +3 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-cursor.d.ts +11 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-cursor.js +28 -0
- package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +42 -2
- package/node_modules/@kardalum/api-schemas/dist/home.schema.d.ts +130 -0
- package/node_modules/@kardalum/api-schemas/dist/home.schema.js +87 -0
- package/node_modules/@kardalum/api-schemas/dist/index.d.ts +73 -31
- package/node_modules/@kardalum/api-schemas/dist/index.js +47 -17
- package/node_modules/@kardalum/api-schemas/dist/install-warnings.schema.d.ts +4 -0
- package/node_modules/@kardalum/api-schemas/dist/install-warnings.schema.js +8 -0
- package/node_modules/@kardalum/api-schemas/dist/issue-list.d.ts +6 -0
- package/node_modules/@kardalum/api-schemas/dist/issue-list.js +6 -0
- package/node_modules/@kardalum/api-schemas/dist/kardalum-latest.schema.d.ts +7 -0
- package/node_modules/@kardalum/api-schemas/dist/kardalum-latest.schema.js +9 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.d.ts +216 -63
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +117 -5
- package/node_modules/@kardalum/api-schemas/dist/marketplace-package-api.schema.d.ts +17 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-package-api.schema.js +16 -0
- package/node_modules/@kardalum/api-schemas/dist/media-api.schema.d.ts +26 -0
- package/node_modules/@kardalum/api-schemas/dist/media-api.schema.js +6 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference-use.d.ts +10 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference-use.js +4 -4
- package/node_modules/@kardalum/api-schemas/dist/news.schema.d.ts +93 -0
- package/node_modules/@kardalum/api-schemas/dist/news.schema.js +86 -0
- package/node_modules/@kardalum/api-schemas/dist/node-access.schema.js +13 -0
- package/node_modules/@kardalum/api-schemas/dist/notification.schema.d.ts +410 -0
- package/node_modules/@kardalum/api-schemas/dist/notification.schema.js +193 -0
- package/node_modules/@kardalum/api-schemas/dist/plan-editor.schema.d.ts +86 -0
- package/node_modules/@kardalum/api-schemas/dist/plan-editor.schema.js +92 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.d.ts +6 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.js +8 -6
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.d.ts +8 -18
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.js +7 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs.d.ts +3 -19
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs.js +13 -15
- package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.d.ts +17 -7
- package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.js +18 -8
- package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.d.ts +1 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-install.d.ts +97 -85
- package/node_modules/@kardalum/api-schemas/dist/plugin-install.js +35 -68
- package/node_modules/@kardalum/api-schemas/dist/plugin-labels.d.ts +60 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-labels.js +116 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-locales.d.ts +9 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-locales.js +22 -7
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.d.ts +240 -6
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +164 -32
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.d.ts +4 -3
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.d.ts +14 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.js +37 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-fields.d.ts +64 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-fields.js +134 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-read-only.schema.d.ts +19 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-read-only.schema.js +33 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.d.ts +2 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.js +4 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-template-payload.d.ts +83 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-template-payload.js +152 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-vocabulary.d.ts +13 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-vocabulary.js +15 -0
- package/node_modules/@kardalum/api-schemas/dist/public-api.schema.d.ts +5 -0
- package/node_modules/@kardalum/api-schemas/dist/public-api.schema.js +35 -23
- package/node_modules/@kardalum/api-schemas/dist/revenue-view.schema.d.ts +83 -0
- package/node_modules/@kardalum/api-schemas/dist/revenue-view.schema.js +73 -0
- package/node_modules/@kardalum/api-schemas/dist/role.schema.d.ts +11 -0
- package/node_modules/@kardalum/api-schemas/dist/role.schema.js +7 -0
- package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.d.ts +11 -2
- package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.js +21 -3
- package/node_modules/@kardalum/api-schemas/dist/sandbox-attach.schema.d.ts +126 -0
- package/node_modules/@kardalum/api-schemas/dist/sandbox-attach.schema.js +70 -0
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +6 -6
- package/node_modules/@kardalum/api-schemas/dist/sites.schema.d.ts +58 -25
- package/node_modules/@kardalum/api-schemas/dist/sites.schema.js +194 -48
- package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.d.ts +18 -6
- package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.js +14 -0
- package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.d.ts +2 -2
- package/node_modules/@kardalum/api-schemas/dist/strict-url.d.ts +12 -0
- package/node_modules/@kardalum/api-schemas/dist/strict-url.js +31 -0
- package/node_modules/@kardalum/api-schemas/dist/template-api.schema.d.ts +115 -1
- package/node_modules/@kardalum/api-schemas/dist/template-api.schema.js +65 -10
- package/node_modules/@kardalum/api-schemas/dist/template.schema.d.ts +37 -2
- package/node_modules/@kardalum/api-schemas/dist/template.schema.js +34 -8
- package/node_modules/@kardalum/api-schemas/dist/trash-cursor.schema.d.ts +4 -0
- package/node_modules/@kardalum/api-schemas/dist/trash-cursor.schema.js +29 -0
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.d.ts +16 -0
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +8 -0
- package/node_modules/@kardalum/api-schemas/dist/uuid.schema.d.ts +2 -0
- package/node_modules/@kardalum/api-schemas/dist/uuid.schema.js +4 -0
- package/node_modules/@kardalum/api-schemas/dist/vendor-service.schema.d.ts +88 -0
- package/node_modules/@kardalum/api-schemas/dist/vendor-service.schema.js +100 -0
- package/node_modules/@kardalum/api-schemas/dist/whoami-api.schema.d.ts +32 -0
- package/node_modules/@kardalum/api-schemas/dist/whoami-api.schema.js +27 -0
- package/node_modules/@kardalum/api-schemas/package.json +2 -2
- package/node_modules/@kardalum/design-tokens/README.md +1 -1
- package/node_modules/@kardalum/design-tokens/dist/build-theme-css.d.ts +16 -0
- package/node_modules/@kardalum/design-tokens/dist/build-theme-css.js +76 -0
- package/node_modules/@kardalum/design-tokens/dist/generate.js +4 -1
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.css +176 -0
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.d.ts +2 -1
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.js +2 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.css +2 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.js +4 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.json +4 -2
- package/node_modules/@kardalum/design-tokens/dist/types.d.ts +2 -0
- package/node_modules/@kardalum/design-tokens/package.json +6 -3
- package/node_modules/@kardalum/plugin-package/README.md +5 -2
- package/node_modules/@kardalum/plugin-package/dist/build-reference.d.ts +6 -21
- package/node_modules/@kardalum/plugin-package/dist/build-reference.js +13 -8
- package/node_modules/@kardalum/plugin-package/dist/capabilities.d.ts +4 -4
- package/node_modules/@kardalum/plugin-package/dist/capabilities.js +59 -16
- package/node_modules/@kardalum/plugin-package/dist/client-bundle.d.ts +4 -0
- package/node_modules/@kardalum/plugin-package/dist/client-bundle.js +25 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.d.ts +25 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.js +203 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/bundle.d.ts +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/bundle.js +73 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.d.ts +8 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.js +77 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/icon-names.generated.d.ts +1 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/icon-names.generated.js +2052 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/icons.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/icons.js +51 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/index.d.ts +8 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/index.js +7 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/label-languages.d.ts +17 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/label-languages.js +119 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/limits.d.ts +14 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/limits.js +21 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/locales.d.ts +5 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/locales.js +148 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/package-files.d.ts +5 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/package-files.js +76 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/registry.d.ts +22 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/registry.js +137 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/sample-content.d.ts +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/sample-content.js +90 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/support.d.ts +24 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/support.js +55 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/templates.d.ts +7 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/templates.js +215 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/types.d.ts +53 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/types.js +1 -0
- package/node_modules/@kardalum/plugin-package/dist/docs-contract.d.ts +3 -2
- package/node_modules/@kardalum/plugin-package/dist/docs-contract.js +4 -2
- package/node_modules/@kardalum/plugin-package/dist/extract.d.ts +92 -3
- package/node_modules/@kardalum/plugin-package/dist/extract.js +251 -41
- package/node_modules/@kardalum/plugin-package/dist/index.d.ts +13 -4
- package/node_modules/@kardalum/plugin-package/dist/index.js +10 -3
- package/node_modules/@kardalum/plugin-package/dist/license-verdict.d.ts +56 -19
- package/node_modules/@kardalum/plugin-package/dist/license-verdict.js +119 -25
- package/node_modules/@kardalum/plugin-package/dist/manifest-entry.d.ts +5 -0
- package/node_modules/@kardalum/plugin-package/dist/manifest-entry.js +20 -0
- package/node_modules/@kardalum/plugin-package/dist/reference-entry.d.ts +1 -0
- package/node_modules/@kardalum/plugin-package/dist/reference-entry.js +1 -0
- package/node_modules/@kardalum/plugin-package/dist/sample-content.d.ts +21 -3
- package/node_modules/@kardalum/plugin-package/dist/sample-content.js +37 -9
- package/node_modules/@kardalum/plugin-package/dist/shipped-files.d.ts +39 -0
- package/node_modules/@kardalum/plugin-package/dist/shipped-files.js +133 -0
- package/node_modules/@kardalum/plugin-package/dist/shipped-locales.d.ts +7 -0
- package/node_modules/@kardalum/plugin-package/dist/shipped-locales.js +27 -0
- package/node_modules/@kardalum/plugin-package/dist/vendor-token.d.ts +24 -0
- package/node_modules/@kardalum/plugin-package/dist/vendor-token.js +118 -0
- package/node_modules/@kardalum/plugin-package/package.json +4 -2
- package/node_modules/@kardalum/ui/README.md +1 -1
- package/node_modules/@kardalum/ui/dist/components/button.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/checkbox.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/dialog.js +5 -2
- package/node_modules/@kardalum/ui/dist/components/dropdown-menu.js +3 -3
- package/node_modules/@kardalum/ui/dist/components/input.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/popover-panel.d.ts +4 -0
- package/node_modules/@kardalum/ui/dist/components/popover-panel.js +13 -0
- package/node_modules/@kardalum/ui/dist/components/sheet.js +5 -4
- package/node_modules/@kardalum/ui/dist/components/switch.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/tab-strip.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/toast.js +1 -1
- package/node_modules/@kardalum/ui/dist/index.d.ts +1 -0
- package/node_modules/@kardalum/ui/dist/index.js +1 -0
- package/node_modules/@kardalum/ui/package.json +1 -1
- package/package.json +19 -6
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { PluginReadOnlyNoticeSchema } from "./plugin-read-only.schema.js";
|
|
2
3
|
import { PluginRoleOfferSchema } from "./plugin-actions.schema.js";
|
|
3
4
|
import { InstallRoleOutcomeSchema } from "./plugin-install-record.schema.js";
|
|
4
5
|
import { SampleContentOutcomeSchema } from "./sample-content-outcome.schema.js";
|
|
6
|
+
import { InstallWarningsSchema } from "./install-warnings.schema.js";
|
|
7
|
+
import { STORAGE_TYPES } from "./plugin-vocabulary.js";
|
|
5
8
|
// The ADMIN management view of the registry (S135): unlike the public
|
|
6
9
|
// GET /api/plugins (enabled-only, boot-loader metadata), this surface
|
|
7
10
|
// lists every installed plugin, disabled included. licenseStatus reflects
|
|
8
|
-
// the PluginLicense row's last verdict ("valid" | "
|
|
9
|
-
// "domain_mismatch" | "unknown" | "grace_expired"), or null when the plugin has no license
|
|
11
|
+
// the PluginLicense row's last verdict ("valid" | "past_due" | "lapsed" |
|
|
12
|
+
// "revoked" | "domain_mismatch" | "unknown" | "grace_expired"), or null when the plugin has no license
|
|
10
13
|
// row at all (free plugins, or a paid plugin never validated yet,
|
|
11
14
|
// S138/S139). The three fields below (S139 Task 5) ride along so the
|
|
12
15
|
// admin's license cell can render an honest state without a second
|
|
@@ -14,28 +17,28 @@ import { SampleContentOutcomeSchema } from "./sample-content-outcome.schema.js";
|
|
|
14
17
|
// server's explanation for a non-valid verdict), licenseLastValidatedAt
|
|
15
18
|
// mirrors lastValidatedAt (the last SUCCESSFUL verdict), and
|
|
16
19
|
// licenseLastAttemptError mirrors lastAttemptError (why the most recent
|
|
17
|
-
// ATTEMPT
|
|
20
|
+
// ATTEMPT (successful or not) failed to reach a verdict; null when it
|
|
18
21
|
// didn't). Together the last two let the cell compute "unreachable since"
|
|
19
22
|
// itself. boundDomain mirrors PluginLicense.boundDomain (the domain this
|
|
20
23
|
// site bound the license to at S138 install; never mutated by later
|
|
21
|
-
// revalidation
|
|
24
|
+
// revalidation; see revalidate-license.ts) so a domain_mismatch warning
|
|
22
25
|
// can name the actual bound domain instead of the raw upstream reason
|
|
23
|
-
// token (S139 fix wave, spec section 6). Never add `key` here
|
|
26
|
+
// token (S139 fix wave, spec section 6). Never add `key` here; see the
|
|
24
27
|
// route's comment on the same prisma select.
|
|
25
28
|
// licenseLocked / buyHref (S209 Task 7, hardened by the S209 criticals
|
|
26
|
-
// fix): whether THIS production domain has locked the plugin's admin UI
|
|
29
|
+
// fix): whether THIS production domain has locked the plugin's admin UI,
|
|
27
30
|
// distinct from licenseStatus === "domain_mismatch" on its own, which also
|
|
28
31
|
// covers the plain warn-only case (localhost, or any domain the license
|
|
29
32
|
// server hasn't been asked to lock on production for). True for either of
|
|
30
|
-
// two reasons: a stored domain_mismatch verdict, or
|
|
33
|
+
// two reasons: a stored domain_mismatch verdict, or (closing the gap a
|
|
31
34
|
// paid plugin side-loaded through the ZIP door left open, since that door
|
|
32
|
-
// never writes a PluginLicense row at all
|
|
35
|
+
// never writes a PluginLicense row at all) a plugin pluginRequiresLicense()
|
|
33
36
|
// (apps/server/src/licensing/entitlement.ts) reports as a paid marketplace
|
|
34
37
|
// listing with no valid licence on record. Computed at read time from the
|
|
35
38
|
// stored license row (plus, for the no-row case, a cached marketplace
|
|
36
39
|
// lookup) and the CURRENT request's own domain
|
|
37
40
|
// (apps/server/src/licensing/production-domain.ts's isProductionDomain),
|
|
38
|
-
// never persisted
|
|
41
|
+
// never persisted: a licensed plugin re-checked from a different admin
|
|
39
42
|
// domain must never keep yesterday's lock. `revoked` never sets this: that
|
|
40
43
|
// status already deactivates the plugin outright (see revalidate-license.ts),
|
|
41
44
|
// which is a different, harder consequence than a lock. buyHref is the
|
|
@@ -51,16 +54,18 @@ export const ManagedPluginRoleOfferSchema = PluginRoleOfferSchema.extend({ creat
|
|
|
51
54
|
export const PluginTamperKindSchema = z.enum(["foreign-package", "sideloaded", "modified-on-disk"]);
|
|
52
55
|
export const ManagedPluginSchema = z.object({
|
|
53
56
|
pluginId: z.string(),
|
|
57
|
+
// S318: present only when the licence term lapsed (the plugin is read-only).
|
|
58
|
+
readOnly: PluginReadOnlyNoticeSchema.optional(),
|
|
54
59
|
name: z.string(),
|
|
55
60
|
type: z.string(),
|
|
56
61
|
version: z.string(),
|
|
57
62
|
trustTier: z.enum(["verified", "unverified"]),
|
|
58
|
-
storageType: z.enum(
|
|
63
|
+
storageType: z.enum(STORAGE_TYPES),
|
|
59
64
|
enabled: z.boolean(),
|
|
60
65
|
licenseStatus: z
|
|
61
66
|
.string()
|
|
62
67
|
.nullable()
|
|
63
|
-
.describe('The licence row\'s last verdict: "valid", "revoked", "domain_mismatch", "unknown", or "grace_expired" (no valid verdict within the grace period, so the plugin is switched off until one arrives). Null when the plugin has no licence row.'),
|
|
68
|
+
.describe('The licence row\'s last verdict: "valid", "past_due" (a renewal failed; the plugin works during 14 days of grace), "lapsed" (the term ended unpaid or cancelled; the plugin is read-only: it renders, its writes are refused), "revoked", "domain_mismatch", "unknown", or "grace_expired" (no valid verdict within the grace period, so the plugin is switched off until one arrives). Null when the plugin has no licence row.'),
|
|
64
69
|
licenseReason: z.string().nullable(),
|
|
65
70
|
// S284b fix wave: the signed `detail` of the latest verdict, today the
|
|
66
71
|
// marketplace operator's reason for a `domain_blocked` answer, which the
|
|
@@ -84,6 +89,21 @@ export const ManagedPluginSchema = z.object({
|
|
|
84
89
|
// record (both above) and, since S284b, a grace_expired lock.
|
|
85
90
|
licenseLocked: z.boolean(),
|
|
86
91
|
buyHref: z.string().nullable(),
|
|
92
|
+
// S322b (P15): the plan the stored licence verdict names (its key, S317)
|
|
93
|
+
// and its name as the marketplace last named it, null when it never did.
|
|
94
|
+
// Absent when the verdict carries no plan (no licence, or one from before S317).
|
|
95
|
+
// S322c fix wave (M1): `bundle` is present when the licence is a bundle's
|
|
96
|
+
// (the member holds the bundle's key): the plan is then the bundle's.
|
|
97
|
+
licensePlan: z
|
|
98
|
+
.object({
|
|
99
|
+
key: z.string(),
|
|
100
|
+
name: z.string().nullable(),
|
|
101
|
+
bundle: z.object({ pluginId: z.string(), name: z.string() }).optional(),
|
|
102
|
+
})
|
|
103
|
+
// S322b polish (M11): a real plan, not the generator's page-name guess.
|
|
104
|
+
.meta({ example: { key: "basic", name: "Basic" } })
|
|
105
|
+
.optional()
|
|
106
|
+
.describe("The plan of this site's licence for the plugin: the verdict's plan key and the marketplace's name for it (null when unknown). Absent when no verdict names a plan. For a member holding the licence of the bundle that installed it, the plan is the bundle's and `bundle` names that bundle."),
|
|
87
107
|
// S273: the roles this plugin's attached manifest offers, so an uploaded
|
|
88
108
|
// or sideloaded plugin, which has no install screen, can have an offer
|
|
89
109
|
// accepted from the installed-plugins view. Empty when the manifest is
|
|
@@ -100,7 +120,14 @@ export const ManagedPluginSchema = z.object({
|
|
|
100
120
|
// before (a cold cache). The lookup fails open: a version learned earlier
|
|
101
121
|
// is served through a failure and its backoff, and while a lookup slower
|
|
102
122
|
// than the list's two-second wait runs.
|
|
103
|
-
|
|
123
|
+
// S319 (spec 3c, plan P7): `renewToUpdate` is present, and true, when the
|
|
124
|
+
// plugin's lapsed licence does not cover that version (released after the
|
|
125
|
+
// term's end): the admin says "renew to get it" and offers no update.
|
|
126
|
+
// `renewHref` is the listing's page on the marketplace, present with it
|
|
127
|
+
// when a marketplace is configured.
|
|
128
|
+
updateAvailable: z
|
|
129
|
+
.object({ version: z.string(), renewToUpdate: z.literal(true).optional(), renewHref: z.string().optional() })
|
|
130
|
+
.nullable(),
|
|
104
131
|
});
|
|
105
132
|
export const ManagedPluginListQuerySchema = z.object({
|
|
106
133
|
cursor: z.string().uuid().optional(),
|
|
@@ -118,7 +145,7 @@ export const PluginIdParamsSchema = z.object({
|
|
|
118
145
|
});
|
|
119
146
|
// Fastify substitutes `null` for a genuinely absent body before handing it
|
|
120
147
|
// to the validator (lib/validation.js's validateParam: `isUndefined ? null
|
|
121
|
-
// : request[paramName]`)
|
|
148
|
+
// : request[paramName]`); a DELETE sent with no payload at all lands here
|
|
122
149
|
// as `null`, not `undefined`. `.nullish()` (not `.optional()`) is required
|
|
123
150
|
// so an absent body validates; `request.body?.confirmStructuredDataCleanup`
|
|
124
151
|
// in the route handler already tolerates both null and undefined.
|
|
@@ -134,14 +161,14 @@ export const UninstallPluginBodySchema = z
|
|
|
134
161
|
// dropped as an unknown key would be read as consent to remove.
|
|
135
162
|
.strict()
|
|
136
163
|
.nullish();
|
|
137
|
-
// 409 payload when a structured plugin's uninstall needs confirmation
|
|
164
|
+
// 409 payload when a structured plugin's uninstall needs confirmation:
|
|
138
165
|
// the snapshot has ALREADY been taken (S87's safe-to-retry design).
|
|
139
166
|
export const UninstallConfirmationRequiredSchema = z.object({
|
|
140
167
|
requiresConfirmation: z.literal(true),
|
|
141
168
|
snapshotGroupId: z.string(),
|
|
142
169
|
message: z.string(),
|
|
143
170
|
});
|
|
144
|
-
// S152: the BUNDLE uninstall's aggregated 409
|
|
171
|
+
// S152: the BUNDLE uninstall's aggregated 409: one snapshot group per
|
|
145
172
|
// structured plugin in the removal set (owned members, and the bundle
|
|
146
173
|
// itself if structured). A separate schema rather than widening
|
|
147
174
|
// UninstallConfirmationRequiredSchema: the single-plugin contract
|
|
@@ -156,14 +183,14 @@ export const BundleUninstallConfirmationRequiredSchema = z.object({
|
|
|
156
183
|
})),
|
|
157
184
|
message: z.string(),
|
|
158
185
|
});
|
|
159
|
-
// F1 QA fix wave: the content-guard 409
|
|
186
|
+
// F1 QA fix wave: the content-guard 409: a single-plugin uninstall()
|
|
160
187
|
// blocked because one or more of its tracked document types still have
|
|
161
188
|
// content or templates referencing them. Distinct from the two
|
|
162
189
|
// confirmation schemas above (those are "confirm to proceed," this is a
|
|
163
190
|
// terminal refusal the caller must resolve by hand, never retried with a
|
|
164
191
|
// flag) and from the bare ApiErrorSchema (that still covers every OTHER
|
|
165
192
|
// refusal this route can throw, e.g. a bundle member blocked by an outside
|
|
166
|
-
// dependent)
|
|
193
|
+
// dependent); a separate shape so `blockedBy` only ever appears when the
|
|
167
194
|
// server actually has a list of named blockers to put in it.
|
|
168
195
|
// contentCount is optional: the guard only knows a count for the
|
|
169
196
|
// "has-content" reason, not "has-templates" (document-type-service.ts's
|
|
@@ -175,15 +202,21 @@ export const UninstallBlockedByDocumentTypesSchema = z.object({
|
|
|
175
202
|
contentCount: z.number().int().nonnegative().optional(),
|
|
176
203
|
})),
|
|
177
204
|
});
|
|
178
|
-
// Task 6: the 200 success body for a single-plugin DELETE
|
|
205
|
+
// Task 6: the 200 success body for a single-plugin DELETE: the CONFIRMED
|
|
179
206
|
// pass's freshly-minted snapshotGroupId (the gate site already took it;
|
|
180
207
|
// this just stops discarding it), null for a simple-storage plugin (never
|
|
181
208
|
// snapshotted) or for the earlier PluginRegistry.uninstall() callers that
|
|
182
209
|
// route around the HTTP layer entirely.
|
|
210
|
+
// S314o3 (D4): the uninstall also removes the plugin's unused data types after writing them into
|
|
211
|
+
// a snapshot of their own; the answer names them and that snapshot group (null when the plugin
|
|
212
|
+
// had none), so a client can say where the record is. Optional for the PluginRegistry callers
|
|
213
|
+
// that answer without them.
|
|
183
214
|
export const UninstallSucceededSchema = z.object({
|
|
184
215
|
snapshotGroupId: z.string().nullable(),
|
|
216
|
+
dataTypesSnapshotGroupId: z.string().nullable().optional(),
|
|
217
|
+
removedDataTypes: z.array(z.string()).optional(),
|
|
185
218
|
});
|
|
186
|
-
// Task 6: the 200 success body for a BUNDLE DELETE
|
|
219
|
+
// Task 6: the 200 success body for a BUNDLE DELETE: one entry per
|
|
187
220
|
// structured plugin in the cascade (owned members, and the bundle itself
|
|
188
221
|
// if structured) that got a fresh snapshot on this confirmed pass. Simple-
|
|
189
222
|
// storage members never appear here, same as the 409 aggregate above.
|
|
@@ -192,8 +225,20 @@ export const BundleUninstallSucceededSchema = z.object({
|
|
|
192
225
|
pluginId: z.string(),
|
|
193
226
|
snapshotGroupId: z.string(),
|
|
194
227
|
})),
|
|
228
|
+
// S314o3 (D4): the data types the cascade removed, by name, and one entry per plugin of the set
|
|
229
|
+
// whose uninstall wrote a data type snapshot, with that group.
|
|
230
|
+
removedDataTypes: z.array(z.string()).optional(),
|
|
231
|
+
dataTypesSnapshots: z
|
|
232
|
+
.array(z.object({
|
|
233
|
+
pluginId: z.string(),
|
|
234
|
+
snapshotGroupId: z.string(),
|
|
235
|
+
}))
|
|
236
|
+
.optional(),
|
|
237
|
+
// S314c5: a member's data type the cascade kept for another member and then could not remove,
|
|
238
|
+
// because a field outside the bundle started using it meanwhile. It stays, by name.
|
|
239
|
+
leftDataTypes: z.array(z.string()).optional(),
|
|
195
240
|
});
|
|
196
|
-
// S180: whether this instance has a marketplace to browse at all
|
|
241
|
+
// S180: whether this instance has a marketplace to browse at all:
|
|
197
242
|
// `getMarketplaceBaseUrl()` returning undefined (KARDALUM_MARKETPLACE_URL
|
|
198
243
|
// explicitly set to "off", or blank) means `configured: false`. Distinct
|
|
199
244
|
// from the marketplace being unreachable (a `configured: true` instance
|
|
@@ -208,15 +253,19 @@ export const MarketplaceStatusResponseSchema = z.object({
|
|
|
208
253
|
// RevalidationOutcome, flattened for the wire. `checked: false` covers
|
|
209
254
|
// every fail-open case that still has a license row to report on
|
|
210
255
|
// (unreachable license server, no KARDALUM_SITE_DOMAIN, no marketplace
|
|
211
|
-
// configured)
|
|
256
|
+
// configured): `status` and `lastValidatedAt` stay null in that shape
|
|
212
257
|
// since nothing was verified. A plugin with no license row at all gets a
|
|
213
|
-
// 404 instead of this body (ApiErrorSchema)
|
|
258
|
+
// 404 instead of this body (ApiErrorSchema), as there's nothing to recheck.
|
|
214
259
|
export const LicenseRecheckResponseSchema = z.object({
|
|
215
260
|
pluginId: z.string(),
|
|
216
261
|
checked: z.boolean(),
|
|
217
262
|
status: z.string().nullable(),
|
|
218
263
|
reason: z.string().nullable(),
|
|
219
264
|
lastValidatedAt: z.string().nullable(),
|
|
265
|
+
// S324 (spec item 9): why a `checked: false` answer checked nothing, when the
|
|
266
|
+
// server knows: "site-domain-missing" (no KARDALUM_SITE_DOMAIN). A string, not
|
|
267
|
+
// an enum, so a newer server's reason never breaks an older admin (S292).
|
|
268
|
+
skipped: z.string().optional(),
|
|
220
269
|
});
|
|
221
270
|
// S284b (design 3.2): the host's latest licence verdict for a plugin, valid
|
|
222
271
|
// or not, handed to the plugin's own code unchanged so the plugin can verify
|
|
@@ -224,6 +273,25 @@ export const LicenseRecheckResponseSchema = z.object({
|
|
|
224
273
|
// @kardalum/plugin-package's LicenseVerdictEnvelope; a verdict is public
|
|
225
274
|
// and signed, never a secret (the licence key never appears in it, only its
|
|
226
275
|
// hash).
|
|
276
|
+
// S317: the term a verdict carries, signed by its termSignature. `state` is
|
|
277
|
+
// a string, not an enum, so a host keeps serving a verdict whose state a
|
|
278
|
+
// newer marketplace added (the S292 tolerance rule); the marketplace writes
|
|
279
|
+
// "active", "renewing", "past_due" or "lapsed".
|
|
280
|
+
export const LicenseVerdictTermSchema = z.object({
|
|
281
|
+
state: z.string(),
|
|
282
|
+
endsAt: z.string().nullable(),
|
|
283
|
+
renewalAmountCents: z.number().int().nullable(),
|
|
284
|
+
cancelAtPeriodEnd: z.boolean(),
|
|
285
|
+
});
|
|
286
|
+
// S317: a live plan of the listing, as a non-production host hands it to
|
|
287
|
+
// the plugin for its local evaluation (entitlementPlan's highest plan).
|
|
288
|
+
export const ListingPlanSummarySchema = z.object({
|
|
289
|
+
key: z.string(),
|
|
290
|
+
shape: z.string(),
|
|
291
|
+
priceCents: z.number().int(),
|
|
292
|
+
// S321 (P10): positions are 0 and up; the bound also gives the reference example a real value.
|
|
293
|
+
position: z.number().int().nonnegative(),
|
|
294
|
+
});
|
|
227
295
|
export const LicenseVerdictEnvelopeSchema = z.object({
|
|
228
296
|
v: z.literal(1),
|
|
229
297
|
alg: z.literal("ed25519"),
|
|
@@ -241,6 +309,10 @@ export const LicenseVerdictEnvelopeSchema = z.object({
|
|
|
241
309
|
tamper: PluginTamperKindSchema.optional(),
|
|
242
310
|
// The signed human sentence explaining `reason` (a domain block's reason).
|
|
243
311
|
detail: z.string().max(500).optional(),
|
|
312
|
+
// S317: the plan key and the term, covered by the verdict's termSignature
|
|
313
|
+
// (never by `signature`); absent on a verdict from before S317.
|
|
314
|
+
planId: z.string().max(64).optional(),
|
|
315
|
+
term: LicenseVerdictTermSchema.optional(),
|
|
244
316
|
});
|
|
245
317
|
// The tagged entitlement (S284b fix wave), the same value plugin server code
|
|
246
318
|
// receives on `context.entitlement`: `exempt` on a non-production install
|
|
@@ -248,12 +320,18 @@ export const LicenseVerdictEnvelopeSchema = z.object({
|
|
|
248
320
|
// no verdict for the plugin (the plugin's check refuses with `missing`), and
|
|
249
321
|
// `verdict` with the stored verdict to verify.
|
|
250
322
|
export const EntitlementSchema = z.discriminatedUnion("kind", [
|
|
251
|
-
z.object({
|
|
323
|
+
z.object({
|
|
324
|
+
kind: z.literal("exempt"),
|
|
325
|
+
reason: z.literal("non-production"),
|
|
326
|
+
listingPlans: z.array(ListingPlanSummarySchema).optional(),
|
|
327
|
+
}),
|
|
252
328
|
z.object({
|
|
253
329
|
kind: z.literal("verdict"),
|
|
254
330
|
envelope: LicenseVerdictEnvelopeSchema,
|
|
255
331
|
/** base64 Ed25519 signature over the envelope's canonical form. */
|
|
256
332
|
signature: z.string(),
|
|
333
|
+
/** S317: base64 Ed25519 signature over the envelope with its plan and term appended; absent when it carries neither. */
|
|
334
|
+
termSignature: z.string().optional(),
|
|
257
335
|
}),
|
|
258
336
|
z.object({ kind: z.literal("none") }),
|
|
259
337
|
]);
|
|
@@ -268,6 +346,8 @@ export const EntitlementSchema = z.discriminatedUnion("kind", [
|
|
|
268
346
|
export const EntitlementResponseSchema = z.object({
|
|
269
347
|
entitlement: EntitlementSchema,
|
|
270
348
|
valid: z.boolean(),
|
|
349
|
+
// S318: present only when the plugin is read-only.
|
|
350
|
+
readOnly: PluginReadOnlyNoticeSchema.optional(),
|
|
271
351
|
});
|
|
272
352
|
// The 403 a plugin API route answers when its handler throws the SDK's
|
|
273
353
|
// EntitlementError (`requireEntitlement` refused the verdict). `reason` is
|
|
@@ -279,13 +359,13 @@ export const EntitlementRefusalSchema = z.object({
|
|
|
279
359
|
});
|
|
280
360
|
// S154 Task 4: a plugin's structured-data snapshot GROUPS, derived from
|
|
281
361
|
// PluginStructuredSnapshot (GROUP BY snapshotGroupId) rather than tracked
|
|
282
|
-
// by their own table
|
|
362
|
+
// by their own table; see apps/server/src/plugins/snapshot-groups.ts for
|
|
283
363
|
// the derivation. takenAt is the group's earliest row's createdAt (every
|
|
284
364
|
// row in a group is written in one snapshotPluginTables() call, so in
|
|
285
|
-
// practice they're all within the same transaction-ish burst
|
|
365
|
+
// practice they're all within the same transaction-ish burst, and min is a
|
|
286
366
|
// defensive, not load-bearing, choice). trigger rides along from Task 3's
|
|
287
367
|
// column ("uninstall", "restore", or null for pre-Task-3 rows). status
|
|
288
|
-
// compares the group's own tableNames against totalTableCount
|
|
368
|
+
// compares the group's own tableNames against totalTableCount, the
|
|
289
369
|
// UNION of distinct tableNames across ALL of the plugin's snapshot rows,
|
|
290
370
|
// the only denominator that survives an uninstall (which deletes the
|
|
291
371
|
// PluginStructuredTable tracking rows, never the snapshots themselves).
|
|
@@ -306,7 +386,7 @@ export const SnapshotGroupListResponseSchema = z.object({
|
|
|
306
386
|
items: z.array(SnapshotGroupSchema), // newest first
|
|
307
387
|
nextCursor: z.string().nullable(),
|
|
308
388
|
});
|
|
309
|
-
// S154 Task 5: the UNION restore plan
|
|
389
|
+
// S154 Task 5: the UNION restore plan: the newest available snapshot copy
|
|
310
390
|
// of each DISTINCT table this plugin has ever snapshotted, chosen
|
|
311
391
|
// independently per table across every group (not "pick one group and use
|
|
312
392
|
// only its tables"). This is what makes restore recover from the S87
|
|
@@ -317,12 +397,12 @@ export const RestorePlanEntrySchema = z.object({
|
|
|
317
397
|
snapshotGroupId: z.string(),
|
|
318
398
|
groupTakenAt: z.string(),
|
|
319
399
|
});
|
|
320
|
-
// 409 payload for an unconfirmed restore
|
|
400
|
+
// 409 payload for an unconfirmed restore: nothing has been touched yet,
|
|
321
401
|
// the plan is offered for the admin to review before confirming. planHash
|
|
322
402
|
// (S161, S154 rider) is a stable digest of this exact plan: the confirm
|
|
323
403
|
// request must echo it back, and the handler refuses to proceed if a fresh
|
|
324
404
|
// re-plan hashes differently (a snapshot landed between the operator
|
|
325
|
-
// seeing this plan and confirming it)
|
|
405
|
+
// seeing this plan and confirming it), closing the requestRestorePlan ->
|
|
326
406
|
// confirmRestore TOCTOU. A mismatch response reuses this same schema, with
|
|
327
407
|
// a fresh plan/planHash and a message explaining the plan changed.
|
|
328
408
|
export const RestoreConfirmationRequiredSchema = z.object({
|
|
@@ -332,7 +412,7 @@ export const RestoreConfirmationRequiredSchema = z.object({
|
|
|
332
412
|
message: z.string(),
|
|
333
413
|
});
|
|
334
414
|
export const RestoreSucceededSchema = z.object({
|
|
335
|
-
// The pre-restore safety snapshot's group id
|
|
415
|
+
// The pre-restore safety snapshot's group id, null only when the
|
|
336
416
|
// plugin had no live tracked tables to protect (restoring onto empty).
|
|
337
417
|
preRestoreSnapshotGroupId: z.string().nullable(),
|
|
338
418
|
restoredTables: z.array(z.string()),
|
|
@@ -343,7 +423,7 @@ export const RestoreSucceededSchema = z.object({
|
|
|
343
423
|
// (not `.optional()`) is required for an absent body to validate at all.
|
|
344
424
|
// planHash (S161, S154 rider) is optional at the schema level only
|
|
345
425
|
// because the SAME body shape covers the unconfirmed call (`{}`, no plan
|
|
346
|
-
// to hash yet)
|
|
426
|
+
// to hash yet), so the route handler enforces it as effectively required
|
|
347
427
|
// whenever confirmRestore is true: a confirm with a missing or stale
|
|
348
428
|
// planHash is refused exactly the same way (409, fresh plan reissued).
|
|
349
429
|
export const RestoreBodySchema = z
|
|
@@ -352,9 +432,42 @@ export const RestoreBodySchema = z
|
|
|
352
432
|
planHash: z.string().optional(),
|
|
353
433
|
})
|
|
354
434
|
.nullish();
|
|
435
|
+
// S314c5 (D1, D2): restoring the data types an uninstall recorded (the row under the trigger
|
|
436
|
+
// "uninstall-data-types" in the snapshot table), in the two-step form of the table restore above:
|
|
437
|
+
// an unconfirmed call answers 409 with the plan and its hash, a confirmed call with that hash
|
|
438
|
+
// writes. A data type that cannot come back is skipped with its reason and every other one is
|
|
439
|
+
// restored: its id or its name exists again, its editor's plugin is missing or switched off, or
|
|
440
|
+
// its settings no longer pass its editor's settings schema.
|
|
441
|
+
export const DataTypeRestoreSkipReasonSchema = z.enum(["id-exists", "name-taken", "editor-missing", "editor-inactive", "settings-invalid"]);
|
|
442
|
+
export const DataTypeRestoreEntrySchema = z.object({ id: z.string(), name: z.string() });
|
|
443
|
+
export const DataTypeRestoreSkipSchema = DataTypeRestoreEntrySchema.extend({ reason: DataTypeRestoreSkipReasonSchema });
|
|
444
|
+
export const DataTypeRestorePlanSchema = z.object({
|
|
445
|
+
snapshotGroupId: z.string(),
|
|
446
|
+
restore: z.array(DataTypeRestoreEntrySchema),
|
|
447
|
+
skip: z.array(DataTypeRestoreSkipSchema),
|
|
448
|
+
});
|
|
449
|
+
export const DataTypeRestoreConfirmationRequiredSchema = DataTypeRestorePlanSchema.extend({
|
|
450
|
+
requiresConfirmation: z.literal(true),
|
|
451
|
+
planHash: z.string(),
|
|
452
|
+
message: z.string(),
|
|
453
|
+
});
|
|
454
|
+
export const DataTypeRestoreSucceededSchema = z.object({
|
|
455
|
+
snapshotGroupId: z.string(),
|
|
456
|
+
restored: z.array(DataTypeRestoreEntrySchema),
|
|
457
|
+
skipped: z.array(DataTypeRestoreSkipSchema),
|
|
458
|
+
});
|
|
459
|
+
// Nullish for the reason RestoreBodySchema is: an absent body lands as null. snapshotGroupId names
|
|
460
|
+
// a record other than the latest; planHash is required in effect whenever confirmRestore is true.
|
|
461
|
+
export const DataTypeRestoreBodySchema = z
|
|
462
|
+
.object({
|
|
463
|
+
snapshotGroupId: z.string().min(1).max(191).optional(),
|
|
464
|
+
confirmRestore: z.boolean().optional(),
|
|
465
|
+
planHash: z.string().optional(),
|
|
466
|
+
})
|
|
467
|
+
.nullish();
|
|
355
468
|
// The second install door (Task 4): POST /api/manage/v1/plugins/upload lands an
|
|
356
469
|
// admin-uploaded .zip through the same installPackageArchive spine the
|
|
357
|
-
// marketplace uses, but with no marketplace signature to check
|
|
470
|
+
// marketplace uses, but with no marketplace signature to check, so trust is
|
|
358
471
|
// always the literal "unregistered" here, never the registry's own
|
|
359
472
|
// "verified" | "unverified" tier (ManagedPluginSchema.trustTier above).
|
|
360
473
|
// That tier answers "did a signature check pass"; `trust: "unregistered"`
|
|
@@ -389,6 +502,10 @@ export const PluginUploadResponseSchema = z.object({
|
|
|
389
502
|
// S293: what the install did with each offered role its answers named;
|
|
390
503
|
// absent when they named none.
|
|
391
504
|
roles: z.array(InstallRoleOutcomeSchema).optional(),
|
|
505
|
+
// S314 (D4, W7): on an update, one sentence per template or asset the
|
|
506
|
+
// update did not apply as shipped, or removed. Absent on a fresh install
|
|
507
|
+
// and when there is nothing to say.
|
|
508
|
+
warnings: InstallWarningsSchema.optional(),
|
|
392
509
|
});
|
|
393
510
|
/** S274c: the upload's confirmation travels as a query flag because the
|
|
394
511
|
* route reads only the multipart file part. */
|
|
@@ -411,3 +528,18 @@ export const TrustDowngradeConfirmationSchema = z.object({
|
|
|
411
528
|
pluginName: z.string(),
|
|
412
529
|
message: z.string(),
|
|
413
530
|
});
|
|
531
|
+
// S314o3 (D3): the 409 of a switch-off or an uninstall refused because document type fields still
|
|
532
|
+
// use one of the plugin's data types (outside the plugin's own document types, which go with it).
|
|
533
|
+
// A key of its own beside `blockedBy`, which keeps meaning "still has content". `kind` lets a
|
|
534
|
+
// client link to the right editor; `dataType` is the data type's name, or the editor id for a
|
|
535
|
+
// field written before named data types.
|
|
536
|
+
export const DataTypeFieldBlockerSchema = z.object({
|
|
537
|
+
documentTypeId: z.string(),
|
|
538
|
+
documentType: z.string(),
|
|
539
|
+
kind: z.enum(["page", "element", "media"]),
|
|
540
|
+
fields: z.array(z.object({ id: z.string(), name: z.string(), dataType: z.string() })),
|
|
541
|
+
});
|
|
542
|
+
export const PluginDataTypesInUseSchema = z.object({
|
|
543
|
+
message: z.string(),
|
|
544
|
+
blockedByFields: z.array(DataTypeFieldBlockerSchema),
|
|
545
|
+
});
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { PluginLabel } from "./plugin-labels.js";
|
|
1
2
|
/** The contribution kinds that sit behind a named action. The SDK classifies
|
|
2
3
|
* these on its CONTRIBUTION_RULES table; its test pins that table to this
|
|
3
4
|
* list, so the two cannot drift apart silently. */
|
|
4
|
-
export declare const ACTION_GATED_CONTRIBUTION_KEYS: readonly ["adminSections", "railEntries", "dashboardWidgets", "
|
|
5
|
+
export declare const ACTION_GATED_CONTRIBUTION_KEYS: readonly ["adminSections", "railEntries", "dashboardWidgets", "apiRoutes"];
|
|
5
6
|
/** S293 (S283's decision, 2026-10-13-s293-the-wizard-installed-design.md 3.9):
|
|
6
7
|
* the built-in rights an offered role may grant beside the plugin's own
|
|
7
8
|
* actions: the read right of each built-in section a rail entry may join
|
|
@@ -17,11 +18,11 @@ export interface ActionDeclarationInput {
|
|
|
17
18
|
id: string;
|
|
18
19
|
actions?: ReadonlyArray<{
|
|
19
20
|
id: string;
|
|
20
|
-
label:
|
|
21
|
+
label: PluginLabel;
|
|
21
22
|
}>;
|
|
22
23
|
roles?: ReadonlyArray<{
|
|
23
24
|
id: string;
|
|
24
|
-
label:
|
|
25
|
+
label: PluginLabel;
|
|
25
26
|
actions: ReadonlyArray<string>;
|
|
26
27
|
}>;
|
|
27
28
|
contributions?: unknown;
|
|
@@ -10,7 +10,7 @@ import { isPluginActionFor } from "./action.schema.js";
|
|
|
10
10
|
/** The contribution kinds that sit behind a named action. The SDK classifies
|
|
11
11
|
* these on its CONTRIBUTION_RULES table; its test pins that table to this
|
|
12
12
|
* list, so the two cannot drift apart silently. */
|
|
13
|
-
export const ACTION_GATED_CONTRIBUTION_KEYS = ["adminSections", "railEntries", "dashboardWidgets", "
|
|
13
|
+
export const ACTION_GATED_CONTRIBUTION_KEYS = ["adminSections", "railEntries", "dashboardWidgets", "apiRoutes"];
|
|
14
14
|
/** S293 (S283's decision, 2026-10-13-s293-the-wizard-installed-design.md 3.9):
|
|
15
15
|
* the built-in rights an offered role may grant beside the plugin's own
|
|
16
16
|
* actions: the read right of each built-in section a rail entry may join
|
|
@@ -6,10 +6,12 @@ export declare const API_ROUTE_METHODS: readonly ["GET", "POST", "PUT", "PATCH",
|
|
|
6
6
|
export declare const API_ROUTE_RESPONSE_STATUSES_MAX = 4;
|
|
7
7
|
/** True for a success status code written canonically as a string: "200" to "299". Linear, no pattern. */
|
|
8
8
|
export declare function isApiRouteResponseStatus(key: string): boolean;
|
|
9
|
+
type ApiRouteMethod = (typeof API_ROUTE_METHODS)[number];
|
|
9
10
|
/** The longest declared path, checked before the path is split. */
|
|
10
11
|
export declare const API_ROUTE_PATH_MAX = 200;
|
|
11
12
|
/** The most apiRoutes one manifest declares, which bounds the pairwise check. */
|
|
12
13
|
export declare const API_ROUTES_MAX = 200;
|
|
14
|
+
export declare const isApiRouteMethod: (value: unknown) => value is ApiRouteMethod;
|
|
13
15
|
export interface ApiRouteDeclarationIssue {
|
|
14
16
|
path: (string | number)[];
|
|
15
17
|
message: string;
|
|
@@ -42,3 +44,15 @@ export declare function checkApiRouteDeclarations(manifest: {
|
|
|
42
44
|
export declare function checkApiRouteActions(manifest: {
|
|
43
45
|
contributions?: unknown;
|
|
44
46
|
}): ApiRouteDeclarationIssue[];
|
|
47
|
+
/** The `:name` parameters of a route path, in order. The one segment parser the
|
|
48
|
+
* SDK's `schema.params` rule and the path rule share. */
|
|
49
|
+
export declare function apiRoutePathParams(path: string): string[];
|
|
50
|
+
/** S311 (S295): the method and tier of every apiRoute, as the SDK's enums
|
|
51
|
+
* enforce them, for the gate that never sees Zod. checkApiRouteDeclarations
|
|
52
|
+
* skips an entry whose method is not in the list because "the schema reports
|
|
53
|
+
* it"; the door has no such schema, so `"get"` published. An absent `access` is
|
|
54
|
+
* the documented default and stays valid; an unknown string is an error. */
|
|
55
|
+
export declare function checkApiRouteTiers(manifest: {
|
|
56
|
+
contributions?: unknown;
|
|
57
|
+
}): ApiRouteDeclarationIssue[];
|
|
58
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { API_ROUTE_ACCESS_TIERS } from "./plugin-vocabulary.js";
|
|
1
2
|
// S295 (2026-10-14-s295-routes-fastify-knows-about-design.md 3.1): the rule for
|
|
2
3
|
// what a plugin may declare as an apiRoute's address, as plain data, so the
|
|
3
4
|
// SDK's manifest schema (and through it `kardalum plugin validate`), the
|
|
@@ -23,7 +24,7 @@ export const API_ROUTE_PATH_MAX = 200;
|
|
|
23
24
|
export const API_ROUTES_MAX = 200;
|
|
24
25
|
// A string of another length fails each of the five comparisons on its length
|
|
25
26
|
// alone, so a hostile method costs five length checks and nothing more.
|
|
26
|
-
const isApiRouteMethod = (value) => typeof value === "string" && API_ROUTE_METHODS.includes(value);
|
|
27
|
+
export const isApiRouteMethod = (value) => typeof value === "string" && API_ROUTE_METHODS.includes(value);
|
|
27
28
|
// Fixed, anchored, one character class each, so linear on any input. A
|
|
28
29
|
// parameter's name starts with a letter and holds no "-" or ".", which the
|
|
29
30
|
// router reads as the start of a static part inside a parameter segment.
|
|
@@ -160,3 +161,38 @@ export function checkApiRouteActions(manifest) {
|
|
|
160
161
|
});
|
|
161
162
|
return issues;
|
|
162
163
|
}
|
|
164
|
+
/** The `:name` parameters of a route path, in order. The one segment parser the
|
|
165
|
+
* SDK's `schema.params` rule and the path rule share. */
|
|
166
|
+
export function apiRoutePathParams(path) {
|
|
167
|
+
return path
|
|
168
|
+
.split("/")
|
|
169
|
+
.filter((segment) => segment.startsWith(":"))
|
|
170
|
+
.map((segment) => segment.slice(1));
|
|
171
|
+
}
|
|
172
|
+
/** S311 (S295): the method and tier of every apiRoute, as the SDK's enums
|
|
173
|
+
* enforce them, for the gate that never sees Zod. checkApiRouteDeclarations
|
|
174
|
+
* skips an entry whose method is not in the list because "the schema reports
|
|
175
|
+
* it"; the door has no such schema, so `"get"` published. An absent `access` is
|
|
176
|
+
* the documented default and stays valid; an unknown string is an error. */
|
|
177
|
+
export function checkApiRouteTiers(manifest) {
|
|
178
|
+
const contributions = manifest.contributions;
|
|
179
|
+
const routes = contributions !== null && typeof contributions === "object" ? contributions.apiRoutes : undefined;
|
|
180
|
+
if (!Array.isArray(routes))
|
|
181
|
+
return [];
|
|
182
|
+
const issues = [];
|
|
183
|
+
routes.forEach((entry, index) => {
|
|
184
|
+
const base = ["contributions", "apiRoutes", index];
|
|
185
|
+
if (entry === null || typeof entry !== "object" || Array.isArray(entry)) {
|
|
186
|
+
issues.push({ path: base, message: "an apiRoute must be an object" });
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
const route = entry;
|
|
190
|
+
if (!isApiRouteMethod(route.method)) {
|
|
191
|
+
issues.push({ path: [...base, "method"], message: `method must be one of ${API_ROUTE_METHODS.join(", ")}, got ${JSON.stringify(route.method)}` });
|
|
192
|
+
}
|
|
193
|
+
if (route.access !== undefined && !API_ROUTE_ACCESS_TIERS.includes(route.access)) {
|
|
194
|
+
issues.push({ path: [...base, "access"], message: `access must be one of ${API_ROUTE_ACCESS_TIERS.join(", ")}, got ${JSON.stringify(route.access)}` });
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
return issues;
|
|
198
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { PLUGIN_ID_MAX } from "./plugin-id-rules.js";
|
|
3
|
+
import { type DeclarationIssue } from "./plugin-template-payload.js";
|
|
4
|
+
export { PLUGIN_ID_MAX };
|
|
5
|
+
/** The longest version a manifest may declare (S311 second code fix): short
|
|
6
|
+
* enough that every name a version becomes part of fits in FILE_NAME_MAX
|
|
7
|
+
* beside the longest id. The longest of them is the starter download's
|
|
8
|
+
* "<id>-<version>-starter.zip": 255 - 128 (PLUGIN_ID_MAX) - 1 ("-") - 12
|
|
9
|
+
* ("-starter.zip") = 114, room for ordinary build metadata such as
|
|
10
|
+
* "1.0.0+21AF26D3----117B344092BD". The others are shorter: "<id>-<version>.zip.sig" and
|
|
11
|
+
* "<id>-<version>.zip" (pack's archive and the downloads), and on disk the
|
|
12
|
+
* marketplace's "<version>-starter.zip", "<version>.tar.gz.sig" and
|
|
13
|
+
* "<version>.tar.gz" and the server's "<id>/<version>" folder. */
|
|
14
|
+
export declare const PLUGIN_VERSION_MAX: number;
|
|
15
|
+
/** The longest plugin name a listing shows. */
|
|
16
|
+
export declare const PLUGIN_NAME_MAX = 120;
|
|
17
|
+
/** The longest description a listing shows. */
|
|
18
|
+
export declare const PLUGIN_DESCRIPTION_MAX = 2000;
|
|
19
|
+
/** The longest author a listing shows. */
|
|
20
|
+
export declare const PLUGIN_AUTHOR_MAX = 200;
|
|
21
|
+
/** The longest licence text. */
|
|
22
|
+
export declare const PLUGIN_LICENSE_MAX = 100;
|
|
23
|
+
/** The longest CMS version range. */
|
|
24
|
+
export declare const PLUGIN_CMS_VERSION_MAX = 100;
|
|
25
|
+
export declare const PLUGIN_ID_MESSAGE = "must be a reverse-domain id like com.vendor.plugin: every segment is lowercase, starts with a letter, and uses only a-z, 0-9 and hyphens";
|
|
26
|
+
export declare const PLUGIN_ID_SEGMENTS_MESSAGE: string;
|
|
27
|
+
export declare const PLUGIN_VERSION_MESSAGE: string;
|
|
28
|
+
/** Whether `value` is a SemVer 2.0.0 version (MAJOR.MINOR.PATCH, an optional
|
|
29
|
+
* `-prerelease` and `+build`, no `v` prefix, no spaces) of at most
|
|
30
|
+
* PLUGIN_VERSION_MAX characters. The length is checked first, then the text
|
|
31
|
+
* is split at its first `+` and its first `-` and each part read on its own,
|
|
32
|
+
* so the work is linear in a length that is already bounded. */
|
|
33
|
+
export declare function isPluginVersion(value: string): boolean;
|
|
34
|
+
/** A manifest's own id: at most PLUGIN_ID_MAX characters, the reverse-domain
|
|
35
|
+
* rule, and at most MANIFEST_ID_SEGMENT_MAX segments. Also the rule for the
|
|
36
|
+
* ids of other plugins a manifest names (bundled plugins, dependencies),
|
|
37
|
+
* since each of those is some plugin's own id. */
|
|
38
|
+
export declare const PluginManifestIdSchema: z.ZodString;
|
|
39
|
+
export declare const PluginVersionSchema: z.ZodString;
|
|
40
|
+
export declare const PluginNameSchema: z.ZodString;
|
|
41
|
+
export declare const PluginDescriptionSchema: z.ZodString;
|
|
42
|
+
export declare const PluginAuthorSchema: z.ZodString;
|
|
43
|
+
export declare const PluginLicenseSchema: z.ZodString;
|
|
44
|
+
export declare const PluginCmsVersionSchema: z.ZodString;
|
|
45
|
+
/** The identity and listing fields of a manifest, as one shape: the SDK's
|
|
46
|
+
* manifest schema and the door's shape rule each spread it into theirs. */
|
|
47
|
+
export declare const pluginManifestFields: {
|
|
48
|
+
id: z.ZodString;
|
|
49
|
+
version: z.ZodString;
|
|
50
|
+
name: z.ZodString;
|
|
51
|
+
description: z.ZodString;
|
|
52
|
+
author: z.ZodString;
|
|
53
|
+
license: z.ZodString;
|
|
54
|
+
cmsVersion: z.ZodString;
|
|
55
|
+
};
|
|
56
|
+
/** The fields a listing row is written from, by the rules above, for the
|
|
57
|
+
* upload, which writes the row before validation reads the package: each
|
|
58
|
+
* field it refuses, with the rule's message. An absent author is left out
|
|
59
|
+
* (the listing names the publisher instead). */
|
|
60
|
+
export declare function checkPluginListingFields(fields: {
|
|
61
|
+
name: unknown;
|
|
62
|
+
description: unknown;
|
|
63
|
+
author?: unknown;
|
|
64
|
+
}): DeclarationIssue[];
|