@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
@@ -1,12 +1,12 @@
1
1
  import { z } from "zod";
2
- import { activityAssetSchema, activitySchema, moduleSchema, saveActivityInputSchema } from "@headless-lms/core/schemas";
2
+ import { activityAssetSchema, activityViewSchema, idSchema, moduleSchema, saveActivityInputSchema } from "@headless-lms/core/schemas";
3
3
  //#region src/http/schemas/activities.ts
4
- const Activity = activitySchema;
4
+ const Activity = activityViewSchema;
5
5
  const ActivityAsset = activityAssetSchema;
6
6
  const Module = moduleSchema;
7
7
  /** Module/activity-write endpoints return the full, reordered module list. */
8
8
  const ModuleList = z.array(Module);
9
- /** A course's activities as bare rows, ordered by (moduleId, seq). */
9
+ /** A course's activities, each with the stable file URLs of the files it links, ordered by (moduleId, seq). */
10
10
  const ActivityList = z.array(Activity);
11
11
  /** A course's activity→asset link rows, ordered by (activityId, seq). */
12
12
  const ActivityAssetList = z.array(ActivityAsset);
@@ -22,7 +22,7 @@ const ActivityPathParam = z.object({
22
22
  });
23
23
  const CreateModule = z.object({ title: z.string().min(1) });
24
24
  const UpdateModule = z.object({ title: z.string().min(1) });
25
- const ReorderInput = z.object({ orderedIds: z.array(z.string()) });
25
+ const ReorderInput = z.object({ orderedIds: z.array(idSchema).max(500).describe("Every id in the collection, in the new order") });
26
26
  const SaveActivity = saveActivityInputSchema;
27
27
  //#endregion
28
28
  export { Activity, ActivityAsset, ActivityAssetList, ActivityList, ActivityPathParam, CourseIdPathParam, CreateModule, Module, ModuleList, ModulePathParam, ReorderInput, SaveActivity, UpdateModule };
