@headless-lms/core 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (307) hide show
  1. package/dist/assets/events.d.ts +24 -18
  2. package/dist/assets/file-urls.d.ts +11 -7
  3. package/dist/assets/file-urls.js +14 -4
  4. package/dist/assets/file-urls.js.map +1 -1
  5. package/dist/assets/index.d.ts +5 -4
  6. package/dist/assets/index.js +4 -3
  7. package/dist/assets/jobs.d.ts +15 -0
  8. package/dist/assets/jobs.js +30 -0
  9. package/dist/assets/jobs.js.map +1 -0
  10. package/dist/assets/ports.d.ts +37 -17
  11. package/dist/assets/service.d.ts +30 -15
  12. package/dist/assets/service.js +229 -59
  13. package/dist/assets/service.js.map +1 -1
  14. package/dist/automations/actions.js +2 -63
  15. package/dist/automations/actions.js.map +1 -1
  16. package/dist/automations/catalog.d.ts +1 -2
  17. package/dist/automations/catalog.js +137 -65
  18. package/dist/automations/catalog.js.map +1 -1
  19. package/dist/automations/community-derivations.js +20 -20
  20. package/dist/automations/community-derivations.js.map +1 -1
  21. package/dist/automations/community-mail.d.ts +36 -20
  22. package/dist/automations/community-mail.js +32 -24
  23. package/dist/automations/community-mail.js.map +1 -1
  24. package/dist/automations/event-permissions.d.ts +12 -0
  25. package/dist/automations/event-permissions.js +38 -0
  26. package/dist/automations/event-permissions.js.map +1 -0
  27. package/dist/automations/events.d.ts +0 -10
  28. package/dist/automations/index.d.ts +12 -4
  29. package/dist/automations/index.js +9 -1
  30. package/dist/automations/notifications/applicable.d.ts +8 -0
  31. package/dist/automations/notifications/applicable.js +12 -0
  32. package/dist/automations/notifications/applicable.js.map +1 -0
  33. package/dist/automations/notifications/debounce.d.ts +25 -0
  34. package/dist/automations/notifications/debounce.js +93 -0
  35. package/dist/automations/notifications/debounce.js.map +1 -0
  36. package/dist/automations/notifications/defaults.d.ts +8 -0
  37. package/dist/automations/notifications/defaults.js +346 -0
  38. package/dist/automations/notifications/defaults.js.map +1 -0
  39. package/dist/automations/notifications/delivery.d.ts +28 -0
  40. package/dist/automations/notifications/delivery.js +88 -0
  41. package/dist/automations/notifications/delivery.js.map +1 -0
  42. package/dist/automations/notifications/processor.d.ts +64 -0
  43. package/dist/automations/notifications/processor.js +270 -0
  44. package/dist/automations/notifications/processor.js.map +1 -0
  45. package/dist/automations/notifications/rules/content.d.ts +6 -0
  46. package/dist/automations/notifications/rules/content.js +96 -0
  47. package/dist/automations/notifications/rules/content.js.map +1 -0
  48. package/dist/automations/notifications/rules/discussion.d.ts +7 -0
  49. package/dist/automations/notifications/rules/discussion.js +678 -0
  50. package/dist/automations/notifications/rules/discussion.js.map +1 -0
  51. package/dist/automations/notifications/rules/entitlements.d.ts +6 -0
  52. package/dist/automations/notifications/rules/entitlements.js +276 -0
  53. package/dist/automations/notifications/rules/entitlements.js.map +1 -0
  54. package/dist/automations/notifications/rules/events.d.ts +9 -0
  55. package/dist/automations/notifications/rules/events.js +27 -0
  56. package/dist/automations/notifications/rules/events.js.map +1 -0
  57. package/dist/automations/notifications/rules/index.d.ts +6 -0
  58. package/dist/automations/notifications/rules/index.js +15 -0
  59. package/dist/automations/notifications/rules/index.js.map +1 -0
  60. package/dist/automations/notifications/rules/organizations.d.ts +6 -0
  61. package/dist/automations/notifications/rules/organizations.js +35 -0
  62. package/dist/automations/notifications/rules/organizations.js.map +1 -0
  63. package/dist/automations/notifications/rules/recipients.d.ts +32 -0
  64. package/dist/automations/notifications/rules/recipients.js +98 -0
  65. package/dist/automations/notifications/rules/recipients.js.map +1 -0
  66. package/dist/automations/notifications/service.d.ts +29 -0
  67. package/dist/automations/notifications/service.js +45 -0
  68. package/dist/automations/notifications/service.js.map +1 -0
  69. package/dist/automations/notifications/types.d.ts +7 -0
  70. package/dist/automations/notifications/types.js +560 -0
  71. package/dist/automations/notifications/types.js.map +1 -0
  72. package/dist/automations/ports.d.ts +134 -21
  73. package/dist/automations/service.d.ts +30 -30
  74. package/dist/automations/service.js +111 -144
  75. package/dist/automations/service.js.map +1 -1
  76. package/dist/content/event-sight.d.ts +11 -0
  77. package/dist/content/event-sight.js +11 -0
  78. package/dist/content/event-sight.js.map +1 -0
  79. package/dist/content/events.d.ts +437 -46
  80. package/dist/content/events.js +45 -1
  81. package/dist/content/events.js.map +1 -1
  82. package/dist/content/index.d.ts +8 -4
  83. package/dist/content/index.js +5 -1
  84. package/dist/content/jobs.d.ts +16 -0
  85. package/dist/content/jobs.js +37 -0
  86. package/dist/content/jobs.js.map +1 -0
  87. package/dist/content/model.d.ts +2 -2
  88. package/dist/content/notification-categories.d.ts +37 -0
  89. package/dist/content/notification-categories.js +73 -0
  90. package/dist/content/notification-categories.js.map +1 -0
  91. package/dist/content/ports.d.ts +132 -68
  92. package/dist/content/service.d.ts +100 -68
  93. package/dist/content/service.js +703 -146
  94. package/dist/content/service.js.map +1 -1
  95. package/dist/content/titles.d.ts +25 -0
  96. package/dist/content/titles.js +82 -0
  97. package/dist/content/titles.js.map +1 -0
  98. package/dist/content/types.d.ts +2 -2
  99. package/dist/discussion/authors.d.ts +4 -2
  100. package/dist/discussion/authors.js +9 -5
  101. package/dist/discussion/authors.js.map +1 -1
  102. package/dist/discussion/chats.d.ts +63 -39
  103. package/dist/discussion/chats.js +455 -190
  104. package/dist/discussion/chats.js.map +1 -1
  105. package/dist/discussion/digests.d.ts +24 -0
  106. package/dist/discussion/digests.js +104 -0
  107. package/dist/discussion/digests.js.map +1 -0
  108. package/dist/discussion/events.d.ts +227 -23
  109. package/dist/discussion/events.js +114 -19
  110. package/dist/discussion/events.js.map +1 -1
  111. package/dist/discussion/index.d.ts +12 -4
  112. package/dist/discussion/index.js +9 -2
  113. package/dist/discussion/jobs.d.ts +16 -0
  114. package/dist/discussion/jobs.js +40 -0
  115. package/dist/discussion/jobs.js.map +1 -0
  116. package/dist/discussion/live.d.ts +106 -0
  117. package/dist/discussion/live.js +642 -0
  118. package/dist/discussion/live.js.map +1 -0
  119. package/dist/discussion/mentions.d.ts +11 -0
  120. package/dist/discussion/mentions.js +35 -0
  121. package/dist/discussion/mentions.js.map +1 -0
  122. package/dist/discussion/ports.d.ts +279 -114
  123. package/dist/discussion/ports.js.map +1 -1
  124. package/dist/discussion/posts.d.ts +60 -44
  125. package/dist/discussion/posts.js +453 -287
  126. package/dist/discussion/posts.js.map +1 -1
  127. package/dist/discussion/rules.d.ts +18 -0
  128. package/dist/discussion/rules.js +22 -0
  129. package/dist/discussion/rules.js.map +1 -0
  130. package/dist/discussion/service.d.ts +50 -35
  131. package/dist/discussion/service.js +333 -205
  132. package/dist/discussion/service.js.map +1 -1
  133. package/dist/discussion/subscriptions.d.ts +37 -0
  134. package/dist/discussion/subscriptions.js +115 -0
  135. package/dist/discussion/subscriptions.js.map +1 -0
  136. package/dist/discussion/titles.d.ts +28 -0
  137. package/dist/discussion/titles.js +98 -0
  138. package/dist/discussion/titles.js.map +1 -0
  139. package/dist/entitlements/events.d.ts +20 -20
  140. package/dist/entitlements/index.d.ts +5 -4
  141. package/dist/entitlements/index.js +3 -2
  142. package/dist/entitlements/jobs.d.ts +12 -0
  143. package/dist/entitlements/jobs.js +18 -0
  144. package/dist/entitlements/jobs.js.map +1 -0
  145. package/dist/entitlements/model.d.ts +2 -2
  146. package/dist/entitlements/ports.d.ts +68 -38
  147. package/dist/entitlements/rules.d.ts +3 -6
  148. package/dist/entitlements/rules.js +5 -10
  149. package/dist/entitlements/rules.js.map +1 -1
  150. package/dist/entitlements/service.d.ts +43 -28
  151. package/dist/entitlements/service.js +387 -160
  152. package/dist/entitlements/service.js.map +1 -1
  153. package/dist/identity/devices.d.ts +30 -0
  154. package/dist/identity/devices.js +109 -0
  155. package/dist/identity/devices.js.map +1 -0
  156. package/dist/identity/index.d.ts +6 -5
  157. package/dist/identity/index.js +4 -3
  158. package/dist/identity/model.d.ts +2 -2
  159. package/dist/identity/notification-settings.d.ts +28 -0
  160. package/dist/identity/notification-settings.js +114 -0
  161. package/dist/identity/notification-settings.js.map +1 -0
  162. package/dist/identity/ports.d.ts +80 -56
  163. package/dist/identity/service.d.ts +8 -7
  164. package/dist/identity/service.js +17 -13
  165. package/dist/identity/service.js.map +1 -1
  166. package/dist/integrations/ports.d.ts +9 -8
  167. package/dist/integrations/service.d.ts +9 -8
  168. package/dist/integrations/service.js +33 -16
  169. package/dist/integrations/service.js.map +1 -1
  170. package/dist/organizations/default-roles.d.ts +22 -0
  171. package/dist/organizations/default-roles.js +89 -0
  172. package/dist/organizations/default-roles.js.map +1 -0
  173. package/dist/organizations/effective-permissions.d.ts +45 -0
  174. package/dist/organizations/effective-permissions.js +113 -0
  175. package/dist/organizations/effective-permissions.js.map +1 -0
  176. package/dist/organizations/events.d.ts +320 -181
  177. package/dist/organizations/events.js +90 -18
  178. package/dist/organizations/events.js.map +1 -1
  179. package/dist/organizations/index.d.ts +15 -10
  180. package/dist/organizations/index.js +8 -3
  181. package/dist/organizations/members.d.ts +66 -8
  182. package/dist/organizations/members.js.map +1 -1
  183. package/dist/organizations/notification-catalog.d.ts +31 -0
  184. package/dist/organizations/notification-catalog.js +32 -0
  185. package/dist/organizations/notification-catalog.js.map +1 -0
  186. package/dist/organizations/notification-categories.d.ts +34 -0
  187. package/dist/organizations/notification-categories.js +66 -0
  188. package/dist/organizations/notification-categories.js.map +1 -0
  189. package/dist/organizations/org-roles.d.ts +33 -0
  190. package/dist/organizations/org-roles.js +49 -0
  191. package/dist/organizations/org-roles.js.map +1 -0
  192. package/dist/organizations/permissions.d.ts +311 -0
  193. package/dist/organizations/permissions.js +327 -0
  194. package/dist/organizations/permissions.js.map +1 -0
  195. package/dist/organizations/ports.d.ts +187 -65
  196. package/dist/organizations/service.d.ts +104 -35
  197. package/dist/organizations/service.js +1247 -323
  198. package/dist/organizations/service.js.map +1 -1
  199. package/dist/organizations/testing.d.ts +18 -0
  200. package/dist/organizations/testing.js +37 -0
  201. package/dist/organizations/testing.js.map +1 -0
  202. package/dist/organizations/types.d.ts +5 -16
  203. package/dist/progress/index.d.ts +2 -2
  204. package/dist/progress/ports.d.ts +11 -3
  205. package/dist/progress/service.d.ts +6 -5
  206. package/dist/progress/service.js +23 -8
  207. package/dist/progress/service.js.map +1 -1
  208. package/dist/reporting/admin/index.d.ts +6 -4
  209. package/dist/reporting/admin/model.d.ts +36 -3
  210. package/dist/reporting/admin/ports.d.ts +39 -14
  211. package/dist/reporting/admin/service.d.ts +32 -11
  212. package/dist/reporting/admin/service.js +102 -18
  213. package/dist/reporting/admin/service.js.map +1 -1
  214. package/dist/reporting/events/index.d.ts +27 -0
  215. package/dist/reporting/events/index.js +20 -0
  216. package/dist/reporting/events/index.js.map +1 -0
  217. package/dist/reporting/member/calendar.d.ts +11 -0
  218. package/dist/reporting/member/calendar.js +75 -0
  219. package/dist/reporting/member/calendar.js.map +1 -0
  220. package/dist/reporting/member/index.d.ts +3 -2
  221. package/dist/reporting/member/model.d.ts +80 -26
  222. package/dist/reporting/member/ports.d.ts +50 -28
  223. package/dist/reporting/member/service.d.ts +81 -35
  224. package/dist/reporting/member/service.js +438 -145
  225. package/dist/reporting/member/service.js.map +1 -1
  226. package/dist/shared/actor.d.ts +22 -3
  227. package/dist/shared/errors.d.ts +15 -2
  228. package/dist/shared/errors.js +21 -2
  229. package/dist/shared/errors.js.map +1 -1
  230. package/dist/shared/id.d.ts +7 -0
  231. package/dist/shared/id.js +8 -1
  232. package/dist/shared/id.js.map +1 -1
  233. package/dist/shared/logger.d.ts +2 -1
  234. package/dist/shared/logger.js +10 -1
  235. package/dist/shared/logger.js.map +1 -1
  236. package/dist/shared/mailer.d.ts +11 -1
  237. package/dist/shared/mailer.js +32 -5
  238. package/dist/shared/mailer.js.map +1 -1
  239. package/dist/shared/notification-categories.d.ts +16 -0
  240. package/dist/shared/notification-categories.js +94 -0
  241. package/dist/shared/notification-categories.js.map +1 -0
  242. package/dist/shared/notification-settings.d.ts +14 -0
  243. package/dist/shared/notification-settings.js +61 -0
  244. package/dist/shared/notification-settings.js.map +1 -0
  245. package/dist/shared/ports.d.ts +68 -2
  246. package/dist/shared/settings.d.ts +2 -1
  247. package/dist/shared/settings.js +1 -0
  248. package/dist/shared/settings.js.map +1 -1
  249. package/dist/types/automations.d.ts +8 -2
  250. package/dist/types/content.d.ts +2 -2
  251. package/dist/types/discussion.d.ts +4 -5
  252. package/dist/types/email-templates.d.ts +119 -6
  253. package/dist/types/entitlements.d.ts +2 -2
  254. package/dist/types/identity.d.ts +14 -17
  255. package/dist/types/index.d.ts +13 -12
  256. package/dist/types/index.js +2 -1
  257. package/dist/types/notifications.d.ts +157 -0
  258. package/dist/types/notifications.js +1 -0
  259. package/dist/types/organizations.d.ts +3 -2
  260. package/dist/types/ports.d.ts +8 -1
  261. package/dist/types/ports.js +7 -1
  262. package/dist/types/ports.js.map +1 -0
  263. package/dist/types/schemas/assets.d.ts +5 -5
  264. package/dist/types/schemas/assets.js +4 -3
  265. package/dist/types/schemas/assets.js.map +1 -1
  266. package/dist/types/schemas/automations.d.ts +1 -10
  267. package/dist/types/schemas/automations.js +1 -3
  268. package/dist/types/schemas/automations.js.map +1 -1
  269. package/dist/types/schemas/content.d.ts +596 -11
  270. package/dist/types/schemas/content.js +225 -9
  271. package/dist/types/schemas/content.js.map +1 -1
  272. package/dist/types/schemas/discussion.d.ts +362 -66
  273. package/dist/types/schemas/discussion.js +123 -15
  274. package/dist/types/schemas/discussion.js.map +1 -1
  275. package/dist/types/schemas/entitlements.d.ts +14 -1
  276. package/dist/types/schemas/entitlements.js +11 -4
  277. package/dist/types/schemas/entitlements.js.map +1 -1
  278. package/dist/types/schemas/identity.d.ts +1 -85
  279. package/dist/types/schemas/identity.js +1 -42
  280. package/dist/types/schemas/identity.js.map +1 -1
  281. package/dist/types/schemas/index.d.ts +8 -7
  282. package/dist/types/schemas/index.js +8 -7
  283. package/dist/types/schemas/notifications.d.ts +96 -0
  284. package/dist/types/schemas/notifications.js +57 -0
  285. package/dist/types/schemas/notifications.js.map +1 -0
  286. package/dist/types/schemas/organizations.d.ts +96 -60
  287. package/dist/types/schemas/organizations.js +78 -27
  288. package/dist/types/schemas/organizations.js.map +1 -1
  289. package/dist/types/schemas/progress.d.ts +0 -1
  290. package/dist/types/schemas/progress.js +0 -1
  291. package/dist/types/schemas/progress.js.map +1 -1
  292. package/package.json +1 -1
  293. package/dist/automations/community-notifications.d.ts +0 -16
  294. package/dist/automations/community-notifications.js +0 -84
  295. package/dist/automations/community-notifications.js.map +0 -1
  296. package/dist/automations/seeds.d.ts +0 -17
  297. package/dist/automations/seeds.js +0 -235
  298. package/dist/automations/seeds.js.map +0 -1
  299. package/dist/identity/notifications.d.ts +0 -27
  300. package/dist/identity/notifications.js +0 -101
  301. package/dist/identity/notifications.js.map +0 -1
  302. package/dist/organizations/access-scopes.d.ts +0 -19
  303. package/dist/organizations/access-scopes.js +0 -89
  304. package/dist/organizations/access-scopes.js.map +0 -1
  305. package/dist/organizations/roles.d.ts +0 -19
  306. package/dist/organizations/roles.js +0 -82
  307. package/dist/organizations/roles.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification-categories.js","names":[],"sources":["../../src/shared/notification-categories.ts"],"sourcesContent":["import type { NotificationCategory, NotificationTypeDeclaration, Scope } from '../types/index.js';\nimport { notificationCategoryListSchema } from '../types/schemas/notifications.js';\nimport { ValidationError, type ValidationProblem } from './errors.js';\nimport type { NotificationTypeRegistry } from './ports.js';\n\nexport type CategoryListScope = 'org' | 'community';\n\nconst LIST_SCOPES: Record<CategoryListScope, Scope[]> = {\n org: ['org'],\n community: ['community', 'space', 'chat'],\n};\n\nexport function coversListScope(\n declaration: Pick<NotificationTypeDeclaration, 'scopes'>,\n listScope: CategoryListScope,\n): boolean {\n return declaration.scopes.some((scope) => LIST_SCOPES[listScope].includes(scope));\n}\n\nexport function typesForList(\n types: Pick<NotificationTypeRegistry, 'list'>,\n listScope: CategoryListScope,\n): Pick<NotificationTypeDeclaration, 'type' | 'scopes' | 'reasons'>[] {\n return types.list().filter((declaration) => coversListScope(declaration, listScope));\n}\n\nexport function categoryListProblems(\n categories: NotificationCategory[],\n listScope: CategoryListScope,\n types: Pick<NotificationTypeRegistry, 'get'>,\n configured: string[],\n): ValidationProblem[] {\n const problems: ValidationProblem[] = [];\n const problem = (path: string, message: string) => problems.push({ path, message });\n const keys = new Set<string>();\n const covered = new Set<string>();\n categories.forEach((category, index) => {\n const at = `categories[${index}]`;\n if (keys.has(category.key)) {\n problem(`${at}.key`, `the key ${category.key} is used by an earlier category`);\n }\n keys.add(category.key);\n const pairs: string[] = [];\n category.covers.forEach((cover, coverIndex) => {\n const coverAt = `${at}.covers[${coverIndex}]`;\n const declaration = types.get(cover.type);\n if (!declaration) {\n problem(`${coverAt}.type`, `${cover.type} is not a notification type`);\n return;\n }\n if (!coversListScope(declaration, listScope)) {\n problem(`${coverAt}.type`, `${cover.type} cannot be in the ${listScope} list`);\n }\n cover.reasons.forEach((reason, reasonIndex) => {\n if (!declaration.reasons.includes(reason)) {\n problem(\n `${coverAt}.reasons[${reasonIndex}]`,\n `${cover.type} does not allow the reason ${reason}`,\n );\n }\n pairs.push(`${cover.type}:${reason}`);\n });\n if (category.perSpace === true && !declaration.scopes.includes('space')) {\n problem(\n `${coverAt}.type`,\n `${cover.type} cannot occur in a space, so it cannot be per space`,\n );\n }\n });\n if (Object.keys(category.channels).length === 0) {\n problem(`${at}.channels`, 'the category offers no channel');\n }\n for (const channel of Object.keys(category.channels)) {\n if (!configured.includes(channel)) {\n problem(`${at}.channels.${channel}`, `the channel ${channel} is not configured`);\n }\n }\n if (category.perSpace === true && listScope === 'org') {\n problem(`${at}.perSpace`, 'only a community list can have a per-space category');\n }\n if (category.spaceDefaults !== undefined) {\n if (category.perSpace !== true) {\n problem(`${at}.spaceDefaults`, 'spaceDefaults needs perSpace');\n }\n for (const [spaceId, channels] of Object.entries(category.spaceDefaults)) {\n for (const channel of Object.keys(channels)) {\n if (!(channel in category.channels)) {\n problem(\n `${at}.spaceDefaults.${spaceId}.${channel}`,\n `spaceDefaults for ${spaceId} names the channel ${channel}, which the category does not offer`,\n );\n }\n }\n }\n }\n if (pairs.length > 0 && pairs.every((pair) => covered.has(pair))) {\n problem(`${at}.covers`, 'earlier categories already cover everything it covers');\n }\n for (const pair of pairs) {\n covered.add(pair);\n }\n });\n return problems;\n}\n\nexport function assertValidCategoryList(\n categories: NotificationCategory[],\n listScope: CategoryListScope,\n types: Pick<NotificationTypeRegistry, 'get'>,\n configured: string[],\n): void {\n const problems = categoryListProblems(categories, listScope, types, configured);\n if (problems.length > 0) {\n throw new ValidationError(problems);\n }\n}\n\nconst LEADING_CHANNELS = ['inApp', 'email', 'push'];\n\nexport function channelOrder(configured: string[]): string[] {\n return [\n ...LEADING_CHANNELS.filter((channel) => configured.includes(channel)),\n ...configured.filter((channel) => !LEADING_CHANNELS.includes(channel)),\n ];\n}\n\nfunction inOrder<T>(values: Record<string, T>, order: string[]): Record<string, T> {\n return Object.fromEntries(\n order.filter((channel) => channel in values).map((channel) => [channel, values[channel]!]),\n );\n}\n\nexport function offeringConfigured(\n categories: NotificationCategory[],\n configured: string[],\n): NotificationCategory[] {\n const order = channelOrder(configured);\n return categories.flatMap((category) => {\n const channels = inOrder(category.channels, order);\n if (Object.keys(channels).length === 0) {\n return [];\n }\n const { spaceDefaults, ...rest } = category;\n return [\n {\n ...rest,\n channels,\n ...(spaceDefaults !== undefined && {\n spaceDefaults: Object.fromEntries(\n Object.entries(spaceDefaults).map(([spaceId, values]) => [\n spaceId,\n inOrder(values, Object.keys(channels)),\n ]),\n ),\n }),\n },\n ];\n });\n}\n\nexport function storedCategoryList(value: unknown): NotificationCategory[] | null {\n if (value === null || value === undefined) {\n return null;\n }\n const parsed = notificationCategoryListSchema.safeParse(value);\n if (!parsed.success) {\n throw new Error(`stored notification categories are invalid: ${parsed.error.message}`);\n }\n return parsed.data;\n}\n"],"mappings":";;;AAOA,MAAM,cAAkD;CACtD,KAAK,CAAC,KAAK;CACX,WAAW;EAAC;EAAa;EAAS;CAAM;AAC1C;AAEA,SAAgB,gBACd,aACA,WACS;CACT,OAAO,YAAY,OAAO,MAAM,UAAU,YAAY,UAAU,CAAC,SAAS,KAAK,CAAC;AAClF;AAEA,SAAgB,aACd,OACA,WACoE;CACpE,OAAO,MAAM,KAAK,CAAC,CAAC,QAAQ,gBAAgB,gBAAgB,aAAa,SAAS,CAAC;AACrF;AAEA,SAAgB,qBACd,YACA,WACA,OACA,YACqB;CACrB,MAAM,WAAgC,CAAC;CACvC,MAAM,WAAW,MAAc,YAAoB,SAAS,KAAK;EAAE;EAAM;CAAQ,CAAC;CAClF,MAAM,uBAAO,IAAI,IAAY;CAC7B,MAAM,0BAAU,IAAI,IAAY;CAChC,WAAW,SAAS,UAAU,UAAU;EACtC,MAAM,KAAK,cAAc,MAAM;EAC/B,IAAI,KAAK,IAAI,SAAS,GAAG,GACvB,QAAQ,GAAG,GAAG,OAAO,WAAW,SAAS,IAAI,gCAAgC;EAE/E,KAAK,IAAI,SAAS,GAAG;EACrB,MAAM,QAAkB,CAAC;EACzB,SAAS,OAAO,SAAS,OAAO,eAAe;GAC7C,MAAM,UAAU,GAAG,GAAG,UAAU,WAAW;GAC3C,MAAM,cAAc,MAAM,IAAI,MAAM,IAAI;GACxC,IAAI,CAAC,aAAa;IAChB,QAAQ,GAAG,QAAQ,QAAQ,GAAG,MAAM,KAAK,4BAA4B;IACrE;GACF;GACA,IAAI,CAAC,gBAAgB,aAAa,SAAS,GACzC,QAAQ,GAAG,QAAQ,QAAQ,GAAG,MAAM,KAAK,oBAAoB,UAAU,MAAM;GAE/E,MAAM,QAAQ,SAAS,QAAQ,gBAAgB;IAC7C,IAAI,CAAC,YAAY,QAAQ,SAAS,MAAM,GACtC,QACE,GAAG,QAAQ,WAAW,YAAY,IAClC,GAAG,MAAM,KAAK,6BAA6B,QAC7C;IAEF,MAAM,KAAK,GAAG,MAAM,KAAK,GAAG,QAAQ;GACtC,CAAC;GACD,IAAI,SAAS,aAAa,QAAQ,CAAC,YAAY,OAAO,SAAS,OAAO,GACpE,QACE,GAAG,QAAQ,QACX,GAAG,MAAM,KAAK,oDAChB;EAEJ,CAAC;EACD,IAAI,OAAO,KAAK,SAAS,QAAQ,CAAC,CAAC,WAAW,GAC5C,QAAQ,GAAG,GAAG,YAAY,gCAAgC;EAE5D,KAAK,MAAM,WAAW,OAAO,KAAK,SAAS,QAAQ,GACjD,IAAI,CAAC,WAAW,SAAS,OAAO,GAC9B,QAAQ,GAAG,GAAG,YAAY,WAAW,eAAe,QAAQ,mBAAmB;EAGnF,IAAI,SAAS,aAAa,QAAQ,cAAc,OAC9C,QAAQ,GAAG,GAAG,YAAY,qDAAqD;EAEjF,IAAI,SAAS,kBAAkB,KAAA,GAAW;GACxC,IAAI,SAAS,aAAa,MACxB,QAAQ,GAAG,GAAG,iBAAiB,8BAA8B;GAE/D,KAAK,MAAM,CAAC,SAAS,aAAa,OAAO,QAAQ,SAAS,aAAa,GACrE,KAAK,MAAM,WAAW,OAAO,KAAK,QAAQ,GACxC,IAAI,EAAE,WAAW,SAAS,WACxB,QACE,GAAG,GAAG,iBAAiB,QAAQ,GAAG,WAClC,qBAAqB,QAAQ,qBAAqB,QAAQ,oCAC5D;EAIR;EACA,IAAI,MAAM,SAAS,KAAK,MAAM,OAAO,SAAS,QAAQ,IAAI,IAAI,CAAC,GAC7D,QAAQ,GAAG,GAAG,UAAU,uDAAuD;EAEjF,KAAK,MAAM,QAAQ,OACjB,QAAQ,IAAI,IAAI;CAEpB,CAAC;CACD,OAAO;AACT;AAEA,SAAgB,wBACd,YACA,WACA,OACA,YACM;CACN,MAAM,WAAW,qBAAqB,YAAY,WAAW,OAAO,UAAU;CAC9E,IAAI,SAAS,SAAS,GACpB,MAAM,IAAI,gBAAgB,QAAQ;AAEtC;AAEA,MAAM,mBAAmB;CAAC;CAAS;CAAS;AAAM;AAElD,SAAgB,aAAa,YAAgC;CAC3D,OAAO,CACL,GAAG,iBAAiB,QAAQ,YAAY,WAAW,SAAS,OAAO,CAAC,GACpE,GAAG,WAAW,QAAQ,YAAY,CAAC,iBAAiB,SAAS,OAAO,CAAC,CACvE;AACF;AAEA,SAAS,QAAW,QAA2B,OAAoC;CACjF,OAAO,OAAO,YACZ,MAAM,QAAQ,YAAY,WAAW,MAAM,CAAC,CAAC,KAAK,YAAY,CAAC,SAAS,OAAO,QAAS,CAAC,CAC3F;AACF;AAEA,SAAgB,mBACd,YACA,YACwB;CACxB,MAAM,QAAQ,aAAa,UAAU;CACrC,OAAO,WAAW,SAAS,aAAa;EACtC,MAAM,WAAW,QAAQ,SAAS,UAAU,KAAK;EACjD,IAAI,OAAO,KAAK,QAAQ,CAAC,CAAC,WAAW,GACnC,OAAO,CAAC;EAEV,MAAM,EAAE,eAAe,GAAG,SAAS;EACnC,OAAO,CACL;GACE,GAAG;GACH;GACA,GAAI,kBAAkB,KAAA,KAAa,EACjC,eAAe,OAAO,YACpB,OAAO,QAAQ,aAAa,CAAC,CAAC,KAAK,CAAC,SAAS,YAAY,CACvD,SACA,QAAQ,QAAQ,OAAO,KAAK,QAAQ,CAAC,CACvC,CAAC,CACH,EACF;EACF,CACF;CACF,CAAC;AACH;AAEA,SAAgB,mBAAmB,OAA+C;CAChF,IAAI,UAAU,QAAQ,UAAU,KAAA,GAC9B,OAAO;CAET,MAAM,SAAS,+BAA+B,UAAU,KAAK;CAC7D,IAAI,CAAC,OAAO,SACV,MAAM,IAAI,MAAM,+CAA+C,OAAO,MAAM,SAAS;CAEvF,OAAO,OAAO;AAChB"}
