@headless-lms/core 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 (307) hide show
  1. package/dist/assets/events.d.ts +42 -24
  2. package/dist/assets/events.js +1 -1
  3. package/dist/assets/events.js.map +1 -1
  4. package/dist/assets/file-urls.d.ts +20 -0
  5. package/dist/assets/file-urls.js +25 -0
  6. package/dist/assets/file-urls.js.map +1 -0
  7. package/dist/assets/index.d.ts +6 -4
  8. package/dist/assets/index.js +4 -2
  9. package/dist/assets/jobs.d.ts +15 -0
  10. package/dist/assets/jobs.js +30 -0
  11. package/dist/assets/jobs.js.map +1 -0
  12. package/dist/assets/model.d.ts +2 -2
  13. package/dist/assets/ports.d.ts +46 -15
  14. package/dist/assets/service.d.ts +38 -7
  15. package/dist/assets/service.js +287 -38
  16. package/dist/assets/service.js.map +1 -1
  17. package/dist/automations/actions.d.ts +13 -24
  18. package/dist/automations/actions.js +106 -42
  19. package/dist/automations/actions.js.map +1 -1
  20. package/dist/automations/catalog.js +226 -3
  21. package/dist/automations/catalog.js.map +1 -1
  22. package/dist/automations/community-derivations.d.ts +14 -0
  23. package/dist/automations/community-derivations.js +439 -0
  24. package/dist/automations/community-derivations.js.map +1 -0
  25. package/dist/automations/community-mail.d.ts +98 -0
  26. package/dist/automations/community-mail.js +70 -0
  27. package/dist/automations/community-mail.js.map +1 -0
  28. package/dist/automations/events.d.ts +18 -0
  29. package/dist/automations/index.d.ts +13 -4
  30. package/dist/automations/index.js +10 -2
  31. package/dist/automations/model.d.ts +10 -3
  32. package/dist/automations/model.js +15 -2
  33. package/dist/automations/model.js.map +1 -1
  34. package/dist/automations/notifications/debounce.d.ts +25 -0
  35. package/dist/automations/notifications/debounce.js +93 -0
  36. package/dist/automations/notifications/debounce.js.map +1 -0
  37. package/dist/automations/notifications/defaults.d.ts +8 -0
  38. package/dist/automations/notifications/defaults.js +316 -0
  39. package/dist/automations/notifications/defaults.js.map +1 -0
  40. package/dist/automations/notifications/delivery.d.ts +28 -0
  41. package/dist/automations/notifications/delivery.js +88 -0
  42. package/dist/automations/notifications/delivery.js.map +1 -0
  43. package/dist/automations/notifications/processor.d.ts +64 -0
  44. package/dist/automations/notifications/processor.js +270 -0
  45. package/dist/automations/notifications/processor.js.map +1 -0
  46. package/dist/automations/notifications/rules/content.d.ts +6 -0
  47. package/dist/automations/notifications/rules/content.js +39 -0
  48. package/dist/automations/notifications/rules/content.js.map +1 -0
  49. package/dist/automations/notifications/rules/discussion.d.ts +7 -0
  50. package/dist/automations/notifications/rules/discussion.js +678 -0
  51. package/dist/automations/notifications/rules/discussion.js.map +1 -0
  52. package/dist/automations/notifications/rules/entitlements.d.ts +6 -0
  53. package/dist/automations/notifications/rules/entitlements.js +249 -0
  54. package/dist/automations/notifications/rules/entitlements.js.map +1 -0
  55. package/dist/automations/notifications/rules/index.d.ts +6 -0
  56. package/dist/automations/notifications/rules/index.js +15 -0
  57. package/dist/automations/notifications/rules/index.js.map +1 -0
  58. package/dist/automations/notifications/rules/organizations.d.ts +6 -0
  59. package/dist/automations/notifications/rules/organizations.js +28 -0
  60. package/dist/automations/notifications/rules/organizations.js.map +1 -0
  61. package/dist/automations/notifications/rules/recipients.d.ts +32 -0
  62. package/dist/automations/notifications/rules/recipients.js +99 -0
  63. package/dist/automations/notifications/rules/recipients.js.map +1 -0
  64. package/dist/automations/notifications/service.d.ts +27 -0
  65. package/dist/automations/notifications/service.js +45 -0
  66. package/dist/automations/notifications/service.js.map +1 -0
  67. package/dist/automations/notifications/types.d.ts +7 -0
  68. package/dist/automations/notifications/types.js +473 -0
  69. package/dist/automations/notifications/types.js.map +1 -0
  70. package/dist/automations/ports.d.ts +121 -3
  71. package/dist/automations/schedule.d.ts +6 -0
  72. package/dist/automations/schedule.js +41 -0
  73. package/dist/automations/schedule.js.map +1 -0
  74. package/dist/automations/service.d.ts +20 -4
  75. package/dist/automations/service.js +246 -45
  76. package/dist/automations/service.js.map +1 -1
  77. package/dist/content/events.d.ts +712 -50
  78. package/dist/content/events.js +55 -1
  79. package/dist/content/events.js.map +1 -1
  80. package/dist/content/index.d.ts +6 -4
  81. package/dist/content/index.js +3 -1
  82. package/dist/content/model.d.ts +2 -2
  83. package/dist/content/notification-categories.d.ts +36 -0
  84. package/dist/content/notification-categories.js +64 -0
  85. package/dist/content/notification-categories.js.map +1 -0
  86. package/dist/content/ports.d.ts +90 -18
  87. package/dist/content/service.d.ts +57 -18
  88. package/dist/content/service.js +520 -25
  89. package/dist/content/service.js.map +1 -1
  90. package/dist/content/titles.d.ts +22 -0
  91. package/dist/content/titles.js +69 -0
  92. package/dist/content/titles.js.map +1 -0
  93. package/dist/content/types.d.ts +2 -2
  94. package/dist/discussion/authors.d.ts +10 -0
  95. package/dist/discussion/authors.js +23 -0
  96. package/dist/discussion/authors.js.map +1 -0
  97. package/dist/discussion/chats.d.ts +109 -0
  98. package/dist/discussion/chats.js +831 -0
  99. package/dist/discussion/chats.js.map +1 -0
  100. package/dist/discussion/digests.d.ts +24 -0
  101. package/dist/discussion/digests.js +104 -0
  102. package/dist/discussion/digests.js.map +1 -0
  103. package/dist/discussion/events.d.ts +785 -56
  104. package/dist/discussion/events.js +165 -5
  105. package/dist/discussion/events.js.map +1 -1
  106. package/dist/discussion/index.d.ts +12 -3
  107. package/dist/discussion/index.js +9 -1
  108. package/dist/discussion/jobs.d.ts +16 -0
  109. package/dist/discussion/jobs.js +40 -0
  110. package/dist/discussion/jobs.js.map +1 -0
  111. package/dist/discussion/mentions.d.ts +11 -0
  112. package/dist/discussion/mentions.js +35 -0
  113. package/dist/discussion/mentions.js.map +1 -0
  114. package/dist/discussion/ports.d.ts +372 -28
  115. package/dist/discussion/ports.js +6 -1
  116. package/dist/discussion/ports.js.map +1 -0
  117. package/dist/discussion/posts.d.ts +113 -0
  118. package/dist/discussion/posts.js +775 -0
  119. package/dist/discussion/posts.js.map +1 -0
  120. package/dist/discussion/service.d.ts +42 -11
  121. package/dist/discussion/service.js +364 -85
  122. package/dist/discussion/service.js.map +1 -1
  123. package/dist/discussion/subscriptions.d.ts +37 -0
  124. package/dist/discussion/subscriptions.js +99 -0
  125. package/dist/discussion/subscriptions.js.map +1 -0
  126. package/dist/discussion/titles.d.ts +26 -0
  127. package/dist/discussion/titles.js +84 -0
  128. package/dist/discussion/titles.js.map +1 -0
  129. package/dist/entitlements/events.d.ts +178 -11
  130. package/dist/entitlements/events.js +28 -1
  131. package/dist/entitlements/events.js.map +1 -1
  132. package/dist/entitlements/index.d.ts +6 -4
  133. package/dist/entitlements/index.js +3 -1
  134. package/dist/entitlements/jobs.d.ts +12 -0
  135. package/dist/entitlements/jobs.js +18 -0
  136. package/dist/entitlements/jobs.js.map +1 -0
  137. package/dist/entitlements/model.d.ts +3 -2
  138. package/dist/entitlements/ports.d.ts +128 -11
  139. package/dist/entitlements/rules.d.ts +12 -0
  140. package/dist/entitlements/rules.js +17 -0
  141. package/dist/entitlements/rules.js.map +1 -0
  142. package/dist/entitlements/service.d.ts +57 -3
  143. package/dist/entitlements/service.js +492 -2
  144. package/dist/entitlements/service.js.map +1 -1
  145. package/dist/identity/access.d.ts +6 -0
  146. package/dist/identity/access.js +7 -0
  147. package/dist/identity/access.js.map +1 -0
  148. package/dist/identity/devices.d.ts +30 -0
  149. package/dist/identity/devices.js +107 -0
  150. package/dist/identity/devices.js.map +1 -0
  151. package/dist/identity/events.d.ts +2 -2
  152. package/dist/identity/index.d.ts +7 -4
  153. package/dist/identity/index.js +4 -1
  154. package/dist/identity/model.d.ts +2 -1
  155. package/dist/identity/notification-settings.d.ts +28 -0
  156. package/dist/identity/notification-settings.js +113 -0
  157. package/dist/identity/notification-settings.js.map +1 -0
  158. package/dist/identity/ports.d.ts +97 -3
  159. package/dist/identity/service.d.ts +14 -3
  160. package/dist/identity/service.js +62 -5
  161. package/dist/identity/service.js.map +1 -1
  162. package/dist/integrations/events.d.ts +3 -3
  163. package/dist/integrations/model.js +1 -1
  164. package/dist/integrations/model.js.map +1 -1
  165. package/dist/integrations/service.js +2 -2
  166. package/dist/integrations/service.js.map +1 -1
  167. package/dist/organizations/access-scopes.d.ts +19 -0
  168. package/dist/organizations/access-scopes.js +89 -0
  169. package/dist/organizations/access-scopes.js.map +1 -0
  170. package/dist/organizations/events.d.ts +75 -33
  171. package/dist/organizations/events.js +6 -0
  172. package/dist/organizations/events.js.map +1 -1
  173. package/dist/organizations/index.d.ts +8 -6
  174. package/dist/organizations/index.js +5 -3
  175. package/dist/organizations/members.d.ts +8 -5
  176. package/dist/organizations/members.js.map +1 -1
  177. package/dist/organizations/notification-categories.d.ts +32 -0
  178. package/dist/organizations/notification-categories.js +51 -0
  179. package/dist/organizations/notification-categories.js.map +1 -0
  180. package/dist/organizations/ports.d.ts +17 -11
  181. package/dist/organizations/roles.d.ts +6 -10
  182. package/dist/organizations/roles.js +19 -7
  183. package/dist/organizations/roles.js.map +1 -1
  184. package/dist/organizations/service.d.ts +22 -11
  185. package/dist/organizations/service.js +164 -47
  186. package/dist/organizations/service.js.map +1 -1
  187. package/dist/organizations/types.d.ts +1 -10
  188. package/dist/progress/events.d.ts +14 -14
  189. package/dist/progress/index.d.ts +2 -2
  190. package/dist/progress/ports.d.ts +6 -1
  191. package/dist/progress/service.d.ts +3 -1
  192. package/dist/progress/service.js +6 -2
  193. package/dist/progress/service.js.map +1 -1
  194. package/dist/reporting/admin/index.d.ts +4 -0
  195. package/dist/reporting/admin/index.js +2 -0
  196. package/dist/reporting/admin/model.d.ts +108 -0
  197. package/dist/reporting/admin/ports.d.ts +27 -0
  198. package/dist/reporting/admin/service.d.ts +22 -0
  199. package/dist/reporting/admin/service.js +38 -0
  200. package/dist/reporting/admin/service.js.map +1 -0
  201. package/dist/reporting/member/index.d.ts +5 -0
  202. package/dist/reporting/member/index.js +2 -0
  203. package/dist/reporting/member/model.d.ts +157 -0
  204. package/dist/reporting/member/ports.d.ts +48 -0
  205. package/dist/reporting/member/service.d.ts +92 -0
  206. package/dist/reporting/member/service.js +364 -0
  207. package/dist/reporting/member/service.js.map +1 -0
  208. package/dist/shared/actor.d.ts +9 -0
  209. package/dist/shared/errors.d.ts +19 -1
  210. package/dist/shared/errors.js +27 -1
  211. package/dist/shared/errors.js.map +1 -1
  212. package/dist/shared/id.d.ts +14 -0
  213. package/dist/shared/id.js +15 -1
  214. package/dist/shared/id.js.map +1 -1
  215. package/dist/shared/mailer.d.ts +15 -2
  216. package/dist/shared/mailer.js +32 -5
  217. package/dist/shared/mailer.js.map +1 -1
  218. package/dist/shared/network.d.ts +10 -0
  219. package/dist/shared/network.js +211 -0
  220. package/dist/shared/network.js.map +1 -0
  221. package/dist/shared/notification-categories.d.ts +16 -0
  222. package/dist/shared/notification-categories.js +94 -0
  223. package/dist/shared/notification-categories.js.map +1 -0
  224. package/dist/shared/notification-settings.d.ts +14 -0
  225. package/dist/shared/notification-settings.js +61 -0
  226. package/dist/shared/notification-settings.js.map +1 -0
  227. package/dist/shared/ports.d.ts +48 -2
  228. package/dist/shared/settings.d.ts +2 -1
  229. package/dist/shared/settings.js +1 -0
  230. package/dist/shared/settings.js.map +1 -1
  231. package/dist/types/assets.d.ts +2 -2
  232. package/dist/types/automations.d.ts +15 -1
  233. package/dist/types/content.d.ts +2 -2
  234. package/dist/types/discussion.d.ts +11 -3
  235. package/dist/types/email-templates.d.ts +216 -1
  236. package/dist/types/entitlements.d.ts +2 -2
  237. package/dist/types/identity.d.ts +48 -2
  238. package/dist/types/index.d.ts +9 -8
  239. package/dist/types/notifications.d.ts +157 -0
  240. package/dist/types/ports.d.ts +6 -0
  241. package/dist/types/schemas/assets.d.ts +65 -37
  242. package/dist/types/schemas/assets.js +17 -12
  243. package/dist/types/schemas/assets.js.map +1 -1
  244. package/dist/types/schemas/automations.d.ts +9 -1
  245. package/dist/types/schemas/automations.js +13 -6
  246. package/dist/types/schemas/automations.js.map +1 -1
  247. package/dist/types/schemas/content.d.ts +396 -3
  248. package/dist/types/schemas/content.js +161 -3
  249. package/dist/types/schemas/content.js.map +1 -1
  250. package/dist/types/schemas/discussion.d.ts +443 -3
  251. package/dist/types/schemas/discussion.js +233 -4
  252. package/dist/types/schemas/discussion.js.map +1 -1
  253. package/dist/types/schemas/entitlements.d.ts +36 -2
  254. package/dist/types/schemas/entitlements.js +23 -1
  255. package/dist/types/schemas/entitlements.js.map +1 -1
  256. package/dist/types/schemas/identity.d.ts +27 -1
  257. package/dist/types/schemas/identity.js +14 -2
  258. package/dist/types/schemas/identity.js.map +1 -1
  259. package/dist/types/schemas/index.d.ts +9 -8
  260. package/dist/types/schemas/index.js +9 -8
  261. package/dist/types/schemas/notifications.d.ts +95 -0
  262. package/dist/types/schemas/notifications.js +56 -0
  263. package/dist/types/schemas/notifications.js.map +1 -0
  264. package/dist/types/schemas/organizations.d.ts +8 -0
  265. package/dist/types/schemas/organizations.js +2 -0
  266. package/dist/types/schemas/organizations.js.map +1 -1
  267. package/dist/types/schemas/progress.d.ts +3 -3
  268. package/dist/types/schemas/shared.d.ts +3 -1
  269. package/dist/types/schemas/shared.js +5 -1
  270. package/dist/types/schemas/shared.js.map +1 -1
  271. package/package.json +2 -2
  272. package/dist/reporting/courses/index.d.ts +0 -4
  273. package/dist/reporting/courses/index.js +0 -2
  274. package/dist/reporting/courses/model.d.ts +0 -24
  275. package/dist/reporting/courses/ports.d.ts +0 -13
  276. package/dist/reporting/courses/service.d.ts +0 -19
  277. package/dist/reporting/courses/service.js +0 -20
  278. package/dist/reporting/courses/service.js.map +0 -1
  279. package/dist/reporting/dashboard/index.d.ts +0 -4
  280. package/dist/reporting/dashboard/index.js +0 -2
  281. package/dist/reporting/dashboard/model.d.ts +0 -14
  282. package/dist/reporting/dashboard/ports.d.ts +0 -13
  283. package/dist/reporting/dashboard/service.d.ts +0 -19
  284. package/dist/reporting/dashboard/service.js +0 -20
  285. package/dist/reporting/dashboard/service.js.map +0 -1
  286. package/dist/reporting/learn/index.d.ts +0 -5
  287. package/dist/reporting/learn/index.js +0 -2
  288. package/dist/reporting/learn/model.d.ts +0 -23
  289. package/dist/reporting/learn/ports.d.ts +0 -43
  290. package/dist/reporting/learn/service.d.ts +0 -49
  291. package/dist/reporting/learn/service.js +0 -116
  292. package/dist/reporting/learn/service.js.map +0 -1
  293. package/dist/reporting/students/index.d.ts +0 -4
  294. package/dist/reporting/students/index.js +0 -2
  295. package/dist/reporting/students/model.d.ts +0 -51
  296. package/dist/reporting/students/model.js +0 -1
  297. package/dist/reporting/students/ports.d.ts +0 -15
  298. package/dist/reporting/students/ports.js +0 -1
  299. package/dist/reporting/students/service.d.ts +0 -20
  300. package/dist/reporting/students/service.js +0 -23
  301. package/dist/reporting/students/service.js.map +0 -1
  302. /package/dist/reporting/{courses → admin}/model.js +0 -0
  303. /package/dist/reporting/{courses → admin}/ports.js +0 -0
  304. /package/dist/reporting/{dashboard → member}/model.js +0 -0
  305. /package/dist/reporting/{dashboard → member}/ports.js +0 -0
  306. /package/dist/{reporting/learn/model.js → shared/actor.js} +0 -0
  307. /package/dist/{reporting/learn/ports.js → types/notifications.js} +0 -0
