@headless-lms/server 0.1.0 → 0.3.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/README.md +1 -1
  2. package/dist/_virtual/_rolldown/runtime.js +5 -0
  3. package/dist/app/community-mail.d.ts +26 -0
  4. package/dist/app/community-mail.js +96 -0
  5. package/dist/app/community-mail.js.map +1 -0
  6. package/dist/app/container.d.ts +22 -14
  7. package/dist/app/container.js +186 -62
  8. package/dist/app/container.js.map +1 -1
  9. package/dist/app/mcp-endpoints.d.ts +13 -0
  10. package/dist/app/mcp-endpoints.js +25 -0
  11. package/dist/app/mcp-endpoints.js.map +1 -0
  12. package/dist/http/config.d.ts +2 -1
  13. package/dist/http/errors.d.ts +14 -0
  14. package/dist/http/errors.js +147 -0
  15. package/dist/http/errors.js.map +1 -0
  16. package/dist/http/mcp/catalogue.d.ts +37 -0
  17. package/dist/http/mcp/catalogue.js +69 -0
  18. package/dist/http/mcp/catalogue.js.map +1 -0
  19. package/dist/http/mcp/challenge.d.ts +7 -0
  20. package/dist/http/mcp/challenge.js +35 -0
  21. package/dist/http/mcp/challenge.js.map +1 -0
  22. package/dist/http/mcp/input-schema.d.ts +7 -0
  23. package/dist/http/mcp/input-schema.js +28 -0
  24. package/dist/http/mcp/input-schema.js.map +1 -0
  25. package/dist/http/mcp/route.d.ts +8 -0
  26. package/dist/http/mcp/route.js +75 -0
  27. package/dist/http/mcp/route.js.map +1 -0
  28. package/dist/http/mcp/server.d.ts +8 -0
  29. package/dist/http/mcp/server.js +31 -0
  30. package/dist/http/mcp/server.js.map +1 -0
  31. package/dist/http/mcp/test-support.d.ts +55 -0
  32. package/dist/http/mcp/test-support.js +151 -0
  33. package/dist/http/mcp/test-support.js.map +1 -0
  34. package/dist/http/mcp/tool.d.ts +48 -0
  35. package/dist/http/mcp/tool.js +58 -0
  36. package/dist/http/mcp/tool.js.map +1 -0
  37. package/dist/http/mcp/tools/automations.d.ts +6 -0
  38. package/dist/http/mcp/tools/automations.js +120 -0
  39. package/dist/http/mcp/tools/automations.js.map +1 -0
  40. package/dist/http/mcp/tools/catalog.d.ts +6 -0
  41. package/dist/http/mcp/tools/catalog.js +200 -0
  42. package/dist/http/mcp/tools/catalog.js.map +1 -0
  43. package/dist/http/mcp/tools/comments.d.ts +6 -0
  44. package/dist/http/mcp/tools/comments.js +70 -0
  45. package/dist/http/mcp/tools/comments.js.map +1 -0
  46. package/dist/http/mcp/tools/communities.d.ts +6 -0
  47. package/dist/http/mcp/tools/communities.js +175 -0
  48. package/dist/http/mcp/tools/communities.js.map +1 -0
  49. package/dist/http/mcp/tools/community-members.d.ts +6 -0
  50. package/dist/http/mcp/tools/community-members.js +89 -0
  51. package/dist/http/mcp/tools/community-members.js.map +1 -0
  52. package/dist/http/mcp/tools/community-moderation.d.ts +6 -0
  53. package/dist/http/mcp/tools/community-moderation.js +144 -0
  54. package/dist/http/mcp/tools/community-moderation.js.map +1 -0
  55. package/dist/http/mcp/tools/courses.d.ts +6 -0
  56. package/dist/http/mcp/tools/courses.js +121 -0
  57. package/dist/http/mcp/tools/courses.js.map +1 -0
  58. package/dist/http/mcp/tools/index.d.ts +6 -0
  59. package/dist/http/mcp/tools/index.js +23 -0
  60. package/dist/http/mcp/tools/index.js.map +1 -0
  61. package/dist/http/mcp/tools/people.d.ts +6 -0
  62. package/dist/http/mcp/tools/people.js +145 -0
  63. package/dist/http/mcp/tools/people.js.map +1 -0
  64. package/dist/http/plugins/auth.js +13 -5
  65. package/dist/http/plugins/auth.js.map +1 -1
  66. package/dist/http/plugins/error-handler.d.ts +3 -2
  67. package/dist/http/plugins/error-handler.js +52 -57
  68. package/dist/http/plugins/error-handler.js.map +1 -1
  69. package/dist/http/plugins/openapi.js +70 -20
  70. package/dist/http/plugins/openapi.js.map +1 -1
  71. package/dist/http/routes/access.d.ts +7 -0
  72. package/dist/http/routes/access.js +140 -0
  73. package/dist/http/routes/access.js.map +1 -0
  74. package/dist/http/routes/activities.js +97 -20
  75. package/dist/http/routes/activities.js.map +1 -1
  76. package/dist/http/routes/assets.js +60 -51
  77. package/dist/http/routes/assets.js.map +1 -1
  78. package/dist/http/routes/automations.js +64 -20
  79. package/dist/http/routes/automations.js.map +1 -1
  80. package/dist/http/routes/bundles.d.ts +7 -0
  81. package/dist/http/routes/bundles.js +181 -0
  82. package/dist/http/routes/bundles.js.map +1 -0
  83. package/dist/http/routes/communities.d.ts +7 -0
  84. package/dist/http/routes/communities.js +462 -0
  85. package/dist/http/routes/communities.js.map +1 -0
  86. package/dist/http/routes/community-moderation.d.ts +7 -0
  87. package/dist/http/routes/community-moderation.js +425 -0
  88. package/dist/http/routes/community-moderation.js.map +1 -0
  89. package/dist/http/routes/course-analytics.d.ts +7 -0
  90. package/dist/http/routes/course-analytics.js +60 -0
  91. package/dist/http/routes/course-analytics.js.map +1 -0
  92. package/dist/http/routes/courses.js +38 -23
  93. package/dist/http/routes/courses.js.map +1 -1
  94. package/dist/http/routes/dashboard.js +17 -8
  95. package/dist/http/routes/dashboard.js.map +1 -1
  96. package/dist/http/routes/discussion.js +35 -27
  97. package/dist/http/routes/discussion.js.map +1 -1
  98. package/dist/http/routes/downloads.js +58 -40
  99. package/dist/http/routes/downloads.js.map +1 -1
  100. package/dist/http/routes/entitlements.js +16 -7
  101. package/dist/http/routes/entitlements.js.map +1 -1
  102. package/dist/http/routes/integrations.js +38 -41
  103. package/dist/http/routes/integrations.js.map +1 -1
  104. package/dist/http/routes/member/actor.d.ts +14 -0
  105. package/dist/http/routes/member/actor.js +11 -0
  106. package/dist/http/routes/member/actor.js.map +1 -0
  107. package/dist/http/routes/member/assets.d.ts +7 -0
  108. package/dist/http/routes/member/assets.js +79 -0
  109. package/dist/http/routes/member/assets.js.map +1 -0
  110. package/dist/http/routes/member/chats.d.ts +7 -0
  111. package/dist/http/routes/member/chats.js +456 -0
  112. package/dist/http/routes/member/chats.js.map +1 -0
  113. package/dist/http/routes/member/comments.d.ts +7 -0
  114. package/dist/http/routes/member/comments.js +187 -0
  115. package/dist/http/routes/member/comments.js.map +1 -0
  116. package/dist/http/routes/member/community.d.ts +7 -0
  117. package/dist/http/routes/member/community.js +288 -0
  118. package/dist/http/routes/member/community.js.map +1 -0
  119. package/dist/http/routes/member/courses.d.ts +7 -0
  120. package/dist/http/routes/member/courses.js +101 -0
  121. package/dist/http/routes/member/courses.js.map +1 -0
  122. package/dist/http/routes/member/downloads.d.ts +7 -0
  123. package/dist/http/routes/member/downloads.js +56 -0
  124. package/dist/http/routes/member/downloads.js.map +1 -0
  125. package/dist/http/routes/member/files.d.ts +7 -0
  126. package/dist/http/routes/member/files.js +184 -0
  127. package/dist/http/routes/member/files.js.map +1 -0
  128. package/dist/http/routes/member/index.d.ts +7 -0
  129. package/dist/http/routes/member/index.js +31 -0
  130. package/dist/http/routes/member/index.js.map +1 -0
  131. package/dist/http/routes/member/notifications.d.ts +7 -0
  132. package/dist/http/routes/member/notifications.js +101 -0
  133. package/dist/http/routes/member/notifications.js.map +1 -0
  134. package/dist/http/routes/member/org.d.ts +7 -0
  135. package/dist/http/routes/member/org.js +56 -0
  136. package/dist/http/routes/member/org.js.map +1 -0
  137. package/dist/http/routes/member/posts.d.ts +7 -0
  138. package/dist/http/routes/member/posts.js +612 -0
  139. package/dist/http/routes/member/posts.js.map +1 -0
  140. package/dist/http/routes/member/profile.d.ts +7 -0
  141. package/dist/http/routes/member/profile.js +48 -0
  142. package/dist/http/routes/member/profile.js.map +1 -0
  143. package/dist/http/routes/member/progress.d.ts +7 -0
  144. package/dist/http/routes/member/progress.js +60 -0
  145. package/dist/http/routes/member/progress.js.map +1 -0
  146. package/dist/http/routes/organizations.js +49 -24
  147. package/dist/http/routes/organizations.js.map +1 -1
  148. package/dist/http/routes/students.js +43 -37
  149. package/dist/http/routes/students.js.map +1 -1
  150. package/dist/http/routes/webhooks.d.ts +7 -0
  151. package/dist/http/routes/webhooks.js +167 -0
  152. package/dist/http/routes/webhooks.js.map +1 -0
  153. package/dist/http/routes.js +14 -2
  154. package/dist/http/routes.js.map +1 -1
  155. package/dist/http/schemas/access.d.ts +146 -0
  156. package/dist/http/schemas/access.js +36 -0
  157. package/dist/http/schemas/access.js.map +1 -0
  158. package/dist/http/schemas/activities.d.ts +36 -1
  159. package/dist/http/schemas/activities.js +9 -4
  160. package/dist/http/schemas/activities.js.map +1 -1
  161. package/dist/http/schemas/assets.d.ts +76 -73
  162. package/dist/http/schemas/assets.js +23 -13
  163. package/dist/http/schemas/assets.js.map +1 -1
  164. package/dist/http/schemas/automations.d.ts +85 -8
  165. package/dist/http/schemas/automations.js +13 -2
  166. package/dist/http/schemas/automations.js.map +1 -1
  167. package/dist/http/schemas/bundles.d.ts +63 -0
  168. package/dist/http/schemas/bundles.js +23 -0
  169. package/dist/http/schemas/bundles.js.map +1 -0
  170. package/dist/http/schemas/chats.d.ts +386 -0
  171. package/dist/http/schemas/chats.js +58 -0
  172. package/dist/http/schemas/chats.js.map +1 -0
  173. package/dist/http/schemas/community.d.ts +537 -0
  174. package/dist/http/schemas/community.js +129 -0
  175. package/dist/http/schemas/community.js.map +1 -0
  176. package/dist/http/schemas/content.d.ts +22 -13
  177. package/dist/http/schemas/content.js +11 -9
  178. package/dist/http/schemas/content.js.map +1 -1
  179. package/dist/http/schemas/course-analytics.d.ts +29 -0
  180. package/dist/http/schemas/course-analytics.js +21 -0
  181. package/dist/http/schemas/course-analytics.js.map +1 -0
  182. package/dist/http/schemas/dashboard.js.map +1 -1
  183. package/dist/http/schemas/discussion.d.ts +85 -23
  184. package/dist/http/schemas/discussion.js +12 -11
  185. package/dist/http/schemas/discussion.js.map +1 -1
  186. package/dist/http/schemas/downloads.d.ts +13 -5
  187. package/dist/http/schemas/downloads.js +14 -11
  188. package/dist/http/schemas/downloads.js.map +1 -1
  189. package/dist/http/schemas/entitlements.d.ts +14 -6
  190. package/dist/http/schemas/entitlements.js +8 -6
  191. package/dist/http/schemas/entitlements.js.map +1 -1
  192. package/dist/http/schemas/files.d.ts +45 -0
  193. package/dist/http/schemas/files.js +25 -0
  194. package/dist/http/schemas/files.js.map +1 -0
  195. package/dist/http/schemas/index.d.ts +19 -10
  196. package/dist/http/schemas/index.js +19 -10
  197. package/dist/http/schemas/integrations.d.ts +4 -4
  198. package/dist/http/schemas/integrations.js.map +1 -1
  199. package/dist/http/schemas/invites.d.ts +4 -0
  200. package/dist/http/schemas/invites.js +3 -1
  201. package/dist/http/schemas/invites.js.map +1 -1
  202. package/dist/http/schemas/{learn.d.ts → member.d.ts} +42 -19
  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 +39 -6
  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 +227 -0
  209. package/dist/http/schemas/notifications.js +44 -0
  210. package/dist/http/schemas/notifications.js.map +1 -0
  211. package/dist/http/schemas/organizations.js.map +1 -1
  212. package/dist/http/schemas/posts.d.ts +316 -0
  213. package/dist/http/schemas/posts.js +47 -0
  214. package/dist/http/schemas/posts.js.map +1 -0
  215. package/dist/http/schemas/profile.d.ts +23 -0
  216. package/dist/http/schemas/profile.js +15 -0
  217. package/dist/http/schemas/profile.js.map +1 -0
  218. package/dist/http/schemas/settings.js.map +1 -1
  219. package/dist/http/schemas/shared.d.ts +26 -1
  220. package/dist/http/schemas/shared.js +22 -3
  221. package/dist/http/schemas/shared.js.map +1 -1
  222. package/dist/http/schemas/students.d.ts +32 -10
  223. package/dist/http/schemas/students.js +19 -6
  224. package/dist/http/schemas/students.js.map +1 -1
  225. package/dist/http/scope.d.ts +2 -1
  226. package/dist/http/scope.js +20 -4
  227. package/dist/http/scope.js.map +1 -1
  228. package/dist/http/server.js +10 -3
  229. package/dist/http/server.js.map +1 -1
  230. package/dist/http/web-bridge.d.ts +1 -1
  231. package/dist/http/web-bridge.js +2 -2
  232. package/dist/http/web-bridge.js.map +1 -1
  233. package/dist/http/well-known.d.ts +7 -0
  234. package/dist/http/well-known.js +22 -0
  235. package/dist/http/well-known.js.map +1 -0
  236. package/dist/index.d.ts +3 -2
  237. package/dist/index.js +4 -2
  238. package/dist/index.js.map +1 -1
  239. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.js +78 -0
  240. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.js.map +1 -0
  241. package/dist/node_modules/.pnpm/@vitest_expect@2.1.9/node_modules/@vitest/expect/dist/index.js +1267 -0
  242. package/dist/node_modules/.pnpm/@vitest_expect@2.1.9/node_modules/@vitest/expect/dist/index.js.map +1 -0
  243. package/dist/node_modules/.pnpm/@vitest_pretty-format@2.1.9/node_modules/@vitest/pretty-format/dist/index.js +814 -0
  244. package/dist/node_modules/.pnpm/@vitest_pretty-format@2.1.9/node_modules/@vitest/pretty-format/dist/index.js.map +1 -0
  245. package/dist/node_modules/.pnpm/@vitest_runner@2.1.9/node_modules/@vitest/runner/dist/chunk-tasks.js +43 -0
  246. package/dist/node_modules/.pnpm/@vitest_runner@2.1.9/node_modules/@vitest/runner/dist/chunk-tasks.js.map +1 -0
  247. package/dist/node_modules/.pnpm/@vitest_runner@2.1.9/node_modules/@vitest/runner/dist/index.js +527 -0
  248. package/dist/node_modules/.pnpm/@vitest_runner@2.1.9/node_modules/@vitest/runner/dist/index.js.map +1 -0
  249. package/dist/node_modules/.pnpm/@vitest_runner@2.1.9/node_modules/@vitest/runner/dist/utils.js +2 -0
  250. package/dist/node_modules/.pnpm/@vitest_snapshot@2.1.9/node_modules/@vitest/snapshot/dist/index.js +1737 -0
  251. package/dist/node_modules/.pnpm/@vitest_snapshot@2.1.9/node_modules/@vitest/snapshot/dist/index.js.map +1 -0
  252. package/dist/node_modules/.pnpm/@vitest_spy@2.1.9/node_modules/@vitest/spy/dist/index.js +137 -0
  253. package/dist/node_modules/.pnpm/@vitest_spy@2.1.9/node_modules/@vitest/spy/dist/index.js.map +1 -0
  254. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js +118 -0
  255. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js.map +1 -0
  256. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/diff.js +1222 -0
  257. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/diff.js.map +1 -0
  258. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/error.js +91 -0
  259. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/error.js.map +1 -0
  260. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/helpers.js +113 -0
  261. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/helpers.js.map +1 -0
  262. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/index.js +449 -0
  263. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/index.js.map +1 -0
  264. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/source-map.js +163 -0
  265. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/source-map.js.map +1 -0
  266. package/dist/node_modules/.pnpm/chai@5.3.3/node_modules/chai/index.js +3187 -0
  267. package/dist/node_modules/.pnpm/chai@5.3.3/node_modules/chai/index.js.map +1 -0
  268. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/arguments.js +11 -0
  269. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/arguments.js.map +1 -0
  270. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/array.js +16 -0
  271. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/array.js.map +1 -0
  272. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/bigint.js +11 -0
  273. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/bigint.js.map +1 -0
  274. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/class.js +15 -0
  275. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/class.js.map +1 -0
  276. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/date.js +13 -0
  277. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/date.js.map +1 -0
  278. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/error.js +34 -0
  279. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/error.js.map +1 -0
  280. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/function.js +12 -0
  281. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/function.js.map +1 -0
  282. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/helpers.js +122 -0
  283. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/helpers.js.map +1 -0
  284. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/html.js +39 -0
  285. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/html.js.map +1 -0
  286. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/index.js +99 -0
  287. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/index.js.map +1 -0
  288. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/map.js +25 -0
  289. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/map.js.map +1 -0
  290. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/number.js +14 -0
  291. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/number.js.map +1 -0
  292. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/object.js +21 -0
  293. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/object.js.map +1 -0
  294. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/promise.js +6 -0
  295. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/promise.js.map +1 -0
  296. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/regexp.js +12 -0
  297. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/regexp.js.map +1 -0
  298. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/set.js +18 -0
  299. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/set.js.map +1 -0
  300. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/string.js +24 -0
  301. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/string.js.map +1 -0
  302. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/symbol.js +9 -0
  303. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/symbol.js.map +1 -0
  304. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/typedarray.js +30 -0
  305. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/typedarray.js.map +1 -0
  306. package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.js +939 -0
  307. package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.js.map +1 -0
  308. package/dist/node_modules/.pnpm/pathe@1.1.2/node_modules/pathe/dist/shared/pathe.ff20891b.js +82 -0
  309. package/dist/node_modules/.pnpm/pathe@1.1.2/node_modules/pathe/dist/shared/pathe.ff20891b.js.map +1 -0
  310. package/dist/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js +82 -0
  311. package/dist/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js.map +1 -0
  312. package/dist/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/node.js +8 -0
  313. package/dist/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/node.js.map +1 -0
  314. package/dist/node_modules/.pnpm/tinyspy@3.0.2/node_modules/tinyspy/dist/index.js +83 -0
  315. package/dist/node_modules/.pnpm/tinyspy@3.0.2/node_modules/tinyspy/dist/index.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/_commonjsHelpers.BFTU3MAI.js +9 -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/_commonjsHelpers.BFTU3MAI.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/date.W2xKR2qe.js +51 -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/date.W2xKR2qe.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/utils.C8RiOc4B.js +48 -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/utils.C8RiOc4B.js.map +1 -0
  322. 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
  323. 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
  324. package/dist/packages/server/package.js +6 -0
  325. package/dist/packages/server/package.js.map +1 -0
  326. package/package.json +9 -7
  327. package/dist/app/notifications.d.ts +0 -7
  328. package/dist/app/notifications.js +0 -23
  329. package/dist/app/notifications.js.map +0 -1
  330. package/dist/http/routes/learn/assets.d.ts +0 -8
  331. package/dist/http/routes/learn/assets.js +0 -32
  332. package/dist/http/routes/learn/assets.js.map +0 -1
  333. package/dist/http/routes/learn/comments.d.ts +0 -7
  334. package/dist/http/routes/learn/comments.js +0 -175
  335. package/dist/http/routes/learn/comments.js.map +0 -1
  336. package/dist/http/routes/learn/courses.d.ts +0 -7
  337. package/dist/http/routes/learn/courses.js +0 -75
  338. package/dist/http/routes/learn/courses.js.map +0 -1
  339. package/dist/http/routes/learn/downloads.d.ts +0 -7
  340. package/dist/http/routes/learn/downloads.js +0 -76
  341. package/dist/http/routes/learn/downloads.js.map +0 -1
  342. package/dist/http/routes/learn/index.d.ts +0 -7
  343. package/dist/http/routes/learn/index.js +0 -19
  344. package/dist/http/routes/learn/index.js.map +0 -1
  345. package/dist/http/routes/learn/org.d.ts +0 -7
  346. package/dist/http/routes/learn/org.js +0 -50
  347. package/dist/http/routes/learn/org.js.map +0 -1
  348. package/dist/http/routes/learn/progress.d.ts +0 -7
  349. package/dist/http/routes/learn/progress.js +0 -63
  350. package/dist/http/routes/learn/progress.js.map +0 -1
  351. package/dist/http/schemas/learn.js.map +0 -1
