@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
@@ -77,8 +77,27 @@ export declare const TemplateListQuerySchema: z.ZodObject<{
77
77
  cursor: z.ZodOptional<z.ZodString>;
78
78
  limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
79
79
  documentTypeId: z.ZodOptional<z.ZodString>;
80
+ kind: z.ZodOptional<z.ZodEnum<{
81
+ page: "page";
82
+ layout: "layout";
83
+ partial: "partial";
84
+ }>>;
80
85
  }, z.core.$strip>;
81
86
  export type TemplateListQuery = z.infer<typeof TemplateListQuerySchema>;
87
+ export declare const TemplateListItemSchema: z.ZodObject<{
88
+ id: z.ZodString;
89
+ name: z.ZodString;
90
+ alias: z.ZodString;
91
+ kind: z.ZodEnum<{
92
+ page: "page";
93
+ layout: "layout";
94
+ partial: "partial";
95
+ }>;
96
+ documentTypeId: z.ZodNullable<z.ZodString>;
97
+ currentVersion: z.ZodNumber;
98
+ ownedBy: z.ZodNullable<z.ZodString>;
99
+ }, z.core.$strict>;
100
+ export type TemplateListItem = z.infer<typeof TemplateListItemSchema>;
82
101
  export declare const TemplateListResponseSchema: z.ZodObject<{
83
102
  items: z.ZodArray<z.ZodObject<{
84
103
  id: z.ZodString;
@@ -91,6 +110,7 @@ export declare const TemplateListResponseSchema: z.ZodObject<{
91
110
  }>;
92
111
  documentTypeId: z.ZodNullable<z.ZodString>;
93
112
  currentVersion: z.ZodNumber;
113
+ ownedBy: z.ZodNullable<z.ZodString>;
94
114
  }, z.core.$strict>>;
95
115
  nextCursor: z.ZodNullable<z.ZodString>;
96
116
  }, z.core.$strip>;
@@ -107,6 +127,100 @@ export declare const TemplateSyncReportSchema: z.ZodObject<{
107
127
  version: z.ZodNumber;
108
128
  }, z.core.$strip>>;
109
129
  healed: z.ZodArray<z.ZodString>;
110
- unmatched: z.ZodArray<z.ZodString>;
130
+ adopted: z.ZodArray<z.ZodObject<{
131
+ id: z.ZodString;
132
+ file: z.ZodString;
133
+ alias: z.ZodString;
134
+ kind: z.ZodEnum<{
135
+ page: "page";
136
+ layout: "layout";
137
+ partial: "partial";
138
+ }>;
139
+ }, z.core.$strip>>;
140
+ skipped: z.ZodArray<z.ZodObject<{
141
+ file: z.ZodString;
142
+ reason: z.ZodString;
143
+ }, z.core.$strip>>;
144
+ ignored: z.ZodOptional<z.ZodArray<z.ZodObject<{
145
+ entry: z.ZodString;
146
+ reason: z.ZodString;
147
+ }, z.core.$strip>>>;
148
+ ignoredMore: z.ZodOptional<z.ZodNumber>;
111
149
  }, z.core.$strip>;
112
150
  export type TemplateSyncReport = z.infer<typeof TemplateSyncReportSchema>;
