@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.
Files changed (274) hide show
  1. package/CHANGELOG.md +105 -0
  2. package/README.md +4 -3
  3. package/dist/admin-section-registry.d.ts +14 -5
  4. package/dist/admin-section-registry.js +14 -4
  5. package/dist/assets/asset-picker.d.ts +11 -0
  6. package/dist/assets/asset-picker.js +109 -0
  7. package/dist/assets/asset-tree.d.ts +30 -0
  8. package/dist/assets/asset-tree.js +150 -0
  9. package/dist/built-in-editor-ids.d.ts +1 -0
  10. package/dist/built-in-editor-ids.js +20 -0
  11. package/dist/built-in-settings-schemas.d.ts +2 -0
  12. package/dist/built-in-settings-schemas.js +27 -0
  13. package/dist/built-in-value-schemas.js +3 -0
  14. package/dist/built-ins.js +10 -1
  15. package/dist/capabilities.js +5 -3
  16. package/dist/datatype-validation.js +18 -4
  17. package/dist/datatypes-entry.d.ts +1 -0
  18. package/dist/datatypes-entry.js +1 -0
  19. package/dist/entitlement-entry.d.ts +3 -2
  20. package/dist/entitlement-entry.js +13 -1
  21. package/dist/entitlement-gate.d.ts +18 -0
  22. package/dist/entitlement-gate.js +95 -21
  23. package/dist/entitlement-plan.d.ts +21 -0
  24. package/dist/entitlement-plan.js +26 -0
  25. package/dist/entitlement-types.d.ts +21 -4
  26. package/dist/entitlement.d.ts +29 -1
  27. package/dist/entitlement.js +39 -0
  28. package/dist/grid-arrow-step.d.ts +7 -0
  29. package/dist/grid-arrow-step.js +20 -0
  30. package/dist/host-entry.d.ts +1 -1
  31. package/dist/host-entry.js +1 -1
  32. package/dist/index.d.ts +8 -3
  33. package/dist/index.js +13 -18
  34. package/dist/license-verdict-keys.d.ts +4 -3
  35. package/dist/license-verdict-keys.js +4 -7
  36. package/dist/manifest-entry.d.ts +6 -2
  37. package/dist/manifest-entry.js +5 -1
  38. package/dist/manifest-schema.d.ts +56 -63
  39. package/dist/manifest-schema.js +103 -249
  40. package/dist/manifest.d.ts +61 -73
  41. package/dist/manifest.js +13 -36
  42. package/dist/media/media-picker.js +32 -32
  43. package/dist/notify.d.ts +17 -0
  44. package/dist/notify.js +17 -0
  45. package/dist/plugin-screen-context.d.ts +11 -1
  46. package/dist/richtext/block-panel.js +19 -20
  47. package/dist/richtext/extensions.js +10 -1
  48. package/dist/richtext/insert-menu.js +1 -1
  49. package/dist/richtext/kardalum-block.js +17 -17
  50. package/dist/richtext/style-listbox.js +4 -4
  51. package/dist/richtext-html-entry.d.ts +35 -0
  52. package/dist/richtext-html-entry.js +73 -0
  53. package/dist/structured-storage-types.d.ts +11 -0
  54. package/dist/tailwind.js +10 -3
  55. package/dist/tokens/tailwind-theme.css +176 -0
  56. package/dist/tokens/tokens.css +2 -0
  57. package/dist/tokens/tokens.json +4 -2
  58. package/dist/type-equality.d.ts +2 -0
  59. package/dist/type-equality.js +1 -0
  60. package/dist/vendor-check.d.ts +39 -0
  61. package/dist/vendor-check.js +79 -0
  62. package/dist/vendor-entry.d.ts +3 -0
  63. package/dist/vendor-entry.js +9 -0
  64. package/dist/vendor-service.d.ts +20 -0
  65. package/dist/vendor-service.js +20 -0
  66. package/dist/views/asset-view.d.ts +6 -0
  67. package/dist/views/asset-view.js +55 -0
  68. package/dist/views/content-list-settings-view.js +1 -1
  69. package/dist/views/content-list-view.js +1 -1
  70. package/dist/views/html-code-editor.js +0 -1
  71. package/dist/views/html-view.js +1 -1
  72. package/dist/views/image-view.js +1 -1
  73. package/dist/views/rich-text-view.js +30 -30
  74. package/node_modules/@kardalum/api-schemas/README.md +1 -1
  75. package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.d.ts +90 -0
  76. package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.js +43 -10
  77. package/node_modules/@kardalum/api-schemas/dist/asset-field.schema.d.ts +21 -0
  78. package/node_modules/@kardalum/api-schemas/dist/asset-field.schema.js +42 -0
  79. package/node_modules/@kardalum/api-schemas/dist/asset.schema.d.ts +23 -1
  80. package/node_modules/@kardalum/api-schemas/dist/asset.schema.js +60 -18
  81. package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.d.ts +204 -0
  82. package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.js +134 -0
  83. package/node_modules/@kardalum/api-schemas/dist/checkout-shown.schema.d.ts +36 -0
  84. package/node_modules/@kardalum/api-schemas/dist/checkout-shown.schema.js +46 -0
  85. package/node_modules/@kardalum/api-schemas/dist/content-api.schema.d.ts +12 -0
  86. package/node_modules/@kardalum/api-schemas/dist/content-api.schema.js +22 -6
  87. package/node_modules/@kardalum/api-schemas/dist/content-list.schema.d.ts +2 -2
  88. package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.d.ts +4 -0
  89. package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.js +3 -0
  90. package/node_modules/@kardalum/api-schemas/dist/content-trash.schema.js +2 -1
  91. package/node_modules/@kardalum/api-schemas/dist/core-actions.d.ts +52 -10
  92. package/node_modules/@kardalum/api-schemas/dist/core-actions.js +33 -14
  93. package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.d.ts +50 -0
  94. package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.js +25 -5
  95. package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.d.ts +1 -0
  96. package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.js +3 -0
  97. package/node_modules/@kardalum/api-schemas/dist/data-type-cursor.d.ts +11 -0
  98. package/node_modules/@kardalum/api-schemas/dist/data-type-cursor.js +28 -0
  99. package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +42 -2
  100. package/node_modules/@kardalum/api-schemas/dist/home.schema.d.ts +130 -0
  101. package/node_modules/@kardalum/api-schemas/dist/home.schema.js +87 -0
  102. package/node_modules/@kardalum/api-schemas/dist/index.d.ts +73 -31
  103. package/node_modules/@kardalum/api-schemas/dist/index.js +47 -17
  104. package/node_modules/@kardalum/api-schemas/dist/install-warnings.schema.d.ts +4 -0
  105. package/node_modules/@kardalum/api-schemas/dist/install-warnings.schema.js +8 -0
  106. package/node_modules/@kardalum/api-schemas/dist/issue-list.d.ts +6 -0
  107. package/node_modules/@kardalum/api-schemas/dist/issue-list.js +6 -0
  108. package/node_modules/@kardalum/api-schemas/dist/kardalum-latest.schema.d.ts +7 -0
  109. package/node_modules/@kardalum/api-schemas/dist/kardalum-latest.schema.js +9 -0
  110. package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.d.ts +216 -63
  111. package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +117 -5
  112. package/node_modules/@kardalum/api-schemas/dist/marketplace-package-api.schema.d.ts +17 -0
  113. package/node_modules/@kardalum/api-schemas/dist/marketplace-package-api.schema.js +16 -0
  114. package/node_modules/@kardalum/api-schemas/dist/media-api.schema.d.ts +26 -0
  115. package/node_modules/@kardalum/api-schemas/dist/media-api.schema.js +6 -0
  116. package/node_modules/@kardalum/api-schemas/dist/media-reference-use.d.ts +10 -0
  117. package/node_modules/@kardalum/api-schemas/dist/media-reference-use.js +4 -4
  118. package/node_modules/@kardalum/api-schemas/dist/news.schema.d.ts +93 -0
  119. package/node_modules/@kardalum/api-schemas/dist/news.schema.js +86 -0
  120. package/node_modules/@kardalum/api-schemas/dist/node-access.schema.js +13 -0
  121. package/node_modules/@kardalum/api-schemas/dist/notification.schema.d.ts +410 -0
  122. package/node_modules/@kardalum/api-schemas/dist/notification.schema.js +193 -0
  123. package/node_modules/@kardalum/api-schemas/dist/plan-editor.schema.d.ts +86 -0
  124. package/node_modules/@kardalum/api-schemas/dist/plan-editor.schema.js +92 -0
  125. package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.d.ts +6 -2
  126. package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.js +8 -6
  127. package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.d.ts +8 -18
  128. package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.js +7 -0
  129. package/node_modules/@kardalum/api-schemas/dist/plugin-docs.d.ts +3 -19
  130. package/node_modules/@kardalum/api-schemas/dist/plugin-docs.js +13 -15
  131. package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.d.ts +17 -7
  132. package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.js +18 -8
  133. package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.d.ts +1 -1
  134. package/node_modules/@kardalum/api-schemas/dist/plugin-install.d.ts +97 -85
  135. package/node_modules/@kardalum/api-schemas/dist/plugin-install.js +35 -68
  136. package/node_modules/@kardalum/api-schemas/dist/plugin-labels.d.ts +60 -0
  137. package/node_modules/@kardalum/api-schemas/dist/plugin-labels.js +116 -0
  138. package/node_modules/@kardalum/api-schemas/dist/plugin-locales.d.ts +9 -2
  139. package/node_modules/@kardalum/api-schemas/dist/plugin-locales.js +22 -7
  140. package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.d.ts +240 -6
  141. package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +164 -32
  142. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.d.ts +4 -3
  143. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.js +1 -1
  144. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.d.ts +14 -0
  145. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.js +37 -1
  146. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-fields.d.ts +64 -0
  147. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-fields.js +134 -0
  148. package/node_modules/@kardalum/api-schemas/dist/plugin-read-only.schema.d.ts +19 -0
  149. package/node_modules/@kardalum/api-schemas/dist/plugin-read-only.schema.js +33 -0
  150. package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.d.ts +2 -0
  151. package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.js +4 -0
  152. package/node_modules/@kardalum/api-schemas/dist/plugin-template-payload.d.ts +83 -0
  153. package/node_modules/@kardalum/api-schemas/dist/plugin-template-payload.js +152 -0
  154. package/node_modules/@kardalum/api-schemas/dist/plugin-vocabulary.d.ts +13 -0
  155. package/node_modules/@kardalum/api-schemas/dist/plugin-vocabulary.js +15 -0
  156. package/node_modules/@kardalum/api-schemas/dist/public-api.schema.d.ts +5 -0
  157. package/node_modules/@kardalum/api-schemas/dist/public-api.schema.js +35 -23
  158. package/node_modules/@kardalum/api-schemas/dist/revenue-view.schema.d.ts +83 -0
  159. package/node_modules/@kardalum/api-schemas/dist/revenue-view.schema.js +73 -0
  160. package/node_modules/@kardalum/api-schemas/dist/role.schema.d.ts +11 -0
  161. package/node_modules/@kardalum/api-schemas/dist/role.schema.js +7 -0
  162. package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.d.ts +11 -2
  163. package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.js +21 -3
  164. package/node_modules/@kardalum/api-schemas/dist/sandbox-attach.schema.d.ts +126 -0
  165. package/node_modules/@kardalum/api-schemas/dist/sandbox-attach.schema.js +70 -0
  166. package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +6 -6
  167. package/node_modules/@kardalum/api-schemas/dist/sites.schema.d.ts +58 -25
  168. package/node_modules/@kardalum/api-schemas/dist/sites.schema.js +194 -48
  169. package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.d.ts +18 -6
  170. package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.js +14 -0
  171. package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.d.ts +2 -2
  172. package/node_modules/@kardalum/api-schemas/dist/strict-url.d.ts +12 -0
  173. package/node_modules/@kardalum/api-schemas/dist/strict-url.js +31 -0
  174. package/node_modules/@kardalum/api-schemas/dist/template-api.schema.d.ts +115 -1
  175. package/node_modules/@kardalum/api-schemas/dist/template-api.schema.js +65 -10
  176. package/node_modules/@kardalum/api-schemas/dist/template.schema.d.ts +37 -2
  177. package/node_modules/@kardalum/api-schemas/dist/template.schema.js +34 -8
  178. package/node_modules/@kardalum/api-schemas/dist/trash-cursor.schema.d.ts +4 -0
  179. package/node_modules/@kardalum/api-schemas/dist/trash-cursor.schema.js +29 -0
  180. package/node_modules/@kardalum/api-schemas/dist/user-api.schema.d.ts +16 -0
  181. package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +8 -0
  182. package/node_modules/@kardalum/api-schemas/dist/uuid.schema.d.ts +2 -0
  183. package/node_modules/@kardalum/api-schemas/dist/uuid.schema.js +4 -0
  184. package/node_modules/@kardalum/api-schemas/dist/vendor-service.schema.d.ts +88 -0
  185. package/node_modules/@kardalum/api-schemas/dist/vendor-service.schema.js +100 -0
  186. package/node_modules/@kardalum/api-schemas/dist/whoami-api.schema.d.ts +32 -0
  187. package/node_modules/@kardalum/api-schemas/dist/whoami-api.schema.js +27 -0
  188. package/node_modules/@kardalum/api-schemas/package.json +2 -2
  189. package/node_modules/@kardalum/design-tokens/README.md +1 -1
  190. package/node_modules/@kardalum/design-tokens/dist/build-theme-css.d.ts +16 -0
  191. package/node_modules/@kardalum/design-tokens/dist/build-theme-css.js +76 -0
  192. package/node_modules/@kardalum/design-tokens/dist/generate.js +4 -1
  193. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.css +176 -0
  194. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.d.ts +2 -1
  195. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.js +2 -0
  196. package/node_modules/@kardalum/design-tokens/dist/tokens.css +2 -0
  197. package/node_modules/@kardalum/design-tokens/dist/tokens.js +4 -0
  198. package/node_modules/@kardalum/design-tokens/dist/tokens.json +4 -2
  199. package/node_modules/@kardalum/design-tokens/dist/types.d.ts +2 -0
  200. package/node_modules/@kardalum/design-tokens/package.json +6 -3
  201. package/node_modules/@kardalum/plugin-package/README.md +5 -2
  202. package/node_modules/@kardalum/plugin-package/dist/build-reference.d.ts +6 -21
  203. package/node_modules/@kardalum/plugin-package/dist/build-reference.js +13 -8
  204. package/node_modules/@kardalum/plugin-package/dist/capabilities.d.ts +4 -4
  205. package/node_modules/@kardalum/plugin-package/dist/capabilities.js +59 -16
  206. package/node_modules/@kardalum/plugin-package/dist/client-bundle.d.ts +4 -0
  207. package/node_modules/@kardalum/plugin-package/dist/client-bundle.js +25 -0
  208. package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.d.ts +25 -0
  209. package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.js +203 -0
  210. package/node_modules/@kardalum/plugin-package/dist/delivery/bundle.d.ts +3 -0
  211. package/node_modules/@kardalum/plugin-package/dist/delivery/bundle.js +73 -0
  212. package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.d.ts +8 -0
  213. package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.js +77 -0
  214. package/node_modules/@kardalum/plugin-package/dist/delivery/icon-names.generated.d.ts +1 -0
  215. package/node_modules/@kardalum/plugin-package/dist/delivery/icon-names.generated.js +2052 -0
  216. package/node_modules/@kardalum/plugin-package/dist/delivery/icons.d.ts +2 -0
  217. package/node_modules/@kardalum/plugin-package/dist/delivery/icons.js +51 -0
  218. package/node_modules/@kardalum/plugin-package/dist/delivery/index.d.ts +8 -0
  219. package/node_modules/@kardalum/plugin-package/dist/delivery/index.js +7 -0
  220. package/node_modules/@kardalum/plugin-package/dist/delivery/label-languages.d.ts +17 -0
  221. package/node_modules/@kardalum/plugin-package/dist/delivery/label-languages.js +119 -0
  222. package/node_modules/@kardalum/plugin-package/dist/delivery/limits.d.ts +14 -0
  223. package/node_modules/@kardalum/plugin-package/dist/delivery/limits.js +21 -0
  224. package/node_modules/@kardalum/plugin-package/dist/delivery/locales.d.ts +5 -0
  225. package/node_modules/@kardalum/plugin-package/dist/delivery/locales.js +148 -0
  226. package/node_modules/@kardalum/plugin-package/dist/delivery/package-files.d.ts +5 -0
  227. package/node_modules/@kardalum/plugin-package/dist/delivery/package-files.js +76 -0
  228. package/node_modules/@kardalum/plugin-package/dist/delivery/registry.d.ts +22 -0
  229. package/node_modules/@kardalum/plugin-package/dist/delivery/registry.js +137 -0
  230. package/node_modules/@kardalum/plugin-package/dist/delivery/sample-content.d.ts +3 -0
  231. package/node_modules/@kardalum/plugin-package/dist/delivery/sample-content.js +90 -0
  232. package/node_modules/@kardalum/plugin-package/dist/delivery/support.d.ts +24 -0
  233. package/node_modules/@kardalum/plugin-package/dist/delivery/support.js +55 -0
  234. package/node_modules/@kardalum/plugin-package/dist/delivery/templates.d.ts +7 -0
  235. package/node_modules/@kardalum/plugin-package/dist/delivery/templates.js +215 -0
  236. package/node_modules/@kardalum/plugin-package/dist/delivery/types.d.ts +53 -0
  237. package/node_modules/@kardalum/plugin-package/dist/delivery/types.js +1 -0
  238. package/node_modules/@kardalum/plugin-package/dist/docs-contract.d.ts +3 -2
  239. package/node_modules/@kardalum/plugin-package/dist/docs-contract.js +4 -2
  240. package/node_modules/@kardalum/plugin-package/dist/extract.d.ts +92 -3
  241. package/node_modules/@kardalum/plugin-package/dist/extract.js +251 -41
  242. package/node_modules/@kardalum/plugin-package/dist/index.d.ts +13 -4
  243. package/node_modules/@kardalum/plugin-package/dist/index.js +10 -3
  244. package/node_modules/@kardalum/plugin-package/dist/license-verdict.d.ts +56 -19
  245. package/node_modules/@kardalum/plugin-package/dist/license-verdict.js +119 -25
  246. package/node_modules/@kardalum/plugin-package/dist/manifest-entry.d.ts +5 -0
  247. package/node_modules/@kardalum/plugin-package/dist/manifest-entry.js +20 -0
  248. package/node_modules/@kardalum/plugin-package/dist/reference-entry.d.ts +1 -0
  249. package/node_modules/@kardalum/plugin-package/dist/reference-entry.js +1 -0
  250. package/node_modules/@kardalum/plugin-package/dist/sample-content.d.ts +21 -3
  251. package/node_modules/@kardalum/plugin-package/dist/sample-content.js +37 -9
  252. package/node_modules/@kardalum/plugin-package/dist/shipped-files.d.ts +39 -0
  253. package/node_modules/@kardalum/plugin-package/dist/shipped-files.js +133 -0
  254. package/node_modules/@kardalum/plugin-package/dist/shipped-locales.d.ts +7 -0
  255. package/node_modules/@kardalum/plugin-package/dist/shipped-locales.js +27 -0
  256. package/node_modules/@kardalum/plugin-package/dist/vendor-token.d.ts +24 -0
  257. package/node_modules/@kardalum/plugin-package/dist/vendor-token.js +118 -0
  258. package/node_modules/@kardalum/plugin-package/package.json +4 -2
  259. package/node_modules/@kardalum/ui/README.md +1 -1
  260. package/node_modules/@kardalum/ui/dist/components/button.js +1 -1
  261. package/node_modules/@kardalum/ui/dist/components/checkbox.js +1 -1
  262. package/node_modules/@kardalum/ui/dist/components/dialog.js +5 -2
  263. package/node_modules/@kardalum/ui/dist/components/dropdown-menu.js +3 -3
  264. package/node_modules/@kardalum/ui/dist/components/input.js +1 -1
  265. package/node_modules/@kardalum/ui/dist/components/popover-panel.d.ts +4 -0
  266. package/node_modules/@kardalum/ui/dist/components/popover-panel.js +13 -0
  267. package/node_modules/@kardalum/ui/dist/components/sheet.js +5 -4
  268. package/node_modules/@kardalum/ui/dist/components/switch.js +1 -1
  269. package/node_modules/@kardalum/ui/dist/components/tab-strip.js +1 -1
  270. package/node_modules/@kardalum/ui/dist/components/toast.js +1 -1
  271. package/node_modules/@kardalum/ui/dist/index.d.ts +1 -0
  272. package/node_modules/@kardalum/ui/dist/index.js +1 -0
  273. package/node_modules/@kardalum/ui/package.json +1 -1
  274. package/package.json +19 -6
