@hed-hog/lms 0.0.364 → 0.0.365

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 (218) hide show
  1. package/dist/bitcode-wallet/bitcode-wallet.service.d.ts +1 -0
  2. package/dist/bitcode-wallet/bitcode-wallet.service.d.ts.map +1 -1
  3. package/dist/bitcode-wallet/bitcode-wallet.service.js +22 -3
  4. package/dist/bitcode-wallet/bitcode-wallet.service.js.map +1 -1
  5. package/dist/course/course-export-scorm12-worker.service.d.ts +21 -0
  6. package/dist/course/course-export-scorm12-worker.service.d.ts.map +1 -0
  7. package/dist/course/course-export-scorm12-worker.service.js +109 -0
  8. package/dist/course/course-export-scorm12-worker.service.js.map +1 -0
  9. package/dist/course/course-export-scorm12.service.d.ts +42 -0
  10. package/dist/course/course-export-scorm12.service.d.ts.map +1 -0
  11. package/dist/course/course-export-scorm12.service.js +628 -0
  12. package/dist/course/course-export-scorm12.service.js.map +1 -0
  13. package/dist/course/course-export.service.d.ts +84 -0
  14. package/dist/course/course-export.service.d.ts.map +1 -0
  15. package/dist/course/course-export.service.js +237 -0
  16. package/dist/course/course-export.service.js.map +1 -0
  17. package/dist/course/course-structure.controller.d.ts +17 -9
  18. package/dist/course/course-structure.controller.d.ts.map +1 -1
  19. package/dist/course/course-structure.controller.js +17 -4
  20. package/dist/course/course-structure.controller.js.map +1 -1
  21. package/dist/course/course-structure.service.d.ts +12 -4
  22. package/dist/course/course-structure.service.d.ts.map +1 -1
  23. package/dist/course/course-structure.service.js +98 -23
  24. package/dist/course/course-structure.service.js.map +1 -1
  25. package/dist/course/course-video-hls.service.d.ts +57 -0
  26. package/dist/course/course-video-hls.service.d.ts.map +1 -0
  27. package/dist/course/course-video-hls.service.js +767 -0
  28. package/dist/course/course-video-hls.service.js.map +1 -0
  29. package/dist/course/course.controller.d.ts +45 -13
  30. package/dist/course/course.controller.d.ts.map +1 -1
  31. package/dist/course/course.controller.js +40 -26
  32. package/dist/course/course.controller.js.map +1 -1
  33. package/dist/course/course.mcp-tools.js +1 -1
  34. package/dist/course/course.mcp-tools.js.map +1 -1
  35. package/dist/course/course.module.d.ts.map +1 -1
  36. package/dist/course/course.module.js +11 -0
  37. package/dist/course/course.module.js.map +1 -1
  38. package/dist/course/course.service.d.ts +6 -9
  39. package/dist/course/course.service.d.ts.map +1 -1
  40. package/dist/course/course.service.js +57 -48
  41. package/dist/course/course.service.js.map +1 -1
  42. package/dist/course/dto/cleanup-course-storage.dto.d.ts +1 -1
  43. package/dist/course/dto/cleanup-course-storage.dto.d.ts.map +1 -1
  44. package/dist/course/dto/cleanup-course-storage.dto.js +1 -0
  45. package/dist/course/dto/cleanup-course-storage.dto.js.map +1 -1
  46. package/dist/course/dto/cleanup-upload-history.dto.d.ts +1 -1
  47. package/dist/course/dto/cleanup-upload-history.dto.d.ts.map +1 -1
  48. package/dist/course/dto/cleanup-upload-history.dto.js +1 -1
  49. package/dist/course/dto/cleanup-upload-history.dto.js.map +1 -1
  50. package/dist/course/dto/create-course-bulk-job.dto.d.ts +2 -1
  51. package/dist/course/dto/create-course-bulk-job.dto.d.ts.map +1 -1
  52. package/dist/course/dto/create-course-bulk-job.dto.js +6 -1
  53. package/dist/course/dto/create-course-bulk-job.dto.js.map +1 -1
  54. package/dist/course/dto/create-course-export.dto.d.ts +14 -0
  55. package/dist/course/dto/create-course-export.dto.d.ts.map +1 -0
  56. package/dist/course/dto/create-course-export.dto.js +71 -0
  57. package/dist/course/dto/create-course-export.dto.js.map +1 -0
  58. package/dist/course/dto/create-course-structure-lesson.dto.d.ts +2 -2
  59. package/dist/course/dto/create-course-structure-lesson.dto.d.ts.map +1 -1
  60. package/dist/course/dto/create-course-structure-lesson.dto.js +3 -2
  61. package/dist/course/dto/create-course-structure-lesson.dto.js.map +1 -1
  62. package/dist/course/lms-bulk-upload-automation.service.d.ts +16 -1
  63. package/dist/course/lms-bulk-upload-automation.service.d.ts.map +1 -1
  64. package/dist/course/lms-bulk-upload-automation.service.js +102 -8
  65. package/dist/course/lms-bulk-upload-automation.service.js.map +1 -1
  66. package/dist/course/lms-bulk-upload-infra.service.d.ts +1 -0
  67. package/dist/course/lms-bulk-upload-infra.service.d.ts.map +1 -1
  68. package/dist/course/lms-bulk-upload-infra.service.js +32 -8
  69. package/dist/course/lms-bulk-upload-infra.service.js.map +1 -1
  70. package/dist/course/lms-bulk-upload.controller.d.ts +30 -3
  71. package/dist/course/lms-bulk-upload.controller.d.ts.map +1 -1
  72. package/dist/course/lms-bulk-upload.controller.js +43 -2
  73. package/dist/course/lms-bulk-upload.controller.js.map +1 -1
  74. package/dist/course/lms-bulk-upload.service.d.ts +11 -0
  75. package/dist/course/lms-bulk-upload.service.d.ts.map +1 -1
  76. package/dist/course/lms-bulk-upload.service.js +59 -6
  77. package/dist/course/lms-bulk-upload.service.js.map +1 -1
  78. package/dist/course/lms-setting.controller.d.ts +2 -1
  79. package/dist/course/lms-setting.controller.d.ts.map +1 -1
  80. package/dist/course/lms-setting.controller.js +4 -2
  81. package/dist/course/lms-setting.controller.js.map +1 -1
  82. package/dist/course/scorm12-schemas.d.ts +4 -0
  83. package/dist/course/scorm12-schemas.d.ts.map +1 -0
  84. package/dist/course/scorm12-schemas.js +9 -0
  85. package/dist/course/scorm12-schemas.js.map +1 -0
  86. package/dist/enterprise/training/training-student.service.d.ts +51 -0
  87. package/dist/enterprise/training/training-student.service.d.ts.map +1 -1
  88. package/dist/enterprise/training/training-student.service.js +217 -4
  89. package/dist/enterprise/training/training-student.service.js.map +1 -1
  90. package/dist/evaluation/evaluation.service.d.ts +18 -0
  91. package/dist/evaluation/evaluation.service.d.ts.map +1 -1
  92. package/dist/evaluation/evaluation.service.js +125 -0
  93. package/dist/evaluation/evaluation.service.js.map +1 -1
  94. package/dist/exam/dto/create-standalone-question.dto.d.ts +12 -0
  95. package/dist/exam/dto/create-standalone-question.dto.d.ts.map +1 -0
  96. package/dist/exam/dto/create-standalone-question.dto.js +70 -0
  97. package/dist/exam/dto/create-standalone-question.dto.js.map +1 -0
  98. package/dist/exam/exam.module.d.ts.map +1 -1
  99. package/dist/exam/exam.module.js +2 -1
  100. package/dist/exam/exam.module.js.map +1 -1
  101. package/dist/exam/exam.service.d.ts +21 -0
  102. package/dist/exam/exam.service.d.ts.map +1 -1
  103. package/dist/exam/exam.service.js +80 -0
  104. package/dist/exam/exam.service.js.map +1 -1
  105. package/dist/exam/question.controller.d.ts +27 -0
  106. package/dist/exam/question.controller.d.ts.map +1 -0
  107. package/dist/exam/question.controller.js +53 -0
  108. package/dist/exam/question.controller.js.map +1 -0
  109. package/dist/lesson-xp-map/lesson-xp-ai-calculation.service.d.ts +4 -0
  110. package/dist/lesson-xp-map/lesson-xp-ai-calculation.service.d.ts.map +1 -1
  111. package/dist/lesson-xp-map/lesson-xp-ai-calculation.service.js +161 -25
  112. package/dist/lesson-xp-map/lesson-xp-ai-calculation.service.js.map +1 -1
  113. package/dist/libraries/lms/tsconfig.tsbuildinfo +1 -1
  114. package/dist/lms-commerce-access.subscriber.d.ts +11 -0
  115. package/dist/lms-commerce-access.subscriber.d.ts.map +1 -0
  116. package/dist/lms-commerce-access.subscriber.js +74 -0
  117. package/dist/lms-commerce-access.subscriber.js.map +1 -0
  118. package/dist/lms.module.d.ts.map +1 -1
  119. package/dist/lms.module.js +6 -5
  120. package/dist/lms.module.js.map +1 -1
  121. package/dist/platforma/platforma-video.service.d.ts +39 -0
  122. package/dist/platforma/platforma-video.service.d.ts.map +1 -0
  123. package/dist/platforma/platforma-video.service.js +301 -0
  124. package/dist/platforma/platforma-video.service.js.map +1 -0
  125. package/dist/platforma/platforma.controller.d.ts +95 -1
  126. package/dist/platforma/platforma.controller.d.ts.map +1 -1
  127. package/dist/platforma/platforma.controller.js +160 -2
  128. package/dist/platforma/platforma.controller.js.map +1 -1
  129. package/dist/student-xp/dto/grant-skill-card-xp.dto.d.ts +5 -0
  130. package/dist/student-xp/dto/grant-skill-card-xp.dto.d.ts.map +1 -0
  131. package/dist/student-xp/dto/grant-skill-card-xp.dto.js +26 -0
  132. package/dist/student-xp/dto/grant-skill-card-xp.dto.js.map +1 -0
  133. package/dist/student-xp/student-xp.controller.d.ts +15 -0
  134. package/dist/student-xp/student-xp.controller.d.ts.map +1 -1
  135. package/dist/student-xp/student-xp.controller.js +24 -0
  136. package/dist/student-xp/student-xp.controller.js.map +1 -1
  137. package/dist/student-xp/student-xp.service.d.ts +16 -0
  138. package/dist/student-xp/student-xp.service.d.ts.map +1 -1
  139. package/dist/student-xp/student-xp.service.js +51 -1
  140. package/dist/student-xp/student-xp.service.js.map +1 -1
  141. package/hedhog/data/evaluation_topic.yaml +17 -0
  142. package/hedhog/data/menu.yaml +0 -17
  143. package/hedhog/data/queue_definition.yaml +48 -0
  144. package/hedhog/data/route.yaml +94 -124
  145. package/hedhog/data/setting_group.yaml +19 -19
  146. package/hedhog/frontend/app/bulk-upload-sessions/page.tsx.ejs +337 -41
  147. package/hedhog/frontend/app/courses/[id]/page.tsx.ejs +69 -4
  148. package/hedhog/frontend/app/courses/[id]/structure/_components/course-export-sheet.tsx.ejs +420 -0
  149. package/hedhog/frontend/app/courses/[id]/structure/_components/course-exports-tab.tsx.ejs +308 -0
  150. package/hedhog/frontend/app/courses/[id]/structure/_components/course-overview-tab.tsx.ejs +17 -15
  151. package/hedhog/frontend/app/courses/[id]/structure/_components/detail-lesson.tsx.ejs +51 -63
  152. package/hedhog/frontend/app/courses/[id]/structure/_components/detail-panel.tsx.ejs +8 -3
  153. package/hedhog/frontend/app/courses/[id]/structure/_components/detail-session.tsx.ejs +31 -8
  154. package/hedhog/frontend/app/courses/[id]/structure/_components/drag-overlay.tsx.ejs +16 -9
  155. package/hedhog/frontend/app/courses/[id]/structure/_components/editor-course.tsx.ejs +201 -401
  156. package/hedhog/frontend/app/courses/[id]/structure/_components/editor-lesson.tsx.ejs +378 -690
  157. package/hedhog/frontend/app/courses/[id]/structure/_components/mock-data.ts.ejs +1 -2
  158. package/hedhog/frontend/app/courses/[id]/structure/_components/tree-row-lesson.tsx.ejs +3 -9
  159. package/hedhog/frontend/app/courses/[id]/structure/_components/types.ts.ejs +1 -1
  160. package/hedhog/frontend/app/courses/[id]/structure/_data/adapters/course-structure.adapter.ts.ejs +6 -10
  161. package/hedhog/frontend/app/courses/[id]/structure/_data/services/course-structure.service.ts.ejs +49 -0
  162. package/hedhog/frontend/app/courses/[id]/structure/_data/types/api-course.types.ts.ejs +4 -3
  163. package/hedhog/frontend/app/courses/[id]/structure/_data/use-course-content-overview.ts.ejs +0 -1
  164. package/hedhog/frontend/app/courses/[id]/structure/_data/use-course-exports.ts.ejs +106 -0
  165. package/hedhog/frontend/app/courses/[id]/structure/_data/use-course-structure-mutations.ts.ejs +28 -1
  166. package/hedhog/frontend/app/courses/[id]/structure/_data/use-lms-settings-query.ts.ejs +0 -2
  167. package/hedhog/frontend/app/courses/page.tsx.ejs +45 -0
  168. package/hedhog/frontend/messages/en.json +26 -28
  169. package/hedhog/frontend/messages/pt.json +26 -28
  170. package/hedhog/table/course_export.yaml +62 -0
  171. package/package.json +13 -9
  172. package/src/bitcode-wallet/bitcode-wallet.service.ts +43 -4
  173. package/src/course/course-export-scorm12-worker.service.ts +124 -0
  174. package/src/course/course-export-scorm12.service.ts +668 -0
  175. package/src/course/course-export.service.ts +280 -0
  176. package/src/course/course-structure.controller.ts +14 -2
  177. package/src/course/course-structure.service.ts +100 -7
  178. package/src/course/course-video-hls.service.ts +946 -0
  179. package/src/course/course.controller.ts +33 -19
  180. package/src/course/course.mcp-tools.ts +1 -1
  181. package/src/course/course.module.ts +11 -0
  182. package/src/course/course.service.ts +73 -60
  183. package/src/course/dto/cleanup-course-storage.dto.ts +1 -0
  184. package/src/course/dto/cleanup-upload-history.dto.ts +1 -1
  185. package/src/course/dto/create-course-bulk-job.dto.ts +7 -3
  186. package/src/course/dto/create-course-export.dto.ts +56 -0
  187. package/src/course/dto/create-course-structure-lesson.dto.ts +4 -3
  188. package/src/course/lms-bulk-upload-automation.service.ts +153 -6
  189. package/src/course/lms-bulk-upload-infra.service.ts +39 -6
  190. package/src/course/lms-bulk-upload.controller.ts +32 -2
  191. package/src/course/lms-bulk-upload.service.ts +70 -7
  192. package/src/course/lms-setting.controller.ts +4 -2
  193. package/src/course/scorm12-schemas.ts +9 -0
  194. package/src/enterprise/training/training-student.service.ts +221 -2
  195. package/src/evaluation/evaluation.service.ts +123 -0
  196. package/src/exam/dto/create-standalone-question.dto.ts +66 -0
  197. package/src/exam/exam.module.ts +2 -1
  198. package/src/exam/exam.service.ts +86 -0
  199. package/src/exam/question.controller.ts +28 -0
  200. package/src/lesson-xp-map/lesson-xp-ai-calculation.service.ts +205 -31
  201. package/src/lms-commerce-access.subscriber.ts +88 -0
  202. package/src/lms.module.ts +6 -5
  203. package/src/platforma/platforma-video.service.ts +346 -0
  204. package/src/platforma/platforma.controller.ts +95 -1
  205. package/src/platforma/platforma.service.ts +268 -268
  206. package/src/student-xp/dto/grant-skill-card-xp.dto.ts +10 -0
  207. package/src/student-xp/student-xp.controller.ts +18 -2
  208. package/src/student-xp/student-xp.service.ts +84 -2
  209. package/hedhog/data/video_resolution_profile.yaml +0 -7
  210. package/hedhog/frontend/app/video-resolution-profiles/page.tsx.ejs +0 -607
  211. package/hedhog/table/course_video_resolution_profile.yaml +0 -22
  212. package/hedhog/table/video_resolution_profile.yaml +0 -18
  213. package/src/video-resolution-profile/dto/create-video-resolution-profile.dto.ts +0 -16
  214. package/src/video-resolution-profile/dto/update-video-resolution-profile.dto.ts +0 -16
  215. package/src/video-resolution-profile/video-resolution-profile.controller.ts +0 -62
  216. package/src/video-resolution-profile/video-resolution-profile.mcp-tools.ts +0 -128
  217. package/src/video-resolution-profile/video-resolution-profile.module.ts +0 -13
  218. package/src/video-resolution-profile/video-resolution-profile.service.ts +0 -117
