@headless-lms/server 0.2.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 (339) hide show
  1. package/dist/_virtual/_rolldown/runtime.js +5 -0
  2. package/dist/app/community-mail.d.ts +26 -0
  3. package/dist/app/community-mail.js +96 -0
  4. package/dist/app/community-mail.js.map +1 -0
  5. package/dist/app/container.d.ts +18 -14
  6. package/dist/app/container.js +136 -43
  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/http/config.d.ts +2 -1
  12. package/dist/http/errors.d.ts +14 -0
  13. package/dist/http/errors.js +147 -0
  14. package/dist/http/errors.js.map +1 -0
  15. package/dist/http/mcp/catalogue.d.ts +37 -0
  16. package/dist/http/mcp/catalogue.js +69 -0
  17. package/dist/http/mcp/catalogue.js.map +1 -0
  18. package/dist/http/mcp/challenge.d.ts +7 -0
  19. package/dist/http/mcp/challenge.js +35 -0
  20. package/dist/http/mcp/challenge.js.map +1 -0
  21. package/dist/http/mcp/input-schema.d.ts +7 -0
  22. package/dist/http/mcp/input-schema.js +28 -0
  23. package/dist/http/mcp/input-schema.js.map +1 -0
  24. package/dist/http/mcp/route.d.ts +8 -0
  25. package/dist/http/mcp/route.js +75 -0
  26. package/dist/http/mcp/route.js.map +1 -0
  27. package/dist/http/mcp/server.d.ts +8 -0
  28. package/dist/http/mcp/server.js +31 -0
  29. package/dist/http/mcp/server.js.map +1 -0
  30. package/dist/http/mcp/test-support.d.ts +55 -0
  31. package/dist/http/mcp/test-support.js +151 -0
  32. package/dist/http/mcp/test-support.js.map +1 -0
  33. package/dist/http/mcp/tool.d.ts +48 -0
  34. package/dist/http/mcp/tool.js +58 -0
  35. package/dist/http/mcp/tool.js.map +1 -0
  36. package/dist/http/mcp/tools/automations.d.ts +6 -0
  37. package/dist/http/mcp/tools/automations.js +120 -0
  38. package/dist/http/mcp/tools/automations.js.map +1 -0
  39. package/dist/http/mcp/tools/catalog.d.ts +6 -0
  40. package/dist/http/mcp/tools/catalog.js +200 -0
  41. package/dist/http/mcp/tools/catalog.js.map +1 -0
  42. package/dist/http/mcp/tools/comments.d.ts +6 -0
  43. package/dist/http/mcp/tools/comments.js +70 -0
  44. package/dist/http/mcp/tools/comments.js.map +1 -0
  45. package/dist/http/mcp/tools/communities.d.ts +6 -0
  46. package/dist/http/mcp/tools/communities.js +175 -0
  47. package/dist/http/mcp/tools/communities.js.map +1 -0
  48. package/dist/http/mcp/tools/community-members.d.ts +6 -0
  49. package/dist/http/mcp/tools/community-members.js +89 -0
  50. package/dist/http/mcp/tools/community-members.js.map +1 -0
  51. package/dist/http/mcp/tools/community-moderation.d.ts +6 -0
  52. package/dist/http/mcp/tools/community-moderation.js +144 -0
  53. package/dist/http/mcp/tools/community-moderation.js.map +1 -0
  54. package/dist/http/mcp/tools/courses.d.ts +6 -0
  55. package/dist/http/mcp/tools/courses.js +121 -0
  56. package/dist/http/mcp/tools/courses.js.map +1 -0
  57. package/dist/http/mcp/tools/index.d.ts +6 -0
  58. package/dist/http/mcp/tools/index.js +23 -0
  59. package/dist/http/mcp/tools/index.js.map +1 -0
  60. package/dist/http/mcp/tools/people.d.ts +6 -0
  61. package/dist/http/mcp/tools/people.js +145 -0
  62. package/dist/http/mcp/tools/people.js.map +1 -0
  63. package/dist/http/plugins/auth.js +13 -5
  64. package/dist/http/plugins/auth.js.map +1 -1
  65. package/dist/http/plugins/error-handler.d.ts +2 -1
  66. package/dist/http/plugins/error-handler.js +49 -65
  67. package/dist/http/plugins/error-handler.js.map +1 -1
  68. package/dist/http/plugins/openapi.js +49 -2
  69. package/dist/http/plugins/openapi.js.map +1 -1
  70. package/dist/http/routes/access.d.ts +7 -0
  71. package/dist/http/routes/access.js +140 -0
  72. package/dist/http/routes/access.js.map +1 -0
  73. package/dist/http/routes/activities.js +68 -23
  74. package/dist/http/routes/activities.js.map +1 -1
  75. package/dist/http/routes/assets.js +60 -55
  76. package/dist/http/routes/assets.js.map +1 -1
  77. package/dist/http/routes/automations.js +44 -24
  78. package/dist/http/routes/automations.js.map +1 -1
  79. package/dist/http/routes/bundles.js +29 -18
  80. package/dist/http/routes/bundles.js.map +1 -1
  81. package/dist/http/routes/communities.d.ts +7 -0
  82. package/dist/http/routes/communities.js +462 -0
  83. package/dist/http/routes/communities.js.map +1 -0
  84. package/dist/http/routes/community-moderation.d.ts +7 -0
  85. package/dist/http/routes/community-moderation.js +425 -0
  86. package/dist/http/routes/community-moderation.js.map +1 -0
  87. package/dist/http/routes/course-analytics.js +9 -7
  88. package/dist/http/routes/course-analytics.js.map +1 -1
  89. package/dist/http/routes/courses.js +30 -15
  90. package/dist/http/routes/courses.js.map +1 -1
  91. package/dist/http/routes/dashboard.js +15 -6
  92. package/dist/http/routes/dashboard.js.map +1 -1
  93. package/dist/http/routes/discussion.js +34 -26
  94. package/dist/http/routes/discussion.js.map +1 -1
  95. package/dist/http/routes/downloads.js +48 -30
  96. package/dist/http/routes/downloads.js.map +1 -1
  97. package/dist/http/routes/entitlements.js +16 -7
  98. package/dist/http/routes/entitlements.js.map +1 -1
  99. package/dist/http/routes/integrations.js +38 -41
  100. package/dist/http/routes/integrations.js.map +1 -1
  101. package/dist/http/routes/member/actor.d.ts +14 -0
  102. package/dist/http/routes/member/actor.js +11 -0
  103. package/dist/http/routes/member/actor.js.map +1 -0
  104. package/dist/http/routes/member/assets.d.ts +7 -0
  105. package/dist/http/routes/member/assets.js +79 -0
  106. package/dist/http/routes/member/assets.js.map +1 -0
  107. package/dist/http/routes/member/chats.d.ts +7 -0
  108. package/dist/http/routes/member/chats.js +456 -0
  109. package/dist/http/routes/member/chats.js.map +1 -0
  110. package/dist/http/routes/member/comments.d.ts +7 -0
  111. package/dist/http/routes/member/comments.js +187 -0
  112. package/dist/http/routes/member/comments.js.map +1 -0
  113. package/dist/http/routes/member/community.d.ts +7 -0
  114. package/dist/http/routes/member/community.js +288 -0
  115. package/dist/http/routes/member/community.js.map +1 -0
  116. package/dist/http/routes/member/courses.d.ts +7 -0
  117. package/dist/http/routes/member/courses.js +101 -0
  118. package/dist/http/routes/member/courses.js.map +1 -0
  119. package/dist/http/routes/member/downloads.d.ts +7 -0
  120. package/dist/http/routes/member/downloads.js +56 -0
  121. package/dist/http/routes/member/downloads.js.map +1 -0
  122. package/dist/http/routes/member/files.d.ts +7 -0
  123. package/dist/http/routes/member/files.js +184 -0
  124. package/dist/http/routes/member/files.js.map +1 -0
  125. package/dist/http/routes/member/index.d.ts +7 -0
  126. package/dist/http/routes/member/index.js +31 -0
  127. package/dist/http/routes/member/index.js.map +1 -0
  128. package/dist/http/routes/member/notifications.d.ts +7 -0
  129. package/dist/http/routes/member/notifications.js +101 -0
  130. package/dist/http/routes/member/notifications.js.map +1 -0
  131. package/dist/http/routes/member/org.d.ts +7 -0
  132. package/dist/http/routes/member/org.js +56 -0
  133. package/dist/http/routes/member/org.js.map +1 -0
  134. package/dist/http/routes/member/posts.d.ts +7 -0
  135. package/dist/http/routes/member/posts.js +612 -0
  136. package/dist/http/routes/member/posts.js.map +1 -0
  137. package/dist/http/routes/member/profile.d.ts +7 -0
  138. package/dist/http/routes/member/profile.js +48 -0
  139. package/dist/http/routes/member/profile.js.map +1 -0
  140. package/dist/http/routes/member/progress.d.ts +7 -0
  141. package/dist/http/routes/member/progress.js +60 -0
  142. package/dist/http/routes/member/progress.js.map +1 -0
  143. package/dist/http/routes/organizations.js +49 -24
  144. package/dist/http/routes/organizations.js.map +1 -1
  145. package/dist/http/routes/students.js +32 -47
  146. package/dist/http/routes/students.js.map +1 -1
  147. package/dist/http/routes/webhooks.js +26 -18
  148. package/dist/http/routes/webhooks.js.map +1 -1
  149. package/dist/http/routes.js +8 -2
  150. package/dist/http/routes.js.map +1 -1
  151. package/dist/http/schemas/access.d.ts +146 -0
  152. package/dist/http/schemas/access.js +36 -0
  153. package/dist/http/schemas/access.js.map +1 -0
  154. package/dist/http/schemas/activities.d.ts +3 -1
  155. package/dist/http/schemas/activities.js +4 -4
  156. package/dist/http/schemas/activities.js.map +1 -1
  157. package/dist/http/schemas/assets.d.ts +73 -74
  158. package/dist/http/schemas/assets.js +23 -13
  159. package/dist/http/schemas/assets.js.map +1 -1
  160. package/dist/http/schemas/automations.d.ts +10 -0
  161. package/dist/http/schemas/bundles.js +6 -6
  162. package/dist/http/schemas/bundles.js.map +1 -1
  163. package/dist/http/schemas/chats.d.ts +386 -0
  164. package/dist/http/schemas/chats.js +58 -0
  165. package/dist/http/schemas/chats.js.map +1 -0
  166. package/dist/http/schemas/community.d.ts +537 -0
  167. package/dist/http/schemas/community.js +129 -0
  168. package/dist/http/schemas/community.js.map +1 -0
  169. package/dist/http/schemas/content.d.ts +4 -2
  170. package/dist/http/schemas/content.js +11 -8
  171. package/dist/http/schemas/content.js.map +1 -1
  172. package/dist/http/schemas/discussion.d.ts +76 -14
  173. package/dist/http/schemas/discussion.js +12 -11
  174. package/dist/http/schemas/discussion.js.map +1 -1
  175. package/dist/http/schemas/downloads.d.ts +11 -5
  176. package/dist/http/schemas/downloads.js +14 -11
  177. package/dist/http/schemas/downloads.js.map +1 -1
  178. package/dist/http/schemas/entitlements.d.ts +6 -6
  179. package/dist/http/schemas/entitlements.js +6 -6
  180. package/dist/http/schemas/entitlements.js.map +1 -1
  181. package/dist/http/schemas/files.d.ts +45 -0
  182. package/dist/http/schemas/files.js +25 -0
  183. package/dist/http/schemas/files.js.map +1 -0
  184. package/dist/http/schemas/index.d.ts +15 -8
  185. package/dist/http/schemas/index.js +15 -8
  186. package/dist/http/schemas/integrations.d.ts +2 -2
  187. package/dist/http/schemas/invites.d.ts +4 -0
  188. package/dist/http/schemas/invites.js +1 -0
  189. package/dist/http/schemas/invites.js.map +1 -1
  190. package/dist/http/schemas/{learn.d.ts → member.d.ts} +31 -18
  191. package/dist/http/schemas/{learn.js → member.js} +17 -13
  192. package/dist/http/schemas/member.js.map +1 -0
  193. package/dist/http/schemas/members.d.ts +39 -6
  194. package/dist/http/schemas/members.js +17 -3
  195. package/dist/http/schemas/members.js.map +1 -1
  196. package/dist/http/schemas/notifications.d.ts +227 -0
  197. package/dist/http/schemas/notifications.js +44 -0
  198. package/dist/http/schemas/notifications.js.map +1 -0
  199. package/dist/http/schemas/posts.d.ts +316 -0
  200. package/dist/http/schemas/posts.js +47 -0
  201. package/dist/http/schemas/posts.js.map +1 -0
  202. package/dist/http/schemas/profile.d.ts +23 -0
  203. package/dist/http/schemas/profile.js +15 -0
  204. package/dist/http/schemas/profile.js.map +1 -0
  205. package/dist/http/schemas/shared.d.ts +25 -1
  206. package/dist/http/schemas/shared.js +19 -2
  207. package/dist/http/schemas/shared.js.map +1 -1
  208. package/dist/http/schemas/students.d.ts +4 -10
  209. package/dist/http/schemas/students.js +1 -7
  210. package/dist/http/schemas/students.js.map +1 -1
  211. package/dist/http/scope.d.ts +2 -1
  212. package/dist/http/scope.js +20 -4
  213. package/dist/http/scope.js.map +1 -1
  214. package/dist/http/server.js +6 -1
  215. package/dist/http/server.js.map +1 -1
  216. package/dist/http/web-bridge.d.ts +1 -1
  217. package/dist/http/web-bridge.js +2 -2
  218. package/dist/http/web-bridge.js.map +1 -1
  219. package/dist/http/well-known.d.ts +7 -0
  220. package/dist/http/well-known.js +22 -0
  221. package/dist/http/well-known.js.map +1 -0
  222. package/dist/index.d.ts +2 -1
  223. package/dist/index.js +4 -2
  224. package/dist/index.js.map +1 -1
  225. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.js +78 -0
  226. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.js.map +1 -0
  227. package/dist/node_modules/.pnpm/@vitest_expect@2.1.9/node_modules/@vitest/expect/dist/index.js +1267 -0
  228. package/dist/node_modules/.pnpm/@vitest_expect@2.1.9/node_modules/@vitest/expect/dist/index.js.map +1 -0
  229. package/dist/node_modules/.pnpm/@vitest_pretty-format@2.1.9/node_modules/@vitest/pretty-format/dist/index.js +814 -0
  230. package/dist/node_modules/.pnpm/@vitest_pretty-format@2.1.9/node_modules/@vitest/pretty-format/dist/index.js.map +1 -0
  231. package/dist/node_modules/.pnpm/@vitest_runner@2.1.9/node_modules/@vitest/runner/dist/chunk-tasks.js +43 -0
  232. package/dist/node_modules/.pnpm/@vitest_runner@2.1.9/node_modules/@vitest/runner/dist/chunk-tasks.js.map +1 -0
  233. package/dist/node_modules/.pnpm/@vitest_runner@2.1.9/node_modules/@vitest/runner/dist/index.js +527 -0
  234. package/dist/node_modules/.pnpm/@vitest_runner@2.1.9/node_modules/@vitest/runner/dist/index.js.map +1 -0
  235. package/dist/node_modules/.pnpm/@vitest_runner@2.1.9/node_modules/@vitest/runner/dist/utils.js +2 -0
  236. package/dist/node_modules/.pnpm/@vitest_snapshot@2.1.9/node_modules/@vitest/snapshot/dist/index.js +1737 -0
  237. package/dist/node_modules/.pnpm/@vitest_snapshot@2.1.9/node_modules/@vitest/snapshot/dist/index.js.map +1 -0
  238. package/dist/node_modules/.pnpm/@vitest_spy@2.1.9/node_modules/@vitest/spy/dist/index.js +137 -0
  239. package/dist/node_modules/.pnpm/@vitest_spy@2.1.9/node_modules/@vitest/spy/dist/index.js.map +1 -0
  240. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js +118 -0
  241. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js.map +1 -0
  242. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/diff.js +1222 -0
  243. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/diff.js.map +1 -0
  244. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/error.js +91 -0
  245. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/error.js.map +1 -0
  246. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/helpers.js +113 -0
  247. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/helpers.js.map +1 -0
  248. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/index.js +449 -0
  249. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/index.js.map +1 -0
  250. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/source-map.js +163 -0
  251. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/source-map.js.map +1 -0
  252. package/dist/node_modules/.pnpm/chai@5.3.3/node_modules/chai/index.js +3187 -0
  253. package/dist/node_modules/.pnpm/chai@5.3.3/node_modules/chai/index.js.map +1 -0
  254. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/arguments.js +11 -0
  255. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/arguments.js.map +1 -0
  256. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/array.js +16 -0
  257. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/array.js.map +1 -0
  258. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/bigint.js +11 -0
  259. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/bigint.js.map +1 -0
  260. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/class.js +15 -0
  261. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/class.js.map +1 -0
  262. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/date.js +13 -0
  263. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/date.js.map +1 -0
  264. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/error.js +34 -0
  265. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/error.js.map +1 -0
  266. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/function.js +12 -0
  267. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/function.js.map +1 -0
  268. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/helpers.js +122 -0
  269. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/helpers.js.map +1 -0
  270. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/html.js +39 -0
  271. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/html.js.map +1 -0
  272. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/index.js +99 -0
  273. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/index.js.map +1 -0
  274. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/map.js +25 -0
  275. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/map.js.map +1 -0
  276. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/number.js +14 -0
  277. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/number.js.map +1 -0
  278. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/object.js +21 -0
  279. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/object.js.map +1 -0
  280. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/promise.js +6 -0
  281. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/promise.js.map +1 -0
  282. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/regexp.js +12 -0
  283. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/regexp.js.map +1 -0
  284. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/set.js +18 -0
  285. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/set.js.map +1 -0
  286. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/string.js +24 -0
  287. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/string.js.map +1 -0
  288. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/symbol.js +9 -0
  289. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/symbol.js.map +1 -0
  290. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/typedarray.js +30 -0
  291. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/typedarray.js.map +1 -0
  292. package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.js +939 -0
  293. package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.js.map +1 -0
  294. package/dist/node_modules/.pnpm/pathe@1.1.2/node_modules/pathe/dist/shared/pathe.ff20891b.js +82 -0
  295. package/dist/node_modules/.pnpm/pathe@1.1.2/node_modules/pathe/dist/shared/pathe.ff20891b.js.map +1 -0
  296. package/dist/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js +82 -0
  297. package/dist/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js.map +1 -0
  298. package/dist/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/node.js +8 -0
  299. package/dist/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/node.js.map +1 -0
  300. package/dist/node_modules/.pnpm/tinyspy@3.0.2/node_modules/tinyspy/dist/index.js +83 -0
  301. package/dist/node_modules/.pnpm/tinyspy@3.0.2/node_modules/tinyspy/dist/index.js.map +1 -0
  302. 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
  303. 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
  304. 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
  305. 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
  306. 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
  307. 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
  308. 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
  309. 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
  310. package/dist/packages/server/package.js +6 -0
  311. package/dist/packages/server/package.js.map +1 -0
  312. package/package.json +9 -7
  313. package/dist/app/notifications.d.ts +0 -7
  314. package/dist/app/notifications.js +0 -26
  315. package/dist/app/notifications.js.map +0 -1
  316. package/dist/http/routes/learn/assets.d.ts +0 -8
  317. package/dist/http/routes/learn/assets.js +0 -32
  318. package/dist/http/routes/learn/assets.js.map +0 -1
  319. package/dist/http/routes/learn/comments.d.ts +0 -7
  320. package/dist/http/routes/learn/comments.js +0 -175
  321. package/dist/http/routes/learn/comments.js.map +0 -1
  322. package/dist/http/routes/learn/courses.d.ts +0 -7
  323. package/dist/http/routes/learn/courses.js +0 -98
  324. package/dist/http/routes/learn/courses.js.map +0 -1
  325. package/dist/http/routes/learn/downloads.d.ts +0 -7
  326. package/dist/http/routes/learn/downloads.js +0 -76
  327. package/dist/http/routes/learn/downloads.js.map +0 -1
  328. package/dist/http/routes/learn/index.d.ts +0 -7
  329. package/dist/http/routes/learn/index.js +0 -19
  330. package/dist/http/routes/learn/index.js.map +0 -1
  331. package/dist/http/routes/learn/org.d.ts +0 -7
  332. package/dist/http/routes/learn/org.js +0 -50
  333. package/dist/http/routes/learn/org.js.map +0 -1
  334. package/dist/http/routes/learn/progress.d.ts +0 -7
  335. package/dist/http/routes/learn/progress.js +0 -63
  336. package/dist/http/routes/learn/progress.js.map +0 -1
  337. package/dist/http/schemas/learn.js.map +0 -1
  338. package/dist/package.js +0 -6
  339. package/dist/package.js.map +0 -1
