@kardalum/plugin-sdk 0.17.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.
Files changed (174) hide show
  1. package/CHANGELOG.md +67 -0
  2. package/README.md +4 -3
  3. package/dist/assets/asset-picker.d.ts +11 -0
  4. package/dist/assets/asset-picker.js +109 -0
  5. package/dist/assets/asset-tree.d.ts +30 -0
  6. package/dist/assets/asset-tree.js +150 -0
  7. package/dist/built-in-editor-ids.d.ts +1 -0
  8. package/dist/built-in-editor-ids.js +20 -0
  9. package/dist/built-in-settings-schemas.d.ts +2 -0
  10. package/dist/built-in-settings-schemas.js +27 -0
  11. package/dist/built-in-value-schemas.js +3 -0
  12. package/dist/built-ins.js +10 -1
  13. package/dist/capabilities.js +5 -0
  14. package/dist/datatype-validation.js +18 -4
  15. package/dist/datatypes-entry.d.ts +1 -0
  16. package/dist/datatypes-entry.js +1 -0
  17. package/dist/entitlement-entry.d.ts +3 -2
  18. package/dist/entitlement-entry.js +13 -1
  19. package/dist/entitlement-gate.d.ts +18 -0
  20. package/dist/entitlement-gate.js +95 -21
  21. package/dist/entitlement-plan.d.ts +21 -0
  22. package/dist/entitlement-plan.js +26 -0
  23. package/dist/entitlement-types.d.ts +21 -4
  24. package/dist/entitlement.d.ts +29 -1
  25. package/dist/entitlement.js +39 -0
  26. package/dist/grid-arrow-step.d.ts +7 -0
  27. package/dist/grid-arrow-step.js +20 -0
  28. package/dist/index.d.ts +6 -1
  29. package/dist/index.js +7 -12
  30. package/dist/manifest-entry.d.ts +4 -0
  31. package/dist/manifest-entry.js +4 -0
  32. package/dist/manifest-schema.d.ts +5 -1
  33. package/dist/manifest-schema.js +7 -1
  34. package/dist/manifest.d.ts +21 -1
  35. package/dist/media/media-picker.js +32 -32
  36. package/dist/notify.d.ts +17 -0
  37. package/dist/notify.js +17 -0
  38. package/dist/richtext/block-panel.js +17 -18
  39. package/dist/richtext/extensions.js +10 -1
  40. package/dist/richtext/insert-menu.js +1 -1
  41. package/dist/richtext/kardalum-block.js +17 -17
  42. package/dist/richtext/style-listbox.js +1 -1
  43. package/dist/richtext-html-entry.d.ts +35 -0
  44. package/dist/richtext-html-entry.js +73 -0
  45. package/dist/structured-storage-types.d.ts +11 -0
  46. package/dist/tailwind.js +10 -3
  47. package/dist/tokens/tailwind-theme.css +176 -0
  48. package/dist/tokens/tokens.css +1 -0
  49. package/dist/tokens/tokens.json +2 -1
  50. package/dist/vendor-check.d.ts +39 -0
  51. package/dist/vendor-check.js +79 -0
  52. package/dist/vendor-entry.d.ts +3 -0
  53. package/dist/vendor-entry.js +9 -0
  54. package/dist/vendor-service.d.ts +20 -0
  55. package/dist/vendor-service.js +20 -0
  56. package/dist/views/asset-view.d.ts +6 -0
  57. package/dist/views/asset-view.js +55 -0
  58. package/dist/views/content-list-settings-view.js +1 -1
  59. package/dist/views/content-list-view.js +1 -1
  60. package/dist/views/html-code-editor.js +0 -1
  61. package/dist/views/image-view.js +1 -1
  62. package/dist/views/rich-text-view.js +30 -30
  63. package/node_modules/@kardalum/api-schemas/README.md +1 -1
  64. package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.js +16 -14
  65. package/node_modules/@kardalum/api-schemas/dist/asset-field.schema.d.ts +21 -0
  66. package/node_modules/@kardalum/api-schemas/dist/asset-field.schema.js +42 -0
  67. package/node_modules/@kardalum/api-schemas/dist/asset.schema.d.ts +1 -0
  68. package/node_modules/@kardalum/api-schemas/dist/asset.schema.js +10 -3
  69. package/node_modules/@kardalum/api-schemas/dist/checkout-shown.schema.d.ts +36 -0
  70. package/node_modules/@kardalum/api-schemas/dist/checkout-shown.schema.js +46 -0
  71. package/node_modules/@kardalum/api-schemas/dist/content-api.schema.d.ts +12 -0
  72. package/node_modules/@kardalum/api-schemas/dist/content-api.schema.js +16 -1
  73. package/node_modules/@kardalum/api-schemas/dist/core-actions.d.ts +12 -6
  74. package/node_modules/@kardalum/api-schemas/dist/core-actions.js +11 -6
  75. package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.d.ts +50 -0
  76. package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.js +25 -5
  77. package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.d.ts +1 -0
  78. package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.js +3 -0
  79. package/node_modules/@kardalum/api-schemas/dist/data-type-cursor.d.ts +11 -0
  80. package/node_modules/@kardalum/api-schemas/dist/data-type-cursor.js +28 -0
  81. package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +42 -2
  82. package/node_modules/@kardalum/api-schemas/dist/home.schema.d.ts +130 -0
  83. package/node_modules/@kardalum/api-schemas/dist/home.schema.js +87 -0
  84. package/node_modules/@kardalum/api-schemas/dist/index.d.ts +41 -15
  85. package/node_modules/@kardalum/api-schemas/dist/index.js +30 -10
  86. package/node_modules/@kardalum/api-schemas/dist/kardalum-latest.schema.d.ts +7 -0
  87. package/node_modules/@kardalum/api-schemas/dist/kardalum-latest.schema.js +9 -0
  88. package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.d.ts +115 -1
  89. package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +102 -1
  90. package/node_modules/@kardalum/api-schemas/dist/marketplace-package-api.schema.d.ts +17 -0
  91. package/node_modules/@kardalum/api-schemas/dist/marketplace-package-api.schema.js +16 -0
  92. package/node_modules/@kardalum/api-schemas/dist/media-api.schema.d.ts +26 -0
  93. package/node_modules/@kardalum/api-schemas/dist/media-api.schema.js +6 -0
  94. package/node_modules/@kardalum/api-schemas/dist/media-reference-use.d.ts +10 -0
  95. package/node_modules/@kardalum/api-schemas/dist/media-reference-use.js +4 -4
  96. package/node_modules/@kardalum/api-schemas/dist/news.schema.d.ts +93 -0
  97. package/node_modules/@kardalum/api-schemas/dist/news.schema.js +86 -0
  98. package/node_modules/@kardalum/api-schemas/dist/node-access.schema.js +13 -0
  99. package/node_modules/@kardalum/api-schemas/dist/notification.schema.d.ts +410 -0
  100. package/node_modules/@kardalum/api-schemas/dist/notification.schema.js +193 -0
  101. package/node_modules/@kardalum/api-schemas/dist/plan-editor.schema.d.ts +86 -0
  102. package/node_modules/@kardalum/api-schemas/dist/plan-editor.schema.js +92 -0
  103. package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.d.ts +7 -2
  104. package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.js +7 -0
  105. package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.d.ts +227 -0
  106. package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +157 -31
  107. package/node_modules/@kardalum/api-schemas/dist/plugin-read-only.schema.d.ts +19 -0
  108. package/node_modules/@kardalum/api-schemas/dist/plugin-read-only.schema.js +33 -0
  109. package/node_modules/@kardalum/api-schemas/dist/plugin-template-payload.d.ts +10 -1
  110. package/node_modules/@kardalum/api-schemas/dist/plugin-template-payload.js +24 -4
  111. package/node_modules/@kardalum/api-schemas/dist/public-api.schema.d.ts +5 -0
  112. package/node_modules/@kardalum/api-schemas/dist/public-api.schema.js +23 -20
  113. package/node_modules/@kardalum/api-schemas/dist/revenue-view.schema.d.ts +83 -0
  114. package/node_modules/@kardalum/api-schemas/dist/revenue-view.schema.js +73 -0
  115. package/node_modules/@kardalum/api-schemas/dist/sites.schema.d.ts +14 -0
  116. package/node_modules/@kardalum/api-schemas/dist/sites.schema.js +7 -0
  117. package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.d.ts +3 -3
  118. package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.d.ts +1 -1
  119. package/node_modules/@kardalum/api-schemas/dist/template-api.schema.d.ts +10 -0
  120. package/node_modules/@kardalum/api-schemas/dist/template-api.schema.js +26 -11
  121. package/node_modules/@kardalum/api-schemas/dist/template.schema.d.ts +7 -0
  122. package/node_modules/@kardalum/api-schemas/dist/template.schema.js +22 -10
  123. package/node_modules/@kardalum/api-schemas/dist/user-api.schema.d.ts +12 -0
  124. package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +5 -0
  125. package/node_modules/@kardalum/api-schemas/dist/uuid.schema.d.ts +2 -0
  126. package/node_modules/@kardalum/api-schemas/dist/uuid.schema.js +4 -0
  127. package/node_modules/@kardalum/api-schemas/dist/vendor-service.schema.d.ts +88 -0
  128. package/node_modules/@kardalum/api-schemas/dist/vendor-service.schema.js +100 -0
  129. package/node_modules/@kardalum/api-schemas/dist/whoami-api.schema.d.ts +13 -0
  130. package/node_modules/@kardalum/api-schemas/dist/whoami-api.schema.js +5 -0
  131. package/node_modules/@kardalum/design-tokens/README.md +1 -1
  132. package/node_modules/@kardalum/design-tokens/dist/build-theme-css.d.ts +16 -0
  133. package/node_modules/@kardalum/design-tokens/dist/build-theme-css.js +76 -0
  134. package/node_modules/@kardalum/design-tokens/dist/generate.js +4 -1
  135. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.css +176 -0
  136. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.d.ts +1 -1
  137. package/node_modules/@kardalum/design-tokens/dist/tokens.css +1 -0
  138. package/node_modules/@kardalum/design-tokens/dist/tokens.js +1 -0
  139. package/node_modules/@kardalum/design-tokens/dist/tokens.json +2 -1
  140. package/node_modules/@kardalum/design-tokens/dist/types.d.ts +1 -0
  141. package/node_modules/@kardalum/design-tokens/package.json +6 -3
  142. package/node_modules/@kardalum/plugin-package/README.md +1 -1
  143. package/node_modules/@kardalum/plugin-package/dist/capabilities.d.ts +4 -4
  144. package/node_modules/@kardalum/plugin-package/dist/capabilities.js +54 -6
  145. package/node_modules/@kardalum/plugin-package/dist/delivery/bundle.js +1 -1
  146. package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.d.ts +3 -0
  147. package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.js +18 -1
  148. package/node_modules/@kardalum/plugin-package/dist/delivery/limits.d.ts +1 -1
  149. package/node_modules/@kardalum/plugin-package/dist/delivery/limits.js +1 -1
  150. package/node_modules/@kardalum/plugin-package/dist/delivery/registry.js +8 -4
  151. package/node_modules/@kardalum/plugin-package/dist/delivery/templates.d.ts +1 -0
  152. package/node_modules/@kardalum/plugin-package/dist/delivery/templates.js +58 -1
  153. package/node_modules/@kardalum/plugin-package/dist/extract.js +1 -1
  154. package/node_modules/@kardalum/plugin-package/dist/index.d.ts +4 -2
  155. package/node_modules/@kardalum/plugin-package/dist/index.js +3 -1
  156. package/node_modules/@kardalum/plugin-package/dist/license-verdict.d.ts +56 -19
  157. package/node_modules/@kardalum/plugin-package/dist/license-verdict.js +119 -25
  158. package/node_modules/@kardalum/plugin-package/dist/vendor-token.d.ts +24 -0
  159. package/node_modules/@kardalum/plugin-package/dist/vendor-token.js +118 -0
  160. package/node_modules/@kardalum/ui/README.md +1 -1
  161. package/node_modules/@kardalum/ui/dist/components/button.js +1 -1
  162. package/node_modules/@kardalum/ui/dist/components/checkbox.js +1 -1
  163. package/node_modules/@kardalum/ui/dist/components/dialog.js +5 -2
  164. package/node_modules/@kardalum/ui/dist/components/dropdown-menu.js +2 -2
  165. package/node_modules/@kardalum/ui/dist/components/input.js +1 -1
  166. package/node_modules/@kardalum/ui/dist/components/popover-panel.d.ts +4 -0
  167. package/node_modules/@kardalum/ui/dist/components/popover-panel.js +13 -0
  168. package/node_modules/@kardalum/ui/dist/components/sheet.js +5 -4
  169. package/node_modules/@kardalum/ui/dist/components/switch.js +1 -1
  170. package/node_modules/@kardalum/ui/dist/components/tab-strip.js +1 -1
  171. package/node_modules/@kardalum/ui/dist/components/toast.js +1 -1
  172. package/node_modules/@kardalum/ui/dist/index.d.ts +1 -0
  173. package/node_modules/@kardalum/ui/dist/index.js +1 -0
  174. package/package.json +17 -4