@@ -0,0 +1,11 @@
1
+ import { IntegrationDeveloperApiService } from '@hed-hog/core';
2
+ import { OnModuleInit } from '@nestjs/common';
3
+ export declare class LmsCommerceAccessSubscriber implements OnModuleInit {
4
+ private readonly integrationApi;
5
+ private readonly logger;
6
+ constructor(integrationApi: IntegrationDeveloperApiService);
7
+ onModuleInit(): void;
8
+ private onSubscriptionActivated;
9
+ private onSubscriptionCanceled;
10
+ }
11
+ //# sourceMappingURL=lms-commerce-access.subscriber.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lms-commerce-access.subscriber.d.ts","sourceRoot":"","sources":["../src/lms-commerce-access.subscriber.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAsB,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAoBlE,qBACa,2BAA4B,YAAW,YAAY;IAI5D,OAAO,CAAC,QAAQ,CAAC,cAAc;IAHjC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAgD;gBAGpD,cAAc,EAAE,8BAA8B;IAGjE,YAAY,IAAI,IAAI;YAiBN,uBAAuB;YA+BvB,sBAAsB;CAUrC"}
@@ -0,0 +1,74 @@
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 LmsCommerceAccessSubscriber_1;
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.LmsCommerceAccessSubscriber = void 0;
14
+ const core_1 = require("@hed-hog/core");
15
+ const common_1 = require("@nestjs/common");
16
+ let LmsCommerceAccessSubscriber = LmsCommerceAccessSubscriber_1 = class LmsCommerceAccessSubscriber {
17
+ constructor(integrationApi) {
18
+ this.integrationApi = integrationApi;
19
+ this.logger = new common_1.Logger(LmsCommerceAccessSubscriber_1.name);
20
+ }
21
+ onModuleInit() {
22
+ this.integrationApi.subscribeMany([
23
+ {
24
+ eventName: 'commerce.subscription.activated',
25
+ consumerName: 'lms.commerce-subscription-activated',
26
+ priority: 0,
27
+ handler: async (event) => this.onSubscriptionActivated(event),
28
+ },
29
+ {
30
+ eventName: 'commerce.subscription.canceled',
31
+ consumerName: 'lms.commerce-subscription-canceled',
32
+ priority: 0,
33
+ handler: async (event) => this.onSubscriptionCanceled(event),
34
+ },
35
+ ]);
36
+ }
37
+ async onSubscriptionActivated(event) {
38
+ var _a, _b, _c, _d;
39
+ const payload = ((_a = event.payload) !== null && _a !== void 0 ? _a : {});
40
+ const userId = Number((_b = payload.user_id) !== null && _b !== void 0 ? _b : 0);
41
+ const productId = Number((_c = payload.product_id) !== null && _c !== void 0 ? _c : 0);
42
+ const subscriptionId = Number((_d = payload.subscription_id) !== null && _d !== void 0 ? _d : 0);
43
+ if (!userId || !productId) {
44
+ this.logger.warn(`commerce.subscription.activated: missing user_id or product_id (subscription ${subscriptionId}) — skipping LMS side effects`);
45
+ return;
46
+ }
47
+ this.logger.log(`LMS access granted: subscription ${subscriptionId} activated for user ${userId} / product ${productId}`);
48
+ // Extension point: look up integration links product_id → lms course/plan
49
+ // and auto-enroll the student in the corresponding class group.
50
+ // Example shape of what would go here:
51
+ //
52
+ // const links = await this.integrationApi.findLinksBySource({
53
+ // module: 'commerce',
54
+ // entityType: 'product',
55
+ // entityId: String(productId),
56
+ // });
57
+ // for (const link of links.filter(l => l.targetModule === 'lms' && l.targetEntityType === 'course')) {
58
+ // await this.classGroupService.enrollStudent(Number(link.targetEntityId), userId);
59
+ // }
60
+ }
61
+ async onSubscriptionCanceled(event) {
62
+ var _a, _b, _c;
63
+ const payload = ((_a = event.payload) !== null && _a !== void 0 ? _a : {});
64
+ const subscriptionId = Number((_b = payload.subscription_id) !== null && _b !== void 0 ? _b : 0);
65
+ this.logger.log(`LMS access revoked: subscription ${subscriptionId} canceled (reason: ${(_c = payload.reason) !== null && _c !== void 0 ? _c : 'none'}, entitlement_revoked: ${payload.entitlement_revoked})`);
66
+ // Extension point: remove student from active class groups linked to this subscription.
67
+ }
68
+ };
69
+ exports.LmsCommerceAccessSubscriber = LmsCommerceAccessSubscriber;
70
+ exports.LmsCommerceAccessSubscriber = LmsCommerceAccessSubscriber = LmsCommerceAccessSubscriber_1 = __decorate([
71
+ (0, common_1.Injectable)(),
72
+ __metadata("design:paramtypes", [core_1.IntegrationDeveloperApiService])
73
+ ], LmsCommerceAccessSubscriber);
74
+ //# sourceMappingURL=lms-commerce-access.subscriber.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lms-commerce-access.subscriber.js","sourceRoot":"","sources":["../src/lms-commerce-access.subscriber.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,wCAA+D;AAC/D,2CAAkE;AAqB3D,IAAM,2BAA2B,mCAAjC,MAAM,2BAA2B;IAGtC,YACmB,cAA8C;QAA9C,mBAAc,GAAd,cAAc,CAAgC;QAHhD,WAAM,GAAG,IAAI,eAAM,CAAC,6BAA2B,CAAC,IAAI,CAAC,CAAC;IAIpE,CAAC;IAEJ,YAAY;QACV,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC;YAChC;gBACE,SAAS,EAAE,iCAAiC;gBAC5C,YAAY,EAAE,qCAAqC;gBACnD,QAAQ,EAAE,CAAC;gBACX,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,uBAAuB,CAAC,KAAK,CAAC;aAC9D;YACD;gBACE,SAAS,EAAE,gCAAgC;gBAC3C,YAAY,EAAE,oCAAoC;gBAClD,QAAQ,EAAE,CAAC;gBACX,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,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EF,wFAAwF;IAC1F,CAAC;CACF,CAAA;AAjEY,kEAA2B;sCAA3B,2BAA2B;IADvC,IAAA,mBAAU,GAAE;qCAKwB,qCAA8B;GAJtD,2BAA2B,CAiEvC"}
@@ -1 +1 @@
1
- {"version":3,"file":"lms.module.d.ts","sourceRoot":"","sources":["../src/lms.module.ts"],"names":[],"mappings":"AAgCA,qBA0Da,SAAS;CAAG"}
1
+ {"version":3,"file":"lms.module.d.ts","sourceRoot":"","sources":["../src/lms.module.ts"],"names":[],"mappings":"AAiCA,qBA0Da,SAAS;CAAG"}
@@ -11,6 +11,7 @@ const api_locale_1 = require("@hed-hog/api-locale");
11
11
  const api_pagination_1 = require("@hed-hog/api-pagination");