@@ -1 +1 @@
1
- {"version":3,"file":"activities.js","names":[],"sources":["../../../src/http/schemas/activities.ts"],"sourcesContent":["// Course modules + activities resource schemas. A module holds an ordered list\n// of activities directly; each activity is a uniform, orderable unit placing an\n// opaque settings blob at a position (`seq`) with a set of linked assets.\nimport { z } from 'zod';\nimport {\n activityAssetSchema,\n activitySchema,\n moduleSchema,\n saveActivityInputSchema,\n} from '@headless-lms/core/schemas';\n\nexport const Activity = activitySchema;\nexport type Activity = z.infer<typeof Activity>;\n\nexport const ActivityAsset = activityAssetSchema;\nexport type ActivityAsset = z.infer<typeof ActivityAsset>;\n\nexport const Module = moduleSchema;\nexport type Module = z.infer<typeof Module>;\n\n/** Module/activity-write endpoints return the full, reordered module list. */\nexport const ModuleList = z.array(Module);\nexport type ModuleList = z.infer<typeof ModuleList>;\n\n/** A course's activities as bare rows, ordered by (moduleId, seq). */\nexport const ActivityList = z.array(Activity);\nexport type ActivityList = z.infer<typeof ActivityList>;\n\n/** A course's activity→asset link rows, ordered by (activityId, seq). */\nexport const ActivityAssetList = z.array(ActivityAsset);\nexport type ActivityAssetList = z.infer<typeof ActivityAssetList>;\n\nexport const CourseIdPathParam = z.object({ courseId: z.string() });\nexport type CourseIdPathParam = z.infer<typeof CourseIdPathParam>;\n\nexport const ModulePathParam = z.object({ courseId: z.string(), moduleId: z.string() });\nexport type ModulePathParam = z.infer<typeof ModulePathParam>;\n\nexport const ActivityPathParam = z.object({\n courseId: z.string(),\n moduleId: z.string(),\n activityId: z.string(),\n});\nexport type ActivityPathParam = z.infer<typeof ActivityPathParam>;\n\nexport const CreateModule = z.object({ title: z.string().min(1) });\nexport type CreateModule = z.infer<typeof CreateModule>;\n\nexport const UpdateModule = z.object({ title: z.string().min(1) });\nexport type UpdateModule = z.infer<typeof UpdateModule>;\n\nexport const ReorderInput = z.object({ orderedIds: z.array(z.string()) });\nexport type ReorderInput = z.infer<typeof ReorderInput>;\n\nexport const SaveActivity = saveActivityInputSchema;\nexport type SaveActivity = z.infer<typeof SaveActivity>;\n"],"mappings":";;;AAWA,MAAa,WAAW;AAGxB,MAAa,gBAAgB;AAG7B,MAAa,SAAS;;AAItB,MAAa,aAAa,EAAE,MAAM,MAAM;;AAIxC,MAAa,eAAe,EAAE,MAAM,QAAQ;;AAI5C,MAAa,oBAAoB,EAAE,MAAM,aAAa;AAGtD,MAAa,oBAAoB,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;AAGlE,MAAa,kBAAkB,EAAE,OAAO;CAAE,UAAU,EAAE,OAAO;CAAG,UAAU,EAAE,OAAO;AAAE,CAAC;AAGtF,MAAa,oBAAoB,EAAE,OAAO;CACxC,UAAU,EAAE,OAAO;CACnB,UAAU,EAAE,OAAO;CACnB,YAAY,EAAE,OAAO;AACvB,CAAC;AAGD,MAAa,eAAe,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;AAGjE,MAAa,eAAe,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;AAGjE,MAAa,eAAe,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;AAGxE,MAAa,eAAe"}
1
+ {"version":3,"file":"activities.js","names":[],"sources":["../../../src/http/schemas/activities.ts"],"sourcesContent":["// Course modules + activities resource schemas. A module holds an ordered list\n// of activities directly; each activity is a uniform, orderable unit placing an\n// opaque settings blob at a position (`seq`) with a set of linked assets.\nimport { z } from 'zod';\nimport {\n activityAssetSchema,\n activityViewSchema,\n moduleSchema,\n saveActivityInputSchema,\n idSchema,\n} from '@headless-lms/core/schemas';\n\nexport const Activity = activityViewSchema;\nexport type Activity = z.infer<typeof Activity>;\n\nexport const ActivityAsset = activityAssetSchema;\nexport type ActivityAsset = z.infer<typeof ActivityAsset>;\n\nexport const Module = moduleSchema;\nexport type Module = z.infer<typeof Module>;\n\n/** Module/activity-write endpoints return the full, reordered module list. */\nexport const ModuleList = z.array(Module);\nexport type ModuleList = z.infer<typeof ModuleList>;\n\n/** A course's activities, each with the stable file URLs of the files it links, ordered by (moduleId, seq). */\nexport const ActivityList = z.array(Activity);\nexport type ActivityList = z.infer<typeof ActivityList>;\n\n/** A course's activity→asset link rows, ordered by (activityId, seq). */\nexport const ActivityAssetList = z.array(ActivityAsset);\nexport type ActivityAssetList = z.infer<typeof ActivityAssetList>;\n\nexport const CourseIdPathParam = z.object({ courseId: z.string() });\nexport type CourseIdPathParam = z.infer<typeof CourseIdPathParam>;\n\nexport const ModulePathParam = z.object({ courseId: z.string(), moduleId: z.string() });\nexport type ModulePathParam = z.infer<typeof ModulePathParam>;\n\nexport const ActivityPathParam = z.object({\n courseId: z.string(),\n moduleId: z.string(),\n activityId: z.string(),\n});\nexport type ActivityPathParam = z.infer<typeof ActivityPathParam>;\n\nexport const CreateModule = z.object({ title: z.string().min(1) });\nexport type CreateModule = z.infer<typeof CreateModule>;\n\nexport const UpdateModule = z.object({ title: z.string().min(1) });\nexport type UpdateModule = z.infer<typeof UpdateModule>;\n\nexport const ReorderInput = z.object({\n orderedIds: z.array(idSchema).max(500).describe('Every id in the collection, in the new order'),\n});\nexport type ReorderInput = z.infer<typeof ReorderInput>;\n\nexport const SaveActivity = saveActivityInputSchema;\nexport type SaveActivity = z.infer<typeof SaveActivity>;\n"],"mappings":";;;AAYA,MAAa,WAAW;AAGxB,MAAa,gBAAgB;AAG7B,MAAa,SAAS;;AAItB,MAAa,aAAa,EAAE,MAAM,MAAM;;AAIxC,MAAa,eAAe,EAAE,MAAM,QAAQ;;AAI5C,MAAa,oBAAoB,EAAE,MAAM,aAAa;AAGtD,MAAa,oBAAoB,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;AAGlE,MAAa,kBAAkB,EAAE,OAAO;CAAE,UAAU,EAAE,OAAO;CAAG,UAAU,EAAE,OAAO;AAAE,CAAC;AAGtF,MAAa,oBAAoB,EAAE,OAAO;CACxC,UAAU,EAAE,OAAO;CACnB,UAAU,EAAE,OAAO;CACnB,YAAY,EAAE,OAAO;AACvB,CAAC;AAGD,MAAa,eAAe,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;AAGjE,MAAa,eAAe,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;AAGjE,MAAa,eAAe,EAAE,OAAO,EACnC,YAAY,EAAE,MAAM,QAAQ,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,SAAS,8CAA8C,EAChG,CAAC;AAGD,MAAa,eAAe"}
@@ -1,36 +1,48 @@
1
1
  import { z } from "zod";
2
2
  //#region src/http/schemas/assets.d.ts
3
3
  declare const AssetKind: z.ZodEnum<{
4
+ image: "image";
4
5
  video: "video";
5
- download: "download";
6
- content: "content";
6
+ audio: "audio";
7
+ document: "document";
7
8
  }>;
8
9
  type AssetKind = z.infer<typeof AssetKind>;
10
+ declare const AssetSource: z.ZodEnum<{
11
+ library: "library";
12
+ member: "member";
13
+ }>;
14
+ type AssetSource = z.infer<typeof AssetSource>;
9
15
  declare const AssetStatus: z.ZodEnum<{
10
16
  pending: "pending";
11
17
  ready: "ready";
12
18
  }>;
