@anantagnanam/lms 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +98 -2
  3. package/astro/client.ts +355 -0
  4. package/astro/components/CertificateCard.astro +83 -0
  5. package/astro/components/CourseCard.astro +61 -0
  6. package/astro/components/CourseCatalog.astro +96 -0
  7. package/astro/components/CourseOverview.astro +308 -0
  8. package/astro/components/LearnerDashboard.astro +127 -0
  9. package/astro/components/LearningShell.astro +37 -0
  10. package/astro/components/LessonAvailabilityNote.astro +26 -0
  11. package/astro/components/LessonContent.astro +53 -0
  12. package/astro/components/LessonPlayer.astro +302 -0
  13. package/astro/components/MediaPlayer.astro +111 -0
  14. package/astro/components/index.ts +7 -0
  15. package/astro/layouts/AcademyLayout.astro +84 -0
  16. package/astro/media-player.ts +99 -0
  17. package/astro/pages/author-preview.astro +71 -0
  18. package/astro/pages/certificate.astro +57 -0
  19. package/astro/pages/cohort.astro +102 -0
  20. package/astro/pages/course.astro +90 -0
  21. package/astro/pages/dashboard.astro +34 -0
  22. package/astro/pages/index.astro +40 -0
  23. package/astro/pages/lesson.astro +103 -0
  24. package/astro/pages/library.astro +173 -0
  25. package/astro/pages/paths.astro +73 -0
  26. package/astro/pages/teach.astro +15 -0
  27. package/astro/quiz-drafts.ts +87 -0
  28. package/astro/quiz-player.ts +362 -0
  29. package/astro/styles.css +1300 -0
  30. package/dist/admin.d.ts +34 -0
  31. package/dist/admin.js +3231 -0
  32. package/dist/admin.js.map +1 -0
  33. package/dist/astro.d.ts +11 -0
  34. package/dist/astro.js +52 -0
  35. package/dist/astro.js.map +1 -0
  36. package/dist/commerce.d.ts +72 -0
  37. package/dist/commerce.js +0 -0
  38. package/dist/config-BX3beTpM.js +15 -0
  39. package/dist/config-BX3beTpM.js.map +1 -0
  40. package/dist/constants-Cnx7k82Z.js +161 -0
  41. package/dist/constants-Cnx7k82Z.js.map +1 -0
  42. package/dist/csv-DKq_4OWU.js +55 -0
  43. package/dist/csv-DKq_4OWU.js.map +1 -0
  44. package/dist/errors-ChzJS9al.js +16 -0
  45. package/dist/errors-ChzJS9al.js.map +1 -0
  46. package/dist/index.d.ts +13 -0
  47. package/dist/index.js +19 -0
  48. package/dist/index.js.map +1 -0
  49. package/dist/runtime.d.ts +773 -0
  50. package/dist/runtime.js +2840 -0
  51. package/dist/runtime.js.map +1 -0
  52. package/dist/schemas.d.ts +651 -0
  53. package/dist/schemas.js +347 -0
  54. package/dist/schemas.js.map +1 -0
  55. package/dist/server.d.ts +40 -0
  56. package/dist/server.js +65 -0
  57. package/dist/server.js.map +1 -0
  58. package/dist/types.d.ts +387 -0
  59. package/dist/types.js +0 -0
  60. package/package.json +83 -4