@@ -0,0 +1,38 @@
1
+ //#region src/reporting/admin/service.ts
2
+ var AdminReportServiceImpl = class {
3
+ repo;
4
+ constructor(params) {
5
+ this.repo = params.repo;
6
+ }
7
+ overview(orgId) {
8
+ return this.repo.overview(orgId);
9
+ }
10
+ enrollments(orgId, days) {
11
+ return this.repo.enrollments(orgId, days);
12
+ }
13
+ courseAnalytics(orgId, courseId) {
14
+ return this.repo.courseAnalytics(orgId, courseId);
15
+ }
16
+ courseEnrollments(orgId, courseId, days) {
17
+ return this.repo.courseEnrollments(orgId, courseId, days);
18
+ }
19
+ listStudents(orgId, query) {
20
+ return this.repo.listStudents(orgId, query);
21
+ }
22
+ getStudent(orgId, id) {
23
+ return this.repo.getStudent(orgId, id);
24
+ }
25
+ studentAnalytics(orgId, id) {
26
+ return this.repo.studentAnalytics(orgId, id);
27
+ }
28
+ communityAnalytics(orgId, communityId) {
29
+ return this.repo.communityAnalytics(orgId, communityId);
30
+ }
31
+ communityMembers(orgId, communityId, query) {
32
+ return this.repo.communityMembers(orgId, communityId, query);
33
+ }
34
+ };
35
+ //#endregion
36
+ export { AdminReportServiceImpl };
37
+
38
+ //# sourceMappingURL=service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service.js","names":[],"sources":["../../../src/reporting/admin/service.ts"],"sourcesContent":["import type {\n CommunityAnalytics,\n CommunityMember,\n CommunityMembersQuery,\n CourseAnalytics,\n CourseEnrollmentPoint,\n EnrollmentPoint,\n OverviewStats,\n Page,\n Student,\n StudentAnalytics,\n StudentsQuery,\n} from './model.js';\nimport type { AdminReportRepository, AdminReportService } from './ports.js';\n\nexport type AdminReportServiceParams = {\n repo: AdminReportRepository;\n};\n\nexport class AdminReportServiceImpl implements AdminReportService {\n private readonly repo: AdminReportRepository;\n\n constructor(params: AdminReportServiceParams) {\n this.repo = params.repo;\n }\n\n overview(orgId: string): Promise<OverviewStats> {\n return this.repo.overview(orgId);\n }\n\n enrollments(orgId: string, days: number): Promise<EnrollmentPoint[]> {\n return this.repo.enrollments(orgId, days);\n }\n\n courseAnalytics(orgId: string, courseId: string): Promise<CourseAnalytics | null> {\n return this.repo.courseAnalytics(orgId, courseId);\n }\n\n courseEnrollments(\n orgId: string,\n courseId: string,\n days: number,\n ): Promise<CourseEnrollmentPoint[] | null> {\n return this.repo.courseEnrollments(orgId, courseId, days);\n }\n\n listStudents(orgId: string, query: StudentsQuery): Promise<Page<Student>> {\n return this.repo.listStudents(orgId, query);\n }\n\n getStudent(orgId: string, id: string): Promise<Student | null> {\n return this.repo.getStudent(orgId, id);\n }\n\n studentAnalytics(orgId: string, id: string): Promise<StudentAnalytics | null> {\n return this.repo.studentAnalytics(orgId, id);\n }\n\n communityAnalytics(orgId: string, communityId: string): Promise<CommunityAnalytics | null> {\n return this.repo.communityAnalytics(orgId, communityId);\n }\n\n communityMembers(\n orgId: string,\n communityId: string,\n query: CommunityMembersQuery,\n ): Promise<Page<CommunityMember> | null> {\n return this.repo.communityMembers(orgId, communityId, query);\n }\n}\n"],"mappings":";AAmBA,IAAa,yBAAb,MAAkE;CAChE;CAEA,YAAY,QAAkC;EAC5C,KAAK,OAAO,OAAO;CACrB;CAEA,SAAS,OAAuC;EAC9C,OAAO,KAAK,KAAK,SAAS,KAAK;CACjC;CAEA,YAAY,OAAe,MAA0C;EACnE,OAAO,KAAK,KAAK,YAAY,OAAO,IAAI;CAC1C;CAEA,gBAAgB,OAAe,UAAmD;EAChF,OAAO,KAAK,KAAK,gBAAgB,OAAO,QAAQ;CAClD;CAEA,kBACE,OACA,UACA,MACyC;EACzC,OAAO,KAAK,KAAK,kBAAkB,OAAO,UAAU,IAAI;CAC1D;CAEA,aAAa,OAAe,OAA8C;EACxE,OAAO,KAAK,KAAK,aAAa,OAAO,KAAK;CAC5C;CAEA,WAAW,OAAe,IAAqC;EAC7D,OAAO,KAAK,KAAK,WAAW,OAAO,EAAE;CACvC;CAEA,iBAAiB,OAAe,IAA8C;EAC5E,OAAO,KAAK,KAAK,iBAAiB,OAAO,EAAE;CAC7C;CAEA,mBAAmB,OAAe,aAAyD;EACzF,OAAO,KAAK,KAAK,mBAAmB,OAAO,WAAW;CACxD;CAEA,iBACE,OACA,aACA,OACuC;EACvC,OAAO,KAAK,KAAK,iBAAiB,OAAO,aAAa,KAAK;CAC7D;AACF"}
@@ -0,0 +1,5 @@
1
+ import { CourseView, Module } from "../../types/schemas/content.js";
2
+ import { CommunityHome, CommunityHomeSpace, CommunityNotificationSettingsView, CourseProgressView, DirectoryEntry, DirectoryQuery, DirectoryRow, LockedCommunitySpace, NotificationItemView, NotificationSettingsCategoryView, NotificationUnreadCounts, NotificationView, NotificationsView, OpenCommunitySpace, OrgNotificationSettingsView, SettingsChannelView } from "./model.js";
3
+ import { MemberReportRepository, MemberReportService } from "./ports.js";
4
+ import { MemberReportServiceImpl } from "./service.js";
5
+ export { type CommunityHome, type CommunityHomeSpace, type CommunityNotificationSettingsView, type CourseProgressView, type CourseView, type DirectoryEntry, type DirectoryQuery, type DirectoryRow, type LockedCommunitySpace, type MemberReportRepository, type MemberReportService, MemberReportServiceImpl, type Module, type NotificationItemView, type NotificationSettingsCategoryView, type NotificationUnreadCounts, type NotificationView, type NotificationsView, type OpenCommunitySpace, type OrgNotificationSettingsView, type SettingsChannelView };
@@ -0,0 +1,2 @@
1
+ import { MemberReportServiceImpl } from "./service.js";
2
+ export { MemberReportServiceImpl };
@@ -0,0 +1,157 @@
1
+ import { JsonValue } from "../../types/shared.js";
2
+ import { ActivityView, CourseView, DigestSchedule, DownloadFile, DownloadView, Module } from "../../types/schemas/content.js";
3
+ import { SubscriptionView } from "../../types/schemas/discussion.js";
4
+ import { Reason, Scope, SubjectRef } from "../../types/notifications.js";
5
+ import "../../types/index.js";
6
+ import "../../content/index.js";
7
+ import { ResolvedChannel } from "../../shared/notification-settings.js";
8
+ //#region src/reporting/member/model.d.ts
9
+ /** Per-course progress for the student surface. Derived on read against the
10
+ * current published structure — never stored. */
11
+ interface DirectoryRow {
12
+ orgUserId: string;
13
+ userId: string;
14
+ role: string;
15
+ displayName: string | null;
16
+ headline: string | null;
17
+ bio: string | null;
18
+ imageAssetId: string | null;
19
+ }
20
+ interface DirectoryQuery {
21
+ page: number;
22
+ pageSize: number;
23
+ search?: string;
24
+ }
25
+ interface DirectoryEntry extends DirectoryRow {
26
+ imageUrl: string | null;
27
+ }
28
+ interface CommunityHomeLink {
29
+ id: string;
30
+ contentId: string;
31
+ type: 'course' | 'download' | 'community';
32
+ title: string;
33
+ }
34
+ interface CommunityHomeSpaceBase {
35
+ id: string;
36
+ name: string;
37
+ memberCount: number;
38
+ accessRule: 'all_members' | 'by_request' | 'by_invite';
39
+ standing: 'open' | 'member' | 'requested' | 'invited' | 'full' | 'none';
40
+ }
41
+ /** A space the viewer can see but not open: enough to request, accept or ask. */
42
+ interface LockedCommunitySpace extends CommunityHomeSpaceBase {
43
+ locked: true;
44
+ }
45
+ interface OpenCommunitySpace extends CommunityHomeSpaceBase {
46
+ locked: false;
47
+ description: string | null;
48
+ capacity: number | null;
49
+ settings: {
50
+ comments: boolean;
51
+ reactions: boolean;
52
+ requireReview: boolean;
53
+ };
54
+ topics: {
55
+ id: string;
56
+ name: string;
57
+ }[];
58
+ links: CommunityHomeLink[];
59
+ subscription: SubscriptionView | null;
60
+ }
61
+ type CommunityHomeSpace = LockedCommunitySpace | OpenCommunitySpace;
62
+ interface CommunityHome {
63
+ communityId: string;
64
+ title: string;
65
+ description: string;
66
+ thumbnailUrl: string | null;
67
+ dm: {
68
+ enabled: boolean;
69
+ memberToMember: boolean;
70
+ memberToStaff: boolean;
71
+ staffToAnyone: boolean;
72
+ firstMessageIsRequest: boolean;
73
+ groupChats: boolean;
74
+ groupSize: number;
75
+ };
76
+ spaces: CommunityHomeSpace[];
77
+ }
78
+ interface CourseProgressView {
79
+ /** Keyed by activity id; absent key = not started. */
80
+ activities: Record<string, 'in-progress' | 'completed'>;
81
+ /** Integer 0–100: completed ÷ current published activities, rounded. */
82
+ percent: number;
83
+ /** The course target's own record says so. */
84
+ completed: boolean;
85
+ /** Per-activity reported state (the record's position map); absent key = none reported. */
86
+ positions: Record<string, unknown>;
87
+ }
88
+ interface NotificationItemView {
89
+ type: SubjectRef['type'];
90
+ id: string;
91
+ title?: string;
92
+ excerpt?: string;
93
+ }
94
+ interface NotificationView {
95
+ id: string;
96
+ type: string;
97
+ scope: Scope;
98
+ reasons: Reason[];
99
+ matchedReason: Reason;
100
+ category: string;
101
+ display: Record<string, JsonValue>;
102
+ community: {
103
+ id: string;
104
+ title: string;
105
+ } | null;
106
+ space: {
107
+ id: string;
108
+ name: string;
109
+ } | null;
110
+ actor: {
111
+ orgUserId: string;
112
+ name: string | null;
113
+ imageUrl: string | null;
114
+ } | null;
115
+ subject: NotificationItemView | null;
116
+ parent: NotificationItemView | null;
117
+ createdAt: Date;
118
+ readAt: Date | null;
119
+ }
120
+ interface NotificationUnreadCounts {
121
+ org: number;
122
+ communities: {
123
+ communityId: string;
124
+ unread: number;
125
+ }[];
126
+ }
127
+ interface NotificationsView {
128
+ rows: NotificationView[];
129
+ total: number;
130
+ page: number;
131
+ pageSize: number;
132
+ unreadCount: number;
133
+ }
134
+ interface SettingsChannelView extends ResolvedChannel {
135
+ default: boolean;
136
+ }
137
+ interface NotificationSettingsCategoryView {
138
+ key: string;
139
+ perSpace: boolean;
140
+ channels: SettingsChannelView[];
141
+ spaces?: {
142
+ spaceId: string;
143
+ name: string;
144
+ channels: SettingsChannelView[];
145
+ }[];
146
+ }
147
+ interface CommunityNotificationSettingsView {
148
+ communityId: string;
149
+ digest: DigestSchedule | null;
150
+ categories: NotificationSettingsCategoryView[];
151
+ }
152
+ interface OrgNotificationSettingsView {
153
+ categories: NotificationSettingsCategoryView[];
154
+ }
155
+ //#endregion
156
+ export { type ActivityView, CommunityHome, CommunityHomeLink, CommunityHomeSpace, CommunityNotificationSettingsView, CourseProgressView, type CourseView, DirectoryEntry, DirectoryQuery, DirectoryRow, type DownloadFile, type DownloadView, LockedCommunitySpace, type Module, NotificationItemView, NotificationSettingsCategoryView, NotificationUnreadCounts, NotificationView, NotificationsView, OpenCommunitySpace, OrgNotificationSettingsView, SettingsChannelView };
157
+ //# sourceMappingURL=model.d.ts.map
@@ -0,0 +1,48 @@
1
+ import { Page } from "../../types/shared.js";
2
+ import { ActivityView, CourseView, DownloadFile, DownloadView, Module } from "../../types/schemas/content.js";
3
+ import { NotificationFilter } from "../../types/notifications.js";
4
+ import "../../types/index.js";
5
+ import { Actor } from "../../shared/actor.js";
6
+ import { CommunityHome, CommunityHomeSpace, CommunityNotificationSettingsView, CourseProgressView, DirectoryEntry, DirectoryQuery, DirectoryRow, NotificationUnreadCounts, NotificationView, NotificationsView, OrgNotificationSettingsView } from "./model.js";
7
+ //#region src/reporting/member/ports.d.ts
8
+ interface MemberReportService {
9
+ listCourses(orgId: string, orgUserId: string): Promise<CourseView[]>;
10
+ getCourse(orgId: string, orgUserId: string, courseId: string): Promise<CourseView | null>;
11
+ listModules(orgId: string, orgUserId: string, courseId: string): Promise<Module[] | null>;
12
+ listActivities(orgId: string, orgUserId: string, courseId: string): Promise<ActivityView[] | null>;
13
+ courseProgress(orgId: string, orgUserId: string, courseId: string): Promise<CourseProgressView | null>;
14
+ listDownloads(orgId: string, orgUserId: string): Promise<DownloadView[]>;
15
+ getDownload(orgId: string, orgUserId: string, downloadId: string): Promise<{
16
+ download: DownloadView;
17
+ assets: DownloadFile[];
18
+ } | null>;
19
+ /** Signed URL of a course, download or community thumbnail: published, or staff. */
20
+ thumbnailFile(orgId: string, actor: Actor, owner: 'course' | 'download' | 'community', id: string): Promise<string | null>;
21
+ /** Signed URL of an asset the activity links, for a student who can open its course. */
22
+ activityFile(orgId: string, actor: Actor, activityId: string, assetId: string): Promise<string | null>;
23
+ /** Signed download URL of a file in a download the student can open. */
24
+ downloadFile(orgId: string, actor: Actor, downloadId: string, assetId: string): Promise<string | null>;
25
+ /** Signed URL of an org user's profile photo, when it belongs to this org. */
26
+ personImage(orgId: string, orgUserId: string): Promise<string | null>;
27
+ directory(orgId: string, actor: Actor, communityId: string, query: DirectoryQuery): Promise<Page<DirectoryEntry> | null>;
28
+ communityHome(orgId: string, actor: Actor, communityId: string): Promise<CommunityHome | null>;
29
+ communitySpace(orgId: string, actor: Actor, communityId: string, spaceId: string): Promise<CommunityHomeSpace | null>;
30
+ notifications(orgId: string, actor: Actor, userId: string, filter: NotificationFilter, page: {
31
+ page: number;
32
+ pageSize: number;
33
+ }): Promise<NotificationsView>;
34
+ notification(orgId: string, actor: Actor, userId: string, notificationId: string): Promise<NotificationView | null>;
35
+ notificationUnreadCounts(orgId: string, actor: Actor, userId: string): Promise<NotificationUnreadCounts>;
36
+ /** The person's notification settings in a community they can open, resolved per channel. */
37
+ communityNotificationSettings(orgId: string, actor: Actor, userId: string, communityId: string): Promise<CommunityNotificationSettingsView | null>;
38
+ /** The person's notification settings for the org's categories. */
39
+ orgNotificationSettings(orgId: string, userId: string): Promise<OrgNotificationSettingsView>;
40
+ }
41
+ interface MemberReportRepository {
42
+ directory(orgId: string, communityId: string, query: DirectoryQuery): Promise<Page<DirectoryRow>>;
43
+ spaceMemberCounts(orgId: string, communityId: string): Promise<Record<string, number>>;
44
+ people(orgId: string, orgUserIds: string[]): Promise<DirectoryRow[]>;
45
+ }
46
+ //#endregion
47
+ export { MemberReportRepository, MemberReportService };
48
+ //# sourceMappingURL=ports.d.ts.map
@@ -0,0 +1,92 @@
1
+ import { Page } from "../../types/shared.js";
2
+ import { ActivityView, CourseView, DownloadFile, DownloadView, Module } from "../../types/schemas/content.js";
3
+ import { NotificationFilter } from "../../types/notifications.js";
4
+ import "../../types/index.js";
5
+ import { ChannelRegistry, NotificationCategoryService } from "../../shared/ports.js";
6
+ import { FileUrls } from "../../assets/file-urls.js";
7
+ import { AssetFiles } from "../../assets/ports.js";
8
+ import "../../assets/index.js";
9
+ import { Actor } from "../../shared/actor.js";
10
+ import { ContentService, ItemTitles } from "../../content/ports.js";
11
+ import "../../content/index.js";
12
+ import { NotificationSettingsService } from "../../identity/ports.js";
13
+ import "../../identity/index.js";
14
+ import { EntitlementsService } from "../../entitlements/ports.js";
15
+ import "../../entitlements/index.js";
16
+ import { NotificationsService } from "../../automations/ports.js";
17
+ import "../../automations/index.js";
18
+ import { ItemTitles as ItemTitles$1, SubscriptionService } from "../../discussion/ports.js";
19
+ import "../../discussion/index.js";
20
+ import { ProgressService } from "../../progress/ports.js";
21
+ import "../../progress/index.js";
22
+ import { CommunityHome, CommunityHomeSpace, CommunityNotificationSettingsView, CourseProgressView, DirectoryEntry, DirectoryQuery, NotificationUnreadCounts, NotificationView, NotificationsView, OrgNotificationSettingsView } from "./model.js";
23
+ import { MemberReportRepository, MemberReportService } from "./ports.js";
24
+ //#region src/reporting/member/service.d.ts
25
+ type MemberAccess = Pick<EntitlementsService, 'isCommunityMember' | 'openSpaceIds' | 'spaceStandings' | 'hasAccess' | 'listAccessibleContent' | 'openCommunityIds'>;
26
+ type MemberReportServiceParams = {
27
+ repo: MemberReportRepository;
28
+ content: ContentService;
29
+ progress: ProgressService;
30
+ files: Pick<AssetFiles, 'signFile'>;
31
+ fileUrls: FileUrls;
32
+ access: MemberAccess;
33
+ notifications: Pick<NotificationsService, 'list' | 'get' | 'unreadCounts'>;
34
+ titles: {
35
+ discussion: ItemTitles$1;
36
+ content: ItemTitles;
37
+ };
38
+ subscriptions: Pick<SubscriptionService, 'viewerSubscriptions'>;
39
+ notificationCategories: {
40
+ community: Pick<NotificationCategoryService, 'get'>;
41
+ org: Pick<NotificationCategoryService, 'get'>;
42
+ };
43
+ notificationSettings: Pick<NotificationSettingsService, 'get'>;
44
+ channels: Pick<ChannelRegistry, 'list'>;
45
+ };
46
+ declare class MemberReportServiceImpl implements MemberReportService {
47
+ private readonly repo;
48
+ private readonly content;
49
+ private readonly progress;
50
+ private readonly files;
51
+ private readonly fileUrls;
52
+ private readonly access;
53
+ private readonly notificationList;
54
+ private readonly titles;
55
+ private readonly subscriptions;
56
+ private readonly notificationCategories;
57
+ private readonly notificationSettings;
58
+ private readonly channels;
59
+ constructor(params: MemberReportServiceParams);
60
+ communityNotificationSettings(orgId: string, actor: Actor, userId: string, communityId: string): Promise<CommunityNotificationSettingsView | null>;
61
+ orgNotificationSettings(orgId: string, userId: string): Promise<OrgNotificationSettingsView>;
62
+ private settingsView;
63
+ notifications(orgId: string, actor: Actor, userId: string, filter: NotificationFilter, page: {
64
+ page: number;
65
+ pageSize: number;
66
+ }): Promise<NotificationsView>;
67
+ notification(orgId: string, actor: Actor, userId: string, notificationId: string): Promise<NotificationView | null>;
68
+ notificationUnreadCounts(orgId: string, actor: Actor, userId: string): Promise<NotificationUnreadCounts>;
69
+ private describeNotifications;
70
+ listCourses(orgId: string, orgUserId: string): Promise<CourseView[]>;
71
+ getCourse(orgId: string, orgUserId: string, courseId: string): Promise<CourseView | null>;
72
+ listModules(orgId: string, orgUserId: string, courseId: string): Promise<Module[] | null>;
73
+ listActivities(orgId: string, orgUserId: string, courseId: string): Promise<ActivityView[] | null>;
74
+ courseProgress(orgId: string, orgUserId: string, courseId: string): Promise<CourseProgressView | null>;
75
+ listDownloads(orgId: string, orgUserId: string): Promise<DownloadView[]>;
76
+ getDownload(orgId: string, orgUserId: string, downloadId: string): Promise<{
77
+ download: DownloadView;
78
+ assets: DownloadFile[];
79
+ } | null>;
80
+ thumbnailFile(orgId: string, actor: Actor, owner: 'course' | 'download' | 'community', id: string): Promise<string | null>;
81
+ activityFile(orgId: string, actor: Actor, activityId: string, assetId: string): Promise<string | null>;
82
+ downloadFile(orgId: string, actor: Actor, downloadId: string, assetId: string): Promise<string | null>;
83
+ personImage(orgId: string, orgUserId: string): Promise<string | null>;
84
+ directory(orgId: string, actor: Actor, communityId: string, query: DirectoryQuery): Promise<Page<DirectoryEntry> | null>;
85
+ communityHome(orgId: string, actor: Actor, communityId: string): Promise<CommunityHome | null>;
86
+ communitySpace(orgId: string, actor: Actor, communityId: string, spaceId: string): Promise<CommunityHomeSpace | null>;
87
+ private homeSpaces;
88
+ private linkViews;
89
+ }
90
+ //#endregion
91
+ export { MemberReportServiceImpl, MemberReportServiceParams };
92
+ //# sourceMappingURL=service.d.ts.map