@headless-lms/server 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (351) hide show
  1. package/README.md +1 -1
  2. package/dist/_virtual/_rolldown/runtime.js +5 -0
  3. package/dist/app/community-mail.d.ts +26 -0
  4. package/dist/app/community-mail.js +96 -0
  5. package/dist/app/community-mail.js.map +1 -0
  6. package/dist/app/container.d.ts +22 -14
  7. package/dist/app/container.js +186 -62
  8. package/dist/app/container.js.map +1 -1
  9. package/dist/app/mcp-endpoints.d.ts +13 -0
  10. package/dist/app/mcp-endpoints.js +25 -0
  11. package/dist/app/mcp-endpoints.js.map +1 -0
  12. package/dist/http/config.d.ts +2 -1
  13. package/dist/http/errors.d.ts +14 -0
  14. package/dist/http/errors.js +147 -0
  15. package/dist/http/errors.js.map +1 -0
  16. package/dist/http/mcp/catalogue.d.ts +37 -0
  17. package/dist/http/mcp/catalogue.js +69 -0
  18. package/dist/http/mcp/catalogue.js.map +1 -0
  19. package/dist/http/mcp/challenge.d.ts +7 -0
  20. package/dist/http/mcp/challenge.js +35 -0
  21. package/dist/http/mcp/challenge.js.map +1 -0
  22. package/dist/http/mcp/input-schema.d.ts +7 -0
  23. package/dist/http/mcp/input-schema.js +28 -0
  24. package/dist/http/mcp/input-schema.js.map +1 -0
  25. package/dist/http/mcp/route.d.ts +8 -0
  26. package/dist/http/mcp/route.js +75 -0
  27. package/dist/http/mcp/route.js.map +1 -0
  28. package/dist/http/mcp/server.d.ts +8 -0
  29. package/dist/http/mcp/server.js +31 -0
  30. package/dist/http/mcp/server.js.map +1 -0
  31. package/dist/http/mcp/test-support.d.ts +55 -0
  32. package/dist/http/mcp/test-support.js +151 -0
  33. package/dist/http/mcp/test-support.js.map +1 -0
  34. package/dist/http/mcp/tool.d.ts +48 -0
  35. package/dist/http/mcp/tool.js +58 -0
  36. package/dist/http/mcp/tool.js.map +1 -0
  37. package/dist/http/mcp/tools/automations.d.ts +6 -0
  38. package/dist/http/mcp/tools/automations.js +120 -0
  39. package/dist/http/mcp/tools/automations.js.map +1 -0
  40. package/dist/http/mcp/tools/catalog.d.ts +6 -0
  41. package/dist/http/mcp/tools/catalog.js +200 -0
  42. package/dist/http/mcp/tools/catalog.js.map +1 -0
  43. package/dist/http/mcp/tools/comments.d.ts +6 -0
  44. package/dist/http/mcp/tools/comments.js +70 -0
  45. package/dist/http/mcp/tools/comments.js.map +1 -0
  46. package/dist/http/mcp/tools/communities.d.ts +6 -0
  47. package/dist/http/mcp/tools/communities.js +175 -0
  48. package/dist/http/mcp/tools/communities.js.map +1 -0
  49. package/dist/http/mcp/tools/community-members.d.ts +6 -0
  50. package/dist/http/mcp/tools/community-members.js +89 -0
  51. package/dist/http/mcp/tools/community-members.js.map +1 -0
  52. package/dist/http/mcp/tools/community-moderation.d.ts +6 -0
  53. package/dist/http/mcp/tools/community-moderation.js +144 -0
  54. package/dist/http/mcp/tools/community-moderation.js.map +1 -0
  55. package/dist/http/mcp/tools/courses.d.ts +6 -0
  56. package/dist/http/mcp/tools/courses.js +121 -0
  57. package/dist/http/mcp/tools/courses.js.map +1 -0
  58. package/dist/http/mcp/tools/index.d.ts +6 -0
  59. package/dist/http/mcp/tools/index.js +23 -0
  60. package/dist/http/mcp/tools/index.js.map +1 -0
  61. package/dist/http/mcp/tools/people.d.ts +6 -0
  62. package/dist/http/mcp/tools/people.js +145 -0
  63. package/dist/http/mcp/tools/people.js.map +1 -0
  64. package/dist/http/plugins/auth.js +13 -5
  65. package/dist/http/plugins/auth.js.map +1 -1
  66. package/dist/http/plugins/error-handler.d.ts +3 -2
  67. package/dist/http/plugins/error-handler.js +52 -57
  68. package/dist/http/plugins/error-handler.js.map +1 -1
  69. package/dist/http/plugins/openapi.js +70 -20
  70. package/dist/http/plugins/openapi.js.map +1 -1
  71. package/dist/http/routes/access.d.ts +7 -0
  72. package/dist/http/routes/access.js +140 -0
  73. package/dist/http/routes/access.js.map +1 -0
  74. package/dist/http/routes/activities.js +97 -20
  75. package/dist/http/routes/activities.js.map +1 -1
  76. package/dist/http/routes/assets.js +60 -51
  77. package/dist/http/routes/assets.js.map +1 -1
  78. package/dist/http/routes/automations.js +64 -20
  79. package/dist/http/routes/automations.js.map +1 -1
  80. package/dist/http/routes/bundles.d.ts +7 -0
  81. package/dist/http/routes/bundles.js +181 -0
  82. package/dist/http/routes/bundles.js.map +1 -0
  83. package/dist/http/routes/communities.d.ts +7 -0
  84. package/dist/http/routes/communities.js +462 -0
  85. package/dist/http/routes/communities.js.map +1 -0
  86. package/dist/http/routes/community-moderation.d.ts +7 -0
  87. package/dist/http/routes/community-moderation.js +425 -0
  88. package/dist/http/routes/community-moderation.js.map +1 -0
  89. package/dist/http/routes/course-analytics.d.ts +7 -0
  90. package/dist/http/routes/course-analytics.js +60 -0
  91. package/dist/http/routes/course-analytics.js.map +1 -0
  92. package/dist/http/routes/courses.js +38 -23
  93. package/dist/http/routes/courses.js.map +1 -1
  94. package/dist/http/routes/dashboard.js +17 -8
  95. package/dist/http/routes/dashboard.js.map +1 -1
  96. package/dist/http/routes/discussion.js +35 -27
  97. package/dist/http/routes/discussion.js.map +1 -1
  98. package/dist/http/routes/downloads.js +58 -40
  99. package/dist/http/routes/downloads.js.map +1 -1
  100. package/dist/http/routes/entitlements.js +16 -7
  101. package/dist/http/routes/entitlements.js.map +1 -1
  102. package/dist/http/routes/integrations.js +38 -41
  103. package/dist/http/routes/integrations.js.map +1 -1
  104. package/dist/http/routes/member/actor.d.ts +14 -0
  105. package/dist/http/routes/member/actor.js +11 -0
  106. package/dist/http/routes/member/actor.js.map +1 -0
  107. package/dist/http/routes/member/assets.d.ts +7 -0
  108. package/dist/http/routes/member/assets.js +79 -0
  109. package/dist/http/routes/member/assets.js.map +1 -0
  110. package/dist/http/routes/member/chats.d.ts +7 -0
  111. package/dist/http/routes/member/chats.js +456 -0
  112. package/dist/http/routes/member/chats.js.map +1 -0
  113. package/dist/http/routes/member/comments.d.ts +7 -0
  114. package/dist/http/routes/member/comments.js +187 -0
  115. package/dist/http/routes/member/comments.js.map +1 -0
  116. package/dist/http/routes/member/community.d.ts +7 -0
  117. package/dist/http/routes/member/community.js +288 -0
  118. package/dist/http/routes/member/community.js.map +1 -0
  119. package/dist/http/routes/member/courses.d.ts +7 -0
  120. package/dist/http/routes/member/courses.js +101 -0
  121. package/dist/http/routes/member/courses.js.map +1 -0
  122. package/dist/http/routes/member/downloads.d.ts +7 -0
  123. package/dist/http/routes/member/downloads.js +56 -0
  124. package/dist/http/routes/member/downloads.js.map +1 -0
  125. package/dist/http/routes/member/files.d.ts +7 -0
  126. package/dist/http/routes/member/files.js +184 -0
  127. package/dist/http/routes/member/files.js.map +1 -0
  128. package/dist/http/routes/member/index.d.ts +7 -0
  129. package/dist/http/routes/member/index.js +31 -0
  130. package/dist/http/routes/member/index.js.map +1 -0
  131. package/dist/http/routes/member/notifications.d.ts +7 -0
  132. package/dist/http/routes/member/notifications.js +101 -0
  133. package/dist/http/routes/member/notifications.js.map +1 -0
  134. package/dist/http/routes/member/org.d.ts +7 -0
  135. package/dist/http/routes/member/org.js +56 -0
  136. package/dist/http/routes/member/org.js.map +1 -0
  137. package/dist/http/routes/member/posts.d.ts +7 -0
  138. package/dist/http/routes/member/posts.js +612 -0
  139. package/dist/http/routes/member/posts.js.map +1 -0
  140. package/dist/http/routes/member/profile.d.ts +7 -0
  141. package/dist/http/routes/member/profile.js +48 -0
  142. package/dist/http/routes/member/profile.js.map +1 -0
  143. package/dist/http/routes/member/progress.d.ts +7 -0
  144. package/dist/http/routes/member/progress.js +60 -0
  145. package/dist/http/routes/member/progress.js.map +1 -0
  146. package/dist/http/routes/organizations.js +49 -24
  147. package/dist/http/routes/organizations.js.map +1 -1
  148. package/dist/http/routes/students.js +43 -37
  149. package/dist/http/routes/students.js.map +1 -1
  150. package/dist/http/routes/webhooks.d.ts +7 -0
  151. package/dist/http/routes/webhooks.js +167 -0
  152. package/dist/http/routes/webhooks.js.map +1 -0
  153. package/dist/http/routes.js +14 -2
  154. package/dist/http/routes.js.map +1 -1
  155. package/dist/http/schemas/access.d.ts +146 -0
  156. package/dist/http/schemas/access.js +36 -0
  157. package/dist/http/schemas/access.js.map +1 -0
  158. package/dist/http/schemas/activities.d.ts +36 -1
  159. package/dist/http/schemas/activities.js +9 -4
  160. package/dist/http/schemas/activities.js.map +1 -1
  161. package/dist/http/schemas/assets.d.ts +76 -73
  162. package/dist/http/schemas/assets.js +23 -13
  163. package/dist/http/schemas/assets.js.map +1 -1
  164. package/dist/http/schemas/automations.d.ts +85 -8
  165. package/dist/http/schemas/automations.js +13 -2
  166. package/dist/http/schemas/automations.js.map +1 -1
  167. package/dist/http/schemas/bundles.d.ts +63 -0
  168. package/dist/http/schemas/bundles.js +23 -0
  169. package/dist/http/schemas/bundles.js.map +1 -0
  170. package/dist/http/schemas/chats.d.ts +386 -0
  171. package/dist/http/schemas/chats.js +58 -0
  172. package/dist/http/schemas/chats.js.map +1 -0
  173. package/dist/http/schemas/community.d.ts +537 -0
  174. package/dist/http/schemas/community.js +129 -0
  175. package/dist/http/schemas/community.js.map +1 -0
  176. package/dist/http/schemas/content.d.ts +22 -13
  177. package/dist/http/schemas/content.js +11 -9
  178. package/dist/http/schemas/content.js.map +1 -1
  179. package/dist/http/schemas/course-analytics.d.ts +29 -0
  180. package/dist/http/schemas/course-analytics.js +21 -0
  181. package/dist/http/schemas/course-analytics.js.map +1 -0
  182. package/dist/http/schemas/dashboard.js.map +1 -1
  183. package/dist/http/schemas/discussion.d.ts +85 -23
  184. package/dist/http/schemas/discussion.js +12 -11
  185. package/dist/http/schemas/discussion.js.map +1 -1
  186. package/dist/http/schemas/downloads.d.ts +13 -5
  187. package/dist/http/schemas/downloads.js +14 -11
  188. package/dist/http/schemas/downloads.js.map +1 -1
  189. package/dist/http/schemas/entitlements.d.ts +14 -6
  190. package/dist/http/schemas/entitlements.js +8 -6
  191. package/dist/http/schemas/entitlements.js.map +1 -1
  192. package/dist/http/schemas/files.d.ts +45 -0
  193. package/dist/http/schemas/files.js +25 -0
  194. package/dist/http/schemas/files.js.map +1 -0
  195. package/dist/http/schemas/index.d.ts +19 -10
  196. package/dist/http/schemas/index.js +19 -10
  197. package/dist/http/schemas/integrations.d.ts +4 -4
  198. package/dist/http/schemas/integrations.js.map +1 -1
  199. package/dist/http/schemas/invites.d.ts +4 -0
  200. package/dist/http/schemas/invites.js +3 -1
  201. package/dist/http/schemas/invites.js.map +1 -1
  202. package/dist/http/schemas/{learn.d.ts → member.d.ts} +42 -19
  203. package/dist/http/schemas/{learn.js → member.js} +17 -13
  204. package/dist/http/schemas/member.js.map +1 -0
  205. package/dist/http/schemas/members.d.ts +39 -6
  206. package/dist/http/schemas/members.js +17 -3
  207. package/dist/http/schemas/members.js.map +1 -1
  208. package/dist/http/schemas/notifications.d.ts +227 -0
  209. package/dist/http/schemas/notifications.js +44 -0
  210. package/dist/http/schemas/notifications.js.map +1 -0
  211. package/dist/http/schemas/organizations.js.map +1 -1
  212. package/dist/http/schemas/posts.d.ts +316 -0
  213. package/dist/http/schemas/posts.js +47 -0
  214. package/dist/http/schemas/posts.js.map +1 -0
  215. package/dist/http/schemas/profile.d.ts +23 -0
  216. package/dist/http/schemas/profile.js +15 -0
  217. package/dist/http/schemas/profile.js.map +1 -0
  218. package/dist/http/schemas/settings.js.map +1 -1
  219. package/dist/http/schemas/shared.d.ts +26 -1
  220. package/dist/http/schemas/shared.js +22 -3
  221. package/dist/http/schemas/shared.js.map +1 -1
  222. package/dist/http/schemas/students.d.ts +32 -10
  223. package/dist/http/schemas/students.js +19 -6
  224. package/dist/http/schemas/students.js.map +1 -1
  225. package/dist/http/scope.d.ts +2 -1
  226. package/dist/http/scope.js +20 -4
  227. package/dist/http/scope.js.map +1 -1
  228. package/dist/http/server.js +10 -3
  229. package/dist/http/server.js.map +1 -1
  230. package/dist/http/web-bridge.d.ts +1 -1
  231. package/dist/http/web-bridge.js +2 -2
  232. package/dist/http/web-bridge.js.map +1 -1
  233. package/dist/http/well-known.d.ts +7 -0
  234. package/dist/http/well-known.js +22 -0
  235. package/dist/http/well-known.js.map +1 -0
  236. package/dist/index.d.ts +3 -2
  237. package/dist/index.js +4 -2
  238. package/dist/index.js.map +1 -1
  239. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.js +78 -0
  240. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.js.map +1 -0
  241. package/dist/node_modules/.pnpm/@vitest_expect@2.1.9/node_modules/@vitest/expect/dist/index.js +1267 -0
  242. package/dist/node_modules/.pnpm/@vitest_expect@2.1.9/node_modules/@vitest/expect/dist/index.js.map +1 -0
  243. package/dist/node_modules/.pnpm/@vitest_pretty-format@2.1.9/node_modules/@vitest/pretty-format/dist/index.js +814 -0
  244. package/dist/node_modules/.pnpm/@vitest_pretty-format@2.1.9/node_modules/@vitest/pretty-format/dist/index.js.map +1 -0
  245. package/dist/node_modules/.pnpm/@vitest_runner@2.1.9/node_modules/@vitest/runner/dist/chunk-tasks.js +43 -0
  246. package/dist/node_modules/.pnpm/@vitest_runner@2.1.9/node_modules/@vitest/runner/dist/chunk-tasks.js.map +1 -0
  247. package/dist/node_modules/.pnpm/@vitest_runner@2.1.9/node_modules/@vitest/runner/dist/index.js +527 -0
  248. package/dist/node_modules/.pnpm/@vitest_runner@2.1.9/node_modules/@vitest/runner/dist/index.js.map +1 -0
  249. package/dist/node_modules/.pnpm/@vitest_runner@2.1.9/node_modules/@vitest/runner/dist/utils.js +2 -0
  250. package/dist/node_modules/.pnpm/@vitest_snapshot@2.1.9/node_modules/@vitest/snapshot/dist/index.js +1737 -0
  251. package/dist/node_modules/.pnpm/@vitest_snapshot@2.1.9/node_modules/@vitest/snapshot/dist/index.js.map +1 -0
  252. package/dist/node_modules/.pnpm/@vitest_spy@2.1.9/node_modules/@vitest/spy/dist/index.js +137 -0
  253. package/dist/node_modules/.pnpm/@vitest_spy@2.1.9/node_modules/@vitest/spy/dist/index.js.map +1 -0
  254. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js +118 -0
  255. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js.map +1 -0
  256. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/diff.js +1222 -0
  257. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/diff.js.map +1 -0
  258. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/error.js +91 -0
  259. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/error.js.map +1 -0
  260. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/helpers.js +113 -0
  261. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/helpers.js.map +1 -0
  262. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/index.js +449 -0
  263. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/index.js.map +1 -0
  264. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/source-map.js +163 -0
  265. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/source-map.js.map +1 -0
  266. package/dist/node_modules/.pnpm/chai@5.3.3/node_modules/chai/index.js +3187 -0
  267. package/dist/node_modules/.pnpm/chai@5.3.3/node_modules/chai/index.js.map +1 -0
  268. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/arguments.js +11 -0
  269. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/arguments.js.map +1 -0
  270. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/array.js +16 -0
  271. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/array.js.map +1 -0
  272. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/bigint.js +11 -0
  273. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/bigint.js.map +1 -0
  274. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/class.js +15 -0
  275. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/class.js.map +1 -0
  276. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/date.js +13 -0
  277. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/date.js.map +1 -0
  278. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/error.js +34 -0
  279. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/error.js.map +1 -0
  280. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/function.js +12 -0
  281. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/function.js.map +1 -0
  282. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/helpers.js +122 -0
  283. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/helpers.js.map +1 -0
  284. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/html.js +39 -0
  285. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/html.js.map +1 -0
  286. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/index.js +99 -0
  287. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/index.js.map +1 -0
  288. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/map.js +25 -0
  289. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/map.js.map +1 -0
  290. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/number.js +14 -0
  291. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/number.js.map +1 -0
  292. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/object.js +21 -0
  293. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/object.js.map +1 -0
  294. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/promise.js +6 -0
  295. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/promise.js.map +1 -0
  296. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/regexp.js +12 -0
  297. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/regexp.js.map +1 -0
  298. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/set.js +18 -0
  299. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/set.js.map +1 -0
  300. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/string.js +24 -0
  301. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/string.js.map +1 -0
  302. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/symbol.js +9 -0
  303. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/symbol.js.map +1 -0
  304. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/typedarray.js +30 -0
  305. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/typedarray.js.map +1 -0
  306. package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.js +939 -0
  307. package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.js.map +1 -0
  308. package/dist/node_modules/.pnpm/pathe@1.1.2/node_modules/pathe/dist/shared/pathe.ff20891b.js +82 -0
  309. package/dist/node_modules/.pnpm/pathe@1.1.2/node_modules/pathe/dist/shared/pathe.ff20891b.js.map +1 -0
  310. package/dist/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js +82 -0
  311. package/dist/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js.map +1 -0
  312. package/dist/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/node.js +8 -0
  313. package/dist/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/node.js.map +1 -0
  314. package/dist/node_modules/.pnpm/tinyspy@3.0.2/node_modules/tinyspy/dist/index.js +83 -0
  315. package/dist/node_modules/.pnpm/tinyspy@3.0.2/node_modules/tinyspy/dist/index.js.map +1 -0
  316. package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.js +9 -0
  317. package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.js.map +1 -0
  318. package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/date.W2xKR2qe.js +51 -0
  319. package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/date.W2xKR2qe.js.map +1 -0
  320. package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/utils.C8RiOc4B.js +48 -0
  321. package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/utils.C8RiOc4B.js.map +1 -0
  322. package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/vi.DgezovHB.js +2426 -0
  323. package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/vi.DgezovHB.js.map +1 -0
  324. package/dist/packages/server/package.js +6 -0
  325. package/dist/packages/server/package.js.map +1 -0
  326. package/package.json +9 -7
  327. package/dist/app/notifications.d.ts +0 -7
  328. package/dist/app/notifications.js +0 -23
  329. package/dist/app/notifications.js.map +0 -1
  330. package/dist/http/routes/learn/assets.d.ts +0 -8
  331. package/dist/http/routes/learn/assets.js +0 -32
  332. package/dist/http/routes/learn/assets.js.map +0 -1
  333. package/dist/http/routes/learn/comments.d.ts +0 -7
  334. package/dist/http/routes/learn/comments.js +0 -175
  335. package/dist/http/routes/learn/comments.js.map +0 -1
  336. package/dist/http/routes/learn/courses.d.ts +0 -7
  337. package/dist/http/routes/learn/courses.js +0 -75
  338. package/dist/http/routes/learn/courses.js.map +0 -1
  339. package/dist/http/routes/learn/downloads.d.ts +0 -7
  340. package/dist/http/routes/learn/downloads.js +0 -76
  341. package/dist/http/routes/learn/downloads.js.map +0 -1
  342. package/dist/http/routes/learn/index.d.ts +0 -7
  343. package/dist/http/routes/learn/index.js +0 -19
  344. package/dist/http/routes/learn/index.js.map +0 -1
  345. package/dist/http/routes/learn/org.d.ts +0 -7
  346. package/dist/http/routes/learn/org.js +0 -50
  347. package/dist/http/routes/learn/org.js.map +0 -1
  348. package/dist/http/routes/learn/progress.d.ts +0 -7
  349. package/dist/http/routes/learn/progress.js +0 -63
  350. package/dist/http/routes/learn/progress.js.map +0 -1
  351. package/dist/http/schemas/learn.js.map +0 -1
