@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,125 @@
1
+ export declare function joinContentPath(parentPath: string, slug: string): string;
2
+ /**
3
+ * The reserved `ContentVersion.data` key holding a node's display name.
4
+ *
5
+ * S227: the name lives in versioned data like any other field, so renaming
6
+ * inserts a version, history shows who renamed what, and a rollback
7
+ * restores the old name together with the old content
8
+ * (specs/2026-09-14-name-slug-copy-move-design.md §2).
9
+ *
10
+ * Safe by construction rather than by convention: a field id must match
11
+ * `/^[a-zA-Z][a-zA-Z0-9_]*$/` (document-type.schema.ts), so it must START
12
+ * with a letter. No user-defined field can ever be called `_name`, and
13
+ * nothing has to check for a collision.
14
+ */
15
+ export declare const CONTENT_NAME_KEY = "_name";
16
+ /**
17
+ * "About us" -> "about-us", "عن فريقنا" -> "عن-فريقنا".
18
+ *
19
+ * S227 REVERSED an earlier decision, so the history is worth stating
20
+ * plainly. This function used to strip everything outside `[a-z0-9]`,
21
+ * which meant a name written entirely in Arabic, Hebrew or CJK slugified
22
+ * to `""`, and its comment instructed callers to treat that as "no auto
23
+ * slug available" and make the user type a Latin one by hand.
24
+ *
25
+ * That is no longer true, and the reason is that RTL is foundational here
26
+ * rather than a later retrofit: under the old rule an Arabic-named page
27
+ * had no usable URL at all, and an Arabic-speaking editor had to invent a
28
+ * Latin name for every page they created. Unicode in a URL is a standard
29
+ * (RFC 3987), browsers display it natively and percent-encode it on the
30
+ * wire, and Umbraco has done this for years.
31
+ *
32
+ * So letters and digits of ANY script survive, and only what genuinely
33
+ * cannot sit in a path segment is replaced. `""` now comes back only for
34
+ * input with no letters or digits at all ("!!!", "---"), which callers
35
+ * must still treat as "no slug available" rather than inventing one.
36
+ *
37
+ * NFC rather than NFD: the composed form is what a browser address bar,
38
+ * a database index and a copied link all agree on, so the same visible
39
+ * name is always the same bytes. (The old code NFD-decomposed in order to
40
+ * strip diacritics off Latin letters, which only made sense while the
41
+ * output was ASCII-only.)
42
+ *
43
+ * Idempotent: slugify(slugify(x)) === slugify(x).
44
+ */
45
+ export declare function slugify(name: string): string;
46
+ /**
47
+ * S228: the first free name in a "Name", "Name (2)", "Name (3)" series.
48
+ *
49
+ * Built for copy, where landing beside the original is the common case and
50
+ * refusing would make the feature useless.
51
+ *
52
+ * This is the FIRST auto-naming generator in the codebase, and that is
53
+ * deliberate rather than accidental: every other collision path refuses
54
+ * instead (ContentPathConflictError, MediaFolderNameConflictError, the
55
+ * assets 409, the templates unique alias). It lives here beside slugify
56
+ * because the two must agree: the NAME is suffixed and the slug follows
57
+ * from it, so "About Us (2)" becomes "/about-us-2" and there is never a
58
+ * second rule deciding what a URL looks like.
59
+ *
60
+ * A base that already carries a suffix continues its own series rather
61
+ * than nesting: "About Us (2)" becomes "About Us (3)", never
62
+ * "About Us (2) (2)". Copying a copy is the exact case that produces it.
63
+ *
64
+ * `taken` is the set of names already in use among the target's siblings.
65
+ * The database's unique (path, locale) index remains the real guarantee;
66
+ * this only decides what to try first.
67
+ */
68
+ export declare function nextAvailableName(base: string, taken: Iterable<string>): string;
69
+ /** How many candidate slugs nextFreeSlug asks about before it gives up. */
70
+ export declare const NEXT_FREE_SLUG_ATTEMPTS = 200;
71
+ /**
72
+ * S277e: the first name in the "Name", "Name (2)", "Name (3)" series whose
73
+ * SLUG is free, with that slug.
74
+ *
75
+ * nextAvailableName picks by display name. A copy needs the other
76
+ * question answered, because the path is what collides: two pages may
77
+ * share a display name, and a page whose rename has not been published
78
+ * still shows its old name in a list while its path has already moved.
79
+ * `isFree` is the caller's whole test for a candidate (an occupied path, a
80
+ * reserved name, a language code, a name another node owns as the first
81
+ * part of an address), so every reason a slug cannot be used is skipped the
82
+ * same way. It is handed the candidate's display name as well, so a caller
83
+ * that will not have two siblings share a display name can refuse the
84
+ * candidate for that too.
85
+ *
86
+ * The series continues an existing one as nextAvailableName does. A name
87
+ * with no letters or digits has no slug, so it is never asked about and
88
+ * the series starts at its "(2)". `isFree` is asked about one candidate at
89
+ * a time and at most NEXT_FREE_SLUG_ATTEMPTS times; after that the name
90
+ * carries a timestamp, unchecked, as nextAvailableName's does, and the
91
+ * database's unique index on the path stays the real guarantee.
92
+ */
93
+ export declare function nextFreeSlug(baseName: string, isFree: (slug: string, name: string) => Promise<boolean>): Promise<{
94
+ name: string;
95
+ slug: string;
96
+ }>;
97
+ /**
98
+ * The one URL that represents this page, for a canonical link and for the
99
+ * admin's links to the live page.
100
+ *
101
+ * The prefixed URL when the site has more than one culture, the bare path
102
+ * when it does not. `path` is the page's public address (`publicPath`), so
103
+ * "/" is the default site and its prefixed form is the bare language root
104
+ * ("/de").
105
+ *
106
+ * S233: moved here from apps/server/src/cultures/resolve-culture.ts so the
107
+ * admin links to exactly the URL the renderer serves.
108
+ */
109
+ export declare function canonicalPath(path: string, culture: string, prefixed: boolean): string;
110
+ /**
111
+ * A node's public address: its stored path with the default site's own
112
+ * segment removed. A node of any other site keeps its stored path.
113
+ * `defaultSitePath` is the default site's stored path ("/home"), or null
114
+ * when the install has no default site.
115
+ */
116
+ export declare function publicPath(storedPath: string, defaultSitePath: string | null): string;
117
+ /**
118
+ * The first non-empty segment of a path: "/home" and "/home/about" give
119
+ * "home". "" for "/" or "".
120
+ *
121
+ * A path with no leading slash is read the same way ("home" gives "home"),
122
+ * because a direct caller of the service can pass one and the reserved-name
123
+ * check must judge the segment the server would route on.
124
+ */
125
+ export declare function firstSegment(path: string): string;
@@ -0,0 +1,256 @@
1
+ // Joins a slug onto a parent node's stored path.
2
+ //
3
+ // A parent path is never "/": no node is stored there (S277c). The home
4
+ // page is an ordinary top-level node ("/home") whose own segment the server
5
+ // hides from a visitor's address, so every parent path is "/" followed by
6
+ // at least one segment and the join is the plain one.
7
+ //
8
+ // This stays the ONE shared implementation for every place that turns a
9
+ // parent path and a slug into a child path (the seeder, the admin's create
10
+ // form, the content routes, ContentService), so they cannot come to
11
+ // disagree about it.
12
+ export function joinContentPath(parentPath, slug) {
13
+ return `${parentPath}/${slug}`;
14
+ }
15
+ /**
16
+ * The reserved `ContentVersion.data` key holding a node's display name.
17
+ *
18
+ * S227: the name lives in versioned data like any other field, so renaming
19
+ * inserts a version, history shows who renamed what, and a rollback
20
+ * restores the old name together with the old content
21
+ * (specs/2026-09-14-name-slug-copy-move-design.md §2).
22
+ *
23
+ * Safe by construction rather than by convention: a field id must match
24
+ * `/^[a-zA-Z][a-zA-Z0-9_]*$/` (document-type.schema.ts), so it must START
25
+ * with a letter. No user-defined field can ever be called `_name`, and
26
+ * nothing has to check for a collision.
27
+ */
28
+ export const CONTENT_NAME_KEY = "_name";
29
+ // No schema caps a content path segment's length (ContentNodeSchema and
30
+ // CreateContentRequestSchema only require `path: z.string().min(1)`), so
31
+ // this is a generous local ceiling rather than a validated contract: it
32
+ // exists so an unusually long name cannot silently produce an unusably
33
+ // long path segment.
34
+ const MAX_SLUG_LENGTH = 200;
35
+ /**
36
+ * "About us" -> "about-us", "عن فريقنا" -> "عن-فريقنا".
37
+ *
38
+ * S227 REVERSED an earlier decision, so the history is worth stating
39
+ * plainly. This function used to strip everything outside `[a-z0-9]`,
40
+ * which meant a name written entirely in Arabic, Hebrew or CJK slugified
41
+ * to `""`, and its comment instructed callers to treat that as "no auto
42
+ * slug available" and make the user type a Latin one by hand.
43
+ *
44
+ * That is no longer true, and the reason is that RTL is foundational here
45
+ * rather than a later retrofit: under the old rule an Arabic-named page
46
+ * had no usable URL at all, and an Arabic-speaking editor had to invent a
47
+ * Latin name for every page they created. Unicode in a URL is a standard
48
+ * (RFC 3987), browsers display it natively and percent-encode it on the
49
+ * wire, and Umbraco has done this for years.
50
+ *
51
+ * So letters and digits of ANY script survive, and only what genuinely
52
+ * cannot sit in a path segment is replaced. `""` now comes back only for
53
+ * input with no letters or digits at all ("!!!", "---"), which callers
54
+ * must still treat as "no slug available" rather than inventing one.
55
+ *
56
+ * NFC rather than NFD: the composed form is what a browser address bar,
57
+ * a database index and a copied link all agree on, so the same visible
58
+ * name is always the same bytes. (The old code NFD-decomposed in order to
59
+ * strip diacritics off Latin letters, which only made sense while the
60
+ * output was ASCII-only.)
61
+ *
62
+ * Idempotent: slugify(slugify(x)) === slugify(x).
63
+ */
64
+ export function slugify(name) {
65
+ const slug = name
66
+ .normalize("NFC")
67
+ .toLowerCase()
68
+ // Anything that is not a letter or a digit in any script becomes a
69
+ // separator. This covers whitespace, punctuation, emoji, and the
70
+ // characters that would otherwise change what the path MEANS: "/"
71
+ // (a segment boundary), "?" and "#" (URL delimiters), "%" (an escape
72
+ // introducer) and control characters.
73
+ .replace(/[^\p{L}\p{N}]+/gu, "-")
74
+ .replace(/^-+|-+$/g, "");
75
+ if (slug.length <= MAX_SLUG_LENGTH)
76
+ return slug;
77
+ const truncated = slug.slice(0, MAX_SLUG_LENGTH);
78
+ // The cut already lands between words when the very next character (just
79
+ // past the budget) is a dash or the slug ends there exactly.
80
+ const nextChar = slug.charAt(MAX_SLUG_LENGTH);
81
+ if (nextChar === "" || nextChar === "-")
82
+ return truncated.replace(/-+$/g, "");
83
+ // Otherwise the cut fell mid-word: back up to the last dash boundary so
84
+ // no word is severed, unless that dash is so early it would throw away
85
+ // nearly all of the budget for one very long final word, in which case a
86
+ // mid-word cut is the lesser evil.
87
+ const lastDash = truncated.lastIndexOf("-");
88
+ const cut = lastDash > MAX_SLUG_LENGTH / 2 ? truncated.slice(0, lastDash) : truncated;
89
+ return cut.replace(/-+$/g, "");
90
+ }
91
+ /**
92
+ * S228: the first free name in a "Name", "Name (2)", "Name (3)" series.
93
+ *
94
+ * Built for copy, where landing beside the original is the common case and
95
+ * refusing would make the feature useless.
96
+ *
97
+ * This is the FIRST auto-naming generator in the codebase, and that is
98
+ * deliberate rather than accidental: every other collision path refuses
99
+ * instead (ContentPathConflictError, MediaFolderNameConflictError, the
100
+ * assets 409, the templates unique alias). It lives here beside slugify
101
+ * because the two must agree: the NAME is suffixed and the slug follows
102
+ * from it, so "About Us (2)" becomes "/about-us-2" and there is never a
103
+ * second rule deciding what a URL looks like.
104
+ *
105
+ * A base that already carries a suffix continues its own series rather
106
+ * than nesting: "About Us (2)" becomes "About Us (3)", never
107
+ * "About Us (2) (2)". Copying a copy is the exact case that produces it.
108
+ *
109
+ * `taken` is the set of names already in use among the target's siblings.
110
+ * The database's unique (path, locale) index remains the real guarantee;
111
+ * this only decides what to try first.
112
+ */
113
+ export function nextAvailableName(base, taken) {
114
+ const used = new Set(taken);
115
+ if (!used.has(base))
116
+ return base;
117
+ // Continue an existing series instead of nesting suffixes.
118
+ const match = /^(.*?)\s*\((\d+)\)$/.exec(base);
119
+ const stem = match ? match[1] : base;
120
+ let counter = match ? Number(match[2]) + 1 : 2;
121
+ // Bounded rather than while(true): a caller passing a pathological
122
+ // `taken` set should get a wrong-ish name, not an infinite loop.
123
+ for (let attempt = 0; attempt < 10_000; attempt++) {
124
+ const candidate = `${stem} (${counter})`;
125
+ if (!used.has(candidate))
126
+ return candidate;
127
+ counter++;
128
+ }
129
+ return `${stem} (${Date.now()})`;
130
+ }
131
+ /** How many candidate slugs nextFreeSlug asks about before it gives up. */
132
+ export const NEXT_FREE_SLUG_ATTEMPTS = 200;
133
+ /**
134
+ * Splits "About Us (2)" into its stem and the number that follows it in
135
+ * the series, so a copy of a copy continues the series instead of nesting
136
+ * suffixes. A name with no whole trailing "(n)" is its own stem and the
137
+ * series starts at 2.
138
+ *
139
+ * A scan from the end, one character at a time: a name is whatever an
140
+ * editor typed, and this never looks at a character twice.
141
+ */
142
+ function seriesOf(name) {
143
+ const last = name.length - 1;
144
+ if (last < 2 || name.charAt(last) !== ")")
145
+ return { stem: name, next: 2 };
146
+ let at = last - 1;
147
+ while (at >= 0 && name.charAt(at) >= "0" && name.charAt(at) <= "9")
148
+ at -= 1;
149
+ const digits = name.slice(at + 1, last);
150
+ // More than 15 digits is no longer a number JavaScript counts exactly.
151
+ if (digits.length === 0 || digits.length > 15 || at < 0 || name.charAt(at) !== "(") {
152
+ return { stem: name, next: 2 };
153
+ }
154
+ return { stem: name.slice(0, at).trimEnd(), next: Number(digits) + 1 };
155
+ }
156
+ /** The slug of "<stem> (<number>)". slugify cuts a long slug at its
157
+ * ceiling, which would cut the number off and give every candidate of a
158
+ * long name the same slug, so the stem gives way to the number. */
159
+ function numberedSlug(stem, number) {
160
+ const suffix = `-${number}`;
161
+ const whole = slugify(`${stem} (${number})`);
162
+ if (whole === String(number) || whole.endsWith(suffix))
163
+ return whole;
164
+ let head = slugify(stem).slice(0, MAX_SLUG_LENGTH - suffix.length);
165
+ while (head.endsWith("-"))
166
+ head = head.slice(0, -1);
167
+ return head === "" ? String(number) : `${head}${suffix}`;
168
+ }
169
+ /**
170
+ * S277e: the first name in the "Name", "Name (2)", "Name (3)" series whose
171
+ * SLUG is free, with that slug.
172
+ *
173
+ * nextAvailableName picks by display name. A copy needs the other
174
+ * question answered, because the path is what collides: two pages may
175
+ * share a display name, and a page whose rename has not been published
176
+ * still shows its old name in a list while its path has already moved.
177
+ * `isFree` is the caller's whole test for a candidate (an occupied path, a
178
+ * reserved name, a language code, a name another node owns as the first
179
+ * part of an address), so every reason a slug cannot be used is skipped the
180
+ * same way. It is handed the candidate's display name as well, so a caller
181
+ * that will not have two siblings share a display name can refuse the
182
+ * candidate for that too.
183
+ *
184
+ * The series continues an existing one as nextAvailableName does. A name
185
+ * with no letters or digits has no slug, so it is never asked about and
186
+ * the series starts at its "(2)". `isFree` is asked about one candidate at
187
+ * a time and at most NEXT_FREE_SLUG_ATTEMPTS times; after that the name
188
+ * carries a timestamp, unchecked, as nextAvailableName's does, and the
189
+ * database's unique index on the path stays the real guarantee.
190
+ */
191
+ export async function nextFreeSlug(baseName, isFree) {
192
+ let attempts = 0;
193
+ const baseSlug = slugify(baseName);
194
+ if (baseSlug !== "") {
195
+ attempts += 1;
196
+ if (await isFree(baseSlug, baseName))
197
+ return { name: baseName, slug: baseSlug };
198
+ }
199
+ const { stem, next } = seriesOf(baseName);
200
+ for (let number = next; attempts < NEXT_FREE_SLUG_ATTEMPTS; number += 1) {
201
+ const slug = numberedSlug(stem, number);
202
+ const name = `${stem} (${number})`;
203
+ attempts += 1;
204
+ if (await isFree(slug, name))
205
+ return { name, slug };
206
+ }
207
+ const stamp = Date.now();
208
+ return { name: `${stem} (${stamp})`, slug: numberedSlug(stem, stamp) };
209
+ }
210
+ /**
211
+ * The one URL that represents this page, for a canonical link and for the
212
+ * admin's links to the live page.
213
+ *
214
+ * The prefixed URL when the site has more than one culture, the bare path
215
+ * when it does not. `path` is the page's public address (`publicPath`), so
216
+ * "/" is the default site and its prefixed form is the bare language root
217
+ * ("/de").
218
+ *
219
+ * S233: moved here from apps/server/src/cultures/resolve-culture.ts so the
220
+ * admin links to exactly the URL the renderer serves.
221
+ */
222
+ export function canonicalPath(path, culture, prefixed) {
223
+ if (!prefixed)
224
+ return path;
225
+ return path === "/" ? `/${culture}` : `/${culture}${path}`;
226
+ }
227
+ /**
228
+ * A node's public address: its stored path with the default site's own
229
+ * segment removed. A node of any other site keeps its stored path.
230
+ * `defaultSitePath` is the default site's stored path ("/home"), or null
231
+ * when the install has no default site.
232
+ */
233
+ export function publicPath(storedPath, defaultSitePath) {
234
+ if (defaultSitePath === null)
235
+ return storedPath;
236
+ if (storedPath === defaultSitePath)
237
+ return "/";
238
+ if (storedPath.startsWith(`${defaultSitePath}/`))
239
+ return storedPath.slice(defaultSitePath.length);
240
+ return storedPath;
241
+ }
242
+ /**
243
+ * The first non-empty segment of a path: "/home" and "/home/about" give
244
+ * "home". "" for "/" or "".
245
+ *
246
+ * A path with no leading slash is read the same way ("home" gives "home"),
247
+ * because a direct caller of the service can pass one and the reserved-name
248
+ * check must judge the segment the server would route on.
249
+ */
250
+ export function firstSegment(path) {
251
+ let start = 0;
252
+ while (start < path.length && path.charAt(start) === "/")
253
+ start++;
254
+ const end = path.indexOf("/", start);
255
+ return path.slice(start, end === -1 ? undefined : end);
256
+ }
@@ -0,0 +1,20 @@
1
+ import { z } from "zod";
2
+ export declare const ContentTrashBodySchema: z.ZodOptional<z.ZodNullable<z.ZodObject<{
3
+ confirm: z.ZodOptional<z.ZodBoolean>;
4
+ }, z.core.$strip>>>;
5
+ export type ContentTrashBody = z.infer<typeof ContentTrashBodySchema>;
6
+ export declare const ContentTrashConfirmationSchema: z.ZodObject<{
7
+ requiresConfirmation: z.ZodLiteral<true>;
8
+ nodeName: z.ZodString;
9
+ descendantCount: z.ZodNumber;
10
+ message: z.ZodString;
11
+ }, z.core.$strip>;
12
+ export type ContentTrashConfirmation = z.infer<typeof ContentTrashConfirmationSchema>;
13
+ export declare const ContentTrashResultSchema: z.ZodObject<{
14
+ trashedCount: z.ZodNumber;
15
+ }, z.core.$strip>;
16
+ export type ContentTrashResult = z.infer<typeof ContentTrashResultSchema>;
17
+ export declare const ContentRestoreResultSchema: z.ZodObject<{
18
+ restoredCount: z.ZodNumber;
19
+ }, z.core.$strip>;
20
+ export type ContentRestoreResult = z.infer<typeof ContentRestoreResultSchema>;
@@ -0,0 +1,23 @@
1
+ import { z } from "zod";
2
+ // S154 content trash. The DELETE is two-step like the structured-data
3
+ // uninstall gate: unconfirmed → 409 naming the blast radius (the count
4
+ // the confirm dialog renders), confirmed → trash. Trash is SOFT —
5
+ // reversible via the restore route — so this is a plain confirmation,
6
+ // not the snapshot-gate treatment.
7
+ //
8
+ // Fastify substitutes `null` for a genuinely absent body before handing it
9
+ // to the validator — a DELETE sent with no payload at all lands here as
10
+ // `null`, not `undefined`. `.nullish()` (not `.optional()`) is required so
11
+ // an absent body validates; `request.body?.confirm` in the route handler
12
+ // already tolerates both null and undefined.
13
+ export const ContentTrashBodySchema = z
14
+ .object({ confirm: z.boolean().optional() })
15
+ .nullish();
16
+ export const ContentTrashConfirmationSchema = z.object({
17
+ requiresConfirmation: z.literal(true),
18
+ nodeName: z.string(),
19
+ descendantCount: z.number().int(),
20
+ message: z.string(),
21
+ });
22
+ export const ContentTrashResultSchema = z.object({ trashedCount: z.number().int() });
23
+ export const ContentRestoreResultSchema = z.object({ restoredCount: z.number().int() });
@@ -0,0 +1,151 @@
1
+ import { z } from "zod";
2
+ export declare const ContentTrashListQuerySchema: z.ZodObject<{
3
+ cursor: z.ZodOptional<z.ZodString>;
4
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
5
+ }, z.core.$strip>;
6
+ export declare const TrashedSubtreeSchema: z.ZodObject<{
7
+ id: z.ZodString;
8
+ path: z.ZodString;
9
+ documentTypeId: z.ZodString;
10
+ deletedAt: z.ZodString;
11
+ nodeCount: z.ZodNumber;
12
+ orphaned: z.ZodBoolean;
13
+ name: z.ZodNullable<z.ZodString>;
14
+ access: z.ZodObject<{
15
+ read: z.ZodBoolean;
16
+ create: z.ZodBoolean;
17
+ update: z.ZodBoolean;
18
+ publish: z.ZodBoolean;
19
+ delete: z.ZodBoolean;
20
+ denied: z.ZodRecord<z.ZodEnum<{
21
+ "content.read": "content.read";
22
+ "content.create": "content.create";
23
+ "content.update": "content.update";
24
+ "content.publish": "content.publish";
25
+ "content.delete": "content.delete";
26
+ }> & z.core.$partial, z.ZodObject<{
27
+ reason: z.ZodEnum<{
28
+ "role-lacks-action": "role-lacks-action";
29
+ "not-granted": "not-granted";
30
+ }>;
31
+ decidedAt: z.ZodNullable<z.ZodObject<{
32
+ nodeId: z.ZodString;
33
+ path: z.ZodNullable<z.ZodString>;
34
+ name: z.ZodNullable<z.ZodString>;
35
+ mode: z.ZodEnum<{
36
+ restricted: "restricted";
37
+ open: "open";
38
+ }>;
39
+ grants: z.ZodArray<z.ZodObject<{
40
+ subjectKind: z.ZodEnum<{
41
+ role: "role";
42
+ user: "user";
43
+ }>;
44
+ subjectId: z.ZodString;
45
+ label: z.ZodNullable<z.ZodString>;
46
+ }, z.core.$strip>>;
47
+ }, z.core.$strip>>;
48
+ }, z.core.$strip>>;
49
+ }, z.core.$strip>;
50
+ }, z.core.$strip>;
51
+ export declare const ContentTrashListResponseSchema: z.ZodObject<{
52
+ items: z.ZodArray<z.ZodObject<{
53
+ id: z.ZodString;
54
+ path: z.ZodString;
55
+ documentTypeId: z.ZodString;
56
+ deletedAt: z.ZodString;
57
+ nodeCount: z.ZodNumber;
58
+ orphaned: z.ZodBoolean;
59
+ name: z.ZodNullable<z.ZodString>;
60
+ access: z.ZodObject<{
61
+ read: z.ZodBoolean;
62
+ create: z.ZodBoolean;
63
+ update: z.ZodBoolean;
64
+ publish: z.ZodBoolean;
65
+ delete: z.ZodBoolean;
66
+ denied: z.ZodRecord<z.ZodEnum<{
67
+ "content.read": "content.read";
68
+ "content.create": "content.create";
69
+ "content.update": "content.update";
70
+ "content.publish": "content.publish";
71
+ "content.delete": "content.delete";
72
+ }> & z.core.$partial, z.ZodObject<{
73
+ reason: z.ZodEnum<{
74
+ "role-lacks-action": "role-lacks-action";
75
+ "not-granted": "not-granted";
76
+ }>;
77
+ decidedAt: z.ZodNullable<z.ZodObject<{
78
+ nodeId: z.ZodString;
79
+ path: z.ZodNullable<z.ZodString>;
80
+ name: z.ZodNullable<z.ZodString>;
81
+ mode: z.ZodEnum<{
82
+ restricted: "restricted";
83
+ open: "open";
84
+ }>;
85
+ grants: z.ZodArray<z.ZodObject<{
86
+ subjectKind: z.ZodEnum<{
87
+ role: "role";
88
+ user: "user";
89
+ }>;
90
+ subjectId: z.ZodString;
91
+ label: z.ZodNullable<z.ZodString>;
92
+ }, z.core.$strip>>;
93
+ }, z.core.$strip>>;
94
+ }, z.core.$strip>>;
95
+ }, z.core.$strip>;
96
+ }, z.core.$strip>>;
97
+ nextCursor: z.ZodNullable<z.ZodString>;
98
+ }, z.core.$strip>;
99
+ export declare const ContentRestoreBlockedSchema: z.ZodObject<{
100
+ message: z.ZodString;
101
+ blockingAncestorPath: z.ZodString;
102
+ }, z.core.$strip>;
103
+ export declare const ContentRestorePathOccupiedSchema: z.ZodObject<{
104
+ message: z.ZodString;
105
+ path: z.ZodString;
106
+ }, z.core.$strip>;
107
+ export declare const ContentRestoreOrphanSchema: z.ZodObject<{
108
+ message: z.ZodString;
109
+ }, z.core.$strip>;
110
+ export declare const ContentRestoreNameTakenSchema: z.ZodObject<{
111
+ message: z.ZodString;
112
+ reason: z.ZodLiteral<"name-taken">;
113
+ cause: z.ZodEnum<{
114
+ taken: "taken";
115
+ reserved: "reserved";
116
+ language: "language";
117
+ }>;
118
+ slug: z.ZodString;
119
+ heldByPath: z.ZodNullable<z.ZodString>;
120
+ }, z.core.$strip>;
121
+ export declare const ContentRestoreLimitSchema: z.ZodObject<{
122
+ message: z.ZodString;
123
+ reason: z.ZodLiteral<"restriction-limit">;
124
+ }, z.core.$strip>;
125
+ export declare const ContentRestoreConflictSchema: z.ZodUnion<readonly [z.ZodObject<{
126
+ message: z.ZodString;
127
+ reason: z.ZodLiteral<"name-taken">;
128
+ cause: z.ZodEnum<{
129
+ taken: "taken";
130
+ reserved: "reserved";
131
+ language: "language";
132
+ }>;
133
+ slug: z.ZodString;
134
+ heldByPath: z.ZodNullable<z.ZodString>;
135
+ }, z.core.$strip>, z.ZodObject<{
136
+ message: z.ZodString;
137
+ reason: z.ZodLiteral<"restriction-limit">;
138
+ }, z.core.$strip>, z.ZodObject<{
139
+ message: z.ZodString;
140
+ blockingAncestorPath: z.ZodString;
141
+ }, z.core.$strip>, z.ZodObject<{
142
+ message: z.ZodString;
143
+ path: z.ZodString;
144
+ }, z.core.$strip>, z.ZodObject<{
145
+ message: z.ZodString;
146
+ }, z.core.$strip>]>;
147
+ export type ContentTrashListResponse = z.infer<typeof ContentTrashListResponseSchema>;
148
+ export type TrashedSubtreeDto = z.infer<typeof TrashedSubtreeSchema>;
149
+ export type ContentRestoreBlocked = z.infer<typeof ContentRestoreBlockedSchema>;
150
+ export type ContentRestoreNameTaken = z.infer<typeof ContentRestoreNameTakenSchema>;
151
+ export type ContentRestoreLimit = z.infer<typeof ContentRestoreLimitSchema>;
@@ -0,0 +1,82 @@
1
+ import { z } from "zod";
2
+ import { NodeAccessFlagsSchema } from "./node-access.schema.js";
3
+ // S161: the trash browse surface. Separate from content-trash-api.schema.ts
4
+ // (S154's trash/restore confirmation bodies) — this file is the list route
5
+ // and the restore-blocked 409, added a session later.
6
+ export const ContentTrashListQuerySchema = z.object({
7
+ cursor: z.string().optional(),
8
+ limit: z.coerce.number().int().min(1).max(100).default(50),
9
+ });
10
+ export const TrashedSubtreeSchema = z.object({
11
+ id: z.string(),
12
+ path: z.string(),
13
+ documentTypeId: z.string(),
14
+ deletedAt: z.string(),
15
+ nodeCount: z.number().int().nonnegative(),
16
+ // True when the node's parent was permanently removed rather than
17
+ // trashed. Such a row cannot be restored (the restore route answers 409),
18
+ // and the UI says so in place of a Restore button.
19
+ orphaned: z.boolean(),
20
+ // S279 (D10): the row is decided for the signed-in person as the live tree
21
+ // decides a row, each action as a read of a trashed page is decided (the
22
+ // page's own entries, those under it and those of its trashed ancestors;
23
+ // an orphan is the admin role's alone). A row whose read is refused keeps
24
+ // its place (id, type, time, counts) and is sent with a null name and its
25
+ // path's last segment alone (`/<segment>`), so the pages above it are not
26
+ // named (A3).
27
+ // `name` is otherwise the page's name, or its last path segment when it
28
+ // has none recorded.
29
+ name: z.string().nullable(),
30
+ access: NodeAccessFlagsSchema,
31
+ });
32
+ export const ContentTrashListResponseSchema = z.object({
33
+ items: z.array(TrashedSubtreeSchema),
34
+ nextCursor: z.string().nullable(),
35
+ });
36
+ export const ContentRestoreBlockedSchema = z.object({
37
+ message: z.string(),
38
+ blockingAncestorPath: z.string(),
39
+ });
40
+ // S277b: the other two 409s of a restore. A live page now holds one of the
41
+ // addresses (`path` names it), or the page it was under is gone for good.
42
+ export const ContentRestorePathOccupiedSchema = z.object({
43
+ message: z.string(),
44
+ path: z.string(),
45
+ });
46
+ export const ContentRestoreOrphanSchema = z.object({
47
+ message: z.string(),
48
+ });
49
+ // S277e: the fourth 409 of a restore. A name the restore would bring back
50
+ // is now owned as the first part of an address: by a top-level page or a
51
+ // page directly under one (`heldByPath` names it), or by the server or a
52
+ // language (`heldByPath` is null, and the message says which). `slug` is
53
+ // the name at fault, which is the restored page's own or that of a page
54
+ // directly under it. `reason` is what tells this body from the others.
55
+ // `cause` says which of the three it is, so a client can say it in its own
56
+ // words: "taken" (a page holds the name, `heldByPath`), "reserved" (the
57
+ // server's own first segments) or "language" (a language of the site).
58
+ export const ContentRestoreNameTakenSchema = z.object({
59
+ message: z.string(),
60
+ reason: z.literal("name-taken"),
61
+ cause: z.enum(["taken", "reserved", "language"]),
62
+ slug: z.string(),
63
+ heldByPath: z.string().nullable(),
64
+ });
65
+ // S278: the fifth 409 of a restore. Restricted pages in the trash are not
66
+ // counted by the limit of pages that carry restrictions, and count again
67
+ // once they are back; this restore would bring back more of them than the
68
+ // limit leaves room for. Nothing was restored. `message` is the limit's own
69
+ // sentence, the one a refused save of the permissions tab carries.
70
+ export const ContentRestoreLimitSchema = z.object({
71
+ message: z.string(),
72
+ reason: z.literal("restriction-limit"),
73
+ });
74
+ // Most specific body first: a union answers with the first member that parses,
75
+ // and a plain z.object strips keys it does not know.
76
+ export const ContentRestoreConflictSchema = z.union([
77
+ ContentRestoreNameTakenSchema,
78
+ ContentRestoreLimitSchema,
79
+ ContentRestoreBlockedSchema,
80
+ ContentRestorePathOccupiedSchema,
81
+ ContentRestoreOrphanSchema,
82
+ ]);