@hed-hog/lms 0.0.350 → 0.0.353

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 (160) hide show
  1. package/dist/certificate/certificate.controller.d.ts +2 -2
  2. package/dist/certificate/certificate.controller.d.ts.map +1 -1
  3. package/dist/certificate/certificate.controller.js +8 -6
  4. package/dist/certificate/certificate.controller.js.map +1 -1
  5. package/dist/certificate/certificate.service.d.ts +5 -2
  6. package/dist/certificate/certificate.service.d.ts.map +1 -1
  7. package/dist/certificate/certificate.service.js +70 -6
  8. package/dist/certificate/certificate.service.js.map +1 -1
  9. package/dist/course/course-structure.controller.d.ts +24 -10
  10. package/dist/course/course-structure.controller.d.ts.map +1 -1
  11. package/dist/course/course-structure.controller.js +23 -2
  12. package/dist/course/course-structure.controller.js.map +1 -1
  13. package/dist/course/course-structure.service.d.ts +16 -8
  14. package/dist/course/course-structure.service.d.ts.map +1 -1
  15. package/dist/course/course-structure.service.js +61 -30
  16. package/dist/course/course-structure.service.js.map +1 -1
  17. package/dist/course/course-video-conversion.service.d.ts +37 -0
  18. package/dist/course/course-video-conversion.service.d.ts.map +1 -0
  19. package/dist/course/course-video-conversion.service.js +308 -0
  20. package/dist/course/course-video-conversion.service.js.map +1 -0
  21. package/dist/course/course.controller.d.ts +17 -0
  22. package/dist/course/course.controller.d.ts.map +1 -1
  23. package/dist/course/course.controller.js +23 -0
  24. package/dist/course/course.controller.js.map +1 -1
  25. package/dist/course/course.module.d.ts.map +1 -1
  26. package/dist/course/course.module.js +15 -2
  27. package/dist/course/course.module.js.map +1 -1
  28. package/dist/course/course.service.d.ts +15 -0
  29. package/dist/course/course.service.d.ts.map +1 -1
  30. package/dist/course/course.service.js +103 -49
  31. package/dist/course/course.service.js.map +1 -1
  32. package/dist/course/dto/create-course-structure-lesson.dto.d.ts +5 -1
  33. package/dist/course/dto/create-course-structure-lesson.dto.d.ts.map +1 -1
  34. package/dist/course/dto/create-course-structure-lesson.dto.js +16 -2
  35. package/dist/course/dto/create-course-structure-lesson.dto.js.map +1 -1
  36. package/dist/course/dto/create-course.dto.d.ts +1 -0
  37. package/dist/course/dto/create-course.dto.d.ts.map +1 -1
  38. package/dist/course/dto/create-course.dto.js +9 -0
  39. package/dist/course/dto/create-course.dto.js.map +1 -1
  40. package/dist/enterprise/enterprise.controller.d.ts +3 -3
  41. package/dist/enterprise/enterprise.controller.d.ts.map +1 -1
  42. package/dist/enterprise/enterprise.controller.js +0 -1
  43. package/dist/enterprise/enterprise.controller.js.map +1 -1
  44. package/dist/enterprise/enterprise.service.d.ts +3 -3
  45. package/dist/evaluation/evaluation.service.d.ts.map +1 -1
  46. package/dist/evaluation/evaluation.service.js +9 -2
  47. package/dist/evaluation/evaluation.service.js.map +1 -1
  48. package/dist/index.d.ts +1 -0
  49. package/dist/index.d.ts.map +1 -1
  50. package/dist/index.js +1 -0
  51. package/dist/index.js.map +1 -1
  52. package/dist/lms.module.d.ts.map +1 -1
  53. package/dist/lms.module.js +3 -0
  54. package/dist/lms.module.js.map +1 -1
  55. package/dist/video-resolution-profile/dto/create-video-resolution-profile.dto.d.ts +6 -0
  56. package/dist/video-resolution-profile/dto/create-video-resolution-profile.dto.d.ts.map +1 -0
  57. package/dist/video-resolution-profile/dto/create-video-resolution-profile.dto.js +33 -0
  58. package/dist/video-resolution-profile/dto/create-video-resolution-profile.dto.js.map +1 -0
  59. package/dist/video-resolution-profile/dto/update-video-resolution-profile.dto.d.ts +6 -0
  60. package/dist/video-resolution-profile/dto/update-video-resolution-profile.dto.d.ts.map +1 -0
  61. package/dist/video-resolution-profile/dto/update-video-resolution-profile.dto.js +33 -0
  62. package/dist/video-resolution-profile/dto/update-video-resolution-profile.dto.js.map +1 -0
  63. package/dist/video-resolution-profile/video-resolution-profile.controller.d.ts +38 -0
  64. package/dist/video-resolution-profile/video-resolution-profile.controller.d.ts.map +1 -0
  65. package/dist/video-resolution-profile/video-resolution-profile.controller.js +89 -0
  66. package/dist/video-resolution-profile/video-resolution-profile.controller.js.map +1 -0
  67. package/dist/video-resolution-profile/video-resolution-profile.mcp-tools.d.ts +26 -0
  68. package/dist/video-resolution-profile/video-resolution-profile.mcp-tools.d.ts.map +1 -0
  69. package/dist/video-resolution-profile/video-resolution-profile.mcp-tools.js +160 -0
  70. package/dist/video-resolution-profile/video-resolution-profile.mcp-tools.js.map +1 -0
  71. package/dist/video-resolution-profile/video-resolution-profile.module.d.ts +3 -0
  72. package/dist/video-resolution-profile/video-resolution-profile.module.d.ts.map +1 -0
  73. package/dist/video-resolution-profile/video-resolution-profile.module.js +26 -0
  74. package/dist/video-resolution-profile/video-resolution-profile.module.js.map +1 -0
  75. package/dist/video-resolution-profile/video-resolution-profile.service.d.ts +45 -0
  76. package/dist/video-resolution-profile/video-resolution-profile.service.d.ts.map +1 -0
  77. package/dist/video-resolution-profile/video-resolution-profile.service.js +117 -0
  78. package/dist/video-resolution-profile/video-resolution-profile.service.js.map +1 -0
  79. package/hedhog/data/menu.yaml +17 -0
  80. package/hedhog/data/route.yaml +133 -0
  81. package/hedhog/data/video_resolution_profile.yaml +7 -0
  82. package/hedhog/frontend/app/_components/class-form-sheet.tsx.ejs +269 -324
  83. package/hedhog/frontend/app/_components/course-form-sheet.tsx.ejs +124 -70
  84. package/hedhog/frontend/app/_components/create-lms-instructor-sheet.tsx.ejs +7 -4
  85. package/hedhog/frontend/app/_components/create-lms-person-sheet.tsx.ejs +2 -2
  86. package/hedhog/frontend/app/_components/create-lms-student-person-sheet.tsx.ejs +2 -2
  87. package/hedhog/frontend/app/_lib/editor/templateSerializer.ts.ejs +34 -4
  88. package/hedhog/frontend/app/_lib/editor/types.ts.ejs +28 -3
  89. package/hedhog/frontend/app/achievements/page.tsx.ejs +9 -3
  90. package/hedhog/frontend/app/bitcodes/page.tsx.ejs +9 -3
  91. package/hedhog/frontend/app/certificates/issued/page.tsx.ejs +7 -3
  92. package/hedhog/frontend/app/certificates/models/CanvasStage.tsx.ejs +29 -8
  93. package/hedhog/frontend/app/certificates/models/LeftPanel.tsx.ejs +14 -0
  94. package/hedhog/frontend/app/certificates/models/RightPanel.tsx.ejs +194 -9
  95. package/hedhog/frontend/app/certificates/models/page.tsx.ejs +15 -5
  96. package/hedhog/frontend/app/classes/[id]/page.tsx.ejs +9 -5
  97. package/hedhog/frontend/app/classes/page.tsx.ejs +73 -47
  98. package/hedhog/frontend/app/courses/[id]/_components/CourseCertificateCard.tsx.ejs +19 -9
  99. package/hedhog/frontend/app/courses/[id]/_components/CourseClassificationCard.tsx.ejs +24 -1
  100. package/hedhog/frontend/app/courses/[id]/_components/CourseContentCard.tsx.ejs +1 -1
  101. package/hedhog/frontend/app/courses/[id]/_components/CourseMainInfoCard.tsx.ejs +1 -1
  102. package/hedhog/frontend/app/courses/[id]/_components/CourseRelationsCard.tsx.ejs +28 -16
  103. package/hedhog/frontend/app/courses/[id]/_components/CourseSectionCard.tsx.ejs +11 -6
  104. package/hedhog/frontend/app/courses/[id]/_components/CourseSummaryCard.tsx.ejs +7 -4
  105. package/hedhog/frontend/app/courses/[id]/_components/course-edit-types.ts.ejs +1 -0
  106. package/hedhog/frontend/app/courses/[id]/page.tsx.ejs +24 -87
  107. package/hedhog/frontend/app/courses/[id]/structure/_components/editor-course.tsx.ejs +892 -411
  108. package/hedhog/frontend/app/courses/[id]/structure/_components/editor-lesson.tsx.ejs +1004 -293
  109. package/hedhog/frontend/app/courses/[id]/structure/_components/editor-session.tsx.ejs +11 -11
  110. package/hedhog/frontend/app/courses/[id]/structure/_components/shortcuts-help.tsx.ejs +62 -52
  111. package/hedhog/frontend/app/courses/[id]/structure/_components/types.ts.ejs +2 -0
  112. package/hedhog/frontend/app/courses/[id]/structure/_data/adapters/course-structure.adapter.ts.ejs +19 -6
  113. package/hedhog/frontend/app/courses/[id]/structure/_data/services/course-structure.service.ts.ejs +86 -1
  114. package/hedhog/frontend/app/courses/[id]/structure/_data/types/api-course.types.ts.ejs +3 -0
  115. package/hedhog/frontend/app/courses/[id]/structure/_data/use-course-structure-mutations.ts.ejs +1 -0
  116. package/hedhog/frontend/app/courses/page.tsx.ejs +112 -89
  117. package/hedhog/frontend/app/enterprise/[id]/page.tsx.ejs +1 -1
  118. package/hedhog/frontend/app/enterprise/_components/enterprise-admin-create-sheet.tsx.ejs +10 -3
  119. package/hedhog/frontend/app/enterprise/_components/enterprise-detail-sheet.tsx.ejs +8 -4
  120. package/hedhog/frontend/app/enterprise/_components/enterprise-person-edit-sheet.tsx.ejs +2 -2
  121. package/hedhog/frontend/app/enterprise/_components/enterprise-sheet.tsx.ejs +10 -4
  122. package/hedhog/frontend/app/enterprise/_components/enterprise-student-create-sheet.tsx.ejs +10 -3
  123. package/hedhog/frontend/app/enterprise/_components/enterprise-user-create-sheet.tsx.ejs +10 -3
  124. package/hedhog/frontend/app/evaluations/_components/evaluation-topic-form-sheet.tsx.ejs +10 -3
  125. package/hedhog/frontend/app/exams/[id]/questions/page.tsx.ejs +23 -9
  126. package/hedhog/frontend/app/exams/page.tsx.ejs +14 -6
  127. package/hedhog/frontend/app/instructor-skills/page.tsx.ejs +9 -3
  128. package/hedhog/frontend/app/instructors/_components/instructor-form-sheet.tsx.ejs +190 -17
  129. package/hedhog/frontend/app/layout.tsx.ejs +5 -1
  130. package/hedhog/frontend/app/paths/page.tsx.ejs +13 -5
  131. package/hedhog/frontend/app/reports/evaluations/page.tsx.ejs +10 -10
  132. package/hedhog/frontend/app/training/page.tsx.ejs +13 -5
  133. package/hedhog/frontend/app/video-resolution-profiles/page.tsx.ejs +607 -0
  134. package/hedhog/frontend/messages/en.json +250 -9
  135. package/hedhog/frontend/messages/pt.json +250 -9
  136. package/hedhog/table/course.yaml +4 -0
  137. package/hedhog/table/course_lesson_file.yaml +8 -0
  138. package/hedhog/table/course_video_resolution_profile.yaml +22 -0
  139. package/hedhog/table/video_resolution_profile.yaml +18 -0
  140. package/package.json +9 -8
  141. package/src/certificate/certificate.controller.ts +19 -14
  142. package/src/certificate/certificate.service.ts +106 -11
  143. package/src/course/course-structure.controller.ts +24 -2
  144. package/src/course/course-structure.service.ts +21 -4
  145. package/src/course/course-video-conversion.service.ts +415 -0
  146. package/src/course/course.controller.ts +18 -0
  147. package/src/course/course.module.ts +15 -2
  148. package/src/course/course.service.ts +72 -2
  149. package/src/course/dto/create-course-structure-lesson.dto.ts +13 -2
  150. package/src/course/dto/create-course.dto.ts +8 -0
  151. package/src/enterprise/enterprise.controller.ts +0 -1
  152. package/src/evaluation/evaluation.service.ts +9 -2
  153. package/src/index.ts +1 -0
  154. package/src/lms.module.ts +3 -0
  155. package/src/video-resolution-profile/dto/create-video-resolution-profile.dto.ts +16 -0
  156. package/src/video-resolution-profile/dto/update-video-resolution-profile.dto.ts +16 -0
  157. package/src/video-resolution-profile/video-resolution-profile.controller.ts +62 -0
  158. package/src/video-resolution-profile/video-resolution-profile.mcp-tools.ts +128 -0
  159. package/src/video-resolution-profile/video-resolution-profile.module.ts +13 -0
  160. package/src/video-resolution-profile/video-resolution-profile.service.ts +117 -0