151
+ export declare const TemplateVersionParamsSchema: z.ZodObject<{
152
+ id: z.ZodString;
153
+ version: z.ZodCoercedNumber<unknown>;
154
+ }, z.core.$strip>;
155
+ export type TemplateVersionParams = z.infer<typeof TemplateVersionParamsSchema>;
156
+ export declare const TemplateVersionListResponseSchema: z.ZodObject<{
157
+ items: z.ZodArray<z.ZodObject<{
158
+ id: z.ZodString;
159
+ createdAt: z.ZodString;
160
+ source: z.ZodEnum<{
161
+ admin: "admin";
162
+ "plugin-install": "plugin-install";
163
+ "file-sync": "file-sync";
164
+ }>;
165
+ templateId: z.ZodString;
166
+ version: z.ZodNumber;
167
+ hash: z.ZodString;
168
+ }, z.core.$strict>>;
169
+ nextCursor: z.ZodNullable<z.ZodNumber>;
170
+ }, z.core.$strip>;
171
+ export type TemplateVersionListResponse = z.infer<typeof TemplateVersionListResponseSchema>;
172
+ export declare const TemplateVersionResponseSchema: z.ZodObject<{
173
+ version: z.ZodObject<{
174
+ id: z.ZodString;
175
+ templateId: z.ZodString;
176
+ version: z.ZodNumber;
177
+ content: z.ZodString;
178
+ hash: z.ZodString;
179
+ source: z.ZodEnum<{
180
+ admin: "admin";
181
+ "plugin-install": "plugin-install";
182
+ "file-sync": "file-sync";
183
+ }>;
184
+ createdAt: z.ZodString;
185
+ }, z.core.$strict>;
186
+ }, z.core.$strip>;
187
+ export type TemplateVersionResponse = z.infer<typeof TemplateVersionResponseSchema>;
188
+ export declare const TemplateTrashListQuerySchema: z.ZodObject<{
189
+ cursor: z.ZodOptional<z.ZodString>;
190
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
191
+ }, z.core.$strip>;
192
+ export type TemplateTrashListQuery = z.infer<typeof TemplateTrashListQuerySchema>;
193
+ export declare const TemplateTrashListResponseSchema: z.ZodObject<{
194
+ items: z.ZodArray<z.ZodObject<{
195
+ id: z.ZodString;
196
+ name: z.ZodString;
197
+ alias: z.ZodString;
198
+ kind: z.ZodEnum<{
199
+ page: "page";
200
+ layout: "layout";
201
+ partial: "partial";
202
+ }>;
203
+ documentTypeId: z.ZodNullable<z.ZodString>;
204
+ currentVersion: z.ZodNumber;
205
+ deletedAt: z.ZodString;
206
+ }, z.core.$strict>>;
207
+ nextCursor: z.ZodNullable<z.ZodString>;
208
+ }, z.core.$strip>;
209
+ export type TemplateTrashListResponse = z.infer<typeof TemplateTrashListResponseSchema>;
210
+ export declare const RestoreTemplateResponseSchema: z.ZodObject<{
211
+ template: z.ZodObject<{
212
+ id: z.ZodString;
213
+ name: z.ZodString;
214
+ alias: z.ZodString;
215
+ kind: z.ZodEnum<{
216
+ page: "page";
217
+ layout: "layout";
218
+ partial: "partial";
219
+ }>;
220
+ documentTypeId: z.ZodNullable<z.ZodString>;
221
+ currentVersion: z.ZodNumber;
222
+ }, z.core.$strict>;
223
+ content: z.ZodString;
224
+ foldedFile: z.ZodBoolean;
225
+ }, z.core.$strip>;
226
+ export type RestoreTemplateResponse = z.infer<typeof RestoreTemplateResponseSchema>;
@@ -1,18 +1,24 @@
1
1
  import { z } from "zod";
2
- import { TemplateAliasSchema, TemplateDefinitionSchema, TemplateKindSchema, } from "./template.schema.js";
3
- // One template source file is capped at 1MB — kin of the render budget:
4
- // a template is code a human edits, not a data blob.
2
+ import { TrashCursorSchema } from "./trash-cursor.schema.js";
3
+ import { TemplateAliasSchema, TemplateDefinitionSchema, TemplateKindSchema, TemplateVersionMetaSchema, TemplateVersionSchema, TrashedTemplateSchema, } from "./template.schema.js";
4
+ // S314c3 (D8): the default of a site's template limit, in UTF-8 bytes. The server holds every
5
+ // write to KARDALUM_MAX_TEMPLATE_BYTES (this number unless raised); the plugin build holds a
6
+ // package to this number (D10). The request schemas carry no maximum of their own, so the
7
+ // configured limit is enforced in one place.
5
8
  export const MAX_TEMPLATE_CONTENT_BYTES = 1_048_576;
6
9
  // alias is optional: when omitted the server derives it from `name`
7
- // (slugify + uniqueness suffix) so the pre-existing admin-UI call shape
8
- // {name, documentTypeId} keeps working unchanged.
10
+ // (slugify + uniqueness suffix among templates of the same kind) so the
11
+ // pre-existing admin-UI call shape {name, documentTypeId} keeps working
12
+ // unchanged. S314o2 (D3): the file is written into the kind's folder, and an
13
+ // alias that starts with pages/, layouts/ or partials/ is answered 400: the
14
+ // kind decides the folder.
9
15
  export const CreateTemplateRequestSchema = z