12
12
  const api_prisma_1 = require("@hed-hog/api-prisma");
13
13
  const core_1 = require("@hed-hog/core");
14
+ const commerce_1 = require("@hed-hog/commerce");
14
15
  const queue_1 = require("@hed-hog/queue");
15
16
  const common_1 = require("@nestjs/common");
16
17
  const config_1 = require("@nestjs/config");
@@ -20,8 +21,8 @@ const certificate_module_1 = require("./certificate/certificate.module");
20
21
  const class_group_module_1 = require("./class-group/class-group.module");
21
22
  const course_lesson_discussion_module_1 = require("./course-lesson-discussion/course-lesson-discussion.module");
22
23
  const course_lesson_note_module_1 = require("./course-lesson-note/course-lesson-note.module");
24
+ const lms_commerce_access_subscriber_1 = require("./lms-commerce-access.subscriber");
23
25
  const course_audio_transcription_service_1 = require("./course/course-audio-transcription.service");
24
- const lms_bulk_upload_automation_service_1 = require("./course/lms-bulk-upload-automation.service");
25
26
  const course_module_1 = require("./course/course.module");
26
27
  const dashboard_module_1 = require("./dashboard/dashboard.module");
27
28
  const enterprise_module_1 = require("./enterprise/enterprise.module");