@@ -18,3 +18,7 @@ export declare const ContentRestoreResultSchema: z.ZodObject<{
18
18
  restoredCount: z.ZodNumber;
19
19
  }, z.core.$strip>;
20
20
  export type ContentRestoreResult = z.infer<typeof ContentRestoreResultSchema>;
21
+ export declare const ContentRestoreRequestSchema: z.ZodOptional<z.ZodNullable<z.ZodObject<{
22
+ parentId: z.ZodOptional<z.ZodString>;
23
+ }, z.core.$strip>>>;
24
+ export type ContentRestoreRequest = z.infer<typeof ContentRestoreRequestSchema>;
@@ -21,3 +21,6 @@ export const ContentTrashConfirmationSchema = z.object({
21
21
  });
22
22
  export const ContentTrashResultSchema = z.object({ trashedCount: z.number().int() });
23
23
  export const ContentRestoreResultSchema = z.object({ restoredCount: z.number().int() });
24
+ // S307: restoring an orphan (a page whose parent was permanently removed) under a parent the person
25
+ // chooses. Nullish for the reason the trash body gives: Fastify hands a missing body over as null.
26
+ export const ContentRestoreRequestSchema = z.object({ parentId: z.string().uuid().optional() }).nullish();
@@ -1,10 +1,11 @@
1
1
  import { z } from "zod";
