@headless-lms/server 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (351) hide show
  1. package/dist/_virtual/_rolldown/runtime.js +5 -0
  2. package/dist/app/community-mail.d.ts +24 -0
  3. package/dist/app/community-mail.js +92 -0
  4. package/dist/app/community-mail.js.map +1 -0
  5. package/dist/app/container.d.ts +40 -19
  6. package/dist/app/container.js +294 -45
  7. package/dist/app/container.js.map +1 -1
  8. package/dist/app/mcp-endpoints.d.ts +13 -0
  9. package/dist/app/mcp-endpoints.js +25 -0
  10. package/dist/app/mcp-endpoints.js.map +1 -0
  11. package/dist/app/notification-channels.d.ts +47 -0
  12. package/dist/app/notification-channels.js +174 -0
  13. package/dist/app/notification-channels.js.map +1 -0
  14. package/dist/app/notification-reads.d.ts +23 -0
  15. package/dist/app/notification-reads.js +95 -0
  16. package/dist/app/notification-reads.js.map +1 -0
  17. package/dist/http/config.d.ts +2 -1
  18. package/dist/http/errors.d.ts +15 -0
  19. package/dist/http/errors.js +162 -0
  20. package/dist/http/errors.js.map +1 -0
  21. package/dist/http/mcp/catalogue.d.ts +37 -0
  22. package/dist/http/mcp/catalogue.js +69 -0
  23. package/dist/http/mcp/catalogue.js.map +1 -0
  24. package/dist/http/mcp/challenge.d.ts +7 -0
  25. package/dist/http/mcp/challenge.js +35 -0
  26. package/dist/http/mcp/challenge.js.map +1 -0
  27. package/dist/http/mcp/input-schema.d.ts +7 -0
  28. package/dist/http/mcp/input-schema.js +28 -0
  29. package/dist/http/mcp/input-schema.js.map +1 -0
  30. package/dist/http/mcp/route.d.ts +8 -0
  31. package/dist/http/mcp/route.js +75 -0
  32. package/dist/http/mcp/route.js.map +1 -0
  33. package/dist/http/mcp/server.d.ts +8 -0
  34. package/dist/http/mcp/server.js +31 -0
  35. package/dist/http/mcp/server.js.map +1 -0
  36. package/dist/http/mcp/test-support.d.ts +55 -0
  37. package/dist/http/mcp/test-support.js +151 -0
  38. package/dist/http/mcp/test-support.js.map +1 -0
  39. package/dist/http/mcp/tool.d.ts +48 -0
  40. package/dist/http/mcp/tool.js +58 -0
  41. package/dist/http/mcp/tool.js.map +1 -0
  42. package/dist/http/mcp/tools/automations.d.ts +6 -0
  43. package/dist/http/mcp/tools/automations.js +120 -0
  44. package/dist/http/mcp/tools/automations.js.map +1 -0
  45. package/dist/http/mcp/tools/catalog.d.ts +6 -0
  46. package/dist/http/mcp/tools/catalog.js +200 -0
  47. package/dist/http/mcp/tools/catalog.js.map +1 -0
  48. package/dist/http/mcp/tools/comments.d.ts +6 -0
  49. package/dist/http/mcp/tools/comments.js +70 -0
  50. package/dist/http/mcp/tools/comments.js.map +1 -0
  51. package/dist/http/mcp/tools/communities.d.ts +6 -0
  52. package/dist/http/mcp/tools/communities.js +175 -0
  53. package/dist/http/mcp/tools/communities.js.map +1 -0
  54. package/dist/http/mcp/tools/community-members.d.ts +6 -0
  55. package/dist/http/mcp/tools/community-members.js +89 -0
  56. package/dist/http/mcp/tools/community-members.js.map +1 -0
  57. package/dist/http/mcp/tools/community-moderation.d.ts +6 -0
  58. package/dist/http/mcp/tools/community-moderation.js +144 -0
  59. package/dist/http/mcp/tools/community-moderation.js.map +1 -0
  60. package/dist/http/mcp/tools/courses.d.ts +6 -0
  61. package/dist/http/mcp/tools/courses.js +121 -0
  62. package/dist/http/mcp/tools/courses.js.map +1 -0
  63. package/dist/http/mcp/tools/index.d.ts +6 -0
  64. package/dist/http/mcp/tools/index.js +23 -0
  65. package/dist/http/mcp/tools/index.js.map +1 -0
  66. package/dist/http/mcp/tools/people.d.ts +6 -0
  67. package/dist/http/mcp/tools/people.js +145 -0
  68. package/dist/http/mcp/tools/people.js.map +1 -0
  69. package/dist/http/plugins/auth.js +13 -5
  70. package/dist/http/plugins/auth.js.map +1 -1
  71. package/dist/http/plugins/error-handler.d.ts +2 -1
  72. package/dist/http/plugins/error-handler.js +51 -65
  73. package/dist/http/plugins/error-handler.js.map +1 -1
  74. package/dist/http/plugins/openapi.js +49 -2
  75. package/dist/http/plugins/openapi.js.map +1 -1
  76. package/dist/http/routes/access.d.ts +7 -0
  77. package/dist/http/routes/access.js +140 -0
  78. package/dist/http/routes/access.js.map +1 -0
  79. package/dist/http/routes/activities.js +68 -23
  80. package/dist/http/routes/activities.js.map +1 -1
  81. package/dist/http/routes/assets.js +60 -55
  82. package/dist/http/routes/assets.js.map +1 -1
  83. package/dist/http/routes/automations.js +44 -24
  84. package/dist/http/routes/automations.js.map +1 -1
  85. package/dist/http/routes/bundles.js +29 -18
  86. package/dist/http/routes/bundles.js.map +1 -1
  87. package/dist/http/routes/communities.d.ts +7 -0
  88. package/dist/http/routes/communities.js +522 -0
  89. package/dist/http/routes/communities.js.map +1 -0
  90. package/dist/http/routes/community-moderation.d.ts +7 -0
  91. package/dist/http/routes/community-moderation.js +425 -0
  92. package/dist/http/routes/community-moderation.js.map +1 -0
  93. package/dist/http/routes/course-analytics.js +9 -7
  94. package/dist/http/routes/course-analytics.js.map +1 -1
  95. package/dist/http/routes/courses.js +30 -15
  96. package/dist/http/routes/courses.js.map +1 -1
  97. package/dist/http/routes/dashboard.js +15 -6
  98. package/dist/http/routes/dashboard.js.map +1 -1
  99. package/dist/http/routes/discussion.js +34 -26
  100. package/dist/http/routes/discussion.js.map +1 -1
  101. package/dist/http/routes/downloads.js +48 -30
  102. package/dist/http/routes/downloads.js.map +1 -1
  103. package/dist/http/routes/entitlements.js +16 -7
  104. package/dist/http/routes/entitlements.js.map +1 -1
  105. package/dist/http/routes/integrations.js +38 -41
  106. package/dist/http/routes/integrations.js.map +1 -1
  107. package/dist/http/routes/member/actor.d.ts +14 -0
  108. package/dist/http/routes/member/actor.js +11 -0
  109. package/dist/http/routes/member/actor.js.map +1 -0
  110. package/dist/http/routes/member/assets.d.ts +7 -0
  111. package/dist/http/routes/member/assets.js +79 -0
  112. package/dist/http/routes/member/assets.js.map +1 -0
  113. package/dist/http/routes/member/chats.d.ts +7 -0
  114. package/dist/http/routes/member/chats.js +435 -0
  115. package/dist/http/routes/member/chats.js.map +1 -0
  116. package/dist/http/routes/member/comments.d.ts +7 -0
  117. package/dist/http/routes/member/comments.js +187 -0
  118. package/dist/http/routes/member/comments.js.map +1 -0
  119. package/dist/http/routes/member/community.d.ts +7 -0
  120. package/dist/http/routes/member/community.js +312 -0
  121. package/dist/http/routes/member/community.js.map +1 -0
  122. package/dist/http/routes/member/courses.d.ts +7 -0
  123. package/dist/http/routes/member/courses.js +101 -0
  124. package/dist/http/routes/member/courses.js.map +1 -0
  125. package/dist/http/routes/member/devices.d.ts +7 -0
  126. package/dist/http/routes/member/devices.js +98 -0
  127. package/dist/http/routes/member/devices.js.map +1 -0
  128. package/dist/http/routes/member/downloads.d.ts +7 -0
  129. package/dist/http/routes/member/downloads.js +56 -0
  130. package/dist/http/routes/member/downloads.js.map +1 -0
  131. package/dist/http/routes/member/files.d.ts +7 -0
  132. package/dist/http/routes/member/files.js +184 -0
  133. package/dist/http/routes/member/files.js.map +1 -0
  134. package/dist/http/routes/member/index.d.ts +7 -0
  135. package/dist/http/routes/member/index.js +35 -0
  136. package/dist/http/routes/member/index.js.map +1 -0
  137. package/dist/http/routes/member/notification-settings.d.ts +7 -0
  138. package/dist/http/routes/member/notification-settings.js +108 -0
  139. package/dist/http/routes/member/notification-settings.js.map +1 -0
  140. package/dist/http/routes/member/notifications.d.ts +7 -0
  141. package/dist/http/routes/member/notifications.js +125 -0
  142. package/dist/http/routes/member/notifications.js.map +1 -0
  143. package/dist/http/routes/member/org.d.ts +7 -0
  144. package/dist/http/routes/member/org.js +56 -0
  145. package/dist/http/routes/member/org.js.map +1 -0
  146. package/dist/http/routes/member/posts.d.ts +7 -0
  147. package/dist/http/routes/member/posts.js +612 -0
  148. package/dist/http/routes/member/posts.js.map +1 -0
  149. package/dist/http/routes/member/profile.d.ts +7 -0
  150. package/dist/http/routes/member/profile.js +48 -0
  151. package/dist/http/routes/member/profile.js.map +1 -0
  152. package/dist/http/routes/member/progress.d.ts +7 -0
  153. package/dist/http/routes/member/progress.js +60 -0
  154. package/dist/http/routes/member/progress.js.map +1 -0
  155. package/dist/http/routes/organizations.js +171 -25
  156. package/dist/http/routes/organizations.js.map +1 -1
  157. package/dist/http/routes/students.js +32 -47
  158. package/dist/http/routes/students.js.map +1 -1
  159. package/dist/http/routes/webhooks.js +26 -18
  160. package/dist/http/routes/webhooks.js.map +1 -1
  161. package/dist/http/routes.js +8 -2
  162. package/dist/http/routes.js.map +1 -1
  163. package/dist/http/schemas/access.d.ts +146 -0
  164. package/dist/http/schemas/access.js +36 -0
  165. package/dist/http/schemas/access.js.map +1 -0
  166. package/dist/http/schemas/activities.d.ts +3 -1
  167. package/dist/http/schemas/activities.js +4 -4
  168. package/dist/http/schemas/activities.js.map +1 -1
  169. package/dist/http/schemas/assets.d.ts +79 -80
  170. package/dist/http/schemas/assets.js +23 -13
  171. package/dist/http/schemas/assets.js.map +1 -1
  172. package/dist/http/schemas/automations.d.ts +6 -0
  173. package/dist/http/schemas/bundles.js +6 -6
  174. package/dist/http/schemas/bundles.js.map +1 -1
  175. package/dist/http/schemas/chats.d.ts +409 -0
  176. package/dist/http/schemas/chats.js +56 -0
  177. package/dist/http/schemas/chats.js.map +1 -0
  178. package/dist/http/schemas/community.d.ts +597 -0
  179. package/dist/http/schemas/community.js +132 -0
  180. package/dist/http/schemas/community.js.map +1 -0
  181. package/dist/http/schemas/content.d.ts +4 -2
  182. package/dist/http/schemas/content.js +11 -8
  183. package/dist/http/schemas/content.js.map +1 -1
  184. package/dist/http/schemas/discussion.d.ts +98 -14
  185. package/dist/http/schemas/discussion.js +25 -12
  186. package/dist/http/schemas/discussion.js.map +1 -1
  187. package/dist/http/schemas/downloads.d.ts +11 -5
  188. package/dist/http/schemas/downloads.js +14 -11
  189. package/dist/http/schemas/downloads.js.map +1 -1
  190. package/dist/http/schemas/entitlements.d.ts +6 -6
  191. package/dist/http/schemas/entitlements.js +6 -6
  192. package/dist/http/schemas/entitlements.js.map +1 -1
  193. package/dist/http/schemas/files.d.ts +45 -0
  194. package/dist/http/schemas/files.js +25 -0
  195. package/dist/http/schemas/files.js.map +1 -0
  196. package/dist/http/schemas/index.d.ts +15 -8
  197. package/dist/http/schemas/index.js +15 -8
  198. package/dist/http/schemas/integrations.d.ts +4 -4
  199. package/dist/http/schemas/invites.d.ts +4 -0
  200. package/dist/http/schemas/invites.js +1 -0
  201. package/dist/http/schemas/invites.js.map +1 -1
  202. package/dist/http/schemas/{learn.d.ts → member.d.ts} +31 -18
  203. package/dist/http/schemas/{learn.js → member.js} +17 -13
  204. package/dist/http/schemas/member.js.map +1 -0
  205. package/dist/http/schemas/members.d.ts +35 -2
  206. package/dist/http/schemas/members.js +17 -3
  207. package/dist/http/schemas/members.js.map +1 -1
  208. package/dist/http/schemas/notifications.d.ts +550 -0
  209. package/dist/http/schemas/notifications.js +164 -0
  210. package/dist/http/schemas/notifications.js.map +1 -0
  211. package/dist/http/schemas/posts.d.ts +350 -0
  212. package/dist/http/schemas/posts.js +47 -0
  213. package/dist/http/schemas/posts.js.map +1 -0
  214. package/dist/http/schemas/profile.d.ts +23 -0
  215. package/dist/http/schemas/profile.js +15 -0
  216. package/dist/http/schemas/profile.js.map +1 -0
  217. package/dist/http/schemas/shared.d.ts +32 -1
  218. package/dist/http/schemas/shared.js +20 -2
  219. package/dist/http/schemas/shared.js.map +1 -1
  220. package/dist/http/schemas/students.d.ts +1 -7
  221. package/dist/http/schemas/students.js +1 -7
  222. package/dist/http/schemas/students.js.map +1 -1
  223. package/dist/http/scope.d.ts +3 -1
  224. package/dist/http/scope.js +26 -4
  225. package/dist/http/scope.js.map +1 -1
  226. package/dist/http/server.js +6 -1
  227. package/dist/http/server.js.map +1 -1
  228. package/dist/http/web-bridge.d.ts +1 -1
  229. package/dist/http/web-bridge.js +2 -2
  230. package/dist/http/web-bridge.js.map +1 -1
  231. package/dist/http/well-known.d.ts +7 -0
  232. package/dist/http/well-known.js +22 -0
  233. package/dist/http/well-known.js.map +1 -0
  234. package/dist/index.d.ts +3 -1
  235. package/dist/index.js +4 -2
  236. package/dist/index.js.map +1 -1
  237. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.js +78 -0
  238. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.js.map +1 -0
  239. package/dist/node_modules/.pnpm/@vitest_expect@2.1.9/node_modules/@vitest/expect/dist/index.js +1267 -0
  240. package/dist/node_modules/.pnpm/@vitest_expect@2.1.9/node_modules/@vitest/expect/dist/index.js.map +1 -0
  241. package/dist/node_modules/.pnpm/@vitest_pretty-format@2.1.9/node_modules/@vitest/pretty-format/dist/index.js +814 -0
  242. package/dist/node_modules/.pnpm/@vitest_pretty-format@2.1.9/node_modules/@vitest/pretty-format/dist/index.js.map +1 -0
  243. package/dist/node_modules/.pnpm/@vitest_runner@2.1.9/node_modules/@vitest/runner/dist/chunk-tasks.js +43 -0
  244. package/dist/node_modules/.pnpm/@vitest_runner@2.1.9/node_modules/@vitest/runner/dist/chunk-tasks.js.map +1 -0
  245. package/dist/node_modules/.pnpm/@vitest_runner@2.1.9/node_modules/@vitest/runner/dist/index.js +527 -0
  246. package/dist/node_modules/.pnpm/@vitest_runner@2.1.9/node_modules/@vitest/runner/dist/index.js.map +1 -0
  247. package/dist/node_modules/.pnpm/@vitest_runner@2.1.9/node_modules/@vitest/runner/dist/utils.js +2 -0
  248. package/dist/node_modules/.pnpm/@vitest_snapshot@2.1.9/node_modules/@vitest/snapshot/dist/index.js +1737 -0
  249. package/dist/node_modules/.pnpm/@vitest_snapshot@2.1.9/node_modules/@vitest/snapshot/dist/index.js.map +1 -0
  250. package/dist/node_modules/.pnpm/@vitest_spy@2.1.9/node_modules/@vitest/spy/dist/index.js +137 -0
  251. package/dist/node_modules/.pnpm/@vitest_spy@2.1.9/node_modules/@vitest/spy/dist/index.js.map +1 -0
  252. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js +118 -0
  253. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js.map +1 -0
  254. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/diff.js +1222 -0
  255. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/diff.js.map +1 -0
  256. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/error.js +91 -0
  257. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/error.js.map +1 -0
  258. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/helpers.js +113 -0
  259. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/helpers.js.map +1 -0
  260. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/index.js +449 -0
  261. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/index.js.map +1 -0
  262. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/source-map.js +163 -0
  263. package/dist/node_modules/.pnpm/@vitest_utils@2.1.9/node_modules/@vitest/utils/dist/source-map.js.map +1 -0
  264. package/dist/node_modules/.pnpm/chai@5.3.3/node_modules/chai/index.js +3187 -0
  265. package/dist/node_modules/.pnpm/chai@5.3.3/node_modules/chai/index.js.map +1 -0
  266. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/arguments.js +11 -0
  267. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/arguments.js.map +1 -0
  268. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/array.js +16 -0
  269. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/array.js.map +1 -0
  270. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/bigint.js +11 -0
  271. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/bigint.js.map +1 -0
  272. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/class.js +15 -0
  273. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/class.js.map +1 -0
  274. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/date.js +13 -0
  275. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/date.js.map +1 -0
  276. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/error.js +34 -0
  277. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/error.js.map +1 -0
  278. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/function.js +12 -0
  279. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/function.js.map +1 -0
  280. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/helpers.js +122 -0
  281. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/helpers.js.map +1 -0
  282. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/html.js +39 -0
  283. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/html.js.map +1 -0
  284. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/index.js +99 -0
  285. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/index.js.map +1 -0
  286. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/map.js +25 -0
  287. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/map.js.map +1 -0
  288. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/number.js +14 -0
  289. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/number.js.map +1 -0
  290. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/object.js +21 -0
  291. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/object.js.map +1 -0
  292. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/promise.js +6 -0
  293. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/promise.js.map +1 -0
  294. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/regexp.js +12 -0
  295. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/regexp.js.map +1 -0
  296. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/set.js +18 -0
  297. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/set.js.map +1 -0
  298. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/string.js +24 -0
  299. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/string.js.map +1 -0
  300. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/symbol.js +9 -0
  301. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/symbol.js.map +1 -0
  302. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/typedarray.js +30 -0
  303. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/typedarray.js.map +1 -0
  304. package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.js +939 -0
  305. package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.js.map +1 -0
  306. package/dist/node_modules/.pnpm/pathe@1.1.2/node_modules/pathe/dist/shared/pathe.ff20891b.js +82 -0
  307. package/dist/node_modules/.pnpm/pathe@1.1.2/node_modules/pathe/dist/shared/pathe.ff20891b.js.map +1 -0
  308. package/dist/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js +82 -0
  309. package/dist/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js.map +1 -0
  310. package/dist/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/node.js +8 -0
  311. package/dist/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/node.js.map +1 -0
  312. package/dist/node_modules/.pnpm/tinyspy@3.0.2/node_modules/tinyspy/dist/index.js +83 -0
  313. package/dist/node_modules/.pnpm/tinyspy@3.0.2/node_modules/tinyspy/dist/index.js.map +1 -0
  314. package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.js +9 -0
  315. package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.js.map +1 -0
  316. package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/date.W2xKR2qe.js +51 -0
  317. package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/date.W2xKR2qe.js.map +1 -0
  318. package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/utils.C8RiOc4B.js +48 -0
  319. package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/utils.C8RiOc4B.js.map +1 -0
  320. package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/vi.DgezovHB.js +2426 -0
  321. package/dist/node_modules/.pnpm/vitest@2.1.9_@types_node@22.20.0_jsdom@25.0.1_lightningcss@1.32.0/node_modules/vitest/dist/chunks/vi.DgezovHB.js.map +1 -0
  322. package/dist/packages/server/package.js +6 -0
  323. package/dist/packages/server/package.js.map +1 -0
  324. package/package.json +9 -7
  325. package/dist/app/notifications.d.ts +0 -7
  326. package/dist/app/notifications.js +0 -26
  327. package/dist/app/notifications.js.map +0 -1
  328. package/dist/http/routes/learn/assets.d.ts +0 -8
  329. package/dist/http/routes/learn/assets.js +0 -32
  330. package/dist/http/routes/learn/assets.js.map +0 -1
  331. package/dist/http/routes/learn/comments.d.ts +0 -7
  332. package/dist/http/routes/learn/comments.js +0 -175
  333. package/dist/http/routes/learn/comments.js.map +0 -1
  334. package/dist/http/routes/learn/courses.d.ts +0 -7
  335. package/dist/http/routes/learn/courses.js +0 -98
  336. package/dist/http/routes/learn/courses.js.map +0 -1
  337. package/dist/http/routes/learn/downloads.d.ts +0 -7
  338. package/dist/http/routes/learn/downloads.js +0 -76
  339. package/dist/http/routes/learn/downloads.js.map +0 -1
  340. package/dist/http/routes/learn/index.d.ts +0 -7
  341. package/dist/http/routes/learn/index.js +0 -19
  342. package/dist/http/routes/learn/index.js.map +0 -1
  343. package/dist/http/routes/learn/org.d.ts +0 -7
  344. package/dist/http/routes/learn/org.js +0 -50
  345. package/dist/http/routes/learn/org.js.map +0 -1
  346. package/dist/http/routes/learn/progress.d.ts +0 -7
  347. package/dist/http/routes/learn/progress.js +0 -63
  348. package/dist/http/routes/learn/progress.js.map +0 -1
  349. package/dist/http/schemas/learn.js.map +0 -1
  350. package/dist/package.js +0 -6
  351. package/dist/package.js.map +0 -1
