@headless-lms/core 0.2.0 → 0.3.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 +39 -21
- 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 +5 -4
- package/dist/assets/index.js +3 -2
- package/dist/assets/model.d.ts +2 -2
- package/dist/assets/ports.d.ts +45 -15
- package/dist/assets/service.d.ts +39 -7
- package/dist/assets/service.js +291 -38
- package/dist/assets/service.js.map +1 -1
- package/dist/automations/actions.d.ts +13 -24
- package/dist/automations/actions.js +168 -43
- package/dist/automations/actions.js.map +1 -1
- package/dist/automations/catalog.d.ts +2 -1
- package/dist/automations/catalog.js +229 -13
- 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 +112 -0
- package/dist/automations/community-mail.js +90 -0
- package/dist/automations/community-mail.js.map +1 -0
- package/dist/automations/community-notifications.d.ts +16 -0
- package/dist/automations/community-notifications.js +84 -0
- package/dist/automations/community-notifications.js.map +1 -0
- package/dist/automations/events.d.ts +28 -0
- package/dist/automations/index.d.ts +4 -2
- package/dist/automations/index.js +3 -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/ports.d.ts +5 -1
- 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/seeds.d.ts +17 -0
- package/dist/automations/seeds.js +235 -0
- package/dist/automations/seeds.js.map +1 -0
- package/dist/automations/service.d.ts +22 -3
- package/dist/automations/service.js +306 -43
- package/dist/automations/service.js.map +1 -1
- package/dist/content/events.d.ts +631 -19
- package/dist/content/events.js +44 -1
- package/dist/content/events.js.map +1 -1
- package/dist/content/index.d.ts +4 -4
- package/dist/content/model.d.ts +2 -2
- package/dist/content/ports.d.ts +71 -18
- package/dist/content/service.d.ts +57 -18
- package/dist/content/service.js +502 -23
- package/dist/content/service.js.map +1 -1
- 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 +104 -0
- package/dist/discussion/chats.js +798 -0
- package/dist/discussion/chats.js.map +1 -0
- package/dist/discussion/events.d.ts +619 -56
- package/dist/discussion/events.js +106 -3
- package/dist/discussion/events.js.map +1 -1
- package/dist/discussion/index.d.ts +7 -3
- package/dist/discussion/index.js +4 -1
- package/dist/discussion/ports.d.ts +288 -27
- package/dist/discussion/ports.js +6 -1
- package/dist/discussion/ports.js.map +1 -0
- package/dist/discussion/posts.d.ts +103 -0
- package/dist/discussion/posts.js +723 -0
- package/dist/discussion/posts.js.map +1 -0
- package/dist/discussion/service.d.ts +32 -10
- package/dist/discussion/service.js +293 -78
- package/dist/discussion/service.js.map +1 -1
- 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 +5 -4
- package/dist/entitlements/index.js +2 -1
- package/dist/entitlements/model.d.ts +3 -2
- package/dist/entitlements/ports.d.ts +124 -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 +54 -3
- package/dist/entitlements/service.js +472 -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/index.d.ts +6 -4
- package/dist/identity/index.js +3 -1
- package/dist/identity/model.d.ts +2 -1
- package/dist/identity/notifications.d.ts +27 -0
- package/dist/identity/notifications.js +101 -0
- package/dist/identity/notifications.js.map +1 -0
- package/dist/identity/ports.d.ts +73 -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/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 +74 -32
- package/dist/organizations/events.js +6 -0
- package/dist/organizations/events.js.map +1 -1
- package/dist/organizations/index.d.ts +7 -6
- package/dist/organizations/index.js +4 -3
- package/dist/organizations/members.d.ts +8 -5
- package/dist/organizations/members.js.map +1 -1
- package/dist/organizations/ports.d.ts +14 -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 +20 -11
- package/dist/organizations/service.js +157 -47
- package/dist/organizations/service.js.map +1 -1
- package/dist/organizations/types.d.ts +1 -10
- 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 +124 -0
- package/dist/reporting/member/ports.d.ts +45 -0
- package/dist/reporting/member/service.d.ts +73 -0
- package/dist/reporting/member/service.js +286 -0
- package/dist/reporting/member/service.js.map +1 -0
- package/dist/shared/actor.d.ts +9 -0
- package/dist/shared/errors.d.ts +7 -1
- package/dist/shared/errors.js +10 -1
- package/dist/shared/errors.js.map +1 -1
- package/dist/shared/id.d.ts +11 -0
- package/dist/shared/id.js +12 -1
- package/dist/shared/id.js.map +1 -1
- package/dist/shared/mailer.d.ts +4 -1
- 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/types/assets.d.ts +2 -2
- package/dist/types/automations.d.ts +10 -2
- package/dist/types/content.d.ts +2 -2
- package/dist/types/discussion.d.ts +11 -3
- package/dist/types/email-templates.d.ts +121 -0
- package/dist/types/entitlements.d.ts +2 -2
- package/dist/types/identity.d.ts +48 -2
- package/dist/types/index.d.ts +9 -9
- 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 +18 -1
- package/dist/types/schemas/automations.js +15 -6
- package/dist/types/schemas/automations.js.map +1 -1
- package/dist/types/schemas/content.d.ts +335 -3
- package/dist/types/schemas/content.js +139 -3
- package/dist/types/schemas/content.js.map +1 -1
- package/dist/types/schemas/discussion.d.ts +370 -3
- package/dist/types/schemas/discussion.js +199 -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 +111 -1
- package/dist/types/schemas/identity.js +55 -2
- package/dist/types/schemas/identity.js.map +1 -1
- package/dist/types/schemas/index.d.ts +8 -8
- package/dist/types/schemas/index.js +8 -8
- 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/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/ports.js +0 -1
- 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/content/events.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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
|
|
@@ -66,6 +66,7 @@ const publicDownloadAsset = downloadAssetSchema.pick({
|
|
|
66
66
|
createdAt: true,
|
|
67
67
|
updatedAt: true
|
|
68
68
|
}).strip();
|
|
69
|
+
const publicCommunity = communitySchema.omit({ settings: true }).strip();
|
|
69
70
|
const publicDownloadAssets = z.object({
|
|
70
71
|
downloadId: idSchema,
|
|
71
72
|
assets: z.array(publicDownloadAsset)
|
|
@@ -203,6 +204,48 @@ const contentEvents = {
|
|
|
203
204
|
type: "content.bundle.item.removed",
|
|
204
205
|
version: 1,
|
|
205
206
|
data: bundleItemsEventSchema
|
|
207
|
+
}),
|
|
208
|
+
communityCreated: defineEvent({
|
|
209
|
+
type: "content.community.created",
|
|
210
|
+
version: 1,
|
|
211
|
+
data: communitySchema,
|
|
212
|
+
publicData: publicCommunity
|
|
213
|
+
}),
|
|
214
|
+
communityUpdated: defineEvent({
|
|
215
|
+
type: "content.community.updated",
|
|
216
|
+
version: 1,
|
|
217
|
+
data: communitySchema,
|
|
218
|
+
publicData: publicCommunity
|
|
219
|
+
}),
|
|
220
|
+
communityDeleted: defineEvent({
|
|
221
|
+
type: "content.community.deleted",
|
|
222
|
+
version: 1,
|
|
223
|
+
data: communitySchema,
|
|
224
|
+
publicData: publicCommunity
|
|
225
|
+
}),
|
|
226
|
+
spaceCreated: defineEvent({
|
|
227
|
+
type: "content.community.space.created",
|
|
228
|
+
version: 1,
|
|
229
|
+
data: spaceDetailSchema,
|
|
230
|
+
publicData: spaceDetailSchema
|
|
231
|
+
}),
|
|
232
|
+
spaceUpdated: defineEvent({
|
|
233
|
+
type: "content.community.space.updated",
|
|
234
|
+
version: 1,
|
|
235
|
+
data: spaceDetailSchema,
|
|
236
|
+
publicData: spaceDetailSchema
|
|
237
|
+
}),
|
|
238
|
+
spaceDeleted: defineEvent({
|
|
239
|
+
type: "content.community.space.deleted",
|
|
240
|
+
version: 1,
|
|
241
|
+
data: spaceDetailSchema,
|
|
242
|
+
publicData: spaceDetailSchema
|
|
243
|
+
}),
|
|
244
|
+
spacesReordered: defineEvent({
|
|
245
|
+
type: "content.community.spaces.reordered",
|
|
246
|
+
version: 1,
|
|
247
|
+
data: z.array(spaceDetailSchema),
|
|
248
|
+
publicData: z.array(spaceDetailSchema)
|
|
206
249
|
})
|
|
207
250
|
};
|
|
208
251
|
//#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 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 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 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,8 @@
|
|
|
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, DmSettings, Download, DownloadAsset, DownloadFile, DownloadStatus, DownloadView, ListBundlesQuery, ListCommunitiesQuery, ListCoursesQuery, ListDownloadsQuery, Module, 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, CommunityReader, ContentRepository, ContentService as ContentService$1, CourseManagementService, DownloadablesService, SpaceRowLock } from "./ports.js";
|
|
7
6
|
import { ContentService } from "./service.js";
|
|
8
|
-
|
|
7
|
+
import { BundleCreated, BundleDeleted, BundleItemAdded, BundleItemRemoved, BundleUpdated, CommunityCreated, CommunityDeleted, CommunitySpaceCreated, CommunitySpaceDeleted, CommunitySpaceUpdated, CommunitySpacesReordered, CommunityUpdated, ContentEvent, CourseActivitiesReordered, CourseActivityCreated, CourseActivityDeleted, CourseActivityUpdated, CourseCreated, CourseDeleted, CourseModuleCreated, CourseModuleDeleted, CourseModuleUpdated, CourseModulesReordered, CourseUpdated, DownloadCreated, DownloadDeleted, DownloadUpdated, contentEvents } from "./events.js";
|
|
8
|
+
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 CommunityReader, type CommunitySpaceCreated, type CommunitySpaceDeleted, type CommunitySpaceUpdated, type CommunitySpacesReordered, type CommunityStatus, type CommunityUpdated, type CommunityView, type ContentEvent, type ContentRepository, ContentService, type ContentService$1 as ContentServicePort, type Course, type CourseActivitiesReordered, type CourseActivityCreated, type CourseActivityDeleted, 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 DmSettings, type Download, type DownloadAsset, type DownloadCreated, type DownloadDeleted, type DownloadFile, type DownloadStatus, type DownloadUpdated, type DownloadView, type DownloadablesService, type ListBundlesQuery, type ListCommunitiesQuery, type ListCoursesQuery, type ListDownloadsQuery, type Module, type Page, 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, 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, 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, DmSettings, Download, DownloadAsset, DownloadFile, DownloadStatus, DownloadView, Module, SaveActivityInput, Space, SpaceAccessRule, SpaceDetail, SpaceLink, SpaceSettings, SpaceTopic };
|
package/dist/content/ports.d.ts
CHANGED
|
@@ -1,22 +1,53 @@
|
|
|
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, DmSettings, Download, DownloadAsset, DownloadFile, DownloadView, ListBundlesQuery, ListCommunitiesQuery, ListCoursesQuery, ListDownloadsQuery, Module, PatchDmSettingsInput, SaveActivityInput, SetSpaceTopicsInput, Space, SpaceDetail, UpdateBundleInput, UpdateCommunityInput, UpdateCourseInput, UpdateDownloadInput, UpdateSpaceInput } from "../types/schemas/content.js";
|
|
3
3
|
import { OutboxAppender, UnitOfWork } from "../shared/ports.js";
|
|
4
4
|
import "./model.js";
|
|
5
5
|
import "./types.js";
|
|
6
|
+
import { Actor } from "../shared/actor.js";
|
|
6
7
|
//#region src/content/ports.d.ts
|
|
7
|
-
interface ContentService extends DownloadablesService, CourseManagementService {}
|
|
8
|
+
interface ContentService extends DownloadablesService, CourseManagementService, CommunitiesService {}
|
|
9
|
+
interface CommunityReader {
|
|
10
|
+
getSpace(orgId: string, spaceId: string): Promise<SpaceDetail | null>;
|
|
11
|
+
listSpaces(orgId: string, communityId: string): Promise<SpaceDetail[]>;
|
|
12
|
+
getDmSettings(orgId: string, communityId: string): Promise<DmSettings | null>;
|
|
13
|
+
}
|
|
14
|
+
interface SpaceRowLock {
|
|
15
|
+
lockSpace(orgId: string, spaceId: string): Promise<Space | null>;
|
|
16
|
+
}
|
|
17
|
+
interface CommunitiesService extends CommunityReader {
|
|
18
|
+
listCommunities(orgId: string, query: ListCommunitiesQuery): Promise<Page<CommunityView>>;
|
|
19
|
+
getCommunity(orgId: string, id: string): Promise<CommunityView | null>;
|
|
20
|
+
listPublishedCommunityIds(orgId: string): Promise<string[]>;
|
|
21
|
+
listCommunitiesById(orgId: string, ids: string[]): Promise<Community[]>;
|
|
22
|
+
getCommunitySpace(orgId: string, communityId: string, spaceId: string): Promise<SpaceDetail | null>;
|
|
23
|
+
createCommunity(orgId: string, input: CreateCommunityInput, actor: Actor): Promise<CommunityView>;
|
|
24
|
+
updateCommunity(orgId: string, id: string, patch: UpdateCommunityInput, actor: Actor): Promise<CommunityView>;
|
|
25
|
+
publishCommunity(orgId: string, id: string, actor: Actor): Promise<CommunityView>;
|
|
26
|
+
unpublishCommunity(orgId: string, id: string, actor: Actor): Promise<CommunityView>;
|
|
27
|
+
deleteCommunity(orgId: string, id: string, actor: Actor): Promise<void>;
|
|
28
|
+
patchDmSettings(orgId: string, id: string, patch: PatchDmSettingsInput, actor: Actor): Promise<CommunityView>;
|
|
29
|
+
createSpace(orgId: string, communityId: string, input: CreateSpaceInput, actor: Actor): Promise<SpaceDetail>;
|
|
30
|
+
updateSpace(orgId: string, communityId: string, spaceId: string, patch: UpdateSpaceInput, actor: Actor): Promise<SpaceDetail>;
|
|
31
|
+
deleteSpace(orgId: string, communityId: string, spaceId: string, actor: Actor): Promise<void>;
|
|
32
|
+
reorderSpaces(orgId: string, communityId: string, orderedIds: string[], actor: Actor): Promise<SpaceDetail[]>;
|
|
33
|
+
setSpaceTopics(orgId: string, communityId: string, spaceId: string, input: SetSpaceTopicsInput, actor: Actor): Promise<SpaceDetail>;
|
|
34
|
+
addSpaceLink(orgId: string, communityId: string, spaceId: string, contentId: string, actor: Actor): Promise<SpaceDetail>;
|
|
35
|
+
removeSpaceLink(orgId: string, communityId: string, spaceId: string, linkId: string, actor: Actor): Promise<SpaceDetail>;
|
|
36
|
+
reorderSpaceLinks(orgId: string, communityId: string, spaceId: string, orderedIds: string[], actor: Actor): Promise<SpaceDetail>;
|
|
37
|
+
}
|
|
8
38
|
interface CourseManagementService {
|
|
9
|
-
listCourses(orgId: string, query: ListCoursesQuery): Promise<Page<
|
|
10
|
-
getCourse(orgId: string, id: string): Promise<
|
|
11
|
-
createCourse(orgId: string, input: CreateCourseInput): Promise<
|
|
39
|
+
listCourses(orgId: string, query: ListCoursesQuery): Promise<Page<CourseView>>;
|
|
40
|
+
getCourse(orgId: string, id: string): Promise<CourseView | null>;
|
|
41
|
+
createCourse(orgId: string, input: CreateCourseInput): Promise<CourseView>;
|
|
12
42
|
/** @throws NotFoundError when no course with this id exists in the org. */
|
|
13
|
-
updateCourse(orgId: string, id: string, patch: UpdateCourseInput): Promise<
|
|
43
|
+
updateCourse(orgId: string, id: string, patch: UpdateCourseInput): Promise<CourseView>;
|
|
14
44
|
/** @throws NotFoundError when no course with this id exists in the org. */
|
|
15
45
|
patchCourseSettings(orgId: string, id: string, value: Partial<CourseSettings>): Promise<CourseSettings>;
|
|
16
46
|
/** @throws NotFoundError when no course with this id exists in the org. */
|
|
17
|
-
deleteCourse(orgId: string, id: string): Promise<void>;
|
|
47
|
+
deleteCourse(orgId: string, id: string, actor: Actor): Promise<void>;
|
|
18
48
|
listCourseModules(orgId: string, courseId: string): Promise<Module[]>;
|
|
19
49
|
listCourseActivities(orgId: string, courseId: string): Promise<Activity[]>;
|
|
50
|
+
listCourseActivityViews(orgId: string, courseId: string): Promise<ActivityView[]>;
|
|
20
51
|
listCourseActivityAssets(orgId: string, courseId: string): Promise<ActivityAsset[]>;
|
|
21
52
|
getActivity(orgId: string, activityId: string): Promise<Activity | null>;
|
|
22
53
|
getModule(orgId: string, moduleId: string): Promise<Module | null>;
|
|
@@ -34,19 +65,19 @@ interface CourseManagementService {
|
|
|
34
65
|
deleteActivity(orgId: string, courseId: string, moduleId: string, activityId: string): Promise<Module[]>;
|
|
35
66
|
}
|
|
36
67
|
interface DownloadablesService {
|
|
37
|
-
listDownloads(orgId: string, query: ListDownloadsQuery): Promise<Page<
|
|
38
|
-
getDownload(orgId: string, id: string): Promise<
|
|
39
|
-
createDownload(orgId: string, input: CreateDownloadInput): Promise<
|
|
68
|
+
listDownloads(orgId: string, query: ListDownloadsQuery): Promise<Page<DownloadView>>;
|
|
69
|
+
getDownload(orgId: string, id: string): Promise<DownloadView | null>;
|
|
70
|
+
createDownload(orgId: string, input: CreateDownloadInput): Promise<DownloadView>;
|
|
40
71
|
/** @throws NotFoundError when no download with this id exists in the org. */
|
|
41
|
-
updateDownload(orgId: string, id: string, patch: UpdateDownloadInput): Promise<
|
|
72
|
+
updateDownload(orgId: string, id: string, patch: UpdateDownloadInput): Promise<DownloadView>;
|
|
42
73
|
/** @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<
|
|
74
|
+
removeDownload(orgId: string, id: string, actor: Actor): Promise<void>;
|
|
75
|
+
listDownloadAssets(orgId: string, downloadId: string): Promise<DownloadFile[]>;
|
|
76
|
+
addDownloadAsset(orgId: string, downloadId: string, input: AddDownloadAssetInput): Promise<DownloadFile[]>;
|
|
77
|
+
removeDownloadAsset(orgId: string, downloadId: string, assetId: string): Promise<DownloadFile[]>;
|
|
78
|
+
renameDownloadAsset(orgId: string, downloadId: string, assetId: string, displayName: string | null): Promise<DownloadFile[]>;
|
|
48
79
|
/** @throws ConflictError when assetIds is not exactly the download's current asset set. */
|
|
49
|
-
reorderDownloadAssets(orgId: string, downloadId: string, assetIds: string[]): Promise<
|
|
80
|
+
reorderDownloadAssets(orgId: string, downloadId: string, assetIds: string[]): Promise<DownloadFile[]>;
|
|
50
81
|
}
|
|
51
82
|
interface BundlesService {
|
|
52
83
|
listBundles(orgId: string, query: ListBundlesQuery): Promise<Page<Bundle>>;
|
|
@@ -105,6 +136,28 @@ interface ContentRepository {
|
|
|
105
136
|
/** Content already in the bundle is left as it is — adding twice is a no-op. */
|
|
106
137
|
addBundleItem(orgId: string, bundleId: string, contentId: string): Promise<BundleItem[]>;
|
|
107
138
|
removeBundleItem(orgId: string, bundleId: string, contentId: string): Promise<BundleItem[]>;
|
|
139
|
+
listCommunities(orgId: string, query: ListCommunitiesQuery): Promise<Page<Community>>;
|
|
140
|
+
findCommunityById(orgId: string, id: string): Promise<Community | null>;
|
|
141
|
+
findCommunitiesByIds(orgId: string, ids: string[]): Promise<Community[]>;
|
|
142
|
+
listPublishedCommunityIds(orgId: string): Promise<string[]>;
|
|
143
|
+
createCommunity(orgId: string, input: CreateCommunityInput, slug: string): Promise<Community>;
|
|
144
|
+
updateCommunity(orgId: string, id: string, patch: UpdateCommunityInput): Promise<Community | null>;
|
|
145
|
+
patchDmSettings(orgId: string, id: string, patch: PatchDmSettingsInput): Promise<Community | null>;
|
|
146
|
+
deleteCommunity(orgId: string, id: string): Promise<boolean>;
|
|
147
|
+
deleteCommunitySettings(orgId: string, id: string): Promise<void>;
|
|
148
|
+
listSpaces(orgId: string, communityId: string): Promise<SpaceDetail[]>;
|
|
149
|
+
findSpace(orgId: string, spaceId: string): Promise<SpaceDetail | null>;
|
|
150
|
+
lockSpace(orgId: string, spaceId: string): Promise<Space | null>;
|
|
151
|
+
createSpace(orgId: string, communityId: string, input: CreateSpaceInput): Promise<SpaceDetail>;
|
|
152
|
+
updateSpace(orgId: string, communityId: string, spaceId: string, patch: UpdateSpaceInput): Promise<SpaceDetail | null>;
|
|
153
|
+
deleteSpace(orgId: string, communityId: string, spaceId: string): Promise<boolean>;
|
|
154
|
+
reorderSpaces(orgId: string, communityId: string, orderedIds: string[]): Promise<SpaceDetail[]>;
|
|
155
|
+
setSpaceTopics(orgId: string, spaceId: string, input: SetSpaceTopicsInput): Promise<SpaceDetail>;
|
|
156
|
+
topicsInUse(orgId: string, spaceId: string, topicIds: string[]): Promise<string[]>;
|
|
157
|
+
addSpaceLink(orgId: string, spaceId: string, contentId: string): Promise<SpaceDetail>;
|
|
158
|
+
removeSpaceLink(orgId: string, spaceId: string, linkId: string): Promise<SpaceDetail>;
|
|
159
|
+
reorderSpaceLinks(orgId: string, spaceId: string, orderedIds: string[]): Promise<SpaceDetail>;
|
|
160
|
+
spacesLinkingContent(orgId: string, contentId: string): Promise<string[]>;
|
|
108
161
|
}
|
|
109
162
|
interface ContentTxScope {
|
|
110
163
|
content: ContentRepository;
|
|
@@ -112,5 +165,5 @@ interface ContentTxScope {
|
|
|
112
165
|
}
|
|
113
166
|
type ContentUnitOfWork = UnitOfWork<ContentTxScope>;
|
|
114
167
|
//#endregion
|
|
115
|
-
export { BundlesService, ContentRepository, ContentService, ContentTxScope, ContentUnitOfWork, CourseManagementService, DownloadablesService };
|
|
168
|
+
export { BundlesService, CommunitiesService, CommunityReader, ContentRepository, ContentService, ContentTxScope, ContentUnitOfWork, CourseManagementService, DownloadablesService, SpaceRowLock };
|
|
116
169
|
//# 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, PatchDmSettingsInput, 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, 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
|
+
listPublishedCommunityIds(orgId: string): Promise<string[]>;
|
|
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
|
+
patchDmSettings(orgId: string, id: string, patch: PatchDmSettingsInput, 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 };
|