@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
package/README.md CHANGED
@@ -23,7 +23,7 @@ Public surface (`src/index.ts`): `createContainer`, `buildServer`,
23
23
  `@headless-lms/adapter-db`, which ships the `drizzle/` migration assets;
24
24
  `@headless-lms/cli` wraps it as `headless-lms migrate`), and the types
25
25
  installations need (`ServerConfig`, `Container`, `AdapterOverrides`, shared ports
26
- like `EmailSender` / `ObjectStorage`). Everything else is internal.
26
+ like `EmailSender` / `ObjectStorage` / `WebhookSender`). Everything else is internal.
27
27
 
28
28
  ## Layout
29
29
 
@@ -0,0 +1,5 @@
1
+ import { createRequire } from "node:module";
2
+ //#region \0rolldown/runtime.js
3
+ var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
4
+ //#endregion
5
+ export { __require };
@@ -0,0 +1,26 @@
1
+ import { ContentService } from "@headless-lms/core/content";
2
+ import { EntitlementsService } from "@headless-lms/core/entitlements";
3
+ import { ChatService, DiscussionService, PostService } from "@headless-lms/core/discussion";
4
+ import { IdentityService } from "@headless-lms/core/identity";
5
+ import { OrganizationService } from "@headless-lms/core/organizations";
6
+ import { AssetsService } from "@headless-lms/core/assets";
7
+ import { CommunityMailReads, GrantWriter, ScheduledWork } from "@headless-lms/core/automations";
8
+ //#region src/app/community-mail.d.ts
9
+ type CommunityMailDeps = {
10
+ content: Pick<ContentService, 'getCommunity' | 'getSpace' | 'listCommunitiesById'>;
11
+ entitlements: Pick<EntitlementsService, 'openSpacesFor' | 'communitiesOpenedBy' | 'communityMembersAmong' | 'spaceOpenersAmong' | 'spaceOpeners' | 'communityModeratorIds' | 'countActiveSpaceMembers' | 'communityIdsOpenedFor' | 'ensureGrant' | 'expireDue' | 'hasDueNotices'>;
12
+ organizations: Pick<OrganizationService, 'getOrgUserById' | 'staffOrgUserIds'>;
13
+ identity: Pick<IdentityService, 'displayName'>;
14
+ posts: Pick<PostService, 'followerIds' | 'find' | 'publishDue' | 'hasDue'>;
15
+ discussion: Pick<DiscussionService, 'getComment' | 'sendDigest'>;
16
+ chats: Pick<ChatService, 'chatSummary' | 'latestMessageBody' | 'isBlocked'>;
17
+ assets: Pick<AssetsService, 'removeUnattached' | 'hasUnattached'>;
18
+ };
19
+ declare function communityMail(deps: CommunityMailDeps): {
20
+ mail: Omit<CommunityMailReads, 'recentMessageRecipients'>;
21
+ grants: GrantWriter;
22
+ scheduledWork: ScheduledWork;
23
+ };
24
+ //#endregion
25
+ export { CommunityMailDeps, communityMail };
26
+ //# sourceMappingURL=community-mail.d.ts.map
@@ -0,0 +1,96 @@
1
+ //#region src/app/community-mail.ts
2
+ function communityMail(deps) {
3
+ return {
4
+ mail: {
5
+ async communityTitle(orgId, communityId) {
6
+ return (await deps.content.getCommunity(orgId, communityId))?.title ?? null;
7
+ },
8
+ async space(orgId, spaceId) {
9
+ const space = await deps.content.getSpace(orgId, spaceId);
10
+ return space ? {
11
+ name: space.name,
12
+ communityId: space.communityId,
13
+ capacity: space.capacity
14
+ } : null;
15
+ },
16
+ async openSpaceNames(orgId, orgUserId, communityId) {
17
+ const orgUser = await deps.organizations.getOrgUserById(orgId, orgUserId);
18
+ if (!orgUser) return [];
19
+ return (await deps.entitlements.openSpacesFor(orgId, {
20
+ id: orgUser.id,
21
+ role: orgUser.role
22
+ }, communityId)).map((space) => space.name);
23
+ },
24
+ communitiesOpenedBy: (orgId, grant) => deps.entitlements.communitiesOpenedBy(orgId, grant),
25
+ communityMembersAmong: (orgId, communityId, ids) => deps.entitlements.communityMembersAmong(orgId, communityId, ids),
26
+ spaceOpenersAmong: (orgId, spaceId, ids) => deps.entitlements.spaceOpenersAmong(orgId, spaceId, ids),
27
+ spaceOpeners: (orgId, spaceId) => deps.entitlements.spaceOpeners(orgId, spaceId),
28
+ moderationAudience: (orgId, communityId) => deps.entitlements.communityModeratorIds(orgId, communityId),
29
+ staffIds: (orgId) => deps.organizations.staffOrgUserIds(orgId),
30
+ async displayName(orgId, orgUserId) {
31
+ const orgUser = await deps.organizations.getOrgUserById(orgId, orgUserId);
32
+ return deps.identity.displayName(orgUser?.userId ?? null);
33
+ },
34
+ followerIds: (orgId, postId) => deps.posts.followerIds(orgId, postId),
35
+ async comment(orgId, commentId) {
36
+ const comment = await deps.discussion.getComment(orgId, commentId);
37
+ return comment ? {
38
+ orgUserId: comment.orgUserId,
39
+ postId: comment.postId,
40
+ body: comment.body
41
+ } : null;
42
+ },
43
+ async post(orgId, postId) {
44
+ const post = await deps.posts.find(orgId, postId);
45
+ return post ? {
46
+ title: post.title,
47
+ body: post.body,
48
+ spaceId: post.spaceId,
49
+ orgUserId: post.orgUserId,
50
+ communityId: post.communityId
51
+ } : null;
52
+ },
53
+ async chat(orgId, chatId) {
54
+ const summary = await deps.chats.chatSummary(orgId, chatId);
55
+ return summary ? {
56
+ communityId: summary.chat.communityId,
57
+ kind: summary.chat.kind,
58
+ status: summary.chat.status,
59
+ createdBy: summary.chat.createdBy,
60
+ participants: summary.participants.map((participant) => ({
61
+ orgUserId: participant.orgUserId,
62
+ muted: participant.muted,
63
+ mutedUntil: participant.mutedUntil,
64
+ leftAt: participant.leftAt
65
+ }))
66
+ } : null;
67
+ },
68
+ latestMessageBody: (orgId, chatId) => deps.chats.latestMessageBody(orgId, chatId),
69
+ pairBlocked: (orgId, communityId, a, b) => deps.chats.isBlocked(orgId, communityId, a, b),
70
+ activeMemberCount: (orgId, spaceId) => deps.entitlements.countActiveSpaceMembers(orgId, spaceId),
71
+ async memberCommunityTitles(orgId, orgUserId) {
72
+ const ids = await deps.entitlements.communityIdsOpenedFor(orgId, orgUserId);
73
+ return (await deps.content.listCommunitiesById(orgId, ids)).map((community) => ({
74
+ id: community.id,
75
+ title: community.title
76
+ }));
77
+ }
78
+ },
79
+ grants: { grant: (orgId, input) => deps.entitlements.ensureGrant(orgId, input) },
80
+ scheduledWork: {
81
+ publishDuePosts: (orgId, now) => deps.posts.publishDue(orgId, now),
82
+ hasDuePosts: (orgId, now) => deps.posts.hasDue(orgId, now),
83
+ expireDueGrants: (orgId, now) => deps.entitlements.expireDue(orgId, now),
84
+ hasDueGrants: (orgId, now) => deps.entitlements.hasDueNotices(orgId, now),
85
+ sendDigest: (orgId, now) => deps.discussion.sendDigest(orgId, now),
86
+ removeUnattachedUploads: async (orgId, now) => {
87
+ await deps.assets.removeUnattached(orgId, now);
88
+ },
89
+ hasUnattachedUploads: (orgId, now) => deps.assets.hasUnattached(orgId, now)
90
+ }
91
+ };
92
+ }
93
+ //#endregion
94
+ export { communityMail };
95
+
96
+ //# sourceMappingURL=community-mail.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"community-mail.js","names":[],"sources":["../../src/app/community-mail.ts"],"sourcesContent":["import type { AssetsService } from '@headless-lms/core/assets';\nimport type {\n CommunityMailReads,\n GrantWriter,\n ScheduledWork,\n} from '@headless-lms/core/automations';\nimport type { ContentService } from '@headless-lms/core/content';\nimport type { ChatService, DiscussionService, PostService } from '@headless-lms/core/discussion';\nimport type { EntitlementsService } from '@headless-lms/core/entitlements';\nimport type { IdentityService } from '@headless-lms/core/identity';\nimport type { OrganizationService } from '@headless-lms/core/organizations';\n\nexport type CommunityMailDeps = {\n content: Pick<ContentService, 'getCommunity' | 'getSpace' | 'listCommunitiesById'>;\n entitlements: Pick<\n EntitlementsService,\n | 'openSpacesFor'\n | 'communitiesOpenedBy'\n | 'communityMembersAmong'\n | 'spaceOpenersAmong'\n | 'spaceOpeners'\n | 'communityModeratorIds'\n | 'countActiveSpaceMembers'\n | 'communityIdsOpenedFor'\n | 'ensureGrant'\n | 'expireDue'\n | 'hasDueNotices'\n >;\n organizations: Pick<OrganizationService, 'getOrgUserById' | 'staffOrgUserIds'>;\n identity: Pick<IdentityService, 'displayName'>;\n posts: Pick<PostService, 'followerIds' | 'find' | 'publishDue' | 'hasDue'>;\n discussion: Pick<DiscussionService, 'getComment' | 'sendDigest'>;\n chats: Pick<ChatService, 'chatSummary' | 'latestMessageBody' | 'isBlocked'>;\n assets: Pick<AssetsService, 'removeUnattached' | 'hasUnattached'>;\n};\n\nexport function communityMail(deps: CommunityMailDeps): {\n mail: Omit<CommunityMailReads, 'recentMessageRecipients'>;\n grants: GrantWriter;\n scheduledWork: ScheduledWork;\n} {\n const mail: Omit<CommunityMailReads, 'recentMessageRecipients'> = {\n async communityTitle(orgId, communityId) {\n return (await deps.content.getCommunity(orgId, communityId))?.title ?? null;\n },\n async space(orgId, spaceId) {\n const space = await deps.content.getSpace(orgId, spaceId);\n return space\n ? { name: space.name, communityId: space.communityId, capacity: space.capacity }\n : null;\n },\n async openSpaceNames(orgId, orgUserId, communityId) {\n const orgUser = await deps.organizations.getOrgUserById(orgId, orgUserId);\n if (!orgUser) {\n return [];\n }\n const spaces = await deps.entitlements.openSpacesFor(\n orgId,\n { id: orgUser.id, role: orgUser.role },\n communityId,\n );\n return spaces.map((space) => space.name);\n },\n communitiesOpenedBy: (orgId, grant) => deps.entitlements.communitiesOpenedBy(orgId, grant),\n communityMembersAmong: (orgId, communityId, ids) =>\n deps.entitlements.communityMembersAmong(orgId, communityId, ids),\n spaceOpenersAmong: (orgId, spaceId, ids) =>\n deps.entitlements.spaceOpenersAmong(orgId, spaceId, ids),\n spaceOpeners: (orgId, spaceId) => deps.entitlements.spaceOpeners(orgId, spaceId),\n moderationAudience: (orgId, communityId) =>\n deps.entitlements.communityModeratorIds(orgId, communityId),\n staffIds: (orgId) => deps.organizations.staffOrgUserIds(orgId),\n async displayName(orgId, orgUserId) {\n const orgUser = await deps.organizations.getOrgUserById(orgId, orgUserId);\n return deps.identity.displayName(orgUser?.userId ?? null);\n },\n followerIds: (orgId, postId) => deps.posts.followerIds(orgId, postId),\n async comment(orgId, commentId) {\n const comment = await deps.discussion.getComment(orgId, commentId);\n return comment\n ? { orgUserId: comment.orgUserId, postId: comment.postId, body: comment.body }\n : null;\n },\n async post(orgId, postId) {\n const post = await deps.posts.find(orgId, postId);\n return post\n ? {\n title: post.title,\n body: post.body,\n spaceId: post.spaceId,\n orgUserId: post.orgUserId,\n communityId: post.communityId,\n }\n : null;\n },\n async chat(orgId, chatId) {\n const summary = await deps.chats.chatSummary(orgId, chatId);\n return summary\n ? {\n communityId: summary.chat.communityId,\n kind: summary.chat.kind,\n status: summary.chat.status,\n createdBy: summary.chat.createdBy,\n participants: summary.participants.map((participant) => ({\n orgUserId: participant.orgUserId,\n muted: participant.muted,\n mutedUntil: participant.mutedUntil,\n leftAt: participant.leftAt,\n })),\n }\n : null;\n },\n latestMessageBody: (orgId, chatId) => deps.chats.latestMessageBody(orgId, chatId),\n pairBlocked: (orgId, communityId, a, b) => deps.chats.isBlocked(orgId, communityId, a, b),\n activeMemberCount: (orgId, spaceId) =>\n deps.entitlements.countActiveSpaceMembers(orgId, spaceId),\n async memberCommunityTitles(orgId, orgUserId) {\n const ids = await deps.entitlements.communityIdsOpenedFor(orgId, orgUserId);\n const communities = await deps.content.listCommunitiesById(orgId, ids);\n return communities.map((community) => ({ id: community.id, title: community.title }));\n },\n };\n return {\n mail,\n grants: {\n grant: (orgId, input) => deps.entitlements.ensureGrant(orgId, input),\n },\n scheduledWork: {\n publishDuePosts: (orgId, now) => deps.posts.publishDue(orgId, now),\n hasDuePosts: (orgId, now) => deps.posts.hasDue(orgId, now),\n expireDueGrants: (orgId, now) => deps.entitlements.expireDue(orgId, now),\n hasDueGrants: (orgId, now) => deps.entitlements.hasDueNotices(orgId, now),\n sendDigest: (orgId, now) => deps.discussion.sendDigest(orgId, now),\n removeUnattachedUploads: async (orgId, now) => {\n await deps.assets.removeUnattached(orgId, now);\n },\n hasUnattachedUploads: (orgId, now) => deps.assets.hasUnattached(orgId, now),\n },\n };\n}\n"],"mappings":"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"}
@@ -1,21 +1,21 @@
1
+ import { McpEndpoints } from "./mcp-endpoints.js";
1
2
  import { PollingOutboxRelayConfig } from "@headless-lms/adapter-defaults/events/outbox-relay";
