@headless-lms/server 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (351) hide show
  1. package/dist/_virtual/_rolldown/runtime.js +5 -0
  2. package/dist/app/community-mail.d.ts +24 -0
  3. package/dist/app/community-mail.js +92 -0
  4. package/dist/app/community-mail.js.map +1 -0
  5. package/dist/app/container.d.ts +40 -19
  6. package/dist/app/container.js +294 -45
  7. package/dist/app/container.js.map +1 -1
  8. package/dist/app/mcp-endpoints.d.ts +13 -0
  9. package/dist/app/mcp-endpoints.js +25 -0
  10. package/dist/app/mcp-endpoints.js.map +1 -0
  11. package/dist/app/notification-channels.d.ts +47 -0
  12. package/dist/app/notification-channels.js +174 -0
  13. package/dist/app/notification-channels.js.map +1 -0
  14. package/dist/app/notification-reads.d.ts +23 -0
  15. package/dist/app/notification-reads.js +95 -0
  16. package/dist/app/notification-reads.js.map +1 -0
  17. package/dist/http/config.d.ts +2 -1
  18. package/dist/http/errors.d.ts +15 -0
  19. package/dist/http/errors.js +162 -0
  20. package/dist/http/errors.js.map +1 -0
  21. package/dist/http/mcp/catalogue.d.ts +37 -0
  22. package/dist/http/mcp/catalogue.js +69 -0
  23. package/dist/http/mcp/catalogue.js.map +1 -0
  24. package/dist/http/mcp/challenge.d.ts +7 -0
  25. package/dist/http/mcp/challenge.js +35 -0
  26. package/dist/http/mcp/challenge.js.map +1 -0
  27. package/dist/http/mcp/input-schema.d.ts +7 -0
  28. package/dist/http/mcp/input-schema.js +28 -0
  29. package/dist/http/mcp/input-schema.js.map +1 -0
  30. package/dist/http/mcp/route.d.ts +8 -0
  31. package/dist/http/mcp/route.js +75 -0
  32. package/dist/http/mcp/route.js.map +1 -0
  33. package/dist/http/mcp/server.d.ts +8 -0
  34. package/dist/http/mcp/server.js +31 -0
  35. package/dist/http/mcp/server.js.map +1 -0
  36. package/dist/http/mcp/test-support.d.ts +55 -0
  37. package/dist/http/mcp/test-support.js +151 -0
  38. package/dist/http/mcp/test-support.js.map +1 -0
  39. package/dist/http/mcp/tool.d.ts +48 -0
  40. package/dist/http/mcp/tool.js +58 -0
  41. package/dist/http/mcp/tool.js.map +1 -0
  42. package/dist/http/mcp/tools/automations.d.ts +6 -0
  43. package/dist/http/mcp/tools/automations.js +120 -0
  44. package/dist/http/mcp/tools/automations.js.map +1 -0
  45. package/dist/http/mcp/tools/catalog.d.ts +6 -0
  46. package/dist/http/mcp/tools/catalog.js +200 -0
  47. package/dist/http/mcp/tools/catalog.js.map +1 -0
  48. package/dist/http/mcp/tools/comments.d.ts +6 -0
  49. package/dist/http/mcp/tools/comments.js +70 -0
  50. package/dist/http/mcp/tools/comments.js.map +1 -0
  51. package/dist/http/mcp/tools/communities.d.ts +6 -0
  52. package/dist/http/mcp/tools/communities.js +175 -0
  53. package/dist/http/mcp/tools/communities.js.map +1 -0
  54. package/dist/http/mcp/tools/community-members.d.ts +6 -0
  55. package/dist/http/mcp/tools/community-members.js +89 -0
  56. package/dist/http/mcp/tools/community-members.js.map +1 -0
  57. package/dist/http/mcp/tools/community-moderation.d.ts +6 -0
  58. package/dist/http/mcp/tools/community-moderation.js +144 -0
  59. package/dist/http/mcp/tools/community-moderation.js.map +1 -0
  60. package/dist/http/mcp/tools/courses.d.ts +6 -0
  61. package/dist/http/mcp/tools/courses.js +121 -0
  62. package/dist/http/mcp/tools/courses.js.map +1 -0
  63. package/dist/http/mcp/tools/index.d.ts +6 -0
  64. package/dist/http/mcp/tools/index.js +23 -0
  65. package/dist/http/mcp/tools/index.js.map +1 -0
  66. package/dist/http/mcp/tools/people.d.ts +6 -0
  67. package/dist/http/mcp/tools/people.js +145 -0
  68. package/dist/http/mcp/tools/people.js.map +1 -0
  69. package/dist/http/plugins/auth.js +13 -5
  70. package/dist/http/plugins/auth.js.map +1 -1
  71. package/dist/http/plugins/error-handler.d.ts +2 -1
  72. package/dist/http/plugins/error-handler.js +51 -65
  73. package/dist/http/plugins/error-handler.js.map +1 -1
  74. package/dist/http/plugins/openapi.js +49 -2
  75. package/dist/http/plugins/openapi.js.map +1 -1
  76. package/dist/http/routes/access.d.ts +7 -0
  77. package/dist/http/routes/access.js +140 -0
  78. package/dist/http/routes/access.js.map +1 -0
  79. package/dist/http/routes/activities.js +68 -23
  80. package/dist/http/routes/activities.js.map +1 -1
  81. package/dist/http/routes/assets.js +60 -55
  82. package/dist/http/routes/assets.js.map +1 -1
  83. package/dist/http/routes/automations.js +44 -24
  84. package/dist/http/routes/automations.js.map +1 -1
  85. package/dist/http/routes/bundles.js +29 -18
  86. package/dist/http/routes/bundles.js.map +1 -1
  87. package/dist/http/routes/communities.d.ts +7 -0
  88. package/dist/http/routes/communities.js +522 -0
  89. package/dist/http/routes/communities.js.map +1 -0
  90. package/dist/http/routes/community-moderation.d.ts +7 -0
  91. package/dist/http/routes/community-moderation.js +425 -0
  92. package/dist/http/routes/community-moderation.js.map +1 -0
  93. package/dist/http/routes/course-analytics.js +9 -7
  94. package/dist/http/routes/course-analytics.js.map +1 -1
  95. package/dist/http/routes/courses.js +30 -15
  96. package/dist/http/routes/courses.js.map +1 -1
  97. package/dist/http/routes/dashboard.js +15 -6
  98. package/dist/http/routes/dashboard.js.map +1 -1
  99. package/dist/http/routes/discussion.js +34 -26
  100. package/dist/http/routes/discussion.js.map +1 -1
  101. package/dist/http/routes/downloads.js +48 -30
  102. package/dist/http/routes/downloads.js.map +1 -1
  103. package/dist/http/routes/entitlements.js +16 -7
  104. package/dist/http/routes/entitlements.js.map +1 -1
  105. package/dist/http/routes/integrations.js +38 -41
  106. package/dist/http/routes/integrations.js.map +1 -1
  107. package/dist/http/routes/member/actor.d.ts +14 -0
  108. package/dist/http/routes/member/actor.js +11 -0
  109. package/dist/http/routes/member/actor.js.map +1 -0
  110. package/dist/http/routes/member/assets.d.ts +7 -0
  111. package/dist/http/routes/member/assets.js +79 -0
  112. package/dist/http/routes/member/assets.js.map +1 -0
  113. package/dist/http/routes/member/chats.d.ts +7 -0
  114. package/dist/http/routes/member/chats.js +435 -0
  115. package/dist/http/routes/member/chats.js.map +1 -0
  116. package/dist/http/routes/member/comments.d.ts +7 -0
  117. package/dist/http/routes/member/comments.js +187 -0
  118. package/dist/http/routes/member/comments.js.map +1 -0
  119. package/dist/http/routes/member/community.d.ts +7 -0
  120. package/dist/http/routes/member/community.js +312 -0
  121. package/dist/http/routes/member/community.js.map +1 -0
  122. package/dist/http/routes/member/courses.d.ts +7 -0
  123. package/dist/http/routes/member/courses.js +101 -0
  124. package/dist/http/routes/member/courses.js.map +1 -0
  125. package/dist/http/routes/member/devices.d.ts +7 -0
  126. package/dist/http/routes/member/devices.js +98 -0
  127. package/dist/http/routes/member/devices.js.map +1 -0
  128. package/dist/http/routes/member/downloads.d.ts +7 -0
  129. package/dist/http/routes/member/downloads.js +56 -0
  130. package/dist/http/routes/member/downloads.js.map +1 -0
  131. package/dist/http/routes/member/files.d.ts +7 -0
  132. package/dist/http/routes/member/files.js +184 -0
  133. package/dist/http/routes/member/files.js.map +1 -0
  134. package/dist/http/routes/member/index.d.ts +7 -0
  135. package/dist/http/routes/member/index.js +35 -0
  136. package/dist/http/routes/member/index.js.map +1 -0
  137. package/dist/http/routes/member/notification-settings.d.ts +7 -0
  138. package/dist/http/routes/member/notification-settings.js +108 -0
  139. package/dist/http/routes/member/notification-settings.js.map +1 -0
  140. package/dist/http/routes/member/notifications.d.ts +7 -0
  141. package/dist/http/routes/member/notifications.js +125 -0
  142. package/dist/http/routes/member/notifications.js.map +1 -0
  143. package/dist/http/routes/member/org.d.ts +7 -0
  144. package/dist/http/routes/member/org.js +56 -0
  145. package/dist/http/routes/member/org.js.map +1 -0
  146. package/dist/http/routes/member/posts.d.ts +7 -0
  147. package/dist/http/routes/member/posts.js +612 -0
  148. package/dist/http/routes/member/posts.js.map +1 -0
  149. package/dist/http/routes/member/profile.d.ts +7 -0
  150. package/dist/http/routes/member/profile.js +48 -0
  151. package/dist/http/routes/member/profile.js.map +1 -0
  152. package/dist/http/routes/member/progress.d.ts +7 -0
  153. package/dist/http/routes/member/progress.js +60 -0
  154. package/dist/http/routes/member/progress.js.map +1 -0
  155. package/dist/http/routes/organizations.js +171 -25
  156. package/dist/http/routes/organizations.js.map +1 -1
  157. package/dist/http/routes/students.js +32 -47
  158. package/dist/http/routes/students.js.map +1 -1
  159. package/dist/http/routes/webhooks.js +26 -18
  160. package/dist/http/routes/webhooks.js.map +1 -1
  161. package/dist/http/routes.js +8 -2
  162. package/dist/http/routes.js.map +1 -1
  163. package/dist/http/schemas/access.d.ts +146 -0
  164. package/dist/http/schemas/access.js +36 -0
  165. package/dist/http/schemas/access.js.map +1 -0
  166. package/dist/http/schemas/activities.d.ts +3 -1
  167. package/dist/http/schemas/activities.js +4 -4
  168. package/dist/http/schemas/activities.js.map +1 -1
  169. package/dist/http/schemas/assets.d.ts +79 -80
  170. package/dist/http/schemas/assets.js +23 -13
  171. package/dist/http/schemas/assets.js.map +1 -1
  172. package/dist/http/schemas/automations.d.ts +6 -0
  173. package/dist/http/schemas/bundles.js +6 -6
  174. package/dist/http/schemas/bundles.js.map +1 -1
  175. package/dist/http/schemas/chats.d.ts +409 -0
  176. package/dist/http/schemas/chats.js +56 -0
  177. package/dist/http/schemas/chats.js.map +1 -0
  178. package/dist/http/schemas/community.d.ts +597 -0
  179. package/dist/http/schemas/community.js +132 -0
  180. package/dist/http/schemas/community.js.map +1 -0
  181. package/dist/http/schemas/content.d.ts +4 -2
  182. package/dist/http/schemas/content.js +11 -8
  183. package/dist/http/schemas/content.js.map +1 -1
  184. package/dist/http/schemas/discussion.d.ts +98 -14
  185. package/dist/http/schemas/discussion.js +25 -12
  186. package/dist/http/schemas/discussion.js.map +1 -1
  187. package/dist/http/schemas/downloads.d.ts +11 -5
  188. package/dist/http/schemas/downloads.js +14 -11
  189. package/dist/http/schemas/downloads.js.map +1 -1
  190. package/dist/http/schemas/entitlements.d.ts +6 -6
  191. package/dist/http/schemas/entitlements.js +6 -6
  192. package/dist/http/schemas/entitlements.js.map +1 -1
  193. package/dist/http/schemas/files.d.ts +45 -0
  194. package/dist/http/schemas/files.js +25 -0
  195. package/dist/http/schemas/files.js.map +1 -0
  196. package/dist/http/schemas/index.d.ts +15 -8
  197. package/dist/http/schemas/index.js +15 -8
  198. package/dist/http/schemas/integrations.d.ts +4 -4
  199. package/dist/http/schemas/invites.d.ts +4 -0
  200. package/dist/http/schemas/invites.js +1 -0
  201. package/dist/http/schemas/invites.js.map +1 -1
  202. package/dist/http/schemas/{learn.d.ts → member.d.ts} +31 -18
  203. package/dist/http/schemas/{learn.js → member.js} +17 -13
  204. package/dist/http/schemas/member.js.map +1 -0
  205. package/dist/http/schemas/members.d.ts +35 -2
  206. package/dist/http/schemas/members.js +17 -3
  207. package/dist/http/schemas/members.js.map +1 -1
  208. package/dist/http/schemas/notifications.d.ts +550 -0
  209. package/dist/http/schemas/notifications.js +164 -0
  210. package/dist/http/schemas/notifications.js.map +1 -0
  211. package/dist/http/schemas/posts.d.ts +350 -0
  212. package/dist/http/schemas/posts.js +47 -0
  213. package/dist/http/schemas/posts.js.map +1 -0
  214. package/dist/http/schemas/profile.d.ts +23 -0
  215. package/dist/http/schemas/profile.js +15 -0
  216. package/dist/http/schemas/profile.js.map +1 -0
  217. package/dist/http/schemas/shared.d.ts +32 -1
  218. package/dist/http/schemas/shared.js +20 -2
  219. package/dist/http/schemas/shared.js.map +1 -1
  220. package/dist/http/schemas/students.d.ts +1 -7
  221. package/dist/http/schemas/students.js +1 -7
  222. package/dist/http/schemas/students.js.map +1 -1
  223. package/dist/http/scope.d.ts +3 -1
  224. package/dist/http/scope.js +26 -4
  225. package/dist/http/scope.js.map +1 -1
  226. package/dist/http/server.js +6 -1
  227. package/dist/http/server.js.map +1 -1
  228. package/dist/http/web-bridge.d.ts +1 -1
  229. package/dist/http/web-bridge.js +2 -2
  230. package/dist/http/web-bridge.js.map +1 -1
  231. package/dist/http/well-known.d.ts +7 -0
  232. package/dist/http/well-known.js +22 -0
  233. package/dist/http/well-known.js.map +1 -0
  234. package/dist/index.d.ts +3 -1
  235. package/dist/index.js +4 -2
  236. package/dist/index.js.map +1 -1
  237. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.js +78 -0
  238. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.js.map +1 -0
  239. package/dist/node_modules/.pnpm/@vitest_expect@2.1.9/node_modules/@vitest/expect/dist/index.js +1267 -0
  240. package/dist/node_modules/.pnpm/@vitest_expect@2.1.9/node_modules/@vitest/expect/dist/index.js.map +1 -0
  241. package/dist/node_modules/.pnpm/@vitest_pretty-format@2.1.9/node_modules/@vitest/pretty-format/dist/index.js +814 -0
  242. package/dist/node_modules/.pnpm/@vitest_pretty-format@2.1.9/node_modules/@vitest/pretty-format/dist/index.js.map +1 -0
  243. package/dist/node_modules/.pnpm/@vitest_runner@2.1.9/node_modules/@vitest/runner/dist/chunk-tasks.js +43 -0
  244. package/dist/node_modules/.pnpm/@vitest_runner@2.1.9/node_modules/@vitest/runner/dist/chunk-tasks.js.map +1 -0
  245. package/dist/node_modules/.pnpm/@vitest_runner@2.1.9/node_modules/@vitest/runner/dist/index.js +527 -0
  246. package/dist/node_modules/.pnpm/@vitest_runner@2.1.9/node_modules/@vitest/runner/dist/index.js.map +1 -0
  247. package/dist/node_modules/.pnpm/@vitest_runner@2.1.9/node_modules/@vitest/runner/dist/utils.js +2 -0
  248. package/dist/node_modules/.pnpm/@vitest_snapshot@2.1.9/node_modules/@vitest/snapshot/dist/index.js +1737 -0
  249. package/dist/node_modules/.pnpm/@vitest_snapshot@2.1.9/node_modules/@vitest/snapshot/dist/index.js.map +1 -0
  250. package/dist/node_modules/.pnpm/@vitest_spy@2.1.9/node_modules/@vitest/spy/dist/index.js +137 -0
  251. package/dist/node_modules/.pnpm/@vitest_spy@2.1.9/node_modules/@vitest/spy/dist/index.js.map +1 -0
  252. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js +118 -0
  253. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js.map +1 -0
  254. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/diff.js +1222 -0
  255. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/diff.js.map +1 -0
  256. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/error.js +91 -0
  257. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/error.js.map +1 -0
  258. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/helpers.js +113 -0
  259. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/helpers.js.map +1 -0
  260. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/index.js +449 -0
  261. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/index.js.map +1 -0
  262. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/source-map.js +163 -0
  263. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/source-map.js.map +1 -0
  264. package/dist/node_modules/.pnpm/chai@5.3.3/node_modules/chai/index.js +3187 -0
  265. package/dist/node_modules/.pnpm/chai@5.3.3/node_modules/chai/index.js.map +1 -0
  266. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/arguments.js +11 -0
  267. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/arguments.js.map +1 -0
  268. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/array.js +16 -0
  269. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/array.js.map +1 -0
  270. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/bigint.js +11 -0
  271. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/bigint.js.map +1 -0
  272. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/class.js +15 -0
  273. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/class.js.map +1 -0
  274. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/date.js +13 -0
  275. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/date.js.map +1 -0
  276. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/error.js +34 -0
  277. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/error.js.map +1 -0
  278. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/function.js +12 -0
  279. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/function.js.map +1 -0
  280. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/helpers.js +122 -0
  281. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/helpers.js.map +1 -0
  282. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/html.js +39 -0
  283. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/html.js.map +1 -0
  284. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/index.js +99 -0
  285. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/index.js.map +1 -0
  286. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/map.js +25 -0
  287. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/map.js.map +1 -0
  288. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/number.js +14 -0
  289. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/number.js.map +1 -0
  290. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/object.js +21 -0
  291. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/object.js.map +1 -0
  292. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/promise.js +6 -0
  293. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/promise.js.map +1 -0
  294. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/regexp.js +12 -0
  295. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/regexp.js.map +1 -0
  296. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/set.js +18 -0
  297. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/set.js.map +1 -0
  298. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/string.js +24 -0
  299. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/string.js.map +1 -0
  300. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/symbol.js +9 -0
  301. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/symbol.js.map +1 -0
  302. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/typedarray.js +30 -0
  303. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/typedarray.js.map +1 -0
  304. package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.js +939 -0
  305. package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.js.map +1 -0
  306. package/dist/node_modules/.pnpm/pathe@1.1.2/node_modules/pathe/dist/shared/pathe.ff20891b.js +82 -0
  307. package/dist/node_modules/.pnpm/pathe@1.1.2/node_modules/pathe/dist/shared/pathe.ff20891b.js.map +1 -0
  308. package/dist/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js +82 -0
  309. package/dist/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js.map +1 -0
  310. package/dist/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/node.js +8 -0
  311. package/dist/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/node.js.map +1 -0
  312. package/dist/node_modules/.pnpm/tinyspy@3.0.2/node_modules/tinyspy/dist/index.js +83 -0
  313. package/dist/node_modules/.pnpm/tinyspy@3.0.2/node_modules/tinyspy/dist/index.js.map +1 -0
  314. package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.js +9 -0
  315. package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.js.map +1 -0
  316. package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/date.W2xKR2qe.js +51 -0
  317. package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/date.W2xKR2qe.js.map +1 -0
  318. package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/utils.C8RiOc4B.js +48 -0
  319. package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/utils.C8RiOc4B.js.map +1 -0
  320. package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/vi.DgezovHB.js +2426 -0
  321. package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/vi.DgezovHB.js.map +1 -0
  322. package/dist/packages/server/package.js +6 -0
  323. package/dist/packages/server/package.js.map +1 -0
  324. package/package.json +9 -7
  325. package/dist/app/notifications.d.ts +0 -7
  326. package/dist/app/notifications.js +0 -26
  327. package/dist/app/notifications.js.map +0 -1
  328. package/dist/http/routes/learn/assets.d.ts +0 -8
  329. package/dist/http/routes/learn/assets.js +0 -32
  330. package/dist/http/routes/learn/assets.js.map +0 -1
  331. package/dist/http/routes/learn/comments.d.ts +0 -7
  332. package/dist/http/routes/learn/comments.js +0 -175
  333. package/dist/http/routes/learn/comments.js.map +0 -1
  334. package/dist/http/routes/learn/courses.d.ts +0 -7
  335. package/dist/http/routes/learn/courses.js +0 -98
  336. package/dist/http/routes/learn/courses.js.map +0 -1
  337. package/dist/http/routes/learn/downloads.d.ts +0 -7
  338. package/dist/http/routes/learn/downloads.js +0 -76
  339. package/dist/http/routes/learn/downloads.js.map +0 -1
  340. package/dist/http/routes/learn/index.d.ts +0 -7
  341. package/dist/http/routes/learn/index.js +0 -19
  342. package/dist/http/routes/learn/index.js.map +0 -1
  343. package/dist/http/routes/learn/org.d.ts +0 -7
  344. package/dist/http/routes/learn/org.js +0 -50
  345. package/dist/http/routes/learn/org.js.map +0 -1
  346. package/dist/http/routes/learn/progress.d.ts +0 -7
  347. package/dist/http/routes/learn/progress.js +0 -63
  348. package/dist/http/routes/learn/progress.js.map +0 -1
  349. package/dist/http/schemas/learn.js.map +0 -1
  350. package/dist/package.js +0 -6
  351. package/dist/package.js.map +0 -1
