@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
@@ -8,15 +8,29 @@ interface AutomationDispatch {
8
8
  actions: AutomationAction[];
9
9
  event: DomainEvent;
10
10
  }
11
+ interface DeliveryDispatch {
12
+ orgId: string;
13
+ deliveryId: string;
14
+ }
15
+ interface ScheduledAutomation {
16
+ orgId: string;
17
+ automationId: string;
18
+ cron: string;
19
+ }
11
20
  interface AutomationExecutor {
12
21
  runAction(d: AutomationDispatch, index: number): Promise<AutomationActionResult>;
13
22
  finalize(d: AutomationDispatch, results: AutomationActionResult[]): Promise<void>;
23
+ runDelivery(d: DeliveryDispatch, lastAttempt: boolean): Promise<void>;
24
+ listSchedules?(): Promise<ScheduledAutomation[]>;
25
+ fireSchedule?(orgId: string, automationId: string, firedAt: Date): Promise<void>;
14
26
  }
15
27
  interface AutomationEngine {
16
28
  register(executor: AutomationExecutor): void;
17
29
  dispatch(d: AutomationDispatch): Promise<void>;
30
+ deliver(d: DeliveryDispatch): Promise<void>;
18
31
  start(): Promise<void>;
19
32
  stop(): Promise<void>;
33
+ syncSchedules?(): Promise<void>;
20
34
  }
