@hed-hog/lms 0.0.351 → 0.0.354

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 (135) hide show
  1. package/dist/course/course-audio-transcription.service.d.ts +29 -0
  2. package/dist/course/course-audio-transcription.service.d.ts.map +1 -0
  3. package/dist/course/course-audio-transcription.service.js +291 -0
  4. package/dist/course/course-audio-transcription.service.js.map +1 -0
  5. package/dist/course/course-lesson.controller.d.ts +10 -0
  6. package/dist/course/course-lesson.controller.d.ts.map +1 -0
  7. package/dist/course/course-lesson.controller.js +62 -0
  8. package/dist/course/course-lesson.controller.js.map +1 -0
  9. package/dist/course/course-structure.controller.d.ts +41 -15
  10. package/dist/course/course-structure.controller.d.ts.map +1 -1
  11. package/dist/course/course-structure.controller.js +50 -6
  12. package/dist/course/course-structure.controller.js.map +1 -1
  13. package/dist/course/course-structure.service.d.ts +50 -15
  14. package/dist/course/course-structure.service.d.ts.map +1 -1
  15. package/dist/course/course-structure.service.js +238 -73
  16. package/dist/course/course-structure.service.js.map +1 -1
  17. package/dist/course/course-video-conversion.service.d.ts +20 -2
  18. package/dist/course/course-video-conversion.service.d.ts.map +1 -1
  19. package/dist/course/course-video-conversion.service.js +730 -10
  20. package/dist/course/course-video-conversion.service.js.map +1 -1
  21. package/dist/course/course.controller.d.ts +24 -8
  22. package/dist/course/course.controller.d.ts.map +1 -1
  23. package/dist/course/course.module.d.ts.map +1 -1
  24. package/dist/course/course.module.js +5 -3
  25. package/dist/course/course.module.js.map +1 -1
  26. package/dist/course/course.service.d.ts +24 -8
  27. package/dist/course/course.service.d.ts.map +1 -1
  28. package/dist/course/course.service.js +112 -176
  29. package/dist/course/course.service.js.map +1 -1
  30. package/dist/course/dto/create-course-lesson-frame.dto.d.ts +5 -0
  31. package/dist/course/dto/create-course-lesson-frame.dto.d.ts.map +1 -0
  32. package/dist/course/dto/create-course-lesson-frame.dto.js +30 -0
  33. package/dist/course/dto/create-course-lesson-frame.dto.js.map +1 -0
  34. package/dist/course/dto/create-course-structure-lesson.dto.d.ts +4 -2
  35. package/dist/course/dto/create-course-structure-lesson.dto.d.ts.map +1 -1
  36. package/dist/course/dto/create-course-structure-lesson.dto.js +10 -3
  37. package/dist/course/dto/create-course-structure-lesson.dto.js.map +1 -1
  38. package/dist/course/dto/create-course.dto.d.ts +1 -1
  39. package/dist/course/dto/create-course.dto.d.ts.map +1 -1
  40. package/dist/course/dto/create-course.dto.js +6 -6
  41. package/dist/course/dto/create-course.dto.js.map +1 -1
  42. package/dist/course/dto/update-course-lesson-frame.dto.d.ts +5 -0
  43. package/dist/course/dto/update-course-lesson-frame.dto.d.ts.map +1 -0
  44. package/dist/course/dto/update-course-lesson-frame.dto.js +32 -0
  45. package/dist/course/dto/update-course-lesson-frame.dto.js.map +1 -0
  46. package/dist/course/dto/update-course-resources.dto.d.ts +4 -2
  47. package/dist/course/dto/update-course-resources.dto.d.ts.map +1 -1
  48. package/dist/course/dto/update-course-resources.dto.js +10 -3
  49. package/dist/course/dto/update-course-resources.dto.js.map +1 -1
  50. package/dist/course/dto/update-transcription-segments.dto.d.ts +10 -0
  51. package/dist/course/dto/update-transcription-segments.dto.d.ts.map +1 -0
  52. package/dist/course/dto/update-transcription-segments.dto.js +38 -0
  53. package/dist/course/dto/update-transcription-segments.dto.js.map +1 -0
  54. package/dist/course/lms-setting.controller.d.ts +13 -0
  55. package/dist/course/lms-setting.controller.d.ts.map +1 -0
  56. package/dist/course/lms-setting.controller.js +53 -0
  57. package/dist/course/lms-setting.controller.js.map +1 -0
  58. package/dist/enterprise/training/training-admin.service.d.ts.map +1 -1
  59. package/dist/enterprise/training/training-admin.service.js +74 -33
  60. package/dist/enterprise/training/training-admin.service.js.map +1 -1
  61. package/dist/index.d.ts +2 -0
  62. package/dist/index.d.ts.map +1 -1
  63. package/dist/index.js +2 -0
  64. package/dist/index.js.map +1 -1
  65. package/dist/lms.module.d.ts.map +1 -1
  66. package/dist/lms.module.js +6 -0
  67. package/dist/lms.module.js.map +1 -1
  68. package/hedhog/data/route.yaml +63 -0
  69. package/hedhog/data/setting_group.yaml +76 -0
  70. package/hedhog/frontend/app/courses/[id]/_components/CourseCertificateCard.tsx.ejs +3 -0
  71. package/hedhog/frontend/app/courses/[id]/_components/CourseClassificationCard.tsx.ejs +10 -1
  72. package/hedhog/frontend/app/courses/[id]/_components/CourseContentCard.tsx.ejs +7 -2
  73. package/hedhog/frontend/app/courses/[id]/_components/CourseDangerZoneCard.tsx.ejs +5 -2
  74. package/hedhog/frontend/app/courses/[id]/_components/CourseFlagsCard.tsx.ejs +7 -1
  75. package/hedhog/frontend/app/courses/[id]/_components/CourseMediaCard.tsx.ejs +3 -0
  76. package/hedhog/frontend/app/courses/[id]/_components/CourseMultiEntityPicker.tsx.ejs +95 -50
  77. package/hedhog/frontend/app/courses/[id]/_components/CourseRelationsCard.tsx.ejs +11 -36
  78. package/hedhog/frontend/app/courses/[id]/_components/CourseSectionCard.tsx.ejs +19 -5
  79. package/hedhog/frontend/app/courses/[id]/_components/course-edit-types.ts.ejs +1 -1
  80. package/hedhog/frontend/app/courses/[id]/page.tsx.ejs +30 -10
  81. package/hedhog/frontend/app/courses/[id]/structure/_components/CourseInstructorsSummaryCard.tsx.ejs +95 -0
  82. package/hedhog/frontend/app/courses/[id]/structure/_components/course-tree-dnd.tsx.ejs +29 -11
  83. package/hedhog/frontend/app/courses/[id]/structure/_components/course-tree-panel.tsx.ejs +42 -31
  84. package/hedhog/frontend/app/courses/[id]/structure/_components/course-tree.tsx.ejs +10 -1
  85. package/hedhog/frontend/app/courses/[id]/structure/_components/detail-lesson.tsx.ejs +51 -9
  86. package/hedhog/frontend/app/courses/[id]/structure/_components/drag-handle.tsx.ejs +25 -22
  87. package/hedhog/frontend/app/courses/[id]/structure/_components/editor-bulk.tsx.ejs +12 -9
  88. package/hedhog/frontend/app/courses/[id]/structure/_components/editor-course.tsx.ejs +315 -229
  89. package/hedhog/frontend/app/courses/[id]/structure/_components/editor-lesson.tsx.ejs +3220 -534
  90. package/hedhog/frontend/app/courses/[id]/structure/_components/editor-session.tsx.ejs +20 -15
  91. package/hedhog/frontend/app/courses/[id]/structure/_components/icon-action-tooltip.tsx.ejs +35 -0
  92. package/hedhog/frontend/app/courses/[id]/structure/_components/multi-select-bar.tsx.ejs +76 -67
  93. package/hedhog/frontend/app/courses/[id]/structure/_components/search-filter.tsx.ejs +13 -10
  94. package/hedhog/frontend/app/courses/[id]/structure/_components/shortcuts-help.tsx.ejs +18 -16
  95. package/hedhog/frontend/app/courses/[id]/structure/_components/sortable-tree-row.tsx.ejs +6 -0
  96. package/hedhog/frontend/app/courses/[id]/structure/_components/tree-context-menu.tsx.ejs +1 -1
  97. package/hedhog/frontend/app/courses/[id]/structure/_components/tree-display-settings-popover.tsx.ejs +23 -11
  98. package/hedhog/frontend/app/courses/[id]/structure/_components/tree-helpers.ts.ejs +48 -9
  99. package/hedhog/frontend/app/courses/[id]/structure/_components/tree-row-course.tsx.ejs +11 -2
  100. package/hedhog/frontend/app/courses/[id]/structure/_components/tree-row-lesson.tsx.ejs +121 -15
  101. package/hedhog/frontend/app/courses/[id]/structure/_components/tree-row-session.tsx.ejs +69 -14
  102. package/hedhog/frontend/app/courses/[id]/structure/_components/tree-row.tsx.ejs +11 -0
  103. package/hedhog/frontend/app/courses/[id]/structure/_components/types.ts.ejs +31 -0
  104. package/hedhog/frontend/app/courses/[id]/structure/_data/adapters/course-structure.adapter.ts.ejs +32 -6
  105. package/hedhog/frontend/app/courses/[id]/structure/_data/services/course-structure.service.ts.ejs +57 -3
  106. package/hedhog/frontend/app/courses/[id]/structure/_data/types/api-course.types.ts.ejs +46 -6
  107. package/hedhog/frontend/app/courses/[id]/structure/_data/use-course-structure-mutations.ts.ejs +14 -0
  108. package/hedhog/frontend/app/courses/[id]/structure/_data/use-lesson-audio-files.ts.ejs +23 -0
  109. package/hedhog/frontend/app/courses/[id]/structure/_data/use-lms-settings-query.ts.ejs +34 -0
  110. package/hedhog/frontend/app/courses/[id]/structure/_data/use-transcription-segments.ts.ejs +76 -0
  111. package/hedhog/frontend/messages/en.json +39 -3
  112. package/hedhog/frontend/messages/pt.json +39 -3
  113. package/hedhog/table/course.yaml +8 -0
  114. package/hedhog/table/course_lesson_file.yaml +12 -4
  115. package/hedhog/table/course_lesson_transcription_segment.yaml +22 -0
  116. package/hedhog/table/course_lesson_video_frame.yaml +25 -0
  117. package/package.json +9 -9
  118. package/src/course/course-audio-transcription.service.ts +393 -0
  119. package/src/course/course-lesson.controller.ts +28 -0
  120. package/src/course/course-structure.controller.ts +49 -3
  121. package/src/course/course-structure.service.ts +294 -32
  122. package/src/course/course-video-conversion.service.ts +972 -6
  123. package/src/course/course.module.ts +5 -3
  124. package/src/course/course.service.ts +87 -139
  125. package/src/course/dto/create-course-lesson-frame.dto.ts +14 -0
  126. package/src/course/dto/create-course-structure-lesson.dto.ts +19 -3
  127. package/src/course/dto/create-course.dto.ts +5 -5
  128. package/src/course/dto/update-course-lesson-frame.dto.ts +16 -0
  129. package/src/course/dto/update-course-resources.dto.ts +18 -3
  130. package/src/course/dto/update-transcription-segments.dto.ts +20 -0
  131. package/src/course/lms-setting.controller.ts +30 -0
  132. package/src/enterprise/training/training-admin.service.ts +77 -24
  133. package/src/index.ts +2 -0
  134. package/src/lms.module.ts +6 -0
  135. package/hedhog/table/course_instructor.yaml +0 -27