@@ -1,11 +1,17 @@
1
1
  import { z } from "zod";
2
2
  //#region src/http/schemas/assets.d.ts
3
3
  declare const AssetKind: z.ZodEnum<{
4
- download: "download";
4
+ image: "image";
5
5
  video: "video";
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";
@@ -14,22 +20,29 @@ type AssetStatus = z.infer<typeof AssetStatus>;
14
20
  declare const Asset: z.ZodObject<{
15
21
  orgId: z.ZodString;
16
22
  id: z.ZodString;
17
- key: z.ZodString;
18
- kind: z.ZodEnum<{
19
- download: "download";
20
- video: "video";
21
- content: "content";
22
- }>;
23
- filename: z.ZodString;
24
- contentType: z.ZodString;
25
- size: z.ZodNumber;
26
23
  status: z.ZodEnum<{
27
24
  pending: "pending";
28
25
  ready: "ready";
29
26
  }>;
30
- uploadedBy: z.ZodString;
31
27
  createdAt: z.ZodCoercedDate<unknown>;
32
- }, z.core.$strict>;
28
+ updatedAt: z.ZodCoercedDate<unknown>;
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>;
33
46
  type Asset = z.infer<typeof Asset>;
34
47
  declare const AssetsQuery: z.ZodObject<{
35
48
  page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
@@ -37,9 +50,14 @@ declare const AssetsQuery: z.ZodObject<{
37
50
  search: z.ZodOptional<z.ZodString>;
38
51
  sort: z.ZodOptional<z.ZodString>;
39
52
  kind: z.ZodOptional<z.ZodEnum<{
40
- download: "download";
53
+ image: "image";
41
54
  video: "video";
42
- content: "content";
55
+ audio: "audio";
56
+ document: "document";
57
+ }>>;
58
+ source: z.ZodOptional<z.ZodEnum<{
59
+ library: "library";
60
+ member: "member";
43
61
  }>>;
44
62
  }, z.core.$strip>;
45
63
  type AssetsQuery = z.infer<typeof AssetsQuery>;
@@ -47,22 +65,29 @@ declare const AssetsPage: z.ZodObject<{
47
65
  rows: z.ZodArray<z.ZodObject<{
48
66
  orgId: z.ZodString;
49
67
  id: z.ZodString;
50
- key: z.ZodString;
51
- kind: z.ZodEnum<{
52
- download: "download";
53
- video: "video";
54
- content: "content";
55
- }>;
56
- filename: z.ZodString;
57
- contentType: z.ZodString;
58
- size: z.ZodNumber;
59
68
  status: z.ZodEnum<{
60
69
  pending: "pending";
61
70
  ready: "ready";
62
71
  }>;
63
- uploadedBy: z.ZodString;
64
72
  createdAt: z.ZodCoercedDate<unknown>;
65
- }, z.core.$strict>>;
73
+ updatedAt: z.ZodCoercedDate<unknown>;
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>>;
66
91
  total: z.ZodNumber;
67
92
  page: z.ZodNumber;
68
93
  pageSize: z.ZodNumber;
@@ -72,71 +97,49 @@ declare const AssetIdParam: z.ZodObject<{
72
97
  id: z.ZodString;
73
98
  }, z.core.$strip>;
74
99
  type AssetIdParam = z.infer<typeof AssetIdParam>;
75
- /** Register an asset and get a presigned upload URL. */
76
100
  declare const RequestUpload: z.ZodObject<{
77
101
  filename: z.ZodString;
78
102
  contentType: z.ZodString;
79
- kind: z.ZodEnum<{
80
- download: "download";
81
- video: "video";
82
- content: "content";
83
- }>;
84
103
  }, z.core.$strip>;
85
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>;
86
110
  declare const UploadTicket: z.ZodObject<{
87
- asset: z.ZodObject<{
88
- orgId: z.ZodString;
89
- id: z.ZodString;
90
- key: z.ZodString;
91
- kind: z.ZodEnum<{
92
- download: "download";
93
- video: "video";
94
- content: "content";
95
- }>;
96
- filename: z.ZodString;
97
- contentType: z.ZodString;
98
- size: z.ZodNumber;
99
- status: z.ZodEnum<{
100
- pending: "pending";
101
- ready: "ready";
102
- }>;
103
- uploadedBy: z.ZodString;
104
- createdAt: z.ZodCoercedDate<unknown>;
105
- }, z.core.$strict>;
106
111
  uploadUrl: z.ZodString;
107
112
  method: z.ZodLiteral<"PUT">;
108
113
  expiresInSeconds: z.ZodNumber;
109
114
  headers: z.ZodRecord<z.ZodString, z.ZodString>;
110
- }, z.core.$strict>;
111
- type UploadTicket = z.infer<typeof UploadTicket>;
112
- /** Optional override of the download filename (Content-Disposition). */
113
- declare const RequestDownload: z.ZodObject<{
114
- filename: z.ZodOptional<z.ZodString>;
115
- }, z.core.$strip>;
116
- type RequestDownload = z.infer<typeof RequestDownload>;
117
- declare const DownloadTicket: z.ZodObject<{
118
- url: z.ZodString;
119
115
  asset: z.ZodObject<{
120
116
  orgId: z.ZodString;
121
117
  id: z.ZodString;
122
- key: z.ZodString;
123
- kind: z.ZodEnum<{
124
- download: "download";
125
- video: "video";
126
- content: "content";
127
- }>;
128
- filename: z.ZodString;
129
- contentType: z.ZodString;
130
- size: z.ZodNumber;
131
118
  status: z.ZodEnum<{
132
119
  pending: "pending";
133
120
  ready: "ready";
134
121
  }>;
135
- uploadedBy: z.ZodString;
136
122
  createdAt: z.ZodCoercedDate<unknown>;
137
- }, z.core.$strict>;
123
+ updatedAt: z.ZodCoercedDate<unknown>;
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>;
138
141
  }, z.core.$strict>;
139
- type DownloadTicket = z.infer<typeof DownloadTicket>;
142
+ type UploadTicket = z.infer<typeof UploadTicket>;
140
143
  //#endregion
141
- export { Asset, AssetIdParam, AssetKind, AssetStatus, AssetsPage, AssetsQuery, DownloadTicket, RequestDownload, RequestUpload, UploadTicket };
144
+ export { Asset, AssetIdParam, AssetKind, AssetSource, AssetStatus, AssetsPage, AssetsQuery, RequestMemberUpload, RequestUpload, UploadTicket };
142
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"}
@@ -9,39 +9,62 @@ type AutomationAction = z.infer<typeof AutomationAction>;
9
9
  /** A domain event type, e.g. `entitlement.created`. */
10
10
  declare const AutomationTrigger: z.ZodString;
11
11
  type AutomationTrigger = z.infer<typeof AutomationTrigger>;
12
+ declare const AutomationKind: z.ZodEnum<{
13
+ workflow: "workflow";
14
+ webhook: "webhook";
15
+ }>;
16
+ type AutomationKind = z.infer<typeof AutomationKind>;
12
17
  declare const Automation: z.ZodObject<{
13
18
  orgId: z.ZodString;
14
19
  id: z.ZodString;
15
20
  name: z.ZodString;
21
+ kind: z.ZodEnum<{
22
+ workflow: "workflow";
23
+ webhook: "webhook";
24
+ }>;
16
25
  description: z.ZodNullable<z.ZodString>;
17
- trigger: z.ZodString;
26
+ triggers: z.ZodArray<z.ZodString>;
18
27
  actions: z.ZodArray<z.ZodObject<{
19
28
  type: z.ZodString;
20
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>>>;
21
30
  }, z.core.$strict>>;
22
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>>>>;
33
+ source: z.ZodEnum<{
34
+ system: "system";
35
+ user: "user";
36
+ }>;
23
37
  createdAt: z.ZodCoercedDate<unknown>;
24
38
  updatedAt: z.ZodCoercedDate<unknown>;
25
39
  }, z.core.$strict>;
26
40
  type Automation = z.infer<typeof Automation>;
41
+ declare const AutomationsQuery: z.ZodObject<{
42
+ kind: z.ZodOptional<z.ZodEnum<{
43
+ workflow: "workflow";
44
+ webhook: "webhook";
45
+ }>>;
46
+ }, z.core.$strict>;
47
+ type AutomationsQuery = z.infer<typeof AutomationsQuery>;
27
48
  declare const CreateAutomationBody: z.ZodObject<{
28
49
  name: z.ZodString;
29
50
  description: z.ZodOptional<z.ZodString>;
30
- trigger: z.ZodString;
51
+ triggers: z.ZodArray<z.ZodString>;
31
52
  actions: z.ZodArray<z.ZodObject<{
32
53
  type: z.ZodString;
33
54
  input: z.ZodRecord<z.ZodString, z.ZodType<import("@headless-lms/core/types").JsonValue, unknown, z.core.$ZodTypeInternals<import("@headless-lms/core/types").JsonValue, unknown>>>;
34
55
  }, z.core.$strict>>;
56
+ 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>>>>>;
35
57
  }, z.core.$strict>;
36
58
  type CreateAutomationBody = z.infer<typeof CreateAutomationBody>;
37
59
  declare const UpdateAutomationBody: z.ZodObject<{
38
60
  name: z.ZodOptional<z.ZodString>;
39
61
  description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
40
- trigger: z.ZodOptional<z.ZodString>;
62
+ triggers: z.ZodOptional<z.ZodArray<z.ZodString>>;
41
63
  actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
42
64
  type: z.ZodString;
43
65
  input: z.ZodRecord<z.ZodString, z.ZodType<import("@headless-lms/core/types").JsonValue, unknown, z.core.$ZodTypeInternals<import("@headless-lms/core/types").JsonValue, unknown>>>;
44
66
  }, z.core.$strict>>>;
67
+ 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>>>>>>;
45
68
  enabled: z.ZodOptional<z.ZodBoolean>;
46
69
  }, z.core.$strict>;
47
70
  type UpdateAutomationBody = z.infer<typeof UpdateAutomationBody>;
@@ -49,6 +72,11 @@ declare const AutomationIdParam: z.ZodObject<{
49
72
  id: z.ZodString;
50
73
  }, z.core.$strip>;
51
74
  type AutomationIdParam = z.infer<typeof AutomationIdParam>;
75
+ declare const AutomationRunParams: z.ZodObject<{
76
+ id: z.ZodString;
77
+ runId: z.ZodString;
78
+ }, z.core.$strip>;
79
+ type AutomationRunParams = z.infer<typeof AutomationRunParams>;
52
80
  /** An action an automation can use: a built-in type (`sendEmail`) or a loaded
53
81
  * integration's own (`<integrationId>.<actionId>`). */
54
82
  declare const AvailableAction: z.ZodObject<{
@@ -62,13 +90,15 @@ type AvailableAction = z.infer<typeof AvailableAction>;
62
90
  declare const AvailableTriggers: z.ZodObject<{
63
91
  triggers: z.ZodArray<z.ZodObject<{
64
92
  type: z.ZodString;
93
+ label: z.ZodString;
94
+ category: z.ZodString;
65
95
  description: z.ZodString;
66
96
  }, z.core.$strict>>;
67
97
  }, z.core.$strict>;
68
98
  type AvailableTriggers = z.infer<typeof AvailableTriggers>;
69
99
  declare const AutomationRunStatus: z.ZodEnum<{
70
- completed: "completed";
71
100
  running: "running";
101
+ completed: "completed";
72
102
  failed: "failed";
73
103
  }>;
74
104
  type AutomationRunStatus = z.infer<typeof AutomationRunStatus>;
@@ -80,6 +110,7 @@ declare const AutomationActionResult: z.ZodObject<{
80
110
  failed: "failed";
81
111
  }>;
82
112
  error: z.ZodOptional<z.ZodString>;
113
+ recipients: z.ZodOptional<z.ZodArray<z.ZodString>>;
83
114
  }, z.core.$strict>;
84
115
  type AutomationActionResult = z.infer<typeof AutomationActionResult>;
85
116
  declare const AutomationRun: z.ZodObject<{
@@ -90,8 +121,8 @@ declare const AutomationRun: z.ZodObject<{
90
121
  eventId: z.ZodString;
91
122
  event: z.ZodType<import("@headless-lms/core/types").DomainEvent<unknown, string, number>, unknown, z.core.$ZodTypeInternals<import("@headless-lms/core/types").DomainEvent<unknown, string, number>, unknown>>;
92
123
  status: z.ZodEnum<{
93
- completed: "completed";
94
124
  running: "running";
125
+ completed: "completed";
95
126
  failed: "failed";
96
127
  }>;
97
128
  actionResults: z.ZodArray<z.ZodObject<{
@@ -102,9 +133,12 @@ declare const AutomationRun: z.ZodObject<{
102
133
  failed: "failed";
103
134
  }>;
104
135
  error: z.ZodOptional<z.ZodString>;
136
+ recipients: z.ZodOptional<z.ZodArray<z.ZodString>>;
105
137
  }, z.core.$strict>>;
106
138
  startedAt: z.ZodCoercedDate<unknown>;
107
139
  finishedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
140
+ createdAt: z.ZodCoercedDate<unknown>;
141
+ updatedAt: z.ZodCoercedDate<unknown>;
108
142
  }, z.core.$strict>;
109
143
  type AutomationRun = z.infer<typeof AutomationRun>;
110
144
  declare const AutomationRunsQuery: z.ZodObject<{
@@ -113,8 +147,8 @@ declare const AutomationRunsQuery: z.ZodObject<{
113
147
  search: z.ZodOptional<z.ZodString>;
114
148
  sort: z.ZodOptional<z.ZodString>;
115
149
  status: z.ZodOptional<z.ZodEnum<{
116
- completed: "completed";
117
150
  running: "running";
151
+ completed: "completed";
118
152
  failed: "failed";
119
153
  }>>;
120
154
  }, z.core.$strip>;
@@ -128,8 +162,8 @@ declare const AutomationRunsPage: z.ZodObject<{
128
162
  eventId: z.ZodString;
129
163
  event: z.ZodType<import("@headless-lms/core/types").DomainEvent<unknown, string, number>, unknown, z.core.$ZodTypeInternals<import("@headless-lms/core/types").DomainEvent<unknown, string, number>, unknown>>;
130
164
  status: z.ZodEnum<{
131
- completed: "completed";
132
165
  running: "running";
166
+ completed: "completed";
133
167
  failed: "failed";
134
168
  }>;
135
169
  actionResults: z.ZodArray<z.ZodObject<{
@@ -140,15 +174,58 @@ declare const AutomationRunsPage: z.ZodObject<{
140
174
  failed: "failed";
141
175
  }>;
142
176
  error: z.ZodOptional<z.ZodString>;
177
+ recipients: z.ZodOptional<z.ZodArray<z.ZodString>>;
143
178
  }, z.core.$strict>>;
144
179
  startedAt: z.ZodCoercedDate<unknown>;
145
180
  finishedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
181
+ createdAt: z.ZodCoercedDate<unknown>;
182
+ updatedAt: z.ZodCoercedDate<unknown>;
146
183
  }, z.core.$strict>>;
147
184
  total: z.ZodNumber;
148
185
  page: z.ZodNumber;
149
186
  pageSize: z.ZodNumber;
150
187
  }, z.core.$strip>;
151
188
  type AutomationRunsPage = z.infer<typeof AutomationRunsPage>;
189
+ declare const Webhook: z.ZodObject<{
190
+ orgId: z.ZodString;
191
+ id: z.ZodString;
192
+ url: z.ZodString;
193
+ events: z.ZodArray<z.ZodString>;
194
+ description: z.ZodNullable<z.ZodString>;
195
+ enabled: z.ZodBoolean;
196
+ createdAt: z.ZodCoercedDate<unknown>;
197
+ updatedAt: z.ZodCoercedDate<unknown>;
198
+ }, z.core.$strict>;
199
+ type Webhook = z.infer<typeof Webhook>;
200
+ declare const CreatedWebhook: z.ZodObject<{
201
+ orgId: z.ZodString;
202
+ id: z.ZodString;
203
+ url: z.ZodString;
204
+ events: z.ZodArray<z.ZodString>;
205
+ description: z.ZodNullable<z.ZodString>;
206
+ enabled: z.ZodBoolean;
207
+ createdAt: z.ZodCoercedDate<unknown>;
208
+ updatedAt: z.ZodCoercedDate<unknown>;
209
+ secret: z.ZodString;
210
+ }, z.core.$strict>;
211
+ type CreatedWebhook = z.infer<typeof CreatedWebhook>;
212
+ declare const CreateWebhookBody: z.ZodObject<{
213
+ url: z.ZodURL;
214
+ events: z.ZodArray<z.ZodString>;
215
+ description: z.ZodOptional<z.ZodString>;
216
+ }, z.core.$strict>;
217
+ type CreateWebhookBody = z.infer<typeof CreateWebhookBody>;
218
+ declare const UpdateWebhookBody: z.ZodObject<{
219
+ url: z.ZodOptional<z.ZodURL>;
220
+ events: z.ZodOptional<z.ZodArray<z.ZodString>>;
221
+ description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
222
+ enabled: z.ZodOptional<z.ZodBoolean>;
223
+ }, z.core.$strict>;
224
+ type UpdateWebhookBody = z.infer<typeof UpdateWebhookBody>;
225
+ declare const WebhookSecret: z.ZodObject<{
226
+ secret: z.ZodString;
227
+ }, z.core.$strict>;
228
+ type WebhookSecret = z.infer<typeof WebhookSecret>;
152
229
  //#endregion
153
- export { Automation, AutomationAction, AutomationActionResult, AutomationIdParam, AutomationRun, AutomationRunStatus, AutomationRunsPage, AutomationRunsQuery, AutomationTrigger, AvailableAction, AvailableTriggers, CreateAutomationBody, UpdateAutomationBody };
230
+ export { Automation, AutomationAction, AutomationActionResult, AutomationIdParam, AutomationKind, AutomationRun, AutomationRunParams, AutomationRunStatus, AutomationRunsPage, AutomationRunsQuery, AutomationTrigger, AutomationsQuery, AvailableAction, AvailableTriggers, CreateAutomationBody, CreateWebhookBody, CreatedWebhook, UpdateAutomationBody, UpdateWebhookBody, Webhook, WebhookSecret };
154
231
  //# sourceMappingURL=automations.d.ts.map
@@ -1,15 +1,21 @@
1
1
  import { ListQuery, paginated } from "./shared.js";
2
2
  import { z } from "zod";
3
- import { automationActionResultSchema, automationActionSchema, automationRunSchema, automationRunStatusSchema, automationSchema, automationTriggerSchema, availableActionSchema, availableTriggersSchema, createAutomationInputSchema, updateAutomationInputSchema } from "@headless-lms/core/schemas";
3
+ import { automationActionResultSchema, automationActionSchema, automationKindSchema, automationRunSchema, automationRunStatusSchema, automationSchema, automationTriggerSchema, automationsQuerySchema, availableActionSchema, availableTriggersSchema, createAutomationInputSchema, createWebhookInputSchema, createdWebhookSchema, updateAutomationInputSchema, updateWebhookInputSchema, webhookSchema, webhookSecretSchema } from "@headless-lms/core/schemas";
4
4
  //#region src/http/schemas/automations.ts
5
5
  /** One step of an automation: which action, and its input per that action's inputSchema. */
6
6
  const AutomationAction = automationActionSchema;
7
7
  /** A domain event type, e.g. `entitlement.created`. */
8
8
  const AutomationTrigger = automationTriggerSchema;
9
+ const AutomationKind = automationKindSchema;
9
10
  const Automation = automationSchema;
11
+ const AutomationsQuery = automationsQuerySchema;
10
12
  const CreateAutomationBody = createAutomationInputSchema;
11
13
  const UpdateAutomationBody = updateAutomationInputSchema;
12
14
  const AutomationIdParam = z.object({ id: z.string() });
15
+ const AutomationRunParams = z.object({
16
+ id: z.string(),
17
+ runId: z.string()
18
+ });
13
19
  /** An action an automation can use: a built-in type (`sendEmail`) or a loaded
14
20
  * integration's own (`<integrationId>.<actionId>`). */
15
21
  const AvailableAction = availableActionSchema;
@@ -20,7 +26,12 @@ const AutomationActionResult = automationActionResultSchema;
20
26
  const AutomationRun = automationRunSchema;
21
27
  const AutomationRunsQuery = ListQuery.extend({ status: AutomationRunStatus.optional() });
22
28
  const AutomationRunsPage = paginated(AutomationRun);
29
+ const Webhook = webhookSchema;
30
+ const CreatedWebhook = createdWebhookSchema;
31
+ const CreateWebhookBody = createWebhookInputSchema;
32
+ const UpdateWebhookBody = updateWebhookInputSchema;
33
+ const WebhookSecret = webhookSecretSchema;
23
34
  //#endregion
24
- export { Automation, AutomationAction, AutomationActionResult, AutomationIdParam, AutomationRun, AutomationRunStatus, AutomationRunsPage, AutomationRunsQuery, AutomationTrigger, AvailableAction, AvailableTriggers, CreateAutomationBody, UpdateAutomationBody };
35
+ export { Automation, AutomationAction, AutomationActionResult, AutomationIdParam, AutomationKind, AutomationRun, AutomationRunParams, AutomationRunStatus, AutomationRunsPage, AutomationRunsQuery, AutomationTrigger, AutomationsQuery, AvailableAction, AvailableTriggers, CreateAutomationBody, CreateWebhookBody, CreatedWebhook, UpdateAutomationBody, UpdateWebhookBody, Webhook, WebhookSecret };
25
36
 
26
37
  //# sourceMappingURL=automations.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"automations.js","names":[],"sources":["../../../src/http/schemas/automations.ts"],"sourcesContent":["// Automations resource schemas. An automation matches a trigger (a domain\n// event type) against enabled rules and runs an ordered list of actions;\n// every run is recorded. Payload shapes are owned by\n// @headless-lms/core/schemas; route-local schemas define endpoint-only\n// concerns such as params and pagination envelopes.\nimport { z } from \"zod\";\nimport {\n automationActionResultSchema,\n automationActionSchema,\n automationRunSchema,\n automationRunStatusSchema,\n automationSchema,\n automationTriggerSchema,\n availableActionSchema,\n availableTriggersSchema,\n createAutomationInputSchema,\n updateAutomationInputSchema,\n} from \"@headless-lms/core/schemas\";\nimport { ListQuery, paginated } from \"./shared.js\";\n\n/** One step of an automation: which action, and its input per that action's inputSchema. */\nexport const AutomationAction = automationActionSchema;\nexport type AutomationAction = z.infer<typeof AutomationAction>;\n\n/** A domain event type, e.g. `entitlement.created`. */\nexport const AutomationTrigger = automationTriggerSchema;\nexport type AutomationTrigger = z.infer<typeof AutomationTrigger>;\n\nexport const Automation = automationSchema;\nexport type Automation = z.infer<typeof Automation>;\n\nexport const CreateAutomationBody = createAutomationInputSchema;\nexport type CreateAutomationBody = z.infer<typeof CreateAutomationBody>;\n\nexport const UpdateAutomationBody = updateAutomationInputSchema;\nexport type UpdateAutomationBody = z.infer<typeof UpdateAutomationBody>;\n\nexport const AutomationIdParam = z.object({ id: z.string() });\nexport type AutomationIdParam = z.infer<typeof AutomationIdParam>;\n\n/** An action an automation can use: a built-in type (`sendEmail`) or a loaded\n * integration's own (`<integrationId>.<actionId>`). */\nexport const AvailableAction = availableActionSchema;\nexport type AvailableAction = z.infer<typeof AvailableAction>;\n\n/** Which domain events an automation can react to. */\nexport const AvailableTriggers = availableTriggersSchema;\nexport type AvailableTriggers = z.infer<typeof AvailableTriggers>;\n\nexport const AutomationRunStatus = automationRunStatusSchema;\nexport type AutomationRunStatus = z.infer<typeof AutomationRunStatus>;\n\nexport const AutomationActionResult = automationActionResultSchema;\nexport type AutomationActionResult = z.infer<typeof AutomationActionResult>;\n\nexport const AutomationRun = automationRunSchema;\nexport type AutomationRun = z.infer<typeof AutomationRun>;\n\nexport const AutomationRunsQuery = ListQuery.extend({\n status: AutomationRunStatus.optional(),\n});\nexport type AutomationRunsQuery = z.infer<typeof AutomationRunsQuery>;\n\nexport const AutomationRunsPage = paginated(AutomationRun);\nexport type AutomationRunsPage = z.infer<typeof AutomationRunsPage>;\n"],"mappings":";;;;;AAqBA,MAAa,mBAAmB;;AAIhC,MAAa,oBAAoB;AAGjC,MAAa,aAAa;AAG1B,MAAa,uBAAuB;AAGpC,MAAa,uBAAuB;AAGpC,MAAa,oBAAoB,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;;AAK5D,MAAa,kBAAkB;;AAI/B,MAAa,oBAAoB;AAGjC,MAAa,sBAAsB;AAGnC,MAAa,yBAAyB;AAGtC,MAAa,gBAAgB;AAG7B,MAAa,sBAAsB,UAAU,OAAO,EAClD,QAAQ,oBAAoB,SAAS,EACvC,CAAC;AAGD,MAAa,qBAAqB,UAAU,aAAa"}
1
+ {"version":3,"file":"automations.js","names":[],"sources":["../../../src/http/schemas/automations.ts"],"sourcesContent":["// Automations resource schemas. An automation matches a trigger (a domain\n// event type) against enabled rules and runs an ordered list of actions;\n// every run is recorded. Payload shapes are owned by\n// @headless-lms/core/schemas; route-local schemas define endpoint-only\n// concerns such as params and pagination envelopes.\nimport { z } from 'zod';\nimport {\n automationActionResultSchema,\n automationActionSchema,\n automationKindSchema,\n automationRunSchema,\n automationRunStatusSchema,\n automationSchema,\n automationTriggerSchema,\n automationsQuerySchema,\n availableActionSchema,\n availableTriggersSchema,\n createAutomationInputSchema,\n createdWebhookSchema,\n createWebhookInputSchema,\n updateAutomationInputSchema,\n updateWebhookInputSchema,\n webhookSchema,\n webhookSecretSchema,\n} from '@headless-lms/core/schemas';\nimport { ListQuery, paginated } from './shared.js';\n\n/** One step of an automation: which action, and its input per that action's inputSchema. */\nexport const AutomationAction = automationActionSchema;\nexport type AutomationAction = z.infer<typeof AutomationAction>;\n\n/** A domain event type, e.g. `entitlement.created`. */\nexport const AutomationTrigger = automationTriggerSchema;\nexport type AutomationTrigger = z.infer<typeof AutomationTrigger>;\n\nexport const AutomationKind = automationKindSchema;\nexport type AutomationKind = z.infer<typeof AutomationKind>;\n\nexport const Automation = automationSchema;\nexport type Automation = z.infer<typeof Automation>;\n\nexport const AutomationsQuery = automationsQuerySchema;\nexport type AutomationsQuery = z.infer<typeof AutomationsQuery>;\n\nexport const CreateAutomationBody = createAutomationInputSchema;\nexport type CreateAutomationBody = z.infer<typeof CreateAutomationBody>;\n\nexport const UpdateAutomationBody = updateAutomationInputSchema;\nexport type UpdateAutomationBody = z.infer<typeof UpdateAutomationBody>;\n\nexport const AutomationIdParam = z.object({ id: z.string() });\nexport type AutomationIdParam = z.infer<typeof AutomationIdParam>;\n\nexport const AutomationRunParams = z.object({ id: z.string(), runId: z.string() });\nexport type AutomationRunParams = z.infer<typeof AutomationRunParams>;\n\n/** An action an automation can use: a built-in type (`sendEmail`) or a loaded\n * integration's own (`<integrationId>.<actionId>`). */\nexport const AvailableAction = availableActionSchema;\nexport type AvailableAction = z.infer<typeof AvailableAction>;\n\n/** Which domain events an automation can react to. */\nexport const AvailableTriggers = availableTriggersSchema;\nexport type AvailableTriggers = z.infer<typeof AvailableTriggers>;\n\nexport const AutomationRunStatus = automationRunStatusSchema;\nexport type AutomationRunStatus = z.infer<typeof AutomationRunStatus>;\n\nexport const AutomationActionResult = automationActionResultSchema;\nexport type AutomationActionResult = z.infer<typeof AutomationActionResult>;\n\nexport const AutomationRun = automationRunSchema;\nexport type AutomationRun = z.infer<typeof AutomationRun>;\n\nexport const AutomationRunsQuery = ListQuery.extend({\n status: AutomationRunStatus.optional(),\n});\nexport type AutomationRunsQuery = z.infer<typeof AutomationRunsQuery>;\n\nexport const AutomationRunsPage = paginated(AutomationRun);\nexport type AutomationRunsPage = z.infer<typeof AutomationRunsPage>;\n\nexport const Webhook = webhookSchema;\nexport type Webhook = z.infer<typeof Webhook>;\n\nexport const CreatedWebhook = createdWebhookSchema;\nexport type CreatedWebhook = z.infer<typeof CreatedWebhook>;\n\nexport const CreateWebhookBody = createWebhookInputSchema;\nexport type CreateWebhookBody = z.infer<typeof CreateWebhookBody>;\n\nexport const UpdateWebhookBody = updateWebhookInputSchema;\nexport type UpdateWebhookBody = z.infer<typeof UpdateWebhookBody>;\n\nexport const WebhookSecret = webhookSecretSchema;\nexport type WebhookSecret = z.infer<typeof WebhookSecret>;\n"],"mappings":";;;;;AA4BA,MAAa,mBAAmB;;AAIhC,MAAa,oBAAoB;AAGjC,MAAa,iBAAiB;AAG9B,MAAa,aAAa;AAG1B,MAAa,mBAAmB;AAGhC,MAAa,uBAAuB;AAGpC,MAAa,uBAAuB;AAGpC,MAAa,oBAAoB,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAG5D,MAAa,sBAAsB,EAAE,OAAO;CAAE,IAAI,EAAE,OAAO;CAAG,OAAO,EAAE,OAAO;AAAE,CAAC;;;AAKjF,MAAa,kBAAkB;;AAI/B,MAAa,oBAAoB;AAGjC,MAAa,sBAAsB;AAGnC,MAAa,yBAAyB;AAGtC,MAAa,gBAAgB;AAG7B,MAAa,sBAAsB,UAAU,OAAO,EAClD,QAAQ,oBAAoB,SAAS,EACvC,CAAC;AAGD,MAAa,qBAAqB,UAAU,aAAa;AAGzD,MAAa,UAAU;AAGvB,MAAa,iBAAiB;AAG9B,MAAa,oBAAoB;AAGjC,MAAa,oBAAoB;AAGjC,MAAa,gBAAgB"}
@@ -0,0 +1,63 @@
1
+ import { z } from "zod";
2
+ //#region src/http/schemas/bundles.d.ts
3
+ declare const Bundle: z.ZodObject<{
4
+ orgId: z.ZodString;
5
+ id: z.ZodString;
6
+ name: z.ZodString;
7
+ createdAt: z.ZodCoercedDate<unknown>;
8
+ updatedAt: z.ZodCoercedDate<unknown>;
9
+ }, z.core.$strict>;
10
+ type Bundle = z.infer<typeof Bundle>;
11
+ declare const BundleItem: z.ZodObject<{
12
+ orgId: z.ZodString;
13
+ bundleId: z.ZodString;
14
+ contentId: z.ZodString;
15
+ createdAt: z.ZodCoercedDate<unknown>;
16
+ updatedAt: z.ZodCoercedDate<unknown>;
17
+ }, z.core.$strict>;
18
+ type BundleItem = z.infer<typeof BundleItem>;
19
+ declare const CreateBundle: z.ZodObject<{
20
+ name: z.ZodString;
21
+ contentIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
22
+ }, z.core.$strip>;
23
+ type CreateBundle = z.infer<typeof CreateBundle>;
24
+ declare const UpdateBundle: z.ZodObject<{
25
+ name: z.ZodOptional<z.ZodString>;
26
+ }, z.core.$strip>;
27
+ type UpdateBundle = z.infer<typeof UpdateBundle>;
28
+ declare const BundlesQuery: z.ZodObject<{
29
+ page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
30
+ pageSize: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
31
+ search: z.ZodOptional<z.ZodString>;
32
+ sort: z.ZodOptional<z.ZodString>;
33
+ }, z.core.$strip>;
34
+ type BundlesQuery = z.infer<typeof BundlesQuery>;
35
+ declare const BundlesPage: z.ZodObject<{
36
+ rows: z.ZodArray<z.ZodObject<{
37
+ orgId: z.ZodString;
38
+ id: z.ZodString;
39
+ name: z.ZodString;
40
+ createdAt: z.ZodCoercedDate<unknown>;
41
+ updatedAt: z.ZodCoercedDate<unknown>;
42
+ }, z.core.$strict>>;
43
+ total: z.ZodNumber;
44
+ page: z.ZodNumber;
45
+ pageSize: z.ZodNumber;
46
+ }, z.core.$strip>;
47
+ type BundlesPage = z.infer<typeof BundlesPage>;
48
+ declare const AddBundleItem: z.ZodObject<{
49
+ contentId: z.ZodString;
50
+ }, z.core.$strip>;
51
+ type AddBundleItem = z.infer<typeof AddBundleItem>;
52
+ declare const BundleIdParam: z.ZodObject<{
53
+ bundleId: z.ZodString;
54
+ }, z.core.$strip>;
55
+ type BundleIdParam = z.infer<typeof BundleIdParam>;
56
+ declare const BundleItemParams: z.ZodObject<{
57
+ bundleId: z.ZodString;
58
+ contentId: z.ZodString;
59
+ }, z.core.$strip>;
60
+ type BundleItemParams = z.infer<typeof BundleItemParams>;
61
+ //#endregion
62
+ export { AddBundleItem, Bundle, BundleIdParam, BundleItem, BundleItemParams, BundlesPage, BundlesQuery, CreateBundle, UpdateBundle };
63
+ //# sourceMappingURL=bundles.d.ts.map
@@ -0,0 +1,23 @@
1
+ import { ListQuery, paginated } from "./shared.js";
2
+ import { z } from "zod";
3
+ import { bundleItemSchema, bundleSchema, idSchema } from "@headless-lms/core/schemas";
4
+ //#region src/http/schemas/bundles.ts
5
+ const Bundle = bundleSchema;
6
+ const BundleItem = bundleItemSchema;
7
+ const CreateBundle = z.object({
8
+ name: z.string().trim().min(1).max(200),
9
+ contentIds: z.array(idSchema).max(500).optional()
10
+ });
11
+ const UpdateBundle = z.object({ name: z.string().trim().min(1).max(200).optional() });
12
+ const BundlesQuery = ListQuery;
13
+ const BundlesPage = paginated(Bundle);
14
+ const AddBundleItem = z.object({ contentId: idSchema });
15
+ const BundleIdParam = z.object({ bundleId: z.string() });
16
+ const BundleItemParams = z.object({
17
+ bundleId: z.string(),
18
+ contentId: idSchema
19
+ });
20
+ //#endregion
21
+ export { AddBundleItem, Bundle, BundleIdParam, BundleItem, BundleItemParams, BundlesPage, BundlesQuery, CreateBundle, UpdateBundle };
22
+
23
+ //# sourceMappingURL=bundles.js.map
@@ -0,0 +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, 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"}