@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
@@ -1,7 +1,7 @@
1
1
  import { z } from "zod";
2
- //#region src/http/schemas/learn.d.ts
2
+ //#region src/http/schemas/member.d.ts
3
3
  /** Courses the authenticated student is actively enrolled in (published only). */
4
- declare const LearnCourses: z.ZodArray<z.ZodObject<{
4
+ declare const MemberCourses: z.ZodArray<z.ZodObject<{
5
5
  orgId: z.ZodString;
6
6
  id: z.ZodString;
7
7
  type: z.ZodLiteral<"course">;
@@ -14,13 +14,22 @@ declare const LearnCourses: z.ZodArray<z.ZodObject<{
14
14
  }>;
15
15
  category: z.ZodString;
16
16
  thumbnailAssetId: z.ZodNullable<z.ZodString>;
17
- settings: z.ZodType<import("@headless-lms/core/types").JsonValue, unknown, z.core.$ZodTypeInternals<import("@headless-lms/core/types").JsonValue, unknown>>;
17
+ settings: z.ZodObject<{
18
+ transcriptDownloads: z.ZodBoolean;
19
+ comments: z.ZodOptional<z.ZodObject<{
20
+ enabled: z.ZodBoolean;
21
+ threaded: z.ZodBoolean;
22
+ requireReview: z.ZodBoolean;
23
+ reactions: z.ZodBoolean;
24
+ }, z.core.$strict>>;
25
+ }, z.core.$strict>;
18
26
  createdAt: z.ZodCoercedDate<unknown>;
19
27
  updatedAt: z.ZodCoercedDate<unknown>;
28
+ thumbnailUrl: z.ZodNullable<z.ZodString>;
20
29
  }, z.core.$strict>>;
21
- type LearnCourses = z.infer<typeof LearnCourses>;
30
+ type MemberCourses = z.infer<typeof MemberCourses>;
22
31
  /** One enrolled course's module→activity tree (published activities only). */
23
- declare const LearnModules: z.ZodArray<z.ZodObject<{
32
+ declare const MemberModules: z.ZodArray<z.ZodObject<{
24
33
  orgId: z.ZodString;
25
34
  id: z.ZodString;
26
35
  courseId: z.ZodString;
@@ -29,13 +38,18 @@ declare const LearnModules: z.ZodArray<z.ZodObject<{
29
38
  createdAt: z.ZodCoercedDate<unknown>;
30
39
  updatedAt: z.ZodCoercedDate<unknown>;
31
40
  }, z.core.$strict>>;
32
- type LearnModules = z.infer<typeof LearnModules>;
33
- declare const LearnCourseIdParam: z.ZodObject<{
41
+ type MemberModules = z.infer<typeof MemberModules>;
42
+ declare const MemberCourseIdParam: z.ZodObject<{
34
43
  courseId: z.ZodString;
35
44
  }, z.core.$strip>;
36
- type LearnCourseIdParam = z.infer<typeof LearnCourseIdParam>;
45
+ type MemberCourseIdParam = z.infer<typeof MemberCourseIdParam>;
46
+ declare const LearnActivityAssetParams: z.ZodObject<{
47
+ activityId: z.ZodString;
48
+ assetId: z.ZodString;
49
+ }, z.core.$strip>;
50
+ type LearnActivityAssetParams = z.infer<typeof LearnActivityAssetParams>;
37
51
  /** Downloads the authenticated student is actively entitled to (published only). */
38
- declare const LearnDownloads: z.ZodArray<z.ZodObject<{
52
+ declare const MemberDownloads: z.ZodArray<z.ZodObject<{
39
53
  orgId: z.ZodString;
40
54
  id: z.ZodString;
41
55
  type: z.ZodLiteral<"download">;
@@ -50,10 +64,11 @@ declare const LearnDownloads: z.ZodArray<z.ZodObject<{
50
64
  thumbnailAssetId: z.ZodNullable<z.ZodString>;
51
65
  createdAt: z.ZodCoercedDate<unknown>;
52
66
  updatedAt: z.ZodCoercedDate<unknown>;
67
+ thumbnailUrl: z.ZodNullable<z.ZodString>;
53
68
  }, z.core.$strict>>;
54
- type LearnDownloads = z.infer<typeof LearnDownloads>;
69
+ type MemberDownloads = z.infer<typeof MemberDownloads>;
55
70
  /** One entitled download plus its ordered assets. */
56
- declare const LearnDownload: z.ZodObject<{
71
+ declare const MemberDownload: z.ZodObject<{
57
72
  download: z.ZodObject<{
58
73
  orgId: z.ZodString;
59
74
  id: z.ZodString;
@@ -69,6 +84,7 @@ declare const LearnDownload: z.ZodObject<{
69
84
  thumbnailAssetId: z.ZodNullable<z.ZodString>;
70
85
  createdAt: z.ZodCoercedDate<unknown>;
71
86
  updatedAt: z.ZodCoercedDate<unknown>;
87
+ thumbnailUrl: z.ZodNullable<z.ZodString>;
72
88
  }, z.core.$strict>;
73
89
  assets: z.ZodArray<z.ZodObject<{
74
90
  orgId: z.ZodString;
@@ -77,28 +93,35 @@ declare const LearnDownload: z.ZodObject<{
77
93
  assetId: z.ZodString;
78
94
  seq: z.ZodNumber;
79
95
  displayName: z.ZodNullable<z.ZodString>;
96
+ createdAt: z.ZodCoercedDate<unknown>;
97
+ updatedAt: z.ZodCoercedDate<unknown>;
98
+ filename: z.ZodString;
99
+ contentType: z.ZodString;
100
+ size: z.ZodNumber;
101
+ url: z.ZodString;
80
102
  }, z.core.$strict>>;
81
103
  }, z.core.$strip>;
82
- type LearnDownload = z.infer<typeof LearnDownload>;
104
+ type MemberDownload = z.infer<typeof MemberDownload>;
83
105
  /** The portal org's public identity — the student surface themes against it. */
84
- declare const LearnOrg: z.ZodObject<{
106
+ declare const MemberOrg: z.ZodObject<{
85
107
  id: z.ZodString;
86
108
  name: z.ZodString;
87
109
  slug: z.ZodString;
88
110
  }, z.core.$strip>;
89
- type LearnOrg = z.infer<typeof LearnOrg>;
111
+ type MemberOrg = z.infer<typeof MemberOrg>;
90
112
  /** Who the caller is within the session's org. The session cookie identifies
91
113
  * an auth user; the learner surface is keyed on `org_users.id`. */
92
- declare const LearnViewer: z.ZodObject<{
114
+ declare const MemberViewer: z.ZodObject<{
93
115
  orgUserId: z.ZodString;
94
116
  role: z.ZodEnum<{
95
117
  owner: "owner";
96
118
  admin: "admin";
97
119
  instructor: "instructor";
120
+ moderator: "moderator";
98
121
  student: "student";
99
122
  }>;
100
123
  }, z.core.$strip>;
101
- type LearnViewer = z.infer<typeof LearnViewer>;
124
+ type MemberViewer = z.infer<typeof MemberViewer>;
102
125
  /** One reported fact — never a decision. `asset` names the subject within the
103
126
  * activity (absent = the activity itself); `completed` is the learner's
104
127
  * activity-level claim. Every other field is the asset type's own vocabulary,
@@ -116,7 +139,7 @@ declare const ReportProgress: z.ZodObject<{
116
139
  asset: z.ZodOptional<z.ZodString>;
117
140
  completed: z.ZodOptional<z.ZodBoolean>;
118
141
  }, z.core.$catchall<z.ZodType<import("@headless-lms/core/types").JsonValue, unknown, z.core.$ZodTypeInternals<import("@headless-lms/core/types").JsonValue, unknown>>>>>;
119
- }, z.core.$strip>;
142
+ }, z.core.$strict>;
120
143
  type ReportProgress = z.infer<typeof ReportProgress>;
121
144
  /** The reported target's state after the service decided. */
122
145
  declare const ProgressStatus: z.ZodObject<{
@@ -138,5 +161,5 @@ declare const CourseProgress: z.ZodObject<{
138
161
  }, z.core.$strip>;
139
162
  type CourseProgress = z.infer<typeof CourseProgress>;
140
163
  //#endregion
141
- export { CourseProgress, LearnCourseIdParam, LearnCourses, LearnDownload, LearnDownloads, LearnModules, LearnOrg, LearnViewer, ProgressReportItem, ProgressStatus, ReportProgress };
142
- //# sourceMappingURL=learn.d.ts.map
164
+ export { CourseProgress, LearnActivityAssetParams, MemberCourseIdParam, MemberCourses, MemberDownload, MemberDownloads, MemberModules, MemberOrg, MemberViewer, ProgressReportItem, ProgressStatus, ReportProgress };
165
+ //# sourceMappingURL=member.d.ts.map
@@ -1,31 +1,35 @@
1
1
  import { OrgRole } from "./shared.js";
2
2
  import { Course } from "./content.js";
3
- import { Download, DownloadAsset } from "./downloads.js";
3
+ import { Download, DownloadFile } from "./downloads.js";
4
4
  import { Module } from "./activities.js";
5
5
  import { z } from "zod";
6
6
  import { progressReportItemSchema } from "@headless-lms/core/schemas";
7
- //#region src/http/schemas/learn.ts
7
+ //#region src/http/schemas/member.ts
8
8
  /** Courses the authenticated student is actively enrolled in (published only). */
9
- const LearnCourses = z.array(Course);
9
+ const MemberCourses = z.array(Course);
10
10
  /** One enrolled course's module→activity tree (published activities only). */
11
- const LearnModules = z.array(Module);
12
- const LearnCourseIdParam = z.object({ courseId: z.string() });
11
+ const MemberModules = z.array(Module);
12
+ const MemberCourseIdParam = z.object({ courseId: z.string() });
13
+ const LearnActivityAssetParams = z.object({
14
+ activityId: z.string(),
15
+ assetId: z.string()
16
+ });
13
17
  /** Downloads the authenticated student is actively entitled to (published only). */
14
- const LearnDownloads = z.array(Download);
18
+ const MemberDownloads = z.array(Download);
15
19
  /** One entitled download plus its ordered assets. */
16
- const LearnDownload = z.object({
20
+ const MemberDownload = z.object({
17
21
  download: Download,
18
- assets: z.array(DownloadAsset)
22
+ assets: z.array(DownloadFile)
19
23
  });
20
24
  /** The portal org's public identity — the student surface themes against it. */
21
- const LearnOrg = z.object({
25
+ const MemberOrg = z.object({
22
26
  id: z.string(),
23
27
  name: z.string(),
24
28
  slug: z.string()
25
29
  });
26
30
  /** Who the caller is within the session's org. The session cookie identifies
27
31
  * an auth user; the learner surface is keyed on `org_users.id`. */
28
- const LearnViewer = z.object({
32
+ const MemberViewer = z.object({
29
33
  orgUserId: z.string(),
30
34
  role: OrgRole
31
35
  });
@@ -39,7 +43,7 @@ const ProgressReportItem = progressReportItemSchema;
39
43
  const ReportProgress = z.object({
40
44
  activity: z.string(),
41
45
  reports: z.array(ProgressReportItem)
42
- });
46
+ }).strict();
43
47
  /** The reported target's state after the service decided. */
44
48
  const ProgressStatus = z.object({ status: z.enum(["in-progress", "completed"]) });
45
49
  /** Per-course progress, derived on read against current structure. */
@@ -53,6 +57,6 @@ const CourseProgress = z.object({
53
57
  positions: z.record(z.string(), z.unknown())
54
58
  });
55
59
  //#endregion
56
- export { CourseProgress, LearnCourseIdParam, LearnCourses, LearnDownload, LearnDownloads, LearnModules, LearnOrg, LearnViewer, ProgressReportItem, ProgressStatus, ReportProgress };
60
+ export { CourseProgress, LearnActivityAssetParams, MemberCourseIdParam, MemberCourses, MemberDownload, MemberDownloads, MemberModules, MemberOrg, MemberViewer, ProgressReportItem, ProgressStatus, ReportProgress };
57
61
 
58
- //# sourceMappingURL=learn.js.map
62
+ //# sourceMappingURL=member.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"member.js","names":[],"sources":["../../../src/http/schemas/member.ts"],"sourcesContent":["// Member resource schemas — the student-facing read surface. Reuses the Course\n// and Module payloads (identical wire shape to the back-office API, including\n// the opaque activity `settings` blob) so one renderer path serves both.\nimport { z } from 'zod';\nimport { progressReportItemSchema } from '@headless-lms/core/schemas';\nimport { Course } from './content.js';\nimport { Module } from './activities.js';\nimport { Download, DownloadFile } from './downloads.js';\nimport { OrgRole } from './shared.js';\n\n/** Courses the authenticated student is actively enrolled in (published only). */\nexport const MemberCourses = z.array(Course);\nexport type MemberCourses = z.infer<typeof MemberCourses>;\n\n/** One enrolled course's module→activity tree (published activities only). */\nexport const MemberModules = z.array(Module);\nexport type MemberModules = z.infer<typeof MemberModules>;\n\nexport const MemberCourseIdParam = z.object({ courseId: z.string() });\nexport type MemberCourseIdParam = z.infer<typeof MemberCourseIdParam>;\n\nexport const LearnActivityAssetParams = z.object({ activityId: z.string(), assetId: z.string() });\nexport type LearnActivityAssetParams = z.infer<typeof LearnActivityAssetParams>;\n\n/** Downloads the authenticated student is actively entitled to (published only). */\nexport const MemberDownloads = z.array(Download);\nexport type MemberDownloads = z.infer<typeof MemberDownloads>;\n\n/** One entitled download plus its ordered assets. */\nexport const MemberDownload = z.object({\n download: Download,\n assets: z.array(DownloadFile),\n});\nexport type MemberDownload = z.infer<typeof MemberDownload>;\n\n/** The portal org's public identity — the student surface themes against it. */\nexport const MemberOrg = z.object({\n id: z.string(),\n name: z.string(),\n slug: z.string(),\n});\nexport type MemberOrg = z.infer<typeof MemberOrg>;\n\n/** Who the caller is within the session's org. The session cookie identifies\n * an auth user; the learner surface is keyed on `org_users.id`. */\nexport const MemberViewer = z.object({\n orgUserId: z.string(),\n role: OrgRole,\n});\nexport type MemberViewer = z.infer<typeof MemberViewer>;\n\n/** One reported fact — never a decision. `asset` names the subject within the\n * activity (absent = the activity itself); `completed` is the learner's\n * activity-level claim. Every other field is the asset type's own vocabulary,\n * passed through opaquely. */\nexport const ProgressReportItem = progressReportItemSchema;\nexport type ProgressReportItem = z.infer<typeof ProgressReportItem>;\n\n/** The report envelope: the target (key names the content type) and a batch of\n * items. `[]` is a bare touch — it creates the record. */\nexport const ReportProgress = z\n .object({\n activity: z.string(),\n reports: z.array(ProgressReportItem),\n })\n .strict();\nexport type ReportProgress = z.infer<typeof ReportProgress>;\n\n/** The reported target's state after the service decided. */\nexport const ProgressStatus = z.object({\n status: z.enum(['in-progress', 'completed']),\n});\nexport type ProgressStatus = z.infer<typeof ProgressStatus>;\n\n/** Per-course progress, derived on read against current structure. */\nexport const CourseProgress = z.object({\n /** Keyed by activity id; absent key = not started. */\n activities: z.record(z.string(), z.enum(['in-progress', 'completed'])),\n /** Integer 0–100, completed ÷ current activities, rounded. */\n percent: z.int().min(0).max(100),\n completed: z.boolean(),\n /** Keyed by activity id: the per-asset reported state map (opaque). */\n positions: z.record(z.string(), z.unknown()),\n});\nexport type CourseProgress = z.infer<typeof CourseProgress>;\n"],"mappings":";;;;;;;;AAWA,MAAa,gBAAgB,EAAE,MAAM,MAAM;;AAI3C,MAAa,gBAAgB,EAAE,MAAM,MAAM;AAG3C,MAAa,sBAAsB,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;AAGpE,MAAa,2BAA2B,EAAE,OAAO;CAAE,YAAY,EAAE,OAAO;CAAG,SAAS,EAAE,OAAO;AAAE,CAAC;;AAIhG,MAAa,kBAAkB,EAAE,MAAM,QAAQ;;AAI/C,MAAa,iBAAiB,EAAE,OAAO;CACrC,UAAU;CACV,QAAQ,EAAE,MAAM,YAAY;AAC9B,CAAC;;AAID,MAAa,YAAY,EAAE,OAAO;CAChC,IAAI,EAAE,OAAO;CACb,MAAM,EAAE,OAAO;CACf,MAAM,EAAE,OAAO;AACjB,CAAC;;;AAKD,MAAa,eAAe,EAAE,OAAO;CACnC,WAAW,EAAE,OAAO;CACpB,MAAM;AACR,CAAC;;;;;AAOD,MAAa,qBAAqB;;;AAKlC,MAAa,iBAAiB,EAC3B,OAAO;CACN,UAAU,EAAE,OAAO;CACnB,SAAS,EAAE,MAAM,kBAAkB;AACrC,CAAC,CAAC,CACD,OAAO;;AAIV,MAAa,iBAAiB,EAAE,OAAO,EACrC,QAAQ,EAAE,KAAK,CAAC,eAAe,WAAW,CAAC,EAC7C,CAAC;;AAID,MAAa,iBAAiB,EAAE,OAAO;;CAErC,YAAY,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,KAAK,CAAC,eAAe,WAAW,CAAC,CAAC;;CAErE,SAAS,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG;CAC/B,WAAW,EAAE,QAAQ;;CAErB,WAAW,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,QAAQ,CAAC;AAC7C,CAAC"}
@@ -5,11 +5,12 @@ declare const Role: z.ZodEnum<{
5
5
  owner: "owner";
6
6
  admin: "admin";
7
7
  instructor: "instructor";
8
+ moderator: "moderator";
8
9
  }>;
9
10
  type Role = z.infer<typeof Role>;
10
11
  declare const MemberStatus: z.ZodEnum<{
11
- active: "active";
12
12
  invited: "invited";
13
+ active: "active";
13
14
  }>;
14
15
  type MemberStatus = z.infer<typeof MemberStatus>;
15
16
  declare const Member: z.ZodObject<{
@@ -22,10 +23,11 @@ declare const Member: z.ZodObject<{
22
23
  owner: "owner";
23
24
  admin: "admin";
24
25
  instructor: "instructor";
26
+ moderator: "moderator";
25
27
  }>;
26
28
  status: z.ZodEnum<{
27
- active: "active";
28
29
  invited: "invited";
30
+ active: "active";
29
31
  }>;
30
32
  joinedAt: z.ZodNullable<z.ZodString>;
31
33
  invitedAt: z.ZodNullable<z.ZodString>;
@@ -40,10 +42,11 @@ declare const MembersQuery: z.ZodObject<{
40
42
  owner: "owner";
41
43
  admin: "admin";
42
44
  instructor: "instructor";
45
+ moderator: "moderator";
43
46
  }>>;
44
47
  status: z.ZodOptional<z.ZodEnum<{
45
- active: "active";
46
48
  invited: "invited";
49
+ active: "active";
47
50
  }>>;
48
51
  }, z.core.$strip>;
49
52
  type MembersQuery = z.infer<typeof MembersQuery>;
@@ -58,10 +61,11 @@ declare const MembersPage: z.ZodObject<{
58
61
  owner: "owner";
59
62
  admin: "admin";
60
63
  instructor: "instructor";
64
+ moderator: "moderator";
61
65
  }>;
62
66
  status: z.ZodEnum<{
63
- active: "active";
64
67
  invited: "invited";
68
+ active: "active";
65
69
  }>;
66
70
  joinedAt: z.ZodNullable<z.ZodString>;
67
71
  invitedAt: z.ZodNullable<z.ZodString>;
@@ -71,18 +75,47 @@ declare const MembersPage: z.ZodObject<{
71
75
  pageSize: z.ZodNumber;
72
76
  }, z.core.$strip>;
73
77
  type MembersPage = z.infer<typeof MembersPage>;
78
+ declare const AssignableRole: z.ZodEnum<{
79
+ admin: "admin";
80
+ instructor: "instructor";
81
+ moderator: "moderator";
82
+ student: "student";
83
+ }>;
84
+ type AssignableRole = z.infer<typeof AssignableRole>;
74
85
  declare const UpdateMemberRole: z.ZodObject<{
75
86
  role: z.ZodEnum<{
76
- owner: "owner";
77
87
  admin: "admin";
78
88
  instructor: "instructor";
89
+ moderator: "moderator";
90
+ student: "student";
79
91
  }>;
80
92
  }, z.core.$strip>;
81
93
  type UpdateMemberRole = z.infer<typeof UpdateMemberRole>;
94
+ declare const MemberRoleChange: z.ZodObject<{
95
+ id: z.ZodString;
96
+ firstName: z.ZodNullable<z.ZodString>;
97
+ lastName: z.ZodNullable<z.ZodString>;
98
+ email: z.ZodString;
99
+ image: z.ZodNullable<z.ZodString>;
100
+ status: z.ZodEnum<{
101
+ invited: "invited";
102
+ active: "active";
103
+ }>;
104
+ joinedAt: z.ZodNullable<z.ZodString>;
105
+ invitedAt: z.ZodNullable<z.ZodString>;
106
+ role: z.ZodEnum<{
107
+ owner: "owner";
108
+ admin: "admin";
109
+ instructor: "instructor";
110
+ moderator: "moderator";
111
+ student: "student";
112
+ }>;
113
+ }, z.core.$strip>;
114
+ type MemberRoleChange = z.infer<typeof MemberRoleChange>;
82
115
  declare const MemberIdParam: z.ZodObject<{
83
116
  id: z.ZodString;
84
117
  }, z.core.$strip>;
85
118
  type MemberIdParam = z.infer<typeof MemberIdParam>;
86
119
  //#endregion
87
- export { Member, MemberIdParam, MemberStatus, MembersPage, MembersQuery, Role, UpdateMemberRole };
120
+ export { AssignableRole, Member, MemberIdParam, MemberRoleChange, MemberStatus, MembersPage, MembersQuery, Role, UpdateMemberRole };
88
121
  //# sourceMappingURL=members.d.ts.map
@@ -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"}
@@ -1 +1 @@
1
- {"version":3,"file":"organizations.js","names":[],"sources":["../../../src/http/schemas/organizations.ts"],"sourcesContent":["// Organization resource schemas. Org creation is served by the API's own\n// `/api/organizations` route (which drives Better Auth under the hood), so the\n// created org is part of the typed contract and SDK — not the auth namespace.\nimport { z } from \"zod\";\n\nexport const Organization = z.object({\n id: z.string(),\n name: z.string(),\n slug: z.string(),\n createdAt: z.string(),\n});\nexport type Organization = z.infer<typeof Organization>;\n\nexport const CreateOrganization = z.object({\n name: z.string().min(1),\n slug: z.string().min(1),\n});\nexport type CreateOrganization = z.infer<typeof CreateOrganization>;\n\n// Update the active organization's profile. Slug must stay URL-safe (Better Auth\n// enforces uniqueness); both fields are sent together from the settings form.\nexport const UpdateOrganization = z.object({\n name: z.string().min(1).max(100),\n slug: z\n .string()\n .min(1)\n .max(50)\n .regex(/^[a-z0-9-]+$/, \"Use lowercase letters, numbers, and hyphens only\"),\n});\nexport type UpdateOrganization = z.infer<typeof UpdateOrganization>;\n"],"mappings":";;AAKA,MAAa,eAAe,EAAE,OAAO;CACnC,IAAI,EAAE,OAAO;CACb,MAAM,EAAE,OAAO;CACf,MAAM,EAAE,OAAO;CACf,WAAW,EAAE,OAAO;AACtB,CAAC;AAGD,MAAa,qBAAqB,EAAE,OAAO;CACzC,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CACtB,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;AACxB,CAAC;AAKD,MAAa,qBAAqB,EAAE,OAAO;CACzC,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG;CAC/B,MAAM,EACH,OAAO,CAAC,CACR,IAAI,CAAC,CAAC,CACN,IAAI,EAAE,CAAC,CACP,MAAM,gBAAgB,kDAAkD;AAC7E,CAAC"}
1
+ {"version":3,"file":"organizations.js","names":[],"sources":["../../../src/http/schemas/organizations.ts"],"sourcesContent":["// Organization resource schemas. Org creation is served by the API's own\n// `/api/organizations` route (which drives Better Auth under the hood), so the\n// created org is part of the typed contract and SDK — not the auth namespace.\nimport { z } from 'zod';\n\nexport const Organization = z.object({\n id: z.string(),\n name: z.string(),\n slug: z.string(),\n createdAt: z.string(),\n});\nexport type Organization = z.infer<typeof Organization>;\n\nexport const CreateOrganization = z.object({\n name: z.string().min(1),\n slug: z.string().min(1),\n});\nexport type CreateOrganization = z.infer<typeof CreateOrganization>;\n\n// Update the active organization's profile. Slug must stay URL-safe (Better Auth\n// enforces uniqueness); both fields are sent together from the settings form.\nexport const UpdateOrganization = z.object({\n name: z.string().min(1).max(100),\n slug: z\n .string()\n .min(1)\n .max(50)\n .regex(/^[a-z0-9-]+$/, 'Use lowercase letters, numbers, and hyphens only'),\n});\nexport type UpdateOrganization = z.infer<typeof UpdateOrganization>;\n"],"mappings":";;AAKA,MAAa,eAAe,EAAE,OAAO;CACnC,IAAI,EAAE,OAAO;CACb,MAAM,EAAE,OAAO;CACf,MAAM,EAAE,OAAO;CACf,WAAW,EAAE,OAAO;AACtB,CAAC;AAGD,MAAa,qBAAqB,EAAE,OAAO;CACzC,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CACtB,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;AACxB,CAAC;AAKD,MAAa,qBAAqB,EAAE,OAAO;CACzC,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG;CAC/B,MAAM,EACH,OAAO,CAAC,CACR,IAAI,CAAC,CAAC,CACN,IAAI,EAAE,CAAC,CACP,MAAM,gBAAgB,kDAAkD;AAC7E,CAAC"}