@headless-lms/core 0.3.0 → 0.5.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 +24 -18
  2. package/dist/assets/file-urls.d.ts +11 -7
  3. package/dist/assets/file-urls.js +14 -4
  4. package/dist/assets/file-urls.js.map +1 -1
  5. package/dist/assets/index.d.ts +5 -4
  6. package/dist/assets/index.js +4 -3
  7. package/dist/assets/jobs.d.ts +15 -0
  8. package/dist/assets/jobs.js +30 -0
  9. package/dist/assets/jobs.js.map +1 -0
  10. package/dist/assets/ports.d.ts +37 -17
  11. package/dist/assets/service.d.ts +30 -15
  12. package/dist/assets/service.js +229 -59
  13. package/dist/assets/service.js.map +1 -1
  14. package/dist/automations/actions.js +2 -63
  15. package/dist/automations/actions.js.map +1 -1
  16. package/dist/automations/catalog.d.ts +1 -2
  17. package/dist/automations/catalog.js +137 -65
  18. package/dist/automations/catalog.js.map +1 -1
  19. package/dist/automations/community-derivations.js +20 -20
  20. package/dist/automations/community-derivations.js.map +1 -1
  21. package/dist/automations/community-mail.d.ts +36 -20
  22. package/dist/automations/community-mail.js +32 -24
  23. package/dist/automations/community-mail.js.map +1 -1
  24. package/dist/automations/event-permissions.d.ts +12 -0
  25. package/dist/automations/event-permissions.js +38 -0
  26. package/dist/automations/event-permissions.js.map +1 -0
  27. package/dist/automations/events.d.ts +0 -10
  28. package/dist/automations/index.d.ts +12 -4
  29. package/dist/automations/index.js +9 -1
  30. package/dist/automations/notifications/applicable.d.ts +8 -0
  31. package/dist/automations/notifications/applicable.js +12 -0
  32. package/dist/automations/notifications/applicable.js.map +1 -0
  33. package/dist/automations/notifications/debounce.d.ts +25 -0
  34. package/dist/automations/notifications/debounce.js +93 -0
  35. package/dist/automations/notifications/debounce.js.map +1 -0
  36. package/dist/automations/notifications/defaults.d.ts +8 -0
  37. package/dist/automations/notifications/defaults.js +346 -0
  38. package/dist/automations/notifications/defaults.js.map +1 -0
  39. package/dist/automations/notifications/delivery.d.ts +28 -0
  40. package/dist/automations/notifications/delivery.js +88 -0
  41. package/dist/automations/notifications/delivery.js.map +1 -0
  42. package/dist/automations/notifications/processor.d.ts +64 -0
  43. package/dist/automations/notifications/processor.js +270 -0
  44. package/dist/automations/notifications/processor.js.map +1 -0
  45. package/dist/automations/notifications/rules/content.d.ts +6 -0
  46. package/dist/automations/notifications/rules/content.js +96 -0
  47. package/dist/automations/notifications/rules/content.js.map +1 -0
  48. package/dist/automations/notifications/rules/discussion.d.ts +7 -0
  49. package/dist/automations/notifications/rules/discussion.js +678 -0
  50. package/dist/automations/notifications/rules/discussion.js.map +1 -0
  51. package/dist/automations/notifications/rules/entitlements.d.ts +6 -0
  52. package/dist/automations/notifications/rules/entitlements.js +276 -0
  53. package/dist/automations/notifications/rules/entitlements.js.map +1 -0
  54. package/dist/automations/notifications/rules/events.d.ts +9 -0
  55. package/dist/automations/notifications/rules/events.js +27 -0
  56. package/dist/automations/notifications/rules/events.js.map +1 -0
  57. package/dist/automations/notifications/rules/index.d.ts +6 -0
  58. package/dist/automations/notifications/rules/index.js +15 -0
  59. package/dist/automations/notifications/rules/index.js.map +1 -0
  60. package/dist/automations/notifications/rules/organizations.d.ts +6 -0
  61. package/dist/automations/notifications/rules/organizations.js +35 -0
  62. package/dist/automations/notifications/rules/organizations.js.map +1 -0
  63. package/dist/automations/notifications/rules/recipients.d.ts +32 -0
  64. package/dist/automations/notifications/rules/recipients.js +98 -0
  65. package/dist/automations/notifications/rules/recipients.js.map +1 -0
  66. package/dist/automations/notifications/service.d.ts +29 -0
  67. package/dist/automations/notifications/service.js +45 -0
  68. package/dist/automations/notifications/service.js.map +1 -0
  69. package/dist/automations/notifications/types.d.ts +7 -0
  70. package/dist/automations/notifications/types.js +560 -0
  71. package/dist/automations/notifications/types.js.map +1 -0
  72. package/dist/automations/ports.d.ts +134 -21
  73. package/dist/automations/service.d.ts +30 -30
  74. package/dist/automations/service.js +111 -144
  75. package/dist/automations/service.js.map +1 -1
  76. package/dist/content/event-sight.d.ts +11 -0
  77. package/dist/content/event-sight.js +11 -0
  78. package/dist/content/event-sight.js.map +1 -0
  79. package/dist/content/events.d.ts +437 -46
  80. package/dist/content/events.js +45 -1
  81. package/dist/content/events.js.map +1 -1
  82. package/dist/content/index.d.ts +8 -4
  83. package/dist/content/index.js +5 -1
  84. package/dist/content/jobs.d.ts +16 -0
  85. package/dist/content/jobs.js +37 -0
  86. package/dist/content/jobs.js.map +1 -0
  87. package/dist/content/model.d.ts +2 -2
  88. package/dist/content/notification-categories.d.ts +37 -0
  89. package/dist/content/notification-categories.js +73 -0
  90. package/dist/content/notification-categories.js.map +1 -0
  91. package/dist/content/ports.d.ts +132 -68
  92. package/dist/content/service.d.ts +100 -68
  93. package/dist/content/service.js +703 -146
  94. package/dist/content/service.js.map +1 -1
  95. package/dist/content/titles.d.ts +25 -0
  96. package/dist/content/titles.js +82 -0
  97. package/dist/content/titles.js.map +1 -0
  98. package/dist/content/types.d.ts +2 -2
  99. package/dist/discussion/authors.d.ts +4 -2
  100. package/dist/discussion/authors.js +9 -5
  101. package/dist/discussion/authors.js.map +1 -1
  102. package/dist/discussion/chats.d.ts +63 -39
  103. package/dist/discussion/chats.js +455 -190
  104. package/dist/discussion/chats.js.map +1 -1
  105. package/dist/discussion/digests.d.ts +24 -0
  106. package/dist/discussion/digests.js +104 -0
  107. package/dist/discussion/digests.js.map +1 -0
  108. package/dist/discussion/events.d.ts +227 -23
  109. package/dist/discussion/events.js +114 -19
  110. package/dist/discussion/events.js.map +1 -1
  111. package/dist/discussion/index.d.ts +12 -4
  112. package/dist/discussion/index.js +9 -2
  113. package/dist/discussion/jobs.d.ts +16 -0
  114. package/dist/discussion/jobs.js +40 -0
  115. package/dist/discussion/jobs.js.map +1 -0
  116. package/dist/discussion/live.d.ts +106 -0
  117. package/dist/discussion/live.js +642 -0
  118. package/dist/discussion/live.js.map +1 -0
  119. package/dist/discussion/mentions.d.ts +11 -0
  120. package/dist/discussion/mentions.js +35 -0
  121. package/dist/discussion/mentions.js.map +1 -0
  122. package/dist/discussion/ports.d.ts +279 -114
  123. package/dist/discussion/ports.js.map +1 -1
  124. package/dist/discussion/posts.d.ts +60 -44
  125. package/dist/discussion/posts.js +453 -287
  126. package/dist/discussion/posts.js.map +1 -1
  127. package/dist/discussion/rules.d.ts +18 -0
  128. package/dist/discussion/rules.js +22 -0
  129. package/dist/discussion/rules.js.map +1 -0
  130. package/dist/discussion/service.d.ts +50 -35
  131. package/dist/discussion/service.js +333 -205
  132. package/dist/discussion/service.js.map +1 -1
  133. package/dist/discussion/subscriptions.d.ts +37 -0
  134. package/dist/discussion/subscriptions.js +115 -0
  135. package/dist/discussion/subscriptions.js.map +1 -0
  136. package/dist/discussion/titles.d.ts +28 -0
  137. package/dist/discussion/titles.js +98 -0
  138. package/dist/discussion/titles.js.map +1 -0
  139. package/dist/entitlements/events.d.ts +20 -20
  140. package/dist/entitlements/index.d.ts +5 -4
  141. package/dist/entitlements/index.js +3 -2
  142. package/dist/entitlements/jobs.d.ts +12 -0
  143. package/dist/entitlements/jobs.js +18 -0
  144. package/dist/entitlements/jobs.js.map +1 -0
  145. package/dist/entitlements/model.d.ts +2 -2
  146. package/dist/entitlements/ports.d.ts +68 -38
  147. package/dist/entitlements/rules.d.ts +3 -6
  148. package/dist/entitlements/rules.js +5 -10
  149. package/dist/entitlements/rules.js.map +1 -1
  150. package/dist/entitlements/service.d.ts +43 -28
  151. package/dist/entitlements/service.js +387 -160
  152. package/dist/entitlements/service.js.map +1 -1
  153. package/dist/identity/devices.d.ts +30 -0
  154. package/dist/identity/devices.js +109 -0
  155. package/dist/identity/devices.js.map +1 -0
  156. package/dist/identity/index.d.ts +6 -5
  157. package/dist/identity/index.js +4 -3
  158. package/dist/identity/model.d.ts +2 -2
  159. package/dist/identity/notification-settings.d.ts +28 -0
  160. package/dist/identity/notification-settings.js +114 -0
  161. package/dist/identity/notification-settings.js.map +1 -0
  162. package/dist/identity/ports.d.ts +80 -56
  163. package/dist/identity/service.d.ts +8 -7
  164. package/dist/identity/service.js +17 -13
  165. package/dist/identity/service.js.map +1 -1
  166. package/dist/integrations/ports.d.ts +9 -8
  167. package/dist/integrations/service.d.ts +9 -8
  168. package/dist/integrations/service.js +33 -16
  169. package/dist/integrations/service.js.map +1 -1
  170. package/dist/organizations/default-roles.d.ts +22 -0
  171. package/dist/organizations/default-roles.js +89 -0
  172. package/dist/organizations/default-roles.js.map +1 -0
  173. package/dist/organizations/effective-permissions.d.ts +45 -0
  174. package/dist/organizations/effective-permissions.js +113 -0
  175. package/dist/organizations/effective-permissions.js.map +1 -0
  176. package/dist/organizations/events.d.ts +320 -181
  177. package/dist/organizations/events.js +90 -18
  178. package/dist/organizations/events.js.map +1 -1
  179. package/dist/organizations/index.d.ts +15 -10
  180. package/dist/organizations/index.js +8 -3
  181. package/dist/organizations/members.d.ts +66 -8
  182. package/dist/organizations/members.js.map +1 -1
  183. package/dist/organizations/notification-catalog.d.ts +31 -0
  184. package/dist/organizations/notification-catalog.js +32 -0
  185. package/dist/organizations/notification-catalog.js.map +1 -0
  186. package/dist/organizations/notification-categories.d.ts +34 -0
  187. package/dist/organizations/notification-categories.js +66 -0
  188. package/dist/organizations/notification-categories.js.map +1 -0
  189. package/dist/organizations/org-roles.d.ts +33 -0
  190. package/dist/organizations/org-roles.js +49 -0
  191. package/dist/organizations/org-roles.js.map +1 -0
  192. package/dist/organizations/permissions.d.ts +311 -0
  193. package/dist/organizations/permissions.js +327 -0
  194. package/dist/organizations/permissions.js.map +1 -0
  195. package/dist/organizations/ports.d.ts +187 -65
  196. package/dist/organizations/service.d.ts +104 -35
  197. package/dist/organizations/service.js +1247 -323
  198. package/dist/organizations/service.js.map +1 -1
  199. package/dist/organizations/testing.d.ts +18 -0
  200. package/dist/organizations/testing.js +37 -0
  201. package/dist/organizations/testing.js.map +1 -0
  202. package/dist/organizations/types.d.ts +5 -16
  203. package/dist/progress/index.d.ts +2 -2
  204. package/dist/progress/ports.d.ts +11 -3
  205. package/dist/progress/service.d.ts +6 -5
  206. package/dist/progress/service.js +23 -8
  207. package/dist/progress/service.js.map +1 -1
  208. package/dist/reporting/admin/index.d.ts +6 -4
  209. package/dist/reporting/admin/model.d.ts +36 -3
  210. package/dist/reporting/admin/ports.d.ts +39 -14
  211. package/dist/reporting/admin/service.d.ts +32 -11
  212. package/dist/reporting/admin/service.js +102 -18
  213. package/dist/reporting/admin/service.js.map +1 -1
  214. package/dist/reporting/events/index.d.ts +27 -0
  215. package/dist/reporting/events/index.js +20 -0
  216. package/dist/reporting/events/index.js.map +1 -0
  217. package/dist/reporting/member/calendar.d.ts +11 -0
  218. package/dist/reporting/member/calendar.js +75 -0
  219. package/dist/reporting/member/calendar.js.map +1 -0
  220. package/dist/reporting/member/index.d.ts +3 -2
  221. package/dist/reporting/member/model.d.ts +80 -26
  222. package/dist/reporting/member/ports.d.ts +50 -28
  223. package/dist/reporting/member/service.d.ts +81 -35
  224. package/dist/reporting/member/service.js +438 -145
  225. package/dist/reporting/member/service.js.map +1 -1
  226. package/dist/shared/actor.d.ts +22 -3
  227. package/dist/shared/errors.d.ts +15 -2
  228. package/dist/shared/errors.js +21 -2
  229. package/dist/shared/errors.js.map +1 -1
  230. package/dist/shared/id.d.ts +7 -0
  231. package/dist/shared/id.js +8 -1
  232. package/dist/shared/id.js.map +1 -1
  233. package/dist/shared/logger.d.ts +2 -1
  234. package/dist/shared/logger.js +10 -1
  235. package/dist/shared/logger.js.map +1 -1
  236. package/dist/shared/mailer.d.ts +11 -1
  237. package/dist/shared/mailer.js +32 -5
  238. package/dist/shared/mailer.js.map +1 -1
  239. package/dist/shared/notification-categories.d.ts +16 -0
  240. package/dist/shared/notification-categories.js +94 -0
  241. package/dist/shared/notification-categories.js.map +1 -0
  242. package/dist/shared/notification-settings.d.ts +14 -0
  243. package/dist/shared/notification-settings.js +61 -0
  244. package/dist/shared/notification-settings.js.map +1 -0
  245. package/dist/shared/ports.d.ts +68 -2
  246. package/dist/shared/settings.d.ts +2 -1
  247. package/dist/shared/settings.js +1 -0
  248. package/dist/shared/settings.js.map +1 -1
  249. package/dist/types/automations.d.ts +8 -2
  250. package/dist/types/content.d.ts +2 -2
  251. package/dist/types/discussion.d.ts +4 -5
  252. package/dist/types/email-templates.d.ts +119 -6
  253. package/dist/types/entitlements.d.ts +2 -2
  254. package/dist/types/identity.d.ts +14 -17
  255. package/dist/types/index.d.ts +13 -12
  256. package/dist/types/index.js +2 -1
  257. package/dist/types/notifications.d.ts +157 -0
  258. package/dist/types/notifications.js +1 -0
  259. package/dist/types/organizations.d.ts +3 -2
  260. package/dist/types/ports.d.ts +8 -1
  261. package/dist/types/ports.js +7 -1
  262. package/dist/types/ports.js.map +1 -0
  263. package/dist/types/schemas/assets.d.ts +5 -5
  264. package/dist/types/schemas/assets.js +4 -3
  265. package/dist/types/schemas/assets.js.map +1 -1
  266. package/dist/types/schemas/automations.d.ts +1 -10
  267. package/dist/types/schemas/automations.js +1 -3
  268. package/dist/types/schemas/automations.js.map +1 -1
  269. package/dist/types/schemas/content.d.ts +596 -11
  270. package/dist/types/schemas/content.js +225 -9
  271. package/dist/types/schemas/content.js.map +1 -1
  272. package/dist/types/schemas/discussion.d.ts +362 -66
  273. package/dist/types/schemas/discussion.js +123 -15
  274. package/dist/types/schemas/discussion.js.map +1 -1
  275. package/dist/types/schemas/entitlements.d.ts +14 -1
  276. package/dist/types/schemas/entitlements.js +11 -4
  277. package/dist/types/schemas/entitlements.js.map +1 -1
  278. package/dist/types/schemas/identity.d.ts +1 -85
  279. package/dist/types/schemas/identity.js +1 -42
  280. package/dist/types/schemas/identity.js.map +1 -1
  281. package/dist/types/schemas/index.d.ts +8 -7
  282. package/dist/types/schemas/index.js +8 -7
  283. package/dist/types/schemas/notifications.d.ts +96 -0
  284. package/dist/types/schemas/notifications.js +57 -0
  285. package/dist/types/schemas/notifications.js.map +1 -0
  286. package/dist/types/schemas/organizations.d.ts +96 -60
  287. package/dist/types/schemas/organizations.js +78 -27
  288. package/dist/types/schemas/organizations.js.map +1 -1
  289. package/dist/types/schemas/progress.d.ts +0 -1
  290. package/dist/types/schemas/progress.js +0 -1
  291. package/dist/types/schemas/progress.js.map +1 -1
  292. package/package.json +1 -1
  293. package/dist/automations/community-notifications.d.ts +0 -16
  294. package/dist/automations/community-notifications.js +0 -84
  295. package/dist/automations/community-notifications.js.map +0 -1
  296. package/dist/automations/seeds.d.ts +0 -17
  297. package/dist/automations/seeds.js +0 -235
  298. package/dist/automations/seeds.js.map +0 -1
  299. package/dist/identity/notifications.d.ts +0 -27
  300. package/dist/identity/notifications.js +0 -101
  301. package/dist/identity/notifications.js.map +0 -1
  302. package/dist/organizations/access-scopes.d.ts +0 -19
  303. package/dist/organizations/access-scopes.js +0 -89
  304. package/dist/organizations/access-scopes.js.map +0 -1
  305. package/dist/organizations/roles.d.ts +0 -19
  306. package/dist/organizations/roles.js +0 -82
  307. package/dist/organizations/roles.js.map +0 -1