@@ -0,0 +1,86 @@
1
+ import { z } from "zod";
2
+ export declare const PLAN_KEY_MAX = 64;
3
+ export declare const PLAN_NAME_MAX = 200;
4
+ export declare const PLAN_DESCRIPTION_MAX = 2000;
5
+ /** $1 floor (Stripe's charge minimum with margin) and a $10,000 sanity cap. */
6
+ export declare const PLAN_MIN_PRICE_CENTS = 100;
7
+ export declare const PLAN_MAX_PRICE_CENTS = 1000000;
8
+ export declare const PLAN_SHAPE_VALUES: readonly ["free", "one_time", "monthly", "yearly"];
9
+ export type PlanShapeValue = (typeof PLAN_SHAPE_VALUES)[number];
10
+ /**
11
+ * A plan key: 1 to 64 characters, lowercase ASCII letters, digits and single
12
+ * hyphens, starting with a letter and ending with a letter or digit. A linear
13
+ * scan with the length checked first, never a regex (untrusted text).
14
+ */
15
+ export declare function isPlanKey(value: string): boolean;
16
+ /** S315 section 3a: a free plan costs 0, every other shape whole cents from $1 to $10,000. */
17
+ export declare function planPriceAgrees(shape: string, priceCents: number): boolean;
18
+ export declare const PlanKeySchema: z.ZodString;
19
+ export declare const PlanNameSchema: z.ZodString;
20
+ export declare const PlanDescriptionSchema: z.ZodString;
21
+ export declare const PlanShapeSchema: z.ZodEnum<{
22
+ free: "free";
23
+ one_time: "one_time";
24
+ monthly: "monthly";
25
+ yearly: "yearly";
26
+ }>;
27
+ export declare const PlanAddInputSchema: z.ZodObject<{
28
+ listingId: z.ZodString;
29
+ key: z.ZodString;
30
+ name: z.ZodString;
31
+ description: z.ZodString;
32
+ shape: z.ZodEnum<{
33
+ free: "free";
34
+ one_time: "one_time";
35
+ monthly: "monthly";
36
+ yearly: "yearly";
37
+ }>;
38
+ priceCents: z.ZodNumber;
39
+ }, z.core.$strict>;
40
+ export type PlanAddInput = z.infer<typeof PlanAddInputSchema>;
41
+ /** Name and description always; key, shape and price only while the plan was never held (D4, S315 D8). */
42
+ export declare const PlanEditInputSchema: z.ZodObject<{
43
+ planId: z.ZodString;
44
+ name: z.ZodString;
45
+ description: z.ZodString;
46
+ key: z.ZodOptional<z.ZodString>;
47
+ shape: z.ZodOptional<z.ZodEnum<{
48
+ free: "free";
49
+ one_time: "one_time";
50
+ monthly: "monthly";
51
+ yearly: "yearly";
52
+ }>>;
53
+ priceCents: z.ZodOptional<z.ZodNumber>;
54
+ }, z.core.$strict>;
55
+ export type PlanEditInput = z.infer<typeof PlanEditInputSchema>;
56
+ export declare const PlanRefInputSchema: z.ZodObject<{
57
+ planId: z.ZodString;
58
+ }, z.core.$strict>;
59
+ export type PlanRefInput = z.infer<typeof PlanRefInputSchema>;
60
+ export declare const PlanMoveInputSchema: z.ZodObject<{
61
+ planId: z.ZodString;
62
+ direction: z.ZodEnum<{
63
+ up: "up";
64
+ down: "down";
65
+ }>;
66
+ }, z.core.$strict>;
67
+ export type PlanMoveInput = z.infer<typeof PlanMoveInputSchema>;
68
+ export declare const PlanPriceInputSchema: z.ZodObject<{
69
+ planId: z.ZodString;
70
+ priceCents: z.ZodNumber;
71
+ }, z.core.$strict>;
72
+ export type PlanPriceInput = z.infer<typeof PlanPriceInputSchema>;
73
+ /** S321c (spec 3c): a price change's background notices as the plans page
74
+ * reads them. While the sweep runs, `waiting` counts the subscribers not
75
+ * reached yet and those whose email has not gone out; after the walk, only
76
+ * the latter. `walking` while the walk has subscribers left to reach (the
77
+ * page reads its progress again only then); `finished` once every subscriber
78
+ * was told. */
79
+ export declare const PriceSweepProgressSchema: z.ZodObject<{
80
+ total: z.ZodNumber;
81
+ told: z.ZodNumber;
82
+ waiting: z.ZodNumber;
83
+ walking: z.ZodBoolean;
84
+ finished: z.ZodBoolean;
85
+ }, z.core.$strict>;
86
+ export type PriceSweepProgress = z.infer<typeof PriceSweepProgressSchema>;
@@ -0,0 +1,92 @@
1
+ import { z } from "zod";
2
+ // S321 (spec 3b, D4; S315 section 3a): what the author's plans editor sends.
3
+ // The plan key is what a plugin reads as planId (S317) and what the vendor
4
+ // token carries (S320), so its caps live here and vendor-service.schema.ts
5
+ // reads them: a longer key or name could never be signed.
6
+ export const PLAN_KEY_MAX = 64;
7
+ export const PLAN_NAME_MAX = 200;
8
+ export const PLAN_DESCRIPTION_MAX = 2000;
9
+ /** $1 floor (Stripe's charge minimum with margin) and a $10,000 sanity cap. */
10
+ export const PLAN_MIN_PRICE_CENTS = 100;
11
+ export const PLAN_MAX_PRICE_CENTS = 1_000_000;
12
+ export const PLAN_SHAPE_VALUES = ["free", "one_time", "monthly", "yearly"];
13
+ /**
14
+ * A plan key: 1 to 64 characters, lowercase ASCII letters, digits and single
15
+ * hyphens, starting with a letter and ending with a letter or digit. A linear
16
+ * scan with the length checked first, never a regex (untrusted text).
17
+ */
18
+ export function isPlanKey(value) {
19
+ if (value.length < 1 || value.length > PLAN_KEY_MAX)
20
+ return false;
21
+ for (let i = 0; i < value.length; i++) {
22
+ const c = value.charCodeAt(i);
23
+ const lower = c >= 97 && c <= 122;
24
+ const digit = c >= 48 && c <= 57;
25
+ const hyphen = c === 45;
26
+ if (i === 0 && !lower)
27
+ return false;
28
+ if (!lower && !digit && !hyphen)
29
+ return false;
30
+ if (hyphen && (i === value.length - 1 || value.charCodeAt(i + 1) === 45))
31
+ return false;
32
+ }
33
+ return true;
34
+ }
35
+ /** S315 section 3a: a free plan costs 0, every other shape whole cents from $1 to $10,000. */
36
+ export function planPriceAgrees(shape, priceCents) {
37
+ if (!Number.isInteger(priceCents))
38
+ return false;
39
+ if (shape === "free")
40
+ return priceCents === 0;
41
+ return priceCents >= PLAN_MIN_PRICE_CENTS && priceCents <= PLAN_MAX_PRICE_CENTS;
42
+ }
43
+ const PRICE_SHAPE_MESSAGE = "A free plan costs 0; any other plan costs from $1.00 to $10,000.00";
44
+ // A listing or plan id is never validated beyond its length: a wrong one
45
+ // reads as "not found" from the owner-scoped query, like someone else's.
46
+ const RowIdSchema = z.string().min(1).max(64);
47
+ export const PlanKeySchema = z
48
+ .string()
49
+ .max(PLAN_KEY_MAX, `A plan key is at most ${PLAN_KEY_MAX} characters`)
50
+ .refine(isPlanKey, "A plan key uses lowercase letters, digits and single hyphens, starts with a letter and ends with a letter or digit");
51
+ export const PlanNameSchema = z.string().trim().min(1, "Give the plan a name").max(PLAN_NAME_MAX, `A plan name is at most ${PLAN_NAME_MAX} characters`);
52
+ export const PlanDescriptionSchema = z.string().trim().max(PLAN_DESCRIPTION_MAX, `A plan description is at most ${PLAN_DESCRIPTION_MAX} characters`);
53
+ export const PlanShapeSchema = z.enum(PLAN_SHAPE_VALUES, "Choose free, one-time, monthly or yearly");
54
+ const PlanCentsSchema = z.number().int().min(0).max(PLAN_MAX_PRICE_CENTS, "Maximum price is $10,000.00");
55
+ export const PlanAddInputSchema = z
56
+ .object({ listingId: RowIdSchema, key: PlanKeySchema, name: PlanNameSchema, description: PlanDescriptionSchema, shape: PlanShapeSchema, priceCents: PlanCentsSchema })
57
+ .strict()
58
+ .refine((input) => planPriceAgrees(input.shape, input.priceCents), { message: PRICE_SHAPE_MESSAGE, path: ["priceCents"] });
59
+ /** Name and description always; key, shape and price only while the plan was never held (D4, S315 D8). */
60
+ export const PlanEditInputSchema = z
61
+ .object({
62
+ planId: RowIdSchema,
63
+ name: PlanNameSchema,
64
+ description: PlanDescriptionSchema,
65
+ key: PlanKeySchema.optional(),
66
+ shape: PlanShapeSchema.optional(),
67
+ priceCents: PlanCentsSchema.optional(),
68
+ })
69
+ .strict();
70
+ export const PlanRefInputSchema = z.object({ planId: RowIdSchema }).strict();
71
+ export const PlanMoveInputSchema = z.object({ planId: RowIdSchema, direction: z.enum(["up", "down"]) }).strict();
72
+ export const PlanPriceInputSchema = z
73
+ .object({
74
+ planId: RowIdSchema,
75
+ priceCents: z.number().int().min(PLAN_MIN_PRICE_CENTS, "A paid plan costs at least $1.00").max(PLAN_MAX_PRICE_CENTS, "Maximum price is $10,000.00"),
76
+ })
77
+ .strict();
78
+ /** S321c (spec 3c): a price change's background notices as the plans page
79
+ * reads them. While the sweep runs, `waiting` counts the subscribers not
80
+ * reached yet and those whose email has not gone out; after the walk, only
81
+ * the latter. `walking` while the walk has subscribers left to reach (the
82
+ * page reads its progress again only then); `finished` once every subscriber
83
+ * was told. */
84
+ export const PriceSweepProgressSchema = z
85
+ .object({
86
+ total: z.number().int().nonnegative(),
87
+ told: z.number().int().nonnegative(),
88
+ waiting: z.number().int().nonnegative(),
89
+ walking: z.boolean(),
90
+ finished: z.boolean(),
91
+ })
92
+ .strict();
@@ -63,6 +63,11 @@ export declare const PluginDocsPluginParamsSchema: z.ZodObject<{
63
63
  pluginId: z.ZodString;
64
64
  }, z.core.$strip>;
