@headless-lms/core 0.4.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (249) hide show
  1. package/dist/assets/events.d.ts +15 -9
  2. package/dist/assets/file-urls.d.ts +14 -7
  3. package/dist/assets/file-urls.js +15 -4
  4. package/dist/assets/file-urls.js.map +1 -1
  5. package/dist/assets/index.d.ts +4 -4
  6. package/dist/assets/index.js +3 -3
  7. package/dist/assets/ports.d.ts +34 -15
  8. package/dist/assets/service.d.ts +30 -14
  9. package/dist/assets/service.js +233 -54
  10. package/dist/assets/service.js.map +1 -1
  11. package/dist/automations/actions.js.map +1 -1
  12. package/dist/automations/catalog.js +68 -3
  13. package/dist/automations/catalog.js.map +1 -1
  14. package/dist/automations/community-derivations.js +16 -16
  15. package/dist/automations/community-derivations.js.map +1 -1
  16. package/dist/automations/community-mail.d.ts +34 -4
  17. package/dist/automations/community-mail.js +32 -4
  18. package/dist/automations/community-mail.js.map +1 -1
  19. package/dist/automations/event-permissions.d.ts +12 -0
  20. package/dist/automations/event-permissions.js +38 -0
  21. package/dist/automations/event-permissions.js.map +1 -0
  22. package/dist/automations/index.d.ts +2 -1
  23. package/dist/automations/index.js +2 -1
  24. package/dist/automations/notifications/applicable.d.ts +8 -0
  25. package/dist/automations/notifications/applicable.js +12 -0
  26. package/dist/automations/notifications/applicable.js.map +1 -0
  27. package/dist/automations/notifications/debounce.js +1 -1
  28. package/dist/automations/notifications/debounce.js.map +1 -1
  29. package/dist/automations/notifications/defaults.js +33 -3
  30. package/dist/automations/notifications/defaults.js.map +1 -1
  31. package/dist/automations/notifications/processor.js +1 -1
  32. package/dist/automations/notifications/processor.js.map +1 -1
  33. package/dist/automations/notifications/rules/content.js +60 -3
  34. package/dist/automations/notifications/rules/content.js.map +1 -1
  35. package/dist/automations/notifications/rules/discussion.js +29 -29
  36. package/dist/automations/notifications/rules/discussion.js.map +1 -1
  37. package/dist/automations/notifications/rules/entitlements.js +36 -9
  38. package/dist/automations/notifications/rules/entitlements.js.map +1 -1
  39. package/dist/automations/notifications/rules/events.d.ts +9 -0
  40. package/dist/automations/notifications/rules/events.js +27 -0
  41. package/dist/automations/notifications/rules/events.js.map +1 -0
  42. package/dist/automations/notifications/rules/organizations.js +17 -10
  43. package/dist/automations/notifications/rules/organizations.js.map +1 -1
  44. package/dist/automations/notifications/rules/recipients.js +0 -1
  45. package/dist/automations/notifications/rules/recipients.js.map +1 -1
  46. package/dist/automations/notifications/service.d.ts +8 -6
  47. package/dist/automations/notifications/service.js +12 -12
  48. package/dist/automations/notifications/service.js.map +1 -1
  49. package/dist/automations/notifications/types.js +94 -7
  50. package/dist/automations/notifications/types.js.map +1 -1
  51. package/dist/automations/ports.d.ts +30 -31
  52. package/dist/automations/service.d.ts +20 -17
  53. package/dist/automations/service.js +90 -61
  54. package/dist/automations/service.js.map +1 -1
  55. package/dist/content/event-sight.d.ts +11 -0
  56. package/dist/content/event-sight.js +11 -0
  57. package/dist/content/event-sight.js.map +1 -0
  58. package/dist/content/events.d.ts +465 -88
  59. package/dist/content/events.js +34 -1
  60. package/dist/content/events.js.map +1 -1
  61. package/dist/content/index.d.ts +6 -4
  62. package/dist/content/index.js +3 -1
  63. package/dist/content/jobs.d.ts +16 -0
  64. package/dist/content/jobs.js +37 -0
  65. package/dist/content/jobs.js.map +1 -0
  66. package/dist/content/model.d.ts +2 -2
  67. package/dist/content/notification-categories.d.ts +5 -4
  68. package/dist/content/notification-categories.js +15 -6
  69. package/dist/content/notification-categories.js.map +1 -1
  70. package/dist/content/ports.d.ts +113 -68
  71. package/dist/content/service.d.ts +103 -67
  72. package/dist/content/service.js +739 -152
  73. package/dist/content/service.js.map +1 -1
  74. package/dist/content/titles.d.ts +6 -3
  75. package/dist/content/titles.js +37 -24
  76. package/dist/content/titles.js.map +1 -1
  77. package/dist/content/types.d.ts +2 -2
  78. package/dist/discussion/authors.d.ts +4 -2
  79. package/dist/discussion/authors.js +9 -5
  80. package/dist/discussion/authors.js.map +1 -1
  81. package/dist/discussion/chats.d.ts +56 -37
  82. package/dist/discussion/chats.js +392 -160
  83. package/dist/discussion/chats.js.map +1 -1
  84. package/dist/discussion/events.d.ts +85 -47
  85. package/dist/discussion/events.js +41 -3
  86. package/dist/discussion/events.js.map +1 -1
  87. package/dist/discussion/index.d.ts +8 -5
  88. package/dist/discussion/index.js +5 -3
  89. package/dist/discussion/live.d.ts +106 -0
  90. package/dist/discussion/live.js +642 -0
  91. package/dist/discussion/live.js.map +1 -0
  92. package/dist/discussion/mentions.js +2 -2
  93. package/dist/discussion/mentions.js.map +1 -1
  94. package/dist/discussion/ports.d.ts +182 -100
  95. package/dist/discussion/ports.js.map +1 -1
  96. package/dist/discussion/posts.d.ts +45 -39
  97. package/dist/discussion/posts.js +266 -152
  98. package/dist/discussion/posts.js.map +1 -1
  99. package/dist/discussion/rules.d.ts +18 -0
  100. package/dist/discussion/rules.js +22 -0
  101. package/dist/discussion/rules.js.map +1 -0
  102. package/dist/discussion/service.d.ts +37 -31
  103. package/dist/discussion/service.js +250 -186
  104. package/dist/discussion/service.js.map +1 -1
  105. package/dist/discussion/subscriptions.d.ts +8 -8
  106. package/dist/discussion/subscriptions.js +28 -12
  107. package/dist/discussion/subscriptions.js.map +1 -1
  108. package/dist/discussion/titles.d.ts +4 -2
  109. package/dist/discussion/titles.js +27 -13
  110. package/dist/discussion/titles.js.map +1 -1
  111. package/dist/entitlements/events.d.ts +58 -58
  112. package/dist/entitlements/index.d.ts +4 -4
  113. package/dist/entitlements/index.js +2 -2
  114. package/dist/entitlements/model.d.ts +2 -2
  115. package/dist/entitlements/ports.d.ts +65 -39
  116. package/dist/entitlements/rules.d.ts +3 -6
  117. package/dist/entitlements/rules.js +5 -10
  118. package/dist/entitlements/rules.js.map +1 -1
  119. package/dist/entitlements/service.d.ts +40 -28
  120. package/dist/entitlements/service.js +369 -162
  121. package/dist/entitlements/service.js.map +1 -1
  122. package/dist/identity/devices.d.ts +3 -3
  123. package/dist/identity/devices.js +6 -4
  124. package/dist/identity/devices.js.map +1 -1
  125. package/dist/identity/index.d.ts +2 -2
  126. package/dist/identity/index.js +2 -2
  127. package/dist/identity/notification-settings.d.ts +1 -1
  128. package/dist/identity/notification-settings.js +2 -1
  129. package/dist/identity/notification-settings.js.map +1 -1
  130. package/dist/identity/ports.d.ts +7 -7
  131. package/dist/identity/service.d.ts +8 -7
  132. package/dist/identity/service.js +16 -12
  133. package/dist/identity/service.js.map +1 -1
  134. package/dist/integrations/events.d.ts +3 -3
  135. package/dist/integrations/ports.d.ts +9 -8
  136. package/dist/integrations/service.d.ts +9 -8
  137. package/dist/integrations/service.js +31 -14
  138. package/dist/integrations/service.js.map +1 -1
  139. package/dist/organizations/default-roles.d.ts +22 -0
  140. package/dist/organizations/default-roles.js +89 -0
  141. package/dist/organizations/default-roles.js.map +1 -0
  142. package/dist/organizations/effective-permissions.d.ts +47 -0
  143. package/dist/organizations/effective-permissions.js +118 -0
  144. package/dist/organizations/effective-permissions.js.map +1 -0
  145. package/dist/organizations/events.d.ts +326 -181
  146. package/dist/organizations/events.js +90 -18
  147. package/dist/organizations/events.js.map +1 -1
  148. package/dist/organizations/index.d.ts +14 -10
  149. package/dist/organizations/index.js +7 -3
  150. package/dist/organizations/members.d.ts +66 -8
  151. package/dist/organizations/members.js.map +1 -1
  152. package/dist/organizations/model.d.ts +2 -2
  153. package/dist/organizations/notification-catalog.d.ts +31 -0
  154. package/dist/organizations/notification-catalog.js +32 -0
  155. package/dist/organizations/notification-catalog.js.map +1 -0
  156. package/dist/organizations/notification-categories.d.ts +6 -4
  157. package/dist/organizations/notification-categories.js +25 -10
  158. package/dist/organizations/notification-categories.js.map +1 -1
  159. package/dist/organizations/org-roles.d.ts +33 -0
  160. package/dist/organizations/org-roles.js +49 -0
  161. package/dist/organizations/org-roles.js.map +1 -0
  162. package/dist/organizations/permissions.d.ts +311 -0
  163. package/dist/organizations/permissions.js +327 -0
  164. package/dist/organizations/permissions.js.map +1 -0
  165. package/dist/organizations/ports.d.ts +187 -65
  166. package/dist/organizations/service.d.ts +102 -35
  167. package/dist/organizations/service.js +1254 -327
  168. package/dist/organizations/service.js.map +1 -1
  169. package/dist/organizations/testing.d.ts +18 -0
  170. package/dist/organizations/testing.js +37 -0
  171. package/dist/organizations/testing.js.map +1 -0
  172. package/dist/organizations/types.d.ts +5 -16
  173. package/dist/progress/events.d.ts +14 -14
  174. package/dist/progress/index.d.ts +2 -2
  175. package/dist/progress/ports.d.ts +11 -3
  176. package/dist/progress/service.d.ts +6 -5
  177. package/dist/progress/service.js +21 -6
  178. package/dist/progress/service.js.map +1 -1
  179. package/dist/reporting/admin/index.d.ts +6 -4
  180. package/dist/reporting/admin/model.d.ts +36 -3
  181. package/dist/reporting/admin/ports.d.ts +39 -14
  182. package/dist/reporting/admin/service.d.ts +32 -11
  183. package/dist/reporting/admin/service.js +102 -18
  184. package/dist/reporting/admin/service.js.map +1 -1
  185. package/dist/reporting/events/index.d.ts +27 -0
  186. package/dist/reporting/events/index.js +20 -0
  187. package/dist/reporting/events/index.js.map +1 -0
  188. package/dist/reporting/member/calendar.d.ts +11 -0
  189. package/dist/reporting/member/calendar.js +75 -0
  190. package/dist/reporting/member/calendar.js.map +1 -0
  191. package/dist/reporting/member/index.d.ts +3 -2
  192. package/dist/reporting/member/model.d.ts +29 -5
  193. package/dist/reporting/member/ports.d.ts +49 -29
  194. package/dist/reporting/member/service.d.ts +57 -29
  195. package/dist/reporting/member/service.js +345 -114
  196. package/dist/reporting/member/service.js.map +1 -1
  197. package/dist/shared/actor.d.ts +23 -3
  198. package/dist/shared/errors.d.ts +2 -1
  199. package/dist/shared/errors.js +3 -1
  200. package/dist/shared/errors.js.map +1 -1
  201. package/dist/shared/id.d.ts +4 -0
  202. package/dist/shared/id.js +4 -0
  203. package/dist/shared/id.js.map +1 -1
  204. package/dist/shared/logger.d.ts +2 -1
  205. package/dist/shared/logger.js +10 -1
  206. package/dist/shared/logger.js.map +1 -1
  207. package/dist/shared/ports.d.ts +25 -5
  208. package/dist/types/content.d.ts +2 -2
  209. package/dist/types/discussion.d.ts +4 -5
  210. package/dist/types/email-templates.d.ts +22 -3
  211. package/dist/types/entitlements.d.ts +2 -2
  212. package/dist/types/identity.d.ts +13 -16
  213. package/dist/types/index.d.ts +9 -9
  214. package/dist/types/index.js +2 -1
  215. package/dist/types/notifications.d.ts +4 -4
  216. package/dist/types/organizations.d.ts +3 -2
  217. package/dist/types/ports.d.ts +8 -1
  218. package/dist/types/ports.js +7 -1
  219. package/dist/types/ports.js.map +1 -0
  220. package/dist/types/schemas/assets.d.ts +5 -5
  221. package/dist/types/schemas/assets.js +4 -3
  222. package/dist/types/schemas/assets.js.map +1 -1
  223. package/dist/types/schemas/content.d.ts +599 -13
  224. package/dist/types/schemas/content.js +219 -8
  225. package/dist/types/schemas/content.js.map +1 -1
  226. package/dist/types/schemas/discussion.d.ts +280 -57
  227. package/dist/types/schemas/discussion.js +77 -3
  228. package/dist/types/schemas/discussion.js.map +1 -1
  229. package/dist/types/schemas/entitlements.d.ts +21 -8
  230. package/dist/types/schemas/entitlements.js +11 -4
  231. package/dist/types/schemas/entitlements.js.map +1 -1
  232. package/dist/types/schemas/index.d.ts +5 -5
  233. package/dist/types/schemas/index.js +5 -5
  234. package/dist/types/schemas/notifications.d.ts +11 -10
  235. package/dist/types/schemas/notifications.js +3 -2
  236. package/dist/types/schemas/notifications.js.map +1 -1
  237. package/dist/types/schemas/organizations.d.ts +99 -60
  238. package/dist/types/schemas/organizations.js +80 -27
  239. package/dist/types/schemas/organizations.js.map +1 -1
  240. package/dist/types/schemas/progress.d.ts +3 -4
  241. package/dist/types/schemas/progress.js +0 -1
  242. package/dist/types/schemas/progress.js.map +1 -1
  243. package/package.json +1 -1
  244. package/dist/organizations/access-scopes.d.ts +0 -19
  245. package/dist/organizations/access-scopes.js +0 -89
  246. package/dist/organizations/access-scopes.js.map +0 -1
  247. package/dist/organizations/roles.d.ts +0 -19
  248. package/dist/organizations/roles.js +0 -82
  249. package/dist/organizations/roles.js.map +0 -1