@@ -1,14 +1,18 @@
1
- import { ActivityView, CourseView, DownloadFile, DownloadView, Module } from "../../types/schemas/content.js";
2
- import { NotificationKind } from "../../types/schemas/identity.js";
1
+ import { JsonValue } from "../../types/shared.js";
2
+ import { ActivityView, CourseView, DigestSchedule, DownloadFile, DownloadView, EventAttendee, MemberEvent, MemberEventSummary, MemberEventsQuery, Module } from "../../types/schemas/content.js";
3
+ import { Permission } from "../../types/schemas/organizations.js";
4
+ import { SubscriptionView } from "../../types/schemas/discussion.js";
5
+ import { Reason, Scope, SubjectRef } from "../../types/notifications.js";
6
+ import "../../types/index.js";
3
7
  import "../../content/index.js";
4
- import "../../identity/index.js";
8
+ import { EventAttendeeRow, EventReader } from "../events/index.js";
9
+ import { ResolvedChannel } from "../../shared/notification-settings.js";
5
10
  //#region src/reporting/member/model.d.ts
6
11
  /** Per-course progress for the student surface. Derived on read against the
7
12
  * current published structure — never stored. */
8
13
  interface DirectoryRow {
9
14
  orgUserId: string;
10
15
  userId: string;
11
- role: string;
12
16
  displayName: string | null;
13
17
  headline: string | null;
14
18
  bio: string | null;
@@ -21,6 +25,25 @@ interface DirectoryQuery {
21
25
  }
22
26
  interface DirectoryEntry extends DirectoryRow {
23
27
  imageUrl: string | null;
28
+ team: boolean;
29
+ roleName: string | null;
30
+ opensEverySpace: boolean;
31
+ }
32
+ interface MemberViewer {
33
+ orgUserId: string;
34
+ orgRole: {
35
+ key: string;
36
+ name: string;
37
+ };
38
+ permissions: Permission[];
39
+ orgPermissions: Permission[];
40
+ }
41
+ interface CommunityViewer {
42
+ permissions: Permission[];
43
+ opensEverySpace: boolean;
44
+ team: boolean;
45
+ roleName: string;
46
+ canCreateEvents: boolean;
24
47
  }
25
48
  interface CommunityHomeLink {
26
49
  id: string;
@@ -53,6 +76,7 @@ interface OpenCommunitySpace extends CommunityHomeSpaceBase {
53
76
  name: string;
54
77
  }[];
55
78
  links: CommunityHomeLink[];
79
+ subscription: SubscriptionView | null;
56
80
  }
57
81
  type CommunityHomeSpace = LockedCommunitySpace | OpenCommunitySpace;
58
82
  interface CommunityHome {
@@ -63,13 +87,14 @@ interface CommunityHome {
63
87
  dm: {
64
88
  enabled: boolean;
65
89
  memberToMember: boolean;
66
- memberToStaff: boolean;
67
- staffToAnyone: boolean;
90
+ memberToTeam: boolean;
91
+ teamToAnyone: boolean;
68
92
  firstMessageIsRequest: boolean;
69
93
  groupChats: boolean;
70
94
  groupSize: number;
71
95
  };
72
96
  spaces: CommunityHomeSpace[];
97
+ viewer: CommunityViewer;
73
98
  }
74
99
  interface CourseProgressView {
75
100
  /** Keyed by activity id; absent key = not started. */
@@ -81,18 +106,20 @@ interface CourseProgressView {
81
106
  /** Per-activity reported state (the record's position map); absent key = none reported. */
82
107
  positions: Record<string, unknown>;
83
108
  }
84
- /** One of the viewer's notifications, with the names of what it refers to.
85
- * A post or chat the viewer can no longer see comes back null. */
109
+ interface NotificationItemView {
110
+ type: SubjectRef['type'];
111
+ id: string;
112
+ title?: string;
113
+ excerpt?: string;
114
+ }
86
115
  interface NotificationView {
87
116
  id: string;
88
- kind: NotificationKind;
89
- createdAt: Date;
90
- readAt: Date | null;
91
- actor: {
92
- orgUserId: string;
93
- displayName: string | null;
94
- imageUrl: string | null;
95
- } | null;
117
+ type: string;
118
+ scope: Scope;
119
+ reasons: Reason[];
120
+ matchedReason: Reason;
121
+ category: string;
122
+ display: Record<string, JsonValue>;
96
123
  community: {
97
124
  id: string;
98
125
  title: string;
@@ -101,16 +128,22 @@ interface NotificationView {
101
128
  id: string;
102
129
  name: string;
103
130
  } | null;
104
- post: {
105
- id: string;
106
- title: string;
107
- } | null;
108
- commentId: string | null;
109
- chat: {
110
- id: string;
111
- title: string;
131
+ actor: {
132
+ orgUserId: string;
133
+ name: string | null;
134
+ imageUrl: string | null;
112
135
  } | null;
113
- messageId: string | null;
136
+ subject: NotificationItemView | null;
137
+ parent: NotificationItemView | null;
138
+ createdAt: Date;
139
+ readAt: Date | null;
140
+ }
141
+ interface NotificationUnreadCounts {
142
+ org: number;
143
+ communities: {
144
+ communityId: string;
145
+ unread: number;
146
+ }[];
114
147
  }
115
148
  interface NotificationsView {
116
149
  rows: NotificationView[];
@@ -119,6 +152,27 @@ interface NotificationsView {
119
152
  pageSize: number;
120
153
  unreadCount: number;
121
154
  }
155
+ interface SettingsChannelView extends ResolvedChannel {
156
+ default: boolean;
157
+ }
158
+ interface NotificationSettingsCategoryView {
159
+ key: string;
160
+ perSpace: boolean;
161
+ channels: SettingsChannelView[];
162
+ spaces?: {
163
+ spaceId: string;
164
+ name: string;
165
+ channels: SettingsChannelView[];
166
+ }[];
167
+ }
168
+ interface CommunityNotificationSettingsView {
169
+ communityId: string;
170
+ digest: DigestSchedule | null;
171
+ categories: NotificationSettingsCategoryView[];
172
+ }
173
+ interface OrgNotificationSettingsView {
174
+ categories: NotificationSettingsCategoryView[];
175
+ }
122
176
  //#endregion
123
- export { type ActivityView, CommunityHome, CommunityHomeLink, CommunityHomeSpace, CourseProgressView, type CourseView, DirectoryEntry, DirectoryQuery, DirectoryRow, type DownloadFile, type DownloadView, LockedCommunitySpace, type Module, NotificationView, NotificationsView, OpenCommunitySpace };
177
+ export { type ActivityView, CommunityHome, CommunityHomeLink, CommunityHomeSpace, CommunityNotificationSettingsView, CommunityViewer, CourseProgressView, type CourseView, DirectoryEntry, DirectoryQuery, DirectoryRow, type DownloadFile, type DownloadView, type EventAttendee, type EventAttendeeRow, type EventReader, LockedCommunitySpace, type MemberEvent, type MemberEventSummary, type MemberEventsQuery, MemberViewer, type Module, NotificationItemView, NotificationSettingsCategoryView, NotificationUnreadCounts, NotificationView, NotificationsView, OpenCommunitySpace, OrgNotificationSettingsView, SettingsChannelView };
124
178
  //# sourceMappingURL=model.d.ts.map
@@ -1,44 +1,66 @@
1
1
  import { Page } from "../../types/shared.js";
2
- import { ActivityView, CourseView, DownloadFile, DownloadView, Module } from "../../types/schemas/content.js";
3
- import { Notification } from "../../types/schemas/identity.js";
2
+ import { ActivityView, CourseView, DownloadFile, DownloadView, EventAttendee, MemberEvent, MemberEventSummary, MemberEventsQuery, Module } from "../../types/schemas/content.js";
3
+ import { NotificationFilter } from "../../types/notifications.js";
4
4
  import "../../types/index.js";
5
5
  import { Actor } from "../../shared/actor.js";
6
+ import { MemberActor } from "../../identity/ports.js";
6
7
  import "../../identity/index.js";
7
- import { CommunityHome, CommunityHomeSpace, CourseProgressView, DirectoryEntry, DirectoryQuery, DirectoryRow, NotificationView, NotificationsView } from "./model.js";
8
+ import { EventAttendeeRow, EventFaces, EventReader } from "../events/index.js";
9
+ import { CommunityHome, CommunityHomeSpace, CommunityNotificationSettingsView, CourseProgressView, DirectoryEntry, DirectoryQuery, DirectoryRow, MemberViewer, NotificationUnreadCounts, NotificationView, NotificationsView, OrgNotificationSettingsView } from "./model.js";
8
10
  //#region src/reporting/member/ports.d.ts
9
11
  interface MemberReportService {
10
- listCourses(orgId: string, orgUserId: string): Promise<CourseView[]>;
11
- getCourse(orgId: string, orgUserId: string, courseId: string): Promise<CourseView | null>;
12
- listModules(orgId: string, orgUserId: string, courseId: string): Promise<Module[] | null>;
13
- listActivities(orgId: string, orgUserId: string, courseId: string): Promise<ActivityView[] | null>;
14
- courseProgress(orgId: string, orgUserId: string, courseId: string): Promise<CourseProgressView | null>;
15
- listDownloads(orgId: string, orgUserId: string): Promise<DownloadView[]>;
16
- getDownload(orgId: string, orgUserId: string, downloadId: string): Promise<{
12
+ /** Who the caller is in the org, and the permissions they hold. */
13
+ viewer(actor: Actor): MemberViewer;
14
+ listCourses(actor: Actor): Promise<CourseView[]>;
15
+ getCourse(courseId: string, actor: Actor): Promise<CourseView>;
16
+ listModules(courseId: string, actor: Actor): Promise<Module[]>;
17
+ listActivities(courseId: string, actor: Actor): Promise<ActivityView[]>;
18
+ courseProgress(courseId: string, actor: Actor): Promise<CourseProgressView>;
19
+ listDownloads(actor: Actor): Promise<DownloadView[]>;
20
+ getDownload(downloadId: string, actor: Actor): Promise<{
17
21
  download: DownloadView;
18
22
  assets: DownloadFile[];
19
- } | null>;
20
- /** Signed URL of a course, download or community thumbnail: published, or staff. */
21
- thumbnailFile(orgId: string, actor: Actor, owner: 'course' | 'download' | 'community', id: string): Promise<string | null>;
22
- /** Signed URL of an asset the activity links, for a student who can open its course. */
23
- activityFile(orgId: string, actor: Actor, activityId: string, assetId: string): Promise<string | null>;
24
- /** Signed download URL of a file in a download the student can open. */
25
- downloadFile(orgId: string, actor: Actor, downloadId: string, assetId: string): Promise<string | null>;
26
- /** Signed URL of an org user's profile photo, when it belongs to this org. */
27
- personImage(orgId: string, orgUserId: string): Promise<string | null>;
28
- directory(orgId: string, actor: Actor, communityId: string, query: DirectoryQuery): Promise<Page<DirectoryEntry> | null>;
29
- communityHome(orgId: string, actor: Actor, communityId: string): Promise<CommunityHome | null>;
30
- communitySpace(orgId: string, actor: Actor, communityId: string, spaceId: string): Promise<CommunityHomeSpace | null>;
31
- notifications(orgId: string, actor: Actor, userId: string, query: {
23
+ }>;
24
+ /** Signed URL of a course, download or community thumbnail: published, or the item's read
25
+ * permission. An event's when the caller can read the event. */
26
+ thumbnailFile(owner: 'course' | 'download' | 'community' | 'event', id: string, actor: Actor): Promise<string>;
27
+ getEvent(eventId: string, actor: Actor): Promise<MemberEvent>;
28
+ listEvents(query: MemberEventsQuery, actor: Actor): Promise<Page<MemberEventSummary>>;
29
+ eventCalendar(eventId: string, actor: Actor): Promise<string>;
30
+ eventAttendees(eventId: string, query: {
32
31
  page: number;
33
32
  pageSize: number;
34
- }): Promise<NotificationsView>;
35
- /** One notification the way `notifications` lists it. */
36
- notificationView(orgId: string, actor: Actor, notification: Notification): Promise<NotificationView>;
33
+ }, actor: Actor): Promise<Page<EventAttendee>>;
34
+ eventFile(eventId: string, assetId: string, actor: Actor): Promise<string>;
35
+ /** Signed URL of an asset the activity links, for a person who can open its course. */
36
+ activityFile(activityId: string, assetId: string, actor: Actor): Promise<string>;
37
+ /** Signed download URL of a file in a download the person can open. */
38
+ downloadFile(downloadId: string, assetId: string, actor: Actor): Promise<string>;
39
+ directory(communityId: string, query: DirectoryQuery, actor: Actor): Promise<Page<DirectoryEntry>>;
40
+ communityHome(communityId: string, actor: Actor): Promise<CommunityHome>;
41
+ communitySpace(communityId: string, spaceId: string, actor: Actor): Promise<CommunityHomeSpace>;
42
+ notifications(filter: NotificationFilter, page: {
43
+ page: number;
44
+ pageSize: number;
45
+ }, actor: MemberActor): Promise<NotificationsView>;
46
+ notification(notificationId: string, actor: MemberActor): Promise<NotificationView>;
47
+ notificationUnreadCounts(actor: MemberActor): Promise<NotificationUnreadCounts>;
48
+ /** The person's notification settings in a community they can open, resolved per channel. */
49
+ communityNotificationSettings(communityId: string, actor: MemberActor): Promise<CommunityNotificationSettingsView>;
50
+ /** The person's notification settings for the org's categories. */
51
+ orgNotificationSettings(actor: MemberActor): Promise<OrgNotificationSettingsView>;
37
52
  }
38
53
  interface MemberReportRepository {
39
- directory(orgId: string, communityId: string, query: DirectoryQuery): Promise<Page<DirectoryRow>>;
40
- spaceMemberCounts(orgId: string, communityId: string): Promise<Record<string, number>>;
54
+ directory(orgId: string, communityId: string, query: DirectoryQuery, readerIds: string[]): Promise<Page<DirectoryRow>>;
55
+ spaceMemberCounts(orgId: string, communityId: string, excluding: string[]): Promise<Record<string, number>>;
41
56
  people(orgId: string, orgUserIds: string[]): Promise<DirectoryRow[]>;
57
+ eventAttendees(orgId: string, eventId: string, page: {
58
+ page: number;
59
+ pageSize: number;
60
+ }): Promise<Page<EventAttendeeRow>>;
61
+ eventFaces(orgId: string, eventIds: string[], limit: number): Promise<Record<string, EventFaces>>;
62
+ directEventGrants(orgId: string, orgUserId: string, eventIds: string[]): Promise<string[]>;
63
+ events(orgId: string, query: MemberEventsQuery, reader: EventReader, now: Date): Promise<Page<string>>;
42
64
  }
43
65
  //#endregion
44
66
  export { MemberReportRepository, MemberReportService };
@@ -1,35 +1,55 @@
1
1
  import { Page } from "../../types/shared.js";
2
- import { ActivityView, CourseView, DownloadFile, DownloadView, Module } from "../../types/schemas/content.js";
3
- import { Notification } from "../../types/schemas/identity.js";
2
+ import { ActivityView, CourseView, DownloadFile, DownloadView, EventAttendee, MemberEvent, MemberEventSummary, MemberEventsQuery, Module } from "../../types/schemas/content.js";
3
+ import { NotificationFilter } from "../../types/notifications.js";
4
4
  import "../../types/index.js";
5
+ import { Actor } from "../../shared/actor.js";
6
+ import { ChannelRegistry, NotificationCategoryService } from "../../shared/ports.js";
5
7
  import { FileUrls } from "../../assets/file-urls.js";
6
8
  import { AssetFiles } from "../../assets/ports.js";
7
9
  import "../../assets/index.js";
8
- import { Actor } from "../../shared/actor.js";
9
- import { ContentService } from "../../content/ports.js";
10
+ import { ContentService, ItemTitles } from "../../content/ports.js";
10
11
  import "../../content/index.js";
11
- import { NotificationInbox } from "../../identity/ports.js";
12
- import "../../identity/index.js";
13
12
  import { EntitlementsService } from "../../entitlements/ports.js";
14
13
  import "../../entitlements/index.js";
15
- import { ChatService, PostService } from "../../discussion/ports.js";
14
+ import { MemberActor, NotificationSettingsService } from "../../identity/ports.js";
15
+ import "../../identity/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";
16
19
  import "../../discussion/index.js";
20
+ import { OrganizationService } from "../../organizations/ports.js";
21
+ import "../../organizations/index.js";
17
22
  import { ProgressService } from "../../progress/ports.js";
18
23
  import "../../progress/index.js";
19
- import { CommunityHome, CommunityHomeSpace, CourseProgressView, DirectoryEntry, DirectoryQuery, NotificationView, NotificationsView } from "./model.js";
24
+ import { CommunityHome, CommunityHomeSpace, CommunityNotificationSettingsView, CourseProgressView, DirectoryEntry, DirectoryQuery, MemberViewer, NotificationUnreadCounts, NotificationView, NotificationsView, OrgNotificationSettingsView } from "./model.js";
20
25
  import { MemberReportRepository, MemberReportService } from "./ports.js";
21
26
  //#region src/reporting/member/service.d.ts
22
- type MemberAccess = Pick<EntitlementsService, 'isCommunityMember' | 'openSpaceIds' | 'spaceStandings' | 'hasAccess' | 'listAccessibleContent'>;
27
+ type MemberAccess = Pick<EntitlementsService, 'isCommunityMember' | 'openSpaceIds' | 'spaceStandings' | 'hasAccess' | 'listAccessibleContent' | 'openCommunityIds' | 'opensEverySpace' | 'everySpaceOpeners'>;
28
+ type MemberContent = Pick<ContentService, 'findCourse' | 'listCourseModules' | 'listCourseActivityViews' | 'listCourseActivities' | 'listCourseActivityAssets' | 'getActivity' | 'findDownload' | 'listDownloadAssets' | 'findCommunity' | 'listSpaces' | 'getSpace' | 'findEvent' | 'findEvents' | 'eventFilesFor'>;
29
+ type MemberPeople = Pick<OrganizationService, 'systemActor' | 'permissionsOfMany' | 'holders'>;
30
+ type Owner = 'course' | 'download' | 'community' | 'event';
23
31
  type MemberReportServiceParams = {
24
32
  repo: MemberReportRepository;
25
- content: ContentService;
26
- progress: ProgressService;
33
+ content: MemberContent;
34
+ progress: Pick<ProgressService, 'get' | 'listByTargets'>;
27
35
  files: Pick<AssetFiles, 'signFile'>;
28
36
  fileUrls: FileUrls;
29
37
  access: MemberAccess;
30
- notifications: Pick<NotificationInbox, 'listNotifications'>;
31
- posts: Pick<PostService, 'visibleTitles'>;
32
- chats: Pick<ChatService, 'titlesFor'>;
38
+ people: MemberPeople;
39
+ notifications: Pick<NotificationsService, 'list' | 'get' | 'unreadCounts'>;
40
+ titles: {
41
+ discussion: ItemTitles$1;
42
+ content: ItemTitles;
43
+ };
44
+ subscriptions: Pick<SubscriptionService, 'viewerSubscriptions'>;
45
+ notificationCategories: {
46
+ community: Pick<NotificationCategoryService, 'get'>;
47
+ org: Pick<NotificationCategoryService, 'get'>;
48
+ };
49
+ notificationSettings: Pick<NotificationSettingsService, 'get'>;
50
+ channels: Pick<ChannelRegistry, 'list'>;
51
+ studentPortalUrl: string;
52
+ now?: () => Date;
33
53
  };
34
54
  declare class MemberReportServiceImpl implements MemberReportService {
35
55
  private readonly repo;
@@ -38,33 +58,59 @@ declare class MemberReportServiceImpl implements MemberReportService {
38
58
  private readonly files;
39
59
  private readonly fileUrls;
40
60
  private readonly access;
41
- private readonly inbox;
42
- private readonly posts;
43
- private readonly chats;
61
+ private readonly people;
62
+ private readonly notificationList;
63
+ private readonly titles;
64
+ private readonly subscriptions;
65
+ private readonly notificationCategories;
66
+ private readonly notificationSettings;
67
+ private readonly channels;
68
+ private readonly studentPortalUrl;
69
+ private readonly now;
44
70
  constructor(params: MemberReportServiceParams);
45
- notifications(orgId: string, actor: Actor, userId: string, query: {
71
+ private system;
72
+ viewer(actor: Actor): MemberViewer;
73
+ communityNotificationSettings(communityId: string, actor: MemberActor): Promise<CommunityNotificationSettingsView>;
74
+ orgNotificationSettings(actor: MemberActor): Promise<OrgNotificationSettingsView>;
75
+ private settingsView;
76
+ notifications(filter: NotificationFilter, page: {
46
77
  page: number;
47
78
  pageSize: number;
48
- }): Promise<NotificationsView>;
49
- notificationView(orgId: string, actor: Actor, notification: Notification): Promise<NotificationView>;
79
+ }, actor: MemberActor): Promise<NotificationsView>;
80
+ notification(notificationId: string, actor: MemberActor): Promise<NotificationView>;
81
+ notificationUnreadCounts(actor: MemberActor): Promise<NotificationUnreadCounts>;
50
82
  private describeNotifications;
51
- listCourses(orgId: string, orgUserId: string): Promise<CourseView[]>;
52
- getCourse(orgId: string, orgUserId: string, courseId: string): Promise<CourseView | null>;
53
- listModules(orgId: string, orgUserId: string, courseId: string): Promise<Module[] | null>;
54
- listActivities(orgId: string, orgUserId: string, courseId: string): Promise<ActivityView[] | null>;
55
- courseProgress(orgId: string, orgUserId: string, courseId: string): Promise<CourseProgressView | null>;
56
- listDownloads(orgId: string, orgUserId: string): Promise<DownloadView[]>;
57
- getDownload(orgId: string, orgUserId: string, downloadId: string): Promise<{
83
+ private opensCourse;
84
+ private opensDownload;
85
+ listCourses(actor: Actor): Promise<CourseView[]>;
86
+ private requireCourse;
87
+ getCourse(courseId: string, actor: Actor): Promise<CourseView>;
88
+ listModules(courseId: string, actor: Actor): Promise<Module[]>;
89
+ listActivities(courseId: string, actor: Actor): Promise<ActivityView[]>;
90
+ courseProgress(courseId: string, actor: Actor): Promise<CourseProgressView>;
91
+ listDownloads(actor: Actor): Promise<DownloadView[]>;
92
+ getDownload(downloadId: string, actor: Actor): Promise<{
58
93
  download: DownloadView;
59
94
  assets: DownloadFile[];
60
- } | null>;
61
- thumbnailFile(orgId: string, actor: Actor, owner: 'course' | 'download' | 'community', id: string): Promise<string | null>;
62
- activityFile(orgId: string, actor: Actor, activityId: string, assetId: string): Promise<string | null>;
63
- downloadFile(orgId: string, actor: Actor, downloadId: string, assetId: string): Promise<string | null>;
64
- personImage(orgId: string, orgUserId: string): Promise<string | null>;
65
- directory(orgId: string, actor: Actor, communityId: string, query: DirectoryQuery): Promise<Page<DirectoryEntry> | null>;
66
- communityHome(orgId: string, actor: Actor, communityId: string): Promise<CommunityHome | null>;
67
- communitySpace(orgId: string, actor: Actor, communityId: string, spaceId: string): Promise<CommunityHomeSpace | null>;
95
+ }>;
96
+ thumbnailFile(owner: Owner, id: string, actor: Actor): Promise<string>;
97
+ activityFile(activityId: string, assetId: string, actor: Actor): Promise<string>;
98
+ downloadFile(downloadId: string, assetId: string, actor: Actor): Promise<string>;
99
+ private seeEvents;
100
+ private requireEvent;
101
+ private eventSummaries;
102
+ private eventSummary;
103
+ getEvent(eventId: string, actor: Actor): Promise<MemberEvent>;
104
+ listEvents(query: MemberEventsQuery, actor: Actor): Promise<Page<MemberEventSummary>>;
105
+ eventCalendar(eventId: string, actor: Actor): Promise<string>;
106
+ eventAttendees(eventId: string, query: {
107
+ page: number;
108
+ pageSize: number;
109
+ }, actor: Actor): Promise<Page<EventAttendee>>;
110
+ eventFile(eventId: string, assetId: string, actor: Actor): Promise<string>;
111
+ directory(communityId: string, query: DirectoryQuery, actor: Actor): Promise<Page<DirectoryEntry>>;
112
+ communityHome(communityId: string, actor: Actor): Promise<CommunityHome>;
113
+ communitySpace(communityId: string, spaceId: string, actor: Actor): Promise<CommunityHomeSpace>;
68
114
  private homeSpaces;
69
115
  private linkViews;
70
116
  }