@orthacms/content-server 0.4.2 → 0.5.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 (246) hide show
  1. package/dist/index.d.ts +16 -0
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +41 -1
  4. package/dist/lib/content.module.d.ts.map +1 -1
  5. package/dist/lib/content.module.js +31 -1
  6. package/dist/lib/copilot/entry-proposal.applier.d.ts.map +1 -1
  7. package/dist/lib/copilot/entry-proposal.applier.js +5 -4
  8. package/dist/lib/docs/describe-content-api.d.ts +7 -0
  9. package/dist/lib/docs/describe-content-api.d.ts.map +1 -1
  10. package/dist/lib/docs/describe-content-api.js +177 -53
  11. package/dist/lib/docs/describe-views-api.d.ts +19 -0
  12. package/dist/lib/docs/describe-views-api.d.ts.map +1 -0
  13. package/dist/lib/docs/describe-views-api.js +76 -0
  14. package/dist/lib/docs/field-schema.d.ts.map +1 -1
  15. package/dist/lib/docs/field-schema.js +36 -2
  16. package/dist/lib/docs/openapi-writer.d.ts +49 -0
  17. package/dist/lib/docs/openapi-writer.d.ts.map +1 -0
  18. package/dist/lib/docs/openapi-writer.js +76 -0
  19. package/dist/lib/docs/public-api-schemas.d.ts +45 -0
  20. package/dist/lib/docs/public-api-schemas.d.ts.map +1 -0
  21. package/dist/lib/docs/public-api-schemas.js +377 -0
  22. package/dist/lib/docs/views-schemas.d.ts +22 -0
  23. package/dist/lib/docs/views-schemas.d.ts.map +1 -0
  24. package/dist/lib/docs/views-schemas.js +156 -0
  25. package/dist/lib/entries/application/use-cases/bulk-publish-entries.use-case.d.ts +8 -2
  26. package/dist/lib/entries/application/use-cases/bulk-publish-entries.use-case.d.ts.map +1 -1
  27. package/dist/lib/entries/application/use-cases/bulk-publish-entries.use-case.js +19 -4
  28. package/dist/lib/entries/application/use-cases/bulk-unpublish-entries.use-case.d.ts +2 -2
  29. package/dist/lib/entries/application/use-cases/bulk-unpublish-entries.use-case.d.ts.map +1 -1
  30. package/dist/lib/entries/application/use-cases/bulk-unpublish-entries.use-case.js +14 -4
  31. package/dist/lib/entries/application/use-cases/publish-entry.use-case.d.ts +6 -8
  32. package/dist/lib/entries/application/use-cases/publish-entry.use-case.d.ts.map +1 -1
  33. package/dist/lib/entries/application/use-cases/publish-entry.use-case.js +10 -4
  34. package/dist/lib/entries/application/use-cases/unpublish-entry.use-case.d.ts +2 -5
  35. package/dist/lib/entries/application/use-cases/unpublish-entry.use-case.d.ts.map +1 -1
  36. package/dist/lib/entries/application/use-cases/unpublish-entry.use-case.js +6 -1
  37. package/dist/lib/entries/domain/entry.d.ts +8 -1
  38. package/dist/lib/entries/domain/entry.d.ts.map +1 -1
  39. package/dist/lib/entries/domain/entry.js +12 -12
  40. package/dist/lib/entries/domain/events/entry-events.d.ts +47 -5
  41. package/dist/lib/entries/domain/events/entry-events.d.ts.map +1 -1
  42. package/dist/lib/entries/domain/events/entry-events.js +26 -10
  43. package/dist/lib/entries/entries.constants.d.ts +10 -2
  44. package/dist/lib/entries/entries.constants.d.ts.map +1 -1
  45. package/dist/lib/entries/entries.constants.js +11 -2
  46. package/dist/lib/entries/http/controllers/bulk-entries.controller.d.ts +2 -2
  47. package/dist/lib/entries/http/controllers/bulk-entries.controller.d.ts.map +1 -1
  48. package/dist/lib/entries/http/controllers/bulk-entries.controller.js +8 -6
  49. package/dist/lib/entries/http/controllers/create-entry.controller.d.ts.map +1 -1
  50. package/dist/lib/entries/http/controllers/create-entry.controller.js +1 -1
  51. package/dist/lib/entries/http/controllers/update-entry.controller.d.ts.map +1 -1
  52. package/dist/lib/entries/http/controllers/update-entry.controller.js +1 -1
  53. package/dist/lib/entries/http/dto/extension-bag.validator.d.ts +14 -0
  54. package/dist/lib/entries/http/dto/extension-bag.validator.d.ts.map +1 -0
  55. package/dist/lib/entries/http/dto/extension-bag.validator.js +42 -0
  56. package/dist/lib/entries/http/dto/save-entry.dto.d.ts +16 -0
  57. package/dist/lib/entries/http/dto/save-entry.dto.d.ts.map +1 -1
  58. package/dist/lib/entries/http/dto/save-entry.dto.js +30 -0
  59. package/dist/lib/entries/infrastructure/persistence/entry-writer.service.d.ts +50 -8
  60. package/dist/lib/entries/infrastructure/persistence/entry-writer.service.d.ts.map +1 -1
  61. package/dist/lib/entries/infrastructure/persistence/entry-writer.service.js +183 -32
  62. package/dist/lib/entries/infrastructure/persistence/relation-link.service.d.ts +38 -5
  63. package/dist/lib/entries/infrastructure/persistence/relation-link.service.d.ts.map +1 -1
  64. package/dist/lib/entries/infrastructure/persistence/relation-link.service.js +38 -6
  65. package/dist/lib/entries/infrastructure/queries/entries.service.d.ts +3 -1
  66. package/dist/lib/entries/infrastructure/queries/entries.service.d.ts.map +1 -1
  67. package/dist/lib/entries/infrastructure/queries/entries.service.js +17 -5
  68. package/dist/lib/entries/infrastructure/queries/entry-match.query.d.ts +82 -0
  69. package/dist/lib/entries/infrastructure/queries/entry-match.query.d.ts.map +1 -0
  70. package/dist/lib/entries/infrastructure/queries/entry-match.query.js +152 -0
  71. package/dist/lib/extension/entry-filter-provider.d.ts +79 -0
  72. package/dist/lib/extension/entry-filter-provider.d.ts.map +1 -0
  73. package/dist/lib/extension/entry-filter-provider.js +149 -0
  74. package/dist/lib/extension/entry-write-extension.d.ts +185 -0
  75. package/dist/lib/extension/entry-write-extension.d.ts.map +1 -0
  76. package/dist/lib/extension/entry-write-extension.js +182 -0
  77. package/dist/lib/extension/read-scope.d.ts +107 -0
  78. package/dist/lib/extension/read-scope.d.ts.map +1 -0
  79. package/dist/lib/extension/read-scope.js +131 -0
  80. package/dist/lib/insights/docs/describe-content-insights-api.d.ts +23 -0
  81. package/dist/lib/insights/docs/describe-content-insights-api.d.ts.map +1 -0
  82. package/dist/lib/insights/docs/describe-content-insights-api.js +329 -0
  83. package/dist/lib/mcp/content-tools.provider.d.ts.map +1 -1
  84. package/dist/lib/mcp/content-tools.provider.js +10 -9
  85. package/dist/lib/public-api/http/controllers/public-entry-writes.controller.d.ts +14 -13
  86. package/dist/lib/public-api/http/controllers/public-entry-writes.controller.d.ts.map +1 -1
  87. package/dist/lib/public-api/http/controllers/public-entry-writes.controller.js +62 -46
  88. package/dist/lib/public-api/http/guards/api-token-workspace.guard.d.ts.map +1 -1
  89. package/dist/lib/public-api/http/guards/api-token-workspace.guard.js +8 -0
  90. package/dist/lib/public-api/infrastructure/public-entries.query.d.ts +14 -1
  91. package/dist/lib/public-api/infrastructure/public-entries.query.d.ts.map +1 -1
  92. package/dist/lib/public-api/infrastructure/public-entries.query.js +20 -3
  93. package/dist/lib/public-api/infrastructure/public-entry-writes.service.d.ts +10 -9
  94. package/dist/lib/public-api/infrastructure/public-entry-writes.service.d.ts.map +1 -1
  95. package/dist/lib/public-api/infrastructure/public-entry-writes.service.js +23 -24
  96. package/dist/lib/public-api/infrastructure/public-expansion.query.d.ts +16 -4
  97. package/dist/lib/public-api/infrastructure/public-expansion.query.d.ts.map +1 -1
  98. package/dist/lib/public-api/infrastructure/public-expansion.query.js +29 -9
  99. package/dist/lib/public-api/infrastructure/token-actor.d.ts +37 -0
  100. package/dist/lib/public-api/infrastructure/token-actor.d.ts.map +1 -0
  101. package/dist/lib/public-api/infrastructure/token-actor.js +58 -0
  102. package/dist/lib/revisions/application/use-cases/restore-revision.use-case.d.ts.map +1 -1
  103. package/dist/lib/revisions/application/use-cases/restore-revision.use-case.js +23 -1
  104. package/dist/lib/revisions/infrastructure/persistence/revision-snapshot.d.ts +7 -1
  105. package/dist/lib/revisions/infrastructure/persistence/revision-snapshot.d.ts.map +1 -1
  106. package/dist/lib/revisions/infrastructure/persistence/revision-snapshot.js +9 -2
  107. package/dist/lib/revisions/infrastructure/purge/revisions-workspace.purger.d.ts +28 -0
  108. package/dist/lib/revisions/infrastructure/purge/revisions-workspace.purger.d.ts.map +1 -0
  109. package/dist/lib/revisions/infrastructure/purge/revisions-workspace.purger.js +52 -0
  110. package/dist/lib/revisions/types/revision-view.d.ts +11 -0
  111. package/dist/lib/revisions/types/revision-view.d.ts.map +1 -1
  112. package/dist/lib/utils/content-plugin.d.ts.map +1 -1
  113. package/dist/lib/utils/content-plugin.js +10 -1
  114. package/dist/lib/utils/content-views-plugin.d.ts +28 -0
  115. package/dist/lib/utils/content-views-plugin.d.ts.map +1 -0
  116. package/dist/lib/utils/content-views-plugin.js +37 -0
  117. package/dist/lib/views/application/queries/saved-views.query.d.ts +16 -0
  118. package/dist/lib/views/application/queries/saved-views.query.d.ts.map +1 -0
  119. package/dist/lib/views/application/queries/saved-views.query.js +46 -0
  120. package/dist/lib/views/application/saved-view-access.service.d.ts +30 -0
  121. package/dist/lib/views/application/saved-view-access.service.d.ts.map +1 -0
  122. package/dist/lib/views/application/saved-view-access.service.js +55 -0
  123. package/dist/lib/views/application/use-cases/create-saved-view.use-case.d.ts +30 -0
  124. package/dist/lib/views/application/use-cases/create-saved-view.use-case.d.ts.map +1 -0
  125. package/dist/lib/views/application/use-cases/create-saved-view.use-case.js +81 -0
  126. package/dist/lib/views/application/use-cases/delete-saved-view.use-case.d.ts +18 -0
  127. package/dist/lib/views/application/use-cases/delete-saved-view.use-case.d.ts.map +1 -0
  128. package/dist/lib/views/application/use-cases/delete-saved-view.use-case.js +56 -0
  129. package/dist/lib/views/application/use-cases/set-default-view.use-case.d.ts +23 -0
  130. package/dist/lib/views/application/use-cases/set-default-view.use-case.d.ts.map +1 -0
  131. package/dist/lib/views/application/use-cases/set-default-view.use-case.js +51 -0
  132. package/dist/lib/views/application/use-cases/update-saved-view.use-case.d.ts +24 -0
  133. package/dist/lib/views/application/use-cases/update-saved-view.use-case.d.ts.map +1 -0
  134. package/dist/lib/views/application/use-cases/update-saved-view.use-case.js +90 -0
  135. package/dist/lib/views/application/view-scope.service.d.ts +25 -0
  136. package/dist/lib/views/application/view-scope.service.d.ts.map +1 -0
  137. package/dist/lib/views/application/view-scope.service.js +45 -0
  138. package/dist/lib/views/content-views.module.d.ts +22 -0
  139. package/dist/lib/views/content-views.module.d.ts.map +1 -0
  140. package/dist/lib/views/content-views.module.js +63 -0
  141. package/dist/lib/views/domain/errors/index.d.ts +6 -0
  142. package/dist/lib/views/domain/errors/index.d.ts.map +1 -0
  143. package/dist/lib/views/domain/errors/index.js +12 -0
  144. package/dist/lib/views/domain/errors/saved-view-forbidden.error.d.ts +10 -0
  145. package/dist/lib/views/domain/errors/saved-view-forbidden.error.d.ts.map +1 -0
  146. package/dist/lib/views/domain/errors/saved-view-forbidden.error.js +16 -0
  147. package/dist/lib/views/domain/errors/saved-view-limit-error.d.ts +9 -0
  148. package/dist/lib/views/domain/errors/saved-view-limit-error.d.ts.map +1 -0
  149. package/dist/lib/views/domain/errors/saved-view-limit-error.js +16 -0
  150. package/dist/lib/views/domain/errors/saved-view-name-taken.error.d.ts +5 -0
  151. package/dist/lib/views/domain/errors/saved-view-name-taken.error.d.ts.map +1 -0
  152. package/dist/lib/views/domain/errors/saved-view-name-taken.error.js +11 -0
  153. package/dist/lib/views/domain/errors/saved-view-not-found.error.d.ts +9 -0
  154. package/dist/lib/views/domain/errors/saved-view-not-found.error.d.ts.map +1 -0
  155. package/dist/lib/views/domain/errors/saved-view-not-found.error.js +15 -0
  156. package/dist/lib/views/domain/events/saved-view-events.d.ts +28 -0
  157. package/dist/lib/views/domain/events/saved-view-events.d.ts.map +1 -0
  158. package/dist/lib/views/domain/events/saved-view-events.js +38 -0
  159. package/dist/lib/views/domain/saved-view.d.ts +66 -0
  160. package/dist/lib/views/domain/saved-view.d.ts.map +1 -0
  161. package/dist/lib/views/domain/saved-view.js +18 -0
  162. package/dist/lib/views/domain/saved-view.repository.d.ts +77 -0
  163. package/dist/lib/views/domain/saved-view.repository.d.ts.map +1 -0
  164. package/dist/lib/views/domain/saved-view.repository.js +5 -0
  165. package/dist/lib/views/http/controllers/saved-views.controller.d.ts +45 -0
  166. package/dist/lib/views/http/controllers/saved-views.controller.d.ts.map +1 -0
  167. package/dist/lib/views/http/controllers/saved-views.controller.js +216 -0
  168. package/dist/lib/views/http/controllers/to-http-error.d.ts +10 -0
  169. package/dist/lib/views/http/controllers/to-http-error.d.ts.map +1 -0
  170. package/dist/lib/views/http/controllers/to-http-error.js +26 -0
  171. package/dist/lib/views/http/dto/save-view.dto.d.ts +54 -0
  172. package/dist/lib/views/http/dto/save-view.dto.d.ts.map +1 -0
  173. package/dist/lib/views/http/dto/save-view.dto.js +230 -0
  174. package/dist/lib/views/http/dto/view-payload.validator.d.ts +20 -0
  175. package/dist/lib/views/http/dto/view-payload.validator.d.ts.map +1 -0
  176. package/dist/lib/views/http/dto/view-payload.validator.js +52 -0
  177. package/dist/lib/views/infrastructure/persistence/drizzle-saved-view.repository.d.ts +26 -0
  178. package/dist/lib/views/infrastructure/persistence/drizzle-saved-view.repository.d.ts.map +1 -0
  179. package/dist/lib/views/infrastructure/persistence/drizzle-saved-view.repository.js +135 -0
  180. package/dist/lib/views/infrastructure/schema/external-refs.d.ts +68 -0
  181. package/dist/lib/views/infrastructure/schema/external-refs.d.ts.map +1 -0
  182. package/dist/lib/views/infrastructure/schema/external-refs.js +29 -0
  183. package/dist/lib/views/infrastructure/schema/index.d.ts +8 -0
  184. package/dist/lib/views/infrastructure/schema/index.d.ts.map +1 -0
  185. package/dist/lib/views/infrastructure/schema/index.js +13 -0
  186. package/dist/lib/views/infrastructure/schema/saved-views.d.ts +275 -0
  187. package/dist/lib/views/infrastructure/schema/saved-views.d.ts.map +1 -0
  188. package/dist/lib/views/infrastructure/schema/saved-views.js +87 -0
  189. package/dist/lib/views/views.constants.d.ts +26 -0
  190. package/dist/lib/views/views.constants.d.ts.map +1 -0
  191. package/dist/lib/views/views.constants.js +28 -0
  192. package/dist/lib/views/views.tokens.d.ts +17 -0
  193. package/dist/lib/views/views.tokens.d.ts.map +1 -0
  194. package/dist/lib/views/views.tokens.js +21 -0
  195. package/migrations/0000_saved_views.sql +29 -0
  196. package/migrations/meta/0000_snapshot.json +256 -0
  197. package/migrations/meta/_journal.json +13 -0
  198. package/package.json +13 -12
  199. package/dist/lib/entries/controllers/bulk-entries.controller.d.ts +0 -26
  200. package/dist/lib/entries/controllers/bulk-entries.controller.d.ts.map +0 -1
  201. package/dist/lib/entries/controllers/create-entry.controller.d.ts +0 -20
  202. package/dist/lib/entries/controllers/create-entry.controller.d.ts.map +0 -1
  203. package/dist/lib/entries/controllers/delete-entry.controller.d.ts +0 -24
  204. package/dist/lib/entries/controllers/delete-entry.controller.d.ts.map +0 -1
  205. package/dist/lib/entries/controllers/get-entry.controller.d.ts +0 -34
  206. package/dist/lib/entries/controllers/get-entry.controller.d.ts.map +0 -1
  207. package/dist/lib/entries/controllers/list-entries.controller.d.ts +0 -20
  208. package/dist/lib/entries/controllers/list-entries.controller.d.ts.map +0 -1
  209. package/dist/lib/entries/controllers/publish-entry.controller.d.ts +0 -19
  210. package/dist/lib/entries/controllers/publish-entry.controller.d.ts.map +0 -1
  211. package/dist/lib/entries/controllers/resolve-type.d.ts +0 -9
  212. package/dist/lib/entries/controllers/resolve-type.d.ts.map +0 -1
  213. package/dist/lib/entries/controllers/update-entry.controller.d.ts +0 -18
  214. package/dist/lib/entries/controllers/update-entry.controller.d.ts.map +0 -1
  215. package/dist/lib/entries/dto/bulk-ids.dto.d.ts +0 -11
  216. package/dist/lib/entries/dto/bulk-ids.dto.d.ts.map +0 -1
  217. package/dist/lib/entries/dto/list-entries-query.dto.d.ts +0 -46
  218. package/dist/lib/entries/dto/list-entries-query.dto.d.ts.map +0 -1
  219. package/dist/lib/entries/dto/relation-delta-map.validator.d.ts +0 -19
  220. package/dist/lib/entries/dto/relation-delta-map.validator.d.ts.map +0 -1
  221. package/dist/lib/entries/dto/save-entry.dto.d.ts +0 -46
  222. package/dist/lib/entries/dto/save-entry.dto.d.ts.map +0 -1
  223. package/dist/lib/entries/infrastructure/persistence/field-selection.d.ts +0 -24
  224. package/dist/lib/entries/infrastructure/persistence/field-selection.d.ts.map +0 -1
  225. package/dist/lib/entries/infrastructure/queries/entry-filter-schema.d.ts +0 -40
  226. package/dist/lib/entries/infrastructure/queries/entry-filter-schema.d.ts.map +0 -1
  227. package/dist/lib/entries/services/entries.service.d.ts +0 -59
  228. package/dist/lib/entries/services/entries.service.d.ts.map +0 -1
  229. package/dist/lib/entries/services/entry-counter.service.d.ts +0 -31
  230. package/dist/lib/entries/services/entry-counter.service.d.ts.map +0 -1
  231. package/dist/lib/entries/services/entry-filter-schema.d.ts +0 -32
  232. package/dist/lib/entries/services/entry-filter-schema.d.ts.map +0 -1
  233. package/dist/lib/entries/services/entry-row.d.ts +0 -56
  234. package/dist/lib/entries/services/entry-row.d.ts.map +0 -1
  235. package/dist/lib/entries/services/entry-writer.service.d.ts +0 -193
  236. package/dist/lib/entries/services/entry-writer.service.d.ts.map +0 -1
  237. package/dist/lib/entries/services/relation-link.service.d.ts +0 -115
  238. package/dist/lib/entries/services/relation-link.service.d.ts.map +0 -1
  239. package/dist/lib/extension/per-locale-relation.d.ts +0 -18
  240. package/dist/lib/extension/per-locale-relation.d.ts.map +0 -1
  241. package/dist/lib/public/controllers/get-public-entry.controller.d.ts +0 -26
  242. package/dist/lib/public/controllers/get-public-entry.controller.d.ts.map +0 -1
  243. package/dist/lib/public/controllers/list-public-entries.controller.d.ts +0 -24
  244. package/dist/lib/public/controllers/list-public-entries.controller.d.ts.map +0 -1
  245. package/dist/lib/public/controllers/public-schema.controller.d.ts +0 -18
  246. package/dist/lib/public/controllers/public-schema.controller.d.ts.map +0 -1
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ /** Limits and scope rules for saved list views. */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.VIEW_MAX_PER_SCOPE = exports.VIEW_EXTRA_MAX_LENGTH = exports.VIEW_MAX_EXTRA_KEYS = exports.VIEW_COLUMN_MAX_LENGTH = exports.VIEW_MAX_COLUMNS = exports.CONTENT_SCOPE_PREFIX = exports.VIEW_SCOPE_MAX_LENGTH = exports.VIEW_NAME_MAX_LENGTH = void 0;
5
+ /** Longest accepted view name. */
6
+ exports.VIEW_NAME_MAX_LENGTH = 80;
7
+ /**
8
+ * Longest accepted `scope` key. A scope names the list a view belongs to —
9
+ * `content:<typeName>` today, `users:members` when the switcher reaches the
10
+ * other list pages. Kept generous enough for a long content-type name.
11
+ */
12
+ exports.VIEW_SCOPE_MAX_LENGTH = 128;
13
+ /**
14
+ * The scopes this endpoint accepts, as a prefix. v1 only serves content
15
+ * collections; anything else is refused at the DTO so a typo can't quietly
16
+ * create a view nothing will ever read.
17
+ */
18
+ exports.CONTENT_SCOPE_PREFIX = 'content:';
19
+ /** Max columns a payload may pin — bounds the stored array. */
20
+ exports.VIEW_MAX_COLUMNS = 100;
21
+ /** Max length of one column id inside a payload. */
22
+ exports.VIEW_COLUMN_MAX_LENGTH = 128;
23
+ /** Max slot-owned list params (`extra`) a payload may carry. */
24
+ exports.VIEW_MAX_EXTRA_KEYS = 20;
25
+ /** Max length of an `extra` key or value. */
26
+ exports.VIEW_EXTRA_MAX_LENGTH = 255;
27
+ /** Max saved views one user may hold in a single workspace + scope. */
28
+ exports.VIEW_MAX_PER_SCOPE = 100;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * The content-type registry, as the **views** module provides it.
3
+ *
4
+ * A token of its own rather than reusing `CONTENT_REGISTRY`: both modules are
5
+ * `global: true`, and two global modules providing the same token put one in
6
+ * the position of silently shadowing the other in Nest's global registry. The
7
+ * value is the same registry instance either way, so nothing would break today
8
+ * — but "which module wins" is not a question a reader of either file can
9
+ * answer, and the answer would change with registration order.
10
+ *
11
+ * Dependency-free by design, so providers reference it without an import cycle
12
+ * with the module.
13
+ */
14
+ export declare const VIEW_CONTENT_REGISTRY: unique symbol;
15
+ /** Injects the registry the views module was constructed with. */
16
+ export declare const InjectViewContentRegistry: () => ParameterDecorator;
17
+ //# sourceMappingURL=views.tokens.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"views.tokens.d.ts","sourceRoot":"","sources":["../../../src/lib/views/views.tokens.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,qBAAqB,eAAkC,CAAC;AAErE,kEAAkE;AAClE,eAAO,MAAM,yBAAyB,QAAO,kBACZ,CAAC"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InjectViewContentRegistry = exports.VIEW_CONTENT_REGISTRY = void 0;
4
+ const common_1 = require("@nestjs/common");
5
+ /**
6
+ * The content-type registry, as the **views** module provides it.
7
+ *
8
+ * A token of its own rather than reusing `CONTENT_REGISTRY`: both modules are
9
+ * `global: true`, and two global modules providing the same token put one in
10
+ * the position of silently shadowing the other in Nest's global registry. The
11
+ * value is the same registry instance either way, so nothing would break today
12
+ * — but "which module wins" is not a question a reader of either file can
13
+ * answer, and the answer would change with registration order.
14
+ *
15
+ * Dependency-free by design, so providers reference it without an import cycle
16
+ * with the module.
17
+ */
18
+ exports.VIEW_CONTENT_REGISTRY = Symbol('VIEW_CONTENT_REGISTRY');
19
+ /** Injects the registry the views module was constructed with. */
20
+ const InjectViewContentRegistry = () => (0, common_1.Inject)(exports.VIEW_CONTENT_REGISTRY);
21
+ exports.InjectViewContentRegistry = InjectViewContentRegistry;
@@ -0,0 +1,29 @@
1
+ CREATE TYPE "public"."view_visibility" AS ENUM('private', 'workspace');--> statement-breakpoint
2
+ CREATE TABLE "saved_view_defaults" (
3
+ "user_id" uuid NOT NULL,
4
+ "scope" text NOT NULL,
5
+ "view_id" uuid NOT NULL,
6
+ "updated_at" timestamp with time zone DEFAULT now() NOT NULL,
7
+ CONSTRAINT "saved_view_defaults_user_id_scope_pk" PRIMARY KEY("user_id","scope")
8
+ );
9
+ --> statement-breakpoint
10
+ CREATE TABLE "saved_views" (
11
+ "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
12
+ "workspace_id" uuid NOT NULL,
13
+ "scope" text NOT NULL,
14
+ "owner_id" uuid NOT NULL,
15
+ "visibility" "view_visibility" DEFAULT 'private' NOT NULL,
16
+ "name" text NOT NULL,
17
+ "payload" jsonb NOT NULL,
18
+ "position" integer DEFAULT 0 NOT NULL,
19
+ "created_at" timestamp with time zone DEFAULT now() NOT NULL,
20
+ "updated_at" timestamp with time zone DEFAULT now() NOT NULL,
21
+ CONSTRAINT "saved_views_owner_name_unique" UNIQUE("workspace_id","scope","owner_id","name")
22
+ );
23
+ --> statement-breakpoint
24
+ ALTER TABLE "saved_view_defaults" ADD CONSTRAINT "saved_view_defaults_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
25
+ ALTER TABLE "saved_view_defaults" ADD CONSTRAINT "saved_view_defaults_view_id_saved_views_id_fk" FOREIGN KEY ("view_id") REFERENCES "public"."saved_views"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
26
+ ALTER TABLE "saved_views" ADD CONSTRAINT "saved_views_workspace_id_workspaces_id_fk" FOREIGN KEY ("workspace_id") REFERENCES "public"."workspaces"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
27
+ ALTER TABLE "saved_views" ADD CONSTRAINT "saved_views_owner_id_users_id_fk" FOREIGN KEY ("owner_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
28
+ CREATE INDEX "saved_view_defaults_view_id_idx" ON "saved_view_defaults" USING btree ("view_id");--> statement-breakpoint
29
+ CREATE INDEX "saved_views_workspace_scope_idx" ON "saved_views" USING btree ("workspace_id","scope");
@@ -0,0 +1,256 @@
1
+ {
2
+ "id": "ab74f936-4815-4be9-8eeb-e9a6aa353189",
3
+ "prevId": "00000000-0000-0000-0000-000000000000",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.saved_view_defaults": {
8
+ "name": "saved_view_defaults",
9
+ "schema": "",
10
+ "columns": {
11
+ "user_id": {
12
+ "name": "user_id",
13
+ "type": "uuid",
14
+ "primaryKey": false,
15
+ "notNull": true
16
+ },
17
+ "scope": {
18
+ "name": "scope",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": true
22
+ },
23
+ "view_id": {
24
+ "name": "view_id",
25
+ "type": "uuid",
26
+ "primaryKey": false,
27
+ "notNull": true
28
+ },
29
+ "updated_at": {
30
+ "name": "updated_at",
31
+ "type": "timestamp with time zone",
32
+ "primaryKey": false,
33
+ "notNull": true,
34
+ "default": "now()"
35
+ }
36
+ },
37
+ "indexes": {
38
+ "saved_view_defaults_view_id_idx": {
39
+ "name": "saved_view_defaults_view_id_idx",
40
+ "columns": [
41
+ {
42
+ "expression": "view_id",
43
+ "isExpression": false,
44
+ "asc": true,
45
+ "nulls": "last"
46
+ }
47
+ ],
48
+ "isUnique": false,
49
+ "concurrently": false,
50
+ "method": "btree",
51
+ "with": {}
52
+ }
53
+ },
54
+ "foreignKeys": {
55
+ "saved_view_defaults_user_id_users_id_fk": {
56
+ "name": "saved_view_defaults_user_id_users_id_fk",
57
+ "tableFrom": "saved_view_defaults",
58
+ "tableTo": "users",
59
+ "columnsFrom": [
60
+ "user_id"
61
+ ],
62
+ "columnsTo": [
63
+ "id"
64
+ ],
65
+ "onDelete": "cascade",
66
+ "onUpdate": "no action"
67
+ },
68
+ "saved_view_defaults_view_id_saved_views_id_fk": {
69
+ "name": "saved_view_defaults_view_id_saved_views_id_fk",
70
+ "tableFrom": "saved_view_defaults",
71
+ "tableTo": "saved_views",
72
+ "columnsFrom": [
73
+ "view_id"
74
+ ],
75
+ "columnsTo": [
76
+ "id"
77
+ ],
78
+ "onDelete": "cascade",
79
+ "onUpdate": "no action"
80
+ }
81
+ },
82
+ "compositePrimaryKeys": {
83
+ "saved_view_defaults_user_id_scope_pk": {
84
+ "name": "saved_view_defaults_user_id_scope_pk",
85
+ "columns": [
86
+ "user_id",
87
+ "scope"
88
+ ]
89
+ }
90
+ },
91
+ "uniqueConstraints": {},
92
+ "policies": {},
93
+ "checkConstraints": {},
94
+ "isRLSEnabled": false
95
+ },
96
+ "public.saved_views": {
97
+ "name": "saved_views",
98
+ "schema": "",
99
+ "columns": {
100
+ "id": {
101
+ "name": "id",
102
+ "type": "uuid",
103
+ "primaryKey": true,
104
+ "notNull": true,
105
+ "default": "gen_random_uuid()"
106
+ },
107
+ "workspace_id": {
108
+ "name": "workspace_id",
109
+ "type": "uuid",
110
+ "primaryKey": false,
111
+ "notNull": true
112
+ },
113
+ "scope": {
114
+ "name": "scope",
115
+ "type": "text",
116
+ "primaryKey": false,
117
+ "notNull": true
118
+ },
119
+ "owner_id": {
120
+ "name": "owner_id",
121
+ "type": "uuid",
122
+ "primaryKey": false,
123
+ "notNull": true
124
+ },
125
+ "visibility": {
126
+ "name": "visibility",
127
+ "type": "view_visibility",
128
+ "typeSchema": "public",
129
+ "primaryKey": false,
130
+ "notNull": true,
131
+ "default": "'private'"
132
+ },
133
+ "name": {
134
+ "name": "name",
135
+ "type": "text",
136
+ "primaryKey": false,
137
+ "notNull": true
138
+ },
139
+ "payload": {
140
+ "name": "payload",
141
+ "type": "jsonb",
142
+ "primaryKey": false,
143
+ "notNull": true
144
+ },
145
+ "position": {
146
+ "name": "position",
147
+ "type": "integer",
148
+ "primaryKey": false,
149
+ "notNull": true,
150
+ "default": 0
151
+ },
152
+ "created_at": {
153
+ "name": "created_at",
154
+ "type": "timestamp with time zone",
155
+ "primaryKey": false,
156
+ "notNull": true,
157
+ "default": "now()"
158
+ },
159
+ "updated_at": {
160
+ "name": "updated_at",
161
+ "type": "timestamp with time zone",
162
+ "primaryKey": false,
163
+ "notNull": true,
164
+ "default": "now()"
165
+ }
166
+ },
167
+ "indexes": {
168
+ "saved_views_workspace_scope_idx": {
169
+ "name": "saved_views_workspace_scope_idx",
170
+ "columns": [
171
+ {
172
+ "expression": "workspace_id",
173
+ "isExpression": false,
174
+ "asc": true,
175
+ "nulls": "last"
176
+ },
177
+ {
178
+ "expression": "scope",
179
+ "isExpression": false,
180
+ "asc": true,
181
+ "nulls": "last"
182
+ }
183
+ ],
184
+ "isUnique": false,
185
+ "concurrently": false,
186
+ "method": "btree",
187
+ "with": {}
188
+ }
189
+ },
190
+ "foreignKeys": {
191
+ "saved_views_workspace_id_workspaces_id_fk": {
192
+ "name": "saved_views_workspace_id_workspaces_id_fk",
193
+ "tableFrom": "saved_views",
194
+ "tableTo": "workspaces",
195
+ "columnsFrom": [
196
+ "workspace_id"
197
+ ],
198
+ "columnsTo": [
199
+ "id"
200
+ ],
201
+ "onDelete": "cascade",
202
+ "onUpdate": "no action"
203
+ },
204
+ "saved_views_owner_id_users_id_fk": {
205
+ "name": "saved_views_owner_id_users_id_fk",
206
+ "tableFrom": "saved_views",
207
+ "tableTo": "users",
208
+ "columnsFrom": [
209
+ "owner_id"
210
+ ],
211
+ "columnsTo": [
212
+ "id"
213
+ ],
214
+ "onDelete": "cascade",
215
+ "onUpdate": "no action"
216
+ }
217
+ },
218
+ "compositePrimaryKeys": {},
219
+ "uniqueConstraints": {
220
+ "saved_views_owner_name_unique": {
221
+ "name": "saved_views_owner_name_unique",
222
+ "nullsNotDistinct": false,
223
+ "columns": [
224
+ "workspace_id",
225
+ "scope",
226
+ "owner_id",
227
+ "name"
228
+ ]
229
+ }
230
+ },
231
+ "policies": {},
232
+ "checkConstraints": {},
233
+ "isRLSEnabled": false
234
+ }
235
+ },
236
+ "enums": {
237
+ "public.view_visibility": {
238
+ "name": "view_visibility",
239
+ "schema": "public",
240
+ "values": [
241
+ "private",
242
+ "workspace"
243
+ ]
244
+ }
245
+ },
246
+ "schemas": {},
247
+ "sequences": {},
248
+ "roles": {},
249
+ "policies": {},
250
+ "views": {},
251
+ "_meta": {
252
+ "columns": {},
253
+ "schemas": {},
254
+ "tables": {}
255
+ }
256
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "version": "7",
3
+ "dialect": "postgresql",
4
+ "entries": [
5
+ {
6
+ "idx": 0,
7
+ "version": "7",
8
+ "when": 1787606201283,
9
+ "tag": "0000_saved_views",
10
+ "breakpoints": true
11
+ }
12
+ ]
13
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orthacms/content-server",
3
- "version": "0.4.2",
3
+ "version": "0.5.0",
4
4
  "description": "@orthacms/content-server — part of Ortha CMS.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/ortha-source/ortha-cms/tree/main/packages/content/server",
