@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,353 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PublicEntryWritesController = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const common_1 = require("@nestjs/common");
6
+ const swagger_1 = require("@nestjs/swagger");
7
+ const identity_server_1 = require("@orthacms/identity-server");
8
+ const workspaces_server_1 = require("@orthacms/workspaces-server");
9
+ const content_tokens_1 = require("../../../content.tokens");
10
+ const workspace_grants_query_1 = require("../../../content-types/queries/workspace-grants.query");
11
+ const public_entry_writes_service_1 = require("../../infrastructure/public-entry-writes.service");
12
+ const api_token_guard_1 = require("../guards/api-token.guard");
13
+ const api_token_workspace_guard_1 = require("../guards/api-token-workspace.guard");
14
+ const public_save_entry_dto_1 = require("../dto/public-save-entry.dto");
15
+ const public_bulk_dto_1 = require("../dto/public-bulk.dto");
16
+ const entries_constants_1 = require("../../../entries/entries.constants");
17
+ const public_list_entries_query_dto_1 = require("../dto/public-list-entries-query.dto");
18
+ const resolve_granted_type_1 = require("./resolve-granted-type");
19
+ /**
20
+ * `POST|PATCH|DELETE /api/v1/content/...` — the **write half** of the public,
21
+ * token-authenticated content API. A `full`-scope token can author content from
22
+ * outside the admin: create drafts, edit them, assign and unassign relations,
23
+ * add translations, publish, and remove.
24
+ *
25
+ * Every route is gated by its own permission (`content:create` / `update` /
26
+ * `publish` / `delete`), which `ApiTokenGuard` evaluates against the token's
27
+ * scope through the same `AccessPolicy` the session routes use. A `read` token
28
+ * therefore gets a **403** on all of them without a line of code here saying so.
29
+ *
30
+ * **Batches sit alongside the single-entry writes, not instead of them**
31
+ * (`/bulk`, `/bulk/publish`, `/bulk/unpublish`, `/bulk/delete`). They exist
32
+ * because an external client is usually syncing a list — an import, a scheduled
33
+ * republish — and doing that one HTTP round trip per record is the difference
34
+ * between a job that finishes and one that times out. Every one of them runs the
35
+ * same use-case its single-entry sibling does, so a batch is a way of *asking*,
36
+ * never a second set of rules.
37
+ *
38
+ * Like the reads, every single-entry write exists in **both addressing forms** —
39
+ * `:id` and `group/:localeGroupId` — so a localized client that holds group ids
40
+ * can edit, publish, and delete without ever learning a per-locale id.
41
+ *
42
+ * **No `OriginGuard`**, unlike the admin's write controllers: those are
43
+ * cookie-authenticated and so CSRF-able, while a bearer token is never sent
44
+ * ambiently by a browser. Requiring an `Origin` header here would reject every
45
+ * server-side client instead of protecting anything.
46
+ */
47
+ let PublicEntryWritesController = class PublicEntryWritesController {
48
+ registry;
49
+ grants;
50
+ writes;
51
+ constructor(registry, grants, writes) {
52
+ this.registry = registry;
53
+ this.grants = grants;
54
+ this.writes = writes;
55
+ }
56
+ /** `POST /api/v1/content/:typeName` — create a draft entry. */
57
+ async create(typeName, body, workspaceId) {
58
+ const { type, granted } = await (0, resolve_granted_type_1.resolveGrantedType)(this.registry, this.grants, typeName, workspaceId);
59
+ return this.writes.create(type, body, workspaceId, granted);
60
+ }
61
+ // ---- batches -----------------------------------------------------------
62
+ //
63
+ // **Declared before the `:id` routes**, because `bulk/publish` and
64
+ // `:id/publish` are the same shape to the router and Express matches in
65
+ // declaration order — the single-entry routes' `ParseUUIDPipe` is a backstop
66
+ // that turns a mis-ordered match into a 400, not a substitute for the order.
67
+ // Same arrangement, same reason, as the admin's `BulkEntriesController`.
68
+ /** `POST /api/v1/content/:typeName/bulk` — create and/or update many entries. */
69
+ async bulkSave(typeName, body, workspaceId) {
70
+ const { type, granted } = await (0, resolve_granted_type_1.resolveGrantedType)(this.registry, this.grants, typeName, workspaceId);
71
+ return this.writes.bulkSave(type, body.items, workspaceId, granted);
72
+ }
73
+ /** `POST /api/v1/content/:typeName/bulk/publish` — take many entries live. */
74
+ async bulkPublish(typeName, body, workspaceId) {
75
+ const { type } = await (0, resolve_granted_type_1.resolveGrantedType)(this.registry, this.grants, typeName, workspaceId);
76
+ return this.writes.bulkPublish(type, body.ids, workspaceId);
77
+ }
78
+ /** `POST /api/v1/content/:typeName/bulk/unpublish` — take many off the air. */
79
+ async bulkUnpublish(typeName, body, workspaceId) {
80
+ const { type } = await (0, resolve_granted_type_1.resolveGrantedType)(this.registry, this.grants, typeName, workspaceId);
81
+ return this.writes.bulkUnpublish(type, body.ids, workspaceId);
82
+ }
83
+ /** `POST /api/v1/content/:typeName/bulk/delete` — remove many entries. */
84
+ async bulkRemove(typeName, body, workspaceId) {
85
+ const { type } = await (0, resolve_granted_type_1.resolveGrantedType)(this.registry, this.grants, typeName, workspaceId);
86
+ return this.writes.bulkRemove(type, body.ids, workspaceId);
87
+ }
88
+ // ---- addressed by translation group -----------------------------------
89
+ //
90
+ // Declared before the `:id` forms for the same reason as the reads: they
91
+ // cannot collide on segment count, but Express matches in declaration order
92
+ // and literal-prefixed routes belong ahead of wildcards.
93
+ /** `PATCH /api/v1/content/:typeName/group/:localeGroupId` */
94
+ updateByGroup(typeName, localeGroupId, body, query, workspaceId) {
95
+ return this.applyUpdate(typeName, { localeGroupId }, body, workspaceId, query.locale);
96
+ }
97
+ /** `POST /api/v1/content/:typeName/group/:localeGroupId/publish` */
98
+ publishByGroup(typeName, localeGroupId, query, workspaceId) {
99
+ return this.applyPublish(typeName, { localeGroupId }, workspaceId, query.locale, true);
100
+ }
101
+ /** `POST /api/v1/content/:typeName/group/:localeGroupId/unpublish` */
102
+ unpublishByGroup(typeName, localeGroupId, query, workspaceId) {
103
+ return this.applyPublish(typeName, { localeGroupId }, workspaceId, query.locale, false);
104
+ }
105
+ /** `DELETE /api/v1/content/:typeName/group/:localeGroupId` */
106
+ removeByGroup(typeName, localeGroupId, query, workspaceId) {
107
+ return this.applyRemove(typeName, { localeGroupId }, workspaceId, query.locale);
108
+ }
109
+ // ---- addressed by entry id ---------------------------------------------
110
+ /** `PATCH /api/v1/content/:typeName/:id` — replace an entry's values. */
111
+ update(typeName, id, body, workspaceId) {
112
+ // No locale: an entry id already names exactly one row, in whatever
113
+ // locale it happens to be.
114
+ return this.applyUpdate(typeName, { id }, body, workspaceId, undefined);
115
+ }
116
+ /** `POST /api/v1/content/:typeName/:id/publish` — take an entry live. */
117
+ publish(typeName, id, workspaceId) {
118
+ return this.applyPublish(typeName, { id }, workspaceId, undefined, true);
119
+ }
120
+ /** `POST /api/v1/content/:typeName/:id/unpublish` — take it off the air. */
121
+ unpublish(typeName, id, workspaceId) {
122
+ return this.applyPublish(typeName, { id }, workspaceId, undefined, false);
123
+ }
124
+ /** `DELETE /api/v1/content/:typeName/:id` — remove an entry. */
125
+ remove(typeName, id, workspaceId) {
126
+ return this.applyRemove(typeName, { id }, workspaceId, undefined);
127
+ }
128
+ // ---- the shared handlers, one per write --------------------------------
129
+ //
130
+ // Each is called by both addressing forms, so the pair stays a routing
131
+ // detail and never a behavioural fork — the same arrangement as the reads.
132
+ /** @see update */
133
+ async applyUpdate(typeName, locator, body, workspaceId, locale) {
134
+ const { type, granted } = await (0, resolve_granted_type_1.resolveGrantedType)(this.registry, this.grants, typeName, workspaceId);
135
+ return this.writes.update(type, locator, body, workspaceId, granted, locale);
136
+ }
137
+ /** @see publish */
138
+ async applyPublish(typeName, locator, workspaceId, locale, live) {
139
+ const { type, granted } = await (0, resolve_granted_type_1.resolveGrantedType)(this.registry, this.grants, typeName, workspaceId);
140
+ return live
141
+ ? this.writes.publish(type, locator, workspaceId, granted, locale)
142
+ : this.writes.unpublish(type, locator, workspaceId, granted, locale);
143
+ }
144
+ /** @see remove */
145
+ async applyRemove(typeName, locator, workspaceId, locale) {
146
+ const { type } = await (0, resolve_granted_type_1.resolveGrantedType)(this.registry, this.grants, typeName, workspaceId);
147
+ await this.writes.remove(type, locator, workspaceId, locale);
148
+ }
149
+ };
150
+ exports.PublicEntryWritesController = PublicEntryWritesController;
151
+ tslib_1.__decorate([
152
+ (0, common_1.Post)(':typeName'),
153
+ (0, identity_server_1.RequirePermissions)(identity_server_1.PERMISSIONS.CONTENT_CREATE),
154
+ (0, swagger_1.ApiOperation)({
155
+ summary: 'Create an entry',
156
+ description: 'Creates the entry as a **draft** on publishable types — publish is a separate call, so a create always has a reviewable state. `values` is validated against the type’s field specs (422 with per-field issues). Pass `localeGroupId` with a different `locale` to add a translation to an existing record. 404 when the type is unknown or the workspace was not granted it.'
157
+ }),
158
+ tslib_1.__param(0, (0, common_1.Param)('typeName')),
159
+ tslib_1.__param(1, (0, common_1.Body)()),
160
+ tslib_1.__param(2, (0, workspaces_server_1.CurrentWorkspace)()),
161
+ tslib_1.__metadata("design:type", Function),
162
+ tslib_1.__metadata("design:paramtypes", [String, public_save_entry_dto_1.PublicSaveEntryDto, String]),
163
+ tslib_1.__metadata("design:returntype", Promise)
164
+ ], PublicEntryWritesController.prototype, "create", null);
165
+ tslib_1.__decorate([
166
+ (0, common_1.Post)(':typeName/bulk'),
167
+ (0, common_1.HttpCode)(common_1.HttpStatus.OK),
168
+ (0, identity_server_1.RequirePermissions)(identity_server_1.PERMISSIONS.CONTENT_CREATE, identity_server_1.PERMISSIONS.CONTENT_UPDATE),
169
+ (0, swagger_1.ApiOperation)({
170
+ summary: 'Save many entries',
171
+ description: `Creates and/or updates up to ${entries_constants_1.BULK_MAX_SAVE_ITEMS} entries of one type in a single request — an item with an \`id\` updates that entry, one without creates a new draft, and an item naming only a \`localeGroupId\` must say which with \`op\`. Each item means exactly what the equivalent \`POST\` / \`PATCH\` means, merge semantics and all.\n\n**Always 200, even when items fail.** Items are written one transaction at a time, so a batch cannot be rolled back as a unit and one bad row does not reject the rest: the response carries a verdict per item in request order, with failures reporting the status and message the single-entry call would have returned (a 422 keeps its per-field \`issues\`). Retry the failures you can fix. Both \`content:create\` and \`content:update\` are required, since one request may do either.`
172
+ }),
173
+ tslib_1.__param(0, (0, common_1.Param)('typeName')),
174
+ tslib_1.__param(1, (0, common_1.Body)()),
175
+ tslib_1.__param(2, (0, workspaces_server_1.CurrentWorkspace)()),
176
+ tslib_1.__metadata("design:type", Function),
177
+ tslib_1.__metadata("design:paramtypes", [String, public_bulk_dto_1.PublicBulkSaveDto, String]),
178
+ tslib_1.__metadata("design:returntype", Promise)
179
+ ], PublicEntryWritesController.prototype, "bulkSave", null);
180
+ tslib_1.__decorate([
181
+ (0, common_1.Post)(':typeName/bulk/publish'),
182
+ (0, common_1.HttpCode)(common_1.HttpStatus.OK),
183
+ (0, identity_server_1.RequirePermissions)(identity_server_1.PERMISSIONS.CONTENT_PUBLISH),
184
+ (0, swagger_1.ApiOperation)({
185
+ summary: 'Publish many entries',
186
+ description: 'Re-validates the listed drafts inside **one locked transaction** and publishes those that pass, reporting the rest in `skipped` with why — `already-published`, `blocked` (validation), or `not-found` (unknown, soft-deleted, or in another workspace). Partial success is the normal outcome, not an error. 400 on a type that is not publishable.'
187
+ }),
188
+ tslib_1.__param(0, (0, common_1.Param)('typeName')),
189
+ tslib_1.__param(1, (0, common_1.Body)()),
190
+ tslib_1.__param(2, (0, workspaces_server_1.CurrentWorkspace)()),
191
+ tslib_1.__metadata("design:type", Function),
192
+ tslib_1.__metadata("design:paramtypes", [String, public_bulk_dto_1.PublicBulkIdsDto, String]),
193
+ tslib_1.__metadata("design:returntype", Promise)
194
+ ], PublicEntryWritesController.prototype, "bulkPublish", null);
195
+ tslib_1.__decorate([
196
+ (0, common_1.Post)(':typeName/bulk/unpublish'),
197
+ (0, common_1.HttpCode)(common_1.HttpStatus.OK),
198
+ (0, identity_server_1.RequirePermissions)(identity_server_1.PERMISSIONS.CONTENT_PUBLISH),
199
+ (0, swagger_1.ApiOperation)({
200
+ summary: 'Unpublish many entries',
201
+ description: 'Reverts the listed entries to drafts. `count` is how many actually transitioned — an id that was not a live published row of this workspace changes nothing and is not counted, which is the only way this call can "fail" for an id.'
202
+ }),
203
+ tslib_1.__param(0, (0, common_1.Param)('typeName')),
204
+ tslib_1.__param(1, (0, common_1.Body)()),
205
+ tslib_1.__param(2, (0, workspaces_server_1.CurrentWorkspace)()),
206
+ tslib_1.__metadata("design:type", Function),
207
+ tslib_1.__metadata("design:paramtypes", [String, public_bulk_dto_1.PublicBulkIdsDto, String]),
208
+ tslib_1.__metadata("design:returntype", Promise)
209
+ ], PublicEntryWritesController.prototype, "bulkUnpublish", null);
210
+ tslib_1.__decorate([
211
+ (0, common_1.Post)(':typeName/bulk/delete'),
212
+ (0, common_1.HttpCode)(common_1.HttpStatus.OK),
213
+ (0, identity_server_1.RequirePermissions)(identity_server_1.PERMISSIONS.CONTENT_DELETE),
214
+ (0, swagger_1.ApiOperation)({
215
+ summary: 'Delete many entries',
216
+ description: 'Soft-deletes on a `paranoid` type (recoverable from the admin’s trash) and hard-deletes otherwise. `count` is how many rows were removed. Deletes exactly the listed rows: on a localized type the other translations stay live.\n\nA `POST`, not a `DELETE`, because the ids travel in a body — the one thing a `DELETE` cannot reliably carry through proxies and client libraries.'
217
+ }),
218
+ tslib_1.__param(0, (0, common_1.Param)('typeName')),
219
+ tslib_1.__param(1, (0, common_1.Body)()),
220
+ tslib_1.__param(2, (0, workspaces_server_1.CurrentWorkspace)()),
221
+ tslib_1.__metadata("design:type", Function),
222
+ tslib_1.__metadata("design:paramtypes", [String, public_bulk_dto_1.PublicBulkIdsDto, String]),
223
+ tslib_1.__metadata("design:returntype", Promise)
224
+ ], PublicEntryWritesController.prototype, "bulkRemove", null);
225
+ tslib_1.__decorate([
226
+ (0, common_1.Patch)(':typeName/group/:localeGroupId'),
227
+ (0, identity_server_1.RequirePermissions)(identity_server_1.PERMISSIONS.CONTENT_UPDATE),
228
+ (0, swagger_1.ApiOperation)({
229
+ summary: 'Update the group’s entry for a locale',
230
+ description: 'As the `:id` form, for the group’s row in the requested `?locale=`.'
231
+ }),
232
+ tslib_1.__param(0, (0, common_1.Param)('typeName')),
233
+ tslib_1.__param(1, (0, common_1.Param)('localeGroupId', common_1.ParseUUIDPipe)),
234
+ tslib_1.__param(2, (0, common_1.Body)()),
235
+ tslib_1.__param(3, (0, common_1.Query)()),
236
+ tslib_1.__param(4, (0, workspaces_server_1.CurrentWorkspace)()),
237
+ tslib_1.__metadata("design:type", Function),
238
+ tslib_1.__metadata("design:paramtypes", [String, String, public_save_entry_dto_1.PublicSaveEntryDto,
239
+ public_list_entries_query_dto_1.PublicEntryQueryDto, String]),
240
+ tslib_1.__metadata("design:returntype", Promise)
241
+ ], PublicEntryWritesController.prototype, "updateByGroup", null);
242
+ tslib_1.__decorate([
243
+ (0, common_1.Post)(':typeName/group/:localeGroupId/publish'),
244
+ (0, identity_server_1.RequirePermissions)(identity_server_1.PERMISSIONS.CONTENT_PUBLISH),
245
+ (0, swagger_1.ApiOperation)({ summary: 'Publish the group’s entry for a locale' }),
246
+ tslib_1.__param(0, (0, common_1.Param)('typeName')),
247
+ tslib_1.__param(1, (0, common_1.Param)('localeGroupId', common_1.ParseUUIDPipe)),
248
+ tslib_1.__param(2, (0, common_1.Query)()),
249
+ tslib_1.__param(3, (0, workspaces_server_1.CurrentWorkspace)()),
250
+ tslib_1.__metadata("design:type", Function),
251
+ tslib_1.__metadata("design:paramtypes", [String, String, public_list_entries_query_dto_1.PublicEntryQueryDto, String]),
252
+ tslib_1.__metadata("design:returntype", Promise)
253
+ ], PublicEntryWritesController.prototype, "publishByGroup", null);
254
+ tslib_1.__decorate([
255
+ (0, common_1.Post)(':typeName/group/:localeGroupId/unpublish'),
256
+ (0, identity_server_1.RequirePermissions)(identity_server_1.PERMISSIONS.CONTENT_PUBLISH),
257
+ (0, swagger_1.ApiOperation)({ summary: 'Unpublish the group’s entry for a locale' }),
258
+ tslib_1.__param(0, (0, common_1.Param)('typeName')),
259
+ tslib_1.__param(1, (0, common_1.Param)('localeGroupId', common_1.ParseUUIDPipe)),
260
+ tslib_1.__param(2, (0, common_1.Query)()),
261
+ tslib_1.__param(3, (0, workspaces_server_1.CurrentWorkspace)()),
262
+ tslib_1.__metadata("design:type", Function),
263
+ tslib_1.__metadata("design:paramtypes", [String, String, public_list_entries_query_dto_1.PublicEntryQueryDto, String]),
264
+ tslib_1.__metadata("design:returntype", Promise)
265
+ ], PublicEntryWritesController.prototype, "unpublishByGroup", null);
266
+ tslib_1.__decorate([
267
+ (0, common_1.Delete)(':typeName/group/:localeGroupId'),
268
+ (0, identity_server_1.RequirePermissions)(identity_server_1.PERMISSIONS.CONTENT_DELETE),
269
+ (0, common_1.HttpCode)(common_1.HttpStatus.NO_CONTENT),
270
+ (0, swagger_1.ApiOperation)({
271
+ summary: 'Delete the group’s entry for a locale',
272
+ description: 'Removes **one** translation — the group’s row in the requested `?locale=`. The other locales stay live.'
273
+ }),
274
+ tslib_1.__param(0, (0, common_1.Param)('typeName')),
275
+ tslib_1.__param(1, (0, common_1.Param)('localeGroupId', common_1.ParseUUIDPipe)),
276
+ tslib_1.__param(2, (0, common_1.Query)()),
277
+ tslib_1.__param(3, (0, workspaces_server_1.CurrentWorkspace)()),
278
+ tslib_1.__metadata("design:type", Function),
279
+ tslib_1.__metadata("design:paramtypes", [String, String, public_list_entries_query_dto_1.PublicEntryQueryDto, String]),
280
+ tslib_1.__metadata("design:returntype", Promise)
281
+ ], PublicEntryWritesController.prototype, "removeByGroup", null);
282
+ tslib_1.__decorate([
283
+ (0, common_1.Patch)(':typeName/:id'),
284
+ (0, identity_server_1.RequirePermissions)(identity_server_1.PERMISSIONS.CONTENT_UPDATE),
285
+ (0, swagger_1.ApiOperation)({
286
+ summary: 'Update an entry',
287
+ description: 'A **partial** update: the `values` you send are merged over the stored ones, so omitting a field leaves it alone and sending `null` clears it. (The admin’s own PATCH replaces the whole bag — the editor always submits the full document — but an API client sends the two fields it changed, and silently nulling the rest would be invisible until a later publish failed.) `relations` deltas apply in the same transaction. On a publishable type a published entry moves back to **draft** while its published version stays live, so an edit never silently changes what the world is reading — publish again to ship it. 404 when no such entry exists in this workspace.'
288
+ }),
289
+ tslib_1.__param(0, (0, common_1.Param)('typeName')),
290
+ tslib_1.__param(1, (0, common_1.Param)('id', common_1.ParseUUIDPipe)),
291
+ tslib_1.__param(2, (0, common_1.Body)()),
292
+ tslib_1.__param(3, (0, workspaces_server_1.CurrentWorkspace)()),
293
+ tslib_1.__metadata("design:type", Function),
294
+ tslib_1.__metadata("design:paramtypes", [String, String, public_save_entry_dto_1.PublicSaveEntryDto, String]),
295
+ tslib_1.__metadata("design:returntype", Promise)
296
+ ], PublicEntryWritesController.prototype, "update", null);
297
+ tslib_1.__decorate([
298
+ (0, common_1.Post)(':typeName/:id/publish'),
299
+ (0, identity_server_1.RequirePermissions)(identity_server_1.PERMISSIONS.CONTENT_PUBLISH),
300
+ (0, swagger_1.ApiOperation)({
301
+ summary: 'Publish an entry',
302
+ description: 'Re-validates the stored row and takes it live. A draft that no longer passes validation is a 422 — `required` means required *to publish*, so an incomplete draft is legal right up until this call. 400 on a type that is not publishable.'
303
+ }),
304
+ tslib_1.__param(0, (0, common_1.Param)('typeName')),
305
+ tslib_1.__param(1, (0, common_1.Param)('id', common_1.ParseUUIDPipe)),
306
+ tslib_1.__param(2, (0, workspaces_server_1.CurrentWorkspace)()),
307
+ tslib_1.__metadata("design:type", Function),
308
+ tslib_1.__metadata("design:paramtypes", [String, String, String]),
309
+ tslib_1.__metadata("design:returntype", Promise)
310
+ ], PublicEntryWritesController.prototype, "publish", null);
311
+ tslib_1.__decorate([
312
+ (0, common_1.Post)(':typeName/:id/unpublish'),
313
+ (0, identity_server_1.RequirePermissions)(identity_server_1.PERMISSIONS.CONTENT_PUBLISH),
314
+ (0, swagger_1.ApiOperation)({
315
+ summary: 'Unpublish an entry',
316
+ description: 'Reverts the entry to a draft. It leaves the published reads immediately; a write-scoped token can still see it with `?status=draft`.'
317
+ }),
318
+ tslib_1.__param(0, (0, common_1.Param)('typeName')),
319
+ tslib_1.__param(1, (0, common_1.Param)('id', common_1.ParseUUIDPipe)),
320
+ tslib_1.__param(2, (0, workspaces_server_1.CurrentWorkspace)()),
321
+ tslib_1.__metadata("design:type", Function),
322
+ tslib_1.__metadata("design:paramtypes", [String, String, String]),
323
+ tslib_1.__metadata("design:returntype", Promise)
324
+ ], PublicEntryWritesController.prototype, "unpublish", null);
325
+ tslib_1.__decorate([
326
+ (0, common_1.Delete)(':typeName/:id'),
327
+ (0, identity_server_1.RequirePermissions)(identity_server_1.PERMISSIONS.CONTENT_DELETE),
328
+ (0, common_1.HttpCode)(common_1.HttpStatus.NO_CONTENT),
329
+ (0, swagger_1.ApiOperation)({
330
+ summary: 'Delete an entry',
331
+ description: 'Soft-deletes on a `paranoid` type (recoverable from the admin’s trash, invisible here either way) and hard-deletes otherwise. Deletes exactly this row: on a localized type the other translations of the group stay live.'
332
+ }),
333
+ tslib_1.__param(0, (0, common_1.Param)('typeName')),
334
+ tslib_1.__param(1, (0, common_1.Param)('id', common_1.ParseUUIDPipe)),
335
+ tslib_1.__param(2, (0, workspaces_server_1.CurrentWorkspace)()),
336
+ tslib_1.__metadata("design:type", Function),
337
+ tslib_1.__metadata("design:paramtypes", [String, String, String]),
338
+ tslib_1.__metadata("design:returntype", Promise)
339
+ ], PublicEntryWritesController.prototype, "remove", null);
340
+ exports.PublicEntryWritesController = PublicEntryWritesController = tslib_1.__decorate([
341
+ (0, identity_server_1.Public)(),
342
+ (0, common_1.UseGuards)(api_token_guard_1.ApiTokenGuard, api_token_workspace_guard_1.ApiTokenWorkspaceGuard),
343
+ (0, swagger_1.ApiSecurity)('apiToken'),
344
+ (0, swagger_1.ApiHeader)({
345
+ name: 'X-Workspace-Id',
346
+ required: false,
347
+ description: "The workspace to write in. Required when the token covers more than one workspace; optional when it covers exactly one. A workspace outside the token's bucket is a 403."
348
+ }),
349
+ (0, common_1.Controller)('v1/content'),
350
+ tslib_1.__param(0, (0, content_tokens_1.InjectContentRegistry)()),
351
+ tslib_1.__metadata("design:paramtypes", [Function, workspace_grants_query_1.WorkspaceGrantsQuery,
352
+ public_entry_writes_service_1.PublicEntryWritesService])
353
+ ], PublicEntryWritesController);
@@ -0,0 +1,42 @@
1
+ import type { ContentTypeRegistry } from '../../../registry/content-type-registry';
2
+ import type { AnyContentType } from '../../../types/content-type';
3
+ /**
4
+ * Where this resolver reads a workspace's content grants from.
5
+ *
6
+ * A structural port rather than `WorkspaceGrantsQuery` itself, so a caller that
7
+ * has **already** read the grant set for the current request can supply it
8
+ * instead of provoking one query per resolved type. `WorkspaceGrantsQuery`
9
+ * satisfies it as-is; the GraphQL endpoint passes a cache over it, because a
10
+ * single document resolves many types and they must all see one consistent
11
+ * grant set anyway.
12
+ */
13
+ export interface ContentGrantsSource {
14
+ /** Every content slug granted to `workspaceId`. */
15
+ grantedSlugs(workspaceId: string): Promise<ReadonlySet<string>>;
16
+ }
17
+ /**
18
+ * A resolved type plus the workspace's full grant set. The grants are returned
19
+ * alongside because the filter surface needs them to prune relation traversals
20
+ * into ungranted types — reading them once per request rather than twice.
21
+ */
22
+ export interface GrantedType {
23
+ /** The registered, granted content type the route targets. */
24
+ type: AnyContentType;
25
+ /** Every content slug the workspace was granted. */
26
+ granted: ReadonlySet<string>;
27
+ }
28
+ /**
29
+ * Resolve a `:typeName` for a public-API request: it must be a registered
30
+ * content type **and** one the target workspace has been granted
31
+ * (`workspace_content`). Anything else — unknown name, or a real type this
32
+ * workspace was never granted — is the same 404, so a token can't enumerate
33
+ * the content model beyond what its workspace actually exposes.
34
+ *
35
+ * Grants are enforced here even though the admin's own entries list doesn't
36
+ * check them: the admin caller is a member of the workspace looking at its own
37
+ * CMS, while a token is an external credential, and the grant set is exactly
38
+ * the workspace's declared content surface. `GET /api/v1/content-types` lists
39
+ * that same set, so a consumer never has to guess which names will 404.
40
+ */
41
+ export declare function resolveGrantedType(registry: ContentTypeRegistry, grants: ContentGrantsSource, typeName: string, workspaceId: string): Promise<GrantedType>;
42
+ //# sourceMappingURL=resolve-granted-type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-granted-type.d.ts","sourceRoot":"","sources":["../../../../../src/lib/public-api/http/controllers/resolve-granted-type.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AACnF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAElE;;;;;;;;;GASG;AACH,MAAM,WAAW,mBAAmB;IAChC,mDAAmD;IACnD,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;CACnE;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW;IACxB,8DAA8D;IAC9D,IAAI,EAAE,cAAc,CAAC;IACrB,oDAAoD;IACpD,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAChC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,kBAAkB,CACpC,QAAQ,EAAE,mBAAmB,EAC7B,MAAM,EAAE,mBAAmB,EAC3B,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,GACpB,OAAO,CAAC,WAAW,CAAC,CAOtB"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolveGrantedType = resolveGrantedType;
4
+ const common_1 = require("@nestjs/common");
5
+ /**
6
+ * Resolve a `:typeName` for a public-API request: it must be a registered
7
+ * content type **and** one the target workspace has been granted
8
+ * (`workspace_content`). Anything else — unknown name, or a real type this
9
+ * workspace was never granted — is the same 404, so a token can't enumerate
10
+ * the content model beyond what its workspace actually exposes.
11
+ *
12
+ * Grants are enforced here even though the admin's own entries list doesn't
13
+ * check them: the admin caller is a member of the workspace looking at its own
14
+ * CMS, while a token is an external credential, and the grant set is exactly
15
+ * the workspace's declared content surface. `GET /api/v1/content-types` lists
16
+ * that same set, so a consumer never has to guess which names will 404.
17
+ */
18
+ async function resolveGrantedType(registry, grants, typeName, workspaceId) {
19
+ const type = registry.get(typeName);
20
+ const granted = await grants.grantedSlugs(workspaceId);
21
+ if (!type || !granted.has(typeName)) {
22
+ throw new common_1.NotFoundException(`Unknown content type "${typeName}".`);
23
+ }
24
+ return { type, granted };
25
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Parameter decorator returning the {@link PublicApiToken} that
3
+ * {@link ApiTokenGuard} verified and attached. Use it only on routes carrying
4
+ * that guard — without it the request carries no token, so this throws rather
5
+ * than handing a handler an `undefined` caller identity.
6
+ */
7
+ export declare const CurrentApiToken: (...dataOrPipes: unknown[]) => ParameterDecorator;
8
+ //# sourceMappingURL=current-api-token.decorator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"current-api-token.decorator.d.ts","sourceRoot":"","sources":["../../../../../src/lib/public-api/http/decorators/current-api-token.decorator.ts"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH,eAAO,MAAM,eAAe,mDAU3B,CAAC"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CurrentApiToken = void 0;
4
+ const common_1 = require("@nestjs/common");
5
+ /**
6
+ * Parameter decorator returning the {@link PublicApiToken} that
7
+ * {@link ApiTokenGuard} verified and attached. Use it only on routes carrying
8
+ * that guard — without it the request carries no token, so this throws rather
9
+ * than handing a handler an `undefined` caller identity.
10
+ */
11
+ exports.CurrentApiToken = (0, common_1.createParamDecorator)((_data, context) => {
12
+ const request = context.switchToHttp().getRequest();
13
+ if (!request.apiToken) {
14
+ throw new common_1.InternalServerErrorException('@CurrentApiToken() used on a route without ApiTokenGuard.');
15
+ }
16
+ return request.apiToken;
17
+ });
@@ -0,0 +1,58 @@
1
+ import { type BulkSaveOp } from '../../types/public-bulk';
2
+ import { PublicSaveEntryDto } from './public-save-entry.dto';
3
+ /**
4
+ * One entry in a bulk save — a {@link PublicSaveEntryDto} plus the addressing a
5
+ * single-entry write takes from its URL.
6
+ *
7
+ * **It extends the single-entry body rather than restating it**, so `values`,
8
+ * `relations`, `locale` and `localeGroupId` mean exactly what they mean on
9
+ * `POST`/`PATCH` and cannot drift from them — including the delta caps, which a
10
+ * hand-rolled item schema would have quietly dropped.
11
+ */
12
+ export declare class PublicBulkSaveItemDto extends PublicSaveEntryDto {
13
+ /**
14
+ * The entry to update — the `:id` of the single-entry `PATCH`. Absent on a
15
+ * create.
16
+ */
17
+ id?: string;
18
+ /**
19
+ * What this item does, when the addressing alone does not say.
20
+ *
21
+ * Only ever **required** for the one genuinely ambiguous shape: a
22
+ * `localeGroupId` with no `id`, which is either "create this record's row in
23
+ * another language" or "update the row this group already has in `locale`".
24
+ * Every other item infers it (see `resolveBulkSaveOp`), because making a
25
+ * plain list of new entries carry `op: "create"` on every element is noise
26
+ * for a rule that has exactly one exception.
27
+ */
28
+ op?: BulkSaveOp;
29
+ }
30
+ /**
31
+ * Body of `POST /v1/content/:typeName/bulk` — the entries to save.
32
+ *
33
+ * Capped at {@link BULK_MAX_SAVE_ITEMS}, which is deliberately lower than the
34
+ * id-only bulk actions' cap: every item here carries a whole document and
35
+ * provokes its own write transaction.
36
+ */
37
+ export declare class PublicBulkSaveDto {
38
+ /** The entries to create and/or update, in the order they should be tried. */
39
+ items: PublicBulkSaveItemDto[];
40
+ }
41
+ /**
42
+ * Body of the public bulk **actions** — `bulk/publish`, `bulk/unpublish`,
43
+ * `bulk/delete`: the entry ids to act on.
44
+ *
45
+ * `{ ids }` rather than the save endpoint's `{ items }`, because these carry no
46
+ * document — and because it is the shape the admin's bulk routes have always
47
+ * taken, so a consumer moving between the two surfaces learns one body, not
48
+ * two. Capped at {@link BULK_MAX_IDS}, the same bound those routes apply.
49
+ *
50
+ * Entry **ids**, not translation groups: a group names a record across
51
+ * languages, and publishing "the record" would mean publishing translations the
52
+ * caller never listed. Address the rows themselves, one locale at a time.
53
+ */
54
+ export declare class PublicBulkIdsDto {
55
+ /** Entry ids to act on. */
56
+ ids: string[];
57
+ }
58
+ //# sourceMappingURL=public-bulk.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public-bulk.dto.d.ts","sourceRoot":"","sources":["../../../../../src/lib/public-api/http/dto/public-bulk.dto.ts"],"names":[],"mappings":"AAeA,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAK7D;;;;;;;;GAQG;AACH,qBAAa,qBAAsB,SAAQ,kBAAkB;IACzD;;;OAGG;IASH,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ;;;;;;;;;OASG;IAQH,EAAE,CAAC,EAAE,UAAU,CAAC;CACnB;AAED;;;;;;GAMG;AACH,qBAAa,iBAAiB;IAC1B,8EAA8E;IAY9E,KAAK,EAAG,qBAAqB,EAAE,CAAC;CACnC;AAED;;;;;;;;;;;;GAYG;AACH,qBAAa,gBAAgB;IACzB,2BAA2B;IAa3B,GAAG,EAAG,MAAM,EAAE,CAAC;CAClB"}
@@ -0,0 +1,118 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PublicBulkIdsDto = exports.PublicBulkSaveDto = exports.PublicBulkSaveItemDto = 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/entries.constants");
9
+ const public_bulk_1 = require("../../types/public-bulk");
10
+ const public_save_entry_dto_1 = require("./public-save-entry.dto");
11
+ /** The two operations a bulk-save item may name explicitly. */
12
+ const BULK_SAVE_OPS = Object.values(public_bulk_1.BULK_SAVE_OP);
13
+ /**
14
+ * One entry in a bulk save — a {@link PublicSaveEntryDto} plus the addressing a
15
+ * single-entry write takes from its URL.
16
+ *
17
+ * **It extends the single-entry body rather than restating it**, so `values`,
18
+ * `relations`, `locale` and `localeGroupId` mean exactly what they mean on
19
+ * `POST`/`PATCH` and cannot drift from them — including the delta caps, which a
20
+ * hand-rolled item schema would have quietly dropped.
21
+ */
22
+ class PublicBulkSaveItemDto extends public_save_entry_dto_1.PublicSaveEntryDto {
23
+ /**
24
+ * The entry to update — the `:id` of the single-entry `PATCH`. Absent on a
25
+ * create.
26
+ */
27
+ id;
28
+ /**
29
+ * What this item does, when the addressing alone does not say.
30
+ *
31
+ * Only ever **required** for the one genuinely ambiguous shape: a
32
+ * `localeGroupId` with no `id`, which is either "create this record's row in
33
+ * another language" or "update the row this group already has in `locale`".
34
+ * Every other item infers it (see `resolveBulkSaveOp`), because making a
35
+ * plain list of new entries carry `op: "create"` on every element is noise
36
+ * for a rule that has exactly one exception.
37
+ */
38
+ op;
39
+ }
40
+ exports.PublicBulkSaveItemDto = PublicBulkSaveItemDto;
41
+ tslib_1.__decorate([
42
+ (0, swagger_1.ApiPropertyOptional)({
43
+ type: String,
44
+ format: 'uuid',
45
+ description: 'The entry to update — what you would put in the `PATCH` path. Absent means this item creates an entry.'
46
+ }),
47
+ (0, class_validator_1.IsOptional)(),
48
+ (0, class_validator_1.IsUUID)(),
49
+ tslib_1.__metadata("design:type", String)
50
+ ], PublicBulkSaveItemDto.prototype, "id", void 0);
51
+ tslib_1.__decorate([
52
+ (0, swagger_1.ApiPropertyOptional)({
53
+ enum: BULK_SAVE_OPS,
54
+ description: 'What this item does. Inferred when the item is unambiguous — an `id` means update, neither `id` nor `localeGroupId` means create — and **required** when only `localeGroupId` is given, which could be either creating that record’s row in a new locale or updating the row it already has there.'
55
+ }),
56
+ (0, class_validator_1.IsOptional)(),
57
+ (0, class_validator_1.IsIn)(BULK_SAVE_OPS),
58
+ tslib_1.__metadata("design:type", String)
59
+ ], PublicBulkSaveItemDto.prototype, "op", void 0);
60
+ /**
61
+ * Body of `POST /v1/content/:typeName/bulk` — the entries to save.
62
+ *
63
+ * Capped at {@link BULK_MAX_SAVE_ITEMS}, which is deliberately lower than the
64
+ * id-only bulk actions' cap: every item here carries a whole document and
65
+ * provokes its own write transaction.
66
+ */
67
+ class PublicBulkSaveDto {
68
+ /** The entries to create and/or update, in the order they should be tried. */
69
+ items;
70
+ }
71
+ exports.PublicBulkSaveDto = PublicBulkSaveDto;
72
+ tslib_1.__decorate([
73
+ (0, swagger_1.ApiProperty)({
74
+ type: [PublicBulkSaveItemDto],
75
+ minItems: 1,
76
+ maxItems: entries_constants_1.BULK_MAX_SAVE_ITEMS,
77
+ description: `The entries to save, applied in order and reported back positionally. Non-empty and capped at ${entries_constants_1.BULK_MAX_SAVE_ITEMS} — each item is a full document and its own write, so the cap bounds both the body and the work one request can start.`
78
+ }),
79
+ (0, class_validator_1.IsArray)(),
80
+ (0, class_validator_1.ArrayNotEmpty)(),
81
+ (0, class_validator_1.ArrayMaxSize)(entries_constants_1.BULK_MAX_SAVE_ITEMS),
82
+ (0, class_validator_1.ValidateNested)({ each: true }),
83
+ (0, class_transformer_1.Type)(() => PublicBulkSaveItemDto),
84
+ tslib_1.__metadata("design:type", Array)
85
+ ], PublicBulkSaveDto.prototype, "items", void 0);
86
+ /**
87
+ * Body of the public bulk **actions** — `bulk/publish`, `bulk/unpublish`,
88
+ * `bulk/delete`: the entry ids to act on.
89
+ *
90
+ * `{ ids }` rather than the save endpoint's `{ items }`, because these carry no
91
+ * document — and because it is the shape the admin's bulk routes have always
92
+ * taken, so a consumer moving between the two surfaces learns one body, not
93
+ * two. Capped at {@link BULK_MAX_IDS}, the same bound those routes apply.
94
+ *
95
+ * Entry **ids**, not translation groups: a group names a record across
96
+ * languages, and publishing "the record" would mean publishing translations the
97
+ * caller never listed. Address the rows themselves, one locale at a time.
98
+ */
99
+ class PublicBulkIdsDto {
100
+ /** Entry ids to act on. */
101
+ ids;
102
+ }
103
+ exports.PublicBulkIdsDto = PublicBulkIdsDto;
104
+ tslib_1.__decorate([
105
+ (0, swagger_1.ApiProperty)({
106
+ type: [String],
107
+ format: 'uuid',
108
+ minItems: 1,
109
+ maxItems: entries_constants_1.BULK_MAX_IDS,
110
+ example: ['3f1a7c1e-9d2b-4a6f-8c11-5b8e2f0d7a91'],
111
+ description: `Entry ids to act on — non-empty and capped at ${entries_constants_1.BULK_MAX_IDS}. Ids outside this workspace simply do not match; nothing distinguishes them from ids that never existed.`
112
+ }),
113
+ (0, class_validator_1.IsArray)(),
114
+ (0, class_validator_1.ArrayNotEmpty)(),
115
+ (0, class_validator_1.ArrayMaxSize)(entries_constants_1.BULK_MAX_IDS),
116
+ (0, class_validator_1.IsUUID)('4', { each: true }),
117
+ tslib_1.__metadata("design:type", Array)
118
+ ], PublicBulkIdsDto.prototype, "ids", void 0);