21
35
  interface WebhookRequest {
22
36
  url: string;
@@ -30,5 +44,5 @@ interface WebhookSender {
30
44
  send(request: WebhookRequest): Promise<WebhookResponse>;
31
45
  }
32
46
  //#endregion
33
- export { type Automation, type AutomationAction, type AutomationActionResult, AutomationDispatch, AutomationEngine, AutomationExecutor, type AutomationKind, type AutomationRun, type AutomationRunStatus, type AutomationRunsQuery, type AutomationTrigger, type AutomationsQuery, type AvailableAction, type AvailableActions, type AvailableTriggers, type CreateAutomationInput, type CreateWebhookInput, type CreatedWebhook, type DeliverWebhookInput, type UpdateAutomationInput, type UpdateWebhookInput, type Webhook, WebhookRequest, WebhookResponse, type WebhookSecret, WebhookSender };
47
+ export { type Automation, type AutomationAction, type AutomationActionResult, AutomationDispatch, AutomationEngine, AutomationExecutor, type AutomationKind, type AutomationRun, type AutomationRunStatus, type AutomationRunsQuery, type AutomationTrigger, type AutomationsQuery, type AvailableAction, type AvailableActions, type AvailableTriggers, type CreateAutomationInput, type CreateWebhookInput, type CreatedWebhook, type DeliverWebhookInput, DeliveryDispatch, ScheduledAutomation, type UpdateAutomationInput, type UpdateWebhookInput, type Webhook, WebhookRequest, WebhookResponse, type WebhookSecret, WebhookSender };
34
48
  //# sourceMappingURL=automations.d.ts.map
@@ -1,2 +1,2 @@
1
- import { Activity, ActivityAsset, ActivitySettings, AddDownloadAssetInput, Bundle, BundleItem, ContentItem, ContentType, Course, CourseSettings, CourseStatus, CreateBundleInput, CreateCourseInput, CreateDownloadInput, Download, DownloadAsset, DownloadStatus, ListBundlesQuery, ListCoursesQuery, ListDownloadsQuery, Module, ReorderDownloadAssetsInput, SaveActivityInput, UpdateBundleInput, UpdateCourseInput, UpdateDownloadInput } from "./schemas/content.js";
2
- export type { Activity, ActivityAsset, ActivitySettings, AddDownloadAssetInput, Bundle, BundleItem, ContentItem, ContentType, Course, CourseSettings, CourseStatus, CreateBundleInput, CreateCourseInput, CreateDownloadInput, Download, DownloadAsset, DownloadStatus, ListBundlesQuery, ListCoursesQuery, ListDownloadsQuery, Module, ReorderDownloadAssetsInput, SaveActivityInput, UpdateBundleInput, UpdateCourseInput, UpdateDownloadInput };
1
+ import { Activity, ActivityAsset, ActivitySettings, ActivityView, AddDownloadAssetInput, AddSpaceLinkInput, Bundle, BundleItem, Community, CommunitySettings, CommunityStatus, CommunityView, ContentItem, ContentType, Course, CourseSettings, CourseStatus, CourseView, CreateBundleInput, CreateCommunityInput, CreateCourseInput, CreateDownloadInput, CreateSpaceInput, DigestCadence, DigestSchedule, DmSettings, Download, DownloadAsset, DownloadFile, DownloadStatus, DownloadView, ListBundlesQuery, ListCommunitiesQuery, ListCoursesQuery, ListDownloadsQuery, Module, PatchCommunitySettingsInput, PatchDmSettingsInput, ReorderDownloadAssetsInput, SaveActivityInput, SetSpaceTopicsInput, Space, SpaceAccessRule, SpaceDetail, SpaceLink, SpaceSettings, SpaceTopic, UpdateBundleInput, UpdateCommunityInput, UpdateCourseInput, UpdateDownloadInput, UpdateSpaceInput } from "./schemas/content.js";
2
+ export type { Activity, ActivityAsset, ActivitySettings, ActivityView, AddDownloadAssetInput, AddSpaceLinkInput, Bundle, BundleItem, Community, CommunitySettings, CommunityStatus, CommunityView, ContentItem, ContentType, Course, CourseSettings, CourseStatus, CourseView, CreateBundleInput, CreateCommunityInput, CreateCourseInput, CreateDownloadInput, CreateSpaceInput, DigestCadence, DigestSchedule, DmSettings, Download, DownloadAsset, DownloadFile, DownloadStatus, DownloadView, ListBundlesQuery, ListCommunitiesQuery, ListCoursesQuery, ListDownloadsQuery, Module, PatchCommunitySettingsInput, PatchDmSettingsInput, ReorderDownloadAssetsInput, SaveActivityInput, SetSpaceTopicsInput, Space, SpaceAccessRule, SpaceDetail, SpaceLink, SpaceSettings, SpaceTopic, UpdateBundleInput, UpdateCommunityInput, UpdateCourseInput, UpdateDownloadInput, UpdateSpaceInput };
@@ -1,12 +1,14 @@
1
1
  import { Page } from "./shared.js";
2
2
  import { Role } from "./schemas/organizations.js";
3
3
  import "./organizations.js";
4
- import { ActivityCommentsRule, CommentListItem, CommentReaction, CommentReportSummary, CommentSettings, CommentStatus, CommentView, CommentsConfig, ListCommentsQuery, ReactionCounts, ReactionEmoji } from "./schemas/discussion.js";
4
+ import { ActivityCommentsRule, BlockedUser, Chat, ChatKind, ChatLastMessage, ChatStatus, ChatUser, CommentFlagResolution, CommentListItem, CommentReaction, 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 } from "./schemas/discussion.js";
5
5
  //#region src/types/discussion.d.ts
6
6
  interface Comment {
7
7
  readonly id: string;
8
8
  readonly orgId: string;
9
- readonly activityId: string;
9
+ readonly activityId: string | null;
10
+ readonly postId: string | null;
11
+ readonly communityId: string | null;
10
12
  readonly parentId: string | null;
11
13
  readonly orgUserId: string;
12
14
  body: string;
@@ -19,7 +21,11 @@ interface CommentAuthor {
19
21
  id: string;
20
22
  firstName: string | null;
21
23
  lastName: string | null;
24
+ displayName: string | null;
25
+ headline: string | null;
22
26
  image: string | null;
27
+ imageAssetId: string | null;
28
+ imageUrl: string | null;
23
29
  role: Role;
24
30
  }
25
31
  interface CommentReport {
@@ -29,9 +35,11 @@ interface CommentReport {
29
35
  readonly orgUserId: string;
30
36
  readonly reason: string;
31
37
  resolvedAt: Date | null;
38
+ resolution: 'dismissed' | 'removed' | null;
39
+ resolvedBy: string | null;
32
40
  readonly createdAt: Date;
33
41
  updatedAt: Date;
34
42
  }
35
43
  //#endregion
36
- export { type ActivityCommentsRule, Comment, CommentAuthor, type CommentListItem, type CommentReaction, CommentReport, type CommentReportSummary, type CommentSettings, type CommentStatus, type CommentView, type CommentsConfig, type ListCommentsQuery, type Page, type ReactionCounts, type ReactionEmoji };
44
+ export { type ActivityCommentsRule, type BlockedUser, type Chat, type ChatKind, type ChatLastMessage, type ChatStatus, type ChatUser, Comment, CommentAuthor, type CommentFlagResolution, type CommentListItem, type CommentReaction, CommentReport, type CommentReportSummary, type CommentSettings, type CommentStatus, type CommentView, type CommentsConfig, type DigestRun, type FlaggedComment, type ListCommentsQuery, type Mention, type MentionItemType, type MentionView, type Message, type MessageAttachment, type MessageFile, type MessageFlag, type MessageFlagResolution, type MessageReaction, type MessageView, type Page, type Post, type PostBookmark, type PostFlag, type PostFlagResolution, type PostReaction, type PostStatus, type PostView, type ReactionCounts, type ReactionEmoji, type Subscription, type SubscriptionItemType, type SubscriptionState, type SubscriptionView };
37
45
  //# sourceMappingURL=discussion.d.ts.map
@@ -39,7 +39,7 @@ interface EmailTemplateParams {
39
39
  accessGranted: {
40
40
  contentTitle: string;
41
41
  contentId: string;
42
- contentType: ContentType;
42
+ contentType: ContentType | 'bundle';
43
43
  };
44
44
  accessRevoked: {
45
45
  contentTitle: string;
@@ -47,6 +47,221 @@ interface EmailTemplateParams {
47
47
  courseCompleted: {
48
48
  courseTitle: string;
49
49
  };
50
+ welcomeToCommunity: {
51
+ communityTitle: string;
52
+ communityId: string;
53
+ spaceNames: string[];
54
+ };
55
+ membershipEndingSoon: {
56
+ communityTitle: string;
57
+ communityId: string;
58
+ expiresAt: string;
59
+ };
60
+ membershipEnded: {
61
+ communities: {
62
+ communityId: string;
63
+ communityTitle: string;
64
+ }[];
65
+ };
66
+ newPostInSpace: {
67
+ spaceName: string;
68
+ postTitle: string;
69
+ authorName: string;
70
+ excerpt: string;
71
+ postId: string;
72
+ communityId: string;
73
+ };
74
+ yourPostWasPublished: {
75
+ postTitle: string;
76
+ spaceName: string;
77
+ postId: string;
78
+ communityId: string;
79
+ };
80
+ yourPostWasRemoved: {
81
+ postTitle: string;
82
+ spaceName: string;
83
+ spaceId: string;
84
+ communityId: string;
85
+ };
86
+ newCommentOnPost: {
87
+ postTitle: string;
88
+ commenterName: string;
89
+ excerpt: string;
90
+ commentId: string;
91
+ postId: string;
92
+ communityId: string;
93
+ };
94
+ replyToYourComment: {
95
+ postTitle: string;
96
+ commenterName: string;
97
+ excerpt: string;
98
+ commentId: string;
99
+ postId: string;
100
+ communityId: string;
101
+ };
102
+ yourCommentWasRemoved: {
103
+ postTitle: string;
104
+ postId: string;
105
+ communityId: string;
106
+ };
107
+ requestApproved: {
108
+ spaceName: string;
109
+ spaceId: string;
110
+ communityId: string;
111
+ };
112
+ requestDeclined: {
113
+ spaceName: string;
114
+ communityId: string;
115
+ };
116
+ invitedToSpace: {
117
+ spaceName: string;
118
+ inviterName: string;
119
+ spaceId: string;
120
+ communityId: string;
121
+ };
122
+ messageRequest: {
123
+ senderName: string;
124
+ excerpt: string;
125
+ chatId: string;
126
+ communityId: string;
127
+ };
128
+ newMessage: {
129
+ senderName: string;
130
+ chatTitle: string;
131
+ excerpt: string;
132
+ chatId: string;
133
+ communityId: string;
134
+ };
135
+ addedToGroupChat: {
136
+ adderName: string;
137
+ participantNames: string[];
138
+ chatId: string;
139
+ communityId: string;
140
+ };
141
+ youAreNowAModerator: {
142
+ communityTitles: string[];
143
+ };
144
+ digest: {
145
+ communityTitle: string;
146
+ communityId: string;
147
+ from: string;
148
+ to: string;
149
+ posts: {
150
+ postId: string;
151
+ title: string;
152
+ authorName: string;
153
+ spaceName: string;
154
+ commentCount: number;
155
+ }[];
156
+ };
157
+ postAwaitingReview: {
158
+ spaceName: string;
159
+ postTitle: string;
160
+ authorName: string;
161
+ spaceId: string;
162
+ communityId: string;
163
+ };
164
+ joinRequest: {
165
+ spaceName: string;
166
+ memberName: string;
167
+ seatsLeft: string;
168
+ spaceId: string;
169
+ communityId: string;
170
+ };
171
+ somethingWasFlagged: {
172
+ spaceName: string;
173
+ excerpt: string;
174
+ reason: string;
175
+ spaceId: string;
176
+ communityId: string;
177
+ };
178
+ messageWasFlagged: {
179
+ reason: string;
180
+ communityId: string;
181
+ };
182
+ postReacted: {
183
+ postTitle: string;
184
+ reactorName: string;
185
+ reaction: string;
186
+ postId: string;
187
+ communityId: string;
188
+ };
189
+ commentReacted: {
190
+ postTitle: string;
191
+ excerpt: string;
192
+ reactorName: string;
193
+ reaction: string;
194
+ commentId: string;
195
+ postId: string;
196
+ communityId: string;
197
+ };
198
+ mention: {
199
+ authorName: string;
200
+ excerpt: string;
201
+ communityId: string;
202
+ } & ({
203
+ postTitle: string;
204
+ postId: string;
205
+ commentId?: string;
206
+ } | {
207
+ chatTitle: string;
208
+ chatId: string;
209
+ });
210
+ messageReacted: {
211
+ excerpt: string;
212
+ reactorName: string;
213
+ reaction: string;
214
+ chatId: string;
215
+ communityId: string;
216
+ };
217
+ courseActivityAdded: {
218
+ courseTitle: string;
219
+ moduleTitle: string;
220
+ activityTitle: string;
221
+ courseId: string;
222
+ activityId: string;
223
+ };
224
+ activityCommentCreated: {
225
+ activityTitle: string;
226
+ courseTitle: string;
227
+ commenterName: string;
228
+ excerpt: string;
229
+ courseId: string;
230
+ activityId: string;
231
+ commentId: string;
232
+ };
233
+ activityCommentRemoved: {
234
+ activityTitle: string;
235
+ courseTitle: string;
236
+ courseId: string;
237
+ activityId: string;
238
+ };
239
+ activityCommentReacted: {
240
+ activityTitle: string;
241
+ courseTitle: string;
242
+ excerpt: string;
243
+ reactorName: string;
244
+ reaction: string;
245
+ courseId: string;
246
+ activityId: string;
247
+ commentId: string;
248
+ };
249
+ activityCommentFlagged: {
250
+ activityTitle: string;
251
+ courseTitle: string;
252
+ excerpt: string;
253
+ reason: string;
254
+ courseId: string;
255
+ activityId: string;
256
+ };
257
+ activityMention: {
258
+ authorName: string;
259
+ excerpt: string;
260
+ activityTitle: string;
261
+ courseTitle: string;
262
+ courseId: string;
263
+ activityId: string;
264
+ };
50
265
  }
51
266
  type EmailTemplateId = keyof EmailTemplateParams;
52
267
  /** Resolves a template + data to rendered content. Deployment-swappable;
@@ -1,3 +1,3 @@
1
1
  import { Page } from "./shared.js";
2
- import { Entitlement, EntitlementStatus, EntitlementsQuery, GrantEntitlementInput } from "./schemas/entitlements.js";
3
- export type { Entitlement, EntitlementStatus, EntitlementsQuery, GrantEntitlementInput, Page };
2
+ import { Entitlement, EntitlementStatus, EntitlementsQuery, GrantEntitlementInput, SpaceMember, SpaceMemberSource, SpaceMemberStatus } from "./schemas/entitlements.js";
3
+ export type { Entitlement, EntitlementStatus, EntitlementsQuery, GrantEntitlementInput, Page, SpaceMember, SpaceMemberSource, SpaceMemberStatus };
@@ -1,4 +1,4 @@
1
- import { CreateUserInput, ProvisionUserInput, UpdateUserInput } from "./schemas/identity.js";
1
+ import { CreateUserInput, ProvisionUserInput, UpdateUserInput, UserProfile, UserProfileView } from "./schemas/identity.js";
2
2
  //#region src/types/identity.d.ts
3
3
  interface User {
4
4
  readonly id: string;
@@ -32,6 +32,52 @@ interface AccountProvisioner {
32
32
  delete(externalId: string): Promise<void>;
33
33
  }
34
34
  type UserId = string;
35
+ type HeaderBag = Record<string, string | string[] | undefined>;
36
+ type AccessGrant = {
37
+ userId: string;
38
+ orgId: string;
39
+ scopes: string[];
40
+ clientId: string;
41
+ };
42
+ type AccessRequest = {
43
+ method: string;
44
+ url: string;
45
+ headers: HeaderBag;
46
+ };
47
+ interface AccessTokenVerifier {
48
+ verifyAccess(request: AccessRequest): Promise<AccessGrant | null>;
49
+ }
50
+ type ConnectedApp = {
51
+ clientId: string;
52
+ name: string;
53
+ iconUrl: string | null;
54
+ scopes: string[];
55
+ connectedAt: Date;
56
+ };
57
+ type ApiKeySummary = {
58
+ id: string;
59
+ name: string | null;
60
+ start: string | null;
61
+ scopes: string[];
62
+ createdAt: Date;
63
+ lastUsedAt: Date | null;
64
+ };
65
+ type CreatedApiKey = ApiKeySummary & {
66
+ key: string;
67
+ };
68
+ type NewApiKey = {
69
+ authUserId: string;
70
+ orgId: string;
71
+ name: string;
72
+ scopes: string[];
73
+ };
74
+ interface AppAccessAdmin {
75
+ listConnectedApps(headers: HeaderBag, orgId: string): Promise<ConnectedApp[]>;
76
+ revokeConnectedApp(headers: HeaderBag, orgId: string, clientId: string): Promise<void>;
77
+ listApiKeys(headers: HeaderBag, orgId: string): Promise<ApiKeySummary[]>;
78
+ createApiKey(input: NewApiKey): Promise<CreatedApiKey>;
79
+ deleteApiKey(headers: HeaderBag, orgId: string, keyId: string): Promise<void>;
80
+ }
35
81
  //#endregion
36
- export { AccountProvisioner, ActiveSession, type CreateUserInput, type ProvisionUserInput, SessionVerifier, type UpdateUserInput, User, UserId };
82
+ export { AccessGrant, AccessRequest, AccessTokenVerifier, AccountProvisioner, ActiveSession, ApiKeySummary, AppAccessAdmin, ConnectedApp, type CreateUserInput, CreatedApiKey, HeaderBag, NewApiKey, type ProvisionUserInput, SessionVerifier, type UpdateUserInput, User, UserId, type UserProfile, type UserProfileView };
37
83
  //# sourceMappingURL=identity.d.ts.map
@@ -1,23 +1,24 @@
1
1
  import { ContractNewDomainEvent, DomainEvent, EventMetadata, JsonValue, NewDomainEvent, Page } from "./shared.js";
2
2
  import { EventDefinition, EventParseResult, MakeEventInput } from "./events.js";
3
3
  import { EmailMessage, EmailSender, Logger, ObjectStorage, PresignDownloadInput, PresignedUpload, StoredObjectInfo } from "./ports.js";
4
- import { Activity, ActivityAsset, ActivitySettings, AddDownloadAssetInput, Bundle, BundleItem, ContentItem, ContentType, Course, CourseSettings, CourseStatus, CreateBundleInput, CreateCourseInput, CreateDownloadInput, Download, DownloadAsset, DownloadStatus, ListBundlesQuery, ListCoursesQuery, ListDownloadsQuery, Module, ReorderDownloadAssetsInput, SaveActivityInput, UpdateBundleInput, UpdateCourseInput, UpdateDownloadInput } from "./schemas/content.js";
4
+ import { Activity, ActivityAsset, ActivitySettings, ActivityView, AddDownloadAssetInput, AddSpaceLinkInput, Bundle, BundleItem, Community, CommunitySettings, CommunityStatus, CommunityView, ContentItem, ContentType, Course, CourseSettings, CourseStatus, CourseView, CreateBundleInput, CreateCommunityInput, CreateCourseInput, CreateDownloadInput, CreateSpaceInput, DigestCadence, DigestSchedule, DmSettings, Download, DownloadAsset, DownloadFile, DownloadStatus, DownloadView, ListBundlesQuery, ListCommunitiesQuery, ListCoursesQuery, ListDownloadsQuery, Module, PatchCommunitySettingsInput, PatchDmSettingsInput, ReorderDownloadAssetsInput, SaveActivityInput, SetSpaceTopicsInput, Space, SpaceAccessRule, SpaceDetail, SpaceLink, SpaceSettings, SpaceTopic, UpdateBundleInput, UpdateCommunityInput, UpdateCourseInput, UpdateDownloadInput, UpdateSpaceInput } from "./schemas/content.js";
5
5
  import { EmailContent, EmailTemplateId, EmailTemplateParams, TemplateContext, TemplateRenderer } from "./email-templates.js";
6
- import { CreateUserInput, ProvisionUserInput, UpdateUserInput } from "./schemas/identity.js";
7
- import { AccountProvisioner, ActiveSession, SessionVerifier, User, UserId } from "./identity.js";
6
+ import { CreateUserInput, ProvisionUserInput, UpdateUserInput, UserProfile, UserProfileView } from "./schemas/identity.js";
7
+ import { AccessGrant, AccessRequest, AccessTokenVerifier, AccountProvisioner, ActiveSession, ApiKeySummary, AppAccessAdmin, ConnectedApp, CreatedApiKey, HeaderBag, NewApiKey, SessionVerifier, User, UserId } from "./identity.js";
8
8
  import { AcceptInviteInput, AddOrgUserInput, CreateInviteInput, CreateOrgUserInput, Invite, InviteInput, InviteRole, NewOrganizationInput, OrgUser, OrgUserInput, OrgUserProfile, OrgUserStatus, Organization, OrganizationInput, Role, UpdateOrgUserInput } from "./schemas/organizations.js";
9
9
  import { CreateOrganizationInput, InviteId, OrgUserId, OrganizationId } from "./organizations.js";
10
10
  import "./content.js";
11
- import { Entitlement, EntitlementStatus, EntitlementsQuery, GrantEntitlementInput } from "./schemas/entitlements.js";
11
+ import { Entitlement, EntitlementStatus, EntitlementsQuery, GrantEntitlementInput, SpaceMember, SpaceMemberSource, SpaceMemberStatus } from "./schemas/entitlements.js";
12
12
  import "./entitlements.js";
13
13
  import { ProgressRecord, ProgressRecordInput, ProgressReportItem, ProgressTarget, ProgressTargetType, ReportProgressInput } from "./schemas/progress.js";
14
14
  import { ProgressId } from "./progress.js";
15
- import { Asset, AssetKind, AssetStatus, AssetsQuery, DownloadTicket, RequestUploadInput, UploadTicket } from "./schemas/assets.js";
15
+ import { Asset, AssetKind, AssetSource, AssetStatus, AssetUrls, AssetView, AssetsQuery, RequestUploadInput, UploadTicket } from "./schemas/assets.js";
16
16
  import "./assets.js";
17
17
  import { ConfigureInput, ConnectInput, Connection, Validation } from "./schemas/integrations.js";
18
18
  import { Action, ActionContext, Integration } from "./integrations.js";
19
19
  import { Automation, AutomationAction, AutomationActionResult, AutomationKind, AutomationRun, AutomationRunStatus, AutomationRunsQuery, AutomationTrigger, AutomationsQuery, AvailableAction, AvailableActions, AvailableTriggers, CreateAutomationInput, CreateWebhookInput, CreatedWebhook, DeliverWebhookInput, UpdateAutomationInput, UpdateWebhookInput, Webhook, WebhookSecret } from "./schemas/automations.js";
20
- import { AutomationDispatch, AutomationEngine, AutomationExecutor, WebhookRequest, WebhookResponse, WebhookSender } from "./automations.js";
21
- import { ActivityCommentsRule, CommentListItem, CommentReaction, CommentReportSummary, CommentSettings, CommentStatus, CommentView, CommentsConfig, ListCommentsQuery, ReactionCounts, ReactionEmoji } from "./schemas/discussion.js";
20
+ import { AutomationDispatch, AutomationEngine, AutomationExecutor, DeliveryDispatch, ScheduledAutomation, WebhookRequest, WebhookResponse, WebhookSender } from "./automations.js";
21
+ import { ActivityCommentsRule, BlockedUser, Chat, ChatKind, ChatLastMessage, ChatStatus, ChatUser, CommentFlagResolution, CommentListItem, CommentReaction, 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 } from "./schemas/discussion.js";
22
22
  import { Comment, CommentAuthor, CommentReport } from "./discussion.js";
23
- export { type AcceptInviteInput, AccountProvisioner, Action, ActionContext, ActiveSession, type Activity, type ActivityAsset, type ActivityCommentsRule, type ActivitySettings, type AddDownloadAssetInput, type AddOrgUserInput, type Asset, type AssetKind, type AssetStatus, type AssetsQuery, type Automation, type AutomationAction, type AutomationActionResult, AutomationDispatch, AutomationEngine, AutomationExecutor, type AutomationKind, type AutomationRun, type AutomationRunStatus, type AutomationRunsQuery, type AutomationTrigger, type AutomationsQuery, type AvailableAction, type AvailableActions, type AvailableTriggers, type Bundle, type BundleItem, Comment, CommentAuthor, type CommentListItem, type CommentReaction, CommentReport, type CommentReportSummary, type CommentSettings, type CommentStatus, type CommentView, type CommentsConfig, type ConfigureInput, type ConnectInput, type Connection, type ContentItem, type ContentType, ContractNewDomainEvent, type Course, type CourseSettings, type CourseStatus, type CreateAutomationInput, type CreateBundleInput, type CreateCourseInput, type CreateDownloadInput, type CreateInviteInput, type CreateOrgUserInput, CreateOrganizationInput, type CreateUserInput, type CreateWebhookInput, type CreatedWebhook, type DeliverWebhookInput, DomainEvent, type Download, type DownloadAsset, type DownloadStatus, type DownloadTicket, EmailContent, EmailMessage, EmailSender, EmailTemplateId, EmailTemplateParams, type Entitlement, type EntitlementStatus, type EntitlementsQuery, EventDefinition, EventMetadata, EventParseResult, type GrantEntitlementInput, Integration, type Invite, InviteId, type InviteInput, type InviteRole, JsonValue, type ListBundlesQuery, type ListCommentsQuery, type ListCoursesQuery, type ListDownloadsQuery, Logger, MakeEventInput, type Module, NewDomainEvent, type NewOrganizationInput, ObjectStorage, type OrgUser, OrgUserId, type OrgUserInput, type OrgUserProfile, type OrgUserStatus, type Organization, OrganizationId, type OrganizationInput, Page, PresignDownloadInput, PresignedUpload, ProgressId, type ProgressRecord, type ProgressRecordInput, type ProgressReportItem, type ProgressTarget, type ProgressTargetType, type ProvisionUserInput, type ReactionCounts, type ReactionEmoji, type ReorderDownloadAssetsInput, type ReportProgressInput, type RequestUploadInput, type Role, type SaveActivityInput, SessionVerifier, StoredObjectInfo, TemplateContext, TemplateRenderer, type UpdateAutomationInput, type UpdateBundleInput, type UpdateCourseInput, type UpdateDownloadInput, type UpdateOrgUserInput, type UpdateUserInput, type UpdateWebhookInput, type UploadTicket, User, UserId, type Validation, type Webhook, WebhookRequest, WebhookResponse, type WebhookSecret, WebhookSender };
23
+ import { ChannelRecipient, Delivery, DeliveryResult, DeliveryStatus, DeviceView, NotificationCategory, NotificationFilter, NotificationTypeDeclaration, PushConfig, PushDevice, PushMessage, PushProvider, Reason, RecipientList, Scope, SettingsScope, StoredNotification, StoredSetting, SubjectRef } from "./notifications.js";
24
+ export { type AcceptInviteInput, AccessGrant, AccessRequest, AccessTokenVerifier, AccountProvisioner, Action, ActionContext, ActiveSession, type Activity, type ActivityAsset, type ActivityCommentsRule, type ActivitySettings, type ActivityView, type AddDownloadAssetInput, type AddOrgUserInput, type AddSpaceLinkInput, ApiKeySummary, AppAccessAdmin, type Asset, type AssetKind, type AssetSource, type AssetStatus, type AssetUrls, type AssetView, type AssetsQuery, type Automation, type AutomationAction, type AutomationActionResult, AutomationDispatch, AutomationEngine, AutomationExecutor, type AutomationKind, type AutomationRun, type AutomationRunStatus, type AutomationRunsQuery, type AutomationTrigger, type AutomationsQuery, type AvailableAction, type AvailableActions, type AvailableTriggers, type BlockedUser, type Bundle, type BundleItem, ChannelRecipient, type Chat, type ChatKind, type ChatLastMessage, type ChatStatus, type ChatUser, Comment, CommentAuthor, type CommentFlagResolution, type CommentListItem, type CommentReaction, CommentReport, type CommentReportSummary, type CommentSettings, type CommentStatus, type CommentView, type CommentsConfig, type Community, type CommunitySettings, type CommunityStatus, type CommunityView, type ConfigureInput, type ConnectInput, ConnectedApp, type Connection, type ContentItem, type ContentType, ContractNewDomainEvent, type Course, type CourseSettings, type CourseStatus, type CourseView, type CreateAutomationInput, type CreateBundleInput, type CreateCommunityInput, type CreateCourseInput, type CreateDownloadInput, type CreateInviteInput, type CreateOrgUserInput, CreateOrganizationInput, type CreateSpaceInput, type CreateUserInput, type CreateWebhookInput, CreatedApiKey, type CreatedWebhook, type DeliverWebhookInput, Delivery, DeliveryDispatch, DeliveryResult, DeliveryStatus, DeviceView, type DigestCadence, type DigestRun, type DigestSchedule, type DmSettings, DomainEvent, type Download, type DownloadAsset, type DownloadFile, type DownloadStatus, type DownloadView, EmailContent, EmailMessage, EmailSender, EmailTemplateId, EmailTemplateParams, type Entitlement, type EntitlementStatus, type EntitlementsQuery, EventDefinition, EventMetadata, EventParseResult, type FlaggedComment, type GrantEntitlementInput, HeaderBag, Integration, type Invite, InviteId, type InviteInput, type InviteRole, JsonValue, type ListBundlesQuery, type ListCommentsQuery, type ListCommunitiesQuery, type ListCoursesQuery, type ListDownloadsQuery, Logger, MakeEventInput, type Mention, type MentionItemType, type MentionView, type Message, type MessageAttachment, type MessageFile, type MessageFlag, type MessageFlagResolution, type MessageReaction, type MessageView, type Module, NewApiKey, NewDomainEvent, type NewOrganizationInput, NotificationCategory, NotificationFilter, NotificationTypeDeclaration, ObjectStorage, type OrgUser, OrgUserId, type OrgUserInput, type OrgUserProfile, type OrgUserStatus, type Organization, OrganizationId, type OrganizationInput, Page, type PatchCommunitySettingsInput, type PatchDmSettingsInput, type Post, type PostBookmark, type PostFlag, type PostFlagResolution, type PostReaction, type PostStatus, type PostView, PresignDownloadInput, PresignedUpload, ProgressId, type ProgressRecord, type ProgressRecordInput, type ProgressReportItem, type ProgressTarget, type ProgressTargetType, type ProvisionUserInput, PushConfig, PushDevice, PushMessage, PushProvider, type ReactionCounts, type ReactionEmoji, Reason, RecipientList, type ReorderDownloadAssetsInput, type ReportProgressInput, type RequestUploadInput, type Role, type SaveActivityInput, ScheduledAutomation, Scope, SessionVerifier, type SetSpaceTopicsInput, SettingsScope, type Space, type SpaceAccessRule, type SpaceDetail, type SpaceLink, type SpaceMember, type SpaceMemberSource, type SpaceMemberStatus, type SpaceSettings, type SpaceTopic, StoredNotification, StoredObjectInfo, StoredSetting, SubjectRef, type Subscription, type SubscriptionItemType, type SubscriptionState, type SubscriptionView, TemplateContext, TemplateRenderer, type UpdateAutomationInput, type UpdateBundleInput, type UpdateCommunityInput, type UpdateCourseInput, type UpdateDownloadInput, type UpdateOrgUserInput, type UpdateSpaceInput, type UpdateUserInput, type UpdateWebhookInput, type UploadTicket, User, UserId, type UserProfile, type UserProfileView, type Validation, type Webhook, WebhookRequest, WebhookResponse, type WebhookSecret, WebhookSender };
@@ -0,0 +1,157 @@
1
+ import { JsonValue } from "./shared.js";
2
+ import { EmailTemplateId } from "./email-templates.js";
3
+ //#region src/types/notifications.d.ts
4
+ type Reason = 'subject' | 'post_author' | 'comment_author' | 'message_author' | 'follower' | 'thread_participant' | 'mentioned' | 'participant' | 'space_member' | 'community_member' | 'course_member' | 'moderator' | 'staff';
5
+ type Scope = 'org' | 'community' | 'space' | 'chat';
6
+ interface SubjectRef {
7
+ type: 'post' | 'comment' | 'chat' | 'message' | 'space' | 'community' | 'course' | 'download' | 'bundle' | 'activity';
8
+ id: string;
9
+ }
10
+ interface NotificationTypeDeclaration {
11
+ type: string;
12
+ scopes: Scope[];
13
+ reasons: Reason[];
14
+ display: Partial<Record<Scope, string[]>>;
15
+ email?: Partial<Record<Scope, {
16
+ template: EmailTemplateId;
17
+ byReason?: Partial<Record<Reason, EmailTemplateId>>;
18
+ }>>;
19
+ push?: Partial<Record<Scope, {
20
+ title: string;
21
+ body: string;
22
+ }>>;
23
+ }
24
+ interface NotificationCategory {
25
+ key: string;
26
+ covers: {
27
+ type: string;
28
+ reasons: Reason[];
29
+ }[];
30
+ channels: Record<string, {
31
+ default: boolean;
32
+ locked: boolean;
33
+ }>;
34
+ perSpace?: boolean;
35
+ spaceDefaults?: Record<string, Record<string, boolean>>;
36
+ }
37
+ interface StoredNotification {
38
+ id: string;
39
+ orgId: string;
40
+ userId: string;
41
+ type: string;
42
+ scope: Scope;
43
+ reasons: Reason[];
44
+ matchedReason: Reason;
45
+ category: string;
46
+ communityId: string | null;
47
+ spaceId: string | null;
48
+ actorOrgUserId: string | null;
49
+ subject: SubjectRef | null;
50
+ parent: SubjectRef | null;
51
+ display: Record<string, JsonValue>;
52
+ createdAt: Date;
53
+ }
54
+ type DeliveryStatus = 'pending' | 'sent' | 'failed';
55
+ interface Delivery {
56
+ id: string;
57
+ notificationId: string;
58
+ channel: string;
59
+ status: DeliveryStatus;
60
+ lastError: string | null;
61
+ createdAt: Date;
62
+ sentAt: Date | null;
63
+ }
64
+ interface StoredSetting {
65
+ communityId: string | null;
66
+ spaceId: string | null;
67
+ category: string;
68
+ channel: string;
69
+ enabled: boolean;
70
+ }
71
+ type SettingsScope = {
72
+ communityId: string;
73
+ } | 'org';
74
+ interface PushDevice {
75
+ id: string;
76
+ provider: 'apns' | 'fcm' | 'webpush';
77
+ token: string;
78
+ p256dh: string | null;
79
+ auth: string | null;
80
+ appId: string | null;
81
+ environment: 'production' | 'sandbox' | null;
82
+ }
83
+ interface PushMessage {
84
+ title: string;
85
+ body: string;
86
+ data: {
87
+ notificationId: string;
88
+ type: string;
89
+ subject: SubjectRef | null;
90
+ parent: SubjectRef | null;
91
+ communityId: string | null;
92
+ spaceId: string | null;
93
+ courseId: string | null;
94
+ };
95
+ }
96
+ interface ChannelRecipient {
97
+ email?: string;
98
+ devices?: PushDevice[];
99
+ address?: JsonValue;
100
+ }
101
+ interface DeliveryResult {
102
+ accepted: boolean;
103
+ deadDeviceIds: string[];
104
+ error?: string;
105
+ }
106
+ interface NotificationFilter {
107
+ scope?: 'org' | 'community';
108
+ communityId?: string;
109
+ includeOrg?: boolean;
110
+ category?: string[];
111
+ reason?: Reason[];
112
+ type?: string[];
113
+ unread?: boolean;
114
+ }
115
+ interface RecipientList {
116
+ type: string;
117
+ scope: Scope;
118
+ actorOrgUserId: string | null;
119
+ communityId: string | null;
120
+ spaceId: string | null;
121
+ subject: SubjectRef | null;
122
+ parent: SubjectRef | null;
123
+ display: Record<string, JsonValue>;
124
+ recipients?: {
125
+ orgUserId: string;
126
+ userId: string;
127
+ reasons: Reason[];
128
+ }[];
129
+ audience?: {
130
+ reason: 'space_member';
131
+ spaceId: string;
132
+ exclude: string[];
133
+ };
134
+ }
135
+ type PushProvider = PushDevice['provider'];
136
+ interface DeviceView extends PushDevice {
137
+ lastSeenAt: Date;
138
+ }
139
+ interface PushConfig {
140
+ apns?: {
141
+ teamId: string;
142
+ keyId: string;
143
+ key: string;
144
+ bundleIds: string[];
145
+ };
146
+ fcm?: {
147
+ serviceAccount: Record<string, unknown>;
148
+ };
149
+ webpush?: {
150
+ publicKey: string;
151
+ privateKey: string;
152
+ subject: string;
153
+ };
154
+ }
155
+ //#endregion
156
+ export { ChannelRecipient, Delivery, DeliveryResult, DeliveryStatus, DeviceView, NotificationCategory, NotificationFilter, NotificationTypeDeclaration, PushConfig, PushDevice, PushMessage, PushProvider, Reason, RecipientList, Scope, SettingsScope, StoredNotification, StoredSetting, SubjectRef };
157
+ //# sourceMappingURL=notifications.d.ts.map
@@ -39,6 +39,7 @@ interface PresignDownloadInput {
39
39
  downloadFilename?: string;
40
40
  }
41
41
  interface ObjectStorage {
42
+ readonly uploadExpirySeconds: number;
42
43
  /** Presigned URL for a direct browser upload (temporary, expiring). */
43
44
  presignUpload(input: {
44
45
  key: string;
@@ -49,6 +50,11 @@ interface ObjectStorage {
49
50
  presignDownload(input: PresignDownloadInput): Promise<string>;
50
51
  /** Object metadata, or null if it does not exist. */
51
52
  stat(key: string): Promise<StoredObjectInfo | null>;
53
+ list(prefix: string): Promise<StoredObjectInfo[]>;
54
+ copy(input: {
55
+ from: string;
56
+ to: string;
57
+ }): Promise<void>;
52
58
  /** Permanently remove an object. */
53
59
  remove(key: string): Promise<void>;
54
60
  }