@@ -0,0 +1,409 @@
1
+ import { z } from "zod";
2
+ //#region src/http/schemas/chats.d.ts
3
+ declare const Chat: z.ZodObject<{
4
+ orgId: z.ZodString;
5
+ id: z.ZodString;
6
+ communityId: z.ZodString;
7
+ kind: z.ZodEnum<{
8
+ direct: "direct";
9
+ group: "group";
10
+ }>;
11
+ status: z.ZodEnum<{
12
+ pending: "pending";
13
+ open: "open";
14
+ closed: "closed";
15
+ }>;
16
+ createdBy: z.ZodNullable<z.ZodString>;
17
+ lockedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
18
+ lockedBy: z.ZodNullable<z.ZodString>;
19
+ createdAt: z.ZodCoercedDate<unknown>;
20
+ updatedAt: z.ZodCoercedDate<unknown>;
21
+ }, z.core.$strict>;
22
+ declare const MessageFlag: z.ZodObject<{
23
+ orgId: z.ZodString;
24
+ id: z.ZodString;
25
+ communityId: z.ZodString;
26
+ messageId: z.ZodString;
27
+ orgUserId: z.ZodString;
28
+ reason: z.ZodString;
29
+ resolvedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
30
+ resolution: z.ZodNullable<z.ZodEnum<{
31
+ locked: "locked";
32
+ dismissed: "dismissed";
33
+ deleted: "deleted";
34
+ }>>;
35
+ resolvedBy: z.ZodNullable<z.ZodString>;
36
+ createdAt: z.ZodCoercedDate<unknown>;
37
+ updatedAt: z.ZodCoercedDate<unknown>;
38
+ }, z.core.$strict>;
39
+ declare const MessageView: z.ZodObject<{
40
+ orgId: z.ZodString;
41
+ id: z.ZodString;
42
+ communityId: z.ZodString;
43
+ chatId: z.ZodString;
44
+ orgUserId: z.ZodString;
45
+ body: z.ZodString;
46
+ replyToId: z.ZodNullable<z.ZodString>;
47
+ editedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
48
+ deletedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
49
+ createdAt: z.ZodCoercedDate<unknown>;
50
+ updatedAt: z.ZodCoercedDate<unknown>;
51
+ sender: z.ZodObject<{
52
+ id: z.ZodString;
53
+ firstName: z.ZodNullable<z.ZodString>;
54
+ lastName: z.ZodNullable<z.ZodString>;
55
+ displayName: z.ZodNullable<z.ZodString>;
56
+ headline: z.ZodNullable<z.ZodString>;
57
+ image: z.ZodNullable<z.ZodString>;
58
+ imageAssetId: z.ZodNullable<z.ZodString>;
59
+ imageUrl: z.ZodNullable<z.ZodString>;
60
+ role: z.ZodEnum<{
61
+ owner: "owner";
62
+ admin: "admin";
63
+ instructor: "instructor";
64
+ moderator: "moderator";
65
+ student: "student";
66
+ }>;
67
+ }, z.core.$strict>;
68
+ attachments: z.ZodArray<z.ZodObject<{
69
+ assetId: z.ZodString;
70
+ url: z.ZodString;
71
+ }, z.core.$strict>>;
72
+ reactions: z.ZodRecord<z.ZodString, z.ZodNumber>;
73
+ viewerReaction: z.ZodNullable<z.ZodString>;
74
+ mentions: z.ZodArray<z.ZodObject<{
75
+ orgUserId: z.ZodString;
76
+ name: z.ZodString;
77
+ }, z.core.$strict>>;
78
+ }, z.core.$strict>;
79
+ declare const MessagesPage: z.ZodObject<{
80
+ rows: z.ZodArray<z.ZodObject<{
81
+ orgId: z.ZodString;
82
+ id: z.ZodString;
83
+ communityId: z.ZodString;
84
+ chatId: z.ZodString;
85
+ orgUserId: z.ZodString;
86
+ body: z.ZodString;
87
+ replyToId: z.ZodNullable<z.ZodString>;
88
+ editedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
89
+ deletedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
90
+ createdAt: z.ZodCoercedDate<unknown>;
91
+ updatedAt: z.ZodCoercedDate<unknown>;
92
+ sender: z.ZodObject<{
93
+ id: z.ZodString;
94
+ firstName: z.ZodNullable<z.ZodString>;
95
+ lastName: z.ZodNullable<z.ZodString>;
96
+ displayName: z.ZodNullable<z.ZodString>;
97
+ headline: z.ZodNullable<z.ZodString>;
98
+ image: z.ZodNullable<z.ZodString>;
99
+ imageAssetId: z.ZodNullable<z.ZodString>;
100
+ imageUrl: z.ZodNullable<z.ZodString>;
101
+ role: z.ZodEnum<{
102
+ owner: "owner";
103
+ admin: "admin";
104
+ instructor: "instructor";
105
+ moderator: "moderator";
106
+ student: "student";
107
+ }>;
108
+ }, z.core.$strict>;
109
+ attachments: z.ZodArray<z.ZodObject<{
110
+ assetId: z.ZodString;
111
+ url: z.ZodString;
112
+ }, z.core.$strict>>;
113
+ reactions: z.ZodRecord<z.ZodString, z.ZodNumber>;
114
+ viewerReaction: z.ZodNullable<z.ZodString>;
115
+ mentions: z.ZodArray<z.ZodObject<{
116
+ orgUserId: z.ZodString;
117
+ name: z.ZodString;
118
+ }, z.core.$strict>>;
119
+ }, z.core.$strict>>;
120
+ total: z.ZodNumber;
121
+ page: z.ZodNumber;
122
+ pageSize: z.ZodNumber;
123
+ }, z.core.$strip>;
124
+ declare const ChatListItem: z.ZodObject<{
125
+ chat: z.ZodObject<{
126
+ orgId: z.ZodString;
127
+ id: z.ZodString;
128
+ communityId: z.ZodString;
129
+ kind: z.ZodEnum<{
130
+ direct: "direct";
131
+ group: "group";
132
+ }>;
133
+ status: z.ZodEnum<{
134
+ pending: "pending";
135
+ open: "open";
136
+ closed: "closed";
137
+ }>;
138
+ createdBy: z.ZodNullable<z.ZodString>;
139
+ lockedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
140
+ lockedBy: z.ZodNullable<z.ZodString>;
141
+ createdAt: z.ZodCoercedDate<unknown>;
142
+ updatedAt: z.ZodCoercedDate<unknown>;
143
+ }, z.core.$strict>;
144
+ participantIds: z.ZodArray<z.ZodString>;
145
+ lastReadMessageId: z.ZodNullable<z.ZodString>;
146
+ subscription: z.ZodNullable<z.ZodObject<{
147
+ state: z.ZodEnum<{
148
+ following: "following";
149
+ muted: "muted";
150
+ }>;
151
+ mutedUntil: z.ZodNullable<z.ZodCoercedDate<unknown>>;
152
+ }, z.core.$strict>>;
153
+ unread: z.ZodNumber;
154
+ lastMessage: z.ZodNullable<z.ZodObject<{
155
+ id: z.ZodString;
156
+ orgUserId: z.ZodString;
157
+ body: z.ZodString;
158
+ createdAt: z.ZodCoercedDate<unknown>;
159
+ deletedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
160
+ }, z.core.$strict>>;
161
+ }, z.core.$strip>;
162
+ declare const ChatsPage: z.ZodObject<{
163
+ rows: z.ZodArray<z.ZodObject<{
164
+ chat: z.ZodObject<{
165
+ orgId: z.ZodString;
166
+ id: z.ZodString;
167
+ communityId: z.ZodString;
168
+ kind: z.ZodEnum<{
169
+ direct: "direct";
170
+ group: "group";
171
+ }>;
172
+ status: z.ZodEnum<{
173
+ pending: "pending";
174
+ open: "open";
175
+ closed: "closed";
176
+ }>;
177
+ createdBy: z.ZodNullable<z.ZodString>;
178
+ lockedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
179
+ lockedBy: z.ZodNullable<z.ZodString>;
180
+ createdAt: z.ZodCoercedDate<unknown>;
181
+ updatedAt: z.ZodCoercedDate<unknown>;
182
+ }, z.core.$strict>;
183
+ participantIds: z.ZodArray<z.ZodString>;
184
+ lastReadMessageId: z.ZodNullable<z.ZodString>;
185
+ subscription: z.ZodNullable<z.ZodObject<{
186
+ state: z.ZodEnum<{
187
+ following: "following";
188
+ muted: "muted";
189
+ }>;
190
+ mutedUntil: z.ZodNullable<z.ZodCoercedDate<unknown>>;
191
+ }, z.core.$strict>>;
192
+ unread: z.ZodNumber;
193
+ lastMessage: z.ZodNullable<z.ZodObject<{
194
+ id: z.ZodString;
195
+ orgUserId: z.ZodString;
196
+ body: z.ZodString;
197
+ createdAt: z.ZodCoercedDate<unknown>;
198
+ deletedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
199
+ }, z.core.$strict>>;
200
+ }, z.core.$strip>>;
201
+ total: z.ZodNumber;
202
+ page: z.ZodNumber;
203
+ pageSize: z.ZodNumber;
204
+ }, z.core.$strip>;
205
+ declare const MessageQueueEntry: z.ZodObject<{
206
+ message: z.ZodObject<{
207
+ orgId: z.ZodString;
208
+ id: z.ZodString;
209
+ communityId: z.ZodString;
210
+ chatId: z.ZodString;
211
+ orgUserId: z.ZodString;
212
+ body: z.ZodString;
213
+ replyToId: z.ZodNullable<z.ZodString>;
214
+ editedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
215
+ deletedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
216
+ createdAt: z.ZodCoercedDate<unknown>;
217
+ updatedAt: z.ZodCoercedDate<unknown>;
218
+ sender: z.ZodObject<{
219
+ id: z.ZodString;
220
+ firstName: z.ZodNullable<z.ZodString>;
221
+ lastName: z.ZodNullable<z.ZodString>;
222
+ displayName: z.ZodNullable<z.ZodString>;
223
+ headline: z.ZodNullable<z.ZodString>;
224
+ image: z.ZodNullable<z.ZodString>;
225
+ imageAssetId: z.ZodNullable<z.ZodString>;
226
+ imageUrl: z.ZodNullable<z.ZodString>;
227
+ role: z.ZodEnum<{
228
+ owner: "owner";
229
+ admin: "admin";
230
+ instructor: "instructor";
231
+ moderator: "moderator";
232
+ student: "student";
233
+ }>;
234
+ }, z.core.$strict>;
235
+ attachments: z.ZodArray<z.ZodObject<{
236
+ assetId: z.ZodString;
237
+ url: z.ZodString;
238
+ }, z.core.$strict>>;
239
+ reactions: z.ZodRecord<z.ZodString, z.ZodNumber>;
240
+ viewerReaction: z.ZodNullable<z.ZodString>;
241
+ mentions: z.ZodArray<z.ZodObject<{
242
+ orgUserId: z.ZodString;
243
+ name: z.ZodString;
244
+ }, z.core.$strict>>;
245
+ }, z.core.$strict>;
246
+ flags: z.ZodArray<z.ZodObject<{
247
+ orgId: z.ZodString;
248
+ id: z.ZodString;
249
+ communityId: z.ZodString;
250
+ messageId: z.ZodString;
251
+ orgUserId: z.ZodString;
252
+ reason: z.ZodString;
253
+ resolvedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
254
+ resolution: z.ZodNullable<z.ZodEnum<{
255
+ locked: "locked";
256
+ dismissed: "dismissed";
257
+ deleted: "deleted";
258
+ }>>;
259
+ resolvedBy: z.ZodNullable<z.ZodString>;
260
+ createdAt: z.ZodCoercedDate<unknown>;
261
+ updatedAt: z.ZodCoercedDate<unknown>;
262
+ }, z.core.$strict>>;
263
+ chat: z.ZodObject<{
264
+ orgId: z.ZodString;
265
+ id: z.ZodString;
266
+ communityId: z.ZodString;
267
+ kind: z.ZodEnum<{
268
+ direct: "direct";
269
+ group: "group";
270
+ }>;
271
+ status: z.ZodEnum<{
272
+ pending: "pending";
273
+ open: "open";
274
+ closed: "closed";
275
+ }>;
276
+ createdBy: z.ZodNullable<z.ZodString>;
277
+ lockedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
278
+ lockedBy: z.ZodNullable<z.ZodString>;
279
+ createdAt: z.ZodCoercedDate<unknown>;
280
+ updatedAt: z.ZodCoercedDate<unknown>;
281
+ }, z.core.$strict>;
282
+ participantIds: z.ZodArray<z.ZodString>;
283
+ }, z.core.$strip>;
284
+ declare const MessageQueue: z.ZodObject<{
285
+ entries: z.ZodArray<z.ZodObject<{
286
+ message: z.ZodObject<{
287
+ orgId: z.ZodString;
288
+ id: z.ZodString;
289
+ communityId: z.ZodString;
290
+ chatId: z.ZodString;
291
+ orgUserId: z.ZodString;
292
+ body: z.ZodString;
293
+ replyToId: z.ZodNullable<z.ZodString>;
294
+ editedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
295
+ deletedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
296
+ createdAt: z.ZodCoercedDate<unknown>;
297
+ updatedAt: z.ZodCoercedDate<unknown>;
298
+ sender: z.ZodObject<{
299
+ id: z.ZodString;
300
+ firstName: z.ZodNullable<z.ZodString>;
301
+ lastName: z.ZodNullable<z.ZodString>;
302
+ displayName: z.ZodNullable<z.ZodString>;
303
+ headline: z.ZodNullable<z.ZodString>;
304
+ image: z.ZodNullable<z.ZodString>;
305
+ imageAssetId: z.ZodNullable<z.ZodString>;
306
+ imageUrl: z.ZodNullable<z.ZodString>;
307
+ role: z.ZodEnum<{
308
+ owner: "owner";
309
+ admin: "admin";
310
+ instructor: "instructor";
311
+ moderator: "moderator";
312
+ student: "student";
313
+ }>;
314
+ }, z.core.$strict>;
315
+ attachments: z.ZodArray<z.ZodObject<{
316
+ assetId: z.ZodString;
317
+ url: z.ZodString;
318
+ }, z.core.$strict>>;
319
+ reactions: z.ZodRecord<z.ZodString, z.ZodNumber>;
320
+ viewerReaction: z.ZodNullable<z.ZodString>;
321
+ mentions: z.ZodArray<z.ZodObject<{
322
+ orgUserId: z.ZodString;
323
+ name: z.ZodString;
324
+ }, z.core.$strict>>;
325
+ }, z.core.$strict>;
326
+ flags: z.ZodArray<z.ZodObject<{
327
+ orgId: z.ZodString;
328
+ id: z.ZodString;
329
+ communityId: z.ZodString;
330
+ messageId: z.ZodString;
331
+ orgUserId: z.ZodString;
332
+ reason: z.ZodString;
333
+ resolvedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
334
+ resolution: z.ZodNullable<z.ZodEnum<{
335
+ locked: "locked";
336
+ dismissed: "dismissed";
337
+ deleted: "deleted";
338
+ }>>;
339
+ resolvedBy: z.ZodNullable<z.ZodString>;
340
+ createdAt: z.ZodCoercedDate<unknown>;
341
+ updatedAt: z.ZodCoercedDate<unknown>;
342
+ }, z.core.$strict>>;
343
+ chat: z.ZodObject<{
344
+ orgId: z.ZodString;
345
+ id: z.ZodString;
346
+ communityId: z.ZodString;
347
+ kind: z.ZodEnum<{
348
+ direct: "direct";
349
+ group: "group";
350
+ }>;
351
+ status: z.ZodEnum<{
352
+ pending: "pending";
353
+ open: "open";
354
+ closed: "closed";
355
+ }>;
356
+ createdBy: z.ZodNullable<z.ZodString>;
357
+ lockedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
358
+ lockedBy: z.ZodNullable<z.ZodString>;
359
+ createdAt: z.ZodCoercedDate<unknown>;
360
+ updatedAt: z.ZodCoercedDate<unknown>;
361
+ }, z.core.$strict>;
362
+ participantIds: z.ZodArray<z.ZodString>;
363
+ }, z.core.$strip>>;
364
+ }, z.core.$strip>;
365
+ declare const StartDirectChat: z.ZodObject<{
366
+ communityId: z.ZodString;
367
+ orgUserId: z.ZodString;
368
+ body: z.ZodNullable<z.ZodString>;
369
+ assetIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
370
+ }, z.core.$strict>;
371
+ declare const StartGroupChat: z.ZodObject<{
372
+ communityId: z.ZodString;
373
+ orgUserIds: z.ZodArray<z.ZodString>;
374
+ }, z.core.$strict>;
375
+ declare const SendMessage: z.ZodObject<{
376
+ body: z.ZodString;
377
+ replyToId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
378
+ assetIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
379
+ }, z.core.$strict>;
380
+ declare const EditMessage: z.ZodObject<{
381
+ body: z.ZodString;
382
+ }, z.core.$strict>;
383
+ declare const MarkRead: z.ZodObject<{
384
+ messageId: z.ZodString;
385
+ }, z.core.$strict>;
386
+ declare const OrgUserBody: z.ZodObject<{
387
+ orgUserId: z.ZodString;
388
+ }, z.core.$strict>;
389
+ declare const ResolveMessageFlags: z.ZodObject<{
390
+ resolution: z.ZodEnum<{
391
+ dismissed: "dismissed";
392
+ }>;
393
+ }, z.core.$strict>;
394
+ declare const ChatIdParam: z.ZodObject<{
395
+ chatId: z.ZodString;
396
+ }, z.core.$strip>;
397
+ declare const MessageIdParam: z.ZodObject<{
398
+ messageId: z.ZodString;
399
+ }, z.core.$strip>;
400
+ declare const CommunityParam: z.ZodObject<{
401
+ communityId: z.ZodString;
402
+ }, z.core.$strip>;
403
+ declare const BlockParam: z.ZodObject<{
404
+ communityId: z.ZodString;
405
+ orgUserId: z.ZodString;
406
+ }, z.core.$strip>;
407
+ //#endregion
408
+ export { BlockParam, Chat, ChatIdParam, ChatListItem, ChatsPage, CommunityParam, EditMessage, MarkRead, MessageFlag, MessageIdParam, MessageQueue, MessageQueueEntry, MessageView, MessagesPage, OrgUserBody, ResolveMessageFlags, SendMessage, StartDirectChat, StartGroupChat };
409
+ //# sourceMappingURL=chats.d.ts.map
@@ -0,0 +1,56 @@
1
+ import { paginated } from "./shared.js";
2
+ import { z } from "zod";
3
+ import { chatLastMessageSchema, chatSchema, idSchema, messageFlagResolutionSchema, messageFlagSchema, messageViewSchema, subscriptionViewSchema } from "@headless-lms/core/schemas";
4
+ //#region src/http/schemas/chats.ts
5
+ const Chat = chatSchema;
6
+ const MessageFlag = messageFlagSchema;
7
+ const MessageView = messageViewSchema;
8
+ const MessagesPage = paginated(MessageView);
9
+ const ChatListItem = z.object({
10
+ chat: Chat,
11
+ participantIds: z.array(z.string()),
12
+ lastReadMessageId: z.string().nullable(),
13
+ subscription: subscriptionViewSchema.nullable().describe("Your mute on this chat while it applies; null when none"),
14
+ unread: z.number().int(),
15
+ lastMessage: chatLastMessageSchema.nullable()
16
+ });
17
+ const ChatsPage = paginated(ChatListItem);
18
+ const MessageQueueEntry = z.object({
19
+ message: MessageView,
20
+ flags: z.array(MessageFlag),
21
+ chat: Chat,
22
+ participantIds: z.array(z.string())
23
+ });
24
+ const MessageQueue = z.object({ entries: z.array(MessageQueueEntry) });
25
+ const MessageBody = z.string().trim().min(1).max(1e4);
26
+ const Attachments = z.array(idSchema).max(10).default([]).describe("Up to 10 finalized images you uploaded through `requestMemberUpload`");
27
+ const StartDirectChat = z.object({
28
+ communityId: idSchema,
29
+ orgUserId: idSchema.describe("The person to talk to"),
30
+ body: MessageBody.nullable().describe("The first message. Null opens the chat without one; a new chat that starts as a message request needs one, and attachments need one."),
31
+ assetIds: Attachments
32
+ }).strict();
33
+ const StartGroupChat = z.object({
34
+ communityId: idSchema,
35
+ orgUserIds: z.array(idSchema).min(2).max(99).describe("The people to add besides you. The chat may not exceed the community's group size.")
36
+ }).strict();
37
+ const SendMessage = z.object({
38
+ body: MessageBody,
39
+ replyToId: idSchema.nullable().default(null).describe("A message in the same chat this one answers"),
40
+ assetIds: Attachments
41
+ }).strict();
42
+ const EditMessage = z.object({ body: MessageBody }).strict();
43
+ const MarkRead = z.object({ messageId: idSchema.describe("The newest message you have read in this chat") }).strict();
44
+ const OrgUserBody = z.object({ orgUserId: idSchema }).strict();
45
+ const ResolveMessageFlags = z.object({ resolution: messageFlagResolutionSchema.extract(["dismissed"]).describe("`dismissed` closes the open flags and leaves the message up. Deleting the message or locking the chat resolves its flags as `deleted` or `locked` instead.") }).strict();
46
+ const ChatIdParam = z.object({ chatId: z.string() });
47
+ const MessageIdParam = z.object({ messageId: z.string() });
48
+ const CommunityParam = z.object({ communityId: z.string() });
49
+ const BlockParam = z.object({
50
+ communityId: z.string(),
51
+ orgUserId: z.string()
52
+ });
53
+ //#endregion
54
+ export { BlockParam, Chat, ChatIdParam, ChatListItem, ChatsPage, CommunityParam, EditMessage, MarkRead, MessageFlag, MessageIdParam, MessageQueue, MessageQueueEntry, MessageView, MessagesPage, OrgUserBody, ResolveMessageFlags, SendMessage, StartDirectChat, StartGroupChat };
55
+
56
+ //# sourceMappingURL=chats.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chats.js","names":[],"sources":["../../../src/http/schemas/chats.ts"],"sourcesContent":["import { z } from 'zod';\nimport {\n chatLastMessageSchema,\n chatSchema,\n idSchema,\n messageFlagResolutionSchema,\n messageFlagSchema,\n messageViewSchema,\n subscriptionViewSchema,\n} from '@headless-lms/core/schemas';\nimport { paginated } from './shared.js';\n\nexport const Chat = chatSchema;\nexport const MessageFlag = messageFlagSchema;\nexport const MessageView = messageViewSchema;\nexport const MessagesPage = paginated(MessageView);\n\nexport const ChatListItem = z.object({\n chat: Chat,\n participantIds: z.array(z.string()),\n lastReadMessageId: z.string().nullable(),\n subscription: subscriptionViewSchema\n .nullable()\n .describe('Your mute on this chat while it applies; null when none'),\n unread: z.number().int(),\n lastMessage: chatLastMessageSchema.nullable(),\n});\nexport const ChatsPage = paginated(ChatListItem);\n\nexport const MessageQueueEntry = z.object({\n message: MessageView,\n flags: z.array(MessageFlag),\n chat: Chat,\n participantIds: z.array(z.string()),\n});\n\nexport const MessageQueue = z.object({\n entries: z.array(MessageQueueEntry),\n});\n\nconst MessageBody = z.string().trim().min(1).max(10_000);\nconst Attachments = z\n .array(idSchema)\n .max(10)\n .default([])\n .describe('Up to 10 finalized images you uploaded through `requestMemberUpload`');\n\nexport const StartDirectChat = z\n .object({\n communityId: idSchema,\n orgUserId: idSchema.describe('The person to talk to'),\n body: MessageBody.nullable().describe(\n 'The first message. Null opens the chat without one; a new chat that starts as a message request needs one, and attachments need one.',\n ),\n assetIds: Attachments,\n })\n .strict();\n\nexport const StartGroupChat = z\n .object({\n communityId: idSchema,\n orgUserIds: z\n .array(idSchema)\n .min(2)\n .max(99)\n .describe(\n \"The people to add besides you. The chat may not exceed the community's group size.\",\n ),\n })\n .strict();\n\nexport const SendMessage = z\n .object({\n body: MessageBody,\n replyToId: idSchema\n .nullable()\n .default(null)\n .describe('A message in the same chat this one answers'),\n assetIds: Attachments,\n })\n .strict();\n\nexport const EditMessage = z.object({ body: MessageBody }).strict();\nexport const MarkRead = z\n .object({ messageId: idSchema.describe('The newest message you have read in this chat') })\n .strict();\nexport const OrgUserBody = z.object({ orgUserId: idSchema }).strict();\nexport const ResolveMessageFlags = z\n .object({\n resolution: messageFlagResolutionSchema\n .extract(['dismissed'])\n .describe(\n '`dismissed` closes the open flags and leaves the message up. Deleting the message or locking the chat resolves its flags as `deleted` or `locked` instead.',\n ),\n })\n .strict();\n\nexport const ChatIdParam = z.object({ chatId: z.string() });\nexport const MessageIdParam = z.object({ messageId: z.string() });\nexport const CommunityParam = z.object({ communityId: z.string() });\nexport const BlockParam = z.object({ communityId: z.string(), orgUserId: z.string() });\n"],"mappings":";;;;AAYA,MAAa,OAAO;AACpB,MAAa,cAAc;AAC3B,MAAa,cAAc;AAC3B,MAAa,eAAe,UAAU,WAAW;AAEjD,MAAa,eAAe,EAAE,OAAO;CACnC,MAAM;CACN,gBAAgB,EAAE,MAAM,EAAE,OAAO,CAAC;CAClC,mBAAmB,EAAE,OAAO,CAAC,CAAC,SAAS;CACvC,cAAc,uBACX,SAAS,CAAC,CACV,SAAS,yDAAyD;CACrE,QAAQ,EAAE,OAAO,CAAC,CAAC,IAAI;CACvB,aAAa,sBAAsB,SAAS;AAC9C,CAAC;AACD,MAAa,YAAY,UAAU,YAAY;AAE/C,MAAa,oBAAoB,EAAE,OAAO;CACxC,SAAS;CACT,OAAO,EAAE,MAAM,WAAW;CAC1B,MAAM;CACN,gBAAgB,EAAE,MAAM,EAAE,OAAO,CAAC;AACpC,CAAC;AAED,MAAa,eAAe,EAAE,OAAO,EACnC,SAAS,EAAE,MAAM,iBAAiB,EACpC,CAAC;AAED,MAAM,cAAc,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAM;AACvD,MAAM,cAAc,EACjB,MAAM,QAAQ,CAAC,CACf,IAAI,EAAE,CAAC,CACP,QAAQ,CAAC,CAAC,CAAC,CACX,SAAS,sEAAsE;AAElF,MAAa,kBAAkB,EAC5B,OAAO;CACN,aAAa;CACb,WAAW,SAAS,SAAS,uBAAuB;CACpD,MAAM,YAAY,SAAS,CAAC,CAAC,SAC3B,sIACF;CACA,UAAU;AACZ,CAAC,CAAC,CACD,OAAO;AAEV,MAAa,iBAAiB,EAC3B,OAAO;CACN,aAAa;CACb,YAAY,EACT,MAAM,QAAQ,CAAC,CACf,IAAI,CAAC,CAAC,CACN,IAAI,EAAE,CAAC,CACP,SACC,oFACF;AACJ,CAAC,CAAC,CACD,OAAO;AAEV,MAAa,cAAc,EACxB,OAAO;CACN,MAAM;CACN,WAAW,SACR,SAAS,CAAC,CACV,QAAQ,IAAI,CAAC,CACb,SAAS,6CAA6C;CACzD,UAAU;AACZ,CAAC,CAAC,CACD,OAAO;AAEV,MAAa,cAAc,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC,CAAC,CAAC,OAAO;AAClE,MAAa,WAAW,EACrB,OAAO,EAAE,WAAW,SAAS,SAAS,+CAA+C,EAAE,CAAC,CAAC,CACzF,OAAO;AACV,MAAa,cAAc,EAAE,OAAO,EAAE,WAAW,SAAS,CAAC,CAAC,CAAC,OAAO;AACpE,MAAa,sBAAsB,EAChC,OAAO,EACN,YAAY,4BACT,QAAQ,CAAC,WAAW,CAAC,CAAC,CACtB,SACC,4JACF,EACJ,CAAC,CAAC,CACD,OAAO;AAEV,MAAa,cAAc,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;AAC1D,MAAa,iBAAiB,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC;AAChE,MAAa,iBAAiB,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC;AAClE,MAAa,aAAa,EAAE,OAAO;CAAE,aAAa,EAAE,OAAO;CAAG,WAAW,EAAE,OAAO;AAAE,CAAC"}