@@ -0,0 +1,308 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ var CourseVideoConversionService_1;
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.CourseVideoConversionService = exports.LMS_VIDEO_CONVERSION_JOB = void 0;
17
+ const api_prisma_1 = require("@hed-hog/api-prisma");
18
+ const core_1 = require("@hed-hog/core");
19
+ const queue_1 = require("@hed-hog/queue");
20
+ const common_1 = require("@nestjs/common");
21
+ const child_process_1 = require("child_process");
22
+ const fs_1 = require("fs");
23
+ const os_1 = require("os");
24
+ const path_1 = require("path");
25
+ const util_1 = require("util");
26
+ exports.LMS_VIDEO_CONVERSION_JOB = 'lms.video.convert';
27
+ const execFileAsync = (0, util_1.promisify)(child_process_1.execFile);
28
+ let CourseVideoConversionService = CourseVideoConversionService_1 = class CourseVideoConversionService {
29
+ constructor(prisma, fileService, registry, queueJob) {
30
+ this.prisma = prisma;
31
+ this.fileService = fileService;
32
+ this.registry = registry;
33
+ this.queueJob = queueJob;
34
+ this.logger = new common_1.Logger(CourseVideoConversionService_1.name);
35
+ }
36
+ onModuleInit() {
37
+ this.registry.register(exports.LMS_VIDEO_CONVERSION_JOB, this);
38
+ this.logger.log(`Registered handler for "${exports.LMS_VIDEO_CONVERSION_JOB}"`);
39
+ }
40
+ async enqueueConversion(params) {
41
+ var _a, _b, _c;
42
+ const lesson = await this.prisma.course_lesson.findFirst({
43
+ where: {
44
+ id: params.lessonId,
45
+ course_module_id: params.sessionId,
46
+ course_module: { course_id: params.courseId },
47
+ },
48
+ include: { course_module: true },
49
+ });
50
+ if (!lesson) {
51
+ throw new common_1.NotFoundException('Lesson not found for this course session');
52
+ }
53
+ const content = this.parseContent(lesson.content);
54
+ if (lesson.type !== 'video' || (content === null || content === void 0 ? void 0 : content.sourceType) !== 'video') {
55
+ throw new common_1.BadRequestException('Video conversion is only available for video lessons');
56
+ }
57
+ if ((content === null || content === void 0 ? void 0 : content.videoProvedor) !== 'file_storage') {
58
+ throw new common_1.BadRequestException('Video conversion requires File Storage provider');
59
+ }
60
+ const original = await this.prisma.file.findUnique({
61
+ where: { id: params.originalFileId },
62
+ include: { file_mimetype: true },
63
+ });
64
+ if (!original) {
65
+ throw new common_1.NotFoundException('Original video file not found');
66
+ }
67
+ const mimetype = (_b = (_a = original.file_mimetype) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : '';
68
+ if (!mimetype.startsWith('video/')) {
69
+ throw new common_1.BadRequestException('Original file must be a video');
70
+ }
71
+ const profiles = await this.getCourseProfiles(params.courseId);
72
+ if (profiles.length === 0) {
73
+ throw new common_1.BadRequestException('Course has no video resolution profiles');
74
+ }
75
+ await this.upsertLessonFile({
76
+ lessonId: params.lessonId,
77
+ type: 'video_original',
78
+ fileId: params.originalFileId,
79
+ title: (_c = original.filename) !== null && _c !== void 0 ? _c : `Original video ${params.originalFileId}`,
80
+ public: false,
81
+ overwrite: true,
82
+ });
83
+ const job = await this.queueJob.enqueue({
84
+ type: exports.LMS_VIDEO_CONVERSION_JOB,
85
+ queueName: exports.LMS_VIDEO_CONVERSION_JOB,
86
+ payload: {
87
+ courseId: params.courseId,
88
+ sessionId: params.sessionId,
89
+ lessonId: params.lessonId,
90
+ originalFileId: params.originalFileId,
91
+ profiles,
92
+ overwrite: true,
93
+ },
94
+ sourceModule: 'lms',
95
+ sourceEntity: 'course_lesson',
96
+ sourceEntityId: String(params.lessonId),
97
+ maxAttempts: 3,
98
+ });
99
+ await this.prisma.course_lesson.update({
100
+ where: { id: params.lessonId },
101
+ data: {
102
+ content: JSON.stringify(Object.assign(Object.assign({}, (content !== null && content !== void 0 ? content : {})), { sourceType: 'video', videoConversionJobId: job.id })),
103
+ },
104
+ });
105
+ return { queueJobId: job.id, status: 'queued' };
106
+ }
107
+ async handle(job) {
108
+ var _a, _b;
109
+ const { courseId, sessionId, lessonId, originalFileId, profiles, overwrite } = job.payload;
110
+ if (!courseId || !sessionId || !lessonId || !originalFileId || !(profiles === null || profiles === void 0 ? void 0 : profiles.length)) {
111
+ throw new Error('Invalid LMS video conversion payload');
112
+ }
113
+ const currentProfiles = await this.getCourseProfiles(courseId);
114
+ const profileIds = new Set(currentProfiles.map((profile) => profile.id));
115
+ const profilesToProcess = profiles.filter((profile) => profileIds.has(profile.id));
116
+ if (profilesToProcess.length === 0) {
117
+ throw new Error('Course has no active profiles to process');
118
+ }
119
+ const maxInputBytes = this.getPositiveIntegerEnv('LMS_VIDEO_MAX_INPUT_BYTES');
120
+ const ffmpegTimeoutMs = (_a = this.getPositiveIntegerEnv('LMS_VIDEO_FFMPEG_TIMEOUT_MS')) !== null && _a !== void 0 ? _a : 1000 * 60 * 60;
121
+ const workDir = await fs_1.promises.mkdtemp((0, path_1.join)((0, os_1.tmpdir)(), `lms-video-${job.id}-`));
122
+ const inputPath = (0, path_1.join)(workDir, `original-${originalFileId}.mp4`);
123
+ this.logger.log(`Queue job ${job.id}: starting LMS video conversion (lesson=${lessonId}, profiles=${profilesToProcess.length})`);
124
+ const downloadedOriginal = await this.fileService.downloadToPath(originalFileId, inputPath, maxInputBytes ? { maxBytes: maxInputBytes } : undefined);
125
+ this.logger.log(`Queue job ${job.id}: original file downloaded (lesson=${lessonId}, size=${downloadedOriginal.size})`);
126
+ const jobStartedAt = Date.now();
127
+ const results = [];
128
+ try {
129
+ for (const profile of profilesToProcess) {
130
+ const profileStartedAt = Date.now();
131
+ const outputPath = (0, path_1.join)(workDir, `${this.slugify(profile.name || String(profile.id))}-${profile.id}.mp4`);
132
+ this.logger.log(`Queue job ${job.id}: converting profile ${profile.id} for lesson ${lessonId}`);
133
+ const conversionStartedAt = Date.now();
134
+ await this.convert(inputPath, outputPath, profile.ffmpeg_params, ffmpegTimeoutMs);
135
+ const conversionMs = Date.now() - conversionStartedAt;
136
+ const outputStats = await fs_1.promises.stat(outputPath);
137
+ const uploadStartedAt = Date.now();
138
+ const uploaded = await this.fileService.uploadFromPath('lms/lessons/videos', outputPath, {
139
+ originalname: (0, path_1.basename)(outputPath),
140
+ mimetype: 'video/mp4',
141
+ });
142
+ const uploadMs = Date.now() - uploadStartedAt;
143
+ const totalMs = Date.now() - profileStartedAt;
144
+ const conversionMBps = this.calculateMBps(outputStats.size, conversionMs);
145
+ const uploadMBps = this.calculateMBps(outputStats.size, uploadMs);
146
+ await this.upsertLessonFile({
147
+ lessonId,
148
+ type: this.profileResourceType(profile.id),
149
+ fileId: uploaded.id,
150
+ title: (_b = uploaded.filename) !== null && _b !== void 0 ? _b : (0, path_1.basename)(outputPath),
151
+ public: false,
152
+ overwrite: overwrite !== false,
153
+ });
154
+ results.push({
155
+ profileId: profile.id,
156
+ fileId: uploaded.id,
157
+ outputBytes: outputStats.size,
158
+ conversionMs,
159
+ conversionMBps,
160
+ uploadMs,
161
+ uploadMBps,
162
+ totalMs,
163
+ });
164
+ this.logger.log(`Queue job ${job.id}: profile ${profile.id} done for lesson ${lessonId} (fileId=${uploaded.id}, outputBytes=${outputStats.size}, conversionMs=${conversionMs}, conversionMBps=${conversionMBps.toFixed(2)}, uploadMs=${uploadMs}, uploadMBps=${uploadMBps.toFixed(2)}, totalMs=${totalMs})`);
165
+ }
166
+ }
167
+ finally {
168
+ await fs_1.promises.rm(workDir, { recursive: true, force: true }).catch(() => undefined);
169
+ this.logger.log(`Queue job ${job.id}: cleaned temporary folder ${workDir}`);
170
+ }
171
+ const totalMs = Date.now() - jobStartedAt;
172
+ const totalOutputBytes = results.reduce((acc, item) => acc + item.outputBytes, 0);
173
+ this.logger.log(`Queue job ${job.id}: LMS conversion finished (lesson=${lessonId}, profiles=${results.length}, totalMs=${totalMs}, totalOutputBytes=${totalOutputBytes})`);
174
+ return {
175
+ lessonId,
176
+ converted: results.length,
177
+ results,
178
+ metrics: {
179
+ totalMs,
180
+ totalOutputBytes,
181
+ averageProfileMs: results.length > 0
182
+ ? Math.round(results.reduce((acc, item) => acc + item.totalMs, 0) / results.length)
183
+ : 0,
184
+ averageConversionMBps: results.length > 0
185
+ ? Number((results.reduce((acc, item) => acc + item.conversionMBps, 0) / results.length).toFixed(2))
186
+ : 0,
187
+ averageUploadMBps: results.length > 0
188
+ ? Number((results.reduce((acc, item) => acc + item.uploadMBps, 0) / results.length).toFixed(2))
189
+ : 0,
190
+ },
191
+ };
192
+ }
193
+ async getCourseProfiles(courseId) {
194
+ const rows = await this.prisma.course_video_resolution_profile.findMany({
195
+ where: { course_id: courseId },
196
+ include: { video_resolution_profile: true },
197
+ orderBy: { video_resolution_profile: { name: 'asc' } },
198
+ });
199
+ return rows
200
+ .map((row) => row.video_resolution_profile)
201
+ .filter((profile) => (profile === null || profile === void 0 ? void 0 : profile.status) !== 'inactive')
202
+ .map((profile) => ({
203
+ id: Number(profile.id),
204
+ name: profile.name,
205
+ ffmpeg_params: profile.ffmpeg_params,
206
+ }));
207
+ }
208
+ async upsertLessonFile(params) {
209
+ if (params.overwrite) {
210
+ await this.prisma.course_lesson_file.deleteMany({
211
+ where: {
212
+ course_lesson_id: params.lessonId,
213
+ tipo: params.type,
214
+ },
215
+ });
216
+ }
217
+ return this.prisma.course_lesson_file.create({
218
+ data: {
219
+ course_lesson_id: params.lessonId,
220
+ file_id: params.fileId,
221
+ title: params.title,
222
+ tipo: params.type,
223
+ publico: params.public,
224
+ },
225
+ });
226
+ }
227
+ async convert(inputPath, outputPath, params, timeoutMs) {
228
+ const args = ['-y', '-i', inputPath, ...this.splitFfmpegParams(params), outputPath];
229
+ try {
230
+ await execFileAsync('ffmpeg', args, {
231
+ maxBuffer: 1024 * 1024 * 20,
232
+ timeout: timeoutMs,
233
+ windowsHide: true,
234
+ });
235
+ }
236
+ catch (error) {
237
+ if ((error === null || error === void 0 ? void 0 : error.killed) && (error === null || error === void 0 ? void 0 : error.signal) === 'SIGTERM') {
238
+ throw new Error(`FFmpeg timed out after ${timeoutMs}ms`);
239
+ }
240
+ throw error;
241
+ }
242
+ }
243
+ getPositiveIntegerEnv(name) {
244
+ const raw = process.env[name];
245
+ if (!raw) {
246
+ return undefined;
247
+ }
248
+ const value = Number(raw);
249
+ if (!Number.isFinite(value) || value <= 0) {
250
+ return undefined;
251
+ }
252
+ return Math.floor(value);
253
+ }
254
+ calculateMBps(bytes, durationMs) {
255
+ if (!Number.isFinite(bytes) || bytes <= 0) {
256
+ return 0;
257
+ }
258
+ if (!Number.isFinite(durationMs) || durationMs <= 0) {
259
+ return 0;
260
+ }
261
+ const seconds = durationMs / 1000;
262
+ return Number((bytes / (1024 * 1024) / seconds).toFixed(2));
263
+ }
264
+ splitFfmpegParams(params) {
265
+ var _a, _b, _c;
266
+ const result = [];
267
+ const pattern = /"([^"]*)"|'([^']*)'|(\S+)/g;
268
+ let match;
269
+ while ((match = pattern.exec(params !== null && params !== void 0 ? params : ''))) {
270
+ result.push((_c = (_b = (_a = match[1]) !== null && _a !== void 0 ? _a : match[2]) !== null && _b !== void 0 ? _b : match[3]) !== null && _c !== void 0 ? _c : '');
271
+ }
272
+ return result.filter(Boolean);
273
+ }
274
+ profileResourceType(profileId) {
275
+ return `video_profile:${profileId}`;
276
+ }
277
+ slugify(value) {
278
+ return (value
279
+ .normalize('NFD')
280
+ .replace(/[\u0300-\u036f]/g, '')
281
+ .toLowerCase()
282
+ .replace(/[^a-z0-9]+/g, '-')
283
+ .replace(/^-+|-+$/g, '') || 'video');
284
+ }
285
+ parseContent(content) {
286
+ if (!content)
287
+ return null;
288
+ try {
289
+ return JSON.parse(content);
290
+ }
291
+ catch (_a) {
292
+ return null;
293
+ }
294
+ }
295
+ };
296
+ exports.CourseVideoConversionService = CourseVideoConversionService;
297
+ exports.CourseVideoConversionService = CourseVideoConversionService = CourseVideoConversionService_1 = __decorate([
298
+ (0, common_1.Injectable)(),
299
+ __param(0, (0, common_1.Inject)((0, common_1.forwardRef)(() => api_prisma_1.PrismaService))),
300
+ __param(1, (0, common_1.Inject)((0, common_1.forwardRef)(() => core_1.FileService))),
301
+ __param(2, (0, common_1.Inject)((0, common_1.forwardRef)(() => queue_1.QueueHandlerRegistry))),
302
+ __param(3, (0, common_1.Inject)((0, common_1.forwardRef)(() => queue_1.QueueJobService))),
303
+ __metadata("design:paramtypes", [api_prisma_1.PrismaService,
304
+ core_1.FileService,
305
+ queue_1.QueueHandlerRegistry,
306
+ queue_1.QueueJobService])
307
+ ], CourseVideoConversionService);
308
+ //# sourceMappingURL=course-video-conversion.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"course-video-conversion.service.js","sourceRoot":"","sources":["../../src/course/course-video-conversion.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAoD;AACpD,wCAA4C;AAC5C,0CAAoF;AACpF,2CAQwB;AACxB,iDAAyC;AACzC,2BAAoC;AACpC,2BAA4B;AAC5B,+BAAsC;AACtC,+BAAiC;AAEpB,QAAA,wBAAwB,GAAG,mBAAmB,CAAC;AAQ5D,MAAM,aAAa,GAAG,IAAA,gBAAS,EAAC,wBAAQ,CAAC,CAAC;AAGnC,IAAM,4BAA4B,oCAAlC,MAAM,4BAA4B;IAGvC,YAEE,MAAsC,EAEtC,WAAyC,EAEzC,QAA+C,EAE/C,QAA0C;QANzB,WAAM,GAAN,MAAM,CAAe;QAErB,gBAAW,GAAX,WAAW,CAAa;QAExB,aAAQ,GAAR,QAAQ,CAAsB;QAE9B,aAAQ,GAAR,QAAQ,CAAiB;QAV3B,WAAM,GAAG,IAAI,eAAM,CAAC,8BAA4B,CAAC,IAAI,CAAC,CAAC;IAWrE,CAAC;IAEJ,YAAY;QACV,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,gCAAwB,EAAE,IAAI,CAAC,CAAC;QACvD,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,2BAA2B,gCAAwB,GAAG,CAAC,CAAC;IAC1E,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,MAKvB;;QACC,MAAM,MAAM,GAAG,MAAO,IAAI,CAAC,MAAc,CAAC,aAAa,CAAC,SAAS,CAAC;YAChE,KAAK,EAAE;gBACL,EAAE,EAAE,MAAM,CAAC,QAAQ;gBACnB,gBAAgB,EAAE,MAAM,CAAC,SAAS;gBAClC,aAAa,EAAE,EAAE,SAAS,EAAE,MAAM,CAAC,QAAQ,EAAE;aAC9C;YACD,OAAO,EAAE,EAAE,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,EAAC,GAAG,EAAE,CAAC,kBAAW,CAAC,CAAC,CAAA;IAErC,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,4BAAoB,CAAC,CAAC,CAAA;IAE9C,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,uBAAe,CAAC,CAAC,CAAA;qCALjB,0BAAa;QAER,kBAAW;QAEd,4BAAoB;QAEpB,uBAAe;GAXjC,4BAA4B,CAiYxC"}
@@ -13,6 +13,7 @@ export declare class CourseController {
13
13
  id: any;
14
14
  name: any;
15
15
  slug: any;
16
+ code: any;
16
17
  title: any;
17
18
  description: any;
18
19
  level: any;
@@ -55,6 +56,7 @@ export declare class CourseController {
55
56
  moduleCount: any;
56
57
  classCount: any;
57
58
  lessonCount: number;
59
+ resourceCount: any;
58
60
  sessionCount: number;
59
61
  averageCompletion: number;
60
62
  certificatesIssued: any;
@@ -80,6 +82,7 @@ export declare class CourseController {
80
82
  id: any;
81
83
  name: any;
82
84
  slug: any;
85
+ code: any;
83
86
  title: any;
84
87
  description: any;
85
88
  level: any;
@@ -122,6 +125,7 @@ export declare class CourseController {
122
125
  moduleCount: any;
123
126
  classCount: any;
124
127
  lessonCount: number;
128
+ resourceCount: any;
125
129
  sessionCount: number;
126
130
  averageCompletion: number;
127
131
  certificatesIssued: any;
@@ -139,6 +143,7 @@ export declare class CourseController {
139
143
  id: any;
140
144
  name: any;
141
145
  slug: any;
146
+ code: any;
142
147
  title: any;
143
148
  description: any;
144
149
  level: any;
@@ -181,6 +186,7 @@ export declare class CourseController {
181
186
  moduleCount: any;
182
187
  classCount: any;
183
188
  lessonCount: number;
189
+ resourceCount: any;
184
190
  sessionCount: number;
185
191
  averageCompletion: number;
186
192
  certificatesIssued: any;
@@ -198,6 +204,7 @@ export declare class CourseController {
198
204
  id: any;
199
205
  name: any;
200
206
  slug: any;
207
+ code: any;
201
208
  title: any;
202
209
  description: any;
203
210
  level: any;
@@ -240,6 +247,7 @@ export declare class CourseController {
240
247
  moduleCount: any;
241
248
  classCount: any;
242
249
  lessonCount: number;
250
+ resourceCount: any;
243
251
  sessionCount: number;
244
252
  averageCompletion: number;
245
253
  certificatesIssued: any;
@@ -256,5 +264,14 @@ export declare class CourseController {
256
264
  remove(id: number): Promise<{
257
265
  success: boolean;
258
266
  }>;
267
+ getCourseVideoProfiles(courseId: number): Promise<{
268
+ id: any;
269
+ name: any;
270
+ ffmpeg_params: any;
271
+ status: any;
272
+ }[]>;
273
+ syncCourseVideoProfiles(courseId: number, body: {
274
+ profileIds: number[];
275
+ }): Promise<any>;
259
276
  }
260
277
  //# sourceMappingURL=course.controller.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"course.controller.d.ts","sourceRoot":"","sources":["../../src/course/course.controller.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,qBAEa,gBAAgB;IACf,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAAb,aAAa,EAAE,aAAa;IAGzD,IAAI,CACa,IAAI,CAAC,EAAE,MAAM,EACT,QAAQ,CAAC,EAAE,MAAM,EACnB,MAAM,CAAC,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,MAAM,EAChB,KAAK,CAAC,EAAE,MAAM,EACX,QAAQ,CAAC,EAAE,MAAM,EACZ,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAa3D,OAAO,CAAC,OAAO;IAiBf,KAAK;;;;;;IAKL,OAAO,CAA4B,EAAE,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAK7C,M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,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAM9B,MAAM,CAA4B,EAAE,EAAE,MAAM;;;IAK5C,sBAAsB,CACa,QAAQ,EAAE,MAAM;;;;;;IAOnD,uBAAuB,CACY,QAAQ,EAAE,MAAM,EACzC,IAAI,EAAE;QAAE,UAAU,EAAE,MAAM,EAAE,CAAA;KAAE;CAIzC"}
@@ -63,6 +63,13 @@ let CourseController = class CourseController {
63
63
  remove(id) {
64
64
  return this.courseService.remove(id);
65
65
  }
66
+ getCourseVideoProfiles(courseId) {
67
+ return this.courseService.getCourseVideoProfiles(courseId);
68
+ }
69
+ syncCourseVideoProfiles(courseId, body) {
70
+ var _a;
71
+ return this.courseService.syncCourseVideoProfiles(courseId, (_a = body.profileIds) !== null && _a !== void 0 ? _a : []);
72
+ }
66
73
  };
67
74
  exports.CourseController = CourseController;
68
75
  __decorate([
@@ -113,6 +120,22 @@ __decorate([
113
120
  __metadata("design:paramtypes", [Number]),
114
121
  __metadata("design:returntype", void 0)
115
122
  ], CourseController.prototype, "remove", null);
123
+ __decorate([
124
+ (0, common_1.Get)(':courseId/video-resolution-profiles'),
125
+ __param(0, (0, common_1.Param)('courseId', common_1.ParseIntPipe)),
126
+ __metadata("design:type", Function),
127
+ __metadata("design:paramtypes", [Number]),
128
+ __metadata("design:returntype", void 0)
129
+ ], CourseController.prototype, "getCourseVideoProfiles", null);
130
+ __decorate([
131
+ (0, common_1.Post)(':courseId/video-resolution-profiles/sync'),
132
+ (0, common_1.HttpCode)(common_1.HttpStatus.OK),
133
+ __param(0, (0, common_1.Param)('courseId', common_1.ParseIntPipe)),
134
+ __param(1, (0, common_1.Body)()),
135
+ __metadata("design:type", Function),
136
+ __metadata("design:paramtypes", [Number, Object]),
137
+ __metadata("design:returntype", void 0)
138
+ ], CourseController.prototype, "syncCourseVideoProfiles", null);
116
139
  exports.CourseController = CourseController = __decorate([
117
140
  (0, api_1.Role)(),
118
141
  (0, common_1.Controller)('lms/courses'),
@@ -1 +1 @@
1
- {"version":3,"file":"course.controller.js","sourceRoot":"","sources":["../../src/course/course.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,sCAAoC;AACpC,2CAUwB;AACxB,qDAAiD;AACjD,+DAA0D;AAC1D,+DAA0D;AAInD,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAC3B,YAA6B,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;IAAG,CAAC;IAG7D,IAAI,CACa,IAAa,EACT,QAAiB,EACnB,MAAe,EACf,MAAe,EAChB,KAAc,EACX,QAAiB,EACZ,aAAiC;QAEzD,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC;YAC7B,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;YAC7B,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE;YAC1C,MAAM;YACN,MAAM;YACN,KAAK;YACL,QAAQ;YACR,aAAa,EAAE,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC;SAC3C,CAAC,CAAC;IACL,CAAC;IAEO,OAAO,CAAC,KAAyB;QACvC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACzB,OAAO,KAAK;iBACT,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;iBAC1C,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;iBAC1B,MAAM,CAAC,OAAO,CAAC,CAAC;QACrB,CAAC;QACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,OAAO,KAAK;iBACT,KAAK,CAAC,GAAG,CAAC;iBACV,GAAG,CAA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AI,EAAC,0CAA0C,CAAC;IAChD,IAAA,iBAAQ,EAAC,mBAAU,CAAC,EAAE,CAAC;IAErB,WAAA,IAAA,cAAK,EAAC,UAAU,EAAE,qBAAY,CAAC,CAAA;IAC/B,WAAA,IAAA,aAAI,GAAE,CAAA;;;;+DAGR;2BAlFU,gBAAgB;IAF5B,IAAA,UAAI,GAAE;IACN,IAAA,mBAAU,EAAC,aAAa,CAAC;qCAEoB,8BAAa;GAD9C,gBAAgB,CAmF5B"}
@@ -1 +1 @@
1
- {"version":3,"file":"course.module.d.ts","sourceRoot":"","sources":["../../src/course/course.module.ts"],"names":[],"mappings":"AAUA,qBAWa,YAAY;CAAG"}
1
+ {"version":3,"file":"course.module.d.ts","sourceRoot":"","sources":["../../src/course/course.module.ts"],"names":[],"mappings":"AAaA,qBAqBa,YAAY;CAAG"}
@@ -8,10 +8,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.CourseModule = void 0;
10
10
  const api_prisma_1 = require("@hed-hog/api-prisma");
11
+ const core_1 = require("@hed-hog/core");
12
+ const queue_1 = require("@hed-hog/queue");
11
13
  const common_1 = require("@nestjs/common");
12
14
  const course_operations_integration_service_1 = require("./course-operations-integration.service");
13
15
  const course_structure_controller_1 = require("./course-structure.controller");
14
16
  const course_structure_service_1 = require("./course-structure.service");
17
+ const course_video_conversion_service_1 = require("./course-video-conversion.service");
15
18
  const course_mcp_tools_1 = require("./course.mcp-tools");
16
19
  const course_controller_1 = require("./course.controller");
17
20
  const course_service_1 = require("./course.service");
@@ -21,15 +24,25 @@ let CourseModule = class CourseModule {
21
24
  exports.CourseModule = CourseModule;
22
25
  exports.CourseModule = CourseModule = __decorate([
23
26
  (0, common_1.Module)({
24
- imports: [(0, common_1.forwardRef)(() => api_prisma_1.PrismaModule), (0, common_1.forwardRef)(() => instructor_module_1.InstructorModule)],
27
+ imports: [
28
+ (0, common_1.forwardRef)(() => api_prisma_1.PrismaModule),
29
+ (0, common_1.forwardRef)(() => instructor_module_1.InstructorModule),
30
+ (0, common_1.forwardRef)(() => core_1.CoreModule),
31
+ (0, common_1.forwardRef)(() => queue_1.QueueModule),
32
+ ],
25
33
  controllers: [course_controller_1.CourseController, course_structure_controller_1.CourseStructureController],
26
34
  providers: [
27
35
  course_operations_integration_service_1.CourseOperationsIntegrationService,
28
36
  course_service_1.CourseService,
29
37
  course_structure_service_1.CourseStructureService,
38
+ course_video_conversion_service_1.CourseVideoConversionService,
30
39
  course_mcp_tools_1.LmsCoursesMcpTools,
31
40
  ],
32
- exports: [(0, common_1.forwardRef)(() => course_service_1.CourseService), (0, common_1.forwardRef)(() => course_structure_service_1.CourseStructureService)],
41
+ exports: [
42
+ (0, common_1.forwardRef)(() => course_service_1.CourseService),
43
+ (0, common_1.forwardRef)(() => course_structure_service_1.CourseStructureService),
44
+ (0, common_1.forwardRef)(() => course_video_conversion_service_1.CourseVideoConversionService),
45
+ ],
33
46
  })
34
47
  ], CourseModule);
35
48
  //# sourceMappingURL=course.module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"course.module.js","sourceRoot":"","sources":["../../src/course/course.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,oDAAmD;AACnD,2CAAoD;AACpD,mGAA6F;AAC7F,+EAA0E;AAC1E,yEAAoE;AACpE,yDAAwD;AACxD,2DAAuD;AACvD,qDAAiD;AACjD,uEAAmE;AAa5D,IAAM,YAAY,GAAlB,MAAM,YAAY;CAAG,CAAA;AAAf,oCAAY;uBAAZ,YAAY;IAXxB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,yBAAY,CAAC,EAAE,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,oCAAgB,CAAC,CAAC;QAC7E,WAAW,EAAE,CAAC,oCAAgB,EAAE,uDAAyB,CAAC;QAC1D,SAAS,EAAE;YACT,0EAAkC;YAClC,8BAAa;YACb,iDAAsB;YACtB,qCAAkB;SACnB;QACD,OAAO,EAAE,CAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,8BAAa,CAAC,EAAE,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,iDAAsB,CAAC,CAAC;KACrF,CAAC;GACW,YAAY,CAAG"}
1
+ {"version":3,"file":"course.module.js","sourceRoot":"","sources":["../../src/course/course.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,oDAAmD;AACnD,wCAA2C;AAC3C,0CAA6C;AAC7C,2CAAoD;AACpD,mGAA6F;AAC7F,+EAA0E;AAC1E,yEAAoE;AACpE,uFAAiF;AACjF,yDAAwD;AACxD,2DAAuD;AACvD,qDAAiD;AACjD,uEAAmE;AAuB5D,IAAM,YAAY,GAAlB,MAAM,YAAY;CAAG,CAAA;AAAf,oCAAY;uBAAZ,YAAY;IArBxB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,yBAAY,CAAC;YAC9B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,oCAAgB,CAAC;YAClC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,iBAAU,CAAC;YAC5B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,mBAAW,CAAC;SAC9B;QACD,WAAW,EAAE,CAAC,oCAAgB,EAAE,uDAAyB,CAAC;QAC1D,SAAS,EAAE;YACT,0EAAkC;YAClC,8BAAa;YACb,iDAAsB;YACtB,8DAA4B;YAC5B,qCAAkB;SACnB;QACD,OAAO,EAAE;YACP,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,8BAAa,CAAC;YAC/B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,iDAAsB,CAAC;YACxC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,8DAA4B,CAAC;SAC/C;KACF,CAAC;GACW,YAAY,CAAG"}
@@ -31,6 +31,7 @@ export declare class CourseService {
31
31
  id: any;
32
32
  name: any;
33
33
  slug: any;
34
+ code: any;
34
35
  title: any;
35
36
  description: any;
36
37
  level: any;
@@ -73,6 +74,7 @@ export declare class CourseService {
73
74
  moduleCount: any;
74
75
  classCount: any;
75
76
  lessonCount: number;
77
+ resourceCount: any;
76
78
  sessionCount: number;
77
79
  averageCompletion: number;
78
80
  certificatesIssued: any;
@@ -97,6 +99,7 @@ export declare class CourseService {
97
99
  id: any;
98
100
  name: any;
99
101
  slug: any;
102
+ code: any;
100
103
  title: any;
101
104
  description: any;
102
105
  level: any;
@@ -139,6 +142,7 @@ export declare class CourseService {
139
142
  moduleCount: any;
140
143
  classCount: any;
141
144
  lessonCount: number;
145
+ resourceCount: any;
142
146
  sessionCount: number;
143
147
  averageCompletion: number;
144
148
  certificatesIssued: any;
@@ -156,6 +160,7 @@ export declare class CourseService {
156
160
  id: any;
157
161
  name: any;
158
162
  slug: any;
163
+ code: any;
159
164
  title: any;
160
165
  description: any;
161
166
  level: any;
@@ -198,6 +203,7 @@ export declare class CourseService {
198
203
  moduleCount: any;
199
204
  classCount: any;
200
205
  lessonCount: number;
206
+ resourceCount: any;
201
207
  sessionCount: number;
202
208
  averageCompletion: number;
203
209
  certificatesIssued: any;
@@ -215,6 +221,7 @@ export declare class CourseService {
215
221
  id: any;
216
222
  name: any;
217
223
  slug: any;
224
+ code: any;
218
225
  title: any;
219
226
  description: any;
220
227
  level: any;
@@ -257,6 +264,7 @@ export declare class CourseService {
257
264
  moduleCount: any;
258
265
  classCount: any;
259
266
  lessonCount: number;
267
+ resourceCount: any;
260
268
  sessionCount: number;
261
269
  averageCompletion: number;
262
270
  certificatesIssued: any;
@@ -282,5 +290,12 @@ export declare class CourseService {
282
290
  private removeCourseImage;
283
291
  private upsertCourseImage;
284
292
  private getOrCreateCourseImageType;
293
+ getCourseVideoProfiles(courseId: number): Promise<{
294
+ id: any;
295
+ name: any;
296
+ ffmpeg_params: any;
297
+ status: any;
298
+ }[]>;
299
+ syncCourseVideoProfiles(courseId: number, profileIds: number[]): Promise<any>;
285
300
  }
286
301
  //# sourceMappingURL=course.service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"course.service.d.ts","sourceRoot":"","sources":["../../src/course/course.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,8BAA8B,EAAE,MAAM,eAAe,CAAC;AAE/D,OAAO,EAAE,kCAAkC,EAAE,MAAM,yCAAyC,CAAC;AAC7F,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AA0B1D,qBACa,aAAa;IAEtB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAEvB,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,qBAAqB;gBAHrB,MAAM,EAAE,aAAa,EAErB,cAAc,EAAE,8BAA8B,EAC9C,qBAAqB,EAAE,kCAAkC;IAG5E,OAAO,CAAC,cAAc;IAetB,OAAO,CAAC,eAAe;IAmBvB,OAAO,CAAC,qBAAqB;IAqB7B,OAAO,CAAC,qBAAqB;IAK7B,OAAO,CAAC,kBAAkB;YAIZ,4BAA4B;IA6BpC,IAAI,CAAC,MAAM,EAAE;QACjB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;KAC1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAqoBe,MAAM;6BACH,MAAM;0BACT,MAAM;;;;;;;IA5iBhB,KAAK;;;;;;IAiBL,OAAO,CAAC,EAAE,E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