13
19
  type AssetStatus = z.infer<typeof AssetStatus>;
14
20
  declare const Asset: z.ZodObject<{
15
- orgId: z.ZodString;
16
21
  id: z.ZodString;
17
- key: z.ZodString;
18
- kind: z.ZodEnum<{
19
- video: "video";
20
- download: "download";
21
- content: "content";
22
- }>;
23
- filename: z.ZodString;
24
- contentType: z.ZodString;
25
- size: z.ZodNumber;
22
+ createdAt: z.ZodCoercedDate<unknown>;
26
23
  status: z.ZodEnum<{
27
24
  pending: "pending";
28
25
  ready: "ready";
29
26
  }>;
30
- uploadedBy: z.ZodString;
31
- createdAt: z.ZodCoercedDate<unknown>;
27
+ orgId: z.ZodString;
32
28
  updatedAt: z.ZodCoercedDate<unknown>;
33
- }, z.core.$strict>;
29
+ uploadedBy: z.ZodString;
30
+ filename: z.ZodString;
31
+ contentType: z.ZodString;
32
+ size: z.ZodNumber;
33
+ kind: z.ZodEnum<{
34
+ image: "image";
35
+ video: "video";
36
+ audio: "audio";
37
+ document: "document";
38
+ }>;
39
+ source: z.ZodEnum<{
40
+ library: "library";
41
+ member: "member";
42
+ }>;
43
+ url: z.ZodNullable<z.ZodString>;
44
+ downloadUrl: z.ZodNullable<z.ZodString>;
45
+ }, z.core.$strip>;
34
46
  type Asset = z.infer<typeof Asset>;
35
47
  declare const AssetsQuery: z.ZodObject<{
36
48
  page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
@@ -38,33 +50,44 @@ declare const AssetsQuery: z.ZodObject<{
38
50
  search: z.ZodOptional<z.ZodString>;
39
51
  sort: z.ZodOptional<z.ZodString>;
40
52
  kind: z.ZodOptional<z.ZodEnum<{
53
+ image: "image";
41
54
  video: "video";
42
- download: "download";
43
- content: "content";
55
+ audio: "audio";
56
+ document: "document";
57
+ }>>;
58
+ source: z.ZodOptional<z.ZodEnum<{
59
+ library: "library";
60
+ member: "member";
44
61
  }>>;
45
62
  }, z.core.$strip>;
46
63
  type AssetsQuery = z.infer<typeof AssetsQuery>;
47
64
  declare const AssetsPage: z.ZodObject<{
48
65
  rows: z.ZodArray<z.ZodObject<{
49
- orgId: z.ZodString;
50
66
  id: z.ZodString;
51
- key: z.ZodString;
52
- kind: z.ZodEnum<{
53
- video: "video";
54
- download: "download";
55
- content: "content";
56
- }>;
57
- filename: z.ZodString;
58
- contentType: z.ZodString;
59
- size: z.ZodNumber;
67
+ createdAt: z.ZodCoercedDate<unknown>;
60
68
  status: z.ZodEnum<{
61
69
  pending: "pending";
62
70
  ready: "ready";
63
71
  }>;
64
- uploadedBy: z.ZodString;
65
- createdAt: z.ZodCoercedDate<unknown>;
72
+ orgId: z.ZodString;
66
73
  updatedAt: z.ZodCoercedDate<unknown>;
67
- }, z.core.$strict>>;
74
+ uploadedBy: z.ZodString;
75
+ filename: z.ZodString;
76
+ contentType: z.ZodString;
77
+ size: z.ZodNumber;
78
+ kind: z.ZodEnum<{
79
+ image: "image";
80
+ video: "video";
81
+ audio: "audio";
82
+ document: "document";
83
+ }>;
84
+ source: z.ZodEnum<{
85
+ library: "library";
86
+ member: "member";
87
+ }>;
88
+ url: z.ZodNullable<z.ZodString>;
89
+ downloadUrl: z.ZodNullable<z.ZodString>;
90
+ }, z.core.$strip>>;
68
91
  total: z.ZodNumber;
69
92
  page: z.ZodNumber;
70
93
  pageSize: z.ZodNumber;
@@ -74,73 +97,49 @@ declare const AssetIdParam: z.ZodObject<{
74
97
  id: z.ZodString;
75
98
  }, z.core.$strip>;
76
99
  type AssetIdParam = z.infer<typeof AssetIdParam>;
77
- /** Register an asset and get a presigned upload URL. */
78
100
  declare const RequestUpload: z.ZodObject<{
79
101
  filename: z.ZodString;
80
102
  contentType: z.ZodString;
81
- kind: z.ZodEnum<{
82
- video: "video";
83
- download: "download";
84
- content: "content";
85
- }>;
86
103
  }, z.core.$strip>;
87
104
  type RequestUpload = z.infer<typeof RequestUpload>;
105
+ declare const RequestMemberUpload: z.ZodObject<{
106
+ filename: z.ZodString;
107
+ contentType: z.ZodString;
108
+ }, z.core.$strip>;
109
+ type RequestMemberUpload = z.infer<typeof RequestMemberUpload>;
88
110
  declare const UploadTicket: z.ZodObject<{
89
- asset: z.ZodObject<{
90
- orgId: z.ZodString;
91
- id: z.ZodString;
92
- key: z.ZodString;
93
- kind: z.ZodEnum<{
94
- video: "video";
95
- download: "download";
96
- content: "content";
97
- }>;
98
- filename: z.ZodString;
99
- contentType: z.ZodString;
100
- size: z.ZodNumber;
101
- status: z.ZodEnum<{
102
- pending: "pending";
103
- ready: "ready";
104
- }>;
105
- uploadedBy: z.ZodString;
106
- createdAt: z.ZodCoercedDate<unknown>;
107
- updatedAt: z.ZodCoercedDate<unknown>;
108
- }, z.core.$strict>;
109
111
  uploadUrl: z.ZodString;
110
112
  method: z.ZodLiteral<"PUT">;
111
113
  expiresInSeconds: z.ZodNumber;
112
114
  headers: z.ZodRecord<z.ZodString, z.ZodString>;
113
- }, z.core.$strict>;
114
- type UploadTicket = z.infer<typeof UploadTicket>;
115
- /** Optional override of the download filename (Content-Disposition). */
116
- declare const RequestDownload: z.ZodObject<{
117
- filename: z.ZodOptional<z.ZodString>;
118
- }, z.core.$strip>;
119
- type RequestDownload = z.infer<typeof RequestDownload>;
120
- declare const DownloadTicket: z.ZodObject<{
121
- url: z.ZodString;
122
115
  asset: z.ZodObject<{
123
- orgId: z.ZodString;
124
116
  id: z.ZodString;
125
- key: z.ZodString;
126
- kind: z.ZodEnum<{
127
- video: "video";
128
- download: "download";
129
- content: "content";
130
- }>;
131
- filename: z.ZodString;
132
- contentType: z.ZodString;
133
- size: z.ZodNumber;
117
+ createdAt: z.ZodCoercedDate<unknown>;
134
118
  status: z.ZodEnum<{
135
119
  pending: "pending";
136
120
  ready: "ready";
137
121
  }>;
138
- uploadedBy: z.ZodString;
139
- createdAt: z.ZodCoercedDate<unknown>;
122
+ orgId: z.ZodString;
140
123
  updatedAt: z.ZodCoercedDate<unknown>;
141
- }, z.core.$strict>;
124
+ uploadedBy: z.ZodString;
125
+ filename: z.ZodString;
126
+ contentType: z.ZodString;
127
+ size: z.ZodNumber;
128
+ kind: z.ZodEnum<{
129
+ image: "image";
130
+ video: "video";
131
+ audio: "audio";
132
+ document: "document";
133
+ }>;
134
+ source: z.ZodEnum<{
135
+ library: "library";
136
+ member: "member";
137
+ }>;
138
+ url: z.ZodNullable<z.ZodString>;
139
+ downloadUrl: z.ZodNullable<z.ZodString>;
140
+ }, z.core.$strip>;
142
141
  }, z.core.$strict>;