@@ -0,0 +1,14 @@
1
+ import { NotificationCategory, StoredSetting } from "../types/notifications.js";
2
+ import "../types/index.js";
3
+ //#region src/shared/notification-settings.d.ts
4
+ type ChannelSource = 'locked' | 'space' | 'community' | 'spaceDefault' | 'default';
5
+ interface ResolvedChannel {
6
+ channel: string;
7
+ enabled: boolean;
8
+ source: ChannelSource;
9
+ locked: boolean;
10
+ }
11
+ declare function resolveChannels(category: NotificationCategory, settings: StoredSetting[], spaceId: string | null, configured: string[]): ResolvedChannel[];
12
+ //#endregion
13
+ export { ChannelSource, ResolvedChannel, resolveChannels };
14
+ //# sourceMappingURL=notification-settings.d.ts.map
@@ -0,0 +1,61 @@
1
+ //#region src/shared/notification-settings.ts
2
+ function resolveChannels(category, settings, spaceId, configured) {
3
+ const perSpace = category.perSpace === true;
4
+ const ownSettings = settings.filter((s) => s.category === category.key);
5
+ const resolved = [];
6
+ for (const channel of configured) {
7
+ const offered = category.channels[channel];
8
+ if (!offered) continue;
9
+ if (offered.locked) {
10
+ resolved.push({
11
+ channel,
12
+ enabled: offered.default,
13
+ source: "locked",
14
+ locked: true
15
+ });
16
+ continue;
17
+ }
18
+ const forChannel = ownSettings.filter((s) => s.channel === channel);
19
+ const spaceSetting = perSpace && spaceId !== null ? forChannel.find((s) => s.spaceId === spaceId) : void 0;
20
+ if (spaceSetting) {
21
+ resolved.push({
22
+ channel,
23
+ enabled: spaceSetting.enabled,
24
+ source: "space",
25
+ locked: false
26
+ });
27
+ continue;
28
+ }
29
+ const communitySetting = forChannel.find((s) => s.spaceId === null);
30
+ if (communitySetting) {
31
+ resolved.push({
32
+ channel,
33
+ enabled: communitySetting.enabled,
34
+ source: "community",
35
+ locked: false
36
+ });
37
+ continue;
38
+ }
39
+ const spaceDefault = perSpace && spaceId !== null ? category.spaceDefaults?.[spaceId]?.[channel] : void 0;
40
+ if (spaceDefault !== void 0) {
41
+ resolved.push({
42
+ channel,
43
+ enabled: spaceDefault,
44
+ source: "spaceDefault",
45
+ locked: false
46
+ });
47
+ continue;
48
+ }
49
+ resolved.push({
50
+ channel,
51
+ enabled: offered.default,
52
+ source: "default",
53
+ locked: false
54
+ });
55
+ }
56
+ return resolved;
57
+ }
58
+ //#endregion
59
+ export { resolveChannels };
60
+
61
+ //# sourceMappingURL=notification-settings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification-settings.js","names":[],"sources":["../../src/shared/notification-settings.ts"],"sourcesContent":["import type { NotificationCategory, StoredSetting } from '../types/index.js';\n\nexport type ChannelSource = 'locked' | 'space' | 'community' | 'spaceDefault' | 'default';\n\nexport interface ResolvedChannel {\n channel: string;\n enabled: boolean;\n source: ChannelSource;\n locked: boolean;\n}\n\nexport function resolveChannels(\n category: NotificationCategory,\n settings: StoredSetting[],\n spaceId: string | null,\n configured: string[],\n): ResolvedChannel[] {\n const perSpace = category.perSpace === true;\n const ownSettings = settings.filter((s) => s.category === category.key);\n const resolved: ResolvedChannel[] = [];\n for (const channel of configured) {\n const offered = category.channels[channel];\n if (!offered) {\n continue;\n }\n if (offered.locked) {\n resolved.push({ channel, enabled: offered.default, source: 'locked', locked: true });\n continue;\n }\n const forChannel = ownSettings.filter((s) => s.channel === channel);\n const spaceSetting =\n perSpace && spaceId !== null ? forChannel.find((s) => s.spaceId === spaceId) : undefined;\n if (spaceSetting) {\n resolved.push({ channel, enabled: spaceSetting.enabled, source: 'space', locked: false });\n continue;\n }\n const communitySetting = forChannel.find((s) => s.spaceId === null);\n if (communitySetting) {\n resolved.push({\n channel,\n enabled: communitySetting.enabled,\n source: 'community',\n locked: false,\n });\n continue;\n }\n const spaceDefault =\n perSpace && spaceId !== null ? category.spaceDefaults?.[spaceId]?.[channel] : undefined;\n if (spaceDefault !== undefined) {\n resolved.push({ channel, enabled: spaceDefault, source: 'spaceDefault', locked: false });\n continue;\n }\n resolved.push({ channel, enabled: offered.default, source: 'default', locked: false });\n }\n return resolved;\n}\n"],"mappings":";AAWA,SAAgB,gBACd,UACA,UACA,SACA,YACmB;CACnB,MAAM,WAAW,SAAS,aAAa;CACvC,MAAM,cAAc,SAAS,QAAQ,MAAM,EAAE,aAAa,SAAS,GAAG;CACtE,MAAM,WAA8B,CAAC;CACrC,KAAK,MAAM,WAAW,YAAY;EAChC,MAAM,UAAU,SAAS,SAAS;EAClC,IAAI,CAAC,SACH;EAEF,IAAI,QAAQ,QAAQ;GAClB,SAAS,KAAK;IAAE;IAAS,SAAS,QAAQ;IAAS,QAAQ;IAAU,QAAQ;GAAK,CAAC;GACnF;EACF;EACA,MAAM,aAAa,YAAY,QAAQ,MAAM,EAAE,YAAY,OAAO;EAClE,MAAM,eACJ,YAAY,YAAY,OAAO,WAAW,MAAM,MAAM,EAAE,YAAY,OAAO,IAAI,KAAA;EACjF,IAAI,cAAc;GAChB,SAAS,KAAK;IAAE;IAAS,SAAS,aAAa;IAAS,QAAQ;IAAS,QAAQ;GAAM,CAAC;GACxF;EACF;EACA,MAAM,mBAAmB,WAAW,MAAM,MAAM,EAAE,YAAY,IAAI;EAClE,IAAI,kBAAkB;GACpB,SAAS,KAAK;IACZ;IACA,SAAS,iBAAiB;IAC1B,QAAQ;IACR,QAAQ;GACV,CAAC;GACD;EACF;EACA,MAAM,eACJ,YAAY,YAAY,OAAO,SAAS,gBAAgB,QAAQ,GAAG,WAAW,KAAA;EAChF,IAAI,iBAAiB,KAAA,GAAW;GAC9B,SAAS,KAAK;IAAE;IAAS,SAAS;IAAc,QAAQ;IAAgB,QAAQ;GAAM,CAAC;GACvF;EACF;EACA,SAAS,KAAK;GAAE;GAAS,SAAS,QAAQ;GAAS,QAAQ;GAAW,QAAQ;EAAM,CAAC;CACvF;CACA,OAAO;AACT"}
@@ -1,9 +1,11 @@
1
- import { DomainEvent, NewDomainEvent } from "../types/shared.js";
1
+ import { DomainEvent, JsonValue, NewDomainEvent } from "../types/shared.js";
2
2
  import { EventDefinition } from "../types/events.js";
