@headless-lms/core 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/events.d.ts +42 -24
- package/dist/assets/events.js +1 -1
- package/dist/assets/events.js.map +1 -1
- package/dist/assets/file-urls.d.ts +20 -0
- package/dist/assets/file-urls.js +25 -0
- package/dist/assets/file-urls.js.map +1 -0
- package/dist/assets/index.d.ts +6 -4
- package/dist/assets/index.js +4 -2
- package/dist/assets/jobs.d.ts +15 -0
- package/dist/assets/jobs.js +30 -0
- package/dist/assets/jobs.js.map +1 -0
- package/dist/assets/model.d.ts +2 -2
- package/dist/assets/ports.d.ts +46 -15
- package/dist/assets/service.d.ts +38 -7
- package/dist/assets/service.js +287 -38
- package/dist/assets/service.js.map +1 -1
- package/dist/automations/actions.d.ts +13 -24
- package/dist/automations/actions.js +106 -42
- package/dist/automations/actions.js.map +1 -1
- package/dist/automations/catalog.js +226 -3
- package/dist/automations/catalog.js.map +1 -1
- package/dist/automations/community-derivations.d.ts +14 -0
- package/dist/automations/community-derivations.js +439 -0
- package/dist/automations/community-derivations.js.map +1 -0
- package/dist/automations/community-mail.d.ts +98 -0
- package/dist/automations/community-mail.js +70 -0
- package/dist/automations/community-mail.js.map +1 -0
- package/dist/automations/events.d.ts +18 -0
- package/dist/automations/index.d.ts +13 -4
- package/dist/automations/index.js +10 -2
- package/dist/automations/model.d.ts +10 -3
- package/dist/automations/model.js +15 -2
- package/dist/automations/model.js.map +1 -1
- package/dist/automations/notifications/debounce.d.ts +25 -0
- package/dist/automations/notifications/debounce.js +93 -0
- package/dist/automations/notifications/debounce.js.map +1 -0
- package/dist/automations/notifications/defaults.d.ts +8 -0
- package/dist/automations/notifications/defaults.js +316 -0
- package/dist/automations/notifications/defaults.js.map +1 -0
- package/dist/automations/notifications/delivery.d.ts +28 -0
- package/dist/automations/notifications/delivery.js +88 -0
- package/dist/automations/notifications/delivery.js.map +1 -0
- package/dist/automations/notifications/processor.d.ts +64 -0
- package/dist/automations/notifications/processor.js +270 -0
- package/dist/automations/notifications/processor.js.map +1 -0
- package/dist/automations/notifications/rules/content.d.ts +6 -0
- package/dist/automations/notifications/rules/content.js +39 -0
- package/dist/automations/notifications/rules/content.js.map +1 -0
- package/dist/automations/notifications/rules/discussion.d.ts +7 -0
- package/dist/automations/notifications/rules/discussion.js +678 -0
- package/dist/automations/notifications/rules/discussion.js.map +1 -0
- package/dist/automations/notifications/rules/entitlements.d.ts +6 -0
- package/dist/automations/notifications/rules/entitlements.js +249 -0
- package/dist/automations/notifications/rules/entitlements.js.map +1 -0
- package/dist/automations/notifications/rules/index.d.ts +6 -0
- package/dist/automations/notifications/rules/index.js +15 -0
- package/dist/automations/notifications/rules/index.js.map +1 -0
- package/dist/automations/notifications/rules/organizations.d.ts +6 -0
- package/dist/automations/notifications/rules/organizations.js +28 -0
- package/dist/automations/notifications/rules/organizations.js.map +1 -0
- package/dist/automations/notifications/rules/recipients.d.ts +32 -0
- package/dist/automations/notifications/rules/recipients.js +99 -0
- package/dist/automations/notifications/rules/recipients.js.map +1 -0
- package/dist/automations/notifications/service.d.ts +27 -0
- package/dist/automations/notifications/service.js +45 -0
- package/dist/automations/notifications/service.js.map +1 -0
- package/dist/automations/notifications/types.d.ts +7 -0
- package/dist/automations/notifications/types.js +473 -0
- package/dist/automations/notifications/types.js.map +1 -0
- package/dist/automations/ports.d.ts +121 -3
- package/dist/automations/schedule.d.ts +6 -0
- package/dist/automations/schedule.js +41 -0
- package/dist/automations/schedule.js.map +1 -0
- package/dist/automations/service.d.ts +20 -4
- package/dist/automations/service.js +246 -45
- package/dist/automations/service.js.map +1 -1
- package/dist/content/events.d.ts +712 -50
- package/dist/content/events.js +55 -1
- package/dist/content/events.js.map +1 -1
- package/dist/content/index.d.ts +6 -4
- package/dist/content/index.js +3 -1
- package/dist/content/model.d.ts +2 -2
- package/dist/content/notification-categories.d.ts +36 -0
- package/dist/content/notification-categories.js +64 -0
- package/dist/content/notification-categories.js.map +1 -0
- package/dist/content/ports.d.ts +90 -18
- package/dist/content/service.d.ts +57 -18
- package/dist/content/service.js +520 -25
- package/dist/content/service.js.map +1 -1
- package/dist/content/titles.d.ts +22 -0
- package/dist/content/titles.js +69 -0
- package/dist/content/titles.js.map +1 -0
- package/dist/content/types.d.ts +2 -2
- package/dist/discussion/authors.d.ts +10 -0
- package/dist/discussion/authors.js +23 -0
- package/dist/discussion/authors.js.map +1 -0
- package/dist/discussion/chats.d.ts +109 -0
- package/dist/discussion/chats.js +831 -0
- package/dist/discussion/chats.js.map +1 -0
- package/dist/discussion/digests.d.ts +24 -0
- package/dist/discussion/digests.js +104 -0
- package/dist/discussion/digests.js.map +1 -0
- package/dist/discussion/events.d.ts +785 -56
- package/dist/discussion/events.js +165 -5
- package/dist/discussion/events.js.map +1 -1
- package/dist/discussion/index.d.ts +12 -3
- package/dist/discussion/index.js +9 -1
- package/dist/discussion/jobs.d.ts +16 -0
- package/dist/discussion/jobs.js +40 -0
- package/dist/discussion/jobs.js.map +1 -0
- package/dist/discussion/mentions.d.ts +11 -0
- package/dist/discussion/mentions.js +35 -0
- package/dist/discussion/mentions.js.map +1 -0
- package/dist/discussion/ports.d.ts +372 -28
- package/dist/discussion/ports.js +6 -1
- package/dist/discussion/ports.js.map +1 -0
- package/dist/discussion/posts.d.ts +113 -0
- package/dist/discussion/posts.js +775 -0
- package/dist/discussion/posts.js.map +1 -0
- package/dist/discussion/service.d.ts +42 -11
- package/dist/discussion/service.js +364 -85
- package/dist/discussion/service.js.map +1 -1
- package/dist/discussion/subscriptions.d.ts +37 -0
- package/dist/discussion/subscriptions.js +99 -0
- package/dist/discussion/subscriptions.js.map +1 -0
- package/dist/discussion/titles.d.ts +26 -0
- package/dist/discussion/titles.js +84 -0
- package/dist/discussion/titles.js.map +1 -0
- package/dist/entitlements/events.d.ts +178 -11
- package/dist/entitlements/events.js +28 -1
- package/dist/entitlements/events.js.map +1 -1
- package/dist/entitlements/index.d.ts +6 -4
- package/dist/entitlements/index.js +3 -1
- package/dist/entitlements/jobs.d.ts +12 -0
- package/dist/entitlements/jobs.js +18 -0
- package/dist/entitlements/jobs.js.map +1 -0
- package/dist/entitlements/model.d.ts +3 -2
- package/dist/entitlements/ports.d.ts +128 -11
- package/dist/entitlements/rules.d.ts +12 -0
- package/dist/entitlements/rules.js +17 -0
- package/dist/entitlements/rules.js.map +1 -0
- package/dist/entitlements/service.d.ts +57 -3
- package/dist/entitlements/service.js +492 -2
- package/dist/entitlements/service.js.map +1 -1
- package/dist/identity/access.d.ts +6 -0
- package/dist/identity/access.js +7 -0
- package/dist/identity/access.js.map +1 -0
- package/dist/identity/devices.d.ts +30 -0
- package/dist/identity/devices.js +107 -0
- package/dist/identity/devices.js.map +1 -0
- package/dist/identity/events.d.ts +2 -2
- package/dist/identity/index.d.ts +7 -4
- package/dist/identity/index.js +4 -1
- package/dist/identity/model.d.ts +2 -1
- package/dist/identity/notification-settings.d.ts +28 -0
- package/dist/identity/notification-settings.js +113 -0
- package/dist/identity/notification-settings.js.map +1 -0
- package/dist/identity/ports.d.ts +97 -3
- package/dist/identity/service.d.ts +14 -3
- package/dist/identity/service.js +62 -5
- package/dist/identity/service.js.map +1 -1
- package/dist/integrations/events.d.ts +3 -3
- package/dist/integrations/model.js +1 -1
- package/dist/integrations/model.js.map +1 -1
- package/dist/integrations/service.js +2 -2
- package/dist/integrations/service.js.map +1 -1
- package/dist/organizations/access-scopes.d.ts +19 -0
- package/dist/organizations/access-scopes.js +89 -0
- package/dist/organizations/access-scopes.js.map +1 -0
- package/dist/organizations/events.d.ts +75 -33
- package/dist/organizations/events.js +6 -0
- package/dist/organizations/events.js.map +1 -1
- package/dist/organizations/index.d.ts +8 -6
- package/dist/organizations/index.js +5 -3
- package/dist/organizations/members.d.ts +8 -5
- package/dist/organizations/members.js.map +1 -1
- package/dist/organizations/notification-categories.d.ts +32 -0
- package/dist/organizations/notification-categories.js +51 -0
- package/dist/organizations/notification-categories.js.map +1 -0
- package/dist/organizations/ports.d.ts +17 -11
- package/dist/organizations/roles.d.ts +6 -10
- package/dist/organizations/roles.js +19 -7
- package/dist/organizations/roles.js.map +1 -1
- package/dist/organizations/service.d.ts +22 -11
- package/dist/organizations/service.js +164 -47
- package/dist/organizations/service.js.map +1 -1
- package/dist/organizations/types.d.ts +1 -10
- package/dist/progress/events.d.ts +14 -14
- package/dist/progress/index.d.ts +2 -2
- package/dist/progress/ports.d.ts +6 -1
- package/dist/progress/service.d.ts +3 -1
- package/dist/progress/service.js +6 -2
- package/dist/progress/service.js.map +1 -1
- package/dist/reporting/admin/index.d.ts +4 -0
- package/dist/reporting/admin/index.js +2 -0
- package/dist/reporting/admin/model.d.ts +108 -0
- package/dist/reporting/admin/ports.d.ts +27 -0
- package/dist/reporting/admin/service.d.ts +22 -0
- package/dist/reporting/admin/service.js +38 -0
- package/dist/reporting/admin/service.js.map +1 -0
- package/dist/reporting/member/index.d.ts +5 -0
- package/dist/reporting/member/index.js +2 -0
- package/dist/reporting/member/model.d.ts +157 -0
- package/dist/reporting/member/ports.d.ts +48 -0
- package/dist/reporting/member/service.d.ts +92 -0
- package/dist/reporting/member/service.js +364 -0
- package/dist/reporting/member/service.js.map +1 -0
- package/dist/shared/actor.d.ts +9 -0
- package/dist/shared/errors.d.ts +19 -1
- package/dist/shared/errors.js +27 -1
- package/dist/shared/errors.js.map +1 -1
- package/dist/shared/id.d.ts +14 -0
- package/dist/shared/id.js +15 -1
- package/dist/shared/id.js.map +1 -1
- package/dist/shared/mailer.d.ts +15 -2
- package/dist/shared/mailer.js +32 -5
- package/dist/shared/mailer.js.map +1 -1
- package/dist/shared/network.d.ts +10 -0
- package/dist/shared/network.js +211 -0
- package/dist/shared/network.js.map +1 -0
- package/dist/shared/notification-categories.d.ts +16 -0
- package/dist/shared/notification-categories.js +94 -0
- package/dist/shared/notification-categories.js.map +1 -0
- package/dist/shared/notification-settings.d.ts +14 -0
- package/dist/shared/notification-settings.js +61 -0
- package/dist/shared/notification-settings.js.map +1 -0
- package/dist/shared/ports.d.ts +48 -2
- package/dist/shared/settings.d.ts +2 -1
- package/dist/shared/settings.js +1 -0
- package/dist/shared/settings.js.map +1 -1
- package/dist/types/assets.d.ts +2 -2
- package/dist/types/automations.d.ts +15 -1
- package/dist/types/content.d.ts +2 -2
- package/dist/types/discussion.d.ts +11 -3
- package/dist/types/email-templates.d.ts +216 -1
- package/dist/types/entitlements.d.ts +2 -2
- package/dist/types/identity.d.ts +48 -2
- package/dist/types/index.d.ts +9 -8
- package/dist/types/notifications.d.ts +157 -0
- package/dist/types/ports.d.ts +6 -0
- package/dist/types/schemas/assets.d.ts +65 -37
- package/dist/types/schemas/assets.js +17 -12
- package/dist/types/schemas/assets.js.map +1 -1
- package/dist/types/schemas/automations.d.ts +9 -1
- package/dist/types/schemas/automations.js +13 -6
- package/dist/types/schemas/automations.js.map +1 -1
- package/dist/types/schemas/content.d.ts +396 -3
- package/dist/types/schemas/content.js +161 -3
- package/dist/types/schemas/content.js.map +1 -1
- package/dist/types/schemas/discussion.d.ts +443 -3
- package/dist/types/schemas/discussion.js +233 -4
- package/dist/types/schemas/discussion.js.map +1 -1
- package/dist/types/schemas/entitlements.d.ts +36 -2
- package/dist/types/schemas/entitlements.js +23 -1
- package/dist/types/schemas/entitlements.js.map +1 -1
- package/dist/types/schemas/identity.d.ts +27 -1
- package/dist/types/schemas/identity.js +14 -2
- package/dist/types/schemas/identity.js.map +1 -1
- package/dist/types/schemas/index.d.ts +9 -8
- package/dist/types/schemas/index.js +9 -8
- package/dist/types/schemas/notifications.d.ts +95 -0
- package/dist/types/schemas/notifications.js +56 -0
- package/dist/types/schemas/notifications.js.map +1 -0
- package/dist/types/schemas/organizations.d.ts +8 -0
- package/dist/types/schemas/organizations.js +2 -0
- package/dist/types/schemas/organizations.js.map +1 -1
- package/dist/types/schemas/progress.d.ts +3 -3
- package/dist/types/schemas/shared.d.ts +3 -1
- package/dist/types/schemas/shared.js +5 -1
- package/dist/types/schemas/shared.js.map +1 -1
- package/package.json +2 -2
- package/dist/reporting/courses/index.d.ts +0 -4
- package/dist/reporting/courses/index.js +0 -2
- package/dist/reporting/courses/model.d.ts +0 -24
- package/dist/reporting/courses/ports.d.ts +0 -13
- package/dist/reporting/courses/service.d.ts +0 -19
- package/dist/reporting/courses/service.js +0 -20
- package/dist/reporting/courses/service.js.map +0 -1
- package/dist/reporting/dashboard/index.d.ts +0 -4
- package/dist/reporting/dashboard/index.js +0 -2
- package/dist/reporting/dashboard/model.d.ts +0 -14
- package/dist/reporting/dashboard/ports.d.ts +0 -13
- package/dist/reporting/dashboard/service.d.ts +0 -19
- package/dist/reporting/dashboard/service.js +0 -20
- package/dist/reporting/dashboard/service.js.map +0 -1
- package/dist/reporting/learn/index.d.ts +0 -5
- package/dist/reporting/learn/index.js +0 -2
- package/dist/reporting/learn/model.d.ts +0 -23
- package/dist/reporting/learn/ports.d.ts +0 -43
- package/dist/reporting/learn/service.d.ts +0 -49
- package/dist/reporting/learn/service.js +0 -116
- package/dist/reporting/learn/service.js.map +0 -1
- package/dist/reporting/students/index.d.ts +0 -4
- package/dist/reporting/students/index.js +0 -2
- package/dist/reporting/students/model.d.ts +0 -51
- package/dist/reporting/students/model.js +0 -1
- package/dist/reporting/students/ports.d.ts +0 -15
- package/dist/reporting/students/ports.js +0 -1
- package/dist/reporting/students/service.d.ts +0 -20
- package/dist/reporting/students/service.js +0 -23
- package/dist/reporting/students/service.js.map +0 -1
- /package/dist/reporting/{courses → admin}/model.js +0 -0
- /package/dist/reporting/{courses → admin}/ports.js +0 -0
- /package/dist/reporting/{dashboard → member}/model.js +0 -0
- /package/dist/reporting/{dashboard → member}/ports.js +0 -0
- /package/dist/{reporting/learn/model.js → shared/actor.js} +0 -0
- /package/dist/{reporting/learn/ports.js → types/notifications.js} +0 -0
package/dist/content/events.js
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { idSchema } from "../types/schemas/shared.js";
|
|
2
|
-
import { activitySchema, bundleItemSchema, bundleSchema, courseSchema, downloadAssetSchema, downloadSchema, moduleSchema } from "../types/schemas/content.js";
|
|
2
|
+
import { activitySchema, bundleItemSchema, bundleSchema, communitySchema, courseSchema, downloadAssetSchema, downloadSchema, moduleSchema, spaceDetailSchema } from "../types/schemas/content.js";
|
|
3
3
|
import { defineEvent } from "../shared/events.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#region src/content/events.ts
|
|
6
|
+
const activityPublishedSchema = z.object({
|
|
7
|
+
activityId: idSchema,
|
|
8
|
+
moduleId: idSchema,
|
|
9
|
+
courseId: idSchema
|
|
10
|
+
}).strict();
|
|
6
11
|
const downloadAssetsEventSchema = z.object({
|
|
7
12
|
downloadId: idSchema,
|
|
8
13
|
assets: z.array(downloadAssetSchema)
|
|
@@ -66,6 +71,7 @@ const publicDownloadAsset = downloadAssetSchema.pick({
|
|
|
66
71
|
createdAt: true,
|
|
67
72
|
updatedAt: true
|
|
68
73
|
}).strip();
|
|
74
|
+
const publicCommunity = communitySchema.omit({ settings: true }).strip();
|
|
69
75
|
const publicDownloadAssets = z.object({
|
|
70
76
|
downloadId: idSchema,
|
|
71
77
|
assets: z.array(publicDownloadAsset)
|
|
@@ -131,6 +137,12 @@ const contentEvents = {
|
|
|
131
137
|
data: activitySchema,
|
|
132
138
|
publicData: publicActivity
|
|
133
139
|
}),
|
|
140
|
+
activityPublished: defineEvent({
|
|
141
|
+
type: "content.course.activity.published",
|
|
142
|
+
version: 1,
|
|
143
|
+
data: activityPublishedSchema,
|
|
144
|
+
publicData: activityPublishedSchema
|
|
145
|
+
}),
|
|
134
146
|
activitiesReordered: defineEvent({
|
|
135
147
|
type: "content.course.activities.reordered",
|
|
136
148
|
version: 1,
|
|
@@ -203,6 +215,48 @@ const contentEvents = {
|
|
|
203
215
|
type: "content.bundle.item.removed",
|
|
204
216
|
version: 1,
|
|
205
217
|
data: bundleItemsEventSchema
|
|
218
|
+
}),
|
|
219
|
+
communityCreated: defineEvent({
|
|
220
|
+
type: "content.community.created",
|
|
221
|
+
version: 1,
|
|
222
|
+
data: communitySchema,
|
|
223
|
+
publicData: publicCommunity
|
|
224
|
+
}),
|
|
225
|
+
communityUpdated: defineEvent({
|
|
226
|
+
type: "content.community.updated",
|
|
227
|
+
version: 1,
|
|
228
|
+
data: communitySchema,
|
|
229
|
+
publicData: publicCommunity
|
|
230
|
+
}),
|
|
231
|
+
communityDeleted: defineEvent({
|
|
232
|
+
type: "content.community.deleted",
|
|
233
|
+
version: 1,
|
|
234
|
+
data: communitySchema,
|
|
235
|
+
publicData: publicCommunity
|
|
236
|
+
}),
|
|
237
|
+
spaceCreated: defineEvent({
|
|
238
|
+
type: "content.community.space.created",
|
|
239
|
+
version: 1,
|
|
240
|
+
data: spaceDetailSchema,
|
|
241
|
+
publicData: spaceDetailSchema
|
|
242
|
+
}),
|
|
243
|
+
spaceUpdated: defineEvent({
|
|
244
|
+
type: "content.community.space.updated",
|
|
245
|
+
version: 1,
|
|
246
|
+
data: spaceDetailSchema,
|
|
247
|
+
publicData: spaceDetailSchema
|
|
248
|
+
}),
|
|
249
|
+
spaceDeleted: defineEvent({
|
|
250
|
+
type: "content.community.space.deleted",
|
|
251
|
+
version: 1,
|
|
252
|
+
data: spaceDetailSchema,
|
|
253
|
+
publicData: spaceDetailSchema
|
|
254
|
+
}),
|
|
255
|
+
spacesReordered: defineEvent({
|
|
256
|
+
type: "content.community.spaces.reordered",
|
|
257
|
+
version: 1,
|
|
258
|
+
data: z.array(spaceDetailSchema),
|
|
259
|
+
publicData: z.array(spaceDetailSchema)
|
|
206
260
|
})
|
|
207
261
|
};
|
|
208
262
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","names":[],"sources":["../../src/content/events.ts"],"sourcesContent":["import { z } from 'zod';\nimport {\n activitySchema,\n bundleItemSchema,\n bundleSchema,\n courseSchema,\n downloadAssetSchema,\n downloadSchema,\n idSchema,\n moduleSchema,\n} from '../types/schemas/index.js';\nimport { defineEvent, type EventOf, type EventOfValues } from '../shared/ports.js';\n\nconst downloadAssetsEventSchema = z\n .object({\n downloadId: idSchema,\n assets: z.array(downloadAssetSchema),\n })\n .strict();\n\nconst bundleItemsEventSchema = z\n .object({\n bundleId: idSchema,\n items: z.array(bundleItemSchema),\n })\n .strict();\n\nconst publicCourse = courseSchema\n .pick({\n orgId: true,\n id: true,\n type: true,\n title: true,\n slug: true,\n description: true,\n status: true,\n category: true,\n thumbnailAssetId: true,\n settings: true,\n createdAt: true,\n updatedAt: true,\n })\n .strip();\n\nconst publicModule = moduleSchema\n .pick({\n orgId: true,\n id: true,\n courseId: true,\n title: true,\n seq: true,\n createdAt: true,\n updatedAt: true,\n })\n .strip();\n\nconst publicActivity = activitySchema\n .pick({\n orgId: true,\n id: true,\n moduleId: true,\n courseId: true,\n seq: true,\n createdAt: true,\n updatedAt: true,\n })\n .strip();\n\nconst publicDownload = downloadSchema\n .pick({\n orgId: true,\n id: true,\n type: true,\n title: true,\n slug: true,\n description: true,\n status: true,\n category: true,\n thumbnailAssetId: true,\n createdAt: true,\n updatedAt: true,\n })\n .strip();\n\nconst publicDownloadAsset = downloadAssetSchema\n .pick({\n orgId: true,\n id: true,\n downloadId: true,\n assetId: true,\n seq: true,\n displayName: true,\n createdAt: true,\n updatedAt: true,\n })\n .strip();\n\nconst publicDownloadAssets = z.object({\n downloadId: idSchema,\n assets: z.array(publicDownloadAsset),\n});\n\nexport const contentEvents = {\n courseCreated: defineEvent({\n type: 'content.course.created',\n version: 1,\n data: courseSchema,\n publicData: publicCourse,\n }),\n courseUpdated: defineEvent({\n type: 'content.course.updated',\n version: 1,\n data: courseSchema,\n publicData: publicCourse,\n }),\n courseDeleted: defineEvent({\n type: 'content.course.deleted',\n version: 1,\n data: courseSchema,\n publicData: publicCourse,\n }),\n moduleCreated: defineEvent({\n type: 'content.course.module.created',\n version: 1,\n data: moduleSchema,\n publicData: publicModule,\n }),\n moduleUpdated: defineEvent({\n type: 'content.course.module.updated',\n version: 1,\n data: moduleSchema,\n publicData: publicModule,\n }),\n moduleDeleted: defineEvent({\n type: 'content.course.module.deleted',\n version: 1,\n data: moduleSchema,\n publicData: publicModule,\n }),\n modulesReordered: defineEvent({\n type: 'content.course.modules.reordered',\n version: 1,\n data: z.array(moduleSchema),\n publicData: z.array(publicModule),\n }),\n activityCreated: defineEvent({\n type: 'content.course.activity.created',\n version: 1,\n data: activitySchema,\n publicData: publicActivity,\n }),\n activityUpdated: defineEvent({\n type: 'content.course.activity.updated',\n version: 1,\n data: activitySchema,\n publicData: publicActivity,\n }),\n activityDeleted: defineEvent({\n type: 'content.course.activity.deleted',\n version: 1,\n data: activitySchema,\n publicData: publicActivity,\n }),\n activitiesReordered: defineEvent({\n type: 'content.course.activities.reordered',\n version: 1,\n data: moduleSchema,\n publicData: publicModule,\n }),\n downloadCreated: defineEvent({\n type: 'content.download.created',\n version: 1,\n data: downloadSchema,\n publicData: publicDownload,\n }),\n downloadUpdated: defineEvent({\n type: 'content.download.updated',\n version: 1,\n data: downloadSchema,\n publicData: publicDownload,\n }),\n downloadDeleted: defineEvent({\n type: 'content.download.deleted',\n version: 1,\n data: downloadSchema,\n publicData: publicDownload,\n }),\n downloadAssetAdded: defineEvent({\n type: 'content.download.asset.added',\n version: 1,\n data: downloadAssetsEventSchema,\n publicData: publicDownloadAssets,\n }),\n downloadAssetRemoved: defineEvent({\n type: 'content.download.asset.removed',\n version: 1,\n data: downloadAssetsEventSchema,\n publicData: publicDownloadAssets,\n }),\n downloadAssetRenamed: defineEvent({\n type: 'content.download.asset.renamed',\n version: 1,\n data: downloadAssetsEventSchema,\n publicData: publicDownloadAssets,\n }),\n downloadAssetsReordered: defineEvent({\n type: 'content.download.assets.reordered',\n version: 1,\n data: downloadAssetsEventSchema,\n publicData: publicDownloadAssets,\n }),\n bundleCreated: defineEvent({\n type: 'content.bundle.created',\n version: 1,\n data: bundleSchema,\n }),\n bundleUpdated: defineEvent({\n type: 'content.bundle.updated',\n version: 1,\n data: bundleSchema,\n }),\n bundleDeleted: defineEvent({\n type: 'content.bundle.deleted',\n version: 1,\n data: bundleSchema,\n }),\n bundleItemAdded: defineEvent({\n type: 'content.bundle.item.added',\n version: 1,\n data: bundleItemsEventSchema,\n }),\n bundleItemRemoved: defineEvent({\n type: 'content.bundle.item.removed',\n version: 1,\n data: bundleItemsEventSchema,\n }),\n};\n\nexport type CourseCreated = EventOf<typeof contentEvents.courseCreated>;\nexport type CourseUpdated = EventOf<typeof contentEvents.courseUpdated>;\nexport type CourseDeleted = EventOf<typeof contentEvents.courseDeleted>;\nexport type CourseModuleCreated = EventOf<typeof contentEvents.moduleCreated>;\nexport type CourseModuleUpdated = EventOf<typeof contentEvents.moduleUpdated>;\nexport type CourseModuleDeleted = EventOf<typeof contentEvents.moduleDeleted>;\nexport type CourseModulesReordered = EventOf<typeof contentEvents.modulesReordered>;\nexport type CourseActivityCreated = EventOf<typeof contentEvents.activityCreated>;\nexport type CourseActivityUpdated = EventOf<typeof contentEvents.activityUpdated>;\nexport type CourseActivityDeleted = EventOf<typeof contentEvents.activityDeleted>;\nexport type CourseActivitiesReordered = EventOf<typeof contentEvents.activitiesReordered>;\nexport type DownloadCreated = EventOf<typeof contentEvents.downloadCreated>;\nexport type DownloadUpdated = EventOf<typeof contentEvents.downloadUpdated>;\nexport type DownloadDeleted = EventOf<typeof contentEvents.downloadDeleted>;\nexport type DownloadAssetAdded = EventOf<typeof contentEvents.downloadAssetAdded>;\nexport type DownloadAssetRemoved = EventOf<typeof contentEvents.downloadAssetRemoved>;\nexport type DownloadAssetRenamed = EventOf<typeof contentEvents.downloadAssetRenamed>;\nexport type DownloadAssetsReordered = EventOf<typeof contentEvents.downloadAssetsReordered>;\nexport type BundleCreated = EventOf<typeof contentEvents.bundleCreated>;\nexport type BundleUpdated = EventOf<typeof contentEvents.bundleUpdated>;\nexport type BundleDeleted = EventOf<typeof contentEvents.bundleDeleted>;\nexport type BundleItemAdded = EventOf<typeof contentEvents.bundleItemAdded>;\nexport type BundleItemRemoved = EventOf<typeof contentEvents.bundleItemRemoved>;\nexport type ContentEvent = EventOfValues<typeof contentEvents>;\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"events.js","names":[],"sources":["../../src/content/events.ts"],"sourcesContent":["import { z } from 'zod';\nimport {\n activitySchema,\n bundleItemSchema,\n bundleSchema,\n communitySchema,\n courseSchema,\n downloadAssetSchema,\n downloadSchema,\n idSchema,\n moduleSchema,\n spaceDetailSchema,\n} from '../types/schemas/index.js';\nimport { defineEvent, type EventOf, type EventOfValues } from '../shared/ports.js';\n\nconst activityPublishedSchema = z\n .object({ activityId: idSchema, moduleId: idSchema, courseId: idSchema })\n .strict();\n\nconst downloadAssetsEventSchema = z\n .object({\n downloadId: idSchema,\n assets: z.array(downloadAssetSchema),\n })\n .strict();\n\nconst bundleItemsEventSchema = z\n .object({\n bundleId: idSchema,\n items: z.array(bundleItemSchema),\n })\n .strict();\n\nconst publicCourse = courseSchema\n .pick({\n orgId: true,\n id: true,\n type: true,\n title: true,\n slug: true,\n description: true,\n status: true,\n category: true,\n thumbnailAssetId: true,\n settings: true,\n createdAt: true,\n updatedAt: true,\n })\n .strip();\n\nconst publicModule = moduleSchema\n .pick({\n orgId: true,\n id: true,\n courseId: true,\n title: true,\n seq: true,\n createdAt: true,\n updatedAt: true,\n })\n .strip();\n\nconst publicActivity = activitySchema\n .pick({\n orgId: true,\n id: true,\n moduleId: true,\n courseId: true,\n seq: true,\n createdAt: true,\n updatedAt: true,\n })\n .strip();\n\nconst publicDownload = downloadSchema\n .pick({\n orgId: true,\n id: true,\n type: true,\n title: true,\n slug: true,\n description: true,\n status: true,\n category: true,\n thumbnailAssetId: true,\n createdAt: true,\n updatedAt: true,\n })\n .strip();\n\nconst publicDownloadAsset = downloadAssetSchema\n .pick({\n orgId: true,\n id: true,\n downloadId: true,\n assetId: true,\n seq: true,\n displayName: true,\n createdAt: true,\n updatedAt: true,\n })\n .strip();\n\nconst publicCommunity = communitySchema.omit({ settings: true }).strip();\n\nconst publicDownloadAssets = z.object({\n downloadId: idSchema,\n assets: z.array(publicDownloadAsset),\n});\n\nexport const contentEvents = {\n courseCreated: defineEvent({\n type: 'content.course.created',\n version: 1,\n data: courseSchema,\n publicData: publicCourse,\n }),\n courseUpdated: defineEvent({\n type: 'content.course.updated',\n version: 1,\n data: courseSchema,\n publicData: publicCourse,\n }),\n courseDeleted: defineEvent({\n type: 'content.course.deleted',\n version: 1,\n data: courseSchema,\n publicData: publicCourse,\n }),\n moduleCreated: defineEvent({\n type: 'content.course.module.created',\n version: 1,\n data: moduleSchema,\n publicData: publicModule,\n }),\n moduleUpdated: defineEvent({\n type: 'content.course.module.updated',\n version: 1,\n data: moduleSchema,\n publicData: publicModule,\n }),\n moduleDeleted: defineEvent({\n type: 'content.course.module.deleted',\n version: 1,\n data: moduleSchema,\n publicData: publicModule,\n }),\n modulesReordered: defineEvent({\n type: 'content.course.modules.reordered',\n version: 1,\n data: z.array(moduleSchema),\n publicData: z.array(publicModule),\n }),\n activityCreated: defineEvent({\n type: 'content.course.activity.created',\n version: 1,\n data: activitySchema,\n publicData: publicActivity,\n }),\n activityUpdated: defineEvent({\n type: 'content.course.activity.updated',\n version: 1,\n data: activitySchema,\n publicData: publicActivity,\n }),\n activityDeleted: defineEvent({\n type: 'content.course.activity.deleted',\n version: 1,\n data: activitySchema,\n publicData: publicActivity,\n }),\n activityPublished: defineEvent({\n type: 'content.course.activity.published',\n version: 1,\n data: activityPublishedSchema,\n publicData: activityPublishedSchema,\n }),\n activitiesReordered: defineEvent({\n type: 'content.course.activities.reordered',\n version: 1,\n data: moduleSchema,\n publicData: publicModule,\n }),\n downloadCreated: defineEvent({\n type: 'content.download.created',\n version: 1,\n data: downloadSchema,\n publicData: publicDownload,\n }),\n downloadUpdated: defineEvent({\n type: 'content.download.updated',\n version: 1,\n data: downloadSchema,\n publicData: publicDownload,\n }),\n downloadDeleted: defineEvent({\n type: 'content.download.deleted',\n version: 1,\n data: downloadSchema,\n publicData: publicDownload,\n }),\n downloadAssetAdded: defineEvent({\n type: 'content.download.asset.added',\n version: 1,\n data: downloadAssetsEventSchema,\n publicData: publicDownloadAssets,\n }),\n downloadAssetRemoved: defineEvent({\n type: 'content.download.asset.removed',\n version: 1,\n data: downloadAssetsEventSchema,\n publicData: publicDownloadAssets,\n }),\n downloadAssetRenamed: defineEvent({\n type: 'content.download.asset.renamed',\n version: 1,\n data: downloadAssetsEventSchema,\n publicData: publicDownloadAssets,\n }),\n downloadAssetsReordered: defineEvent({\n type: 'content.download.assets.reordered',\n version: 1,\n data: downloadAssetsEventSchema,\n publicData: publicDownloadAssets,\n }),\n bundleCreated: defineEvent({\n type: 'content.bundle.created',\n version: 1,\n data: bundleSchema,\n }),\n bundleUpdated: defineEvent({\n type: 'content.bundle.updated',\n version: 1,\n data: bundleSchema,\n }),\n bundleDeleted: defineEvent({\n type: 'content.bundle.deleted',\n version: 1,\n data: bundleSchema,\n }),\n bundleItemAdded: defineEvent({\n type: 'content.bundle.item.added',\n version: 1,\n data: bundleItemsEventSchema,\n }),\n bundleItemRemoved: defineEvent({\n type: 'content.bundle.item.removed',\n version: 1,\n data: bundleItemsEventSchema,\n }),\n communityCreated: defineEvent({\n type: 'content.community.created',\n version: 1,\n data: communitySchema,\n publicData: publicCommunity,\n }),\n communityUpdated: defineEvent({\n type: 'content.community.updated',\n version: 1,\n data: communitySchema,\n publicData: publicCommunity,\n }),\n communityDeleted: defineEvent({\n type: 'content.community.deleted',\n version: 1,\n data: communitySchema,\n publicData: publicCommunity,\n }),\n spaceCreated: defineEvent({\n type: 'content.community.space.created',\n version: 1,\n data: spaceDetailSchema,\n publicData: spaceDetailSchema,\n }),\n spaceUpdated: defineEvent({\n type: 'content.community.space.updated',\n version: 1,\n data: spaceDetailSchema,\n publicData: spaceDetailSchema,\n }),\n spaceDeleted: defineEvent({\n type: 'content.community.space.deleted',\n version: 1,\n data: spaceDetailSchema,\n publicData: spaceDetailSchema,\n }),\n spacesReordered: defineEvent({\n type: 'content.community.spaces.reordered',\n version: 1,\n data: z.array(spaceDetailSchema),\n publicData: z.array(spaceDetailSchema),\n }),\n};\n\nexport type CourseCreated = EventOf<typeof contentEvents.courseCreated>;\nexport type CourseUpdated = EventOf<typeof contentEvents.courseUpdated>;\nexport type CourseDeleted = EventOf<typeof contentEvents.courseDeleted>;\nexport type CourseModuleCreated = EventOf<typeof contentEvents.moduleCreated>;\nexport type CourseModuleUpdated = EventOf<typeof contentEvents.moduleUpdated>;\nexport type CourseModuleDeleted = EventOf<typeof contentEvents.moduleDeleted>;\nexport type CourseModulesReordered = EventOf<typeof contentEvents.modulesReordered>;\nexport type CourseActivityCreated = EventOf<typeof contentEvents.activityCreated>;\nexport type CourseActivityUpdated = EventOf<typeof contentEvents.activityUpdated>;\nexport type CourseActivityDeleted = EventOf<typeof contentEvents.activityDeleted>;\nexport type CourseActivityPublished = EventOf<typeof contentEvents.activityPublished>;\nexport type CourseActivitiesReordered = EventOf<typeof contentEvents.activitiesReordered>;\nexport type DownloadCreated = EventOf<typeof contentEvents.downloadCreated>;\nexport type DownloadUpdated = EventOf<typeof contentEvents.downloadUpdated>;\nexport type DownloadDeleted = EventOf<typeof contentEvents.downloadDeleted>;\nexport type DownloadAssetAdded = EventOf<typeof contentEvents.downloadAssetAdded>;\nexport type DownloadAssetRemoved = EventOf<typeof contentEvents.downloadAssetRemoved>;\nexport type DownloadAssetRenamed = EventOf<typeof contentEvents.downloadAssetRenamed>;\nexport type DownloadAssetsReordered = EventOf<typeof contentEvents.downloadAssetsReordered>;\nexport type BundleCreated = EventOf<typeof contentEvents.bundleCreated>;\nexport type BundleUpdated = EventOf<typeof contentEvents.bundleUpdated>;\nexport type BundleDeleted = EventOf<typeof contentEvents.bundleDeleted>;\nexport type BundleItemAdded = EventOf<typeof contentEvents.bundleItemAdded>;\nexport type BundleItemRemoved = EventOf<typeof contentEvents.bundleItemRemoved>;\nexport type CommunityCreated = EventOf<typeof contentEvents.communityCreated>;\nexport type CommunityUpdated = EventOf<typeof contentEvents.communityUpdated>;\nexport type CommunityDeleted = EventOf<typeof contentEvents.communityDeleted>;\nexport type CommunitySpaceCreated = EventOf<typeof contentEvents.spaceCreated>;\nexport type CommunitySpaceUpdated = EventOf<typeof contentEvents.spaceUpdated>;\nexport type CommunitySpaceDeleted = EventOf<typeof contentEvents.spaceDeleted>;\nexport type CommunitySpacesReordered = EventOf<typeof contentEvents.spacesReordered>;\nexport type ContentEvent = EventOfValues<typeof contentEvents>;\n"],"mappings":"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"}
|
package/dist/content/index.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Page } from "../types/shared.js";
|
|
2
|
-
import { Activity, ActivityAsset, AddDownloadAssetInput, Bundle, BundleItem, Course, CourseSettings, CourseStatus, CreateBundleInput, CreateCourseInput, CreateDownloadInput, Download, DownloadAsset, DownloadStatus, ListBundlesQuery, ListCoursesQuery, ListDownloadsQuery, Module, ReorderDownloadAssetsInput, SaveActivityInput, UpdateBundleInput, UpdateCourseInput, UpdateDownloadInput } from "../types/schemas/content.js";
|
|
3
|
-
import { BundleCreated, BundleDeleted, BundleItemAdded, BundleItemRemoved, BundleUpdated, ContentEvent, CourseActivitiesReordered, CourseActivityCreated, CourseActivityDeleted, CourseActivityUpdated, CourseCreated, CourseDeleted, CourseModuleCreated, CourseModuleDeleted, CourseModuleUpdated, CourseModulesReordered, CourseUpdated, DownloadCreated, DownloadDeleted, DownloadUpdated, contentEvents } from "./events.js";
|
|
2
|
+
import { Activity, ActivityAsset, ActivityView, AddDownloadAssetInput, Bundle, BundleItem, Community, CommunityStatus, CommunityView, Course, CourseSettings, CourseStatus, CourseView, CreateBundleInput, CreateCommunityInput, CreateCourseInput, CreateDownloadInput, CreateSpaceInput, DigestSchedule, DmSettings, Download, DownloadAsset, DownloadFile, DownloadStatus, DownloadView, ListBundlesQuery, ListCommunitiesQuery, ListCoursesQuery, ListDownloadsQuery, Module, PatchCommunitySettingsInput, PatchDmSettingsInput, ReorderDownloadAssetsInput, SaveActivityInput, SetSpaceTopicsInput, Space, SpaceAccessRule, SpaceDetail, SpaceLink, SpaceTopic, UpdateBundleInput, UpdateCommunityInput, UpdateCourseInput, UpdateDownloadInput, UpdateSpaceInput } from "../types/schemas/content.js";
|
|
4
3
|
import "./model.js";
|
|
5
4
|
import "./types.js";
|
|
6
|
-
import { BundlesService, ContentRepository, ContentService as ContentService$1, CourseManagementService, DownloadablesService } from "./ports.js";
|
|
5
|
+
import { BundlesService, CommunitiesService, CommunityDigest, CommunityReader, ContentRepository, ContentService as ContentService$1, CourseManagementService, DownloadablesService, ItemTitle, ItemTitleAccess, ItemTitles, SpaceRowLock } from "./ports.js";
|
|
7
6
|
import { ContentService } from "./service.js";
|
|
8
|
-
|
|
7
|
+
import { CommunityNotificationCategories } from "./notification-categories.js";
|
|
8
|
+
import { ContentItemTitles, activityTitle } from "./titles.js";
|
|
9
|
+
import { BundleCreated, BundleDeleted, BundleItemAdded, BundleItemRemoved, BundleUpdated, CommunityCreated, CommunityDeleted, CommunitySpaceCreated, CommunitySpaceDeleted, CommunitySpaceUpdated, CommunitySpacesReordered, CommunityUpdated, ContentEvent, CourseActivitiesReordered, CourseActivityCreated, CourseActivityDeleted, CourseActivityPublished, CourseActivityUpdated, CourseCreated, CourseDeleted, CourseModuleCreated, CourseModuleDeleted, CourseModuleUpdated, CourseModulesReordered, CourseUpdated, DownloadCreated, DownloadDeleted, DownloadUpdated, contentEvents } from "./events.js";
|
|
10
|
+
export { type Activity, type ActivityAsset, type ActivityView, type AddDownloadAssetInput, type Bundle, type BundleCreated, type BundleDeleted, type BundleItem, type BundleItemAdded, type BundleItemRemoved, type BundleUpdated, type BundlesService, type CommunitiesService, type Community, type CommunityCreated, type CommunityDeleted, type CommunityDigest, CommunityNotificationCategories, type CommunityReader, type CommunitySpaceCreated, type CommunitySpaceDeleted, type CommunitySpaceUpdated, type CommunitySpacesReordered, type CommunityStatus, type CommunityUpdated, type CommunityView, type ContentEvent, ContentItemTitles, type ContentRepository, ContentService, type ContentService$1 as ContentServicePort, type Course, type CourseActivitiesReordered, type CourseActivityCreated, type CourseActivityDeleted, type CourseActivityPublished, type CourseActivityUpdated, type CourseCreated, type CourseDeleted, type CourseManagementService, type CourseModuleCreated, type CourseModuleDeleted, type CourseModuleUpdated, type CourseModulesReordered, type CourseSettings, type CourseStatus, type CourseUpdated, type CourseView, type CreateBundleInput, type CreateCommunityInput, type CreateCourseInput, type CreateDownloadInput, type CreateSpaceInput, type DigestSchedule, type DmSettings, type Download, type DownloadAsset, type DownloadCreated, type DownloadDeleted, type DownloadFile, type DownloadStatus, type DownloadUpdated, type DownloadView, type DownloadablesService, type ItemTitle, type ItemTitleAccess, type ItemTitles, type ListBundlesQuery, type ListCommunitiesQuery, type ListCoursesQuery, type ListDownloadsQuery, type Module, type Page, type PatchCommunitySettingsInput, type PatchDmSettingsInput, type ReorderDownloadAssetsInput, type SaveActivityInput, type SetSpaceTopicsInput, type Space, type SpaceAccessRule, type SpaceDetail, type SpaceLink, type SpaceRowLock, type SpaceTopic, type UpdateBundleInput, type UpdateCommunityInput, type UpdateCourseInput, type UpdateDownloadInput, type UpdateSpaceInput, activityTitle, contentEvents };
|
package/dist/content/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { contentEvents } from "./events.js";
|
|
2
2
|
import { ContentService } from "./service.js";
|
|
3
|
-
|
|
3
|
+
import { CommunityNotificationCategories } from "./notification-categories.js";
|
|
4
|
+
import { ContentItemTitles, activityTitle } from "./titles.js";
|
|
5
|
+
export { CommunityNotificationCategories, ContentItemTitles, ContentService, activityTitle, contentEvents };
|
package/dist/content/model.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Activity, ActivityAsset, ActivitySettings, Bundle, BundleItem, ContentItem, ContentType, Course, CourseSettings, CourseStatus, Download, DownloadAsset, DownloadStatus, Module, SaveActivityInput } from "../types/schemas/content.js";
|
|
1
|
+
import { Activity, ActivityAsset, ActivitySettings, ActivityView, Bundle, BundleItem, Community, CommunitySettings, CommunityStatus, CommunityView, ContentItem, ContentType, Course, CourseSettings, CourseStatus, CourseView, DigestSchedule, DmSettings, Download, DownloadAsset, DownloadFile, DownloadStatus, DownloadView, Module, SaveActivityInput, Space, SpaceAccessRule, SpaceDetail, SpaceLink, SpaceSettings, SpaceTopic } from "../types/schemas/content.js";
|
|
2
2
|
import "../types/index.js";
|
|
3
|
-
export type { Activity, ActivityAsset, ActivitySettings, Bundle, BundleItem, ContentItem, ContentType, Course, CourseSettings, CourseStatus, Download, DownloadAsset, DownloadStatus, Module, SaveActivityInput };
|
|
3
|
+
export type { Activity, ActivityAsset, ActivitySettings, ActivityView, Bundle, BundleItem, Community, CommunitySettings, CommunityStatus, CommunityView, ContentItem, ContentType, Course, CourseSettings, CourseStatus, CourseView, DigestSchedule, DmSettings, Download, DownloadAsset, DownloadFile, DownloadStatus, DownloadView, Module, SaveActivityInput, Space, SpaceAccessRule, SpaceDetail, SpaceLink, SpaceSettings, SpaceTopic };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Logger } from "../types/ports.js";
|
|
2
|
+
import { NotificationCategory } from "../types/notifications.js";
|
|
3
|
+
import "../types/index.js";
|
|
4
|
+
import { ChannelRegistry, NotificationCategoryService, NotificationTypeRegistry } from "../shared/ports.js";
|
|
5
|
+
import { ContentRepository } from "./ports.js";
|
|
6
|
+
import { SettingsService } from "../shared/settings.js";
|
|
7
|
+
//#region src/content/notification-categories.d.ts
|
|
8
|
+
type CommunityNotificationCategoriesParams = {
|
|
9
|
+
communities: Pick<ContentRepository, 'findCommunityById'>;
|
|
10
|
+
settings: SettingsService;
|
|
11
|
+
types: NotificationTypeRegistry;
|
|
12
|
+
channels: ChannelRegistry;
|
|
13
|
+
logger?: Logger;
|
|
14
|
+
};
|
|
15
|
+
declare class CommunityNotificationCategories implements NotificationCategoryService {
|
|
16
|
+
private readonly communities;
|
|
17
|
+
private readonly settings;
|
|
18
|
+
private readonly types;
|
|
19
|
+
private readonly channels;
|
|
20
|
+
private readonly logger;
|
|
21
|
+
constructor(params: CommunityNotificationCategoriesParams);
|
|
22
|
+
get(orgId: string, communityId: string): Promise<{
|
|
23
|
+
categories: NotificationCategory[];
|
|
24
|
+
source: 'default' | 'stored';
|
|
25
|
+
}>;
|
|
26
|
+
replace(orgId: string, communityId: string, categories: NotificationCategory[]): Promise<{
|
|
27
|
+
categories: NotificationCategory[];
|
|
28
|
+
source: 'stored';
|
|
29
|
+
}>;
|
|
30
|
+
reset(orgId: string, communityId: string): Promise<void>;
|
|
31
|
+
defaults(): NotificationCategory[];
|
|
32
|
+
private assertCommunity;
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
export { CommunityNotificationCategories, CommunityNotificationCategoriesParams };
|
|
36
|
+
//# sourceMappingURL=notification-categories.d.ts.map
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { NotFoundError } from "../shared/errors.js";
|
|
2
|
+
import { noopLogger } from "../shared/logger.js";
|
|
3
|
+
import "../shared/settings.js";
|
|
4
|
+
import { assertValidCategoryList, offeringConfigured, storedCategoryList } from "../shared/notification-categories.js";
|
|
5
|
+
//#region src/content/notification-categories.ts
|
|
6
|
+
var CommunityNotificationCategories = class {
|
|
7
|
+
communities;
|
|
8
|
+
settings;
|
|
9
|
+
types;
|
|
10
|
+
channels;
|
|
11
|
+
logger;
|
|
12
|
+
constructor(params) {
|
|
13
|
+
this.communities = params.communities;
|
|
14
|
+
this.settings = params.settings;
|
|
15
|
+
this.types = params.types;
|
|
16
|
+
this.channels = params.channels;
|
|
17
|
+
this.logger = params.logger ?? noopLogger;
|
|
18
|
+
}
|
|
19
|
+
async get(orgId, communityId) {
|
|
20
|
+
await this.assertCommunity(orgId, communityId);
|
|
21
|
+
const stored = storedCategoryList((await this.settings.get(orgId, "content", communityId))?.notificationCategories);
|
|
22
|
+
return stored ? {
|
|
23
|
+
categories: offeringConfigured(stored, this.channels.list()),
|
|
24
|
+
source: "stored"
|
|
25
|
+
} : {
|
|
26
|
+
categories: this.defaults(),
|
|
27
|
+
source: "default"
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
async replace(orgId, communityId, categories) {
|
|
31
|
+
await this.assertCommunity(orgId, communityId);
|
|
32
|
+
const configured = this.channels.list();
|
|
33
|
+
assertValidCategoryList(categories, "community", this.types, configured);
|
|
34
|
+
const ordered = offeringConfigured(categories, configured);
|
|
35
|
+
await this.settings.patch(orgId, "content", communityId, { notificationCategories: ordered });
|
|
36
|
+
this.logger.info("community notification categories replaced", {
|
|
37
|
+
orgId,
|
|
38
|
+
communityId,
|
|
39
|
+
keys: categories.map((category) => category.key)
|
|
40
|
+
});
|
|
41
|
+
return {
|
|
42
|
+
categories: ordered,
|
|
43
|
+
source: "stored"
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
async reset(orgId, communityId) {
|
|
47
|
+
await this.assertCommunity(orgId, communityId);
|
|
48
|
+
await this.settings.patch(orgId, "content", communityId, { notificationCategories: null });
|
|
49
|
+
this.logger.info("community notification categories reset", {
|
|
50
|
+
orgId,
|
|
51
|
+
communityId
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
defaults() {
|
|
55
|
+
return this.types.defaults("community");
|
|
56
|
+
}
|
|
57
|
+
async assertCommunity(orgId, communityId) {
|
|
58
|
+
if (!await this.communities.findCommunityById(orgId, communityId)) throw new NotFoundError("Community", communityId);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
//#endregion
|
|
62
|
+
export { CommunityNotificationCategories };
|
|
63
|
+
|
|
64
|
+
//# sourceMappingURL=notification-categories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification-categories.js","names":[],"sources":["../../src/content/notification-categories.ts"],"sourcesContent":["import type { NotificationCategory } from '../types/index.js';\nimport type {\n ChannelRegistry,\n Logger,\n NotificationCategoryService,\n NotificationTypeRegistry,\n} from '../shared/ports.js';\nimport { NotFoundError } from '../shared/errors.js';\nimport { noopLogger } from '../shared/logger.js';\nimport { SettingsNamespace, type SettingsService } from '../shared/settings.js';\nimport {\n assertValidCategoryList,\n offeringConfigured,\n storedCategoryList,\n} from '../shared/notification-categories.js';\nimport type { ContentRepository } from './ports.js';\n\nexport type CommunityNotificationCategoriesParams = {\n communities: Pick<ContentRepository, 'findCommunityById'>;\n settings: SettingsService;\n types: NotificationTypeRegistry;\n channels: ChannelRegistry;\n logger?: Logger;\n};\n\nexport class CommunityNotificationCategories implements NotificationCategoryService {\n private readonly communities: Pick<ContentRepository, 'findCommunityById'>;\n private readonly settings: SettingsService;\n private readonly types: NotificationTypeRegistry;\n private readonly channels: ChannelRegistry;\n private readonly logger: Logger;\n\n constructor(params: CommunityNotificationCategoriesParams) {\n this.communities = params.communities;\n this.settings = params.settings;\n this.types = params.types;\n this.channels = params.channels;\n this.logger = params.logger ?? noopLogger;\n }\n\n async get(\n orgId: string,\n communityId: string,\n ): Promise<{ categories: NotificationCategory[]; source: 'default' | 'stored' }> {\n await this.assertCommunity(orgId, communityId);\n const value = await this.settings.get<Record<string, unknown>>(\n orgId,\n SettingsNamespace.content,\n communityId,\n );\n const stored = storedCategoryList(value?.notificationCategories);\n return stored\n ? { categories: offeringConfigured(stored, this.channels.list()), source: 'stored' }\n : { categories: this.defaults(), source: 'default' };\n }\n\n async replace(\n orgId: string,\n communityId: string,\n categories: NotificationCategory[],\n ): Promise<{ categories: NotificationCategory[]; source: 'stored' }> {\n await this.assertCommunity(orgId, communityId);\n const configured = this.channels.list();\n assertValidCategoryList(categories, 'community', this.types, configured);\n const ordered = offeringConfigured(categories, configured);\n await this.settings.patch(orgId, SettingsNamespace.content, communityId, {\n notificationCategories: ordered,\n });\n this.logger.info('community notification categories replaced', {\n orgId,\n communityId,\n keys: categories.map((category) => category.key),\n });\n return { categories: ordered, source: 'stored' };\n }\n\n async reset(orgId: string, communityId: string): Promise<void> {\n await this.assertCommunity(orgId, communityId);\n await this.settings.patch(orgId, SettingsNamespace.content, communityId, {\n notificationCategories: null,\n });\n this.logger.info('community notification categories reset', { orgId, communityId });\n }\n\n defaults(): NotificationCategory[] {\n return this.types.defaults('community');\n }\n\n private async assertCommunity(orgId: string, communityId: string): Promise<void> {\n const community = await this.communities.findCommunityById(orgId, communityId);\n if (!community) {\n throw new NotFoundError('Community', communityId);\n }\n }\n}\n"],"mappings":";;;;;AAyBA,IAAa,kCAAb,MAAoF;CAClF;CACA;CACA;CACA;CACA;CAEA,YAAY,QAA+C;EACzD,KAAK,cAAc,OAAO;EAC1B,KAAK,WAAW,OAAO;EACvB,KAAK,QAAQ,OAAO;EACpB,KAAK,WAAW,OAAO;EACvB,KAAK,SAAS,OAAO,UAAU;CACjC;CAEA,MAAM,IACJ,OACA,aAC+E;EAC/E,MAAM,KAAK,gBAAgB,OAAO,WAAW;EAM7C,MAAM,SAAS,oBAAmB,MALd,KAAK,SAAS,IAChC,OAAA,WAEA,WACF,EAAA,EACyC,sBAAsB;EAC/D,OAAO,SACH;GAAE,YAAY,mBAAmB,QAAQ,KAAK,SAAS,KAAK,CAAC;GAAG,QAAQ;EAAS,IACjF;GAAE,YAAY,KAAK,SAAS;GAAG,QAAQ;EAAU;CACvD;CAEA,MAAM,QACJ,OACA,aACA,YACmE;EACnE,MAAM,KAAK,gBAAgB,OAAO,WAAW;EAC7C,MAAM,aAAa,KAAK,SAAS,KAAK;EACtC,wBAAwB,YAAY,aAAa,KAAK,OAAO,UAAU;EACvE,MAAM,UAAU,mBAAmB,YAAY,UAAU;EACzD,MAAM,KAAK,SAAS,MAAM,OAAA,WAAkC,aAAa,EACvE,wBAAwB,QAC1B,CAAC;EACD,KAAK,OAAO,KAAK,8CAA8C;GAC7D;GACA;GACA,MAAM,WAAW,KAAK,aAAa,SAAS,GAAG;EACjD,CAAC;EACD,OAAO;GAAE,YAAY;GAAS,QAAQ;EAAS;CACjD;CAEA,MAAM,MAAM,OAAe,aAAoC;EAC7D,MAAM,KAAK,gBAAgB,OAAO,WAAW;EAC7C,MAAM,KAAK,SAAS,MAAM,OAAA,WAAkC,aAAa,EACvE,wBAAwB,KAC1B,CAAC;EACD,KAAK,OAAO,KAAK,2CAA2C;GAAE;GAAO;EAAY,CAAC;CACpF;CAEA,WAAmC;EACjC,OAAO,KAAK,MAAM,SAAS,WAAW;CACxC;CAEA,MAAc,gBAAgB,OAAe,aAAoC;EAE/E,IAAI,CAAC,MADmB,KAAK,YAAY,kBAAkB,OAAO,WAAW,GAE3E,MAAM,IAAI,cAAc,aAAa,WAAW;CAEpD;AACF"}
|
package/dist/content/ports.d.ts
CHANGED
|
@@ -1,22 +1,72 @@
|
|
|
1
1
|
import { Page } from "../types/shared.js";
|
|
2
|
-
import { Activity, ActivityAsset, AddDownloadAssetInput, Bundle, BundleItem, Course, CourseSettings, CreateBundleInput, CreateCourseInput, CreateDownloadInput, Download, DownloadAsset, ListBundlesQuery, ListCoursesQuery, ListDownloadsQuery, Module, SaveActivityInput, UpdateBundleInput, UpdateCourseInput, UpdateDownloadInput } from "../types/schemas/content.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";
|
|
3
|
+
import { SubjectRef } from "../types/notifications.js";
|
|
4
|
+
import "../types/index.js";
|
|
3
5
|
import { OutboxAppender, UnitOfWork } from "../shared/ports.js";
|
|
4
6
|
import "./model.js";
|
|
5
7
|
import "./types.js";
|
|
8
|
+
import { Actor } from "../shared/actor.js";
|
|
6
9
|
//#region src/content/ports.d.ts
|
|
7
|
-
interface ContentService extends DownloadablesService, CourseManagementService {}
|
|
10
|
+
interface ContentService extends DownloadablesService, CourseManagementService, CommunitiesService {}
|
|
11
|
+
interface ItemTitle {
|
|
12
|
+
title: string;
|
|
13
|
+
excerpt?: string;
|
|
14
|
+
}
|
|
15
|
+
interface ItemTitles {
|
|
16
|
+
titlesFor(orgId: string, actor: Actor, refs: SubjectRef[]): Promise<Record<string, ItemTitle>>;
|
|
17
|
+
}
|
|
18
|
+
interface ItemTitleAccess {
|
|
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>;
|
|
22
|
+
}
|
|
23
|
+
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>;
|
|
27
|
+
}
|
|
28
|
+
interface SpaceRowLock {
|
|
29
|
+
lockSpace(orgId: string, spaceId: string): Promise<Space | null>;
|
|
30
|
+
}
|
|
31
|
+
interface CommunityDigest {
|
|
32
|
+
orgId: string;
|
|
33
|
+
communityId: string;
|
|
34
|
+
digest: DigestSchedule;
|
|
35
|
+
}
|
|
36
|
+
interface CommunitiesService extends CommunityReader {
|
|
37
|
+
listCommunities(orgId: string, query: ListCommunitiesQuery): Promise<Page<CommunityView>>;
|
|
38
|
+
getCommunity(orgId: string, id: string): Promise<CommunityView | null>;
|
|
39
|
+
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>;
|
|
56
|
+
}
|
|
8
57
|
interface CourseManagementService {
|
|
9
|
-
listCourses(orgId: string, query: ListCoursesQuery): Promise<Page<
|
|
10
|
-
getCourse(orgId: string, id: string): Promise<
|
|
11
|
-
createCourse(orgId: string, input: CreateCourseInput): Promise<
|
|
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>;
|
|
12
61
|
/** @throws NotFoundError when no course with this id exists in the org. */
|
|
13
|
-
updateCourse(orgId: string, id: string, patch: UpdateCourseInput): Promise<
|
|
62
|
+
updateCourse(orgId: string, id: string, patch: UpdateCourseInput): Promise<CourseView>;
|
|
14
63
|
/** @throws NotFoundError when no course with this id exists in the org. */
|
|
15
64
|
patchCourseSettings(orgId: string, id: string, value: Partial<CourseSettings>): Promise<CourseSettings>;
|
|
16
65
|
/** @throws NotFoundError when no course with this id exists in the org. */
|
|
17
|
-
deleteCourse(orgId: string, id: string): Promise<void>;
|
|
66
|
+
deleteCourse(orgId: string, id: string, actor: Actor): Promise<void>;
|
|
18
67
|
listCourseModules(orgId: string, courseId: string): Promise<Module[]>;
|
|
19
68
|
listCourseActivities(orgId: string, courseId: string): Promise<Activity[]>;
|
|
69
|
+
listCourseActivityViews(orgId: string, courseId: string): Promise<ActivityView[]>;
|
|
20
70
|
listCourseActivityAssets(orgId: string, courseId: string): Promise<ActivityAsset[]>;
|
|
21
71
|
getActivity(orgId: string, activityId: string): Promise<Activity | null>;
|
|
22
72
|
getModule(orgId: string, moduleId: string): Promise<Module | null>;
|
|
@@ -34,19 +84,19 @@ interface CourseManagementService {
|
|
|
34
84
|
deleteActivity(orgId: string, courseId: string, moduleId: string, activityId: string): Promise<Module[]>;
|
|
35
85
|
}
|
|
36
86
|
interface DownloadablesService {
|
|
37
|
-
listDownloads(orgId: string, query: ListDownloadsQuery): Promise<Page<
|
|
38
|
-
getDownload(orgId: string, id: string): Promise<
|
|
39
|
-
createDownload(orgId: string, input: CreateDownloadInput): Promise<
|
|
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>;
|
|
40
90
|
/** @throws NotFoundError when no download with this id exists in the org. */
|
|
41
|
-
updateDownload(orgId: string, id: string, patch: UpdateDownloadInput): Promise<
|
|
91
|
+
updateDownload(orgId: string, id: string, patch: UpdateDownloadInput): Promise<DownloadView>;
|
|
42
92
|
/** @throws NotFoundError when no download with this id exists in the org. */
|
|
43
|
-
removeDownload(orgId: string, id: string): Promise<void>;
|
|
44
|
-
listDownloadAssets(orgId: string, downloadId: string): Promise<
|
|
45
|
-
addDownloadAsset(orgId: string, downloadId: string, input: AddDownloadAssetInput): Promise<
|
|
46
|
-
removeDownloadAsset(orgId: string, downloadId: string, assetId: string): Promise<
|
|
47
|
-
renameDownloadAsset(orgId: string, downloadId: string, assetId: string, displayName: string | null): Promise<
|
|
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[]>;
|
|
48
98
|
/** @throws ConflictError when assetIds is not exactly the download's current asset set. */
|
|
49
|
-
reorderDownloadAssets(orgId: string, downloadId: string, assetIds: string[]): Promise<
|
|
99
|
+
reorderDownloadAssets(orgId: string, downloadId: string, assetIds: string[]): Promise<DownloadFile[]>;
|
|
50
100
|
}
|
|
51
101
|
interface BundlesService {
|
|
52
102
|
listBundles(orgId: string, query: ListBundlesQuery): Promise<Page<Bundle>>;
|
|
@@ -105,6 +155,28 @@ interface ContentRepository {
|
|
|
105
155
|
/** Content already in the bundle is left as it is — adding twice is a no-op. */
|
|
106
156
|
addBundleItem(orgId: string, bundleId: string, contentId: string): Promise<BundleItem[]>;
|
|
107
157
|
removeBundleItem(orgId: string, bundleId: string, contentId: string): Promise<BundleItem[]>;
|
|
158
|
+
listCommunities(orgId: string, query: ListCommunitiesQuery): Promise<Page<Community>>;
|
|
159
|
+
findCommunityById(orgId: string, id: string): Promise<Community | null>;
|
|
160
|
+
findCommunitiesByIds(orgId: string, ids: string[]): Promise<Community[]>;
|
|
161
|
+
communitiesWithDigest(): Promise<CommunityDigest[]>;
|
|
162
|
+
createCommunity(orgId: string, input: CreateCommunityInput, slug: string): Promise<Community>;
|
|
163
|
+
updateCommunity(orgId: string, id: string, patch: UpdateCommunityInput): Promise<Community | null>;
|
|
164
|
+
patchCommunitySettings(orgId: string, id: string, patch: PatchCommunitySettingsInput): Promise<Community | null>;
|
|
165
|
+
deleteCommunity(orgId: string, id: string): Promise<boolean>;
|
|
166
|
+
deleteCommunitySettings(orgId: string, id: string): Promise<void>;
|
|
167
|
+
listSpaces(orgId: string, communityId: string): Promise<SpaceDetail[]>;
|
|
168
|
+
findSpace(orgId: string, spaceId: string): Promise<SpaceDetail | null>;
|
|
169
|
+
lockSpace(orgId: string, spaceId: string): Promise<Space | null>;
|
|
170
|
+
createSpace(orgId: string, communityId: string, input: CreateSpaceInput): Promise<SpaceDetail>;
|
|
171
|
+
updateSpace(orgId: string, communityId: string, spaceId: string, patch: UpdateSpaceInput): Promise<SpaceDetail | null>;
|
|
172
|
+
deleteSpace(orgId: string, communityId: string, spaceId: string): Promise<boolean>;
|
|
173
|
+
reorderSpaces(orgId: string, communityId: string, orderedIds: string[]): Promise<SpaceDetail[]>;
|
|
174
|
+
setSpaceTopics(orgId: string, spaceId: string, input: SetSpaceTopicsInput): Promise<SpaceDetail>;
|
|
175
|
+
topicsInUse(orgId: string, spaceId: string, topicIds: string[]): Promise<string[]>;
|
|
176
|
+
addSpaceLink(orgId: string, spaceId: string, contentId: string): Promise<SpaceDetail>;
|
|
177
|
+
removeSpaceLink(orgId: string, spaceId: string, linkId: string): Promise<SpaceDetail>;
|
|
178
|
+
reorderSpaceLinks(orgId: string, spaceId: string, orderedIds: string[]): Promise<SpaceDetail>;
|
|
179
|
+
spacesLinkingContent(orgId: string, contentId: string): Promise<string[]>;
|
|
108
180
|
}
|
|
109
181
|
interface ContentTxScope {
|
|
110
182
|
content: ContentRepository;
|
|
@@ -112,5 +184,5 @@ interface ContentTxScope {
|
|
|
112
184
|
}
|
|
113
185
|
type ContentUnitOfWork = UnitOfWork<ContentTxScope>;
|
|
114
186
|
//#endregion
|
|
115
|
-
export { BundlesService, ContentRepository, ContentService, ContentTxScope, ContentUnitOfWork, CourseManagementService, DownloadablesService };
|
|
187
|
+
export { BundlesService, CommunitiesService, CommunityDigest, CommunityReader, ContentRepository, ContentService, ContentTxScope, ContentUnitOfWork, CourseManagementService, DownloadablesService, ItemTitle, ItemTitleAccess, ItemTitles, SpaceRowLock };
|
|
116
188
|
//# sourceMappingURL=ports.d.ts.map
|
|
@@ -1,29 +1,43 @@
|
|
|
1
1
|
import { Page } from "../types/shared.js";
|
|
2
2
|
import { Logger } from "../types/ports.js";
|
|
3
|
-
import { Activity, ActivityAsset, AddDownloadAssetInput, Bundle, BundleItem,
|
|
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
4
|
import "../shared/ports.js";
|
|
5
|
+
import { FileUrls } from "../assets/file-urls.js";
|
|
6
|
+
import { AssetFiles, LibraryAssetReader } from "../assets/ports.js";
|
|
7
|
+
import "../assets/index.js";
|
|
5
8
|
import "./model.js";
|
|
6
9
|
import "./types.js";
|
|
7
|
-
import {
|
|
10
|
+
import { Actor } from "../shared/actor.js";
|
|
11
|
+
import { BundlesService, CommunitiesService, CommunityDigest, ContentRepository, ContentUnitOfWork, CourseManagementService, DownloadablesService } from "./ports.js";
|
|
8
12
|
//#region src/content/service.d.ts
|
|
9
13
|
type ContentServiceParams = {
|
|
10
14
|
repo: ContentRepository;
|
|
11
15
|
uow: ContentUnitOfWork;
|
|
16
|
+
libraryAssets: LibraryAssetReader;
|
|
17
|
+
files: Pick<AssetFiles, 'readyFiles'>;
|
|
18
|
+
fileUrls: FileUrls;
|
|
12
19
|
logger?: Logger;
|
|
13
20
|
};
|
|
14
|
-
declare class ContentService implements CourseManagementService, DownloadablesService, BundlesService {
|
|
21
|
+
declare class ContentService implements CourseManagementService, DownloadablesService, BundlesService, CommunitiesService {
|
|
15
22
|
private readonly repo;
|
|
16
23
|
private readonly uow;
|
|
24
|
+
private readonly libraryAssets;
|
|
25
|
+
private readonly files;
|
|
26
|
+
private readonly fileUrls;
|
|
17
27
|
private readonly logger;
|
|
18
28
|
constructor(params: ContentServiceParams);
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
29
|
+
private withThumbnail;
|
|
30
|
+
private pageWithThumbnails;
|
|
31
|
+
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>;
|
|
23
36
|
patchCourseSettings(orgId: string, id: string, value: Partial<CourseSettings>): Promise<CourseSettings>;
|
|
24
|
-
deleteCourse(orgId: string, id: string): Promise<void>;
|
|
37
|
+
deleteCourse(orgId: string, id: string, actor: Actor): Promise<void>;
|
|
25
38
|
listCourseModules(orgId: string, courseId: string): Promise<Module[]>;
|
|
26
39
|
listCourseActivities(orgId: string, courseId: string): Promise<Activity[]>;
|
|
40
|
+
listCourseActivityViews(orgId: string, courseId: string): Promise<ActivityView[]>;
|
|
27
41
|
listCourseActivityAssets(orgId: string, courseId: string): Promise<ActivityAsset[]>;
|
|
28
42
|
getActivity(orgId: string, activityId: string): Promise<Activity | null>;
|
|
29
43
|
getModule(orgId: string, moduleId: string): Promise<Module | null>;
|
|
@@ -32,20 +46,21 @@ declare class ContentService implements CourseManagementService, DownloadablesSe
|
|
|
32
46
|
updateModule(orgId: string, courseId: string, moduleId: string, title: string): Promise<Module[]>;
|
|
33
47
|
deleteModule(orgId: string, courseId: string, moduleId: string): Promise<Module[]>;
|
|
34
48
|
reorderActivities(orgId: string, courseId: string, moduleId: string, orderedIds: string[]): Promise<Module[]>;
|
|
49
|
+
private assertLibraryAssets;
|
|
35
50
|
saveActivity(orgId: string, courseId: string, moduleId: string, input: SaveActivityInput, activityId?: string): Promise<Module[]>;
|
|
36
51
|
deleteActivity(orgId: string, courseId: string, moduleId: string, activityId: string): Promise<Module[]>;
|
|
37
|
-
listDownloads(orgId: string, query: ListDownloadsQuery): Promise<Page<
|
|
38
|
-
getDownload(orgId: string, id: string): Promise<
|
|
39
|
-
createDownload(orgId: string, input: CreateDownloadInput): Promise<
|
|
40
|
-
updateDownload(orgId: string, id: string, patch: UpdateDownloadInput): Promise<
|
|
41
|
-
removeDownload(orgId: string, id: string): Promise<void>;
|
|
42
|
-
listDownloadAssets(orgId: string, downloadId: string): Promise<
|
|
43
|
-
addDownloadAsset(orgId: string, downloadId: string, input: AddDownloadAssetInput): Promise<
|
|
44
|
-
removeDownloadAsset(orgId: string, downloadId: string, assetId: string): Promise<
|
|
45
|
-
renameDownloadAsset(orgId: string, downloadId: string, assetId: string, displayName: string | null): Promise<
|
|
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[]>;
|
|
46
61
|
/** The caller must send the COMPLETE ordered set — a partial list would
|
|
47
62
|
* silently unlink whatever it omitted. */
|
|
48
|
-
reorderDownloadAssets(orgId: string, downloadId: string, assetIds: string[]): Promise<
|
|
63
|
+
reorderDownloadAssets(orgId: string, downloadId: string, assetIds: string[]): Promise<DownloadFile[]>;
|
|
49
64
|
listBundles(orgId: string, query: ListBundlesQuery): Promise<Page<Bundle>>;
|
|
50
65
|
getBundle(orgId: string, id: string): Promise<Bundle | null>;
|
|
51
66
|
createBundle(orgId: string, input: CreateBundleInput): Promise<Bundle>;
|
|
@@ -54,6 +69,30 @@ declare class ContentService implements CourseManagementService, DownloadablesSe
|
|
|
54
69
|
listBundleItems(orgId: string, bundleId: string): Promise<BundleItem[]>;
|
|
55
70
|
addBundleItem(orgId: string, bundleId: string, contentId: string): Promise<BundleItem[]>;
|
|
56
71
|
removeBundleItem(orgId: string, bundleId: string, contentId: string): Promise<BundleItem[]>;
|
|
72
|
+
private spaceUpdates;
|
|
73
|
+
private resolvedSpace;
|
|
74
|
+
listCommunities(orgId: string, query: ListCommunitiesQuery): Promise<Page<CommunityView>>;
|
|
75
|
+
getCommunity(orgId: string, id: string): Promise<CommunityView | null>;
|
|
76
|
+
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>;
|
|
57
96
|
}
|
|
58
97
|
//#endregion
|
|
59
98
|
export { ContentService, ContentServiceParams };
|