143
- type DownloadTicket = z.infer<typeof DownloadTicket>;
142
+ type UploadTicket = z.infer<typeof UploadTicket>;
144
143
  //#endregion
145
- export { Asset, AssetIdParam, AssetKind, AssetStatus, AssetsPage, AssetsQuery, DownloadTicket, RequestDownload, RequestUpload, UploadTicket };
144
+ export { Asset, AssetIdParam, AssetKind, AssetSource, AssetStatus, AssetsPage, AssetsQuery, RequestMemberUpload, RequestUpload, UploadTicket };
146
145
  //# sourceMappingURL=assets.d.ts.map
@@ -1,24 +1,34 @@
1
1
  import { ListQuery, paginated } from "./shared.js";
2
+ import { MEMBER_IMAGE_TYPE } from "@headless-lms/core/assets";
2
3
  import { z } from "zod";
3
- import { assetKindSchema, assetSchema, assetStatusSchema, downloadTicketSchema, uploadTicketSchema } from "@headless-lms/core/schemas";
4
+ import { assetKindSchema, assetSourceSchema, assetStatusSchema, assetViewSchema, uploadTicketSchema } from "@headless-lms/core/schemas";
4
5
  //#region src/http/schemas/assets.ts
5
- const AssetKind = assetKindSchema;
6
+ const AssetKind = assetKindSchema.describe("The media class, derived by the server from the content type.");
7
+ const AssetSource = assetSourceSchema.describe("Where the file came from: `library` is the org's media uploaded by staff, `member` is a person's own upload.");
6
8
  const AssetStatus = assetStatusSchema;
7
- const Asset = assetSchema;
8
- const AssetsQuery = ListQuery.extend({ kind: AssetKind.optional() });
9
+ const Asset = assetViewSchema.omit({ key: true }).extend({
10
+ kind: AssetKind,
11
+ source: AssetSource,
12
+ url: z.string().nullable().describe("A short-lived signed URL that shows a ready library file. `null` while pending and for a member upload, which is served with what it is attached to."),
13
+ downloadUrl: z.string().nullable().describe("The same file as a download saved under its filename. `null` when `url` is.")
14
+ }).strip();
15
+ const AssetsQuery = ListQuery.extend({
16
+ kind: AssetKind.optional(),
17
+ source: AssetSource.optional().describe("Defaults to `library`.")
18
+ });
9
19
  const AssetsPage = paginated(Asset);