@@ -38,9 +38,18 @@ declare const Course: z.ZodObject<{
38
38
  }>;
39
39
  category: z.ZodString;
40
40
  thumbnailAssetId: z.ZodNullable<z.ZodString>;
41
- settings: z.ZodType<import("@headless-lms/core/types").JsonValue, unknown, z.core.$ZodTypeInternals<import("@headless-lms/core/types").JsonValue, unknown>>;
41
+ settings: z.ZodObject<{
42
+ transcriptDownloads: z.ZodBoolean;
43
+ comments: z.ZodOptional<z.ZodObject<{
44
+ enabled: z.ZodBoolean;
45
+ threaded: z.ZodBoolean;
46
+ requireReview: z.ZodBoolean;
47
+ reactions: z.ZodBoolean;
48
+ }, z.core.$strict>>;
49
+ }, z.core.$strict>;
42
50
  createdAt: z.ZodCoercedDate<unknown>;
43
51
  updatedAt: z.ZodCoercedDate<unknown>;
52
+ thumbnailUrl: z.ZodNullable<z.ZodString>;
44
53
  }, z.core.$strict>;
45
54
  type Course = z.infer<typeof Course>;
46
55
  declare const CreateCourse: z.ZodObject<{
@@ -51,22 +60,13 @@ declare const CreateCourse: z.ZodObject<{
51
60
  type CreateCourse = z.infer<typeof CreateCourse>;
52
61
  declare const UpdateCourse: z.ZodObject<{
53
62
  title: z.ZodOptional<z.ZodString>;
54
- description: z.ZodOptional<z.ZodDefault<z.ZodString>>;
55
- category: z.ZodOptional<z.ZodDefault<z.ZodString>>;
63
+ description: z.ZodOptional<z.ZodString>;
64
+ category: z.ZodOptional<z.ZodString>;
56
65
  status: z.ZodOptional<z.ZodEnum<{
57
66
  draft: "draft";
58
67
  published: "published";
59
68
  }>>;
60
69
  thumbnailAssetId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
61
- settings: z.ZodOptional<z.ZodObject<{
62
- transcriptDownloads: z.ZodOptional<z.ZodBoolean>;
63
- comments: z.ZodOptional<z.ZodOptional<z.ZodObject<{
64
- enabled: z.ZodBoolean;
65
- threaded: z.ZodBoolean;
66
- requireReview: z.ZodBoolean;
67
- reactions: z.ZodBoolean;
68
- }, z.core.$strict>>>;
69
- }, z.core.$strict>>;
70
70
  }, z.core.$strip>;
71
71
  type UpdateCourse = z.infer<typeof UpdateCourse>;
72
72
  declare const CoursesQuery: z.ZodObject<{
@@ -95,9 +95,18 @@ declare const CoursesPage: z.ZodObject<{
95
95
  }>;
96
96
  category: z.ZodString;
97
97
  thumbnailAssetId: z.ZodNullable<z.ZodString>;
98
- settings: z.ZodType<import("@headless-lms/core/types").JsonValue, unknown, z.core.$ZodTypeInternals<import("@headless-lms/core/types").JsonValue, unknown>>;
98
+ settings: z.ZodObject<{
99
+ transcriptDownloads: z.ZodBoolean;
100
+ comments: z.ZodOptional<z.ZodObject<{
101
+ enabled: z.ZodBoolean;
102
+ threaded: z.ZodBoolean;
103
+ requireReview: z.ZodBoolean;
104
+ reactions: z.ZodBoolean;
105
+ }, z.core.$strict>>;
106
+ }, z.core.$strict>;
99
107
  createdAt: z.ZodCoercedDate<unknown>;
100
108
  updatedAt: z.ZodCoercedDate<unknown>;
109
+ thumbnailUrl: z.ZodNullable<z.ZodString>;
101
110
  }, z.core.$strict>>;
102
111
  total: z.ZodNumber;
103
112
  page: z.ZodNumber;
@@ -1,25 +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(),
18
- settings: CourseSettings.partial().optional()
20
+ thumbnailAssetId: idSchema.nullable().optional()
19
21
  });