@@ -0,0 +1,773 @@
1
+ import { AccessGrant, Acquisition, Actor, AuditRecord, Certificate, CertificateIndex, Cohort, CohortMembership, Course, CourseCard, CourseData, CourseDetail, CourseEdition, CourseRevision, CurriculumModule, Discussion, Enrollment, LearnerPreferences, LearningPath, Lesson, LessonProgress, LmsOptions, LmsSettings, MigrationState, Notification, Page, PathEnrollment, ProgressSummary, PublicEnrollment, PublicLesson, PublicQuizAttempt, Review, RevisionSummary, SavedCourse, Versioned } from "./types.js";
2
+ import * as emdash from "emdash";
3
+ import { PluginContext, StorageCollection } from "emdash";
4
+ import { z } from "zod";
5
+
6
+ //#region src/store.d.ts
7
+ interface LmsCollections {
8
+ courses: StorageCollection<Course>;
9
+ course_revisions: StorageCollection<CourseRevision>;
10
+ course_editions: StorageCollection<CourseEdition>;
11
+ migrations: StorageCollection<MigrationState>;
12
+ preferences: StorageCollection<LearnerPreferences>;
13
+ saved_courses: StorageCollection<SavedCourse>;
14
+ learning_paths: StorageCollection<LearningPath>;
15
+ path_enrollments: StorageCollection<PathEnrollment>;
16
+ enrollments: StorageCollection<Enrollment>;
17
+ certificates: StorageCollection<CertificateIndex>;
18
+ discussions: StorageCollection<Discussion>;
19
+ reviews: StorageCollection<Review>;
20
+ cohorts: StorageCollection<Cohort>;
21
+ cohort_enrollments: StorageCollection<CohortMembership>;
22
+ notifications: StorageCollection<Notification>;
23
+ audit: StorageCollection<AuditRecord>;
24
+ }
25
+ //#endregion
26
+ //#region src/editions.d.ts
27
+ /** Child snapshots are immutable. Only the root CAS makes a revision visible. */
28
+ declare class CourseEditions {
29
+ readonly stores: LmsCollections;
30
+ readonly time: () => string;
31
+ readonly resolveContent: (lesson: Lesson) => Promise<Lesson>;
32
+ constructor(stores: LmsCollections, time: () => string, resolveContent: (lesson: Lesson) => Promise<Lesson>);
33
+ snapshot(courseId: string, data: CourseData): Promise<string>;
34
+ revision(course: Course, data: CourseData, actorId: string, kind: CourseRevision["kind"], extra?: Partial<Pick<CourseRevision, "editionId" | "restoredFrom">>): Promise<CourseRevision>;
35
+ commit(current: Versioned<Course> | null, course: Course): Promise<Versioned<Course>>;
36
+ ensure(id: string, expectedRevision?: string): Promise<Versioned<Course>>;
37
+ draft(course: Course): Promise<Course>;
38
+ learning(course: Course, enrollment: Enrollment | null): Promise<Course>;
39
+ history(course: Course, cursor?: string): Promise<{
40
+ items: RevisionSummary[];
41
+ cursor?: string;
42
+ hasMore: boolean;
43
+ }>;
44
+ migrationStatus(): Promise<MigrationState>;
45
+ migrateBatch(limit: number): Promise<MigrationState>;
46
+ }
47
+ //#endregion
48
+ //#region src/curriculum.d.ts
49
+ declare function findLesson(course: Course, lessonId: string): Lesson;
50
+ //#endregion
51
+ //#region src/service.d.ts
52
+ declare class LmsService {
53
+ readonly ctx: PluginContext;
54
+ readonly now: () => Date;
55
+ readonly stores: LmsCollections;
56
+ readonly editions: CourseEditions;
57
+ constructor(ctx: PluginContext, now?: () => Date);
58
+ time(): string;
59
+ settings(): Promise<LmsSettings>;
60
+ saveSettings(actor: Actor | undefined, input: unknown): Promise<LmsSettings>;
61
+ audit(actor: Actor, action: string, resourceId: string, details?: Record<string, unknown>): Promise<void>;
62
+ course(id: string): Promise<Course>;
63
+ accessEnrollment(enrollment: Enrollment | null): Promise<Enrollment | null>;
64
+ enrollmentView(enrollment: Enrollment): Promise<PublicEnrollment>;
65
+ learningState(course: Course, enrollment: Enrollment | null): Promise<{
66
+ enrollment: PublicEnrollment | null;
67
+ progress: ProgressSummary;
68
+ }>;
69
+ lessonAccess(course: Course, lessonId: string, enrollment: Enrollment | null): Promise<{
70
+ id: string;
71
+ title: string;
72
+ summary: string;
73
+ kind: "text" | "video" | "audio" | "quiz" | "assignment" | "live";
74
+ body: string;
75
+ portableText: Record<string, unknown>[];
76
+ contentSource: {
77
+ collection: string;
78
+ id: string;
79
+ field: string;
80
+ } | null;
81
+ mediaUrl: string | null;
82
+ transcript: string;
83
+ captions: {
84
+ src: string;
85
+ language: string;
86
+ label: string;
87
+ }[];
88
+ liveStartsAt: string | null;
89
+ durationMinutes: number;
90
+ minStudySeconds: number;
91
+ preview: boolean;
92
+ required: boolean;
93
+ resources: {
94
+ id: string;
95
+ title: string;
96
+ url: string;
97
+ description: string;
98
+ }[];
99
+ quiz: {
100
+ questions: {
101
+ id: string;
102
+ type: "single" | "multiple" | "true_false" | "short";
103
+ prompt: string;
104
+ options: {
105
+ id: string;
106
+ text: string;
107
+ }[];
108
+ correctAnswers: string[];
109
+ points: number;
110
+ explanation: string;
111
+ }[];
112
+ passingPercent: number;
113
+ maxAttempts: number;
114
+ timeLimitMinutes: number;
115
+ randomizeQuestions: boolean;
116
+ randomizeOptions: boolean;
117
+ showFeedback: "never" | "after_pass" | "after_submit";
118
+ } | null;
119
+ assignment: {
120
+ instructions: string;
121
+ maxPoints: number;
122
+ passingPoints: number;
123
+ dueAt: string | null;
124
+ allowResubmission: boolean;
125
+ } | null;
126
+ }>;
127
+ instructor(course: Course, actor: Actor | undefined): Actor;
128
+ saveCourse(actor: Actor | undefined, input: unknown): Promise<{
129
+ course: Course;
130
+ revision: string;
131
+ }>;
132
+ publishCourse(actor: Actor | undefined, id: string, expectedRevision: string): Promise<{
133
+ course: Course;
134
+ revision: string;
135
+ }>;
136
+ courseHistory(actor: Actor | undefined, id: string, cursor?: string): Promise<{
137
+ items: RevisionSummary[];
138
+ cursor?: string;
139
+ hasMore: boolean;
140
+ }>;
141
+ restoreCourse(actor: Actor | undefined, id: string, expectedRevision: string, revisionId: string): Promise<{
142
+ course: Course;
143
+ revision: string;
144
+ }>;
145
+ archiveCourse(actor: Actor | undefined, id: string, expectedRevision: string): Promise<{
146
+ course: Course;
147
+ revision: string;
148
+ }>;
149
+ migrationStatus(actor: Actor | undefined): Promise<MigrationState>;
150
+ migrateBatch(actor: Actor | undefined, limit: number): Promise<MigrationState>;
151
+ assertPrerequisiteGraph(courseId: string, prerequisites: string[]): Promise<void>;
152
+ editableCourse(actor: Actor | undefined, id: string): Promise<{
153
+ course: Course;
154
+ revision: string;
155
+ }>;
156
+ adminCourses(actor: Actor | undefined, options?: {
157
+ cursor?: string;
158
+ limit?: number;
159
+ status?: string;
160
+ }): Promise<Page<Course>>;
161
+ catalog(input: unknown): Promise<Page<CourseCard>>;
162
+ publicCourse(slug: string): Promise<{
163
+ prerequisites: {
164
+ id: string;
165
+ title: string;
166
+ slug: string | null;
167
+ }[];
168
+ description: string;
169
+ outcomes: string[];
170
+ requirements: string[];
171
+ sequential: boolean;
172
+ prerequisiteCourseIds: string[];
173
+ enrollmentClosesAt: string | null;
174
+ accessDays: number;
175
+ certificateEnabled: boolean;
176
+ modules: CurriculumModule[];
177
+ id: string;
178
+ slug: string;
179
+ title: string;
180
+ summary: string;
181
+ category: string;
182
+ tags: string[];
183
+ level: CourseData["level"];
184
+ language: string;
185
+ featuredImage: CourseData["featuredImage"];
186
+ instructorName: string;
187
+ enrollmentMode: CourseData["enrollmentMode"];
188
+ lessonCount: number;
189
+ durationMinutes: number;
190
+ }>;
191
+ detail(course: Course): Promise<{
192
+ prerequisites: {
193
+ id: string;
194
+ title: string;
195
+ slug: string | null;
196
+ }[];
197
+ description: string;
198
+ outcomes: string[];
199
+ requirements: string[];
200
+ sequential: boolean;
201
+ prerequisiteCourseIds: string[];
202
+ enrollmentClosesAt: string | null;
203
+ accessDays: number;
204
+ certificateEnabled: boolean;
205
+ modules: CurriculumModule[];
206
+ id: string;
207
+ slug: string;
208
+ title: string;
209
+ summary: string;
210
+ category: string;
211
+ tags: string[];
212
+ level: CourseData["level"];
213
+ language: string;
214
+ featuredImage: CourseData["featuredImage"];
215
+ instructorName: string;
216
+ enrollmentMode: CourseData["enrollmentMode"];
217
+ lessonCount: number;
218
+ durationMinutes: number;
219
+ }>;
220
+ preview(courseId: string, lessonId: string): Promise<{
221
+ course: CourseDetail;
222
+ lesson: PublicLesson;
223
+ }>;
224
+ resolveContent(lesson: ReturnType<typeof findLesson>): Promise<ReturnType<typeof findLesson>>;
225
+ authorLessonPreview(actor: Actor | undefined, courseId: string, lessonId: string): Promise<{
226
+ course: CourseDetail;
227
+ lesson: PublicLesson;
228
+ }>;
229
+ assertPrerequisites(course: Course, actorId: string): Promise<void>;
230
+ newEnrollment(course: Course, actor: Actor, status: Enrollment["status"]): Enrollment;
231
+ enroll(actor: Actor | undefined, courseId: string, options?: {
232
+ cohortId?: string;
233
+ }): Promise<PublicEnrollment>;
234
+ adminEnrollment(actor: Actor | undefined, input: unknown): Promise<PublicEnrollment>;
235
+ learnerCourse(actor: Actor | undefined, courseId: string): Promise<{
236
+ enrollment: PublicEnrollment | null;
237
+ progress: ProgressSummary;
238
+ course: {
239
+ prerequisites: {
240
+ id: string;
241
+ title: string;
242
+ slug: string | null;
243
+ }[];
244
+ description: string;
245
+ outcomes: string[];
246
+ requirements: string[];
247
+ sequential: boolean;
248
+ prerequisiteCourseIds: string[];
249
+ enrollmentClosesAt: string | null;
250
+ accessDays: number;
251
+ certificateEnabled: boolean;
252
+ modules: CurriculumModule[];
253
+ id: string;
254
+ slug: string;
255
+ title: string;
256
+ summary: string;
257
+ category: string;
258
+ tags: string[];
259
+ level: CourseData["level"];
260
+ language: string;
261
+ featuredImage: CourseData["featuredImage"];
262
+ instructorName: string;
263
+ enrollmentMode: CourseData["enrollmentMode"];
264
+ lessonCount: number;
265
+ durationMinutes: number;
266
+ };
267
+ }>;
268
+ learnerCourseBySlug(actor: Actor | undefined, slug: string): Promise<{
269
+ enrollment: PublicEnrollment | null;
270
+ progress: ProgressSummary;
271
+ course: {
272
+ prerequisites: {
273
+ id: string;
274
+ title: string;
275
+ slug: string | null;
276
+ }[];
277
+ description: string;
278
+ outcomes: string[];
279
+ requirements: string[];
280
+ sequential: boolean;
281
+ prerequisiteCourseIds: string[];
282
+ enrollmentClosesAt: string | null;
283
+ accessDays: number;
284
+ certificateEnabled: boolean;
285
+ modules: CurriculumModule[];
286
+ id: string;
287
+ slug: string;
288
+ title: string;
289
+ summary: string;
290
+ category: string;
291
+ tags: string[];
292
+ level: CourseData["level"];
293
+ language: string;
294
+ featuredImage: CourseData["featuredImage"];
295
+ instructorName: string;
296
+ enrollmentMode: CourseData["enrollmentMode"];
297
+ lessonCount: number;
298
+ durationMinutes: number;
299
+ };
300
+ }>;
301
+ dashboard(actor: Actor | undefined, options?: {
302
+ cursor?: string;
303
+ limit?: number;
304
+ }): Promise<{
305
+ items: {
306
+ enrollment: PublicEnrollment | null;
307
+ progress: ProgressSummary;
308
+ course: CourseCard;
309
+ }[];
310
+ cursor?: string;
311
+ hasMore: boolean;
312
+ }>;
313
+ learnerLesson(actor: Actor | undefined, courseId: string, lessonId: string): Promise<{
314
+ enrollment: PublicEnrollment | null;
315
+ progress: ProgressSummary;
316
+ course: CourseDetail;
317
+ lesson: PublicLesson;
318
+ }>;
319
+ startLesson(actor: Actor | undefined, courseId: string, lessonId: string): Promise<PublicEnrollment>;
320
+ completeLesson(actor: Actor | undefined, courseId: string, lessonId: string): Promise<{
321
+ enrollment: PublicEnrollment | null;
322
+ progress: ProgressSummary;
323
+ }>;
324
+ finish(course: Course, enrollment: Enrollment, settings: LmsSettings): void;
325
+ projectCompletion(enrollment: Enrollment): Promise<void>;
326
+ startQuiz(actor: Actor | undefined, courseId: string, lessonId: string): Promise<PublicQuizAttempt>;
327
+ submitQuiz(actor: Actor | undefined, input: unknown): Promise<{
328
+ enrollment: PublicEnrollment | null;
329
+ progress: ProgressSummary;
330
+ attempt: PublicQuizAttempt;
331
+ }>;
332
+ saveQuizDraft(actor: Actor | undefined, input: unknown): Promise<{
333
+ saved: boolean;
334
+ draftRevision: number;
335
+ }>;
336
+ submitAssignment(actor: Actor | undefined, input: unknown): Promise<PublicEnrollment>;
337
+ gradeAssignment(actor: Actor | undefined, input: unknown): Promise<PublicEnrollment>;
338
+ saveNote(actor: Actor | undefined, input: unknown): Promise<{
339
+ note: string;
340
+ }>;
341
+ certificate(actor: Actor | undefined, courseId: string): Promise<Certificate>;
342
+ ownedCertificate(actor: Actor | undefined, id: string): Promise<Certificate>;
343
+ verifyCertificate(id: string): Promise<{
344
+ id: string;
345
+ courseTitle: string;
346
+ issuerName: string;
347
+ issuedAt: string;
348
+ valid: boolean;
349
+ shared: boolean;
350
+ learnerName: string | null;
351
+ }>;
352
+ shareCertificate(actor: Actor | undefined, courseId: string, shared: boolean): Promise<Certificate>;
353
+ revokeCertificate(actor: Actor | undefined, courseId: string, userId: string, reason: string): Promise<Certificate>;
354
+ cancelEnrollment(actor: Actor | undefined, courseId: string): Promise<PublicEnrollment>;
355
+ discussions(actor: Actor | undefined, courseId: string, lessonId: string, cursor?: string): Promise<{
356
+ pending: Discussion[];
357
+ items: Discussion[];
358
+ cursor?: string;
359
+ hasMore: boolean;
360
+ }>;
361
+ postDiscussion(actor: Actor | undefined, input: unknown): Promise<Discussion>;
362
+ publicReviews(courseId: string, cursor?: string): Promise<Page<Review>>;
363
+ postReview(actor: Actor | undefined, input: unknown): Promise<Review>;
364
+ moderate(actor: Actor | undefined, collection: "reviews" | "discussions", input: unknown): Promise<{
365
+ status: "published" | "hidden";
366
+ updatedAt: string;
367
+ id: string;
368
+ courseId: string;
369
+ userId: string;
370
+ authorName: string;
371
+ rating: number;
372
+ body: string;
373
+ createdAt: string;
374
+ } | {
375
+ status: "published" | "hidden";
376
+ updatedAt: string;
377
+ id: string;
378
+ courseId: string;
379
+ lessonId: string;
380
+ parentId: string | null;
381
+ authorId: string;
382
+ authorName: string;
383
+ body: string;
384
+ createdAt: string;
385
+ }>;
386
+ communityQueue(actor: Actor | undefined, collection: "reviews" | "discussions", options?: {
387
+ courseId?: string;
388
+ cursor?: string;
389
+ status?: string;
390
+ }): Promise<{
391
+ items: ({
392
+ revision: string;
393
+ id: string;
394
+ courseId: string;
395
+ userId: string;
396
+ authorName: string;
397
+ rating: number;
398
+ body: string;
399
+ status: "pending" | "published" | "hidden";
400
+ createdAt: string;
401
+ updatedAt: string;
402
+ } | {
403
+ revision: string;
404
+ id: string;
405
+ courseId: string;
406
+ lessonId: string;
407
+ parentId: string | null;
408
+ authorId: string;
409
+ authorName: string;
410
+ body: string;
411
+ status: "pending" | "published" | "hidden";
412
+ createdAt: string;
413
+ updatedAt: string;
414
+ })[];
415
+ cursor?: string;
416
+ hasMore: boolean;
417
+ } | {
418
+ items: ({
419
+ revision: string;
420
+ id: string;
421
+ courseId: string;
422
+ userId: string;
423
+ authorName: string;
424
+ rating: number;
425
+ body: string;
426
+ status: "pending" | "published" | "hidden";
427
+ createdAt: string;
428
+ updatedAt: string;
429
+ } | {
430
+ revision: string;
431
+ id: string;
432
+ courseId: string;
433
+ lessonId: string;
434
+ parentId: string | null;
435
+ authorId: string;
436
+ authorName: string;
437
+ body: string;
438
+ status: "pending" | "published" | "hidden";
439
+ createdAt: string;
440
+ updatedAt: string;
441
+ })[];
442
+ cursor?: string;
443
+ hasMore: boolean;
444
+ }>;
445
+ enrollments(actor: Actor | undefined, options?: {
446
+ courseId?: string;
447
+ status?: string;
448
+ cursor?: string;
449
+ limit?: number;
450
+ }): Promise<{
451
+ items: {
452
+ learnerEmail: string;
453
+ courseTitle: string;
454
+ lessonTitles: {
455
+ [k: string]: string;
456
+ };
457
+ progressSummary: ProgressSummary | null;
458
+ effectiveAccess: "pending" | "granted" | "scheduled" | "expired" | "suspended" | "revoked";
459
+ progress: Record<string, Omit<LessonProgress, "quizAttempts"> & {
460
+ quizAttempts: PublicQuizAttempt[];
461
+ }>;
462
+ id: string;
463
+ status: "pending" | "active" | "completed" | "rejected" | "suspended" | "cancelled";
464
+ courseId: string;
465
+ cohortId: string | null;
466
+ userId: string;
467
+ accessStartsAt: string | null;
468
+ accessExpiresAt: string | null;
469
+ accessStatus: "pending" | "granted" | "suspended" | "revoked";
470
+ accessSource: "free" | "manual" | "cohort" | "purchase";
471
+ enrolledAt: string;
472
+ completedAt: string | null;
473
+ lastActivityAt: string;
474
+ courseEditionId?: string | undefined;
475
+ learnerName: string;
476
+ grants: Record<string, AccessGrant>;
477
+ cohortIds: string[];
478
+ acquisition: Acquisition;
479
+ approvedBy: string | null;
480
+ decisionAt: string | null;
481
+ decisionReason: string | null;
482
+ approvedAt: string | null;
483
+ certificate: Certificate | null;
484
+ completionLessonIds: string[];
485
+ schemaVersion: 1;
486
+ }[];
487
+ cursor?: string;
488
+ hasMore: boolean;
489
+ }>;
490
+ report(actor: Actor | undefined, courseId?: string): Promise<{
491
+ accessSources: any;
492
+ accessDecisions: any;
493
+ completionRate: number;
494
+ courseCount: number;
495
+ generatedAt: string;
496
+ total: number;
497
+ completedEver: number;
498
+ }>;
499
+ enrollmentCsv(actor: Actor | undefined, options?: {
500
+ courseId?: string;
501
+ status?: string;
502
+ }): Promise<string>;
503
+ cohortList(actor: Actor | undefined, cursor?: string): Promise<{
504
+ items: {
505
+ revision: string;
506
+ id: string;
507
+ createdBy: string;
508
+ createdAt: string;
509
+ updatedAt: string;
510
+ title: string;
511
+ courseIds: string[];
512
+ memberIds: string[];
513
+ startsAt: string | null;
514
+ endsAt: string | null;
515
+ }[];
516
+ cursor?: string;
517
+ hasMore: boolean;
518
+ }>;
519
+ publicCohort(id: string): Promise<{
520
+ id: string;
521
+ title: string;
522
+ startsAt: string | null;
523
+ endsAt: string | null;
524
+ courses: CourseCard[];
525
+ }>;
526
+ requestCohort(actor: Actor | undefined, cohortId: string): Promise<CohortMembership>;
527
+ cohortMemberships(actor: Actor | undefined, options?: {
528
+ cohortId?: string;
529
+ status?: string;
530
+ cursor?: string;
531
+ }): Promise<Page<CohortMembership>>;
532
+ decideCohort(actor: Actor | undefined, cohortId: string, userId: string, status: "active" | "rejected" | "suspended" | "cancelled", reason?: string): Promise<{
533
+ membership: CohortMembership;
534
+ results: {
535
+ courseId: string;
536
+ success: boolean;
537
+ error?: string;
538
+ }[];
539
+ }>;
540
+ saveCohort(actor: Actor | undefined, input: unknown): Promise<{
541
+ cohort: Cohort;
542
+ revision: string;
543
+ }>;
544
+ applyCohort(actor: Actor | undefined, id: string, expectedRevision: string, offset: number): Promise<{
545
+ results: {
546
+ userId: string;
547
+ courseId: string;
548
+ success: boolean;
549
+ error?: string;
550
+ }[];
551
+ nextOffset: number;
552
+ hasMore: boolean;
553
+ }>;
554
+ notify(enrollment: Enrollment, key: string, title: string, message: string): Promise<void>;
555
+ notifications(actor: Actor | undefined, cursor?: string): Promise<{
556
+ items: {
557
+ id: string;
558
+ userId: string;
559
+ title: string;
560
+ message: string;
561
+ courseId: string | null;
562
+ read: boolean;
563
+ createdAt: string;
564
+ }[];
565
+ cursor?: string;
566
+ hasMore: boolean;
567
+ }>;
568
+ readNotification(actor: Actor | undefined, id: string): Promise<{
569
+ read: boolean;
570
+ }>;
571
+ deliverNotifications(): Promise<{
572
+ sent: number;
573
+ failed: number;
574
+ }>;
575
+ assignments(actor: Actor | undefined, courseId: string, cursor?: string): Promise<{
576
+ items: {
577
+ userId: string;
578
+ learnerName: string;
579
+ courseId: string;
580
+ lessonId: string;
581
+ id: string;
582
+ body: string;
583
+ attachmentUrl: string | null;
584
+ submittedAt: string;
585
+ status: "submitted" | "graded";
586
+ maxPoints: number;
587
+ passingPoints: number;
588
+ points: number | null;
589
+ feedback: string;
590
+ gradedAt: string | null;
591
+ gradedBy: string | null;
592
+ }[];
593
+ cursor?: string;
594
+ hasMore: boolean;
595
+ }>;
596
+ exportCourse(actor: Actor | undefined, id: string): Promise<{
597
+ format: string;
598
+ version: number;
599
+ course: {
600
+ slug: string;
601
+ title: string;
602
+ summary: string;
603
+ description: string;
604
+ outcomes: string[];
605
+ requirements: string[];
606
+ category: string;
607
+ tags: string[];
608
+ language: string;
609
+ level: "beginner" | "intermediate" | "advanced" | "all";
610
+ featuredImage: {
611
+ id: string;
612
+ src: string;
613
+ alt: string;
614
+ } | null;
615
+ instructorName: string;
616
+ instructorIds: string[];
617
+ status: "draft" | "published" | "archived";
618
+ enrollmentMode: "open" | "approval" | "invite";
619
+ commerce: {
620
+ accessModel: "free" | "paid";
621
+ offerId: string | null;
622
+ priceMinor: number | null;
623
+ currency: string;
624
+ };
625
+ prerequisiteCourseIds: string[];
626
+ sequential: boolean;
627
+ enrollmentClosesAt: string | null;
628
+ accessDays: number;
629
+ certificateEnabled: boolean;
630
+ modules: {
631
+ id: string;
632
+ title: string;
633
+ description: string;
634
+ releaseDays: number;
635
+ unlockAt: string | null;
636
+ lessons: {
637
+ id: string;
638
+ title: string;
639
+ summary: string;
640
+ kind: "text" | "video" | "audio" | "quiz" | "assignment" | "live";
641
+ body: string;
642
+ portableText: Record<string, unknown>[];
643
+ contentSource: {
644
+ collection: string;
645
+ id: string;
646
+ field: string;
647
+ } | null;
648
+ mediaUrl: string | null;
649
+ transcript: string;
650
+ captions: {
651
+ src: string;
652
+ language: string;
653
+ label: string;
654
+ }[];
655
+ liveStartsAt: string | null;
656
+ durationMinutes: number;
657
+ minStudySeconds: number;
658
+ preview: boolean;
659
+ required: boolean;
660
+ resources: {
661
+ id: string;
662
+ title: string;
663
+ url: string;
664
+ description: string;
665
+ }[];
666
+ quiz: {
667
+ questions: {
668
+ id: string;
669
+ type: "single" | "multiple" | "true_false" | "short";
670
+ prompt: string;
671
+ options: {
672
+ id: string;
673
+ text: string;
674
+ }[];
675
+ correctAnswers: string[];
676
+ points: number;
677
+ explanation: string;
678
+ }[];
679
+ passingPercent: number;
680
+ maxAttempts: number;
681
+ timeLimitMinutes: number;
682
+ randomizeQuestions: boolean;
683
+ randomizeOptions: boolean;
684
+ showFeedback: "never" | "after_pass" | "after_submit";
685
+ } | null;
686
+ assignment: {
687
+ instructions: string;
688
+ maxPoints: number;
689
+ passingPoints: number;
690
+ dueAt: string | null;
691
+ allowResubmission: boolean;
692
+ } | null;
693
+ }[];
694
+ }[];
695
+ };
696
+ }>;
697
+ importCourse(actor: Actor | undefined, input: unknown): Promise<{
698
+ course: Course;
699
+ revision: string;
700
+ }>;
701
+ deleteCourse(actor: Actor | undefined, id: string, expectedRevision: string): Promise<{
702
+ deleted: boolean;
703
+ }>;
704
+ retryNotification(actor: Actor | undefined, id: string): Promise<{
705
+ queued: boolean;
706
+ }>;
707
+ notificationQueue(actor: Actor | undefined, options?: {
708
+ status?: Notification["emailStatus"];
709
+ cursor?: string;
710
+ limit?: number;
711
+ }): Promise<Page<Notification>>;
712
+ auditList(actor: Actor | undefined, options?: {
713
+ cursor?: string;
714
+ limit?: number;
715
+ }): Promise<Page<AuditRecord>>;
716
+ reminders(): Promise<number>;
717
+ }
718
+ //#endregion
719
+ //#region src/runtime.d.ts
720
+ declare function createPlugin(_options?: LmsOptions): emdash.ResolvedPlugin<{
721
+ courses: {
722
+ indexes: string[];
723
+ uniqueIndexes: string[];
724
+ };
725
+ course_revisions: {
726
+ indexes: string[];
727
+ };
728
+ course_editions: {
729
+ indexes: string[];
730
+ };
731
+ migrations: {
732
+ indexes: string[];
733
+ };
734
+ preferences: {
735
+ indexes: never[];
736
+ };
737
+ saved_courses: {
738
+ indexes: string[];
739
+ };
740
+ learning_paths: {
741
+ indexes: string[];
742
+ };
743
+ path_enrollments: {
744
+ indexes: string[];
745
+ };
746
+ enrollments: {
747
+ indexes: (string | string[])[];
748
+ };
749
+ certificates: {
750
+ indexes: string[];
751
+ };
752
+ discussions: {
753
+ indexes: (string | string[])[];
754
+ };
755
+ reviews: {
756
+ indexes: string[];
757
+ };
758
+ cohorts: {
759
+ indexes: string[];
760
+ };
761
+ cohort_enrollments: {
762
+ indexes: string[];
763
+ };
764
+ notifications: {
765
+ indexes: string[];
766
+ };
767
+ audit: {
768
+ indexes: string[];
769
+ };
770
+ }>;
771
+ //#endregion
772
+ export { LmsService, createPlugin };
773
+ //# sourceMappingURL=runtime.d.ts.map