@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 @@
1
+ {"version":3,"file":"update-entry.controller.d.ts","sourceRoot":"","sources":["../../../../../src/lib/entries/http/controllers/update-entry.controller.ts"],"names":[],"mappings":"AAQA,OAAO,EAKH,KAAK,UAAU,EAElB,MAAM,2BAA2B,CAAC;AAInC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uDAAuD,CAAC;AAC3F,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAI/D;;;;;;GAMG;AACH,qBAGa,qBAAqB;IAG1B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBADN,QAAQ,EAAE,mBAAmB,EAC7B,MAAM,EAAE,kBAAkB;IAI/C,MAAM,CACiB,QAAQ,EAAE,MAAM,EACP,EAAE,EAAE,MAAM,EAC9B,IAAI,EAAE,YAAY,EACN,WAAW,EAAE,MAAM,EACxB,IAAI,CAAC,EAAE,UAAU,GACjC,OAAO,CAAC,WAAW,CAAC;CAW1B"}
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdateEntryController = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const common_1 = require("@nestjs/common");
6
+ const identity_server_1 = require("@orthacms/identity-server");
7
+ const workspaces_server_1 = require("@orthacms/workspaces-server");
8
+ const content_grant_guard_1 = require("../guards/content-grant.guard");
9
+ const content_tokens_1 = require("../../../content.tokens");
10
+ const entry_writer_service_1 = require("../../infrastructure/persistence/entry-writer.service");
11
+ const save_entry_dto_1 = require("../dto/save-entry.dto");
12
+ const resolve_type_1 = require("./resolve-type");
13
+ const to_actor_1 = require("./to-actor");
14
+ /**
15
+ * `PATCH /api/content/:typeName/:id` — replace a live entry's values with a
16
+ * validated bag (the editor always submits the full document). 404 if there's no
17
+ * live row; 422 with the issue list on validation failure. `OriginGuard` defends
18
+ * this state-changing write; `WorkspaceGuard` scopes it to a workspace the caller
19
+ * belongs to; `content:update` gates it.
20
+ */
21
+ let UpdateEntryController = class UpdateEntryController {
22
+ registry;
23
+ writer;
24
+ constructor(registry, writer) {
25
+ this.registry = registry;
26
+ this.writer = writer;
27
+ }
28
+ update(typeName, id, body, workspaceId, user) {
29
+ const type = (0, resolve_type_1.resolveType)(this.registry, typeName);
30
+ return this.writer.update(type, id, body.values, workspaceId, body.relations, (0, to_actor_1.toActor)(user));
31
+ }
32
+ };
33
+ exports.UpdateEntryController = UpdateEntryController;
34
+ tslib_1.__decorate([
35
+ (0, common_1.Patch)(':typeName/:id'),
36
+ tslib_1.__param(0, (0, common_1.Param)('typeName')),
37
+ tslib_1.__param(1, (0, common_1.Param)('id', common_1.ParseUUIDPipe)),
38
+ tslib_1.__param(2, (0, common_1.Body)()),
39
+ tslib_1.__param(3, (0, workspaces_server_1.CurrentWorkspace)()),
40
+ tslib_1.__param(4, (0, identity_server_1.CurrentUser)()),
41
+ tslib_1.__metadata("design:type", Function),
42
+ tslib_1.__metadata("design:paramtypes", [String, String, save_entry_dto_1.SaveEntryDto, String, Object]),
43
+ tslib_1.__metadata("design:returntype", Promise)
44
+ ], UpdateEntryController.prototype, "update", null);
45
+ exports.UpdateEntryController = UpdateEntryController = tslib_1.__decorate([
46
+ (0, common_1.UseGuards)(identity_server_1.OriginGuard, identity_server_1.PermissionsGuard, workspaces_server_1.WorkspaceGuard, content_grant_guard_1.ContentGrantGuard),
47
+ (0, identity_server_1.RequirePermissions)(identity_server_1.PERMISSIONS.CONTENT_UPDATE),
48
+ (0, common_1.Controller)('content'),
49
+ tslib_1.__param(0, (0, content_tokens_1.InjectContentRegistry)()),
50
+ tslib_1.__metadata("design:paramtypes", [Function, entry_writer_service_1.EntryWriterService])
51
+ ], UpdateEntryController);
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Body for the bulk endpoints (`/bulk/publish`, `/bulk/unpublish`,
3
+ * `/bulk/delete`, `/bulk/restore`, and the publish dry run): the set of entry
4
+ * ids to act on. Non-empty, uuid-typed, and capped at {@link BULK_MAX_IDS} so a
5
+ * single request can't fan out unbounded work.
6
+ */
7
+ export declare class BulkIdsDto {
8
+ /** Entry ids to act on. */
9
+ ids: string[];
10
+ }
11
+ //# sourceMappingURL=bulk-ids.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bulk-ids.dto.d.ts","sourceRoot":"","sources":["../../../../../src/lib/entries/http/dto/bulk-ids.dto.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,qBAAa,UAAU;IACnB,2BAA2B;IAa3B,GAAG,EAAG,MAAM,EAAE,CAAC;CAClB"}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BulkIdsDto = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const swagger_1 = require("@nestjs/swagger");
6
+ const class_validator_1 = require("class-validator");
7
+ const entries_constants_1 = require("../../entries.constants");
8
+ /**
9
+ * Body for the bulk endpoints (`/bulk/publish`, `/bulk/unpublish`,
10
+ * `/bulk/delete`, `/bulk/restore`, and the publish dry run): the set of entry
11
+ * ids to act on. Non-empty, uuid-typed, and capped at {@link BULK_MAX_IDS} so a
12
+ * single request can't fan out unbounded work.
13
+ */
14
+ class BulkIdsDto {
15
+ /** Entry ids to act on. */
16
+ ids;
17
+ }
18
+ exports.BulkIdsDto = BulkIdsDto;
19
+ tslib_1.__decorate([
20
+ (0, swagger_1.ApiProperty)({
21
+ type: [String],
22
+ format: 'uuid',
23
+ minItems: 1,
24
+ maxItems: entries_constants_1.BULK_MAX_IDS,
25
+ example: ['3f1a7c1e-9d2b-4a6f-8c11-5b8e2f0d7a91'],
26
+ description: `Entry ids to act on — v4 uuids, non-empty and capped at ${entries_constants_1.BULK_MAX_IDS} so one request can't fan out unbounded work.`
27
+ }),
28
+ (0, class_validator_1.IsArray)(),
29
+ (0, class_validator_1.ArrayNotEmpty)(),
30
+ (0, class_validator_1.ArrayMaxSize)(entries_constants_1.BULK_MAX_IDS),
31
+ (0, class_validator_1.IsUUID)('4', { each: true }),
32
+ tslib_1.__metadata("design:type", Array)
33
+ ], BulkIdsDto.prototype, "ids", void 0);
@@ -0,0 +1,66 @@
1
+ /** `?deleted=only` flips the list to the trash view (soft-deleted rows). */
2
+ export declare const DELETED_ONLY = "only";
3
+ /**
4
+ * `?relations=preview` opts the list into a capped relation preview per row.
5
+ * Opt-in because the relation **picker** reuses this endpoint to list candidates
6
+ * — it would otherwise pay for relation expansion on every keystroke.
7
+ */
8
+ export declare const RELATIONS_PREVIEW = "preview";
9
+ /**
10
+ * Query parameters for `GET /api/content/:typeName`. Pagination is 1-based; the
11
+ * service applies the defaults (page 1, {@link DEFAULT_PAGE_SIZE}) so the
12
+ * contract has one source of truth. `@Type` coerces the raw query strings — the
13
+ * host's global `ValidationPipe` transforms but does not implicitly convert.
14
+ */
15
+ export declare class ListEntriesQueryDto {
16
+ /** Free-text search across the type's text-like columns (text/richtext/select). */
17
+ search?: string;
18
+ /**
19
+ * Structured filter tree as a JSON string (`?filter=<json>`), produced by
20
+ * the admin query builder and validated against the type's derived filter
21
+ * schema by `parseFilterTree`. Length-capped here as a first line of
22
+ * defence; the engine's node/depth caps bound the parsed shape.
23
+ */
24
+ filter?: string;
25
+ /** Sort spec: a column id (ascending) or `-`-prefixed (descending). */
26
+ sort?: string;
27
+ /** 1-based page number. */
28
+ page?: number;
29
+ /** Rows per page, capped at {@link MAX_PAGE_SIZE}. */
30
+ pageSize?: number;
31
+ /**
32
+ * `only` lists soft-deleted rows (the trash view) instead of live ones.
33
+ * Meaningful only for paranoid types; ignored otherwise. Absent (the
34
+ * default) lists live rows.
35
+ */
36
+ deleted?: typeof DELETED_ONLY;
37
+ /**
38
+ * `preview` includes a capped {@link RELATIONS_PREVIEW} of each requested
39
+ * relation field's links on every row. Absent (the default) returns no
40
+ * relation data, exactly as before.
41
+ */
42
+ relations?: typeof RELATIONS_PREVIEW;
43
+ /**
44
+ * Comma-separated relation field names to preview — the table's **visible**
45
+ * relation columns, so a hidden column costs nothing. Ignored without
46
+ * `?relations=preview`. Names are matched against the type's own relation
47
+ * fields and anything unknown is dropped, so the raw string never reaches a
48
+ * query.
49
+ */
50
+ relationFields?: string;
51
+ /**
52
+ * Locale slug the list targets — an **extension-owned** param this package
53
+ * declares (the strict ValidationPipe rejects undeclared keys) but never
54
+ * interprets: it's forwarded to the bound `CONTENT_ENTRY_EXTENSION`, which
55
+ * validates and applies it. Ignored when no extension is bound or the type
56
+ * isn't localized.
57
+ */
58
+ locale?: string;
59
+ /**
60
+ * `default` widens the locale scope to fall back to the default locale
61
+ * where the requested one is missing (the relation picker's mode).
62
+ * Extension-owned, like {@link locale}.
63
+ */
64
+ localeFallback?: string;
65
+ }
66
+ //# sourceMappingURL=list-entries-query.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-entries-query.dto.d.ts","sourceRoot":"","sources":["../../../../../src/lib/entries/http/dto/list-entries-query.dto.ts"],"names":[],"mappings":"AAiBA,4EAA4E;AAC5E,eAAO,MAAM,YAAY,SAAS,CAAC;AAEnC;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAQ3C;;;;;GAKG;AACH,qBAAa,mBAAmB;IAC5B,mFAAmF;IAUnF,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;;OAKG;IAYH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,uEAAuE;IAWvE,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,2BAA2B;IAW3B,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,sDAAsD;IAatD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;;OAIG;IAQH,OAAO,CAAC,EAAE,OAAO,YAAY,CAAC;IAE9B;;;;OAIG;IAQH,SAAS,CAAC,EAAE,OAAO,iBAAiB,CAAC;IAErC;;;;;;OAMG;IAWH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;;;;OAMG;IAWH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IAQH,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B"}
@@ -0,0 +1,192 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ListEntriesQueryDto = exports.RELATIONS_PREVIEW = exports.DELETED_ONLY = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const swagger_1 = require("@nestjs/swagger");
6
+ const class_transformer_1 = require("class-transformer");
7
+ const class_validator_1 = require("class-validator");
8
+ const entries_constants_1 = require("../../entries.constants");
9
+ /** `?deleted=only` flips the list to the trash view (soft-deleted rows). */
10
+ exports.DELETED_ONLY = 'only';
11
+ /**
12
+ * `?relations=preview` opts the list into a capped relation preview per row.
13
+ * Opt-in because the relation **picker** reuses this endpoint to list candidates
14
+ * — it would otherwise pay for relation expansion on every keystroke.
15
+ */
16
+ exports.RELATIONS_PREVIEW = 'preview';
17
+ /** Upper bound on the `?relationFields=` list (a comma-separated field list). */
18
+ const RELATION_FIELDS_MAX_LENGTH = 1024;
19
+ /** Longest accepted locale slug (BCP-47's practical bound). */
20
+ const LOCALE_MAX_LENGTH = 35;
21
+ /**
22
+ * Query parameters for `GET /api/content/:typeName`. Pagination is 1-based; the
23
+ * service applies the defaults (page 1, {@link DEFAULT_PAGE_SIZE}) so the
24
+ * contract has one source of truth. `@Type` coerces the raw query strings — the
25
+ * host's global `ValidationPipe` transforms but does not implicitly convert.
26
+ */
27
+ class ListEntriesQueryDto {
28
+ /** Free-text search across the type's text-like columns (text/richtext/select). */
29
+ search;
30
+ /**
31
+ * Structured filter tree as a JSON string (`?filter=<json>`), produced by
32
+ * the admin query builder and validated against the type's derived filter
33
+ * schema by `parseFilterTree`. Length-capped here as a first line of
34
+ * defence; the engine's node/depth caps bound the parsed shape.
35
+ */
36
+ filter;
37
+ /** Sort spec: a column id (ascending) or `-`-prefixed (descending). */
38
+ sort;
39
+ /** 1-based page number. */
40
+ page;
41
+ /** Rows per page, capped at {@link MAX_PAGE_SIZE}. */
42
+ pageSize;
43
+ /**
44
+ * `only` lists soft-deleted rows (the trash view) instead of live ones.
45
+ * Meaningful only for paranoid types; ignored otherwise. Absent (the
46
+ * default) lists live rows.
47
+ */
48
+ deleted;
49
+ /**
50
+ * `preview` includes a capped {@link RELATIONS_PREVIEW} of each requested
51
+ * relation field's links on every row. Absent (the default) returns no
52
+ * relation data, exactly as before.
53
+ */
54
+ relations;
55
+ /**
56
+ * Comma-separated relation field names to preview — the table's **visible**
57
+ * relation columns, so a hidden column costs nothing. Ignored without
58
+ * `?relations=preview`. Names are matched against the type's own relation
59
+ * fields and anything unknown is dropped, so the raw string never reaches a
60
+ * query.
61
+ */
62
+ relationFields;
63
+ /**
64
+ * Locale slug the list targets — an **extension-owned** param this package
65
+ * declares (the strict ValidationPipe rejects undeclared keys) but never
66
+ * interprets: it's forwarded to the bound `CONTENT_ENTRY_EXTENSION`, which
67
+ * validates and applies it. Ignored when no extension is bound or the type
68
+ * isn't localized.
69
+ */
70
+ locale;
71
+ /**
72
+ * `default` widens the locale scope to fall back to the default locale
73
+ * where the requested one is missing (the relation picker's mode).
74
+ * Extension-owned, like {@link locale}.
75
+ */
76
+ localeFallback;
77
+ }
78
+ exports.ListEntriesQueryDto = ListEntriesQueryDto;
79
+ tslib_1.__decorate([
80
+ (0, swagger_1.ApiPropertyOptional)({
81
+ type: String,
82
+ maxLength: 255,
83
+ description: "Free-text ILIKE search across the type's text-like columns (text/richtext/select)."
84
+ }),
85
+ (0, class_validator_1.IsOptional)(),
86
+ (0, class_validator_1.IsString)(),
87
+ (0, class_validator_1.MaxLength)(255),
88
+ tslib_1.__metadata("design:type", String)
89
+ ], ListEntriesQueryDto.prototype, "search", void 0);
90
+ tslib_1.__decorate([
91
+ (0, swagger_1.ApiPropertyOptional)({
92
+ type: String,
93
+ maxLength: entries_constants_1.FILTER_MAX_LENGTH,
94
+ example: '{"op":"and","rules":[{"field":"author.name","op":"eq","value":"Ada"}]}',
95
+ description: "Structured filter tree as a JSON string, validated against the type's derived filter schema (relation paths included). Malformed → 400."
96
+ }),
97
+ (0, class_validator_1.IsOptional)(),
98
+ (0, class_validator_1.IsString)(),
99
+ (0, class_validator_1.MaxLength)(entries_constants_1.FILTER_MAX_LENGTH),
100
+ tslib_1.__metadata("design:type", String)
101
+ ], ListEntriesQueryDto.prototype, "filter", void 0);
102
+ tslib_1.__decorate([
103
+ (0, swagger_1.ApiPropertyOptional)({
104
+ type: String,
105
+ maxLength: 255,
106
+ example: '-updatedAt',
107
+ description: 'Sort spec: a whitelisted column id (ascending) or `-`-prefixed (descending). `id` is always the tiebreaker.'
108
+ }),
109
+ (0, class_validator_1.IsOptional)(),
110
+ (0, class_validator_1.IsString)(),
111
+ (0, class_validator_1.MaxLength)(255),
112
+ tslib_1.__metadata("design:type", String)
113
+ ], ListEntriesQueryDto.prototype, "sort", void 0);
114
+ tslib_1.__decorate([
115
+ (0, swagger_1.ApiPropertyOptional)({
116
+ type: 'integer',
117
+ minimum: 1,
118
+ default: 1,
119
+ description: '1-based page number.'
120
+ }),
121
+ (0, class_validator_1.IsOptional)(),
122
+ (0, class_transformer_1.Type)(() => Number),
123
+ (0, class_validator_1.IsInt)(),
124
+ (0, class_validator_1.Min)(1),
125
+ tslib_1.__metadata("design:type", Number)
126
+ ], ListEntriesQueryDto.prototype, "page", void 0);
127
+ tslib_1.__decorate([
128
+ (0, swagger_1.ApiPropertyOptional)({
129
+ type: 'integer',
130
+ minimum: 1,
131
+ maximum: entries_constants_1.MAX_PAGE_SIZE,
132
+ default: entries_constants_1.DEFAULT_PAGE_SIZE,
133
+ description: `Rows per page, capped at ${entries_constants_1.MAX_PAGE_SIZE}.`
134
+ }),
135
+ (0, class_validator_1.IsOptional)(),
136
+ (0, class_transformer_1.Type)(() => Number),
137
+ (0, class_validator_1.IsInt)(),
138
+ (0, class_validator_1.Min)(1),
139
+ (0, class_validator_1.Max)(entries_constants_1.MAX_PAGE_SIZE),
140
+ tslib_1.__metadata("design:type", Number)
141
+ ], ListEntriesQueryDto.prototype, "pageSize", void 0);
142
+ tslib_1.__decorate([
143
+ (0, swagger_1.ApiPropertyOptional)({
144
+ enum: [exports.DELETED_ONLY],
145
+ description: '`only` lists soft-deleted rows (the trash view) instead of live ones. Meaningful only for paranoid types; absent lists live rows.'
146
+ }),
147
+ (0, class_validator_1.IsOptional)(),
148
+ (0, class_validator_1.IsIn)([exports.DELETED_ONLY]),
149
+ tslib_1.__metadata("design:type", Object)
150
+ ], ListEntriesQueryDto.prototype, "deleted", void 0);
151
+ tslib_1.__decorate([
152
+ (0, swagger_1.ApiPropertyOptional)({
153
+ enum: [exports.RELATIONS_PREVIEW],
154
+ description: "`preview` adds a capped page of each requested relation field's links to every row. Opt-in: absent returns no relation data."
155
+ }),
156
+ (0, class_validator_1.IsOptional)(),
157
+ (0, class_validator_1.IsIn)([exports.RELATIONS_PREVIEW]),
158
+ tslib_1.__metadata("design:type", Object)
159
+ ], ListEntriesQueryDto.prototype, "relations", void 0);
160
+ tslib_1.__decorate([
161
+ (0, swagger_1.ApiPropertyOptional)({
162
+ type: String,
163
+ maxLength: RELATION_FIELDS_MAX_LENGTH,
164
+ example: 'author,tags',
165
+ description: 'Comma-separated relation field names to preview. Ignored without `?relations=preview`; unknown names are dropped.'
166
+ }),
167
+ (0, class_validator_1.IsOptional)(),
168
+ (0, class_validator_1.IsString)(),
169
+ (0, class_validator_1.MaxLength)(RELATION_FIELDS_MAX_LENGTH),
170
+ tslib_1.__metadata("design:type", String)
171
+ ], ListEntriesQueryDto.prototype, "relationFields", void 0);
172
+ tslib_1.__decorate([
173
+ (0, swagger_1.ApiPropertyOptional)({
174
+ type: String,
175
+ maxLength: LOCALE_MAX_LENGTH,
176
+ example: 'en',
177
+ description: "Locale slug the list targets. Extension-owned: forwarded verbatim to the bound `CONTENT_ENTRY_EXTENSION`, which validates it (unknown → 400). Ignored when no extension is bound or the type isn't localized."
178
+ }),
179
+ (0, class_validator_1.IsOptional)(),
180
+ (0, class_validator_1.IsString)(),
181
+ (0, class_validator_1.MaxLength)(LOCALE_MAX_LENGTH),
182
+ tslib_1.__metadata("design:type", String)
183
+ ], ListEntriesQueryDto.prototype, "locale", void 0);
184
+ tslib_1.__decorate([
185
+ (0, swagger_1.ApiPropertyOptional)({
186
+ enum: ['default'],
187
+ description: '`default` widens the locale scope to fall back to the default locale where the requested one is missing (the relation picker’s mode).'
188
+ }),
189
+ (0, class_validator_1.IsOptional)(),
190
+ (0, class_validator_1.IsIn)(['default']),
191
+ tslib_1.__metadata("design:type", String)
192
+ ], ListEntriesQueryDto.prototype, "localeFallback", void 0);
@@ -0,0 +1,30 @@
1
+ import { type ValidationOptions, type ValidatorConstraintInterface } from 'class-validator';
2
+ /**
3
+ * Max ids in any one `link`/`unlink`/`order` array. The read side is already
4
+ * clamped (`pageSize ≤ MAX_PAGE_SIZE`); this bounds the write side so a single
5
+ * save can't carry an unbounded id array — which would fan out into a huge
6
+ * `inArray(...)` probe or a one-`WHEN`-per-id `CASE` reorder. Generous enough
7
+ * for a realistic drag-reorder of a scrolled-open relation, finite enough to
8
+ * reject a pathological payload.
9
+ */
10
+ export declare const MAX_DELTA_IDS = 1000;
11
+ /** Max relation fields one save may touch (a bound on the map's key count). */
12
+ export declare const MAX_DELTA_FIELDS = 100;
13
+ /**
14
+ * Validates the `relations` bag of {@link SaveEntryDto}: a map from field name to
15
+ * `{ link?, unlink?, order? }`, each an array of uuid strings. class-validator
16
+ * can't decorate a `Record`'s dynamic keys, so this constraint checks the shape
17
+ * of every value — turning a malformed delta (a non-array `unlink`, a non-uuid
18
+ * id, an unknown inner key, or an over-large array) into a clean **400** instead
19
+ * of letting it reach `inArray(...)` against a `uuid` column and surface as a
20
+ * 500. Unknown inner keys are rejected so the nested `Record` can't slip past
21
+ * the app's `forbidNonWhitelisted` posture, and the id arrays and the map itself
22
+ * are size-bounded so a single request can't carry an unbounded payload.
23
+ */
24
+ export declare class RelationDeltaMapConstraint implements ValidatorConstraintInterface {
25
+ validate(value: unknown): boolean;
26
+ defaultMessage(): string;
27
+ }
28
+ /** Property decorator applying {@link RelationDeltaMapConstraint}. */
29
+ export declare function IsRelationDeltaMap(options?: ValidationOptions): (object: object, propertyName: string) => void;
30
+ //# sourceMappingURL=relation-delta-map.validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relation-delta-map.validator.d.ts","sourceRoot":"","sources":["../../../../../src/lib/entries/http/dto/relation-delta-map.validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,KAAK,iBAAiB,EACtB,KAAK,4BAA4B,EACpC,MAAM,iBAAiB,CAAC;AAezB;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,OAAO,CAAC;AAElC,+EAA+E;AAC/E,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAepC;;;;;;;;;;GAUG;AACH,qBACa,0BACT,YAAW,4BAA4B;IAEvC,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO;IA6CjC,cAAc,IAAI,MAAM;CAO3B;AAED,sEAAsE;AACtE,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE,iBAAiB,IAClD,QAAQ,MAAM,EAAE,cAAc,MAAM,KAAG,IAAI,CAOtD"}
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RelationDeltaMapConstraint = exports.MAX_DELTA_FIELDS = exports.MAX_DELTA_IDS = void 0;
4
+ exports.IsRelationDeltaMap = IsRelationDeltaMap;
5
+ const tslib_1 = require("tslib");
6
+ const class_validator_1 = require("class-validator");
7
+ /** RFC-4122 uuid (any version), matched case-insensitively. */
8
+ const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
9
+ /** The only keys a per-field delta may carry. */
10
+ const DELTA_KEYS = ['link', 'unlink', 'order', 'set', 'by'];
11
+ /** The array keys — a join-backed relation's change set. */
12
+ const LINK_KEYS = ['link', 'unlink', 'order'];
13
+ /** Accepted values of the delta's `by` key. @see RelationDelta.by */
14
+ const ADDRESSING = ['id', 'localeGroup'];
15
+ /**
16
+ * Max ids in any one `link`/`unlink`/`order` array. The read side is already
17
+ * clamped (`pageSize ≤ MAX_PAGE_SIZE`); this bounds the write side so a single
18
+ * save can't carry an unbounded id array — which would fan out into a huge
19
+ * `inArray(...)` probe or a one-`WHEN`-per-id `CASE` reorder. Generous enough
20
+ * for a realistic drag-reorder of a scrolled-open relation, finite enough to
21
+ * reject a pathological payload.
22
+ */
23
+ exports.MAX_DELTA_IDS = 1000;
24
+ /** Max relation fields one save may touch (a bound on the map's key count). */
25
+ exports.MAX_DELTA_FIELDS = 100;
26
+ /**
27
+ * A key is valid when absent or an array of at most {@link MAX_DELTA_IDS} uuid
28
+ * strings.
29
+ */
30
+ function isUuidArray(value) {
31
+ return (value === undefined ||
32
+ (Array.isArray(value) &&
33
+ value.length <= exports.MAX_DELTA_IDS &&
34
+ value.every((id) => typeof id === 'string' && UUID_RE.test(id))));
35
+ }
36
+ /**
37
+ * Validates the `relations` bag of {@link SaveEntryDto}: a map from field name to
38
+ * `{ link?, unlink?, order? }`, each an array of uuid strings. class-validator
39
+ * can't decorate a `Record`'s dynamic keys, so this constraint checks the shape
40
+ * of every value — turning a malformed delta (a non-array `unlink`, a non-uuid
41
+ * id, an unknown inner key, or an over-large array) into a clean **400** instead
42
+ * of letting it reach `inArray(...)` against a `uuid` column and surface as a
43
+ * 500. Unknown inner keys are rejected so the nested `Record` can't slip past
44
+ * the app's `forbidNonWhitelisted` posture, and the id arrays and the map itself
45
+ * are size-bounded so a single request can't carry an unbounded payload.
46
+ */
47
+ let RelationDeltaMapConstraint = class RelationDeltaMapConstraint {
48
+ validate(value) {
49
+ if (value === null || typeof value !== 'object')
50
+ return false;
51
+ const entries = Object.entries(value);
52
+ if (entries.length > exports.MAX_DELTA_FIELDS)
53
+ return false;
54
+ return entries.every(([, delta]) => {
55
+ if (delta === null || typeof delta !== 'object')
56
+ return false;
57
+ const record = delta;
58
+ // Reject any key beyond link/unlink/order — the nested Record isn't
59
+ // reached by the global whitelist pipe, so enforce it here.
60
+ if (Object.keys(record).some((key) => !DELTA_KEYS.includes(key)))
61
+ return false;
62
+ const by = record['by'];
63
+ if (by !== undefined &&
64
+ !ADDRESSING.includes(by))
65
+ return false;
66
+ // `set` targets an owning single relation; the arrays target a
67
+ // join-backed one. A field is one or the other, so mixing them is a
68
+ // contradiction rather than a merge — reject it here instead of
69
+ // silently honouring one.
70
+ const hasSet = record['set'] !== undefined;
71
+ const hasLinks = LINK_KEYS.some((key) => record[key] !== undefined);
72
+ if (hasSet && hasLinks)
73
+ return false;
74
+ if (hasSet &&
75
+ record['set'] !== null &&
76
+ !(typeof record['set'] === 'string' &&
77
+ UUID_RE.test(record['set'])))
78
+ return false;
79
+ return (isUuidArray(record['link']) &&
80
+ isUuidArray(record['unlink']) &&
81
+ isUuidArray(record['order']));
82
+ });
83
+ }
84
+ defaultMessage() {
85
+ return ('relations must map each field to { link?, unlink?, order? } arrays of uuids ' +
86
+ '(join-backed relations) or { set } with a uuid or null (a single relation), ' +
87
+ `each with an optional by: ${ADDRESSING.join(' | ')}`);
88
+ }
89
+ };
90
+ exports.RelationDeltaMapConstraint = RelationDeltaMapConstraint;
91
+ exports.RelationDeltaMapConstraint = RelationDeltaMapConstraint = tslib_1.__decorate([
92
+ (0, class_validator_1.ValidatorConstraint)({ name: 'relationDeltaMap' })
93
+ ], RelationDeltaMapConstraint);
94
+ /** Property decorator applying {@link RelationDeltaMapConstraint}. */
95
+ function IsRelationDeltaMap(options) {
96
+ return (object, propertyName) => (0, class_validator_1.registerDecorator)({
97
+ target: object.constructor,
98
+ propertyName,
99
+ options,
100
+ validator: RelationDeltaMapConstraint
101
+ });
102
+ }
@@ -0,0 +1,48 @@
1
+ import type { RelationDelta } from '../../types/entry-list-view';
2
+ /**
3
+ * Body for `POST /api/content/:typeName` (create) and
4
+ * `PATCH /api/content/:typeName/:id` (update). The field `values` bag crosses the
5
+ * wire, plus optional per-field relation **deltas** (`relations`) — the editor
6
+ * stages its many-to-many / inverse link changes locally and sends them here
7
+ * with the rest of the document, so a save persists everything in **one
8
+ * transaction** without ever transmitting a huge relation whole.
9
+ *
10
+ * Reserved envelope columns (`status`/`published_at`/`deleted_at`) are owned by
11
+ * the service and can't be set from here: `coerceValues`/`toColumns` project
12
+ * only keys declared on the type, so a reserved (or otherwise unknown) key in
13
+ * the bag is **silently dropped** — including before validation, which runs on
14
+ * the coerced bag, so an unknown key is never a 422 on either kind of type.
15
+ * (That is what keeps an old revision snapshot restorable after its field was
16
+ * removed from the type.) The bag's
17
+ * *contents* are validated against the type's field specs by that same service
18
+ * (a dynamic, per-type contract class-validator can't express); the relation
19
+ * deltas' ids are validated as existing workspace entries by
20
+ * `RelationLinkService`. `values` is structurally only "an object" (its contents
21
+ * are the per-type contract); the `relations` bag's *shape* — each value a
22
+ * `{ link?, unlink?, order? }` of uuid arrays — is enforced here so a malformed
23
+ * delta is a clean 400, not a 500 from a bad id hitting the query.
24
+ */
25
+ export declare class SaveEntryDto {
26
+ /** Field values keyed by field name. */
27
+ values: Record<string, unknown>;
28
+ /**
29
+ * Per-field relation deltas (`{ <field>: { link?, unlink?, order? } }`) —
30
+ * many/inverse relations only; a single relation is set through `values`.
31
+ */
32
+ relations?: Record<string, RelationDelta>;
33
+ /**
34
+ * Locale slug the entry is created in — an **extension-owned** param this
35
+ * package declares but never interprets (forwarded to the bound
36
+ * `CONTENT_ENTRY_EXTENSION`, which validates it and stamps the envelope
37
+ * column). Read on create only; an update never re-homes a row's locale.
38
+ */
39
+ locale?: string;
40
+ /**
41
+ * The existing translation group a created row joins (making it a sibling)
42
+ * — an **extension-owned**, opaque param, like {@link locale}. Absent → the
43
+ * row starts its own fresh group. The bound extension validates it against
44
+ * the workspace. Read on create only.
45
+ */
46
+ localeGroupId?: string;
47
+ }
48
+ //# sourceMappingURL=save-entry.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"save-entry.dto.d.ts","sourceRoot":"","sources":["../../../../../src/lib/entries/http/dto/save-entry.dto.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAiBjE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,YAAY;IACrB,wCAAwC;IASxC,MAAM,EAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEjC;;;OAGG;IAwBH,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IAE1C;;;;;OAKG;IAWH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;;OAKG;IASH,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B"}