@orthacms/content-server 0.0.0-reserve.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 (396) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +7 -0
  3. package/dist/define.d.ts +17 -0
  4. package/dist/define.d.ts.map +1 -0
  5. package/dist/define.js +28 -0
  6. package/dist/index.d.ts +48 -0
  7. package/dist/index.d.ts.map +1 -0
  8. package/dist/index.js +109 -0
  9. package/dist/lib/collection/define.d.ts +35 -0
  10. package/dist/lib/collection/define.d.ts.map +1 -0
  11. package/dist/lib/collection/define.js +217 -0
  12. package/dist/lib/collection/table-builder.d.ts +28 -0
  13. package/dist/lib/collection/table-builder.d.ts.map +1 -0
  14. package/dist/lib/collection/table-builder.js +306 -0
  15. package/dist/lib/content-types/controllers/get-content-schema.controller.d.ts +24 -0
  16. package/dist/lib/content-types/controllers/get-content-schema.controller.d.ts.map +1 -0
  17. package/dist/lib/content-types/controllers/get-content-schema.controller.js +58 -0
  18. package/dist/lib/content-types/controllers/get-filter-fields.controller.d.ts +35 -0
  19. package/dist/lib/content-types/controllers/get-filter-fields.controller.d.ts.map +1 -0
  20. package/dist/lib/content-types/controllers/get-filter-fields.controller.js +74 -0
  21. package/dist/lib/content-types/controllers/list-content-schema.controller.d.ts +15 -0
  22. package/dist/lib/content-types/controllers/list-content-schema.controller.d.ts.map +1 -0
  23. package/dist/lib/content-types/controllers/list-content-schema.controller.js +38 -0
  24. package/dist/lib/content-types/queries/workspace-grants.query.d.ts +25 -0
  25. package/dist/lib/content-types/queries/workspace-grants.query.d.ts.map +1 -0
  26. package/dist/lib/content-types/queries/workspace-grants.query.js +45 -0
  27. package/dist/lib/content.module.d.ts +21 -0
  28. package/dist/lib/content.module.d.ts.map +1 -0
  29. package/dist/lib/content.module.js +264 -0
  30. package/dist/lib/content.tokens.d.ts +5 -0
  31. package/dist/lib/content.tokens.d.ts.map +1 -0
  32. package/dist/lib/content.tokens.js +9 -0
  33. package/dist/lib/copilot/content-tool.provider.d.ts +64 -0
  34. package/dist/lib/copilot/content-tool.provider.d.ts.map +1 -0
  35. package/dist/lib/copilot/content-tool.provider.js +309 -0
  36. package/dist/lib/copilot/diff-snapshots.d.ts +42 -0
  37. package/dist/lib/copilot/diff-snapshots.d.ts.map +1 -0
  38. package/dist/lib/copilot/diff-snapshots.js +77 -0
  39. package/dist/lib/copilot/entry-proposal.applier.d.ts +89 -0
  40. package/dist/lib/copilot/entry-proposal.applier.d.ts.map +1 -0
  41. package/dist/lib/copilot/entry-proposal.applier.js +245 -0
  42. package/dist/lib/copilot/entry-proposal.provider.d.ts +157 -0
  43. package/dist/lib/copilot/entry-proposal.provider.d.ts.map +1 -0
  44. package/dist/lib/copilot/entry-proposal.provider.js +619 -0
  45. package/dist/lib/copilot/filter-schema.d.ts +61 -0
  46. package/dist/lib/copilot/filter-schema.d.ts.map +1 -0
  47. package/dist/lib/copilot/filter-schema.js +139 -0
  48. package/dist/lib/copilot/project-entry.d.ts +23 -0
  49. package/dist/lib/copilot/project-entry.d.ts.map +1 -0
  50. package/dist/lib/copilot/project-entry.js +36 -0
  51. package/dist/lib/copilot/proposal-kinds.d.ts +30 -0
  52. package/dist/lib/copilot/proposal-kinds.d.ts.map +1 -0
  53. package/dist/lib/copilot/proposal-kinds.js +32 -0
  54. package/dist/lib/copilot/revision-tool.provider.d.ts +56 -0
  55. package/dist/lib/copilot/revision-tool.provider.d.ts.map +1 -0
  56. package/dist/lib/copilot/revision-tool.provider.js +215 -0
  57. package/dist/lib/docs/content-schemas.d.ts +34 -0
  58. package/dist/lib/docs/content-schemas.d.ts.map +1 -0
  59. package/dist/lib/docs/content-schemas.js +617 -0
  60. package/dist/lib/docs/describe-content-api.d.ts +22 -0
  61. package/dist/lib/docs/describe-content-api.d.ts.map +1 -0
  62. package/dist/lib/docs/describe-content-api.js +173 -0
  63. package/dist/lib/docs/field-schema.d.ts +28 -0
  64. package/dist/lib/docs/field-schema.d.ts.map +1 -0
  65. package/dist/lib/docs/field-schema.js +214 -0
  66. package/dist/lib/entries/application/use-cases/bulk-publish-entries.use-case.d.ts +23 -0
  67. package/dist/lib/entries/application/use-cases/bulk-publish-entries.use-case.d.ts.map +1 -0
  68. package/dist/lib/entries/application/use-cases/bulk-publish-entries.use-case.js +77 -0
  69. package/dist/lib/entries/application/use-cases/bulk-unpublish-entries.use-case.d.ts +23 -0
  70. package/dist/lib/entries/application/use-cases/bulk-unpublish-entries.use-case.d.ts.map +1 -0
  71. package/dist/lib/entries/application/use-cases/bulk-unpublish-entries.use-case.js +66 -0
  72. package/dist/lib/entries/application/use-cases/publish-entry.use-case.d.ts +43 -0
  73. package/dist/lib/entries/application/use-cases/publish-entry.use-case.d.ts.map +1 -0
  74. package/dist/lib/entries/application/use-cases/publish-entry.use-case.js +106 -0
  75. package/dist/lib/entries/application/use-cases/unpublish-entry.use-case.d.ts +30 -0
  76. package/dist/lib/entries/application/use-cases/unpublish-entry.use-case.d.ts.map +1 -0
  77. package/dist/lib/entries/application/use-cases/unpublish-entry.use-case.js +70 -0
  78. package/dist/lib/entries/controllers/bulk-entries.controller.d.ts +26 -0
  79. package/dist/lib/entries/controllers/bulk-entries.controller.d.ts.map +1 -0
  80. package/dist/lib/entries/controllers/create-entry.controller.d.ts +20 -0
  81. package/dist/lib/entries/controllers/create-entry.controller.d.ts.map +1 -0
  82. package/dist/lib/entries/controllers/delete-entry.controller.d.ts +24 -0
  83. package/dist/lib/entries/controllers/delete-entry.controller.d.ts.map +1 -0
  84. package/dist/lib/entries/controllers/get-entry.controller.d.ts +34 -0
  85. package/dist/lib/entries/controllers/get-entry.controller.d.ts.map +1 -0
  86. package/dist/lib/entries/controllers/list-entries.controller.d.ts +20 -0
  87. package/dist/lib/entries/controllers/list-entries.controller.d.ts.map +1 -0
  88. package/dist/lib/entries/controllers/publish-entry.controller.d.ts +19 -0
  89. package/dist/lib/entries/controllers/publish-entry.controller.d.ts.map +1 -0
  90. package/dist/lib/entries/controllers/resolve-type.d.ts +9 -0
  91. package/dist/lib/entries/controllers/resolve-type.d.ts.map +1 -0
  92. package/dist/lib/entries/controllers/update-entry.controller.d.ts +18 -0
  93. package/dist/lib/entries/controllers/update-entry.controller.d.ts.map +1 -0
  94. package/dist/lib/entries/domain/entry-publish-blocked.error.d.ts +13 -0
  95. package/dist/lib/entries/domain/entry-publish-blocked.error.d.ts.map +1 -0
  96. package/dist/lib/entries/domain/entry-publish-blocked.error.js +19 -0
  97. package/dist/lib/entries/domain/entry.d.ts +71 -0
  98. package/dist/lib/entries/domain/entry.d.ts.map +1 -0
  99. package/dist/lib/entries/domain/entry.js +90 -0
  100. package/dist/lib/entries/domain/events/entry-events.d.ts +67 -0
  101. package/dist/lib/entries/domain/events/entry-events.d.ts.map +1 -0
  102. package/dist/lib/entries/domain/events/entry-events.js +100 -0
  103. package/dist/lib/entries/dto/bulk-ids.dto.d.ts +11 -0
  104. package/dist/lib/entries/dto/bulk-ids.dto.d.ts.map +1 -0
  105. package/dist/lib/entries/dto/list-entries-query.dto.d.ts +46 -0
  106. package/dist/lib/entries/dto/list-entries-query.dto.d.ts.map +1 -0
  107. package/dist/lib/entries/dto/relation-delta-map.validator.d.ts +19 -0
  108. package/dist/lib/entries/dto/relation-delta-map.validator.d.ts.map +1 -0
  109. package/dist/lib/entries/dto/save-entry.dto.d.ts +46 -0
  110. package/dist/lib/entries/dto/save-entry.dto.d.ts.map +1 -0
  111. package/dist/lib/entries/entries.constants.d.ts +19 -0
  112. package/dist/lib/entries/entries.constants.d.ts.map +1 -0
  113. package/dist/lib/entries/entries.constants.js +21 -0
  114. package/dist/lib/entries/http/controllers/bulk-entries.controller.d.ts +33 -0
  115. package/dist/lib/entries/http/controllers/bulk-entries.controller.d.ts.map +1 -0
  116. package/dist/lib/entries/http/controllers/bulk-entries.controller.js +143 -0
  117. package/dist/lib/entries/http/controllers/create-entry.controller.d.ts +21 -0
  118. package/dist/lib/entries/http/controllers/create-entry.controller.d.ts.map +1 -0
  119. package/dist/lib/entries/http/controllers/create-entry.controller.js +52 -0
  120. package/dist/lib/entries/http/controllers/delete-entry.controller.d.ts +25 -0
  121. package/dist/lib/entries/http/controllers/delete-entry.controller.d.ts.map +1 -0
  122. package/dist/lib/entries/http/controllers/delete-entry.controller.js +84 -0
  123. package/dist/lib/entries/http/controllers/get-entry.controller.d.ts +44 -0
  124. package/dist/lib/entries/http/controllers/get-entry.controller.d.ts.map +1 -0
  125. package/dist/lib/entries/http/controllers/get-entry.controller.js +124 -0
  126. package/dist/lib/entries/http/controllers/list-entries.controller.d.ts +20 -0
  127. package/dist/lib/entries/http/controllers/list-entries.controller.d.ts.map +1 -0
  128. package/dist/lib/entries/http/controllers/list-entries.controller.js +52 -0
  129. package/dist/lib/entries/http/controllers/publish-entry.controller.d.ts +22 -0
  130. package/dist/lib/entries/http/controllers/publish-entry.controller.d.ts.map +1 -0
  131. package/dist/lib/entries/http/controllers/publish-entry.controller.js +68 -0
  132. package/dist/lib/entries/http/controllers/resolve-type.d.ts +9 -0
  133. package/dist/lib/entries/http/controllers/resolve-type.d.ts.map +1 -0
  134. package/dist/lib/entries/http/controllers/resolve-type.js +16 -0
  135. package/dist/lib/entries/http/controllers/to-actor.d.ts +13 -0
  136. package/dist/lib/entries/http/controllers/to-actor.d.ts.map +1 -0
  137. package/dist/lib/entries/http/controllers/to-actor.js +15 -0
  138. package/dist/lib/entries/http/controllers/update-entry.controller.d.ts +19 -0
  139. package/dist/lib/entries/http/controllers/update-entry.controller.d.ts.map +1 -0
  140. package/dist/lib/entries/http/controllers/update-entry.controller.js +51 -0
  141. package/dist/lib/entries/http/dto/bulk-ids.dto.d.ts +11 -0
  142. package/dist/lib/entries/http/dto/bulk-ids.dto.d.ts.map +1 -0
  143. package/dist/lib/entries/http/dto/bulk-ids.dto.js +33 -0
  144. package/dist/lib/entries/http/dto/list-entries-query.dto.d.ts +66 -0
  145. package/dist/lib/entries/http/dto/list-entries-query.dto.d.ts.map +1 -0
  146. package/dist/lib/entries/http/dto/list-entries-query.dto.js +192 -0
  147. package/dist/lib/entries/http/dto/relation-delta-map.validator.d.ts +30 -0
  148. package/dist/lib/entries/http/dto/relation-delta-map.validator.d.ts.map +1 -0
  149. package/dist/lib/entries/http/dto/relation-delta-map.validator.js +102 -0
  150. package/dist/lib/entries/http/dto/save-entry.dto.d.ts +48 -0
  151. package/dist/lib/entries/http/dto/save-entry.dto.d.ts.map +1 -0
  152. package/dist/lib/entries/http/dto/save-entry.dto.js +120 -0
  153. package/dist/lib/entries/http/guards/content-grant.guard.d.ts +37 -0
  154. package/dist/lib/entries/http/guards/content-grant.guard.d.ts.map +1 -0
  155. package/dist/lib/entries/http/guards/content-grant.guard.js +67 -0
  156. package/dist/lib/entries/infrastructure/persistence/bulk-publish-verdicts.d.ts +22 -0
  157. package/dist/lib/entries/infrastructure/persistence/bulk-publish-verdicts.d.ts.map +1 -0
  158. package/dist/lib/entries/infrastructure/persistence/bulk-publish-verdicts.js +81 -0
  159. package/dist/lib/entries/infrastructure/persistence/entry-counter.service.d.ts +42 -0
  160. package/dist/lib/entries/infrastructure/persistence/entry-counter.service.d.ts.map +1 -0
  161. package/dist/lib/entries/infrastructure/persistence/entry-counter.service.js +73 -0
  162. package/dist/lib/entries/infrastructure/persistence/entry-row.d.ts +56 -0
  163. package/dist/lib/entries/infrastructure/persistence/entry-row.d.ts.map +1 -0
  164. package/dist/lib/entries/infrastructure/persistence/entry-row.js +185 -0
  165. package/dist/lib/entries/infrastructure/persistence/entry-writer.service.d.ts +392 -0
  166. package/dist/lib/entries/infrastructure/persistence/entry-writer.service.d.ts.map +1 -0
  167. package/dist/lib/entries/infrastructure/persistence/entry-writer.service.js +1223 -0
  168. package/dist/lib/entries/infrastructure/persistence/field-selection.d.ts +24 -0
  169. package/dist/lib/entries/infrastructure/persistence/field-selection.d.ts.map +1 -0
  170. package/dist/lib/entries/infrastructure/persistence/media-accept.d.ts +23 -0
  171. package/dist/lib/entries/infrastructure/persistence/media-accept.d.ts.map +1 -0
  172. package/dist/lib/entries/infrastructure/persistence/media-accept.js +55 -0
  173. package/dist/lib/entries/infrastructure/persistence/relation-link.service.d.ts +327 -0
  174. package/dist/lib/entries/infrastructure/persistence/relation-link.service.d.ts.map +1 -0
  175. package/dist/lib/entries/infrastructure/persistence/relation-link.service.js +1008 -0
  176. package/dist/lib/entries/infrastructure/queries/bulk-publish-preview.query.d.ts +19 -0
  177. package/dist/lib/entries/infrastructure/queries/bulk-publish-preview.query.d.ts.map +1 -0
  178. package/dist/lib/entries/infrastructure/queries/bulk-publish-preview.query.js +39 -0
  179. package/dist/lib/entries/infrastructure/queries/entries.service.d.ts +64 -0
  180. package/dist/lib/entries/infrastructure/queries/entries.service.d.ts.map +1 -0
  181. package/dist/lib/entries/infrastructure/queries/entries.service.js +202 -0
  182. package/dist/lib/entries/infrastructure/queries/entry-filter-schema.d.ts +40 -0
  183. package/dist/lib/entries/infrastructure/queries/entry-filter-schema.d.ts.map +1 -0
  184. package/dist/lib/entries/infrastructure/queries/entry-filter-surface.d.ts +38 -0
  185. package/dist/lib/entries/infrastructure/queries/entry-filter-surface.d.ts.map +1 -0
  186. package/dist/lib/entries/infrastructure/queries/entry-filter-surface.js +310 -0
  187. package/dist/lib/entries/infrastructure/queries/entry-scalar-fields.d.ts +25 -0
  188. package/dist/lib/entries/infrastructure/queries/entry-scalar-fields.d.ts.map +1 -0
  189. package/dist/lib/entries/infrastructure/queries/entry-scalar-fields.js +51 -0
  190. package/dist/lib/entries/infrastructure/queries/entry-search.d.ts +19 -0
  191. package/dist/lib/entries/infrastructure/queries/entry-search.d.ts.map +1 -0
  192. package/dist/lib/entries/infrastructure/queries/entry-search.js +52 -0
  193. package/dist/lib/entries/infrastructure/queries/media-refs.query.d.ts +21 -0
  194. package/dist/lib/entries/infrastructure/queries/media-refs.query.d.ts.map +1 -0
  195. package/dist/lib/entries/infrastructure/queries/media-refs.query.js +117 -0
  196. package/dist/lib/entries/services/entries.service.d.ts +59 -0
  197. package/dist/lib/entries/services/entries.service.d.ts.map +1 -0
  198. package/dist/lib/entries/services/entry-counter.service.d.ts +31 -0
  199. package/dist/lib/entries/services/entry-counter.service.d.ts.map +1 -0
  200. package/dist/lib/entries/services/entry-filter-schema.d.ts +32 -0
  201. package/dist/lib/entries/services/entry-filter-schema.d.ts.map +1 -0
  202. package/dist/lib/entries/services/entry-row.d.ts +56 -0
  203. package/dist/lib/entries/services/entry-row.d.ts.map +1 -0
  204. package/dist/lib/entries/services/entry-writer.service.d.ts +193 -0
  205. package/dist/lib/entries/services/entry-writer.service.d.ts.map +1 -0
  206. package/dist/lib/entries/services/relation-link.service.d.ts +115 -0
  207. package/dist/lib/entries/services/relation-link.service.d.ts.map +1 -0
  208. package/dist/lib/entries/types/bulk-publish.d.ts +75 -0
  209. package/dist/lib/entries/types/bulk-publish.d.ts.map +1 -0
  210. package/dist/lib/entries/types/bulk-publish.js +22 -0
  211. package/dist/lib/entries/types/entry-list-view.d.ts +205 -0
  212. package/dist/lib/entries/types/entry-list-view.d.ts.map +1 -0
  213. package/dist/lib/entries/types/entry-list-view.js +5 -0
  214. package/dist/lib/entries/types/filter-surface.d.ts +35 -0
  215. package/dist/lib/entries/types/filter-surface.d.ts.map +1 -0
  216. package/dist/lib/entries/types/filter-surface.js +2 -0
  217. package/dist/lib/extension/entry-extension-boot-check.d.ts +16 -0
  218. package/dist/lib/extension/entry-extension-boot-check.d.ts.map +1 -0
  219. package/dist/lib/extension/entry-extension-boot-check.js +42 -0
  220. package/dist/lib/extension/entry-extension.d.ts +225 -0
  221. package/dist/lib/extension/entry-extension.d.ts.map +1 -0
  222. package/dist/lib/extension/entry-extension.js +27 -0
  223. package/dist/lib/extension/media-asset-resolver.d.ts +85 -0
  224. package/dist/lib/extension/media-asset-resolver.d.ts.map +1 -0
  225. package/dist/lib/extension/media-asset-resolver.js +26 -0
  226. package/dist/lib/extension/per-locale-relation.d.ts +18 -0
  227. package/dist/lib/extension/per-locale-relation.d.ts.map +1 -0
  228. package/dist/lib/extension/relation-locale-sync.d.ts +62 -0
  229. package/dist/lib/extension/relation-locale-sync.d.ts.map +1 -0
  230. package/dist/lib/extension/relation-locale-sync.js +88 -0
  231. package/dist/lib/fields/index.d.ts +94 -0
  232. package/dist/lib/fields/index.d.ts.map +1 -0
  233. package/dist/lib/fields/index.js +203 -0
  234. package/dist/lib/insights/http/controllers/content-pipeline.controller.d.ts +16 -0
  235. package/dist/lib/insights/http/controllers/content-pipeline.controller.d.ts.map +1 -0
  236. package/dist/lib/insights/http/controllers/content-pipeline.controller.js +39 -0
  237. package/dist/lib/insights/http/controllers/content-punchcard.controller.d.ts +18 -0
  238. package/dist/lib/insights/http/controllers/content-punchcard.controller.d.ts.map +1 -0
  239. package/dist/lib/insights/http/controllers/content-punchcard.controller.js +42 -0
  240. package/dist/lib/insights/http/controllers/content-stale.controller.d.ts +17 -0
  241. package/dist/lib/insights/http/controllers/content-stale.controller.d.ts.map +1 -0
  242. package/dist/lib/insights/http/controllers/content-stale.controller.js +40 -0
  243. package/dist/lib/insights/http/controllers/content-totals.controller.d.ts +18 -0
  244. package/dist/lib/insights/http/controllers/content-totals.controller.d.ts.map +1 -0
  245. package/dist/lib/insights/http/controllers/content-totals.controller.js +42 -0
  246. package/dist/lib/insights/http/controllers/content-unshipped.controller.d.ts +17 -0
  247. package/dist/lib/insights/http/controllers/content-unshipped.controller.d.ts.map +1 -0
  248. package/dist/lib/insights/http/controllers/content-unshipped.controller.js +40 -0
  249. package/dist/lib/insights/http/controllers/content-velocity.controller.d.ts +17 -0
  250. package/dist/lib/insights/http/controllers/content-velocity.controller.d.ts.map +1 -0
  251. package/dist/lib/insights/http/controllers/content-velocity.controller.js +41 -0
  252. package/dist/lib/insights/http/dto/insights-range-query.dto.d.ts +15 -0
  253. package/dist/lib/insights/http/dto/insights-range-query.dto.d.ts.map +1 -0
  254. package/dist/lib/insights/http/dto/insights-range-query.dto.js +38 -0
  255. package/dist/lib/insights/infrastructure/queries/content-insights.query.d.ts +77 -0
  256. package/dist/lib/insights/infrastructure/queries/content-insights.query.d.ts.map +1 -0
  257. package/dist/lib/insights/infrastructure/queries/content-insights.query.js +380 -0
  258. package/dist/lib/insights/types/content-insights-view.d.ts +134 -0
  259. package/dist/lib/insights/types/content-insights-view.d.ts.map +1 -0
  260. package/dist/lib/insights/types/content-insights-view.js +10 -0
  261. package/dist/lib/mcp/content-tools.provider.d.ts +83 -0
  262. package/dist/lib/mcp/content-tools.provider.d.ts.map +1 -0
  263. package/dist/lib/mcp/content-tools.provider.js +441 -0
  264. package/dist/lib/mcp/tool-input.d.ts +43 -0
  265. package/dist/lib/mcp/tool-input.d.ts.map +1 -0
  266. package/dist/lib/mcp/tool-input.js +117 -0
  267. package/dist/lib/mcp/tool-schemas.d.ts +34 -0
  268. package/dist/lib/mcp/tool-schemas.d.ts.map +1 -0
  269. package/dist/lib/mcp/tool-schemas.js +282 -0
  270. package/dist/lib/public/controllers/get-public-entry.controller.d.ts +26 -0
  271. package/dist/lib/public/controllers/get-public-entry.controller.d.ts.map +1 -0
  272. package/dist/lib/public/controllers/list-public-entries.controller.d.ts +24 -0
  273. package/dist/lib/public/controllers/list-public-entries.controller.d.ts.map +1 -0
  274. package/dist/lib/public/controllers/public-schema.controller.d.ts +18 -0
  275. package/dist/lib/public/controllers/public-schema.controller.d.ts.map +1 -0
  276. package/dist/lib/public-api/http/api-token-request.d.ts +41 -0
  277. package/dist/lib/public-api/http/api-token-request.d.ts.map +1 -0
  278. package/dist/lib/public-api/http/api-token-request.js +2 -0
  279. package/dist/lib/public-api/http/controllers/public-content-types.controller.d.ts +31 -0
  280. package/dist/lib/public-api/http/controllers/public-content-types.controller.d.ts.map +1 -0
  281. package/dist/lib/public-api/http/controllers/public-content-types.controller.js +93 -0
  282. package/dist/lib/public-api/http/controllers/public-entries.controller.d.ts +101 -0
  283. package/dist/lib/public-api/http/controllers/public-entries.controller.d.ts.map +1 -0
  284. package/dist/lib/public-api/http/controllers/public-entries.controller.js +307 -0
  285. package/dist/lib/public-api/http/controllers/public-entry-writes.controller.d.ts +76 -0
  286. package/dist/lib/public-api/http/controllers/public-entry-writes.controller.d.ts.map +1 -0
  287. package/dist/lib/public-api/http/controllers/public-entry-writes.controller.js +353 -0
  288. package/dist/lib/public-api/http/controllers/resolve-granted-type.d.ts +42 -0
  289. package/dist/lib/public-api/http/controllers/resolve-granted-type.d.ts.map +1 -0
  290. package/dist/lib/public-api/http/controllers/resolve-granted-type.js +25 -0
  291. package/dist/lib/public-api/http/decorators/current-api-token.decorator.d.ts +8 -0
  292. package/dist/lib/public-api/http/decorators/current-api-token.decorator.d.ts.map +1 -0
  293. package/dist/lib/public-api/http/decorators/current-api-token.decorator.js +17 -0
  294. package/dist/lib/public-api/http/dto/public-bulk.dto.d.ts +58 -0
  295. package/dist/lib/public-api/http/dto/public-bulk.dto.d.ts.map +1 -0
  296. package/dist/lib/public-api/http/dto/public-bulk.dto.js +118 -0
  297. package/dist/lib/public-api/http/dto/public-list-entries-query.dto.d.ts +106 -0
  298. package/dist/lib/public-api/http/dto/public-list-entries-query.dto.d.ts.map +1 -0
  299. package/dist/lib/public-api/http/dto/public-list-entries-query.dto.js +297 -0
  300. package/dist/lib/public-api/http/dto/public-save-entry.dto.d.ts +39 -0
  301. package/dist/lib/public-api/http/dto/public-save-entry.dto.d.ts.map +1 -0
  302. package/dist/lib/public-api/http/dto/public-save-entry.dto.js +112 -0
  303. package/dist/lib/public-api/http/guards/api-token-workspace.guard.d.ts +25 -0
  304. package/dist/lib/public-api/http/guards/api-token-workspace.guard.d.ts.map +1 -0
  305. package/dist/lib/public-api/http/guards/api-token-workspace.guard.js +58 -0
  306. package/dist/lib/public-api/http/guards/api-token.guard.d.ts +32 -0
  307. package/dist/lib/public-api/http/guards/api-token.guard.d.ts.map +1 -0
  308. package/dist/lib/public-api/http/guards/api-token.guard.js +92 -0
  309. package/dist/lib/public-api/http/guards/draft-visibility.guard.d.ts +25 -0
  310. package/dist/lib/public-api/http/guards/draft-visibility.guard.d.ts.map +1 -0
  311. package/dist/lib/public-api/http/guards/draft-visibility.guard.js +56 -0
  312. package/dist/lib/public-api/infrastructure/bulk-save-op.d.ts +55 -0
  313. package/dist/lib/public-api/infrastructure/bulk-save-op.d.ts.map +1 -0
  314. package/dist/lib/public-api/infrastructure/bulk-save-op.js +61 -0
  315. package/dist/lib/public-api/infrastructure/field-selection.d.ts +21 -0
  316. package/dist/lib/public-api/infrastructure/field-selection.d.ts.map +1 -0
  317. package/dist/lib/public-api/infrastructure/field-selection.js +72 -0
  318. package/dist/lib/public-api/infrastructure/public-entries.query.d.ts +248 -0
  319. package/dist/lib/public-api/infrastructure/public-entries.query.d.ts.map +1 -0
  320. package/dist/lib/public-api/infrastructure/public-entries.query.js +557 -0
  321. package/dist/lib/public-api/infrastructure/public-entry-row.d.ts +31 -0
  322. package/dist/lib/public-api/infrastructure/public-entry-row.d.ts.map +1 -0
  323. package/dist/lib/public-api/infrastructure/public-entry-row.js +76 -0
  324. package/dist/lib/public-api/infrastructure/public-entry-writes.service.d.ts +188 -0
  325. package/dist/lib/public-api/infrastructure/public-entry-writes.service.d.ts.map +1 -0
  326. package/dist/lib/public-api/infrastructure/public-entry-writes.service.js +321 -0
  327. package/dist/lib/public-api/infrastructure/public-expansion.query.d.ts +98 -0
  328. package/dist/lib/public-api/infrastructure/public-expansion.query.d.ts.map +1 -0
  329. package/dist/lib/public-api/infrastructure/public-expansion.query.js +384 -0
  330. package/dist/lib/public-api/types/public-bulk.d.ts +77 -0
  331. package/dist/lib/public-api/types/public-bulk.d.ts.map +1 -0
  332. package/dist/lib/public-api/types/public-bulk.js +23 -0
  333. package/dist/lib/public-api/types/public-entry.d.ts +97 -0
  334. package/dist/lib/public-api/types/public-entry.d.ts.map +1 -0
  335. package/dist/lib/public-api/types/public-entry.js +8 -0
  336. package/dist/lib/public-api/types/public-expansion.d.ts +92 -0
  337. package/dist/lib/public-api/types/public-expansion.d.ts.map +1 -0
  338. package/dist/lib/public-api/types/public-expansion.js +2 -0
  339. package/dist/lib/registry/content-type-registry.d.ts +103 -0
  340. package/dist/lib/registry/content-type-registry.d.ts.map +1 -0
  341. package/dist/lib/registry/content-type-registry.js +155 -0
  342. package/dist/lib/revisions/application/ports/revision-store.d.ts +71 -0
  343. package/dist/lib/revisions/application/ports/revision-store.d.ts.map +1 -0
  344. package/dist/lib/revisions/application/ports/revision-store.js +9 -0
  345. package/dist/lib/revisions/application/use-cases/publish-revision.use-case.d.ts +40 -0
  346. package/dist/lib/revisions/application/use-cases/publish-revision.use-case.d.ts.map +1 -0
  347. package/dist/lib/revisions/application/use-cases/publish-revision.use-case.js +66 -0
  348. package/dist/lib/revisions/application/use-cases/restore-revision.use-case.d.ts +36 -0
  349. package/dist/lib/revisions/application/use-cases/restore-revision.use-case.d.ts.map +1 -0
  350. package/dist/lib/revisions/application/use-cases/restore-revision.use-case.js +57 -0
  351. package/dist/lib/revisions/domain/revision-status.d.ts +18 -0
  352. package/dist/lib/revisions/domain/revision-status.d.ts.map +1 -0
  353. package/dist/lib/revisions/domain/revision-status.js +18 -0
  354. package/dist/lib/revisions/domain/revision.d.ts +80 -0
  355. package/dist/lib/revisions/domain/revision.d.ts.map +1 -0
  356. package/dist/lib/revisions/domain/revision.js +84 -0
  357. package/dist/lib/revisions/http/controllers/publish-revision.controller.d.ts +19 -0
  358. package/dist/lib/revisions/http/controllers/publish-revision.controller.d.ts.map +1 -0
  359. package/dist/lib/revisions/http/controllers/publish-revision.controller.js +51 -0
  360. package/dist/lib/revisions/http/controllers/restore-revision.controller.d.ts +17 -0
  361. package/dist/lib/revisions/http/controllers/restore-revision.controller.d.ts.map +1 -0
  362. package/dist/lib/revisions/http/controllers/restore-revision.controller.js +49 -0
  363. package/dist/lib/revisions/http/controllers/revisions.controller.d.ts +20 -0
  364. package/dist/lib/revisions/http/controllers/revisions.controller.d.ts.map +1 -0
  365. package/dist/lib/revisions/http/controllers/revisions.controller.js +76 -0
  366. package/dist/lib/revisions/infrastructure/persistence/drizzle-revision.store.d.ts +33 -0
  367. package/dist/lib/revisions/infrastructure/persistence/drizzle-revision.store.d.ts.map +1 -0
  368. package/dist/lib/revisions/infrastructure/persistence/drizzle-revision.store.js +174 -0
  369. package/dist/lib/revisions/infrastructure/persistence/revision-snapshot.d.ts +17 -0
  370. package/dist/lib/revisions/infrastructure/persistence/revision-snapshot.d.ts.map +1 -0
  371. package/dist/lib/revisions/infrastructure/persistence/revision-snapshot.js +20 -0
  372. package/dist/lib/revisions/infrastructure/persistence/revision-table.d.ts +228 -0
  373. package/dist/lib/revisions/infrastructure/persistence/revision-table.d.ts.map +1 -0
  374. package/dist/lib/revisions/infrastructure/persistence/revision-table.js +57 -0
  375. package/dist/lib/revisions/infrastructure/queries/revision-refs.query.d.ts +22 -0
  376. package/dist/lib/revisions/infrastructure/queries/revision-refs.query.d.ts.map +1 -0
  377. package/dist/lib/revisions/infrastructure/queries/revision-refs.query.js +66 -0
  378. package/dist/lib/revisions/revisions.constants.d.ts +10 -0
  379. package/dist/lib/revisions/revisions.constants.d.ts.map +1 -0
  380. package/dist/lib/revisions/revisions.constants.js +12 -0
  381. package/dist/lib/revisions/types/revision-view.d.ts +74 -0
  382. package/dist/lib/revisions/types/revision-view.d.ts.map +1 -0
  383. package/dist/lib/revisions/types/revision-view.js +2 -0
  384. package/dist/lib/types/content-type.d.ts +131 -0
  385. package/dist/lib/types/content-type.d.ts.map +1 -0
  386. package/dist/lib/types/content-type.js +28 -0
  387. package/dist/lib/types/fields.d.ts +303 -0
  388. package/dist/lib/types/fields.d.ts.map +1 -0
  389. package/dist/lib/types/fields.js +52 -0
  390. package/dist/lib/utils/content-plugin.d.ts +35 -0
  391. package/dist/lib/utils/content-plugin.d.ts.map +1 -0
  392. package/dist/lib/utils/content-plugin.js +35 -0
  393. package/dist/lib/validation/services/entry-validation.service.d.ts +24 -0
  394. package/dist/lib/validation/services/entry-validation.service.d.ts.map +1 -0
  395. package/dist/lib/validation/services/entry-validation.service.js +35 -0
  396. package/package.json +54 -0