2
3
  import { LogLevel, PinoInstance, RequestLogContext } from "@headless-lms/adapter-defaults/logging";
3
4
  import { BetterAuth } from "@headless-lms/adapter-auth";
4
- import { ContentServiceImpl } from "@headless-lms/core/content";
5
+ import { ContentService } from "@headless-lms/core/content";
5
6
  import { EntitlementsServiceImpl } from "@headless-lms/core/entitlements";
6
7
  import { ProgressServiceImpl } from "@headless-lms/core/progress";
7
- import { DiscussionServiceImpl } from "@headless-lms/core/discussion";
8
- import { IdentityServiceImpl, SessionAdmin } from "@headless-lms/core/identity";
8
+ import { ChatServiceImpl, DiscussionServiceImpl, PostServiceImpl } from "@headless-lms/core/discussion";
9
+ import { IdentityServiceImpl, NotificationServiceImpl, SessionAdmin } from "@headless-lms/core/identity";
9
10
  import { OrgAdmin, OrganizationServiceImpl } from "@headless-lms/core/organizations";
10
11
  import { AssetsServiceImpl } from "@headless-lms/core/assets";
11
12
  import { IntegrationsServiceImpl } from "@headless-lms/core/integrations";
12
13
  import { AutomationsServiceImpl } from "@headless-lms/core/automations";