10
20
  const AssetIdParam = z.object({ id: z.string() });
11
- /** Register an asset and get a presigned upload URL. */
21
+ const Filename = z.string().trim().min(1).max(255);
12
22
  const RequestUpload = z.object({
13
- filename: z.string().min(1),
14
- contentType: z.string().min(1),
15
- kind: AssetKind
23
+ filename: Filename,
24
+ contentType: z.string().min(1).max(255).describe("The media class is derived from this.")
25
+ });
26
+ const RequestMemberUpload = z.object({
27
+ filename: Filename,
28
+ contentType: z.string().regex(MEMBER_IMAGE_TYPE, "A member upload must be a PNG, JPEG, GIF, WebP or AVIF image").describe("One of `image/png`, `image/jpeg`, `image/gif`, `image/webp` or `image/avif`. The stored type and size are checked when the upload is finalized.")
16
29
  });
17
- const UploadTicket = uploadTicketSchema;
18
- /** Optional override of the download filename (Content-Disposition). */
19
- const RequestDownload = z.object({ filename: z.string().optional() });
20
- const DownloadTicket = downloadTicketSchema;
30
+ const UploadTicket = uploadTicketSchema.extend({ asset: Asset });
21
31
  //#endregion
22
- export { Asset, AssetIdParam, AssetKind, AssetStatus, AssetsPage, AssetsQuery, DownloadTicket, RequestDownload, RequestUpload, UploadTicket };
32
+ export { Asset, AssetIdParam, AssetKind, AssetSource, AssetStatus, AssetsPage, AssetsQuery, RequestMemberUpload, RequestUpload, UploadTicket };
23
33
 
24
34
  //# sourceMappingURL=assets.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"assets.js","names":[],"sources":["../../../src/http/schemas/assets.ts"],"sourcesContent":["// Assets (media library) resource schemas. An Asset is a tracked object in\n// private storage; files are uploaded via a presigned PUT and served via a\n// presigned GET. Domain objects (e.g. a lesson) reference an asset by id.\n// The Asset payload shape is owned by @headless-lms/core/schemas; route-local\n// schemas define endpoint-only concerns such as params and pagination.\nimport { z } from 'zod';\nimport {\n assetKindSchema,\n assetSchema,\n assetStatusSchema,\n downloadTicketSchema,\n uploadTicketSchema,\n} from '@headless-lms/core/schemas';\nimport { ListQuery, paginated } from './shared.js';\n\nexport const AssetKind = assetKindSchema;\nexport type AssetKind = z.infer<typeof AssetKind>;\n\nexport const AssetStatus = assetStatusSchema;\nexport type AssetStatus = z.infer<typeof AssetStatus>;\n\nexport const Asset = assetSchema;\nexport type Asset = z.infer<typeof Asset>;\n\nexport const AssetsQuery = ListQuery.extend({ kind: AssetKind.optional() });\nexport type AssetsQuery = z.infer<typeof AssetsQuery>;\n\nexport const AssetsPage = paginated(Asset);\nexport type AssetsPage = z.infer<typeof AssetsPage>;\n\nexport const AssetIdParam = z.object({ id: z.string() });\nexport type AssetIdParam = z.infer<typeof AssetIdParam>;\n\n/** Register an asset and get a presigned upload URL. */\nexport const RequestUpload = z.object({\n filename: z.string().min(1),\n contentType: z.string().min(1),\n kind: AssetKind,\n});\nexport type RequestUpload = z.infer<typeof RequestUpload>;\n\nexport const UploadTicket = uploadTicketSchema;\nexport type UploadTicket = z.infer<typeof UploadTicket>;\n\n/** Optional override of the download filename (Content-Disposition). */\nexport const RequestDownload = z.object({ filename: z.string().optional() });\nexport type RequestDownload = z.infer<typeof RequestDownload>;\n\nexport const DownloadTicket = downloadTicketSchema;\nexport type DownloadTicket = z.infer<typeof DownloadTicket>;\n"],"mappings":";;;;AAeA,MAAa,YAAY;AAGzB,MAAa,cAAc;AAG3B,MAAa,QAAQ;AAGrB,MAAa,cAAc,UAAU,OAAO,EAAE,MAAM,UAAU,SAAS,EAAE,CAAC;AAG1E,MAAa,aAAa,UAAU,KAAK;AAGzC,MAAa,eAAe,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;AAIvD,MAAa,gBAAgB,EAAE,OAAO;CACpC,UAAU,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CAC1B,aAAa,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CAC7B,MAAM;AACR,CAAC;AAGD,MAAa,eAAe;;AAI5B,MAAa,kBAAkB,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS,EAAE,CAAC;AAG3E,MAAa,iBAAiB"}
