@hed-hog/lms 0.0.365 → 0.0.370

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 (243) hide show
  1. package/dist/certificate/certificate.controller.d.ts +1 -1
  2. package/dist/certificate/certificate.controller.d.ts.map +1 -1
  3. package/dist/certificate/certificate.controller.js +4 -2
  4. package/dist/certificate/certificate.controller.js.map +1 -1
  5. package/dist/certificate/certificate.service.d.ts +50 -0
  6. package/dist/certificate/certificate.service.d.ts.map +1 -1
  7. package/dist/certificate/certificate.service.js +73 -0
  8. package/dist/certificate/certificate.service.js.map +1 -1
  9. package/dist/class-group/class-group.controller.d.ts +1 -0
  10. package/dist/class-group/class-group.controller.d.ts.map +1 -1
  11. package/dist/class-group/class-group.service.d.ts +1 -0
  12. package/dist/class-group/class-group.service.d.ts.map +1 -1
  13. package/dist/course/course-ai-usage.service.d.ts +58 -0
  14. package/dist/course/course-ai-usage.service.d.ts.map +1 -0
  15. package/dist/course/course-ai-usage.service.js +176 -0
  16. package/dist/course/course-ai-usage.service.js.map +1 -0
  17. package/dist/course/course-audio-transcription.service.d.ts +65 -1
  18. package/dist/course/course-audio-transcription.service.d.ts.map +1 -1
  19. package/dist/course/course-audio-transcription.service.js +381 -29
  20. package/dist/course/course-audio-transcription.service.js.map +1 -1
  21. package/dist/course/course-export-scorm12.service.d.ts +3 -0
  22. package/dist/course/course-export-scorm12.service.d.ts.map +1 -1
  23. package/dist/course/course-export-scorm12.service.js +141 -6
  24. package/dist/course/course-export-scorm12.service.js.map +1 -1
  25. package/dist/course/course-export.service.d.ts.map +1 -1
  26. package/dist/course/course-export.service.js +2 -1
  27. package/dist/course/course-export.service.js.map +1 -1
  28. package/dist/course/course-lesson.controller.d.ts +25 -3
  29. package/dist/course/course-lesson.controller.d.ts.map +1 -1
  30. package/dist/course/course-lesson.controller.js +71 -8
  31. package/dist/course/course-lesson.controller.js.map +1 -1
  32. package/dist/course/course-structure.controller.d.ts +30 -7
  33. package/dist/course/course-structure.controller.d.ts.map +1 -1
  34. package/dist/course/course-structure.controller.js +37 -4
  35. package/dist/course/course-structure.controller.js.map +1 -1
  36. package/dist/course/course-structure.service.d.ts +37 -5
  37. package/dist/course/course-structure.service.d.ts.map +1 -1
  38. package/dist/course/course-structure.service.js +165 -20
  39. package/dist/course/course-structure.service.js.map +1 -1
  40. package/dist/course/course-transcription-translation.service.d.ts +31 -0
  41. package/dist/course/course-transcription-translation.service.d.ts.map +1 -0
  42. package/dist/course/course-transcription-translation.service.js +227 -0
  43. package/dist/course/course-transcription-translation.service.js.map +1 -0
  44. package/dist/course/course-video-agent-pipeline.service.d.ts +70 -0
  45. package/dist/course/course-video-agent-pipeline.service.d.ts.map +1 -0
  46. package/dist/course/course-video-agent-pipeline.service.js +398 -0
  47. package/dist/course/course-video-agent-pipeline.service.js.map +1 -0
  48. package/dist/course/course-video-hls.service.d.ts +14 -0
  49. package/dist/course/course-video-hls.service.d.ts.map +1 -1
  50. package/dist/course/course-video-hls.service.js +25 -8
  51. package/dist/course/course-video-hls.service.js.map +1 -1
  52. package/dist/course/course.controller.d.ts +2 -0
  53. package/dist/course/course.controller.d.ts.map +1 -1
  54. package/dist/course/course.module.d.ts.map +1 -1
  55. package/dist/course/course.module.js +9 -0
  56. package/dist/course/course.module.js.map +1 -1
  57. package/dist/course/course.service.d.ts +2 -0
  58. package/dist/course/course.service.d.ts.map +1 -1
  59. package/dist/course/course.service.js +36 -2
  60. package/dist/course/course.service.js.map +1 -1
  61. package/dist/course/dto/create-course-bulk-job.dto.d.ts +2 -1
  62. package/dist/course/dto/create-course-bulk-job.dto.d.ts.map +1 -1
  63. package/dist/course/dto/create-course-bulk-job.dto.js +6 -1
  64. package/dist/course/dto/create-course-bulk-job.dto.js.map +1 -1
  65. package/dist/course/dto/create-course-export.dto.d.ts +1 -0
  66. package/dist/course/dto/create-course-export.dto.d.ts.map +1 -1
  67. package/dist/course/dto/create-course-export.dto.js +6 -0
  68. package/dist/course/dto/create-course-export.dto.js.map +1 -1
  69. package/dist/course/ffmpeg.util.d.ts +10 -0
  70. package/dist/course/ffmpeg.util.d.ts.map +1 -0
  71. package/dist/course/ffmpeg.util.js +79 -0
  72. package/dist/course/ffmpeg.util.js.map +1 -0
  73. package/dist/course/lms-bulk-upload-automation.service.d.ts +3 -1
  74. package/dist/course/lms-bulk-upload-automation.service.d.ts.map +1 -1
  75. package/dist/course/lms-bulk-upload-automation.service.js +33 -16
  76. package/dist/course/lms-bulk-upload-automation.service.js.map +1 -1
  77. package/dist/course/lms-bulk-upload.controller.d.ts +3 -0
  78. package/dist/course/lms-bulk-upload.controller.d.ts.map +1 -1
  79. package/dist/course/lms-bulk-upload.service.d.ts +3 -0
  80. package/dist/course/lms-bulk-upload.service.d.ts.map +1 -1
  81. package/dist/course/lms-bulk-upload.service.js +48 -29
  82. package/dist/course/lms-bulk-upload.service.js.map +1 -1
  83. package/dist/course/subtitle.util.d.ts +46 -0
  84. package/dist/course/subtitle.util.d.ts.map +1 -0
  85. package/dist/course/subtitle.util.js +206 -0
  86. package/dist/course/subtitle.util.js.map +1 -0
  87. package/dist/enterprise/training/training-admin.controller.d.ts +2 -0
  88. package/dist/enterprise/training/training-admin.controller.d.ts.map +1 -1
  89. package/dist/enterprise/training/training-admin.service.d.ts +2 -0
  90. package/dist/enterprise/training/training-admin.service.d.ts.map +1 -1
  91. package/dist/enterprise/training/training-student.service.d.ts +27 -0
  92. package/dist/enterprise/training/training-student.service.d.ts.map +1 -1
  93. package/dist/enterprise/training/training-student.service.js +197 -10
  94. package/dist/enterprise/training/training-student.service.js.map +1 -1
  95. package/dist/lesson-xp-map/lesson-xp-ai-calculation.service.d.ts +3 -1
  96. package/dist/lesson-xp-map/lesson-xp-ai-calculation.service.d.ts.map +1 -1
  97. package/dist/lesson-xp-map/lesson-xp-ai-calculation.service.js +19 -5
  98. package/dist/lesson-xp-map/lesson-xp-ai-calculation.service.js.map +1 -1
  99. package/dist/lesson-xp-map/lesson-xp-map.module.d.ts.map +1 -1
  100. package/dist/lesson-xp-map/lesson-xp-map.module.js +2 -1
  101. package/dist/lesson-xp-map/lesson-xp-map.module.js.map +1 -1
  102. package/dist/libraries/lms/tsconfig.tsbuildinfo +1 -1
  103. package/dist/lms.module.d.ts.map +1 -1
  104. package/dist/lms.module.js +14 -0
  105. package/dist/lms.module.js.map +1 -1
  106. package/dist/platforma/dto/heartbeat.dto.d.ts +9 -0
  107. package/dist/platforma/dto/heartbeat.dto.d.ts.map +1 -0
  108. package/dist/platforma/dto/heartbeat.dto.js +50 -0
  109. package/dist/platforma/dto/heartbeat.dto.js.map +1 -0
  110. package/dist/platforma/handlers/emit-certificate.handler.d.ts +27 -0
  111. package/dist/platforma/handlers/emit-certificate.handler.d.ts.map +1 -0
  112. package/dist/platforma/handlers/emit-certificate.handler.js +117 -0
  113. package/dist/platforma/handlers/emit-certificate.handler.js.map +1 -0
  114. package/dist/platforma/handlers/lesson-heartbeat.handler.d.ts +31 -0
  115. package/dist/platforma/handlers/lesson-heartbeat.handler.d.ts.map +1 -0
  116. package/dist/platforma/handlers/lesson-heartbeat.handler.js +281 -0
  117. package/dist/platforma/handlers/lesson-heartbeat.handler.js.map +1 -0
  118. package/dist/platforma/platforma-heartbeat.service.d.ts +10 -0
  119. package/dist/platforma/platforma-heartbeat.service.d.ts.map +1 -0
  120. package/dist/platforma/platforma-heartbeat.service.js +50 -0
  121. package/dist/platforma/platforma-heartbeat.service.js.map +1 -0
  122. package/dist/platforma/platforma-performance.service.d.ts +121 -0
  123. package/dist/platforma/platforma-performance.service.d.ts.map +1 -0
  124. package/dist/platforma/platforma-performance.service.js +500 -0
  125. package/dist/platforma/platforma-performance.service.js.map +1 -0
  126. package/dist/platforma/platforma-search.service.d.ts +21 -0
  127. package/dist/platforma/platforma-search.service.d.ts.map +1 -0
  128. package/dist/platforma/platforma-search.service.js +64 -0
  129. package/dist/platforma/platforma-search.service.js.map +1 -0
  130. package/dist/platforma/platforma-video.service.d.ts +8 -0
  131. package/dist/platforma/platforma-video.service.d.ts.map +1 -1
  132. package/dist/platforma/platforma-video.service.js +45 -2
  133. package/dist/platforma/platforma-video.service.js.map +1 -1
  134. package/dist/platforma/platforma.controller.d.ts +213 -1
  135. package/dist/platforma/platforma.controller.d.ts.map +1 -1
  136. package/dist/platforma/platforma.controller.js +159 -2
  137. package/dist/platforma/platforma.controller.js.map +1 -1
  138. package/dist/realtime/lms-realtime.controller.d.ts +2 -0
  139. package/dist/realtime/lms-realtime.controller.d.ts.map +1 -1
  140. package/dist/realtime/lms-realtime.controller.js +31 -0
  141. package/dist/realtime/lms-realtime.controller.js.map +1 -1
  142. package/dist/realtime/lms-realtime.service.d.ts +1 -1
  143. package/dist/realtime/lms-realtime.service.d.ts.map +1 -1
  144. package/dist/realtime/lms-realtime.service.js.map +1 -1
  145. package/dist/training/dto/create-training.dto.d.ts +9 -0
  146. package/dist/training/dto/create-training.dto.d.ts.map +1 -1
  147. package/dist/training/dto/create-training.dto.js +45 -1
  148. package/dist/training/dto/create-training.dto.js.map +1 -1
  149. package/dist/training/training.controller.d.ts +144 -0
  150. package/dist/training/training.controller.d.ts.map +1 -1
  151. package/dist/training/training.service.d.ts +149 -0
  152. package/dist/training/training.service.d.ts.map +1 -1
  153. package/dist/training/training.service.js +332 -167
  154. package/dist/training/training.service.js.map +1 -1
  155. package/hedhog/data/image_type.yaml +10 -0
  156. package/hedhog/data/route.yaml +251 -0
  157. package/hedhog/data/setting_group.yaml +97 -0
  158. package/hedhog/frontend/app/bulk-upload-sessions/page.tsx.ejs +139 -27
  159. package/hedhog/frontend/app/certificates/models/page.tsx.ejs +182 -29
  160. package/hedhog/frontend/app/classes/_components/classes-calendar-view.tsx.ejs +277 -0
  161. package/hedhog/frontend/app/classes/page.tsx.ejs +127 -20
  162. package/hedhog/frontend/app/courses/[id]/_components/CourseFlagsCard.tsx.ejs +69 -57
  163. package/hedhog/frontend/app/courses/[id]/_components/CourseIssuedCertificatesCard.tsx.ejs +168 -0
  164. package/hedhog/frontend/app/courses/[id]/structure/_components/course-ai-costs-tab.tsx.ejs +191 -0
  165. package/hedhog/frontend/app/courses/[id]/structure/_components/course-export-sheet.tsx.ejs +81 -1
  166. package/hedhog/frontend/app/courses/[id]/structure/_components/course-exports-tab.tsx.ejs +12 -0
  167. package/hedhog/frontend/app/courses/[id]/structure/_components/course-overview-tab.tsx.ejs +141 -30
  168. package/hedhog/frontend/app/courses/[id]/structure/_components/course-xp-overview-tab.tsx.ejs +13 -13
  169. package/hedhog/frontend/app/courses/[id]/structure/_components/detail-course.tsx.ejs +69 -1
  170. package/hedhog/frontend/app/courses/[id]/structure/_components/detail-lesson-xp-tab.tsx.ejs +11 -23
  171. package/hedhog/frontend/app/courses/[id]/structure/_components/detail-lesson.tsx.ejs +267 -19
  172. package/hedhog/frontend/app/courses/[id]/structure/_components/editor-bulk.tsx.ejs +114 -86
  173. package/hedhog/frontend/app/courses/[id]/structure/_components/editor-course.tsx.ejs +239 -31
  174. package/hedhog/frontend/app/courses/[id]/structure/_components/editor-lesson.tsx.ejs +344 -59
  175. package/hedhog/frontend/app/courses/[id]/structure/_components/lesson-video-preview.tsx.ejs +200 -0
  176. package/hedhog/frontend/app/courses/[id]/structure/_components/tree-row-lesson.tsx.ejs +1 -0
  177. package/hedhog/frontend/app/courses/[id]/structure/_components/types.ts.ejs +3 -0
  178. package/hedhog/frontend/app/courses/[id]/structure/_components/xp-premium-pills.tsx.ejs +1 -8
  179. package/hedhog/frontend/app/courses/[id]/structure/_data/adapters/course-structure.adapter.ts.ejs +19 -7
  180. package/hedhog/frontend/app/courses/[id]/structure/_data/types/api-course.types.ts.ejs +4 -0
  181. package/hedhog/frontend/app/courses/[id]/structure/_data/use-course-ai-costs.ts.ejs +40 -0
  182. package/hedhog/frontend/app/courses/[id]/structure/_data/use-course-content-overview.ts.ejs +2 -0
  183. package/hedhog/frontend/app/courses/[id]/structure/_data/use-course-exports.ts.ejs +25 -0
  184. package/hedhog/frontend/app/courses/[id]/structure/_data/use-course-structure-mutations.ts.ejs +148 -0
  185. package/hedhog/frontend/app/courses/[id]/structure/_data/use-transcription-segments.ts.ejs +157 -8
  186. package/hedhog/frontend/app/courses/_components/CourseRowActions.tsx.ejs +1 -22
  187. package/hedhog/frontend/app/courses/page.tsx.ejs +66 -13
  188. package/hedhog/frontend/app/enterprise/[id]/page.tsx.ejs +6 -0
  189. package/hedhog/frontend/app/enterprise/_components/enterprise-classes-calendar-tab.tsx.ejs +264 -0
  190. package/hedhog/frontend/app/enterprise/page.tsx.ejs +104 -47
  191. package/hedhog/frontend/app/exams/page.tsx.ejs +38 -4
  192. package/hedhog/frontend/app/instructors/page.tsx.ejs +87 -46
  193. package/hedhog/frontend/app/paths/page.tsx.ejs +650 -168
  194. package/hedhog/frontend/app/training/page.tsx.ejs +38 -4
  195. package/hedhog/frontend/messages/en.json +41 -12
  196. package/hedhog/frontend/messages/pt.json +44 -13
  197. package/hedhog/query/triggers.sql +33 -0
  198. package/hedhog/table/course_ai_usage.yaml +46 -0
  199. package/hedhog/table/course_enrollment.yaml +3 -0
  200. package/hedhog/table/course_lesson.yaml +3 -0
  201. package/hedhog/table/course_lesson_answer.yaml +37 -0
  202. package/hedhog/table/course_lesson_transcription_segment.yaml +8 -0
  203. package/hedhog/table/learning_path.yaml +6 -0
  204. package/hedhog/table/learning_path_module.yaml +22 -0
  205. package/hedhog/table/learning_path_step.yaml +9 -6
  206. package/hedhog/table/lesson_view_event.yaml +66 -0
  207. package/package.json +8 -7
  208. package/src/certificate/certificate.controller.ts +2 -0
  209. package/src/certificate/certificate.service.ts +99 -0
  210. package/src/course/course-ai-usage.service.ts +221 -0
  211. package/src/course/course-audio-transcription.service.ts +471 -43
  212. package/src/course/course-export-scorm12.service.ts +149 -5
  213. package/src/course/course-export.service.ts +1 -0
  214. package/src/course/course-lesson.controller.ts +59 -6
  215. package/src/course/course-structure.controller.ts +19 -1
  216. package/src/course/course-structure.service.ts +184 -10
  217. package/src/course/course-transcription-translation.service.ts +293 -0
  218. package/src/course/course-video-agent-pipeline.service.ts +471 -0
  219. package/src/course/course-video-hls.service.ts +30 -10
  220. package/src/course/course.module.ts +9 -0
  221. package/src/course/course.service.ts +46 -1
  222. package/src/course/dto/create-course-bulk-job.dto.ts +7 -3
  223. package/src/course/dto/create-course-export.dto.ts +6 -0
  224. package/src/course/ffmpeg.util.ts +65 -0
  225. package/src/course/lms-bulk-upload-automation.service.ts +33 -8
  226. package/src/course/lms-bulk-upload.service.ts +20 -1
  227. package/src/course/subtitle.util.ts +220 -0
  228. package/src/enterprise/training/training-student.service.ts +224 -4
  229. package/src/lesson-xp-map/lesson-xp-ai-calculation.service.ts +14 -0
  230. package/src/lesson-xp-map/lesson-xp-map.module.ts +2 -1
  231. package/src/lms.module.ts +14 -0
  232. package/src/platforma/dto/heartbeat.dto.ts +30 -0
  233. package/src/platforma/handlers/emit-certificate.handler.ts +117 -0
  234. package/src/platforma/handlers/lesson-heartbeat.handler.ts +343 -0
  235. package/src/platforma/platforma-heartbeat.service.ts +33 -0
  236. package/src/platforma/platforma-performance.service.ts +606 -0
  237. package/src/platforma/platforma-search.service.ts +48 -0
  238. package/src/platforma/platforma-video.service.ts +59 -3
  239. package/src/platforma/platforma.controller.ts +130 -0
  240. package/src/realtime/lms-realtime.controller.ts +27 -1
  241. package/src/realtime/lms-realtime.service.ts +2 -1
  242. package/src/training/dto/create-training.dto.ts +36 -0
  243. package/src/training/training.service.ts +360 -163
