@kardalum/plugin-sdk 0.15.0 → 0.17.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 (204) hide show
  1. package/CHANGELOG.md +49 -1
  2. package/README.md +10 -0
  3. package/dist/admin-section-registry.d.ts +14 -5
  4. package/dist/admin-section-registry.js +14 -4
  5. package/dist/built-in-value-schemas.js +1 -1
  6. package/dist/built-ins.js +2 -2
  7. package/dist/capabilities.d.ts +8 -78
  8. package/dist/capabilities.js +23 -322
  9. package/dist/host-entry.d.ts +1 -1
  10. package/dist/host-entry.js +1 -1
  11. package/dist/index.d.ts +5 -5
  12. package/dist/index.js +13 -12
  13. package/dist/license-verdict-keys.d.ts +4 -3
  14. package/dist/license-verdict-keys.js +6 -5
  15. package/dist/manifest-entry.d.ts +3 -3
  16. package/dist/manifest-entry.js +2 -2
  17. package/dist/manifest-schema.d.ts +113 -56
  18. package/dist/manifest-schema.js +192 -295
  19. package/dist/manifest.d.ts +145 -112
  20. package/dist/manifest.js +13 -36
  21. package/dist/media/media-picker.js +21 -12
  22. package/dist/media/upload-error.d.ts +1 -1
  23. package/dist/media/upload-error.js +1 -1
  24. package/dist/plugin-context.d.ts +7 -0
  25. package/dist/plugin-context.js +7 -0
  26. package/dist/plugin-screen-context.d.ts +44 -3
  27. package/dist/plugin-screen-context.js +27 -2
  28. package/dist/read-all-pages.d.ts +23 -0
  29. package/dist/read-all-pages.js +30 -0
  30. package/dist/richtext/block-panel.js +6 -6
  31. package/dist/richtext/insert-menu.js +4 -4
  32. package/dist/richtext/style-listbox.js +4 -4
  33. package/dist/tokens/tokens.css +1 -0
  34. package/dist/tokens/tokens.json +2 -1
  35. package/dist/type-equality.d.ts +2 -0
  36. package/dist/type-equality.js +1 -0
  37. package/dist/views/content-list-view.js +2 -2
  38. package/dist/views/html-view.js +1 -1
  39. package/dist/views/image-view.js +24 -39
  40. package/dist/views/rich-text-view.js +3 -3
  41. package/node_modules/@kardalum/api-schemas/dist/api-error.schema.d.ts +12 -0
  42. package/node_modules/@kardalum/api-schemas/dist/api-error.schema.js +19 -0
  43. package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.d.ts +43 -25
  44. package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.js +60 -8
  45. package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.d.ts +90 -0
  46. package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.js +33 -2
  47. package/node_modules/@kardalum/api-schemas/dist/asset.schema.d.ts +22 -1
  48. package/node_modules/@kardalum/api-schemas/dist/asset.schema.js +50 -15
  49. package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.d.ts +204 -0
  50. package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.js +134 -0
  51. package/node_modules/@kardalum/api-schemas/dist/content-api.schema.d.ts +5 -0
  52. package/node_modules/@kardalum/api-schemas/dist/content-api.schema.js +18 -13
  53. package/node_modules/@kardalum/api-schemas/dist/content-list.schema.d.ts +2 -2
  54. package/node_modules/@kardalum/api-schemas/dist/content-list.schema.js +1 -1
  55. package/node_modules/@kardalum/api-schemas/dist/content-path.js +11 -7
  56. package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.d.ts +4 -0
  57. package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.js +3 -0
  58. package/node_modules/@kardalum/api-schemas/dist/content-trash.schema.d.ts +1 -0
  59. package/node_modules/@kardalum/api-schemas/dist/content-trash.schema.js +2 -1
  60. package/node_modules/@kardalum/api-schemas/dist/core-actions.d.ts +143 -57
  61. package/node_modules/@kardalum/api-schemas/dist/core-actions.js +110 -60
  62. package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.d.ts +1 -0
  63. package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.d.ts +2 -0
  64. package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +1 -1
  65. package/node_modules/@kardalum/api-schemas/dist/index.d.ts +67 -40
  66. package/node_modules/@kardalum/api-schemas/dist/index.js +35 -19
  67. package/node_modules/@kardalum/api-schemas/dist/install-warnings.schema.d.ts +4 -0
  68. package/node_modules/@kardalum/api-schemas/dist/install-warnings.schema.js +8 -0
  69. package/node_modules/@kardalum/api-schemas/dist/issue-list.d.ts +6 -0
  70. package/node_modules/@kardalum/api-schemas/dist/issue-list.js +6 -0
  71. package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.d.ts +73 -0
  72. package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.js +104 -0
  73. package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.d.ts +356 -16
  74. package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +93 -10
  75. package/node_modules/@kardalum/api-schemas/dist/media-api.schema.d.ts +10 -0
  76. package/node_modules/@kardalum/api-schemas/dist/media-api.schema.js +38 -30
  77. package/node_modules/@kardalum/api-schemas/dist/media-rendition.schema.js +2 -2
  78. package/node_modules/@kardalum/api-schemas/dist/media.schema.js +1 -1
  79. package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.d.ts +6 -2
  80. package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.js +8 -6
  81. package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.d.ts +69 -4
  82. package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.js +4 -0
  83. package/node_modules/@kardalum/api-schemas/dist/plugin-docs.d.ts +76 -9
  84. package/node_modules/@kardalum/api-schemas/dist/plugin-docs.js +84 -24
  85. package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.d.ts +17 -7
  86. package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.js +18 -8
  87. package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.d.ts +69 -0
  88. package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.js +59 -0
  89. package/node_modules/@kardalum/api-schemas/dist/plugin-install.d.ts +597 -0
  90. package/node_modules/@kardalum/api-schemas/dist/plugin-install.js +503 -0
  91. package/node_modules/@kardalum/api-schemas/dist/plugin-labels.d.ts +60 -0
  92. package/node_modules/@kardalum/api-schemas/dist/plugin-labels.js +116 -0
  93. package/node_modules/@kardalum/api-schemas/dist/plugin-locales.d.ts +82 -0
  94. package/node_modules/@kardalum/api-schemas/dist/plugin-locales.js +228 -0
  95. package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.d.ts +33 -4
  96. package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +28 -2
  97. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.d.ts +11 -3
  98. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.js +17 -4
  99. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.d.ts +58 -0
  100. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.js +198 -0
  101. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-fields.d.ts +64 -0
  102. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-fields.js +134 -0
  103. package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.d.ts +2 -0
  104. package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.js +4 -0
  105. package/node_modules/@kardalum/api-schemas/dist/plugin-template-payload.d.ts +74 -0
  106. package/node_modules/@kardalum/api-schemas/dist/plugin-template-payload.js +132 -0
  107. package/node_modules/@kardalum/api-schemas/dist/plugin-vocabulary.d.ts +13 -0
  108. package/node_modules/@kardalum/api-schemas/dist/plugin-vocabulary.js +15 -0
  109. package/node_modules/@kardalum/api-schemas/dist/public-api.schema.d.ts +8 -0
  110. package/node_modules/@kardalum/api-schemas/dist/public-api.schema.js +23 -4
  111. package/node_modules/@kardalum/api-schemas/dist/render-editing.d.ts +4 -4
  112. package/node_modules/@kardalum/api-schemas/dist/role.schema.d.ts +17 -0
  113. package/node_modules/@kardalum/api-schemas/dist/role.schema.js +13 -0
  114. package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.d.ts +44 -0
  115. package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.js +97 -0
  116. package/node_modules/@kardalum/api-schemas/dist/sandbox-attach.schema.d.ts +126 -0
  117. package/node_modules/@kardalum/api-schemas/dist/sandbox-attach.schema.js +70 -0
  118. package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +36 -6
  119. package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.js +17 -5
  120. package/node_modules/@kardalum/api-schemas/dist/sites.schema.d.ts +52 -33
  121. package/node_modules/@kardalum/api-schemas/dist/sites.schema.js +195 -56
  122. package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.d.ts +19 -3
  123. package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.js +16 -0
  124. package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.d.ts +1 -1
  125. package/node_modules/@kardalum/api-schemas/dist/strict-url.d.ts +12 -0
  126. package/node_modules/@kardalum/api-schemas/dist/strict-url.js +31 -0
  127. package/node_modules/@kardalum/api-schemas/dist/template-api.schema.d.ts +105 -1
  128. package/node_modules/@kardalum/api-schemas/dist/template-api.schema.js +47 -7
  129. package/node_modules/@kardalum/api-schemas/dist/template.schema.d.ts +30 -2
  130. package/node_modules/@kardalum/api-schemas/dist/template.schema.js +19 -5
  131. package/node_modules/@kardalum/api-schemas/dist/trash-cursor.schema.d.ts +4 -0
  132. package/node_modules/@kardalum/api-schemas/dist/trash-cursor.schema.js +29 -0
  133. package/node_modules/@kardalum/api-schemas/dist/user-api.schema.d.ts +15 -3
  134. package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +8 -0
  135. package/node_modules/@kardalum/api-schemas/dist/whoami-api.schema.d.ts +19 -0
  136. package/node_modules/@kardalum/api-schemas/dist/whoami-api.schema.js +22 -0
  137. package/node_modules/@kardalum/api-schemas/package.json +2 -2
  138. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.d.ts +1 -0
  139. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.js +2 -0
  140. package/node_modules/@kardalum/design-tokens/dist/tokens.css +1 -0
  141. package/node_modules/@kardalum/design-tokens/dist/tokens.js +3 -0
  142. package/node_modules/@kardalum/design-tokens/dist/tokens.json +2 -1
  143. package/node_modules/@kardalum/design-tokens/dist/types.d.ts +1 -0
  144. package/node_modules/@kardalum/plugin-package/README.md +4 -1
  145. package/node_modules/@kardalum/plugin-package/dist/build-reference.d.ts +96 -0
  146. package/node_modules/@kardalum/plugin-package/dist/build-reference.js +66 -0
  147. package/node_modules/@kardalum/plugin-package/dist/capabilities.d.ts +103 -0
  148. package/node_modules/@kardalum/plugin-package/dist/capabilities.js +346 -0
  149. package/node_modules/@kardalum/plugin-package/dist/client-bundle.d.ts +4 -0
  150. package/node_modules/@kardalum/plugin-package/dist/client-bundle.js +25 -0
  151. package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.d.ts +25 -0
  152. package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.js +203 -0
  153. package/node_modules/@kardalum/plugin-package/dist/delivery/bundle.d.ts +3 -0
  154. package/node_modules/@kardalum/plugin-package/dist/delivery/bundle.js +73 -0
  155. package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.d.ts +5 -0
  156. package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.js +60 -0
  157. package/node_modules/@kardalum/plugin-package/dist/delivery/icon-names.generated.d.ts +1 -0
  158. package/node_modules/@kardalum/plugin-package/dist/delivery/icon-names.generated.js +2052 -0
  159. package/node_modules/@kardalum/plugin-package/dist/delivery/icons.d.ts +2 -0
  160. package/node_modules/@kardalum/plugin-package/dist/delivery/icons.js +51 -0
  161. package/node_modules/@kardalum/plugin-package/dist/delivery/index.d.ts +8 -0
  162. package/node_modules/@kardalum/plugin-package/dist/delivery/index.js +7 -0
  163. package/node_modules/@kardalum/plugin-package/dist/delivery/label-languages.d.ts +17 -0
  164. package/node_modules/@kardalum/plugin-package/dist/delivery/label-languages.js +119 -0
  165. package/node_modules/@kardalum/plugin-package/dist/delivery/limits.d.ts +14 -0
  166. package/node_modules/@kardalum/plugin-package/dist/delivery/limits.js +21 -0
  167. package/node_modules/@kardalum/plugin-package/dist/delivery/locales.d.ts +5 -0
  168. package/node_modules/@kardalum/plugin-package/dist/delivery/locales.js +148 -0
  169. package/node_modules/@kardalum/plugin-package/dist/delivery/package-files.d.ts +5 -0
  170. package/node_modules/@kardalum/plugin-package/dist/delivery/package-files.js +76 -0
  171. package/node_modules/@kardalum/plugin-package/dist/delivery/registry.d.ts +22 -0
  172. package/node_modules/@kardalum/plugin-package/dist/delivery/registry.js +133 -0
  173. package/node_modules/@kardalum/plugin-package/dist/delivery/sample-content.d.ts +3 -0
  174. package/node_modules/@kardalum/plugin-package/dist/delivery/sample-content.js +90 -0
  175. package/node_modules/@kardalum/plugin-package/dist/delivery/support.d.ts +24 -0
  176. package/node_modules/@kardalum/plugin-package/dist/delivery/support.js +55 -0
  177. package/node_modules/@kardalum/plugin-package/dist/delivery/templates.d.ts +6 -0
  178. package/node_modules/@kardalum/plugin-package/dist/delivery/templates.js +158 -0
  179. package/node_modules/@kardalum/plugin-package/dist/delivery/types.d.ts +53 -0
  180. package/node_modules/@kardalum/plugin-package/dist/delivery/types.js +1 -0
  181. package/node_modules/@kardalum/plugin-package/dist/docs-contract.d.ts +3 -2
  182. package/node_modules/@kardalum/plugin-package/dist/docs-contract.js +4 -2
  183. package/node_modules/@kardalum/plugin-package/dist/extract.d.ts +92 -3
  184. package/node_modules/@kardalum/plugin-package/dist/extract.js +251 -41
  185. package/node_modules/@kardalum/plugin-package/dist/index.d.ts +11 -2
  186. package/node_modules/@kardalum/plugin-package/dist/index.js +8 -2
  187. package/node_modules/@kardalum/plugin-package/dist/manifest-entry.d.ts +5 -0
  188. package/node_modules/@kardalum/plugin-package/dist/manifest-entry.js +20 -0
  189. package/node_modules/@kardalum/plugin-package/dist/reference-entry.d.ts +3 -0
  190. package/node_modules/@kardalum/plugin-package/dist/reference-entry.js +7 -0
  191. package/node_modules/@kardalum/plugin-package/dist/sample-content.d.ts +38 -1
  192. package/node_modules/@kardalum/plugin-package/dist/sample-content.js +84 -16
  193. package/node_modules/@kardalum/plugin-package/dist/shipped-files.d.ts +39 -0
  194. package/node_modules/@kardalum/plugin-package/dist/shipped-files.js +133 -0
  195. package/node_modules/@kardalum/plugin-package/dist/shipped-locales.d.ts +7 -0
  196. package/node_modules/@kardalum/plugin-package/dist/shipped-locales.js +27 -0
  197. package/node_modules/@kardalum/plugin-package/dist/types.d.ts +4 -6
  198. package/node_modules/@kardalum/plugin-package/dist/types.js +15 -1
  199. package/node_modules/@kardalum/plugin-package/package.json +9 -2
  200. package/node_modules/@kardalum/ui/dist/components/checkbox.js +2 -2
  201. package/node_modules/@kardalum/ui/dist/components/dropdown-menu.js +2 -2
  202. package/node_modules/@kardalum/ui/dist/components/property-field.js +4 -1
  203. package/node_modules/@kardalum/ui/package.json +1 -1
  204. package/package.json +6 -6