3
3
  import { EmailMessage, EmailSender, Logger, ObjectStorage, PresignDownloadInput, PresignedUpload, StoredObjectInfo } from "../types/ports.js";
4
4
  import { EmailContent, EmailTemplateId, EmailTemplateParams, TemplateContext, TemplateRenderer } from "../types/email-templates.js";
5
+ import { ChannelRecipient, DeliveryResult, NotificationCategory, NotificationTypeDeclaration, PushDevice, PushMessage, StoredNotification } from "../types/notifications.js";
5
6
  import "../types/index.js";
6
7
  import { EventOf, EventOfValues, InvalidDomainEventError, RuntimeEventDefinition, defineEvent, eventIdSchema, eventJsonValueSchema, eventMetadataSchema } from "./events.js";
8
+ import { Actor } from "./actor.js";
7
9
  //#region src/shared/ports.d.ts
8
10
  interface Clock {
9
11
  now(): Date;
@@ -14,6 +16,17 @@ interface EventBus {
14
16
  subscribe(type: string, handler: (event: DomainEvent) => Promise<void>): void;
15
17
  subscribeAll(handler: (event: DomainEvent) => Promise<void>): void;
16
18
  }
19
+ /** Messages published on any instance, delivered to every subscriber on every
20
+ * instance, the publisher's included. Best effort: a subscriber can miss
21
+ * messages while its instance is disconnected; `onReset` fires after every
22
+ * reconnect. No ordering is promised. `start` never fails on connectivity:
23
+ * it keeps reconnecting and fires `onReset` once connected. */
24
+ interface PubSub {
25
+ publish(channel: string, message: JsonValue): Promise<void>;
26
+ subscribe(channel: string, handler: (message: JsonValue) => void, onReset: () => void): () => void;
27
+ start(): Promise<void>;
28
+ stop(): Promise<void>;
29
+ }
17
30
  /** Appends domain events to the transactional outbox. A tx-bound member of a
18
31
  * UnitOfWork scope, so the append shares that transaction — the event
19
32
  * becomes visible to the relay only when the surrounding write commits. */
@@ -57,6 +70,59 @@ interface CredentialStore {
57
70
  /** Permanently delete stored secrets (e.g. disconnect). */
58
71
  destroy(orgId: string, ref: string): Promise<void>;
59
72
  }
73
+ interface NotificationTypeRegistry {
74
+ list(): Pick<NotificationTypeDeclaration, 'type' | 'scopes' | 'reasons'>[];
75
+ get(type: string): NotificationTypeDeclaration | undefined;
76
+ defaults(scope: 'org' | 'community'): NotificationCategory[];
77
+ }
78
+ interface NotificationChannel {
79
+ key: string;
80
+ recipient(orgId: string, userId: string): Promise<ChannelRecipient | null>;
81
+ deliver(notification: StoredNotification, to: ChannelRecipient): Promise<DeliveryResult>;
82
+ }
83
+ interface ChannelRegistry {
84
+ list(): string[];
85
+ get(key: string): NotificationChannel | undefined;
86
+ }
87
+ interface NotificationCategoryService {
88
+ get(scopeId: string, actor: Actor): Promise<{
89
+ categories: NotificationCategory[];
90
+ source: 'default' | 'stored';
91
+ }>;
92
+ replace(scopeId: string, categories: NotificationCategory[], actor: Actor): Promise<{
93
+ categories: NotificationCategory[];
94
+ source: 'stored';
95
+ }>;
96
+ reset(scopeId: string, actor: Actor): Promise<void>;
97
+ defaults(actor: Actor): NotificationCategory[];
98
+ }
99
+ interface ParsedBody {
100
+ text: string;
101
+ mentions: string[];
102
+ assetIds: string[];
103
+ }
104
+ interface BodyParser {
105
+ parse(body: string): ParsedBody;
106
+ }
107
+ interface PushSender {
108
+ send(devices: PushDevice[], message: PushMessage): Promise<DeliveryResult>;
109
+ }
110
+ interface ScheduledJob {
111
+ job: string;
112
+ run(payload: JsonValue, fire: {
113
+ id: string;
114
+ startedAt: Date;
115
+ }): Promise<void>;
116
+ }
117
+ interface RecurringJob {
118
+ job: string;
119
+ cron: string;
120
+ }
121
+ interface Scheduler {
122
+ registerJobs(handlers: ScheduledJob[], recurring: RecurringJob[]): void;
123
+ at(job: string, runAt: Date, key: string, payload: JsonValue): Promise<void>;
124
+ cancel(job: string, key: string): Promise<void>;
125
+ }
60
126
  //#endregion
61
- export { Clock, CredentialStore, type DomainEvent, type EmailContent, type EmailMessage, type EmailSender, type EmailTemplateId, type EmailTemplateParams, EventBus, type EventDefinition, type EventOf, type EventOfValues, InvalidDomainEventError, type Logger, type NewDomainEvent, type ObjectStorage, OutboxAppender, OutboxMessage, OutboxRelay, OutboxStore, type PresignDownloadInput, type PresignedUpload, type RuntimeEventDefinition, type StoredObjectInfo, type TemplateContext, type TemplateRenderer, UnitOfWork, defineEvent, eventIdSchema, eventJsonValueSchema, eventMetadataSchema };
127
+ export { BodyParser, type ChannelRecipient, ChannelRegistry, Clock, CredentialStore, type DeliveryResult, type DomainEvent, type EmailContent, type EmailMessage, type EmailSender, type EmailTemplateId, type EmailTemplateParams, EventBus, type EventDefinition, type EventOf, type EventOfValues, InvalidDomainEventError, type JsonValue, type Logger, type NewDomainEvent, type NotificationCategory, NotificationCategoryService, NotificationChannel, type NotificationTypeDeclaration, NotificationTypeRegistry, type ObjectStorage, OutboxAppender, OutboxMessage, OutboxRelay, OutboxStore, ParsedBody, type PresignDownloadInput, type PresignedUpload, PubSub, type PushDevice, type PushMessage, PushSender, RecurringJob, type RuntimeEventDefinition, ScheduledJob, Scheduler, type StoredNotification, type StoredObjectInfo, type TemplateContext, type TemplateRenderer, UnitOfWork, defineEvent, eventIdSchema, eventJsonValueSchema, eventMetadataSchema };
62
128
  //# sourceMappingURL=ports.d.ts.map
@@ -5,7 +5,8 @@ interface SettingsRecord {
5
5
  value?: Record<string, unknown>;
6
6
  }
7
7
  declare enum SettingsNamespace {
8
- content = "content"
8
+ content = "content",
9
+ organizations = "organizations"
9
10
  }
10
11
  interface SettingsRepository {
11
12
  /** Rows for the given scopes, optionally narrowed to one namespace. */
@@ -1,6 +1,7 @@
1
1
  //#region src/shared/settings.ts
2
2
  let SettingsNamespace = /* @__PURE__ */ function(SettingsNamespace) {
3
3
  SettingsNamespace["content"] = "content";
4
+ SettingsNamespace["organizations"] = "organizations";
4
5
  return SettingsNamespace;
5
6
  }({});
6
7
  var SettingsService = class {
@@ -1 +1 @@
1
- {"version":3,"file":"settings.js","names":[],"sources":["../../src/shared/settings.ts"],"sourcesContent":["// Cross-cutting settings: storage, scoping and resolution for every domain's\n// configuration. Not a bounded context: it is a leaf every context may import, and it imports\n// no context.\n\nexport interface SettingsRecord {\n namespace: string;\n scopeId: string;\n value?: Record<string, unknown>;\n}\n\nexport enum SettingsNamespace {\n content = 'content',\n}\n\nexport interface SettingsRepository {\n /** Rows for the given scopes, optionally narrowed to one namespace. */\n find(orgId: string, scopeId: string, namespace?: string): Promise<SettingsRecord[]>;\n /** Deep-merges the patch into the row's value, inserting when absent. Nested\n * objects merge key by key; arrays and scalars are replaced outright. */\n patch(orgId: string, namespace: string, scopeId: string, value: unknown): Promise<SettingsRecord>;\n}\n\nexport class SettingsService {\n constructor(private readonly repo: SettingsRepository) {}\n\n async get<T>(\n orgId: string,\n namespace: string,\n scopeId: string,\n defaultIfNull?: T,\n ): Promise<T | undefined> {\n const rows = await this.repo.find(orgId, scopeId, namespace);\n return (rows[0]?.value as T) ?? defaultIfNull;\n }\n\n async patch<T>(orgId: string, namespace: string, scopeId: string, value: unknown): Promise<T> {\n const row = await this.repo.patch(orgId, namespace, scopeId, value);\n return row.value as T;\n }\n}\n"],"mappings":";AAUA,IAAY,oBAAL,yBAAA,mBAAA;CACL,kBAAA,aAAA;;AACF,EAAA,CAAA,CAAA;AAUA,IAAa,kBAAb,MAA6B;CACE;CAA7B,YAAY,MAA2C;EAA1B,KAAA,OAAA;CAA2B;CAExD,MAAM,IACJ,OACA,WACA,SACA,eACwB;EAExB,QAAQ,MADW,KAAK,KAAK,KAAK,OAAO,SAAS,SAAS,EAAA,CAC9C,EAAE,EAAE,SAAe;CAClC;CAEA,MAAM,MAAS,OAAe,WAAmB,SAAiB,OAA4B;EAE5F,QAAO,MADW,KAAK,KAAK,MAAM,OAAO,WAAW,SAAS,KAAK,EAAA,CACvD;CACb;AACF"}
1
+ {"version":3,"file":"settings.js","names":[],"sources":["../../src/shared/settings.ts"],"sourcesContent":["// Cross-cutting settings: storage, scoping and resolution for every domain's\n// configuration. Not a bounded context: it is a leaf every context may import, and it imports\n// no context.\n\nexport interface SettingsRecord {\n namespace: string;\n scopeId: string;\n value?: Record<string, unknown>;\n}\n\nexport enum SettingsNamespace {\n content = 'content',\n organizations = 'organizations',\n}\n\nexport interface SettingsRepository {\n /** Rows for the given scopes, optionally narrowed to one namespace. */\n find(orgId: string, scopeId: string, namespace?: string): Promise<SettingsRecord[]>;\n /** Deep-merges the patch into the row's value, inserting when absent. Nested\n * objects merge key by key; arrays and scalars are replaced outright. */\n patch(orgId: string, namespace: string, scopeId: string, value: unknown): Promise<SettingsRecord>;\n}\n\nexport class SettingsService {\n constructor(private readonly repo: SettingsRepository) {}\n\n async get<T>(\n orgId: string,\n namespace: string,\n scopeId: string,\n defaultIfNull?: T,\n ): Promise<T | undefined> {\n const rows = await this.repo.find(orgId, scopeId, namespace);\n return (rows[0]?.value as T) ?? defaultIfNull;\n }\n\n async patch<T>(orgId: string, namespace: string, scopeId: string, value: unknown): Promise<T> {\n const row = await this.repo.patch(orgId, namespace, scopeId, value);\n return row.value as T;\n }\n}\n"],"mappings":";AAUA,IAAY,oBAAL,yBAAA,mBAAA;CACL,kBAAA,aAAA;CACA,kBAAA,mBAAA;;AACF,EAAA,CAAA,CAAA;AAUA,IAAa,kBAAb,MAA6B;CACE;CAA7B,YAAY,MAA2C;EAA1B,KAAA,OAAA;CAA2B;CAExD,MAAM,IACJ,OACA,WACA,SACA,eACwB;EAExB,QAAQ,MADW,KAAK,KAAK,KAAK,OAAO,SAAS,SAAS,EAAA,CAC9C,EAAE,EAAE,SAAe;CAClC;CAEA,MAAM,MAAS,OAAe,WAAmB,SAAiB,OAA4B;EAE5F,QAAO,MADW,KAAK,KAAK,MAAM,OAAO,WAAW,SAAS,KAAK,EAAA,CACvD;CACb;AACF"}
@@ -1,5 +1,5 @@
1
1
  import { DomainEvent } from "./shared.js";
2
- import { Automation, AutomationAction, AutomationActionResult, AutomationKind, AutomationRun, AutomationRunStatus, AutomationRunsQuery, AutomationSource, AutomationTrigger, AutomationsQuery, AvailableAction, AvailableActions, AvailableTriggers, CreateAutomationInput, CreateWebhookInput, CreatedWebhook, DeliverWebhookInput, UpdateAutomationInput, UpdateWebhookInput, Webhook, WebhookSecret } from "./schemas/automations.js";
2
+ 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";
3
3
  //#region src/types/automations.d.ts
4
4
  interface AutomationDispatch {
5
5
  runId: string;
@@ -8,6 +8,10 @@ interface AutomationDispatch {
8
8
  actions: AutomationAction[];
9
9
  event: DomainEvent;
10
10
  }
11
+ interface DeliveryDispatch {
12
+ orgId: string;
13
+ deliveryId: string;
14
+ }
11
15
  interface ScheduledAutomation {
12
16
  orgId: string;
13
17
  automationId: string;
@@ -16,12 +20,14 @@ interface ScheduledAutomation {
16
20
  interface AutomationExecutor {
17
21
  runAction(d: AutomationDispatch, index: number): Promise<AutomationActionResult>;
18
22
  finalize(d: AutomationDispatch, results: AutomationActionResult[]): Promise<void>;
23
+ runDelivery(d: DeliveryDispatch, lastAttempt: boolean): Promise<void>;
19
24
  listSchedules?(): Promise<ScheduledAutomation[]>;
20
25
  fireSchedule?(orgId: string, automationId: string, firedAt: Date): Promise<void>;
21
26
  }
22
27
  interface AutomationEngine {
23
28
  register(executor: AutomationExecutor): void;
24
29
  dispatch(d: AutomationDispatch): Promise<void>;
30
+ deliver(d: DeliveryDispatch): Promise<void>;
25
31
  start(): Promise<void>;
26
32
  stop(): Promise<void>;
27
33
  syncSchedules?(): Promise<void>;
@@ -38,5 +44,5 @@ interface WebhookSender {
38
44
  send(request: WebhookRequest): Promise<WebhookResponse>;
39
45
  }
40
46
  //#endregion
41
- export { type Automation, type AutomationAction, type AutomationActionResult, AutomationDispatch, AutomationEngine, AutomationExecutor, type AutomationKind, type AutomationRun, type AutomationRunStatus, type AutomationRunsQuery, type AutomationSource, type AutomationTrigger, type AutomationsQuery, type AvailableAction, type AvailableActions, type AvailableTriggers, type CreateAutomationInput, type CreateWebhookInput, type CreatedWebhook, type DeliverWebhookInput, ScheduledAutomation, 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 };
42
48
  //# sourceMappingURL=automations.d.ts.map
@@ -1,2 +1,2 @@
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, DmSettings, Download, DownloadAsset, DownloadFile, DownloadStatus, DownloadView, ListBundlesQuery, ListCommunitiesQuery, ListCoursesQuery, ListDownloadsQuery, Module, 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, DmSettings, Download, DownloadAsset, DownloadFile, DownloadStatus, DownloadView, ListBundlesQuery, ListCommunitiesQuery, ListCoursesQuery, ListDownloadsQuery, Module, PatchDmSettingsInput, ReorderDownloadAssetsInput, SaveActivityInput, SetSpaceTopicsInput, Space, SpaceAccessRule, SpaceDetail, SpaceLink, SpaceSettings, SpaceTopic, UpdateBundleInput, UpdateCommunityInput, UpdateCourseInput, UpdateDownloadInput, UpdateSpaceInput };
1
+ import { Activity, ActivityAsset, ActivitySettings, ActivityView, AddDownloadAssetInput, AddEventAssetInput, AddSpaceLinkInput, Bundle, BundleItem, Community, CommunitySettings, CommunityStatus, CommunityView, ContentItem, ContentType, Course, CourseSettings, CourseStatus, CourseView, CreateBundleInput, CreateCommunityInput, CreateCourseInput, CreateDownloadInput, CreateEventInput, CreateSpaceInput, DigestCadence, DigestSchedule, DmSettings, Download, DownloadAsset, DownloadFile, DownloadStatus, DownloadView, Event, EventAddress, EventAnalytics, EventAsset, EventAttendee, EventAttendeeFace, EventAttendeeSource, EventFile, EventLead, EventLocation, EventOnline, EventRecording, EventSettings, EventSort, EventStatus, EventType, EventVenue, EventView, ListBundlesQuery, ListCommunitiesQuery, ListCoursesQuery, ListDownloadsQuery, ListEventsQuery, MemberEvent, MemberEventSummary, MemberEventViewer, MemberEventsQuery, Module, PatchCommunitySettingsInput, PatchDmSettingsInput, ReorderDownloadAssetsInput, ReorderEventAssetsInput, SaveActivityInput, SetSpaceTopicsInput, Space, SpaceAccessRule, SpaceDetail, SpaceLink, SpaceSettings, SpaceTopic, UpdateBundleInput, UpdateCommunityInput, UpdateCourseInput, UpdateDownloadInput, UpdateEventInput, UpdateSpaceInput } from "./schemas/content.js";
2
+ export type { Activity, ActivityAsset, ActivitySettings, ActivityView, AddDownloadAssetInput, AddEventAssetInput, AddSpaceLinkInput, Bundle, BundleItem, Community, CommunitySettings, CommunityStatus, CommunityView, ContentItem, ContentType, Course, CourseSettings, CourseStatus, CourseView, CreateBundleInput, CreateCommunityInput, CreateCourseInput, CreateDownloadInput, CreateEventInput, CreateSpaceInput, DigestCadence, DigestSchedule, DmSettings, Download, DownloadAsset, DownloadFile, DownloadStatus, DownloadView, Event, EventAddress, EventAnalytics, EventAsset, EventAttendee, EventAttendeeFace, EventAttendeeSource, EventFile, EventLead, EventLocation, EventOnline, EventRecording, EventSettings, EventSort, EventStatus, EventType, EventVenue, EventView, ListBundlesQuery, ListCommunitiesQuery, ListCoursesQuery, ListDownloadsQuery, ListEventsQuery, MemberEvent, MemberEventSummary, MemberEventViewer, MemberEventsQuery, Module, PatchCommunitySettingsInput, PatchDmSettingsInput, ReorderDownloadAssetsInput, ReorderEventAssetsInput, SaveActivityInput, SetSpaceTopicsInput, Space, SpaceAccessRule, SpaceDetail, SpaceLink, SpaceSettings, SpaceTopic, UpdateBundleInput, UpdateCommunityInput, UpdateCourseInput, UpdateDownloadInput, UpdateEventInput, UpdateSpaceInput };
@@ -1,7 +1,5 @@
1
1
  import { Page } from "./shared.js";
2
- import { Role } from "./schemas/organizations.js";
3
- import "./organizations.js";
4
- import { ActivityCommentsRule, BlockedUser, Chat, ChatKind, ChatLastMessage, ChatStatus, ChatUser, CommentFlagResolution, CommentListItem, CommentReaction, CommentReportSummary, CommentSettings, CommentStatus, CommentView, CommentsConfig, FlaggedComment, ListCommentsQuery, Message, MessageAttachment, MessageFile, MessageFlag, MessageFlagResolution, MessageReaction, MessageView, Post, PostBookmark, PostFlag, PostFlagResolution, PostFollow, PostReaction, PostStatus, PostView, ReactionCounts, ReactionEmoji } from "./schemas/discussion.js";
2
+ import { ActivityCommentsRule, BlockedUser, Chat, ChatKind, ChatLastMessage, ChatLiveEvent, ChatStatus, ChatUnreadSummary, ChatUser, CommentFlagResolution, CommentListItem, CommentReaction, CommentReportSummary, CommentSettings, CommentStatus, CommentView, CommentsConfig, DigestRun, FlaggedComment, FlaggedCommentView, ListCommentsQuery, LiveMessage, 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
3
  //#region src/types/discussion.d.ts
6
4
  interface Comment {
7
5
  readonly id: string;
@@ -26,7 +24,8 @@ interface CommentAuthor {
26
24
  image: string | null;
27
25
  imageAssetId: string | null;
28
26
  imageUrl: string | null;
29
- role: Role;
27
+ team: boolean;
28
+ roleName: string | null;
30
29
  }
31
30
  interface CommentReport {
32
31
  readonly id: string;
@@ -41,5 +40,5 @@ interface CommentReport {
41
40
  updatedAt: Date;
42
41
  }
43
42
  //#endregion
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 FlaggedComment, type ListCommentsQuery, 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 PostFollow, type PostReaction, type PostStatus, type PostView, type ReactionCounts, type ReactionEmoji };
43
+ export { type ActivityCommentsRule, type BlockedUser, type Chat, type ChatKind, type ChatLastMessage, type ChatLiveEvent, type ChatStatus, type ChatUnreadSummary, 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 FlaggedCommentView, type ListCommentsQuery, type LiveMessage, 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 };
45
44
  //# sourceMappingURL=discussion.d.ts.map
@@ -15,6 +15,13 @@ interface EmailContent {
15
15
  html: string;
16
16
  text: string;
17
17
  }
18
+ interface EventEmailParams {
19
+ eventId: string;
20
+ eventTitle: string;
21
+ startsAt: string;
22
+ endsAt: string;
23
+ timeZone: string;
24
+ }
18
25
  /** Template id → params. Adding an email = adding a row here. */
19
26
  interface EmailTemplateParams {
20
27
  magicLink: {
@@ -39,7 +46,7 @@ interface EmailTemplateParams {
39
46
  accessGranted: {
40
47
  contentTitle: string;
41
48
  contentId: string;
42
- contentType: ContentType;
49
+ contentType: ContentType | 'bundle';
43
50
  };
44
51
  accessRevoked: {
45
52
  contentTitle: string;
@@ -58,8 +65,10 @@ interface EmailTemplateParams {
58
65
  expiresAt: string;
59
66
  };
60
67
  membershipEnded: {
61
- communityTitle: string;
62
- communityId: string;
68
+ communities: {
69
+ communityId: string;
70
+ communityTitle: string;
71
+ }[];
63
72
  };
64
73
  newPostInSpace: {
65
74
  spaceName: string;
@@ -136,12 +145,24 @@ interface EmailTemplateParams {
136
145
  chatId: string;
137
146
  communityId: string;
138
147
  };
139
- youAreNowAModerator: {
140
- communityTitles: string[];
148
+ roleAssigned: {
149
+ roleName: string;
150
+ place: string;
151
+ contentId: string | null;
152
+ contentType: ContentType | null;
141
153
  };
142
154
  digest: {
143
155
  communityTitle: string;
144
156
  communityId: string;
157
+ from: string;
158
+ to: string;
159
+ posts: {
160
+ postId: string;
161
+ title: string;
162
+ authorName: string;
163
+ spaceName: string;
164
+ commentCount: number;
165
+ }[];
145
166
  };
146
167
  postAwaitingReview: {
147
168
  spaceName: string;
@@ -168,6 +189,98 @@ interface EmailTemplateParams {
168
189
  reason: string;
169
190
  communityId: string;
170
191
  };
192
+ postReacted: {
193
+ postTitle: string;
194
+ reactorName: string;
195
+ reaction: string;
196
+ postId: string;
197
+ communityId: string;
198
+ };
199
+ commentReacted: {
200
+ postTitle: string;
201
+ excerpt: string;
202
+ reactorName: string;
203
+ reaction: string;
204
+ commentId: string;
205
+ postId: string;
206
+ communityId: string;
207
+ };
208
+ mention: {
209
+ authorName: string;
210
+ excerpt: string;
211
+ communityId: string;
212
+ } & ({
213
+ postTitle: string;
214
+ postId: string;
215
+ commentId?: string;
216
+ } | {
217
+ chatTitle: string;
218
+ chatId: string;
219
+ });
220
+ messageReacted: {
221
+ excerpt: string;
222
+ reactorName: string;
223
+ reaction: string;
224
+ chatId: string;
225
+ communityId: string;
226
+ };
227
+ courseActivityAdded: {
228
+ courseTitle: string;
229
+ moduleTitle: string;
230
+ activityTitle: string;
231
+ courseId: string;
232
+ activityId: string;
233
+ };
234
+ activityCommentCreated: {
235
+ activityTitle: string;
236
+ courseTitle: string;
237
+ commenterName: string;
238
+ excerpt: string;
239
+ courseId: string;
240
+ activityId: string;
241
+ commentId: string;
242
+ };
243
+ activityCommentRemoved: {
244
+ activityTitle: string;
245
+ courseTitle: string;
246
+ courseId: string;
247
+ activityId: string;
248
+ };
249
+ activityCommentReacted: {
250
+ activityTitle: string;
251
+ courseTitle: string;
252
+ excerpt: string;
253
+ reactorName: string;
254
+ reaction: string;
255
+ courseId: string;
256
+ activityId: string;
257
+ commentId: string;
258
+ };
259
+ activityCommentFlagged: {
260
+ activityTitle: string;
261
+ courseTitle: string;
262
+ excerpt: string;
263
+ reason: string;
264
+ courseId: string;
265
+ activityId: string;
266
+ };
267
+ activityMention: {
268
+ authorName: string;
269
+ excerpt: string;
270
+ activityTitle: string;
271
+ courseTitle: string;
272
+ courseId: string;
273
+ activityId: string;
274
+ };
275
+ eventGranted: EventEmailParams;
276
+ eventStartingSoon: EventEmailParams & {
277
+ leadText: string;
278
+ };
279
+ eventChanged: EventEmailParams & {
280
+ changed: 'time' | 'location' | 'time_and_location';
281
+ };
282
+ eventCanceled: EventEmailParams;
283
+ eventRevoked: EventEmailParams;
171
284
  }
172
285
  type EmailTemplateId = keyof EmailTemplateParams;
173
286
  /** Resolves a template + data to rendered content. Deployment-swappable;
@@ -176,5 +289,5 @@ interface TemplateRenderer {
176
289
  render<K extends EmailTemplateId>(id: K, ctx: TemplateContext, params: EmailTemplateParams[K]): Promise<EmailContent>;
177
290
  }
178
291
  //#endregion
179
- export { EmailContent, EmailTemplateId, EmailTemplateParams, TemplateContext, TemplateRenderer };
292
+ export { EmailContent, EmailTemplateId, EmailTemplateParams, EventEmailParams, TemplateContext, TemplateRenderer };
180
293
  //# sourceMappingURL=email-templates.d.ts.map
@@ -1,3 +1,3 @@
1
1
  import { Page } from "./shared.js";
2
- import { Entitlement, EntitlementStatus, EntitlementsQuery, GrantEntitlementInput, SpaceMember, SpaceMemberSource, SpaceMemberStatus } from "./schemas/entitlements.js";
3
- export type { Entitlement, EntitlementStatus, EntitlementsQuery, GrantEntitlementInput, Page, SpaceMember, SpaceMemberSource, SpaceMemberStatus };
2
+ import { Entitlement, EntitlementStatus, EntitlementsQuery, GrantEntitlementInput, GrantSource, SpaceMember, SpaceMemberSource, SpaceMemberStatus } from "./schemas/entitlements.js";
3
+ export type { Entitlement, EntitlementStatus, EntitlementsQuery, GrantEntitlementInput, GrantSource, Page, SpaceMember, SpaceMemberSource, SpaceMemberStatus };
@@ -1,4 +1,4 @@
1
- import { CreateUserInput, Notification, NotificationKind, NotificationPreference, ProvisionUserInput, UpdateUserInput, UserProfile, UserProfileView } 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;
@@ -33,11 +33,16 @@ interface AccountProvisioner {
33
33
  }
34
34
  type UserId = string;
35
35
  type HeaderBag = Record<string, string | string[] | undefined>;
36
+ type CredentialLimit = {
37
+ scopes: string[];
38
+ } | {
39
+ roleKey: string;
40
+ };
36
41
  type AccessGrant = {
37
42
  userId: string;
38
43
  orgId: string;
39
- scopes: string[];
40
44
  clientId: string;
45
+ limit: CredentialLimit;
41
46
  };
42
47
  type AccessRequest = {
43
48
  method: string;
@@ -46,6 +51,7 @@ type AccessRequest = {
46
51
  };
47
52
  interface AccessTokenVerifier {
48
53
  verifyAccess(request: AccessRequest): Promise<AccessGrant | null>;
54
+ verifyApiKey(headers: HeaderBag): Promise<AccessGrant | null>;
49
55
  }
50
56
  type ConnectedApp = {
51
57
  clientId: string;
@@ -58,26 +64,17 @@ type ApiKeySummary = {
58
64
  id: string;
59
65
  name: string | null;
60
66
  start: string | null;
61
- scopes: string[];
67
+ role: {
68
+ key: string;
69
+ name: string | null;
70
+ } | null;
62
71
  createdAt: Date;
63
72
  lastUsedAt: Date | null;
73
+ expiresAt: Date | null;
64
74
  };
65
75
  type CreatedApiKey = ApiKeySummary & {
66
76
  key: string;
67
77
  };
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
- }
81
78
  //#endregion
82
- export { AccessGrant, AccessRequest, AccessTokenVerifier, AccountProvisioner, ActiveSession, ApiKeySummary, AppAccessAdmin, ConnectedApp, type CreateUserInput, CreatedApiKey, HeaderBag, NewApiKey, type Notification, type NotificationKind, type NotificationPreference, type ProvisionUserInput, SessionVerifier, type UpdateUserInput, User, UserId, type UserProfile, type UserProfileView };
79
+ export { AccessGrant, AccessRequest, AccessTokenVerifier, AccountProvisioner, ActiveSession, ApiKeySummary, ConnectedApp, type CreateUserInput, CreatedApiKey, CredentialLimit, HeaderBag, type ProvisionUserInput, SessionVerifier, type UpdateUserInput, User, UserId, type UserProfile, type UserProfileView };
83
80
  //# sourceMappingURL=identity.d.ts.map
@@ -1,14 +1,14 @@
1
1
  import { ContractNewDomainEvent, DomainEvent, EventMetadata, JsonValue, NewDomainEvent, Page } from "./shared.js";
2
2
  import { EventDefinition, EventParseResult, MakeEventInput } from "./events.js";
3
- import { EmailMessage, EmailSender, Logger, ObjectStorage, PresignDownloadInput, PresignedUpload, StoredObjectInfo } from "./ports.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, DmSettings, Download, DownloadAsset, DownloadFile, DownloadStatus, DownloadView, ListBundlesQuery, ListCommunitiesQuery, ListCoursesQuery, ListDownloadsQuery, Module, PatchDmSettingsInput, ReorderDownloadAssetsInput, SaveActivityInput, SetSpaceTopicsInput, Space, SpaceAccessRule, SpaceDetail, SpaceLink, SpaceSettings, SpaceTopic, UpdateBundleInput, UpdateCommunityInput, UpdateCourseInput, UpdateDownloadInput, UpdateSpaceInput } from "./schemas/content.js";
5
- import { EmailContent, EmailTemplateId, EmailTemplateParams, TemplateContext, TemplateRenderer } from "./email-templates.js";
6
- import { CreateUserInput, Notification, NotificationKind, NotificationPreference, 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
- import { AcceptInviteInput, AddOrgUserInput, CreateInviteInput, CreateOrgUserInput, Invite, InviteInput, InviteRole, NewOrganizationInput, OrgUser, OrgUserInput, OrgUserProfile, OrgUserStatus, Organization, OrganizationInput, Role, UpdateOrgUserInput } from "./schemas/organizations.js";
9
- import { CreateOrganizationInput, InviteId, OrgUserId, OrganizationId } from "./organizations.js";
3
+ import { EmailMessage, EmailSender, Logger, ObjectStorage, PUBLIC_CACHE_CONTROL, PUBLIC_PREFIX, PresignDownloadInput, PresignedUpload, StoredObjectInfo } from "./ports.js";
4
+ import { Activity, ActivityAsset, ActivitySettings, ActivityView, AddDownloadAssetInput, AddEventAssetInput, AddSpaceLinkInput, Bundle, BundleItem, Community, CommunitySettings, CommunityStatus, CommunityView, ContentItem, ContentType, Course, CourseSettings, CourseStatus, CourseView, CreateBundleInput, CreateCommunityInput, CreateCourseInput, CreateDownloadInput, CreateEventInput, CreateSpaceInput, DigestCadence, DigestSchedule, DmSettings, Download, DownloadAsset, DownloadFile, DownloadStatus, DownloadView, Event, EventAddress, EventAnalytics, EventAsset, EventAttendee, EventAttendeeFace, EventAttendeeSource, EventFile, EventLead, EventLocation, EventOnline, EventRecording, EventSettings, EventSort, EventStatus, EventType, EventVenue, EventView, ListBundlesQuery, ListCommunitiesQuery, ListCoursesQuery, ListDownloadsQuery, ListEventsQuery, MemberEvent, MemberEventSummary, MemberEventViewer, MemberEventsQuery, Module, PatchCommunitySettingsInput, PatchDmSettingsInput, ReorderDownloadAssetsInput, ReorderEventAssetsInput, SaveActivityInput, SetSpaceTopicsInput, Space, SpaceAccessRule, SpaceDetail, SpaceLink, SpaceSettings, SpaceTopic, UpdateBundleInput, UpdateCommunityInput, UpdateCourseInput, UpdateDownloadInput, UpdateEventInput, UpdateSpaceInput } from "./schemas/content.js";
5
+ import { EmailContent, EmailTemplateId, EmailTemplateParams, EventEmailParams, TemplateContext, TemplateRenderer } from "./email-templates.js";
6
+ import { CreateUserInput, ProvisionUserInput, UpdateUserInput, UserProfile, UserProfileView } from "./schemas/identity.js";
7
+ import { AccessGrant, AccessRequest, AccessTokenVerifier, AccountProvisioner, ActiveSession, ApiKeySummary, ConnectedApp, CreatedApiKey, CredentialLimit, HeaderBag, SessionVerifier, User, UserId } from "./identity.js";
8
+ import { AcceptInviteInput, AddOrgUserInput, CreateInviteInput, CreateOrgUserInput, Invite, InviteInput, Level, NewOrganizationInput, OrgRoleRow, OrgUser, OrgUserInput, OrgUserProfile, OrgUserStatus, Organization, OrganizationInput, Permission, RoleAssignment, RoleKey, UpdateOrgUserInput } from "./schemas/organizations.js";
9
+ import { ContentId, CreateOrganizationInput, InviteId, OrgUserId, OrganizationId } from "./organizations.js";
10
10
  import "./content.js";
11
- import { Entitlement, EntitlementStatus, EntitlementsQuery, GrantEntitlementInput, SpaceMember, SpaceMemberSource, SpaceMemberStatus } from "./schemas/entitlements.js";
11
+ import { Entitlement, EntitlementStatus, EntitlementsQuery, GrantEntitlementInput, GrantSource, 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";
@@ -16,8 +16,9 @@ import { Asset, AssetKind, AssetSource, AssetStatus, AssetUrls, AssetView, Asset
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
- import { Automation, AutomationAction, AutomationActionResult, AutomationKind, AutomationRun, AutomationRunStatus, AutomationRunsQuery, AutomationSource, AutomationTrigger, AutomationsQuery, AvailableAction, AvailableActions, AvailableTriggers, CreateAutomationInput, CreateWebhookInput, CreatedWebhook, DeliverWebhookInput, UpdateAutomationInput, UpdateWebhookInput, Webhook, WebhookSecret } from "./schemas/automations.js";
20
- import { AutomationDispatch, AutomationEngine, AutomationExecutor, ScheduledAutomation, WebhookRequest, WebhookResponse, WebhookSender } from "./automations.js";
21
- import { ActivityCommentsRule, BlockedUser, Chat, ChatKind, ChatLastMessage, ChatStatus, ChatUser, CommentFlagResolution, CommentListItem, CommentReaction, CommentReportSummary, CommentSettings, CommentStatus, CommentView, CommentsConfig, FlaggedComment, ListCommentsQuery, Message, MessageAttachment, MessageFile, MessageFlag, MessageFlagResolution, MessageReaction, MessageView, Post, PostBookmark, PostFlag, PostFlagResolution, PostFollow, PostReaction, PostStatus, PostView, ReactionCounts, ReactionEmoji } from "./schemas/discussion.js";
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, DeliveryDispatch, ScheduledAutomation, WebhookRequest, WebhookResponse, WebhookSender } from "./automations.js";
21
+ import { ActivityCommentsRule, BlockedUser, Chat, ChatKind, ChatLastMessage, ChatLiveEvent, ChatStatus, ChatUnreadSummary, ChatUser, CommentFlagResolution, CommentListItem, CommentReaction, CommentReportSummary, CommentSettings, CommentStatus, CommentView, CommentsConfig, DigestRun, FlaggedComment, FlaggedCommentView, ListCommentsQuery, LiveMessage, 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, 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 AutomationSource, type AutomationTrigger, type AutomationsQuery, type AvailableAction, type AvailableActions, type AvailableTriggers, type BlockedUser, type Bundle, type BundleItem, 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, 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 Message, type MessageAttachment, type MessageFile, type MessageFlag, type MessageFlagResolution, type MessageReaction, type MessageView, type Module, NewApiKey, NewDomainEvent, type NewOrganizationInput, type Notification, type NotificationKind, type NotificationPreference, ObjectStorage, type OrgUser, OrgUserId, type OrgUserInput, type OrgUserProfile, type OrgUserStatus, type Organization, OrganizationId, type OrganizationInput, Page, type PatchDmSettingsInput, type Post, type PostBookmark, type PostFlag, type PostFlagResolution, type PostFollow, type PostReaction, type PostStatus, type PostView, 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, ScheduledAutomation, SessionVerifier, type SetSpaceTopicsInput, type Space, type SpaceAccessRule, type SpaceDetail, type SpaceLink, type SpaceMember, type SpaceMemberSource, type SpaceMemberStatus, type SpaceSettings, type SpaceTopic, StoredObjectInfo, 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 };
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 AddEventAssetInput, type AddOrgUserInput, type AddSpaceLinkInput, ApiKeySummary, 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 ChatLiveEvent, type ChatStatus, type ChatUnreadSummary, 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, ContentId, type ContentItem, type ContentType, ContractNewDomainEvent, type Course, type CourseSettings, type CourseStatus, type CourseView, type CreateAutomationInput, type CreateBundleInput, type CreateCommunityInput, type CreateCourseInput, type CreateDownloadInput, type CreateEventInput, type CreateInviteInput, type CreateOrgUserInput, CreateOrganizationInput, type CreateSpaceInput, type CreateUserInput, type CreateWebhookInput, CreatedApiKey, type CreatedWebhook, CredentialLimit, 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, type Event, type EventAddress, type EventAnalytics, type EventAsset, type EventAttendee, type EventAttendeeFace, type EventAttendeeSource, EventDefinition, EventEmailParams, type EventFile, type EventLead, type EventLocation, EventMetadata, type EventOnline, EventParseResult, type EventRecording, type EventSettings, type EventSort, type EventStatus, type EventType, type EventVenue, type EventView, type FlaggedComment, type FlaggedCommentView, type GrantEntitlementInput, type GrantSource, HeaderBag, Integration, type Invite, InviteId, type InviteInput, JsonValue, type Level, type ListBundlesQuery, type ListCommentsQuery, type ListCommunitiesQuery, type ListCoursesQuery, type ListDownloadsQuery, type ListEventsQuery, type LiveMessage, Logger, MakeEventInput, type MemberEvent, type MemberEventSummary, type MemberEventViewer, type MemberEventsQuery, type Mention, type MentionItemType, type MentionView, type Message, type MessageAttachment, type MessageFile, type MessageFlag, type MessageFlagResolution, type MessageReaction, type MessageView, type Module, NewDomainEvent, type NewOrganizationInput, NotificationCategory, NotificationFilter, NotificationTypeDeclaration, ObjectStorage, type OrgRoleRow, type OrgUser, OrgUserId, type OrgUserInput, type OrgUserProfile, type OrgUserStatus, type Organization, OrganizationId, type OrganizationInput, PUBLIC_CACHE_CONTROL, PUBLIC_PREFIX, Page, type PatchCommunitySettingsInput, type PatchDmSettingsInput, type Permission, 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 ReorderEventAssetsInput, type ReportProgressInput, type RequestUploadInput, type RoleAssignment, type RoleKey, 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 UpdateEventInput, 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 };
@@ -1 +1,2 @@
1
- export {};
1
+ import { PUBLIC_CACHE_CONTROL, PUBLIC_PREFIX } from "./ports.js";
2
+ export { PUBLIC_CACHE_CONTROL, PUBLIC_PREFIX };