1
+ {"version":3,"file":"assets.js","names":[],"sources":["../../../src/http/schemas/assets.ts"],"sourcesContent":["import { z } from 'zod';\nimport {\n assetKindSchema,\n assetSourceSchema,\n assetStatusSchema,\n assetViewSchema,\n uploadTicketSchema,\n} from '@headless-lms/core/schemas';\nimport { MEMBER_IMAGE_TYPE } from '@headless-lms/core/assets';\nimport { ListQuery, paginated } from './shared.js';\n\nexport const AssetKind = assetKindSchema.describe(\n 'The media class, derived by the server from the content type.',\n);\nexport type AssetKind = z.infer<typeof AssetKind>;\n\nexport const AssetSource = assetSourceSchema.describe(\n \"Where the file came from: `library` is the org's media uploaded by staff, `member` is a person's own upload.\",\n);\nexport type AssetSource = z.infer<typeof AssetSource>;\n\nexport const AssetStatus = assetStatusSchema;\nexport type AssetStatus = z.infer<typeof AssetStatus>;\n\nexport const Asset = assetViewSchema\n .omit({ key: true })\n .extend({\n kind: AssetKind,\n source: AssetSource,\n url: z\n .string()\n .nullable()\n .describe(\n 'A short-lived signed URL that shows a ready library file. `null` while pending and for a member upload, which is served with what it is attached to.',\n ),\n downloadUrl: z\n .string()\n .nullable()\n .describe('The same file as a download saved under its filename. `null` when `url` is.'),\n })\n .strip();\nexport type Asset = z.infer<typeof Asset>;\n\nexport const AssetsQuery = ListQuery.extend({\n kind: AssetKind.optional(),\n source: AssetSource.optional().describe('Defaults to `library`.'),\n});\nexport type AssetsQuery = z.infer<typeof AssetsQuery>;\n\nexport const AssetsPage = paginated(Asset);\nexport type AssetsPage = z.infer<typeof AssetsPage>;\n\nexport const AssetIdParam = z.object({ id: z.string() });\nexport type AssetIdParam = z.infer<typeof AssetIdParam>;\n\nconst Filename = z.string().trim().min(1).max(255);\n\nexport const RequestUpload = z.object({\n filename: Filename,\n contentType: z.string().min(1).max(255).describe('The media class is derived from this.'),\n});\nexport type RequestUpload = z.infer<typeof RequestUpload>;\n\nexport const RequestMemberUpload = z.object({\n filename: Filename,\n contentType: z\n .string()\n .regex(MEMBER_IMAGE_TYPE, 'A member upload must be a PNG, JPEG, GIF, WebP or AVIF image')\n .describe(\n 'One of `image/png`, `image/jpeg`, `image/gif`, `image/webp` or `image/avif`. The stored type and size are checked when the upload is finalized.',\n ),\n});\nexport type RequestMemberUpload = z.infer<typeof RequestMemberUpload>;\n\nexport const UploadTicket = uploadTicketSchema.extend({ asset: Asset });\nexport type UploadTicket = z.infer<typeof UploadTicket>;\n"],"mappings":";;;;;AAWA,MAAa,YAAY,gBAAgB,SACvC,+DACF;AAGA,MAAa,cAAc,kBAAkB,SAC3C,8GACF;AAGA,MAAa,cAAc;AAG3B,MAAa,QAAQ,gBAClB,KAAK,EAAE,KAAK,KAAK,CAAC,CAAC,CACnB,OAAO;CACN,MAAM;CACN,QAAQ;CACR,KAAK,EACF,OAAO,CAAC,CACR,SAAS,CAAC,CACV,SACC,sJACF;CACF,aAAa,EACV,OAAO,CAAC,CACR,SAAS,CAAC,CACV,SAAS,6EAA6E;AAC3F,CAAC,CAAC,CACD,MAAM;AAGT,MAAa,cAAc,UAAU,OAAO;CAC1C,MAAM,UAAU,SAAS;CACzB,QAAQ,YAAY,SAAS,CAAC,CAAC,SAAS,wBAAwB;AAClE,CAAC;AAGD,MAAa,aAAa,UAAU,KAAK;AAGzC,MAAa,eAAe,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAGvD,MAAM,WAAW,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG;AAEjD,MAAa,gBAAgB,EAAE,OAAO;CACpC,UAAU;CACV,aAAa,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,SAAS,uCAAuC;AAC1F,CAAC;AAGD,MAAa,sBAAsB,EAAE,OAAO;CAC1C,UAAU;CACV,aAAa,EACV,OAAO,CAAC,CACR,MAAM,mBAAmB,8DAA8D,CAAC,CACxF,SACC,iJACF;AACJ,CAAC;AAGD,MAAa,eAAe,mBAAmB,OAAO,EAAE,OAAO,MAAM,CAAC"}
@@ -29,6 +29,7 @@ declare const Automation: z.ZodObject<{
29
29
  input: z.ZodRecord<z.ZodString, z.ZodType<import("@headless-lms/core/types").JsonValue, unknown, z.core.$ZodTypeInternals<import("@headless-lms/core/types").JsonValue, unknown>>>;
30
30
  }, z.core.$strict>>;
31
31
  enabled: z.ZodBoolean;
32
+ filter: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodType<import("@headless-lms/core/types").JsonValue, unknown, z.core.$ZodTypeInternals<import("@headless-lms/core/types").JsonValue, unknown>>>>;
32
33
  createdAt: z.ZodCoercedDate<unknown>;
