@headless-lms/server 0.2.0 → 0.4.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 (351) hide show
  1. package/dist/_virtual/_rolldown/runtime.js +5 -0
  2. package/dist/app/community-mail.d.ts +24 -0
  3. package/dist/app/community-mail.js +92 -0
  4. package/dist/app/community-mail.js.map +1 -0
  5. package/dist/app/container.d.ts +40 -19
  6. package/dist/app/container.js +294 -45
  7. package/dist/app/container.js.map +1 -1
  8. package/dist/app/mcp-endpoints.d.ts +13 -0
  9. package/dist/app/mcp-endpoints.js +25 -0
  10. package/dist/app/mcp-endpoints.js.map +1 -0
  11. package/dist/app/notification-channels.d.ts +47 -0
  12. package/dist/app/notification-channels.js +174 -0
  13. package/dist/app/notification-channels.js.map +1 -0
  14. package/dist/app/notification-reads.d.ts +23 -0
  15. package/dist/app/notification-reads.js +95 -0
  16. package/dist/app/notification-reads.js.map +1 -0
  17. package/dist/http/config.d.ts +2 -1
  18. package/dist/http/errors.d.ts +15 -0
  19. package/dist/http/errors.js +162 -0
  20. package/dist/http/errors.js.map +1 -0
  21. package/dist/http/mcp/catalogue.d.ts +37 -0
  22. package/dist/http/mcp/catalogue.js +69 -0
  23. package/dist/http/mcp/catalogue.js.map +1 -0
  24. package/dist/http/mcp/challenge.d.ts +7 -0
  25. package/dist/http/mcp/challenge.js +35 -0
  26. package/dist/http/mcp/challenge.js.map +1 -0
  27. package/dist/http/mcp/input-schema.d.ts +7 -0
  28. package/dist/http/mcp/input-schema.js +28 -0
  29. package/dist/http/mcp/input-schema.js.map +1 -0
  30. package/dist/http/mcp/route.d.ts +8 -0
  31. package/dist/http/mcp/route.js +75 -0
  32. package/dist/http/mcp/route.js.map +1 -0
  33. package/dist/http/mcp/server.d.ts +8 -0
  34. package/dist/http/mcp/server.js +31 -0
  35. package/dist/http/mcp/server.js.map +1 -0
  36. package/dist/http/mcp/test-support.d.ts +55 -0
  37. package/dist/http/mcp/test-support.js +151 -0
  38. package/dist/http/mcp/test-support.js.map +1 -0
  39. package/dist/http/mcp/tool.d.ts +48 -0
  40. package/dist/http/mcp/tool.js +58 -0
  41. package/dist/http/mcp/tool.js.map +1 -0
  42. package/dist/http/mcp/tools/automations.d.ts +6 -0
  43. package/dist/http/mcp/tools/automations.js +120 -0
  44. package/dist/http/mcp/tools/automations.js.map +1 -0
  45. package/dist/http/mcp/tools/catalog.d.ts +6 -0
  46. package/dist/http/mcp/tools/catalog.js +200 -0
  47. package/dist/http/mcp/tools/catalog.js.map +1 -0
  48. package/dist/http/mcp/tools/comments.d.ts +6 -0
  49. package/dist/http/mcp/tools/comments.js +70 -0
  50. package/dist/http/mcp/tools/comments.js.map +1 -0
  51. package/dist/http/mcp/tools/communities.d.ts +6 -0
  52. package/dist/http/mcp/tools/communities.js +175 -0
  53. package/dist/http/mcp/tools/communities.js.map +1 -0
  54. package/dist/http/mcp/tools/community-members.d.ts +6 -0
  55. package/dist/http/mcp/tools/community-members.js +89 -0
  56. package/dist/http/mcp/tools/community-members.js.map +1 -0
  57. package/dist/http/mcp/tools/community-moderation.d.ts +6 -0
  58. package/dist/http/mcp/tools/community-moderation.js +144 -0
  59. package/dist/http/mcp/tools/community-moderation.js.map +1 -0
  60. package/dist/http/mcp/tools/courses.d.ts +6 -0
  61. package/dist/http/mcp/tools/courses.js +121 -0
  62. package/dist/http/mcp/tools/courses.js.map +1 -0
  63. package/dist/http/mcp/tools/index.d.ts +6 -0
  64. package/dist/http/mcp/tools/index.js +23 -0
  65. package/dist/http/mcp/tools/index.js.map +1 -0
  66. package/dist/http/mcp/tools/people.d.ts +6 -0
  67. package/dist/http/mcp/tools/people.js +145 -0
  68. package/dist/http/mcp/tools/people.js.map +1 -0
  69. package/dist/http/plugins/auth.js +13 -5
  70. package/dist/http/plugins/auth.js.map +1 -1
  71. package/dist/http/plugins/error-handler.d.ts +2 -1
  72. package/dist/http/plugins/error-handler.js +51 -65
  73. package/dist/http/plugins/error-handler.js.map +1 -1
  74. package/dist/http/plugins/openapi.js +49 -2
  75. package/dist/http/plugins/openapi.js.map +1 -1
  76. package/dist/http/routes/access.d.ts +7 -0
  77. package/dist/http/routes/access.js +140 -0
  78. package/dist/http/routes/access.js.map +1 -0
  79. package/dist/http/routes/activities.js +68 -23
  80. package/dist/http/routes/activities.js.map +1 -1
  81. package/dist/http/routes/assets.js +60 -55
  82. package/dist/http/routes/assets.js.map +1 -1
  83. package/dist/http/routes/automations.js +44 -24
  84. package/dist/http/routes/automations.js.map +1 -1
  85. package/dist/http/routes/bundles.js +29 -18
  86. package/dist/http/routes/bundles.js.map +1 -1
  87. package/dist/http/routes/communities.d.ts +7 -0
  88. package/dist/http/routes/communities.js +522 -0
  89. package/dist/http/routes/communities.js.map +1 -0
  90. package/dist/http/routes/community-moderation.d.ts +7 -0
  91. package/dist/http/routes/community-moderation.js +425 -0
  92. package/dist/http/routes/community-moderation.js.map +1 -0
  93. package/dist/http/routes/course-analytics.js +9 -7
  94. package/dist/http/routes/course-analytics.js.map +1 -1
  95. package/dist/http/routes/courses.js +30 -15
  96. package/dist/http/routes/courses.js.map +1 -1
  97. package/dist/http/routes/dashboard.js +15 -6
  98. package/dist/http/routes/dashboard.js.map +1 -1
  99. package/dist/http/routes/discussion.js +34 -26
  100. package/dist/http/routes/discussion.js.map +1 -1
  101. package/dist/http/routes/downloads.js +48 -30
  102. package/dist/http/routes/downloads.js.map +1 -1
  103. package/dist/http/routes/entitlements.js +16 -7
  104. package/dist/http/routes/entitlements.js.map +1 -1
  105. package/dist/http/routes/integrations.js +38 -41
  106. package/dist/http/routes/integrations.js.map +1 -1
  107. package/dist/http/routes/member/actor.d.ts +14 -0
  108. package/dist/http/routes/member/actor.js +11 -0
  109. package/dist/http/routes/member/actor.js.map +1 -0
  110. package/dist/http/routes/member/assets.d.ts +7 -0
  111. package/dist/http/routes/member/assets.js +79 -0
  112. package/dist/http/routes/member/assets.js.map +1 -0
  113. package/dist/http/routes/member/chats.d.ts +7 -0
  114. package/dist/http/routes/member/chats.js +435 -0
  115. package/dist/http/routes/member/chats.js.map +1 -0
  116. package/dist/http/routes/member/comments.d.ts +7 -0
  117. package/dist/http/routes/member/comments.js +187 -0
  118. package/dist/http/routes/member/comments.js.map +1 -0
  119. package/dist/http/routes/member/community.d.ts +7 -0
  120. package/dist/http/routes/member/community.js +312 -0
  121. package/dist/http/routes/member/community.js.map +1 -0
  122. package/dist/http/routes/member/courses.d.ts +7 -0
  123. package/dist/http/routes/member/courses.js +101 -0
  124. package/dist/http/routes/member/courses.js.map +1 -0
  125. package/dist/http/routes/member/devices.d.ts +7 -0
  126. package/dist/http/routes/member/devices.js +98 -0
  127. package/dist/http/routes/member/devices.js.map +1 -0
  128. package/dist/http/routes/member/downloads.d.ts +7 -0
  129. package/dist/http/routes/member/downloads.js +56 -0
  130. package/dist/http/routes/member/downloads.js.map +1 -0
  131. package/dist/http/routes/member/files.d.ts +7 -0
  132. package/dist/http/routes/member/files.js +184 -0
  133. package/dist/http/routes/member/files.js.map +1 -0
  134. package/dist/http/routes/member/index.d.ts +7 -0
  135. package/dist/http/routes/member/index.js +35 -0
  136. package/dist/http/routes/member/index.js.map +1 -0
  137. package/dist/http/routes/member/notification-settings.d.ts +7 -0
  138. package/dist/http/routes/member/notification-settings.js +108 -0
  139. package/dist/http/routes/member/notification-settings.js.map +1 -0
  140. package/dist/http/routes/member/notifications.d.ts +7 -0
  141. package/dist/http/routes/member/notifications.js +125 -0
  142. package/dist/http/routes/member/notifications.js.map +1 -0
  143. package/dist/http/routes/member/org.d.ts +7 -0
  144. package/dist/http/routes/member/org.js +56 -0
  145. package/dist/http/routes/member/org.js.map +1 -0
  146. package/dist/http/routes/member/posts.d.ts +7 -0
  147. package/dist/http/routes/member/posts.js +612 -0
  148. package/dist/http/routes/member/posts.js.map +1 -0
  149. package/dist/http/routes/member/profile.d.ts +7 -0
  150. package/dist/http/routes/member/profile.js +48 -0
  151. package/dist/http/routes/member/profile.js.map +1 -0
  152. package/dist/http/routes/member/progress.d.ts +7 -0
  153. package/dist/http/routes/member/progress.js +60 -0
  154. package/dist/http/routes/member/progress.js.map +1 -0
  155. package/dist/http/routes/organizations.js +171 -25
  156. package/dist/http/routes/organizations.js.map +1 -1
  157. package/dist/http/routes/students.js +32 -47
  158. package/dist/http/routes/students.js.map +1 -1
  159. package/dist/http/routes/webhooks.js +26 -18
  160. package/dist/http/routes/webhooks.js.map +1 -1
  161. package/dist/http/routes.js +8 -2
  162. package/dist/http/routes.js.map +1 -1
  163. package/dist/http/schemas/access.d.ts +146 -0
  164. package/dist/http/schemas/access.js +36 -0
  165. package/dist/http/schemas/access.js.map +1 -0
  166. package/dist/http/schemas/activities.d.ts +3 -1
  167. package/dist/http/schemas/activities.js +4 -4
  168. package/dist/http/schemas/activities.js.map +1 -1
  169. package/dist/http/schemas/assets.d.ts +79 -80
  170. package/dist/http/schemas/assets.js +23 -13
  171. package/dist/http/schemas/assets.js.map +1 -1
  172. package/dist/http/schemas/automations.d.ts +6 -0
  173. package/dist/http/schemas/bundles.js +6 -6
  174. package/dist/http/schemas/bundles.js.map +1 -1
  175. package/dist/http/schemas/chats.d.ts +409 -0
  176. package/dist/http/schemas/chats.js +56 -0
  177. package/dist/http/schemas/chats.js.map +1 -0
  178. package/dist/http/schemas/community.d.ts +597 -0
  179. package/dist/http/schemas/community.js +132 -0
  180. package/dist/http/schemas/community.js.map +1 -0
  181. package/dist/http/schemas/content.d.ts +4 -2
  182. package/dist/http/schemas/content.js +11 -8
  183. package/dist/http/schemas/content.js.map +1 -1
  184. package/dist/http/schemas/discussion.d.ts +98 -14
  185. package/dist/http/schemas/discussion.js +25 -12
  186. package/dist/http/schemas/discussion.js.map +1 -1
  187. package/dist/http/schemas/downloads.d.ts +11 -5
  188. package/dist/http/schemas/downloads.js +14 -11
  189. package/dist/http/schemas/downloads.js.map +1 -1
  190. package/dist/http/schemas/entitlements.d.ts +6 -6
  191. package/dist/http/schemas/entitlements.js +6 -6
  192. package/dist/http/schemas/entitlements.js.map +1 -1
  193. package/dist/http/schemas/files.d.ts +45 -0
  194. package/dist/http/schemas/files.js +25 -0
  195. package/dist/http/schemas/files.js.map +1 -0
  196. package/dist/http/schemas/index.d.ts +15 -8
  197. package/dist/http/schemas/index.js +15 -8
  198. package/dist/http/schemas/integrations.d.ts +4 -4
  199. package/dist/http/schemas/invites.d.ts +4 -0
  200. package/dist/http/schemas/invites.js +1 -0
  201. package/dist/http/schemas/invites.js.map +1 -1
  202. package/dist/http/schemas/{learn.d.ts → member.d.ts} +31 -18
  203. package/dist/http/schemas/{learn.js → member.js} +17 -13
  204. package/dist/http/schemas/member.js.map +1 -0
  205. package/dist/http/schemas/members.d.ts +35 -2
  206. package/dist/http/schemas/members.js +17 -3
  207. package/dist/http/schemas/members.js.map +1 -1
  208. package/dist/http/schemas/notifications.d.ts +550 -0
  209. package/dist/http/schemas/notifications.js +164 -0
  210. package/dist/http/schemas/notifications.js.map +1 -0
  211. package/dist/http/schemas/posts.d.ts +350 -0
  212. package/dist/http/schemas/posts.js +47 -0
  213. package/dist/http/schemas/posts.js.map +1 -0
  214. package/dist/http/schemas/profile.d.ts +23 -0
  215. package/dist/http/schemas/profile.js +15 -0
  216. package/dist/http/schemas/profile.js.map +1 -0
  217. package/dist/http/schemas/shared.d.ts +32 -1
  218. package/dist/http/schemas/shared.js +20 -2
  219. package/dist/http/schemas/shared.js.map +1 -1
  220. package/dist/http/schemas/students.d.ts +1 -7
  221. package/dist/http/schemas/students.js +1 -7
  222. package/dist/http/schemas/students.js.map +1 -1
  223. package/dist/http/scope.d.ts +3 -1
  224. package/dist/http/scope.js +26 -4
  225. package/dist/http/scope.js.map +1 -1
  226. package/dist/http/server.js +6 -1
  227. package/dist/http/server.js.map +1 -1
  228. package/dist/http/web-bridge.d.ts +1 -1
  229. package/dist/http/web-bridge.js +2 -2
  230. package/dist/http/web-bridge.js.map +1 -1
  231. package/dist/http/well-known.d.ts +7 -0
  232. package/dist/http/well-known.js +22 -0
  233. package/dist/http/well-known.js.map +1 -0
  234. package/dist/index.d.ts +3 -1
  235. package/dist/index.js +4 -2
  236. package/dist/index.js.map +1 -1
  237. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.js +78 -0
  238. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.js.map +1 -0
  239. package/dist/node_modules/.pnpm/@vitest_expect@2.1.9/node_modules/@vitest/expect/dist/index.js +1267 -0
  240. package/dist/node_modules/.pnpm/@vitest_expect@2.1.9/node_modules/@vitest/expect/dist/index.js.map +1 -0
  241. package/dist/node_modules/.pnpm/@vitest_pretty-format@2.1.9/node_modules/@vitest/pretty-format/dist/index.js +814 -0
  242. package/dist/node_modules/.pnpm/@vitest_pretty-format@2.1.9/node_modules/@vitest/pretty-format/dist/index.js.map +1 -0
  243. package/dist/node_modules/.pnpm/@vitest_runner@2.1.9/node_modules/@vitest/runner/dist/chunk-tasks.js +43 -0
  244. package/dist/node_modules/.pnpm/@vitest_runner@2.1.9/node_modules/@vitest/runner/dist/chunk-tasks.js.map +1 -0
  245. package/dist/node_modules/.pnpm/@vitest_runner@2.1.9/node_modules/@vitest/runner/dist/index.js +527 -0
  246. package/dist/node_modules/.pnpm/@vitest_runner@2.1.9/node_modules/@vitest/runner/dist/index.js.map +1 -0
  247. package/dist/node_modules/.pnpm/@vitest_runner@2.1.9/node_modules/@vitest/runner/dist/utils.js +2 -0
  248. package/dist/node_modules/.pnpm/@vitest_snapshot@2.1.9/node_modules/@vitest/snapshot/dist/index.js +1737 -0
  249. package/dist/node_modules/.pnpm/@vitest_snapshot@2.1.9/node_modules/@vitest/snapshot/dist/index.js.map +1 -0
  250. package/dist/node_modules/.pnpm/@vitest_spy@2.1.9/node_modules/@vitest/spy/dist/index.js +137 -0
  251. package/dist/node_modules/.pnpm/@vitest_spy@2.1.9/node_modules/@vitest/spy/dist/index.js.map +1 -0
  252. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js +118 -0
  253. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js.map +1 -0
  254. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/diff.js +1222 -0
  255. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/diff.js.map +1 -0
  256. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/error.js +91 -0
  257. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/error.js.map +1 -0
  258. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/helpers.js +113 -0
  259. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/helpers.js.map +1 -0
  260. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/index.js +449 -0
  261. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/index.js.map +1 -0
  262. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/source-map.js +163 -0
  263. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/source-map.js.map +1 -0
  264. package/dist/node_modules/.pnpm/chai@5.3.3/node_modules/chai/index.js +3187 -0
  265. package/dist/node_modules/.pnpm/chai@5.3.3/node_modules/chai/index.js.map +1 -0
  266. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/arguments.js +11 -0
  267. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/arguments.js.map +1 -0
  268. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/array.js +16 -0
  269. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/array.js.map +1 -0
  270. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/bigint.js +11 -0
  271. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/bigint.js.map +1 -0
  272. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/class.js +15 -0
  273. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/class.js.map +1 -0
  274. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/date.js +13 -0
  275. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/date.js.map +1 -0
  276. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/error.js +34 -0
  277. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/error.js.map +1 -0
  278. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/function.js +12 -0
  279. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/function.js.map +1 -0
  280. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/helpers.js +122 -0
  281. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/helpers.js.map +1 -0
  282. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/html.js +39 -0
  283. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/html.js.map +1 -0
  284. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/index.js +99 -0
  285. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/index.js.map +1 -0
  286. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/map.js +25 -0
  287. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/map.js.map +1 -0
  288. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/number.js +14 -0
  289. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/number.js.map +1 -0
  290. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/object.js +21 -0
  291. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/object.js.map +1 -0
  292. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/promise.js +6 -0
  293. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/promise.js.map +1 -0
  294. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/regexp.js +12 -0
  295. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/regexp.js.map +1 -0
  296. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/set.js +18 -0
  297. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/set.js.map +1 -0
  298. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/string.js +24 -0
  299. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/string.js.map +1 -0
  300. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/symbol.js +9 -0
  301. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/symbol.js.map +1 -0
  302. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/typedarray.js +30 -0
  303. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/typedarray.js.map +1 -0
  304. package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.js +939 -0
  305. package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.js.map +1 -0
  306. package/dist/node_modules/.pnpm/pathe@1.1.2/node_modules/pathe/dist/shared/pathe.ff20891b.js +82 -0
  307. package/dist/node_modules/.pnpm/pathe@1.1.2/node_modules/pathe/dist/shared/pathe.ff20891b.js.map +1 -0
  308. package/dist/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js +82 -0
  309. package/dist/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js.map +1 -0
  310. package/dist/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/node.js +8 -0
  311. package/dist/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/node.js.map +1 -0
  312. package/dist/node_modules/.pnpm/tinyspy@3.0.2/node_modules/tinyspy/dist/index.js +83 -0
  313. package/dist/node_modules/.pnpm/tinyspy@3.0.2/node_modules/tinyspy/dist/index.js.map +1 -0
  314. package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.js +9 -0
  315. package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.js.map +1 -0
  316. package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/date.W2xKR2qe.js +51 -0
  317. package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/date.W2xKR2qe.js.map +1 -0
  318. package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/utils.C8RiOc4B.js +48 -0
  319. package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/utils.C8RiOc4B.js.map +1 -0
  320. package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/vi.DgezovHB.js +2426 -0
  321. package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/vi.DgezovHB.js.map +1 -0
  322. package/dist/packages/server/package.js +6 -0
  323. package/dist/packages/server/package.js.map +1 -0
  324. package/package.json +9 -7
  325. package/dist/app/notifications.d.ts +0 -7
  326. package/dist/app/notifications.js +0 -26
  327. package/dist/app/notifications.js.map +0 -1
  328. package/dist/http/routes/learn/assets.d.ts +0 -8
  329. package/dist/http/routes/learn/assets.js +0 -32
  330. package/dist/http/routes/learn/assets.js.map +0 -1
  331. package/dist/http/routes/learn/comments.d.ts +0 -7
  332. package/dist/http/routes/learn/comments.js +0 -175
  333. package/dist/http/routes/learn/comments.js.map +0 -1
  334. package/dist/http/routes/learn/courses.d.ts +0 -7
  335. package/dist/http/routes/learn/courses.js +0 -98
  336. package/dist/http/routes/learn/courses.js.map +0 -1
  337. package/dist/http/routes/learn/downloads.d.ts +0 -7
  338. package/dist/http/routes/learn/downloads.js +0 -76
  339. package/dist/http/routes/learn/downloads.js.map +0 -1
  340. package/dist/http/routes/learn/index.d.ts +0 -7
  341. package/dist/http/routes/learn/index.js +0 -19
  342. package/dist/http/routes/learn/index.js.map +0 -1
  343. package/dist/http/routes/learn/org.d.ts +0 -7
  344. package/dist/http/routes/learn/org.js +0 -50
  345. package/dist/http/routes/learn/org.js.map +0 -1
  346. package/dist/http/routes/learn/progress.d.ts +0 -7
  347. package/dist/http/routes/learn/progress.js +0 -63
  348. package/dist/http/routes/learn/progress.js.map +0 -1
  349. package/dist/http/schemas/learn.js.map +0 -1
  350. package/dist/package.js +0 -6
  351. package/dist/package.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"bundles.js","names":[],"sources":["../../../src/http/routes/bundles.ts"],"sourcesContent":["// HTTP routes for bundles — named groupings of content items. Request +\n// response are validated against the shared contract schemas by the Zod type\n// provider, and @fastify/swagger reads the same schemas to build the OpenAPI\n// spec.\nimport type { FastifyInstance } from 'fastify';\nimport type { ZodTypeProvider } from 'fastify-type-provider-zod';\nimport {\n AddBundleItem,\n Bundle,\n BundleIdParam,\n BundleItem,\n BundleItemParams,\n BundlesPage,\n BundlesQuery,\n CreateBundle,\n ErrorBody,\n UpdateBundle,\n} from '../schemas/index.js';\nimport { z } from 'zod';\nimport type { Container } from '../../app/container.js';\nimport { NotFoundError } from '@headless-lms/core/shared/errors';\nimport { resolveScope } from '../scope.js';\n\nexport async function bundlesRoutes(app: FastifyInstance, container: Container): Promise<void> {\n const r = app.withTypeProvider<ZodTypeProvider>();\n const content = container.content;\n\n r.route({\n method: 'GET',\n url: '/api/bundles',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'listBundles',\n tags: ['Content'],\n summary: 'List bundles',\n querystring: BundlesQuery,\n response: { 200: BundlesPage },\n },\n handler: async (req) => {\n const scope = await resolveScope(container, req);\n return content.listBundles(scope.orgId, req.query);\n },\n });\n\n r.route({\n method: 'GET',\n url: '/api/bundles/:bundleId',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'getBundle',\n tags: ['Content'],\n summary: 'Get a bundle by id',\n params: BundleIdParam,\n response: { 200: Bundle, 404: ErrorBody },\n },\n handler: async (req) => {\n const scope = await resolveScope(container, req);\n const bundle = await content.getBundle(scope.orgId, req.params.bundleId);\n if (!bundle) {\n throw new NotFoundError('Bundle', req.params.bundleId);\n }\n return bundle;\n },\n });\n\n r.route({\n method: 'POST',\n url: '/api/bundles',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'createBundle',\n tags: ['Content'],\n summary: 'Create a bundle, optionally with initial content',\n body: CreateBundle,\n response: { 201: Bundle, 404: ErrorBody },\n },\n handler: async (req, reply) => {\n const scope = await resolveScope(container, req);\n const bundle = await content.createBundle(scope.orgId, req.body);\n return reply.code(201).send(bundle);\n },\n });\n\n r.route({\n method: 'PATCH',\n url: '/api/bundles/:bundleId',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'updateBundle',\n tags: ['Content'],\n summary: 'Update a bundle',\n params: BundleIdParam,\n body: UpdateBundle,\n response: { 200: Bundle, 404: ErrorBody },\n },\n handler: async (req) => {\n const scope = await resolveScope(container, req);\n return content.updateBundle(scope.orgId, req.params.bundleId, req.body);\n },\n });\n\n r.route({\n method: 'DELETE',\n url: '/api/bundles/:bundleId',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'deleteBundle',\n tags: ['Content'],\n summary: 'Delete a bundle (its content survives)',\n params: BundleIdParam,\n response: { 204: z.void(), 404: ErrorBody },\n },\n handler: async (req, reply) => {\n const scope = await resolveScope(container, req);\n await content.deleteBundle(scope.orgId, req.params.bundleId);\n return reply.code(204).send();\n },\n });\n\n r.route({\n method: 'GET',\n url: '/api/bundles/:bundleId/items',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'listBundleItems',\n tags: ['Content'],\n summary: \"List a bundle's content items\",\n params: BundleIdParam,\n response: { 200: z.array(BundleItem), 404: ErrorBody },\n },\n handler: async (req) => {\n const scope = await resolveScope(container, req);\n return content.listBundleItems(scope.orgId, req.params.bundleId);\n },\n });\n\n r.route({\n method: 'POST',\n url: '/api/bundles/:bundleId/items',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'addBundleItem',\n tags: ['Content'],\n summary: 'Add a content item to a bundle',\n params: BundleIdParam,\n body: AddBundleItem,\n response: { 200: z.array(BundleItem), 404: ErrorBody },\n },\n handler: async (req) => {\n const scope = await resolveScope(container, req);\n return content.addBundleItem(scope.orgId, req.params.bundleId, req.body.contentId);\n },\n });\n\n r.route({\n method: 'DELETE',\n url: '/api/bundles/:bundleId/items/:contentId',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'removeBundleItem',\n tags: ['Content'],\n summary: 'Remove a content item from a bundle (the content survives)',\n params: BundleItemParams,\n response: { 200: z.array(BundleItem), 404: ErrorBody },\n },\n handler: async (req) => {\n const scope = await resolveScope(container, req);\n return content.removeBundleItem(scope.or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EAAE,MAAM,UAAU;IAAG,KAAK;GAAU;EACvD;EACA,SAAS,OAAO,QAAQ;GACtB,MAAM,QAAQ,MAAM,aAAa,WAAW,GAAG;GAC/C,OAAO,QAAQ,cAAc,MAAM,OAAO,IAAI,OAAO,UAAU,IAAI,KAAK,SAAS;EACnF;CACF,CAAC;CAED,EAAE,MAAM;EACN,QAAQ;EACR,KAAK;EACL,YAAY,IAAI;EAChB,QAAQ;GACN,aAAa;GACb,MAAM,CAAC,SAAS;GAChB,SAAS;GACT,QAAQ;GACR,UAAU;IAAE,KAAK,EAAE,MAAM,UAAU;IAAG,KAAK;GAAU;EACvD;EACA,SAAS,OAAO,QAAQ;GACtB,MAAM,QAAQ,MAAM,aAAa,WAAW,GAAG;GAC/C,OAAO,QAAQ,iBAAiB,MAAM,OAAO,IAAI,OAAO,UAAU,IAAI,OAAO,SAAS;EACxF;CACF,CAAC;AACH"}