@@ -1 +1 @@
1
- {"version":3,"file":"lms.module.d.ts","sourceRoot":"","sources":["../src/lms.module.ts"],"names":[],"mappings":"AAiCA,qBA0Da,SAAS;CAAG"}
1
+ {"version":3,"file":"lms.module.d.ts","sourceRoot":"","sources":["../src/lms.module.ts"],"names":[],"mappings":"AAwCA,qBAiEa,SAAS;CAAG"}
@@ -22,7 +22,9 @@ const class_group_module_1 = require("./class-group/class-group.module");
22
22
  const course_lesson_discussion_module_1 = require("./course-lesson-discussion/course-lesson-discussion.module");
23
23
  const course_lesson_note_module_1 = require("./course-lesson-note/course-lesson-note.module");
24
24
  const lms_commerce_access_subscriber_1 = require("./lms-commerce-access.subscriber");
25
+ const course_ai_usage_service_1 = require("./course/course-ai-usage.service");
25
26
  const course_audio_transcription_service_1 = require("./course/course-audio-transcription.service");
27
+ const course_transcription_translation_service_1 = require("./course/course-transcription-translation.service");
26
28
  const course_module_1 = require("./course/course.module");
27
29
  const dashboard_module_1 = require("./dashboard/dashboard.module");