13
- import { StudentsReportServiceImpl } from "@headless-lms/core/reporting/students";
14
- import { DashboardReportServiceImpl } from "@headless-lms/core/reporting/dashboard";
15
- import { LearnReportServiceImpl } from "@headless-lms/core/reporting/learn";
14
+ import { AdminReportServiceImpl } from "@headless-lms/core/reporting/admin";
15
+ import { MemberReportServiceImpl } from "@headless-lms/core/reporting/member";
16
16
  import { Mailer } from "@headless-lms/core/shared/mailer";
17
17
  import { SettingsService } from "@headless-lms/core/shared/settings";
18
- import { AutomationEngine } from "@headless-lms/core/types";
18
+ import { AutomationEngine, WebhookSender } from "@headless-lms/core/types";
19
19
  import { CredentialStore, EmailSender, Logger, ObjectStorage, OutboxRelay, TemplateContext, TemplateRenderer } from "@headless-lms/core/shared/ports";
20
20
  //#region src/app/container.d.ts
21
21
  /** Installation-supplied ports; an absent slot falls back to a fail-loudly stub. */
@@ -24,8 +24,10 @@ interface AdapterOverrides {
24
24
  storage?: ObjectStorage;
25
25
  /** Resolves email templates to rendered content. Absent → fail-loudly stub. */
26
26
  templates?: TemplateRenderer;
27
- /** Durable automation engine. Absent → InlineAutomationEngine (in-process, one attempt per action). */
28
- workflows?: AutomationEngine;
27
+ /** Durable automation engine, or a factory given the automations logger. Absent → InlineAutomationEngine (in-process, one attempt per action). */
28
+ workflows?: AutomationEngine | ((logger: Logger) => AutomationEngine);
29
+ /** Outbound HTTP for webhook deliveries. Absent → FetchWebhookSender (public addresses only, 10s timeout). */
30
+ webhooks?: WebhookSender;
29
31
  }