1
+ {"version":3,"file":"bundles.js","names":[],"sources":["../../../src/http/routes/bundles.ts"],"sourcesContent":["// HTTP routes for bundles — named groupings of content items. Request +\n// response are validated against the shared contract schemas by the Zod type\n// provider, and @fastify/swagger reads the same schemas to build the OpenAPI\n// spec.\nimport type { FastifyInstance } from 'fastify';\nimport type { ZodTypeProvider } from 'fastify-type-provider-zod';\nimport {\n AddBundleItem,\n Bundle,\n BundleIdParam,\n BundleItem,\n BundleItemParams,\n BundlesPage,\n BundlesQuery,\n CreateBundle,\n UpdateBundle,\n refusals,\n} from '../schemas/index.js';\nimport { z } from 'zod';\nimport type { Container } from '../../app/container.js';\nimport { NotFoundError } from '@headless-lms/core/shared/errors';\nimport { resolveScope } from '../scope.js';\n\nexport async function bundlesRoutes(app: FastifyInstance, container: Container): Promise<void> {\n const r = app.withTypeProvider<ZodTypeProvider>();\n const content = container.content;\n\n r.route({\n method: 'GET',\n url: '/api/bundles',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'listBundles',\n tags: ['Content'],\n summary: 'List bundles (staff)',\n description: 'Staff only (owner, admin, instructor).',\n querystring: BundlesQuery,\n response: { 200: BundlesPage, ...refusals(403) },\n },\n handler: async (req) => {\n const scope = await resolveScope(container, req);\n return content.listBundles(scope.orgId, req.query);\n },\n });\n\n r.route({\n method: 'GET',\n url: '/api/bundles/:bundleId',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'getBundle',\n tags: ['Content'],\n summary: 'Get a bundle (staff)',\n description: 'Staff only (owner, admin, instructor).',\n params: BundleIdParam,\n response: { 200: Bundle, ...refusals(403, 404) },\n },\n handler: async (req) => {\n const scope = await resolveScope(container, req);\n const bundle = await content.getBundle(scope.orgId, req.params.bundleId);\n if (!bundle) {\n throw new NotFoundError('Bundle', req.params.bundleId);\n }\n return bundle;\n },\n });\n\n r.route({\n method: 'POST',\n url: '/api/bundles',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'createBundle',\n tags: ['Content'],\n summary: 'Create a bundle, optionally with initial content (staff)',\n description:\n 'Staff only (owner, admin, instructor). 404 when an initial content id is unknown.',\n body: CreateBundle,\n response: { 201: Bundle, ...refusals(403, 404) },\n },\n handler: async (req, reply) => {\n const scope = await resolveScope(container, req);\n const bundle = await content.createBundle(scope.orgId, req.body);\n return reply.code(201).send(bundle);\n },\n });\n\n r.route({\n method: 'PATCH',\n url: '/api/bundles/:bundleId',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'updateBundle',\n tags: ['Content'],\n summary: 'Rename a bundle (staff)',\n description: 'Staff only (owner, admin, instructor).',\n params: BundleIdParam,\n body: UpdateBundle,\n response: { 200: Bundle, ...refusals(403, 404) },\n },\n handler: async (req) => {\n const scope = await resolveScope(container, req);\n return content.updateBundle(scope.orgId, req.params.bundleId, req.body);\n },\n });\n\n r.route({\n method: 'DELETE',\n url: '/api/bundles/:bundleId',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'deleteBundle',\n tags: ['Content'],\n summary: 'Delete a bundle (staff)',\n description:\n 'Staff only (owner, admin, instructor). Its content survives; access granted through the bundle ends.',\n params: BundleIdParam,\n response: { 204: z.void(), ...refusals(403, 404) },\n },\n handler: async (req, reply) => {\n const scope = await resolveScope(container, req);\n await content.deleteBundle(scope.orgId, req.params.bundleId);\n return reply.code(204).send();\n },\n });\n\n r.route({\n method: 'GET',\n url: '/api/bundles/:bundleId/items',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'listBundleItems',\n tags: ['Content'],\n summary: \"List a bundle's content (staff)\",\n description: 'Staff only (owner, admin, instructor).',\n params: BundleIdParam,\n response: { 200: z.array(BundleItem), ...refusals(403) },\n },\n handler: async (req) => {\n const scope = await resolveScope(container, req);\n return content.listBundleItems(scope.orgId, req.params.bundleId);\n },\n });\n\n r.route({\n method: 'POST',\n url: '/api/bundles/:bundleId/items',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'addBundleItem',\n tags: ['Content'],\n summary: 'Add content to a bundle (staff)',\n description:\n \"Staff only (owner, admin, instructor). Everyone who holds the bundle can open the content from then on. Returns the bundle's content.\",\n params: BundleIdParam,\n body: AddBundleItem,\n response: { 200: z.array(BundleItem), ...refusals(403, 404) },\n },\n handler: async (req) => {\n const scope = await resolveScope(container, req);\n return content.addBundleItem(scope.orgId, req.params.bundleId, req.body.contentId);\n },\n });\n\n r.route({\n method: 'DELETE',\n url: '/api/bundles/:bundleId/items/:contentId',\n preHandler: app.requireOrgSession,\n schema: {\n operationId: 'removeBundleItem',\n tags: ['Content'],\n summary: 'Remove content from a bundle (staff)',\n description:\n \"Staff only (owner, admin, instructor). The content survives; access to it through the bundle ends. Returns the bundle's content.\",\n params: BundleItemParams,\n response: { 200: z.array(BundleItem), ...refusals(403, 404) },\n },\n handler: async (req) => {\n const scope = await resolveScope(container, req);\n return content.removeBundleItem(scope.orgId, req.params.bundleId, req.params.contentId);\n },\n });\n}\n"],"mappings":";;;;;;;AAuBA,eAAsB,cAAc,KAAsB,WAAqC;CAC7F,MAAM,IAAI,IAAI,iBAAkC;CAChD,MAAM,UAAU,UAAU;CAE1B,EAA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AAU;IAAE,KAAK,EAAE,MAAM,UAAU;IAAG,GAAG,SAAS,KAAK,GAAG;GAAE;EAC9D;EACA,SAAS,OAAO,QAAQ;GACtB,MAAM,QAAQ,MAAM,aAAa,WAAW,GAAG;GAC/C,OAAO,QAAQ,cAAc,MAAM,OAAO,IAAI,OAAO,UAAU,IAAI,KAAK,SAAS;EACnF;CACF,CAAC;CAED,EAAE,MAAM;EACN,QAAQ;EACR,KAAK;EACL,YAAY,IAAI;EAChB,QAAQ;GACN,aAAa;GACb,MAAM,CAAC,SAAS;GAChB,SAAS;GACT,aACE;GACF,QAAQ;GACR,UAAU;IAAE,KAAK,EAAE,MAAM,UAAU;IAAG,GAAG,SAAS,KAAK,GAAG;GAAE;EAC9D;EACA,SAAS,OAAO,QAAQ;GACtB,MAAM,QAAQ,MAAM,aAAa,WAAW,GAAG;GAC/C,OAAO,QAAQ,iBAAiB,MAAM,OAAO,IAAI,OAAO,UAAU,IAAI,OAAO,SAAS;EACxF;CACF,CAAC;AACH"}
@@ -0,0 +1,7 @@
1
+ import { Container } from "../../app/container.js";
2
+ import { FastifyInstance } from "fastify";
3
+ //#region src/http/routes/communities.d.ts
4
+ declare function communitiesRoutes(app: FastifyInstance, container: Container): Promise<void>;
5
+ //#endregion
6
+ export { communitiesRoutes };
7
+ //# sourceMappingURL=communities.d.ts.map
@@ -0,0 +1,522 @@
1
+ import { refusals } from "../schemas/shared.js";
2
+ import { resolveConfiguratorScope, resolveScope } from "../scope.js";
3
+ import { CommunitiesPage, CommunitiesQuery, Community, CommunityAnalytics, CommunityIdParam, CommunitySpaceParam, CreateCommunity, CreateSpace, OrderedIds, PatchCommunitySettings, SetSpaceTopics, SpaceDetail, SpaceLinkBody, SpaceLinkParam, UpdateCommunity, UpdateSpace } from "../schemas/community.js";
4
+ import { MessageQueue } from "../schemas/chats.js";
5
+ import { NotificationCategoryList, ReplaceNotificationCategories } from "../schemas/notifications.js";
6
+ import "../schemas/index.js";
7
+ import { z } from "zod";
8
+ import { NotFoundError } from "@headless-lms/core/shared/errors";
9
+ //#region src/http/routes/communities.ts
10
+ async function communitiesRoutes(app, container) {
11
+ const r = app.withTypeProvider();
12
+ const content = container.content;
13
+ const tags = ["Communities"];
14
+ r.route({
15
+ method: "GET",
16
+ url: "/api/communities",
17
+ schema: {
18
+ operationId: "listCommunities",
19
+ tags,
20
+ summary: "List communities (staff)",
21
+ description: "Staff only (owner, admin, instructor). Pages every community in the organization, drafts included, filtered by `status` and searched by title.",
22
+ querystring: CommunitiesQuery,
23
+ response: {
24
+ 200: CommunitiesPage,
25
+ ...refusals(403)
26
+ }
27
+ },
28
+ handler: async (req) => {
29
+ const scope = await resolveScope(container, req);
30
+ return content.listCommunities(scope.orgId, req.query);
31
+ }
32
+ });
33
+ r.route({
34
+ method: "POST",
35
+ url: "/api/communities",
36
+ schema: {
37
+ operationId: "createCommunity",
38
+ tags,
39
+ summary: "Create a community (staff)",
40
+ description: "Owner or admin only. The community starts as a draft with the default direct-message settings and no spaces. Members see it once it is published and they hold it.",
41
+ body: CreateCommunity,
42
+ response: {
43
+ 201: Community,
44
+ ...refusals(403, 409)
45
+ }
46
+ },
47
+ handler: async (req, reply) => {
48
+ const scope = await resolveScope(container, req);
49
+ const community = await content.createCommunity(scope.orgId, req.body, {
50
+ id: scope.orgUserId,
51
+ role: scope.role
52
+ });
53
+ req.log.info({ communityId: community.id }, "community created");
54
+ return reply.code(201).send(community);
55
+ }
56
+ });
57
+ r.route({
58
+ method: "GET",
59
+ url: "/api/communities/:communityId",
60
+ schema: {
61
+ operationId: "getCommunity",
62
+ tags,
63
+ summary: "Get a community (staff)",
64
+ description: "Staff only (owner, admin, instructor). Any community of the organization, drafts included.",
65
+ params: CommunityIdParam,
66
+ response: {
67
+ 200: Community,
68
+ ...refusals(403, 404)
69
+ }
70
+ },
71
+ handler: async (req) => {
72
+ const scope = await resolveScope(container, req);
73
+ const community = await content.getCommunity(scope.orgId, req.params.communityId);
74
+ if (!community) throw new NotFoundError("Community", req.params.communityId);
75
+ return community;
76
+ }
77
+ });
78
+ r.route({
79
+ method: "PATCH",
80
+ url: "/api/communities/:communityId",
81
+ schema: {
82
+ operationId: "updateCommunity",
83
+ tags,
84
+ summary: "Update a community (staff)",
85
+ description: "Owner or admin only. Changes only the fields sent. `thumbnailAssetId` must be a ready library image (409 otherwise); null clears it.",
86
+ params: CommunityIdParam,
87
+ body: UpdateCommunity,
88
+ response: {
89
+ 200: Community,
90
+ ...refusals(403, 404, 409)
91
+ }
92
+ },
93
+ handler: async (req) => {
94
+ const scope = await resolveScope(container, req);
95
+ return content.updateCommunity(scope.orgId, req.params.communityId, req.body, {
96
+ id: scope.orgUserId,
97
+ role: scope.role
98
+ });
99
+ }
100
+ });
101
+ r.route({
102
+ method: "DELETE",
103
+ url: "/api/communities/:communityId",
104
+ schema: {
105
+ operationId: "deleteCommunity",
106
+ tags,
107
+ summary: "Delete a community (staff)",
108
+ description: "Owner or admin only. Links to the community from other spaces are removed with it.",
109
+ params: CommunityIdParam,
110
+ response: {
111
+ 204: z.void(),
112
+ ...refusals(403, 404)
113
+ }
114
+ },
115
+ handler: async (req, reply) => {
116
+ const scope = await resolveScope(container, req);
117
+ await content.deleteCommunity(scope.orgId, req.params.communityId, {
118
+ id: scope.orgUserId,
119
+ role: scope.role
120
+ });
121
+ return reply.code(204).send();
122
+ }
123
+ });
124
+ r.route({
125
+ method: "PATCH",
126
+ url: "/api/communities/:communityId/settings",
127
+ schema: {
128
+ operationId: "patchCommunitySettings",
129
+ tags,
130
+ summary: "Change the direct-message and digest settings of a community (staff)",
131
+ description: "Owner or admin only. Changes only the settings sent; the rest keep their values. The direct-message settings decide who may message whom from then on. `digest` sets when the community digest goes out, or `null` stops it; the first digest after a change goes out at the next slot.",
132
+ params: CommunityIdParam,
133
+ body: PatchCommunitySettings,
134
+ response: {
135
+ 200: Community,
136
+ ...refusals(403, 404)
137
+ }
138
+ },
139
+ handler: async (req) => {
140
+ const scope = await resolveScope(container, req);
141
+ return content.patchCommunitySettings(scope.orgId, req.params.communityId, req.body, {
142
+ id: scope.orgUserId,
143
+ role: scope.role
144
+ });
145
+ }
146
+ });
147
+ r.route({
148
+ method: "GET",
149
+ url: "/api/communities/:communityId/notification-categories",
150
+ schema: {
151
+ operationId: "getCommunityNotificationCategories",
152
+ tags: ["Notifications"],
153
+ summary: "Get a community's notification categories (staff)",
154
+ description: "Owner or admin only. The list in use for the community, with `source` saying whether it is the default or a stored list.",
155
+ params: CommunityIdParam,
156
+ response: {
157
+ 200: NotificationCategoryList,
158
+ ...refusals(403, 404)
159
+ }
160
+ },
161
+ handler: async (req) => {
162
+ const scope = await resolveConfiguratorScope(container, req);
163
+ return container.notificationCategories.community.get(scope.orgId, req.params.communityId);
164
+ }
165
+ });
166
+ r.route({
167
+ method: "PUT",
168
+ url: "/api/communities/:communityId/notification-categories",
169
+ schema: {
170
+ operationId: "replaceCommunityNotificationCategories",
171
+ tags: ["Notifications"],
172
+ summary: "Replace a community's notification categories (staff)",
173
+ description: "Owner or admin only. Stores the whole list for this community; other communities keep theirs. 422 when a key repeats, a type cannot be in a community list, a reason is not allowed for its type, a channel is not configured, `perSpace` is set on a type that cannot occur in a space, `spaceDefaults` appears without `perSpace` or names a channel the category does not offer, or earlier categories already cover everything a category covers.",
174
+ params: CommunityIdParam,
175
+ body: ReplaceNotificationCategories,
176
+ response: {
177
+ 200: NotificationCategoryList,
178
+ ...refusals(400, 403, 404, 422)
179
+ }
180
+ },
181
+ handler: async (req) => {
182
+ const scope = await resolveConfiguratorScope(container, req);
183
+ return container.notificationCategories.community.replace(scope.orgId, req.params.communityId, req.body.categories);
184
+ }
185
+ });
186
+ r.route({
187
+ method: "DELETE",
188
+ url: "/api/communities/:communityId/notification-categories",
189
+ schema: {
190
+ operationId: "resetCommunityNotificationCategories",
191
+ tags: ["Notifications"],
192
+ summary: "Go back to the default notification categories for a community (staff)",
193
+ description: "Owner or admin only. Removes the stored list; the default applies again.",
194
+ params: CommunityIdParam,
195
+ response: {
196
+ 204: z.void(),
197
+ ...refusals(403, 404)
198
+ }
199
+ },
200
+ handler: async (req, reply) => {
201
+ const scope = await resolveConfiguratorScope(container, req);
202
+ await container.notificationCategories.community.reset(scope.orgId, req.params.communityId);
203
+ return reply.code(204).send();
204
+ }
205
+ });
206
+ r.route({
207
+ method: "POST",
208
+ url: "/api/communities/:communityId/publish",
209
+ schema: {
210
+ operationId: "publishCommunity",
211
+ tags,
212
+ summary: "Publish a community (staff)",
213
+ description: "Owner or admin only. Makes the community visible to the people who hold it.",
214
+ params: CommunityIdParam,
215
+ response: {
216
+ 200: Community,
217
+ ...refusals(403, 404, 409)
218
+ }
219
+ },
220
+ handler: async (req) => {
221
+ const scope = await resolveScope(container, req);
222
+ return content.publishCommunity(scope.orgId, req.params.communityId, {
223
+ id: scope.orgUserId,
224
+ role: scope.role
225
+ });
226
+ }
227
+ });
228
+ r.route({
229
+ method: "POST",
230
+ url: "/api/communities/:communityId/unpublish",
231
+ schema: {
232
+ operationId: "unpublishCommunity",
233
+ tags,
234
+ summary: "Unpublish a community (staff)",
235
+ description: "Owner or admin only. Hides the community from members again; nothing in it is deleted.",
236
+ params: CommunityIdParam,
237
+ response: {
238
+ 200: Community,
239
+ ...refusals(403, 404, 409)
240
+ }
241
+ },
242
+ handler: async (req) => {
243
+ const scope = await resolveScope(container, req);
244
+ return content.unpublishCommunity(scope.orgId, req.params.communityId, {
245
+ id: scope.orgUserId,
246
+ role: scope.role
247
+ });
248
+ }
249
+ });
250
+ r.route({
251
+ method: "GET",
252
+ url: "/api/communities/:communityId/analytics",
253
+ schema: {
254
+ operationId: "getCommunityAnalytics",
255
+ tags,
256
+ summary: "Staff analytics for a community",
257
+ description: "Staff only (owner, admin, instructor). Membership, activity and moderation counts for one community.",
258
+ params: CommunityIdParam,
259
+ response: {
260
+ 200: CommunityAnalytics,
261
+ ...refusals(403, 404)
262
+ }
263
+ },
264
+ handler: async (req) => {
265
+ const scope = await resolveScope(container, req);
266
+ const stats = await container.reporting.admin.communityAnalytics(scope.orgId, req.params.communityId);
267
+ if (!stats) throw new NotFoundError("Community", req.params.communityId);
268
+ return stats;
269
+ }
270
+ });
271
+ r.route({
272
+ method: "GET",
273
+ url: "/api/communities/:communityId/message-queue",
274
+ schema: {
275
+ operationId: "getCommunityMessageQueue",
276
+ tags,
277
+ summary: "Open message flags in a community (staff)",
278
+ description: "Staff only (owner, admin, instructor). The messages in the community's chats with open flags, with the flags and the chat each is in. Holds at most the 100 oldest open flags; working the queue brings in the next ones.",
279
+ params: CommunityIdParam,
280
+ response: {
281
+ 200: MessageQueue,
282
+ ...refusals(403, 404)
283
+ }
284
+ },
285
+ handler: async (req) => {
286
+ const scope = await resolveScope(container, req);
287
+ return container.chats.messageQueue(scope.orgId, {
288
+ id: scope.orgUserId,
289
+ role: scope.role
290
+ }, req.params.communityId);
291
+ }
292
+ });
293
+ r.route({
294
+ method: "GET",
295
+ url: "/api/communities/:communityId/spaces",
296
+ schema: {
297
+ operationId: "listCommunitySpaces",
298
+ tags,
299
+ summary: "List the spaces in a community (staff)",
300
+ description: "Staff only (owner, admin, instructor). Every space in order, with its topics and links.",
301
+ params: CommunityIdParam,
302
+ response: {
303
+ 200: z.array(SpaceDetail),
304
+ ...refusals(403, 404)
305
+ }
306
+ },
307
+ handler: async (req) => {
308
+ const scope = await resolveScope(container, req);
309
+ return content.listSpaces(scope.orgId, req.params.communityId);
310
+ }
311
+ });
312
+ r.route({
313
+ method: "POST",
314
+ url: "/api/communities/:communityId/spaces",
315
+ schema: {
316
+ operationId: "createSpace",
317
+ tags,
318
+ summary: "Create a space (staff)",
319
+ description: "Owner or admin only. The space is added last. An `all_members` space cannot have a capacity (409).",
320
+ params: CommunityIdParam,
321
+ body: CreateSpace,
322
+ response: {
323
+ 201: SpaceDetail,
324
+ ...refusals(403, 404, 409)
325
+ }
326
+ },
327
+ handler: async (req, reply) => {
328
+ const scope = await resolveScope(container, req);
329
+ const space = await content.createSpace(scope.orgId, req.params.communityId, req.body, {
330
+ id: scope.orgUserId,
331
+ role: scope.role
332
+ });
333
+ return reply.code(201).send(space);
334
+ }
335
+ });
336
+ r.route({
337
+ method: "PUT",
338
+ url: "/api/communities/:communityId/spaces/order",
339
+ schema: {
340
+ operationId: "reorderSpaces",
341
+ tags,
342
+ summary: "Reorder the spaces in a community (staff)",
343
+ description: "Owner or admin only. Send every space id of the community exactly once (409 otherwise).",
344
+ params: CommunityIdParam,
345
+ body: OrderedIds,
346
+ response: {
347
+ 200: z.array(SpaceDetail),
348
+ ...refusals(403, 404, 409)
349
+ }
350
+ },
351
+ handler: async (req) => {
352
+ const scope = await resolveScope(container, req);
353
+ return content.reorderSpaces(scope.orgId, req.params.communityId, req.body.ids, {
354
+ id: scope.orgUserId,
355
+ role: scope.role
356
+ });
357
+ }
358
+ });
359
+ r.route({
360
+ method: "GET",
361
+ url: "/api/communities/:communityId/spaces/:spaceId",
362
+ schema: {
363
+ operationId: "getSpace",
364
+ tags,
365
+ summary: "Get a space (staff)",
366
+ description: "Staff only (owner, admin, instructor). The space with its topics and links.",
367
+ params: CommunitySpaceParam,
368
+ response: {
369
+ 200: SpaceDetail,
370
+ ...refusals(403, 404)
371
+ }
372
+ },
373
+ handler: async (req) => {
374
+ const scope = await resolveScope(container, req);
375
+ const space = await content.getCommunitySpace(scope.orgId, req.params.communityId, req.params.spaceId);
376
+ if (!space) throw new NotFoundError("Space", req.params.spaceId);
377
+ return space;
378
+ }
379
+ });
380
+ r.route({
381
+ method: "PATCH",
382
+ url: "/api/communities/:communityId/spaces/:spaceId",
383
+ schema: {
384
+ operationId: "updateSpace",
385
+ tags,
386
+ summary: "Update a space (staff)",
387
+ description: "Owner or admin only. Changes only the fields sent; `settings` merges into the current settings. An `all_members` space cannot have a capacity (409).",
388
+ params: CommunitySpaceParam,
389
+ body: UpdateSpace,
390
+ response: {
391
+ 200: SpaceDetail,
392
+ ...refusals(403, 404, 409)
393
+ }
394
+ },
395
+ handler: async (req) => {
396
+ const scope = await resolveScope(container, req);
397
+ return content.updateSpace(scope.orgId, req.params.communityId, req.params.spaceId, req.body, {
398
+ id: scope.orgUserId,
399
+ role: scope.role
400
+ });
401
+ }
402
+ });
403
+ r.route({
404
+ method: "DELETE",
405
+ url: "/api/communities/:communityId/spaces/:spaceId",
406
+ schema: {
407
+ operationId: "deleteSpace",
408
+ tags,
409
+ summary: "Delete a space (staff)",
410
+ description: "Owner or admin only. The space and everything in it go.",
411
+ params: CommunitySpaceParam,
412
+ response: {
413
+ 204: z.void(),
414
+ ...refusals(403, 404)
415
+ }
416
+ },
417
+ handler: async (req, reply) => {
418
+ const scope = await resolveScope(container, req);
419
+ await content.deleteSpace(scope.orgId, req.params.communityId, req.params.spaceId, {
420
+ id: scope.orgUserId,
421
+ role: scope.role
422
+ });
423
+ return reply.code(204).send();
424
+ }
425
+ });
426
+ r.route({
427
+ method: "PUT",
428
+ url: "/api/communities/:communityId/spaces/:spaceId/topics",
429
+ schema: {
430
+ operationId: "setSpaceTopics",
431
+ tags,
432
+ summary: "Replace the topics on a space (staff)",
433
+ description: "Owner or admin only. The list replaces the current topics: an entry with an `id` keeps and renames that topic, one without adds a topic, and a topic left out is deleted. Names must be unique (409), and a topic that posts use cannot be deleted (409).",
434
+ params: CommunitySpaceParam,
435
+ body: SetSpaceTopics,
436
+ response: {
437
+ 200: SpaceDetail,
438
+ ...refusals(403, 404, 409)
439
+ }
440
+ },
441
+ handler: async (req) => {
442
+ const scope = await resolveScope(container, req);
443
+ return content.setSpaceTopics(scope.orgId, req.params.communityId, req.params.spaceId, req.body, {
444
+ id: scope.orgUserId,
445
+ role: scope.role
446
+ });
447
+ }
448
+ });
449
+ r.route({
450
+ method: "POST",
451
+ url: "/api/communities/:communityId/spaces/:spaceId/links",
452
+ schema: {
453
+ operationId: "addSpaceLink",
454
+ tags,
455
+ summary: "Link a course, download, or community into a space (staff)",
456
+ description: "Owner or admin only. The link is added last. Linking the same content twice is a 409.",
457
+ params: CommunitySpaceParam,
458
+ body: SpaceLinkBody,
459
+ response: {
460
+ 201: SpaceDetail,
461
+ ...refusals(403, 404, 409)
462
+ }
463
+ },
464
+ handler: async (req, reply) => {
465
+ const scope = await resolveScope(container, req);
466
+ const space = await content.addSpaceLink(scope.orgId, req.params.communityId, req.params.spaceId, req.body.contentId, {
467
+ id: scope.orgUserId,
468
+ role: scope.role
469
+ });
470
+ return reply.code(201).send(space);
471
+ }
472
+ });
473
+ r.route({
474
+ method: "DELETE",
475
+ url: "/api/communities/:communityId/spaces/:spaceId/links/:linkId",
476
+ schema: {
477
+ operationId: "removeSpaceLink",
478
+ tags,
479
+ summary: "Remove a link from a space (staff)",
480
+ description: "Owner or admin only. The linked content itself is untouched.",
481
+ params: SpaceLinkParam,
482
+ response: {
483
+ 200: SpaceDetail,
484
+ ...refusals(403, 404)
485
+ }
486
+ },
487
+ handler: async (req) => {
488
+ const scope = await resolveScope(container, req);
489
+ return content.removeSpaceLink(scope.orgId, req.params.communityId, req.params.spaceId, req.params.linkId, {
490
+ id: scope.orgUserId,
491
+ role: scope.role
492
+ });
493
+ }
494
+ });
495
+ r.route({
496
+ method: "PUT",
497
+ url: "/api/communities/:communityId/spaces/:spaceId/links/order",
498
+ schema: {
499
+ operationId: "reorderSpaceLinks",
500
+ tags,
501
+ summary: "Reorder the links in a space (staff)",
502
+ description: "Owner or admin only. Send every link id of the space exactly once (409 otherwise).",
503
+ params: CommunitySpaceParam,
504
+ body: OrderedIds,
505
+ response: {
506
+ 200: SpaceDetail,
507
+ ...refusals(403, 404, 409)
508
+ }
509
+ },
510
+ handler: async (req) => {
511
+ const scope = await resolveScope(container, req);
512
+ return content.reorderSpaceLinks(scope.orgId, req.params.communityId, req.params.spaceId, req.body.ids, {
513
+ id: scope.orgUserId,
514
+ role: scope.role
515
+ });
516
+ }
517
+ });
518
+ }
519
+ //#endregion
520
+ export { communitiesRoutes };
521
+
522
+ //# sourceMappingURL=communities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"communities.js","names":[],"sources":["../../../src/http/routes/communities.ts"],"sourcesContent":["import type { FastifyInstance } from 'fastify';\nimport type { ZodTypeProvider } from 'fastify-type-provider-zod';\nimport { z } from 'zod';\nimport type { Container } from '../../app/container.js';\nimport { NotFoundError } from '@headless-lms/core/shared/errors';\nimport { resolveConfiguratorScope, resolveScope } from '../scope.js';\nimport {\n Community,\n CommunityAnalytics,\n CommunityIdParam,\n CommunitySpaceParam,\n CommunitiesPage,\n CommunitiesQuery,\n CreateCommunity,\n CreateSpace,\n MessageQueue,\n NotificationCategoryList,\n OrderedIds,\n PatchCommunitySettings,\n ReplaceNotificationCategories,\n SetSpaceTopics,\n SpaceDetail,\n SpaceLinkBody,\n SpaceLinkParam,\n UpdateCommunity,\n UpdateSpace,\n refusals,\n} from '../schemas/index.js';\n\nexport async function communitiesRoutes(app: FastifyInstance, container: Container): Promise<void> {\n const r = app.withTypeProvider<ZodTypeProvider>();\n const content = container.content;\n const tags = ['Communities'];\n\n r.route({\n method: 'GET',\n url: '/api/communities',\n schema: {\n operationId: 'listCommunities',\n tags,\n summary: 'List communities (staff)',\n description:\n 'Staff only (owner, admin, instructor). Pages every community in the organization, drafts included, filtered by `status` and searched by title.',\n querystring: CommunitiesQuery,\n response: { 200: CommunitiesPage, ...refusals(403) },\n },\n handler: async (req) => {\n const scope = await resolveScope(container, req);\n return content.listCommunities(scope.orgId, req.query);\n },\n });\n\n r.route({\n method: 'POST',\n url: '/api/communities',\n schema: {\n operationId: 'createCommunity',\n tags,\n summary: 'Create a community (staff)',\n description:\n 'Owner or admin only. The community starts as a draft with the default direct-message settings and no spaces. Members see it once it is published and they hold it.',\n body: CreateCommunity,\n response: { 201: Community, ...refusals(403, 409) },\n },\n handler: async (req, reply) => {\n const scope = await resolveScope(container, req);\n const community = await content.createCommunity(scope.orgId, req.body, {\n id: scope.orgUserId,\n role: scope.role,\n });\n req.log.info({ communityId: community.id }, 'community created');\n return reply.code(201).send(community);\n },\n });\n\n r.route({\n method: 'GET',\n url: '/api/communities/:communityId',\n schema: {\n operationId: 'getCommunity',\n tags,\n summary: 'Get a community (staff)',\n description:\n 'Staff only (owner, admin, instructor). Any community of the organization, drafts included.',\n params: CommunityIdParam,\n response: { 200: Community, ...refusals(403, 404) },\n },\n handler: async (req) => {\n const scope = await resolveScope(container, req);\n const community = await content.getCommunity(scope.orgId, req.params.communityId);\n if (!community) {\n throw new NotFoundError('Community', req.params.communityId);\n }\n return community;\n },\n });\n\n r.route({\n method: 'PATCH',\n url: '/api/communities/:communityId',\n schema: {\n operationId: 'updateCommunity',\n tags,\n summary: 'Update a community (staff)',\n description:\n 'Owner or admin only. Changes only the fields sent. `thumbnailAssetId` must be a ready library image (409 otherwise); null clears it.',\n params: CommunityIdParam,\n body: UpdateCommunity,\n response: { 200: Community, ...refusals(403, 404, 409) },\n },\n handler: async (req) => {\n const scope = await resolveScope(container, req);\n return content.updateCommunity(scope.orgId, req.params.communityId, req.body, {\n id: scope.orgUserId,\n role: scope.role,\n });\n },\n });\n\n r.route({\n method: 'DELETE',\n url: '/api/communities/:communityId',\n schema: {\n operationId: 'deleteCommunity',\n tags,\n summary: 'Delete a community (staff)',\n description:\n 'Owner or admin only. Links to the community from other spaces are removed with it.',\n params: CommunityIdParam,\n response: { 204: z.void(), ...refusals(403, 404) },\n },\n handler: async (req, reply) => {\n const scope = await resolveScope(container, req);\n await content.deleteCommunity(scope.orgId, req.params.communityId, {\n id: scope.orgUserId,\n role: scope.role,\n });\n return reply.code(204).send();\n },\n });\n\n r.route({\n method: 'PATCH',\n url: '/api/communities/:communityId/settings',\n schema: {\n operationId: 'patchCommunitySettings',\n tags,\n summary: 'Change the direct-message and digest settings of a community (staff)',\n description:\n 'Owner or admin only. Changes only the settings sent; the rest keep their values. The direct-message settings decide who may message whom from then on. `digest` sets when the community digest goes out, or `null` stops it; the first digest after a change goes out at the next slot.',\n params: CommunityIdParam,\n body: PatchCommunitySettings,\n response: { 200: Community, ...refusals(403, 404) },\n },\n handler: async (req) => {\n const scope = await resolveScope(container, req);\n return content.patchCommunitySettings(scope.orgId, req.params.communityId, req.body, {\n id: scope.orgUserId,\n role: scope.role,\n });\n },\n });\n\n r.route({\n method: 'GET',\n url: '/api/communities/:communityId/notification-categories',\n schema: {\n operationId: 'getCommunityNotificationCategories',\n tags: ['Notifications'],\n summary: \"Get a community's notification categories (staff)\",\n description:\n 'Owner or admin only. The list in use for the community, with `source` saying whether it is the default or a stored list.',\n params: CommunityIdParam,\n response: { 200: NotificationCategoryList, ...refusals(403, 404) },\n },\n handler: async (req) => {\n const scope = await resolveConfiguratorScope(container, req);\n return container.notificationCategories.community.get(scope.orgId, req.params.communityId);\n },\n });\n\n r.route({\n method: 'PUT',\n url: '/api/communities/:communityId/notification-categories',\n schema: {\n operationId: 'replaceCommunityNotificationCategories',\n tags: ['Notifications'],\n summary: \"Replace a community's notification categories (staff)\",\n description:\n 'Owner or admin only. Stores the whole list for this community; other communities keep theirs. 422 when a key repeats, a type cannot be in a community list, a reason is not allowed for its type, a channel is not configured, `perSpace` is set on a type that cannot occur in a space, `spaceDefaults` appears without `perSpace` or names a channel the category does not offer, or earlier categories already cover everything a category covers.',\n params: CommunityIdParam,\n body: ReplaceNotificationCategories,\n response: { 200: NotificationCategoryList, ...refusals(400, 403, 404, 422) },\n },\n handler: async (req) => {\n const scope = await resolveConfiguratorScope(container, req);\n return container.notificationCategories.community.replace(\n scope.orgId,\n req.params.communityId,\n req.body.categories,\n );\n },\n });\n\n r.route({\n method: 'DELETE',\n url: '/api/communities/:communityId/notification-categories',\n schema: {\n operationId: 'resetCommunityNotificationCategories',\n tags: ['Notifications'],\n summary: 'Go back to the default notification categories for a community (staff)',\n description: 'Owner or admin only. Removes the stored list; the default applies again.',\n params: CommunityIdParam,\n response: { 204: z.void(), ...refusals(403, 404) },\n },\n handler: async (req, reply) => {\n const scope = await resolveConfiguratorScope(container, req);\n await container.notificationCategories.community.reset(scope.orgId, req.params.communityId);\n return reply.code(204).send();\n },\n });\n\n r.route({\n method: 'POST',\n url: '/api/communities/:communityId/publish',\n schema: {\n operationId: 'publishCommunity',\n tags,\n summary: 'Publish a community (staff)',\n description: 'Owner or admin only. Makes the community visible to the people who hold it.',\n params: CommunityIdParam,\n response: { 200: Community, ...refusals(403, 404, 409) },\n },\n handler: async (req) => {\n const scope = await resolveScope(container, req);\n return content.publishCommunity(scope.orgId, req.params.communityId, {\n id: scope.orgUserId,\n role: scope.role,\n });\n },\n });\n\n r.route({\n method: 'POST',\n url: '/api/communities/:communityId/unpublish',\n schema: {\n operationId: 'unpublishCommunity',\n tags,\n summary: 'Unpublish a community (staff)',\n description:\n 'Owner or admin only. Hides the community from members again; nothing in it is deleted.',\n params: CommunityIdParam,\n response: { 200: Community, ...refusals(403, 404, 409) },\n },\n handler: async (req) => {\n const scope = await resolveScope(container, req);\n return content.unpublishCommunity(scope.orgId, req.params.communityId, {\n id: scope.orgUserId,\n role: scope.role,\n });\n },\n });\n\n r.route({\n method: 'GET',\n url: '/api/communities/:communityId/analytics',\n schema: {\n operationId: 'getCommunityAnalytics',\n tags,\n summary: 'Staff analytics for a community',\n description:\n 'Staff only (owner, admin, instructor). Membership, activity and moderation counts for one community.',\n params: CommunityIdParam,\n response: { 200: CommunityAnalytics, ...refusals(403, 404) },\n },\n handler: async (req) => {\n const scope = await resolveScope(container, req);\n const stats = await container.reporting.admin.communityAnalytics(\n scope.orgId,\n req.params.communityId,\n );\n if (!stats) {\n throw new NotFoundError('Community', req.params.communityId);\n }\n return stats;\n },\n });\n\n r.route({\n method: 'GET',\n url: '/api/communities/:communityId/message-queue',\n schema: {\n operationId: 'getCommunityMessageQueue',\n tags,\n summary: 'Open message flags in a community (staff)',\n description:\n \"Staff only (owner, admin, instructor). The messages in the community's chats with open flags, with the flags and the chat each is in. Holds at most the 100 oldest open flags; working the queue brings in the next ones.\",\n params: CommunityIdParam,\n response: { 200: MessageQueue, ...refusals(403, 404) },\n },\n handler: async (req) => {\n const scope = await resolveScope(container, req);\n return container.chats.messageQueue(\n scope.orgId,\n { id: scope.orgUserId, role: scope.role },\n req.params.communityId,\n );\n },\n });\n\n r.route({\n method: 'GET',\n url: '/api/communities/:communityId/spaces',\n schema: {\n operationId: 'listCommunitySpaces',\n tags,\n summary: 'List the spaces in a community (staff)',\n description:\n 'Staff only (owner, admin, instructor). Every space in order, with its topics and links.',\n params: CommunityIdParam,\n response: { 200: z.array(SpaceDetail), ...refusals(403, 404) },\n },\n handler: async (req) => {\n const scope = await resolveScope(container, req);\n return content.listSpaces(scope.orgId, req.params.communityId);\n },\n });\n\n r.route({\n method: 'POST',\n url: '/api/communities/:communityId/spaces',\n schema: {\n operationId: 'createSpace',\n tags,\n summary: 'Create a space (staff)',\n description:\n 'Owner or admin only. The space is added last. An `all_members` space cannot have a capacity (409).',\n params: CommunityIdParam,\n body: CreateSpace,\n response: { 201: SpaceDetail, ...refusals(403, 404, 409) },\n },\n handler: async (req, reply) => {\n const scope = await resolveScope(container, req);\n const space = await content.createSpace(scope.orgId, req.params.communityId, req.body, {\n id: scope.orgUserId,\n role: scope.role,\n });\n return reply.code(201).send(space);\n },\n });\n\n r.route({\n method: 'PUT',\n url: '/api/communities/:communityId/spaces/order',\n schema: {\n operationId: 'reorderSpaces',\n tags,\n summary: 'Reorder the spaces in a community (staff)',\n description:\n 'Owner or admin only. Send every space id of the community exactly once (409 otherwise).',\n params: CommunityIdParam,\n body: OrderedIds,\n response: { 200: z.array(SpaceDetail), ...refusals(403, 404, 409) },\n },\n handler: async (req) => {\n const scope = await resolveScope(container, req);\n return content.reorderSpaces(scope.orgId, req.params.communityId, req.body.ids, {\n id: scope.orgUserId,\n role: scope.role,\n });\n },\n });\n\n r.route({\n method: 'GET',\n url: '/api/communities/:communityId/spaces/:spaceId',\n schema: {\n operationId: 'getSpace',\n tags,\n summary: 'Get a space (staff)',\n description: 'Staff only (owner, admin, instructor). The space with its topics and links.',\n params: CommunitySpaceParam,\n response: { 200: SpaceDetail, ...refusals(403, 404) },\n },\n handler: async (req) => {\n const scope = await resolveScope(container, req);\n const space = await content.getCommunitySpace(\n scope.orgId,\n req.params.communityId,\n req.params.spaceId,\n );\n if (!space) {\n throw new NotFoundError('Space', req.params.spaceId);\n }\n return space;\n },\n });\n\n r.route({\n method: 'PATCH',\n url: '/api/communities/:communityId/spaces/:spaceId',\n schema: {\n operationId: 'updateSpace',\n tags,\n summary: 'Update a space (staff)',\n description:\n 'Owner or admin only. Changes only the fields sent; `settings` merges into the current settings. An `all_members` space cannot have a capacity (409).',\n params: CommunitySpaceParam,\n body: UpdateSpace,\n response: { 200: SpaceDetail, ...refusals(403, 404, 409) },\n },\n handler: async (req) => {\n const scope = await resolveScope(container, req);\n return content.updateSpace(\n scope.orgId,\n req.params.communityId,\n req.params.spaceId,\n req.body,\n { id: scope.orgUserId, role: scope.role },\n );\n },\n });\n\n r.route({\n method: 'DELETE',\n url: '/api/communities/:communityId/spaces/:spaceId',\n schema: {\n operationId: 'deleteSpace',\n tags,\n summary: 'Delete a space (staff)',\n description: 'Owner or admin only. The space and everything in it go.',\n params: CommunitySpaceParam,\n response: { 204: z.void(), ...refusals(403, 404) },\n },\n handler: async (req, reply) => {\n const scope = await resolveScope(container, req);\n await content.deleteSpace(scope.orgId, req.params.communityId, req.params.spaceId, {\n id: scope.orgUserId,\n role: scope.role,\n });\n return reply.code(204).send();\n },\n });\n\n r.route({\n method: 'PUT',\n url: '/api/communities/:communityId/spaces/:spaceId/topics',\n schema: {\n operationId: 'setSpaceTopics',\n tags,\n summary: 'Replace the topics on a space (staff)',\n description:\n 'Owner or admin only. The list replaces the current topics: an entry with an `id` keeps and renames that topic, one without adds a topic, and a topic left out is deleted. Names must be unique (409), and a topic that posts use cannot be deleted (409).',\n params: CommunitySpaceParam,\n body: SetSpaceTopics,\n response: { 200: SpaceDetail, ...refusals(403, 404, 409) },\n },\n handler: async (req) => {\n const scope = await resolveScope(container, req);\n return content.setSpaceTopics(\n scope.orgId,\n req.params.communityId,\n req.params.spaceId,\n req.body,\n { id: scope.orgUserId, role: scope.role },\n );\n },\n });\n\n r.route({\n method: 'POST',\n url: '/api/communities/:communityId/spaces/:spaceId/links',\n schema: {\n operationId: 'addSpaceLink',\n tags,\n summary: 'Link a course, download, or community into a space (staff)',\n description:\n 'Owner or admin only. The link is added last. Linking the same content twice is a 409.',\n params: CommunitySpaceParam,\n body: SpaceLinkBody,\n response: { 201: SpaceDetail, ...refusals(403, 404, 409) },\n },\n handler: async (req, reply) => {\n const scope = await resolveScope(container, req);\n const space = await content.addSpaceLink(\n scope.orgId,\n req.params.communityId,\n req.params.spaceId,\n req.body.contentId,\n { id: scope.orgUserId, role: scope.role },\n );\n return reply.code(201).send(space);\n },\n });\n\n r.route({\n method: 'DELETE',\n url: '/api/communities/:communityId/spaces/:spaceId/links/:linkId',\n schema: {\n operationId: 'removeSpaceLink',\n tags,\n summary: 'Remove a link from a space (staff)',\n description: 'Owner or admin only. The linked content itself is untouched.',\n params: SpaceLinkParam,\n response: { 200: SpaceDetail, ...refusals(403, 404) },\n },\n handler: async (req) => {\n const scope = await resolveScope(container, req);\n return content.removeSpaceLink(\n scope.orgId,\n req.params.communityId,\n req.params.spaceId,\n req.params.linkId,\n { id: scope.orgUserId, role: scope.role },\n );\n },\n });\n\n r.route({\n method: 'PUT',\n url: '/api/communities/:communityId/spaces/:spaceId/links/order',\n schema: {\n operationId: 'reorderSpaceLinks',\n tags,\n summary: 'Reorder the links in a space (staff)',\n description:\n 'Owner or admin only. Send every link id of the space exactly once (409 otherwise).',\n params: CommunitySpaceParam,\n body: OrderedIds,\n response: { 200: SpaceDetail, ...refusals(403, 404, 409) },\n },\n handler: async (req) => {\n const scope = await resolveScope(container, req);\n return content.reorderSpaceLinks(\n scope.orgId,\n req.params.communityId,\n req.params.spaceId,\n req.body.ids,\n { id: scope.orgUserId, role: scope.role },\n );\n },\n });\n}\n"],"mappings":";;;;;;;;;AA6BA,eAAsB,kBAAkB,KAAsB,WAAqC;CACjG,MAAM,IAAI,IAAI,iBAAkC;CAChD,MAAM,UAAU,UAAU;CAC1B,MAAM,OAAO,CA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MAAM,MAAM;GAAK,CAC1C;EACF;CACF,CAAC;CAED,EAAE,MAAM;EACN,QAAQ;EACR,KAAK;EACL,QAAQ;GACN,aAAa;GACb;GACA,SAAS;GACT,aACE;GACF,QAAQ;GACR,MAAM;GACN,UAAU;IAAE,KAAK;IAAa,GAAG,SAAS,KAAK,KAAK,GAAG;GAAE;EAC3D;EACA,SAAS,OAAO,QAAQ;GACtB,MAAM,QAAQ,MAAM,aAAa,WAAW,GAAG;GAC/C,OAAO,QAAQ,kBACb,MAAM,OACN,IAAI,OAAO,aACX,IAAI,OAAO,SACX,IAAI,KAAK,KACT;IAAE,IAAI,MAAM;IAAW,MAAM,MAAM;GAAK,CAC1C;EACF;CACF,CAAC;AACH"}
@@ -0,0 +1,7 @@
1
+ import { Container } from "../../app/container.js";
2
+ import { FastifyInstance } from "fastify";
3
+ //#region src/http/routes/community-moderation.d.ts
4
+ declare function communityModerationRoutes(app: FastifyInstance, container: Container): Promise<void>;
5
+ //#endregion
6
+ export { communityModerationRoutes };
7
+ //# sourceMappingURL=community-moderation.d.ts.map