@headless-lms/core 0.4.0 → 0.6.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 (249) hide show
  1. package/dist/assets/events.d.ts +15 -9
  2. package/dist/assets/file-urls.d.ts +14 -7
  3. package/dist/assets/file-urls.js +15 -4
  4. package/dist/assets/file-urls.js.map +1 -1
  5. package/dist/assets/index.d.ts +4 -4
  6. package/dist/assets/index.js +3 -3
  7. package/dist/assets/ports.d.ts +34 -15
  8. package/dist/assets/service.d.ts +30 -14
  9. package/dist/assets/service.js +233 -54
  10. package/dist/assets/service.js.map +1 -1
  11. package/dist/automations/actions.js.map +1 -1
  12. package/dist/automations/catalog.js +68 -3
  13. package/dist/automations/catalog.js.map +1 -1
  14. package/dist/automations/community-derivations.js +16 -16
  15. package/dist/automations/community-derivations.js.map +1 -1
  16. package/dist/automations/community-mail.d.ts +34 -4
  17. package/dist/automations/community-mail.js +32 -4
  18. package/dist/automations/community-mail.js.map +1 -1
  19. package/dist/automations/event-permissions.d.ts +12 -0
  20. package/dist/automations/event-permissions.js +38 -0
  21. package/dist/automations/event-permissions.js.map +1 -0
  22. package/dist/automations/index.d.ts +2 -1
  23. package/dist/automations/index.js +2 -1
  24. package/dist/automations/notifications/applicable.d.ts +8 -0
  25. package/dist/automations/notifications/applicable.js +12 -0
  26. package/dist/automations/notifications/applicable.js.map +1 -0
  27. package/dist/automations/notifications/debounce.js +1 -1
  28. package/dist/automations/notifications/debounce.js.map +1 -1
  29. package/dist/automations/notifications/defaults.js +33 -3
  30. package/dist/automations/notifications/defaults.js.map +1 -1
  31. package/dist/automations/notifications/processor.js +1 -1
  32. package/dist/automations/notifications/processor.js.map +1 -1
  33. package/dist/automations/notifications/rules/content.js +60 -3
  34. package/dist/automations/notifications/rules/content.js.map +1 -1
  35. package/dist/automations/notifications/rules/discussion.js +29 -29
  36. package/dist/automations/notifications/rules/discussion.js.map +1 -1
  37. package/dist/automations/notifications/rules/entitlements.js +36 -9
  38. package/dist/automations/notifications/rules/entitlements.js.map +1 -1
  39. package/dist/automations/notifications/rules/events.d.ts +9 -0
  40. package/dist/automations/notifications/rules/events.js +27 -0
  41. package/dist/automations/notifications/rules/events.js.map +1 -0
  42. package/dist/automations/notifications/rules/organizations.js +17 -10
  43. package/dist/automations/notifications/rules/organizations.js.map +1 -1
  44. package/dist/automations/notifications/rules/recipients.js +0 -1
  45. package/dist/automations/notifications/rules/recipients.js.map +1 -1
  46. package/dist/automations/notifications/service.d.ts +8 -6
  47. package/dist/automations/notifications/service.js +12 -12
  48. package/dist/automations/notifications/service.js.map +1 -1
  49. package/dist/automations/notifications/types.js +94 -7
  50. package/dist/automations/notifications/types.js.map +1 -1
  51. package/dist/automations/ports.d.ts +30 -31
  52. package/dist/automations/service.d.ts +20 -17
  53. package/dist/automations/service.js +90 -61
  54. package/dist/automations/service.js.map +1 -1
  55. package/dist/content/event-sight.d.ts +11 -0
  56. package/dist/content/event-sight.js +11 -0
  57. package/dist/content/event-sight.js.map +1 -0
  58. package/dist/content/events.d.ts +465 -88
  59. package/dist/content/events.js +34 -1
  60. package/dist/content/events.js.map +1 -1
  61. package/dist/content/index.d.ts +6 -4
  62. package/dist/content/index.js +3 -1
  63. package/dist/content/jobs.d.ts +16 -0
  64. package/dist/content/jobs.js +37 -0
  65. package/dist/content/jobs.js.map +1 -0
  66. package/dist/content/model.d.ts +2 -2
  67. package/dist/content/notification-categories.d.ts +5 -4
  68. package/dist/content/notification-categories.js +15 -6
  69. package/dist/content/notification-categories.js.map +1 -1
  70. package/dist/content/ports.d.ts +113 -68
  71. package/dist/content/service.d.ts +103 -67
  72. package/dist/content/service.js +739 -152
  73. package/dist/content/service.js.map +1 -1
  74. package/dist/content/titles.d.ts +6 -3
  75. package/dist/content/titles.js +37 -24
  76. package/dist/content/titles.js.map +1 -1
  77. package/dist/content/types.d.ts +2 -2
  78. package/dist/discussion/authors.d.ts +4 -2
  79. package/dist/discussion/authors.js +9 -5
  80. package/dist/discussion/authors.js.map +1 -1
  81. package/dist/discussion/chats.d.ts +56 -37
  82. package/dist/discussion/chats.js +392 -160
  83. package/dist/discussion/chats.js.map +1 -1
  84. package/dist/discussion/events.d.ts +85 -47
  85. package/dist/discussion/events.js +41 -3
  86. package/dist/discussion/events.js.map +1 -1
  87. package/dist/discussion/index.d.ts +8 -5
  88. package/dist/discussion/index.js +5 -3
  89. package/dist/discussion/live.d.ts +106 -0
  90. package/dist/discussion/live.js +642 -0
  91. package/dist/discussion/live.js.map +1 -0
  92. package/dist/discussion/mentions.js +2 -2
  93. package/dist/discussion/mentions.js.map +1 -1
  94. package/dist/discussion/ports.d.ts +182 -100
  95. package/dist/discussion/ports.js.map +1 -1
  96. package/dist/discussion/posts.d.ts +45 -39
  97. package/dist/discussion/posts.js +266 -152
  98. package/dist/discussion/posts.js.map +1 -1
  99. package/dist/discussion/rules.d.ts +18 -0
  100. package/dist/discussion/rules.js +22 -0
  101. package/dist/discussion/rules.js.map +1 -0
  102. package/dist/discussion/service.d.ts +37 -31
  103. package/dist/discussion/service.js +250 -186
  104. package/dist/discussion/service.js.map +1 -1
  105. package/dist/discussion/subscriptions.d.ts +8 -8
  106. package/dist/discussion/subscriptions.js +28 -12
  107. package/dist/discussion/subscriptions.js.map +1 -1
  108. package/dist/discussion/titles.d.ts +4 -2
  109. package/dist/discussion/titles.js +27 -13
  110. package/dist/discussion/titles.js.map +1 -1
  111. package/dist/entitlements/events.d.ts +58 -58
  112. package/dist/entitlements/index.d.ts +4 -4
  113. package/dist/entitlements/index.js +2 -2
  114. package/dist/entitlements/model.d.ts +2 -2
  115. package/dist/entitlements/ports.d.ts +65 -39
  116. package/dist/entitlements/rules.d.ts +3 -6
  117. package/dist/entitlements/rules.js +5 -10
  118. package/dist/entitlements/rules.js.map +1 -1
  119. package/dist/entitlements/service.d.ts +40 -28
  120. package/dist/entitlements/service.js +369 -162
  121. package/dist/entitlements/service.js.map +1 -1
  122. package/dist/identity/devices.d.ts +3 -3
  123. package/dist/identity/devices.js +6 -4
  124. package/dist/identity/devices.js.map +1 -1
  125. package/dist/identity/index.d.ts +2 -2
  126. package/dist/identity/index.js +2 -2
  127. package/dist/identity/notification-settings.d.ts +1 -1
  128. package/dist/identity/notification-settings.js +2 -1
  129. package/dist/identity/notification-settings.js.map +1 -1
  130. package/dist/identity/ports.d.ts +7 -7
  131. package/dist/identity/service.d.ts +8 -7
  132. package/dist/identity/service.js +16 -12
  133. package/dist/identity/service.js.map +1 -1
  134. package/dist/integrations/events.d.ts +3 -3
  135. package/dist/integrations/ports.d.ts +9 -8
  136. package/dist/integrations/service.d.ts +9 -8
  137. package/dist/integrations/service.js +31 -14
  138. package/dist/integrations/service.js.map +1 -1
  139. package/dist/organizations/default-roles.d.ts +22 -0
  140. package/dist/organizations/default-roles.js +89 -0
  141. package/dist/organizations/default-roles.js.map +1 -0
  142. package/dist/organizations/effective-permissions.d.ts +47 -0
  143. package/dist/organizations/effective-permissions.js +118 -0
  144. package/dist/organizations/effective-permissions.js.map +1 -0
  145. package/dist/organizations/events.d.ts +326 -181
  146. package/dist/organizations/events.js +90 -18
  147. package/dist/organizations/events.js.map +1 -1
  148. package/dist/organizations/index.d.ts +14 -10
  149. package/dist/organizations/index.js +7 -3
  150. package/dist/organizations/members.d.ts +66 -8
  151. package/dist/organizations/members.js.map +1 -1
  152. package/dist/organizations/model.d.ts +2 -2
  153. package/dist/organizations/notification-catalog.d.ts +31 -0
  154. package/dist/organizations/notification-catalog.js +32 -0
  155. package/dist/organizations/notification-catalog.js.map +1 -0
  156. package/dist/organizations/notification-categories.d.ts +6 -4
  157. package/dist/organizations/notification-categories.js +25 -10
  158. package/dist/organizations/notification-categories.js.map +1 -1
  159. package/dist/organizations/org-roles.d.ts +33 -0
  160. package/dist/organizations/org-roles.js +49 -0
  161. package/dist/organizations/org-roles.js.map +1 -0
  162. package/dist/organizations/permissions.d.ts +311 -0
  163. package/dist/organizations/permissions.js +327 -0
  164. package/dist/organizations/permissions.js.map +1 -0
  165. package/dist/organizations/ports.d.ts +187 -65
  166. package/dist/organizations/service.d.ts +102 -35
  167. package/dist/organizations/service.js +1254 -327
  168. package/dist/organizations/service.js.map +1 -1
  169. package/dist/organizations/testing.d.ts +18 -0
  170. package/dist/organizations/testing.js +37 -0
  171. package/dist/organizations/testing.js.map +1 -0
  172. package/dist/organizations/types.d.ts +5 -16
  173. package/dist/progress/events.d.ts +14 -14
  174. package/dist/progress/index.d.ts +2 -2
  175. package/dist/progress/ports.d.ts +11 -3
  176. package/dist/progress/service.d.ts +6 -5
  177. package/dist/progress/service.js +21 -6
  178. package/dist/progress/service.js.map +1 -1
  179. package/dist/reporting/admin/index.d.ts +6 -4
  180. package/dist/reporting/admin/model.d.ts +36 -3
  181. package/dist/reporting/admin/ports.d.ts +39 -14
  182. package/dist/reporting/admin/service.d.ts +32 -11
  183. package/dist/reporting/admin/service.js +102 -18
  184. package/dist/reporting/admin/service.js.map +1 -1
  185. package/dist/reporting/events/index.d.ts +27 -0
  186. package/dist/reporting/events/index.js +20 -0
  187. package/dist/reporting/events/index.js.map +1 -0
  188. package/dist/reporting/member/calendar.d.ts +11 -0
  189. package/dist/reporting/member/calendar.js +75 -0
  190. package/dist/reporting/member/calendar.js.map +1 -0
  191. package/dist/reporting/member/index.d.ts +3 -2
  192. package/dist/reporting/member/model.d.ts +29 -5
  193. package/dist/reporting/member/ports.d.ts +49 -29
  194. package/dist/reporting/member/service.d.ts +57 -29
  195. package/dist/reporting/member/service.js +345 -114
  196. package/dist/reporting/member/service.js.map +1 -1
  197. package/dist/shared/actor.d.ts +23 -3
  198. package/dist/shared/errors.d.ts +2 -1
  199. package/dist/shared/errors.js +3 -1
  200. package/dist/shared/errors.js.map +1 -1
  201. package/dist/shared/id.d.ts +4 -0
  202. package/dist/shared/id.js +4 -0
  203. package/dist/shared/id.js.map +1 -1
  204. package/dist/shared/logger.d.ts +2 -1
  205. package/dist/shared/logger.js +10 -1
  206. package/dist/shared/logger.js.map +1 -1
  207. package/dist/shared/ports.d.ts +25 -5
  208. package/dist/types/content.d.ts +2 -2
  209. package/dist/types/discussion.d.ts +4 -5
  210. package/dist/types/email-templates.d.ts +22 -3
  211. package/dist/types/entitlements.d.ts +2 -2
  212. package/dist/types/identity.d.ts +13 -16
  213. package/dist/types/index.d.ts +9 -9
  214. package/dist/types/index.js +2 -1
  215. package/dist/types/notifications.d.ts +4 -4
  216. package/dist/types/organizations.d.ts +3 -2
  217. package/dist/types/ports.d.ts +8 -1
  218. package/dist/types/ports.js +7 -1
  219. package/dist/types/ports.js.map +1 -0
  220. package/dist/types/schemas/assets.d.ts +5 -5
  221. package/dist/types/schemas/assets.js +4 -3
  222. package/dist/types/schemas/assets.js.map +1 -1
  223. package/dist/types/schemas/content.d.ts +599 -13
  224. package/dist/types/schemas/content.js +219 -8
  225. package/dist/types/schemas/content.js.map +1 -1
  226. package/dist/types/schemas/discussion.d.ts +280 -57
  227. package/dist/types/schemas/discussion.js +77 -3
  228. package/dist/types/schemas/discussion.js.map +1 -1
  229. package/dist/types/schemas/entitlements.d.ts +21 -8
  230. package/dist/types/schemas/entitlements.js +11 -4
  231. package/dist/types/schemas/entitlements.js.map +1 -1
  232. package/dist/types/schemas/index.d.ts +5 -5
  233. package/dist/types/schemas/index.js +5 -5
  234. package/dist/types/schemas/notifications.d.ts +11 -10
  235. package/dist/types/schemas/notifications.js +3 -2
  236. package/dist/types/schemas/notifications.js.map +1 -1
  237. package/dist/types/schemas/organizations.d.ts +99 -60
  238. package/dist/types/schemas/organizations.js +80 -27
  239. package/dist/types/schemas/organizations.js.map +1 -1
  240. package/dist/types/schemas/progress.d.ts +3 -4
  241. package/dist/types/schemas/progress.js +0 -1
  242. package/dist/types/schemas/progress.js.map +1 -1
  243. package/package.json +1 -1
  244. package/dist/organizations/access-scopes.d.ts +0 -19
  245. package/dist/organizations/access-scopes.js +0 -89
  246. package/dist/organizations/access-scopes.js.map +0 -1
  247. package/dist/organizations/roles.d.ts +0 -19
  248. package/dist/organizations/roles.js +0 -82
  249. package/dist/organizations/roles.js.map +0 -1
