@kardalum/plugin-sdk 0.0.0-stage → 0.15.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 (312) hide show
  1. package/CHANGELOG.md +108 -0
  2. package/LICENSE +202 -0
  3. package/README.md +70 -2
  4. package/dist/admin-section-registry.d.ts +34 -0
  5. package/dist/admin-section-registry.js +49 -0
  6. package/dist/built-in-serializers.d.ts +3 -0
  7. package/dist/built-in-serializers.js +18 -0
  8. package/dist/built-in-settings-schemas.d.ts +14 -0
  9. package/dist/built-in-settings-schemas.js +225 -0
  10. package/dist/built-in-value-schemas.d.ts +4 -0
  11. package/dist/built-in-value-schemas.js +47 -0
  12. package/dist/built-ins.d.ts +1 -0
  13. package/dist/built-ins.js +257 -0
  14. package/dist/capabilities.d.ts +99 -0
  15. package/dist/capabilities.js +363 -0
  16. package/dist/data-type-plugin.d.ts +28 -0
  17. package/dist/data-type-plugin.js +1 -0
  18. package/dist/datatype-validation.d.ts +26 -0
  19. package/dist/datatype-validation.js +110 -0
  20. package/dist/datatypes-entry.d.ts +4 -0
  21. package/dist/datatypes-entry.js +18 -0
  22. package/dist/define-plugin.d.ts +25 -0
  23. package/dist/define-plugin.js +51 -0
  24. package/dist/entitlement-entry.d.ts +5 -0
  25. package/dist/entitlement-entry.js +24 -0
  26. package/dist/entitlement-gate.d.ts +36 -0
  27. package/dist/entitlement-gate.js +201 -0
  28. package/dist/entitlement-types.d.ts +39 -0
  29. package/dist/entitlement-types.js +1 -0
  30. package/dist/entitlement.d.ts +57 -0
  31. package/dist/entitlement.js +170 -0
  32. package/dist/host-entry.d.ts +1 -0
  33. package/dist/host-entry.js +11 -0
  34. package/dist/icon-name.d.ts +1 -0
  35. package/dist/icon-name.js +1 -0
  36. package/dist/icons.d.ts +2 -0
  37. package/dist/icons.js +10 -0
  38. package/dist/index.d.ts +28 -0
  39. package/dist/index.js +93 -0
  40. package/dist/license-verdict-keys.d.ts +18 -0
  41. package/dist/license-verdict-keys.js +22 -0
  42. package/dist/local-host.d.ts +3 -0
  43. package/dist/local-host.js +38 -0
  44. package/dist/manifest-entry.d.ts +8 -0
  45. package/dist/manifest-entry.js +13 -0
  46. package/dist/manifest-schema.d.ts +408 -0
  47. package/dist/manifest-schema.js +774 -0
  48. package/dist/manifest.d.ts +546 -0
  49. package/dist/manifest.js +86 -0
  50. package/dist/media/media-picker.d.ts +39 -0
  51. package/dist/media/media-picker.js +438 -0
  52. package/dist/media/upload-error.d.ts +12 -0
  53. package/dist/media/upload-error.js +30 -0
  54. package/dist/plugin-context.d.ts +75 -0
  55. package/dist/plugin-context.js +70 -0
  56. package/dist/plugin-screen-context.d.ts +40 -0
  57. package/dist/plugin-screen-context.js +16 -0
  58. package/dist/register-built-ins.d.ts +1 -0
  59. package/dist/register-built-ins.js +41 -0
  60. package/dist/registry.d.ts +4 -0
  61. package/dist/registry.js +17 -0
  62. package/dist/rendition-eligibility.d.ts +24 -0
  63. package/dist/rendition-eligibility.js +40 -0
  64. package/dist/richtext/block-panel.d.ts +27 -0
  65. package/dist/richtext/block-panel.js +232 -0
  66. package/dist/richtext/extensions.d.ts +19 -0
  67. package/dist/richtext/extensions.js +56 -0
  68. package/dist/richtext/insert-menu.d.ts +24 -0
  69. package/dist/richtext/insert-menu.js +142 -0
  70. package/dist/richtext/kardalum-block.d.ts +33 -0
  71. package/dist/richtext/kardalum-block.js +282 -0
  72. package/dist/richtext/style-listbox.d.ts +10 -0
  73. package/dist/richtext/style-listbox.js +69 -0
  74. package/dist/richtext/text-style-class.d.ts +18 -0
  75. package/dist/richtext/text-style-class.js +36 -0
  76. package/dist/simple-storage-value-provider.d.ts +9 -0
  77. package/dist/simple-storage-value-provider.js +96 -0
  78. package/dist/structured-storage-types.d.ts +61 -0
  79. package/dist/structured-storage-types.js +11 -0
  80. package/dist/tailwind.d.ts +1 -0
  81. package/dist/tailwind.js +5 -0
  82. package/dist/tokens/system-dark.css +75 -0
  83. package/dist/tokens/tokens.css +239 -0
  84. package/dist/tokens/tokens.json +212 -0
  85. package/dist/tokens.d.ts +1 -0
  86. package/dist/tokens.js +11 -0
  87. package/dist/ui-entry.d.ts +5 -0
  88. package/dist/ui-entry.js +42 -0
  89. package/dist/views/content-list-preview.d.ts +1 -0
  90. package/dist/views/content-list-preview.js +14 -0
  91. package/dist/views/content-list-settings-view.d.ts +1 -0
  92. package/dist/views/content-list-settings-view.js +97 -0
  93. package/dist/views/content-list-view.d.ts +19 -0
  94. package/dist/views/content-list-view.js +248 -0
  95. package/dist/views/crop-view.d.ts +55 -0
  96. package/dist/views/crop-view.js +161 -0
  97. package/dist/views/date-range-view.d.ts +6 -0
  98. package/dist/views/date-range-view.js +55 -0
  99. package/dist/views/file-upload-view.d.ts +43 -0
  100. package/dist/views/file-upload-view.js +104 -0
  101. package/dist/views/html-code-editor.d.ts +10 -0
  102. package/dist/views/html-code-editor.js +101 -0
  103. package/dist/views/html-view.d.ts +3 -0
  104. package/dist/views/html-view.js +53 -0
  105. package/dist/views/image-view.d.ts +3 -0
  106. package/dist/views/image-view.js +387 -0
  107. package/dist/views/rich-text-view.d.ts +2 -0
  108. package/dist/views/rich-text-view.js +429 -0
  109. package/node_modules/@kardalum/api-schemas/LICENSE +202 -0
  110. package/node_modules/@kardalum/api-schemas/README.md +56 -0
  111. package/node_modules/@kardalum/api-schemas/dist/action.schema.d.ts +30 -0
  112. package/node_modules/@kardalum/api-schemas/dist/action.schema.js +88 -0
  113. package/node_modules/@kardalum/api-schemas/dist/api-error.schema.d.ts +5 -0
  114. package/node_modules/@kardalum/api-schemas/dist/api-error.schema.js +6 -0
  115. package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.d.ts +75 -0
  116. package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.js +36 -0
  117. package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.d.ts +89 -0
  118. package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.js +60 -0
  119. package/node_modules/@kardalum/api-schemas/dist/asset.schema.d.ts +24 -0
  120. package/node_modules/@kardalum/api-schemas/dist/asset.schema.js +47 -0
  121. package/node_modules/@kardalum/api-schemas/dist/auth.schema.d.ts +38 -0
  122. package/node_modules/@kardalum/api-schemas/dist/auth.schema.js +38 -0
  123. package/node_modules/@kardalum/api-schemas/dist/content-api.schema.d.ts +537 -0
  124. package/node_modules/@kardalum/api-schemas/dist/content-api.schema.js +353 -0
  125. package/node_modules/@kardalum/api-schemas/dist/content-list.schema.d.ts +158 -0
  126. package/node_modules/@kardalum/api-schemas/dist/content-list.schema.js +139 -0
  127. package/node_modules/@kardalum/api-schemas/dist/content-path.d.ts +125 -0
  128. package/node_modules/@kardalum/api-schemas/dist/content-path.js +256 -0
  129. package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.d.ts +20 -0
  130. package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.js +23 -0
  131. package/node_modules/@kardalum/api-schemas/dist/content-trash.schema.d.ts +151 -0
  132. package/node_modules/@kardalum/api-schemas/dist/content-trash.schema.js +82 -0
  133. package/node_modules/@kardalum/api-schemas/dist/content-version.schema.d.ts +18 -0
  134. package/node_modules/@kardalum/api-schemas/dist/content-version.schema.js +22 -0
  135. package/node_modules/@kardalum/api-schemas/dist/content.schema.d.ts +17 -0
  136. package/node_modules/@kardalum/api-schemas/dist/content.schema.js +20 -0
  137. package/node_modules/@kardalum/api-schemas/dist/core-actions.d.ts +302 -0
  138. package/node_modules/@kardalum/api-schemas/dist/core-actions.js +97 -0
  139. package/node_modules/@kardalum/api-schemas/dist/culture-direction.d.ts +1 -0
  140. package/node_modules/@kardalum/api-schemas/dist/culture-direction.js +9 -0
  141. package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.d.ts +36 -0
  142. package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.js +32 -0
  143. package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.d.ts +9 -0
  144. package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.js +32 -0
  145. package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.d.ts +296 -0
  146. package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +138 -0
  147. package/node_modules/@kardalum/api-schemas/dist/document-type.schema.d.ts +121 -0
  148. package/node_modules/@kardalum/api-schemas/dist/document-type.schema.js +147 -0
  149. package/node_modules/@kardalum/api-schemas/dist/health.schema.d.ts +6 -0
  150. package/node_modules/@kardalum/api-schemas/dist/health.schema.js +5 -0
  151. package/node_modules/@kardalum/api-schemas/dist/html-entities.d.ts +4 -0
  152. package/node_modules/@kardalum/api-schemas/dist/html-entities.js +250 -0
  153. package/node_modules/@kardalum/api-schemas/dist/index.d.ts +102 -0
  154. package/node_modules/@kardalum/api-schemas/dist/index.js +58 -0
  155. package/node_modules/@kardalum/api-schemas/dist/licensing.schema.d.ts +15 -0
  156. package/node_modules/@kardalum/api-schemas/dist/licensing.schema.js +14 -0
  157. package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.d.ts +381 -0
  158. package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +197 -0
  159. package/node_modules/@kardalum/api-schemas/dist/media-api.schema.d.ts +167 -0
  160. package/node_modules/@kardalum/api-schemas/dist/media-api.schema.js +214 -0
  161. package/node_modules/@kardalum/api-schemas/dist/media-reference-api.schema.d.ts +77 -0
  162. package/node_modules/@kardalum/api-schemas/dist/media-reference-api.schema.js +53 -0
  163. package/node_modules/@kardalum/api-schemas/dist/media-reference-use.d.ts +75 -0
  164. package/node_modules/@kardalum/api-schemas/dist/media-reference-use.js +117 -0
  165. package/node_modules/@kardalum/api-schemas/dist/media-reference.d.ts +27 -0
  166. package/node_modules/@kardalum/api-schemas/dist/media-reference.js +279 -0
  167. package/node_modules/@kardalum/api-schemas/dist/media-rendition.schema.d.ts +74 -0
  168. package/node_modules/@kardalum/api-schemas/dist/media-rendition.schema.js +157 -0
  169. package/node_modules/@kardalum/api-schemas/dist/media.schema.d.ts +80 -0
  170. package/node_modules/@kardalum/api-schemas/dist/media.schema.js +156 -0
  171. package/node_modules/@kardalum/api-schemas/dist/nav.schema.d.ts +23 -0
  172. package/node_modules/@kardalum/api-schemas/dist/nav.schema.js +55 -0
  173. package/node_modules/@kardalum/api-schemas/dist/node-access.schema.d.ts +846 -0
  174. package/node_modules/@kardalum/api-schemas/dist/node-access.schema.js +356 -0
  175. package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.d.ts +20 -0
  176. package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.js +27 -0
  177. package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.d.ts +169 -0
  178. package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.js +80 -0
  179. package/node_modules/@kardalum/api-schemas/dist/plugin-docs-text.d.ts +65 -0
  180. package/node_modules/@kardalum/api-schemas/dist/plugin-docs-text.js +889 -0
  181. package/node_modules/@kardalum/api-schemas/dist/plugin-docs.d.ts +89 -0
  182. package/node_modules/@kardalum/api-schemas/dist/plugin-docs.js +134 -0
  183. package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.d.ts +31 -0
  184. package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.js +38 -0
  185. package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.d.ts +369 -0
  186. package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +393 -0
  187. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.d.ts +22 -0
  188. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.js +87 -0
  189. package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.d.ts +31 -0
  190. package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.js +25 -0
  191. package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.d.ts +15 -0
  192. package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.js +24 -0
  193. package/node_modules/@kardalum/api-schemas/dist/public-api.schema.d.ts +306 -0
  194. package/node_modules/@kardalum/api-schemas/dist/public-api.schema.js +328 -0
  195. package/node_modules/@kardalum/api-schemas/dist/render-editing.d.ts +79 -0
  196. package/node_modules/@kardalum/api-schemas/dist/render-editing.js +50 -0
  197. package/node_modules/@kardalum/api-schemas/dist/render-settings-api.schema.d.ts +9 -0
  198. package/node_modules/@kardalum/api-schemas/dist/render-settings-api.schema.js +13 -0
  199. package/node_modules/@kardalum/api-schemas/dist/reserved-slugs.d.ts +2 -0
  200. package/node_modules/@kardalum/api-schemas/dist/reserved-slugs.js +16 -0
  201. package/node_modules/@kardalum/api-schemas/dist/role.schema.d.ts +90 -0
  202. package/node_modules/@kardalum/api-schemas/dist/role.schema.js +69 -0
  203. package/node_modules/@kardalum/api-schemas/dist/sample-content-outcome.schema.d.ts +17 -0
  204. package/node_modules/@kardalum/api-schemas/dist/sample-content-outcome.schema.js +27 -0
  205. package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +108 -0
  206. package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.js +93 -0
  207. package/node_modules/@kardalum/api-schemas/dist/sites.schema.d.ts +243 -0
  208. package/node_modules/@kardalum/api-schemas/dist/sites.schema.js +296 -0
  209. package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.d.ts +43 -0
  210. package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.js +25 -0
  211. package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.d.ts +30 -0
  212. package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.js +19 -0
  213. package/node_modules/@kardalum/api-schemas/dist/template-api.schema.d.ts +112 -0
  214. package/node_modules/@kardalum/api-schemas/dist/template-api.schema.js +74 -0
  215. package/node_modules/@kardalum/api-schemas/dist/template.schema.d.ts +41 -0
  216. package/node_modules/@kardalum/api-schemas/dist/template.schema.js +39 -0
  217. package/node_modules/@kardalum/api-schemas/dist/theme-api.schema.d.ts +21 -0
  218. package/node_modules/@kardalum/api-schemas/dist/theme-api.schema.js +14 -0
  219. package/node_modules/@kardalum/api-schemas/dist/user-api.schema.d.ts +89 -0
  220. package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +68 -0
  221. package/node_modules/@kardalum/api-schemas/package.json +35 -0
  222. package/node_modules/@kardalum/design-tokens/LICENSE +202 -0
  223. package/node_modules/@kardalum/design-tokens/README.md +29 -0
  224. package/node_modules/@kardalum/design-tokens/dist/build-css.d.ts +32 -0
  225. package/node_modules/@kardalum/design-tokens/dist/build-css.js +88 -0
  226. package/node_modules/@kardalum/design-tokens/dist/generate.d.ts +1 -0
  227. package/node_modules/@kardalum/design-tokens/dist/generate.js +18 -0
  228. package/node_modules/@kardalum/design-tokens/dist/index.d.ts +6 -0
  229. package/node_modules/@kardalum/design-tokens/dist/index.js +4 -0
  230. package/node_modules/@kardalum/design-tokens/dist/system-dark.css +75 -0
  231. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.d.ts +33 -0
  232. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.js +54 -0
  233. package/node_modules/@kardalum/design-tokens/dist/theme-css.d.ts +12 -0
  234. package/node_modules/@kardalum/design-tokens/dist/theme-css.js +42 -0
  235. package/node_modules/@kardalum/design-tokens/dist/theme-types.d.ts +43 -0
  236. package/node_modules/@kardalum/design-tokens/dist/theme-types.js +1 -0
  237. package/node_modules/@kardalum/design-tokens/dist/themes/dark.d.ts +13 -0
  238. package/node_modules/@kardalum/design-tokens/dist/themes/dark.js +120 -0
  239. package/node_modules/@kardalum/design-tokens/dist/themes/index.d.ts +5 -0
  240. package/node_modules/@kardalum/design-tokens/dist/themes/index.js +4 -0
  241. package/node_modules/@kardalum/design-tokens/dist/themes/light.d.ts +9 -0
  242. package/node_modules/@kardalum/design-tokens/dist/themes/light.js +13 -0
  243. package/node_modules/@kardalum/design-tokens/dist/tokens.css +239 -0
  244. package/node_modules/@kardalum/design-tokens/dist/tokens.d.ts +25 -0
  245. package/node_modules/@kardalum/design-tokens/dist/tokens.js +276 -0
  246. package/node_modules/@kardalum/design-tokens/dist/tokens.json +212 -0
  247. package/node_modules/@kardalum/design-tokens/dist/types.d.ts +91 -0
  248. package/node_modules/@kardalum/design-tokens/dist/types.js +5 -0
  249. package/node_modules/@kardalum/design-tokens/package.json +42 -0
  250. package/node_modules/@kardalum/plugin-package/LICENSE +202 -0
  251. package/node_modules/@kardalum/plugin-package/README.md +71 -0
  252. package/node_modules/@kardalum/plugin-package/dist/docs-contract.d.ts +50 -0
  253. package/node_modules/@kardalum/plugin-package/dist/docs-contract.js +659 -0
  254. package/node_modules/@kardalum/plugin-package/dist/envelope.d.ts +19 -0
  255. package/node_modules/@kardalum/plugin-package/dist/envelope.js +104 -0
  256. package/node_modules/@kardalum/plugin-package/dist/extract.d.ts +37 -0
  257. package/node_modules/@kardalum/plugin-package/dist/extract.js +199 -0
  258. package/node_modules/@kardalum/plugin-package/dist/hash.d.ts +17 -0
  259. package/node_modules/@kardalum/plugin-package/dist/hash.js +69 -0
  260. package/node_modules/@kardalum/plugin-package/dist/index.d.ts +11 -0
  261. package/node_modules/@kardalum/plugin-package/dist/index.js +7 -0
  262. package/node_modules/@kardalum/plugin-package/dist/license-verdict.d.ts +185 -0
  263. package/node_modules/@kardalum/plugin-package/dist/license-verdict.js +236 -0
  264. package/node_modules/@kardalum/plugin-package/dist/package-contract.d.ts +50 -0
  265. package/node_modules/@kardalum/plugin-package/dist/package-contract.js +115 -0
  266. package/node_modules/@kardalum/plugin-package/dist/sample-content.d.ts +1 -0
  267. package/node_modules/@kardalum/plugin-package/dist/sample-content.js +17 -0
  268. package/node_modules/@kardalum/plugin-package/dist/types.d.ts +45 -0
  269. package/node_modules/@kardalum/plugin-package/dist/types.js +1 -0
  270. package/node_modules/@kardalum/plugin-package/package.json +49 -0
  271. package/node_modules/@kardalum/ui/LICENSE +202 -0
  272. package/node_modules/@kardalum/ui/README.md +35 -0
  273. package/node_modules/@kardalum/ui/dist/components/alert-dialog.d.ts +14 -0
  274. package/node_modules/@kardalum/ui/dist/components/alert-dialog.js +38 -0
  275. package/node_modules/@kardalum/ui/dist/components/badge.d.ts +9 -0
  276. package/node_modules/@kardalum/ui/dist/components/badge.js +30 -0
  277. package/node_modules/@kardalum/ui/dist/components/button.d.ts +11 -0
  278. package/node_modules/@kardalum/ui/dist/components/button.js +37 -0
  279. package/node_modules/@kardalum/ui/dist/components/checkbox.d.ts +5 -0
  280. package/node_modules/@kardalum/ui/dist/components/checkbox.js +7 -0
  281. package/node_modules/@kardalum/ui/dist/components/dialog.d.ts +17 -0
  282. package/node_modules/@kardalum/ui/dist/components/dialog.js +48 -0
  283. package/node_modules/@kardalum/ui/dist/components/dropdown-menu.d.ts +18 -0
  284. package/node_modules/@kardalum/ui/dist/components/dropdown-menu.js +53 -0
  285. package/node_modules/@kardalum/ui/dist/components/empty-state.d.ts +30 -0
  286. package/node_modules/@kardalum/ui/dist/components/empty-state.js +9 -0
  287. package/node_modules/@kardalum/ui/dist/components/input.d.ts +4 -0
  288. package/node_modules/@kardalum/ui/dist/components/input.js +6 -0
  289. package/node_modules/@kardalum/ui/dist/components/panel.d.ts +5 -0
  290. package/node_modules/@kardalum/ui/dist/components/panel.js +6 -0
  291. package/node_modules/@kardalum/ui/dist/components/property-field.d.ts +19 -0
  292. package/node_modules/@kardalum/ui/dist/components/property-field.js +86 -0
  293. package/node_modules/@kardalum/ui/dist/components/sheet.d.ts +17 -0
  294. package/node_modules/@kardalum/ui/dist/components/sheet.js +55 -0
  295. package/node_modules/@kardalum/ui/dist/components/skeleton.d.ts +3 -0
  296. package/node_modules/@kardalum/ui/dist/components/skeleton.js +9 -0
  297. package/node_modules/@kardalum/ui/dist/components/switch.d.ts +5 -0
  298. package/node_modules/@kardalum/ui/dist/components/switch.js +7 -0
  299. package/node_modules/@kardalum/ui/dist/components/tab-strip.d.ts +34 -0
  300. package/node_modules/@kardalum/ui/dist/components/tab-strip.js +72 -0
  301. package/node_modules/@kardalum/ui/dist/components/toast.d.ts +18 -0
  302. package/node_modules/@kardalum/ui/dist/components/toast.js +42 -0
  303. package/node_modules/@kardalum/ui/dist/components/toaster.d.ts +12 -0
  304. package/node_modules/@kardalum/ui/dist/components/toaster.js +11 -0
  305. package/node_modules/@kardalum/ui/dist/components/use-toast.d.ts +17 -0
  306. package/node_modules/@kardalum/ui/dist/components/use-toast.js +62 -0
  307. package/node_modules/@kardalum/ui/dist/index.d.ts +18 -0
  308. package/node_modules/@kardalum/ui/dist/index.js +18 -0
  309. package/node_modules/@kardalum/ui/dist/lib/cn.d.ts +2 -0
  310. package/node_modules/@kardalum/ui/dist/lib/cn.js +5 -0
  311. package/node_modules/@kardalum/ui/package.json +63 -0
  312. package/package.json +146 -4
