@kardalum/plugin-sdk 0.0.0-stage → 0.16.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 (332) hide show
  1. package/CHANGELOG.md +118 -0
  2. package/LICENSE +202 -0
  3. package/README.md +80 -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 +29 -0
  15. package/dist/capabilities.js +67 -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 +94 -0
  40. package/dist/license-verdict-keys.d.ts +18 -0
  41. package/dist/license-verdict-keys.js +26 -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 +476 -0
  47. package/dist/manifest-schema.js +823 -0
  48. package/dist/manifest.d.ts +611 -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 +447 -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 +82 -0
  55. package/dist/plugin-context.js +77 -0
  56. package/dist/plugin-screen-context.d.ts +71 -0
  57. package/dist/plugin-screen-context.js +41 -0
  58. package/dist/read-all-pages.d.ts +23 -0
  59. package/dist/read-all-pages.js +30 -0
  60. package/dist/register-built-ins.d.ts +1 -0
  61. package/dist/register-built-ins.js +41 -0
  62. package/dist/registry.d.ts +4 -0
  63. package/dist/registry.js +17 -0
  64. package/dist/rendition-eligibility.d.ts +24 -0
  65. package/dist/rendition-eligibility.js +40 -0
  66. package/dist/richtext/block-panel.d.ts +27 -0
  67. package/dist/richtext/block-panel.js +232 -0
  68. package/dist/richtext/extensions.d.ts +19 -0
  69. package/dist/richtext/extensions.js +56 -0
  70. package/dist/richtext/insert-menu.d.ts +24 -0
  71. package/dist/richtext/insert-menu.js +142 -0
  72. package/dist/richtext/kardalum-block.d.ts +33 -0
  73. package/dist/richtext/kardalum-block.js +282 -0
  74. package/dist/richtext/style-listbox.d.ts +10 -0
  75. package/dist/richtext/style-listbox.js +69 -0
  76. package/dist/richtext/text-style-class.d.ts +18 -0
  77. package/dist/richtext/text-style-class.js +36 -0
  78. package/dist/simple-storage-value-provider.d.ts +9 -0
  79. package/dist/simple-storage-value-provider.js +96 -0
  80. package/dist/structured-storage-types.d.ts +61 -0
  81. package/dist/structured-storage-types.js +11 -0
  82. package/dist/tailwind.d.ts +1 -0
  83. package/dist/tailwind.js +5 -0
  84. package/dist/tokens/system-dark.css +75 -0
  85. package/dist/tokens/tokens.css +239 -0
  86. package/dist/tokens/tokens.json +212 -0
  87. package/dist/tokens.d.ts +1 -0
  88. package/dist/tokens.js +11 -0
  89. package/dist/ui-entry.d.ts +5 -0
  90. package/dist/ui-entry.js +42 -0
  91. package/dist/views/content-list-preview.d.ts +1 -0
  92. package/dist/views/content-list-preview.js +14 -0
  93. package/dist/views/content-list-settings-view.d.ts +1 -0
  94. package/dist/views/content-list-settings-view.js +97 -0
  95. package/dist/views/content-list-view.d.ts +19 -0
  96. package/dist/views/content-list-view.js +248 -0
  97. package/dist/views/crop-view.d.ts +55 -0
  98. package/dist/views/crop-view.js +161 -0
  99. package/dist/views/date-range-view.d.ts +6 -0
  100. package/dist/views/date-range-view.js +55 -0
  101. package/dist/views/file-upload-view.d.ts +43 -0
  102. package/dist/views/file-upload-view.js +104 -0
  103. package/dist/views/html-code-editor.d.ts +10 -0
  104. package/dist/views/html-code-editor.js +101 -0
  105. package/dist/views/html-view.d.ts +3 -0
  106. package/dist/views/html-view.js +53 -0
  107. package/dist/views/image-view.d.ts +3 -0
  108. package/dist/views/image-view.js +372 -0
  109. package/dist/views/rich-text-view.d.ts +2 -0
  110. package/dist/views/rich-text-view.js +429 -0
  111. package/node_modules/@kardalum/api-schemas/LICENSE +202 -0
  112. package/node_modules/@kardalum/api-schemas/README.md +56 -0
  113. package/node_modules/@kardalum/api-schemas/dist/action.schema.d.ts +30 -0
  114. package/node_modules/@kardalum/api-schemas/dist/action.schema.js +88 -0
  115. package/node_modules/@kardalum/api-schemas/dist/api-error.schema.d.ts +17 -0
  116. package/node_modules/@kardalum/api-schemas/dist/api-error.schema.js +25 -0
  117. package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.d.ts +93 -0
  118. package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.js +88 -0
  119. package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.d.ts +89 -0
  120. package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.js +60 -0
  121. package/node_modules/@kardalum/api-schemas/dist/asset.schema.d.ts +24 -0
  122. package/node_modules/@kardalum/api-schemas/dist/asset.schema.js +47 -0
  123. package/node_modules/@kardalum/api-schemas/dist/auth.schema.d.ts +38 -0
  124. package/node_modules/@kardalum/api-schemas/dist/auth.schema.js +38 -0
  125. package/node_modules/@kardalum/api-schemas/dist/content-api.schema.d.ts +542 -0
  126. package/node_modules/@kardalum/api-schemas/dist/content-api.schema.js +357 -0
  127. package/node_modules/@kardalum/api-schemas/dist/content-list.schema.d.ts +158 -0
  128. package/node_modules/@kardalum/api-schemas/dist/content-list.schema.js +139 -0
  129. package/node_modules/@kardalum/api-schemas/dist/content-path.d.ts +125 -0
  130. package/node_modules/@kardalum/api-schemas/dist/content-path.js +260 -0
  131. package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.d.ts +20 -0
  132. package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.js +23 -0
  133. package/node_modules/@kardalum/api-schemas/dist/content-trash.schema.d.ts +152 -0
  134. package/node_modules/@kardalum/api-schemas/dist/content-trash.schema.js +82 -0
  135. package/node_modules/@kardalum/api-schemas/dist/content-version.schema.d.ts +18 -0
  136. package/node_modules/@kardalum/api-schemas/dist/content-version.schema.js +22 -0
  137. package/node_modules/@kardalum/api-schemas/dist/content.schema.d.ts +17 -0
  138. package/node_modules/@kardalum/api-schemas/dist/content.schema.js +20 -0
  139. package/node_modules/@kardalum/api-schemas/dist/core-actions.d.ts +352 -0
  140. package/node_modules/@kardalum/api-schemas/dist/core-actions.js +133 -0
  141. package/node_modules/@kardalum/api-schemas/dist/culture-direction.d.ts +1 -0
  142. package/node_modules/@kardalum/api-schemas/dist/culture-direction.js +9 -0
  143. package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.d.ts +37 -0
  144. package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.js +32 -0
  145. package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.d.ts +9 -0
  146. package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.js +32 -0
  147. package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.d.ts +298 -0
  148. package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +138 -0
  149. package/node_modules/@kardalum/api-schemas/dist/document-type.schema.d.ts +121 -0
  150. package/node_modules/@kardalum/api-schemas/dist/document-type.schema.js +147 -0
  151. package/node_modules/@kardalum/api-schemas/dist/health.schema.d.ts +6 -0
  152. package/node_modules/@kardalum/api-schemas/dist/health.schema.js +5 -0
  153. package/node_modules/@kardalum/api-schemas/dist/html-entities.d.ts +4 -0
  154. package/node_modules/@kardalum/api-schemas/dist/html-entities.js +250 -0
  155. package/node_modules/@kardalum/api-schemas/dist/index.d.ts +113 -0
  156. package/node_modules/@kardalum/api-schemas/dist/index.js +64 -0
  157. package/node_modules/@kardalum/api-schemas/dist/licensing.schema.d.ts +15 -0
  158. package/node_modules/@kardalum/api-schemas/dist/licensing.schema.js +14 -0
  159. package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.d.ts +73 -0
  160. package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.js +104 -0
  161. package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.d.ts +682 -0
  162. package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +269 -0
  163. package/node_modules/@kardalum/api-schemas/dist/media-api.schema.d.ts +177 -0
  164. package/node_modules/@kardalum/api-schemas/dist/media-api.schema.js +222 -0
  165. package/node_modules/@kardalum/api-schemas/dist/media-reference-api.schema.d.ts +77 -0
  166. package/node_modules/@kardalum/api-schemas/dist/media-reference-api.schema.js +53 -0
  167. package/node_modules/@kardalum/api-schemas/dist/media-reference-use.d.ts +75 -0
  168. package/node_modules/@kardalum/api-schemas/dist/media-reference-use.js +117 -0
  169. package/node_modules/@kardalum/api-schemas/dist/media-reference.d.ts +27 -0
  170. package/node_modules/@kardalum/api-schemas/dist/media-reference.js +279 -0
  171. package/node_modules/@kardalum/api-schemas/dist/media-rendition.schema.d.ts +74 -0
  172. package/node_modules/@kardalum/api-schemas/dist/media-rendition.schema.js +157 -0
  173. package/node_modules/@kardalum/api-schemas/dist/media.schema.d.ts +80 -0
  174. package/node_modules/@kardalum/api-schemas/dist/media.schema.js +156 -0
  175. package/node_modules/@kardalum/api-schemas/dist/nav.schema.d.ts +23 -0
  176. package/node_modules/@kardalum/api-schemas/dist/nav.schema.js +55 -0
  177. package/node_modules/@kardalum/api-schemas/dist/node-access.schema.d.ts +846 -0
  178. package/node_modules/@kardalum/api-schemas/dist/node-access.schema.js +356 -0
  179. package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.d.ts +20 -0
  180. package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.js +27 -0
  181. package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.d.ts +249 -0
  182. package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.js +84 -0
  183. package/node_modules/@kardalum/api-schemas/dist/plugin-docs-text.d.ts +65 -0
  184. package/node_modules/@kardalum/api-schemas/dist/plugin-docs-text.js +889 -0
  185. package/node_modules/@kardalum/api-schemas/dist/plugin-docs.d.ts +172 -0
  186. package/node_modules/@kardalum/api-schemas/dist/plugin-docs.js +196 -0
  187. package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.d.ts +31 -0
  188. package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.js +38 -0
  189. package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.d.ts +69 -0
  190. package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.js +59 -0
  191. package/node_modules/@kardalum/api-schemas/dist/plugin-install.d.ts +585 -0
  192. package/node_modules/@kardalum/api-schemas/dist/plugin-install.js +536 -0
  193. package/node_modules/@kardalum/api-schemas/dist/plugin-locales.d.ts +75 -0
  194. package/node_modules/@kardalum/api-schemas/dist/plugin-locales.js +213 -0
  195. package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.d.ts +391 -0
  196. package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +413 -0
  197. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.d.ts +29 -0
  198. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.js +100 -0
  199. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.d.ts +44 -0
  200. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.js +162 -0
  201. package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.d.ts +31 -0
  202. package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.js +25 -0
  203. package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.d.ts +15 -0
  204. package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.js +24 -0
  205. package/node_modules/@kardalum/api-schemas/dist/public-api.schema.d.ts +314 -0
  206. package/node_modules/@kardalum/api-schemas/dist/public-api.schema.js +338 -0
  207. package/node_modules/@kardalum/api-schemas/dist/render-editing.d.ts +79 -0
  208. package/node_modules/@kardalum/api-schemas/dist/render-editing.js +50 -0
  209. package/node_modules/@kardalum/api-schemas/dist/render-settings-api.schema.d.ts +9 -0
  210. package/node_modules/@kardalum/api-schemas/dist/render-settings-api.schema.js +13 -0
  211. package/node_modules/@kardalum/api-schemas/dist/reserved-slugs.d.ts +2 -0
  212. package/node_modules/@kardalum/api-schemas/dist/reserved-slugs.js +16 -0
  213. package/node_modules/@kardalum/api-schemas/dist/role.schema.d.ts +96 -0
  214. package/node_modules/@kardalum/api-schemas/dist/role.schema.js +75 -0
  215. package/node_modules/@kardalum/api-schemas/dist/sample-content-outcome.schema.d.ts +17 -0
  216. package/node_modules/@kardalum/api-schemas/dist/sample-content-outcome.schema.js +27 -0
  217. package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.d.ts +35 -0
  218. package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.js +79 -0
  219. package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +138 -0
  220. package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.js +105 -0
  221. package/node_modules/@kardalum/api-schemas/dist/sites.schema.d.ts +243 -0
  222. package/node_modules/@kardalum/api-schemas/dist/sites.schema.js +296 -0
  223. package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.d.ts +47 -0
  224. package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.js +27 -0
  225. package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.d.ts +30 -0
  226. package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.js +19 -0
  227. package/node_modules/@kardalum/api-schemas/dist/template-api.schema.d.ts +112 -0
  228. package/node_modules/@kardalum/api-schemas/dist/template-api.schema.js +74 -0
  229. package/node_modules/@kardalum/api-schemas/dist/template.schema.d.ts +41 -0
  230. package/node_modules/@kardalum/api-schemas/dist/template.schema.js +39 -0
  231. package/node_modules/@kardalum/api-schemas/dist/theme-api.schema.d.ts +21 -0
  232. package/node_modules/@kardalum/api-schemas/dist/theme-api.schema.js +14 -0
  233. package/node_modules/@kardalum/api-schemas/dist/user-api.schema.d.ts +97 -0
  234. package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +73 -0
  235. package/node_modules/@kardalum/api-schemas/package.json +35 -0
  236. package/node_modules/@kardalum/design-tokens/LICENSE +202 -0
  237. package/node_modules/@kardalum/design-tokens/README.md +29 -0
  238. package/node_modules/@kardalum/design-tokens/dist/build-css.d.ts +32 -0
  239. package/node_modules/@kardalum/design-tokens/dist/build-css.js +88 -0
  240. package/node_modules/@kardalum/design-tokens/dist/generate.d.ts +1 -0
  241. package/node_modules/@kardalum/design-tokens/dist/generate.js +18 -0
  242. package/node_modules/@kardalum/design-tokens/dist/index.d.ts +6 -0
  243. package/node_modules/@kardalum/design-tokens/dist/index.js +4 -0
  244. package/node_modules/@kardalum/design-tokens/dist/system-dark.css +75 -0
  245. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.d.ts +33 -0
  246. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.js +54 -0
  247. package/node_modules/@kardalum/design-tokens/dist/theme-css.d.ts +12 -0
  248. package/node_modules/@kardalum/design-tokens/dist/theme-css.js +42 -0
  249. package/node_modules/@kardalum/design-tokens/dist/theme-types.d.ts +43 -0
  250. package/node_modules/@kardalum/design-tokens/dist/theme-types.js +1 -0
  251. package/node_modules/@kardalum/design-tokens/dist/themes/dark.d.ts +13 -0
  252. package/node_modules/@kardalum/design-tokens/dist/themes/dark.js +120 -0
  253. package/node_modules/@kardalum/design-tokens/dist/themes/index.d.ts +5 -0
  254. package/node_modules/@kardalum/design-tokens/dist/themes/index.js +4 -0
  255. package/node_modules/@kardalum/design-tokens/dist/themes/light.d.ts +9 -0
  256. package/node_modules/@kardalum/design-tokens/dist/themes/light.js +13 -0
  257. package/node_modules/@kardalum/design-tokens/dist/tokens.css +239 -0
  258. package/node_modules/@kardalum/design-tokens/dist/tokens.d.ts +25 -0
  259. package/node_modules/@kardalum/design-tokens/dist/tokens.js +276 -0
  260. package/node_modules/@kardalum/design-tokens/dist/tokens.json +212 -0
  261. package/node_modules/@kardalum/design-tokens/dist/types.d.ts +91 -0
  262. package/node_modules/@kardalum/design-tokens/dist/types.js +5 -0
  263. package/node_modules/@kardalum/design-tokens/package.json +42 -0
  264. package/node_modules/@kardalum/plugin-package/LICENSE +202 -0
  265. package/node_modules/@kardalum/plugin-package/README.md +71 -0
  266. package/node_modules/@kardalum/plugin-package/dist/build-reference.d.ts +111 -0
  267. package/node_modules/@kardalum/plugin-package/dist/build-reference.js +61 -0
  268. package/node_modules/@kardalum/plugin-package/dist/capabilities.d.ts +103 -0
  269. package/node_modules/@kardalum/plugin-package/dist/capabilities.js +351 -0
  270. package/node_modules/@kardalum/plugin-package/dist/docs-contract.d.ts +50 -0
  271. package/node_modules/@kardalum/plugin-package/dist/docs-contract.js +659 -0
  272. package/node_modules/@kardalum/plugin-package/dist/envelope.d.ts +19 -0
  273. package/node_modules/@kardalum/plugin-package/dist/envelope.js +104 -0
  274. package/node_modules/@kardalum/plugin-package/dist/extract.d.ts +37 -0
  275. package/node_modules/@kardalum/plugin-package/dist/extract.js +199 -0
  276. package/node_modules/@kardalum/plugin-package/dist/hash.d.ts +17 -0
  277. package/node_modules/@kardalum/plugin-package/dist/hash.js +69 -0
  278. package/node_modules/@kardalum/plugin-package/dist/index.d.ts +13 -0
  279. package/node_modules/@kardalum/plugin-package/dist/index.js +8 -0
  280. package/node_modules/@kardalum/plugin-package/dist/license-verdict.d.ts +185 -0
  281. package/node_modules/@kardalum/plugin-package/dist/license-verdict.js +236 -0
  282. package/node_modules/@kardalum/plugin-package/dist/package-contract.d.ts +50 -0
  283. package/node_modules/@kardalum/plugin-package/dist/package-contract.js +115 -0
  284. package/node_modules/@kardalum/plugin-package/dist/reference-entry.d.ts +2 -0
  285. package/node_modules/@kardalum/plugin-package/dist/reference-entry.js +6 -0
  286. package/node_modules/@kardalum/plugin-package/dist/sample-content.d.ts +20 -0
  287. package/node_modules/@kardalum/plugin-package/dist/sample-content.js +57 -0
  288. package/node_modules/@kardalum/plugin-package/dist/types.d.ts +43 -0
  289. package/node_modules/@kardalum/plugin-package/dist/types.js +15 -0
  290. package/node_modules/@kardalum/plugin-package/package.json +54 -0
  291. package/node_modules/@kardalum/ui/LICENSE +202 -0
  292. package/node_modules/@kardalum/ui/README.md +35 -0
  293. package/node_modules/@kardalum/ui/dist/components/alert-dialog.d.ts +14 -0
  294. package/node_modules/@kardalum/ui/dist/components/alert-dialog.js +38 -0
  295. package/node_modules/@kardalum/ui/dist/components/badge.d.ts +9 -0
  296. package/node_modules/@kardalum/ui/dist/components/badge.js +30 -0
  297. package/node_modules/@kardalum/ui/dist/components/button.d.ts +11 -0
  298. package/node_modules/@kardalum/ui/dist/components/button.js +37 -0
  299. package/node_modules/@kardalum/ui/dist/components/checkbox.d.ts +5 -0
  300. package/node_modules/@kardalum/ui/dist/components/checkbox.js +7 -0
  301. package/node_modules/@kardalum/ui/dist/components/dialog.d.ts +17 -0
  302. package/node_modules/@kardalum/ui/dist/components/dialog.js +48 -0
  303. package/node_modules/@kardalum/ui/dist/components/dropdown-menu.d.ts +18 -0
  304. package/node_modules/@kardalum/ui/dist/components/dropdown-menu.js +53 -0
  305. package/node_modules/@kardalum/ui/dist/components/empty-state.d.ts +30 -0
  306. package/node_modules/@kardalum/ui/dist/components/empty-state.js +9 -0
  307. package/node_modules/@kardalum/ui/dist/components/input.d.ts +4 -0
  308. package/node_modules/@kardalum/ui/dist/components/input.js +6 -0
  309. package/node_modules/@kardalum/ui/dist/components/panel.d.ts +5 -0
  310. package/node_modules/@kardalum/ui/dist/components/panel.js +6 -0
  311. package/node_modules/@kardalum/ui/dist/components/property-field.d.ts +19 -0
  312. package/node_modules/@kardalum/ui/dist/components/property-field.js +89 -0
  313. package/node_modules/@kardalum/ui/dist/components/sheet.d.ts +17 -0
  314. package/node_modules/@kardalum/ui/dist/components/sheet.js +55 -0
  315. package/node_modules/@kardalum/ui/dist/components/skeleton.d.ts +3 -0
  316. package/node_modules/@kardalum/ui/dist/components/skeleton.js +9 -0
  317. package/node_modules/@kardalum/ui/dist/components/switch.d.ts +5 -0
  318. package/node_modules/@kardalum/ui/dist/components/switch.js +7 -0
  319. package/node_modules/@kardalum/ui/dist/components/tab-strip.d.ts +34 -0
  320. package/node_modules/@kardalum/ui/dist/components/tab-strip.js +72 -0
  321. package/node_modules/@kardalum/ui/dist/components/toast.d.ts +18 -0
  322. package/node_modules/@kardalum/ui/dist/components/toast.js +42 -0
  323. package/node_modules/@kardalum/ui/dist/components/toaster.d.ts +12 -0
  324. package/node_modules/@kardalum/ui/dist/components/toaster.js +11 -0
  325. package/node_modules/@kardalum/ui/dist/components/use-toast.d.ts +17 -0
  326. package/node_modules/@kardalum/ui/dist/components/use-toast.js +62 -0
  327. package/node_modules/@kardalum/ui/dist/index.d.ts +18 -0
  328. package/node_modules/@kardalum/ui/dist/index.js +18 -0
  329. package/node_modules/@kardalum/ui/dist/lib/cn.d.ts +2 -0
  330. package/node_modules/@kardalum/ui/dist/lib/cn.js +5 -0
  331. package/node_modules/@kardalum/ui/package.json +63 -0
  332. package/package.json +146 -4