@@ -5,7 +5,8 @@ import { z } from "zod";
5
5
  const Role = z.enum([
6
6
  "owner",
7
7
  "admin",
8
- "instructor"
8
+ "instructor",
9
+ "moderator"
9
10
  ]);
10
11
  const MemberStatus = z.enum(["active", "invited"]);
11
12
  const Member = OrgUserProfileSchema.extend({
@@ -19,9 +20,22 @@ const MembersQuery = ListQuery.extend({
19
20
  status: MemberStatus.optional()
20
21
  });
21
22
  const MembersPage = paginated(Member);
22
- const UpdateMemberRole = z.object({ role: Role });
23
+ const AssignableRole = z.enum([
24
+ "admin",
25
+ "instructor",
26
+ "moderator",
27
+ "student"
28
+ ]);
29
+ const UpdateMemberRole = z.object({ role: AssignableRole });
30
+ const MemberRoleChange = Member.extend({ role: z.enum([
31
+ "owner",
32
+ "admin",
33
+ "instructor",
34
+ "moderator",
35
+ "student"
36
+ ]) });
23
37
  const MemberIdParam = z.object({ id: z.string() });
24
38
  //#endregion
25
- export { Member, MemberIdParam, MemberStatus, MembersPage, MembersQuery, Role, UpdateMemberRole };
39
+ export { AssignableRole, Member, MemberIdParam, MemberRoleChange, MemberStatus, MembersPage, MembersQuery, Role, UpdateMemberRole };
26
40
 
27
41
  //# sourceMappingURL=members.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"members.js","names":[],"sources":["../../../src/http/schemas/members.ts"],"sourcesContent":["// Team (org members) resource schemas.\nimport { z } from 'zod';\nimport { ListQuery, paginated, OrgUserProfileSchema } from './shared.js';\n\n/** Org-scoped roles, mirrored from better-auth's organization plugin. */\nexport const Role = z.enum(['owner', 'admin', 'instructor']);\nexport type Role = z.infer<typeof Role>;\n\nexport const MemberStatus = z.enum(['active', 'invited']);\nexport type MemberStatus = z.infer<typeof MemberStatus>;\n\nexport const Member = OrgUserProfileSchema.extend({\n role: Role,\n status: MemberStatus,\n joinedAt: z.string().nullable(),\n invitedAt: z.string().nullable(),\n});\nexport type Member = z.infer<typeof Member>;\n\nexport const MembersQuery = ListQuery.extend({\n role: Role.optional(),\n status: MemberStatus.optional(),\n});\nexport type MembersQuery = z.infer<typeof MembersQuery>;\n\nexport const MembersPage = paginated(Member);\nexport type MembersPage = z.infer<typeof MembersPage>;\n\nexport const UpdateMemberRole = z.object({ role: Role });\nexport type UpdateMemberRole = z.infer<typeof UpdateMemberRole>;\n\nexport const MemberIdParam = z.object({ id: z.string() });\nexport type MemberIdParam = z.infer<typeof MemberIdParam>;\n"],"mappings":";;;;AAKA,MAAa,OAAO,EAAE,KAAK;CAAC;CAAS;CAAS;AAAY,CAAC;AAG3D,MAAa,eAAe,EAAE,KAAK,CAAC,UAAU,SAAS,CAAC;AAGxD,MAAa,SAAS,qBAAqB,OAAO;CAChD,MAAM;CACN,QAAQ;CACR,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS;CAC9B,WAAW,EAAE,OAAO,CAAC,CAAC,SAAS;AACjC,CAAC;AAGD,MAAa,eAAe,UAAU,OAAO;CAC3C,MAAM,KAAK,SAAS;CACpB,QAAQ,aAAa,SAAS;AAChC,CAAC;AAGD,MAAa,cAAc,UAAU,MAAM;AAG3C,MAAa,mBAAmB,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAGvD,MAAa,gBAAgB,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"members.js","names":[],"sources":["../../../src/http/schemas/members.ts"],"sourcesContent":["// Team (org members) resource schemas.\nimport { z } from 'zod';\nimport { ListQuery, paginated, OrgUserProfileSchema } from './shared.js';\n\n/** Org-scoped roles, mirrored from better-auth's organization plugin. */\nexport const Role = z.enum(['owner', 'admin', 'instructor', 'moderator']);\nexport type Role = z.infer<typeof Role>;\n\nexport const MemberStatus = z.enum(['active', 'invited']);\nexport type MemberStatus = z.infer<typeof MemberStatus>;\n\nexport const Member = OrgUserProfileSchema.extend({\n role: Role,\n status: MemberStatus,\n joinedAt: z.string().nullable(),\n invitedAt: z.string().nullable(),\n});\nexport type Member = z.infer<typeof Member>;\n\nexport const MembersQuery = ListQuery.extend({\n role: Role.optional(),\n status: MemberStatus.optional(),\n});\nexport type MembersQuery = z.infer<typeof MembersQuery>;\n\nexport const MembersPage = paginated(Member);\nexport type MembersPage = z.infer<typeof MembersPage>;\n\nexport const AssignableRole = z.enum(['admin', 'instructor', 'moderator', 'student']);\nexport type AssignableRole = z.infer<typeof AssignableRole>;\n\nexport const UpdateMemberRole = z.object({ role: AssignableRole });\nexport type UpdateMemberRole = z.infer<typeof UpdateMemberRole>;\n\nexport const MemberRoleChange = Member.extend({\n role: z.enum(['owner', 'admin', 'instructor', 'moderator', 'student']),\n});\nexport type MemberRoleChange = z.infer<typeof MemberRoleChange>;\n\nexport const MemberIdParam = z.object({ id: z.string() });\nexport type MemberIdParam = z.infer<typeof MemberIdParam>;\n"],"mappings":";;;;AAKA,MAAa,OAAO,EAAE,KAAK;CAAC;CAAS;CAAS;CAAc;AAAW,CAAC;AAGxE,MAAa,eAAe,EAAE,KAAK,CAAC,UAAU,SAAS,CAAC;AAGxD,MAAa,SAAS,qBAAqB,OAAO;CAChD,MAAM;CACN,QAAQ;CACR,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS;CAC9B,WAAW,EAAE,OAAO,CAAC,CAAC,SAAS;AACjC,CAAC;AAGD,MAAa,eAAe,UAAU,OAAO;CAC3C,MAAM,KAAK,SAAS;CACpB,QAAQ,aAAa,SAAS;AAChC,CAAC;AAGD,MAAa,cAAc,UAAU,MAAM;AAG3C,MAAa,iBAAiB,EAAE,KAAK;CAAC;CAAS;CAAc;CAAa;AAAS,CAAC;AAGpF,MAAa,mBAAmB,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAGjE,MAAa,mBAAmB,OAAO,OAAO,EAC5C,MAAM,EAAE,KAAK;CAAC;CAAS;CAAS;CAAc;CAAa;AAAS,CAAC,EACvE,CAAC;AAGD,MAAa,gBAAgB,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC"}
@@ -0,0 +1,227 @@
1
+ import { z } from "zod";
2
+ //#region src/http/schemas/notifications.d.ts
3
+ declare const Notification: z.ZodObject<{
4
+ orgId: z.ZodString;
5
+ id: z.ZodString;
6
+ userId: z.ZodString;
7
+ kind: z.ZodEnum<{
8
+ newPostInSpace: "newPostInSpace";
9
+ newCommentOnPost: "newCommentOnPost";
10
+ replyToYourComment: "replyToYourComment";
11
+ yourPostWasPublished: "yourPostWasPublished";
12
+ yourPostWasRemoved: "yourPostWasRemoved";
13
+ yourCommentWasRemoved: "yourCommentWasRemoved";
14
+ requestApproved: "requestApproved";
15
+ requestDeclined: "requestDeclined";
16
+ invitedToSpace: "invitedToSpace";
17
+ newMessage: "newMessage";
18
+ messageRequest: "messageRequest";
19
+ addedToGroupChat: "addedToGroupChat";
20
+ youAreNowAModerator: "youAreNowAModerator";
21
+ membershipEndingSoon: "membershipEndingSoon";
22
+ welcomeToCommunity: "welcomeToCommunity";
23
+ postAwaitingReview: "postAwaitingReview";
24
+ joinRequest: "joinRequest";
25
+ somethingWasFlagged: "somethingWasFlagged";
26
+ messageWasFlagged: "messageWasFlagged";
27
+ }>;
28
+ actorOrgUserId: z.ZodNullable<z.ZodString>;
29
+ communityId: z.ZodNullable<z.ZodString>;
30
+ spaceId: z.ZodNullable<z.ZodString>;
31
+ postId: z.ZodNullable<z.ZodString>;
32
+ commentId: z.ZodNullable<z.ZodString>;
33
+ chatId: z.ZodNullable<z.ZodString>;
34
+ messageId: z.ZodNullable<z.ZodString>;
35
+ createdAt: z.ZodCoercedDate<unknown>;
36
+ readAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
37
+ }, z.core.$strict>;
38
+ declare const NotificationIdParam: z.ZodObject<{
39
+ notificationId: z.ZodString;
40
+ }, z.core.$strip>;
41
+ declare const NotificationView: z.ZodObject<{
42
+ id: z.ZodString;
43
+ kind: z.ZodEnum<{
44
+ newPostInSpace: "newPostInSpace";
45
+ newCommentOnPost: "newCommentOnPost";
46
+ replyToYourComment: "replyToYourComment";
47
+ yourPostWasPublished: "yourPostWasPublished";
48
+ yourPostWasRemoved: "yourPostWasRemoved";
49
+ yourCommentWasRemoved: "yourCommentWasRemoved";
50
+ requestApproved: "requestApproved";
51
+ requestDeclined: "requestDeclined";
52
+ invitedToSpace: "invitedToSpace";
53
+ newMessage: "newMessage";
54
+ messageRequest: "messageRequest";
55
+ addedToGroupChat: "addedToGroupChat";
56
+ youAreNowAModerator: "youAreNowAModerator";
57
+ membershipEndingSoon: "membershipEndingSoon";
58
+ welcomeToCommunity: "welcomeToCommunity";
59
+ postAwaitingReview: "postAwaitingReview";
60
+ joinRequest: "joinRequest";
61
+ somethingWasFlagged: "somethingWasFlagged";
62
+ messageWasFlagged: "messageWasFlagged";
63
+ }>;
64
+ createdAt: z.ZodCoercedDate<unknown>;
65
+ readAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
66
+ actor: z.ZodNullable<z.ZodObject<{
67
+ orgUserId: z.ZodString;
68
+ displayName: z.ZodNullable<z.ZodString>;
69
+ imageUrl: z.ZodNullable<z.ZodString>;
70
+ }, z.core.$strip>>;
71
+ community: z.ZodNullable<z.ZodObject<{
72
+ id: z.ZodString;
73
+ title: z.ZodString;
74
+ }, z.core.$strip>>;
75
+ space: z.ZodNullable<z.ZodObject<{
76
+ id: z.ZodString;
77
+ name: z.ZodString;
78
+ }, z.core.$strip>>;
79
+ post: z.ZodNullable<z.ZodObject<{
80
+ id: z.ZodString;
81
+ title: z.ZodString;
82
+ }, z.core.$strip>>;
83
+ commentId: z.ZodNullable<z.ZodString>;
84
+ chat: z.ZodNullable<z.ZodObject<{
85
+ id: z.ZodString;
86
+ title: z.ZodString;
87
+ }, z.core.$strip>>;
88
+ messageId: z.ZodNullable<z.ZodString>;
89
+ }, z.core.$strip>;
90
+ declare const NotificationsPage: z.ZodObject<{
91
+ rows: z.ZodArray<z.ZodObject<{
92
+ id: z.ZodString;
93
+ kind: z.ZodEnum<{
94
+ newPostInSpace: "newPostInSpace";
95
+ newCommentOnPost: "newCommentOnPost";
96
+ replyToYourComment: "replyToYourComment";
97
+ yourPostWasPublished: "yourPostWasPublished";
98
+ yourPostWasRemoved: "yourPostWasRemoved";
99
+ yourCommentWasRemoved: "yourCommentWasRemoved";
100
+ requestApproved: "requestApproved";
101
+ requestDeclined: "requestDeclined";
102
+ invitedToSpace: "invitedToSpace";
103
+ newMessage: "newMessage";
104
+ messageRequest: "messageRequest";
105
+ addedToGroupChat: "addedToGroupChat";
106
+ youAreNowAModerator: "youAreNowAModerator";
107
+ membershipEndingSoon: "membershipEndingSoon";
108
+ welcomeToCommunity: "welcomeToCommunity";
109
+ postAwaitingReview: "postAwaitingReview";
110
+ joinRequest: "joinRequest";
111
+ somethingWasFlagged: "somethingWasFlagged";
112
+ messageWasFlagged: "messageWasFlagged";
113
+ }>;
114
+ createdAt: z.ZodCoercedDate<unknown>;
115
+ readAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
116
+ actor: z.ZodNullable<z.ZodObject<{
117
+ orgUserId: z.ZodString;
118
+ displayName: z.ZodNullable<z.ZodString>;
119
+ imageUrl: z.ZodNullable<z.ZodString>;
120
+ }, z.core.$strip>>;
121
+ community: z.ZodNullable<z.ZodObject<{
122
+ id: z.ZodString;
123
+ title: z.ZodString;
124
+ }, z.core.$strip>>;
125
+ space: z.ZodNullable<z.ZodObject<{
126
+ id: z.ZodString;
127
+ name: z.ZodString;
128
+ }, z.core.$strip>>;
129
+ post: z.ZodNullable<z.ZodObject<{
130
+ id: z.ZodString;
131
+ title: z.ZodString;
132
+ }, z.core.$strip>>;
133
+ commentId: z.ZodNullable<z.ZodString>;
134
+ chat: z.ZodNullable<z.ZodObject<{
135
+ id: z.ZodString;
136
+ title: z.ZodString;
137
+ }, z.core.$strip>>;
138
+ messageId: z.ZodNullable<z.ZodString>;
139
+ }, z.core.$strip>>;
140
+ total: z.ZodNumber;
141
+ page: z.ZodNumber;
142
+ pageSize: z.ZodNumber;
143
+ unreadCount: z.ZodNumber;
144
+ }, z.core.$strip>;
145
+ declare const MarkedRead: z.ZodObject<{
146
+ updated: z.ZodNumber;
147
+ }, z.core.$strip>;
148
+ declare const NotificationPreference: z.ZodObject<{
149
+ kind: z.ZodEnum<{
150
+ newPostInSpace: "newPostInSpace";
151
+ newCommentOnPost: "newCommentOnPost";
152
+ replyToYourComment: "replyToYourComment";
153
+ yourPostWasPublished: "yourPostWasPublished";
154
+ yourPostWasRemoved: "yourPostWasRemoved";
155
+ yourCommentWasRemoved: "yourCommentWasRemoved";
156
+ requestApproved: "requestApproved";
157
+ requestDeclined: "requestDeclined";
158
+ invitedToSpace: "invitedToSpace";
159
+ newMessage: "newMessage";
160
+ messageRequest: "messageRequest";
161
+ addedToGroupChat: "addedToGroupChat";
162
+ youAreNowAModerator: "youAreNowAModerator";
163
+ membershipEndingSoon: "membershipEndingSoon";
164
+ welcomeToCommunity: "welcomeToCommunity";
165
+ postAwaitingReview: "postAwaitingReview";
166
+ joinRequest: "joinRequest";
167
+ somethingWasFlagged: "somethingWasFlagged";
168
+ messageWasFlagged: "messageWasFlagged";
169
+ }>;
170
+ inApp: z.ZodBoolean;
171
+ email: z.ZodBoolean;
172
+ }, z.core.$strict>;
173
+ declare const NotificationPreferences: z.ZodArray<z.ZodObject<{
174
+ kind: z.ZodEnum<{
175
+ newPostInSpace: "newPostInSpace";
176
+ newCommentOnPost: "newCommentOnPost";
177
+ replyToYourComment: "replyToYourComment";
178
+ yourPostWasPublished: "yourPostWasPublished";
179
+ yourPostWasRemoved: "yourPostWasRemoved";
180
+ yourCommentWasRemoved: "yourCommentWasRemoved";
181
+ requestApproved: "requestApproved";
182
+ requestDeclined: "requestDeclined";
183
+ invitedToSpace: "invitedToSpace";
184
+ newMessage: "newMessage";
185
+ messageRequest: "messageRequest";
186
+ addedToGroupChat: "addedToGroupChat";
187
+ youAreNowAModerator: "youAreNowAModerator";
188
+ membershipEndingSoon: "membershipEndingSoon";
189
+ welcomeToCommunity: "welcomeToCommunity";
190
+ postAwaitingReview: "postAwaitingReview";
191
+ joinRequest: "joinRequest";
192
+ somethingWasFlagged: "somethingWasFlagged";
193
+ messageWasFlagged: "messageWasFlagged";
194
+ }>;
195
+ inApp: z.ZodBoolean;
196
+ email: z.ZodBoolean;
197
+ }, z.core.$strict>>;
198
+ declare const SetNotificationPreferences: z.ZodObject<{
199
+ preferences: z.ZodArray<z.ZodObject<{
200
+ kind: z.ZodEnum<{
201
+ newPostInSpace: "newPostInSpace";
202
+ newCommentOnPost: "newCommentOnPost";
203
+ replyToYourComment: "replyToYourComment";
204
+ yourPostWasPublished: "yourPostWasPublished";
205
+ yourPostWasRemoved: "yourPostWasRemoved";
206
+ yourCommentWasRemoved: "yourCommentWasRemoved";
207
+ requestApproved: "requestApproved";
208
+ requestDeclined: "requestDeclined";
209
+ invitedToSpace: "invitedToSpace";
210
+ newMessage: "newMessage";
211
+ messageRequest: "messageRequest";
212
+ addedToGroupChat: "addedToGroupChat";
213
+ youAreNowAModerator: "youAreNowAModerator";
214
+ membershipEndingSoon: "membershipEndingSoon";
215
+ welcomeToCommunity: "welcomeToCommunity";
216
+ postAwaitingReview: "postAwaitingReview";
217
+ joinRequest: "joinRequest";
218
+ somethingWasFlagged: "somethingWasFlagged";
219
+ messageWasFlagged: "messageWasFlagged";
220
+ }>;
221
+ inApp: z.ZodBoolean;
222
+ email: z.ZodBoolean;
223
+ }, z.core.$strict>>;
224
+ }, z.core.$strict>;
225
+ //#endregion
226
+ export { MarkedRead, Notification, NotificationIdParam, NotificationPreference, NotificationPreferences, NotificationView, NotificationsPage, SetNotificationPreferences };
227
+ //# sourceMappingURL=notifications.d.ts.map
@@ -0,0 +1,44 @@
1
+ import { paginated } from "./shared.js";
2
+ import { z } from "zod";
3
+ import { notificationKindSchema, notificationPreferenceSchema, notificationSchema } from "@headless-lms/core/schemas";
4
+ //#region src/http/schemas/notifications.ts
5
+ const Notification = notificationSchema;
6
+ const NotificationIdParam = z.object({ notificationId: z.string() });
7
+ const NotificationView = z.object({
8
+ id: z.string(),
9
+ kind: notificationKindSchema,
10
+ createdAt: z.coerce.date(),
11
+ readAt: z.coerce.date().nullable(),
12
+ actor: z.object({
13
+ orgUserId: z.string(),
14
+ displayName: z.string().nullable(),
15
+ imageUrl: z.string().nullable()
16
+ }).nullable(),
17
+ community: z.object({
18
+ id: z.string(),
19
+ title: z.string()
20
+ }).nullable(),
21
+ space: z.object({
22
+ id: z.string(),
23
+ name: z.string()
24
+ }).nullable(),
25
+ post: z.object({
26
+ id: z.string(),
27
+ title: z.string()
28
+ }).nullable().describe("Null when the viewer can no longer see the post"),
29
+ commentId: z.string().nullable(),
30
+ chat: z.object({
31
+ id: z.string(),
32
+ title: z.string()
33
+ }).nullable().describe("Null when the viewer is not in the chat"),
34
+ messageId: z.string().nullable()
35
+ });
36
+ const NotificationsPage = paginated(NotificationView).extend({ unreadCount: z.number().int() });
37
+ const MarkedRead = z.object({ updated: z.number().int() });
38
+ const NotificationPreference = notificationPreferenceSchema;
39
+ const NotificationPreferences = z.array(NotificationPreference);
40
+ const SetNotificationPreferences = z.object({ preferences: z.array(NotificationPreference).min(1).max(notificationKindSchema.options.length).refine((preferences) => new Set(preferences.map((p) => p.kind)).size === preferences.length, { message: "must name each kind at most once" }).describe("One entry per kind to change, each kind at most once; kinds left out keep theirs") }).strict();
41
+ //#endregion
42
+ export { MarkedRead, Notification, NotificationIdParam, NotificationPreference, NotificationPreferences, NotificationView, NotificationsPage, SetNotificationPreferences };
43
+
44
+ //# sourceMappingURL=notifications.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notifications.js","names":[],"sources":["../../../src/http/schemas/notifications.ts"],"sourcesContent":["import { z } from 'zod';\nimport {\n notificationKindSchema,\n notificationPreferenceSchema,\n notificationSchema,\n} from '@headless-lms/core/schemas';\nimport type { NotificationView as DomainNotificationView } from '@headless-lms/core/reporting/member';\nimport { paginated, type Matches } from './shared.js';\n\nexport const Notification = notificationSchema;\nexport const NotificationIdParam = z.object({ notificationId: z.string() });\n\nexport const NotificationView = z.object({\n id: z.string(),\n kind: notificationKindSchema,\n createdAt: z.coerce.date(),\n readAt: z.coerce.date().nullable(),\n actor: z\n .object({\n orgUserId: z.string(),\n displayName: z.string().nullable(),\n imageUrl: z.string().nullable(),\n })\n .nullable(),\n community: z.object({ id: z.string(), title: z.string() }).nullable(),\n space: z.object({ id: z.string(), name: z.string() }).nullable(),\n post: z\n .object({ id: z.string(), title: z.string() })\n .nullable()\n .describe('Null when the viewer can no longer see the post'),\n commentId: z.string().nullable(),\n chat: z\n .object({ id: z.string(), title: z.string() })\n .nullable()\n .describe('Null when the viewer is not in the chat'),\n messageId: z.string().nullable(),\n});\ntype _NotificationViewMatches = Matches<DomainNotificationView, z.infer<typeof NotificationView>> &\n Matches<z.infer<typeof NotificationView>, DomainNotificationView>;\n\nexport const NotificationsPage = paginated(NotificationView).extend({\n unreadCount: z.number().int(),\n});\n\nexport const MarkedRead = z.object({ updated: z.number().int() });\n\nexport const NotificationPreference = notificationPreferenceSchema;\nexport const NotificationPreferences = z.array(NotificationPreference);\nexport const SetNotificationPreferences = z\n .object({\n preferences: z\n .array(NotificationPreference)\n .min(1)\n .max(notificationKindSchema.options.length)\n .refine(\n (preferences) => new Set(preferences.map((p) => p.kind)).size === preferences.length,\n { message: 'must name each kind at most once' },\n )\n .describe('One entry per kind to change, each kind at most once; kinds left out keep theirs'),\n })\n .strict();\n"],"mappings":";;;;AASA,MAAa,eAAe;AAC5B,MAAa,sBAAsB,EAAE,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,CAAC;AAE1E,MAAa,mBAAmB,EAAE,OAAO;CACvC,IAAI,EAAE,OAAO;CACb,MAAM;CACN,WAAW,EAAE,OAAO,KAAK;CACzB,QAAQ,EAAE,OAAO,KAAK,CAAC,CAAC,SAAS;CACjC,OAAO,EACJ,OAAO;EACN,WAAW,EAAE,OAAO;EACpB,aAAa,EAAE,OAAO,CAAC,CAAC,SAAS;EACjC,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS;CAChC,CAAC,CAAC,CACD,SAAS;CACZ,WAAW,EAAE,OAAO;EAAE,IAAI,EAAE,OAAO;EAAG,OAAO,EAAE,OAAO;CAAE,CAAC,CAAC,CAAC,SAAS;CACpE,OAAO,EAAE,OAAO;EAAE,IAAI,EAAE,OAAO;EAAG,MAAM,EAAE,OAAO;CAAE,CAAC,CAAC,CAAC,SAAS;CAC/D,MAAM,EACH,OAAO;EAAE,IAAI,EAAE,OAAO;EAAG,OAAO,EAAE,OAAO;CAAE,CAAC,CAAC,CAC7C,SAAS,CAAC,CACV,SAAS,iDAAiD;CAC7D,WAAW,EAAE,OAAO,CAAC,CAAC,SAAS;CAC/B,MAAM,EACH,OAAO;EAAE,IAAI,EAAE,OAAO;EAAG,OAAO,EAAE,OAAO;CAAE,CAAC,CAAC,CAC7C,SAAS,CAAC,CACV,SAAS,yCAAyC;CACrD,WAAW,EAAE,OAAO,CAAC,CAAC,SAAS;AACjC,CAAC;AAID,MAAa,oBAAoB,UAAU,gBAAgB,CAAC,CAAC,OAAO,EAClE,aAAa,EAAE,OAAO,CAAC,CAAC,IAAI,EAC9B,CAAC;AAED,MAAa,aAAa,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;AAEhE,MAAa,yBAAyB;AACtC,MAAa,0BAA0B,EAAE,MAAM,sBAAsB;AACrE,MAAa,6BAA6B,EACvC,OAAO,EACN,aAAa,EACV,MAAM,sBAAsB,CAAC,CAC7B,IAAI,CAAC,CAAC,CACN,IAAI,uBAAuB,QAAQ,MAAM,CAAC,CAC1C,QACE,gBAAgB,IAAI,IAAI,YAAY,KAAK,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,SAAS,YAAY,QAC9E,EAAE,SAAS,mCAAmC,CAChD,CAAC,CACA,SAAS,kFAAkF,EAChG,CAAC,CAAC,CACD,OAAO"}
@@ -0,0 +1,316 @@
1
+ import { z } from "zod";
2
+ //#region src/http/schemas/posts.d.ts
3
+ declare const PostView: z.ZodObject<{
4
+ orgId: z.ZodString;
5
+ id: z.ZodString;
6
+ communityId: z.ZodString;
7
+ spaceId: z.ZodString;
8
+ orgUserId: z.ZodString;
9
+ topicId: z.ZodNullable<z.ZodString>;
10
+ title: z.ZodString;
11
+ body: z.ZodString;
12
+ extra: z.ZodType<import("@headless-lms/core/types").JsonValue, unknown, z.core.$ZodTypeInternals<import("@headless-lms/core/types").JsonValue, unknown>>;
13
+ coverAssetId: z.ZodNullable<z.ZodString>;
14
+ status: z.ZodEnum<{
15
+ pending: "pending";
16
+ draft: "draft";
17
+ published: "published";
18
+ removed: "removed";
19
+ scheduled: "scheduled";
20
+ }>;
21
+ scheduledAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
22
+ publishedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
23
+ removedBy: z.ZodNullable<z.ZodString>;
24
+ pinned: z.ZodBoolean;
25
+ commentsClosed: z.ZodNullable<z.ZodBoolean>;
26
+ reactionsEnabled: z.ZodNullable<z.ZodBoolean>;
27
+ createdAt: z.ZodCoercedDate<unknown>;
28
+ updatedAt: z.ZodCoercedDate<unknown>;
29
+ coverUrl: z.ZodNullable<z.ZodString>;
30
+ author: z.ZodObject<{
31
+ id: z.ZodString;
32
+ firstName: z.ZodNullable<z.ZodString>;
33
+ lastName: z.ZodNullable<z.ZodString>;
34
+ displayName: z.ZodNullable<z.ZodString>;
35
+ headline: z.ZodNullable<z.ZodString>;
36
+ image: z.ZodNullable<z.ZodString>;
37
+ imageAssetId: z.ZodNullable<z.ZodString>;
38
+ imageUrl: z.ZodNullable<z.ZodString>;
39
+ role: z.ZodEnum<{
40
+ owner: "owner";
41
+ admin: "admin";
42
+ instructor: "instructor";
43
+ moderator: "moderator";
44
+ student: "student";
45
+ }>;
46
+ }, z.core.$strict>;
47
+ reactions: z.ZodRecord<z.ZodString, z.ZodNumber>;
48
+ viewerReaction: z.ZodNullable<z.ZodString>;
49
+ commentCount: z.ZodNumber;
50
+ following: z.ZodBoolean;
51
+ bookmarked: z.ZodBoolean;
52
+ }, z.core.$strict>;
53
+ declare const PostFlag: z.ZodObject<{
54
+ orgId: z.ZodString;
55
+ id: z.ZodString;
56
+ postId: z.ZodString;
57
+ orgUserId: z.ZodString;
58
+ reason: z.ZodString;
59
+ resolvedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
60
+ resolution: z.ZodNullable<z.ZodEnum<{
61
+ dismissed: "dismissed";
62
+ removed: "removed";
63
+ }>>;
64
+ resolvedBy: z.ZodNullable<z.ZodString>;
65
+ createdAt: z.ZodCoercedDate<unknown>;
66
+ updatedAt: z.ZodCoercedDate<unknown>;
67
+ }, z.core.$strict>;
68
+ declare const PostFeedPage: z.ZodObject<{
69
+ rows: z.ZodArray<z.ZodObject<{
70
+ orgId: z.ZodString;
71
+ id: z.ZodString;
72
+ communityId: z.ZodString;
73
+ spaceId: z.ZodString;
74
+ orgUserId: z.ZodString;
75
+ topicId: z.ZodNullable<z.ZodString>;
76
+ title: z.ZodString;
77
+ body: z.ZodString;
78
+ extra: z.ZodType<import("@headless-lms/core/types").JsonValue, unknown, z.core.$ZodTypeInternals<import("@headless-lms/core/types").JsonValue, unknown>>;
79
+ coverAssetId: z.ZodNullable<z.ZodString>;
80
+ status: z.ZodEnum<{
81
+ pending: "pending";
82
+ draft: "draft";
83
+ published: "published";
84
+ removed: "removed";
85
+ scheduled: "scheduled";
86
+ }>;
87
+ scheduledAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
88
+ publishedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
89
+ removedBy: z.ZodNullable<z.ZodString>;
90
+ pinned: z.ZodBoolean;
91
+ commentsClosed: z.ZodNullable<z.ZodBoolean>;
92
+ reactionsEnabled: z.ZodNullable<z.ZodBoolean>;
93
+ createdAt: z.ZodCoercedDate<unknown>;
94
+ updatedAt: z.ZodCoercedDate<unknown>;
95
+ coverUrl: z.ZodNullable<z.ZodString>;
96
+ author: z.ZodObject<{
97
+ id: z.ZodString;
98
+ firstName: z.ZodNullable<z.ZodString>;
99
+ lastName: z.ZodNullable<z.ZodString>;
100
+ displayName: z.ZodNullable<z.ZodString>;
101
+ headline: z.ZodNullable<z.ZodString>;
102
+ image: z.ZodNullable<z.ZodString>;
103
+ imageAssetId: z.ZodNullable<z.ZodString>;
104
+ imageUrl: z.ZodNullable<z.ZodString>;
105
+ role: z.ZodEnum<{
106
+ owner: "owner";
107
+ admin: "admin";
108
+ instructor: "instructor";
109
+ moderator: "moderator";
110
+ student: "student";
111
+ }>;
112
+ }, z.core.$strict>;
113
+ reactions: z.ZodRecord<z.ZodString, z.ZodNumber>;
114
+ viewerReaction: z.ZodNullable<z.ZodString>;
115
+ commentCount: z.ZodNumber;
116
+ following: z.ZodBoolean;
117
+ bookmarked: z.ZodBoolean;
118
+ }, z.core.$strict>>;
119
+ total: z.ZodNumber;
120
+ page: z.ZodNumber;
121
+ pageSize: z.ZodNumber;
122
+ }, z.core.$strip>;
123
+ declare const PostIdParam: z.ZodObject<{
124
+ postId: z.ZodString;
125
+ }, z.core.$strip>;
126
+ declare const FeedQuery: z.ZodObject<{
127
+ page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
128
+ pageSize: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
129
+ topicId: z.ZodOptional<z.ZodString>;
130
+ }, z.core.$strict>;
131
+ declare const CreatePost: z.ZodObject<{
132
+ title: z.ZodString;
133
+ body: z.ZodString;
134
+ topicId: z.ZodNullable<z.ZodString>;
135
+ extra: z.ZodDefault<z.ZodType<import("@headless-lms/core/types").JsonValue, unknown, z.core.$ZodTypeInternals<import("@headless-lms/core/types").JsonValue, unknown>>>;
136
+ coverAssetId: z.ZodNullable<z.ZodString>;
137
+ mode: z.ZodEnum<{
138
+ draft: "draft";
139
+ submit: "submit";
140
+ schedule: "schedule";
141
+ }>;
142
+ scheduledAt: z.ZodNullable<z.ZodPipe<z.ZodISODateTime, z.ZodCoercedDate<string>>>;
143
+ }, z.core.$strict>;
144
+ declare const UpdatePost: z.ZodObject<{
145
+ title: z.ZodOptional<z.ZodString>;
146
+ body: z.ZodOptional<z.ZodString>;
147
+ topicId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
148
+ extra: z.ZodOptional<z.ZodType<import("@headless-lms/core/types").JsonValue, unknown, z.core.$ZodTypeInternals<import("@headless-lms/core/types").JsonValue, unknown>>>;
149
+ coverAssetId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
150
+ }, z.core.$strict>;
151
+ declare const SchedulePost: z.ZodObject<{
152
+ scheduledAt: z.ZodPipe<z.ZodISODateTime, z.ZodCoercedDate<string>>;
153
+ }, z.core.$strict>;
154
+ declare const SetPostReactions: z.ZodObject<{
155
+ enabled: z.ZodBoolean;
156
+ }, z.core.$strict>;
157
+ declare const FlagReason: z.ZodObject<{
158
+ reason: z.ZodString;
159
+ }, z.core.$strict>;
160
+ declare const ResolvePostFlags: z.ZodObject<{
161
+ resolution: z.ZodEnum<{
162
+ dismissed: "dismissed";
163
+ }>;
164
+ }, z.core.$strict>;
165
+ declare const SpaceQueue: z.ZodObject<{
166
+ pending: z.ZodArray<z.ZodObject<{
167
+ orgId: z.ZodString;
168
+ id: z.ZodString;
169
+ communityId: z.ZodString;
170
+ spaceId: z.ZodString;
171
+ orgUserId: z.ZodString;
172
+ topicId: z.ZodNullable<z.ZodString>;
173
+ title: z.ZodString;
174
+ body: z.ZodString;
175
+ extra: z.ZodType<import("@headless-lms/core/types").JsonValue, unknown, z.core.$ZodTypeInternals<import("@headless-lms/core/types").JsonValue, unknown>>;
176
+ coverAssetId: z.ZodNullable<z.ZodString>;
177
+ status: z.ZodEnum<{
178
+ pending: "pending";
179
+ draft: "draft";
180
+ published: "published";
181
+ removed: "removed";
182
+ scheduled: "scheduled";
183
+ }>;
184
+ scheduledAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
185
+ publishedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
186
+ removedBy: z.ZodNullable<z.ZodString>;
187
+ pinned: z.ZodBoolean;
188
+ commentsClosed: z.ZodNullable<z.ZodBoolean>;
189
+ reactionsEnabled: z.ZodNullable<z.ZodBoolean>;
190
+ createdAt: z.ZodCoercedDate<unknown>;
191
+ updatedAt: z.ZodCoercedDate<unknown>;
192
+ coverUrl: z.ZodNullable<z.ZodString>;
193
+ author: z.ZodObject<{
194
+ id: z.ZodString;
195
+ firstName: z.ZodNullable<z.ZodString>;
196
+ lastName: z.ZodNullable<z.ZodString>;
197
+ displayName: z.ZodNullable<z.ZodString>;
198
+ headline: z.ZodNullable<z.ZodString>;
199
+ image: z.ZodNullable<z.ZodString>;
200
+ imageAssetId: z.ZodNullable<z.ZodString>;
201
+ imageUrl: z.ZodNullable<z.ZodString>;
202
+ role: z.ZodEnum<{
203
+ owner: "owner";
204
+ admin: "admin";
205
+ instructor: "instructor";
206
+ moderator: "moderator";
207
+ student: "student";
208
+ }>;
209
+ }, z.core.$strict>;
210
+ reactions: z.ZodRecord<z.ZodString, z.ZodNumber>;
211
+ viewerReaction: z.ZodNullable<z.ZodString>;
212
+ commentCount: z.ZodNumber;
213
+ following: z.ZodBoolean;
214
+ bookmarked: z.ZodBoolean;
215
+ }, z.core.$strict>>;
216
+ flags: z.ZodArray<z.ZodObject<{
217
+ orgId: z.ZodString;
218
+ id: z.ZodString;
219
+ postId: z.ZodString;
220
+ orgUserId: z.ZodString;
221
+ reason: z.ZodString;
222
+ resolvedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
223
+ resolution: z.ZodNullable<z.ZodEnum<{
224
+ dismissed: "dismissed";
225
+ removed: "removed";
226
+ }>>;
227
+ resolvedBy: z.ZodNullable<z.ZodString>;
228
+ createdAt: z.ZodCoercedDate<unknown>;
229
+ updatedAt: z.ZodCoercedDate<unknown>;
230
+ }, z.core.$strict>>;
231
+ commentFlags: z.ZodArray<z.ZodObject<{
232
+ id: z.ZodString;
233
+ orgId: z.ZodString;
234
+ commentId: z.ZodString;
235
+ orgUserId: z.ZodString;
236
+ reason: z.ZodString;
237
+ resolvedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
238
+ resolution: z.ZodNullable<z.ZodEnum<{
239
+ dismissed: "dismissed";
240
+ removed: "removed";
241
+ }>>;
242
+ resolvedBy: z.ZodNullable<z.ZodString>;
243
+ createdAt: z.ZodCoercedDate<unknown>;
244
+ updatedAt: z.ZodCoercedDate<unknown>;
245
+ comment: z.ZodObject<{
246
+ id: z.ZodString;
247
+ postId: z.ZodString;
248
+ body: z.ZodString;
249
+ orgUserId: z.ZodString;
250
+ status: z.ZodEnum<{
251
+ pending: "pending";
252
+ published: "published";
253
+ removed: "removed";
254
+ }>;
255
+ }, z.core.$strict>;
256
+ }, z.core.$strict>>;
257
+ }, z.core.$strip>;
258
+ declare const PostCommentsPage: z.ZodObject<{
259
+ rows: z.ZodArray<z.ZodObject<{
260
+ id: z.ZodString;
261
+ activityId: z.ZodNullable<z.ZodString>;
262
+ postId: z.ZodNullable<z.ZodString>;
263
+ communityId: z.ZodNullable<z.ZodString>;
264
+ parentId: z.ZodNullable<z.ZodString>;
265
+ author: z.ZodObject<{
266
+ id: z.ZodString;
267
+ firstName: z.ZodNullable<z.ZodString>;
268
+ lastName: z.ZodNullable<z.ZodString>;
269
+ displayName: z.ZodNullable<z.ZodString>;
270
+ headline: z.ZodNullable<z.ZodString>;
271
+ image: z.ZodNullable<z.ZodString>;
272
+ imageAssetId: z.ZodNullable<z.ZodString>;
273
+ imageUrl: z.ZodNullable<z.ZodString>;
274
+ role: z.ZodEnum<{
275
+ owner: "owner";
276
+ admin: "admin";
277
+ instructor: "instructor";
278
+ moderator: "moderator";
279
+ student: "student";
280
+ }>;
281
+ }, z.core.$strict>;
282
+ body: z.ZodNullable<z.ZodString>;
283
+ status: z.ZodEnum<{
284
+ pending: "pending";
285
+ published: "published";
286
+ removed: "removed";
287
+ }>;
288
+ removedBy: z.ZodNullable<z.ZodObject<{
289
+ id: z.ZodString;
290
+ firstName: z.ZodNullable<z.ZodString>;
291
+ lastName: z.ZodNullable<z.ZodString>;
292
+ displayName: z.ZodNullable<z.ZodString>;
293
+ headline: z.ZodNullable<z.ZodString>;
294
+ image: z.ZodNullable<z.ZodString>;
295
+ imageAssetId: z.ZodNullable<z.ZodString>;
296
+ imageUrl: z.ZodNullable<z.ZodString>;
297
+ role: z.ZodEnum<{
298
+ owner: "owner";
299
+ admin: "admin";
300
+ instructor: "instructor";
301
+ moderator: "moderator";
302
+ student: "student";
303
+ }>;
304
+ }, z.core.$strict>>;
305
+ reactions: z.ZodRecord<z.ZodString, z.ZodNumber>;
306
+ viewerReaction: z.ZodOptional<z.ZodString>;
307
+ createdAt: z.ZodCoercedDate<unknown>;
308
+ updatedAt: z.ZodCoercedDate<unknown>;
309
+ }, z.core.$strict>>;
310
+ total: z.ZodNumber;
311
+ page: z.ZodNumber;
312
+ pageSize: z.ZodNumber;
313
+ }, z.core.$strip>;
314
+ //#endregion
315
+ export { CreatePost, FeedQuery, FlagReason, PostCommentsPage, PostFeedPage, PostFlag, PostIdParam, PostView, ResolvePostFlags, SchedulePost, SetPostReactions, SpaceQueue, UpdatePost };
316
+ //# sourceMappingURL=posts.d.ts.map