65
65
  export type PluginDocsPluginParams = z.infer<typeof PluginDocsPluginParamsSchema>;
66
+ export declare const PluginDocsImageParamsSchema: z.ZodObject<{
67
+ pluginId: z.ZodString;
68
+ "*": z.ZodString;
69
+ }, z.core.$strip>;
70
+ export type PluginDocsImageParams = z.infer<typeof PluginDocsImageParamsSchema>;
66
71
  export declare const PluginDocsPageResponseSchema: z.ZodObject<{
67
72
  pluginId: z.ZodString;
68
73
  version: z.ZodString;
@@ -80,8 +85,8 @@ export declare const PluginDocsPageResponseSchema: z.ZodObject<{
80
85
  }, z.core.$strip>;
81
86
  export type PluginDocsPageResponse = z.infer<typeof PluginDocsPageResponseSchema>;
82
87
  export declare const PluginReferenceSourceSchema: z.ZodEnum<{
83
- package: "package";
84
88
  live: "live";
89
+ package: "package";
85
90
  }>;
86
91
  export type PluginReferenceSource = z.infer<typeof PluginReferenceSourceSchema>;
87
92
  /** S289: "live" is built from the manifest the server has attached; "package"
@@ -90,8 +95,8 @@ export declare const PluginDocsReferenceResponseSchema: z.ZodObject<{
90
95
  pluginId: z.ZodString;
91
96
  version: z.ZodString;
92
97
  source: z.ZodEnum<{
93
- package: "package";
94
98
  live: "live";
99
+ package: "package";
95
100
  }>;
96
101
  reference: z.ZodObject<{
97
102
  actions: z.ZodArray<z.ZodObject<{
@@ -1,5 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { PLUGIN_DOC_ROLES, PluginReferenceSchema } from "./plugin-docs.js";
3
+ import { MAX_DOCS_TARGET_LENGTH } from "./plugin-docs-text.js";
3
4
  // S287. The shapes of the four JSON routes the server serves to the admin:
4
5
  // the docs index, one page, the reference tables and the search index.
5
6
  export const PluginDocsPageRefSchema = z.object({
@@ -26,6 +27,12 @@ export const PluginDocsPageParamsSchema = z.object({
26
27
  export const PluginDocsPluginParamsSchema = z.object({
27
28
  pluginId: z.string().min(1),
28
29
  });
30
+ // S314c3 (D2): GET /plugin-docs/:pluginId/images/*, an image of the stored package by its package
31
+ // path (the `*` param, as Fastify names a wildcard).
32
+ export const PluginDocsImageParamsSchema = z.object({
33
+ pluginId: z.string().min(1),
34
+ "*": z.string().min(1).max(MAX_DOCS_TARGET_LENGTH),
35
+ });
29
36
  export const PluginDocsPageResponseSchema = z.object({
30
37
  pluginId: z.string(),
31
38
  version: z.string(),
@@ -21,6 +21,15 @@ export declare const PluginTamperKindSchema: z.ZodEnum<{
21
21
  export type PluginTamperKind = z.infer<typeof PluginTamperKindSchema>;
22
22
  export declare const ManagedPluginSchema: z.ZodObject<{
23
23
  pluginId: z.ZodString;
24
+ readOnly: z.ZodOptional<z.ZodObject<{
25
+ code: z.ZodLiteral<"plugin_read_only">;
26
+ pluginId: z.ZodString;
27
+ pluginName: z.ZodString;
28
+ canRenew: z.ZodBoolean;
29
+ message: z.ZodString;
30
+ renewUrl: z.ZodOptional<z.ZodString>;
31
+ lapsedAt: z.ZodOptional<z.ZodString>;
32
+ }, z.core.$strip>>;
24
33
  name: z.ZodString;
25
34
  type: z.ZodString;
26
35
  version: z.ZodString;
@@ -48,6 +57,14 @@ export declare const ManagedPluginSchema: z.ZodObject<{
48
57
  }>>;
49
58
  licenseLocked: z.ZodBoolean;
50
59
  buyHref: z.ZodNullable<z.ZodString>;
60
+ licensePlan: z.ZodOptional<z.ZodObject<{
61
+ key: z.ZodString;
62
+ name: z.ZodNullable<z.ZodString>;
63
+ bundle: z.ZodOptional<z.ZodObject<{
64
+ pluginId: z.ZodString;
65
+ name: z.ZodString;
66
+ }, z.core.$strip>>;
67
+ }, z.core.$strip>>;
51
68
  roleOffers: z.ZodArray<z.ZodObject<{
52
69
  id: z.ZodString;
53
70
  label: z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
@@ -59,6 +76,8 @@ export declare const ManagedPluginSchema: z.ZodObject<{
59
76
  grantedRoleCount: z.ZodNumber;
60
77
  updateAvailable: z.ZodNullable<z.ZodObject<{
61
78
  version: z.ZodString;
79
+ renewToUpdate: z.ZodOptional<z.ZodLiteral<true>>;
80
+ renewHref: z.ZodOptional<z.ZodString>;
62
81
  }, z.core.$strip>>;
63
82
  }, z.core.$strip>;
64
83
  export type ManagedPlugin = z.infer<typeof ManagedPluginSchema>;
@@ -69,6 +88,15 @@ export declare const ManagedPluginListQuerySchema: z.ZodObject<{
69
88
  export declare const ManagedPluginListResponseSchema: z.ZodObject<{
70
89
  items: z.ZodArray<z.ZodObject<{
71
90
  pluginId: z.ZodString;
91
+ readOnly: z.ZodOptional<z.ZodObject<{
92
+ code: z.ZodLiteral<"plugin_read_only">;
93
+ pluginId: z.ZodString;
94
+ pluginName: z.ZodString;
95
+ canRenew: z.ZodBoolean;
96
+ message: z.ZodString;
97
+ renewUrl: z.ZodOptional<z.ZodString>;
98
+ lapsedAt: z.ZodOptional<z.ZodString>;
99
+ }, z.core.$strip>>;
72
100
  name: z.ZodString;
73
101
  type: z.ZodString;
74
102
  version: z.ZodString;
@@ -96,6 +124,14 @@ export declare const ManagedPluginListResponseSchema: z.ZodObject<{
96
124
  }>>;
97
125
  licenseLocked: z.ZodBoolean;
98
126
  buyHref: z.ZodNullable<z.ZodString>;
127
+ licensePlan: z.ZodOptional<z.ZodObject<{
128
+ key: z.ZodString;
129
+ name: z.ZodNullable<z.ZodString>;
130
+ bundle: z.ZodOptional<z.ZodObject<{
131
+ pluginId: z.ZodString;
132
+ name: z.ZodString;
133
+ }, z.core.$strip>>;
134
+ }, z.core.$strip>>;
99
135
  roleOffers: z.ZodArray<z.ZodObject<{
100
136
  id: z.ZodString;
101
137
  label: z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
@@ -107,6 +143,8 @@ export declare const ManagedPluginListResponseSchema: z.ZodObject<{
107
143
  grantedRoleCount: z.ZodNumber;
108
144
  updateAvailable: z.ZodNullable<z.ZodObject<{
109
145
  version: z.ZodString;
146
+ renewToUpdate: z.ZodOptional<z.ZodLiteral<true>>;
147
+ renewHref: z.ZodOptional<z.ZodString>;
110
148
  }, z.core.$strip>>;
111
149
  }, z.core.$strip>>;
112
150
  nextCursor: z.ZodNullable<z.ZodString>;
@@ -144,6 +182,8 @@ export declare const UninstallBlockedByDocumentTypesSchema: z.ZodObject<{
144
182
  export type UninstallBlockedByDocumentTypes = z.infer<typeof UninstallBlockedByDocumentTypesSchema>;
145
183
  export declare const UninstallSucceededSchema: z.ZodObject<{
146
184
  snapshotGroupId: z.ZodNullable<z.ZodString>;
185
+ dataTypesSnapshotGroupId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
186
+ removedDataTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
147
187
  }, z.core.$strip>;
148
188
  export type UninstallSucceeded = z.infer<typeof UninstallSucceededSchema>;
149
189
  export declare const BundleUninstallSucceededSchema: z.ZodObject<{
@@ -151,6 +191,12 @@ export declare const BundleUninstallSucceededSchema: z.ZodObject<{
151
191
  pluginId: z.ZodString;
152
192
  snapshotGroupId: z.ZodString;
153
193
  }, z.core.$strip>>;
194
+ removedDataTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
195
+ dataTypesSnapshots: z.ZodOptional<z.ZodArray<z.ZodObject<{
196
+ pluginId: z.ZodString;
197
+ snapshotGroupId: z.ZodString;
198
+ }, z.core.$strip>>>;
199
+ leftDataTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
154
200
  }, z.core.$strip>;
155
201
  export type BundleUninstallSucceeded = z.infer<typeof BundleUninstallSucceededSchema>;
156
202
  export declare const MarketplaceStatusResponseSchema: z.ZodObject<{
@@ -163,8 +209,21 @@ export declare const LicenseRecheckResponseSchema: z.ZodObject<{
163
209
  status: z.ZodNullable<z.ZodString>;
164
210
  reason: z.ZodNullable<z.ZodString>;
165
211
  lastValidatedAt: z.ZodNullable<z.ZodString>;
212
+ skipped: z.ZodOptional<z.ZodString>;
166
213
  }, z.core.$strip>;
167
214
  export type LicenseRecheckResponse = z.infer<typeof LicenseRecheckResponseSchema>;
215
+ export declare const LicenseVerdictTermSchema: z.ZodObject<{
216
+ state: z.ZodString;
217
+ endsAt: z.ZodNullable<z.ZodString>;
218
+ renewalAmountCents: z.ZodNullable<z.ZodNumber>;
219
+ cancelAtPeriodEnd: z.ZodBoolean;
220
+ }, z.core.$strip>;
221
+ export declare const ListingPlanSummarySchema: z.ZodObject<{
222
+ key: z.ZodString;
223
+ shape: z.ZodString;
224
+ priceCents: z.ZodNumber;
225
+ position: z.ZodNumber;
226
+ }, z.core.$strip>;
168
227
  export declare const LicenseVerdictEnvelopeSchema: z.ZodObject<{
169
228
  v: z.ZodLiteral<1>;
170
229
  alg: z.ZodLiteral<"ed25519">;
@@ -187,11 +246,24 @@ export declare const LicenseVerdictEnvelopeSchema: z.ZodObject<{
187
246
  "modified-on-disk": "modified-on-disk";
188
247
  }>>;
189
248
  detail: z.ZodOptional<z.ZodString>;
249
+ planId: z.ZodOptional<z.ZodString>;
250
+ term: z.ZodOptional<z.ZodObject<{
251
+ state: z.ZodString;
252
+ endsAt: z.ZodNullable<z.ZodString>;
253
+ renewalAmountCents: z.ZodNullable<z.ZodNumber>;
254
+ cancelAtPeriodEnd: z.ZodBoolean;
255
+ }, z.core.$strip>>;
190
256
  }, z.core.$strip>;
191
257
  export type LicenseVerdictEnvelopeWire = z.infer<typeof LicenseVerdictEnvelopeSchema>;
192
258
  export declare const EntitlementSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
193
259
  kind: z.ZodLiteral<"exempt">;
194
260
  reason: z.ZodLiteral<"non-production">;
261
+ listingPlans: z.ZodOptional<z.ZodArray<z.ZodObject<{
262
+ key: z.ZodString;
263
+ shape: z.ZodString;
264
+ priceCents: z.ZodNumber;
265
+ position: z.ZodNumber;
266
+ }, z.core.$strip>>>;
195
267
  }, z.core.$strip>, z.ZodObject<{
196
268
  kind: z.ZodLiteral<"verdict">;
197
269
  envelope: z.ZodObject<{
@@ -216,8 +288,16 @@ export declare const EntitlementSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
216
288
  "modified-on-disk": "modified-on-disk";
217
289
  }>>;
218
290
  detail: z.ZodOptional<z.ZodString>;
291
+ planId: z.ZodOptional<z.ZodString>;
292
+ term: z.ZodOptional<z.ZodObject<{
293
+ state: z.ZodString;
294
+ endsAt: z.ZodNullable<z.ZodString>;
295
+ renewalAmountCents: z.ZodNullable<z.ZodNumber>;
296
+ cancelAtPeriodEnd: z.ZodBoolean;
297
+ }, z.core.$strip>>;
219
298
  }, z.core.$strip>;
220
299
  signature: z.ZodString;
300
+ termSignature: z.ZodOptional<z.ZodString>;
221
301
  }, z.core.$strip>, z.ZodObject<{
222
302
  kind: z.ZodLiteral<"none">;
223
303
  }, z.core.$strip>], "kind">;
@@ -226,6 +306,12 @@ export declare const EntitlementResponseSchema: z.ZodObject<{
226
306
  entitlement: z.ZodDiscriminatedUnion<[z.ZodObject<{
227
307
  kind: z.ZodLiteral<"exempt">;
228
308
  reason: z.ZodLiteral<"non-production">;
309
+ listingPlans: z.ZodOptional<z.ZodArray<z.ZodObject<{
310
+ key: z.ZodString;
311
+ shape: z.ZodString;
312
+ priceCents: z.ZodNumber;
313
+ position: z.ZodNumber;
314
+ }, z.core.$strip>>>;
229
315
  }, z.core.$strip>, z.ZodObject<{
230
316
  kind: z.ZodLiteral<"verdict">;
231
317
  envelope: z.ZodObject<{
@@ -250,12 +336,29 @@ export declare const EntitlementResponseSchema: z.ZodObject<{
250
336
  "modified-on-disk": "modified-on-disk";
251
337
  }>>;
252
338
  detail: z.ZodOptional<z.ZodString>;
339
+ planId: z.ZodOptional<z.ZodString>;
340
+ term: z.ZodOptional<z.ZodObject<{
341
+ state: z.ZodString;
342
+ endsAt: z.ZodNullable<z.ZodString>;
343
+ renewalAmountCents: z.ZodNullable<z.ZodNumber>;
344
+ cancelAtPeriodEnd: z.ZodBoolean;
345
+ }, z.core.$strip>>;
253
346
  }, z.core.$strip>;
254
347
  signature: z.ZodString;
348
+ termSignature: z.ZodOptional<z.ZodString>;
255
349
  }, z.core.$strip>, z.ZodObject<{
256
350
  kind: z.ZodLiteral<"none">;
257
351
  }, z.core.$strip>], "kind">;
258
352
  valid: z.ZodBoolean;
353
+ readOnly: z.ZodOptional<z.ZodObject<{
354
+ code: z.ZodLiteral<"plugin_read_only">;
355
+ pluginId: z.ZodString;
356
+ pluginName: z.ZodString;
357
+ canRenew: z.ZodBoolean;
358
+ message: z.ZodString;
359
+ renewUrl: z.ZodOptional<z.ZodString>;
360
+ lapsedAt: z.ZodOptional<z.ZodString>;
361
+ }, z.core.$strip>>;
259
362
  }, z.core.$strip>;
260
363
  export type EntitlementResponse = z.infer<typeof EntitlementResponseSchema>;
261
364
  export declare const EntitlementRefusalSchema: z.ZodObject<{
@@ -328,6 +431,97 @@ export declare const RestoreBodySchema: z.ZodOptional<z.ZodNullable<z.ZodObject<
328
431
  confirmRestore: z.ZodOptional<z.ZodBoolean>;
329
432
  planHash: z.ZodOptional<z.ZodString>;
330
433
  }, z.core.$strip>>>;
434
+ export declare const DataTypeRestoreSkipReasonSchema: z.ZodEnum<{
435
+ "name-taken": "name-taken";
436
+ "id-exists": "id-exists";
437
+ "editor-missing": "editor-missing";
438
+ "editor-inactive": "editor-inactive";
439
+ "settings-invalid": "settings-invalid";
440
+ }>;
441
+ export type DataTypeRestoreSkipReason = z.infer<typeof DataTypeRestoreSkipReasonSchema>;
442
+ export declare const DataTypeRestoreEntrySchema: z.ZodObject<{
443
+ id: z.ZodString;
444
+ name: z.ZodString;
445
+ }, z.core.$strip>;
446
+ export type DataTypeRestoreEntry = z.infer<typeof DataTypeRestoreEntrySchema>;
447
+ export declare const DataTypeRestoreSkipSchema: z.ZodObject<{
448
+ id: z.ZodString;
449
+ name: z.ZodString;
450
+ reason: z.ZodEnum<{
451
+ "name-taken": "name-taken";
452
+ "id-exists": "id-exists";
453
+ "editor-missing": "editor-missing";
454
+ "editor-inactive": "editor-inactive";
455
+ "settings-invalid": "settings-invalid";
456
+ }>;
457
+ }, z.core.$strip>;
458
+ export type DataTypeRestoreSkip = z.infer<typeof DataTypeRestoreSkipSchema>;
459
+ export declare const DataTypeRestorePlanSchema: z.ZodObject<{
460
+ snapshotGroupId: z.ZodString;
461
+ restore: z.ZodArray<z.ZodObject<{
462
+ id: z.ZodString;
463
+ name: z.ZodString;
464
+ }, z.core.$strip>>;
465
+ skip: z.ZodArray<z.ZodObject<{
466
+ id: z.ZodString;
467
+ name: z.ZodString;
468
+ reason: z.ZodEnum<{
469
+ "name-taken": "name-taken";
470
+ "id-exists": "id-exists";
471
+ "editor-missing": "editor-missing";
472
+ "editor-inactive": "editor-inactive";
473
+ "settings-invalid": "settings-invalid";
474
+ }>;
475
+ }, z.core.$strip>>;
476
+ }, z.core.$strip>;
477
+ export type DataTypeRestorePlan = z.infer<typeof DataTypeRestorePlanSchema>;
478
+ export declare const DataTypeRestoreConfirmationRequiredSchema: z.ZodObject<{
479
+ snapshotGroupId: z.ZodString;
480
+ restore: z.ZodArray<z.ZodObject<{
481
+ id: z.ZodString;
482
+ name: z.ZodString;
483
+ }, z.core.$strip>>;
484
+ skip: z.ZodArray<z.ZodObject<{
485
+ id: z.ZodString;
486
+ name: z.ZodString;
487
+ reason: z.ZodEnum<{
488
+ "name-taken": "name-taken";
489
+ "id-exists": "id-exists";
490
+ "editor-missing": "editor-missing";
491
+ "editor-inactive": "editor-inactive";
492
+ "settings-invalid": "settings-invalid";
493
+ }>;
494
+ }, z.core.$strip>>;
495
+ requiresConfirmation: z.ZodLiteral<true>;
496
+ planHash: z.ZodString;
497
+ message: z.ZodString;
498
+ }, z.core.$strip>;
499
+ export type DataTypeRestoreConfirmationRequired = z.infer<typeof DataTypeRestoreConfirmationRequiredSchema>;
500
+ export declare const DataTypeRestoreSucceededSchema: z.ZodObject<{
501
+ snapshotGroupId: z.ZodString;
502
+ restored: z.ZodArray<z.ZodObject<{
503
+ id: z.ZodString;
504
+ name: z.ZodString;
505
+ }, z.core.$strip>>;
506
+ skipped: z.ZodArray<z.ZodObject<{
507
+ id: z.ZodString;
508
+ name: z.ZodString;
509
+ reason: z.ZodEnum<{
510
+ "name-taken": "name-taken";
511
+ "id-exists": "id-exists";
512
+ "editor-missing": "editor-missing";
513
+ "editor-inactive": "editor-inactive";
514
+ "settings-invalid": "settings-invalid";
515
+ }>;
516
+ }, z.core.$strip>>;
517
+ }, z.core.$strip>;
518
+ export type DataTypeRestoreSucceeded = z.infer<typeof DataTypeRestoreSucceededSchema>;
519
+ export declare const DataTypeRestoreBodySchema: z.ZodOptional<z.ZodNullable<z.ZodObject<{
520
+ snapshotGroupId: z.ZodOptional<z.ZodString>;
521
+ confirmRestore: z.ZodOptional<z.ZodBoolean>;
522
+ planHash: z.ZodOptional<z.ZodString>;
523
+ }, z.core.$strip>>>;
524
+ export type DataTypeRestoreBody = z.infer<typeof DataTypeRestoreBodySchema>;
331
525
  export declare const PluginUploadResponseSchema: z.ZodObject<{
332
526
  pluginId: z.ZodString;
333
527
  name: z.ZodString;
@@ -396,3 +590,36 @@ export type UninstallPluginBody = NonNullable<z.infer<typeof UninstallPluginBody
396
590
  export type SnapshotGroupListQuery = z.infer<typeof SnapshotGroupListQuerySchema>;
397
591
  /** The restore body as a caller writes it: the object, without the null and undefined the route also accepts. */
398
592
  export type RestoreBody = NonNullable<z.infer<typeof RestoreBodySchema>>;
593
+ export declare const DataTypeFieldBlockerSchema: z.ZodObject<{
594
+ documentTypeId: z.ZodString;
595
+ documentType: z.ZodString;
596
+ kind: z.ZodEnum<{
597
+ media: "media";
598
+ page: "page";
599
+ element: "element";
600
+ }>;
601
+ fields: z.ZodArray<z.ZodObject<{
602
+ id: z.ZodString;
603
+ name: z.ZodString;
604
+ dataType: z.ZodString;
605
+ }, z.core.$strip>>;
606
+ }, z.core.$strip>;
607
+ export type DataTypeFieldBlocker = z.infer<typeof DataTypeFieldBlockerSchema>;
608
+ export declare const PluginDataTypesInUseSchema: z.ZodObject<{
609
+ message: z.ZodString;
610
+ blockedByFields: z.ZodArray<z.ZodObject<{
611
+ documentTypeId: z.ZodString;
612
+ documentType: z.ZodString;
613
+ kind: z.ZodEnum<{
614
+ media: "media";
615
+ page: "page";
616
+ element: "element";
617
+ }>;
618
+ fields: z.ZodArray<z.ZodObject<{
619
+ id: z.ZodString;
620
+ name: z.ZodString;
621
+ dataType: z.ZodString;
622
+ }, z.core.$strip>>;
623
+ }, z.core.$strip>>;
624
+ }, z.core.$strip>;
625
+ export type PluginDataTypesInUse = z.infer<typeof PluginDataTypesInUseSchema>;