28
30
  const enterprise_module_1 = require("./enterprise/enterprise.module");
@@ -31,7 +33,12 @@ const evaluation_module_1 = require("./evaluation/evaluation.module");
31
33
  const exam_module_1 = require("./exam/exam.module");
32
34
  const instructor_module_1 = require("./instructor/instructor.module");
33
35
  const lesson_xp_map_module_1 = require("./lesson-xp-map/lesson-xp-map.module");
36
+ const emit_certificate_handler_1 = require("./platforma/handlers/emit-certificate.handler");
37
+ const lesson_heartbeat_handler_1 = require("./platforma/handlers/lesson-heartbeat.handler");
34
38
  const platforma_controller_1 = require("./platforma/platforma.controller");
39
+ const platforma_heartbeat_service_1 = require("./platforma/platforma-heartbeat.service");
40
+ const platforma_performance_service_1 = require("./platforma/platforma-performance.service");
41
+ const platforma_search_service_1 = require("./platforma/platforma-search.service");
35
42
  const platforma_video_service_1 = require("./platforma/platforma-video.service");
36
43
  const student_xp_module_1 = require("./student-xp/student-xp.module");
37
44
  const xp_catalog_module_1 = require("./xp-catalog/xp-catalog.module");
@@ -74,9 +81,16 @@ exports.LmsModule = LmsModule = __decorate([
74
81
  ],
75
82
  controllers: [platforma_controller_1.PlataformaController],
76
83
  providers: [
84
+ course_ai_usage_service_1.CourseAiUsageService,
77
85
  course_audio_transcription_service_1.CourseAudioTranscriptionService,
86
+ course_transcription_translation_service_1.CourseTranscriptionTranslationService,
78
87
  platforma_service_1.PlatformaService,
79
88
  platforma_video_service_1.PlatformaVideoService,
89
+ platforma_heartbeat_service_1.PlatformaHeartbeatService,
90
+ platforma_performance_service_1.PlatformaPerformanceService,
91
+ platforma_search_service_1.PlatformaSearchService,
92
+ lesson_heartbeat_handler_1.LessonHeartbeatHandler,
93
+ emit_certificate_handler_1.EmitCertificateHandler,
80
94
  lms_commerce_access_subscriber_1.LmsCommerceAccessSubscriber,
81
95
  ],
82
96
  exports: [
@@ -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,gDAAmD;AACnD,0CAA6C;AAC7C,2CAAoD;AACpD,2CAA8C;AAC9C,yEAAqE;AACrE,kFAA6E;AAC7E,yEAAwE;AACxE,yEAAoE;AACpE,gHAA0G;AAC1G,8FAAwF;AACxF,qFAA+E;AAC/E,oGAA8F;AAC9F,0DAAsD;AACtD,mEAAkE;AAClE,sEAAkE;AAClE,iGAA4F;AAC5F,sEAAkE;AAClE,oDAAgD;AAChD,sEAAkE;AAClE,+EAAyE;AACzE,2EAAwE;AACxE,iFAA4E;AAC5E,sEAAiE;AACjE,sEAAiE;AACjE,qEAAiE;AACjE,wEAAmE;AACnE,6DAA4D;AAC5D,gEAA4D;AA4DrD,IAAM,SAAS,GAAf,MAAM,SAAS;CAAG,CAAA;AAAZ,8BAAS;oBAAT,SAAS;IA1DrB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,qBAAY,CAAC,OAAO,EAAE;YACtB,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,iCAAgB,CAAC;YAClC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,yBAAY,CAAC;YAC9B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,iBAAU,CAAC;YAC5B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,mBAAW,CAAC;YAC7B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,yBAAc,CAAC;YAChC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,yBAAY,CAAC;YAC9B,IAAA,mBAA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GAAG,EAAE,CAAC,2CAAmB,CAAC;YACrC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,qCAAgB,CAAC;YAClC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,8DAA4B,CAAC;YAC9C,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,kDAAsB,CAAC;YACxC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,yCAAoB,CAAC;YACtC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,4BAAY,CAAC;YAC9B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,qCAAkB,CAAC;YACpC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,oCAAgB,CAAC;YAClC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,qDAAwB,CAAC;YAC1C,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,oCAAgB,CAAC;YAClC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,wBAAU,CAAC;YAC5B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,oCAAgB,CAAC;YAClC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,uCAAiB,CAAC;YACnC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,iCAAgB,CAAC;YAClC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,gCAAc,CAAC;YAChC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,mCAAe,CAAC;YACjC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,wCAAiB,CAAC;YACnC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,mCAAe,CAAC;SAClC;KACF,CAAC;GACW,SAAS,CAAG"}
@@ -0,0 +1,9 @@
1
+ export declare class HeartbeatDto {
2
+ lessonId: number;
3
+ positionSeconds: number;
4
+ sessionId?: string;
5
+ screenWidth?: number;
6
+ screenHeight?: number;
7
+ isTouch?: boolean;
8
+ }
9
+ //# sourceMappingURL=heartbeat.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"heartbeat.dto.d.ts","sourceRoot":"","sources":["../../../src/platforma/dto/heartbeat.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,YAAY;IAEvB,QAAQ,EAAE,MAAM,CAAC;IAIjB,eAAe,EAAE,MAAM,CAAC;IAIxB,SAAS,CAAC,EAAE,MAAM,CAAC;IAMnB,WAAW,CAAC,EAAE,MAAM,CAAC;IAMrB,YAAY,CAAC,EAAE,MAAM,CAAC;IAItB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB"}
@@ -0,0 +1,50 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.HeartbeatDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ class HeartbeatDto {
15
+ }
16
+ exports.HeartbeatDto = HeartbeatDto;
17
+ __decorate([
18
+ (0, class_validator_1.IsInt)(),
19
+ __metadata("design:type", Number)
20
+ ], HeartbeatDto.prototype, "lessonId", void 0);
21
+ __decorate([
22
+ (0, class_validator_1.IsInt)(),
23
+ (0, class_validator_1.Min)(0),
24
+ __metadata("design:type", Number)
25
+ ], HeartbeatDto.prototype, "positionSeconds", void 0);
26
+ __decorate([
27
+ (0, class_validator_1.IsOptional)(),
28
+ (0, class_validator_1.IsString)(),
29
+ __metadata("design:type", String)
30
+ ], HeartbeatDto.prototype, "sessionId", void 0);
31
+ __decorate([
32
+ (0, class_validator_1.IsOptional)(),
33
+ (0, class_validator_1.IsInt)(),
34
+ (0, class_validator_1.Min)(1),
35
+ (0, class_validator_1.Max)(10000),
36
+ __metadata("design:type", Number)
37
+ ], HeartbeatDto.prototype, "screenWidth", void 0);
38
+ __decorate([
39
+ (0, class_validator_1.IsOptional)(),
40
+ (0, class_validator_1.IsInt)(),
41
+ (0, class_validator_1.Min)(1),
42
+ (0, class_validator_1.Max)(10000),
43
+ __metadata("design:type", Number)
44
+ ], HeartbeatDto.prototype, "screenHeight", void 0);
45
+ __decorate([
46
+ (0, class_validator_1.IsOptional)(),
47
+ (0, class_validator_1.IsBoolean)(),
48
+ __metadata("design:type", Boolean)
49
+ ], HeartbeatDto.prototype, "isTouch", void 0);
50
+ //# sourceMappingURL=heartbeat.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"heartbeat.dto.js","sourceRoot":"","sources":["../../../src/platforma/dto/heartbeat.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAmF;AAEnF,MAAa,YAAY;CA2BxB;AA3BD,oCA2BC;AAzBC;IADC,IAAA,uBAAK,GAAE;;8CACS;AAIjB;IAFC,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAG,EAAC,CAAC,CAAC;;qDACiB;AAIxB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;+CACQ;AAMnB;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAG,EAAC,CAAC,CAAC;IACN,IAAA,qBAAG,EAAC,KAAK,CAAC;;iDACU;AAMrB;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAG,EAAC,CAAC,CAAC;IACN,IAAA,qBAAG,EAAC,KAAK,CAAC;;kDACW;AAItB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,GAAE;;6CACM"}
@@ -0,0 +1,27 @@
1
+ import { PrismaService } from '@hed-hog/api-prisma';
2
+ import { IJobHandler, QueueHandlerRegistry } from '@hed-hog/queue';
3
+ import { OnModuleInit } from '@nestjs/common';
4
+ export declare const EMIT_CERTIFICATE_JOB = "lms.emit_certificate";
5
+ export declare class EmitCertificateHandler implements OnModuleInit, IJobHandler {
6
+ private readonly prisma;
7
+ private readonly registry;
8
+ private readonly logger;
9
+ constructor(prisma: PrismaService, registry: QueueHandlerRegistry);
10
+ onModuleInit(): void;
11
+ handle(job: {
12
+ payload: Record<string, any>;
13
+ }): Promise<{
14
+ skipped: boolean;
15
+ alreadyIssued?: undefined;
16
+ verificationCode?: undefined;
17
+ } | {
18
+ skipped: boolean;
19
+ alreadyIssued: boolean;
20
+ verificationCode?: undefined;
21
+ } | {
22
+ verificationCode: string;
23
+ skipped?: undefined;
24
+ alreadyIssued?: undefined;
25
+ }>;
26
+ }
27
+ //# sourceMappingURL=emit-certificate.handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emit-certificate.handler.d.ts","sourceRoot":"","sources":["../../../src/platforma/handlers/emit-certificate.handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAA8B,YAAY,EAAc,MAAM,gBAAgB,CAAC;AAGtF,eAAO,MAAM,oBAAoB,yBAAyB,CAAC;AAE3D,qBACa,sBAAuB,YAAW,YAAY,EAAE,WAAW;IAKpE,OAAO,CAAC,QAAQ,CAAC,MAAM;IAEvB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAN3B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA2C;gBAI/C,MAAM,EAAE,aAAa,EAErB,QAAQ,EAAE,oBAAoB;IAGjD,YAAY;IAKN,MAAM,CAAC,GAAG,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;KAAE;;;;;;;;;;;;;CA6FnD"}
@@ -0,0 +1,117 @@
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 EmitCertificateHandler_1;
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.EmitCertificateHandler = exports.EMIT_CERTIFICATE_JOB = void 0;
17
+ const api_prisma_1 = require("@hed-hog/api-prisma");
18
+ const queue_1 = require("@hed-hog/queue");
19
+ const common_1 = require("@nestjs/common");
20
+ const crypto_1 = require("crypto");
21
+ exports.EMIT_CERTIFICATE_JOB = 'lms.emit_certificate';
22
+ let EmitCertificateHandler = EmitCertificateHandler_1 = class EmitCertificateHandler {
23
+ constructor(prisma, registry) {
24
+ this.prisma = prisma;
25
+ this.registry = registry;
26
+ this.logger = new common_1.Logger(EmitCertificateHandler_1.name);
27
+ }
28
+ onModuleInit() {
29
+ this.registry.register(exports.EMIT_CERTIFICATE_JOB, this);
30
+ this.logger.log(`Registered handler for "${exports.EMIT_CERTIFICATE_JOB}"`);
31
+ }
32
+ async handle(job) {
33
+ var _a, _b, _c, _d, _e, _f, _g;
34
+ const { enrollmentId, courseId, personId } = job.payload;
35
+ // Idempotency guard — re-entrancy safe
36
+ const enrollment = await this.prisma.course_enrollment.findUnique({
37
+ where: { id: enrollmentId },
38
+ select: { certificate_issued_at: true, completed_at: true, final_score: true },
39
+ });
40
+ if (!enrollment) {
41
+ this.logger.warn(`Enrollment ${enrollmentId} not found, skipping certificate`);
42
+ return { skipped: true };
43
+ }
44
+ if (enrollment.certificate_issued_at) {
45
+ this.logger.log(`Certificate already issued for enrollment ${enrollmentId}`);
46
+ return { skipped: true, alreadyIssued: true };
47
+ }
48
+ const [person, course] = await Promise.all([
49
+ this.prisma.person.findUnique({
50
+ where: { id: personId },
51
+ select: { name: true },
52
+ }),
53
+ this.prisma.course.findUnique({
54
+ where: { id: courseId },
55
+ select: {
56
+ title: true,
57
+ certificate_workload: true,
58
+ has_certificate: true,
59
+ certificate_template_id: true,
60
+ },
61
+ }),
62
+ ]);
63
+ if (!person || !course) {
64
+ this.logger.warn(`Person or course not found (enrollment ${enrollmentId})`);
65
+ return { skipped: true };
66
+ }
67
+ if (!course.has_certificate || !course.certificate_template_id) {
68
+ this.logger.log(`Course ${courseId} does not issue certificates`);
69
+ return { skipped: true };
70
+ }
71
+ // Compute workload hours from lesson durations when not set on the course
72
+ let workloadHours = (_a = course.certificate_workload) !== null && _a !== void 0 ? _a : 0;
73
+ if (!workloadHours) {
74
+ const agg = await this.prisma.course_lesson.aggregate({
75
+ where: { published: true, course_module: { course_id: courseId } },
76
+ _sum: { duration_seconds: true },
77
+ });
78
+ const totalSeconds = (_c = (_b = agg._sum) === null || _b === void 0 ? void 0 : _b.duration_seconds) !== null && _c !== void 0 ? _c : 0;
79
+ workloadHours = Math.max(1, Math.ceil(totalSeconds / 3600));
80
+ }
81
+ const issuedAt = new Date();
82
+ const verificationCode = (0, crypto_1.randomBytes)(12).toString('hex').toUpperCase();
83
+ await this.prisma.certificate.create({
84
+ data: {
85
+ verification_code: verificationCode,
86
+ student_id: personId,
87
+ course_enrollment_id: enrollmentId,
88
+ course_id: courseId,
89
+ certificate_template_id: course.certificate_template_id,
90
+ certificate_type: 'course',
91
+ student_name: (_d = person.name) !== null && _d !== void 0 ? _d : '',
92
+ course_name: (_e = course.title) !== null && _e !== void 0 ? _e : '',
93
+ workload_hours: workloadHours,
94
+ issued_at: issuedAt,
95
+ completed_at: (_f = enrollment.completed_at) !== null && _f !== void 0 ? _f : issuedAt,
96
+ final_score: (_g = enrollment.final_score) !== null && _g !== void 0 ? _g : null,
97
+ public_access: false,
98
+ },
99
+ });
100
+ // Mark enrollment as issued — prevents duplicate certificates on any future re-run
101
+ await this.prisma.course_enrollment.update({
102
+ where: { id: enrollmentId },
103
+ data: { certificate_issued_at: issuedAt },
104
+ });
105
+ this.logger.log(`Certificate issued — enrollment=${enrollmentId} course=${courseId} code=${verificationCode}`);
106
+ return { verificationCode };
107
+ }
108
+ };
109
+ exports.EmitCertificateHandler = EmitCertificateHandler;
110
+ exports.EmitCertificateHandler = EmitCertificateHandler = EmitCertificateHandler_1 = __decorate([
111
+ (0, common_1.Injectable)(),
112
+ __param(0, (0, common_1.Inject)((0, common_1.forwardRef)(() => api_prisma_1.PrismaService))),
113
+ __param(1, (0, common_1.Inject)((0, common_1.forwardRef)(() => queue_1.QueueHandlerRegistry))),
114
+ __metadata("design:paramtypes", [api_prisma_1.PrismaService,
115
+ queue_1.QueueHandlerRegistry])
116
+ ], EmitCertificateHandler);
117
+ //# sourceMappingURL=emit-certificate.handler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emit-certificate.handler.js","sourceRoot":"","sources":["../../../src/platforma/handlers/emit-certificate.handler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAoD;AACpD,0CAAmE;AACnE,2CAAsF;AACtF,mCAAqC;AAExB,QAAA,oBAAoB,GAAG,sBAAsB,CAAC;AAGpD,IAAM,sBAAsB,8BAA5B,MAAM,sBAAsB;IAGjC,YAEE,MAAsC,EAEtC,QAA+C;QAF9B,WAAM,GAAN,MAAM,CAA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;iCAAtB,sBAAsB;IADlC,IAAA,mBAAU,GAAE;IAKR,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,0BAAa,CAAC,CAAC,CAAA;IAEvC,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,4BAAoB,CAAC,CAAC,CAAA;qCADtB,0BAAa;QAEX,4BAAoB;GAPtC,sBAAsB,CA4GlC"}
@@ -0,0 +1,31 @@
1
+ import { PrismaService } from '@hed-hog/api-prisma';
2
+ import { IJobHandler, QueueHandlerRegistry, QueueJobService } from '@hed-hog/queue';
3
+ import { OnModuleInit } from '@nestjs/common';
4
+ import { LmsRealtimeService } from '../../realtime/lms-realtime.service';
5
+ export declare const LESSON_HEARTBEAT_JOB = "lms.lesson_heartbeat";
6
+ export declare class LessonHeartbeatHandler implements OnModuleInit, IJobHandler {
7
+ private readonly prisma;
8
+ private readonly registry;
9
+ private readonly queueJob;
10
+ private readonly realtime;
11
+ private readonly logger;
12
+ constructor(prisma: PrismaService, registry: QueueHandlerRegistry, queueJob: QueueJobService, realtime: LmsRealtimeService);
13
+ onModuleInit(): void;
14
+ handle(job: {
15
+ payload: Record<string, any>;
16
+ }): Promise<{
17
+ skipped: boolean;
18
+ reason: string;
19
+ ok?: undefined;
20
+ } | {
21
+ ok: boolean;
22
+ skipped?: undefined;
23
+ reason?: undefined;
24
+ }>;
25
+ private updateLessonProgress;
26
+ private syncEnrollmentProgress;
27
+ private maybeTriggerCertificate;
28
+ private parseUA;
29
+ private resolveGeo;
30
+ }
31
+ //# sourceMappingURL=lesson-heartbeat.handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lesson-heartbeat.handler.d.ts","sourceRoot":"","sources":["../../../src/platforma/handlers/lesson-heartbeat.handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACpF,OAAO,EAA8B,YAAY,EAAc,MAAM,gBAAgB,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAEzE,eAAO,MAAM,oBAAoB,yBAAyB,CAAC;AAE3D,qBACa,sBAAuB,YAAW,YAAY,EAAE,WAAW;IAKpE,OAAO,CAAC,QAAQ,CAAC,MAAM;IAEvB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAEzB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAEzB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAV3B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA2C;gBAI/C,MAAM,EAAE,aAAa,EAErB,QAAQ,EAAE,oBAAoB,EAE9B,QAAQ,EAAE,eAAe,EAEzB,QAAQ,EAAE,kBAAkB;IAG/C,YAAY;IAKN,MAAM,CAAC,GAAG,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;KAAE;;;;;;;;;YA8GpC,oBAAoB;YA+DpB,sBAAsB;YAsCtB,uBAAuB;IA4BrC,OAAO,CAAC,OAAO;YAqCD,UAAU;CAuCzB"}
@@ -0,0 +1,281 @@
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 LessonHeartbeatHandler_1;
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.LessonHeartbeatHandler = exports.LESSON_HEARTBEAT_JOB = void 0;
17
+ const api_prisma_1 = require("@hed-hog/api-prisma");
18
+ const queue_1 = require("@hed-hog/queue");
19
+ const common_1 = require("@nestjs/common");
20
+ const lms_realtime_service_1 = require("../../realtime/lms-realtime.service");
21
+ exports.LESSON_HEARTBEAT_JOB = 'lms.lesson_heartbeat';
22
+ let LessonHeartbeatHandler = LessonHeartbeatHandler_1 = class LessonHeartbeatHandler {
23
+ constructor(prisma, registry, queueJob, realtime) {
24
+ this.prisma = prisma;
25
+ this.registry = registry;
26
+ this.queueJob = queueJob;
27
+ this.realtime = realtime;
28
+ this.logger = new common_1.Logger(LessonHeartbeatHandler_1.name);
29
+ }
30
+ onModuleInit() {
31
+ this.registry.register(exports.LESSON_HEARTBEAT_JOB, this);
32
+ this.logger.log(`Registered handler for "${exports.LESSON_HEARTBEAT_JOB}"`);
33
+ }
34
+ async handle(job) {
35
+ var _a, _b, _c, _d, _e, _f, _g;
36
+ const { userId, ip, userAgent, lessonId, positionSeconds, sessionId, screenWidth, screenHeight, isTouch, } = job.payload;
37
+ const { browser, os, deviceType } = this.parseUA(String(userAgent !== null && userAgent !== void 0 ? userAgent : ''));
38
+ const geo = await this.resolveGeo(ip);
39
+ const lesson = await this.prisma.course_lesson.findUnique({
40
+ where: { id: lessonId },
41
+ select: {
42
+ id: true,
43
+ duration_seconds: true,
44
+ published: true,
45
+ course_module: { select: { course_id: true } },
46
+ },
47
+ });
48
+ if (!(lesson === null || lesson === void 0 ? void 0 : lesson.published)) {
49
+ return { skipped: true, reason: 'lesson not published' };
50
+ }
51
+ const courseId = (_a = lesson.course_module) === null || _a === void 0 ? void 0 : _a.course_id;
52
+ let enrollmentId = null;
53
+ let personId = null;
54
+ if (userId && courseId) {
55
+ const personUser = await this.prisma.person_user.findFirst({
56
+ where: { user_id: userId },
57
+ select: { person_id: true },
58
+ });
59
+ if (personUser) {
60
+ personId = personUser.person_id;
61
+ const enrollment = await this.prisma.course_enrollment.findFirst({
62
+ where: {
63
+ person_id: personId,
64
+ course_id: courseId,
65
+ status: { in: ['active', 'completed'] },
66
+ },
67
+ select: { id: true },
68
+ });
69
+ enrollmentId = (_b = enrollment === null || enrollment === void 0 ? void 0 : enrollment.id) !== null && _b !== void 0 ? _b : null;
70
+ }
71
+ }
72
+ // Record raw view event
73
+ await this.prisma.lesson_view_event.create({
74
+ data: {
75
+ user_id: userId !== null && userId !== void 0 ? userId : null,
76
+ course_lesson_id: lessonId,
77
+ course_enrollment_id: enrollmentId,
78
+ session_id: sessionId !== null && sessionId !== void 0 ? sessionId : null,
79
+ video_position_seconds: positionSeconds !== null && positionSeconds !== void 0 ? positionSeconds : 0,
80
+ ip: ip !== null && ip !== void 0 ? ip : null,
81
+ country: (_c = geo === null || geo === void 0 ? void 0 : geo.country) !== null && _c !== void 0 ? _c : null,
82
+ city: (_d = geo === null || geo === void 0 ? void 0 : geo.city) !== null && _d !== void 0 ? _d : null,
83
+ browser,
84
+ os,
85
+ device_type: deviceType,
86
+ screen_width: screenWidth !== null && screenWidth !== void 0 ? screenWidth : null,
87
+ screen_height: screenHeight !== null && screenHeight !== void 0 ? screenHeight : null,
88
+ is_touch: isTouch !== null && isTouch !== void 0 ? isTouch : false,
89
+ },
90
+ });
91
+ // Update lesson progress if enrolled
92
+ if (enrollmentId) {
93
+ const wasLessonCompleted = await this.updateLessonProgress(enrollmentId, lessonId, positionSeconds !== null && positionSeconds !== void 0 ? positionSeconds : 0, (_e = lesson.duration_seconds) !== null && _e !== void 0 ? _e : 0);
94
+ if (wasLessonCompleted) {
95
+ await this.syncEnrollmentProgress(enrollmentId, courseId, personId);
96
+ }
97
+ }
98
+ // Publish to admin real-time monitor
99
+ this.realtime.publish({
100
+ domain: 'lesson_view',
101
+ type: 'created',
102
+ entityId: lessonId,
103
+ actorId: userId !== null && userId !== void 0 ? userId : null,
104
+ payload: {
105
+ ip,
106
+ country: (_f = geo === null || geo === void 0 ? void 0 : geo.country) !== null && _f !== void 0 ? _f : null,
107
+ city: (_g = geo === null || geo === void 0 ? void 0 : geo.city) !== null && _g !== void 0 ? _g : null,
108
+ browser,
109
+ os,
110
+ deviceType,
111
+ positionSeconds,
112
+ enrollmentId,
113
+ },
114
+ });
115
+ return { ok: true };
116
+ }
117
+ async updateLessonProgress(enrollmentId, lessonId, positionSeconds, durationSeconds) {
118
+ const progressPercent = durationSeconds > 0
119
+ ? Math.min(100, Math.round((positionSeconds / durationSeconds) * 100))
120
+ : positionSeconds > 0
121
+ ? 100
122
+ : 0;
123
+ const isCompleted = progressPercent >= 95;
124
+ const existing = await this.prisma.course_lesson_progress.findUnique({
125
+ where: {
126
+ course_enrollment_id_course_lesson_id: {
127
+ course_enrollment_id: enrollmentId,
128
+ course_lesson_id: lessonId,
129
+ },
130
+ },
131
+ select: { status: true },
132
+ });
133
+ const wasAlreadyCompleted = (existing === null || existing === void 0 ? void 0 : existing.status) === 'completed';
134
+ const newStatus = isCompleted
135
+ ? 'completed'
136
+ : positionSeconds > 0
137
+ ? 'in_progress'
138
+ : 'not_started';
139
+ await this.prisma.course_lesson_progress.upsert({
140
+ where: {
141
+ course_enrollment_id_course_lesson_id: {
142
+ course_enrollment_id: enrollmentId,
143
+ course_lesson_id: lessonId,
144
+ },
145
+ },
146
+ create: {
147
+ course_enrollment_id: enrollmentId,
148
+ course_lesson_id: lessonId,
149
+ status: newStatus,
150
+ progress_percent: progressPercent,
151
+ video_progress_seconds: positionSeconds,
152
+ started_at: new Date(),
153
+ completed_at: isCompleted ? new Date() : null,
154
+ time_spent_seconds: 0,
155
+ },
156
+ update: Object.assign({ video_progress_seconds: positionSeconds, progress_percent: wasAlreadyCompleted ? 100 : progressPercent,
157
+ // Never regress status from completed
158
+ status: wasAlreadyCompleted ? 'completed' : newStatus }, (!wasAlreadyCompleted && isCompleted ? { completed_at: new Date() } : {})),
159
+ });
160
+ // Returns true when the lesson just became completed for the first time
161
+ return isCompleted && !wasAlreadyCompleted;
162
+ }
163
+ async syncEnrollmentProgress(enrollmentId, courseId, personId) {
164
+ const [totalLessons, completedLessons] = await Promise.all([
165
+ this.prisma.course_lesson.count({
166
+ where: { published: true, course_module: { course_id: courseId } },
167
+ }),
168
+ this.prisma.course_lesson_progress.count({
169
+ where: {
170
+ course_enrollment_id: enrollmentId,
171
+ status: 'completed',
172
+ course_lesson: { published: true, course_module: { course_id: courseId } },
173
+ },
174
+ }),
175
+ ]);
176
+ const progressPercent = totalLessons > 0 ? Math.round((completedLessons / totalLessons) * 100) : 0;
177
+ const isCourseComplete = progressPercent === 100;
178
+ await this.prisma.course_enrollment.update({
179
+ where: { id: enrollmentId },
180
+ data: Object.assign({ progress_percent: progressPercent }, (isCourseComplete
181
+ ? { status: 'completed', completed_at: new Date() }
182
+ : {})),
183
+ });
184
+ if (isCourseComplete && personId) {
185
+ await this.maybeTriggerCertificate(enrollmentId, courseId, personId);
186
+ }
187
+ }
188
+ async maybeTriggerCertificate(enrollmentId, courseId, personId) {
189
+ const enrollment = await this.prisma.course_enrollment.findUnique({
190
+ where: { id: enrollmentId },
191
+ select: { certificate_issued_at: true },
192
+ });
193
+ if (enrollment === null || enrollment === void 0 ? void 0 : enrollment.certificate_issued_at)
194
+ return;
195
+ const course = await this.prisma.course.findUnique({
196
+ where: { id: courseId },
197
+ select: { has_certificate: true, certificate_template_id: true },
198
+ });
199
+ if (!(course === null || course === void 0 ? void 0 : course.has_certificate) || !course.certificate_template_id)
200
+ return;
201
+ await this.queueJob.enqueue({
202
+ type: 'lms.emit_certificate',
203
+ queueName: 'lms.certificate',
204
+ payload: { enrollmentId, courseId, personId },
205
+ maxAttempts: 3,
206
+ sourceModule: 'lms',
207
+ });
208
+ }
209
+ parseUA(ua) {
210
+ const browser = /Chrome\//.test(ua) && !/Edg\/|OPR\//.test(ua)
211
+ ? 'Chrome'
212
+ : /Firefox\//.test(ua)
213
+ ? 'Firefox'
214
+ : /Safari\//.test(ua) && !/Chrome\//.test(ua)
215
+ ? 'Safari'
216
+ : /Edg\//.test(ua)
217
+ ? 'Edge'
218
+ : /OPR\//.test(ua)
219
+ ? 'Opera'
220
+ : 'Other';
221
+ const os = /Android/.test(ua)
222
+ ? 'Android'
223
+ : /iPhone|iPad/.test(ua)
224
+ ? 'iOS'
225
+ : /Windows/.test(ua)
226
+ ? 'Windows'
227
+ : /Mac OS X/.test(ua)
228
+ ? 'macOS'
229
+ : /Linux/.test(ua)
230
+ ? 'Linux'
231
+ : 'Other';
232
+ const deviceType = /Mobile|Android|iPhone/.test(ua)
233
+ ? 'mobile'
234
+ : /iPad|Tablet/.test(ua)
235
+ ? 'tablet'
236
+ : 'desktop';
237
+ return { browser, os, deviceType };
238
+ }
239
+ async resolveGeo(ip) {
240
+ var _a, _b;
241
+ if (!ip ||
242
+ ip === '127.0.0.1' ||
243
+ ip === '::1' ||
244
+ ip.startsWith('192.168.') ||
245
+ ip.startsWith('10.') ||
246
+ ip.startsWith('172.')) {
247
+ return null;
248
+ }
249
+ try {
250
+ const controller = new AbortController();
251
+ const timeout = setTimeout(() => controller.abort(), 2000);
252
+ const res = await fetch(`http://ip-api.com/json/${ip}?fields=status,countryCode,city`, { signal: controller.signal });
253
+ clearTimeout(timeout);
254
+ if (!res.ok)
255
+ return null;
256
+ const data = (await res.json());
257
+ if (data.status !== 'success')
258
+ return null;
259
+ return {
260
+ country: ((_a = data.countryCode) !== null && _a !== void 0 ? _a : '').slice(0, 2),
261
+ city: ((_b = data.city) !== null && _b !== void 0 ? _b : '').slice(0, 100),
262
+ };
263
+ }
264
+ catch (_c) {
265
+ return null;
266
+ }
267
+ }
268
+ };
269
+ exports.LessonHeartbeatHandler = LessonHeartbeatHandler;
270
+ exports.LessonHeartbeatHandler = LessonHeartbeatHandler = LessonHeartbeatHandler_1 = __decorate([
271
+ (0, common_1.Injectable)(),
272
+ __param(0, (0, common_1.Inject)((0, common_1.forwardRef)(() => api_prisma_1.PrismaService))),
273
+ __param(1, (0, common_1.Inject)((0, common_1.forwardRef)(() => queue_1.QueueHandlerRegistry))),
274
+ __param(2, (0, common_1.Inject)((0, common_1.forwardRef)(() => queue_1.QueueJobService))),
275
+ __param(3, (0, common_1.Inject)((0, common_1.forwardRef)(() => lms_realtime_service_1.LmsRealtimeService))),
276
+ __metadata("design:paramtypes", [api_prisma_1.PrismaService,
277
+ queue_1.QueueHandlerRegistry,
278
+ queue_1.QueueJobService,
279
+ lms_realtime_service_1.LmsRealtimeService])
280
+ ], LessonHeartbeatHandler);
281
+ //# sourceMappingURL=lesson-heartbeat.handler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lesson-heartbeat.handler.js","sourceRoot":"","sources":["../../../src/platforma/handlers/lesson-heartbeat.handler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAoD;AACpD,0CAAoF;AACpF,2CAAsF;AACtF,8EAAyE;AAE5D,QAAA,oBAAoB,GAAG,sBAAsB,CAAC;AAGpD,IAAM,sBAAsB,8BAA5B,MAAM,sBAAsB;IAGjC,YAEE,MAAsC,EAEtC,QAA+C,EAE/C,QAA0C,EAE1C,QAA6C;QAN5B,WAAM,GAAN,MAAM,CAAe;QAErB,aAAQ,GAAR,QAAQ,CAAsB;QAE9B,aAAQ,GAAR,QAAQ,CAAiB;QAEzB,aAAQ,GAAR,QAAQ,CAAoB;QAV9B,WAAM,GAAG,IAAI,eAAM,CAAC,wBAAsB,CAAC,IAAI,CAAC,CAAC;IAW/D,CAAC;IAEJ,YAAY;QACV,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,4BAAoB,EAAE,IAAI,CAAC,CAAC;QACnD,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,2BAA2B,4BAAoB,GAAG,CAAC,CAAC;IACtE,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,GAAqC;;QAChD,MAAM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B;iCAAtB,sBAAsB;IADlC,IAAA,mBAAU,GAAE;IAKR,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,0BAAa,CAAC,CAAC,CAAA;IAEvC,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;IAEzC,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,yCAAkB,CAAC,CAAC,CAAA;qCALpB,0BAAa;QAEX,4BAAoB;QAEpB,uBAAe;QAEf,yCAAkB;GAXpC,sBAAsB,CA8UlC"}
@@ -0,0 +1,10 @@
1
+ import { QueueJobService } from '@hed-hog/queue';
2
+ import { HeartbeatDto } from './dto/heartbeat.dto';
3
+ export declare class PlatformaHeartbeatService {
4
+ private readonly queueJob;
5
+ constructor(queueJob: QueueJobService);
6
+ enqueue(userId: number, ip: string, userAgent: string, dto: HeartbeatDto): Promise<{
7
+ ok: boolean;
8
+ }>;
9
+ }
10
+ //# sourceMappingURL=platforma-heartbeat.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platforma-heartbeat.service.d.ts","sourceRoot":"","sources":["../../src/platforma/platforma-heartbeat.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,qBACa,yBAAyB;IAGlC,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,EAAE,eAAe;IAGtC,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,YAAY;;;CAqB/E"}