@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
@@ -0,0 +1,132 @@
1
+ import { ListQuery, OrgUserProfileSchema, PageQuery, paginated } from "./shared.js";
2
+ import { z } from "zod";
3
+ import { communityStatusSchema, communityViewSchema, createCommunityInputSchema, createSpaceInputSchema, dmSettingsSchema, idSchema, patchCommunitySettingsInputSchema, patchDmSettingsInputSchema, roleSchema, setSpaceTopicsInputSchema, spaceDetailSchema, spaceMemberSchema, subscriptionViewSchema, updateCommunityInputSchema, updateSpaceInputSchema } from "@headless-lms/core/schemas";
4
+ //#region src/http/schemas/community.ts
5
+ const Community = communityViewSchema;
6
+ const CommunitiesQuery = ListQuery.extend({ status: communityStatusSchema.optional() });
7
+ const CommunitiesPage = paginated(Community);
8
+ const CreateCommunity = createCommunityInputSchema;
9
+ const UpdateCommunity = updateCommunityInputSchema;
10
+ const PatchDmSettings = patchDmSettingsInputSchema;
11
+ const PatchCommunitySettings = patchCommunitySettingsInputSchema;
12
+ const DmSettings = dmSettingsSchema;
13
+ const SpaceDetail = spaceDetailSchema;
14
+ const SpaceMember = spaceMemberSchema;
15
+ const SpaceMembersPage = paginated(SpaceMember);
16
+ const CreateSpace = createSpaceInputSchema;
17
+ const UpdateSpace = updateSpaceInputSchema;
18
+ const SetSpaceTopics = setSpaceTopicsInputSchema;
19
+ const OrderedIds = z.object({ ids: z.array(idSchema).min(1).max(200).describe("Every id in the collection, once each, in the new order") }).strict();
20
+ const SpaceLinkBody = z.object({ contentId: idSchema.describe("The course, download or community to link") }).strict();
21
+ const CommunityIdParam = z.object({ communityId: z.string() });
22
+ const CommunitySpaceParam = z.object({
23
+ communityId: z.string(),
24
+ spaceId: z.string()
25
+ });
26
+ const SpaceIdParam = z.object({ spaceId: z.string() });
27
+ const SpaceLinkParam = CommunitySpaceParam.extend({ linkId: z.string() });
28
+ const SpaceMemberParam = CommunitySpaceParam.extend({ orgUserId: z.string() });
29
+ const CommunityPostParam = z.object({
30
+ communityId: z.string(),
31
+ postId: z.string()
32
+ });
33
+ const CommunityCommentParam = z.object({
34
+ communityId: z.string(),
35
+ commentId: z.string()
36
+ });
37
+ const CommunityMessageParam = z.object({
38
+ communityId: z.string(),
39
+ messageId: z.string()
40
+ });
41
+ const CommunityChatParam = z.object({
42
+ communityId: z.string(),
43
+ chatId: z.string()
44
+ });
45
+ const CommunityMember = OrgUserProfileSchema.extend({ role: roleSchema });
46
+ const CommunityMembersQuery = PageQuery.extend({ search: z.string().trim().optional() });
47
+ const CommunityMembersPage = paginated(CommunityMember);
48
+ const DirectoryEntry = z.object({
49
+ orgUserId: z.string(),
50
+ role: z.string(),
51
+ displayName: z.string().nullable(),
52
+ headline: z.string().nullable(),
53
+ bio: z.string().nullable(),
54
+ imageAssetId: z.string().nullable(),
55
+ imageUrl: z.string().nullable()
56
+ });
57
+ const DirectoryQuery = PageQuery.extend({ search: z.string().trim().max(100).optional().describe("Matches part of a display name") });
58
+ const DirectoryPage = paginated(DirectoryEntry);
59
+ const CommunityHomeSpaceBase = z.object({
60
+ id: z.string(),
61
+ name: z.string(),
62
+ memberCount: z.number().int().describe("Active space members"),
63
+ accessRule: z.enum([
64
+ "all_members",
65
+ "by_request",
66
+ "by_invite"
67
+ ]),
68
+ standing: z.enum([
69
+ "open",
70
+ "member",
71
+ "requested",
72
+ "invited",
73
+ "full",
74
+ "none"
75
+ ]).describe("Where the viewer stands with this space, and so which action it offers. `open`: the viewer can open it without joining (an all-members space, or staff). `member`: the viewer belongs to it. `requested`: the viewer asked to join and awaits a decision. `invited`: the viewer may accept or refuse an invitation. `full`: it is at capacity. `none`: none of these; ask to join a `by_request` space, or wait for an invitation to a `by_invite` one.")
76
+ });
77
+ const LockedCommunitySpace = CommunityHomeSpaceBase.extend({ locked: z.literal(true).describe("The viewer cannot open this space. Only enough to request a place, accept an invite or contact staff is served; never its description, topics, links or settings") });
78
+ const OpenCommunitySpace = CommunityHomeSpaceBase.extend({
79
+ locked: z.literal(false).describe("The viewer can open this space and read its feed"),
80
+ description: z.string().nullable(),
81
+ capacity: z.number().int().nullable(),
82
+ settings: z.object({
83
+ comments: z.boolean(),
84
+ reactions: z.boolean(),
85
+ requireReview: z.boolean()
86
+ }),
87
+ topics: z.array(z.object({
88
+ id: z.string(),
89
+ name: z.string()
90
+ })),
91
+ links: z.array(z.object({
92
+ id: z.string(),
93
+ contentId: z.string(),
94
+ type: z.enum([
95
+ "course",
96
+ "download",
97
+ "community"
98
+ ]),
99
+ title: z.string()
100
+ })).describe("Linked content that is published; staff also see unpublished targets"),
101
+ subscription: subscriptionViewSchema.nullable().describe("Your mute on this space while it applies; null when none")
102
+ });
103
+ const CommunityHomeSpace = z.discriminatedUnion("locked", [LockedCommunitySpace, OpenCommunitySpace]).describe("A space as the viewer sees it. A by-invite space the viewer is not invited to or a member of is never served");
104
+ const CommunityHome = z.object({
105
+ communityId: z.string(),
106
+ title: z.string(),
107
+ description: z.string(),
108
+ thumbnailUrl: z.string().nullable(),
109
+ dm: dmSettingsSchema,
110
+ spaces: z.array(CommunityHomeSpace)
111
+ });
112
+ const CommunityAnalytics = z.object({
113
+ memberCount: z.number().int(),
114
+ activeMembers: z.number().int(),
115
+ postsPerSpace: z.array(z.object({
116
+ spaceId: z.string(),
117
+ count: z.number().int()
118
+ })),
119
+ commentsPerPost: z.array(z.object({
120
+ postId: z.string(),
121
+ count: z.number().int()
122
+ })),
123
+ messagesSent: z.number().int(),
124
+ flagsRaised: z.number().int(),
125
+ flagsResolved: z.number().int(),
126
+ grantsLapsed: z.number().int(),
127
+ grantsRenewed: z.number().int()
128
+ });
129
+ //#endregion
130
+ export { CommunitiesPage, CommunitiesQuery, Community, CommunityAnalytics, CommunityChatParam, CommunityCommentParam, CommunityHome, CommunityHomeSpace, CommunityIdParam, CommunityMember, CommunityMembersPage, CommunityMembersQuery, CommunityMessageParam, CommunityPostParam, CommunitySpaceParam, CreateCommunity, CreateSpace, DirectoryEntry, DirectoryPage, DirectoryQuery, DmSettings, LockedCommunitySpace, OpenCommunitySpace, OrderedIds, PatchCommunitySettings, PatchDmSettings, SetSpaceTopics, SpaceDetail, SpaceIdParam, SpaceLinkBody, SpaceLinkParam, SpaceMember, SpaceMemberParam, SpaceMembersPage, UpdateCommunity, UpdateSpace };
131
+
132
+ //# sourceMappingURL=community.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"community.js","names":[],"sources":["../../../src/http/schemas/community.ts"],"sourcesContent":["import { z } from 'zod';\nimport {\n communityStatusSchema,\n roleSchema,\n communityViewSchema,\n createCommunityInputSchema,\n createSpaceInputSchema,\n dmSettingsSchema,\n idSchema,\n patchDmSettingsInputSchema,\n patchCommunitySettingsInputSchema,\n setSpaceTopicsInputSchema,\n spaceDetailSchema,\n spaceMemberSchema,\n subscriptionViewSchema,\n updateCommunityInputSchema,\n updateSpaceInputSchema,\n} from '@headless-lms/core/schemas';\nimport type {\n CommunityAnalytics as DomainCommunityAnalytics,\n CommunityMember as DomainCommunityMember,\n} from '@headless-lms/core/reporting/admin';\nimport type {\n CommunityHome as DomainCommunityHome,\n CommunityHomeSpace as DomainCommunityHomeSpace,\n DirectoryEntry as DomainDirectoryEntry,\n} from '@headless-lms/core/reporting/member';\nimport { ListQuery, OrgUserProfileSchema, PageQuery, paginated, type Matches } from './shared.js';\n\nexport const Community = communityViewSchema;\nexport const CommunitiesQuery = ListQuery.extend({\n status: communityStatusSchema.optional(),\n});\nexport const CommunitiesPage = paginated(Community);\nexport const CreateCommunity = createCommunityInputSchema;\nexport const UpdateCommunity = updateCommunityInputSchema;\nexport const PatchDmSettings = patchDmSettingsInputSchema;\nexport const PatchCommunitySettings = patchCommunitySettingsInputSchema;\nexport const DmSettings = dmSettingsSchema;\nexport const SpaceDetail = spaceDetailSchema;\nexport const SpaceMember = spaceMemberSchema;\nexport const SpaceMembersPage = paginated(SpaceMember);\nexport const CreateSpace = createSpaceInputSchema;\nexport const UpdateSpace = updateSpaceInputSchema;\nexport const SetSpaceTopics = setSpaceTopicsInputSchema;\nexport const OrderedIds = z\n .object({\n ids: z\n .array(idSchema)\n .min(1)\n .max(200)\n .describe('Every id in the collection, once each, in the new order'),\n })\n .strict();\nexport const SpaceLinkBody = z\n .object({ contentId: idSchema.describe('The course, download or community to link') })\n .strict();\n\nexport const CommunityIdParam = z.object({ communityId: z.string() });\nexport const CommunitySpaceParam = z.object({ communityId: z.string(), spaceId: z.string() });\nexport const SpaceIdParam = z.object({ spaceId: z.string() });\nexport const SpaceLinkParam = CommunitySpaceParam.extend({ linkId: z.string() });\nexport const SpaceMemberParam = CommunitySpaceParam.extend({ orgUserId: z.string() });\nexport const CommunityPostParam = z.object({ communityId: z.string(), postId: z.string() });\nexport const CommunityCommentParam = z.object({ communityId: z.string(), commentId: z.string() });\nexport const CommunityMessageParam = z.object({ communityId: z.string(), messageId: z.string() });\nexport const CommunityChatParam = z.object({ communityId: z.string(), chatId: z.string() });\n\nexport const CommunityMember = OrgUserProfileSchema.extend({ role: roleSchema });\ntype _CommunityMemberMatches = Matches<DomainCommunityMember, z.infer<typeof CommunityMember>> &\n Matches<z.infer<typeof CommunityMember>, DomainCommunityMember>;\nexport const CommunityMembersQuery = PageQuery.extend({ search: z.string().trim().optional() });\nexport const CommunityMembersPage = paginated(CommunityMember);\n\nexport const DirectoryEntry = z.object({\n orgUserId: z.string(),\n role: z.string(),\n displayName: z.string().nullable(),\n headline: z.string().nullable(),\n bio: z.string().nullable(),\n imageAssetId: z.string().nullable(),\n imageUrl: z.string().nullable(),\n});\ntype _DirectoryMatches = Matches<\n Omit<DomainDirectoryEntry, 'userId'>,\n z.infer<typeof DirectoryEntry>\n> &\n Matches<z.infer<typeof DirectoryEntry>, Omit<DomainDirectoryEntry, 'userId'>>;\nexport const DirectoryQuery = PageQuery.extend({\n search: z.string().trim().max(100).optional().describe('Matches part of a display name'),\n});\nexport const DirectoryPage = paginated(DirectoryEntry);\n\nconst CommunityHomeSpaceBase = z.object({\n id: z.string(),\n name: z.string(),\n memberCount: z.number().int().describe('Active space members'),\n accessRule: z.enum(['all_members', 'by_request', 'by_invite']),\n standing: z\n .enum(['open', 'member', 'requested', 'invited', 'full', 'none'])\n .describe(\n 'Where the viewer stands with this space, and so which action it offers. `open`: the viewer can open it without joining (an all-members space, or staff). `member`: the viewer belongs to it. `requested`: the viewer asked to join and awaits a decision. `invited`: the viewer may accept or refuse an invitation. `full`: it is at capacity. `none`: none of these; ask to join a `by_request` space, or wait for an invitation to a `by_invite` one.',\n ),\n});\n\nexport const LockedCommunitySpace = CommunityHomeSpaceBase.extend({\n locked: z\n .literal(true)\n .describe(\n 'The viewer cannot open this space. Only enough to request a place, accept an invite or contact staff is served; never its description, topics, links or settings',\n ),\n});\n\nexport const OpenCommunitySpace = CommunityHomeSpaceBase.extend({\n locked: z.literal(false).describe('The viewer can open this space and read its feed'),\n description: z.string().nullable(),\n capacity: z.number().int().nullable(),\n settings: z.object({\n comments: z.boolean(),\n reactions: z.boolean(),\n requireReview: z.boolean(),\n }),\n topics: z.array(z.object({ id: z.string(), name: z.string() })),\n links: z\n .array(\n z.object({\n id: z.string(),\n contentId: z.string(),\n type: z.enum(['course', 'download', 'community']),\n title: z.string(),\n }),\n )\n .describe('Linked content that is published; staff also see unpublished targets'),\n subscription: subscriptionViewSchema\n .nullable()\n .describe('Your mute on this space while it applies; null when none'),\n});\n\nexport const CommunityHomeSpace = z\n .discriminatedUnion('locked', [LockedCommunitySpace, OpenCommunitySpace])\n .describe(\n 'A space as the viewer sees it. A by-invite space the viewer is not invited to or a member of is never served',\n );\ntype _HomeSpaceMatches = Matches<DomainCommunityHomeSpace, z.infer<typeof CommunityHomeSpace>> &\n Matches<z.infer<typeof CommunityHomeSpace>, DomainCommunityHomeSpace>;\n\nexport const CommunityHome = z.object({\n communityId: z.string(),\n title: z.string(),\n description: z.string(),\n thumbnailUrl: z.string().nullable(),\n dm: dmSettingsSchema,\n spaces: z.array(CommunityHomeSpace),\n});\ntype _HomeMatches = Matches<DomainCommunityHome, z.infer<typeof CommunityHome>> &\n Matches<z.infer<typeof CommunityHome>, DomainCommunityHome>;\n\nexport const CommunityAnalytics = z.object({\n memberCount: z.number().int(),\n activeMembers: z.number().int(),\n postsPerSpace: z.array(z.object({ spaceId: z.string(), count: z.number().int() })),\n commentsPerPost: z.array(z.object({ postId: z.string(), count: z.number().int() })),\n messagesSent: z.number().int(),\n flagsRaised: z.number().int(),\n flagsResolved: z.number().int(),\n grantsLapsed: z.number().int(),\n grantsRenewed: z.number().int(),\n});\ntype _AnalyticsMatches = Matches<DomainCommunityAnalytics, z.infer<typeof CommunityAnalytics>> &\n Matches<z.infer<typeof CommunityAnalytics>, DomainCommunityAnalytics>;\n"],"mappings":"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"}
@@ -49,6 +49,7 @@ declare const Course: z.ZodObject<{
49
49
  }, z.core.$strict>;