@@ -0,0 +1,164 @@
1
+ import { PageQuery, paginated } from "./shared.js";
2
+ import { z } from "zod";
3
+ import { digestScheduleSchema, jsonValueSchema, notificationCategoryKeySchema, notificationCategoryListSchema, notificationCategorySchema, notificationChannelKeySchema, notificationScopeSchema, notificationTypeKeySchema, reasonSchema, subjectTypeSchema } from "@headless-lms/core/schemas";
4
+ //#region src/http/schemas/notifications.ts
5
+ const NotificationIdParam = z.object({ notificationId: z.string() });
6
+ function commaSeparated(item, description) {
7
+ return z.string().max(2e3).transform((value) => value.split(",").map((part) => part.trim()).filter((part) => part.length > 0)).pipe(z.array(item).min(1).max(50)).describe(description);
8
+ }
9
+ function scopeMatchesCommunity(filter, ctx) {
10
+ if (filter.scope === "org" && filter.communityId !== void 0) ctx.addIssue({
11
+ code: "custom",
12
+ path: ["communityId"],
13
+ message: "`communityId` implies `scope=community`; it cannot go with `scope=org`"
14
+ });
15
+ if (filter.includeOrg === true && filter.communityId === void 0) ctx.addIssue({
16
+ code: "custom",
17
+ path: ["includeOrg"],
18
+ message: "`includeOrg` goes with `communityId`"
19
+ });
20
+ if (filter.includeOrg === true && filter.scope !== void 0) ctx.addIssue({
21
+ code: "custom",
22
+ path: ["includeOrg"],
23
+ message: "`includeOrg` cannot go with `scope`"
24
+ });
25
+ }
26
+ const notificationFilterShape = z.object({
27
+ scope: z.enum(["org", "community"]).optional().describe("`org`: the org list only; `community`: notifications in any community"),
28
+ communityId: z.string().min(1).max(64).optional().describe("Notifications in this community; implies `scope=community`"),
29
+ includeOrg: z.stringbool().optional().describe("With `communityId`, `true` adds the org list (notifications in no community); not with `scope`"),
30
+ category: commaSeparated(notificationCategoryKeySchema, "One or more category keys, comma separated").optional(),
31
+ reason: commaSeparated(reasonSchema, "One or more reasons, comma separated; matches any").optional(),
32
+ type: commaSeparated(notificationTypeKeySchema, "One or more types, comma separated").optional(),
33
+ unread: z.stringbool().optional().describe("`true` for unread notifications only")
34
+ }).strict();
35
+ const NotificationFilterQuery = notificationFilterShape.superRefine(scopeMatchesCommunity);
36
+ const NotificationListQuery = PageQuery.extend(notificationFilterShape.shape).strict().superRefine(scopeMatchesCommunity);
37
+ const NotificationItem = z.object({
38
+ type: subjectTypeSchema,
39
+ id: z.string(),
40
+ title: z.string().optional(),
41
+ excerpt: z.string().optional()
42
+ });
43
+ const NotificationView = z.object({
44
+ id: z.string(),
45
+ type: z.string(),
46
+ scope: notificationScopeSchema,
47
+ reasons: z.array(reasonSchema),
48
+ matchedReason: reasonSchema.describe("The reason of the pair the category matched, which picks the wording, such as a reply to your comment"),
49
+ category: z.string(),
50
+ display: z.record(z.string(), jsonValueSchema).describe("The text stored when the notification was sent"),
51
+ community: z.object({
52
+ id: z.string(),
53
+ title: z.string()
54
+ }).nullable(),
55
+ space: z.object({
56
+ id: z.string(),
57
+ name: z.string()
58
+ }).nullable(),
59
+ actor: z.object({
60
+ orgUserId: z.string(),
61
+ name: z.string().nullable(),
62
+ imageUrl: z.string().nullable()
63
+ }).nullable(),
64
+ subject: NotificationItem.nullable().describe("What the notification is about, with its current title or excerpt; null when you can no longer open it or it was deleted"),
65
+ parent: NotificationItem.nullable().describe("The subject's container, such as a comment's post; null when you can no longer open it or it was deleted"),
66
+ createdAt: z.coerce.date(),
67
+ readAt: z.coerce.date().nullable()
68
+ });
69
+ const NotificationsPage = paginated(NotificationView).extend({ unreadCount: z.number().int().describe("Unread notifications matching the same filters") });
70
+ const NotificationUnreadCounts = z.object({
71
+ org: z.number().int(),
72
+ communities: z.array(z.object({
73
+ communityId: z.string(),
74
+ unread: z.number().int()
75
+ }))
76
+ });
77
+ const NotificationCategory = notificationCategorySchema;
78
+ const NotificationCategoryList = z.object({
79
+ categories: z.array(NotificationCategory),
80
+ source: z.enum(["default", "stored"]).describe("`default` while the list in use is the server default, `stored` once one is saved")
81
+ });
82
+ const ReplaceNotificationCategories = z.object({ categories: notificationCategoryListSchema.describe("The whole ordered list; a notification is filed under the first category that matches") }).strict();
83
+ const NotificationCategoryDefaults = z.object({ categories: z.array(NotificationCategory) });
84
+ const NotificationListScopeQuery = z.object({ scope: z.enum(["org", "community"]) }).strict();
85
+ const NotificationTypeInfo = z.object({
86
+ type: z.string(),
87
+ scopes: z.array(notificationScopeSchema),
88
+ reasons: z.array(reasonSchema)
89
+ });
90
+ const NotificationTypeInfos = z.array(NotificationTypeInfo);
91
+ const NotificationChannelInfos = z.array(z.object({ channel: z.string() }));
92
+ const ResolvedChannel = z.object({
93
+ channel: z.string(),
94
+ enabled: z.boolean(),
95
+ default: z.boolean().describe("What the channel would be without your own setting at this level: what `enabled: null` gives"),
96
+ source: z.enum([
97
+ "locked",
98
+ "space",
99
+ "community",
100
+ "spaceDefault",
101
+ "default"
102
+ ]).describe("Why the channel is on or off: locked by the category, your setting for the space, your setting for the whole community (or the org), the default for the space, or the category default"),
103
+ locked: z.boolean()
104
+ });
105
+ const NotificationSettingsCategory = z.object({
106
+ key: z.string(),
107
+ perSpace: z.boolean(),
108
+ channels: z.array(ResolvedChannel),
109
+ spaces: z.array(z.object({
110
+ spaceId: z.string(),
111
+ name: z.string(),
112
+ channels: z.array(ResolvedChannel)
113
+ })).optional().describe("Per-space categories only: every space you can open")
114
+ });
115
+ const CommunityNotificationSettings = z.object({
116
+ communityId: z.string(),
117
+ digest: digestScheduleSchema.nullable().describe("The community's digest schedule; null when it sends no digest"),
118
+ categories: z.array(NotificationSettingsCategory)
119
+ });
120
+ const OrgNotificationSettings = z.object({ categories: z.array(NotificationSettingsCategory) });
121
+ const PatchNotificationSettings = z.object({ settings: z.array(z.object({
122
+ category: notificationCategoryKeySchema,
123
+ spaceId: z.string().min(1).max(64).optional(),
124
+ channel: notificationChannelKeySchema,
125
+ enabled: z.boolean().nullable().describe("null removes your choice, so the default applies again")
126
+ }).strict()).min(1).max(200) }).strict();
127
+ const DeviceFields = {
128
+ id: z.string(),
129
+ provider: z.enum([
130
+ "apns",
131
+ "fcm",
132
+ "webpush"
133
+ ]),
134
+ token: z.string(),
135
+ p256dh: z.string().nullable(),
136
+ auth: z.string().nullable(),
137
+ appId: z.string().nullable(),
138
+ environment: z.enum(["production", "sandbox"]).nullable()
139
+ };
140
+ const Device = z.object(DeviceFields);
141
+ const DeviceList = z.array(z.object({
142
+ ...DeviceFields,
143
+ lastSeenAt: z.coerce.date()
144
+ }));
145
+ const DeviceIdParam = z.object({ deviceId: z.string() });
146
+ const RegisterDevice = z.object({
147
+ provider: z.enum([
148
+ "apns",
149
+ "fcm",
150
+ "webpush"
151
+ ]),
152
+ token: z.string().min(1).max(4096).describe("The APNs device token, the FCM registration token, or the Web Push endpoint URL"),
153
+ keys: z.object({
154
+ p256dh: z.string().min(1).max(512),
155
+ auth: z.string().min(1).max(512)
156
+ }).strict().optional().describe("The Web Push subscription keys; webpush only"),
157
+ appId: z.string().min(1).max(255).optional().describe("The iOS bundle id or Android package name"),
158
+ environment: z.enum(["production", "sandbox"]).optional().describe("apns only")
159
+ }).strict();
160
+ const PushConfigView = z.object({ vapidPublicKey: z.string().nullable() });
161
+ //#endregion
162
+ export { CommunityNotificationSettings, Device, DeviceIdParam, DeviceList, NotificationCategory, NotificationCategoryDefaults, NotificationCategoryList, NotificationChannelInfos, NotificationFilterQuery, NotificationIdParam, NotificationListQuery, NotificationListScopeQuery, NotificationTypeInfo, NotificationTypeInfos, NotificationUnreadCounts, NotificationView, NotificationsPage, OrgNotificationSettings, PatchNotificationSettings, PushConfigView, RegisterDevice, ReplaceNotificationCategories };
163
+
164
+ //# sourceMappingURL=notifications.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notifications.js","names":[],"sources":["../../../src/http/schemas/notifications.ts"],"sourcesContent":["import { z } from 'zod';\nimport {\n digestScheduleSchema,\n jsonValueSchema,\n notificationCategoryKeySchema,\n notificationChannelKeySchema,\n notificationCategoryListSchema,\n notificationCategorySchema,\n notificationScopeSchema,\n notificationTypeKeySchema,\n reasonSchema,\n subjectTypeSchema,\n} from '@headless-lms/core/schemas';\nimport type {\n CommunityNotificationSettingsView as DomainCommunityNotificationSettingsView,\n NotificationUnreadCounts as DomainNotificationUnreadCounts,\n NotificationView as DomainNotificationView,\n} from '@headless-lms/core/reporting/member';\nimport { PageQuery, paginated, type Matches } from './shared.js';\n\nexport const NotificationIdParam = z.object({ notificationId: z.string() });\n\nfunction commaSeparated<T extends string>(item: z.ZodType<T, string>, description: string) {\n return z\n .string()\n .max(2000)\n .transform((value) =>\n value\n .split(',')\n .map((part) => part.trim())\n .filter((part) => part.length > 0),\n )\n .pipe(z.array(item).min(1).max(50))\n .describe(description);\n}\n\nfunction scopeMatchesCommunity(\n filter: { scope?: 'org' | 'community'; communityId?: string; includeOrg?: boolean },\n ctx: z.RefinementCtx,\n): void {\n if (filter.scope === 'org' && filter.communityId !== undefined) {\n ctx.addIssue({\n code: 'custom',\n path: ['communityId'],\n message: '`communityId` implies `scope=community`; it cannot go with `scope=org`',\n });\n }\n if (filter.includeOrg === true && filter.communityId === undefined) {\n ctx.addIssue({\n code: 'custom',\n path: ['includeOrg'],\n message: '`includeOrg` goes with `communityId`',\n });\n }\n if (filter.includeOrg === true && filter.scope !== undefined) {\n ctx.addIssue({\n code: 'custom',\n path: ['includeOrg'],\n message: '`includeOrg` cannot go with `scope`',\n });\n }\n}\n\nconst notificationFilterShape = z\n .object({\n scope: z\n .enum(['org', 'community'])\n .optional()\n .describe('`org`: the org list only; `community`: notifications in any community'),\n communityId: z\n .string()\n .min(1)\n .max(64)\n .optional()\n .describe('Notifications in this community; implies `scope=community`'),\n includeOrg: z\n .stringbool()\n .optional()\n .describe(\n 'With `communityId`, `true` adds the org list (notifications in no community); not with `scope`',\n ),\n category: commaSeparated(\n notificationCategoryKeySchema,\n 'One or more category keys, comma separated',\n ).optional(),\n reason: commaSeparated(\n reasonSchema,\n 'One or more reasons, comma separated; matches any',\n ).optional(),\n type: commaSeparated(\n notificationTypeKeySchema,\n 'One or more types, comma separated',\n ).optional(),\n unread: z.stringbool().optional().describe('`true` for unread notifications only'),\n })\n .strict();\n\nexport const NotificationFilterQuery = notificationFilterShape.superRefine(scopeMatchesCommunity);\n\nexport const NotificationListQuery = PageQuery.extend(notificationFilterShape.shape)\n .strict()\n .superRefine(scopeMatchesCommunity);\n\nconst NotificationItem = z.object({\n type: subjectTypeSchema,\n id: z.string(),\n title: z.string().optional(),\n excerpt: z.string().optional(),\n});\n\nexport const NotificationView = z.object({\n id: z.string(),\n type: z.string(),\n scope: notificationScopeSchema,\n reasons: z.array(reasonSchema),\n matchedReason: reasonSchema.describe(\n 'The reason of the pair the category matched, which picks the wording, such as a reply to your comment',\n ),\n category: z.string(),\n display: z\n .record(z.string(), jsonValueSchema)\n .describe('The text stored when the notification was sent'),\n community: z.object({ id: z.string(), title: z.string() }).nullable(),\n space: z.object({ id: z.string(), name: z.string() }).nullable(),\n actor: z\n .object({\n orgUserId: z.string(),\n name: z.string().nullable(),\n imageUrl: z.string().nullable(),\n })\n .nullable(),\n subject: NotificationItem.nullable().describe(\n 'What the notification is about, with its current title or excerpt; null when you can no longer open it or it was deleted',\n ),\n parent: NotificationItem.nullable().describe(\n \"The subject's container, such as a comment's post; null when you can no longer open it or it was deleted\",\n ),\n createdAt: z.coerce.date(),\n readAt: z.coerce.date().nullable(),\n});\ntype _NotificationViewMatches = Matches<DomainNotificationView, z.infer<typeof NotificationView>> &\n Matches<z.infer<typeof NotificationView>, DomainNotificationView>;\n\nexport const NotificationsPage = paginated(NotificationView).extend({\n unreadCount: z.number().int().describe('Unread notifications matching the same filters'),\n});\n\nexport const NotificationUnreadCounts = z.object({\n org: z.number().int(),\n communities: z.array(z.object({ communityId: z.string(), unread: z.number().int() })),\n});\ntype _NotificationUnreadCountsMatches = Matches<\n DomainNotificationUnreadCounts,\n z.infer<typeof NotificationUnreadCounts>\n>;\n\nexport const NotificationCategory = notificationCategorySchema;\n\nexport const NotificationCategoryList = z.object({\n categories: z.array(NotificationCategory),\n source: z\n .enum(['default', 'stored'])\n .describe('`default` while the list in use is the server default, `stored` once one is saved'),\n});\n\nexport const ReplaceNotificationCategories = z\n .object({\n categories: notificationCategoryListSchema.describe(\n 'The whole ordered list; a notification is filed under the first category that matches',\n ),\n })\n .strict();\n\nexport const NotificationCategoryDefaults = z.object({ categories: z.array(NotificationCategory) });\n\nexport const NotificationListScopeQuery = z\n .object({ scope: z.enum(['org', 'community']) })\n .strict();\n\nexport const NotificationTypeInfo = z.object({\n type: z.string(),\n scopes: z.array(notificationScopeSchema),\n reasons: z.array(reasonSchema),\n});\nexport const NotificationTypeInfos = z.array(NotificationTypeInfo);\n\nexport const NotificationChannelInfos = z.array(z.object({ channel: z.string() }));\n\nconst ResolvedChannel = z.object({\n channel: z.string(),\n enabled: z.boolean(),\n default: z\n .boolean()\n .describe(\n 'What the channel would be without your own setting at this level: what `enabled: null` gives',\n ),\n source: z\n .enum(['locked', 'space', 'community', 'spaceDefault', 'default'])\n .describe(\n 'Why the channel is on or off: locked by the category, your setting for the space, your setting for the whole community (or the org), the default for the space, or the category default',\n ),\n locked: z.boolean(),\n});\n\nconst NotificationSettingsCategory = z.object({\n key: z.string(),\n perSpace: z.boolean(),\n channels: z.array(ResolvedChannel),\n spaces: z\n .array(z.object({ spaceId: z.string(), name: z.string(), channels: z.array(ResolvedChannel) }))\n .optional()\n .describe('Per-space categories only: every space you can open'),\n});\n\nexport const CommunityNotificationSettings = z.object({\n communityId: z.string(),\n digest: digestScheduleSchema\n .nullable()\n .describe(\"The community's digest schedule; null when it sends no digest\"),\n categories: z.array(NotificationSettingsCategory),\n});\ntype _CommunityNotificationSettingsMatches = Matches<\n DomainCommunityNotificationSettingsView,\n z.infer<typeof CommunityNotificationSettings>\n>;\n\nexport const OrgNotificationSettings = z.object({\n categories: z.array(NotificationSettingsCategory),\n});\n\nexport const PatchNotificationSettings = z\n .object({\n settings: z\n .array(\n z\n .object({\n category: notificationCategoryKeySchema,\n spaceId: z.string().min(1).max(64).optional(),\n channel: notificationChannelKeySchema,\n enabled: z\n .boolean()\n .nullable()\n .describe('null removes your choice, so the default applies again'),\n })\n .strict(),\n )\n .min(1)\n .max(200),\n })\n .strict();\n\nconst DeviceFields = {\n id: z.string(),\n provider: z.enum(['apns', 'fcm', 'webpush']),\n token: z.string(),\n p256dh: z.string().nullable(),\n auth: z.string().nullable(),\n appId: z.string().nullable(),\n environment: z.enum(['production', 'sandbox']).nullable(),\n};\n\nexport const Device = z.object(DeviceFields);\nexport const DeviceList = z.array(z.object({ ...DeviceFields, lastSeenAt: z.coerce.date() }));\nexport const DeviceIdParam = z.object({ deviceId: z.string() });\n\nexport const RegisterDevice = z\n .object({\n provider: z.enum(['apns', 'fcm', 'webpush']),\n token: z\n .string()\n .min(1)\n .max(4096)\n .describe('The APNs device token, the FCM registration token, or the Web Push endpoint URL'),\n keys: z\n .object({ p256dh: z.string().min(1).max(512), auth: z.string().min(1).max(512) })\n .strict()\n .optional()\n .describe('The Web Push subscription keys; webpush only'),\n appId: z\n .string()\n .min(1)\n .max(255)\n .optional()\n .describe('The iOS bundle id or Android package name'),\n environment: z.enum(['production', 'sandbox']).optional().describe('apns only'),\n })\n .strict();\n\nexport const PushConfigView = z.object({ vapidPublicKey: z.string().nullable() });\n"],"mappings":";;;;AAoBA,MAAa,sBAAsB,EAAE,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,CAAC;AAE1E,SAAS,eAAiC,MAA4B,aAAqB;CACzF,OAAO,EACJ,OAAO,CAAC,CACR,IAAI,GAAI,CAAC,CACT,WAAW,UACV,MACG,MAAM,GAAG,CAAC,CACV,KAAK,SAAS,KAAK,KAAK,CAAC,CAAC,CAC1B,QAAQ,SAAS,KAAK,SAAS,CAAC,CACrC,CAAC,CACA,KAAK,EAAE,MAAM,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAClC,SAAS,WAAW;AACzB;AAEA,SAAS,sBACP,QACA,KACM;CACN,IAAI,OAAO,UAAU,SAAS,OAAO,gBAAgB,KAAA,GACnD,IAAI,SAAS;EACX,MAAM;EACN,MAAM,CAAC,aAAa;EACpB,SAAS;CACX,CAAC;CAEH,IAAI,OAAO,eAAe,QAAQ,OAAO,gBAAgB,KAAA,GACvD,IAAI,SAAS;EACX,MAAM;EACN,MAAM,CAAC,YAAY;EACnB,SAAS;CACX,CAAC;CAEH,IAAI,OA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ACJ,OAAO,CAAC,CACR,IAAI,CAAC,CAAC,CACN,IAAI,GAAG,CAAC,CACR,SAAS,CAAC,CACV,SAAS,2CAA2C;CACvD,aAAa,EAAE,KAAK,CAAC,cAAc,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,WAAW;AAChF,CAAC,CAAC,CACD,OAAO;AAEV,MAAa,iBAAiB,EAAE,OAAO,EAAE,gBAAgB,EAAE,OAAO,CAAC,CAAC,SAAS,EAAE,CAAC"}
@@ -0,0 +1,350 @@
1
+ import { z } from "zod";
2
+ //#region src/http/schemas/posts.d.ts
3
+ declare const PostView: z.ZodObject<{
4
+ orgId: z.ZodString;
5
+ id: z.ZodString;
6
+ communityId: z.ZodString;
7
+ spaceId: z.ZodString;
8
+ orgUserId: z.ZodString;
9
+ topicId: z.ZodNullable<z.ZodString>;
10
+ title: z.ZodString;
11
+ body: z.ZodString;
12
+ extra: z.ZodType<import("@headless-lms/core/types").JsonValue, unknown, z.core.$ZodTypeInternals<import("@headless-lms/core/types").JsonValue, unknown>>;
13
+ coverAssetId: z.ZodNullable<z.ZodString>;
14
+ status: z.ZodEnum<{
15
+ pending: "pending";
16
+ draft: "draft";
17
+ published: "published";
18
+ removed: "removed";
19
+ scheduled: "scheduled";
20
+ }>;
21
+ scheduledAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
22
+ publishedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
23
+ removedBy: z.ZodNullable<z.ZodString>;
24
+ pinned: z.ZodBoolean;
25
+ commentsClosed: z.ZodNullable<z.ZodBoolean>;
26
+ reactionsEnabled: z.ZodNullable<z.ZodBoolean>;
27
+ createdAt: z.ZodCoercedDate<unknown>;
28
+ updatedAt: z.ZodCoercedDate<unknown>;
29
+ coverUrl: z.ZodNullable<z.ZodString>;
30
+ author: z.ZodObject<{
31
+ id: z.ZodString;
32
+ firstName: z.ZodNullable<z.ZodString>;
33
+ lastName: z.ZodNullable<z.ZodString>;
34
+ displayName: z.ZodNullable<z.ZodString>;
35
+ headline: z.ZodNullable<z.ZodString>;
36
+ image: z.ZodNullable<z.ZodString>;
37
+ imageAssetId: z.ZodNullable<z.ZodString>;
38
+ imageUrl: z.ZodNullable<z.ZodString>;
39
+ role: z.ZodEnum<{
40
+ owner: "owner";
41
+ admin: "admin";
42
+ instructor: "instructor";
43
+ moderator: "moderator";
44
+ student: "student";
45
+ }>;
46
+ }, z.core.$strict>;
47
+ reactions: z.ZodRecord<z.ZodString, z.ZodNumber>;
48
+ viewerReaction: z.ZodNullable<z.ZodString>;
49
+ commentCount: z.ZodNumber;
50
+ subscription: z.ZodNullable<z.ZodObject<{
51
+ state: z.ZodEnum<{
52
+ following: "following";
53
+ muted: "muted";
54
+ }>;
55
+ mutedUntil: z.ZodNullable<z.ZodCoercedDate<unknown>>;
56
+ }, z.core.$strict>>;
57
+ bookmarked: z.ZodBoolean;
58
+ mentions: z.ZodArray<z.ZodObject<{
59
+ orgUserId: z.ZodString;
60
+ name: z.ZodString;
61
+ }, z.core.$strict>>;
62
+ }, z.core.$strict>;
63
+ declare const PostFlag: z.ZodObject<{
64
+ orgId: z.ZodString;
65
+ id: z.ZodString;
66
+ postId: z.ZodString;
67
+ orgUserId: z.ZodString;
68
+ reason: z.ZodString;
69
+ resolvedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
70
+ resolution: z.ZodNullable<z.ZodEnum<{
71
+ dismissed: "dismissed";
72
+ removed: "removed";
73
+ }>>;
74
+ resolvedBy: z.ZodNullable<z.ZodString>;
75
+ createdAt: z.ZodCoercedDate<unknown>;
76
+ updatedAt: z.ZodCoercedDate<unknown>;
77
+ }, z.core.$strict>;
78
+ declare const PostFeedPage: z.ZodObject<{
79
+ rows: z.ZodArray<z.ZodObject<{
80
+ orgId: z.ZodString;
81
+ id: z.ZodString;
82
+ communityId: z.ZodString;
83
+ spaceId: z.ZodString;
84
+ orgUserId: z.ZodString;
85
+ topicId: z.ZodNullable<z.ZodString>;
86
+ title: z.ZodString;
87
+ body: z.ZodString;
88
+ extra: z.ZodType<import("@headless-lms/core/types").JsonValue, unknown, z.core.$ZodTypeInternals<import("@headless-lms/core/types").JsonValue, unknown>>;
89
+ coverAssetId: z.ZodNullable<z.ZodString>;
90
+ status: z.ZodEnum<{
91
+ pending: "pending";
92
+ draft: "draft";
93
+ published: "published";
94
+ removed: "removed";
95
+ scheduled: "scheduled";
96
+ }>;
97
+ scheduledAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
98
+ publishedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
99
+ removedBy: z.ZodNullable<z.ZodString>;
100
+ pinned: z.ZodBoolean;
101
+ commentsClosed: z.ZodNullable<z.ZodBoolean>;
102
+ reactionsEnabled: z.ZodNullable<z.ZodBoolean>;
103
+ createdAt: z.ZodCoercedDate<unknown>;
104
+ updatedAt: z.ZodCoercedDate<unknown>;
105
+ coverUrl: z.ZodNullable<z.ZodString>;
106
+ author: z.ZodObject<{
107
+ id: z.ZodString;
108
+ firstName: z.ZodNullable<z.ZodString>;
109
+ lastName: z.ZodNullable<z.ZodString>;
110
+ displayName: z.ZodNullable<z.ZodString>;
111
+ headline: z.ZodNullable<z.ZodString>;
112
+ image: z.ZodNullable<z.ZodString>;
113
+ imageAssetId: z.ZodNullable<z.ZodString>;
114
+ imageUrl: z.ZodNullable<z.ZodString>;
115
+ role: z.ZodEnum<{
116
+ owner: "owner";
117
+ admin: "admin";
118
+ instructor: "instructor";
119
+ moderator: "moderator";
120
+ student: "student";
121
+ }>;
122
+ }, z.core.$strict>;
123
+ reactions: z.ZodRecord<z.ZodString, z.ZodNumber>;
124
+ viewerReaction: z.ZodNullable<z.ZodString>;
125
+ commentCount: z.ZodNumber;
126
+ subscription: z.ZodNullable<z.ZodObject<{
127
+ state: z.ZodEnum<{
128
+ following: "following";
129
+ muted: "muted";
130
+ }>;
131
+ mutedUntil: z.ZodNullable<z.ZodCoercedDate<unknown>>;
132
+ }, z.core.$strict>>;
133
+ bookmarked: z.ZodBoolean;
134
+ mentions: z.ZodArray<z.ZodObject<{
135
+ orgUserId: z.ZodString;
136
+ name: z.ZodString;
137
+ }, z.core.$strict>>;
138
+ }, z.core.$strict>>;
139
+ total: z.ZodNumber;
140
+ page: z.ZodNumber;
141
+ pageSize: z.ZodNumber;
142
+ }, z.core.$strip>;
143
+ declare const PostIdParam: z.ZodObject<{
144
+ postId: z.ZodString;
145
+ }, z.core.$strip>;
146
+ declare const FeedQuery: z.ZodObject<{
147
+ page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
148
+ pageSize: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
149
+ topicId: z.ZodOptional<z.ZodString>;
150
+ }, z.core.$strict>;
151
+ declare const CreatePost: z.ZodObject<{
152
+ title: z.ZodString;
153
+ body: z.ZodString;
154
+ topicId: z.ZodNullable<z.ZodString>;
155
+ extra: z.ZodDefault<z.ZodType<import("@headless-lms/core/types").JsonValue, unknown, z.core.$ZodTypeInternals<import("@headless-lms/core/types").JsonValue, unknown>>>;
156
+ coverAssetId: z.ZodNullable<z.ZodString>;
157
+ mode: z.ZodEnum<{
158
+ draft: "draft";
159
+ submit: "submit";
160
+ schedule: "schedule";
161
+ }>;
162
+ scheduledAt: z.ZodNullable<z.ZodPipe<z.ZodISODateTime, z.ZodCoercedDate<string>>>;
163
+ }, z.core.$strict>;
164
+ declare const UpdatePost: z.ZodObject<{
165
+ title: z.ZodOptional<z.ZodString>;
166
+ body: z.ZodOptional<z.ZodString>;
167
+ topicId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
168
+ extra: z.ZodOptional<z.ZodType<import("@headless-lms/core/types").JsonValue, unknown, z.core.$ZodTypeInternals<import("@headless-lms/core/types").JsonValue, unknown>>>;
169
+ coverAssetId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
170
+ }, z.core.$strict>;
171
+ declare const SchedulePost: z.ZodObject<{
172
+ scheduledAt: z.ZodPipe<z.ZodISODateTime, z.ZodCoercedDate<string>>;
173
+ }, z.core.$strict>;
174
+ declare const SetPostReactions: z.ZodObject<{
175
+ enabled: z.ZodBoolean;
176
+ }, z.core.$strict>;
177
+ declare const FlagReason: z.ZodObject<{
178
+ reason: z.ZodString;
179
+ }, z.core.$strict>;
180
+ declare const ResolvePostFlags: z.ZodObject<{
181
+ resolution: z.ZodEnum<{
182
+ dismissed: "dismissed";
183
+ }>;
184
+ }, z.core.$strict>;
185
+ declare const SpaceQueue: z.ZodObject<{
186
+ pending: z.ZodArray<z.ZodObject<{
187
+ orgId: z.ZodString;
188
+ id: z.ZodString;
189
+ communityId: z.ZodString;
190
+ spaceId: z.ZodString;
191
+ orgUserId: z.ZodString;
192
+ topicId: z.ZodNullable<z.ZodString>;
193
+ title: z.ZodString;
194
+ body: z.ZodString;
195
+ extra: z.ZodType<import("@headless-lms/core/types").JsonValue, unknown, z.core.$ZodTypeInternals<import("@headless-lms/core/types").JsonValue, unknown>>;
196
+ coverAssetId: z.ZodNullable<z.ZodString>;
197
+ status: z.ZodEnum<{
198
+ pending: "pending";
199
+ draft: "draft";
200
+ published: "published";
201
+ removed: "removed";
202
+ scheduled: "scheduled";
203
+ }>;
204
+ scheduledAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
205
+ publishedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
206
+ removedBy: z.ZodNullable<z.ZodString>;
207
+ pinned: z.ZodBoolean;
208
+ commentsClosed: z.ZodNullable<z.ZodBoolean>;
209
+ reactionsEnabled: z.ZodNullable<z.ZodBoolean>;
210
+ createdAt: z.ZodCoercedDate<unknown>;
211
+ updatedAt: z.ZodCoercedDate<unknown>;
212
+ coverUrl: z.ZodNullable<z.ZodString>;
213
+ author: z.ZodObject<{
214
+ id: z.ZodString;
215
+ firstName: z.ZodNullable<z.ZodString>;
216
+ lastName: z.ZodNullable<z.ZodString>;
217
+ displayName: z.ZodNullable<z.ZodString>;
218
+ headline: z.ZodNullable<z.ZodString>;
219
+ image: z.ZodNullable<z.ZodString>;
220
+ imageAssetId: z.ZodNullable<z.ZodString>;
221
+ imageUrl: z.ZodNullable<z.ZodString>;
222
+ role: z.ZodEnum<{
223
+ owner: "owner";
224
+ admin: "admin";
225
+ instructor: "instructor";
226
+ moderator: "moderator";
227
+ student: "student";
228
+ }>;
229
+ }, z.core.$strict>;
230
+ reactions: z.ZodRecord<z.ZodString, z.ZodNumber>;
231
+ viewerReaction: z.ZodNullable<z.ZodString>;
232
+ commentCount: z.ZodNumber;
233
+ subscription: z.ZodNullable<z.ZodObject<{
234
+ state: z.ZodEnum<{
235
+ following: "following";
236
+ muted: "muted";
237
+ }>;
238
+ mutedUntil: z.ZodNullable<z.ZodCoercedDate<unknown>>;
239
+ }, z.core.$strict>>;
240
+ bookmarked: z.ZodBoolean;
241
+ mentions: z.ZodArray<z.ZodObject<{
242
+ orgUserId: z.ZodString;
243
+ name: z.ZodString;
244
+ }, z.core.$strict>>;
245
+ }, z.core.$strict>>;
246
+ flags: z.ZodArray<z.ZodObject<{
247
+ orgId: z.ZodString;
248
+ id: z.ZodString;
249
+ postId: z.ZodString;
250
+ orgUserId: z.ZodString;
251
+ reason: z.ZodString;
252
+ resolvedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
253
+ resolution: z.ZodNullable<z.ZodEnum<{
254
+ dismissed: "dismissed";
255
+ removed: "removed";
256
+ }>>;
257
+ resolvedBy: z.ZodNullable<z.ZodString>;
258
+ createdAt: z.ZodCoercedDate<unknown>;
259
+ updatedAt: z.ZodCoercedDate<unknown>;
260
+ }, z.core.$strict>>;
261
+ commentFlags: z.ZodArray<z.ZodObject<{
262
+ id: z.ZodString;
263
+ orgId: z.ZodString;
264
+ commentId: z.ZodString;
265
+ orgUserId: z.ZodString;
266
+ reason: z.ZodString;
267
+ resolvedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
268
+ resolution: z.ZodNullable<z.ZodEnum<{
269
+ dismissed: "dismissed";
270
+ removed: "removed";
271
+ }>>;
272
+ resolvedBy: z.ZodNullable<z.ZodString>;
273
+ createdAt: z.ZodCoercedDate<unknown>;
274
+ updatedAt: z.ZodCoercedDate<unknown>;
275
+ comment: z.ZodObject<{
276
+ id: z.ZodString;
277
+ postId: z.ZodString;
278
+ body: z.ZodString;
279
+ orgUserId: z.ZodString;
280
+ status: z.ZodEnum<{
281
+ pending: "pending";
282
+ published: "published";
283
+ removed: "removed";
284
+ }>;
285
+ }, z.core.$strict>;
286
+ }, z.core.$strict>>;
287
+ }, z.core.$strip>;
288
+ declare const PostCommentsPage: z.ZodObject<{
289
+ rows: z.ZodArray<z.ZodObject<{
290
+ id: z.ZodString;
291
+ activityId: z.ZodNullable<z.ZodString>;
292
+ postId: z.ZodNullable<z.ZodString>;
293
+ communityId: z.ZodNullable<z.ZodString>;
294
+ parentId: z.ZodNullable<z.ZodString>;
295
+ author: z.ZodObject<{
296
+ id: z.ZodString;
297
+ firstName: z.ZodNullable<z.ZodString>;
298
+ lastName: z.ZodNullable<z.ZodString>;
299
+ displayName: z.ZodNullable<z.ZodString>;
300
+ headline: z.ZodNullable<z.ZodString>;
301
+ image: z.ZodNullable<z.ZodString>;
302
+ imageAssetId: z.ZodNullable<z.ZodString>;
303
+ imageUrl: z.ZodNullable<z.ZodString>;
304
+ role: z.ZodEnum<{
305
+ owner: "owner";
306
+ admin: "admin";
307
+ instructor: "instructor";
308
+ moderator: "moderator";
309
+ student: "student";
310
+ }>;
311
+ }, z.core.$strict>;
312
+ body: z.ZodNullable<z.ZodString>;
313
+ status: z.ZodEnum<{
314
+ pending: "pending";
315
+ published: "published";
316
+ removed: "removed";
317
+ }>;
318
+ removedBy: z.ZodNullable<z.ZodObject<{
319
+ id: z.ZodString;
320
+ firstName: z.ZodNullable<z.ZodString>;
321
+ lastName: z.ZodNullable<z.ZodString>;
322
+ displayName: z.ZodNullable<z.ZodString>;
323
+ headline: z.ZodNullable<z.ZodString>;
324
+ image: z.ZodNullable<z.ZodString>;
325
+ imageAssetId: z.ZodNullable<z.ZodString>;
326
+ imageUrl: z.ZodNullable<z.ZodString>;
327
+ role: z.ZodEnum<{
328
+ owner: "owner";
329
+ admin: "admin";
330
+ instructor: "instructor";
331
+ moderator: "moderator";
332
+ student: "student";
333
+ }>;
334
+ }, z.core.$strict>>;
335
+ reactions: z.ZodRecord<z.ZodString, z.ZodNumber>;
336
+ viewerReaction: z.ZodOptional<z.ZodString>;
337
+ mentions: z.ZodArray<z.ZodObject<{
338
+ orgUserId: z.ZodString;
339
+ name: z.ZodString;
340
+ }, z.core.$strict>>;
341
+ createdAt: z.ZodCoercedDate<unknown>;
342
+ updatedAt: z.ZodCoercedDate<unknown>;
343
+ }, z.core.$strict>>;
344
+ total: z.ZodNumber;
345
+ page: z.ZodNumber;
346
+ pageSize: z.ZodNumber;
347
+ }, z.core.$strip>;
348
+ //#endregion
349
+ export { CreatePost, FeedQuery, FlagReason, PostCommentsPage, PostFeedPage, PostFlag, PostIdParam, PostView, ResolvePostFlags, SchedulePost, SetPostReactions, SpaceQueue, UpdatePost };
350
+ //# sourceMappingURL=posts.d.ts.map
@@ -0,0 +1,47 @@
1
+ import { DateTimeInput, PageQuery, paginated } from "./shared.js";
2
+ import { CommentView } from "./discussion.js";
3
+ import { z } from "zod";
4
+ import { boundedJsonSchema, flaggedCommentSchema, idSchema, postFlagResolutionSchema, postFlagSchema, postViewSchema } from "@headless-lms/core/schemas";
5
+ //#region src/http/schemas/posts.ts
6
+ const PostView = postViewSchema;
7
+ const PostFlag = postFlagSchema;
8
+ const PostFeedPage = paginated(PostView);
9
+ const PostIdParam = z.object({ postId: z.string() });
10
+ const FeedQuery = PageQuery.extend({ topicId: z.string().optional().describe("Only posts under this topic") }).strict();
11
+ const PostTitle = z.string().trim().min(1).max(200);
12
+ const PostBody = z.string().max(5e4);
13
+ const PostExtra = boundedJsonSchema(16 * 1024);
14
+ const CreatePost = z.object({
15
+ title: PostTitle,
16
+ body: PostBody,
17
+ topicId: idSchema.nullable().describe("One of the space's topics. Required when the space has topics, else null"),
18
+ extra: PostExtra.default({}),
19
+ coverAssetId: idSchema.nullable().describe("A finalized image you uploaded through `requestMemberUpload`"),
20
+ mode: z.enum([
21
+ "draft",
22
+ "submit",
23
+ "schedule"
24
+ ]).describe("`draft` keeps the post to yourself. `submit` publishes it, or holds it for review when the space requires review and you are not staff. `schedule` submits it at `scheduledAt`."),
25
+ scheduledAt: DateTimeInput.nullable().describe("When a scheduled post is submitted. Required, and in the future, when `mode` is `schedule`; ignored otherwise.")
26
+ }).strict();
27
+ const UpdatePost = z.object({
28
+ title: PostTitle.optional(),
29
+ body: PostBody.optional(),
30
+ topicId: idSchema.nullable().optional(),
31
+ extra: PostExtra.optional(),
32
+ coverAssetId: idSchema.nullable().optional()
33
+ }).strict();
34
+ const SchedulePost = z.object({ scheduledAt: DateTimeInput.describe("When the post is submitted; must be in the future") }).strict();
35
+ const SetPostReactions = z.object({ enabled: z.boolean().describe("Whether readers may react to this post") }).strict();
36
+ const FlagReason = z.object({ reason: z.string().trim().min(1).max(1e3) }).strict();
37
+ const ResolvePostFlags = z.object({ resolution: postFlagResolutionSchema.extract(["dismissed"]).describe("`dismissed` closes the open flags and leaves the post up. Removing the post resolves its flags as `removed` instead.") }).strict();
38
+ const SpaceQueue = z.object({
39
+ pending: z.array(PostView),
40
+ flags: z.array(PostFlag),
41
+ commentFlags: z.array(flaggedCommentSchema)
42
+ });
43
+ const PostCommentsPage = paginated(CommentView);
44
+ //#endregion
45
+ export { CreatePost, FeedQuery, FlagReason, PostCommentsPage, PostFeedPage, PostFlag, PostIdParam, PostView, ResolvePostFlags, SchedulePost, SetPostReactions, SpaceQueue, UpdatePost };
46
+
47
+ //# sourceMappingURL=posts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"posts.js","names":[],"sources":["../../../src/http/schemas/posts.ts"],"sourcesContent":["import { z } from 'zod';\nimport {\n boundedJsonSchema,\n flaggedCommentSchema,\n idSchema,\n postFlagResolutionSchema,\n postFlagSchema,\n postViewSchema,\n} from '@headless-lms/core/schemas';\nimport { CommentView } from './discussion.js';\nimport { DateTimeInput, PageQuery, paginated } from './shared.js';\n\nexport const PostView = postViewSchema;\nexport const PostFlag = postFlagSchema;\nexport const PostFeedPage = paginated(PostView);\nexport const PostIdParam = z.object({ postId: z.string() });\nexport const FeedQuery = PageQuery.extend({\n topicId: z.string().optional().describe('Only posts under this topic'),\n}).strict();\n\nconst PostTitle = z.string().trim().min(1).max(200);\nconst PostBody = z.string().max(50_000);\nconst PostExtra = boundedJsonSchema(16 * 1024);\n\nexport const CreatePost = z\n .object({\n title: PostTitle,\n body: PostBody,\n topicId: idSchema\n .nullable()\n .describe(\"One of the space's topics. Required when the space has topics, else null\"),\n extra: PostExtra.default({}),\n coverAssetId: idSchema\n .nullable()\n .describe('A finalized image you uploaded through `requestMemberUpload`'),\n mode: z\n .enum(['draft', 'submit', 'schedule'])\n .describe(\n '`draft` keeps the post to yourself. `submit` publishes it, or holds it for review when the space requires review and you are not staff. `schedule` submits it at `scheduledAt`.',\n ),\n scheduledAt: DateTimeInput.nullable().describe(\n 'When a scheduled post is submitted. Required, and in the future, when `mode` is `schedule`; ignored otherwise.',\n ),\n })\n .strict();\n\nexport const UpdatePost = z\n .object({\n title: PostTitle.optional(),\n body: PostBody.optional(),\n topicId: idSchema.nullable().optional(),\n extra: PostExtra.optional(),\n coverAssetId: idSchema.nullable().optional(),\n })\n .strict();\n\nexport const SchedulePost = z\n .object({\n scheduledAt: DateTimeInput.describe('When the post is submitted; must be in the future'),\n })\n .strict();\nexport const SetPostReactions = z\n .object({ enabled: z.boolean().describe('Whether readers may react to this post') })\n .strict();\nexport const FlagReason = z.object({ reason: z.string().trim().min(1).max(1_000) }).strict();\nexport const ResolvePostFlags = z\n .object({\n resolution: postFlagResolutionSchema\n .extract(['dismissed'])\n .describe(\n '`dismissed` closes the open flags and leaves the post up. Removing the post resolves its flags as `removed` instead.',\n ),\n })\n .strict();\n\nexport const SpaceQueue = z.object({\n pending: z.array(PostView),\n flags: z.array(PostFlag),\n commentFlags: z.array(fla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SAAS,wCAAwC,EAAE,CAAC,CAAC,CACnF,OAAO;AACV,MAAa,aAAa,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAK,EAAE,CAAC,CAAC,CAAC,OAAO;AAC3F,MAAa,mBAAmB,EAC7B,OAAO,EACN,YAAY,yBACT,QAAQ,CAAC,WAAW,CAAC,CAAC,CACtB,SACC,sHACF,EACJ,CAAC,CAAC,CACD,OAAO;AAEV,MAAa,aAAa,EAAE,OAAO;CACjC,SAAS,EAAE,MAAM,QAAQ;CACzB,OAAO,EAAE,MAAM,QAAQ;CACvB,cAAc,EAAE,MAAM,oBAAoB;AAC5C,CAAC;AAED,MAAa,mBAAmB,UAAU,WAAW"}
@@ -0,0 +1,23 @@
1
+ import { z } from "zod";
2
+ //#region src/http/schemas/profile.d.ts
3
+ declare const UserProfile: z.ZodObject<{
4
+ createdAt: z.ZodCoercedDate<unknown>;
5
+ updatedAt: z.ZodCoercedDate<unknown>;
6
+ imageUrl: z.ZodNullable<z.ZodString>;
7
+ displayName: z.ZodNullable<z.ZodString>;
8
+ headline: z.ZodNullable<z.ZodString>;
9
+ imageAssetId: z.ZodNullable<z.ZodString>;
10
+ bio: z.ZodNullable<z.ZodString>;
11
+ extra: z.ZodType<import("@headless-lms/core/types").JsonValue, unknown, z.core.$ZodTypeInternals<import("@headless-lms/core/types").JsonValue, unknown>>;
12
+ userId: z.ZodString;
13
+ }, z.core.$strip>;
14
+ declare const UpdateProfile: z.ZodObject<{
15
+ displayName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
16
+ headline: z.ZodOptional<z.ZodNullable<z.ZodString>>;
17
+ bio: z.ZodOptional<z.ZodNullable<z.ZodString>>;
18
+ imageAssetId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
19
+ extra: z.ZodOptional<z.ZodType<import("@headless-lms/core/types").JsonValue, unknown, z.core.$ZodTypeInternals<import("@headless-lms/core/types").JsonValue, unknown>>>;
20
+ }, z.core.$strict>;
21
+ //#endregion
22
+ export { UpdateProfile, UserProfile };
23
+ //# sourceMappingURL=profile.d.ts.map
@@ -0,0 +1,15 @@
1
+ import { z } from "zod";
2
+ import { boundedJsonSchema, idSchema, userProfileViewSchema } from "@headless-lms/core/schemas";
3
+ //#region src/http/schemas/profile.ts
4
+ const UserProfile = userProfileViewSchema.omit({ imageAssetOrgId: true }).strip();
5
+ const UpdateProfile = z.object({
6
+ displayName: z.string().trim().max(80).nullable().optional(),
7
+ headline: z.string().trim().max(160).nullable().optional(),
8
+ bio: z.string().trim().max(2e3).nullable().optional(),
9
+ imageAssetId: idSchema.nullable().optional().describe("A finalized image you uploaded through `requestMemberUpload`; null clears it"),
10
+ extra: boundedJsonSchema(16 * 1024).optional()
11
+ }).strict();
12
+ //#endregion
13
+ export { UpdateProfile, UserProfile };
14
+
15
+ //# sourceMappingURL=profile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profile.js","names":[],"sources":["../../../src/http/schemas/profile.ts"],"sourcesContent":["import { z } from 'zod';\nimport { boundedJsonSchema, idSchema, userProfileViewSchema } from '@headless-lms/core/schemas';\n\nexport const UserProfile = userProfileViewSchema.omit({ imageAssetOrgId: true }).strip();\nexport const UpdateProfile = z\n .object({\n displayName: z.string().trim().max(80).nullable().optional(),\n headline: z.string().trim().max(160).nullable().optional(),\n bio: z.string().trim().max(2_000).nullable().optional(),\n imageAssetId: idSchema\n .nullable()\n .optional()\n .describe('A finalized image you uploaded through `requestMemberUpload`; null clears it'),\n extra: boundedJsonSchema(16 * 1024).optional(),\n })\n .strict();\n"],"mappings":";;;AAGA,MAAa,cAAc,sBAAsB,KAAK,EAAE,iBAAiB,KAAK,CAAC,CAAC,CAAC,MAAM;AACvF,MAAa,gBAAgB,EAC1B,OAAO;CACN,aAAa,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CAC3D,UAAU,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CACzD,KAAK,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,GAAK,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CACtD,cAAc,SACX,SAAS,CAAC,CACV,SAAS,CAAC,CACV,SAAS,8EAA8E;CAC1F,OAAO,kBAAkB,KAAK,IAAI,CAAC,CAAC,SAAS;AAC/C,CAAC,CAAC,CACD,OAAO"}