33
34
  updatedAt: z.ZodCoercedDate<unknown>;
34
35
  }, z.core.$strict>;
@@ -48,6 +49,7 @@ declare const CreateAutomationBody: z.ZodObject<{
48
49
  type: z.ZodString;
49
50
  input: z.ZodRecord<z.ZodString, z.ZodType<import("@headless-lms/core/types").JsonValue, unknown, z.core.$ZodTypeInternals<import("@headless-lms/core/types").JsonValue, unknown>>>;
50
51
  }, z.core.$strict>>;
52
+ filter: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodType<import("@headless-lms/core/types").JsonValue, unknown, z.core.$ZodTypeInternals<import("@headless-lms/core/types").JsonValue, unknown>>>>>;
51
53
  }, z.core.$strict>;
52
54
  type CreateAutomationBody = z.infer<typeof CreateAutomationBody>;
53
55
  declare const UpdateAutomationBody: z.ZodObject<{
@@ -58,6 +60,7 @@ declare const UpdateAutomationBody: z.ZodObject<{
58
60
  type: z.ZodString;
59
61
  input: z.ZodRecord<z.ZodString, z.ZodType<import("@headless-lms/core/types").JsonValue, unknown, z.core.$ZodTypeInternals<import("@headless-lms/core/types").JsonValue, unknown>>>;
60
62
  }, z.core.$strict>>>;
63
+ filter: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodType<import("@headless-lms/core/types").JsonValue, unknown, z.core.$ZodTypeInternals<import("@headless-lms/core/types").JsonValue, unknown>>>>>>;
61
64
  enabled: z.ZodOptional<z.ZodBoolean>;
62
65
  }, z.core.$strict>;
63
66
  type UpdateAutomationBody = z.infer<typeof UpdateAutomationBody>;
@@ -103,6 +106,7 @@ declare const AutomationActionResult: z.ZodObject<{
103
106
  failed: "failed";
104
107
  }>;
105
108
  error: z.ZodOptional<z.ZodString>;
109
+ recipients: z.ZodOptional<z.ZodArray<z.ZodString>>;
106
110
  }, z.core.$strict>;
107
111
  type AutomationActionResult = z.infer<typeof AutomationActionResult>;
108
112
  declare const AutomationRun: z.ZodObject<{
@@ -125,6 +129,7 @@ declare const AutomationRun: z.ZodObject<{
125
129
  failed: "failed";
126
130
  }>;
127
131
  error: z.ZodOptional<z.ZodString>;
132
+ recipients: z.ZodOptional<z.ZodArray<z.ZodString>>;
128
133
  }, z.core.$strict>>;
129
134
  startedAt: z.ZodCoercedDate<unknown>;
130
135
  finishedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
@@ -165,6 +170,7 @@ declare const AutomationRunsPage: z.ZodObject<{
165
170
  failed: "failed";
166
171
  }>;
167
172
  error: z.ZodOptional<z.ZodString>;
173
+ recipients: z.ZodOptional<z.ZodArray<z.ZodString>>;
168
174
  }, z.core.$strict>>;
169
175
  startedAt: z.ZodCoercedDate<unknown>;
170
176
  finishedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
@@ -1,21 +1,21 @@
1
1
  import { ListQuery, paginated } from "./shared.js";
2
2
  import { z } from "zod";
3
- import { bundleItemSchema, bundleSchema } from "@headless-lms/core/schemas";
3
+ import { bundleItemSchema, bundleSchema, idSchema } from "@headless-lms/core/schemas";
4
4
  //#region src/http/schemas/bundles.ts
5
5
  const Bundle = bundleSchema;
6
6
  const BundleItem = bundleItemSchema;
7
7
  const CreateBundle = z.object({
8
- name: z.string().min(1),
9
- contentIds: z.array(z.string()).optional()
8
+ name: z.string().trim().min(1).max(200),
9
+ contentIds: z.array(idSchema).max(500).optional()
10
10
  });
11
- const UpdateBundle = z.object({ name: z.string().min(1).optional() });
11
+ const UpdateBundle = z.object({ name: z.string().trim().min(1).max(200).optional() });
12
12
  const BundlesQuery = ListQuery;
13
13
  const BundlesPage = paginated(Bundle);
14
- const AddBundleItem = z.object({ contentId: z.string() });
14
+ const AddBundleItem = z.object({ contentId: idSchema });
15
15
  const BundleIdParam = z.object({ bundleId: z.string() });
16
16
  const BundleItemParams = z.object({
17
17
  bundleId: z.string(),
18
- contentId: z.string()
18
+ contentId: idSchema
19
19
  });
20
20
  //#endregion
21
21
  export { AddBundleItem, Bundle, BundleIdParam, BundleItem, BundleItemParams, BundlesPage, BundlesQuery, CreateBundle, UpdateBundle };