50
50
  createdAt: z.ZodCoercedDate<unknown>;
51
51
  updatedAt: z.ZodCoercedDate<unknown>;
52
+ thumbnailUrl: z.ZodNullable<z.ZodString>;
52
53
  }, z.core.$strict>;
53
54
  type Course = z.infer<typeof Course>;
54
55
  declare const CreateCourse: z.ZodObject<{
@@ -59,8 +60,8 @@ declare const CreateCourse: z.ZodObject<{
59
60
  type CreateCourse = z.infer<typeof CreateCourse>;
60
61
  declare const UpdateCourse: z.ZodObject<{
61
62
  title: z.ZodOptional<z.ZodString>;
62
- description: z.ZodOptional<z.ZodDefault<z.ZodString>>;
63
- category: z.ZodOptional<z.ZodDefault<z.ZodString>>;
63
+ description: z.ZodOptional<z.ZodString>;
64
+ category: z.ZodOptional<z.ZodString>;
64
65
  status: z.ZodOptional<z.ZodEnum<{
65
66
  draft: "draft";
66
67
  published: "published";
@@ -105,6 +106,7 @@ declare const CoursesPage: z.ZodObject<{
105
106
  }, z.core.$strict>;
106
107
  createdAt: z.ZodCoercedDate<unknown>;
107
108
  updatedAt: z.ZodCoercedDate<unknown>;
109
+ thumbnailUrl: z.ZodNullable<z.ZodString>;
108
110
  }, z.core.$strict>>;
109
111
  total: z.ZodNumber;
110
112
  page: z.ZodNumber;
@@ -1,24 +1,27 @@
1
1
  import { ListQuery, paginated } from "./shared.js";
2
2
  import { z } from "zod";
3
- import { courseSchema, courseSettingsSchema, courseStatusSchema } from "@headless-lms/core/schemas";
3
+ import { courseSettingsSchema, courseStatusSchema, courseViewSchema, idSchema } from "@headless-lms/core/schemas";
4
4
  //#region src/http/schemas/content.ts
5
5
  const CourseStatus = courseStatusSchema;
6
6
  const CourseSettings = courseSettingsSchema;
7
7
  const PatchCourseSettings = CourseSettings.partial();
8
- const Course = courseSchema;
8
+ const Course = courseViewSchema;
9
9
  const CreateCourse = z.object({
10
- title: z.string().min(1),
11
- description: z.string().default(""),
12
- category: z.string().default("")
10
+ title: z.string().trim().min(1).max(200),
11
+ description: z.string().max(5e3).default(""),
12
+ category: z.string().trim().max(100).default("")
13
13
  });
14
- const UpdateCourse = CreateCourse.partial().extend({
14
+ const UpdateCourse = z.object({
15
+ title: z.string().trim().min(1).max(200).optional(),
16
+ description: z.string().max(5e3).optional(),
17
+ category: z.string().trim().max(100).optional(),
15
18
  status: CourseStatus.optional(),
16
19
  /** null clears the cover. */
17
- thumbnailAssetId: z.string().nullable().optional()
20
+ thumbnailAssetId: idSchema.nullable().optional()
18
21
  });
19
22
  const CoursesQuery = ListQuery.extend({
20
23
  status: CourseStatus.optional(),
21
- category: z.string().optional()
24
+ category: z.string().trim().max(100).optional()
22
25
  });
23
26
  const CoursesPage = paginated(Course);
24
27
  const CourseIdParam = z.object({ id: z.string() });
@@ -1 +1 @@
1
- {"version":3,"file":"content.js","names":[],"sources":["../../../src/http/schemas/content.ts"],"sourcesContent":["// Content resource schemas (courses). The Course payload shape is owned by\n// @headless-lms/core/schemas; route-local schemas define endpoint-only\n// concerns such as defaults, params, and pagination envelopes.\nimport { z } from 'zod';\nimport { courseSchema, courseSettingsSchema, courseStatusSchema } from '@headless-lms/core/schemas';\nimport { ListQuery, paginated } from './shared.js';\n\nexport const CourseStatus = courseStatusSchema;\nexport type CourseStatus = z.infer<typeof CourseStatus>;\n\nexport const CourseSettings = courseSettingsSchema;\nexport type CourseSettings = z.infer<typeof CourseSettings>;\n\nexport const PatchCourseSettings = CourseSettings.partial();\nexport type PatchCourseSettings = z.infer<typeof PatchCourseSettings>;\n\nexport const Course = courseSchema;\nexport type Course = z.infer<typeof Course>;\n\nexport const CreateCourse = z.object({\n title: z.string().min(1),\n description: z.string().default(''),\n category: z.string().default(''),\n});\nexport type CreateCourse = z.infer<typeof CreateCourse>;\n\nexport const UpdateCourse = CreateCourse.partial().extend({\n status: CourseStatus.optional(),\n /** null clears the cover. */\n thumbnailAssetId: z.string().nullable().optional(),\n});\nexport type UpdateCourse = z.infer<typeof UpdateCourse>;\n\nexport const CoursesQuery = ListQuery.extend({\n status: CourseStatus.optional(),\n category: z.string().optional(),\n});\nexport type CoursesQuery = z.infer<typeof CoursesQuery>;\n\nexport const CoursesPage = paginated(Course);\nexport type CoursesPage = z.infer<typeof CoursesPage>;\n\nexport const CourseIdParam = z.object({ id: z.string() });\nexport type CourseIdParam = z.infer<typeof CourseIdParam>;\n"],"mappings":";;;;AAOA,MAAa,eAAe;AAG5B,MAAa,iBAAiB;AAG9B,MAAa,sBAAsB,eAAe,QAAQ;AAG1D,MAAa,SAAS;AAGtB,MAAa,eAAe,EAAE,OAAO;CACnC,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CACvB,aAAa,EAAE,OAAO,CAAC,CAAC,QAAQ,EAAE;CAClC,UAAU,EAAE,OAAO,CAAC,CAAC,QAAQ,EAAE;AACjC,CAAC;AAGD,MAAa,eAAe,aAAa,QAAQ,CAAC,CAAC,OAAO;CACxD,QAAQ,aAAa,SAAS;;CAE9B,kBAAkB,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;AACnD,CAAC;AAGD,MAAa,eAAe,UAAU,OAAO;CAC3C,QAAQ,aAAa,SAAS;CAC9B,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS;AAChC,CAAC;AAGD,MAAa,cAAc,UAAU,MAAM;AAG3C,MAAa,gBAAgB,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"content.js","names":[],"sources":["../../../src/http/schemas/content.ts"],"sourcesContent":["// Content resource schemas (courses). The Course payload shape is owned by\n// @headless-lms/core/schemas; route-local schemas define endpoint-only\n// concerns such as defaults, params, and pagination envelopes.\nimport { z } from 'zod';\nimport {\n courseSettingsSchema,\n courseStatusSchema,\n courseViewSchema,\n idSchema,\n} from '@headless-lms/core/schemas';\nimport { ListQuery, paginated } from './shared.js';\n\nexport const CourseStatus = courseStatusSchema;\nexport type CourseStatus = z.infer<typeof CourseStatus>;\n\nexport const CourseSettings = courseSettingsSchema;\nexport type CourseSettings = z.infer<typeof CourseSettings>;\n\nexport const PatchCourseSettings = CourseSettings.partial();\nexport type PatchCourseSettings = z.infer<typeof PatchCourseSettings>;\n\nexport const Course = courseViewSchema;\nexport type Course = z.infer<typeof Course>;\n\nexport const CreateCourse = z.object({\n title: z.string().trim().min(1).max(200),\n description: z.string().max(5_000).default(''),\n category: z.string().trim().max(100).default(''),\n});\nexport type CreateCourse = z.infer<typeof CreateCourse>;\n\nexport const UpdateCourse = z.object({\n title: z.string().trim().min(1).max(200).optional(),\n description: z.string().max(5_000).optional(),\n category: z.string().trim().max(100).optional(),\n status: CourseStatus.optional(),\n /** null clears the cover. */\n thumbnailAssetId: idSchema.nullable().optional(),\n});\nexport type UpdateCourse = z.infer<typeof UpdateCourse>;\n\nexport const CoursesQuery = ListQuery.extend({\n status: CourseStatus.optional(),\n category: z.string().trim().max(100).optional(),\n});\nexport type CoursesQuery = z.infer<typeof CoursesQuery>;\n\nexport const CoursesPage = paginated(Course);\nexport type CoursesPage = z.infer<typeof CoursesPage>;\n\nexport const CourseIdParam = z.object({ id: z.string() });\nexport type CourseIdParam = z.infer<typeof CourseIdParam>;\n"],"mappings":";;;;AAYA,MAAa,eAAe;AAG5B,MAAa,iBAAiB;AAG9B,MAAa,sBAAsB,eAAe,QAAQ;AAG1D,MAAa,SAAS;AAGtB,MAAa,eAAe,EAAE,OAAO;CACnC,OAAO,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG;CACvC,aAAa,EAAE,OAAO,CAAC,CAAC,IAAI,GAAK,CAAC,CAAC,QAAQ,EAAE;CAC7C,UAAU,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE;AACjD,CAAC;AAGD,MAAa,eAAe,EAAE,OAAO;CACnC,OAAO,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,SAAS;CAClD,aAAa,EAAE,OAAO,CAAC,CAAC,IAAI,GAAK,CAAC,CAAC,SAAS;CAC5C,UAAU,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,SAAS;CAC9C,QAAQ,aAAa,SAAS;;CAE9B,kBAAkB,SAAS,SAAS,CAAC,CAAC,SAAS;AACjD,CAAC;AAGD,MAAa,eAAe,UAAU,OAAO;CAC3C,QAAQ,aAAa,SAAS;CAC9B,UAAU,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,SAAS;AAChD,CAAC;AAGD,MAAa,cAAc,UAAU,MAAM;AAG3C,MAAa,gBAAgB,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC"}
@@ -10,11 +10,16 @@ declare const CommentAuthor: z.ZodObject<{
10
10
  id: z.ZodString;
11
11
  firstName: z.ZodNullable<z.ZodString>;
12
12
  lastName: z.ZodNullable<z.ZodString>;
13
+ displayName: z.ZodNullable<z.ZodString>;
14
+ headline: z.ZodNullable<z.ZodString>;
13
15
  image: z.ZodNullable<z.ZodString>;
16
+ imageAssetId: z.ZodNullable<z.ZodString>;
17
+ imageUrl: z.ZodNullable<z.ZodString>;
14
18
  role: z.ZodEnum<{
15
19
  owner: "owner";
16
20
  admin: "admin";
17
21
  instructor: "instructor";
22
+ moderator: "moderator";
18
23
  student: "student";
19
24
  }>;
20
25
  }, z.core.$strict>;
@@ -25,19 +30,40 @@ type ReactionEmoji = z.infer<typeof ReactionEmoji>;
25
30
  /** Counts by emoji; unused ones are absent, so no reactions serves `{}`. */
26
31
  declare const ReactionCounts: z.ZodRecord<z.ZodString, z.ZodNumber>;
27
32
  type ReactionCounts = z.infer<typeof ReactionCounts>;
33
+ declare const SetPostSubscription: z.ZodDiscriminatedUnion<[z.ZodObject<{
34
+ state: z.ZodLiteral<"following">;
35
+ }, z.core.$strict>, z.ZodObject<{
36
+ state: z.ZodLiteral<"muted">;
37
+ mutedUntil: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodISODateTime, z.ZodCoercedDate<string>>>>;
38
+ }, z.core.$strict>, z.ZodObject<{
39
+ state: z.ZodLiteral<"none">;
40
+ }, z.core.$strict>], "state">;
41
+ declare const SetMute: z.ZodDiscriminatedUnion<[z.ZodObject<{
42
+ state: z.ZodLiteral<"muted">;
43
+ mutedUntil: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodISODateTime, z.ZodCoercedDate<string>>>>;
44
+ }, z.core.$strict>, z.ZodObject<{
45
+ state: z.ZodLiteral<"none">;
46
+ }, z.core.$strict>], "state">;
28
47
  declare const CommentView: z.ZodObject<{
29
48
  id: z.ZodString;
30
- activityId: z.ZodString;
49
+ activityId: z.ZodNullable<z.ZodString>;
50
+ postId: z.ZodNullable<z.ZodString>;
51
+ communityId: z.ZodNullable<z.ZodString>;
31
52
  parentId: z.ZodNullable<z.ZodString>;
32
53
  author: z.ZodObject<{
33
54
  id: z.ZodString;
34
55
  firstName: z.ZodNullable<z.ZodString>;
35
56
  lastName: z.ZodNullable<z.ZodString>;
57
+ displayName: z.ZodNullable<z.ZodString>;
58
+ headline: z.ZodNullable<z.ZodString>;
36
59
  image: z.ZodNullable<z.ZodString>;
60
+ imageAssetId: z.ZodNullable<z.ZodString>;
61
+ imageUrl: z.ZodNullable<z.ZodString>;
37
62
  role: z.ZodEnum<{
38
63
  owner: "owner";
39
64
  admin: "admin";
40
65
  instructor: "instructor";
66
+ moderator: "moderator";
41
67
  student: "student";
42
68
  }>;
43
69
  }, z.core.$strict>;
@@ -51,26 +77,35 @@ declare const CommentView: z.ZodObject<{
51
77
  id: z.ZodString;
52
78
  firstName: z.ZodNullable<z.ZodString>;
53
79
  lastName: z.ZodNullable<z.ZodString>;
80
+ displayName: z.ZodNullable<z.ZodString>;
81
+ headline: z.ZodNullable<z.ZodString>;
54
82
  image: z.ZodNullable<z.ZodString>;
83
+ imageAssetId: z.ZodNullable<z.ZodString>;
84
+ imageUrl: z.ZodNullable<z.ZodString>;
55
85
  role: z.ZodEnum<{
56
86
  owner: "owner";
57
87
  admin: "admin";
58
88
  instructor: "instructor";
89
+ moderator: "moderator";
59
90
  student: "student";
60
91
  }>;
61
92
  }, z.core.$strict>>;
62
93
  reactions: z.ZodRecord<z.ZodString, z.ZodNumber>;
63
94
  viewerReaction: z.ZodOptional<z.ZodString>;
95
+ mentions: z.ZodArray<z.ZodObject<{
96
+ orgUserId: z.ZodString;
97
+ name: z.ZodString;
98
+ }, z.core.$strict>>;
64
99
  createdAt: z.ZodCoercedDate<unknown>;
65
100
  updatedAt: z.ZodCoercedDate<unknown>;
66
101
  }, z.core.$strict>;
67
102
  type CommentView = z.infer<typeof CommentView>;
68
- /** What the reaction write returns, so the client never recomputes a count. */
69
- declare const CommentReactions: z.ZodObject<{
103
+ /** What a reaction write on a post, message or comment returns, so the client never recomputes a count. */
104
+ declare const Reactions: z.ZodObject<{
70
105
  reactions: z.ZodRecord<z.ZodString, z.ZodNumber>;
71
106
  viewerReaction: z.ZodOptional<z.ZodString>;
72
107
  }, z.core.$strip>;
73
- type CommentReactions = z.infer<typeof CommentReactions>;
108
+ type Reactions = z.infer<typeof Reactions>;
74
109
  /** A course's comment settings. Stored under the course, carried on the course
75
110
  * payload as `settings.comments`. */
76
111
  declare const CommentSettings: z.ZodObject<{
@@ -98,17 +133,24 @@ declare const ActivityComments: z.ZodObject<{
98
133
  }, z.core.$strip>;
99
134
  comments: z.ZodArray<z.ZodObject<{
100
135
  id: z.ZodString;
101
- activityId: z.ZodString;
136
+ activityId: z.ZodNullable<z.ZodString>;
137
+ postId: z.ZodNullable<z.ZodString>;
138
+ communityId: z.ZodNullable<z.ZodString>;
102
139
  parentId: z.ZodNullable<z.ZodString>;
103
140
  author: z.ZodObject<{
104
141
  id: z.ZodString;
105
142
  firstName: z.ZodNullable<z.ZodString>;
106
143
  lastName: z.ZodNullable<z.ZodString>;
144
+ displayName: z.ZodNullable<z.ZodString>;
145
+ headline: z.ZodNullable<z.ZodString>;
107
146
  image: z.ZodNullable<z.ZodString>;
147
+ imageAssetId: z.ZodNullable<z.ZodString>;
148
+ imageUrl: z.ZodNullable<z.ZodString>;
108
149
  role: z.ZodEnum<{
109
150
  owner: "owner";
110
151
  admin: "admin";
111
152
  instructor: "instructor";
153
+ moderator: "moderator";
112
154
  student: "student";
113
155
  }>;
114
156
  }, z.core.$strict>;
@@ -122,16 +164,25 @@ declare const ActivityComments: z.ZodObject<{
122
164
  id: z.ZodString;
123
165
  firstName: z.ZodNullable<z.ZodString>;
124
166
  lastName: z.ZodNullable<z.ZodString>;
167
+ displayName: z.ZodNullable<z.ZodString>;
168
+ headline: z.ZodNullable<z.ZodString>;
125
169
  image: z.ZodNullable<z.ZodString>;
170
+ imageAssetId: z.ZodNullable<z.ZodString>;
171
+ imageUrl: z.ZodNullable<z.ZodString>;
126
172
  role: z.ZodEnum<{
127
173
  owner: "owner";
128
174
  admin: "admin";
129
175
  instructor: "instructor";
176
+ moderator: "moderator";
130
177
  student: "student";
131
178
  }>;
132
179
  }, z.core.$strict>>;
133
180
  reactions: z.ZodRecord<z.ZodString, z.ZodNumber>;
134
181
  viewerReaction: z.ZodOptional<z.ZodString>;
182
+ mentions: z.ZodArray<z.ZodObject<{
183
+ orgUserId: z.ZodString;
184
+ name: z.ZodString;
185
+ }, z.core.$strict>>;
135
186
  createdAt: z.ZodCoercedDate<unknown>;
136
187
  updatedAt: z.ZodCoercedDate<unknown>;
137
188
  }, z.core.$strict>>;
@@ -140,24 +191,30 @@ type ActivityComments = z.infer<typeof ActivityComments>;
140
191
  declare const PostComment: z.ZodObject<{
141
192
  body: z.ZodString;
142
193
  parentId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
143
- }, z.core.$strip>;
194
+ }, z.core.$strict>;
144
195
  type PostComment = z.infer<typeof PostComment>;
145
196
  declare const EditComment: z.ZodObject<{
146
197
  body: z.ZodString;
147
- }, z.core.$strip>;
198
+ }, z.core.$strict>;
148
199
  type EditComment = z.infer<typeof EditComment>;
149
200
  /** The staff PATCH writes status and nothing else: publishing covers approving
150
201
  * a pending comment and restoring a removed one. Revising the text is the
151
- * author's own edit, under /api/learn. */
202
+ * author's own edit, under /api/member. */
152
203
  declare const PatchComment: z.ZodObject<{
153
204
  status: z.ZodLiteral<"published">;
154
205
  }, z.core.$strip>;
155
206
  type PatchComment = z.infer<typeof PatchComment>;
156
207
  /** Replaces whatever the reader had. Clearing is DELETE, which carries no body. */
157
- declare const SetCommentReaction: z.ZodObject<{
208
+ declare const SetReaction: z.ZodObject<{
158
209
  emoji: z.ZodString;
159
- }, z.core.$strip>;
160
- type SetCommentReaction = z.infer<typeof SetCommentReaction>;
210
+ }, z.core.$strict>;
211
+ type SetReaction = z.infer<typeof SetReaction>;
212
+ declare const ResolveCommentFlags: z.ZodObject<{
213
+ resolution: z.ZodEnum<{
214
+ dismissed: "dismissed";
215
+ }>;
216
+ }, z.core.$strict>;
217
+ type ResolveCommentFlags = z.infer<typeof ResolveCommentFlags>;
161
218
  /** A moderator's reply, posted from the queue against the comment it answers. */
162
219
  declare const ReplyToComment: z.ZodObject<{
163
220
  body: z.ZodString;
@@ -165,12 +222,14 @@ declare const ReplyToComment: z.ZodObject<{
165
222
  type ReplyToComment = z.infer<typeof ReplyToComment>;
166
223
  declare const ReportComment: z.ZodObject<{
167
224
  reason: z.ZodDefault<z.ZodString>;
168
- }, z.core.$strip>;
225
+ }, z.core.$strict>;
169
226
  type ReportComment = z.infer<typeof ReportComment>;
170
227
  declare const Comment: z.ZodObject<{
171
228
  id: z.ZodString;
172
229
  orgId: z.ZodString;
173
- activityId: z.ZodString;
230
+ activityId: z.ZodNullable<z.ZodString>;
231
+ postId: z.ZodNullable<z.ZodString>;
232
+ communityId: z.ZodNullable<z.ZodString>;
174
233
  parentId: z.ZodNullable<z.ZodString>;
175
234
  orgUserId: z.ZodString;
176
235
  body: z.ZodString;
@@ -200,11 +259,16 @@ declare const CommentReportSummary: z.ZodObject<{
200
259
  id: z.ZodString;
201
260
  firstName: z.ZodNullable<z.ZodString>;
202
261
  lastName: z.ZodNullable<z.ZodString>;
262
+ displayName: z.ZodNullable<z.ZodString>;
263
+ headline: z.ZodNullable<z.ZodString>;
203
264
  image: z.ZodNullable<z.ZodString>;
265
+ imageAssetId: z.ZodNullable<z.ZodString>;
266
+ imageUrl: z.ZodNullable<z.ZodString>;
204
267
  role: z.ZodEnum<{
205
268
  owner: "owner";
206
269
  admin: "admin";
207
270
  instructor: "instructor";
271
+ moderator: "moderator";
208
272
  student: "student";
209
273
  }>;
210
274
  }, z.core.$strict>;
@@ -230,11 +294,16 @@ declare const CommentListItem: z.ZodObject<{
230
294
  id: z.ZodString;
231
295
  firstName: z.ZodNullable<z.ZodString>;
232
296
  lastName: z.ZodNullable<z.ZodString>;
297
+ displayName: z.ZodNullable<z.ZodString>;
298
+ headline: z.ZodNullable<z.ZodString>;
233
299
  image: z.ZodNullable<z.ZodString>;
300
+ imageAssetId: z.ZodNullable<z.ZodString>;
301
+ imageUrl: z.ZodNullable<z.ZodString>;
234
302
  role: z.ZodEnum<{
235
303
  owner: "owner";
236
304
  admin: "admin";
237
305
  instructor: "instructor";
306
+ moderator: "moderator";
238
307
  student: "student";
239
308
  }>;
240
309
  }, z.core.$strict>;
@@ -245,11 +314,16 @@ declare const CommentListItem: z.ZodObject<{
245
314
  id: z.ZodString;
246
315
  firstName: z.ZodNullable<z.ZodString>;
247
316
  lastName: z.ZodNullable<z.ZodString>;
317
+ displayName: z.ZodNullable<z.ZodString>;
318
+ headline: z.ZodNullable<z.ZodString>;
248
319
  image: z.ZodNullable<z.ZodString>;
320
+ imageAssetId: z.ZodNullable<z.ZodString>;
321
+ imageUrl: z.ZodNullable<z.ZodString>;
249
322
  role: z.ZodEnum<{
250
323
  owner: "owner";
251
324
  admin: "admin";
252
325
  instructor: "instructor";
326
+ moderator: "moderator";
253
327
  student: "student";
254
328
  }>;
255
329
  }, z.core.$strict>;
@@ -293,11 +367,16 @@ declare const CommentsPage: z.ZodObject<{
293
367
  id: z.ZodString;
294
368
  firstName: z.ZodNullable<z.ZodString>;
295
369
  lastName: z.ZodNullable<z.ZodString>;
370
+ displayName: z.ZodNullable<z.ZodString>;
371
+ headline: z.ZodNullable<z.ZodString>;
296
372
  image: z.ZodNullable<z.ZodString>;
373
+ imageAssetId: z.ZodNullable<z.ZodString>;
374
+ imageUrl: z.ZodNullable<z.ZodString>;
297
375
  role: z.ZodEnum<{
298
376
  owner: "owner";
299
377
  admin: "admin";
300
378
  instructor: "instructor";
379
+ moderator: "moderator";
301
380
  student: "student";
302
381
  }>;
303
382
  }, z.core.$strict>;
@@ -308,11 +387,16 @@ declare const CommentsPage: z.ZodObject<{
308
387
  id: z.ZodString;
309
388
  firstName: z.ZodNullable<z.ZodString>;
310
389
  lastName: z.ZodNullable<z.ZodString>;
390
+ displayName: z.ZodNullable<z.ZodString>;
391
+ headline: z.ZodNullable<z.ZodString>;
311
392
  image: z.ZodNullable<z.ZodString>;
393
+ imageAssetId: z.ZodNullable<z.ZodString>;
394
+ imageUrl: z.ZodNullable<z.ZodString>;
312
395
  role: z.ZodEnum<{
313
396
  owner: "owner";
314
397
  admin: "admin";
315
398
  instructor: "instructor";
399
+ moderator: "moderator";
316
400
  student: "student";
317
401
  }>;
318
402
  }, z.core.$strict>;
@@ -336,5 +420,5 @@ declare const CommentIdParam: z.ZodObject<{
336
420
  }, z.core.$strip>;
337
421
  type CommentIdParam = z.infer<typeof CommentIdParam>;
338
422
  //#endregion
339
- export { ActivityComments, Comment, CommentAuthor, CommentIdParam, CommentListItem, CommentReactions, CommentReport, CommentReportSummary, CommentSettings, CommentStatus, CommentView, CommentsConfig, CommentsPage, CommentsQuery, DiscussionActivityParam, EditComment, PatchComment, PostComment, ReactionCounts, ReactionEmoji, ReplyToComment, ReportComment, SetCommentReaction };
423
+ export { ActivityComments, Comment, CommentAuthor, CommentIdParam, CommentListItem, CommentReport, CommentReportSummary, CommentSettings, CommentStatus, CommentView, CommentsConfig, CommentsPage, CommentsQuery, DiscussionActivityParam, EditComment, PatchComment, PostComment, ReactionCounts, ReactionEmoji, Reactions, ReplyToComment, ReportComment, ResolveCommentFlags, SetMute, SetPostSubscription, SetReaction };
340
424
  //# sourceMappingURL=discussion.d.ts.map
@@ -1,6 +1,6 @@
1
- import { ListQuery, paginated } from "./shared.js";
1
+ import { DateTimeInput, ListQuery, paginated } from "./shared.js";
2
2
  import { z } from "zod";
3
- import { commentAuthorSchema, commentListItemSchema, commentReportSummarySchema, commentSchema, commentStatusSchema, commentViewSchema } from "@headless-lms/core/schemas";
3
+ import { commentAuthorSchema, commentFlagResolutionSchema, commentListItemSchema, commentReportSummarySchema, commentSchema, commentStatusSchema, commentViewSchema, idSchema } from "@headless-lms/core/schemas";
4
4
  //#region src/http/schemas/discussion.ts
5
5
  const CommentStatus = commentStatusSchema;
6
6
  const CommentAuthor = commentAuthorSchema;
@@ -8,11 +8,23 @@ const CommentAuthor = commentAuthorSchema;
8
8
  const ReactionEmoji = z.string().min(1).max(16);
9
9
  /** Counts by emoji; unused ones are absent, so no reactions serves `{}`. */
10
10
  const ReactionCounts = z.record(z.string(), z.number().int());
11
+ const Following = z.object({ state: z.literal("following") }).strict().describe("Follow the post: you are notified of its new comments");
12
+ const Muted = z.object({
13
+ state: z.literal("muted"),
14
+ mutedUntil: DateTimeInput.nullable().optional().describe("When the mute ends. Omit or null to mute until you change it")
15
+ }).strict().describe("Mute it: its activity stops notifying you, except mentions and actions on you");
16
+ const Unsubscribed = z.object({ state: z.literal("none") }).strict().describe("Neither follow nor mute it");
17
+ const SetPostSubscription = z.discriminatedUnion("state", [
18
+ Following,
19
+ Muted,
20
+ Unsubscribed
21
+ ]);
22
+ const SetMute = z.discriminatedUnion("state", [Muted, Unsubscribed]);
11
23
  const CommentView = commentViewSchema;
12
- /** What the reaction write returns, so the client never recomputes a count. */
13
- const CommentReactions = z.object({
24
+ /** What a reaction write on a post, message or comment returns, so the client never recomputes a count. */
25
+ const Reactions = z.object({
14
26
  reactions: ReactionCounts,
15
- viewerReaction: ReactionEmoji.optional()
27
+ viewerReaction: ReactionEmoji.optional().describe("Absent when you have no reaction")
16
28
  });
17
29
  /** A course's comment settings. Stored under the course, carried on the course
18
30
  * payload as `settings.comments`. */
@@ -31,18 +43,19 @@ const ActivityComments = z.object({
31
43
  });
32
44
  const PostComment = z.object({
33
45
  body: z.string().min(1).max(1e4),
34
- parentId: z.string().nullable().default(null)
35
- });
36
- const EditComment = z.object({ body: z.string().min(1).max(1e4) });
46
+ parentId: idSchema.nullable().default(null).describe("The comment this replies to. Replies nest one level, under a root comment")
47
+ }).strict();
48
+ const EditComment = z.object({ body: z.string().min(1).max(1e4) }).strict();
37
49
  /** The staff PATCH writes status and nothing else: publishing covers approving
38
50
  * a pending comment and restoring a removed one. Revising the text is the
39
- * author's own edit, under /api/learn. */
51
+ * author's own edit, under /api/member. */
40
52
  const PatchComment = z.object({ status: z.literal("published") });
41
53
  /** Replaces whatever the reader had. Clearing is DELETE, which carries no body. */
42
- const SetCommentReaction = z.object({ emoji: ReactionEmoji });
54
+ const SetReaction = z.object({ emoji: ReactionEmoji.describe("Replaces any reaction you already had") }).strict();
55
+ const ResolveCommentFlags = z.object({ resolution: commentFlagResolutionSchema.extract(["dismissed"]).describe("`dismissed` closes the open flags and leaves the comment up. Removing the comment resolves its flags as `removed` instead.") }).strict();
43
56
  /** A moderator's reply, posted from the queue against the comment it answers. */
44
57
  const ReplyToComment = z.object({ body: z.string().min(1).max(1e4) });
45
- const ReportComment = z.object({ reason: z.string().max(1e3).default("") });
58
+ const ReportComment = z.object({ reason: z.string().max(1e3).default("") }).strict();
46
59
  const Comment = commentSchema;
47
60
  const CommentReport = z.object({
48
61
  id: z.string(),
@@ -73,6 +86,6 @@ const CommentsPage = paginated(CommentListItem);
73
86
  const DiscussionActivityParam = z.object({ activityId: z.string() });
74
87
  const CommentIdParam = z.object({ commentId: z.string() });
75
88
  //#endregion
76
- export { ActivityComments, Comment, CommentAuthor, CommentIdParam, CommentListItem, CommentReactions, CommentReport, CommentReportSummary, CommentSettings, CommentStatus, CommentView, CommentsConfig, CommentsPage, CommentsQuery, DiscussionActivityParam, EditComment, PatchComment, PostComment, ReactionCounts, ReactionEmoji, ReplyToComment, ReportComment, SetCommentReaction };
89
+ export { ActivityComments, Comment, CommentAuthor, CommentIdParam, CommentListItem, CommentReport, CommentReportSummary, CommentSettings, CommentStatus, CommentView, CommentsConfig, CommentsPage, CommentsQuery, DiscussionActivityParam, EditComment, PatchComment, PostComment, ReactionCounts, ReactionEmoji, Reactions, ReplyToComment, ReportComment, ResolveCommentFlags, SetMute, SetPostSubscription, SetReaction };
77
90
 
78
91
  //# sourceMappingURL=discussion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"discussion.js","names":[],"sources":["../../../src/http/schemas/discussion.ts"],"sourcesContent":["// Discussion resource schemas. Comments attach to an activity; settings are\n// per course, with a per-activity override carried on the activity's own\n// settings blob rather than a resource of its own.\n//\n// The author is the org user's profile minus its email — learners read each\n// other's comments and the list must not be a directory of the cohort's\n// addresses. The staff-facing comment list carries `authorEmail` separately.\nimport type { CommentSettings as DomainCommentSettings } from '@headless-lms/core/types';\nimport {\n commentAuthorSchema,\n commentListItemSchema,\n commentReportSummarySchema,\n commentSchema,\n commentStatusSchema,\n commentViewSchema,\n} from '@headless-lms/core/schemas';\nimport { z } from 'zod';\nimport { ListQuery, type Matches, paginated } from './shared.js';\n\nexport const CommentStatus = commentStatusSchema;\nexport type CommentStatus = z.infer<typeof CommentStatus>;\n\nexport const CommentAuthor = commentAuthorSchema;\nexport type CommentAuthor = z.infer<typeof CommentAuthor>;\n\n/** Any single emoji. Open, so widening the picker needs no schema change. */\nexport const ReactionEmoji = z.string().min(1).max(16);\nexport type ReactionEmoji = z.infer<typeof ReactionEmoji>;\n\n/** Counts by emoji; unused ones are absent, so no reactions serves `{}`. */\nexport const ReactionCounts = z.record(z.string(), z.number().int());\nexport type ReactionCounts = z.infer<typeof ReactionCounts>;\n\nexport const CommentView = commentViewSchema;\nexport type CommentView = z.infer<typeof CommentView>;\n\n/** What the reaction write returns, so the client never recomputes a count. */\nexport const CommentReactions = z.object({\n reactions: ReactionCounts,\n viewerReaction: ReactionEmoji.optional(),\n});\nexport type CommentReactions = z.infer<typeof CommentReactions>;\n\n/** A course's comment settings. Stored under the course, carried on the course\n * payload as `settings.comments`. */\nexport const CommentSettings = z.object({\n enabled: z.boolean(),\n threaded: z.boolean(),\n requireReview: z.boolean(),\n reactions: z.boolean(),\n});\nexport type CommentSettings = z.infer<typeof CommentSettings>;\ntype _CommentSettingsMatchesDomain = Matches<DomainCommentSettings, CommentSettings> &\n Matches<CommentSettings, DomainCommentSettings>;\n\n/** The course settings with the activity's override applied: `enabled` is the\n * resolved answer for this activity, not the course switch. */\nexport const CommentsConfig = CommentSettings;\nexport type CommentsConfig = z.infer<typeof CommentsConfig>;\n\nexport const ActivityComments = z.object({\n config: CommentsConfig,\n comments: z.array(CommentView),\n});\nexport type ActivityComments = z.infer<typeof ActivityComments>;\n\nexport const PostComment = z.object({\n body: z.string().min(1).max(10_000),\n parentId: z.string().nullable().default(null),\n});\nexport type PostComment = z.infer<typeof PostComment>;\n\nexport const EditComment = z.object({\n body: z.string().min(1).max(10_000),\n});\nexport type EditComment = z.infer<typeof EditComment>;\n\n/** The staff PATCH writes status and nothing else: publishing covers approving\n * a pending comment and restoring a removed one. Revising the text is the\n * author's own edit, under /api/learn. */\nexport const PatchComment = z.object({\n status: z.literal('published'),\n});\nexport type PatchComment = z.infer<typeof PatchComment>;\n\n/** Replaces whatever the reader had. Clearing is DELETE, which carries no body. */\nexport const SetCommentReaction = z.object({\n emoji: ReactionEmoji,\n});\nexport type SetCommentReaction = z.infer<typeof SetCommentReaction>;\n\n/** A moderator's reply, posted from the queue against the comment it answers. */\nexport const ReplyToComment = z.object({\n body: z.string().min(1).max(10_000),\n});\nexport type ReplyToComment = z.infer<typeof ReplyToComment>;\n\nexport const ReportComment = z.object({\n reason: z.string().max(1_000).default(''),\n});\nexport type ReportComment = z.infer<typeof ReportComment>;\n\nexport const Comment = commentSchema;\nexport type Comment = z.infer<typeof Comment>;\n\nexport const CommentReport = z.object({\n id: z.string(),\n commentId: z.string(),\n orgUserId: z.string(),\n reason: z.string(),\n resolvedAt: z.date().nullable(),\n createdAt: z.date(),\n});\nexport type CommentReport = z.infer<typeof CommentReport>;\n\n/** An unresolved report on a listed comment. Resolved ones are history and are\n * never served here. */\nexport const CommentReportSummary = commentReportSummarySchema;\nexport type CommentReportSummary = z.infer<typeof CommentReportSummary>;\n\n/** One row of the staff comment list: the comment plus the context a\n * moderation decision needs, so the list needs no follow-up request. */\nexport const CommentListItem = commentListItemSchema;\nexport type CommentListItem = z.infer<typeof CommentListItem>;\n\nexport const CommentsQuery = ListQuery.extend({\n status: CommentStatus.optional(),\n /** true = only comments carrying an unresolved report, false = only those\n * carrying none. `z.stringbool` because query values arrive as strings and\n * `z.coerce.boolean()` would read \"false\" as true. */\n reported: z.stringbool().optional(),\n courseId: z.string().optional(),\n activityId: z.string().optional(),\n /** Scope to one author (org_users.id). */\n orgUserId: z.string().optional(),\n});\nexport type CommentsQuery = z.infer<typeof CommentsQuery>;\n\nexport const CommentsPage = paginated(CommentListItem);\nexport type CommentsPage = z.infer<typeof CommentsPage>;\n\nexport const DiscussionActivityParam = z.object({ activityId: z.string() });\nexport type DiscussionActivityParam = z.infer<typeof DiscussionActivityParam>;\n\nexport const CommentIdParam = z.object({ commentId: z.string() });\nexport type CommentIdParam = z.infer<typeof CommentIdParam>;\n"],"mappings":";;;;AAmBA,MAAa,gBAAgB;AAG7B,MAAa,gBAAgB;;AAI7B,MAAa,gBAAgB,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE;;AAIrD,MAAa,iBAAiB,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;AAGnE,MAAa,cAAc;;AAI3B,MAAa,mBAAmB,EAAE,OAAO;CACvC,WAAW;CACX,gBAAgB,cAAc,SAAS;AACzC,CAAC;;;AAKD,MAAa,kBAAkB,EAAE,OAAO;CACtC,SAAS,EAAE,QAAQ;CACnB,UAAU,EAAE,QAAQ;CACpB,eAAe,EAAE,QAAQ;CACzB,WAAW,EAAE,QAAQ;AACvB,CAAC;;;AAOD,MAAa,iBAAiB;AAG9B,MAAa,mBAAmB,EAAE,OAAO;CACvC,QAAQ;CACR,UAAU,EAAE,MAAM,WAAW;AAC/B,CAAC;AAGD,MAAa,cAAc,EAAE,OAAO;CAClC,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAM;CAClC,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,IAAI;AAC9C,CAAC;AAGD,MAAa,cAAc,EAAE,OAAO,EAClC,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAM,EACpC,CAAC;;;;AAMD,MAAa,eAAe,EAAE,OAAO,EACnC,QAAQ,EAAE,QAAQ,WAAW,EAC/B,CAAC;;AAID,MAAa,qBAAqB,EAAE,OAAO,EACzC,OAAO,cACT,CAAC;;AAID,MAAa,iBAAiB,EAAE,OAAO,EACrC,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAM,EACpC,CAAC;AAGD,MAAa,gBAAgB,EAAE,OAAO,EACpC,QAAQ,EAAE,OAAO,CAAC,CAAC,IAAI,GAAK,CAAC,CAAC,QAAQ,EAAE,EAC1C,CAAC;AAGD,MAAa,UAAU;AAGvB,MAAa,gBAAgB,EAAE,OAAO;CACpC,IAAI,EAAE,OAAO;CACb,WAAW,EAAE,OAAO;CACpB,WAAW,EAAE,OAAO;CACpB,QAAQ,EAAE,OAAO;CACjB,YAAY,EAAE,KAAK,CAAC,CAAC,SAAS;CAC9B,WAAW,EAAE,KAAK;AACpB,CAAC;;;AAKD,MAAa,uBAAuB;;;AAKpC,MAAa,kBAAkB;AAG/B,MAAa,gBAAgB,UAAU,OAAO;CAC5C,QAAQ,cAAc,SAAS;;;;CAI/B,UAAU,EAAE,WAAW,CAAC,CAAC,SAAS;CAClC,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS;CAC9B,YAAY,EAAE,OAAO,CAAC,CAAC,SAAS;;CAEhC,WAAW,EAAE,OAAO,CAAC,CAAC,SAAS;AACjC,CAAC;AAGD,MAAa,eAAe,UAAU,eAAe;AAGrD,MAAa,0BAA0B,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC;AAG1E,MAAa,iBAAiB,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"discussion.js","names":[],"sources":["../../../src/http/schemas/discussion.ts"],"sourcesContent":["// Discussion resource schemas. Comments attach to an activity; settings are\n// per course, with a per-activity override carried on the activity's own\n// settings blob rather than a resource of its own.\n//\n// The author is the org user's profile minus its email — learners read each\n// other's comments and the list must not be a directory of the cohort's\n// addresses. The staff-facing comment list carries `authorEmail` separately.\nimport type { CommentSettings as DomainCommentSettings } from '@headless-lms/core/types';\nimport {\n commentAuthorSchema,\n commentListItemSchema,\n commentReportSummarySchema,\n commentSchema,\n commentFlagResolutionSchema,\n commentStatusSchema,\n commentViewSchema,\n idSchema,\n} from '@headless-lms/core/schemas';\nimport { z } from 'zod';\nimport { DateTimeInput, ListQuery, type Matches, paginated } from './shared.js';\n\nexport const CommentStatus = commentStatusSchema;\nexport type CommentStatus = z.infer<typeof CommentStatus>;\n\nexport const CommentAuthor = commentAuthorSchema;\nexport type CommentAuthor = z.infer<typeof CommentAuthor>;\n\n/** Any single emoji. Open, so widening the picker needs no schema change. */\nexport const ReactionEmoji = z.string().min(1).max(16);\nexport type ReactionEmoji = z.infer<typeof ReactionEmoji>;\n\n/** Counts by emoji; unused ones are absent, so no reactions serves `{}`. */\nexport const ReactionCounts = z.record(z.string(), z.number().int());\nexport type ReactionCounts = z.infer<typeof ReactionCounts>;\n\nconst Following = z\n .object({ state: z.literal('following') })\n .strict()\n .describe('Follow the post: you are notified of its new comments');\nconst Muted = z\n .object({\n state: z.literal('muted'),\n mutedUntil: DateTimeInput.nullable()\n .optional()\n .describe('When the mute ends. Omit or null to mute until you change it'),\n })\n .strict()\n .describe('Mute it: its activity stops notifying you, except mentions and actions on you');\nconst Unsubscribed = z\n .object({ state: z.literal('none') })\n .strict()\n .describe('Neither follow nor mute it');\n\nexport const SetPostSubscription = z.discriminatedUnion('state', [Following, Muted, Unsubscribed]);\nexport const SetMute = z.discriminatedUnion('state', [Muted, Unsubscribed]);\n\nexport const CommentView = commentViewSchema;\nexport type CommentView = z.infer<typeof CommentView>;\n\n/** What a reaction write on a post, message or comment returns, so the client never recomputes a count. */\nexport const Reactions = z.object({\n reactions: ReactionCounts,\n viewerReaction: ReactionEmoji.optional().describe('Absent when you have no reaction'),\n});\nexport type Reactions = z.infer<typeof Reactions>;\n\n/** A course's comment settings. Stored under the course, carried on the course\n * payload as `settings.comments`. */\nexport const CommentSettings = z.object({\n enabled: z.boolean(),\n threaded: z.boolean(),\n requireReview: z.boolean(),\n reactions: z.boolean(),\n});\nexport type CommentSettings = z.infer<typeof CommentSettings>;\ntype _CommentSettingsMatchesDomain = Matches<DomainCommentSettings, CommentSettings> &\n Matches<CommentSettings, DomainCommentSettings>;\n\n/** The course settings with the activity's override applied: `enabled` is the\n * resolved answer for this activity, not the course switch. */\nexport const CommentsConfig = CommentSettings;\nexport type CommentsConfig = z.infer<typeof CommentsConfig>;\n\nexport const ActivityComments = z.object({\n config: CommentsConfig,\n comments: z.array(CommentView),\n});\nexport type ActivityComments = z.infer<typeof ActivityComments>;\n\nexport const PostComment = z\n .object({\n body: z.string().min(1).max(10_000),\n parentId: idSchema\n .nullable()\n .default(null)\n .describe('The comment this replies to. Replies nest one level, under a root comment'),\n })\n .strict();\nexport type PostComment = z.infer<typeof PostComment>;\n\nexport const EditComment = z.object({ body: z.string().min(1).max(10_000) }).strict();\nexport type EditComment = z.infer<typeof EditComment>;\n\n/** The staff PATCH writes status and nothing else: publishing covers approving\n * a pending comment and restoring a removed one. Revising the text is the\n * author's own edit, under /api/member. */\nexport const PatchComment = z.object({\n status: z.literal('published'),\n});\nexport type PatchComment = z.infer<typeof PatchComment>;\n\n/** Replaces whatever the reader had. Clearing is DELETE, which carries no body. */\nexport const SetReaction = z\n .object({ emoji: ReactionEmoji.describe('Replaces any reaction you already had') })\n .strict();\nexport type SetReaction = z.infer<typeof SetReaction>;\n\nexport const ResolveCommentFlags = z\n .object({\n resolution: commentFlagResolutionSchema\n .extract(['dismissed'])\n .describe(\n '`dismissed` closes the open flags and leaves the comment up. Removing the comment resolves its flags as `removed` instead.',\n ),\n })\n .strict();\nexport type ResolveCommentFlags = z.infer<typeof ResolveCommentFlags>;\n\n/** A moderator's reply, posted from the queue against the comment it answers. */\nexport const ReplyToComment = z.object({\n body: z.string().min(1).max(10_000),\n});\nexport type ReplyToComment = z.infer<typeof ReplyToComment>;\n\nexport const ReportComment = z.object({ reason: z.string().max(1_000).default('') }).strict();\nexport type ReportComment = z.infer<typeof ReportComment>;\n\nexport const Comment = commentSchema;\nexport type Comment = z.infer<typeof Comment>;\n\nexport const CommentReport = z.object({\n id: z.string(),\n commentId: z.string(),\n orgUserId: z.string(),\n reason: z.string(),\n resolvedAt: z.date().nullable(),\n createdAt: z.date(),\n});\nexport type CommentReport = z.infer<typeof CommentReport>;\n\n/** An unresolved report on a listed comment. Resolved ones are history and are\n * never served here. */\nexport const CommentReportSummary = commentReportSummarySchema;\nexport type CommentReportSummary = z.infer<typeof CommentReportSummary>;\n\n/** One row of the staff comment list: the comment plus the context a\n * moderation decision needs, so the list needs no follow-up request. */\nexport const CommentListItem = commentListItemSchema;\nexport type CommentListItem = z.infer<typeof CommentListItem>;\n\nexport const CommentsQuery = ListQuery.extend({\n status: CommentStatus.optional(),\n /** true = only comments carrying an unresolved report, false = only those\n * carrying none. `z.stringbool` because query values arrive as strings and\n * `z.coerce.boolean()` would read \"false\" as true. */\n reported: z.stringbool().optional(),\n courseId: z.string().optional(),\n activityId: z.string().optional(),\n /** Scope to one author (org_users.id). */\n orgUserId: z.string().optional(),\n});\nexport type CommentsQuery = z.infer<typeof CommentsQuery>;\n\nexport const CommentsPage = paginated(CommentListItem);\nexport type CommentsPage = z.infer<typeof CommentsPage>;\n\nexport const DiscussionActivityParam = z.object({ activityId: z.string() });\nexport type DiscussionActivityParam = z.infer<typeof DiscussionActivityParam>;\n\nexport const CommentIdParam = z.object({ commentId: z.string() });\nexport type CommentIdParam = z.infer<typeof CommentIdParam>;\n"],"mappings":"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"}