10
16
  .object({
11
17
  name: z.string().min(1),
12
18
  alias: TemplateAliasSchema.optional(),
13
19
  kind: TemplateKindSchema.default("page"),
14
20
  documentTypeId: z.string().uuid().nullable().optional(),
15
- content: z.string().max(MAX_TEMPLATE_CONTENT_BYTES).default(""),
21
+ content: z.string().default(""),
16
22
  })
17
23
  .strict();
18
24
  // baseVersion is optional-conflict-detection only (S195): it never enters
@@ -21,7 +27,7 @@ export const CreateTemplateRequestSchema = z
21
27
  export const UpdateTemplateRequestSchema = z
22
28
  .object({
23
29
  name: z.string().min(1).optional(),
24
- content: z.string().max(MAX_TEMPLATE_CONTENT_BYTES).optional(),
30
+ content: z.string().optional(),
25
31
  baseVersion: z.number().int().min(1).optional(),
26
32
  })
27
33
  .strict()
@@ -51,14 +57,21 @@ export const TemplateResponseSchema = z.object({
51
57
  export const CreateTemplateResponseSchema = TemplateResponseSchema;
52
58
  // Per api-design.md, list endpoints are always cursor-paginated. The
53
59
  // optional documentTypeId filter is what the builder's template picker
54
- // uses to list "templates for this document type."
60
+ // uses to list "templates for this document type"; the optional kind
61
+ // (S314o2 D6) lists one of the three folders.
55
62
  export const TemplateListQuerySchema = z.object({
56
63
  cursor: z.string().uuid().optional(),
57
64
  limit: z.coerce.number().int().min(1).max(100).default(50),
58
65
  documentTypeId: z.string().uuid().optional(),
66
+ kind: TemplateKindSchema.optional(),
59
67
  });
68
+ // S314g (P6): a list row names the plugin that ships the template (from the
69
+ // plugin tracking table, read by the route), or null for the operator's own.
70
+ // A route-level field: TemplateDefinitionSchema, and every adapter row mapper
71
+ // behind it, stay as they are.
72
+ export const TemplateListItemSchema = TemplateDefinitionSchema.extend({ ownedBy: z.string().min(1).nullable() });
60
73
  export const TemplateListResponseSchema = z.object({
61
- items: z.array(TemplateDefinitionSchema),
74
+ items: z.array(TemplateListItemSchema),
62
75
  nextCursor: z.string().uuid().nullable(),
63
76
  });
64
77
  // Body for PATCH /api/manage/v1/document-types/:id/default-template.
@@ -66,9 +79,51 @@ export const SetDefaultTemplateRequestSchema = z.object({
66
79
  templateId: z.string().uuid().nullable(),
67
80
  });
68
81
  // POST /api/manage/v1/templates/sync: the "Sync files" action's report.
82
+ // S314j (D3, D4, D7): `adopted` lists the .liquid files no template owned that
83
+ // became templates (the file as found, the alias it took, the kind its folder
84
+ // gave it); `skipped` lists every file in the three kind folders the walk did
85
+ // not adopt, with why (an alias taken, a name that cannot be an alias, over
86
+ // 1 MiB, too deep, an .html file, the folder's entry cap). S314o2 (D1, P2):
87
+ // `ignored` names every top-level entry outside pages/, layouts/ and
88
+ // partials/ once (a file by its name, a folder with a trailing "/"), with a
89
+ // reason that follows the name in a sentence; the server always answers it.
69
90
  export const TemplateSyncReportSchema = z.object({
70
91
  checked: z.number().int().min(0),
71
92
  updated: z.array(z.object({ id: z.string().uuid(), alias: z.string(), version: z.number().int() })),
72
93
  healed: z.array(z.string()),
73
- unmatched: z.array(z.string()),
94
+ adopted: z.array(z.object({ id: z.string().uuid(), file: z.string(), alias: z.string(), kind: TemplateKindSchema })),
95
+ skipped: z.array(z.object({ file: z.string(), reason: z.string() })),
96
+ ignored: z.array(z.object({ entry: z.string(), reason: z.string() })).optional(),
97
+ // S314c5: how many entries outside the three folders the walk did not name one by one. When it
98
+ // is above 0, the last `ignored` entry is the one that says so (for a reader that lists them);
99
+ // the count of real entries is `ignored.length - 1 + ignoredMore`.
100
+ ignoredMore: z.number().int().min(0).optional(),
74
101
  });
102
+ // S314g (D5, P3): a template's history. The list is metadata, newest first, a
103
+ // page at a time; its query is content's VersionListQuerySchema (cursor = the
104
+ // last version number of the previous page, limit 1..100, default 20) and its
105
+ // nextCursor is null once version 1 was returned.
106
+ export const TemplateVersionParamsSchema = z.object({
107
+ id: z.string().uuid(),
108
+ version: z.coerce.number().int().positive(),
109
+ });
110
+ export const TemplateVersionListResponseSchema = z.object({
111
+ items: z.array(TemplateVersionMetaSchema),
112
+ nextCursor: z.number().int().positive().nullable(),
113
+ });
114
+ // One version with its text, as content's version read answers `{ version }`.
115
+ export const TemplateVersionResponseSchema = z.object({ version: TemplateVersionSchema });
116
+ // The templates trash, newest first; the cursor is `${deletedAt}|${id}`.
117
+ export const TemplateTrashListQuerySchema = z.object({
118
+ cursor: TrashCursorSchema.optional(),
119
+ limit: z.coerce.number().int().min(1).max(100).default(50),
120
+ });
121
+ export const TemplateTrashListResponseSchema = z.object({
122
+ items: z.array(TrashedTemplateSchema),
123
+ nextCursor: z.string().nullable(),
124
+ });
125
+ // POST /templates/:id/restore. `foldedFile` is true when a file found at the
126
+ // template's alias held other text than the restored version: that text was
127
+ // kept as a file-sync version after the newest before the file was written
128
+ // back from the restored one (S314g fix wave).
129
+ export const RestoreTemplateResponseSchema = TemplateResponseSchema.extend({ foldedFile: z.boolean() });
@@ -5,7 +5,15 @@ export declare const TemplateKindSchema: z.ZodEnum<{
5
5
  partial: "partial";
6
6
  }>;
7
7
  export type TemplateKind = z.infer<typeof TemplateKindSchema>;
8
+ export declare const TEMPLATE_ALIAS_MAX_SEGMENTS = 8;
8
9
  export declare const TemplateAliasSchema: z.ZodString;
10
+ export declare const TEMPLATE_KIND_FOLDERS: {
11
+ readonly page: "pages";
12
+ readonly layout: "layouts";
13
+ readonly partial: "partials";
14
+ };
15
+ /** S314o2 (D2): a template's file under the templates folder, "/"-separated. */
16
+ export declare function templateFilePath(kind: TemplateKind, alias: string): string;
9
17
  export declare const TemplateDefinitionSchema: z.ZodObject<{
10
18
  id: z.ZodString;
11
19
  name: z.ZodString;
@@ -20,8 +28,8 @@ export declare const TemplateDefinitionSchema: z.ZodObject<{
20
28
  }, z.core.$strict>;
21
29
  export type TemplateDefinition = z.infer<typeof TemplateDefinitionSchema>;
22
30
  export declare const TemplateVersionSourceSchema: z.ZodEnum<{
23
- "plugin-install": "plugin-install";
24
31
  admin: "admin";
32
+ "plugin-install": "plugin-install";
25
33
  "file-sync": "file-sync";
26
34
  }>;
27
35
  export type TemplateVersionSource = z.infer<typeof TemplateVersionSourceSchema>;
@@ -32,10 +40,37 @@ export declare const TemplateVersionSchema: z.ZodObject<{
32
40
  content: z.ZodString;
33
41
  hash: z.ZodString;
34
42
  source: z.ZodEnum<{
35
- "plugin-install": "plugin-install";
36
43
  admin: "admin";
44
+ "plugin-install": "plugin-install";
37
45
  "file-sync": "file-sync";
38
46
  }>;
39
47
  createdAt: z.ZodString;
40
48
  }, z.core.$strict>;
41
49
  export type TemplateVersion = z.infer<typeof TemplateVersionSchema>;
50
+ export declare const TemplateVersionMetaSchema: z.ZodObject<{
51
+ id: z.ZodString;
52
+ createdAt: z.ZodString;
53
+ source: z.ZodEnum<{
54
+ admin: "admin";
55
+ "plugin-install": "plugin-install";
56
+ "file-sync": "file-sync";
57
+ }>;
58
+ templateId: z.ZodString;
59
+ version: z.ZodNumber;
60
+ hash: z.ZodString;
61
+ }, z.core.$strict>;
62
+ export type TemplateVersionMeta = z.infer<typeof TemplateVersionMetaSchema>;
63
+ export declare const TrashedTemplateSchema: z.ZodObject<{
64
+ id: z.ZodString;
65
+ name: z.ZodString;
66
+ alias: z.ZodString;
67
+ kind: z.ZodEnum<{
68
+ page: "page";
69
+ layout: "layout";
70
+ partial: "partial";
71
+ }>;
72
+ documentTypeId: z.ZodNullable<z.ZodString>;
73
+ currentVersion: z.ZodNumber;
74
+ deletedAt: z.ZodString;
75
+ }, z.core.$strict>;
76
+ export type TrashedTemplate = z.infer<typeof TrashedTemplateSchema>;
@@ -1,18 +1,38 @@
1
1
  import { z } from "zod";
2
+ import { TEMPLATE_KINDS } from "./plugin-vocabulary.js";
2
3
  // A template's persisted identity. Content does NOT live here: the source
3
- // of a template is its file (`templates/<alias>.liquid`) mirrored into
4
- // immutable template_versions rows — see the S192 spec §5. currentVersion
5
- // is a pointer, exactly like content_nodes.current_version.
6
- export const TemplateKindSchema = z.enum(["page", "layout", "partial"]);
4
+ // of a template is its file (`templates/<kind folder>/<alias>.liquid`, see
5
+ // templateFilePath below) mirrored into immutable template_versions rows
6
+ // (the S192 spec, section 5). currentVersion is a pointer, exactly like
7
+ // content_nodes.current_version.
8
+ export const TemplateKindSchema = z.enum(TEMPLATE_KINDS);
7
9
  // The alias is the cross-reference key ({% layout 'x' %} / {% render 'x' %})
8
- // AND the file stem (<alias>.liquid). The regex is deliberately narrow —
9
- // lowercase kebab only — so an alias can never traverse paths or collide
10
- // case-insensitively on Windows filesystems.
10
+ // AND the file's path inside its kind's folder (S314o2 D2): the layout `cafe`
11
+ // is templates/layouts/cafe.liquid, the page `legal/imprint` is
12
+ // templates/pages/legal/imprint.liquid. Aliases are unique per kind, so a
13
+ // page and a partial may both be `menu-item`. S314j (D6, P3): an alias may
14
+ // name folders: segments of lowercase kebab joined by "/", at most
15
+ // TEMPLATE_ALIAS_MAX_SEGMENTS of them, 120 characters in all. No dots, no
16
+ // empty segment, no leading or trailing "/", so an alias can never traverse
17
+ // paths or collide case-insensitively on Windows filesystems; the template
18
+ // service still asserts the joined path stays inside its folder. Plugin
19
+ // manifests keep flat aliases (PluginTemplateAliasSchema).
20
+ export const TEMPLATE_ALIAS_MAX_SEGMENTS = 8;
21
+ const ALIAS_SEGMENT = "[a-z0-9]+(?:-[a-z0-9]+)*";
22
+ const TEMPLATE_ALIAS_REGEX = new RegExp(`^${ALIAS_SEGMENT}(?:/${ALIAS_SEGMENT}){0,${TEMPLATE_ALIAS_MAX_SEGMENTS - 1}}$`);
11
23
  export const TemplateAliasSchema = z
12
24
  .string()
13
25
  .min(1)
14
26
  .max(120)
15
- .regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/, "lowercase kebab-case only");
27
+ .regex(TEMPLATE_ALIAS_REGEX, "lowercase kebab-case segments joined by /, at most 8");
28
+ // S314o2 (D1): the three folders under templates/ the system reads and writes
29
+ // a template file in, one per kind, by these exact lower-case names. Every
30
+ // other entry under templates/ is ignored by the sync.
31
+ export const TEMPLATE_KIND_FOLDERS = { page: "pages", layout: "layouts", partial: "partials" };
32
+ /** S314o2 (D2): a template's file under the templates folder, "/"-separated. */
33
+ export function templateFilePath(kind, alias) {
34
+ return `${TEMPLATE_KIND_FOLDERS[kind]}/${alias}.liquid`;
35
+ }
16
36
  export const TemplateDefinitionSchema = z
17
37
  .object({
18
38
  id: z.string().uuid(),
@@ -37,3 +57,9 @@ export const TemplateVersionSchema = z
37
57
  createdAt: z.string().min(1),
38
58
  })
39
59
  .strict();
60
+ // S314g: a version's facts without its text, for a history list (one read
61
+ // away from the text). Strict, as TemplateVersionSchema is.
62
+ export const TemplateVersionMetaSchema = TemplateVersionSchema.omit({ content: true });
63
+ // S314g: a template in the trash, with the moment it went there; what the
64
+ // trash list shows and what a restore reads first.
65
+ export const TrashedTemplateSchema = TemplateDefinitionSchema.extend({ deletedAt: z.string().min(1) });
@@ -0,0 +1,4 @@
1
+ import { z } from "zod";
2
+ export declare const TRASH_CURSOR_MAX = 300;
3
+ export declare function isTrashCursor(value: string): boolean;
4
+ export declare const TrashCursorSchema: z.ZodString;
@@ -0,0 +1,29 @@
1
+ import { z } from "zod";
2
+ // S314c2 (D14): the one cursor of the three trash lists (content, templates, assets). A list
3
+ // answers `${deletedAt}|${id}` as `nextCursor` (an ISO timestamp, a bar, the row's id); the
4
+ // adapters split it on the first bar (splitTrashCursor) and bind both halves into the keyset
5
+ // comparison. Checked here, a cursor that is not one answers 400 at the route before any
6
+ // dialect reads it; it used to reach a timestamp comparison and answer 500.
7
+ export const TRASH_CURSOR_MAX = 300;
8
+ // S314c2 (fix wave 1): within what every dialect stores, so PostgreSQL's TIMESTAMPTZ never refuses
9
+ // the bound half: a four-digit year from 1000 to 9999 (z.iso.datetime takes 0000) and an offset of
10
+ // at most 14 hours either way (it takes up to 23:59).
11
+ const OFFSET_MAX_MINUTES = 14 * 60;
12
+ function withinStoredRange(stamp) {
13
+ const year = Number(stamp.slice(0, 4));
14
+ if (year < 1000 || year > 9999)
15
+ return false;
16
+ const offset = /([+-])(\d{2}):?(\d{2})$/.exec(stamp);
17
+ return offset === null || Number(offset[2]) * 60 + Number(offset[3]) <= OFFSET_MAX_MINUTES;
18
+ }
19
+ const IsoTimestampSchema = z.iso.datetime({ offset: true }).refine(withinStoredRange);
20
+ export function isTrashCursor(value) {
21
+ const at = value.indexOf("|");
22
+ if (at <= 0 || at === value.length - 1)
23
+ return false;
24
+ return IsoTimestampSchema.safeParse(value.slice(0, at)).success;
25
+ }
26
+ export const TrashCursorSchema = z
27
+ .string()
28
+ .max(TRASH_CURSOR_MAX)
29
+ .refine(isTrashCursor, { message: "cursor must be a nextCursor this list answered: an ISO timestamp, a bar (|) and an id" });
@@ -62,6 +62,10 @@ export declare const UpdateUserRoleResponseSchema: z.ZodObject<{
62
62
  }, z.core.$strip>;
63
63
  }, z.core.$strip>;
64
64
  export type UpdateUserRoleResponse = z.infer<typeof UpdateUserRoleResponseSchema>;
65
+ export declare const DeleteUserResponseSchema: z.ZodObject<{
66
+ deleted: z.ZodLiteral<true>;
67
+ }, z.core.$strip>;
68
+ export type DeleteUserResponse = z.infer<typeof DeleteUserResponseSchema>;
65
69
  export declare const ADMIN_LOCALES: readonly ["en", "de"];
66
70
  export type AdminLocale = (typeof ADMIN_LOCALES)[number];
67
71
  export declare const ThemeModeSchema: z.ZodEnum<{
@@ -80,6 +84,12 @@ export declare const UserPreferencesSchema: z.ZodObject<{
80
84
  dark: "dark";
81
85
  }>>;
82
86
  themeId: z.ZodNullable<z.ZodString>;
87
+ homeLayout: z.ZodOptional<z.ZodNullable<z.ZodObject<{
88
+ widgets: z.ZodArray<z.ZodObject<{
89
+ id: z.ZodString;
90
+ shown: z.ZodBoolean;
91
+ }, z.core.$strict>>;
92
+ }, z.core.$strict>>>;
83
93
  }, z.core.$strip>;
84
94
  export type UserPreferences = z.infer<typeof UserPreferencesSchema>;
85
95
  export declare const UpdateUserPreferencesSchema: z.ZodObject<{
@@ -93,5 +103,11 @@ export declare const UpdateUserPreferencesSchema: z.ZodObject<{
93
103
  dark: "dark";
94
104
  }>>>;
95
105
  themeId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
106
+ homeLayout: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodObject<{
107
+ widgets: z.ZodArray<z.ZodObject<{
108
+ id: z.ZodString;
109
+ shown: z.ZodBoolean;
110
+ }, z.core.$strict>>;
111
+ }, z.core.$strict>>>>;
96
112
  }, z.core.$strip>;
97
113
  export type UpdateUserPreferences = z.infer<typeof UpdateUserPreferencesSchema>;
@@ -1,4 +1,5 @@
1
1
  import { z } from "zod";
2
+ import { HomeLayoutSchema } from "./home.schema.js";
2
3
  import { RoleIdSchema } from "./role.schema.js";
3
4
  // S272: `role` is the id of a row in `roles`, validated as a slug here and
4
5
  // for existence on the server. Before S272 it was a two-value enum.
@@ -39,6 +40,9 @@ export const UpdateUserRoleRequestSchema = z.object({
39
40
  export const UpdateUserRoleResponseSchema = z.object({
40
41
  user: UserSummarySchema,
41
42
  });
43
+ // S309: DELETE /users/:id answers this. The delete removes the account, ends its
44
+ // sessions and moves its uploads to the system account; it rewrites no authored row.
45
+ export const DeleteUserResponseSchema = z.object({ deleted: z.literal(true) });
42
46
  // The admin interface languages that actually ship. ONE list, here,
43
47
  // because three consumers have to agree: the server validates against
44
48
  // it, the admin registers a bundle per entry, and the user menu offers
@@ -66,6 +70,10 @@ export const UserPreferencesSchema = z.object({
66
70
  // A built-in id or an installed theme plugin's reverse-domain id. Not
67
71
  // enumerated: the set is open, since a theme plugin can add one.
68
72
  themeId: z.string().min(1).max(200).nullable(),
73
+ // S314n (D8): the person's Home layout, null when none is saved. Optional,
74
+ // so an answer or a cached copy without it still parses. In a PATCH, null
75
+ // resets to the default.
76
+ homeLayout: HomeLayoutSchema.nullable().optional(),
69
77
  });
70
78
  // Every field optional: a PATCH that sets only the language must not
71
79
  // clear the theme. An explicit null is different from an absent key and
@@ -0,0 +1,2 @@
1
+ import { z } from "zod";
2
+ export declare const UuidStringSchema: z.ZodString;
@@ -0,0 +1,4 @@
1
+ import { z } from "zod";
2
+ // S314p: an id a person or a template writes by hand (a page id given to `url_for`, a media id in
3
+ // rich text HTML), told apart from any other string before it reaches a database lookup.
4
+ export const UuidStringSchema = z.string().uuid();
@@ -0,0 +1,88 @@
1
+ import { z } from "zod";
2
+ /** The token's `typ`, and (with a trailing ".") the purpose string in its signed bytes (D5). */
3
+ export declare const VENDOR_TOKEN_TYPE: "kardalum-vendor-token/1";
4
+ /** D4: a token lives 5 minutes. */
5
+ export declare const VENDOR_TOKEN_TTL_SECONDS = 300;
6
+ /** Spec 3a: the decoded payload is at most 4 KiB. */
7
+ export declare const VENDOR_TOKEN_PAYLOAD_MAX_BYTES = 4096;
8
+ /** The whole token as it travels: both base64url segments and the dot. */
9
+ export declare const VENDOR_TOKEN_MAX_LENGTH = 8192;
10
+ export declare const VENDOR_SERVICE_ORIGIN_MAX = 255;
11
+ /** Spec 3b: the one refusal the marketplace gives, whatever the reason. */
12
+ export declare const VENDOR_TOKEN_REFUSAL_CODE: "no_vendor_token";
13
+ /** A licence term's states (S317). Mirrors LicenseTermState in
14
+ * @kardalum/plugin-package, which pins the two as equal at compile time. */
15
+ export declare const VENDOR_TOKEN_TERM_STATES: readonly ["active", "renewing", "past_due", "lapsed"];
16
+ /** D3: the states a token calls live. */
17
+ export declare const VENDOR_TOKEN_LIVE_STATES: readonly ["active", "renewing", "past_due"];
18
+ /** True for the hosts a development install may reach over plain http. */
19
+ export declare function isLocalVendorHost(hostname: string): boolean;
20
+ export type VendorServiceOriginResult = {
21
+ ok: true;
22
+ origin: string;
23
+ host: string;
24
+ } | {
25
+ ok: false;
26
+ reason: string;
27
+ };
28
+ /**
29
+ * The origin rule (spec 3b, 3c, 3d). `https:` with any host; `http:` only for
30
+ * localhost, 127.0.0.1 or [::1] and only with `allowLocalHttp`. The value must
31
+ * be exactly the URL's origin: no path (not even "/"), query, fragment or
32
+ * userinfo, a lower-case host, at most 255 characters. No regex: the URL
33
+ * parser and exact comparisons.
34
+ */
35
+ export declare function parseVendorServiceOrigin(value: unknown, opts: {
36
+ allowLocalHttp: boolean;
37
+ }): VendorServiceOriginResult;
38
+ /** D6: the manifest's top-level `vendorService`. An http://localhost origin
39
+ * parses here (a plugin in development); both publish gates refuse it. */
40
+ export declare const PluginVendorServiceSchema: z.ZodObject<{
41
+ origin: z.ZodString;
42
+ }, z.core.$strict>;
43
+ export type PluginVendorServiceDeclaration = z.infer<typeof PluginVendorServiceSchema>;
44
+ /** Spec 3a: the token payload. `exp` is after `iat` and at most 300 s later. */
45
+ export declare const VendorTokenPayloadSchema: z.ZodObject<{
46
+ typ: z.ZodLiteral<"kardalum-vendor-token/1">;
47
+ kid: z.ZodString;
48
+ pluginId: z.ZodString;
49
+ aud: z.ZodString;
50
+ domain: z.ZodString;
51
+ live: z.ZodBoolean;
52
+ plan: z.ZodObject<{
53
+ id: z.ZodString;
54
+ key: z.ZodString;
55
+ name: z.ZodString;
56
+ }, z.core.$strict>;
57
+ term: z.ZodObject<{
58
+ state: z.ZodEnum<{
59
+ active: "active";
60
+ renewing: "renewing";
61
+ past_due: "past_due";
62
+ lapsed: "lapsed";
63
+ }>;
64
+ endsAt: z.ZodNullable<z.ZodISODateTime>;
65
+ }, z.core.$strict>;
66
+ iat: z.ZodNumber;
67
+ exp: z.ZodNumber;
68
+ jti: z.ZodString;
69
+ }, z.core.$strict>;
70
+ export type VendorTokenPayload = z.infer<typeof VendorTokenPayloadSchema>;
71
+ /** Spec 3b: what the CMS sends. The key is the credential. */
72
+ export declare const VendorTokenRequestSchema: z.ZodObject<{
73
+ key: z.ZodString;
74
+ pluginId: z.ZodString;
75
+ domain: z.ZodString;
76
+ aud: z.ZodString;
77
+ }, z.core.$strict>;
78
+ export type VendorTokenRequest = z.infer<typeof VendorTokenRequestSchema>;
79
+ export declare const VendorTokenResponseSchema: z.ZodObject<{
80
+ token: z.ZodString;
81
+ expiresAt: z.ZodISODateTime;
82
+ }, z.core.$strip>;
83
+ export type VendorTokenResponse = z.infer<typeof VendorTokenResponseSchema>;
84
+ export declare const VendorTokenRefusalSchema: z.ZodObject<{
85
+ code: z.ZodLiteral<"no_vendor_token">;
86
+ error: z.ZodString;
87
+ }, z.core.$strip>;
88
+ export type VendorTokenRefusal = z.infer<typeof VendorTokenRefusalSchema>;