@@ -1,29 +1,36 @@
1
1
  import { Page } from "../types/shared.js";
2
- import { Activity, ActivityAsset, ActivityView, AddDownloadAssetInput, Bundle, BundleItem, Community, CommunityView, Course, CourseSettings, CourseView, CreateBundleInput, CreateCommunityInput, CreateCourseInput, CreateDownloadInput, CreateSpaceInput, DigestSchedule, DmSettings, Download, DownloadAsset, DownloadFile, DownloadView, ListBundlesQuery, ListCommunitiesQuery, ListCoursesQuery, ListDownloadsQuery, Module, PatchCommunitySettingsInput, SaveActivityInput, SetSpaceTopicsInput, Space, SpaceDetail, UpdateBundleInput, UpdateCommunityInput, UpdateCourseInput, UpdateDownloadInput, UpdateSpaceInput } from "../types/schemas/content.js";
2
+ import { Activity, ActivityAsset, ActivityView, AddDownloadAssetInput, AddEventAssetInput, Bundle, BundleItem, Community, CommunityView, Course, CourseSettings, CourseView, CreateBundleInput, CreateCommunityInput, CreateCourseInput, CreateDownloadInput, CreateEventInput, CreateSpaceInput, DigestSchedule, DmSettings, Download, DownloadAsset, DownloadFile, DownloadView, Event, EventAsset, EventFile, EventLead, EventSettings, EventStatus, EventView, ListBundlesQuery, ListCommunitiesQuery, ListCoursesQuery, ListDownloadsQuery, ListEventsQuery, Module, PatchCommunitySettingsInput, SaveActivityInput, SetSpaceTopicsInput, Space, SpaceDetail, SpaceView, UpdateBundleInput, UpdateCommunityInput, UpdateCourseInput, UpdateDownloadInput, UpdateEventInput, UpdateSpaceInput } from "../types/schemas/content.js";
3
3
  import { SubjectRef } from "../types/notifications.js";