30
32
  interface BuildContainerOptions {
31
33
  /** Installation's plugins folder, scanned by loadIntegrations. Absent → no integrations. */
@@ -54,9 +56,12 @@ interface Config {
54
56
  outbox?: OutboxConfig;
55
57
  /** Log level for the process-wide logger (HTTP + domain + relay). Default "info". */
56
58
  logging?: LoggingConfig;
57
- /** Presigned URL lifetime for entitled download delivery, seconds. Mirrors
59
+ /** Lifetime of every signed file URL a response carries, seconds. Mirrors
58
60
  * ServerConfig.deliveryExpirySeconds — createContainer threads it through. */
59
61
  deliveryExpirySeconds: number;
62
+ memberImageMaxBytes: number;
63
+ /** Let the default webhook sender reach loopback and private network addresses. Local development only. */
64
+ webhookAllowPrivateNetwork?: boolean;
60
65
  }
61
66
  /** Tuning for the transactional-outbox relay. Every field is optional; the
62
67
  * container resolves against OUTBOX_DEFAULTS. */
@@ -79,13 +84,17 @@ declare const LOGGING_DEFAULTS: Required<LoggingConfig>;
79
84
  declare function resolveLoggingConfig(config?: LoggingConfig): Required<LoggingConfig>;
80
85
  interface Container {
81
86
  auth: BetterAuth;
87
+ mcp: McpEndpoints;
82
88
  orgProvider: OrgAdmin;
83
89
  identity: IdentityServiceImpl;
90
+ notifications: NotificationServiceImpl;
84
91
  organizations: OrganizationServiceImpl;
85
- content: ContentServiceImpl;
92
+ content: ContentService;
86
93
  entitlements: EntitlementsServiceImpl;
87
94
  progress: ProgressServiceImpl;
88
95
  discussion: DiscussionServiceImpl;
96
+ posts: PostServiceImpl;
97
+ chats: ChatServiceImpl;
89
98
  assets: AssetsServiceImpl;
90
99
  integrations: IntegrationsServiceImpl;
91
100
  automations: AutomationsServiceImpl;
@@ -93,9 +102,8 @@ interface Container {
93
102
  * inject `settings.for('<namespace>')` into a service, never the service itself. */
94
103
  settings: SettingsService;
95
104
  reporting: {
96
- students: StudentsReportServiceImpl;
97
- dashboard: DashboardReportServiceImpl;
98
- learn: LearnReportServiceImpl;
105
+ admin: AdminReportServiceImpl;
106
+ member: MemberReportServiceImpl;
99
107
  };
100
108
  storage: ObjectStorage;
101
109
  mailer: Mailer;