@@ -9,6 +9,13 @@ export declare const UpdateMediaFolderRequestSchema: z.ZodObject<{
9
9
  parentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
10
10
  }, z.core.$strip>;
11
11
  export type UpdateMediaFolderRequest = z.infer<typeof UpdateMediaFolderRequestSchema>;
12
+ /** The most items one page of a media folder, version or rendition list holds, and the default (S300b). */
13
+ export declare const MEDIA_NESTED_LIST_PAGE_MAX = 200;
14
+ export declare const MediaNestedListQuerySchema: z.ZodObject<{
15
+ cursor: z.ZodOptional<z.ZodString>;
16
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
17
+ }, z.core.$strip>;
18
+ export type MediaNestedListQuery = z.infer<typeof MediaNestedListQuerySchema>;
12
19
  export declare const MediaFolderListResponseSchema: z.ZodObject<{
13
20
  folders: z.ZodArray<z.ZodObject<{
14
21
  id: z.ZodString;
@@ -16,6 +23,7 @@ export declare const MediaFolderListResponseSchema: z.ZodObject<{
16
23
  parentId: z.ZodNullable<z.ZodString>;
17
24
  createdAt: z.ZodString;
18
25
  }, z.core.$strip>>;
26
+ nextCursor: z.ZodNullable<z.ZodString>;
19
27
  }, z.core.$strip>;
20
28
  export type MediaFolderListResponse = z.infer<typeof MediaFolderListResponseSchema>;
21
29
  export declare const MediaFileResponseSchema: z.ZodObject<{
@@ -104,6 +112,7 @@ export declare const MediaVersionListResponseSchema: z.ZodObject<{
104
112
  createdByName: z.ZodNullable<z.ZodString>;
105
113
  }, z.core.$strip>>;
106
114
  currentVersion: z.ZodNumber;
115
+ nextCursor: z.ZodNullable<z.ZodString>;
107
116
  }, z.core.$strip>;
108
117
  export type MediaVersionListResponse = z.infer<typeof MediaVersionListResponseSchema>;
109
118
  export declare const MediaRenditionListResponseSchema: z.ZodObject<{
@@ -125,6 +134,7 @@ export declare const MediaRenditionListResponseSchema: z.ZodObject<{
125
134
  createdAt: z.ZodString;
126
135
  }, z.core.$strip>>;
127
136
  currentVersion: z.ZodNumber;
137
+ nextCursor: z.ZodNullable<z.ZodString>;
128
138
  }, z.core.$strip>;
129
139
  export type MediaRenditionListResponse = z.infer<typeof MediaRenditionListResponseSchema>;
130
140
  export declare const MediaTrashListQuerySchema: z.ZodObject<{
@@ -1,7 +1,7 @@
1
1
  import { z } from "zod";
2
2
  import { MediaFileSchema, MediaFolderSchema, MediaVersionSchema, MediaVisibilitySchema } from "./media.schema.js";
3
3
  import { MediaRenditionSchema } from "./media-rendition.schema.js";
4
- // POST /api/media/folders body (S186e §2) — name required, parentId
4
+ // POST /api/manage/v1/media/folders body (S186e §2): name required, parentId
5
5
  // optional (omitted/undefined = create at the library root). Duplicate
6
6
  // name under the same parent -> 409, enforced by a real database
7
7
  // constraint as of the fix wave (HIGH-1 — see media-service.ts's
@@ -12,7 +12,7 @@ export const CreateMediaFolderRequestSchema = z.object({
12
12
  name: z.string().min(1),
13
13
  parentId: z.string().uuid().optional(),
14
14
  });
15
- // PATCH /api/media/folders/:id body (S186e §2) — rename and/or move, both
15
+ // PATCH /api/manage/v1/media/folders/:id body (S186e §2): rename and/or move, both
16
16
  // optional and independent. name absent = don't rename. parentId absent =
17
17
  // don't move; null = move to the library root; a uuid = move under that
18
18
  // folder. The cycle-guard (a folder cannot move under its own descendant)
@@ -30,27 +30,30 @@ export const UpdateMediaFolderRequestSchema = z
30
30
  .refine((body) => body.name !== undefined || body.parentId !== undefined, {
31
31
  message: "At least one of name or parentId must be present",
32
32
  });
33
- // GET /api/media/folders response (S186e §2/Task 2 obligation 7): the
34
- // WHOLE tree in one response, not cursor-paginated the way /api/media is.
35
- // Fix wave (MEDIUM-1) correction: this is NOT actually bounded by the
36
- // service's depth cap (5) and per-parent sibling sanity limit (500) the
37
- // way an earlier version of this comment claimed — those two caps bound
38
- // one branch's nesting and one parent's children respectively, not the
39
- // whole tree's total folder count, which is their product summed across
40
- // every branch (on the order of 3×10^13 in the worst case at those same
41
- // limits) — nowhere near a real bound in practice. Left unpaginated as a
42
- // deliberate scope decision for this task, not because it's provably
43
- // small; a future task can revisit pagination here if a real library
44
- // ever grows large enough for it to matter. Decision, documented here
45
- // rather than left implicit: a FLAT array of MediaFolderSchema, not a
46
- // server-assembled nested structure — the client groups by `parentId`
47
- // itself (cheap at ordinary scale, and it's exactly the shape
48
- // MediaFolderSchema already has). A folder whose parentId dangles (binding
49
- // obligation 4 from the S186e Task 1 review) is normalized to
50
- // `parentId: null` in this response by the service, so it renders as a
51
- // root folder instead of silently vanishing from the client's grouping.
33
+ /** The most items one page of a media folder, version or rendition list holds, and the default (S300b). */
34
+ export const MEDIA_NESTED_LIST_PAGE_MAX = 200;
35
+ // The query of the three lists that used to be unpaginated: GET /api/manage/v1/media/folders,
36
+ // /api/manage/v1/media/:id/versions and /api/manage/v1/media/:id/renditions. The cursor is the `id`
37
+ // of the previous page's last item, the idiom of GET /api/manage/v1/media.
38
+ export const MediaNestedListQuerySchema = z.object({
39
+ cursor: z.string().uuid().optional(),
40
+ limit: z.coerce.number().int().min(1).max(MEDIA_NESTED_LIST_PAGE_MAX).default(MEDIA_NESTED_LIST_PAGE_MAX),
41
+ });
42
+ // GET /api/manage/v1/media/folders (S186e §2, paged by S300b): the tree as a FLAT array of
43
+ // MediaFolderSchema, `limit` folders at a time (default and maximum
44
+ // MEDIA_NESTED_LIST_PAGE_MAX), ordered by name and then id, with the cursor of
45
+ // the next page. Flat rather than nested: the client groups by `parentId`
46
+ // itself, and a server-assembled tree could not be paged. A folder whose
47
+ // parentId dangles (binding obligation 4 of the S186e Task 1 review) is reported
48
+ // with `parentId: null`, so it renders as a root folder instead of vanishing
49
+ // from the client's grouping; a folder whose parent sits on another page keeps
50
+ // its parentId. The tree's total size is not bounded by the depth cap or the
51
+ // per-parent sibling limit (they bound one branch and one parent), which is why
52
+ // this list is paged.
52
53
  export const MediaFolderListResponseSchema = z.object({
53
54
  folders: z.array(MediaFolderSchema),
55
+ // null = no more pages.
56
+ nextCursor: z.string().uuid().nullable(),
54
57
  });
55
58
  // downloadUrl is the stable app path (S186c §3), computed fresh each
56
59
  // response rather than trusted from storage: for a PUBLIC item it's
@@ -62,7 +65,7 @@ export const MediaFolderListResponseSchema = z.object({
62
65
  export const MediaFileResponseSchema = MediaFileSchema.extend({
63
66
  downloadUrl: z.string().min(1),
64
67
  });
65
- // POST /api/media/:id/link response (S186c §3) — the admin's "Copy
68
+ // POST /api/manage/v1/media/:id/link response (S186c §3): the admin's "Copy
66
69
  // temporary link" mint: a signed `?token=` URL good until `expiresAt`.
67
70
  // Same stable path as `downloadUrl`, just minted on demand rather than
68
71
  // alongside every list/get response.
@@ -73,7 +76,7 @@ export const MediaLinkResponseSchema = z.object({
73
76
  export const MediaDeleteResponseSchema = z.object({
74
77
  success: z.literal(true),
75
78
  });
76
- // PATCH /api/media/:id body (S186c §2, folderId added S186e §2; renamed
79
+ // PATCH /api/manage/v1/media/:id body (S186c §2, folderId added S186e §2; renamed
77
80
  // from UpdateMediaVisibilityRequestSchema in the fix wave — it carries
78
81
  // both visibility and folderId now, not just visibility, and the old
79
82
  // name stopped describing it). Both fields optional and independent, same
@@ -120,7 +123,7 @@ export const UpdateMediaRequestSchema = z
120
123
  data: z.record(z.string(), z.unknown()).optional(),
121
124
  })
122
125
  .refine((body) => body.visibility !== undefined || body.folderId !== undefined || body.data !== undefined, { message: "At least one of visibility, folderId or data must be present" });
123
- // GET /api/media — newest-first pages; cursor = id of the previous
126
+ // GET /api/manage/v1/media: newest-first pages; cursor = id of the previous
124
127
  // page's last item. `search` filters by filename substring,
125
128
  // case-insensitive. `folderId` (S186e §2) is a folder filter: ABSENT
126
129
  // keeps the pre-S186e all-files behavior (compatibility-pinned by a
@@ -149,20 +152,25 @@ export const MediaListResponseSchema = z.object({
149
152
  // null = no more pages.
150
153
  nextCursor: z.string().uuid().nullable(),
151
154
  });
152
- // GET /api/media/:id/versions. Newest first, with the pointer beside them
155
+ // GET /api/manage/v1/media/:id/versions. Newest first, with the pointer beside them
153
156
  // so a client never has to infer which row is live from the list order.
157
+ // Paged like the folder list (S300b).
154
158
  export const MediaVersionListResponseSchema = z.object({
155
159
  items: z.array(MediaVersionSchema),
156
160
  currentVersion: z.number().int().positive(),
161
+ // null = no more pages.
162
+ nextCursor: z.string().uuid().nullable(),
157
163
  });
158
- // GET /api/media/:id/renditions. The renditions of the CURRENT version
164
+ // GET /api/manage/v1/media/:id/renditions. The renditions of the CURRENT version
159
165
  // only, with the pointer beside them so a client never infers which
160
- // version these belong to.
166
+ // version these belong to. Paged like the folder list (S300b).
161
167
  export const MediaRenditionListResponseSchema = z.object({
162
168
  items: z.array(MediaRenditionSchema),
163
169
  currentVersion: z.number().int().positive(),
170
+ // null = no more pages.
171
+ nextCursor: z.string().uuid().nullable(),
164
172
  });
165
- // GET /api/media/trash (S234e). Newest-trashed first; cursor = id of the
173
+ // GET /api/manage/v1/media/trash (S234e). Newest-trashed first; cursor = id of the
166
174
  // previous page's last item, the same cursor idiom the library list uses.
167
175
  export const MediaTrashListQuerySchema = z.object({
168
176
  cursor: z.string().uuid().optional(),
@@ -179,7 +187,7 @@ export const MediaTrashListResponseSchema = z.object({
179
187
  // null = no more pages.
180
188
  nextCursor: z.string().uuid().nullable(),
181
189
  });
182
- // GET /api/media/:id query (S234e). The ONE way to read a trashed item
190
+ // GET /api/manage/v1/media/:id query (S234e). The ONE way to read a trashed item
183
191
  // through the API, and it has to be asked for: every other read, and this
184
192
  // one without the flag, answers 404 for a trashed item so that a trashed
185
193
  // file is not reachable by accident.
@@ -198,7 +206,7 @@ export const MediaReadQuerySchema = z.object({
198
206
  .default(false)
199
207
  .transform((value) => value === true || value === "true"),
200
208
  });
201
- // POST /api/media/trash/empty (S234e). Both numbers, always, because a
209
+ // POST /api/manage/v1/media/trash/empty (S234e). Both numbers, always, because a
202
210
  // purge deletes the row before the objects and can therefore half
203
211
  // succeed. An endpoint that answered only `{ success: true }` would be
204
212
  // claiming something it cannot know.
@@ -69,8 +69,8 @@ export const MediaRenditionSchema = z.object({
69
69
  // "thumb". Three doors refuse that state, and all three ask this function
70
70
  // rather than re-deriving the rule (S234c Task 7):
71
71
  // DocumentTypeService.createDocumentType (which is also the plugin
72
- // manifest install path), PUT /api/document-types/:id, and
73
- // PATCH /api/data-types/:id, which could otherwise edit one crop data
72
+ // manifest install path), PUT /api/manage/v1/document-types/:id, and
73
+ // PATCH /api/manage/v1/data-types/:id, which could otherwise edit one crop data
74
74
  // type's ratio into another's without touching the media type at all.
75
75
  export function renditionName(dataType) {
76
76
  // A union rather than `editorId: string` with a cast. The argument is a
@@ -99,7 +99,7 @@ export const MediaVersionSchema = z.object({
99
99
  // is gone and a user who never set one (`User.name` is itself nullable).
100
100
  //
101
101
  // NAME ONLY, deliberately. Never the email and never the role: those
102
- // live on GET /api/users, which is admin only, and this list is not.
102
+ // live on GET /api/manage/v1/users, which is admin only, and this list is not.
103
103
  createdByName: z.string().nullable(),
104
104
  });
105
105
  /**
@@ -1,7 +1,9 @@
1
1
  import { z } from "zod";
2
2
  export declare const PluginActionDeclarationSchema: z.ZodObject<{
3
3
  id: z.ZodString;
4
- label: z.ZodString;
4
+ label: z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
5
+ en: z.ZodString;
6
+ }, z.core.$catchall<z.ZodString>>, unknown>]>;
5
7
  }, z.core.$strip>;
6
8
  export type PluginActionDeclaration = z.infer<typeof PluginActionDeclarationSchema>;
7
9
  /** A role a plugin offers. Never applied unasked: the operator accepts it
@@ -9,7 +11,9 @@ export type PluginActionDeclaration = z.infer<typeof PluginActionDeclarationSche
9
11
  * result is an ordinary editable role. */
10
12
  export declare const PluginRoleOfferSchema: z.ZodObject<{
11
13
  id: z.ZodString;
12
- label: z.ZodString;
14
+ label: z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodObject<{
15
+ en: z.ZodString;
16
+ }, z.core.$catchall<z.ZodString>>, unknown>]>;
13
17
  actions: z.ZodArray<z.ZodString>;
14
18
  }, z.core.$strip>;
15
19
  export type PluginRoleOffer = z.infer<typeof PluginRoleOfferSchema>;
@@ -1,24 +1,26 @@
1
1
  import { z } from "zod";
2
2
  import { ActionStringSchema } from "./action.schema.js";
3
+ import { PluginLabelSchema } from "./plugin-labels.js";
3
4
  import { RoleIdSchema } from "./role.schema.js";
4
5
  // S273: what a plugin declares about permissions. These two shapes are the
5
6
  // one definition the SDK manifest schema, the marketplace listing and the
6
7
  // installed-plugin list all reuse, so a label an author wrote reaches the
7
8
  // install screen and the Roles screen unchanged.
8
- /** A label is what the role editor and the install screen show; nothing
9
- * ever shows an operator a raw action string. Capped for MySQL's
10
- * VARCHAR(191) with room to spare. */
11
- const ActionLabelSchema = z.string().trim().min(1).max(120);
9
+ // A label is what the role editor and the install screen show; nothing ever
10
+ // shows an operator a raw action string. Since S311 it may be a language map
11
+ // (PluginLabelSchema, the shape a section's label has) or a plain string; the
12
+ // server stores one string per action and per role, the map resolved to the
13
+ // site's default language when the plugin is installed.
12
14
  export const PluginActionDeclarationSchema = z.object({
13
15
  id: ActionStringSchema,
14
- label: ActionLabelSchema,
16
+ label: PluginLabelSchema,
15
17
  });
16
18
  /** A role a plugin offers. Never applied unasked: the operator accepts it
17
19
  * on the install screen or later from the installed-plugins view, and the
18
20
  * result is an ordinary editable role. */
19
21
  export const PluginRoleOfferSchema = z.object({
20
22
  id: RoleIdSchema,
21
- label: ActionLabelSchema,
23
+ label: PluginLabelSchema,
22
24
  actions: z.array(ActionStringSchema).min(1),
23
25
  });
24
26
  export const OfferedRoleParamsSchema = z.object({
@@ -79,9 +79,20 @@ export declare const PluginDocsPageResponseSchema: z.ZodObject<{
79
79
  markdown: z.ZodString;
80
80
  }, z.core.$strip>;
81
81
  export type PluginDocsPageResponse = z.infer<typeof PluginDocsPageResponseSchema>;
82
+ export declare const PluginReferenceSourceSchema: z.ZodEnum<{
83
+ package: "package";
84
+ live: "live";
85
+ }>;
86
+ export type PluginReferenceSource = z.infer<typeof PluginReferenceSourceSchema>;
87
+ /** S289: "live" is built from the manifest the server has attached; "package"
88
+ * is the package's reference.json, used only when no manifest is attached. */
82
89
  export declare const PluginDocsReferenceResponseSchema: z.ZodObject<{
83
90
  pluginId: z.ZodString;
84
91
  version: z.ZodString;
92
+ source: z.ZodEnum<{
93
+ package: "package";
94
+ live: "live";
95
+ }>;
85
96
  reference: z.ZodObject<{
86
97
  actions: z.ZodArray<z.ZodObject<{
87
98
  id: z.ZodString;
@@ -89,8 +100,8 @@ export declare const PluginDocsReferenceResponseSchema: z.ZodObject<{
89
100
  }, z.core.$strip>>;
90
101
  roles: z.ZodArray<z.ZodObject<{
91
102
  id: z.ZodString;
92
- label: z.ZodString;
93
103
  actions: z.ZodArray<z.ZodString>;
104
+ label: z.ZodString;
94
105
  }, z.core.$strip>>;
95
106
  apiRoutes: z.ZodArray<z.ZodObject<{
96
107
  method: z.ZodString;
@@ -100,8 +111,14 @@ export declare const PluginDocsReferenceResponseSchema: z.ZodObject<{
100
111
  }, z.core.$strict>>;
101
112
  capabilities: z.ZodArray<z.ZodObject<{
102
113
  id: z.ZodString;
103
- mediation: z.ZodString;
104
- payload: z.ZodOptional<z.ZodUnknown>;
114
+ mediation: z.ZodEnum<{
115
+ mediated: "mediated";
116
+ promised: "promised";
117
+ }>;
118
+ payload: z.ZodObject<{
119
+ count: z.ZodNumber;
120
+ details: z.ZodArray<z.ZodString>;
121
+ }, z.core.$strict>;
105
122
  }, z.core.$strict>>;
106
123
  documentTypes: z.ZodArray<z.ZodObject<{
107
124
  name: z.ZodString;
@@ -112,11 +129,59 @@ export declare const PluginDocsReferenceResponseSchema: z.ZodObject<{
112
129
  id: z.ZodString;
113
130
  name: z.ZodString;
114
131
  }, z.core.$loose>>;
115
- settingsPages: z.ZodArray<z.ZodObject<{
132
+ templates: z.ZodArray<z.ZodObject<{
133
+ name: z.ZodString;
134
+ alias: z.ZodString;
135
+ kind: z.ZodString;
136
+ documentType: z.ZodOptional<z.ZodString>;
137
+ }, z.core.$strict>>;
138
+ adminSections: z.ZodArray<z.ZodObject<{
139
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
140
+ rail: z.ZodArray<z.ZodObject<{
141
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
142
+ id: z.ZodString;
143
+ action: z.ZodString;
144
+ }, z.core.$strict>>;
116
145
  id: z.ZodString;
146
+ action: z.ZodString;
147
+ }, z.core.$strict>>;
148
+ railEntries: z.ZodArray<z.ZodObject<{
149
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
150
+ section: z.ZodString;
151
+ id: z.ZodString;
152
+ action: z.ZodString;
153
+ }, z.core.$strict>>;
154
+ dashboardWidgets: z.ZodArray<z.ZodObject<{
117
155
  name: z.ZodString;
156
+ id: z.ZodString;
118
157
  action: z.ZodString;
119
158
  }, z.core.$strict>>;
159
+ hooks: z.ZodArray<z.ZodString>;
160
+ scheduledTasks: z.ZodArray<z.ZodObject<{
161
+ id: z.ZodString;
162
+ name: z.ZodString;
163
+ cron: z.ZodString;
164
+ }, z.core.$strict>>;
165
+ migrations: z.ZodArray<z.ZodObject<{
166
+ id: z.ZodString;
167
+ name: z.ZodString;
168
+ }, z.core.$strict>>;
169
+ assertions: z.ZodArray<z.ZodObject<{
170
+ key: z.ZodString;
171
+ reason: z.ZodString;
172
+ }, z.core.$strict>>;
173
+ installOptions: z.ZodDefault<z.ZodArray<z.ZodObject<{
174
+ step: z.ZodRecord<z.ZodString, z.ZodString>;
175
+ id: z.ZodString;
176
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
177
+ kind: z.ZodString;
178
+ choices: z.ZodArray<z.ZodObject<{
179
+ id: z.ZodString;
180
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
181
+ }, z.core.$strict>>;
182
+ default: z.ZodNullable<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString, z.ZodArray<z.ZodString>]>>;
183
+ required: z.ZodBoolean;
184
+ }, z.core.$strict>>>;
120
185
  }, z.core.$strict>;
121
186
  }, z.core.$strip>;
122
187
  export type PluginDocsReferenceResponse = z.infer<typeof PluginDocsReferenceResponseSchema>;
@@ -35,9 +35,13 @@ export const PluginDocsPageResponseSchema = z.object({
35
35
  path: z.string(),
36
36
  markdown: z.string(),
37
37
  });
38
+ export const PluginReferenceSourceSchema = z.enum(["live", "package"]);
39
+ /** S289: "live" is built from the manifest the server has attached; "package"
40
+ * is the package's reference.json, used only when no manifest is attached. */
38
41
  export const PluginDocsReferenceResponseSchema = z.object({
39
42
  pluginId: z.string(),
40
43
  version: z.string(),
44
+ source: PluginReferenceSourceSchema,
41
45
  reference: PluginReferenceSchema,
42
46
  });
43
47
  export const PluginDocsSearchItemSchema = z.object({
@@ -32,9 +32,8 @@ export interface DocsFacts {
32
32
  hasDependencies: boolean;
33
33
  hasPrice: boolean;
34
34
  hasDocumentTypes: boolean;
35
- hasSettingsPages: boolean;
36
35
  }
37
- /** Reads the five facts from a live manifest or from manifest.json. The
36
+ /** Reads the four facts from a live manifest or from manifest.json. The
38
37
  * summary keeps each contribution list as a list of redacted entries,
39
38
  * reduces migrations to their ids, and says `paid: true` where the live
40
39
  * manifest has a price above 0: the amount itself never reaches
@@ -47,6 +46,9 @@ export declare function requiredDocRoles(facts: DocsFacts): Array<{
47
46
  role: PluginDocRole;
48
47
  because: string;
49
48
  }>;
49
+ /** A slot label as reference.json carries it: language code to text, with
50
+ * the English text every slot label must have. */
51
+ export declare const ReferenceLabelMapSchema: z.ZodRecord<z.ZodString, z.ZodString>;
50
52
  export declare const PluginReferenceSchema: z.ZodObject<{
51
53
  actions: z.ZodArray<z.ZodObject<{
52
54
  id: z.ZodString;
@@ -54,8 +56,8 @@ export declare const PluginReferenceSchema: z.ZodObject<{
54
56
  }, z.core.$strip>>;
55
57
  roles: z.ZodArray<z.ZodObject<{
56
58
  id: z.ZodString;
57
- label: z.ZodString;
58
59
  actions: z.ZodArray<z.ZodString>;
60
+ label: z.ZodString;
59
61
  }, z.core.$strip>>;
60
62
  apiRoutes: z.ZodArray<z.ZodObject<{
61
63
  method: z.ZodString;
@@ -65,8 +67,14 @@ export declare const PluginReferenceSchema: z.ZodObject<{
65
67
  }, z.core.$strict>>;
66
68
  capabilities: z.ZodArray<z.ZodObject<{
67
69
  id: z.ZodString;
68
- mediation: z.ZodString;
69
- payload: z.ZodOptional<z.ZodUnknown>;
70
+ mediation: z.ZodEnum<{
71
+ mediated: "mediated";
72
+ promised: "promised";
73
+ }>;
74
+ payload: z.ZodObject<{
75
+ count: z.ZodNumber;
76
+ details: z.ZodArray<z.ZodString>;
77
+ }, z.core.$strict>;
70
78
  }, z.core.$strict>>;
71
79
  documentTypes: z.ZodArray<z.ZodObject<{
72
80
  name: z.ZodString;
@@ -77,13 +85,72 @@ export declare const PluginReferenceSchema: z.ZodObject<{
77
85
  id: z.ZodString;
78
86
  name: z.ZodString;
79
87
  }, z.core.$loose>>;
80
- settingsPages: z.ZodArray<z.ZodObject<{
88
+ templates: z.ZodArray<z.ZodObject<{
89
+ name: z.ZodString;
90
+ alias: z.ZodString;
91
+ kind: z.ZodString;
92
+ documentType: z.ZodOptional<z.ZodString>;
93
+ }, z.core.$strict>>;
94
+ adminSections: z.ZodArray<z.ZodObject<{
95
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
96
+ rail: z.ZodArray<z.ZodObject<{
97
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
98
+ id: z.ZodString;
99
+ action: z.ZodString;
100
+ }, z.core.$strict>>;
81
101
  id: z.ZodString;
102
+ action: z.ZodString;
103
+ }, z.core.$strict>>;
104
+ railEntries: z.ZodArray<z.ZodObject<{
105
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
106
+ section: z.ZodString;
107
+ id: z.ZodString;
108
+ action: z.ZodString;
109
+ }, z.core.$strict>>;
110
+ dashboardWidgets: z.ZodArray<z.ZodObject<{
82
111
  name: z.ZodString;
112
+ id: z.ZodString;
83
113
  action: z.ZodString;
84
114
  }, z.core.$strict>>;
115
+ hooks: z.ZodArray<z.ZodString>;
116
+ scheduledTasks: z.ZodArray<z.ZodObject<{
117
+ id: z.ZodString;
118
+ name: z.ZodString;
119
+ cron: z.ZodString;
120
+ }, z.core.$strict>>;
121
+ migrations: z.ZodArray<z.ZodObject<{
122
+ id: z.ZodString;
123
+ name: z.ZodString;
124
+ }, z.core.$strict>>;
125
+ assertions: z.ZodArray<z.ZodObject<{
126
+ key: z.ZodString;
127
+ reason: z.ZodString;
128
+ }, z.core.$strict>>;
129
+ installOptions: z.ZodDefault<z.ZodArray<z.ZodObject<{
130
+ step: z.ZodRecord<z.ZodString, z.ZodString>;
131
+ id: z.ZodString;
132
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
133
+ kind: z.ZodString;
134
+ choices: z.ZodArray<z.ZodObject<{
135
+ id: z.ZodString;
136
+ label: z.ZodRecord<z.ZodString, z.ZodString>;
137
+ }, z.core.$strict>>;
138
+ default: z.ZodNullable<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString, z.ZodArray<z.ZodString>]>>;
139
+ required: z.ZodBoolean;
140
+ }, z.core.$strict>>>;
85
141
  }, z.core.$strict>;
86
142
  export type PluginReference = z.infer<typeof PluginReferenceSchema>;
87
- export declare const REFERENCE_PAGE_SLUGS: readonly ["permissions", "api-routes", "capabilities", "content", "settings"];
88
- /** The generated pages this plugin gets, in their fixed order (spec section 7). */
89
- export declare function referencePageSlugs(reference: PluginReference): string[];
143
+ export declare function emptyPluginReference(): PluginReference;
144
+ export declare const REFERENCE_PAGE_SLUGS: readonly ["permissions", "api-routes", "capabilities", "content", "admin-surfaces", "lifecycle"];
145
+ export type ReferencePageSlug = (typeof REFERENCE_PAGE_SLUGS)[number];
146
+ /** Which lists each page's tables are drawn from. Every list belongs to
147
+ * exactly one page (pinned by plugin-docs.test.ts), so a list added to the
148
+ * schema without a page is a red test, not a fact nobody sees. */
149
+ export declare const REFERENCE_PAGE_TABLES: Record<ReferencePageSlug, readonly (keyof PluginReference)[]>;
150
+ export declare function isReferencePageSlug(slug: string): slug is ReferencePageSlug;
151
+ /** The one rule (S289): a reference page exists when at least one of its
152
+ * tables has a row. The renderer, the admin, the server, the door, the
153
+ * marketplace and its sitemap all ask this function. */
154
+ export declare function referencePageHasContent(reference: PluginReference, slug: string): boolean;
155
+ /** The generated pages this plugin gets, in their fixed order. */
156
+ export declare function referencePageSlugs(reference: PluginReference): ReferencePageSlug[];