@@ -1232,13 +1232,6 @@ export class TrainingAdminService {
1232
1232
  _count: { select: { course_lesson: true } },
1233
1233
  },
1234
1234
  },
1235
- course_instructor: {
1236
- include: {
1237
- instructor: {
1238
- include: { person: { select: { id: true, name: true } } },
1239
- },
1240
- },
1241
- },
1242
1235
  course_category: {
1243
1236
  include: { category: { select: { slug: true } } },
1244
1237
  },
@@ -1253,6 +1246,56 @@ export class TrainingAdminService {
1253
1246
 
1254
1247
  const courseIds = courses.map((c) => c.id);
1255
1248
 
1249
+ const lessonInstructors =
1250
+ courseIds.length > 0
1251
+ ? await this.prisma.course_lesson_instructor.findMany({
1252
+ where: {
1253
+ course_lesson: {
1254
+ course_module: {
1255
+ course_id: { in: courseIds },
1256
+ },
1257
+ },
1258
+ },
1259
+ select: {
1260
+ instructor_id: true,
1261
+ course_lesson: {
1262
+ select: {
1263
+ course_module: {
1264
+ select: { course_id: true },
1265
+ },
1266
+ },
1267
+ },
1268
+ instructor: {
1269
+ select: {
1270
+ id: true,
1271
+ person: { select: { id: true, name: true } },
1272
+ },
1273
+ },
1274
+ },
1275
+ })
1276
+ : [];
1277
+
1278
+ const instructorsByCourseId = new Map<
1279
+ number,
1280
+ Array<{ id: number; name: string; avatarId: number | null }>
1281
+ >();
1282
+ const seenByCourseId = new Map<number, Set<number>>();
1283
+ for (const row of lessonInstructors) {
1284
+ const courseId = row.course_lesson.course_module.course_id;
1285
+ if (!instructorsByCourseId.has(courseId)) {
1286
+ instructorsByCourseId.set(courseId, []);
1287
+ seenByCourseId.set(courseId, new Set());
1288
+ }
1289
+ const seen = seenByCourseId.get(courseId)!;
1290
+ if (seen.has(row.instructor_id)) continue;
1291
+ seen.add(row.instructor_id);
1292
+ instructorsByCourseId.get(courseId)!.push({
1293
+ id: row.instructor_id,
1294
+ name: row.instructor?.person?.name ?? '',
1295
+ avatarId: null,
1296
+ });
1297
+ }
1298
+
1256
1299
  const enterpriseStudents = await this.prisma.enterprise_student.findMany({
1257
1300
  where: { enterprise_id: enterpriseId },
1258
1301
  select: { person_id: true },
@@ -1305,11 +1348,7 @@ export class TrainingAdminService {
1305
1348
  durationHours: c.duration_hours,
1306
1349
  moduleCount,
1307
1350
  lessonCount,
1308
- instructors: c.course_instructor.map((ci) => ({
1309
- id: ci.instructor_id,
1310
- name: ci.instructor?.person?.name ?? '',
1311
- avatarId: null as number | null,
1312
- })),
1351
+ instructors: instructorsByCourseId.get(c.id) ?? [],
1313
1352
  createdAt: c.created_at,
1314
1353
  enrolledCount: stats.enrolledCount,
1315
1354
  completedCount: stats.completedCount,
@@ -1376,13 +1415,6 @@ export class TrainingAdminService {
1376
1415
  },
1377
1416
  },
1378
1417
  },
1379
- course_instructor: {
1380
- include: {
1381
- instructor: {
1382
- include: { person: { select: { id: true, name: true } } },
1383
- },
1384
- },
1385
- },
1386
1418
  course_category: {
1387
1419
  include: { category: { select: { slug: true } } },
1388
1420
  },
@@ -1420,6 +1452,31 @@ export class TrainingAdminService {
1420
1452
  })
1421
1453
  : [];
1422
1454
 
1455
+ const lessonInstructors = await this.prisma.course_lesson_instructor.findMany({
1456
+ where: {
1457
+ course_lesson: {
1458
+ course_module: { course_id: courseId },
1459
+ },
1460
+ },
1461
+ select: {
1462
+ instructor_id: true,
1463
+ instructor: {
1464
+ select: {
1465
+ id: true,
1466
+ person: { select: { id: true, name: true } },
1467
+ },
1468
+ },
1469
+ },
1470
+ });
1471
+
1472
+ const instructors = Array.from(
1473
+ new Map(lessonInstructors.map((row) => [row.instructor_id, row])).values(),
1474
+ ).map((row) => ({
1475
+ id: row.instructor_id,
1476
+ name: row.instructor?.person?.name ?? '',
1477
+ avatarId: null as number | null,
1478
+ }));
1479
+
1423
1480
  const enrolledCount = enrollments.length;
1424
1481
  const completedCount = enrollments.filter((e) => e.status === 'completed').length;
1425
1482
  const inProgressCount = enrollments.filter((e) => e.status === 'active').length;
@@ -1436,11 +1493,7 @@ export class TrainingAdminService {
1436
1493
  durationHours: course.duration_hours,
1437
1494
  moduleCount,
1438
1495
  lessonCount,
1439
- instructors: course.course_instructor.map((ci) => ({
1440
- id: ci.instructor_id,
1441
- name: ci.instructor?.person?.name ?? '',
1442
- avatarId: null as number | null,
1443
- })),
1496
+ instructors,
1444
1497
  createdAt: course.created_at,
1445
1498
  objectives: course.objectives ?? null,
1446
1499
  requirements: course.requirements ?? null,
package/src/index.ts CHANGED
@@ -10,6 +10,8 @@ export * from './class-group/class-group.service';
10
10
  export * from './course-lesson-note/course-lesson-note.controller';
11
11
  export * from './course-lesson-note/course-lesson-note.module';
12
12
  export * from './course-lesson-note/course-lesson-note.service';
13
+ export * from './course/course-audio-transcription.service';
14
+ export * from './course/course-lesson.controller';
13
15
  export * from './course/course-structure.controller';
14
16
  export * from './course/course-structure.service';
15
17
  export * from './course/course-video-conversion.service';
package/src/lms.module.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  import { LocaleModule } from '@hed-hog/api-locale';
2
2
  import { PaginationModule } from '@hed-hog/api-pagination';
3
3
  import { PrismaModule } from '@hed-hog/api-prisma';
4
+ import { CoreModule } from '@hed-hog/core';
5
+ import { QueueModule } from '@hed-hog/queue';
4
6
  import { forwardRef, Module } from '@nestjs/common';
5
7
  import { ConfigModule } from '@nestjs/config';
6
8
  import { AchievementModule } from './achievement/achievement.module';
@@ -9,6 +11,7 @@ import { LmsCertificateModule } from './certificate/certificate.module';
9
11
  import { ClassGroupModule } from './class-group/class-group.module';
10
12
  import { CourseLessonDiscussionModule } from './course-lesson-discussion/course-lesson-discussion.module';
11
13
  import { CourseLessonNoteModule } from './course-lesson-note/course-lesson-note.module';
14
+ import { CourseAudioTranscriptionService } from './course/course-audio-transcription.service';
12
15
  import { CourseModule } from './course/course.module';
13
16
  import { LmsDashboardModule } from './dashboard/dashboard.module';
14
17
  import { EnterpriseModule } from './enterprise/enterprise.module';
@@ -26,6 +29,8 @@ import { VideoResolutionProfileModule } from './video-resolution-profile/video-r
26
29
  ConfigModule.forRoot(),
27
30
  forwardRef(() => PaginationModule),
28
31
  forwardRef(() => PrismaModule),
32
+ forwardRef(() => CoreModule),
33
+ forwardRef(() => QueueModule),
29
34
  forwardRef(() => LocaleModule),
30
35
  forwardRef(() => AchievementModule),
31
36
  forwardRef(() => BitcodeWalletModule),
@@ -45,6 +50,7 @@ import { VideoResolutionProfileModule } from './video-resolution-profile/video-r
45
50
  forwardRef(() => TrainingModule),
46
51
  forwardRef(() => VideoResolutionProfileModule),
47
52
  ],
53
+ providers: [CourseAudioTranscriptionService],
48
54
  exports: [
49
55
  forwardRef(() => AchievementModule),
50
56
  forwardRef(() => BitcodeWalletModule),
@@ -1,27 +0,0 @@
1
- columns:
2
- - type: pk
3
- - name: course_id
4
- type: fk
5
- references:
6
- table: course
7
- column: id
8
- onDelete: CASCADE
9
- - name: instructor_id
10
- type: fk
11
- references:
12
- table: instructor
13
- column: id
14
- onDelete: CASCADE
15
- - name: role
16
- type: enum
17
- values: [lead, assistant]
18
- default: assistant
19
- - type: created_at
20
- - type: updated_at
21
-
22
- indices:
23
- - columns: [course_id, instructor_id]
24
- isUnique: true
25
- - columns: [course_id]
26
- - columns: [instructor_id]
27
- - columns: [role]