4
4
  import "../types/index.js";
5
+ import { Actor } from "../shared/actor.js";
5
6
  import { OutboxAppender, UnitOfWork } from "../shared/ports.js";
6
7
  import "./model.js";
7
8
  import "./types.js";
8
- import { Actor } from "../shared/actor.js";
9
9
  //#region src/content/ports.d.ts
10
- interface ContentService extends DownloadablesService, CourseManagementService, CommunitiesService {}
10
+ interface ContentService extends DownloadablesService, CourseManagementService, BundlesService, CommunitiesService, EventsService {}
11
11
  interface ItemTitle {
12
12
  title: string;
13
13
  excerpt?: string;
14
14
  }
15
15
  interface ItemTitles {
16
- titlesFor(orgId: string, actor: Actor, refs: SubjectRef[]): Promise<Record<string, ItemTitle>>;
16
+ titlesFor(refs: SubjectRef[], actor: Actor): Promise<Record<string, ItemTitle>>;
17
17
  }
18
18
  interface ItemTitleAccess {
19
19
  hasAccess(orgId: string, orgUserId: string, contentId: string): Promise<boolean>;
20
- isCommunityMember(orgId: string, actor: Actor, communityId: string): Promise<boolean>;
21
- canOpenSpace(orgId: string, actor: Actor, spaceId: string): Promise<boolean>;
20
+ isCommunityMember(communityId: string, actor: Actor): Promise<boolean>;
21
+ canOpenSpace(spaceId: string, actor: Actor): Promise<boolean>;
22
+ }
23
+ interface LibraryAssetRef {
24
+ id: string;
25
+ contentId: string | null;
26
+ }
27
+ interface ContentAssetReader {
28
+ libraryAssetsFor(orgId: string, assetIds: string[]): Promise<LibraryAssetRef[]>;
22
29
  }
23
30
  interface CommunityReader {
24
- getSpace(orgId: string, spaceId: string): Promise<SpaceDetail | null>;
25
- listSpaces(orgId: string, communityId: string): Promise<SpaceDetail[]>;
26
- getDmSettings(orgId: string, communityId: string): Promise<DmSettings | null>;
31
+ getSpace(spaceId: string, actor: Actor): Promise<SpaceView | null>;
32
+ listSpaces(communityId: string, actor: Actor): Promise<SpaceView[]>;
33
+ getDmSettings(communityId: string, actor: Actor): Promise<DmSettings | null>;
27
34
  }