20
22
  const CoursesQuery = ListQuery.extend({
21
23
  status: CourseStatus.optional(),
22
- category: z.string().optional()
24
+ category: z.string().trim().max(100).optional()
23
25
  });
24
26
  const CoursesPage = paginated(Course);
25
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 {\n courseSchema,\n courseSettingsSchema,\n courseStatusSchema,\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 = 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 settings: CourseSettings.partial().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":";;;;AAWA,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;CACjD,UAAU,eAAe,QAAQ,CAAC,CAAC,SAAS;AAC9C,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"}
@@ -0,0 +1,29 @@
1
+ import { z } from "zod";
2
+ //#region src/http/schemas/course-analytics.d.ts
3
+ declare const CourseActivityEngagement: z.ZodObject<{
4
+ activityId: z.ZodString;
5
+ title: z.ZodString;
6
+ moduleId: z.ZodString;
7
+ moduleTitle: z.ZodString;
8
+ started: z.ZodNumber;
9
+ completed: z.ZodNumber;
10
+ }, z.core.$strip>;
11
+ type CourseActivityEngagement = z.infer<typeof CourseActivityEngagement>;
12
+ declare const CourseAnalytics: z.ZodObject<{
13
+ enrolled: z.ZodNumber;
14
+ started: z.ZodNumber;
15
+ completed: z.ZodNumber;
16
+ avgProgress: z.ZodNumber;
17
+ activities: z.ZodArray<z.ZodObject<{
18
+ activityId: z.ZodString;
19
+ title: z.ZodString;
20
+ moduleId: z.ZodString;
21
+ moduleTitle: z.ZodString;
22
+ started: z.ZodNumber;
23
+ completed: z.ZodNumber;
24
+ }, z.core.$strip>>;
25
+ }, z.core.$strip>;
26
+ type CourseAnalytics = z.infer<typeof CourseAnalytics>;
27
+ //#endregion
28
+ export { CourseActivityEngagement, CourseAnalytics };
29
+ //# sourceMappingURL=course-analytics.d.ts.map
@@ -0,0 +1,21 @@
1
+ import { z } from "zod";
2
+ //#region src/http/schemas/course-analytics.ts
3
+ const CourseActivityEngagement = z.object({
4
+ activityId: z.string(),
5
+ title: z.string(),
6
+ moduleId: z.string(),
7
+ moduleTitle: z.string(),
8
+ started: z.number().int(),
9
+ completed: z.number().int()
10
+ });
11
+ const CourseAnalytics = z.object({
12
+ enrolled: z.number().int(),
13
+ started: z.number().int(),
14
+ completed: z.number().int(),
15
+ avgProgress: z.number().int(),
16
+ activities: z.array(CourseActivityEngagement)
17
+ });
18
+ //#endregion
19
+ export { CourseActivityEngagement, CourseAnalytics };
20
+
21
+ //# sourceMappingURL=course-analytics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"course-analytics.js","names":[],"sources":["../../../src/http/schemas/course-analytics.ts"],"sourcesContent":["// Per-course analytics resource schemas.\nimport { z } from 'zod';\n\nexport const CourseActivityEngagement = z.object({\n activityId: z.string(),\n title: z.string(),\n moduleId: z.string(),\n moduleTitle: z.string(),\n started: z.number().int(),\n completed: z.number().int(),\n});\nexport type CourseActivityEngagement = z.infer<typeof CourseActivityEngagement>;\n\nexport const CourseAnalytics = z.object({\n enrolled: z.number().int(),\n started: z.number().int(),\n completed: z.number().int(),\n avgProgress: z.number().int(),\n activities: z.array(CourseActivityEngagement),\n});\nexport type CourseAnalytics = z.infer<typeof CourseAnalytics>;\n"],"mappings":";;AAGA,MAAa,2BAA2B,EAAE,OAAO;CAC/C,YAAY,EAAE,OAAO;CACrB,OAAO,EAAE,OAAO;CAChB,UAAU,EAAE,OAAO;CACnB,aAAa,EAAE,OAAO;CACtB,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI;CACxB,WAAW,EAAE,OAAO,CAAC,CAAC,IAAI;AAC5B,CAAC;AAGD,MAAa,kBAAkB,EAAE,OAAO;CACtC,UAAU,EAAE,OAAO,CAAC,CAAC,IAAI;CACzB,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI;CACxB,WAAW,EAAE,OAAO,CAAC,CAAC,IAAI;CAC1B,aAAa,EAAE,OAAO,CAAC,CAAC,IAAI;CAC5B,YAAY,EAAE,MAAM,wBAAwB;AAC9C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"dashboard.js","names":[],"sources":["../../../src/http/schemas/dashboard.ts"],"sourcesContent":["// Dashboard / overview resource schemas.\nimport { z } from \"zod\";\n\nexport const OverviewStats = z.object({\n publishedCourses: z.number().int(),\n draftCourses: z.number().int(),\n activeStudents: z.number().int(),\n expiringSoon: z.number().int(),\n});\nexport type OverviewStats = z.infer<typeof OverviewStats>;\n\nexport const EnrollmentPoint = z.object({\n date: z.string(),\n count: z.number().int(),\n});\nexport type EnrollmentPoint = z.infer<typeof EnrollmentPoint>;\n\nexport const EnrollmentSeries = z.array(EnrollmentPoint);\nexport type EnrollmentSeries = z.infer<typeof EnrollmentSeries>;\n\nexport const EnrollmentSeriesQuery = z.object({\n days: z.coerce.number().int().min(1).max(365).default(30),\n});\nexport type EnrollmentSeriesQuery = z.infer<typeof EnrollmentSeriesQuery>;\n"],"mappings":";;AAGA,MAAa,gBAAgB,EAAE,OAAO;CACpC,kBAAkB,EAAE,OAAO,CAAC,CAAC,IAAI;CACjC,cAAc,EAAE,OAAO,CAAC,CAAC,IAAI;CAC7B,gBAAgB,EAAE,OAAO,CAAC,CAAC,IAAI;CAC/B,cAAc,EAAE,OAAO,CAAC,CAAC,IAAI;AAC/B,CAAC;AAGD,MAAa,kBAAkB,EAAE,OAAO;CACtC,MAAM,EAAE,OAAO;CACf,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI;AACxB,CAAC;AAGD,MAAa,mBAAmB,EAAE,MAAM,eAAe;AAGvD,MAAa,wBAAwB,EAAE,OAAO,EAC5C,MAAM,EAAE,OAAO,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,EAC1D,CAAC"}
1
+ {"version":3,"file":"dashboard.js","names":[],"sources":["../../../src/http/schemas/dashboard.ts"],"sourcesContent":["// Dashboard / overview resource schemas.\nimport { z } from 'zod';\n\nexport const OverviewStats = z.object({\n publishedCourses: z.number().int(),\n draftCourses: z.number().int(),\n activeStudents: z.number().int(),\n expiringSoon: z.number().int(),\n});\nexport type OverviewStats = z.infer<typeof OverviewStats>;\n\nexport const EnrollmentPoint = z.object({\n date: z.string(),\n count: z.number().int(),\n});\nexport type EnrollmentPoint = z.infer<typeof EnrollmentPoint>;\n\nexport const EnrollmentSeries = z.array(EnrollmentPoint);\nexport type EnrollmentSeries = z.infer<typeof EnrollmentSeries>;\n\nexport const EnrollmentSeriesQuery = z.object({\n days: z.coerce.number().int().min(1).max(365).default(30),\n});\nexport type EnrollmentSeriesQuery = z.infer<typeof EnrollmentSeriesQuery>;\n"],"mappings":";;AAGA,MAAa,gBAAgB,EAAE,OAAO;CACpC,kBAAkB,EAAE,OAAO,CAAC,CAAC,IAAI;CACjC,cAAc,EAAE,OAAO,CAAC,CAAC,IAAI;CAC7B,gBAAgB,EAAE,OAAO,CAAC,CAAC,IAAI;CAC/B,cAAc,EAAE,OAAO,CAAC,CAAC,IAAI;AAC/B,CAAC;AAGD,MAAa,kBAAkB,EAAE,OAAO;CACtC,MAAM,EAAE,OAAO;CACf,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI;AACxB,CAAC;AAGD,MAAa,mBAAmB,EAAE,MAAM,eAAe;AAGvD,MAAa,wBAAwB,EAAE,OAAO,EAC5C,MAAM,EAAE,OAAO,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,EAC1D,CAAC"}
@@ -1,8 +1,8 @@
1
1
  import { z } from "zod";
2
2
  //#region src/http/schemas/discussion.d.ts
3
3
  declare const CommentStatus: z.ZodEnum<{
4
- published: "published";
5
4
  pending: "pending";
5
+ published: "published";
6
6
  removed: "removed";
7
7
  }>;
8
8
  type CommentStatus = z.infer<typeof CommentStatus>;
@@ -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>;
@@ -27,35 +32,47 @@ declare const ReactionCounts: z.ZodRecord<z.ZodString, z.ZodNumber>;
27
32
  type ReactionCounts = z.infer<typeof ReactionCounts>;
28
33
  declare const CommentView: z.ZodObject<{
29
34
  id: z.ZodString;
30
- activityId: z.ZodString;
35
+ activityId: z.ZodNullable<z.ZodString>;
36
+ postId: z.ZodNullable<z.ZodString>;
37
+ communityId: z.ZodNullable<z.ZodString>;
31
38
  parentId: z.ZodNullable<z.ZodString>;
32
39
  author: z.ZodObject<{
33
40
  id: z.ZodString;
34
41
  firstName: z.ZodNullable<z.ZodString>;
35
42
  lastName: z.ZodNullable<z.ZodString>;
43
+ displayName: z.ZodNullable<z.ZodString>;
44
+ headline: z.ZodNullable<z.ZodString>;
36
45
  image: z.ZodNullable<z.ZodString>;
46
+ imageAssetId: z.ZodNullable<z.ZodString>;
47
+ imageUrl: z.ZodNullable<z.ZodString>;
37
48
  role: z.ZodEnum<{
38
49
  owner: "owner";
39
50
  admin: "admin";
40
51
  instructor: "instructor";
52
+ moderator: "moderator";
41
53
  student: "student";
42
54
  }>;
43
55
  }, z.core.$strict>;
44
56
  body: z.ZodNullable<z.ZodString>;
45
57
  status: z.ZodEnum<{
46
- published: "published";
47
58
  pending: "pending";
59
+ published: "published";
48
60
  removed: "removed";
49
61
  }>;
50
62
  removedBy: z.ZodNullable<z.ZodObject<{
51
63
  id: z.ZodString;
52
64
  firstName: z.ZodNullable<z.ZodString>;
53
65
  lastName: z.ZodNullable<z.ZodString>;
66
+ displayName: z.ZodNullable<z.ZodString>;
67
+ headline: z.ZodNullable<z.ZodString>;
54
68
  image: z.ZodNullable<z.ZodString>;
69
+ imageAssetId: z.ZodNullable<z.ZodString>;
70
+ imageUrl: z.ZodNullable<z.ZodString>;
55
71
  role: z.ZodEnum<{
56
72
  owner: "owner";
57
73
  admin: "admin";
58
74
  instructor: "instructor";
75
+ moderator: "moderator";
59
76
  student: "student";
60
77
  }>;
61
78
  }, z.core.$strict>>;
@@ -65,12 +82,12 @@ declare const CommentView: z.ZodObject<{
65
82
  updatedAt: z.ZodCoercedDate<unknown>;
66
83
  }, z.core.$strict>;
67
84
  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<{
85
+ /** What a reaction write on a post, message or comment returns, so the client never recomputes a count. */
86
+ declare const Reactions: z.ZodObject<{
70
87
  reactions: z.ZodRecord<z.ZodString, z.ZodNumber>;
71
88
  viewerReaction: z.ZodOptional<z.ZodString>;
72
89
  }, z.core.$strip>;
73
- type CommentReactions = z.infer<typeof CommentReactions>;
90
+ type Reactions = z.infer<typeof Reactions>;
74
91
  /** A course's comment settings. Stored under the course, carried on the course
75
92
  * payload as `settings.comments`. */
76
93
  declare const CommentSettings: z.ZodObject<{
@@ -98,35 +115,47 @@ declare const ActivityComments: z.ZodObject<{
98
115
  }, z.core.$strip>;
99
116
  comments: z.ZodArray<z.ZodObject<{
100
117
  id: z.ZodString;
101
- activityId: z.ZodString;
118
+ activityId: z.ZodNullable<z.ZodString>;
119
+ postId: z.ZodNullable<z.ZodString>;
120
+ communityId: z.ZodNullable<z.ZodString>;
102
121
  parentId: z.ZodNullable<z.ZodString>;
103
122
  author: z.ZodObject<{
104
123
  id: z.ZodString;
105
124
  firstName: z.ZodNullable<z.ZodString>;
106
125
  lastName: z.ZodNullable<z.ZodString>;
126
+ displayName: z.ZodNullable<z.ZodString>;
127
+ headline: z.ZodNullable<z.ZodString>;
107
128
  image: z.ZodNullable<z.ZodString>;
129
+ imageAssetId: z.ZodNullable<z.ZodString>;
130
+ imageUrl: z.ZodNullable<z.ZodString>;
108
131
  role: z.ZodEnum<{
109
132
  owner: "owner";
110
133
  admin: "admin";
111
134
  instructor: "instructor";
135
+ moderator: "moderator";
112
136
  student: "student";
113
137
  }>;
114
138
  }, z.core.$strict>;
115
139
  body: z.ZodNullable<z.ZodString>;
116
140
  status: z.ZodEnum<{
117
- published: "published";
118
141
  pending: "pending";
142
+ published: "published";
119
143
  removed: "removed";
120
144
  }>;
121
145
  removedBy: z.ZodNullable<z.ZodObject<{
122
146
  id: z.ZodString;
123
147
  firstName: z.ZodNullable<z.ZodString>;
124
148
  lastName: z.ZodNullable<z.ZodString>;
149
+ displayName: z.ZodNullable<z.ZodString>;
150
+ headline: z.ZodNullable<z.ZodString>;
125
151
  image: z.ZodNullable<z.ZodString>;
152
+ imageAssetId: z.ZodNullable<z.ZodString>;
153
+ imageUrl: z.ZodNullable<z.ZodString>;
126
154
  role: z.ZodEnum<{
127
155
  owner: "owner";
128
156
  admin: "admin";
129
157
  instructor: "instructor";
158
+ moderator: "moderator";
130
159
  student: "student";
131
160
  }>;
132
161
  }, z.core.$strict>>;
@@ -140,24 +169,30 @@ type ActivityComments = z.infer<typeof ActivityComments>;
140
169
  declare const PostComment: z.ZodObject<{
141
170
  body: z.ZodString;
142
171
  parentId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
143
- }, z.core.$strip>;
172
+ }, z.core.$strict>;
144
173
  type PostComment = z.infer<typeof PostComment>;
145
174
  declare const EditComment: z.ZodObject<{
146
175
  body: z.ZodString;
147
- }, z.core.$strip>;
176
+ }, z.core.$strict>;
148
177
  type EditComment = z.infer<typeof EditComment>;
149
178
  /** The staff PATCH writes status and nothing else: publishing covers approving
150
179
  * a pending comment and restoring a removed one. Revising the text is the
151
- * author's own edit, under /api/learn. */
180
+ * author's own edit, under /api/member. */
152
181
  declare const PatchComment: z.ZodObject<{
153
182
  status: z.ZodLiteral<"published">;
154
183
  }, z.core.$strip>;
155
184
  type PatchComment = z.infer<typeof PatchComment>;
156
185
  /** Replaces whatever the reader had. Clearing is DELETE, which carries no body. */
157
- declare const SetCommentReaction: z.ZodObject<{
186
+ declare const SetReaction: z.ZodObject<{
158
187
  emoji: z.ZodString;
159
- }, z.core.$strip>;
160
- type SetCommentReaction = z.infer<typeof SetCommentReaction>;
188
+ }, z.core.$strict>;
189
+ type SetReaction = z.infer<typeof SetReaction>;
190
+ declare const ResolveCommentFlags: z.ZodObject<{
191
+ resolution: z.ZodEnum<{
192
+ dismissed: "dismissed";
193
+ }>;
194
+ }, z.core.$strict>;
195
+ type ResolveCommentFlags = z.infer<typeof ResolveCommentFlags>;
161
196
  /** A moderator's reply, posted from the queue against the comment it answers. */
162
197
  declare const ReplyToComment: z.ZodObject<{
163
198
  body: z.ZodString;
@@ -165,18 +200,20 @@ declare const ReplyToComment: z.ZodObject<{
165
200
  type ReplyToComment = z.infer<typeof ReplyToComment>;
166
201
  declare const ReportComment: z.ZodObject<{
167
202
  reason: z.ZodDefault<z.ZodString>;
168
- }, z.core.$strip>;
203
+ }, z.core.$strict>;
169
204
  type ReportComment = z.infer<typeof ReportComment>;
170
205
  declare const Comment: z.ZodObject<{
171
206
  id: z.ZodString;
172
207
  orgId: z.ZodString;
173
- activityId: z.ZodString;
208
+ activityId: z.ZodNullable<z.ZodString>;
209
+ postId: z.ZodNullable<z.ZodString>;
210
+ communityId: z.ZodNullable<z.ZodString>;
174
211
  parentId: z.ZodNullable<z.ZodString>;
175
212
  orgUserId: z.ZodString;
176
213
  body: z.ZodString;
177
214
  status: z.ZodEnum<{
178
- published: "published";
179
215
  pending: "pending";
216
+ published: "published";
180
217
  removed: "removed";
181
218
  }>;
182
219
  removedBy: z.ZodNullable<z.ZodString>;
@@ -200,11 +237,16 @@ declare const CommentReportSummary: z.ZodObject<{
200
237
  id: z.ZodString;
201
238
  firstName: z.ZodNullable<z.ZodString>;
202
239
  lastName: z.ZodNullable<z.ZodString>;
240
+ displayName: z.ZodNullable<z.ZodString>;
241
+ headline: z.ZodNullable<z.ZodString>;
203
242
  image: z.ZodNullable<z.ZodString>;
243
+ imageAssetId: z.ZodNullable<z.ZodString>;
244
+ imageUrl: z.ZodNullable<z.ZodString>;
204
245
  role: z.ZodEnum<{
205
246
  owner: "owner";
206
247
  admin: "admin";
207
248
  instructor: "instructor";
249
+ moderator: "moderator";
208
250
  student: "student";
209
251
  }>;
210
252
  }, z.core.$strict>;
@@ -222,34 +264,44 @@ declare const CommentListItem: z.ZodObject<{
222
264
  courseId: z.ZodString;
223
265
  body: z.ZodString;
224
266
  status: z.ZodEnum<{
225
- published: "published";
226
267
  pending: "pending";
268
+ published: "published";
227
269
  removed: "removed";
228
270
  }>;
229
271
  author: z.ZodObject<{
230
272
  id: z.ZodString;
231
273
  firstName: z.ZodNullable<z.ZodString>;
232
274
  lastName: z.ZodNullable<z.ZodString>;
275
+ displayName: z.ZodNullable<z.ZodString>;
276
+ headline: z.ZodNullable<z.ZodString>;
233
277
  image: z.ZodNullable<z.ZodString>;
278
+ imageAssetId: z.ZodNullable<z.ZodString>;
279
+ imageUrl: z.ZodNullable<z.ZodString>;
234
280
  role: z.ZodEnum<{
235
281
  owner: "owner";
236
282
  admin: "admin";
237
283
  instructor: "instructor";
284
+ moderator: "moderator";
238
285
  student: "student";
239
286
  }>;
240
287
  }, z.core.$strict>;
241
- authorEmail: z.ZodString;
288
+ authorEmail: z.ZodEmail;
242
289
  removedBy: z.ZodNullable<z.ZodString>;
243
290
  reports: z.ZodArray<z.ZodObject<{
244
291
  reporter: z.ZodObject<{
245
292
  id: z.ZodString;
246
293
  firstName: z.ZodNullable<z.ZodString>;
247
294
  lastName: z.ZodNullable<z.ZodString>;
295
+ displayName: z.ZodNullable<z.ZodString>;
296
+ headline: z.ZodNullable<z.ZodString>;
248
297
  image: z.ZodNullable<z.ZodString>;
298
+ imageAssetId: z.ZodNullable<z.ZodString>;
299
+ imageUrl: z.ZodNullable<z.ZodString>;
249
300
  role: z.ZodEnum<{
250
301
  owner: "owner";
251
302
  admin: "admin";
252
303
  instructor: "instructor";
304
+ moderator: "moderator";
253
305
  student: "student";
254
306
  }>;
255
307
  }, z.core.$strict>;
@@ -266,8 +318,8 @@ declare const CommentsQuery: z.ZodObject<{
266
318
  search: z.ZodOptional<z.ZodString>;
267
319
  sort: z.ZodOptional<z.ZodString>;
268
320
  status: z.ZodOptional<z.ZodEnum<{
269
- published: "published";
270
321
  pending: "pending";
322
+ published: "published";
271
323
  removed: "removed";
272
324
  }>>;
273
325
  reported: z.ZodOptional<z.ZodCodec<z.ZodString, z.ZodBoolean>>;
@@ -285,34 +337,44 @@ declare const CommentsPage: z.ZodObject<{
285
337
  courseId: z.ZodString;
286
338
  body: z.ZodString;
287
339
  status: z.ZodEnum<{
288
- published: "published";
289
340
  pending: "pending";
341
+ published: "published";
290
342
  removed: "removed";
291
343
  }>;
292
344
  author: z.ZodObject<{
293
345
  id: z.ZodString;
294
346
  firstName: z.ZodNullable<z.ZodString>;
295
347
  lastName: z.ZodNullable<z.ZodString>;
348
+ displayName: z.ZodNullable<z.ZodString>;
349
+ headline: z.ZodNullable<z.ZodString>;
296
350
  image: z.ZodNullable<z.ZodString>;
351
+ imageAssetId: z.ZodNullable<z.ZodString>;
352
+ imageUrl: z.ZodNullable<z.ZodString>;
297
353
  role: z.ZodEnum<{
298
354
  owner: "owner";
299
355
  admin: "admin";
300
356
  instructor: "instructor";
357
+ moderator: "moderator";
301
358
  student: "student";
302
359
  }>;
303
360
  }, z.core.$strict>;
304
- authorEmail: z.ZodString;
361
+ authorEmail: z.ZodEmail;
305
362
  removedBy: z.ZodNullable<z.ZodString>;
306
363
  reports: z.ZodArray<z.ZodObject<{
307
364
  reporter: z.ZodObject<{
308
365
  id: z.ZodString;
309
366
  firstName: z.ZodNullable<z.ZodString>;
310
367
  lastName: z.ZodNullable<z.ZodString>;
368
+ displayName: z.ZodNullable<z.ZodString>;
369
+ headline: z.ZodNullable<z.ZodString>;
311
370
  image: z.ZodNullable<z.ZodString>;
371
+ imageAssetId: z.ZodNullable<z.ZodString>;
372
+ imageUrl: z.ZodNullable<z.ZodString>;
312
373
  role: z.ZodEnum<{
313
374
  owner: "owner";
314
375
  admin: "admin";
315
376
  instructor: "instructor";
377
+ moderator: "moderator";
316
378
  student: "student";
317
379
  }>;
318
380
  }, z.core.$strict>;
@@ -336,5 +398,5 @@ declare const CommentIdParam: z.ZodObject<{
336
398
  }, z.core.$strip>;
337
399
  type CommentIdParam = z.infer<typeof CommentIdParam>;
338
400
  //#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 };
401
+ export { ActivityComments, Comment, CommentAuthor, CommentIdParam, CommentListItem, CommentReport, CommentReportSummary, CommentSettings, CommentStatus, CommentView, CommentsConfig, CommentsPage, CommentsQuery, DiscussionActivityParam, EditComment, PatchComment, PostComment, ReactionCounts, ReactionEmoji, Reactions, ReplyToComment, ReportComment, ResolveCommentFlags, SetReaction };
340
402
  //# sourceMappingURL=discussion.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { 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;
@@ -9,10 +9,10 @@ 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
11
  const CommentView = commentViewSchema;
12
- /** What the reaction write returns, so the client never recomputes a count. */
13
- const CommentReactions = z.object({
12
+ /** What a reaction write on a post, message or comment returns, so the client never recomputes a count. */
13
+ const Reactions = z.object({
14
14
  reactions: ReactionCounts,
15
- viewerReaction: ReactionEmoji.optional()
15
+ viewerReaction: ReactionEmoji.optional().describe("Absent when you have no reaction")
16
16
  });
17
17
  /** A course's comment settings. Stored under the course, carried on the course
18
18
  * payload as `settings.comments`. */
@@ -31,18 +31,19 @@ const ActivityComments = z.object({
31
31
  });
32
32
  const PostComment = z.object({
33
33
  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) });
34
+ parentId: idSchema.nullable().default(null).describe("The comment this replies to. Replies nest one level, under a root comment")
35
+ }).strict();
36
+ const EditComment = z.object({ body: z.string().min(1).max(1e4) }).strict();
37
37
  /** The staff PATCH writes status and nothing else: publishing covers approving
38
38
  * a pending comment and restoring a removed one. Revising the text is the
39
- * author's own edit, under /api/learn. */
39
+ * author's own edit, under /api/member. */
40
40
  const PatchComment = z.object({ status: z.literal("published") });
41
41
  /** Replaces whatever the reader had. Clearing is DELETE, which carries no body. */
42
- const SetCommentReaction = z.object({ emoji: ReactionEmoji });
42
+ const SetReaction = z.object({ emoji: ReactionEmoji.describe("Replaces any reaction you already had") }).strict();
43
+ 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
44
  /** A moderator's reply, posted from the queue against the comment it answers. */
44
45
  const ReplyToComment = z.object({ body: z.string().min(1).max(1e4) });
45
- const ReportComment = z.object({ reason: z.string().max(1e3).default("") });
46
+ const ReportComment = z.object({ reason: z.string().max(1e3).default("") }).strict();
46
47
  const Comment = commentSchema;
47
48
  const CommentReport = z.object({
48
49
  id: z.string(),
@@ -73,6 +74,6 @@ const CommentsPage = paginated(CommentListItem);
73
74
  const DiscussionActivityParam = z.object({ activityId: z.string() });
74
75
  const CommentIdParam = z.object({ commentId: z.string() });
75
76
  //#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 };
77
+ export { ActivityComments, Comment, CommentAuthor, CommentIdParam, CommentListItem, CommentReport, CommentReportSummary, CommentSettings, CommentStatus, CommentView, CommentsConfig, CommentsPage, CommentsQuery, DiscussionActivityParam, EditComment, PatchComment, PostComment, ReactionCounts, ReactionEmoji, Reactions, ReplyToComment, ReportComment, ResolveCommentFlags, SetReaction };
77
78
 
78
79
  //# 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\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 { 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 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":";;;;AAqBA,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,YAAY,EAAE,OAAO;CAChC,WAAW;CACX,gBAAgB,cAAc,SAAS,CAAC,CAAC,SAAS,kCAAkC;AACtF,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,EACxB,OAAO;CACN,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAM;CAClC,UAAU,SACP,SAAS,CAAC,CACV,QAAQ,IAAI,CAAC,CACb,SAAS,2EAA2E;AACzF,CAAC,CAAC,CACD,OAAO;AAGV,MAAa,cAAc,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAM,EAAE,CAAC,CAAC,CAAC,OAAO;;;;AAMpF,MAAa,eAAe,EAAE,OAAO,EACnC,QAAQ,EAAE,QAAQ,WAAW,EAC/B,CAAC;;AAID,MAAa,cAAc,EACxB,OAAO,EAAE,OAAO,cAAc,SAAS,uCAAuC,EAAE,CAAC,CAAC,CAClF,OAAO;AAGV,MAAa,sBAAsB,EAChC,OAAO,EACN,YAAY,4BACT,QAAQ,CAAC,WAAW,CAAC,CAAC,CACtB,SACC,4HACF,EACJ,CAAC,CAAC,CACD,OAAO;;AAIV,MAAa,iBAAiB,EAAE,OAAO,EACrC,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAM,EACpC,CAAC;AAGD,MAAa,gBAAgB,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,IAAI,GAAK,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO;AAG5F,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"}