@@ -0,0 +1,85 @@
1
+ /**
2
+ * The **media-asset resolver port** — the seam through which content-server
3
+ * checks that a media field's asset ids reference real assets in the workspace,
4
+ * and match the field's `accept` restriction, without depending on the media
5
+ * plugin. Content-server *declares* the port and consults it optionally
6
+ * (`@Optional()` injection) from {@link EntryWriterService}; the media plugin
7
+ * *binds* an implementation to {@link MEDIA_ASSET_RESOLVER} in its own module —
8
+ * the same inversion as {@link CONTENT_ENTRY_EXTENSION} and identity's
9
+ * `CONTENT_CATALOG`.
10
+ *
11
+ * When no implementation is bound (the media plugin isn't registered), media
12
+ * fields still shape-validate and store their ids — the existence and
13
+ * restriction checks are simply skipped, so content boots without media.
14
+ *
15
+ * NestJS-free on purpose (types + a Symbol + an inject helper): the
16
+ * implementation lives in another package.
17
+ */
18
+ /** DI token the media plugin binds its {@link MediaAssetResolver} to. */
19
+ export declare const MEDIA_ASSET_RESOLVER: unique symbol;
20
+ /** Injects the optional media-asset resolver. Pair with `@Optional()`. */
21
+ export declare const InjectMediaAssetResolver: () => ParameterDecorator;
22
+ /**
23
+ * One timed-text track on a video or audio asset — what a consumer needs to
24
+ * emit a `<track>`.
25
+ *
26
+ * Declared here rather than imported from media-server because the dependency
27
+ * runs the other way: media binds this port, content declares it (`ORT-92`).
28
+ */
29
+ export interface ResolvedMediaTrack {
30
+ /** `captions` / `subtitles` / `descriptions` / `chapters`. */
31
+ kind: string;
32
+ /** BCP-47 tag of the track's language. */
33
+ srclang: string;
34
+ /** The label a player shows in its track menu. */
35
+ label: string;
36
+ /** Route the WebVTT bytes stream from. */
37
+ src: string;
38
+ /** Whether a player should enable this one by default. */
39
+ default?: boolean;
40
+ }
41
+ /** The subset of a media asset content-server needs to enforce a media field. */
42
+ export interface ResolvedMediaAsset {
43
+ /** Asset id (uuid). */
44
+ id: string;
45
+ /** Coarse kind — image/video/audio/document/archive. */
46
+ kind: string;
47
+ /** MIME type, e.g. `image/png`. */
48
+ mimeType: string;
49
+ /** Display name (the original file name). */
50
+ name: string;
51
+ /** The route the browser fetches to stream the bytes. */
52
+ url: string;
53
+ /**
54
+ * Route for the small (~320px) derivative, when the media plugin generated
55
+ * one — what a field tile or a revision-preview chip should render instead
56
+ * of the full original. Absent for a non-image, an SVG, or an image too
57
+ * small to derive; the caller falls back to {@link url}.
58
+ */
59
+ thumbUrl?: string;
60
+ /** Route for the larger (~1280px) derivative, same caveats as {@link thumbUrl}. */
61
+ previewUrl?: string;
62
+ /** Alt text, when set. */
63
+ alt: string | null;
64
+ /**
65
+ * Timed-text tracks for a video or audio asset. Empty for everything else,
66
+ * and for a video nobody has captioned yet.
67
+ *
68
+ * Without these a published video had no caption track available **at any
69
+ * layer**, because the CMS could not represent one — WCAG 1.2.2 / 1.2.3,
70
+ * 508 503.4 (`ORT-92`).
71
+ */
72
+ tracks: ResolvedMediaTrack[];
73
+ }
74
+ /**
75
+ * Resolves media asset ids to the facts content-server needs. Workspace-scoped:
76
+ * an id that names no asset in `workspaceId` (missing, or belonging to another
77
+ * workspace) is simply **absent** from the returned map — the caller reads that
78
+ * as "does not exist" and reports a uniform validation issue, with no
79
+ * not-found-vs-forbidden enumeration signal.
80
+ */
81
+ export interface MediaAssetResolver {
82
+ /** Batched, workspace-scoped lookup keyed by asset id. */
83
+ resolve(ids: readonly string[], workspaceId: string): Promise<Map<string, ResolvedMediaAsset>>;
84
+ }
85
+ //# sourceMappingURL=media-asset-resolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media-asset-resolver.d.ts","sourceRoot":"","sources":["../../../src/lib/extension/media-asset-resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,yEAAyE;AACzE,eAAO,MAAM,oBAAoB,eAAiC,CAAC;AAEnE,0EAA0E;AAC1E,eAAO,MAAM,wBAAwB,QAAO,kBACZ,CAAC;AAEjC;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IAC/B,8DAA8D;IAC9D,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,kDAAkD;IAClD,KAAK,EAAE,MAAM,CAAC;IACd,0CAA0C;IAC1C,GAAG,EAAE,MAAM,CAAC;IACZ,0DAA0D;IAC1D,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,iFAAiF;AACjF,MAAM,WAAW,kBAAkB;IAC/B,uBAAuB;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,mCAAmC;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,yDAAyD;IACzD,GAAG,EAAE,MAAM,CAAC;IACZ;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mFAAmF;IACnF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0BAA0B;IAC1B,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB;;;;;;;OAOG;IACH,MAAM,EAAE,kBAAkB,EAAE,CAAC;CAChC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IAC/B,0DAA0D;IAC1D,OAAO,CACH,GAAG,EAAE,SAAS,MAAM,EAAE,EACtB,WAAW,EAAE,MAAM,GACpB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC,CAAC;CAC/C"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ /**
3
+ * The **media-asset resolver port** — the seam through which content-server
4
+ * checks that a media field's asset ids reference real assets in the workspace,
5
+ * and match the field's `accept` restriction, without depending on the media
6
+ * plugin. Content-server *declares* the port and consults it optionally
7
+ * (`@Optional()` injection) from {@link EntryWriterService}; the media plugin
8
+ * *binds* an implementation to {@link MEDIA_ASSET_RESOLVER} in its own module —
9
+ * the same inversion as {@link CONTENT_ENTRY_EXTENSION} and identity's
10
+ * `CONTENT_CATALOG`.
11
+ *
12
+ * When no implementation is bound (the media plugin isn't registered), media
13
+ * fields still shape-validate and store their ids — the existence and
14
+ * restriction checks are simply skipped, so content boots without media.
15
+ *
16
+ * NestJS-free on purpose (types + a Symbol + an inject helper): the
17
+ * implementation lives in another package.
18
+ */
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.InjectMediaAssetResolver = exports.MEDIA_ASSET_RESOLVER = void 0;
21
+ const common_1 = require("@nestjs/common");
22
+ /** DI token the media plugin binds its {@link MediaAssetResolver} to. */
23
+ exports.MEDIA_ASSET_RESOLVER = Symbol('MEDIA_ASSET_RESOLVER');
24
+ /** Injects the optional media-asset resolver. Pair with `@Optional()`. */
25
+ const InjectMediaAssetResolver = () => (0, common_1.Inject)(exports.MEDIA_ASSET_RESOLVER);
26
+ exports.InjectMediaAssetResolver = InjectMediaAssetResolver;
@@ -0,0 +1,18 @@
1
+ import { type AnyFieldSpec } from '../types/fields';
2
+ import type { AnyContentType } from '../types/content-type';
3
+ /**
4
+ * Whether a field is a **per-locale relation** — a *single owning* relation
5
+ * (`!many`, `!inverse`) on an **i18n** owner whose **target type is also i18n**.
6
+ *
7
+ * Such a relation can't be shared across a translation group: a shared FK would
8
+ * point at one specific locale's row, i.e. a cross-locale link. So the platform
9
+ * treats it as `localized` — not synced onto siblings, not copied into a
10
+ * translation draft, and the picker offers only same-locale candidates. Both the
11
+ * schema serializer (which stamps `localized` for the admin) and the i18n
12
+ * sibling-sync consult this, so the rule lives in one place.
13
+ *
14
+ * The target's i18n-ness is read via the resolved thunk `spec.relation.to()` —
15
+ * safe because the registry resolves every relation target at boot.
16
+ */
17
+ export declare function isPerLocaleRelation(owner: AnyContentType, spec: AnyFieldSpec): boolean;
18
+ //# sourceMappingURL=per-locale-relation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"per-locale-relation.d.ts","sourceRoot":"","sources":["../../../src/lib/extension/per-locale-relation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CAC/B,KAAK,EAAE,cAAc,EACrB,IAAI,EAAE,YAAY,GACnB,OAAO,CAQT"}
@@ -0,0 +1,62 @@
1
+ import { type AnyFieldSpec } from '../types/fields';
2
+ import type { AnyContentType } from '../types/content-type';
3
+ /**
4
+ * How one relation field behaves across a translation group.
5
+ *
6
+ * The three values are not three author-facing options — the author sets one
7
+ * boolean (`syncAcrossLocales`). What splits `Shared` from `Mirrored` is the
8
+ * **target type**: a link to non-localized content is the same row for every
9
+ * language, while a link to localized content has to name that content's row
10
+ * *in each sibling's own locale* — a shared FK there would be a cross-locale
11
+ * link, which {@link assertSameLocale} rejects and nothing would ever repair.
12
+ */
13
+ export declare const RELATION_LOCALE_SYNC: {
14
+ /** One target row for the whole group — the same id in every sibling. */
15
+ readonly Shared: "shared";
16
+ /** The target's translation *group*, resolved into each sibling's locale. */
17
+ readonly Mirrored: "mirrored";
18
+ /** Not propagated: each locale keeps its own links. */
19
+ readonly None: "none";
20
+ };
21
+ /** How a relation field propagates across a translation group. */
22
+ export type RelationLocaleSync = (typeof RELATION_LOCALE_SYNC)[keyof typeof RELATION_LOCALE_SYNC];
23
+ /**
24
+ * The propagation mode of one field on `owner` — **the** definition, consulted
25
+ * by the schema serializer, the i18n sibling sync, and the copilot's
26
+ * translation applier, so the three cannot drift.
27
+ *
28
+ * `None` for everything that has nothing to propagate: a non-relation, a
29
+ * non-`i18n` owner (no siblings), an inverse field (it reuses the owning side's
30
+ * storage, so syncing from both ends would write the same links twice), and any
31
+ * relation whose author set `syncAcrossLocales: false`.
32
+ *
33
+ * The target's i18n-ness is read via the resolved thunk `spec.relation.to()` —
34
+ * safe because the registry resolves every relation target at boot.
35
+ */
36
+ export declare function relationLocaleSync(owner: AnyContentType, spec: AnyFieldSpec): RelationLocaleSync;
37
+ /**
38
+ * Whether a field's stored value **varies from one locale row to the next** —
39
+ * what the schema serializer reports to the admin as `localized`, and what the
40
+ * translation prefill uses to decide a field is the translator's to fill in.
41
+ *
42
+ * True for an explicitly `localized` field, and for a relation that is either
43
+ * mirrored (each sibling stores its own locale's target id) or unsynced (each
44
+ * sibling stores whatever it was given). False for a **shared** relation, whose
45
+ * every sibling genuinely holds the same id.
46
+ *
47
+ * Note the difference from {@link relationLocaleSync}: a *mirrored* relation is
48
+ * both per-locale AND propagated — the value differs per row precisely so that
49
+ * every row points at the right translation.
50
+ */
51
+ export declare function isPerLocaleField(owner: AnyContentType, spec: AnyFieldSpec): boolean;
52
+ /**
53
+ * Whether a relation's links live in a join table (an owning many-to-many)
54
+ * rather than in a `<field>_id` column. The two storage forms are synced by
55
+ * different machinery — a column write vs. a join-row rewrite — so the sync
56
+ * pass splits on this.
57
+ *
58
+ * An **inverse** is excluded even though it is join-backed: it owns no writable
59
+ * link from its side.
60
+ */
61
+ export declare function isJoinBackedRelation(spec: AnyFieldSpec): boolean;
62
+ //# sourceMappingURL=relation-locale-sync.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relation-locale-sync.d.ts","sourceRoot":"","sources":["../../../src/lib/extension/relation-locale-sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB;IAC7B,yEAAyE;;IAEzE,6EAA6E;;IAE7E,uDAAuD;;CAEjD,CAAC;AAEX,kEAAkE;AAClE,MAAM,MAAM,kBAAkB,GAC1B,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,OAAO,oBAAoB,CAAC,CAAC;AAErE;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAC9B,KAAK,EAAE,cAAc,EACrB,IAAI,EAAE,YAAY,GACnB,kBAAkB,CASpB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAC5B,KAAK,EAAE,cAAc,EACrB,IAAI,EAAE,YAAY,GACnB,OAAO,CAMT;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAMhE"}
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RELATION_LOCALE_SYNC = void 0;
4
+ exports.relationLocaleSync = relationLocaleSync;
5
+ exports.isPerLocaleField = isPerLocaleField;
6
+ exports.isJoinBackedRelation = isJoinBackedRelation;
7
+ const fields_1 = require("../types/fields");
8
+ /**
9
+ * How one relation field behaves across a translation group.
10
+ *
11
+ * The three values are not three author-facing options — the author sets one
12
+ * boolean (`syncAcrossLocales`). What splits `Shared` from `Mirrored` is the
13
+ * **target type**: a link to non-localized content is the same row for every
14
+ * language, while a link to localized content has to name that content's row
15
+ * *in each sibling's own locale* — a shared FK there would be a cross-locale
16
+ * link, which {@link assertSameLocale} rejects and nothing would ever repair.
17
+ */
18
+ exports.RELATION_LOCALE_SYNC = {
19
+ /** One target row for the whole group — the same id in every sibling. */
20
+ Shared: 'shared',
21
+ /** The target's translation *group*, resolved into each sibling's locale. */
22
+ Mirrored: 'mirrored',
23
+ /** Not propagated: each locale keeps its own links. */
24
+ None: 'none'
25
+ };
26
+ /**
27
+ * The propagation mode of one field on `owner` — **the** definition, consulted
28
+ * by the schema serializer, the i18n sibling sync, and the copilot's
29
+ * translation applier, so the three cannot drift.
30
+ *
31
+ * `None` for everything that has nothing to propagate: a non-relation, a
32
+ * non-`i18n` owner (no siblings), an inverse field (it reuses the owning side's
33
+ * storage, so syncing from both ends would write the same links twice), and any
34
+ * relation whose author set `syncAcrossLocales: false`.
35
+ *
36
+ * The target's i18n-ness is read via the resolved thunk `spec.relation.to()` —
37
+ * safe because the registry resolves every relation target at boot.
38
+ */
39
+ function relationLocaleSync(owner, spec) {
40
+ if (spec.type !== fields_1.CONTENT_FIELD_TYPE.Relation || !spec.relation)
41
+ return exports.RELATION_LOCALE_SYNC.None;
42
+ if (!owner.i18n)
43
+ return exports.RELATION_LOCALE_SYNC.None;
44
+ if (spec.relation.inverse)
45
+ return exports.RELATION_LOCALE_SYNC.None;
46
+ if (!spec.relation.syncAcrossLocales)
47
+ return exports.RELATION_LOCALE_SYNC.None;
48
+ return spec.relation.to().i18n
49
+ ? exports.RELATION_LOCALE_SYNC.Mirrored
50
+ : exports.RELATION_LOCALE_SYNC.Shared;
51
+ }
52
+ /**
53
+ * Whether a field's stored value **varies from one locale row to the next** —
54
+ * what the schema serializer reports to the admin as `localized`, and what the
55
+ * translation prefill uses to decide a field is the translator's to fill in.
56
+ *
57
+ * True for an explicitly `localized` field, and for a relation that is either
58
+ * mirrored (each sibling stores its own locale's target id) or unsynced (each
59
+ * sibling stores whatever it was given). False for a **shared** relation, whose
60
+ * every sibling genuinely holds the same id.
61
+ *
62
+ * Note the difference from {@link relationLocaleSync}: a *mirrored* relation is
63
+ * both per-locale AND propagated — the value differs per row precisely so that
64
+ * every row points at the right translation.
65
+ */
66
+ function isPerLocaleField(owner, spec) {
67
+ if (spec.localized)
68
+ return true;
69
+ if (spec.type !== fields_1.CONTENT_FIELD_TYPE.Relation || !spec.relation)
70
+ return false;
71
+ if (!owner.i18n || spec.relation.inverse)
72
+ return false;
73
+ return relationLocaleSync(owner, spec) !== exports.RELATION_LOCALE_SYNC.Shared;
74
+ }
75
+ /**
76
+ * Whether a relation's links live in a join table (an owning many-to-many)
77
+ * rather than in a `<field>_id` column. The two storage forms are synced by
78
+ * different machinery — a column write vs. a join-row rewrite — so the sync
79
+ * pass splits on this.
80
+ *
81
+ * An **inverse** is excluded even though it is join-backed: it owns no writable
82
+ * link from its side.
83
+ */
84
+ function isJoinBackedRelation(spec) {
85
+ return (spec.type === fields_1.CONTENT_FIELD_TYPE.Relation &&
86
+ !!spec.relation?.many &&
87
+ !spec.relation.inverse);
88
+ }
@@ -0,0 +1,94 @@
1
+ /**
2
+ * Field builders — the `field.*` vocabulary used inside `collection()` /
3
+ * `single()` definitions. Each builder normalizes its options into a
4
+ * {@link FieldSpec} and carries the value type as a phantom generic so
5
+ * `InferEntry` can derive row types with correct nullability.
6
+ */
7
+ import { type RichTextDocument } from '@orthacms/content-domain';
8
+ import type { BaseFieldOptions, FieldSpec, MediaFieldOptions, MoneyFieldOptions, NumberFieldOptions, RelationFieldOptions, RelationInverseFieldOptions, RichTextFieldOptions, SelectFieldOptions, TextFieldOptions, WithRequired } from '../types/fields';
9
+ /** Short text. Validation: minLength / maxLength / pattern. */
10
+ declare function text<const O extends TextFieldOptions = TextFieldOptions>(options?: O): FieldSpec<'text', WithRequired<O, string>>;
11
+ /**
12
+ * Long-form rich text — a **structured document**, not an HTML string.
13
+ *
14
+ * The value is the ProseMirror/TipTap node tree the admin editor produces, in
15
+ * a `jsonb` column, so heading order, table headers, link text and the
16
+ * language of a quoted passage are things the platform can express and check
17
+ * (WCAG 1.3.1 / 2.4.6 / 3.1.2) rather than characters inside an opaque blob.
18
+ * `minLength`/`maxLength` count the body's **text** for the same reason:
19
+ * bolding a word used to cost the author `<strong></strong>`.
20
+ *
21
+ * A body written before this change is an HTML string, and still reads and
22
+ * validates as one — see `@orthacms/content-domain`'s rich-text module. It is
23
+ * rewritten as a document the next time the record is saved through the editor.
24
+ */
25
+ declare function richtext<const O extends RichTextFieldOptions = RichTextFieldOptions>(options?: O): FieldSpec<'richtext', WithRequired<O, RichTextDocument | string>>;
26
+ /** Floating-point number (or integer with `integer: true`). */
27
+ declare function number<const O extends NumberFieldOptions = NumberFieldOptions>(options?: O): FieldSpec<'number', WithRequired<O, number>>;
28
+ /** Money in integer minor units (cents) — exact, no float drift. */
29
+ declare function money<const O extends MoneyFieldOptions = MoneyFieldOptions>(options?: O): FieldSpec<'money', WithRequired<O, number>>;
30
+ /** True/false. Stored NOT NULL with default false when `required`. */
31
+ declare function boolean<const O extends BaseFieldOptions = BaseFieldOptions>(options?: O): FieldSpec<'boolean', WithRequired<O, boolean>>;
32
+ /** Calendar date (no time of day), ISO `YYYY-MM-DD`. */
33
+ declare function date<const O extends BaseFieldOptions = BaseFieldOptions>(options?: O): FieldSpec<'date', WithRequired<O, string>>;
34
+ /** Point in time, stored as timestamptz. */
35
+ declare function datetime<const O extends BaseFieldOptions = BaseFieldOptions>(options?: O): FieldSpec<'datetime', WithRequired<O, Date>>;
36
+ /** One of a fixed set of strings. The value type narrows to the options. */
37
+ declare function select<const O extends SelectFieldOptions>(options: O): FieldSpec<'select', WithRequired<O, O['options'][number]>>;
38
+ /** Several of a fixed set of strings, stored as a jsonb array of options. */
39
+ declare function multiselect<const O extends SelectFieldOptions>(options: O): FieldSpec<'multiselect', WithRequired<O, O['options'][number][]>>;
40
+ /** Arbitrary JSON payload (jsonb). Escape hatch — prefer typed fields. */
41
+ declare function json<const O extends BaseFieldOptions = BaseFieldOptions>(options?: O): FieldSpec<'json', WithRequired<O, unknown>>;
42
+ /**
43
+ * Relation to another content type — a real Postgres foreign key.
44
+ * Single (`many: false`) becomes a `<field>_id` uuid FK column;
45
+ * `many: true` becomes a generated join table. `unique: true` adds a
46
+ * `UNIQUE` constraint to the single FK column for a one-to-one relation.
47
+ * `to` is a thunk so mutually-referencing collection files can import
48
+ * each other.
49
+ */
50
+ declare function relation<const O extends RelationFieldOptions>(options: O): FieldSpec<'relation', O extends {
51
+ many: true;
52
+ } ? string[] : WithRequired<O, string>>;
53
+ /**
54
+ * The **inverse** side of a two-way relation — a back-reference to the storage
55
+ * owned by `of`'s `field`. Generates no column/table: it reads and writes the
56
+ * same link the owning relation does (source/target swapped), so editing either
57
+ * side stays in sync. `of` is a thunk so the two files can import each other.
58
+ *
59
+ * @example
60
+ * // article.ts owns: tags: field.relation({ to: () => tag, many: true })
61
+ * // tag.ts mirrors: articles: field.relationInverse({ of: () => article, field: 'tags' })
62
+ */
63
+ declare function relationInverse<const O extends RelationInverseFieldOptions>(options: O): FieldSpec<'relation', O extends {
64
+ many: false;
65
+ } ? string : string[]>;
66
+ /**
67
+ * Attach one or more **Media Library** assets. Stores asset ids in the values
68
+ * bag — a single `uuid` column (`multiple: false`), or a `jsonb` array of ids
69
+ * (`multiple: true`), so media rides revisions and locale-sibling sync like any
70
+ * other field. Asset ids are plain uuids, not a Postgres FK: the assets live in
71
+ * the media plugin's own schema, so existence and the `accept` restriction are
72
+ * enforced by the server on save (via the media-asset resolver), not the DB.
73
+ */
74
+ declare function media<const O extends MediaFieldOptions = MediaFieldOptions>(options?: O): FieldSpec<'media', O extends {
75
+ multiple: true;
76
+ } ? string[] : WithRequired<O, string>>;
77
+ /** The field-builder vocabulary: `field.text()`, `field.relation()`, … */
78
+ export declare const field: {
79
+ text: typeof text;
80
+ richtext: typeof richtext;
81
+ number: typeof number;
82
+ money: typeof money;
83
+ boolean: typeof boolean;
84
+ date: typeof date;
85
+ datetime: typeof datetime;
86
+ select: typeof select;
87
+ multiselect: typeof multiselect;
88
+ json: typeof json;
89
+ relation: typeof relation;
90
+ relationInverse: typeof relationInverse;
91
+ media: typeof media;
92
+ };
93
+ export {};
94
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/fields/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAEH,KAAK,gBAAgB,EACxB,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EACR,gBAAgB,EAChB,SAAS,EAGT,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,2BAA2B,EAC3B,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACf,MAAM,iBAAiB,CAAC;AA6BzB,+DAA+D;AAC/D,iBAAS,IAAI,CAAC,KAAK,CAAC,CAAC,SAAS,gBAAgB,GAAG,gBAAgB,EAC7D,OAAO,CAAC,EAAE,CAAC,GACZ,SAAS,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAmB5C;AAED;;;;;;;;;;;;;GAaG;AACH,iBAAS,QAAQ,CAAC,KAAK,CAAC,CAAC,SAAS,oBAAoB,GAAG,oBAAoB,EACzE,OAAO,CAAC,EAAE,CAAC,GACZ,SAAS,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC,EAAE,gBAAgB,GAAG,MAAM,CAAC,CAAC,CAOnE;AAED,+DAA+D;AAC/D,iBAAS,MAAM,CAAC,KAAK,CAAC,CAAC,SAAS,kBAAkB,GAAG,kBAAkB,EACnE,OAAO,CAAC,EAAE,CAAC,GACZ,SAAS,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAG9C;AAED,oEAAoE;AACpE,iBAAS,KAAK,CAAC,KAAK,CAAC,CAAC,SAAS,iBAAiB,GAAG,iBAAiB,EAChE,OAAO,CAAC,EAAE,CAAC,GACZ,SAAS,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAG7C;AAED,sEAAsE;AACtE,iBAAS,OAAO,CAAC,KAAK,CAAC,CAAC,SAAS,gBAAgB,GAAG,gBAAgB,EAChE,OAAO,CAAC,EAAE,CAAC,GACZ,SAAS,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAEhD;AAED,wDAAwD;AACxD,iBAAS,IAAI,CAAC,KAAK,CAAC,CAAC,SAAS,gBAAgB,GAAG,gBAAgB,EAC7D,OAAO,CAAC,EAAE,CAAC,GACZ,SAAS,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAE5C;AAED,4CAA4C;AAC5C,iBAAS,QAAQ,CAAC,KAAK,CAAC,CAAC,SAAS,gBAAgB,GAAG,gBAAgB,EACjE,OAAO,CAAC,EAAE,CAAC,GACZ,SAAS,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAE9C;AAED,4EAA4E;AAC5E,iBAAS,MAAM,CAAC,KAAK,CAAC,CAAC,SAAS,kBAAkB,EAC9C,OAAO,EAAE,CAAC,GACX,SAAS,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAK5D;AAED,6EAA6E;AAC7E,iBAAS,WAAW,CAAC,KAAK,CAAC,CAAC,SAAS,kBAAkB,EACnD,OAAO,EAAE,CAAC,GACX,SAAS,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAKnE;AAED,0EAA0E;AAC1E,iBAAS,IAAI,CAAC,KAAK,CAAC,CAAC,SAAS,gBAAgB,GAAG,gBAAgB,EAC7D,OAAO,CAAC,EAAE,CAAC,GACZ,SAAS,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAE7C;AAED;;;;;;;GAOG;AACH,iBAAS,QAAQ,CAAC,KAAK,CAAC,CAAC,SAAS,oBAAoB,EAClD,OAAO,EAAE,CAAC,GACX,SAAS,CACR,UAAU,EACV,CAAC,SAAS;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,GAAG,MAAM,EAAE,GAAG,YAAY,CAAC,CAAC,EAAE,MAAM,CAAC,CAChE,CAiBA;AAED;;;;;;;;;GASG;AACH,iBAAS,eAAe,CAAC,KAAK,CAAC,CAAC,SAAS,2BAA2B,EAChE,OAAO,EAAE,CAAC,GACX,SAAS,CAAC,UAAU,EAAE,CAAC,SAAS;IAAE,IAAI,EAAE,KAAK,CAAA;CAAE,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC,CActE;AAED;;;;;;;GAOG;AACH,iBAAS,KAAK,CAAC,KAAK,CAAC,CAAC,SAAS,iBAAiB,GAAG,iBAAiB,EAChE,OAAO,CAAC,EAAE,CAAC,GACZ,SAAS,CACR,OAAO,EACP,CAAC,SAAS;IAAE,QAAQ,EAAE,IAAI,CAAA;CAAE,GAAG,MAAM,EAAE,GAAG,YAAY,CAAC,CAAC,EAAE,MAAM,CAAC,CACpE,CAkBA;AAED,0EAA0E;AAC1E,eAAO,MAAM,KAAK;;;;;;;;;;;;;;CAcjB,CAAC"}
@@ -0,0 +1,203 @@
1
+ "use strict";
2
+ /**
3
+ * Field builders — the `field.*` vocabulary used inside `collection()` /
4
+ * `single()` definitions. Each builder normalizes its options into a
5
+ * {@link FieldSpec} and carries the value type as a phantom generic so
6
+ * `InferEntry` can derive row types with correct nullability.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.field = void 0;
10
+ const content_domain_1 = require("@orthacms/content-domain");
11
+ const fields_1 = require("../types/fields");
12
+ /** Builds the common part of every spec from the shared base options. */
13
+ function base(type, options = {}, validation = {}) {
14
+ // A `lang` that no user agent can parse is worse than none — it tells
15
+ // assistive tech the content is in a language it cannot pronounce. Fail at
16
+ // definition time (boot) rather than shipping it into every entry.
17
+ if (options.lang !== undefined && !(0, content_domain_1.isWellFormedLanguageTag)(options.lang)) {
18
+ throw new Error(`Invalid BCP-47 language tag ${JSON.stringify(options.lang)} on a ` +
19
+ `${type} field. Expected something like "en", "en-GB" or "zh-Hans".`);
20
+ }
21
+ return {
22
+ type,
23
+ required: options.required ?? false,
24
+ // Omitted (not `false`) when unset, so serialized specs stay lean and
25
+ // the admin can treat presence as the flag.
26
+ ...(options.localized ? { localized: true } : {}),
27
+ ...(options.lang !== undefined ? { lang: options.lang } : {}),
28
+ validation,
29
+ admin: options.admin ?? {}
30
+ };
31
+ }
32
+ /** Short text. Validation: minLength / maxLength / pattern. */
33
+ function text(options) {
34
+ const { minLength, maxLength, pattern } = options ?? {};
35
+ if (pattern !== undefined) {
36
+ // Fail at definition time (boot) rather than on the first value that
37
+ // hits validation, if the author wrote an unparseable pattern.
38
+ try {
39
+ new RegExp(pattern);
40
+ }
41
+ catch (cause) {
42
+ throw new Error(`Invalid regex pattern ${JSON.stringify(pattern)} on a text ` +
43
+ `field: ${cause.message}`);
44
+ }
45
+ }
46
+ return base(fields_1.CONTENT_FIELD_TYPE.Text, options, {
47
+ minLength,
48
+ maxLength,
49
+ pattern
50
+ });
51
+ }
52
+ /**
53
+ * Long-form rich text — a **structured document**, not an HTML string.
54
+ *
55
+ * The value is the ProseMirror/TipTap node tree the admin editor produces, in
56
+ * a `jsonb` column, so heading order, table headers, link text and the
57
+ * language of a quoted passage are things the platform can express and check
58
+ * (WCAG 1.3.1 / 2.4.6 / 3.1.2) rather than characters inside an opaque blob.
59
+ * `minLength`/`maxLength` count the body's **text** for the same reason:
60
+ * bolding a word used to cost the author `<strong></strong>`.
61
+ *
62
+ * A body written before this change is an HTML string, and still reads and
63
+ * validates as one — see `@orthacms/content-domain`'s rich-text module. It is
64
+ * rewritten as a document the next time the record is saved through the editor.
65
+ */
66
+ function richtext(options) {
67
+ const { minLength, maxLength, structure } = options ?? {};
68
+ return base(fields_1.CONTENT_FIELD_TYPE.RichText, options, {
69
+ minLength,
70
+ maxLength,
71
+ ...(structure !== undefined ? { structure } : {})
72
+ });
73
+ }
74
+ /** Floating-point number (or integer with `integer: true`). */
75
+ function number(options) {
76
+ const { min, max, integer } = options ?? {};
77
+ return base(fields_1.CONTENT_FIELD_TYPE.Number, options, { min, max, integer });
78
+ }
79
+ /** Money in integer minor units (cents) — exact, no float drift. */
80
+ function money(options) {
81
+ const { min, max } = options ?? {};
82
+ return base(fields_1.CONTENT_FIELD_TYPE.Money, options, { min, max, integer: true });
83
+ }
84
+ /** True/false. Stored NOT NULL with default false when `required`. */
85
+ function boolean(options) {
86
+ return base(fields_1.CONTENT_FIELD_TYPE.Boolean, options);
87
+ }
88
+ /** Calendar date (no time of day), ISO `YYYY-MM-DD`. */
89
+ function date(options) {
90
+ return base(fields_1.CONTENT_FIELD_TYPE.Date, options);
91
+ }
92
+ /** Point in time, stored as timestamptz. */
93
+ function datetime(options) {
94
+ return base(fields_1.CONTENT_FIELD_TYPE.Datetime, options);
95
+ }
96
+ /** One of a fixed set of strings. The value type narrows to the options. */
97
+ function select(options) {
98
+ return {
99
+ ...base(fields_1.CONTENT_FIELD_TYPE.Select, options),
100
+ options: options.options
101
+ };
102
+ }
103
+ /** Several of a fixed set of strings, stored as a jsonb array of options. */
104
+ function multiselect(options) {
105
+ return {
106
+ ...base(fields_1.CONTENT_FIELD_TYPE.Multiselect, options),
107
+ options: options.options
108
+ };
109
+ }
110
+ /** Arbitrary JSON payload (jsonb). Escape hatch — prefer typed fields. */
111
+ function json(options) {
112
+ return base(fields_1.CONTENT_FIELD_TYPE.Json, options);
113
+ }
114
+ /**
115
+ * Relation to another content type — a real Postgres foreign key.
116
+ * Single (`many: false`) becomes a `<field>_id` uuid FK column;
117
+ * `many: true` becomes a generated join table. `unique: true` adds a
118
+ * `UNIQUE` constraint to the single FK column for a one-to-one relation.
119
+ * `to` is a thunk so mutually-referencing collection files can import
120
+ * each other.
121
+ */
122
+ function relation(options) {
123
+ return {
124
+ ...base(fields_1.CONTENT_FIELD_TYPE.Relation, options),
125
+ relation: {
126
+ to: options.to,
127
+ many: options.many ?? false,
128
+ onDelete: options.onDelete ?? (options.required ? 'cascade' : 'set null'),
129
+ unique: options.unique ?? false,
130
+ // `localized: true` on a relation means "each locale keeps its own
131
+ // links", which is exactly `syncAcrossLocales: false` — so it sets
132
+ // the default rather than being a second, separately-honoured flag.
133
+ // Declaring both in contradiction is rejected at define time.
134
+ syncAcrossLocales: options.syncAcrossLocales ?? !(options.localized ?? false)
135
+ }
136
+ };
137
+ }
138
+ /**
139
+ * The **inverse** side of a two-way relation — a back-reference to the storage
140
+ * owned by `of`'s `field`. Generates no column/table: it reads and writes the
141
+ * same link the owning relation does (source/target swapped), so editing either
142
+ * side stays in sync. `of` is a thunk so the two files can import each other.
143
+ *
144
+ * @example
145
+ * // article.ts owns: tags: field.relation({ to: () => tag, many: true })
146
+ * // tag.ts mirrors: articles: field.relationInverse({ of: () => article, field: 'tags' })
147
+ */
148
+ function relationInverse(options) {
149
+ return {
150
+ ...base(fields_1.CONTENT_FIELD_TYPE.Relation, options),
151
+ relation: {
152
+ to: options.of,
153
+ many: options.many ?? true,
154
+ onDelete: 'set null', // inert for a virtual (storage-less) field
155
+ unique: false,
156
+ // Inert too: an inverse reuses the owning side's FK/join rows, so
157
+ // syncing from both ends would write the same links twice.
158
+ syncAcrossLocales: false,
159
+ inverse: { field: options.field }
160
+ }
161
+ };
162
+ }
163
+ /**
164
+ * Attach one or more **Media Library** assets. Stores asset ids in the values
165
+ * bag — a single `uuid` column (`multiple: false`), or a `jsonb` array of ids
166
+ * (`multiple: true`), so media rides revisions and locale-sibling sync like any
167
+ * other field. Asset ids are plain uuids, not a Postgres FK: the assets live in
168
+ * the media plugin's own schema, so existence and the `accept` restriction are
169
+ * enforced by the server on save (via the media-asset resolver), not the DB.
170
+ */
171
+ function media(options) {
172
+ const accept = options?.accept;
173
+ if (accept?.kinds) {
174
+ // Fail at boot on a typo'd kind rather than silently accepting nothing.
175
+ for (const kind of accept.kinds) {
176
+ if (!fields_1.MEDIA_KIND_VALUES.includes(kind)) {
177
+ throw new Error(`Invalid media kind ${JSON.stringify(kind)} on a media ` +
178
+ `field: expected one of ${fields_1.MEDIA_KIND_VALUES.join(', ')}.`);
179
+ }
180
+ }
181
+ }
182
+ return {
183
+ ...base(fields_1.CONTENT_FIELD_TYPE.Media, options),
184
+ multiple: options?.multiple ?? false,
185
+ ...(accept ? { accept } : {})
186
+ };
187
+ }
188
+ /** The field-builder vocabulary: `field.text()`, `field.relation()`, … */
189
+ exports.field = {
190
+ text,
191
+ richtext,
192
+ number,
193
+ money,
194
+ boolean,
195
+ date,
196
+ datetime,
197
+ select,
198
+ multiselect,
199
+ json,
200
+ relation,
201
+ relationInverse,
202
+ media
203
+ };
@@ -0,0 +1,16 @@
1
+ import { ContentInsightsQuery } from '../../infrastructure/queries/content-insights.query';
2
+ import type { ContentPipelineView } from '../../types/content-insights-view';
3
+ /**
4
+ * `GET /api/insights/content/pipeline` — the draft/published split for every
5
+ * content type that has at least one entry in the workspace.
6
+ *
7
+ * Takes no `?days=`: this is a snapshot of what exists now, not a flow over
8
+ * time. Filtering it by a window would answer a different and much less useful
9
+ * question ("what was created recently") under the same name.
10
+ */
11
+ export declare class ContentPipelineController {
12
+ private readonly insights;
13
+ constructor(insights: ContentInsightsQuery);
14
+ pipeline(workspaceId: string): Promise<ContentPipelineView>;
15
+ }
16
+ //# sourceMappingURL=content-pipeline.controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-pipeline.controller.d.ts","sourceRoot":"","sources":["../../../../../src/lib/insights/http/controllers/content-pipeline.controller.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,oBAAoB,EAAE,MAAM,qDAAqD,CAAC;AAC3F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAE7E;;;;;;;GAOG;AACH,qBAGa,yBAAyB;IACtB,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,EAAE,oBAAoB;IAG3D,QAAQ,CACgB,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,mBAAmB,CAAC;CAGlC"}