@@ -54,13 +54,8 @@ declare const commentAuthorSchema: z.ZodObject<{
54
54
  image: z.ZodNullable<z.ZodString>;
55
55
  imageAssetId: z.ZodNullable<z.ZodString>;
56
56
  imageUrl: z.ZodNullable<z.ZodString>;
57
- role: z.ZodEnum<{
58
- owner: "owner";
59
- admin: "admin";
60
- instructor: "instructor";
61
- moderator: "moderator";
62
- student: "student";
63
- }>;
57
+ team: z.ZodBoolean;
58
+ roleName: z.ZodNullable<z.ZodString>;
64
59
  }, z.core.$strict>;
65
60
  type CommentAuthor = z.infer<typeof commentAuthorSchema>;
66
61
  declare const commentReactionSchema: z.ZodObject<{
@@ -132,13 +127,8 @@ declare const commentViewSchema: z.ZodObject<{
132
127
  image: z.ZodNullable<z.ZodString>;
133
128
  imageAssetId: z.ZodNullable<z.ZodString>;
134
129
  imageUrl: z.ZodNullable<z.ZodString>;
135
- role: z.ZodEnum<{
136
- owner: "owner";
137
- admin: "admin";
138
- instructor: "instructor";
139
- moderator: "moderator";
140
- student: "student";
141
- }>;
130
+ team: z.ZodBoolean;
131
+ roleName: z.ZodNullable<z.ZodString>;
142
132
  }, z.core.$strict>;
143
133
  body: z.ZodNullable<z.ZodString>;
144
134
  status: z.ZodEnum<{
@@ -155,13 +145,8 @@ declare const commentViewSchema: z.ZodObject<{
155
145
  image: z.ZodNullable<z.ZodString>;
156
146
  imageAssetId: z.ZodNullable<z.ZodString>;
157
147
  imageUrl: z.ZodNullable<z.ZodString>;
158
- role: z.ZodEnum<{
159
- owner: "owner";
160
- admin: "admin";
161
- instructor: "instructor";
162
- moderator: "moderator";
163
- student: "student";
164
- }>;
148
+ team: z.ZodBoolean;
149
+ roleName: z.ZodNullable<z.ZodString>;
165
150
  }, z.core.$strict>>;
166
151
  reactions: z.ZodRecord<z.ZodString, z.ZodNumber>;
167
152
  viewerReaction: z.ZodOptional<z.ZodString>;
@@ -183,13 +168,8 @@ declare const commentReportSummarySchema: z.ZodObject<{
183
168
  image: z.ZodNullable<z.ZodString>;
184
169
  imageAssetId: z.ZodNullable<z.ZodString>;
185
170
  imageUrl: z.ZodNullable<z.ZodString>;
186
- role: z.ZodEnum<{
187
- owner: "owner";
188
- admin: "admin";
189
- instructor: "instructor";
190
- moderator: "moderator";
191
- student: "student";
192
- }>;
171
+ team: z.ZodBoolean;
172
+ roleName: z.ZodNullable<z.ZodString>;
193
173
  }, z.core.$strict>;
194
174
  reason: z.ZodString;
195
175
  createdAt: z.ZodCoercedDate<unknown>;
@@ -216,13 +196,8 @@ declare const commentListItemSchema: z.ZodObject<{
216
196
  image: z.ZodNullable<z.ZodString>;
217
197
  imageAssetId: z.ZodNullable<z.ZodString>;
218
198
  imageUrl: z.ZodNullable<z.ZodString>;
219
- role: z.ZodEnum<{
220
- owner: "owner";
221
- admin: "admin";
222
- instructor: "instructor";
223
- moderator: "moderator";
224
- student: "student";
225
- }>;
199
+ team: z.ZodBoolean;
200
+ roleName: z.ZodNullable<z.ZodString>;
226
201
  }, z.core.$strict>;
227
202
  authorEmail: z.ZodEmail;
228
203
  removedBy: z.ZodNullable<z.ZodString>;
@@ -236,13 +211,8 @@ declare const commentListItemSchema: z.ZodObject<{
236
211
  image: z.ZodNullable<z.ZodString>;
237
212
  imageAssetId: z.ZodNullable<z.ZodString>;
238
213
  imageUrl: z.ZodNullable<z.ZodString>;
239
- role: z.ZodEnum<{
240
- owner: "owner";
241
- admin: "admin";
242
- instructor: "instructor";
243
- moderator: "moderator";
244
- student: "student";
245
- }>;
214
+ team: z.ZodBoolean;
215
+ roleName: z.ZodNullable<z.ZodString>;
246
216
  }, z.core.$strict>;
247
217
  reason: z.ZodString;
248
218
  createdAt: z.ZodCoercedDate<unknown>;
@@ -339,6 +309,18 @@ declare const postSchema: z.ZodObject<{
339
309
  updatedAt: z.ZodCoercedDate<unknown>;
340
310
  }, z.core.$strict>;
341
311
  type Post = z.output<typeof postSchema>;
312
+ declare const postAssetSchema: z.ZodObject<{
313
+ url: z.ZodString;
314
+ kind: z.ZodEnum<{
315
+ image: "image";
316
+ video: "video";
317
+ audio: "audio";
318
+ document: "document";
319
+ }>;
320
+ filename: z.ZodString;
321
+ size: z.ZodNumber;
322
+ }, z.core.$strict>;
323
+ type PostAsset = z.output<typeof postAssetSchema>;
342
324
  declare const postViewSchema: z.ZodObject<{
343
325
  orgId: z.ZodString;
344
326
  id: z.ZodString;
@@ -366,6 +348,17 @@ declare const postViewSchema: z.ZodObject<{
366
348
  createdAt: z.ZodCoercedDate<unknown>;
367
349
  updatedAt: z.ZodCoercedDate<unknown>;
368
350
  coverUrl: z.ZodNullable<z.ZodString>;
351
+ assets: z.ZodRecord<z.ZodString, z.ZodObject<{
352
+ url: z.ZodString;
353
+ kind: z.ZodEnum<{
354
+ image: "image";
355
+ video: "video";
356
+ audio: "audio";
357
+ document: "document";
358
+ }>;
359
+ filename: z.ZodString;
360
+ size: z.ZodNumber;
361
+ }, z.core.$strict>>;
369
362
  author: z.ZodObject<{
370
363
  id: z.ZodString;
371
364
  firstName: z.ZodNullable<z.ZodString>;
@@ -375,13 +368,8 @@ declare const postViewSchema: z.ZodObject<{
375
368
  image: z.ZodNullable<z.ZodString>;
376
369
  imageAssetId: z.ZodNullable<z.ZodString>;
377
370
  imageUrl: z.ZodNullable<z.ZodString>;
378
- role: z.ZodEnum<{
379
- owner: "owner";
380
- admin: "admin";
381
- instructor: "instructor";
382
- moderator: "moderator";
383
- student: "student";
384
- }>;
371
+ team: z.ZodBoolean;
372
+ roleName: z.ZodNullable<z.ZodString>;
385
373
  }, z.core.$strict>;
386
374
  reactions: z.ZodRecord<z.ZodString, z.ZodNumber>;
387
375
  viewerReaction: z.ZodNullable<z.ZodString>;
@@ -427,6 +415,45 @@ declare const flaggedCommentSchema: z.ZodObject<{
427
415
  }, z.core.$strict>;
428
416
  }, z.core.$strict>;
429
417
  type FlaggedComment = z.output<typeof flaggedCommentSchema>;
418
+ declare const flaggedCommentViewSchema: z.ZodObject<{
419
+ id: z.ZodString;
420
+ orgId: z.ZodString;
421
+ commentId: z.ZodString;
422
+ orgUserId: z.ZodString;
423
+ reason: z.ZodString;
424
+ resolvedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
425
+ resolution: z.ZodNullable<z.ZodEnum<{
426
+ removed: "removed";
427
+ dismissed: "dismissed";
428
+ }>>;
429
+ resolvedBy: z.ZodNullable<z.ZodString>;
430
+ createdAt: z.ZodCoercedDate<unknown>;
431
+ updatedAt: z.ZodCoercedDate<unknown>;
432
+ comment: z.ZodObject<{
433
+ id: z.ZodString;
434
+ postId: z.ZodString;
435
+ body: z.ZodString;
436
+ orgUserId: z.ZodString;
437
+ status: z.ZodEnum<{
438
+ pending: "pending";
439
+ published: "published";
440
+ removed: "removed";
441
+ }>;
442
+ author: z.ZodObject<{
443
+ id: z.ZodString;
444
+ firstName: z.ZodNullable<z.ZodString>;
445
+ lastName: z.ZodNullable<z.ZodString>;
446
+ displayName: z.ZodNullable<z.ZodString>;
447
+ headline: z.ZodNullable<z.ZodString>;
448
+ image: z.ZodNullable<z.ZodString>;
449
+ imageAssetId: z.ZodNullable<z.ZodString>;
450
+ imageUrl: z.ZodNullable<z.ZodString>;
451
+ team: z.ZodBoolean;
452
+ roleName: z.ZodNullable<z.ZodString>;
453
+ }, z.core.$strict>;
454
+ }, z.core.$strict>;
455
+ }, z.core.$strict>;
456
+ type FlaggedCommentView = z.output<typeof flaggedCommentViewSchema>;
430
457
  declare const postReactionSchema: z.ZodObject<{
431
458
  orgId: z.ZodString;
432
459
  postId: z.ZodString;
@@ -516,6 +543,7 @@ declare const messageSchema: z.ZodObject<{
516
543
  orgUserId: z.ZodString;
517
544
  body: z.ZodString;
518
545
  replyToId: z.ZodNullable<z.ZodString>;
546
+ clientId: z.ZodNullable<z.ZodUUID>;
519
547
  editedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
520
548
  deletedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
521
549
  createdAt: z.ZodCoercedDate<unknown>;
@@ -535,6 +563,7 @@ declare const messageViewSchema: z.ZodObject<{
535
563
  orgUserId: z.ZodString;
536
564
  body: z.ZodString;
537
565
  replyToId: z.ZodNullable<z.ZodString>;
566
+ clientId: z.ZodNullable<z.ZodUUID>;
538
567
  editedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
539
568
  deletedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
540
569
  createdAt: z.ZodCoercedDate<unknown>;
@@ -548,13 +577,8 @@ declare const messageViewSchema: z.ZodObject<{
548
577
  image: z.ZodNullable<z.ZodString>;
549
578
  imageAssetId: z.ZodNullable<z.ZodString>;
550
579
  imageUrl: z.ZodNullable<z.ZodString>;
551
- role: z.ZodEnum<{
552
- owner: "owner";
553
- admin: "admin";
554
- instructor: "instructor";
555
- moderator: "moderator";
556
- student: "student";
557
- }>;
580
+ team: z.ZodBoolean;
581
+ roleName: z.ZodNullable<z.ZodString>;
558
582
  }, z.core.$strict>;
559
583
  attachments: z.ZodArray<z.ZodObject<{
560
584
  assetId: z.ZodString;
@@ -568,6 +592,47 @@ declare const messageViewSchema: z.ZodObject<{
568
592
  }, z.core.$strict>>;
569
593
  }, z.core.$strict>;
570
594
  type MessageView = z.output<typeof messageViewSchema>;
595
+ declare const liveMessageSchema: z.ZodObject<{
596
+ orgId: z.ZodString;
597
+ id: z.ZodString;
598
+ createdAt: z.ZodCoercedDate<unknown>;
599
+ updatedAt: z.ZodCoercedDate<unknown>;
600
+ reactions: z.ZodRecord<z.ZodString, z.ZodNumber>;
601
+ communityId: z.ZodString;
602
+ orgUserId: z.ZodString;
603
+ body: z.ZodString;
604
+ mentions: z.ZodArray<z.ZodObject<{
605
+ orgUserId: z.ZodString;
606
+ name: z.ZodString;
607
+ }, z.core.$strict>>;
608
+ chatId: z.ZodString;
609
+ replyToId: z.ZodNullable<z.ZodString>;
610
+ clientId: z.ZodNullable<z.ZodUUID>;
611
+ editedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
612
+ deletedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
613
+ sender: z.ZodObject<{
614
+ id: z.ZodString;
615
+ firstName: z.ZodNullable<z.ZodString>;
616
+ lastName: z.ZodNullable<z.ZodString>;
617
+ displayName: z.ZodNullable<z.ZodString>;
618
+ headline: z.ZodNullable<z.ZodString>;
619
+ image: z.ZodNullable<z.ZodString>;
620
+ imageAssetId: z.ZodNullable<z.ZodString>;
621
+ imageUrl: z.ZodNullable<z.ZodString>;
622
+ team: z.ZodBoolean;
623
+ roleName: z.ZodNullable<z.ZodString>;
624
+ }, z.core.$strict>;
625
+ attachments: z.ZodArray<z.ZodObject<{
626
+ assetId: z.ZodString;
627
+ url: z.ZodString;
628
+ }, z.core.$strict>>;
629
+ }, z.core.$strict>;
630
+ type LiveMessage = z.output<typeof liveMessageSchema>;
631
+ declare const chatUnreadSummarySchema: z.ZodObject<{
632
+ unread: z.ZodNumber;
633
+ requests: z.ZodNumber;
634
+ }, z.core.$strict>;
635
+ type ChatUnreadSummary = z.output<typeof chatUnreadSummarySchema>;
571
636
  declare const chatLastMessageSchema: z.ZodObject<{
572
637
  id: z.ZodString;
573
638
  orgUserId: z.ZodString;
@@ -635,6 +700,164 @@ declare const digestRunSchema: z.ZodObject<{
635
700
  lastDueAt: z.ZodCoercedDate<unknown>;
636
701
  }, z.core.$strict>;
637
702
  type DigestRun = z.output<typeof digestRunSchema>;
703
+ declare const chatLiveEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
704
+ type: z.ZodLiteral<"ready">;
705
+ heartbeatMs: z.ZodNumber;
706
+ }, z.core.$strict>, z.ZodObject<{
707
+ type: z.ZodLiteral<"message.created">;
708
+ chatId: z.ZodString;
709
+ message: z.ZodObject<{
710
+ orgId: z.ZodString;
711
+ id: z.ZodString;
712
+ createdAt: z.ZodCoercedDate<unknown>;
713
+ updatedAt: z.ZodCoercedDate<unknown>;
714
+ reactions: z.ZodRecord<z.ZodString, z.ZodNumber>;
715
+ communityId: z.ZodString;
716
+ orgUserId: z.ZodString;
717
+ body: z.ZodString;
718
+ mentions: z.ZodArray<z.ZodObject<{
719
+ orgUserId: z.ZodString;
720
+ name: z.ZodString;
721
+ }, z.core.$strict>>;
722
+ chatId: z.ZodString;
723
+ replyToId: z.ZodNullable<z.ZodString>;
724
+ clientId: z.ZodNullable<z.ZodUUID>;
725
+ editedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
726
+ deletedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
727
+ sender: z.ZodObject<{
728
+ id: z.ZodString;
729
+ firstName: z.ZodNullable<z.ZodString>;
730
+ lastName: z.ZodNullable<z.ZodString>;
731
+ displayName: z.ZodNullable<z.ZodString>;
732
+ headline: z.ZodNullable<z.ZodString>;
733
+ image: z.ZodNullable<z.ZodString>;
734
+ imageAssetId: z.ZodNullable<z.ZodString>;
735
+ imageUrl: z.ZodNullable<z.ZodString>;
736
+ team: z.ZodBoolean;
737
+ roleName: z.ZodNullable<z.ZodString>;
738
+ }, z.core.$strict>;
739
+ attachments: z.ZodArray<z.ZodObject<{
740
+ assetId: z.ZodString;
741
+ url: z.ZodString;
742
+ }, z.core.$strict>>;
743
+ }, z.core.$strict>;
744
+ }, z.core.$strict>, z.ZodObject<{
745
+ type: z.ZodLiteral<"message.updated">;
746
+ chatId: z.ZodString;
747
+ message: z.ZodObject<{
748
+ orgId: z.ZodString;
749
+ id: z.ZodString;
750
+ createdAt: z.ZodCoercedDate<unknown>;
751
+ updatedAt: z.ZodCoercedDate<unknown>;
752
+ reactions: z.ZodRecord<z.ZodString, z.ZodNumber>;
753
+ communityId: z.ZodString;
754
+ orgUserId: z.ZodString;
755
+ body: z.ZodString;
756
+ mentions: z.ZodArray<z.ZodObject<{
757
+ orgUserId: z.ZodString;
758
+ name: z.ZodString;
759
+ }, z.core.$strict>>;
760
+ chatId: z.ZodString;
761
+ replyToId: z.ZodNullable<z.ZodString>;
762
+ clientId: z.ZodNullable<z.ZodUUID>;
763
+ editedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
764
+ deletedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
765
+ sender: z.ZodObject<{
766
+ id: z.ZodString;
767
+ firstName: z.ZodNullable<z.ZodString>;
768
+ lastName: z.ZodNullable<z.ZodString>;
769
+ displayName: z.ZodNullable<z.ZodString>;
770
+ headline: z.ZodNullable<z.ZodString>;
771
+ image: z.ZodNullable<z.ZodString>;
772
+ imageAssetId: z.ZodNullable<z.ZodString>;
773
+ imageUrl: z.ZodNullable<z.ZodString>;
774
+ team: z.ZodBoolean;
775
+ roleName: z.ZodNullable<z.ZodString>;
776
+ }, z.core.$strict>;
777
+ attachments: z.ZodArray<z.ZodObject<{
778
+ assetId: z.ZodString;
779
+ url: z.ZodString;
780
+ }, z.core.$strict>>;
781
+ }, z.core.$strict>;
782
+ }, z.core.$strict>, z.ZodObject<{
783
+ type: z.ZodLiteral<"message.deleted">;
784
+ chatId: z.ZodString;
785
+ messageId: z.ZodString;
786
+ deletedAt: z.ZodCoercedDate<unknown>;
787
+ }, z.core.$strict>, z.ZodObject<{
788
+ type: z.ZodLiteral<"message.reactions">;
789
+ chatId: z.ZodString;
790
+ messageId: z.ZodString;
791
+ reactions: z.ZodRecord<z.ZodString, z.ZodNumber>;
792
+ orgUserId: z.ZodString;
793
+ reaction: z.ZodNullable<z.ZodString>;
794
+ }, z.core.$strict>, z.ZodObject<{
795
+ type: z.ZodLiteral<"chat.updated">;
796
+ chatId: z.ZodString;
797
+ chat: z.ZodObject<{
798
+ orgId: z.ZodString;
799
+ id: z.ZodString;
800
+ communityId: z.ZodString;
801
+ kind: z.ZodEnum<{
802
+ direct: "direct";
803
+ group: "group";
804
+ }>;
805
+ status: z.ZodEnum<{
806
+ pending: "pending";
807
+ open: "open";
808
+ closed: "closed";
809
+ }>;
810
+ createdBy: z.ZodNullable<z.ZodString>;
811
+ lockedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
812
+ lockedBy: z.ZodNullable<z.ZodString>;
813
+ createdAt: z.ZodCoercedDate<unknown>;
814
+ updatedAt: z.ZodCoercedDate<unknown>;
815
+ }, z.core.$strict>;
816
+ participants: z.ZodArray<z.ZodObject<{
817
+ id: z.ZodString;
818
+ firstName: z.ZodNullable<z.ZodString>;
819
+ lastName: z.ZodNullable<z.ZodString>;
820
+ displayName: z.ZodNullable<z.ZodString>;
821
+ headline: z.ZodNullable<z.ZodString>;
822
+ image: z.ZodNullable<z.ZodString>;
823
+ imageAssetId: z.ZodNullable<z.ZodString>;
824
+ imageUrl: z.ZodNullable<z.ZodString>;
825
+ team: z.ZodBoolean;
826
+ roleName: z.ZodNullable<z.ZodString>;
827
+ }, z.core.$strict>>;
828
+ }, z.core.$strict>, z.ZodObject<{
829
+ type: z.ZodLiteral<"chat.removed">;
830
+ chatId: z.ZodString;
831
+ }, z.core.$strict>, z.ZodObject<{
832
+ type: z.ZodLiteral<"chat.state">;
833
+ chatId: z.ZodString;
834
+ unread: z.ZodNumber;
835
+ lastReadMessageId: z.ZodNullable<z.ZodString>;
836
+ subscription: z.ZodNullable<z.ZodObject<{
837
+ state: z.ZodEnum<{
838
+ following: "following";
839
+ muted: "muted";
840
+ }>;
841
+ mutedUntil: z.ZodNullable<z.ZodCoercedDate<unknown>>;
842
+ }, z.core.$strict>>;
843
+ }, z.core.$strict>, z.ZodObject<{
844
+ unread: z.ZodNumber;
845
+ requests: z.ZodNumber;
846
+ type: z.ZodLiteral<"unread">;
847
+ }, z.core.$strict>, z.ZodObject<{
848
+ type: z.ZodLiteral<"typing">;
849
+ chatId: z.ZodString;
850
+ orgUserId: z.ZodString;
851
+ until: z.ZodCoercedDate<unknown>;
852
+ }, z.core.$strict>, z.ZodObject<{
853
+ type: z.ZodLiteral<"resync">;
854
+ }, z.core.$strict>, z.ZodObject<{
855
+ type: z.ZodLiteral<"closed">;
856
+ reason: z.ZodEnum<{
857
+ shutdown: "shutdown";
858
+ }>;
859
+ }, z.core.$strict>], "type">;
860
+ type ChatLiveEvent = z.output<typeof chatLiveEventSchema>;
638
861
  //#endregion
639
- export { ActivityCommentsRule, BlockedUser, Chat, ChatKind, ChatLastMessage, ChatStatus, ChatUser, Comment, CommentAuthor, CommentFlagResolution, CommentInput, CommentListItem, CommentReaction, CommentReport, CommentReportInput, CommentReportSummary, CommentSettings, CommentStatus, CommentView, CommentsConfig, DigestRun, FlaggedComment, ListCommentsQuery, Mention, MentionItemType, MentionView, Message, MessageAttachment, MessageFile, MessageFlag, MessageFlagResolution, MessageReaction, MessageView, Post, PostBookmark, PostFlag, PostFlagResolution, PostReaction, PostStatus, PostView, ReactionCounts, ReactionEmoji, Subscription, SubscriptionItemType, SubscriptionState, SubscriptionView, activityCommentsRuleSchema, blockedUserSchema, chatKindSchema, chatLastMessageSchema, chatSchema, chatStatusSchema, chatUserSchema, commentAuthorSchema, commentFlagResolutionSchema, commentListItemSchema, commentReactionSchema, commentReportSchema, commentReportSummarySchema, commentSchema, commentSettingsSchema, commentStatusSchema, commentViewSchema, digestRunSchema, flaggedCommentSchema, listCommentsQuerySchema, mentionItemTypeSchema, mentionSchema, mentionViewSchema, messageAttachmentSchema, messageFileSchema, messageFlagResolutionSchema, messageFlagSchema, messageReactionSchema, messageSchema, messageViewSchema, postBookmarkSchema, postFlagResolutionSchema, postFlagSchema, postReactionSchema, postSchema, postStatusSchema, postViewSchema, reactionCountsSchema, reactionEmojiSchema, subscriptionItemTypeSchema, subscriptionSchema, subscriptionStateSchema, subscriptionViewSchema };
862
+ export { ActivityCommentsRule, BlockedUser, Chat, ChatKind, ChatLastMessage, ChatLiveEvent, ChatStatus, ChatUnreadSummary, ChatUser, Comment, CommentAuthor, CommentFlagResolution, CommentInput, CommentListItem, CommentReaction, CommentReport, CommentReportInput, CommentReportSummary, CommentSettings, CommentStatus, CommentView, CommentsConfig, DigestRun, FlaggedComment, FlaggedCommentView, ListCommentsQuery, LiveMessage, Mention, MentionItemType, MentionView, Message, MessageAttachment, MessageFile, MessageFlag, MessageFlagResolution, MessageReaction, MessageView, Post, PostAsset, PostBookmark, PostFlag, PostFlagResolution, PostReaction, PostStatus, PostView, ReactionCounts, ReactionEmoji, Subscription, SubscriptionItemType, SubscriptionState, SubscriptionView, activityCommentsRuleSchema, blockedUserSchema, chatKindSchema, chatLastMessageSchema, chatLiveEventSchema, chatSchema, chatStatusSchema, chatUnreadSummarySchema, chatUserSchema, commentAuthorSchema, commentFlagResolutionSchema, commentListItemSchema, commentReactionSchema, commentReportSchema, commentReportSummarySchema, commentSchema, commentSettingsSchema, commentStatusSchema, commentViewSchema, digestRunSchema, flaggedCommentSchema, flaggedCommentViewSchema, listCommentsQuerySchema, liveMessageSchema, mentionItemTypeSchema, mentionSchema, mentionViewSchema, messageAttachmentSchema, messageFileSchema, messageFlagResolutionSchema, messageFlagSchema, messageReactionSchema, messageSchema, messageViewSchema, postAssetSchema, postBookmarkSchema, postFlagResolutionSchema, postFlagSchema, postReactionSchema, postSchema, postStatusSchema, postViewSchema, reactionCountsSchema, reactionEmojiSchema, subscriptionItemTypeSchema, subscriptionSchema, subscriptionStateSchema, subscriptionViewSchema };
640
863
  //# sourceMappingURL=discussion.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { emailSchema, idSchema, jsonValueSchema } from "./shared.js";
2
- import { roleSchema } from "./organizations.js";
2
+ import { assetKindSchema } from "./assets.js";
3
3
  import { z } from "zod";
4
4
  //#region src/types/schemas/discussion.ts
5
5
  const commentStatusSchema = z.enum([
@@ -43,7 +43,8 @@ const commentAuthorSchema = z.object({
43
43
  image: z.string().nullable(),
44
44
  imageAssetId: idSchema.nullable(),
45
45
  imageUrl: z.string().nullable(),
46
- role: roleSchema
46
+ team: z.boolean(),
47
+ roleName: z.string().nullable()
47
48
  }).strict();
48
49
  const commentReactionSchema = z.object({
49
50
  orgId: idSchema,
@@ -176,8 +177,15 @@ const postSchema = z.object({
176
177
  createdAt: z.coerce.date(),
177
178
  updatedAt: z.coerce.date()
178
179
  }).strict();
180
+ const postAssetSchema = z.object({
181
+ url: z.string(),
182
+ kind: assetKindSchema,
183
+ filename: z.string(),
184
+ size: z.number().int().min(0)
185
+ }).strict();
179
186
  const postViewSchema = postSchema.extend({
180
187
  coverUrl: z.string().nullable(),
188
+ assets: z.record(idSchema, postAssetSchema),
181
189
  author: commentAuthorSchema,
182
190
  reactions: reactionCountsSchema,
183
191
  viewerReaction: reactionEmojiSchema.nullable(),
@@ -193,6 +201,7 @@ const flaggedCommentSchema = commentReportSchema.extend({ comment: z.object({
193
201
  orgUserId: idSchema,
194
202
  status: commentStatusSchema
195
203
  }).strict() }).strict();
204
+ const flaggedCommentViewSchema = commentReportSchema.extend({ comment: flaggedCommentSchema.shape.comment.extend({ author: commentAuthorSchema }).strict() }).strict();
196
205
  const postReactionSchema = z.object({
197
206
  orgId: idSchema,
198
207
  postId: idSchema,
@@ -258,6 +267,7 @@ const messageSchema = z.object({
258
267
  orgUserId: idSchema,
259
268
  body: z.string(),
260
269
  replyToId: idSchema.nullable(),
270
+ clientId: z.uuid().nullable(),
261
271
  editedAt: z.coerce.date().nullable(),
262
272
  deletedAt: z.coerce.date().nullable(),
263
273
  createdAt: z.coerce.date(),
@@ -274,6 +284,11 @@ const messageViewSchema = messageSchema.extend({
274
284
  viewerReaction: reactionEmojiSchema.nullable(),
275
285
  mentions: z.array(mentionViewSchema)
276
286
  }).strict();
287
+ const liveMessageSchema = messageViewSchema.omit({ viewerReaction: true });
288
+ const chatUnreadSummarySchema = z.object({
289
+ unread: z.number().int().min(0),
290
+ requests: z.number().int().min(0)
291
+ }).strict();
277
292
  const chatLastMessageSchema = z.object({
278
293
  id: idSchema,
279
294
  orgUserId: idSchema,
@@ -330,7 +345,66 @@ const digestRunSchema = z.object({
330
345
  communityId: idSchema,
331
346
  lastDueAt: z.coerce.date()
332
347
  }).strict();
348
+ const chatLiveEventSchema = z.discriminatedUnion("type", [
349
+ z.object({
350
+ type: z.literal("ready"),
351
+ heartbeatMs: z.number().int()
352
+ }).strict(),
353
+ z.object({
354
+ type: z.literal("message.created"),
355
+ chatId: idSchema,
356
+ message: liveMessageSchema
357
+ }).strict(),
358
+ z.object({
359
+ type: z.literal("message.updated"),
360
+ chatId: idSchema,
361
+ message: liveMessageSchema
362
+ }).strict(),
363
+ z.object({
364
+ type: z.literal("message.deleted"),
365
+ chatId: idSchema,
366
+ messageId: idSchema,
367
+ deletedAt: z.coerce.date()
368
+ }).strict(),
369
+ z.object({
370
+ type: z.literal("message.reactions"),
371
+ chatId: idSchema,
372
+ messageId: idSchema,
373
+ reactions: reactionCountsSchema,
374
+ orgUserId: idSchema,
375
+ reaction: reactionEmojiSchema.nullable()
376
+ }).strict(),
377
+ z.object({
378
+ type: z.literal("chat.updated"),
379
+ chatId: idSchema,
380
+ chat: chatSchema,
381
+ participants: z.array(commentAuthorSchema)
382
+ }).strict(),
383
+ z.object({
384
+ type: z.literal("chat.removed"),
385
+ chatId: idSchema
386
+ }).strict(),
387
+ z.object({
388
+ type: z.literal("chat.state"),
389
+ chatId: idSchema,
390
+ unread: z.number().int().min(0),
391
+ lastReadMessageId: idSchema.nullable(),
392
+ subscription: subscriptionViewSchema.nullable()
393
+ }).strict(),
394
+ chatUnreadSummarySchema.extend({ type: z.literal("unread") }).strict(),
395
+ z.object({
396
+ type: z.literal("typing"),
397
+ chatId: idSchema,
398
+ orgUserId: idSchema,
399
+ until: z.coerce.date()
400
+ }).strict(),
401
+ z.object({ type: z.literal("resync") }).strict(),
402
+ z.object({
403
+ type: z.literal("closed"),
404
+ reason: z.enum(["shutdown"])
405
+ }).strict()
406
+ ]);
333
407
  //#endregion
334
- export { activityCommentsRuleSchema, blockedUserSchema, chatKindSchema, chatLastMessageSchema, chatSchema, chatStatusSchema, chatUserSchema, commentAuthorSchema, commentFlagResolutionSchema, commentListItemSchema, commentReactionSchema, commentReportSchema, commentReportSummarySchema, commentSchema, commentSettingsSchema, commentStatusSchema, commentViewSchema, digestRunSchema, flaggedCommentSchema, listCommentsQuerySchema, mentionItemTypeSchema, mentionSchema, mentionViewSchema, messageAttachmentSchema, messageFileSchema, messageFlagResolutionSchema, messageFlagSchema, messageReactionSchema, messageSchema, messageViewSchema, postBookmarkSchema, postFlagResolutionSchema, postFlagSchema, postReactionSchema, postSchema, postStatusSchema, postViewSchema, reactionCountsSchema, reactionEmojiSchema, subscriptionItemTypeSchema, subscriptionSchema, subscriptionStateSchema, subscriptionViewSchema };
408
+ export { activityCommentsRuleSchema, blockedUserSchema, chatKindSchema, chatLastMessageSchema, chatLiveEventSchema, chatSchema, chatStatusSchema, chatUnreadSummarySchema, chatUserSchema, commentAuthorSchema, commentFlagResolutionSchema, commentListItemSchema, commentReactionSchema, commentReportSchema, commentReportSummarySchema, commentSchema, commentSettingsSchema, commentStatusSchema, commentViewSchema, digestRunSchema, flaggedCommentSchema, flaggedCommentViewSchema, listCommentsQuerySchema, liveMessageSchema, mentionItemTypeSchema, mentionSchema, mentionViewSchema, messageAttachmentSchema, messageFileSchema, messageFlagResolutionSchema, messageFlagSchema, messageReactionSchema, messageSchema, messageViewSchema, postAssetSchema, postBookmarkSchema, postFlagResolutionSchema, postFlagSchema, postReactionSchema, postSchema, postStatusSchema, postViewSchema, reactionCountsSchema, reactionEmojiSchema, subscriptionItemTypeSchema, subscriptionSchema, subscriptionStateSchema, subscriptionViewSchema };
335
409
 
336
410
  //# sourceMappingURL=discussion.js.map