@@ -1 +1 @@
1
- {"version":3,"file":"bundles.js","names":[],"sources":["../../../src/http/schemas/bundles.ts"],"sourcesContent":["// Bundles resource schemas — a named grouping of content items. The Fastify\n// routes validate requests/responses against these, the OpenAPI spec is built\n// from them, and the frontend SDK is generated off that spec.\nimport { z } from 'zod';\nimport { bundleItemSchema, bundleSchema } from '@headless-lms/core/schemas';\nimport { ListQuery, paginated } from './shared.js';\n\nexport const Bundle = bundleSchema;\nexport type Bundle = z.infer<typeof Bundle>;\n\nexport const BundleItem = bundleItemSchema;\nexport type BundleItem = z.infer<typeof BundleItem>;\n\nexport const CreateBundle = z.object({\n name: z.string().min(1),\n contentIds: z.array(z.string()).optional(),\n});\nexport type CreateBundle = z.infer<typeof CreateBundle>;\n\nexport const UpdateBundle = z.object({\n name: z.string().min(1).optional(),\n});\nexport type UpdateBundle = z.infer<typeof UpdateBundle>;\n\nexport const BundlesQuery = ListQuery;\nexport type BundlesQuery = z.infer<typeof BundlesQuery>;\n\nexport const BundlesPage = paginated(Bundle);\nexport type BundlesPage = z.infer<typeof BundlesPage>;\n\nexport const AddBundleItem = z.object({\n contentId: z.string(),\n});\nexport type AddBundleItem = z.infer<typeof AddBundleItem>;\n\nexport const BundleIdParam = z.object({ bundleId: z.string() });\nexport type BundleIdParam = z.infer<typeof BundleIdParam>;\n\nexport const BundleItemParams = z.object({\n bundleId: z.string(),\n contentId: z.string(),\n});\nexport type BundleItemParams = z.infer<typeof BundleItemParams>;\n"],"mappings":";;;;AAOA,MAAa,SAAS;AAGtB,MAAa,aAAa;AAG1B,MAAa,eAAe,EAAE,OAAO;CACnC,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CACtB,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS;AAC3C,CAAC;AAGD,MAAa,eAAe,EAAE,OAAO,EACnC,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,EACnC,CAAC;AAGD,MAAa,eAAe;AAG5B,MAAa,cAAc,UAAU,MAAM;AAG3C,MAAa,gBAAgB,EAAE,OAAO,EACpC,WAAW,EAAE,OAAO,EACtB,CAAC;AAGD,MAAa,gBAAgB,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;AAG9D,MAAa,mBAAmB,EAAE,OAAO;CACvC,UAAU,EAAE,OAAO;CACnB,WAAW,EAAE,OAAO;AACtB,CAAC"}
1
+ {"version":3,"file":"bundles.js","names":[],"sources":["../../../src/http/schemas/bundles.ts"],"sourcesContent":["// Bundles resource schemas — a named grouping of content items. The Fastify\n// routes validate requests/responses against these, the OpenAPI spec is built\n// from them, and the frontend SDK is generated off that spec.\nimport { z } from 'zod';\nimport { bundleItemSchema, bundleSchema, idSchema } from '@headless-lms/core/schemas';\nimport { ListQuery, paginated } from './shared.js';\n\nexport const Bundle = bundleSchema;\nexport type Bundle = z.infer<typeof Bundle>;\n\nexport const BundleItem = bundleItemSchema;\nexport type BundleItem = z.infer<typeof BundleItem>;\n\nexport const CreateBundle = z.object({\n name: z.string().trim().min(1).max(200),\n contentIds: z.array(idSchema).max(500).optional(),\n});\nexport type CreateBundle = z.infer<typeof CreateBundle>;\n\nexport const UpdateBundle = z.object({\n name: z.string().trim().min(1).max(200).optional(),\n});\nexport type UpdateBundle = z.infer<typeof UpdateBundle>;\n\nexport const BundlesQuery = ListQuery;\nexport type BundlesQuery = z.infer<typeof BundlesQuery>;\n\nexport const BundlesPage = paginated(Bundle);\nexport type BundlesPage = z.infer<typeof BundlesPage>;\n\nexport const AddBundleItem = z.object({\n contentId: idSchema,\n});\nexport type AddBundleItem = z.infer<typeof AddBundleItem>;\n\nexport const BundleIdParam = z.object({ bundleId: z.string() });\nexport type BundleIdParam = z.infer<typeof BundleIdParam>;\n\nexport const BundleItemParams = z.object({\n bundleId: z.string(),\n contentId: idSchema,\n});\nexport type BundleItemParams = z.infer<typeof BundleItemParams>;\n"],"mappings":";;;;AAOA,MAAa,SAAS;AAGtB,MAAa,aAAa;AAG1B,MAAa,eAAe,EAAE,OAAO;CACnC,MAAM,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG;CACtC,YAAY,EAAE,MAAM,QAAQ,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,SAAS;AAClD,CAAC;AAGD,MAAa,eAAe,EAAE,OAAO,EACnC,MAAM,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,SAAS,EACnD,CAAC;AAGD,MAAa,eAAe;AAG5B,MAAa,cAAc,UAAU,MAAM;AAG3C,MAAa,gBAAgB,EAAE,OAAO,EACpC,WAAW,SACb,CAAC;AAGD,MAAa,gBAAgB,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;AAG9D,MAAa,mBAAmB,EAAE,OAAO;CACvC,UAAU,EAAE,OAAO;CACnB,WAAW;AACb,CAAC"}