28
35
  interface SpaceRowLock {
29
36
  lockSpace(orgId: string, spaceId: string): Promise<Space | null>;
@@ -34,88 +41,112 @@ interface CommunityDigest {
34
41
  digest: DigestSchedule;
35
42
  }
36
43
  interface CommunitiesService extends CommunityReader {
37
- listCommunities(orgId: string, query: ListCommunitiesQuery): Promise<Page<CommunityView>>;
38
- getCommunity(orgId: string, id: string): Promise<CommunityView | null>;
44
+ listCommunities(query: ListCommunitiesQuery, actor: Actor): Promise<Page<CommunityView>>;
45
+ getCommunity(id: string, actor: Actor): Promise<CommunityView>;
46
+ findCommunity(id: string, actor: Actor): Promise<CommunityView | null>;
39
47
  communitiesWithDigest(): Promise<CommunityDigest[]>;
40
- listCommunitiesById(orgId: string, ids: string[]): Promise<Community[]>;
41
- getCommunitySpace(orgId: string, communityId: string, spaceId: string): Promise<SpaceDetail | null>;
42
- createCommunity(orgId: string, input: CreateCommunityInput, actor: Actor): Promise<CommunityView>;
43
- updateCommunity(orgId: string, id: string, patch: UpdateCommunityInput, actor: Actor): Promise<CommunityView>;
44
- publishCommunity(orgId: string, id: string, actor: Actor): Promise<CommunityView>;
45
- unpublishCommunity(orgId: string, id: string, actor: Actor): Promise<CommunityView>;
46
- deleteCommunity(orgId: string, id: string, actor: Actor): Promise<void>;
47
- patchCommunitySettings(orgId: string, id: string, patch: PatchCommunitySettingsInput, actor: Actor): Promise<CommunityView>;
48
- createSpace(orgId: string, communityId: string, input: CreateSpaceInput, actor: Actor): Promise<SpaceDetail>;
49
- updateSpace(orgId: string, communityId: string, spaceId: string, patch: UpdateSpaceInput, actor: Actor): Promise<SpaceDetail>;
50
- deleteSpace(orgId: string, communityId: string, spaceId: string, actor: Actor): Promise<void>;
51
- reorderSpaces(orgId: string, communityId: string, orderedIds: string[], actor: Actor): Promise<SpaceDetail[]>;
52
- setSpaceTopics(orgId: string, communityId: string, spaceId: string, input: SetSpaceTopicsInput, actor: Actor): Promise<SpaceDetail>;
53
- addSpaceLink(orgId: string, communityId: string, spaceId: string, contentId: string, actor: Actor): Promise<SpaceDetail>;
54
- removeSpaceLink(orgId: string, communityId: string, spaceId: string, linkId: string, actor: Actor): Promise<SpaceDetail>;
55
- reorderSpaceLinks(orgId: string, communityId: string, spaceId: string, orderedIds: string[], actor: Actor): Promise<SpaceDetail>;
48
+ listCommunitiesById(ids: string[], actor: Actor): Promise<Community[]>;
49
+ getCommunitySpace(communityId: string, spaceId: string, actor: Actor): Promise<SpaceView>;
50
+ createCommunity(input: CreateCommunityInput, actor: Actor): Promise<CommunityView>;
51
+ updateCommunity(id: string, patch: UpdateCommunityInput, actor: Actor): Promise<CommunityView>;
52
+ publishCommunity(id: string, actor: Actor): Promise<CommunityView>;
53
+ unpublishCommunity(id: string, actor: Actor): Promise<CommunityView>;
54
+ deleteCommunity(id: string, actor: Actor): Promise<void>;
55
+ patchCommunitySettings(id: string, patch: PatchCommunitySettingsInput, actor: Actor): Promise<CommunityView>;
56
+ createSpace(communityId: string, input: CreateSpaceInput, actor: Actor): Promise<SpaceView>;
57
+ updateSpace(communityId: string, spaceId: string, patch: UpdateSpaceInput, actor: Actor): Promise<SpaceView>;
58
+ deleteSpace(communityId: string, spaceId: string, actor: Actor): Promise<void>;
59
+ reorderSpaces(communityId: string, orderedIds: string[], actor: Actor): Promise<SpaceView[]>;
60
+ setSpaceTopics(communityId: string, spaceId: string, input: SetSpaceTopicsInput, actor: Actor): Promise<SpaceView>;
61
+ addSpaceLink(communityId: string, spaceId: string, contentId: string, actor: Actor): Promise<SpaceView>;
62
+ removeSpaceLink(communityId: string, spaceId: string, linkId: string, actor: Actor): Promise<SpaceView>;
63
+ reorderSpaceLinks(communityId: string, spaceId: string, orderedIds: string[], actor: Actor): Promise<SpaceView>;
56
64
  }
57
65
  interface CourseManagementService {
58
- listCourses(orgId: string, query: ListCoursesQuery): Promise<Page<CourseView>>;
59
- getCourse(orgId: string, id: string): Promise<CourseView | null>;
60
- createCourse(orgId: string, input: CreateCourseInput): Promise<CourseView>;
66
+ listCourses(query: ListCoursesQuery, actor: Actor): Promise<Page<CourseView>>;
67
+ getCourse(id: string, actor: Actor): Promise<CourseView>;
68
+ findCourse(id: string, actor: Actor): Promise<CourseView | null>;
69
+ createCourse(input: CreateCourseInput, actor: Actor): Promise<CourseView>;
61
70
  /** @throws NotFoundError when no course with this id exists in the org. */
62
- updateCourse(orgId: string, id: string, patch: UpdateCourseInput): Promise<CourseView>;
71
+ updateCourse(id: string, patch: UpdateCourseInput, actor: Actor): Promise<CourseView>;
63
72
  /** @throws NotFoundError when no course with this id exists in the org. */
64
- patchCourseSettings(orgId: string, id: string, value: Partial<CourseSettings>): Promise<CourseSettings>;
73
+ patchCourseSettings(id: string, value: Partial<CourseSettings>, actor: Actor): Promise<CourseSettings>;
65
74
  /** @throws NotFoundError when no course with this id exists in the org. */
66
- deleteCourse(orgId: string, id: string, actor: Actor): Promise<void>;
67
- listCourseModules(orgId: string, courseId: string): Promise<Module[]>;
68
- listCourseActivities(orgId: string, courseId: string): Promise<Activity[]>;
69
- listCourseActivityViews(orgId: string, courseId: string): Promise<ActivityView[]>;
70
- listCourseActivityAssets(orgId: string, courseId: string): Promise<ActivityAsset[]>;
71
- getActivity(orgId: string, activityId: string): Promise<Activity | null>;
72
- getModule(orgId: string, moduleId: string): Promise<Module | null>;
73
- reorderModules(orgId: string, courseId: string, orderedIds: string[]): Promise<Module[]>;
74
- createModule(orgId: string, courseId: string, title: string): Promise<Module[]>;
75
+ deleteCourse(id: string, actor: Actor): Promise<void>;
76
+ listCourseModules(courseId: string, actor: Actor): Promise<Module[]>;
77
+ listCourseActivities(courseId: string, actor: Actor): Promise<Activity[]>;
78
+ listCourseActivityViews(courseId: string, actor: Actor): Promise<ActivityView[]>;
79
+ listCourseActivityAssets(courseId: string, actor: Actor): Promise<ActivityAsset[]>;
80
+ getActivity(activityId: string, actor: Actor): Promise<Activity | null>;
81
+ getModule(moduleId: string, actor: Actor): Promise<Module | null>;
82
+ reorderModules(courseId: string, orderedIds: string[], actor: Actor): Promise<Module[]>;
83
+ createModule(courseId: string, title: string, actor: Actor): Promise<Module[]>;
75
84
  /** @throws NotFoundError when no such module exists in this course. */
76
- updateModule(orgId: string, courseId: string, moduleId: string, title: string): Promise<Module[]>;
85
+ updateModule(courseId: string, moduleId: string, title: string, actor: Actor): Promise<Module[]>;
77
86
  /** @throws NotFoundError when no such module exists in this course. */
78
- deleteModule(orgId: string, courseId: string, moduleId: string): Promise<Module[]>;
87
+ deleteModule(courseId: string, moduleId: string, actor: Actor): Promise<Module[]>;
79
88
  /** @throws NotFoundError when no such module exists in this course. */
80
- reorderActivities(orgId: string, courseId: string, moduleId: string, orderedIds: string[]): Promise<Module[]>;
89
+ reorderActivities(courseId: string, moduleId: string, orderedIds: string[], actor: Actor): Promise<Module[]>;
81
90
  /** @throws NotFoundError when the module — or, on update, the activity — does not exist. */
82
- saveActivity(orgId: string, courseId: string, moduleId: string, input: SaveActivityInput, activityId?: string): Promise<Module[]>;
91
+ saveActivity(courseId: string, moduleId: string, input: SaveActivityInput, activityId: string | null, actor: Actor): Promise<Module[]>;
83
92
  /** @throws NotFoundError when no such activity exists in this module. */
84
- deleteActivity(orgId: string, courseId: string, moduleId: string, activityId: string): Promise<Module[]>;
93
+ deleteActivity(courseId: string, moduleId: string, activityId: string, actor: Actor): Promise<Module[]>;
85
94
  }
86
95
  interface DownloadablesService {
87
- listDownloads(orgId: string, query: ListDownloadsQuery): Promise<Page<DownloadView>>;
88
- getDownload(orgId: string, id: string): Promise<DownloadView | null>;
89
- createDownload(orgId: string, input: CreateDownloadInput): Promise<DownloadView>;
96
+ listDownloads(query: ListDownloadsQuery, actor: Actor): Promise<Page<DownloadView>>;
97
+ getDownload(id: string, actor: Actor): Promise<DownloadView>;
98
+ findDownload(id: string, actor: Actor): Promise<DownloadView | null>;
99
+ createDownload(input: CreateDownloadInput, actor: Actor): Promise<DownloadView>;
90
100
  /** @throws NotFoundError when no download with this id exists in the org. */
91
- updateDownload(orgId: string, id: string, patch: UpdateDownloadInput): Promise<DownloadView>;
101
+ updateDownload(id: string, patch: UpdateDownloadInput, actor: Actor): Promise<DownloadView>;
92
102
  /** @throws NotFoundError when no download with this id exists in the org. */
93
- removeDownload(orgId: string, id: string, actor: Actor): Promise<void>;
94
- listDownloadAssets(orgId: string, downloadId: string): Promise<DownloadFile[]>;
95
- addDownloadAsset(orgId: string, downloadId: string, input: AddDownloadAssetInput): Promise<DownloadFile[]>;
96
- removeDownloadAsset(orgId: string, downloadId: string, assetId: string): Promise<DownloadFile[]>;
97
- renameDownloadAsset(orgId: string, downloadId: string, assetId: string, displayName: string | null): Promise<DownloadFile[]>;
103
+ removeDownload(id: string, actor: Actor): Promise<void>;
104
+ listDownloadAssets(downloadId: string, actor: Actor): Promise<DownloadFile[]>;
105
+ addDownloadAsset(downloadId: string, input: AddDownloadAssetInput, actor: Actor): Promise<DownloadFile[]>;
106
+ removeDownloadAsset(downloadId: string, assetId: string, actor: Actor): Promise<DownloadFile[]>;
107
+ renameDownloadAsset(downloadId: string, assetId: string, displayName: string | null, actor: Actor): Promise<DownloadFile[]>;
98
108
  /** @throws ConflictError when assetIds is not exactly the download's current asset set. */
99
- reorderDownloadAssets(orgId: string, downloadId: string, assetIds: string[]): Promise<DownloadFile[]>;
109
+ reorderDownloadAssets(downloadId: string, assetIds: string[], actor: Actor): Promise<DownloadFile[]>;
100
110
  }
111
+ interface EventsService {
112
+ listEvents(query: ListEventsQuery, actor: Actor): Promise<Page<EventView>>;
113
+ getEvent(id: string, actor: Actor): Promise<EventView>;
114
+ findEvent(id: string, actor: Actor): Promise<EventView | null>;
115
+ findEvents(ids: string[], actor: Actor): Promise<EventView[]>;
116
+ createEvent(input: CreateEventInput, actor: Actor): Promise<EventView>;
117
+ updateEvent(id: string, patch: UpdateEventInput, actor: Actor): Promise<EventView>;
118
+ cancelEvent(id: string, actor: Actor): Promise<EventView>;
119
+ deleteEvent(id: string, actor: Actor): Promise<void>;
120
+ startingSoon(orgId: string, eventId: string, lead: EventLead, now: Date): Promise<void>;
121
+ listEventAssets(eventId: string, actor: Actor): Promise<EventFile[]>;
122
+ eventFilesFor(eventIds: string[], actor: Actor): Promise<Record<string, EventFile[]>>;
123
+ addEventAsset(eventId: string, input: AddEventAssetInput, actor: Actor): Promise<EventFile[]>;
124
+ removeEventAsset(eventId: string, assetId: string, actor: Actor): Promise<EventFile[]>;
125
+ renameEventAsset(eventId: string, assetId: string, displayName: string | null, actor: Actor): Promise<EventFile[]>;
126
+ reorderEventAssets(eventId: string, assetIds: string[], actor: Actor): Promise<EventFile[]>;
127
+ }
128
+ type EventPatch = Omit<UpdateEventInput, 'status' | 'settings'> & {
129
+ status?: EventStatus;
130
+ };
101
131
  interface BundlesService {
102
- listBundles(orgId: string, query: ListBundlesQuery): Promise<Page<Bundle>>;
103
- getBundle(orgId: string, id: string): Promise<Bundle | null>;
132
+ listBundles(query: ListBundlesQuery, actor: Actor): Promise<Page<Bundle>>;
133
+ getBundle(id: string, actor: Actor): Promise<Bundle>;
134
+ findBundle(id: string, actor: Actor): Promise<Bundle | null>;
104
135
  /** Bundle and its initial items are created together, or not at all.
105
136
  * @throws NotFoundError when an initial content id does not exist in the org. */
106
- createBundle(orgId: string, input: CreateBundleInput): Promise<Bundle>;
137
+ createBundle(input: CreateBundleInput, actor: Actor): Promise<Bundle>;
107
138
  /** @throws NotFoundError when no bundle with this id exists in the org. */
108
- updateBundle(orgId: string, id: string, patch: UpdateBundleInput): Promise<Bundle>;
139
+ updateBundle(id: string, patch: UpdateBundleInput, actor: Actor): Promise<Bundle>;
109
140
  /** @throws NotFoundError when no bundle with this id exists in the org. */
110
- deleteBundle(orgId: string, id: string): Promise<void>;
111
- listBundleItems(orgId: string, bundleId: string): Promise<BundleItem[]>;
141
+ deleteBundle(id: string, actor: Actor): Promise<void>;
142
+ listBundleItems(bundleId: string, actor: Actor): Promise<BundleItem[]>;
112
143
  /** @throws NotFoundError when the bundle — or the content — does not exist in the org. */
113
- addBundleItem(orgId: string, bundleId: string, contentId: string): Promise<BundleItem[]>;
144
+ addBundleItem(bundleId: string, contentId: string, actor: Actor): Promise<BundleItem[]>;
114
145
  /** @throws NotFoundError when no bundle with this id exists in the org. */
115
- removeBundleItem(orgId: string, bundleId: string, contentId: string): Promise<BundleItem[]>;
146
+ removeBundleItem(bundleId: string, contentId: string, actor: Actor): Promise<BundleItem[]>;
116
147
  }
117
148
  interface ContentRepository {
118
- listCourses(orgId: string, query: ListCoursesQuery): Promise<Page<Course>>;
149
+ listCourses(orgId: string, query: ListCoursesQuery, ids?: string[]): Promise<Page<Course>>;
119
150
  findCourseById(orgId: string, id: string): Promise<Course | null>;
120
151
  createCourse(orgId: string, input: CreateCourseInput, slug: string): Promise<Course>;
121
152
  updateCourse(orgId: string, id: string, patch: UpdateCourseInput): Promise<Course | null>;
@@ -136,7 +167,7 @@ interface ContentRepository {
136
167
  activity: Activity;
137
168
  }>;
138
169
  deleteActivity(orgId: string, courseId: string, moduleId: string, activityId: string): Promise<Module[]>;
139
- listDownloads(orgId: string, query: ListDownloadsQuery): Promise<Page<Download>>;
170
+ listDownloads(orgId: string, query: ListDownloadsQuery, ids?: string[]): Promise<Page<Download>>;
140
171
  getDownload(orgId: string, id: string): Promise<Download | null>;
141
172
  createDownload(orgId: string, input: CreateDownloadInput, slug: string): Promise<Download>;
142
173
  updateDownload(orgId: string, id: string, patch: UpdateDownloadInput): Promise<Download | null>;
@@ -146,6 +177,20 @@ interface ContentRepository {
146
177
  removeDownloadAsset(orgId: string, downloadId: string, assetId: string): Promise<DownloadAsset[]>;
147
178
  renameDownloadAsset(orgId: string, downloadId: string, assetId: string, displayName: string | null): Promise<DownloadAsset[]>;
148
179
  reorderDownloadAssets(orgId: string, downloadId: string, assetIds: string[]): Promise<DownloadAsset[]>;
180
+ listEvents(orgId: string, query: ListEventsQuery, ids?: string[]): Promise<Page<Event>>;
181
+ findEventById(orgId: string, id: string): Promise<Event | null>;
182
+ findEventsByIds(orgId: string, ids: string[]): Promise<Event[]>;
183
+ createEvent(orgId: string, input: Omit<CreateEventInput, 'settings'>): Promise<Event>;
184
+ updateEvent(orgId: string, id: string, patch: EventPatch): Promise<Event | null>;
185
+ patchEventSettings(orgId: string, id: string, value: Partial<EventSettings>): Promise<EventSettings>;
186
+ deleteEvent(orgId: string, id: string): Promise<boolean>;
187
+ deleteEventSettings(orgId: string, id: string): Promise<void>;
188
+ listEventAssets(orgId: string, eventId: string): Promise<EventAsset[]>;
189
+ listEventAssetsFor(orgId: string, eventIds: string[]): Promise<EventAsset[]>;
190
+ addEventAsset(orgId: string, eventId: string, input: AddEventAssetInput): Promise<EventAsset[]>;
191
+ removeEventAsset(orgId: string, eventId: string, assetId: string): Promise<EventAsset[]>;
192
+ renameEventAsset(orgId: string, eventId: string, assetId: string, displayName: string | null): Promise<EventAsset[]>;
193
+ reorderEventAssets(orgId: string, eventId: string, assetIds: string[]): Promise<EventAsset[]>;
149
194
  listBundles(orgId: string, query: ListBundlesQuery): Promise<Page<Bundle>>;
150
195
  findBundleById(orgId: string, id: string): Promise<Bundle | null>;
151
196
  createBundle(orgId: string, input: CreateBundleInput): Promise<Bundle>;
@@ -155,7 +200,7 @@ interface ContentRepository {
155
200
  /** Content already in the bundle is left as it is — adding twice is a no-op. */
156
201
  addBundleItem(orgId: string, bundleId: string, contentId: string): Promise<BundleItem[]>;
157
202
  removeBundleItem(orgId: string, bundleId: string, contentId: string): Promise<BundleItem[]>;
158
- listCommunities(orgId: string, query: ListCommunitiesQuery): Promise<Page<Community>>;
203
+ listCommunities(orgId: string, query: ListCommunitiesQuery, ids?: string[]): Promise<Page<Community>>;
159
204
  findCommunityById(orgId: string, id: string): Promise<Community | null>;
160
205
  findCommunitiesByIds(orgId: string, ids: string[]): Promise<Community[]>;
161
206
  communitiesWithDigest(): Promise<CommunityDigest[]>;
@@ -184,5 +229,5 @@ interface ContentTxScope {
184
229
  }
185
230
  type ContentUnitOfWork = UnitOfWork<ContentTxScope>;
186
231
  //#endregion
187
- export { BundlesService, CommunitiesService, CommunityDigest, CommunityReader, ContentRepository, ContentService, ContentTxScope, ContentUnitOfWork, CourseManagementService, DownloadablesService, ItemTitle, ItemTitleAccess, ItemTitles, SpaceRowLock };
232
+ export { BundlesService, CommunitiesService, CommunityDigest, CommunityReader, ContentAssetReader, ContentRepository, ContentService, ContentTxScope, ContentUnitOfWork, CourseManagementService, DownloadablesService, EventPatch, EventsService, ItemTitle, ItemTitleAccess, ItemTitles, LibraryAssetRef, SpaceRowLock };
188
233
  //# sourceMappingURL=ports.d.ts.map
@@ -1,98 +1,134 @@
1
1
  import { Page } from "../types/shared.js";
2
2
  import { Logger } from "../types/ports.js";
3
- import { Activity, ActivityAsset, ActivityView, AddDownloadAssetInput, Bundle, BundleItem, Community, CommunityView, CourseSettings, CourseView, CreateBundleInput, CreateCommunityInput, CreateCourseInput, CreateDownloadInput, CreateSpaceInput, DmSettings, DownloadFile, DownloadView, ListBundlesQuery, ListCommunitiesQuery, ListCoursesQuery, ListDownloadsQuery, Module, PatchCommunitySettingsInput, SaveActivityInput, SetSpaceTopicsInput, SpaceDetail, UpdateBundleInput, UpdateCommunityInput, UpdateCourseInput, UpdateDownloadInput, UpdateSpaceInput } from "../types/schemas/content.js";
4
- import "../shared/ports.js";
3
+ import { Activity, ActivityAsset, ActivityView, AddDownloadAssetInput, AddEventAssetInput, Bundle, BundleItem, Community, CommunityView, CourseSettings, CourseView, CreateBundleInput, CreateCommunityInput, CreateCourseInput, CreateDownloadInput, CreateEventInput, CreateSpaceInput, DmSettings, DownloadFile, DownloadView, EventFile, EventLead, EventView, ListBundlesQuery, ListCommunitiesQuery, ListCoursesQuery, ListDownloadsQuery, ListEventsQuery, Module, PatchCommunitySettingsInput, SaveActivityInput, SetSpaceTopicsInput, SpaceView, UpdateBundleInput, UpdateCommunityInput, UpdateCourseInput, UpdateDownloadInput, UpdateEventInput, UpdateSpaceInput } from "../types/schemas/content.js";
4
+ import { Actor } from "../shared/actor.js";
5
+ import { Scheduler } from "../shared/ports.js";
5
6
  import { FileUrls } from "../assets/file-urls.js";
6
- import { AssetFiles, LibraryAssetReader } from "../assets/ports.js";
7
+ import { AssetFiles } from "../assets/ports.js";
7
8
  import "../assets/index.js";
8
9
  import "./model.js";
9
10
  import "./types.js";
10
- import { Actor } from "../shared/actor.js";
11
- import { BundlesService, CommunitiesService, CommunityDigest, ContentRepository, ContentUnitOfWork, CourseManagementService, DownloadablesService } from "./ports.js";
11
+ import { BundlesService, CommunitiesService, CommunityDigest, ContentAssetReader, ContentRepository, ContentUnitOfWork, CourseManagementService, DownloadablesService, EventsService } from "./ports.js";
12
12
  //#region src/content/service.d.ts
13
13
  type ContentServiceParams = {
14
14
  repo: ContentRepository;
15
15
  uow: ContentUnitOfWork;
16
- libraryAssets: LibraryAssetReader;
17
- files: Pick<AssetFiles, 'readyFiles'>;
16
+ libraryAssets: ContentAssetReader;
17
+ files: Pick<AssetFiles, 'readyFiles' | 'syncPublicImages'>;
18
18
  fileUrls: FileUrls;
19
+ scheduler: Pick<Scheduler, 'at' | 'cancel'>;
19
20
  logger?: Logger;
20
21
  };
21
- declare class ContentService implements CourseManagementService, DownloadablesService, BundlesService, CommunitiesService {
22
+ declare class ContentService implements CourseManagementService, DownloadablesService, BundlesService, CommunitiesService, EventsService {
22
23
  private readonly repo;
23
24
  private readonly uow;
24
25
  private readonly libraryAssets;
25
26
  private readonly files;
26
27
  private readonly fileUrls;
28
+ private readonly scheduler;
27
29
  private readonly logger;
28
30
  constructor(params: ContentServiceParams);
31
+ private require;
32
+ private requireAny;
33
+ private visibleIds;
29
34
  private withThumbnail;
35
+ private syncThumbnail;
36
+ private withdrawThumbnail;
37
+ private spaceView;
38
+ private communityPublished;
39
+ private oneSpaceView;
40
+ private syncSpaceImages;
30
41
  private pageWithThumbnails;
31
42
  private downloadFiles;
32
- listCourses(orgId: string, query: ListCoursesQuery): Promise<Page<CourseView>>;
33
- getCourse(orgId: string, id: string): Promise<CourseView | null>;
34
- createCourse(orgId: string, input: CreateCourseInput): Promise<CourseView>;
35
- updateCourse(orgId: string, id: string, patch: UpdateCourseInput): Promise<CourseView>;
36
- patchCourseSettings(orgId: string, id: string, value: Partial<CourseSettings>): Promise<CourseSettings>;
37
- deleteCourse(orgId: string, id: string, actor: Actor): Promise<void>;
38
- listCourseModules(orgId: string, courseId: string): Promise<Module[]>;
39
- listCourseActivities(orgId: string, courseId: string): Promise<Activity[]>;
40
- listCourseActivityViews(orgId: string, courseId: string): Promise<ActivityView[]>;
41
- listCourseActivityAssets(orgId: string, courseId: string): Promise<ActivityAsset[]>;
42
- getActivity(orgId: string, activityId: string): Promise<Activity | null>;
43
- getModule(orgId: string, moduleId: string): Promise<Module | null>;
44
- reorderModules(orgId: string, courseId: string, orderedIds: string[]): Promise<Module[]>;
45
- createModule(orgId: string, courseId: string, title: string): Promise<Module[]>;
46
- updateModule(orgId: string, courseId: string, moduleId: string, title: string): Promise<Module[]>;
47
- deleteModule(orgId: string, courseId: string, moduleId: string): Promise<Module[]>;
48
- reorderActivities(orgId: string, courseId: string, moduleId: string, orderedIds: string[]): Promise<Module[]>;
49
- private assertLibraryAssets;
50
- saveActivity(orgId: string, courseId: string, moduleId: string, input: SaveActivityInput, activityId?: string): Promise<Module[]>;
51
- deleteActivity(orgId: string, courseId: string, moduleId: string, activityId: string): Promise<Module[]>;
52
- listDownloads(orgId: string, query: ListDownloadsQuery): Promise<Page<DownloadView>>;
53
- getDownload(orgId: string, id: string): Promise<DownloadView | null>;
54
- createDownload(orgId: string, input: CreateDownloadInput): Promise<DownloadView>;
55
- updateDownload(orgId: string, id: string, patch: UpdateDownloadInput): Promise<DownloadView>;
56
- removeDownload(orgId: string, id: string, actor: Actor): Promise<void>;
57
- listDownloadAssets(orgId: string, downloadId: string): Promise<DownloadFile[]>;
58
- addDownloadAsset(orgId: string, downloadId: string, input: AddDownloadAssetInput): Promise<DownloadFile[]>;
59
- removeDownloadAsset(orgId: string, downloadId: string, assetId: string): Promise<DownloadFile[]>;
60
- renameDownloadAsset(orgId: string, downloadId: string, assetId: string, displayName: string | null): Promise<DownloadFile[]>;
43
+ private eventFiles;
44
+ private assertAttachable;
45
+ private courseAssetIds;
46
+ private downloadAssetIds;
47
+ private eventAssetIds;
48
+ listCourses(query: ListCoursesQuery, actor: Actor): Promise<Page<CourseView>>;
49
+ getCourse(id: string, actor: Actor): Promise<CourseView>;
50
+ findCourse(id: string, actor: Actor): Promise<CourseView | null>;
51
+ createCourse(input: CreateCourseInput, actor: Actor): Promise<CourseView>;
52
+ updateCourse(id: string, patch: UpdateCourseInput, actor: Actor): Promise<CourseView>;
53
+ patchCourseSettings(id: string, value: Partial<CourseSettings>, actor: Actor): Promise<CourseSettings>;
54
+ deleteCourse(id: string, actor: Actor): Promise<void>;
55
+ listCourseModules(courseId: string, actor: Actor): Promise<Module[]>;
56
+ listCourseActivities(courseId: string, actor: Actor): Promise<Activity[]>;
57
+ listCourseActivityViews(courseId: string, actor: Actor): Promise<ActivityView[]>;
58
+ listCourseActivityAssets(courseId: string, actor: Actor): Promise<ActivityAsset[]>;
59
+ getActivity(activityId: string, actor: Actor): Promise<Activity | null>;
60
+ getModule(moduleId: string, actor: Actor): Promise<Module | null>;
61
+ reorderModules(courseId: string, orderedIds: string[], actor: Actor): Promise<Module[]>;
62
+ createModule(courseId: string, title: string, actor: Actor): Promise<Module[]>;
63
+ updateModule(courseId: string, moduleId: string, title: string, actor: Actor): Promise<Module[]>;
64
+ deleteModule(courseId: string, moduleId: string, actor: Actor): Promise<Module[]>;
65
+ reorderActivities(courseId: string, moduleId: string, orderedIds: string[], actor: Actor): Promise<Module[]>;
66
+ saveActivity(courseId: string, moduleId: string, input: SaveActivityInput, activityId: string | null, actor: Actor): Promise<Module[]>;
67
+ deleteActivity(courseId: string, moduleId: string, activityId: string, actor: Actor): Promise<Module[]>;
68
+ listDownloads(query: ListDownloadsQuery, actor: Actor): Promise<Page<DownloadView>>;
69
+ getDownload(id: string, actor: Actor): Promise<DownloadView>;
70
+ findDownload(id: string, actor: Actor): Promise<DownloadView | null>;
71
+ createDownload(input: CreateDownloadInput, actor: Actor): Promise<DownloadView>;
72
+ updateDownload(id: string, patch: UpdateDownloadInput, actor: Actor): Promise<DownloadView>;
73
+ removeDownload(id: string, actor: Actor): Promise<void>;
74
+ listDownloadAssets(downloadId: string, actor: Actor): Promise<DownloadFile[]>;
75
+ addDownloadAsset(downloadId: string, input: AddDownloadAssetInput, actor: Actor): Promise<DownloadFile[]>;
76
+ removeDownloadAsset(downloadId: string, assetId: string, actor: Actor): Promise<DownloadFile[]>;
77
+ renameDownloadAsset(downloadId: string, assetId: string, displayName: string | null, actor: Actor): Promise<DownloadFile[]>;
61
78
  /** The caller must send the COMPLETE ordered set — a partial list would
62
79
  * silently unlink whatever it omitted. */
63
- reorderDownloadAssets(orgId: string, downloadId: string, assetIds: string[]): Promise<DownloadFile[]>;
64
- listBundles(orgId: string, query: ListBundlesQuery): Promise<Page<Bundle>>;
65
- getBundle(orgId: string, id: string): Promise<Bundle | null>;
66
- createBundle(orgId: string, input: CreateBundleInput): Promise<Bundle>;
67
- updateBundle(orgId: string, id: string, patch: UpdateBundleInput): Promise<Bundle>;
68
- deleteBundle(orgId: string, id: string): Promise<void>;
69
- listBundleItems(orgId: string, bundleId: string): Promise<BundleItem[]>;
70
- addBundleItem(orgId: string, bundleId: string, contentId: string): Promise<BundleItem[]>;
71
- removeBundleItem(orgId: string, bundleId: string, contentId: string): Promise<BundleItem[]>;
80
+ reorderDownloadAssets(downloadId: string, assetIds: string[], actor: Actor): Promise<DownloadFile[]>;
81
+ listEvents(query: ListEventsQuery, actor: Actor): Promise<Page<EventView>>;
82
+ getEvent(id: string, actor: Actor): Promise<EventView>;
83
+ findEvent(id: string, actor: Actor): Promise<EventView | null>;
84
+ findEvents(ids: string[], actor: Actor): Promise<EventView[]>;
85
+ createEvent(input: CreateEventInput, actor: Actor): Promise<EventView>;
86
+ updateEvent(id: string, patch: UpdateEventInput, actor: Actor): Promise<EventView>;
87
+ cancelEvent(id: string, actor: Actor): Promise<EventView>;
88
+ deleteEvent(id: string, actor: Actor): Promise<void>;
89
+ startingSoon(orgId: string, eventId: string, lead: EventLead, now: Date): Promise<void>;
90
+ private scheduleStartingSoon;
91
+ private cancelStartingSoon;
92
+ listEventAssets(eventId: string, actor: Actor): Promise<EventFile[]>;
93
+ eventFilesFor(eventIds: string[], actor: Actor): Promise<Record<string, EventFile[]>>;
94
+ addEventAsset(eventId: string, input: AddEventAssetInput, actor: Actor): Promise<EventFile[]>;
95
+ removeEventAsset(eventId: string, assetId: string, actor: Actor): Promise<EventFile[]>;
96
+ renameEventAsset(eventId: string, assetId: string, displayName: string | null, actor: Actor): Promise<EventFile[]>;
97
+ reorderEventAssets(eventId: string, assetIds: string[], actor: Actor): Promise<EventFile[]>;
98
+ listBundles(query: ListBundlesQuery, actor: Actor): Promise<Page<Bundle>>;
99
+ getBundle(id: string, actor: Actor): Promise<Bundle>;
100
+ findBundle(id: string, actor: Actor): Promise<Bundle | null>;
101
+ createBundle(input: CreateBundleInput, actor: Actor): Promise<Bundle>;
102
+ updateBundle(id: string, patch: UpdateBundleInput, actor: Actor): Promise<Bundle>;
103
+ deleteBundle(id: string, actor: Actor): Promise<void>;
104
+ listBundleItems(bundleId: string, actor: Actor): Promise<BundleItem[]>;
105
+ addBundleItem(bundleId: string, contentId: string, actor: Actor): Promise<BundleItem[]>;
106
+ removeBundleItem(bundleId: string, contentId: string, actor: Actor): Promise<BundleItem[]>;
72
107
  private spaceUpdates;
73
108
  private resolvedSpace;
74
- listCommunities(orgId: string, query: ListCommunitiesQuery): Promise<Page<CommunityView>>;
75
- getCommunity(orgId: string, id: string): Promise<CommunityView | null>;
109
+ listCommunities(query: ListCommunitiesQuery, actor: Actor): Promise<Page<CommunityView>>;
110
+ getCommunity(id: string, actor: Actor): Promise<CommunityView>;
111
+ findCommunity(id: string, actor: Actor): Promise<CommunityView | null>;
76
112
  communitiesWithDigest(): Promise<CommunityDigest[]>;
77
- listCommunitiesById(orgId: string, ids: string[]): Promise<Community[]>;
78
- getSpace(orgId: string, spaceId: string): Promise<SpaceDetail | null>;
79
- getCommunitySpace(orgId: string, communityId: string, spaceId: string): Promise<SpaceDetail | null>;
80
- listSpaces(orgId: string, communityId: string): Promise<SpaceDetail[]>;
81
- getDmSettings(orgId: string, communityId: string): Promise<DmSettings | null>;
82
- createCommunity(orgId: string, input: CreateCommunityInput, actor: Actor): Promise<CommunityView>;
83
- updateCommunity(orgId: string, id: string, patch: UpdateCommunityInput, actor: Actor): Promise<CommunityView>;
84
- publishCommunity(orgId: string, id: string, actor: Actor): Promise<CommunityView>;
85
- unpublishCommunity(orgId: string, id: string, actor: Actor): Promise<CommunityView>;
86
- deleteCommunity(orgId: string, id: string, actor: Actor): Promise<void>;
87
- patchCommunitySettings(orgId: string, id: string, patch: PatchCommunitySettingsInput, actor: Actor): Promise<CommunityView>;
88
- createSpace(orgId: string, communityId: string, input: CreateSpaceInput, actor: Actor): Promise<SpaceDetail>;
89
- updateSpace(orgId: string, communityId: string, spaceId: string, patch: UpdateSpaceInput, actor: Actor): Promise<SpaceDetail>;
90
- deleteSpace(orgId: string, communityId: string, spaceId: string, actor: Actor): Promise<void>;
91
- reorderSpaces(orgId: string, communityId: string, orderedIds: string[], actor: Actor): Promise<SpaceDetail[]>;
92
- setSpaceTopics(orgId: string, communityId: string, spaceId: string, input: SetSpaceTopicsInput, actor: Actor): Promise<SpaceDetail>;
93
- addSpaceLink(orgId: string, communityId: string, spaceId: string, contentId: string, actor: Actor): Promise<SpaceDetail>;
94
- removeSpaceLink(orgId: string, communityId: string, spaceId: string, linkId: string, actor: Actor): Promise<SpaceDetail>;
95
- reorderSpaceLinks(orgId: string, communityId: string, spaceId: string, orderedIds: string[], actor: Actor): Promise<SpaceDetail>;
113
+ listCommunitiesById(ids: string[], actor: Actor): Promise<Community[]>;
114
+ getSpace(spaceId: string, actor: Actor): Promise<SpaceView | null>;
115
+ getCommunitySpace(communityId: string, spaceId: string, actor: Actor): Promise<SpaceView>;
116
+ listSpaces(communityId: string, actor: Actor): Promise<SpaceView[]>;
117
+ getDmSettings(communityId: string, actor: Actor): Promise<DmSettings | null>;
118
+ createCommunity(input: CreateCommunityInput, actor: Actor): Promise<CommunityView>;
119
+ updateCommunity(id: string, patch: UpdateCommunityInput, actor: Actor): Promise<CommunityView>;
120
+ publishCommunity(id: string, actor: Actor): Promise<CommunityView>;
121
+ unpublishCommunity(id: string, actor: Actor): Promise<CommunityView>;
122
+ deleteCommunity(id: string, actor: Actor): Promise<void>;
123
+ patchCommunitySettings(id: string, patch: PatchCommunitySettingsInput, actor: Actor): Promise<CommunityView>;
124
+ createSpace(communityId: string, input: CreateSpaceInput, actor: Actor): Promise<SpaceView>;
125
+ updateSpace(communityId: string, spaceId: string, patch: UpdateSpaceInput, actor: Actor): Promise<SpaceView>;
126
+ deleteSpace(communityId: string, spaceId: string, actor: Actor): Promise<void>;
127
+ reorderSpaces(communityId: string, orderedIds: string[], actor: Actor): Promise<SpaceView[]>;
128
+ setSpaceTopics(communityId: string, spaceId: string, input: SetSpaceTopicsInput, actor: Actor): Promise<SpaceView>;
129
+ addSpaceLink(communityId: string, spaceId: string, contentId: string, actor: Actor): Promise<SpaceView>;
130
+ removeSpaceLink(communityId: string, spaceId: string, linkId: string, actor: Actor): Promise<SpaceView>;
131
+ reorderSpaceLinks(communityId: string, spaceId: string, orderedIds: string[], actor: Actor): Promise<SpaceView>;
96
132
  }
97
133
  //#endregion
98
134
  export { ContentService, ContentServiceParams };