@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,106 @@
1
+ /**
2
+ * `?relations=preview` / `?media=preview` opt an entry read into expanding the
3
+ * named fields. Opt-in because the cost scales with the number of expanded
4
+ * fields, and most reads want neither.
5
+ */
6
+ export declare const PREVIEW = "preview";
7
+ /**
8
+ * Default links / assets returned per expanded field. Matches the admin
9
+ * preview's cap so both surfaces summarise a relation the same way.
10
+ */
11
+ export declare const DEFAULT_EXPANSION_LIMIT = 20;
12
+ /**
13
+ * What publish states a read may return. `published` is the default and the only
14
+ * value a `read`-scope token may use; the other two need write scope.
15
+ */
16
+ export declare const ENTRY_VISIBILITY: readonly ["published", "draft", "any"];
17
+ /** @see ENTRY_VISIBILITY */
18
+ export type EntryVisibility = (typeof ENTRY_VISIBILITY)[number];
19
+ /**
20
+ * The one parameter every public read accepts: which locale to read. Shared by
21
+ * the list and the single-entry route so the slug is declared once.
22
+ */
23
+ export declare class PublicEntryQueryDto {
24
+ /**
25
+ * Which publish states to return. Defaults to `published` — the whole
26
+ * contract of this API for an anonymous consumer.
27
+ *
28
+ * A **write-scoped** token may widen it, because otherwise creating a draft
29
+ * would produce a record the creator cannot read back: the write returns it
30
+ * once and it is then invisible forever. Narrower than "drafts are public" —
31
+ * the widening is gated on the same scope that could have published the row
32
+ * anyway.
33
+ */
34
+ status?: EntryVisibility;
35
+ /** `preview` expands the relation fields named by `relationFields`. */
36
+ relations?: typeof PREVIEW;
37
+ /**
38
+ * Comma-separated relation field names to expand. Each yields one capped
39
+ * page of links plus the count of visible ones.
40
+ */
41
+ relationFields?: string;
42
+ /** `preview` expands the media fields named by `mediaFields`. */
43
+ media?: typeof PREVIEW;
44
+ /**
45
+ * Links returned per expanded relation field. The **true** count is always
46
+ * reported as that field's `total`, so lowering this never hides the fact
47
+ * that more exist.
48
+ */
49
+ relationLimit?: number;
50
+ /**
51
+ * Assets returned per expanded media field, with the same
52
+ * `total`-tells-the-truth guarantee as {@link relationLimit}.
53
+ */
54
+ mediaLimit?: number;
55
+ /** Comma-separated media field names to expand. */
56
+ mediaFields?: string;
57
+ /**
58
+ * Comma-separated field names to return in `values` — a sparse fieldset.
59
+ * Absent returns every value field. Selection narrows the SQL projection
60
+ * too, so an unselected richtext column is never read, let alone sent.
61
+ */
62
+ fields?: string;
63
+ /**
64
+ * `preview` attaches the entry's other locale rows — the rest of its
65
+ * translation group. Opt-in like the other expansions, and a 400 on a type
66
+ * that isn't localized.
67
+ */
68
+ translations?: typeof PREVIEW;
69
+ /**
70
+ * Locale slug the read targets, on a localized type. Extension-owned:
71
+ * forwarded verbatim to the bound `CONTENT_ENTRY_EXTENSION`, which
72
+ * validates it; absent means the configured default locale.
73
+ */
74
+ locale?: string;
75
+ }
76
+ /**
77
+ * Query parameters for `GET /api/v1/content/:typeName` — search, filter, sort,
78
+ * paginate, locale. `search` and `filter` use the **same** shapes as the admin
79
+ * records list, so one query language covers both surfaces.
80
+ *
81
+ * `@Type` coerces the raw query strings; the host's global `ValidationPipe`
82
+ * transforms but does not implicitly convert, and rejects any key not declared
83
+ * here.
84
+ */
85
+ export declare class PublicListEntriesQueryDto extends PublicEntryQueryDto {
86
+ /** Free-text search across the type's text-like columns. */
87
+ search?: string;
88
+ /**
89
+ * Structured filter tree as a JSON string, the same shape the admin's
90
+ * query builder emits. Length-capped here as a first line of defence; the
91
+ * engine's own node/depth caps bound the parsed shape.
92
+ */
93
+ filter?: string;
94
+ /** 1-based page number. */
95
+ page?: number;
96
+ /** Rows per page, capped at {@link MAX_PAGE_SIZE}. */
97
+ pageSize?: number;
98
+ /**
99
+ * Sort spec: a whitelisted column id (ascending) or `-`-prefixed
100
+ * (descending). The whitelist is the envelope timestamps, `publishedAt`,
101
+ * `locale`, and the type's scalar fields; anything else falls back to
102
+ * newest-updated first. `id` is always the tiebreaker.
103
+ */
104
+ sort?: string;
105
+ }
106
+ //# sourceMappingURL=public-list-entries-query.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public-list-entries-query.dto.d.ts","sourceRoot":"","sources":["../../../../../src/lib/public-api/http/dto/public-list-entries-query.dto.ts"],"names":[],"mappings":"AA0BA;;;;GAIG;AACH,eAAO,MAAM,OAAO,YAAY,CAAC;AAEjC;;;GAGG;AACH,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAE1C;;;GAGG;AACH,eAAO,MAAM,gBAAgB,wCAAyC,CAAC;AAEvE,4BAA4B;AAC5B,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhE;;;GAGG;AACH,qBAAa,mBAAmB;IAC5B;;;;;;;;;OASG;IASH,MAAM,CAAC,EAAE,eAAe,CAAC;IAEzB,uEAAuE;IAQvE,SAAS,CAAC,EAAE,OAAO,OAAO,CAAC;IAE3B;;;OAGG;IAWH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,iEAAiE;IAQjE,KAAK,CAAC,EAAE,OAAO,OAAO,CAAC;IAEvB;;;;OAIG;IAaH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IAaH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,mDAAmD;IAWnD,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;OAIG;IAWH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IAQH,YAAY,CAAC,EAAE,OAAO,OAAO,CAAC;IAE9B;;;;OAIG;IAWH,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;GAQG;AACH,qBAAa,yBAA0B,SAAQ,mBAAmB;IAC9D,4DAA4D;IAU5D,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IAYH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2BAA2B;IAW3B,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,sDAAsD;IAatD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;;;OAKG;IAWH,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB"}
@@ -0,0 +1,297 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PublicListEntriesQueryDto = exports.PublicEntryQueryDto = exports.ENTRY_VISIBILITY = exports.DEFAULT_EXPANSION_LIMIT = exports.PREVIEW = 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
+ /** Longest accepted locale slug (BCP-47's practical bound). */
10
+ const LOCALE_MAX_LENGTH = 35;
11
+ /** Longest accepted free-text search needle — matches the admin list's cap. */
12
+ const SEARCH_MAX_LENGTH = 255;
13
+ /** Upper bound on the raw `?fields=` list (a comma-separated field list). */
14
+ const FIELDS_MAX_LENGTH = 1024;
15
+ /**
16
+ * `?relations=preview` / `?media=preview` opt an entry read into expanding the
17
+ * named fields. Opt-in because the cost scales with the number of expanded
18
+ * fields, and most reads want neither.
19
+ */
20
+ exports.PREVIEW = 'preview';
21
+ /**
22
+ * Default links / assets returned per expanded field. Matches the admin
23
+ * preview's cap so both surfaces summarise a relation the same way.
24
+ */
25
+ exports.DEFAULT_EXPANSION_LIMIT = 20;
26
+ /**
27
+ * What publish states a read may return. `published` is the default and the only
28
+ * value a `read`-scope token may use; the other two need write scope.
29
+ */
30
+ exports.ENTRY_VISIBILITY = ['published', 'draft', 'any'];
31
+ /**
32
+ * The one parameter every public read accepts: which locale to read. Shared by
33
+ * the list and the single-entry route so the slug is declared once.
34
+ */
35
+ class PublicEntryQueryDto {
36
+ /**
37
+ * Which publish states to return. Defaults to `published` — the whole
38
+ * contract of this API for an anonymous consumer.
39
+ *
40
+ * A **write-scoped** token may widen it, because otherwise creating a draft
41
+ * would produce a record the creator cannot read back: the write returns it
42
+ * once and it is then invisible forever. Narrower than "drafts are public" —
43
+ * the widening is gated on the same scope that could have published the row
44
+ * anyway.
45
+ */
46
+ status;
47
+ /** `preview` expands the relation fields named by `relationFields`. */
48
+ relations;
49
+ /**
50
+ * Comma-separated relation field names to expand. Each yields one capped
51
+ * page of links plus the count of visible ones.
52
+ */
53
+ relationFields;
54
+ /** `preview` expands the media fields named by `mediaFields`. */
55
+ media;
56
+ /**
57
+ * Links returned per expanded relation field. The **true** count is always
58
+ * reported as that field's `total`, so lowering this never hides the fact
59
+ * that more exist.
60
+ */
61
+ relationLimit;
62
+ /**
63
+ * Assets returned per expanded media field, with the same
64
+ * `total`-tells-the-truth guarantee as {@link relationLimit}.
65
+ */
66
+ mediaLimit;
67
+ /** Comma-separated media field names to expand. */
68
+ mediaFields;
69
+ /**
70
+ * Comma-separated field names to return in `values` — a sparse fieldset.
71
+ * Absent returns every value field. Selection narrows the SQL projection
72
+ * too, so an unselected richtext column is never read, let alone sent.
73
+ */
74
+ fields;
75
+ /**
76
+ * `preview` attaches the entry's other locale rows — the rest of its
77
+ * translation group. Opt-in like the other expansions, and a 400 on a type
78
+ * that isn't localized.
79
+ */
80
+ translations;
81
+ /**
82
+ * Locale slug the read targets, on a localized type. Extension-owned:
83
+ * forwarded verbatim to the bound `CONTENT_ENTRY_EXTENSION`, which
84
+ * validates it; absent means the configured default locale.
85
+ */
86
+ locale;
87
+ }
88
+ exports.PublicEntryQueryDto = PublicEntryQueryDto;
89
+ tslib_1.__decorate([
90
+ (0, swagger_1.ApiPropertyOptional)({
91
+ enum: exports.ENTRY_VISIBILITY,
92
+ default: 'published',
93
+ description: 'Publish states to return. `published` (default) is all a read-only token may ask for; `draft` and `any` require a `full`-scope token, and are a 403 otherwise. Ignored on types that are not publishable — those have no publish state and every row is live.'
94
+ }),
95
+ (0, class_validator_1.IsOptional)(),
96
+ (0, class_validator_1.IsIn)(exports.ENTRY_VISIBILITY),
97
+ tslib_1.__metadata("design:type", String)
98
+ ], PublicEntryQueryDto.prototype, "status", void 0);
99
+ tslib_1.__decorate([
100
+ (0, swagger_1.ApiPropertyOptional)({
101
+ enum: [exports.PREVIEW],
102
+ description: '`preview` expands the relation fields named by `relationFields`. Absent returns no relation data.'
103
+ }),
104
+ (0, class_validator_1.IsOptional)(),
105
+ (0, class_validator_1.IsIn)([exports.PREVIEW]),
106
+ tslib_1.__metadata("design:type", Object)
107
+ ], PublicEntryQueryDto.prototype, "relations", void 0);
108
+ tslib_1.__decorate([
109
+ (0, swagger_1.ApiPropertyOptional)({
110
+ type: String,
111
+ maxLength: FIELDS_MAX_LENGTH,
112
+ example: 'author,tags',
113
+ description: 'Comma-separated relation fields to expand (ignored without `relations=preview`). Only published targets are shown or counted. A name that is not a relation field, or whose target type the workspace was not granted, is a 400.'
114
+ }),
115
+ (0, class_validator_1.IsOptional)(),
116
+ (0, class_validator_1.IsString)(),
117
+ (0, class_validator_1.MaxLength)(FIELDS_MAX_LENGTH),
118
+ tslib_1.__metadata("design:type", String)
119
+ ], PublicEntryQueryDto.prototype, "relationFields", void 0);
120
+ tslib_1.__decorate([
121
+ (0, swagger_1.ApiPropertyOptional)({
122
+ enum: [exports.PREVIEW],
123
+ description: '`preview` expands the media fields named by `mediaFields`. Absent returns no media data.'
124
+ }),
125
+ (0, class_validator_1.IsOptional)(),
126
+ (0, class_validator_1.IsIn)([exports.PREVIEW]),
127
+ tslib_1.__metadata("design:type", Object)
128
+ ], PublicEntryQueryDto.prototype, "media", void 0);
129
+ tslib_1.__decorate([
130
+ (0, swagger_1.ApiPropertyOptional)({
131
+ type: 'integer',
132
+ minimum: 1,
133
+ maximum: entries_constants_1.MAX_PAGE_SIZE,
134
+ default: exports.DEFAULT_EXPANSION_LIMIT,
135
+ description: `Links returned per expanded relation field (1…${entries_constants_1.MAX_PAGE_SIZE}, default ${exports.DEFAULT_EXPANSION_LIMIT}). The field's \`total\` always reports the true count, so a low limit hides nothing. Page the rest via /relations/<field>.`
136
+ }),
137
+ (0, class_validator_1.IsOptional)(),
138
+ (0, class_transformer_1.Type)(() => Number),
139
+ (0, class_validator_1.IsInt)(),
140
+ (0, class_validator_1.Min)(1),
141
+ (0, class_validator_1.Max)(entries_constants_1.MAX_PAGE_SIZE),
142
+ tslib_1.__metadata("design:type", Number)
143
+ ], PublicEntryQueryDto.prototype, "relationLimit", void 0);
144
+ tslib_1.__decorate([
145
+ (0, swagger_1.ApiPropertyOptional)({
146
+ type: 'integer',
147
+ minimum: 1,
148
+ maximum: entries_constants_1.MAX_PAGE_SIZE,
149
+ default: exports.DEFAULT_EXPANSION_LIMIT,
150
+ description: `Assets returned per expanded media field (1…${entries_constants_1.MAX_PAGE_SIZE}, default ${exports.DEFAULT_EXPANSION_LIMIT}). The field's \`total\` always reports the true count.`
151
+ }),
152
+ (0, class_validator_1.IsOptional)(),
153
+ (0, class_transformer_1.Type)(() => Number),
154
+ (0, class_validator_1.IsInt)(),
155
+ (0, class_validator_1.Min)(1),
156
+ (0, class_validator_1.Max)(entries_constants_1.MAX_PAGE_SIZE),
157
+ tslib_1.__metadata("design:type", Number)
158
+ ], PublicEntryQueryDto.prototype, "mediaLimit", void 0);
159
+ tslib_1.__decorate([
160
+ (0, swagger_1.ApiPropertyOptional)({
161
+ type: String,
162
+ maxLength: FIELDS_MAX_LENGTH,
163
+ example: 'coverImage,gallery',
164
+ description: 'Comma-separated media fields to expand (ignored without `media=preview`). Returns asset metadata plus URLs under `/v1/media/assets/:id/raw`, which take the same bearer token as this request.'
165
+ }),
166
+ (0, class_validator_1.IsOptional)(),
167
+ (0, class_validator_1.IsString)(),
168
+ (0, class_validator_1.MaxLength)(FIELDS_MAX_LENGTH),
169
+ tslib_1.__metadata("design:type", String)
170
+ ], PublicEntryQueryDto.prototype, "mediaFields", void 0);
171
+ tslib_1.__decorate([
172
+ (0, swagger_1.ApiPropertyOptional)({
173
+ type: String,
174
+ maxLength: FIELDS_MAX_LENGTH,
175
+ example: 'title,slug,publishedAt',
176
+ description: 'Comma-separated field names to return in `values`. Absent returns every value field. The envelope (`id`, `createdAt`, `updatedAt`, `publishedAt`, `locale`, `localeGroupId`) is always returned and is not selectable. An unknown name is a 400; so is a relation or media field, which this API cannot return yet.'
177
+ }),
178
+ (0, class_validator_1.IsOptional)(),
179
+ (0, class_validator_1.IsString)(),
180
+ (0, class_validator_1.MaxLength)(FIELDS_MAX_LENGTH),
181
+ tslib_1.__metadata("design:type", String)
182
+ ], PublicEntryQueryDto.prototype, "fields", void 0);
183
+ tslib_1.__decorate([
184
+ (0, swagger_1.ApiPropertyOptional)({
185
+ enum: [exports.PREVIEW],
186
+ description: '`preview` attaches the entry’s sibling translations (the rest of its `localeGroupId` group) as `translations`. 400 on a type that is not localized.'
187
+ }),
188
+ (0, class_validator_1.IsOptional)(),
189
+ (0, class_validator_1.IsIn)([exports.PREVIEW]),
190
+ tslib_1.__metadata("design:type", Object)
191
+ ], PublicEntryQueryDto.prototype, "translations", void 0);
192
+ tslib_1.__decorate([
193
+ (0, swagger_1.ApiPropertyOptional)({
194
+ type: String,
195
+ maxLength: LOCALE_MAX_LENGTH,
196
+ example: 'en',
197
+ description: "Locale slug the read targets. Validated by the localization plugin (unknown → 400); absent means the default locale. Ignored on types that aren't localized."
198
+ }),
199
+ (0, class_validator_1.IsOptional)(),
200
+ (0, class_validator_1.IsString)(),
201
+ (0, class_validator_1.MaxLength)(LOCALE_MAX_LENGTH),
202
+ tslib_1.__metadata("design:type", String)
203
+ ], PublicEntryQueryDto.prototype, "locale", void 0);
204
+ /**
205
+ * Query parameters for `GET /api/v1/content/:typeName` — search, filter, sort,
206
+ * paginate, locale. `search` and `filter` use the **same** shapes as the admin
207
+ * records list, so one query language covers both surfaces.
208
+ *
209
+ * `@Type` coerces the raw query strings; the host's global `ValidationPipe`
210
+ * transforms but does not implicitly convert, and rejects any key not declared
211
+ * here.
212
+ */
213
+ class PublicListEntriesQueryDto extends PublicEntryQueryDto {
214
+ /** Free-text search across the type's text-like columns. */
215
+ search;
216
+ /**
217
+ * Structured filter tree as a JSON string, the same shape the admin's
218
+ * query builder emits. Length-capped here as a first line of defence; the
219
+ * engine's own node/depth caps bound the parsed shape.
220
+ */
221
+ filter;
222
+ /** 1-based page number. */
223
+ page;
224
+ /** Rows per page, capped at {@link MAX_PAGE_SIZE}. */
225
+ pageSize;
226
+ /**
227
+ * Sort spec: a whitelisted column id (ascending) or `-`-prefixed
228
+ * (descending). The whitelist is the envelope timestamps, `publishedAt`,
229
+ * `locale`, and the type's scalar fields; anything else falls back to
230
+ * newest-updated first. `id` is always the tiebreaker.
231
+ */
232
+ sort;
233
+ }
234
+ exports.PublicListEntriesQueryDto = PublicListEntriesQueryDto;
235
+ tslib_1.__decorate([
236
+ (0, swagger_1.ApiPropertyOptional)({
237
+ type: String,
238
+ maxLength: SEARCH_MAX_LENGTH,
239
+ description: "Free-text, case-insensitive search across the type's text-like columns (text / richtext / select). LIKE metacharacters are matched literally."
240
+ }),
241
+ (0, class_validator_1.IsOptional)(),
242
+ (0, class_validator_1.IsString)(),
243
+ (0, class_validator_1.MaxLength)(SEARCH_MAX_LENGTH),
244
+ tslib_1.__metadata("design:type", String)
245
+ ], PublicListEntriesQueryDto.prototype, "search", void 0);
246
+ tslib_1.__decorate([
247
+ (0, swagger_1.ApiPropertyOptional)({
248
+ type: String,
249
+ maxLength: entries_constants_1.FILTER_MAX_LENGTH,
250
+ example: '{"and":[{"field":"featured","op":"eq","value":true},{"field":"publishedAt","op":"gte","value":"2026-01-01"}]}',
251
+ description: 'Structured filter tree as a JSON string, validated against the type’s derived filter schema. Filterable: the type’s own scalar fields plus `id`, `createdAt`, `updatedAt`, `publishedAt`, and — on localized types — `locale` and `localeGroupId`. `status` is NOT filterable — this API serves published entries only, so the rule could only ever be a no-op or match nothing. Malformed or unknown fields → 400.'
252
+ }),
253
+ (0, class_validator_1.IsOptional)(),
254
+ (0, class_validator_1.IsString)(),
255
+ (0, class_validator_1.MaxLength)(entries_constants_1.FILTER_MAX_LENGTH),
256
+ tslib_1.__metadata("design:type", String)
257
+ ], PublicListEntriesQueryDto.prototype, "filter", void 0);
258
+ tslib_1.__decorate([
259
+ (0, swagger_1.ApiPropertyOptional)({
260
+ type: 'integer',
261
+ minimum: 1,
262
+ default: 1,
263
+ description: '1-based page number.'
264
+ }),
265
+ (0, class_validator_1.IsOptional)(),
266
+ (0, class_transformer_1.Type)(() => Number),
267
+ (0, class_validator_1.IsInt)(),
268
+ (0, class_validator_1.Min)(1),
269
+ tslib_1.__metadata("design:type", Number)
270
+ ], PublicListEntriesQueryDto.prototype, "page", void 0);
271
+ tslib_1.__decorate([
272
+ (0, swagger_1.ApiPropertyOptional)({
273
+ type: 'integer',
274
+ minimum: 1,
275
+ maximum: entries_constants_1.MAX_PAGE_SIZE,
276
+ default: entries_constants_1.DEFAULT_PAGE_SIZE,
277
+ description: `Rows per page, capped at ${entries_constants_1.MAX_PAGE_SIZE}.`
278
+ }),
279
+ (0, class_validator_1.IsOptional)(),
280
+ (0, class_transformer_1.Type)(() => Number),
281
+ (0, class_validator_1.IsInt)(),
282
+ (0, class_validator_1.Min)(1),
283
+ (0, class_validator_1.Max)(entries_constants_1.MAX_PAGE_SIZE),
284
+ tslib_1.__metadata("design:type", Number)
285
+ ], PublicListEntriesQueryDto.prototype, "pageSize", void 0);
286
+ tslib_1.__decorate([
287
+ (0, swagger_1.ApiPropertyOptional)({
288
+ type: String,
289
+ maxLength: 255,
290
+ example: '-publishedAt',
291
+ description: 'Sort spec: a whitelisted column id (ascending) or `-`-prefixed (descending). Unknown keys fall back to `-updatedAt`; `id` is always the tiebreaker.'
292
+ }),
293
+ (0, class_validator_1.IsOptional)(),
294
+ (0, class_validator_1.IsString)(),
295
+ (0, class_validator_1.MaxLength)(255),
296
+ tslib_1.__metadata("design:type", String)
297
+ ], PublicListEntriesQueryDto.prototype, "sort", void 0);
@@ -0,0 +1,39 @@
1
+ import type { RelationDelta } from '../../../entries/types/entry-list-view';
2
+ /**
3
+ * Body for the public write routes — `POST /v1/content/:typeName` and
4
+ * `PATCH /v1/content/:typeName/:id`.
5
+ *
6
+ * Its own class rather than a re-export of the admin's `SaveEntryDto`, for the
7
+ * same reason `PublicEntry` is not `EntryRecord`: this is a **published
8
+ * contract** an external client codes against, so it must be free to stay still
9
+ * while the editor's internal shape moves. The two happen to agree today, and
10
+ * the *validators* are shared (`IsRelationDeltaMap` is imported, not restated)
11
+ * so the accepted delta shape cannot drift — only the documented surface is
12
+ * duplicated.
13
+ *
14
+ * What is deliberately NOT settable here: `status`, `publishedAt`, `deletedAt`.
15
+ * Publishing is its own route with its own permission, and the other two are
16
+ * stamped by the server. `toColumns` projects only keys declared on the type, so
17
+ * a reserved key in `values` is dropped before storage rather than honoured.
18
+ */
19
+ export declare class PublicSaveEntryDto {
20
+ /** Field values keyed by field name. */
21
+ values: Record<string, unknown>;
22
+ /**
23
+ * Per-field relation deltas — the assign / unassign half of the write API.
24
+ * Many and inverse relations only; an owning single relation is set through
25
+ * `values`.
26
+ */
27
+ relations?: Record<string, RelationDelta>;
28
+ /**
29
+ * Locale the created row is written in — **create only**; an update never
30
+ * re-homes a row's locale.
31
+ */
32
+ locale?: string;
33
+ /**
34
+ * The translation group a created row joins — how a **new translation of an
35
+ * existing record** is written. Create only.
36
+ */
37
+ localeGroupId?: string;
38
+ }
39
+ //# sourceMappingURL=public-save-entry.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public-save-entry.dto.d.ts","sourceRoot":"","sources":["../../../../../src/lib/public-api/http/dto/public-save-entry.dto.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAiB5E;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,kBAAkB;IAC3B,wCAAwC;IASxC,MAAM,EAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEjC;;;;OAIG;IAyBH,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IAE1C;;;OAGG;IAWH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IASH,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B"}
@@ -0,0 +1,112 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PublicSaveEntryDto = 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 relation_delta_map_validator_1 = require("../../../entries/http/dto/relation-delta-map.validator");
8
+ /** Longest accepted locale slug (BCP-47's practical bound). */
9
+ const LOCALE_MAX_LENGTH = 35;
10
+ /** OpenAPI schema of one uuid-array leg of a relation delta. */
11
+ const UUID_ARRAY_SCHEMA = {
12
+ type: 'array',
13
+ maxItems: relation_delta_map_validator_1.MAX_DELTA_IDS,
14
+ items: { type: 'string', format: 'uuid' }
15
+ };
16
+ /**
17
+ * Body for the public write routes — `POST /v1/content/:typeName` and
18
+ * `PATCH /v1/content/:typeName/:id`.
19
+ *
20
+ * Its own class rather than a re-export of the admin's `SaveEntryDto`, for the
21
+ * same reason `PublicEntry` is not `EntryRecord`: this is a **published
22
+ * contract** an external client codes against, so it must be free to stay still
23
+ * while the editor's internal shape moves. The two happen to agree today, and
24
+ * the *validators* are shared (`IsRelationDeltaMap` is imported, not restated)
25
+ * so the accepted delta shape cannot drift — only the documented surface is
26
+ * duplicated.
27
+ *
28
+ * What is deliberately NOT settable here: `status`, `publishedAt`, `deletedAt`.
29
+ * Publishing is its own route with its own permission, and the other two are
30
+ * stamped by the server. `toColumns` projects only keys declared on the type, so
31
+ * a reserved key in `values` is dropped before storage rather than honoured.
32
+ */
33
+ class PublicSaveEntryDto {
34
+ /** Field values keyed by field name. */
35
+ values;
36
+ /**
37
+ * Per-field relation deltas — the assign / unassign half of the write API.
38
+ * Many and inverse relations only; an owning single relation is set through
39
+ * `values`.
40
+ */
41
+ relations;
42
+ /**
43
+ * Locale the created row is written in — **create only**; an update never
44
+ * re-homes a row's locale.
45
+ */
46
+ locale;
47
+ /**
48
+ * The translation group a created row joins — how a **new translation of an
49
+ * existing record** is written. Create only.
50
+ */
51
+ localeGroupId;
52
+ }
53
+ exports.PublicSaveEntryDto = PublicSaveEntryDto;
54
+ tslib_1.__decorate([
55
+ (0, swagger_1.ApiProperty)({
56
+ type: 'object',
57
+ additionalProperties: true,
58
+ example: { title: 'Hello world', coverImage: null },
59
+ description: 'Field values keyed by field name — the per-type contract, so this is structurally just an object. Contents are validated against the content type’s field specs (a failure is a 422 carrying per-field issues). A **media** field takes asset ids (one, or an array) from `POST /v1/media/assets`; an id the workspace does not own, or one the field’s `accept` rule excludes, is a 422. An owning **single** relation is set here by target id. Reserved envelope keys (`status`, `publishedAt`, `deletedAt`, `locale`, `localeGroupId`) are not settable.'
60
+ }),
61
+ (0, class_validator_1.IsObject)(),
62
+ tslib_1.__metadata("design:type", Object)
63
+ ], PublicSaveEntryDto.prototype, "values", void 0);
64
+ tslib_1.__decorate([
65
+ (0, swagger_1.ApiPropertyOptional)({
66
+ type: 'object',
67
+ maxProperties: relation_delta_map_validator_1.MAX_DELTA_FIELDS,
68
+ additionalProperties: {
69
+ type: 'object',
70
+ properties: {
71
+ link: UUID_ARRAY_SCHEMA,
72
+ unlink: UUID_ARRAY_SCHEMA,
73
+ order: UUID_ARRAY_SCHEMA,
74
+ by: { type: 'string', enum: ['id', 'localeGroup'] }
75
+ },
76
+ additionalProperties: false
77
+ },
78
+ example: {
79
+ tags: {
80
+ link: ['9c4b1e77-2f0a-4d3b-8e6c-1a5f7b2d9e04'],
81
+ unlink: ['1f9a3c55-7b21-4e08-9d4a-6c2e8b1f0a37']
82
+ }
83
+ },
84
+ description: `Relation changes, keyed by relation field: \`link\` assigns, \`unlink\` unassigns, \`order\` reorders. A **delta**, not a replacement — ids you do not mention are left alone, so a record with thousands of links never has to be sent whole. Many-to-many and inverse relations only; naming an owning single relation here is a 400 (set it through \`values\`). At most ${relation_delta_map_validator_1.MAX_DELTA_FIELDS} fields per save and ${relation_delta_map_validator_1.MAX_DELTA_IDS} ids per array; \`order\` is accepted on the owning side only. Every id must name an entry in the same workspace, or the save is a 422.\n\n**Locales.** When both this type and the target are localized, a link may not cross locales — the English article links the English tag — and a target in another locale is a 422. Set \`by: "localeGroup"\` to pass **translation group** ids instead of entry ids: each is resolved to that group's row in this entry's own locale, so a client that thinks in stories never has to keep a per-locale id map. A group with no row in this locale is a 422 telling you to translate it first.`
85
+ }),
86
+ (0, class_validator_1.IsOptional)(),
87
+ (0, class_validator_1.IsObject)(),
88
+ (0, relation_delta_map_validator_1.IsRelationDeltaMap)(),
89
+ tslib_1.__metadata("design:type", Object)
90
+ ], PublicSaveEntryDto.prototype, "relations", void 0);
91
+ tslib_1.__decorate([
92
+ (0, swagger_1.ApiPropertyOptional)({
93
+ type: String,
94
+ maxLength: LOCALE_MAX_LENGTH,
95
+ example: 'de',
96
+ description: 'Locale slug the entry is created in; absent means the configured default. An unknown slug is a 400. **Create only** — an update never re-homes a row’s locale, and sending it there is ignored. Ignored on types that are not localized.'
97
+ }),
98
+ (0, class_validator_1.IsOptional)(),
99
+ (0, class_validator_1.IsString)(),
100
+ (0, class_validator_1.MaxLength)(LOCALE_MAX_LENGTH),
101
+ tslib_1.__metadata("design:type", String)
102
+ ], PublicSaveEntryDto.prototype, "locale", void 0);
103
+ tslib_1.__decorate([
104
+ (0, swagger_1.ApiPropertyOptional)({
105
+ type: String,
106
+ format: 'uuid',
107
+ description: 'The existing translation group the new row joins, making it a sibling translation — this is how you add a locale to a record you already have (take `localeGroupId` off any read, POST with it plus a different `locale`). Absent → the row starts its own fresh group. An unknown group is a 404; a locale the group already holds is a 409. **Create only.**'
108
+ }),
109
+ (0, class_validator_1.IsOptional)(),
110
+ (0, class_validator_1.IsUUID)(),
111
+ tslib_1.__metadata("design:type", String)
112
+ ], PublicSaveEntryDto.prototype, "localeGroupId", void 0);
@@ -0,0 +1,25 @@
1
+ import { CanActivate, ExecutionContext } from '@nestjs/common';
2
+ /**
3
+ * Resolves which of a token's workspaces a public-API request targets, and
4
+ * stamps it on the request for `@CurrentWorkspace()` — the token-authenticated
5
+ * counterpart of workspaces' membership-based `WorkspaceGuard`.
6
+ *
7
+ * The rule:
8
+ *
9
+ * - `X-Workspace-Id` present → it must be well-formed (400) **and** in the
10
+ * token's bucket (403). A token can never read a workspace it wasn't minted
11
+ * for, whatever the header says.
12
+ * - Header absent, token covers exactly one workspace → that workspace. A
13
+ * single-workspace token needs no header at all, which is what makes the
14
+ * common case a one-line fetch.
15
+ * - Header absent, token covers several → 400. Guessing would silently pick a
16
+ * workspace for the caller, and "why is this empty?" is a much worse failure
17
+ * than an explicit error.
18
+ *
19
+ * Runs **after** {@link ApiTokenGuard} (which attaches `request.apiToken`);
20
+ * reaching it without a token is a wiring bug, not an unauthenticated caller.
21
+ */
22
+ export declare class ApiTokenWorkspaceGuard implements CanActivate {
23
+ canActivate(context: ExecutionContext): boolean;
24
+ }
25
+ //# sourceMappingURL=api-token-workspace.guard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-token-workspace.guard.d.ts","sourceRoot":"","sources":["../../../../../src/lib/public-api/http/guards/api-token-workspace.guard.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,WAAW,EACX,gBAAgB,EAInB,MAAM,gBAAgB,CAAC;AAOxB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBACa,sBAAuB,YAAW,WAAW;IACtD,WAAW,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO;CAmClD"}
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ApiTokenWorkspaceGuard = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const common_1 = require("@nestjs/common");
6
+ const workspaces_server_1 = require("@orthacms/workspaces-server");
7
+ /**
8
+ * Resolves which of a token's workspaces a public-API request targets, and
9
+ * stamps it on the request for `@CurrentWorkspace()` — the token-authenticated
10
+ * counterpart of workspaces' membership-based `WorkspaceGuard`.
11
+ *
12
+ * The rule:
13
+ *
14
+ * - `X-Workspace-Id` present → it must be well-formed (400) **and** in the
15
+ * token's bucket (403). A token can never read a workspace it wasn't minted
16
+ * for, whatever the header says.
17
+ * - Header absent, token covers exactly one workspace → that workspace. A
18
+ * single-workspace token needs no header at all, which is what makes the
19
+ * common case a one-line fetch.
20
+ * - Header absent, token covers several → 400. Guessing would silently pick a
21
+ * workspace for the caller, and "why is this empty?" is a much worse failure
22
+ * than an explicit error.
23
+ *
24
+ * Runs **after** {@link ApiTokenGuard} (which attaches `request.apiToken`);
25
+ * reaching it without a token is a wiring bug, not an unauthenticated caller.
26
+ */
27
+ let ApiTokenWorkspaceGuard = class ApiTokenWorkspaceGuard {
28
+ canActivate(context) {
29
+ const request = context.switchToHttp().getRequest();
30
+ const token = request.apiToken;
31
+ if (!token) {
32
+ throw new common_1.UnauthorizedException();
33
+ }
34
+ const header = request.headers[workspaces_server_1.WORKSPACE_HEADER];
35
+ const requested = Array.isArray(header) ? header[0] : header;
36
+ if (!requested) {
37
+ if (token.workspaceIds.length === 1) {
38
+ request.workspaceId = token.workspaceIds[0];
39
+ return true;
40
+ }
41
+ throw new common_1.BadRequestException(`This token covers ${token.workspaceIds.length} workspaces — name the one you want with the X-Workspace-Id header.`);
42
+ }
43
+ if (!workspaces_server_1.WORKSPACE_ID_PATTERN.test(requested)) {
44
+ throw new common_1.BadRequestException('Malformed X-Workspace-Id header.');
45
+ }
46
+ if (!token.workspaceIds.includes(requested)) {
47
+ // Not-in-bucket and no-such-workspace are the same 403, so a token
48
+ // can't be used to probe which workspace ids exist.
49
+ throw new common_1.ForbiddenException('This token does not cover that workspace.');
50
+ }
51
+ request.workspaceId = requested;
52
+ return true;
53
+ }
54
+ };
55
+ exports.ApiTokenWorkspaceGuard = ApiTokenWorkspaceGuard;
56
+ exports.ApiTokenWorkspaceGuard = ApiTokenWorkspaceGuard = tslib_1.__decorate([
57
+ (0, common_1.Injectable)()
58
+ ], ApiTokenWorkspaceGuard);