@@ -26,22 +26,23 @@
26
26
  "./package.json": "./package.json"
27
27
  },
28
28
  "files": [
29
- "dist"
29
+ "dist",
30
+ "migrations"
30
31
  ],
31
32
  "dependencies": {
32
33
  "@nestjs/common": "^11.0.0",
33
34
  "@nestjs/core": "^11.0.0",
34
35
  "@nestjs/swagger": "^11.4.6",
35
- "@orthacms/bootstrap-server": "^0.4.2",
36
- "@orthacms/content-domain": "^0.4.2",
37
- "@orthacms/copilot-domain": "^0.4.2",
38
- "@orthacms/copilot-server": "^0.4.2",
39
- "@orthacms/database": "^0.4.2",
40
- "@orthacms/identity-server": "^0.4.2",
41
- "@orthacms/mcp-server": "^0.4.2",
42
- "@orthacms/tools-server": "^0.4.2",
43
- "@orthacms/utils-server": "^0.4.2",
44
- "@orthacms/workspaces-server": "^0.4.2",
36
+ "@orthacms/bootstrap-server": "^0.5.0",
37
+ "@orthacms/content-domain": "^0.5.0",
38
+ "@orthacms/copilot-domain": "^0.5.0",
39
+ "@orthacms/copilot-server": "^0.5.0",
40
+ "@orthacms/database": "^0.5.0",
41
+ "@orthacms/identity-server": "^0.5.0",
42
+ "@orthacms/mcp-server": "^0.5.0",
43
+ "@orthacms/tools-server": "^0.5.0",
44
+ "@orthacms/utils-server": "^0.5.0",
45
+ "@orthacms/workspaces-server": "^0.5.0",
45
46
  "class-transformer": "^0.5.1",
46
47
  "class-validator": "^0.15.1",
47
48
  "drizzle-orm": "^0.45.0",
@@ -1,26 +0,0 @@
1
- import type { ContentTypeRegistry } from '../../registry/content-type-registry';
2
- import { EntryWriterService } from '../services/entry-writer.service';
3
- import { BulkIdsDto } from '../dto/bulk-ids.dto';
4
- import type { BulkActionResult, BulkPublishPreview, BulkPublishResult } from '../types/bulk-publish';
5
- /**
6
- * Bulk entry actions over a set of `{ ids }`. **Registered before the
7
- * single-item controllers** (see `content.module.ts`): the literal `bulk`
8
- * segment sits in the same slot as those controllers' `:id`, so it must match
9
- * first — otherwise `/bulk/publish` would resolve as `:id='bulk'` (and trip the
10
- * single-item `ParseUUIDPipe`). `WorkspaceGuard` scopes every action to a
11
- * workspace the caller belongs to. Per-route permissions: publish/unpublish need
12
- * `content:publish`, delete/restore need `content:delete`.
13
- */
14
- export declare class BulkEntriesController {
15
- private readonly registry;
16
- private readonly writer;
17
- constructor(registry: ContentTypeRegistry, writer: EntryWriterService);
18
- /** Dry run: validate each id and report a per-entry verdict. Writes nothing. */
19
- previewPublish(typeName: string, body: BulkIdsDto, workspaceId: string): Promise<BulkPublishPreview>;
20
- publish(typeName: string, body: BulkIdsDto, workspaceId: string): Promise<BulkPublishResult>;
21
- unpublish(typeName: string, body: BulkIdsDto, workspaceId: string): Promise<BulkActionResult>;
22
- remove(typeName: string, body: BulkIdsDto, workspaceId: string): Promise<BulkActionResult>;
23
- restore(typeName: string, body: BulkIdsDto, workspaceId: string): Promise<BulkActionResult>;
24
- purge(typeName: string, body: BulkIdsDto, workspaceId: string): Promise<BulkActionResult>;
25
- }
26
- //# sourceMappingURL=bulk-entries.controller.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bulk-entries.controller.d.ts","sourceRoot":"","sources":["../../../../src/lib/entries/controllers/bulk-entries.controller.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,EACR,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACpB,MAAM,uBAAuB,CAAC;AAG/B;;;;;;;;GAQG;AACH,qBAEa,qBAAqB;IAG1B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBADN,QAAQ,EAAE,mBAAmB,EAC7B,MAAM,EAAE,kBAAkB;IAG/C,gFAAgF;IAIhF,cAAc,CACS,QAAQ,EAAE,MAAM,EAC3B,IAAI,EAAE,UAAU,EACJ,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,kBAAkB,CAAC;IAQ9B,OAAO,CACgB,QAAQ,EAAE,MAAM,EAC3B,IAAI,EAAE,UAAU,EACJ,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,iBAAiB,CAAC;IAQ7B,SAAS,CACc,QAAQ,EAAE,MAAM,EAC3B,IAAI,EAAE,UAAU,EACJ,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,gBAAgB,CAAC;IAQ5B,MAAM,CACiB,QAAQ,EAAE,MAAM,EAC3B,IAAI,EAAE,UAAU,EACJ,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,gBAAgB,CAAC;IAQ5B,OAAO,CACgB,QAAQ,EAAE,MAAM,EAC3B,IAAI,EAAE,UAAU,EACJ,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,gBAAgB,CAAC;IAQ5B,KAAK,CACkB,QAAQ,EAAE,MAAM,EAC3B,IAAI,EAAE,UAAU,EACJ,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,gBAAgB,CAAC;CAI/B"}
@@ -1,20 +0,0 @@
1
- import type { ContentTypeRegistry } from '../../registry/content-type-registry';
2
- import { EntryWriterService } from '../services/entry-writer.service';
3
- import { SaveEntryDto } from '../dto/save-entry.dto';
4
- import type { EntryRecord } from '../types/entry-list-view';
5
- /**
6
- * `POST /api/content/:typeName` — create a draft entry from a validated values
7
- * bag. The `:typeName` resolves via the registry (404 if unknown); the body is
8
- * validated against the type's field specs (422 with the issue list on failure).
9
- * `OriginGuard` defends this state-changing POST (CSRF); `WorkspaceGuard` scopes
10
- * it to a workspace the caller belongs to; `content:create` gates it. The
11
- * synchronous CSRF + permission guards run before `WorkspaceGuard` so a rejected
12
- * request never incurs its membership DB probe.
13
- */
14
- export declare class CreateEntryController {
15
- private readonly registry;
16
- private readonly writer;
17
- constructor(registry: ContentTypeRegistry, writer: EntryWriterService);
18
- create(typeName: string, body: SaveEntryDto, workspaceId: string): Promise<EntryRecord>;
19
- }
20
- //# sourceMappingURL=create-entry.controller.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-entry.controller.d.ts","sourceRoot":"","sources":["../../../../src/lib/entries/controllers/create-entry.controller.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAG5D;;;;;;;;GAQG;AACH,qBAGa,qBAAqB;IAG1B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBADN,QAAQ,EAAE,mBAAmB,EAC7B,MAAM,EAAE,kBAAkB;IAI/C,MAAM,CACiB,QAAQ,EAAE,MAAM,EAC3B,IAAI,EAAE,YAAY,EACN,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,WAAW,CAAC;CAW1B"}
@@ -1,24 +0,0 @@
1
- import type { ContentTypeRegistry } from '../../registry/content-type-registry';
2
- import { EntryWriterService } from '../services/entry-writer.service';
3
- import type { EntryRecord } from '../types/entry-list-view';
4
- /**
5
- * Single-entry removal lifecycle, all gated on `content:delete`:
6
- * - `DELETE /api/content/:typeName/:id` — soft delete (stamp `deleted_at`) for a
7
- * paranoid type, hard delete otherwise; 204.
8
- * - `POST /api/content/:typeName/:id/restore` — clear the tombstone (paranoid
9
- * only); returns the restored record.
10
- * - `DELETE /api/content/:typeName/:id/permanent` — permanently remove a
11
- * tombstoned row (paranoid only); 204.
12
- *
13
- * `OriginGuard` defends these state-changing writes; `WorkspaceGuard` scopes them
14
- * to a workspace the caller belongs to.
15
- */
16
- export declare class DeleteEntryController {
17
- private readonly registry;
18
- private readonly writer;
19
- constructor(registry: ContentTypeRegistry, writer: EntryWriterService);
20
- remove(typeName: string, id: string, workspaceId: string): Promise<void>;
21
- restore(typeName: string, id: string, workspaceId: string): Promise<EntryRecord>;
22
- purge(typeName: string, id: string, workspaceId: string): Promise<void>;
23
- }
24
- //# sourceMappingURL=delete-entry.controller.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"delete-entry.controller.d.ts","sourceRoot":"","sources":["../../../../src/lib/entries/controllers/delete-entry.controller.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAG5D;;;;;;;;;;;GAWG;AACH,qBAGa,qBAAqB;IAG1B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBADN,QAAQ,EAAE,mBAAmB,EAC7B,MAAM,EAAE,kBAAkB;IAKzC,MAAM,CACW,QAAQ,EAAE,MAAM,EACP,EAAE,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,IAAI,CAAC;IAMhB,OAAO,CACgB,QAAQ,EAAE,MAAM,EACP,EAAE,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,WAAW,CAAC;IAOjB,KAAK,CACY,QAAQ,EAAE,MAAM,EACP,EAAE,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,IAAI,CAAC;CAInB"}
@@ -1,34 +0,0 @@
1
- import type { ContentTypeRegistry } from '../../registry/content-type-registry';
2
- import { EntryWriterService } from '../services/entry-writer.service';
3
- import type { EntryRecord, EntryRelationsView, RelationFieldView } from '../types/entry-list-view';
4
- /**
5
- * `GET /api/content/:typeName/:id` — one live entry by id (404 if unknown or
6
- * soft-deleted), so the editor can open an entry by deep link without relying on
7
- * the records-list cache. `WorkspaceGuard` scopes it to a workspace the caller
8
- * belongs to; gated on `content:read`.
9
- */
10
- export declare class GetEntryController {
11
- private readonly registry;
12
- private readonly writer;
13
- constructor(registry: ContentTypeRegistry, writer: EntryWriterService);
14
- getOne(typeName: string, id: string, workspaceId: string): Promise<EntryRecord>;
15
- /**
16
- * `GET /api/content/:typeName/:id/relations` — one entry's relation links,
17
- * keyed by field name. Every relation field (owning single/many **and**
18
- * inverse back-references) resolved to display-ready refs (id + title) in a
19
- * bounded set of queries, so the editor can render assigned relations by
20
- * title and seed the form value with their ids without a round-trip per
21
- * link. 404 when the entry is missing or soft-deleted in this workspace.
22
- */
23
- getRelations(typeName: string, id: string, workspaceId: string): Promise<EntryRelationsView>;
24
- /**
25
- * `GET /api/content/:typeName/:id/relations/:field` — one page of a single
26
- * relation field's links (`{ items, total }`), ordered by position. Drives
27
- * the editor's infinite-scroll of a many/inverse relation, so a field with
28
- * thousands of links is paged, never loaded whole. `?page=&pageSize=`
29
- * (1-based; clamped). 400 if `field` isn't a relation; 404 if the entry is
30
- * missing. `content:read`.
31
- */
32
- getRelationField(typeName: string, id: string, field: string, workspaceId: string, page?: string, pageSize?: string): Promise<RelationFieldView>;
33
- }
34
- //# sourceMappingURL=get-entry.controller.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-entry.controller.d.ts","sourceRoot":"","sources":["../../../../src/lib/entries/controllers/get-entry.controller.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,KAAK,EACR,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EACpB,MAAM,0BAA0B,CAAC;AAIlC;;;;;GAKG;AACH,qBAGa,kBAAkB;IAGvB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBADN,QAAQ,EAAE,mBAAmB,EAC7B,MAAM,EAAE,kBAAkB;IAI/C,MAAM,CACiB,QAAQ,EAAE,MAAM,EACP,EAAE,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,WAAW,CAAC;IAKvB;;;;;;;OAOG;IAEG,YAAY,CACK,QAAQ,EAAE,MAAM,EACP,EAAE,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,kBAAkB,CAAC;IAO9B;;;;;;;OAOG;IAEH,gBAAgB,CACO,QAAQ,EAAE,MAAM,EACP,EAAE,EAAE,MAAM,EACtB,KAAK,EAAE,MAAM,EACT,WAAW,EAAE,MAAM,EACxB,IAAI,CAAC,EAAE,MAAM,EACT,QAAQ,CAAC,EAAE,MAAM,GACrC,OAAO,CAAC,iBAAiB,CAAC;CAWhC"}
@@ -1,20 +0,0 @@
1
- import type { ContentTypeRegistry } from '../../registry/content-type-registry';
2
- import { EntriesService } from '../services/entries.service';
3
- import { ListEntriesQueryDto } from '../dto/list-entries-query.dto';
4
- import type { EntryListView } from '../types/entry-list-view';
5
- /**
6
- * `GET /api/content/:typeName` — one page of a collection's entries, filtered/
7
- * searched/sorted via query params (`?search=`, `?filter=`, `?sort=`, `?page=`,
8
- * `?pageSize=`). The `:typeName` is resolved from the registry (404 if unknown),
9
- * so this single route serves every collection; the service runs the generic SQL
10
- * pipeline against the type's generated table. Authentication is enforced by the
11
- * app-wide AuthGuard; `WorkspaceGuard` scopes the request to a workspace the
12
- * caller belongs to; read access is gated on `content:read`.
13
- */
14
- export declare class ListEntriesController {
15
- private readonly registry;
16
- private readonly entries;
17
- constructor(registry: ContentTypeRegistry, entries: EntriesService);
18
- list(typeName: string, query: ListEntriesQueryDto, workspaceId: string): Promise<EntryListView>;
19
- }
20
- //# sourceMappingURL=list-entries.controller.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"list-entries.controller.d.ts","sourceRoot":"","sources":["../../../../src/lib/entries/controllers/list-entries.controller.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D;;;;;;;;GAQG;AACH,qBAGa,qBAAqB;IAG1B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBADP,QAAQ,EAAE,mBAAmB,EAC7B,OAAO,EAAE,cAAc;IAI5C,IAAI,CACmB,QAAQ,EAAE,MAAM,EAC1B,KAAK,EAAE,mBAAmB,EACf,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,aAAa,CAAC;CAO5B"}
@@ -1,19 +0,0 @@
1
- import type { ContentTypeRegistry } from '../../registry/content-type-registry';
2
- import { EntryWriterService } from '../services/entry-writer.service';
3
- import type { EntryRecord } from '../types/entry-list-view';
4
- /**
5
- * `POST /api/content/:typeName/:id/publish` and `.../unpublish` — the publish
6
- * workflow for a single entry. Publish revalidates the stored row (a 422 if the
7
- * draft no longer passes), then stamps `status='published'` + `published_at`;
8
- * unpublish reverts to draft. Both 400 on a non-publishable type and 404 on a
9
- * missing live row. `OriginGuard` defends the writes; `WorkspaceGuard` scopes
10
- * them to a workspace the caller belongs to; `content:publish` gates them.
11
- */
12
- export declare class PublishEntryController {
13
- private readonly registry;
14
- private readonly writer;
15
- constructor(registry: ContentTypeRegistry, writer: EntryWriterService);
16
- publish(typeName: string, id: string, workspaceId: string): Promise<EntryRecord>;
17
- unpublish(typeName: string, id: string, workspaceId: string): Promise<EntryRecord>;
18
- }
19
- //# sourceMappingURL=publish-entry.controller.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"publish-entry.controller.d.ts","sourceRoot":"","sources":["../../../../src/lib/entries/controllers/publish-entry.controller.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAG5D;;;;;;;GAOG;AACH,qBAGa,sBAAsB;IAG3B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBADN,QAAQ,EAAE,mBAAmB,EAC7B,MAAM,EAAE,kBAAkB;IAI/C,OAAO,CACgB,QAAQ,EAAE,MAAM,EACP,EAAE,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,WAAW,CAAC;IAMvB,SAAS,CACc,QAAQ,EAAE,MAAM,EACP,EAAE,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,WAAW,CAAC;CAI1B"}
@@ -1,9 +0,0 @@
1
- import type { AnyContentType } from '../../types/content-type';
2
- import type { ContentTypeRegistry } from '../../registry/content-type-registry';
3
- /**
4
- * Resolve a `:typeName` route param to a registered content type, or throw 404.
5
- * Every entries controller routes one path per HTTP verb against the registry,
6
- * so this single lookup keeps them thin and consistent.
7
- */
8
- export declare function resolveType(registry: ContentTypeRegistry, typeName: string): AnyContentType;
9
- //# sourceMappingURL=resolve-type.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolve-type.d.ts","sourceRoot":"","sources":["../../../../src/lib/entries/controllers/resolve-type.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAEhF;;;;GAIG;AACH,wBAAgB,WAAW,CACvB,QAAQ,EAAE,mBAAmB,EAC7B,QAAQ,EAAE,MAAM,GACjB,cAAc,CAMhB"}
@@ -1,18 +0,0 @@
1
- import type { ContentTypeRegistry } from '../../registry/content-type-registry';
2
- import { EntryWriterService } from '../services/entry-writer.service';
3
- import { SaveEntryDto } from '../dto/save-entry.dto';
4
- import type { EntryRecord } from '../types/entry-list-view';
5
- /**
6
- * `PATCH /api/content/:typeName/:id` — replace a live entry's values with a
7
- * validated bag (the editor always submits the full document). 404 if there's no
8
- * live row; 422 with the issue list on validation failure. `OriginGuard` defends
9
- * this state-changing write; `WorkspaceGuard` scopes it to a workspace the caller
10
- * belongs to; `content:update` gates it.
11
- */
12
- export declare class UpdateEntryController {
13
- private readonly registry;
14
- private readonly writer;
15
- constructor(registry: ContentTypeRegistry, writer: EntryWriterService);
16
- update(typeName: string, id: string, body: SaveEntryDto, workspaceId: string): Promise<EntryRecord>;
17
- }
18
- //# sourceMappingURL=update-entry.controller.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-entry.controller.d.ts","sourceRoot":"","sources":["../../../../src/lib/entries/controllers/update-entry.controller.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAG5D;;;;;;GAMG;AACH,qBAGa,qBAAqB;IAG1B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBADN,QAAQ,EAAE,mBAAmB,EAC7B,MAAM,EAAE,kBAAkB;IAI/C,MAAM,CACiB,QAAQ,EAAE,MAAM,EACP,EAAE,EAAE,MAAM,EAC9B,IAAI,EAAE,YAAY,EACN,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,WAAW,CAAC;CAU1B"}
@@ -1,11 +0,0 @@
1
- /**
2
- * Body for the bulk endpoints (`/bulk/publish`, `/bulk/unpublish`,
3
- * `/bulk/delete`, `/bulk/restore`, and the publish dry run): the set of entry
4
- * ids to act on. Non-empty, uuid-typed, and capped at {@link BULK_MAX_IDS} so a
5
- * single request can't fan out unbounded work.
6
- */
7
- export declare class BulkIdsDto {
8
- /** Entry ids to act on. */
9
- ids: string[];
10
- }
11
- //# sourceMappingURL=bulk-ids.dto.d.ts.map