@@ -0,0 +1,338 @@
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/manage/v1/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
+ // S297: the whole multipart body of POST /api/v1/media for the OpenAPI document
307
+ // and the reference page: the fields above, then the file part. The route
308
+ // still streams the upload unvalidated and parses its fields with
309
+ // PublicMediaUploadFieldsSchema, so this schema is documentation only. The
310
+ // order is the route's rule: a field sent after the file may not be read.
311
+ export const PublicMediaUploadBodySchema = PublicMediaUploadFieldsSchema.extend({
312
+ file: z
313
+ .file()
314
+ .describe("The file to store. It must come after the visibility field in the multipart body: a field sent after the file may not be read."),
315
+ });
316
+ // PATCH /api/v1/media/:id body. v1 patches visibility only — metadata
317
+ // (filename, custom fields) is a later task, so visibility is required
318
+ // rather than optional: this is the only field there is, and an empty
319
+ // body has nothing to do. folderId is deliberately absent for the same
320
+ // admin-only reason as PublicMediaUploadFieldsSchema above; `.strict()`
321
+ // rejects it explicitly.
322
+ export const PublicMediaUpdateRequestSchema = z
323
+ .object({
324
+ visibility: MediaVisibilitySchema,
325
+ })
326
+ .strict();
327
+ // Upload (POST) and update (PATCH) both hand back the same public media
328
+ // item shape already used for reads/lists — an alias, not a fresh shape.
329
+ export const PublicMediaWriteResponseSchema = PublicMediaFileSchema;
330
+ // S234e: the route behind this now trashes rather than destroys (the
331
+ // admin DELETE route made the same change in the same session; see
332
+ // MediaService.trash), so `{ ok: true }` means "moved to the bin", not
333
+ // "gone for good" any more. The shape itself is unaffected: there was
334
+ // never a third state to report. There is no public restore route on
335
+ // this surface (restoring is admin-only, S234e Task 4), so a headless
336
+ // caller cannot undo this itself; an admin can still bring the item back
337
+ // from the bin in the meantime.
338
+ export const PublicMediaDeleteResponseSchema = z.object({ ok: z.literal(true) });
@@ -0,0 +1,79 @@
1
+ import { z } from "zod";
2
+ export declare const TextStyleEntrySchema: z.ZodObject<{
3
+ key: z.ZodString;
4
+ label: z.ZodString;
5
+ }, z.core.$strict>;
6
+ export type TextStyleEntry = z.infer<typeof TextStyleEntrySchema>;
7
+ export declare const TextStylesResponseSchema: z.ZodArray<z.ZodObject<{
8
+ key: z.ZodString;
9
+ label: z.ZodString;
10
+ }, z.core.$strict>>;
11
+ export type TextStylesResponse = z.infer<typeof TextStylesResponseSchema>;
12
+ export declare const BlockParamTypeSchema: z.ZodEnum<{
13
+ number: "number";
14
+ boolean: "boolean";
15
+ text: "text";
16
+ image: "image";
17
+ textarea: "textarea";
18
+ choice: "choice";
19
+ }>;
20
+ export type BlockParamType = z.infer<typeof BlockParamTypeSchema>;
21
+ export declare const BlockParamSchema: z.ZodObject<{
22
+ key: z.ZodString;
23
+ type: z.ZodEnum<{
24
+ number: "number";
25
+ boolean: "boolean";
26
+ text: "text";
27
+ image: "image";
28
+ textarea: "textarea";
29
+ choice: "choice";
30
+ }>;
31
+ label: z.ZodString;
32
+ options: z.ZodOptional<z.ZodArray<z.ZodString>>;
33
+ }, z.core.$strict>;
34
+ export type BlockParam = z.infer<typeof BlockParamSchema>;
35
+ export declare const BlockListingSchema: z.ZodObject<{
36
+ alias: z.ZodString;
37
+ name: z.ZodString;
38
+ params: z.ZodArray<z.ZodObject<{
39
+ key: z.ZodString;
40
+ type: z.ZodEnum<{
41
+ number: "number";
42
+ boolean: "boolean";
43
+ text: "text";
44
+ image: "image";
45
+ textarea: "textarea";
46
+ choice: "choice";
47
+ }>;
48
+ label: z.ZodString;
49
+ options: z.ZodOptional<z.ZodArray<z.ZodString>>;
50
+ }, z.core.$strict>>;
51
+ }, z.core.$strict>;
52
+ export type BlockListing = z.infer<typeof BlockListingSchema>;
53
+ export declare const BlockListResponseSchema: z.ZodArray<z.ZodObject<{
54
+ alias: z.ZodString;
55
+ name: z.ZodString;
56
+ params: z.ZodArray<z.ZodObject<{
57
+ key: z.ZodString;
58
+ type: z.ZodEnum<{
59
+ number: "number";
60
+ boolean: "boolean";
61
+ text: "text";
62
+ image: "image";
63
+ textarea: "textarea";
64
+ choice: "choice";
65
+ }>;
66
+ label: z.ZodString;
67
+ options: z.ZodOptional<z.ZodArray<z.ZodString>>;
68
+ }, z.core.$strict>>;
69
+ }, z.core.$strict>>;
70
+ export type BlockListResponse = z.infer<typeof BlockListResponseSchema>;
71
+ export declare const RenderBlockRequestSchema: z.ZodObject<{
72
+ partial: z.ZodString;
73
+ params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
74
+ }, z.core.$strict>;
75
+ export type RenderBlockRequest = z.infer<typeof RenderBlockRequestSchema>;
76
+ export declare const RenderBlockResponseSchema: z.ZodObject<{
77
+ html: z.ZodString;
78
+ }, z.core.$strict>;
79
+ export type RenderBlockResponse = z.infer<typeof RenderBlockResponseSchema>;
@@ -0,0 +1,50 @@
1
+ import { z } from "zod";
2
+ import { TemplateAliasSchema } from "./template.schema.js";
3
+ // S197 Task 6: the editor's server side. GET .../text-styles and
4
+ // .../blocks feed the richtext editor's dropdowns
5
+ // (rich-text-view.tsx's useTextStyles, insert-menu.tsx's/block-panel.tsx's
6
+ // useBlockListings); POST .../block renders one embeddable block's live
7
+ // preview (block-panel.tsx's BlockPreviewPopover). Both list responses are
8
+ // bare arrays, not `{items, nextCursor}` — deliberately NOT
9
+ // cursor-paginated, unlike api-design.md's list-endpoint rule for content:
10
+ // both sources are small, in-process scans over registered assets/
11
+ // templates (assetMirror.listTextStyles() / templateService.
12
+ // listEmbeddableBlocks(), Task 4), not content, and every existing UI
13
+ // consumer already parses a bare array off `await response.json()` — see
14
+ // the three files above.
15
+ export const TextStyleEntrySchema = z.object({ key: z.string(), label: z.string() }).strict();
16
+ export const TextStylesResponseSchema = z.array(TextStyleEntrySchema);
17
+ // Mirrors BlockParamType/BlockParam in apps/server/src/render/
18
+ // block-annotations.ts (the parser that produces these) — kept as an
19
+ // independent schema here rather than imported, same "server internals
20
+ // don't leak into api-schemas" boundary every other schema in this
21
+ // package respects.
22
+ export const BlockParamTypeSchema = z.enum(["text", "textarea", "number", "boolean", "image", "choice"]);
23
+ export const BlockParamSchema = z
24
+ .object({
25
+ key: z.string(),
26
+ type: BlockParamTypeSchema,
27
+ label: z.string(),
28
+ options: z.array(z.string()).optional(),
29
+ })
30
+ .strict();
31
+ export const BlockListingSchema = z
32
+ .object({
33
+ alias: TemplateAliasSchema,
34
+ name: z.string(),
35
+ params: z.array(BlockParamSchema),
36
+ })
37
+ .strict();
38
+ export const BlockListResponseSchema = z.array(BlockListingSchema);
39
+ // params is an arbitrary bag (whatever the block's own declared params
40
+ // require) — validated against the live template declaration server-side
41
+ // (block-annotations.ts's findInvalidBlockParamKey), not by this schema,
42
+ // so it stays a permissive record here rather than trying to model every
43
+ // possible declared param shape in Zod.
44
+ export const RenderBlockRequestSchema = z
45
+ .object({
46
+ partial: TemplateAliasSchema,
47
+ params: z.record(z.string(), z.unknown()),
48
+ })
49
+ .strict();
50
+ export const RenderBlockResponseSchema = z.object({ html: z.string() }).strict();
@@ -0,0 +1,9 @@
1
+ import { z } from "zod";
2
+ export declare const RenderSettingsSchema: z.ZodObject<{
3
+ catchAllTemplateId: z.ZodNullable<z.ZodString>;
4
+ }, z.core.$strip>;
5
+ export type RenderSettings = z.infer<typeof RenderSettingsSchema>;
6
+ export declare const UpdateRenderSettingsRequestSchema: z.ZodObject<{
7
+ catchAllTemplateId: z.ZodNullable<z.ZodString>;
8
+ }, z.core.$strict>;
9
+ export type UpdateRenderSettingsRequest = z.infer<typeof UpdateRenderSettingsRequestSchema>;
@@ -0,0 +1,13 @@
1
+ import { z } from "zod";
2
+ // Site-level render settings, stored in the (previously unused) Prisma
3
+ // `Setting` key-value model — key "render", value = this object. The
4
+ // catch-all template is the S192 spec §6 step-3 fallback: rendered when a
5
+ // node's document type has no template of its own (the SPA-shell case).
6
+ export const RenderSettingsSchema = z.object({
7
+ catchAllTemplateId: z.string().uuid().nullable(),
8
+ });
9
+ export const UpdateRenderSettingsRequestSchema = z
10
+ .object({
11
+ catchAllTemplateId: z.string().uuid().nullable(),
12
+ })
13
+ .strict();
@@ -0,0 +1,2 @@
1
+ export declare const RESERVED_ROOT_SLUGS: readonly ["kardalum", "api", "docs", "plugin-assets", "media", "kardalum-edit"];
2
+ export declare function isReservedRootSlug(slug: string): boolean;
@@ -0,0 +1,16 @@
1
+ // Root path segments the server owns (S184): /kardalum is the admin SPA,
2
+ // /api /docs /plugin-assets are route namespaces. Content at these roots
3
+ // would be shadowed the moment the Month-17 site renderer serves "/", so
4
+ // creation refuses them everywhere (one list, enforced in the content
5
+ // service both create paths share).
6
+ //
7
+ // "media" joins the list in S186c §3: GET /media/:id/v:version/:filename
8
+ // is a server-owned route namespace exactly like /api, /docs and
9
+ // /plugin-assets, so content at /media would be shadowed the same way.
10
+ //
11
+ // "kardalum-edit" joins in S277c: /kardalum-edit/* is the edit-on-page route, so
12
+ // a site named that would be shadowed by it.
13
+ export const RESERVED_ROOT_SLUGS = ["kardalum", "api", "docs", "plugin-assets", "media", "kardalum-edit"];
14
+ export function isReservedRootSlug(slug) {
15
+ return RESERVED_ROOT_SLUGS.includes(slug.toLowerCase());
16
+ }
@@ -0,0 +1,96 @@
1
+ import { z } from "zod";
2
+ /** An operator-chosen slug, chosen at create and never changed. Lowercase
3
+ * so it reads the same in a URL, a token and a SQL client. */
4
+ export declare const ROLE_ID_PATTERN: RegExp;
5
+ /** The two roles every install has. `admin` is the fixed superuser: it
6
+ * holds every registered action, has no role_actions rows, and cannot be
7
+ * deleted or have actions removed. `editor` is an ordinary editable row
8
+ * seeded with today's non-admin-gated actions; it cannot be deleted. */
9
+ export declare const SEEDED_ROLE_IDS: {
10
+ readonly admin: "admin";
11
+ readonly editor: "editor";
12
+ };
13
+ export type SeededRoleId = (typeof SEEDED_ROLE_IDS)[keyof typeof SEEDED_ROLE_IDS];
14
+ export declare const RoleIdSchema: z.ZodString;
15
+ export type RoleId = z.infer<typeof RoleIdSchema>;
16
+ /** One registered action, as the role editor lists it. `source` is "core"
17
+ * or, from S273 on, the id of the plugin that declared it. */
18
+ export declare const ActionSummarySchema: z.ZodObject<{
19
+ id: z.ZodString;
20
+ label: z.ZodString;
21
+ source: z.ZodString;
22
+ sourceLabel: z.ZodString;
23
+ active: z.ZodBoolean;
24
+ keyNote: z.ZodNullable<z.ZodString>;
25
+ }, z.core.$strip>;
26
+ export type ActionSummary = z.infer<typeof ActionSummarySchema>;
27
+ export declare const ActionListResponseSchema: z.ZodObject<{
28
+ items: z.ZodArray<z.ZodObject<{
29
+ id: z.ZodString;
30
+ label: z.ZodString;
31
+ source: z.ZodString;
32
+ sourceLabel: z.ZodString;
33
+ active: z.ZodBoolean;
34
+ keyNote: z.ZodNullable<z.ZodString>;
35
+ }, z.core.$strip>>;
36
+ }, z.core.$strip>;
37
+ export type ActionListResponse = z.infer<typeof ActionListResponseSchema>;
38
+ export declare const RoleSchema: z.ZodObject<{
39
+ id: z.ZodString;
40
+ label: z.ZodString;
41
+ actions: z.ZodArray<z.ZodString>;
42
+ superuser: z.ZodBoolean;
43
+ userCount: z.ZodNumber;
44
+ createdAt: z.ZodString;
45
+ updatedAt: z.ZodString;
46
+ }, z.core.$strip>;
47
+ export type Role = z.infer<typeof RoleSchema>;
48
+ export declare const RoleListQuerySchema: z.ZodObject<{
49
+ cursor: z.ZodOptional<z.ZodString>;
50
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
51
+ }, z.core.$strip>;
52
+ export type RoleListQuery = z.infer<typeof RoleListQuerySchema>;
53
+ export declare const RoleListResponseSchema: z.ZodObject<{
54
+ items: z.ZodArray<z.ZodObject<{
55
+ id: z.ZodString;
56
+ label: z.ZodString;
57
+ actions: z.ZodArray<z.ZodString>;
58
+ superuser: z.ZodBoolean;
59
+ userCount: z.ZodNumber;
60
+ createdAt: z.ZodString;
61
+ updatedAt: z.ZodString;
62
+ }, z.core.$strip>>;
63
+ nextCursor: z.ZodNullable<z.ZodString>;
64
+ }, z.core.$strip>;
65
+ export type RoleListResponse = z.infer<typeof RoleListResponseSchema>;
66
+ export declare const CreateRoleRequestSchema: z.ZodObject<{
67
+ id: z.ZodString;
68
+ label: z.ZodString;
69
+ actions: z.ZodArray<z.ZodString>;
70
+ }, z.core.$strip>;
71
+ export type CreateRoleRequest = z.infer<typeof CreateRoleRequestSchema>;
72
+ export declare const UpdateRoleRequestSchema: z.ZodObject<{
73
+ label: z.ZodOptional<z.ZodString>;
74
+ actions: z.ZodOptional<z.ZodArray<z.ZodString>>;
75
+ }, z.core.$strip>;
76
+ export type UpdateRoleRequest = z.infer<typeof UpdateRoleRequestSchema>;
77
+ export declare const RoleResponseSchema: z.ZodObject<{
78
+ role: z.ZodObject<{
79
+ id: z.ZodString;
80
+ label: z.ZodString;
81
+ actions: z.ZodArray<z.ZodString>;
82
+ superuser: z.ZodBoolean;
83
+ userCount: z.ZodNumber;
84
+ createdAt: z.ZodString;
85
+ updatedAt: z.ZodString;
86
+ }, z.core.$strip>;
87
+ }, z.core.$strip>;
88
+ export type RoleResponse = z.infer<typeof RoleResponseSchema>;
89
+ export declare const DeleteRoleResponseSchema: z.ZodObject<{
90
+ deleted: z.ZodLiteral<true>;
91
+ }, z.core.$strip>;
92
+ export type DeleteRoleResponse = z.infer<typeof DeleteRoleResponseSchema>;
93
+ export declare const RoleParamsSchema: z.ZodObject<{
94
+ id: z.ZodString;
95
+ }, z.core.$strip>;
96
+ export type RoleParams = z.infer<typeof RoleParamsSchema>;