@@ -0,0 +1,306 @@
1
+ import { z } from "zod";
2
+ export declare const PublicContentExtensionsSchema: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3
+ export declare const PublicContentItemSchema: z.ZodObject<{
4
+ id: z.ZodString;
5
+ documentTypeId: z.ZodString;
6
+ locale: z.ZodString;
7
+ publishedAt: z.ZodNullable<z.ZodString>;
8
+ version: z.ZodNumber;
9
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
10
+ extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
11
+ url: z.ZodNullable<z.ZodString>;
12
+ }, z.core.$strip>;
13
+ export type PublicContentItem = z.infer<typeof PublicContentItemSchema>;
14
+ export declare const PublicContentItemQuerySchema: z.ZodObject<{
15
+ locale: z.ZodOptional<z.ZodString>;
16
+ format: z.ZodOptional<z.ZodString>;
17
+ previewToken: z.ZodOptional<z.ZodString>;
18
+ }, z.core.$strip>;
19
+ export type PublicContentItemQuery = z.infer<typeof PublicContentItemQuerySchema>;
20
+ export declare const PublicContentFormatResponseSchema: z.ZodObject<{
21
+ format: z.ZodString;
22
+ content: z.ZodUnknown;
23
+ }, z.core.$strip>;
24
+ export type PublicContentFormatResponse = z.infer<typeof PublicContentFormatResponseSchema>;
25
+ export declare const PublicContentByPathQuerySchema: z.ZodObject<{
26
+ locale: z.ZodOptional<z.ZodString>;
27
+ format: z.ZodOptional<z.ZodString>;
28
+ previewToken: z.ZodOptional<z.ZodString>;
29
+ path: z.ZodString;
30
+ }, z.core.$strip>;
31
+ export type PublicContentByPathQuery = z.infer<typeof PublicContentByPathQuerySchema>;
32
+ export declare const PublicContentByAddressQuerySchema: z.ZodObject<{
33
+ path: z.ZodString;
34
+ host: z.ZodOptional<z.ZodString>;
35
+ locale: z.ZodOptional<z.ZodString>;
36
+ }, z.core.$strip>;
37
+ export type PublicContentByAddressQuery = z.infer<typeof PublicContentByAddressQuerySchema>;
38
+ export declare const PublicContentByAddressResponseSchema: z.ZodObject<{
39
+ id: z.ZodString;
40
+ documentTypeId: z.ZodString;
41
+ locale: z.ZodString;
42
+ publishedAt: z.ZodNullable<z.ZodString>;
43
+ version: z.ZodNumber;
44
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
45
+ extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
46
+ url: z.ZodNullable<z.ZodString>;
47
+ redirected: z.ZodBoolean;
48
+ }, z.core.$strip>;
49
+ export type PublicContentByAddressResponse = z.infer<typeof PublicContentByAddressResponseSchema>;
50
+ export declare const PublicContentListQuerySchema: z.ZodObject<{
51
+ cursor: z.ZodOptional<z.ZodString>;
52
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
53
+ }, z.core.$strip>;
54
+ export type PublicContentListQuery = z.infer<typeof PublicContentListQuerySchema>;
55
+ export declare const PublicContentNodeSummarySchema: z.ZodObject<{
56
+ id: z.ZodString;
57
+ parentId: z.ZodNullable<z.ZodString>;
58
+ path: z.ZodString;
59
+ depth: z.ZodNumber;
60
+ sortOrder: z.ZodNumber;
61
+ documentTypeId: z.ZodString;
62
+ publishedAt: z.ZodString;
63
+ url: z.ZodNullable<z.ZodString>;
64
+ }, z.core.$strip>;
65
+ export type PublicContentNodeSummary = z.infer<typeof PublicContentNodeSummarySchema>;
66
+ export declare const PublicContentListResponseSchema: z.ZodObject<{
67
+ items: z.ZodArray<z.ZodObject<{
68
+ id: z.ZodString;
69
+ parentId: z.ZodNullable<z.ZodString>;
70
+ path: z.ZodString;
71
+ depth: z.ZodNumber;
72
+ sortOrder: z.ZodNumber;
73
+ documentTypeId: z.ZodString;
74
+ publishedAt: z.ZodString;
75
+ url: z.ZodNullable<z.ZodString>;
76
+ }, z.core.$strip>>;
77
+ nextCursor: z.ZodNullable<z.ZodString>;
78
+ }, z.core.$strip>;
79
+ export type PublicContentListResponse = z.infer<typeof PublicContentListResponseSchema>;
80
+ export declare const PublicSiteSchema: z.ZodObject<{
81
+ id: z.ZodString;
82
+ path: z.ZodString;
83
+ name: z.ZodString;
84
+ hostnames: z.ZodArray<z.ZodString>;
85
+ isDefault: z.ZodBoolean;
86
+ url: z.ZodNullable<z.ZodString>;
87
+ }, z.core.$strip>;
88
+ export type PublicSite = z.infer<typeof PublicSiteSchema>;
89
+ export declare const PublicSitesQuerySchema: z.ZodObject<{
90
+ cursor: z.ZodOptional<z.ZodString>;
91
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
92
+ }, z.core.$strip>;
93
+ export type PublicSitesQuery = z.infer<typeof PublicSitesQuerySchema>;
94
+ export declare const PublicSitesResponseSchema: z.ZodObject<{
95
+ items: z.ZodArray<z.ZodObject<{
96
+ id: z.ZodString;
97
+ path: z.ZodString;
98
+ name: z.ZodString;
99
+ hostnames: z.ZodArray<z.ZodString>;
100
+ isDefault: z.ZodBoolean;
101
+ url: z.ZodNullable<z.ZodString>;
102
+ }, z.core.$strip>>;
103
+ nextCursor: z.ZodNullable<z.ZodString>;
104
+ }, z.core.$strip>;
105
+ export type PublicSitesResponse = z.infer<typeof PublicSitesResponseSchema>;
106
+ export declare const PublicContentSearchQuerySchema: z.ZodObject<{
107
+ documentTypeId: z.ZodOptional<z.ZodString>;
108
+ under: z.ZodOptional<z.ZodString>;
109
+ q: z.ZodOptional<z.ZodString>;
110
+ cursor: z.ZodOptional<z.ZodString>;
111
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
112
+ }, z.core.$strip>;
113
+ export type PublicContentSearchQuery = z.infer<typeof PublicContentSearchQuerySchema>;
114
+ export declare const PublicMediaFileSchema: z.ZodObject<{
115
+ id: z.ZodString;
116
+ filename: z.ZodString;
117
+ mimeType: z.ZodString;
118
+ size: z.ZodNumber;
119
+ downloadUrl: z.ZodString;
120
+ visibility: z.ZodEnum<{
121
+ public: "public";
122
+ private: "private";
123
+ }>;
124
+ uploadedAt: z.ZodString;
125
+ }, z.core.$strip>;
126
+ export type PublicMediaFile = z.infer<typeof PublicMediaFileSchema>;
127
+ export declare const PublicMediaListQuerySchema: z.ZodObject<{
128
+ cursor: z.ZodOptional<z.ZodString>;
129
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
130
+ search: z.ZodOptional<z.ZodString>;
131
+ }, z.core.$strip>;
132
+ export type PublicMediaListQuery = z.infer<typeof PublicMediaListQuerySchema>;
133
+ export declare const PublicMediaListResponseSchema: z.ZodObject<{
134
+ items: z.ZodArray<z.ZodObject<{
135
+ id: z.ZodString;
136
+ filename: z.ZodString;
137
+ mimeType: z.ZodString;
138
+ size: z.ZodNumber;
139
+ downloadUrl: z.ZodString;
140
+ visibility: z.ZodEnum<{
141
+ public: "public";
142
+ private: "private";
143
+ }>;
144
+ uploadedAt: z.ZodString;
145
+ }, z.core.$strip>>;
146
+ nextCursor: z.ZodNullable<z.ZodString>;
147
+ }, z.core.$strip>;
148
+ export type PublicMediaListResponse = z.infer<typeof PublicMediaListResponseSchema>;
149
+ export declare const PublicFieldDefinitionSchema: z.ZodObject<{
150
+ id: z.ZodString;
151
+ name: z.ZodString;
152
+ datatypeId: z.ZodString;
153
+ valueSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
154
+ validation: z.ZodOptional<z.ZodObject<{
155
+ required: z.ZodOptional<z.ZodBoolean>;
156
+ minLength: z.ZodOptional<z.ZodNumber>;
157
+ maxLength: z.ZodOptional<z.ZodNumber>;
158
+ min: z.ZodOptional<z.ZodNumber>;
159
+ max: z.ZodOptional<z.ZodNumber>;
160
+ pattern: z.ZodOptional<z.ZodString>;
161
+ }, z.core.$strip>>;
162
+ }, z.core.$strip>;
163
+ export type PublicFieldDefinition = z.infer<typeof PublicFieldDefinitionSchema>;
164
+ export declare const PublicDocumentTypeSchema: z.ZodObject<{
165
+ id: z.ZodString;
166
+ name: z.ZodString;
167
+ icon: z.ZodString;
168
+ kind: z.ZodEnum<{
169
+ page: "page";
170
+ element: "element";
171
+ }>;
172
+ fields: z.ZodArray<z.ZodObject<{
173
+ id: z.ZodString;
174
+ name: z.ZodString;
175
+ datatypeId: z.ZodString;
176
+ valueSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
177
+ validation: z.ZodOptional<z.ZodObject<{
178
+ required: z.ZodOptional<z.ZodBoolean>;
179
+ minLength: z.ZodOptional<z.ZodNumber>;
180
+ maxLength: z.ZodOptional<z.ZodNumber>;
181
+ min: z.ZodOptional<z.ZodNumber>;
182
+ max: z.ZodOptional<z.ZodNumber>;
183
+ pattern: z.ZodOptional<z.ZodString>;
184
+ }, z.core.$strip>>;
185
+ }, z.core.$strip>>;
186
+ }, z.core.$strip>;
187
+ export type PublicDocumentType = z.infer<typeof PublicDocumentTypeSchema>;
188
+ export declare const PublicDocumentTypeListQuerySchema: z.ZodObject<{
189
+ cursor: z.ZodOptional<z.ZodString>;
190
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
191
+ }, z.core.$strip>;
192
+ export type PublicDocumentTypeListQuery = z.infer<typeof PublicDocumentTypeListQuerySchema>;
193
+ export declare const PublicDocumentTypeListResponseSchema: z.ZodObject<{
194
+ items: z.ZodArray<z.ZodObject<{
195
+ id: z.ZodString;
196
+ name: z.ZodString;
197
+ icon: z.ZodString;
198
+ kind: z.ZodEnum<{
199
+ page: "page";
200
+ element: "element";
201
+ }>;
202
+ fields: z.ZodArray<z.ZodObject<{
203
+ id: z.ZodString;
204
+ name: z.ZodString;
205
+ datatypeId: z.ZodString;
206
+ valueSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
207
+ validation: z.ZodOptional<z.ZodObject<{
208
+ required: z.ZodOptional<z.ZodBoolean>;
209
+ minLength: z.ZodOptional<z.ZodNumber>;
210
+ maxLength: z.ZodOptional<z.ZodNumber>;
211
+ min: z.ZodOptional<z.ZodNumber>;
212
+ max: z.ZodOptional<z.ZodNumber>;
213
+ pattern: z.ZodOptional<z.ZodString>;
214
+ }, z.core.$strip>>;
215
+ }, z.core.$strip>>;
216
+ }, z.core.$strip>>;
217
+ nextCursor: z.ZodNullable<z.ZodString>;
218
+ }, z.core.$strip>;
219
+ export type PublicDocumentTypeListResponse = z.infer<typeof PublicDocumentTypeListResponseSchema>;
220
+ export declare const PublicTemplateSchema: z.ZodObject<{
221
+ id: z.ZodString;
222
+ name: z.ZodString;
223
+ documentTypeId: z.ZodNullable<z.ZodString>;
224
+ }, z.core.$strip>;
225
+ export type PublicTemplate = z.infer<typeof PublicTemplateSchema>;
226
+ export declare const PublicTemplateListQuerySchema: z.ZodObject<{
227
+ cursor: z.ZodOptional<z.ZodString>;
228
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
229
+ documentTypeId: z.ZodOptional<z.ZodString>;
230
+ }, z.core.$strip>;
231
+ export type PublicTemplateListQuery = z.infer<typeof PublicTemplateListQuerySchema>;
232
+ export declare const PublicTemplateListResponseSchema: z.ZodObject<{
233
+ items: z.ZodArray<z.ZodObject<{
234
+ id: z.ZodString;
235
+ name: z.ZodString;
236
+ documentTypeId: z.ZodNullable<z.ZodString>;
237
+ }, z.core.$strip>>;
238
+ nextCursor: z.ZodNullable<z.ZodString>;
239
+ }, z.core.$strip>;
240
+ export type PublicTemplateListResponse = z.infer<typeof PublicTemplateListResponseSchema>;
241
+ export declare const PublicContentWriteResponseSchema: z.ZodObject<{
242
+ id: z.ZodString;
243
+ documentTypeId: z.ZodString;
244
+ parentId: z.ZodNullable<z.ZodString>;
245
+ path: z.ZodString;
246
+ version: z.ZodNumber;
247
+ publishedAt: z.ZodNullable<z.ZodString>;
248
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
249
+ }, z.core.$strip>;
250
+ export type PublicContentWriteResponse = z.infer<typeof PublicContentWriteResponseSchema>;
251
+ export declare const PublicCreateContentRequestSchema: z.ZodObject<{
252
+ documentTypeId: z.ZodString;
253
+ parentId: z.ZodNullable<z.ZodString>;
254
+ slug: z.ZodString;
255
+ data: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
256
+ }, z.core.$strip>;
257
+ export type PublicCreateContentRequest = z.infer<typeof PublicCreateContentRequestSchema>;
258
+ export type PublicCreateContentRequestInput = z.input<typeof PublicCreateContentRequestSchema>;
259
+ export declare const PublicUpdateContentRequestSchema: z.ZodObject<{
260
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
261
+ }, z.core.$strip>;
262
+ export type PublicUpdateContentRequest = z.infer<typeof PublicUpdateContentRequestSchema>;
263
+ export declare const PublicContentDeleteQuerySchema: z.ZodObject<{
264
+ cascade: z.ZodDefault<z.ZodOptional<z.ZodCodec<z.ZodString, z.ZodBoolean>>>;
265
+ }, z.core.$strip>;
266
+ export type PublicContentDeleteQuery = z.infer<typeof PublicContentDeleteQuerySchema>;
267
+ export declare const PublicContentDeleteResponseSchema: z.ZodObject<{
268
+ ok: z.ZodLiteral<true>;
269
+ }, z.core.$strip>;
270
+ export type PublicContentDeleteResponse = z.infer<typeof PublicContentDeleteResponseSchema>;
271
+ export declare const PublicContentDeleteConfirmationSchema: z.ZodObject<{
272
+ descendantCount: z.ZodNumber;
273
+ message: z.ZodString;
274
+ }, z.core.$strip>;
275
+ export type PublicContentDeleteConfirmation = z.infer<typeof PublicContentDeleteConfirmationSchema>;
276
+ export declare const PublicMediaUploadFieldsSchema: z.ZodObject<{
277
+ visibility: z.ZodDefault<z.ZodEnum<{
278
+ public: "public";
279
+ private: "private";
280
+ }>>;
281
+ }, z.core.$strict>;
282
+ export type PublicMediaUploadFields = z.infer<typeof PublicMediaUploadFieldsSchema>;
283
+ export declare const PublicMediaUpdateRequestSchema: z.ZodObject<{
284
+ visibility: z.ZodEnum<{
285
+ public: "public";
286
+ private: "private";
287
+ }>;
288
+ }, z.core.$strict>;
289
+ export type PublicMediaUpdateRequest = z.infer<typeof PublicMediaUpdateRequestSchema>;
290
+ export declare const PublicMediaWriteResponseSchema: z.ZodObject<{
291
+ id: z.ZodString;
292
+ filename: z.ZodString;
293
+ mimeType: z.ZodString;
294
+ size: z.ZodNumber;
295
+ downloadUrl: z.ZodString;
296
+ visibility: z.ZodEnum<{
297
+ public: "public";
298
+ private: "private";
299
+ }>;
300
+ uploadedAt: z.ZodString;
301
+ }, z.core.$strip>;
302
+ export type PublicMediaWriteResponse = z.infer<typeof PublicMediaWriteResponseSchema>;
303
+ export declare const PublicMediaDeleteResponseSchema: z.ZodObject<{
304
+ ok: z.ZodLiteral<true>;
305
+ }, z.core.$strip>;
306
+ export type PublicMediaDeleteResponse = z.infer<typeof PublicMediaDeleteResponseSchema>;
@@ -0,0 +1,328 @@
1
+ import { z } from "zod";
2
+ import { CultureSchema } from "./content-api.schema.js";
3
+ import { MediaVisibilitySchema } from "./media.schema.js";
4
+ // Session 112: serializer-contribution output. Keyed by pluginId —
5
+ // structurally separate from core fields and `data`, so a contribution
6
+ // can never remove or overwrite either. Present only when at least one
7
+ // active plugin's extendContentResponse produced a value.
8
+ export const PublicContentExtensionsSchema = z.record(z.string(), z.record(z.string(), z.unknown()));
9
+ // The public Content API's own wire contract (Month 9). Deliberately NOT
10
+ // a re-export of the backoffice ContentNode/ContentVersion shapes — the
11
+ // public surface exposes only what an external consumer needs, and can
12
+ // stay stable while internal shapes evolve. Session 103 widens this file.
13
+ // Session 116: `publishedAt` is nullable ONLY here — a verified preview
14
+ // token can serve a genuinely-draft node's latest version, which has no
15
+ // publishedAt. Every other public schema (summaries/lists) stays on the
16
+ // published-only surface and keeps its non-null publishedAt unchanged.
17
+ export const PublicContentItemSchema = z.object({
18
+ id: z.string().uuid(),
19
+ documentTypeId: z.string().uuid(),
20
+ locale: z.string().min(2),
21
+ publishedAt: z.string().datetime().nullable(),
22
+ version: z.number().int().positive(),
23
+ data: z.record(z.string(), z.unknown()),
24
+ extensions: PublicContentExtensionsSchema.optional(),
25
+ // S277e: the page's one address, the one a visitor uses. A full URL
26
+ // ("https://shop.example/about") when the address has a host, a path
27
+ // ("/about") otherwise, with the language prefix of the locale served
28
+ // when the site has more than one language. Null when the page has no
29
+ // address: its top-level page is not published, or no link to it can be
30
+ // made from the domain the request named.
31
+ url: z.string().nullable(),
32
+ });
33
+ // `locale` mirrors the backoffice contract exactly (content-api.schema).
34
+ // `previewToken` (Session 116) is a stateless signed token minted by
35
+ // POST /api/content/:id/preview-token; verified once per request against
36
+ // the FINAL resolved (post-locale) node id — see published-item.ts.
37
+ export const PublicContentItemQuerySchema = z.object({
38
+ // S230: validated as a language tag, identically to the backoffice
39
+ // route. It used to be any string of two or more characters, so a
40
+ // malformed locale reached the data layer instead of being refused.
41
+ locale: CultureSchema.optional(),
42
+ format: z.string().regex(/^[a-z0-9.-]+:[a-z0-9-]+$/).optional(),
43
+ previewToken: z.string().optional(),
44
+ });
45
+ // A custom-format read (?format=<pluginId>:<name>) — the plugin's whole
46
+ // projection rides in `content`; the caller asked for the plugin's shape,
47
+ // so the server imposes nothing beyond JSON-serializability.
48
+ export const PublicContentFormatResponseSchema = z.object({
49
+ format: z.string(),
50
+ content: z.unknown(),
51
+ });
52
+ export const PublicContentByPathQuerySchema = PublicContentItemQuerySchema.extend({
53
+ path: z.string().min(1).startsWith("/"),
54
+ });
55
+ // S277e: GET /api/v1/content/by-address. An address is what a visitor
56
+ // types: a path, on a host. `path` is read as the renderer reads a
57
+ // request's path, so a language prefix in it selects the language unless
58
+ // `locale` says otherwise. `host` selects the site and nothing else: it is
59
+ // compared with the domains stored on sites and never written into an
60
+ // answer. Without it the address is read on the default address.
61
+ export const PublicContentByAddressQuerySchema = z.object({
62
+ path: z.string().min(1).max(2048),
63
+ host: z.string().max(253).optional(),
64
+ locale: z.string().optional(),
65
+ });
66
+ // The page a visitor gets at that address. `redirected` is true when the
67
+ // address asked is not the page's one address (a visitor would be sent on
68
+ // to it); `url` is that one address either way.
69
+ export const PublicContentByAddressResponseSchema = PublicContentItemSchema.extend({ redirected: z.boolean() });
70
+ export const PublicContentListQuerySchema = z.object({
71
+ cursor: z.string().uuid().optional(),
72
+ limit: z.coerce.number().int().min(1).max(100).default(50),
73
+ });
74
+ // The tree-walk row: everything a consumer needs to render navigation and
75
+ // fetch the full item — no version data (fetch by id for that), and
76
+ // publishedAt is non-nullable by construction (published-only surface).
77
+ export const PublicContentNodeSummarySchema = z.object({
78
+ id: z.string().uuid(),
79
+ parentId: z.string().uuid().nullable(),
80
+ path: z.string().min(1),
81
+ depth: z.number().int().nonnegative(),
82
+ sortOrder: z.number().int(),
83
+ documentTypeId: z.string().uuid(),
84
+ publishedAt: z.string().datetime(),
85
+ // S277e: the page's one address in the default language, as on
86
+ // PublicContentItemSchema. `path` stays the stored path, which is what
87
+ // by-path takes; `url` is what a link to the page is made from.
88
+ url: z.string().nullable(),
89
+ });
90
+ export const PublicContentListResponseSchema = z.object({
91
+ items: z.array(PublicContentNodeSummarySchema),
92
+ nextCursor: z.string().uuid().nullable(),
93
+ });
94
+ // S277e: GET /api/v1/sites. Every published top-level page is a site.
95
+ // `path` is its stored path, `hostnames` its domains in order (the first
96
+ // is its address), `isDefault` whether it is the site a visitor gets on
97
+ // the default address, and `url` its home address in the default
98
+ // language, as `url` on a content result.
99
+ export const PublicSiteSchema = z.object({
100
+ id: z.string().uuid(),
101
+ path: z.string(),
102
+ name: z.string(),
103
+ hostnames: z.array(z.string()),
104
+ isDefault: z.boolean(),
105
+ url: z.string().nullable(),
106
+ });
107
+ // Paged as every public list is: the cursor is the id of the last row of
108
+ // the page before.
109
+ export const PublicSitesQuerySchema = PublicContentListQuerySchema;
110
+ export const PublicSitesResponseSchema = z.object({
111
+ items: z.array(PublicSiteSchema),
112
+ nextCursor: z.string().nullable(),
113
+ });
114
+ // GET /api/v1/content — combinable filters over the published surface.
115
+ // `under` is a published node's id; the server resolves it to a subtree
116
+ // path filter (strict descendants). q is a case-insensitive substring
117
+ // (ASCII-pinned), min 2 chars so a single char can't trigger full scans.
118
+ export const PublicContentSearchQuerySchema = z.object({
119
+ documentTypeId: z.string().uuid().optional(),
120
+ under: z.string().uuid().optional(),
121
+ q: z.string().min(2).optional(),
122
+ cursor: z.string().uuid().optional(),
123
+ limit: z.coerce.number().int().min(1).max(100).default(50),
124
+ });
125
+ // Public media (Month 9, Session 105). downloadUrl is the stable app path
126
+ // (S186c §3) made ABSOLUTE (S186c Task 3, mandate 1: this surface is
127
+ // consumed cross-origin, unlike the backoffice MediaFileResponseSchema's
128
+ // path-relative convention). It is generated fresh per response and is
129
+ // never a time-limited presigned URL; a PRIVATE item's carries a freshly
130
+ // minted, short-lived `?token=` instead. Since S234b it names a VERSION
131
+ // (`/media/<id>/v<n>/<filename>`), so it is permanent for one set of
132
+ // bytes rather than permanent for one item: replacing the file moves the
133
+ // item to a new version and this value changes with it, which is what
134
+ // lets the byte route cache each set of bytes forever. A consumer that
135
+ // stored an older response keeps a link to the older bytes, and those
136
+ // bytes stay where they are until an admin deletes that version outright.
137
+ // filename/mimeType/size/uploadedAt are
138
+ // safe to expose as-is; uploadedBy (an internal user id) is deliberately
139
+ // omitted. visibility rides along too (S186c §2 decision): a headless
140
+ // consumer hitting this item's downloadUrl needs to know whether it
141
+ // requires auth/a signed token before it 404s. GET
142
+ // /media/:id/v:version/:filename (media-public.ts) is an ALWAYS-404
143
+ // surface (S186c §3's no-existence-oracle rule: an unauthorized-private
144
+ // miss and an unknown id return the identical 404 body), never a 401, so
145
+ // "401" above would be comment drift (L3 fix wave) if left as the stated
146
+ // behavior.
147
+ export const PublicMediaFileSchema = z.object({
148
+ id: z.string().uuid(),
149
+ filename: z.string().min(1),
150
+ mimeType: z.string().min(1),
151
+ size: z.number().int().nonnegative(),
152
+ downloadUrl: z.string().min(1),
153
+ visibility: MediaVisibilitySchema,
154
+ uploadedAt: z.string().datetime(),
155
+ });
156
+ export const PublicMediaListQuerySchema = z.object({
157
+ cursor: z.string().uuid().optional(),
158
+ limit: z.coerce.number().int().min(1).max(100).default(24),
159
+ search: z.string().min(1).optional(),
160
+ });
161
+ export const PublicMediaListResponseSchema = z.object({
162
+ items: z.array(PublicMediaFileSchema),
163
+ nextCursor: z.string().uuid().nullable(),
164
+ });
165
+ // Public document type introspection. Deliberately narrower than the
166
+ // backoffice DocumentTypeDefinitionSchema: tabs (admin-UI organization),
167
+ // treeRules (an admin content-placement rule), and defaultTemplateId (an
168
+ // editor pointer — the separate templates resource covers discovery) are
169
+ // all excluded. Just enough to interpret a fetched ContentVersion.data:
170
+ // each field's data key (id), display name, datatypeId, and its
171
+ // client-facing validation rules.
172
+ export const PublicFieldDefinitionSchema = z.object({
173
+ id: z.string(),
174
+ name: z.string().min(1),
175
+ datatypeId: z.string().min(1),
176
+ // S217: the JSON Schema describing what this field's value looks like,
177
+ // taken from its datatype's own `schema`. Present for every built-in and
178
+ // for any plugin datatype that declares one; absent otherwise, which is
179
+ // why it is optional rather than a lie-shaped default.
180
+ //
181
+ // This is the one place a consumer can learn a field's shape. A content
182
+ // item's `data` is `Record<string, unknown>` and cannot be more specific,
183
+ // because its shape depends on which document type the item is. Document
184
+ // types are runtime data, so their shape belongs in a runtime response
185
+ // rather than baked into a static OpenAPI document that would go stale
186
+ // the moment a plugin is installed.
187
+ //
188
+ // Passthrough, not a modelled JSON Schema: describing JSON Schema in Zod
189
+ // would pin this to one draft and reject valid schemas from the next.
190
+ valueSchema: z.record(z.string(), z.unknown()).optional(),
191
+ validation: z
192
+ .object({
193
+ required: z.boolean().optional(),
194
+ minLength: z.number().int().nonnegative().optional(),
195
+ maxLength: z.number().int().nonnegative().optional(),
196
+ min: z.number().optional(),
197
+ max: z.number().optional(),
198
+ pattern: z.string().min(1).optional(),
199
+ })
200
+ .optional(),
201
+ });
202
+ export const PublicDocumentTypeSchema = z.object({
203
+ id: z.string().uuid(),
204
+ name: z.string().min(1),
205
+ // May be empty since S183 (icon is optional; admin renders a default
206
+ // document icon). min(1) here would 500 the public read for such types.
207
+ icon: z.string(),
208
+ kind: z.enum(["page", "element"]),
209
+ fields: z.array(PublicFieldDefinitionSchema),
210
+ });
211
+ export const PublicDocumentTypeListQuerySchema = z.object({
212
+ cursor: z.string().uuid().optional(),
213
+ limit: z.coerce.number().int().min(1).max(100).default(50),
214
+ });
215
+ export const PublicDocumentTypeListResponseSchema = z.object({
216
+ items: z.array(PublicDocumentTypeSchema),
217
+ nextCursor: z.string().uuid().nullable(),
218
+ });
219
+ // Templates are inert data (headless-first decision) — the public shape
220
+ // is the same three fields the backoffice already exposes, defined fresh
221
+ // as its own contract rather than re-exporting TemplateDefinitionSchema.
222
+ export const PublicTemplateSchema = z.object({
223
+ id: z.string().uuid(),
224
+ name: z.string().min(1),
225
+ documentTypeId: z.string().uuid().nullable(),
226
+ });
227
+ export const PublicTemplateListQuerySchema = z.object({
228
+ cursor: z.string().uuid().optional(),
229
+ limit: z.coerce.number().int().min(1).max(100).default(50),
230
+ documentTypeId: z.string().uuid().optional(),
231
+ });
232
+ export const PublicTemplateListResponseSchema = z.object({
233
+ items: z.array(PublicTemplateSchema),
234
+ nextCursor: z.string().uuid().nullable(),
235
+ });
236
+ // Public content write shapes (Month 9, Session 107). The write surface is
237
+ // key-gated and NOT published-only — a writer operates on a node by id in
238
+ // any publish state, so `publishedAt` here is nullable (a fresh draft),
239
+ // unlike the read PublicContentItemSchema's non-null publishedAt.
240
+ export const PublicContentWriteResponseSchema = z.object({
241
+ id: z.string().uuid(),
242
+ documentTypeId: z.string().uuid(),
243
+ parentId: z.string().uuid().nullable(),
244
+ path: z.string().min(1),
245
+ version: z.number().int().positive(),
246
+ publishedAt: z.string().datetime().nullable(),
247
+ data: z.record(z.string(), z.unknown()),
248
+ });
249
+ // Create derives path/depth/sortOrder server-side from parentId + slug, so
250
+ // an external consumer never computes tree internals. `slug` is an
251
+ // already-slugified path segment; `data` defaults to {} (the stub-then-
252
+ // PATCH pattern). Non-empty data is field-validated at the route.
253
+ export const PublicCreateContentRequestSchema = z.object({
254
+ documentTypeId: z.string().uuid(),
255
+ parentId: z.string().uuid().nullable(),
256
+ slug: z.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/),
257
+ data: z.record(z.string(), z.unknown()).default({}),
258
+ });
259
+ // Body for both PUT (full-replace) and PATCH (partial merge) — the verb,
260
+ // not the body shape, decides the merge semantics. See the route
261
+ // descriptions.
262
+ export const PublicUpdateContentRequestSchema = z.object({
263
+ data: z.record(z.string(), z.unknown()),
264
+ });
265
+ // DELETE /api/v1/content/:id?cascade=true — cascade opts into trashing a
266
+ // node's whole descendant subtree in one call, the API equivalent of the
267
+ // admin trash route's confirm:true retry (S154). z.stringbool() — NOT
268
+ // z.coerce.boolean(), which is plain JS truthiness (Boolean("false") ===
269
+ // true, so "?cascade=false" would silently perform the cascade it looks
270
+ // like it's declining) — parses "true"/"1"/"yes"/"on"/"y"/"enabled" to
271
+ // true and "false"/"0"/"no"/"off"/"n"/"disabled" to false, and rejects
272
+ // anything else (including a bare "?cascade" with no value, which arrives
273
+ // as "") with a clean 400 instead of guessing. Omitting the param
274
+ // entirely is still the safe default.
275
+ export const PublicContentDeleteQuerySchema = z.object({
276
+ cascade: z.stringbool().optional().default(false),
277
+ });
278
+ // DELETE /api/v1/content/:id response. Deletion is soft (trash, not
279
+ // destroy — content immutability applies to the whole subtree, not just
280
+ // this node), so there is nothing to hand back but a confirmation; same
281
+ // shape as PublicMediaDeleteResponseSchema below, kept as its own type
282
+ // since the two write surfaces evolve independently.
283
+ export const PublicContentDeleteResponseSchema = z.object({ ok: z.literal(true) });
284
+ // 409 when the node has descendants and the caller didn't pass
285
+ // ?cascade=true. Carries the same information the admin trash route's
286
+ // unconfirmed 409 does (ContentTrashConfirmationSchema: blast radius +
287
+ // remedy) reshaped for a single API round trip instead of a UI dialog —
288
+ // the remedy is spelled out in the message itself since there's no
289
+ // confirmation click to follow up with, so there's no separate
290
+ // requiresConfirmation/nodeName pair to carry.
291
+ export const PublicContentDeleteConfirmationSchema = z.object({
292
+ descendantCount: z.number().int().positive(),
293
+ message: z.string(),
294
+ });
295
+ // Public media write shapes (Month 9 media write routes). The upload is a
296
+ // multipart request — the binary streams separately at the route; this
297
+ // schema covers only the accompanying form fields. No folderId: folders
298
+ // are an admin-only surface (S186e), never exposed on the public write
299
+ // API. `.strict()` so a caller that sends folderId here gets a clear 400
300
+ // instead of it being silently dropped.
301
+ export const PublicMediaUploadFieldsSchema = z
302
+ .object({
303
+ visibility: MediaVisibilitySchema.default("private"),
304
+ })
305
+ .strict();
306
+ // PATCH /api/v1/media/:id body. v1 patches visibility only — metadata
307
+ // (filename, custom fields) is a later task, so visibility is required
308
+ // rather than optional: this is the only field there is, and an empty
309
+ // body has nothing to do. folderId is deliberately absent for the same
310
+ // admin-only reason as PublicMediaUploadFieldsSchema above; `.strict()`
311
+ // rejects it explicitly.
312
+ export const PublicMediaUpdateRequestSchema = z
313
+ .object({
314
+ visibility: MediaVisibilitySchema,
315
+ })
316
+ .strict();
317
+ // Upload (POST) and update (PATCH) both hand back the same public media
318
+ // item shape already used for reads/lists — an alias, not a fresh shape.
319
+ export const PublicMediaWriteResponseSchema = PublicMediaFileSchema;
320
+ // S234e: the route behind this now trashes rather than destroys (the
321
+ // admin DELETE route made the same change in the same session; see
322
+ // MediaService.trash), so `{ ok: true }` means "moved to the bin", not
323
+ // "gone for good" any more. The shape itself is unaffected: there was
324
+ // never a third state to report. There is no public restore route on
325
+ // this surface (restoring is admin-only, S234e Task 4), so a headless
326
+ // caller cannot undo this itself; an admin can still bring the item back
327
+ // from the bin in the meantime.
328
+ export const PublicMediaDeleteResponseSchema = z.object({ ok: z.literal(true) });