@@ -31,13 +32,13 @@ const exam_module_1 = require("./exam/exam.module");
31
32
  const instructor_module_1 = require("./instructor/instructor.module");
32
33
  const lesson_xp_map_module_1 = require("./lesson-xp-map/lesson-xp-map.module");
33
34
  const platforma_controller_1 = require("./platforma/platforma.controller");
35
+ const platforma_video_service_1 = require("./platforma/platforma-video.service");
34
36
  const student_xp_module_1 = require("./student-xp/student-xp.module");
35
37
  const xp_catalog_module_1 = require("./xp-catalog/xp-catalog.module");
36
38
  const platforma_service_1 = require("./platforma/platforma.service");
37
39
  const lms_realtime_module_1 = require("./realtime/lms-realtime.module");
38
40
  const reports_module_1 = require("./reports/reports.module");
39
41
  const training_module_1 = require("./training/training.module");
40
- const video_resolution_profile_module_1 = require("./video-resolution-profile/video-resolution-profile.module");
41
42
  let LmsModule = class LmsModule {
42
43
  };
43
44
  exports.LmsModule = LmsModule;
@@ -49,6 +50,7 @@ exports.LmsModule = LmsModule = __decorate([
49
50
  (0, common_1.forwardRef)(() => api_prisma_1.PrismaModule),
50
51
  (0, common_1.forwardRef)(() => core_1.CoreModule),
51
52
  (0, common_1.forwardRef)(() => queue_1.QueueModule),
53
+ (0, common_1.forwardRef)(() => commerce_1.CommerceModule),
52
54
  (0, common_1.forwardRef)(() => api_locale_1.LocaleModule),
53
55
  (0, common_1.forwardRef)(() => achievement_module_1.AchievementModule),
54
56
  (0, common_1.forwardRef)(() => bitcode_wallet_module_1.BitcodeWalletModule),
@@ -66,7 +68,6 @@ exports.LmsModule = LmsModule = __decorate([
66
68
  (0, common_1.forwardRef)(() => lms_realtime_module_1.LmsRealtimeModule),
67
69
  (0, common_1.forwardRef)(() => reports_module_1.LmsReportsModule),
68
70
  (0, common_1.forwardRef)(() => training_module_1.TrainingModule),
69
- (0, common_1.forwardRef)(() => video_resolution_profile_module_1.VideoResolutionProfileModule),
70
71
  (0, common_1.forwardRef)(() => xp_catalog_module_1.XpCatalogModule),
71
72
  (0, common_1.forwardRef)(() => lesson_xp_map_module_1.LessonXpMapModule),
72
73
  (0, common_1.forwardRef)(() => student_xp_module_1.StudentXpModule),
@@ -74,8 +75,9 @@ exports.LmsModule = LmsModule = __decorate([
74
75
  controllers: [platforma_controller_1.PlataformaController],
75
76
  providers: [
76
77
  course_audio_transcription_service_1.CourseAudioTranscriptionService,
77
- lms_bulk_upload_automation_service_1.LmsBulkUploadAutomationService,
78
78
  platforma_service_1.PlatformaService,
79
+ platforma_video_service_1.PlatformaVideoService,
80
+ lms_commerce_access_subscriber_1.LmsCommerceAccessSubscriber,
79
81
  ],
80
82
  exports: [
81
83
  (0, common_1.forwardRef)(() => achievement_module_1.AchievementModule),
@@ -94,7 +96,6 @@ exports.LmsModule = LmsModule = __decorate([
94
96
  (0, common_1.forwardRef)(() => lms_realtime_module_1.LmsRealtimeModule),
95
97
  (0, common_1.forwardRef)(() => reports_module_1.LmsReportsModule),
96
98
  (0, common_1.forwardRef)(() => training_module_1.TrainingModule),
97
- (0, common_1.forwardRef)(() => video_resolution_profile_module_1.VideoResolutionProfileModule),
98
99
  (0, common_1.forwardRef)(() => xp_catalog_module_1.XpCatalogModule),
99
100
  (0, common_1.forwardRef)(() => lesson_xp_map_module_1.LessonXpMapModule),
100
101
  (0, common_1.forwardRef)(() => student_xp_module_1.StudentXpModule),
@@ -1 +1 @@
1
- {"version":3,"file":"lms.module.js","sourceRoot":"","sources":["../src/lms.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,oDAAmD;AACnD,4DAA2D;AAC3D,oDAAmD;AACnD,wCAA2C;AAC3C,0CAA6C;AAC7C,2CAAoD;AACpD,2CAA8C;AAC9C,yEAAqE;AACrE,kFAA6E;AAC7E,yEAAwE;AACxE,yEAAoE;AACpE,gHAA0G;AAC1G,8FAAwF;AACxF,oGAA8F;AAC9F,oGAA6F;AAC7F,0DAAsD;AACtD,mEAAkE;AAClE,sEAAkE;AAClE,iGAA4F;AAC5F,sEAAkE;AAClE,oDAAgD;AAChD,sEAAkE;AAClE,+EAAyE;AACzE,2EAAwE;AACxE,sEAAiE;AACjE,sEAAiE;AACjE,qEAAiE;AACjE,wEAAmE;AACnE,6DAA4D;AAC5D,gEAA4D;AAC5D,gHAA0G;AA4DnG,IAAM,SAAS,GAAf,MAAM,SAAS;CAAG,CAAA;AAAZ,8BAAS;oBAAT,SAA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CAAC;YACnC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,mCAAe,CAAC;SAClC;KACF,CAAC;GACW,SAAS,CAAG"}
@@ -0,0 +1,39 @@
1
+ import { FileService } from '@hed-hog/core';
2
+ import { PrismaService } from '@hed-hog/api-prisma';
3
+ import { JwtService } from '@nestjs/jwt';
4
+ import type { Request, Response } from 'express';
5
+ export declare class PlatformaVideoService {
6
+ private readonly prisma;
7
+ private readonly fileService;
8
+ private readonly jwtService;
9
+ private readonly logger;
10
+ constructor(prisma: PrismaService, fileService: FileService, jwtService: JwtService);
11
+ getVideoOptions(lessonId: number): Promise<{
12
+ type: string;
13
+ label: string;
14
+ fileId: number;
15
+ }[]>;
16
+ generateVideoToken(lessonId: number, quality?: string): Promise<{
17
+ token: string;
18
+ label: string;
19
+ type: string;
20
+ expiresIn: number;
21
+ }>;
22
+ streamVideo(token: string, req: Request, res: Response): Promise<void>;
23
+ generateHlsToken(lessonId: number): Promise<{
24
+ token: string;
25
+ expiresIn: number;
26
+ }>;
27
+ private verifyHlsToken;
28
+ serveHlsMasterManifest(token: string, req: Request, res: Response): Promise<void>;
29
+ serveHlsVariantPlaylist(token: string, variant: string, req: Request, res: Response): Promise<void>;
30
+ serveHlsSegment(token: string, variant: string, segment: string, res: Response): Promise<void>;
31
+ generateSubtitlesToken(lessonId: number): Promise<{
32
+ token: string;
33
+ expiresIn: number;
34
+ }>;
35
+ serveSubtitles(token: string, res: Response): Promise<void>;
36
+ private secondsToVttTime;
37
+ private buildVtt;
38
+ }
39
+ //# sourceMappingURL=platforma-video.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platforma-video.service.d.ts","sourceRoot":"","sources":["../../src/platforma/platforma-video.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AASpD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEjD,qBACa,qBAAqB;IAI9B,OAAO,CAAC,QAAQ,CAAC,MAAM;IAEvB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAE5B,OAAO,CAAC,QAAQ,CAAC,UAAU;IAP7B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA0C;gBAG9C,MAAM,EAAE,aAAa,EAErB,WAAW,EAAE,WAAW,EAExB,UAAU,EAAE,UAAU;IAGnC,eAAe,CAAC,QAAQ,EAAE,MAAM;;;;;IA0ChC,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM;;;;;;IAgBrD,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ;IAmDtD,gBAAgB,CAAC,QAAQ,EAAE,MAAM;;;;IAuBvC,OAAO,CAAC,cAAc;IAUhB,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ;IAuCjE,uBAAuB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ;IAuCnF,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ;IAgC9E,sBAAsB,CAAC,QAAQ,EAAE,MAAM;;;;IAsBvC,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ;IA4BjD,OAAO,CAAC,gBAAgB;IASxB,OAAO,CAAC,QAAQ;CASjB"}
@@ -0,0 +1,301 @@
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 PlatformaVideoService_1;
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.PlatformaVideoService = void 0;
17
+ const core_1 = require("@hed-hog/core");
18
+ const api_prisma_1 = require("@hed-hog/api-prisma");
19
+ const common_1 = require("@nestjs/common");
20
+ const jwt_1 = require("@nestjs/jwt");
21
+ let PlatformaVideoService = PlatformaVideoService_1 = class PlatformaVideoService {
22
+ constructor(prisma, fileService, jwtService) {
23
+ this.prisma = prisma;
24
+ this.fileService = fileService;
25
+ this.jwtService = jwtService;
26
+ this.logger = new common_1.Logger(PlatformaVideoService_1.name);
27
+ }
28
+ async getVideoOptions(lessonId) {
29
+ const lesson = await this.prisma.course_lesson.findFirst({
30
+ where: { id: lessonId, published: true },
31
+ select: {
32
+ id: true,
33
+ course_lesson_file: {
34
+ where: { file_id: { not: null } },
35
+ select: { id: true, title: true, type: true, file: { select: { id: true } } },
36
+ },
37
+ },
38
+ });
39
+ if (!lesson)
40
+ throw new common_1.NotFoundException('Lesson not found');
41
+ // HLS takes priority over legacy MP4 profiles
42
+ const hlsFile = lesson.course_lesson_file.find((f) => { var _a; return f.type === 'video_hls' && ((_a = f.file) === null || _a === void 0 ? void 0 : _a.id); });
43
+ if (hlsFile) {
44
+ return [{ type: 'video_hls', label: 'HLS', fileId: hlsFile.file.id }];
45
+ }
46
+ const videoFiles = lesson.course_lesson_file.filter((f) => { var _a; return f.type === 'video_original' || ((_a = f.type) === null || _a === void 0 ? void 0 : _a.startsWith('video_profile:')); });
47
+ if (videoFiles.length === 0)
48
+ return [];
49
+ return videoFiles
50
+ .filter((f) => { var _a; return (_a = f.file) === null || _a === void 0 ? void 0 : _a.id; })
51
+ .map((f) => {
52
+ var _a;
53
+ const profileMatch = (_a = f.type) === null || _a === void 0 ? void 0 : _a.match(/^video_profile:(\d+)$/);
54
+ const profileId = profileMatch ? Number(profileMatch[1]) : null;
55
+ const label = f.type === 'video_original'
56
+ ? 'Original'
57
+ : profileId !== null
58
+ ? f.title || `Perfil ${profileId}`
59
+ : f.title || f.type || 'Vídeo';
60
+ return { type: f.type, label, fileId: f.file.id };
61
+ });
62
+ }
63
+ async generateVideoToken(lessonId, quality) {
64
+ var _a;
65
+ const options = await this.getVideoOptions(lessonId);
66
+ if (options.length === 0)
67
+ throw new common_1.NotFoundException('No video available for this lesson');
68
+ const selected = quality
69
+ ? ((_a = options.find((o) => o.type === quality)) !== null && _a !== void 0 ? _a : options[0])
70
+ : options[0];
71
+ const token = this.jwtService.sign({ fileId: selected.fileId, lessonId }, { secret: process.env.JWT_SECRET, expiresIn: '4h' });
72
+ return { token, label: selected.label, type: selected.type, expiresIn: 14400 };
73
+ }
74
+ async streamVideo(token, req, res) {
75
+ let fileId;
76
+ try {
77
+ const payload = this.jwtService.verify(token, {
78
+ secret: process.env.JWT_SECRET,
79
+ });
80
+ fileId = payload.fileId;
81
+ }
82
+ catch (_a) {
83
+ throw new common_1.UnauthorizedException('Invalid or expired video token');
84
+ }
85
+ const rangeHeader = req.headers['range'];
86
+ let start;
87
+ let end;
88
+ if (rangeHeader) {
89
+ const match = rangeHeader.match(/bytes=(\d+)-(\d*)/);
90
+ if (match) {
91
+ start = parseInt(match[1], 10);
92
+ end = match[2] ? parseInt(match[2], 10) : undefined;
93
+ }
94
+ }
95
+ const result = await this.fileService.openReadStreamWithRange(fileId, start, end);
96
+ if (!result)
97
+ throw new common_1.NotFoundException('Video file not found');
98
+ const { stream, totalSize, start: resolvedStart, end: resolvedEnd, contentLength, mimetype } = result;
99
+ const headers = {
100
+ 'Content-Type': mimetype,
101
+ 'Content-Disposition': 'inline',
102
+ 'Accept-Ranges': 'bytes',
103
+ 'Cache-Control': 'no-store',
104
+ };
105
+ if (start !== undefined) {
106
+ headers['Content-Range'] = `bytes ${resolvedStart}-${resolvedEnd !== null && resolvedEnd !== void 0 ? resolvedEnd : totalSize - 1}/${totalSize || '*'}`;
107
+ headers['Content-Length'] = contentLength;
108
+ res.writeHead(206, headers);
109
+ }
110
+ else {
111
+ if (totalSize > 0)
112
+ headers['Content-Length'] = totalSize;
113
+ res.writeHead(200, headers);
114
+ }
115
+ stream.pipe(res);
116
+ }
117
+ // ---------------------------------------------------------------------------
118
+ // HLS endpoints
119
+ // ---------------------------------------------------------------------------
120
+ async generateHlsToken(lessonId) {
121
+ const lesson = await this.prisma.course_lesson.findFirst({
122
+ where: { id: lessonId, published: true },
123
+ select: {
124
+ id: true,
125
+ course_lesson_file: {
126
+ where: { type: 'video_hls', file_id: { not: null } },
127
+ select: { id: true },
128
+ },
129
+ },
130
+ });
131
+ if (!lesson)
132
+ throw new common_1.NotFoundException('Lesson not found');
133
+ if (lesson.course_lesson_file.length === 0)
134
+ throw new common_1.NotFoundException('No HLS stream available for this lesson');
135
+ const token = this.jwtService.sign({ lessonId }, { secret: process.env.JWT_SECRET, expiresIn: '4h' });
136
+ return { token, expiresIn: 14400 };
137
+ }
138
+ verifyHlsToken(token) {
139
+ try {
140
+ return this.jwtService.verify(token, {
141
+ secret: process.env.JWT_SECRET,
142
+ });
143
+ }
144
+ catch (_a) {
145
+ throw new common_1.UnauthorizedException('Invalid or expired HLS token');
146
+ }
147
+ }
148
+ async serveHlsMasterManifest(token, req, res) {
149
+ const { lessonId } = this.verifyHlsToken(token);
150
+ const manifestFile = await this.prisma.file.findFirst({
151
+ where: {
152
+ location: `lms/lessons/hls/${lessonId}`,
153
+ filename: 'master.m3u8',
154
+ },
155
+ select: { id: true },
156
+ });
157
+ if (!manifestFile)
158
+ throw new common_1.NotFoundException('HLS master manifest not found');
159
+ const { stream } = await this.fileService.openReadStreamById(manifestFile.id);
160
+ const chunks = [];
161
+ await new Promise((resolve, reject) => {
162
+ stream.on('data', (chunk) => chunks.push(chunk));
163
+ stream.on('end', resolve);
164
+ stream.on('error', reject);
165
+ });
166
+ const baseUrl = `${req.protocol}://${req.get('host')}`;
167
+ const content = Buffer.concat(chunks).toString('utf8');
168
+ // Rewrite relative variant playlist paths to absolute authenticated URLs
169
+ const rewritten = content.replace(/^(stream_\d+\/playlist\.m3u8)$/gm, (_, variantPath) => `${baseUrl}/lms/platforma/hls/${token}/${variantPath}`);
170
+ res.set({
171
+ 'Content-Type': 'application/x-mpegURL',
172
+ 'Cache-Control': 'no-store',
173
+ 'Access-Control-Allow-Origin': '*',
174
+ });
175
+ res.send(rewritten);
176
+ }
177
+ async serveHlsVariantPlaylist(token, variant, req, res) {
178
+ const { lessonId } = this.verifyHlsToken(token);
179
+ const playlistFile = await this.prisma.file.findFirst({
180
+ where: {
181
+ location: `lms/lessons/hls/${lessonId}/${variant}`,
182
+ filename: 'playlist.m3u8',
183
+ },
184
+ select: { id: true },
185
+ });
186
+ if (!playlistFile)
187
+ throw new common_1.NotFoundException('HLS variant playlist not found');
188
+ const { stream } = await this.fileService.openReadStreamById(playlistFile.id);
189
+ const chunks = [];
190
+ await new Promise((resolve, reject) => {
191
+ stream.on('data', (chunk) => chunks.push(chunk));
192
+ stream.on('end', resolve);
193
+ stream.on('error', reject);
194
+ });
195
+ const baseUrl = `${req.protocol}://${req.get('host')}`;
196
+ const content = Buffer.concat(chunks).toString('utf8');
197
+ // Rewrite relative segment paths to absolute authenticated URLs
198
+ const rewritten = content.replace(/^(seg\d+\.ts)$/gm, (_, segName) => `${baseUrl}/lms/platforma/hls/${token}/${variant}/${segName}`);
199
+ res.set({
200
+ 'Content-Type': 'application/x-mpegURL',
201
+ 'Cache-Control': 'no-store',
202
+ 'Access-Control-Allow-Origin': '*',
203
+ });
204
+ res.send(rewritten);
205
+ }
206
+ async serveHlsSegment(token, variant, segment, res) {
207
+ const { lessonId } = this.verifyHlsToken(token);
208
+ if (!/^seg\d+\.ts$/.test(segment)) {
209
+ throw new common_1.NotFoundException('Invalid segment name');
210
+ }
211
+ const segmentFile = await this.prisma.file.findFirst({
212
+ where: {
213
+ location: `lms/lessons/hls/${lessonId}/${variant}`,
214
+ filename: segment,
215
+ },
216
+ select: { id: true },
217
+ });
218
+ if (!segmentFile)
219
+ throw new common_1.NotFoundException('HLS segment not found');
220
+ const { stream } = await this.fileService.openReadStreamById(segmentFile.id);
221
+ res.set({
222
+ 'Content-Type': 'video/MP2T',
223
+ 'Cache-Control': 'public, max-age=31536000, immutable',
224
+ 'Access-Control-Allow-Origin': '*',
225
+ });
226
+ stream.pipe(res);
227
+ }
228
+ // ---------------------------------------------------------------------------
229
+ // Subtitle (VTT) endpoints
230
+ // ---------------------------------------------------------------------------
231
+ async generateSubtitlesToken(lessonId) {
232
+ const lesson = await this.prisma.course_lesson.findFirst({
233
+ where: { id: lessonId, published: true },
234
+ select: { id: true },
235
+ });
236
+ if (!lesson)
237
+ throw new common_1.NotFoundException('Lesson not found');
238
+ const count = await this.prisma.course_lesson_transcription_segment.count({
239
+ where: { course_lesson_id: lessonId },
240
+ });
241
+ if (count === 0)
242
+ throw new common_1.NotFoundException('No subtitles available for this lesson');
243
+ const token = this.jwtService.sign({ lessonId, type: 'subtitles' }, { secret: process.env.JWT_SECRET, expiresIn: '4h' });
244
+ return { token, expiresIn: 14400 };
245
+ }
246
+ async serveSubtitles(token, res) {
247
+ let lessonId;
248
+ try {
249
+ const payload = this.jwtService.verify(token, {
250
+ secret: process.env.JWT_SECRET,
251
+ });
252
+ if (payload.type !== 'subtitles')
253
+ throw new Error('Wrong token type');
254
+ lessonId = payload.lessonId;
255
+ }
256
+ catch (_a) {
257
+ throw new common_1.UnauthorizedException('Invalid or expired subtitles token');
258
+ }
259
+ const segments = await this.prisma.course_lesson_transcription_segment.findMany({
260
+ where: { course_lesson_id: lessonId },
261
+ orderBy: { start_seconds: 'asc' },
262
+ select: { start_seconds: true, end_seconds: true, text: true },
263
+ });
264
+ const vtt = this.buildVtt(segments);
265
+ res.set({
266
+ 'Content-Type': 'text/vtt; charset=utf-8',
267
+ 'Cache-Control': 'no-store',
268
+ 'Access-Control-Allow-Origin': '*',
269
+ });
270
+ res.send(vtt);
271
+ }
272
+ secondsToVttTime(seconds) {
273
+ const s = Number(seconds);
274
+ const h = Math.floor(s / 3600);
275
+ const m = Math.floor((s % 3600) / 60);
276
+ const sec = Math.floor(s % 60);
277
+ const ms = Math.round((s % 1) * 1000);
278
+ return `${String(h).padStart(2, '0')}:${String(m).padStart(2, '0')}:${String(sec).padStart(2, '0')}.${String(ms).padStart(3, '0')}`;
279
+ }
280
+ buildVtt(segments) {
281
+ if (segments.length === 0)
282
+ return 'WEBVTT\n';
283
+ const cues = segments.map((seg, i) => {
284
+ const start = this.secondsToVttTime(seg.start_seconds);
285
+ const end = this.secondsToVttTime(seg.end_seconds);
286
+ return `${i + 1}\n${start} --> ${end}\n${seg.text}`;
287
+ });
288
+ return `WEBVTT\n\n${cues.join('\n\n')}\n`;
289
+ }
290
+ };
291
+ exports.PlatformaVideoService = PlatformaVideoService;
292
+ exports.PlatformaVideoService = PlatformaVideoService = PlatformaVideoService_1 = __decorate([
293
+ (0, common_1.Injectable)(),
294
+ __param(0, (0, common_1.Inject)((0, common_1.forwardRef)(() => api_prisma_1.PrismaService))),
295
+ __param(1, (0, common_1.Inject)((0, common_1.forwardRef)(() => core_1.FileService))),
296
+ __param(2, (0, common_1.Inject)((0, common_1.forwardRef)(() => jwt_1.JwtService))),
297
+ __metadata("design:paramtypes", [api_prisma_1.PrismaService,
298
+ core_1.FileService,
299
+ jwt_1.JwtService])
300
+ ], PlatformaVideoService);
301
+ //# sourceMappingURL=platforma-video.service.js.map
@@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