2
+ import { TrashCursorSchema } from "./trash-cursor.schema.js";
2
3
  import { NodeAccessFlagsSchema } from "./node-access.schema.js";
3
4
  // S161: the trash browse surface. Separate from content-trash-api.schema.ts
4
5
  // (S154's trash/restore confirmation bodies) — this file is the list route
5
6
  // and the restore-blocked 409, added a session later.
6
7
  export const ContentTrashListQuerySchema = z.object({
7
- cursor: z.string().optional(),
8
+ cursor: TrashCursorSchema.optional(),
8
9
  limit: z.coerce.number().int().min(1).max(100).default(50),
9
10
  });
10
11
  export const TrashedSubtreeSchema = z.object({
@@ -20,7 +20,7 @@ export declare const CORE_ACTIONS: readonly [{
20
20
  readonly adminGatedToday: false;
21
21
  readonly label: "View content and mint preview links";
22
22
  readonly keyNote: "On the management API this also reads drafts, every saved version and preview links, not only published content.";
23
- readonly route: "GET /api/manage/v1/content/by-path, GET /api/manage/v1/content/by-address, GET /api/manage/v1/content/:id, GET /api/manage/v1/content/roots, GET /api/manage/v1/content/:id/children, GET /api/manage/v1/content/:id/list, GET /api/manage/v1/content/:id/url-impact, GET /api/manage/v1/content/:id/move-impact, GET /api/manage/v1/content/:id/versions, GET /api/manage/v1/content/:id/versions/latest, GET /api/manage/v1/content/:id/versions/:version, POST /api/manage/v1/content/:id/preview-token, GET /api/plugins/:pluginId/storage/:contentId/:fieldId";
23
+ readonly route: "GET /api/manage/v1/content/by-path, GET /api/manage/v1/content/by-address, GET /api/manage/v1/content/:id, GET /api/manage/v1/content/roots, GET /api/manage/v1/content/:id/children, GET /api/manage/v1/content/:id/list, GET /api/manage/v1/content/:id/url-impact, GET /api/manage/v1/content/:id/move-impact, GET /api/manage/v1/content/:id/versions, GET /api/manage/v1/content/:id/versions/latest, GET /api/manage/v1/content/:id/versions/:version, POST /api/manage/v1/content/:id/preview-token, GET /api/manage/v1/home/drafts, GET /api/manage/v1/home/recent-edits, GET /api/manage/v1/home/published, GET /api/plugins/:pluginId/storage/:contentId/:fieldId";
24
24
  }, {
25
25
  readonly action: "content.create";
26
26
  readonly adminGatedToday: false;
@@ -45,7 +45,7 @@ export declare const CORE_ACTIONS: readonly [{
45
45
  readonly action: "content.readTrash";
46
46
  readonly adminGatedToday: true;
47
47
  readonly label: "View trashed content";
48
- readonly route: "GET /api/manage/v1/content/trash";
48
+ readonly route: "GET /api/manage/v1/content/trash, GET /api/manage/v1/home/trash-count";
49
49
  }, {
50
50
  readonly action: "content.restore";
51
51
  readonly adminGatedToday: true;
@@ -135,11 +135,17 @@ export declare const CORE_ACTIONS: readonly [{
135
135
  readonly adminGatedToday: false;
136
136
  readonly label: "Configure data types";
137
137
  readonly route: "PATCH /api/manage/v1/data-types/:id";
138
+ }, {
139
+ readonly action: "dataTypes.delete";
140
+ readonly adminGatedToday: true;
141
+ readonly label: "Delete data types";
142
+ readonly keyNote: "Removes a data type for good. The server refuses a built-in data type, and one any document type still has a field of, naming those types.";
143
+ readonly route: "DELETE /api/manage/v1/data-types/:id";
138
144
  }, {
139
145
  readonly action: "templates.read";
140
146
  readonly adminGatedToday: false;
141
147
  readonly label: "View templates";
142
- readonly route: "GET /api/manage/v1/templates, GET /api/manage/v1/templates/:id";
148
+ readonly route: "GET /api/manage/v1/templates, GET /api/manage/v1/templates/:id, GET /api/manage/v1/templates/trash, GET /api/manage/v1/templates/:id/versions, GET /api/manage/v1/templates/:id/versions/:version";
143
149
  }, {
144
150
  readonly action: "templates.create";
145
151
  readonly adminGatedToday: true;
@@ -151,7 +157,7 @@ export declare const CORE_ACTIONS: readonly [{
151
157
  readonly adminGatedToday: true;
152
158
  readonly label: "Edit templates";
153
159
  readonly keyNote: "Changes code the server serves from the admin's own origin: with managementApi.use this is as strong as an admin session.";
154
- readonly route: "PATCH /api/manage/v1/templates/:id";
160
+ readonly route: "PATCH /api/manage/v1/templates/:id, POST /api/manage/v1/templates/:id/versions/:version/current, POST /api/manage/v1/templates/:id/restore";
155
161
  }, {
156
162
  readonly action: "templates.delete";
157
163
  readonly adminGatedToday: true;
@@ -168,7 +174,7 @@ export declare const CORE_ACTIONS: readonly [{
168
174
  readonly action: "assets.read";
169
175
  readonly adminGatedToday: false;
170
176
  readonly label: "View site assets";
171
- readonly route: "GET /api/manage/v1/assets/tree, GET /api/manage/v1/assets/content, GET /api/manage/v1/assets/raw";
177
+ readonly route: "GET /api/manage/v1/assets/tree, GET /api/manage/v1/assets/content, GET /api/manage/v1/assets/raw, GET /api/manage/v1/assets/versions, GET /api/manage/v1/assets/versions/:version, GET /api/manage/v1/assets/trash";
172
178
  }, {
173
179
  readonly action: "assets.create";
174
180
  readonly adminGatedToday: true;
@@ -180,7 +186,7 @@ export declare const CORE_ACTIONS: readonly [{
180
186
  readonly adminGatedToday: true;
181
187
  readonly label: "Edit and rename site assets";
182
188
  readonly keyNote: "Changes code the server serves from the admin's own origin: with managementApi.use this is as strong as an admin session.";
183
- readonly route: "PUT /api/manage/v1/assets/content, PATCH /api/manage/v1/assets/rename";
189
+ readonly route: "PUT /api/manage/v1/assets/content, PATCH /api/manage/v1/assets/rename, POST /api/manage/v1/assets/versions/:version/current, POST /api/manage/v1/assets/restore";
184
190
  }, {
185
191
  readonly action: "assets.delete";
186
192
  readonly adminGatedToday: true;
@@ -207,12 +213,12 @@ export declare const CORE_ACTIONS: readonly [{
207
213
  readonly action: "settings.read";
208
214
  readonly adminGatedToday: false;
209
215
  readonly label: "View settings";
210
- readonly route: "GET /api/manage/v1/settings/render, GET /api/manage/v1/settings/cultures, GET /api/manage/v1/settings/sites";
216
+ readonly route: "GET /api/manage/v1/settings/render, GET /api/manage/v1/settings/cultures, GET /api/manage/v1/settings/sites, GET /api/manage/v1/settings/nav, GET /api/manage/v1/settings/audit-retention, GET /api/manage/v1/home/news, GET /api/manage/v1/settings/notification-retention";
211
217
  }, {
212
218
  readonly action: "settings.update";
213
219
  readonly adminGatedToday: true;
214
220
  readonly label: "Change settings";
215
- readonly route: "PUT /api/manage/v1/settings/render, PUT /api/manage/v1/settings/cultures, PUT /api/manage/v1/settings/nav";
221
+ readonly route: "PUT /api/manage/v1/settings/render, PUT /api/manage/v1/settings/cultures, PUT /api/manage/v1/settings/nav, PUT /api/manage/v1/settings/notification-retention";
216
222
  }, {
217
223
  readonly action: "sites.manage";
218
224
  readonly adminGatedToday: true;
@@ -240,6 +246,12 @@ export declare const CORE_ACTIONS: readonly [{
240
246
  readonly label: "Change user roles";
241
247
  readonly keyNote: "Changes what a person may do by changing their role. A key is refused the admin role.";
242
248
  readonly route: "PATCH /api/manage/v1/users/:id/role";
249
+ }, {
250
+ readonly action: "users.delete";
251
+ readonly adminGatedToday: true;
252
+ readonly label: "Delete users";
253
+ readonly keyNote: "Removes a person's account and ends their sessions. A key is refused when the account is an administrator's.";
254
+ readonly route: "DELETE /api/manage/v1/users/:id";
243
255
  }, {
244
256
  readonly action: "roles.read";
245
257
  readonly adminGatedToday: true;
@@ -285,6 +297,30 @@ export declare const CORE_ACTIONS: readonly [{
285
297
  readonly adminGatedToday: true;
286
298
  readonly label: "Use the API playground";
287
299
  readonly route: "GET /api/manage/v1/api-playground/openapi";
300
+ }, {
301
+ readonly action: "audit.read";
302
+ readonly adminGatedToday: true;
303
+ readonly label: "View the audit log";
304
+ readonly keyNote: "Reads every audit entry, with the name and email of everyone who acted and the address they came from.";
305
+ readonly route: "GET /api/manage/v1/audit";
306
+ }, {
307
+ readonly action: "audit.export";
308
+ readonly adminGatedToday: true;
309
+ readonly label: "Export the audit log";
310
+ readonly keyNote: "Exports a month of audit entries, with the name and email of everyone who acted and the address they came from.";
311
+ readonly route: "GET /api/manage/v1/audit/export";
312
+ }, {
313
+ readonly action: "audit.prune";
314
+ readonly adminGatedToday: true;
315
+ readonly label: "Set audit log retention and remove archived months";
316
+ readonly keyNote: "A key is refused here: retention and pruning take a session, so this matters only to a session's role.";
317
+ readonly route: "PUT /api/manage/v1/settings/audit-retention, POST /api/manage/v1/audit/prune";
318
+ }, {
319
+ readonly action: "notifications.send";
320
+ readonly adminGatedToday: false;
321
+ readonly label: "Send notifications";
322
+ readonly keyNote: "Sends a notification to the inbox of everyone who holds the roles it names, and of the people it names, and lists every role and person to choose from.";
323
+ readonly route: "POST /api/manage/v1/notifications, GET /api/manage/v1/notifications/audience, POST /api/manage/v1/notifications/reach";
288
324
  }, {
289
325
  readonly action: "managementApi.use";
290
326
  readonly adminGatedToday: true;
@@ -295,7 +331,7 @@ export declare const CORE_ACTIONS: readonly [{
295
331
  readonly action: "plugins.read";
296
332
  readonly adminGatedToday: true;
297
333
  readonly label: "View installed plugins";
298
- readonly route: "GET /api/manage/v1/plugins, GET /api/manage/v1/marketplace/status, GET /api/manage/v1/plugins/:pluginId/snapshot-groups, GET /api/manage/v1/plugins/:pluginId/install-record, GET /api/manage/v1/plugin-docs, GET /api/manage/v1/plugin-docs/search-index, GET /api/manage/v1/plugin-docs/:pluginId/pages/:slug, GET /api/manage/v1/plugin-docs/:pluginId/reference";
334
+ readonly route: "GET /api/manage/v1/plugins, GET /api/manage/v1/marketplace/status, GET /api/manage/v1/plugins/:pluginId/snapshot-groups, GET /api/manage/v1/plugins/:pluginId/install-record, GET /api/manage/v1/plugin-docs, GET /api/manage/v1/plugin-docs/search-index, GET /api/manage/v1/plugin-docs/:pluginId/pages/:slug, GET /api/manage/v1/plugin-docs/:pluginId/reference, GET /api/manage/v1/home/plugin-fees";
299
335
  }, {
300
336
  readonly action: "plugins.browse";
301
337
  readonly adminGatedToday: true;
@@ -322,7 +358,7 @@ export declare const CORE_ACTIONS: readonly [{
322
358
  readonly action: "plugins.restore";
323
359
  readonly adminGatedToday: true;
324
360
  readonly label: "Restore a plugin from a snapshot";
325
- readonly route: "POST /api/manage/v1/plugins/:pluginId/snapshot-groups/restore";
361
+ readonly route: "POST /api/manage/v1/plugins/:pluginId/snapshot-groups/restore, POST /api/manage/v1/plugins/:pluginId/data-types/restore";
326
362
  }, {
327
363
  readonly action: "snapshots.read";
328
364
  readonly adminGatedToday: true;
@@ -338,6 +374,12 @@ export declare const CORE_ACTIONS: readonly [{
338
374
  readonly adminGatedToday: true;
339
375
  readonly label: "Restore a snapshot";
340
376
  readonly route: "POST /api/manage/v1/snapshots/:id/restore";
377
+ }, {
378
+ readonly action: "snapshots.delete";
379
+ readonly adminGatedToday: true;
380
+ readonly label: "Delete snapshots";
381
+ readonly keyNote: "Removes a snapshot for good: its record of which page versions were published. No page changes.";
382
+ readonly route: "DELETE /api/manage/v1/snapshots/:id";
341
383
  }];
342
384
  /** Every core action as a literal union, so a mistyped action string is a
343
385
  * compile error at the call site rather than a permission nobody holds. */
@@ -8,9 +8,9 @@
8
8
  // checklist. Since S271 the `adminGatedToday: true` routes carry
9
9
  // requireAction(<action>), and since S276 and S277 so do all the content rows.
10
10
  // Since S298 so do all the document type, data type and template rows.
11
- // Since S300a so do the asset and settings reads (the app bar's order read
12
- // excepted on purpose: it is open to every signed-in user and no action's
13
- // route). Since S300b so do the media rows: no route in the vocabulary asks
11
+ // Since S300a so do the asset and settings reads (the admin shell's app bar
12
+ // order read excepted on purpose: it is open to every signed-in user and no
13
+ // action's route; its management read, S309, asks settings.read). Since S300b so do the media rows: no route in the vocabulary asks
14
14
  // only for a session. The flag remains what the seeded editor role is derived
15
15
  // from.
16
16
  // Since S299 the `/api/v1` delivery routes ask the same actions for an API
@@ -28,12 +28,12 @@
28
28
  // string. The role editor renders this, the same way CAPABILITY_LABELS
29
29
  // renders capabilities.
30
30
  export const CORE_ACTIONS = [
31
- { action: "content.read", adminGatedToday: false, label: "View content and mint preview links", keyNote: "On the management API this also reads drafts, every saved version and preview links, not only published content.", route: "GET /api/manage/v1/content/by-path, GET /api/manage/v1/content/by-address, GET /api/manage/v1/content/:id, GET /api/manage/v1/content/roots, GET /api/manage/v1/content/:id/children, GET /api/manage/v1/content/:id/list, GET /api/manage/v1/content/:id/url-impact, GET /api/manage/v1/content/:id/move-impact, GET /api/manage/v1/content/:id/versions, GET /api/manage/v1/content/:id/versions/latest, GET /api/manage/v1/content/:id/versions/:version, POST /api/manage/v1/content/:id/preview-token, GET /api/plugins/:pluginId/storage/:contentId/:fieldId" },
31
+ { action: "content.read", adminGatedToday: false, label: "View content and mint preview links", keyNote: "On the management API this also reads drafts, every saved version and preview links, not only published content.", route: "GET /api/manage/v1/content/by-path, GET /api/manage/v1/content/by-address, GET /api/manage/v1/content/:id, GET /api/manage/v1/content/roots, GET /api/manage/v1/content/:id/children, GET /api/manage/v1/content/:id/list, GET /api/manage/v1/content/:id/url-impact, GET /api/manage/v1/content/:id/move-impact, GET /api/manage/v1/content/:id/versions, GET /api/manage/v1/content/:id/versions/latest, GET /api/manage/v1/content/:id/versions/:version, POST /api/manage/v1/content/:id/preview-token, GET /api/manage/v1/home/drafts, GET /api/manage/v1/home/recent-edits, GET /api/manage/v1/home/published, GET /api/plugins/:pluginId/storage/:contentId/:fieldId" },
32
32
  { action: "content.create", adminGatedToday: false, label: "Create and copy content", route: "POST /api/manage/v1/content, POST /api/manage/v1/content/:id/copy" },
33
33
  { action: "content.update", adminGatedToday: false, label: "Edit, move and reorder content", route: "PUT /api/manage/v1/content/:id, POST /api/manage/v1/content/:id/move, POST /api/manage/v1/content/roots/reorder, POST /api/manage/v1/content/:id/children/reorder, PUT /api/plugins/:pluginId/storage/:contentId/:fieldId" },
34
34
  { action: "content.publish", adminGatedToday: false, label: "Publish content", route: "POST /api/manage/v1/content/:id/publish, POST /api/manage/v1/content/:id/publish-all" },
35
35
  { action: "content.delete", adminGatedToday: true, label: "Move content to the trash", route: "DELETE /api/manage/v1/content/:id" },
36
- { action: "content.readTrash", adminGatedToday: true, label: "View trashed content", route: "GET /api/manage/v1/content/trash" },
36
+ { action: "content.readTrash", adminGatedToday: true, label: "View trashed content", route: "GET /api/manage/v1/content/trash, GET /api/manage/v1/home/trash-count" },
37
37
  { action: "content.restore", adminGatedToday: true, label: "Restore trashed content", route: "POST /api/manage/v1/content/:id/restore" },
38
38
  // S278: reading and saving a node's restrictions, and the search for the
39
39
  // roles and users a restriction can name. New with the permissions tab, so
@@ -60,21 +60,23 @@ export const CORE_ACTIONS = [
60
60
  { action: "dataTypes.read", adminGatedToday: false, label: "View data types", route: "GET /api/manage/v1/data-types, GET /api/manage/v1/data-types/:id" },
61
61
  { action: "dataTypes.create", adminGatedToday: false, label: "Create data types", route: "POST /api/manage/v1/data-types" },
62
62
  { action: "dataTypes.update", adminGatedToday: false, label: "Configure data types", route: "PATCH /api/manage/v1/data-types/:id" },
63
- { action: "templates.read", adminGatedToday: false, label: "View templates", route: "GET /api/manage/v1/templates, GET /api/manage/v1/templates/:id" },
63
+ { action: "dataTypes.delete", adminGatedToday: true, label: "Delete data types", keyNote: "Removes a data type for good. The server refuses a built-in data type, and one any document type still has a field of, naming those types.", route: "DELETE /api/manage/v1/data-types/:id" },
64
+ { action: "templates.read", adminGatedToday: false, label: "View templates", route: "GET /api/manage/v1/templates, GET /api/manage/v1/templates/:id, GET /api/manage/v1/templates/trash, GET /api/manage/v1/templates/:id/versions, GET /api/manage/v1/templates/:id/versions/:version" },
64
65
  { action: "templates.create", adminGatedToday: true, label: "Create templates", keyNote: "Changes code the server serves from the admin's own origin: with managementApi.use this is as strong as an admin session.", route: "POST /api/manage/v1/templates" },
65
- { action: "templates.update", adminGatedToday: true, label: "Edit templates", keyNote: "Changes code the server serves from the admin's own origin: with managementApi.use this is as strong as an admin session.", route: "PATCH /api/manage/v1/templates/:id" },
66
+ { action: "templates.update", adminGatedToday: true, label: "Edit templates", keyNote: "Changes code the server serves from the admin's own origin: with managementApi.use this is as strong as an admin session.", route: "PATCH /api/manage/v1/templates/:id, POST /api/manage/v1/templates/:id/versions/:version/current, POST /api/manage/v1/templates/:id/restore" },
66
67
  { action: "templates.delete", adminGatedToday: true, label: "Delete templates", keyNote: "Changes code the server serves from the admin's own origin: with managementApi.use this is as strong as an admin session.", route: "DELETE /api/manage/v1/templates/:id" },
67
68
  { action: "templates.sync", adminGatedToday: true, label: "Sync templates from disk", keyNote: "Changes code the server serves from the admin's own origin: with managementApi.use this is as strong as an admin session.", route: "POST /api/manage/v1/templates/sync" },
68
- { action: "assets.read", adminGatedToday: false, label: "View site assets", route: "GET /api/manage/v1/assets/tree, GET /api/manage/v1/assets/content, GET /api/manage/v1/assets/raw" },
69
+ { action: "assets.read", adminGatedToday: false, label: "View site assets", route: "GET /api/manage/v1/assets/tree, GET /api/manage/v1/assets/content, GET /api/manage/v1/assets/raw, GET /api/manage/v1/assets/versions, GET /api/manage/v1/assets/versions/:version, GET /api/manage/v1/assets/trash" },
69
70
  { action: "assets.create", adminGatedToday: true, label: "Upload site assets and create folders", keyNote: "Changes code the server serves from the admin's own origin: with managementApi.use this is as strong as an admin session.", route: "POST /api/manage/v1/assets/upload, POST /api/manage/v1/assets/extract-zip, POST /api/manage/v1/assets/folder" },
70
- { action: "assets.update", adminGatedToday: true, label: "Edit and rename site assets", keyNote: "Changes code the server serves from the admin's own origin: with managementApi.use this is as strong as an admin session.", route: "PUT /api/manage/v1/assets/content, PATCH /api/manage/v1/assets/rename" },
71
+ { action: "assets.update", adminGatedToday: true, label: "Edit and rename site assets", keyNote: "Changes code the server serves from the admin's own origin: with managementApi.use this is as strong as an admin session.", route: "PUT /api/manage/v1/assets/content, PATCH /api/manage/v1/assets/rename, POST /api/manage/v1/assets/versions/:version/current, POST /api/manage/v1/assets/restore" },
71
72
  { action: "assets.delete", adminGatedToday: true, label: "Delete site assets", keyNote: "Changes code the server serves from the admin's own origin: with managementApi.use this is as strong as an admin session.", route: "DELETE /api/manage/v1/assets" },
72
73
  { action: "assets.sync", adminGatedToday: true, label: "Sync site assets from disk", keyNote: "Changes code the server serves from the admin's own origin: with managementApi.use this is as strong as an admin session.", route: "POST /api/manage/v1/assets/sync" },
73
74
  { action: "render.read", adminGatedToday: true, label: "View text styles and embeddable blocks", route: "GET /api/manage/v1/render/text-styles, GET /api/manage/v1/render/blocks" },
74
75
  { action: "render.preview", adminGatedToday: true, label: "Render a block preview", route: "POST /api/manage/v1/render/block" },
75
- // S300a: the app bar's order read (GET /api/settings/nav) is open to every signed-in user on purpose (S281) and is no action's route; only its write is settings.update.
76
- { action: "settings.read", adminGatedToday: false, label: "View settings", route: "GET /api/manage/v1/settings/render, GET /api/manage/v1/settings/cultures, GET /api/manage/v1/settings/sites" },
77
- { action: "settings.update", adminGatedToday: true, label: "Change settings", route: "PUT /api/manage/v1/settings/render, PUT /api/manage/v1/settings/cultures, PUT /api/manage/v1/settings/nav" },
76
+ // S300a: the app bar's order read in the shell (GET /api/settings/nav) is open to every signed-in user on purpose (S281) and asks no action;
77
+ // its management read (GET /api/manage/v1/settings/nav, S309) asks settings.read, and its write is settings.update.
78
+ { action: "settings.read", adminGatedToday: false, label: "View settings", route: "GET /api/manage/v1/settings/render, GET /api/manage/v1/settings/cultures, GET /api/manage/v1/settings/sites, GET /api/manage/v1/settings/nav, GET /api/manage/v1/settings/audit-retention, GET /api/manage/v1/home/news, GET /api/manage/v1/settings/notification-retention" },
79
+ { action: "settings.update", adminGatedToday: true, label: "Change settings", route: "PUT /api/manage/v1/settings/render, PUT /api/manage/v1/settings/cultures, PUT /api/manage/v1/settings/nav, PUT /api/manage/v1/settings/notification-retention" },
78
80
  // S277d: a site's domains and the choice of default site. New with the
79
81
  // Site tab, so there was no earlier gate to read; admin-gated because it
80
82
  // decides which content every address of the install shows.
@@ -86,6 +88,7 @@ export const CORE_ACTIONS = [
86
88
  { action: "users.read", adminGatedToday: true, label: "View users", route: "GET /api/manage/v1/users" },
87
89
  { action: "users.create", adminGatedToday: true, label: "Invite users", keyNote: "A key is refused here: creating a user takes a session, so this matters only to a session's role.", route: "POST /api/manage/v1/users" },
88
90
  { action: "users.update", adminGatedToday: true, label: "Change user roles", keyNote: "Changes what a person may do by changing their role. A key is refused the admin role.", route: "PATCH /api/manage/v1/users/:id/role" },
91
+ { action: "users.delete", adminGatedToday: true, label: "Delete users", keyNote: "Removes a person's account and ends their sessions. A key is refused when the account is an administrator's.", route: "DELETE /api/manage/v1/users/:id" },
89
92
  // S272: new with the role editor, so there was no requireAdmin gate to
90
93
  // read. Marked admin-gated because granting the role editor to the seeded
91
94
  // editor would let that role grant itself anything.
@@ -97,6 +100,21 @@ export const CORE_ACTIONS = [
97
100
  { action: "apiKeys.create", adminGatedToday: true, label: "Create API keys", keyNote: "A key is refused here: key routes take a session only, so this matters only to a session's role.", route: "POST /api/manage/v1/api-keys" },
98
101
  { action: "apiKeys.revoke", adminGatedToday: true, label: "Revoke API keys", keyNote: "A key is refused here: key routes take a session only, so this matters only to a session's role.", route: "POST /api/manage/v1/api-keys/:id/revoke" },
99
102
  { action: "apiPlayground.read", adminGatedToday: true, label: "Use the API playground", route: "GET /api/manage/v1/api-playground/openapi" },
103
+ // S314b (P11): the audit log. Both admin-gated and both through requireAction, so a key
104
+ // that holds one beside managementApi.use reads the log too; the entries carry the name
105
+ // and email of everyone who acted, which the note says. The list is not itself recorded;
106
+ // the export is.
107
+ { action: "audit.read", adminGatedToday: true, label: "View the audit log", keyNote: "Reads every audit entry, with the name and email of everyone who acted and the address they came from.", route: "GET /api/manage/v1/audit" },
108
+ { action: "audit.export", adminGatedToday: true, label: "Export the audit log", keyNote: "Exports a month of audit entries, with the name and email of everyone who acted and the address they came from.", route: "GET /api/manage/v1/audit/export" },
109
+ // S314b2 (D2): audit log retention. Admin-gated and session-only: requireSessionAction
110
+ // refuses every key, so no script removes entries; the note says so. Reading the setting
111
+ // asks settings.read.
112
+ { action: "audit.prune", adminGatedToday: true, label: "Set audit log retention and remove archived months", keyNote: "A key is refused here: retention and pruning take a session, so this matters only to a session's role.", route: "PUT /api/manage/v1/settings/audit-retention, POST /api/manage/v1/audit/prune" },
113
+ // S314n2 (3b): sending a notification to roles and people, and the two reads the
114
+ // compose sheet asks (the audience search and the reach). Not admin-gated, so the
115
+ // seeded editor is offered it (EDITOR_ACTIONS_ADDED_AFTER_SEED in seed-roles.ts); a
116
+ // site's administrator grants it to any other role on the Roles screen.
117
+ { action: "notifications.send", adminGatedToday: false, label: "Send notifications", keyNote: "Sends a notification to the inbox of everyone who holds the roles it names, and of the people it names, and lists every role and person to choose from.", route: "POST /api/manage/v1/notifications, GET /api/manage/v1/notifications/audience, POST /api/manage/v1/notifications/reach" },
100
118
  // Row C2 of 2026-10-16-s300a-management-routes-the-structure-side-design.md
101
119
  // (section 4b): what an API key must hold, beside the route's own action, to
102
120
  // reach any route under /api/manage/v1, hence the wildcard. requireAction
@@ -110,15 +128,16 @@ export const CORE_ACTIONS = [
110
128
  label: "Let API keys use the management API", keyNote: "Lets a key call the management API with the actions it also holds. Never give it to a key that ships in a browser.",
111
129
  route: "GET /api/manage/v1/*, POST /api/manage/v1/*, PUT /api/manage/v1/*, PATCH /api/manage/v1/*, DELETE /api/manage/v1/*",
112
130
  },
113
- { action: "plugins.read", adminGatedToday: true, label: "View installed plugins", route: "GET /api/manage/v1/plugins, GET /api/manage/v1/marketplace/status, GET /api/manage/v1/plugins/:pluginId/snapshot-groups, GET /api/manage/v1/plugins/:pluginId/install-record, GET /api/manage/v1/plugin-docs, GET /api/manage/v1/plugin-docs/search-index, GET /api/manage/v1/plugin-docs/:pluginId/pages/:slug, GET /api/manage/v1/plugin-docs/:pluginId/reference" },
131
+ { action: "plugins.read", adminGatedToday: true, label: "View installed plugins", route: "GET /api/manage/v1/plugins, GET /api/manage/v1/marketplace/status, GET /api/manage/v1/plugins/:pluginId/snapshot-groups, GET /api/manage/v1/plugins/:pluginId/install-record, GET /api/manage/v1/plugin-docs, GET /api/manage/v1/plugin-docs/search-index, GET /api/manage/v1/plugin-docs/:pluginId/pages/:slug, GET /api/manage/v1/plugin-docs/:pluginId/reference, GET /api/manage/v1/home/plugin-fees" },
114
132
  { action: "plugins.browse", adminGatedToday: true, label: "Browse the plugin marketplace", route: "GET /api/manage/v1/marketplace/listings, GET /api/manage/v1/marketplace/listings/:pluginId" },
115
133
  { action: "plugins.install", adminGatedToday: true, label: "Install plugins", keyNote: "Puts code into the server process. An unsigned package is not refused.", route: "POST /api/manage/v1/marketplace/install, POST /api/manage/v1/plugins/upload" },
116
134
  { action: "plugins.update", adminGatedToday: true, label: "Enable or disable plugins", route: "POST /api/manage/v1/plugins/:pluginId/activate, POST /api/manage/v1/plugins/:pluginId/deactivate, POST /api/manage/v1/plugins/:pluginId/license/recheck" },
117
135
  { action: "plugins.delete", adminGatedToday: true, label: "Uninstall plugins", keyNote: "Removes an installed plugin from the site.", route: "DELETE /api/manage/v1/plugins/:pluginId" },
118
- { action: "plugins.restore", adminGatedToday: true, label: "Restore a plugin from a snapshot", route: "POST /api/manage/v1/plugins/:pluginId/snapshot-groups/restore" },
136
+ { action: "plugins.restore", adminGatedToday: true, label: "Restore a plugin from a snapshot", route: "POST /api/manage/v1/plugins/:pluginId/snapshot-groups/restore, POST /api/manage/v1/plugins/:pluginId/data-types/restore" },
119
137
  { action: "snapshots.read", adminGatedToday: true, label: "View snapshots", route: "GET /api/manage/v1/snapshots" },
120
138
  { action: "snapshots.create", adminGatedToday: true, label: "Create snapshots", route: "POST /api/manage/v1/snapshots" },
121
139
  { action: "snapshots.restore", adminGatedToday: true, label: "Restore a snapshot", route: "POST /api/manage/v1/snapshots/:id/restore" },
140
+ { action: "snapshots.delete", adminGatedToday: true, label: "Delete snapshots", keyNote: "Removes a snapshot for good: its record of which page versions were published. No page changes.", route: "DELETE /api/manage/v1/snapshots/:id" },
122
141
  ];
123
142
  export const CORE_ACTION_STRINGS = CORE_ACTIONS.map((entry) => entry.action);
124
143
  const CORE_SET = new Set(CORE_ACTION_STRINGS);
@@ -25,12 +25,62 @@ export declare const DataTypeListQuerySchema: z.ZodObject<{
25
25
  limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
26
26
  }, z.core.$strip>;
27
27
  export type DataTypeListQuery = z.infer<typeof DataTypeListQuerySchema>;
28
+ export declare const DataTypeEditorPluginSchema: z.ZodObject<{
29
+ readOnly: z.ZodOptional<z.ZodObject<{
30
+ code: z.ZodLiteral<"plugin_read_only">;
31
+ pluginId: z.ZodString;
32
+ pluginName: z.ZodString;
33
+ canRenew: z.ZodBoolean;
34
+ message: z.ZodString;
35
+ renewUrl: z.ZodOptional<z.ZodString>;
36
+ lapsedAt: z.ZodOptional<z.ZodString>;
37
+ }, z.core.$strip>>;
38
+ pluginId: z.ZodString;
39
+ name: z.ZodString;
40
+ enabled: z.ZodBoolean;
41
+ }, z.core.$strip>;
42
+ export type DataTypeEditorPlugin = z.infer<typeof DataTypeEditorPluginSchema>;
43
+ export declare const DataTypeListItemSchema: z.ZodObject<{
44
+ id: z.ZodString;
45
+ name: z.ZodString;
46
+ editorId: z.ZodString;
47
+ settings: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
48
+ editorPlugin: z.ZodOptional<z.ZodObject<{
49
+ readOnly: z.ZodOptional<z.ZodObject<{
50
+ code: z.ZodLiteral<"plugin_read_only">;
51
+ pluginId: z.ZodString;
52
+ pluginName: z.ZodString;
53
+ canRenew: z.ZodBoolean;
54
+ message: z.ZodString;
55
+ renewUrl: z.ZodOptional<z.ZodString>;
56
+ lapsedAt: z.ZodOptional<z.ZodString>;
57
+ }, z.core.$strip>>;
58
+ pluginId: z.ZodString;
59
+ name: z.ZodString;
60
+ enabled: z.ZodBoolean;
61
+ }, z.core.$strip>>;
62
+ }, z.core.$strict>;
63
+ export type DataTypeListItem = z.infer<typeof DataTypeListItemSchema>;
28
64
  export declare const DataTypeListResponseSchema: z.ZodObject<{
29
65
  items: z.ZodArray<z.ZodObject<{
30
66
  id: z.ZodString;
31
67
  name: z.ZodString;
32
68
  editorId: z.ZodString;
33
69
  settings: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
70
+ editorPlugin: z.ZodOptional<z.ZodObject<{
71
+ readOnly: z.ZodOptional<z.ZodObject<{
72
+ code: z.ZodLiteral<"plugin_read_only">;
73
+ pluginId: z.ZodString;
74
+ pluginName: z.ZodString;
75
+ canRenew: z.ZodBoolean;
76
+ message: z.ZodString;
77
+ renewUrl: z.ZodOptional<z.ZodString>;
78
+ lapsedAt: z.ZodOptional<z.ZodString>;
79
+ }, z.core.$strip>>;
80
+ pluginId: z.ZodString;
81
+ name: z.ZodString;
82
+ enabled: z.ZodBoolean;
83
+ }, z.core.$strip>>;
34
84
  }, z.core.$strict>>;
35
85
  nextCursor: z.ZodNullable<z.ZodString>;
36
86
  }, z.core.$strip>;
@@ -1,5 +1,7 @@
1
1
  import { z } from "zod";
2
+ import { PluginReadOnlyNoticeSchema } from "./plugin-read-only.schema.js";
2
3
  import { DataTypeConfigSchema } from "./data-type-config.schema.js";
4
+ import { DATA_TYPE_CURSOR_MAX, decodeDataTypeCursor } from "./data-type-cursor.js";
3
5
  export const CreateDataTypeRequestSchema = z
4
6
  .object({
5
7
  name: z.string().min(1),
@@ -19,14 +21,32 @@ export const UpdateDataTypeRequestSchema = z
19
21
  export const DataTypeResponseSchema = z.object({
20
22
  dataType: DataTypeConfigSchema,
21
23
  });
22
- // Ordered name ASC (id ASC tiebreak) for the Settings tree; cursor = id
23
- // of the previous page's last config.
24
+ // Ordered name ASC (id ASC tiebreak) for the Settings tree. S314c5 (D3): the cursor is opaque
25
+ // (dataTypeCursor of the previous page's last row); one that does not decode is a 400.
24
26
  export const DataTypeListQuerySchema = z.object({
25
- cursor: z.string().uuid().optional(),
27
+ cursor: z
28
+ .string()
29
+ .max(DATA_TYPE_CURSOR_MAX)
30
+ .refine((value) => decodeDataTypeCursor(value) !== null, { message: "Not a data type list cursor" })
31
+ .optional(),
26
32
  limit: z.coerce.number().int().min(1).max(100).default(50),
27
33
  });
34
+ // S314o3 (D3, D4): the plugin a data type's editor comes from, as the list names it: its id, its
35
+ // name and whether it is switched on. Absent for a built-in editor and for an editor no installed
36
+ // plugin contributes. A data type whose plugin is off cannot be used for a new field, and the
37
+ // admin's pickers say so.
38
+ export const DataTypeEditorPluginSchema = z.object({
39
+ // S318: present only when the plugin is read-only.
40
+ readOnly: PluginReadOnlyNoticeSchema.optional(),
41
+ pluginId: z.string(),
42
+ name: z.string(),
43
+ enabled: z.boolean(),
44
+ });
45
+ export const DataTypeListItemSchema = DataTypeConfigSchema.extend({
46
+ editorPlugin: DataTypeEditorPluginSchema.optional(),
47
+ }).strict();
28
48
  export const DataTypeListResponseSchema = z.object({
29
- items: z.array(DataTypeConfigSchema),
49
+ items: z.array(DataTypeListItemSchema),
30
50
  // null = no more pages.
31
- nextCursor: z.string().uuid().nullable(),
51
+ nextCursor: z.string().nullable(),
32
52
  });
@@ -6,4 +6,5 @@ export declare const DataTypeConfigSchema: z.ZodObject<{
6
6
  settings: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
7
7
  }, z.core.$strict>;
8
8
  export type DataTypeConfig = z.infer<typeof DataTypeConfigSchema>;
9
+ export declare const RICHTEXT_EDITOR_ID = "com.kardalum.richtext";
9
10
  export declare const BUILT_IN_DATA_TYPE_CONFIGS: readonly DataTypeConfig[];
@@ -17,6 +17,9 @@ export const DataTypeConfigSchema = z
17
17
  settings: z.record(z.string(), z.unknown()).default({}),
18
18
  })
19
19
  .strict();
20
+ // S314p (D1): the rich text editor's id, which the server's content writes look for when a value
21
+ // arrives as HTML.
22
+ export const RICHTEXT_EDITOR_ID = "com.kardalum.richtext";
20
23
  // Every built-in editor seeds one default config in migration
21
24
  // 0006_data_types, with these FIXED ids — the single source of truth
22
25
  // shared by the migrations, tests, and any code that needs "the plain
@@ -0,0 +1,11 @@
1
+ /** The longest cursor decoded: a name and an id fit far inside it, and a longer string is not read. */
2
+ export declare const DATA_TYPE_CURSOR_MAX = 8192;
3
+ export declare function dataTypeCursor(row: {
4
+ name: string;
5
+ id: string;
6
+ }): string;
7
+ /** Null for anything this module did not mint: never throws, so a typed cursor is a 400, never a 500. */
8
+ export declare function decodeDataTypeCursor(cursor: string): {
9
+ name: string;
10
+ id: string;
11
+ } | null;
@@ -0,0 +1,28 @@
1
+ import { base64UrlDecode, base64UrlEncode, utf8Bytes, utf8String } from "./media-reference-use.js";
2
+ // S314c5 (D3): the data type list is ordered by (name, id), so its cursor carries both of the
3
+ // previous page's last row. A cursor that named only the id looked the name up again, and a
4
+ // deleted cursor row then gave an empty page. Opaque, base64url of a JSON pair as the media
5
+ // reference cursor is: a name may hold any character, so no separator is safe. Minted here and
6
+ // decoded by the adapter and the list query; nothing else parses it.
7
+ /** The longest cursor decoded: a name and an id fit far inside it, and a longer string is not read. */
8
+ export const DATA_TYPE_CURSOR_MAX = 8192;
9
+ export function dataTypeCursor(row) {
10
+ return base64UrlEncode(utf8Bytes(JSON.stringify([row.name, row.id])));
11
+ }
12
+ /** Null for anything this module did not mint: never throws, so a typed cursor is a 400, never a 500. */
13
+ export function decodeDataTypeCursor(cursor) {
14
+ if (cursor.length === 0 || cursor.length > DATA_TYPE_CURSOR_MAX)
15
+ return null;
16
+ try {
17
+ const bytes = base64UrlDecode(cursor);
18
+ if (!bytes)
19
+ return null;
20
+ const parsed = JSON.parse(utf8String(bytes));
21
+ if (!Array.isArray(parsed) || parsed.length !== 2 || typeof parsed[0] !== "string" || typeof parsed[1] !== "string")
22
+ return null;
23
+ return { name: parsed[0], id: parsed[1] };
24
+ }
25
+ catch {
26
+ return null;
27
+ }
28
+ }
@@ -88,7 +88,28 @@ export const CreateDocumentTypeRequestSchema = z
88
88
  })
89
89
  .strict(),
90
90
  ])
91
- .superRefine(validateFieldsAndTabs);
91
+ .superRefine(validateFieldsAndTabs)
92
+ // S314c6 (D6): a generated field names a tab id the generated (empty) tab list does not
93
+ // declare, which the refinement refuses; the example declares the tab its field sits on.
94
+ .meta({
95
+ example: {
96
+ name: "Article",
97
+ icon: "document",
98
+ kind: "page",
99
+ fields: [
100
+ {
101
+ id: "title",
102
+ name: "Title",
103
+ datatypeId: "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
104
+ validation: { required: true, maxLength: 120 },
105
+ tabId: "f47ac10b-58cc-4372-a567-0e02b2c3d479",
106
+ varies: true,
107
+ }
108
+ ],
109
+ treeRules: { allowedAtRoot: true, allowedParentTypes: [], allowedChildTypes: [] },
110
+ tabs: [{ id: "f47ac10b-58cc-4372-a567-0e02b2c3d479", name: "Content" }],
111
+ },
112
+ });
92
113
  // PUT /api/manage/v1/document-types/:id: the mutable subset only. `kind` is
93
114
  // immutable after creation (a payload carrying it fails .strict() — the
94
115
  // intended behavior, not an accident) and `defaultTemplateId` stays with
@@ -121,7 +142,26 @@ export const UpdateDocumentTypeRequestSchema = z
121
142
  catchAll: z.boolean().optional(),
122
143
  })
123
144
  .strict()
124
- .superRefine(validateFieldsAndTabs);
145
+ .superRefine(validateFieldsAndTabs)
146
+ // S314c6 (D6): as on create, the example declares the tab its field sits on.
147
+ .meta({
148
+ example: {
149
+ name: "Article",
150
+ icon: "document",
151
+ fields: [
152
+ {
153
+ id: "title",
154
+ name: "Title",
155
+ datatypeId: "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
156
+ validation: { required: true, maxLength: 120 },
157
+ tabId: "f47ac10b-58cc-4372-a567-0e02b2c3d479",
158
+ varies: true,
159
+ }
160
+ ],
161
+ tabs: [{ id: "f47ac10b-58cc-4372-a567-0e02b2c3d479", name: "Content" }],
162
+ treeRules: { allowedAtRoot: true, allowedParentTypes: [], allowedChildTypes: [] },
163
+ },
164
+ });
125
165
  export const CreateDocumentTypeResponseSchema = z.object({
126
166
  documentType: DocumentTypeDefinitionSchema,
127
167
  });