@hed-hog/lms 0.0.364 → 0.0.366
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.
- package/dist/bitcode-wallet/bitcode-wallet.service.d.ts +1 -0
- package/dist/bitcode-wallet/bitcode-wallet.service.d.ts.map +1 -1
- package/dist/bitcode-wallet/bitcode-wallet.service.js +22 -3
- package/dist/bitcode-wallet/bitcode-wallet.service.js.map +1 -1
- package/dist/class-group/class-group.controller.d.ts +1 -0
- package/dist/class-group/class-group.controller.d.ts.map +1 -1
- package/dist/class-group/class-group.service.d.ts +1 -0
- package/dist/class-group/class-group.service.d.ts.map +1 -1
- package/dist/course/course-export-scorm12-worker.service.d.ts +21 -0
- package/dist/course/course-export-scorm12-worker.service.d.ts.map +1 -0
- package/dist/course/course-export-scorm12-worker.service.js +109 -0
- package/dist/course/course-export-scorm12-worker.service.js.map +1 -0
- package/dist/course/course-export-scorm12.service.d.ts +42 -0
- package/dist/course/course-export-scorm12.service.d.ts.map +1 -0
- package/dist/course/course-export-scorm12.service.js +628 -0
- package/dist/course/course-export-scorm12.service.js.map +1 -0
- package/dist/course/course-export.service.d.ts +84 -0
- package/dist/course/course-export.service.d.ts.map +1 -0
- package/dist/course/course-export.service.js +237 -0
- package/dist/course/course-export.service.js.map +1 -0
- package/dist/course/course-structure.controller.d.ts +20 -10
- package/dist/course/course-structure.controller.d.ts.map +1 -1
- package/dist/course/course-structure.controller.js +20 -4
- package/dist/course/course-structure.controller.js.map +1 -1
- package/dist/course/course-structure.service.d.ts +12 -4
- package/dist/course/course-structure.service.d.ts.map +1 -1
- package/dist/course/course-structure.service.js +98 -23
- package/dist/course/course-structure.service.js.map +1 -1
- package/dist/course/course-video-agent-pipeline.service.d.ts +70 -0
- package/dist/course/course-video-agent-pipeline.service.d.ts.map +1 -0
- package/dist/course/course-video-agent-pipeline.service.js +398 -0
- package/dist/course/course-video-agent-pipeline.service.js.map +1 -0
- package/dist/course/course-video-hls.service.d.ts +71 -0
- package/dist/course/course-video-hls.service.d.ts.map +1 -0
- package/dist/course/course-video-hls.service.js +784 -0
- package/dist/course/course-video-hls.service.js.map +1 -0
- package/dist/course/course.controller.d.ts +47 -13
- package/dist/course/course.controller.d.ts.map +1 -1
- package/dist/course/course.controller.js +40 -26
- package/dist/course/course.controller.js.map +1 -1
- package/dist/course/course.mcp-tools.js +1 -1
- package/dist/course/course.mcp-tools.js.map +1 -1
- package/dist/course/course.module.d.ts.map +1 -1
- package/dist/course/course.module.js +16 -0
- package/dist/course/course.module.js.map +1 -1
- package/dist/course/course.service.d.ts +8 -9
- package/dist/course/course.service.d.ts.map +1 -1
- package/dist/course/course.service.js +93 -50
- package/dist/course/course.service.js.map +1 -1
- package/dist/course/dto/cleanup-course-storage.dto.d.ts +1 -1
- package/dist/course/dto/cleanup-course-storage.dto.d.ts.map +1 -1
- package/dist/course/dto/cleanup-course-storage.dto.js +1 -0
- package/dist/course/dto/cleanup-course-storage.dto.js.map +1 -1
- package/dist/course/dto/cleanup-upload-history.dto.d.ts +1 -1
- package/dist/course/dto/cleanup-upload-history.dto.d.ts.map +1 -1
- package/dist/course/dto/cleanup-upload-history.dto.js +1 -1
- package/dist/course/dto/cleanup-upload-history.dto.js.map +1 -1
- package/dist/course/dto/create-course-bulk-job.dto.d.ts +2 -1
- package/dist/course/dto/create-course-bulk-job.dto.d.ts.map +1 -1
- package/dist/course/dto/create-course-bulk-job.dto.js +6 -1
- package/dist/course/dto/create-course-bulk-job.dto.js.map +1 -1
- package/dist/course/dto/create-course-export.dto.d.ts +14 -0
- package/dist/course/dto/create-course-export.dto.d.ts.map +1 -0
- package/dist/course/dto/create-course-export.dto.js +71 -0
- package/dist/course/dto/create-course-export.dto.js.map +1 -0
- package/dist/course/dto/create-course-structure-lesson.dto.d.ts +2 -2
- package/dist/course/dto/create-course-structure-lesson.dto.d.ts.map +1 -1
- package/dist/course/dto/create-course-structure-lesson.dto.js +3 -2
- package/dist/course/dto/create-course-structure-lesson.dto.js.map +1 -1
- package/dist/course/ffmpeg.util.d.ts +10 -0
- package/dist/course/ffmpeg.util.d.ts.map +1 -0
- package/dist/course/ffmpeg.util.js +79 -0
- package/dist/course/ffmpeg.util.js.map +1 -0
- package/dist/course/lms-bulk-upload-automation.service.d.ts +18 -1
- package/dist/course/lms-bulk-upload-automation.service.d.ts.map +1 -1
- package/dist/course/lms-bulk-upload-automation.service.js +106 -8
- package/dist/course/lms-bulk-upload-automation.service.js.map +1 -1
- package/dist/course/lms-bulk-upload-infra.service.d.ts +1 -0
- package/dist/course/lms-bulk-upload-infra.service.d.ts.map +1 -1
- package/dist/course/lms-bulk-upload-infra.service.js +32 -8
- package/dist/course/lms-bulk-upload-infra.service.js.map +1 -1
- package/dist/course/lms-bulk-upload.controller.d.ts +30 -3
- package/dist/course/lms-bulk-upload.controller.d.ts.map +1 -1
- package/dist/course/lms-bulk-upload.controller.js +43 -2
- package/dist/course/lms-bulk-upload.controller.js.map +1 -1
- package/dist/course/lms-bulk-upload.service.d.ts +11 -0
- package/dist/course/lms-bulk-upload.service.d.ts.map +1 -1
- package/dist/course/lms-bulk-upload.service.js +59 -6
- package/dist/course/lms-bulk-upload.service.js.map +1 -1
- package/dist/course/lms-setting.controller.d.ts +2 -1
- package/dist/course/lms-setting.controller.d.ts.map +1 -1
- package/dist/course/lms-setting.controller.js +4 -2
- package/dist/course/lms-setting.controller.js.map +1 -1
- package/dist/course/scorm12-schemas.d.ts +4 -0
- package/dist/course/scorm12-schemas.d.ts.map +1 -0
- package/dist/course/scorm12-schemas.js +9 -0
- package/dist/course/scorm12-schemas.js.map +1 -0
- package/dist/enterprise/training/training-admin.controller.d.ts +2 -0
- package/dist/enterprise/training/training-admin.controller.d.ts.map +1 -1
- package/dist/enterprise/training/training-admin.service.d.ts +2 -0
- package/dist/enterprise/training/training-admin.service.d.ts.map +1 -1
- package/dist/enterprise/training/training-student.service.d.ts +51 -0
- package/dist/enterprise/training/training-student.service.d.ts.map +1 -1
- package/dist/enterprise/training/training-student.service.js +217 -4
- package/dist/enterprise/training/training-student.service.js.map +1 -1
- package/dist/evaluation/evaluation.service.d.ts +18 -0
- package/dist/evaluation/evaluation.service.d.ts.map +1 -1
- package/dist/evaluation/evaluation.service.js +125 -0
- package/dist/evaluation/evaluation.service.js.map +1 -1
- package/dist/exam/dto/create-standalone-question.dto.d.ts +12 -0
- package/dist/exam/dto/create-standalone-question.dto.d.ts.map +1 -0
- package/dist/exam/dto/create-standalone-question.dto.js +70 -0
- package/dist/exam/dto/create-standalone-question.dto.js.map +1 -0
- package/dist/exam/exam.module.d.ts.map +1 -1
- package/dist/exam/exam.module.js +2 -1
- package/dist/exam/exam.module.js.map +1 -1
- package/dist/exam/exam.service.d.ts +21 -0
- package/dist/exam/exam.service.d.ts.map +1 -1
- package/dist/exam/exam.service.js +80 -0
- package/dist/exam/exam.service.js.map +1 -1
- package/dist/exam/question.controller.d.ts +27 -0
- package/dist/exam/question.controller.d.ts.map +1 -0
- package/dist/exam/question.controller.js +53 -0
- package/dist/exam/question.controller.js.map +1 -0
- package/dist/lesson-xp-map/lesson-xp-ai-calculation.service.d.ts +4 -0
- package/dist/lesson-xp-map/lesson-xp-ai-calculation.service.d.ts.map +1 -1
- package/dist/lesson-xp-map/lesson-xp-ai-calculation.service.js +161 -25
- package/dist/lesson-xp-map/lesson-xp-ai-calculation.service.js.map +1 -1
- package/dist/libraries/lms/tsconfig.tsbuildinfo +1 -1
- package/dist/lms-commerce-access.subscriber.d.ts +11 -0
- package/dist/lms-commerce-access.subscriber.d.ts.map +1 -0
- package/dist/lms-commerce-access.subscriber.js +74 -0
- package/dist/lms-commerce-access.subscriber.js.map +1 -0
- package/dist/lms.module.d.ts.map +1 -1
- package/dist/lms.module.js +16 -5
- package/dist/lms.module.js.map +1 -1
- package/dist/platforma/dto/heartbeat.dto.d.ts +9 -0
- package/dist/platforma/dto/heartbeat.dto.d.ts.map +1 -0
- package/dist/platforma/dto/heartbeat.dto.js +50 -0
- package/dist/platforma/dto/heartbeat.dto.js.map +1 -0
- package/dist/platforma/handlers/emit-certificate.handler.d.ts +27 -0
- package/dist/platforma/handlers/emit-certificate.handler.d.ts.map +1 -0
- package/dist/platforma/handlers/emit-certificate.handler.js +117 -0
- package/dist/platforma/handlers/emit-certificate.handler.js.map +1 -0
- package/dist/platforma/handlers/lesson-heartbeat.handler.d.ts +31 -0
- package/dist/platforma/handlers/lesson-heartbeat.handler.d.ts.map +1 -0
- package/dist/platforma/handlers/lesson-heartbeat.handler.js +281 -0
- package/dist/platforma/handlers/lesson-heartbeat.handler.js.map +1 -0
- package/dist/platforma/platforma-heartbeat.service.d.ts +10 -0
- package/dist/platforma/platforma-heartbeat.service.d.ts.map +1 -0
- package/dist/platforma/platforma-heartbeat.service.js +50 -0
- package/dist/platforma/platforma-heartbeat.service.js.map +1 -0
- package/dist/platforma/platforma-performance.service.d.ts +121 -0
- package/dist/platforma/platforma-performance.service.d.ts.map +1 -0
- package/dist/platforma/platforma-performance.service.js +500 -0
- package/dist/platforma/platforma-performance.service.js.map +1 -0
- package/dist/platforma/platforma-search.service.d.ts +21 -0
- package/dist/platforma/platforma-search.service.d.ts.map +1 -0
- package/dist/platforma/platforma-search.service.js +64 -0
- package/dist/platforma/platforma-search.service.js.map +1 -0
- package/dist/platforma/platforma-video.service.d.ts +39 -0
- package/dist/platforma/platforma-video.service.d.ts.map +1 -0
- package/dist/platforma/platforma-video.service.js +301 -0
- package/dist/platforma/platforma-video.service.js.map +1 -0
- package/dist/platforma/platforma.controller.d.ts +209 -1
- package/dist/platforma/platforma.controller.d.ts.map +1 -1
- package/dist/platforma/platforma.controller.js +208 -2
- package/dist/platforma/platforma.controller.js.map +1 -1
- package/dist/realtime/lms-realtime.controller.d.ts +2 -0
- package/dist/realtime/lms-realtime.controller.d.ts.map +1 -1
- package/dist/realtime/lms-realtime.controller.js +31 -0
- package/dist/realtime/lms-realtime.controller.js.map +1 -1
- package/dist/realtime/lms-realtime.service.d.ts +1 -1
- package/dist/realtime/lms-realtime.service.d.ts.map +1 -1
- package/dist/realtime/lms-realtime.service.js.map +1 -1
- package/dist/student-xp/dto/grant-skill-card-xp.dto.d.ts +5 -0
- package/dist/student-xp/dto/grant-skill-card-xp.dto.d.ts.map +1 -0
- package/dist/student-xp/dto/grant-skill-card-xp.dto.js +26 -0
- package/dist/student-xp/dto/grant-skill-card-xp.dto.js.map +1 -0
- package/dist/student-xp/student-xp.controller.d.ts +15 -0
- package/dist/student-xp/student-xp.controller.d.ts.map +1 -1
- package/dist/student-xp/student-xp.controller.js +24 -0
- package/dist/student-xp/student-xp.controller.js.map +1 -1
- package/dist/student-xp/student-xp.service.d.ts +16 -0
- package/dist/student-xp/student-xp.service.d.ts.map +1 -1
- package/dist/student-xp/student-xp.service.js +51 -1
- package/dist/student-xp/student-xp.service.js.map +1 -1
- package/hedhog/data/evaluation_topic.yaml +17 -0
- package/hedhog/data/menu.yaml +0 -17
- package/hedhog/data/queue_definition.yaml +48 -0
- package/hedhog/data/route.yaml +94 -124
- package/hedhog/data/setting_group.yaml +19 -19
- package/hedhog/frontend/app/bulk-upload-sessions/page.tsx.ejs +337 -41
- package/hedhog/frontend/app/certificates/models/page.tsx.ejs +182 -29
- package/hedhog/frontend/app/classes/_components/classes-calendar-view.tsx.ejs +277 -0
- package/hedhog/frontend/app/classes/page.tsx.ejs +127 -20
- package/hedhog/frontend/app/courses/[id]/page.tsx.ejs +69 -4
- package/hedhog/frontend/app/courses/[id]/structure/_components/course-export-sheet.tsx.ejs +420 -0
- package/hedhog/frontend/app/courses/[id]/structure/_components/course-exports-tab.tsx.ejs +308 -0
- package/hedhog/frontend/app/courses/[id]/structure/_components/course-overview-tab.tsx.ejs +158 -45
- package/hedhog/frontend/app/courses/[id]/structure/_components/course-xp-overview-tab.tsx.ejs +13 -13
- package/hedhog/frontend/app/courses/[id]/structure/_components/detail-lesson-xp-tab.tsx.ejs +11 -23
- package/hedhog/frontend/app/courses/[id]/structure/_components/detail-lesson.tsx.ejs +51 -63
- package/hedhog/frontend/app/courses/[id]/structure/_components/detail-panel.tsx.ejs +8 -3
- package/hedhog/frontend/app/courses/[id]/structure/_components/detail-session.tsx.ejs +31 -8
- package/hedhog/frontend/app/courses/[id]/structure/_components/drag-overlay.tsx.ejs +16 -9
- package/hedhog/frontend/app/courses/[id]/structure/_components/editor-course.tsx.ejs +201 -401
- package/hedhog/frontend/app/courses/[id]/structure/_components/editor-lesson.tsx.ejs +378 -690
- package/hedhog/frontend/app/courses/[id]/structure/_components/mock-data.ts.ejs +1 -2
- package/hedhog/frontend/app/courses/[id]/structure/_components/tree-row-lesson.tsx.ejs +3 -9
- package/hedhog/frontend/app/courses/[id]/structure/_components/types.ts.ejs +1 -1
- package/hedhog/frontend/app/courses/[id]/structure/_components/xp-premium-pills.tsx.ejs +1 -8
- package/hedhog/frontend/app/courses/[id]/structure/_data/adapters/course-structure.adapter.ts.ejs +6 -10
- package/hedhog/frontend/app/courses/[id]/structure/_data/services/course-structure.service.ts.ejs +49 -0
- package/hedhog/frontend/app/courses/[id]/structure/_data/types/api-course.types.ts.ejs +4 -3
- package/hedhog/frontend/app/courses/[id]/structure/_data/use-course-content-overview.ts.ejs +2 -1
- package/hedhog/frontend/app/courses/[id]/structure/_data/use-course-exports.ts.ejs +106 -0
- package/hedhog/frontend/app/courses/[id]/structure/_data/use-course-structure-mutations.ts.ejs +28 -1
- package/hedhog/frontend/app/courses/[id]/structure/_data/use-lms-settings-query.ts.ejs +0 -2
- package/hedhog/frontend/app/courses/page.tsx.ejs +85 -9
- package/hedhog/frontend/app/enterprise/[id]/page.tsx.ejs +6 -0
- package/hedhog/frontend/app/enterprise/_components/enterprise-classes-calendar-tab.tsx.ejs +264 -0
- package/hedhog/frontend/app/enterprise/page.tsx.ejs +104 -47
- package/hedhog/frontend/app/exams/page.tsx.ejs +38 -4
- package/hedhog/frontend/app/instructors/page.tsx.ejs +87 -46
- package/hedhog/frontend/app/paths/page.tsx.ejs +38 -4
- package/hedhog/frontend/app/training/page.tsx.ejs +38 -4
- package/hedhog/frontend/messages/en.json +44 -28
- package/hedhog/frontend/messages/pt.json +47 -29
- package/hedhog/table/course_enrollment.yaml +3 -0
- package/hedhog/table/course_export.yaml +62 -0
- package/hedhog/table/lesson_view_event.yaml +66 -0
- package/package.json +14 -9
- package/src/bitcode-wallet/bitcode-wallet.service.ts +43 -4
- package/src/course/course-export-scorm12-worker.service.ts +124 -0
- package/src/course/course-export-scorm12.service.ts +668 -0
- package/src/course/course-export.service.ts +280 -0
- package/src/course/course-structure.controller.ts +16 -2
- package/src/course/course-structure.service.ts +100 -7
- package/src/course/course-video-agent-pipeline.service.ts +471 -0
- package/src/course/course-video-hls.service.ts +966 -0
- package/src/course/course.controller.ts +33 -19
- package/src/course/course.mcp-tools.ts +1 -1
- package/src/course/course.module.ts +16 -0
- package/src/course/course.service.ts +119 -61
- package/src/course/dto/cleanup-course-storage.dto.ts +1 -0
- package/src/course/dto/cleanup-upload-history.dto.ts +1 -1
- package/src/course/dto/create-course-bulk-job.dto.ts +7 -3
- package/src/course/dto/create-course-export.dto.ts +56 -0
- package/src/course/dto/create-course-structure-lesson.dto.ts +4 -3
- package/src/course/ffmpeg.util.ts +65 -0
- package/src/course/lms-bulk-upload-automation.service.ts +156 -6
- package/src/course/lms-bulk-upload-infra.service.ts +39 -6
- package/src/course/lms-bulk-upload.controller.ts +32 -2
- package/src/course/lms-bulk-upload.service.ts +70 -7
- package/src/course/lms-setting.controller.ts +4 -2
- package/src/course/scorm12-schemas.ts +9 -0
- package/src/enterprise/training/training-student.service.ts +221 -2
- package/src/evaluation/evaluation.service.ts +123 -0
- package/src/exam/dto/create-standalone-question.dto.ts +66 -0
- package/src/exam/exam.module.ts +2 -1
- package/src/exam/exam.service.ts +86 -0
- package/src/exam/question.controller.ts +28 -0
- package/src/lesson-xp-map/lesson-xp-ai-calculation.service.ts +205 -31
- package/src/lms-commerce-access.subscriber.ts +88 -0
- package/src/lms.module.ts +16 -5
- package/src/platforma/dto/heartbeat.dto.ts +30 -0
- package/src/platforma/handlers/emit-certificate.handler.ts +117 -0
- package/src/platforma/handlers/lesson-heartbeat.handler.ts +343 -0
- package/src/platforma/platforma-heartbeat.service.ts +33 -0
- package/src/platforma/platforma-performance.service.ts +606 -0
- package/src/platforma/platforma-search.service.ts +48 -0
- package/src/platforma/platforma-video.service.ts +346 -0
- package/src/platforma/platforma.controller.ts +137 -1
- package/src/platforma/platforma.service.ts +268 -268
- package/src/realtime/lms-realtime.controller.ts +27 -1
- package/src/realtime/lms-realtime.service.ts +2 -1
- package/src/student-xp/dto/grant-skill-card-xp.dto.ts +10 -0
- package/src/student-xp/student-xp.controller.ts +18 -2
- package/src/student-xp/student-xp.service.ts +84 -2
- package/hedhog/data/video_resolution_profile.yaml +0 -7
- package/hedhog/frontend/app/video-resolution-profiles/page.tsx.ejs +0 -607
- package/hedhog/table/course_video_resolution_profile.yaml +0 -22
- package/hedhog/table/video_resolution_profile.yaml +0 -18
- package/src/video-resolution-profile/dto/create-video-resolution-profile.dto.ts +0 -16
- package/src/video-resolution-profile/dto/update-video-resolution-profile.dto.ts +0 -16
- package/src/video-resolution-profile/video-resolution-profile.controller.ts +0 -62
- package/src/video-resolution-profile/video-resolution-profile.mcp-tools.ts +0 -128
- package/src/video-resolution-profile/video-resolution-profile.module.ts +0 -13
- package/src/video-resolution-profile/video-resolution-profile.service.ts +0 -117
|
@@ -18,15 +18,26 @@ const core_1 = require("@hed-hog/core");
|
|
|
18
18
|
const common_1 = require("@nestjs/common");
|
|
19
19
|
const bitcode_wallet_service_1 = require("../bitcode-wallet/bitcode-wallet.service");
|
|
20
20
|
const create_current_bitcode_wallet_transaction_dto_1 = require("../bitcode-wallet/dto/create-current-bitcode-wallet-transaction.dto");
|
|
21
|
+
const evaluation_service_1 = require("../evaluation/evaluation.service");
|
|
21
22
|
const training_student_service_1 = require("../enterprise/training/training-student.service");
|
|
23
|
+
const heartbeat_dto_1 = require("./dto/heartbeat.dto");
|
|
22
24
|
const update_profile_dto_1 = require("./dto/update-profile.dto");
|
|
25
|
+
const platforma_heartbeat_service_1 = require("./platforma-heartbeat.service");
|
|
26
|
+
const platforma_performance_service_1 = require("./platforma-performance.service");
|
|
23
27
|
const platforma_service_1 = require("./platforma.service");
|
|
28
|
+
const platforma_search_service_1 = require("./platforma-search.service");
|
|
29
|
+
const platforma_video_service_1 = require("./platforma-video.service");
|
|
24
30
|
let PlataformaController = class PlataformaController {
|
|
25
|
-
constructor(trainingStudentService, notificationService, platforma, bitcodeWalletService) {
|
|
31
|
+
constructor(trainingStudentService, notificationService, platforma, bitcodeWalletService, platformaVideoService, evaluationService, heartbeatService, performanceService, searchService) {
|
|
26
32
|
this.trainingStudentService = trainingStudentService;
|
|
27
33
|
this.notificationService = notificationService;
|
|
28
34
|
this.platforma = platforma;
|
|
29
35
|
this.bitcodeWalletService = bitcodeWalletService;
|
|
36
|
+
this.platformaVideoService = platformaVideoService;
|
|
37
|
+
this.evaluationService = evaluationService;
|
|
38
|
+
this.heartbeatService = heartbeatService;
|
|
39
|
+
this.performanceService = performanceService;
|
|
40
|
+
this.searchService = searchService;
|
|
30
41
|
}
|
|
31
42
|
getHome(userId) {
|
|
32
43
|
return this.trainingStudentService.getDashboard(userId);
|
|
@@ -43,6 +54,49 @@ let PlataformaController = class PlataformaController {
|
|
|
43
54
|
sort,
|
|
44
55
|
});
|
|
45
56
|
}
|
|
57
|
+
getCourseBySlug(slug, userId) {
|
|
58
|
+
return this.trainingStudentService.getPublishedCourseBySlug(slug, userId);
|
|
59
|
+
}
|
|
60
|
+
search(q = '', types, pageSize) {
|
|
61
|
+
return this.searchService.search(q, types ? types.split(',').filter(Boolean) : [], pageSize ? Math.max(1, Number(pageSize)) : 5);
|
|
62
|
+
}
|
|
63
|
+
getLessonDetail(lessonId) {
|
|
64
|
+
return this.trainingStudentService.getLessonDetail(lessonId);
|
|
65
|
+
}
|
|
66
|
+
getVideoToken(lessonId, quality) {
|
|
67
|
+
return this.platformaVideoService.generateVideoToken(lessonId, quality);
|
|
68
|
+
}
|
|
69
|
+
getHlsToken(lessonId) {
|
|
70
|
+
return this.platformaVideoService.generateHlsToken(lessonId);
|
|
71
|
+
}
|
|
72
|
+
streamVideo(token, req, res) {
|
|
73
|
+
return this.platformaVideoService.streamVideo(token, req, res);
|
|
74
|
+
}
|
|
75
|
+
serveHlsMaster(token, req, res) {
|
|
76
|
+
return this.platformaVideoService.serveHlsMasterManifest(token, req, res);
|
|
77
|
+
}
|
|
78
|
+
serveHlsVariant(token, variant, req, res) {
|
|
79
|
+
return this.platformaVideoService.serveHlsVariantPlaylist(token, variant, req, res);
|
|
80
|
+
}
|
|
81
|
+
serveHlsSegment(token, variant, segment, res) {
|
|
82
|
+
return this.platformaVideoService.serveHlsSegment(token, variant, segment, res);
|
|
83
|
+
}
|
|
84
|
+
getSubtitlesToken(lessonId) {
|
|
85
|
+
return this.platformaVideoService.generateSubtitlesToken(lessonId);
|
|
86
|
+
}
|
|
87
|
+
getCourseLessonEvaluationTopics(lessonId) {
|
|
88
|
+
return this.evaluationService.getCourseLessonTopics(lessonId);
|
|
89
|
+
}
|
|
90
|
+
getMyLessonEvaluation(lessonId, userId) {
|
|
91
|
+
return this.evaluationService.getMyLessonRatings(lessonId, userId);
|
|
92
|
+
}
|
|
93
|
+
submitLessonEvaluation(lessonId, userId, body) {
|
|
94
|
+
var _a;
|
|
95
|
+
return this.evaluationService.submitLessonRatings(lessonId, userId, (_a = body.ratings) !== null && _a !== void 0 ? _a : []);
|
|
96
|
+
}
|
|
97
|
+
serveSubtitles(token, res) {
|
|
98
|
+
return this.platformaVideoService.serveSubtitles(token, res);
|
|
99
|
+
}
|
|
46
100
|
listNotifications(userId, page, pageSize, search, sortField, sortOrder) {
|
|
47
101
|
return this.notificationService.list(userId, {
|
|
48
102
|
page: page ? Number(page) : 1,
|
|
@@ -82,6 +136,15 @@ let PlataformaController = class PlataformaController {
|
|
|
82
136
|
createBitcodeTransaction(userId, dto) {
|
|
83
137
|
return this.bitcodeWalletService.createCurrentUserTransaction(userId, dto);
|
|
84
138
|
}
|
|
139
|
+
getPerformanceSummary(userId, period) {
|
|
140
|
+
return this.performanceService.getSummary(userId, period !== null && period !== void 0 ? period : '30d');
|
|
141
|
+
}
|
|
142
|
+
heartbeat(userId, dto, req) {
|
|
143
|
+
var _a, _b, _c, _d, _e, _f;
|
|
144
|
+
const ip = (_e = (_c = (_b = (_a = req.headers['x-forwarded-for']) === null || _a === void 0 ? void 0 : _a.split(',')[0]) === null || _b === void 0 ? void 0 : _b.trim()) !== null && _c !== void 0 ? _c : (_d = req.socket) === null || _d === void 0 ? void 0 : _d.remoteAddress) !== null && _e !== void 0 ? _e : '';
|
|
145
|
+
const userAgent = (_f = req.headers['user-agent']) !== null && _f !== void 0 ? _f : '';
|
|
146
|
+
return this.heartbeatService.enqueue(userId, ip, userAgent, dto);
|
|
147
|
+
}
|
|
85
148
|
getProfile(userId) {
|
|
86
149
|
return this.platforma.getProfile(userId);
|
|
87
150
|
}
|
|
@@ -115,6 +178,127 @@ __decorate([
|
|
|
115
178
|
__metadata("design:paramtypes", [String, String, String, String, String]),
|
|
116
179
|
__metadata("design:returntype", void 0)
|
|
117
180
|
], PlataformaController.prototype, "getCourses", null);
|
|
181
|
+
__decorate([
|
|
182
|
+
(0, common_1.Get)('courses/:slug'),
|
|
183
|
+
__param(0, (0, common_1.Param)('slug')),
|
|
184
|
+
__param(1, (0, api_1.User)('id')),
|
|
185
|
+
__metadata("design:type", Function),
|
|
186
|
+
__metadata("design:paramtypes", [String, Number]),
|
|
187
|
+
__metadata("design:returntype", void 0)
|
|
188
|
+
], PlataformaController.prototype, "getCourseBySlug", null);
|
|
189
|
+
__decorate([
|
|
190
|
+
(0, common_1.Get)('search'),
|
|
191
|
+
__param(0, (0, common_1.Query)('q')),
|
|
192
|
+
__param(1, (0, common_1.Query)('types')),
|
|
193
|
+
__param(2, (0, common_1.Query)('pageSize')),
|
|
194
|
+
__metadata("design:type", Function),
|
|
195
|
+
__metadata("design:paramtypes", [Object, String, String]),
|
|
196
|
+
__metadata("design:returntype", void 0)
|
|
197
|
+
], PlataformaController.prototype, "search", null);
|
|
198
|
+
__decorate([
|
|
199
|
+
(0, common_1.Get)('lessons/:lessonId'),
|
|
200
|
+
__param(0, (0, common_1.Param)('lessonId', common_1.ParseIntPipe)),
|
|
201
|
+
__metadata("design:type", Function),
|
|
202
|
+
__metadata("design:paramtypes", [Number]),
|
|
203
|
+
__metadata("design:returntype", void 0)
|
|
204
|
+
], PlataformaController.prototype, "getLessonDetail", null);
|
|
205
|
+
__decorate([
|
|
206
|
+
(0, common_1.Get)('lessons/:lessonId/video-token'),
|
|
207
|
+
__param(0, (0, common_1.Param)('lessonId', common_1.ParseIntPipe)),
|
|
208
|
+
__param(1, (0, common_1.Query)('quality')),
|
|
209
|
+
__metadata("design:type", Function),
|
|
210
|
+
__metadata("design:paramtypes", [Number, String]),
|
|
211
|
+
__metadata("design:returntype", void 0)
|
|
212
|
+
], PlataformaController.prototype, "getVideoToken", null);
|
|
213
|
+
__decorate([
|
|
214
|
+
(0, common_1.Get)('lessons/:lessonId/hls-token'),
|
|
215
|
+
__param(0, (0, common_1.Param)('lessonId', common_1.ParseIntPipe)),
|
|
216
|
+
__metadata("design:type", Function),
|
|
217
|
+
__metadata("design:paramtypes", [Number]),
|
|
218
|
+
__metadata("design:returntype", void 0)
|
|
219
|
+
], PlataformaController.prototype, "getHlsToken", null);
|
|
220
|
+
__decorate([
|
|
221
|
+
(0, api_1.Public)(),
|
|
222
|
+
(0, common_1.Get)('video/:token'),
|
|
223
|
+
__param(0, (0, common_1.Param)('token')),
|
|
224
|
+
__param(1, (0, common_1.Req)()),
|
|
225
|
+
__param(2, (0, common_1.Res)()),
|
|
226
|
+
__metadata("design:type", Function),
|
|
227
|
+
__metadata("design:paramtypes", [String, Object, Object]),
|
|
228
|
+
__metadata("design:returntype", void 0)
|
|
229
|
+
], PlataformaController.prototype, "streamVideo", null);
|
|
230
|
+
__decorate([
|
|
231
|
+
(0, api_1.Public)(),
|
|
232
|
+
(0, common_1.Get)('hls/:token/master.m3u8'),
|
|
233
|
+
__param(0, (0, common_1.Param)('token')),
|
|
234
|
+
__param(1, (0, common_1.Req)()),
|
|
235
|
+
__param(2, (0, common_1.Res)()),
|
|
236
|
+
__metadata("design:type", Function),
|
|
237
|
+
__metadata("design:paramtypes", [String, Object, Object]),
|
|
238
|
+
__metadata("design:returntype", void 0)
|
|
239
|
+
], PlataformaController.prototype, "serveHlsMaster", null);
|
|
240
|
+
__decorate([
|
|
241
|
+
(0, api_1.Public)(),
|
|
242
|
+
(0, common_1.Get)('hls/:token/:variant/playlist.m3u8'),
|
|
243
|
+
__param(0, (0, common_1.Param)('token')),
|
|
244
|
+
__param(1, (0, common_1.Param)('variant')),
|
|
245
|
+
__param(2, (0, common_1.Req)()),
|
|
246
|
+
__param(3, (0, common_1.Res)()),
|
|
247
|
+
__metadata("design:type", Function),
|
|
248
|
+
__metadata("design:paramtypes", [String, String, Object, Object]),
|
|
249
|
+
__metadata("design:returntype", void 0)
|
|
250
|
+
], PlataformaController.prototype, "serveHlsVariant", null);
|
|
251
|
+
__decorate([
|
|
252
|
+
(0, api_1.Public)(),
|
|
253
|
+
(0, common_1.Get)('hls/:token/:variant/:segment'),
|
|
254
|
+
__param(0, (0, common_1.Param)('token')),
|
|
255
|
+
__param(1, (0, common_1.Param)('variant')),
|
|
256
|
+
__param(2, (0, common_1.Param)('segment')),
|
|
257
|
+
__param(3, (0, common_1.Res)()),
|
|
258
|
+
__metadata("design:type", Function),
|
|
259
|
+
__metadata("design:paramtypes", [String, String, String, Object]),
|
|
260
|
+
__metadata("design:returntype", void 0)
|
|
261
|
+
], PlataformaController.prototype, "serveHlsSegment", null);
|
|
262
|
+
__decorate([
|
|
263
|
+
(0, common_1.Get)('lessons/:lessonId/subtitles-token'),
|
|
264
|
+
__param(0, (0, common_1.Param)('lessonId', common_1.ParseIntPipe)),
|
|
265
|
+
__metadata("design:type", Function),
|
|
266
|
+
__metadata("design:paramtypes", [Number]),
|
|
267
|
+
__metadata("design:returntype", void 0)
|
|
268
|
+
], PlataformaController.prototype, "getSubtitlesToken", null);
|
|
269
|
+
__decorate([
|
|
270
|
+
(0, common_1.Get)('lessons/:lessonId/evaluation-topics'),
|
|
271
|
+
__param(0, (0, common_1.Param)('lessonId', common_1.ParseIntPipe)),
|
|
272
|
+
__metadata("design:type", Function),
|
|
273
|
+
__metadata("design:paramtypes", [Number]),
|
|
274
|
+
__metadata("design:returntype", void 0)
|
|
275
|
+
], PlataformaController.prototype, "getCourseLessonEvaluationTopics", null);
|
|
276
|
+
__decorate([
|
|
277
|
+
(0, common_1.Get)('lessons/:lessonId/my-evaluation'),
|
|
278
|
+
__param(0, (0, common_1.Param)('lessonId', common_1.ParseIntPipe)),
|
|
279
|
+
__param(1, (0, api_1.User)('id')),
|
|
280
|
+
__metadata("design:type", Function),
|
|
281
|
+
__metadata("design:paramtypes", [Number, Number]),
|
|
282
|
+
__metadata("design:returntype", void 0)
|
|
283
|
+
], PlataformaController.prototype, "getMyLessonEvaluation", null);
|
|
284
|
+
__decorate([
|
|
285
|
+
(0, common_1.Post)('lessons/:lessonId/evaluate'),
|
|
286
|
+
__param(0, (0, common_1.Param)('lessonId', common_1.ParseIntPipe)),
|
|
287
|
+
__param(1, (0, api_1.User)('id')),
|
|
288
|
+
__param(2, (0, common_1.Body)()),
|
|
289
|
+
__metadata("design:type", Function),
|
|
290
|
+
__metadata("design:paramtypes", [Number, Number, Object]),
|
|
291
|
+
__metadata("design:returntype", void 0)
|
|
292
|
+
], PlataformaController.prototype, "submitLessonEvaluation", null);
|
|
293
|
+
__decorate([
|
|
294
|
+
(0, api_1.Public)(),
|
|
295
|
+
(0, common_1.Get)('subtitles/:token/captions.vtt'),
|
|
296
|
+
__param(0, (0, common_1.Param)('token')),
|
|
297
|
+
__param(1, (0, common_1.Res)()),
|
|
298
|
+
__metadata("design:type", Function),
|
|
299
|
+
__metadata("design:paramtypes", [String, Object]),
|
|
300
|
+
__metadata("design:returntype", void 0)
|
|
301
|
+
], PlataformaController.prototype, "serveSubtitles", null);
|
|
118
302
|
__decorate([
|
|
119
303
|
(0, common_1.Get)('notifications'),
|
|
120
304
|
__param(0, (0, api_1.User)('id')),
|
|
@@ -204,6 +388,23 @@ __decorate([
|
|
|
204
388
|
__metadata("design:paramtypes", [Number, create_current_bitcode_wallet_transaction_dto_1.CreateCurrentBitcodeWalletTransactionDto]),
|
|
205
389
|
__metadata("design:returntype", void 0)
|
|
206
390
|
], PlataformaController.prototype, "createBitcodeTransaction", null);
|
|
391
|
+
__decorate([
|
|
392
|
+
(0, common_1.Get)('performance/summary'),
|
|
393
|
+
__param(0, (0, api_1.User)('id')),
|
|
394
|
+
__param(1, (0, common_1.Query)('period')),
|
|
395
|
+
__metadata("design:type", Function),
|
|
396
|
+
__metadata("design:paramtypes", [Number, String]),
|
|
397
|
+
__metadata("design:returntype", void 0)
|
|
398
|
+
], PlataformaController.prototype, "getPerformanceSummary", null);
|
|
399
|
+
__decorate([
|
|
400
|
+
(0, common_1.Post)('heartbeat'),
|
|
401
|
+
__param(0, (0, api_1.User)('id')),
|
|
402
|
+
__param(1, (0, common_1.Body)()),
|
|
403
|
+
__param(2, (0, common_1.Req)()),
|
|
404
|
+
__metadata("design:type", Function),
|
|
405
|
+
__metadata("design:paramtypes", [Number, heartbeat_dto_1.HeartbeatDto, Object]),
|
|
406
|
+
__metadata("design:returntype", void 0)
|
|
407
|
+
], PlataformaController.prototype, "heartbeat", null);
|
|
207
408
|
__decorate([
|
|
208
409
|
(0, common_1.Get)('profile'),
|
|
209
410
|
__param(0, (0, api_1.User)('id')),
|
|
@@ -225,6 +426,11 @@ exports.PlataformaController = PlataformaController = __decorate([
|
|
|
225
426
|
__metadata("design:paramtypes", [training_student_service_1.TrainingStudentService,
|
|
226
427
|
core_1.NotificationService,
|
|
227
428
|
platforma_service_1.PlatformaService,
|
|
228
|
-
bitcode_wallet_service_1.BitcodeWalletService
|
|
429
|
+
bitcode_wallet_service_1.BitcodeWalletService,
|
|
430
|
+
platforma_video_service_1.PlatformaVideoService,
|
|
431
|
+
evaluation_service_1.EvaluationService,
|
|
432
|
+
platforma_heartbeat_service_1.PlatformaHeartbeatService,
|
|
433
|
+
platforma_performance_service_1.PlatformaPerformanceService,
|
|
434
|
+
platforma_search_service_1.PlatformaSearchService])
|
|
229
435
|
], PlataformaController);
|
|
230
436
|
//# sourceMappingURL=platforma.controller.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platforma.controller.js","sourceRoot":"","sources":["../../src/platforma/platforma.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"platforma.controller.js","sourceRoot":"","sources":["../../src/platforma/platforma.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sCAAoD;AACpD,wCAAoD;AACpD,2CAAuH;AAEvH,qFAAgF;AAChF,uIAA+H;AAC/H,yEAAqE;AACrE,8FAAyF;AACzF,uDAAmD;AACnD,iEAAqE;AACrE,+EAA0E;AAC1E,mFAA8E;AAC9E,2DAAuD;AACvD,yEAAoE;AACpE,uEAAkE;AAI3D,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAC/B,YACmB,sBAA8C,EAC9C,mBAAwC,EACxC,SAA2B,EAC3B,oBAA0C,EAC1C,qBAA4C,EAC5C,iBAAoC,EACpC,gBAA2C,EAC3C,kBAA+C,EAC/C,aAAqC;QARrC,2BAAsB,GAAtB,sBAAsB,CAAwB;QAC9C,wBAAmB,GAAnB,mBAAmB,CAAqB;QACxC,cAAS,GAAT,SAAS,CAAkB;QAC3B,yBAAoB,GAApB,oBAAoB,CAAsB;QAC1C,0BAAqB,GAArB,qBAAqB,CAAuB;QAC5C,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,qBAAgB,GAAhB,gBAAgB,CAA2B;QAC3C,uBAAkB,GAAlB,kBAAkB,CAA6B;QAC/C,kBAAa,GAAb,aAAa,CAAwB;IACrD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,EAAC,uBAAuB,CAAC;IAE3B,WAAA,IAAA,UAAI,EAAC,IAAI,CAAC,CAAA;IACV,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAAM,wFAAwC;;oEAGtD;AAGD;IADC,IAAA,YAAG,EAAC,qBAAqB,CAAC;IAExB,WAAA,IAAA,UAAI,EAAC,IAAI,CAAC,CAAA;IACV,WAAA,IAAA,cAAK,EAAC,QAAQ,CAAC,CAAA;;;;iEAGjB;AAGD;IADC,IAAA,aAAI,EAAC,WAAW,CAAC;IAEf,WAAA,IAAA,UAAI,EAAC,IAAI,CAAC,CAAA;IACV,WAAA,IAAA,aAAI,GAAE,CAAA;IACN,WAAA,IAAA,YAAG,GAAE,CAAA;;6CADO,4BAAY;;qDAS1B;AAGD;IADC,IAAA,YAAG,EAAC,SAAS,CAAC;IACH,WAAA,IAAA,UAAI,EAAC,IAAI,CAAC,CAAA;;;;sDAErB;AAGD;IADC,IAAA,YAAG,EAAC,SAAS,CAAC;IAEZ,WAAA,IAAA,UAAI,EAAC,IAAI,CAAC,CAAA;IACV,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAAM,8CAAyB;;yDAGvC;+BAvQU,oBAAoB;IAFhC,IAAA,YAAM,GAAE;IACR,IAAA,mBAAU,EAAC,eAAe,CAAC;qCAGiB,iDAAsB;QACzB,0BAAmB;QAC7B,oCAAgB;QACL,6CAAoB;QACnB,+CAAqB;QACzB,sCAAiB;QAClB,uDAAyB;QACvB,2DAA2B;QAChC,iDAAsB;GAV7C,oBAAoB,CAwQhC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import type { Request, Response } from 'express';
|
|
1
2
|
import { LmsRealtimeCursor, LmsRealtimeService } from './lms-realtime.service';
|
|
2
3
|
export declare class LmsRealtimeController {
|
|
3
4
|
private readonly lmsRealtime;
|
|
4
5
|
constructor(lmsRealtime: LmsRealtimeService);
|
|
5
6
|
getCursor(): LmsRealtimeCursor;
|
|
7
|
+
streamActivity(req: Request, res: Response): void;
|
|
6
8
|
}
|
|
7
9
|
//# sourceMappingURL=lms-realtime.controller.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lms-realtime.controller.d.ts","sourceRoot":"","sources":["../../src/realtime/lms-realtime.controller.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE/E,qBACa,qBAAqB;IACpB,OAAO,CAAC,QAAQ,CAAC,WAAW;gBAAX,WAAW,EAAE,kBAAkB;IAG5D,SAAS,IAAI,iBAAiB;
|
|
1
|
+
{"version":3,"file":"lms-realtime.controller.d.ts","sourceRoot":"","sources":["../../src/realtime/lms-realtime.controller.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE/E,qBACa,qBAAqB;IACpB,OAAO,CAAC,QAAQ,CAAC,WAAW;gBAAX,WAAW,EAAE,kBAAkB;IAG5D,SAAS,IAAI,iBAAiB;IAK9B,cAAc,CAAQ,GAAG,EAAE,OAAO,EAAS,GAAG,EAAE,QAAQ;CAuBzD"}
|
|
@@ -8,6 +8,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
15
|
exports.LmsRealtimeController = void 0;
|
|
13
16
|
const common_1 = require("@nestjs/common");
|
|
@@ -19,6 +22,26 @@ let LmsRealtimeController = class LmsRealtimeController {
|
|
|
19
22
|
getCursor() {
|
|
20
23
|
return this.lmsRealtime.getCursor();
|
|
21
24
|
}
|
|
25
|
+
streamActivity(req, res) {
|
|
26
|
+
res.set({
|
|
27
|
+
'Content-Type': 'text/event-stream',
|
|
28
|
+
'Cache-Control': 'no-cache',
|
|
29
|
+
Connection: 'keep-alive',
|
|
30
|
+
'X-Accel-Buffering': 'no',
|
|
31
|
+
});
|
|
32
|
+
res.flushHeaders();
|
|
33
|
+
const unsub = this.lmsRealtime.subscribe((event) => {
|
|
34
|
+
if (event.domain === 'lesson_view') {
|
|
35
|
+
res.write(`data: ${JSON.stringify(event)}\n\n`);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
// Send a heartbeat every 25s to keep the connection alive through proxies
|
|
39
|
+
const heartbeat = setInterval(() => res.write(': ping\n\n'), 25000);
|
|
40
|
+
req.on('close', () => {
|
|
41
|
+
clearInterval(heartbeat);
|
|
42
|
+
unsub();
|
|
43
|
+
});
|
|
44
|
+
}
|
|
22
45
|
};
|
|
23
46
|
exports.LmsRealtimeController = LmsRealtimeController;
|
|
24
47
|
__decorate([
|
|
@@ -27,6 +50,14 @@ __decorate([
|
|
|
27
50
|
__metadata("design:paramtypes", []),
|
|
28
51
|
__metadata("design:returntype", Object)
|
|
29
52
|
], LmsRealtimeController.prototype, "getCursor", null);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, common_1.Get)('activity/stream'),
|
|
55
|
+
__param(0, (0, common_1.Req)()),
|
|
56
|
+
__param(1, (0, common_1.Res)()),
|
|
57
|
+
__metadata("design:type", Function),
|
|
58
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
59
|
+
__metadata("design:returntype", void 0)
|
|
60
|
+
], LmsRealtimeController.prototype, "streamActivity", null);
|
|
30
61
|
exports.LmsRealtimeController = LmsRealtimeController = __decorate([
|
|
31
62
|
(0, common_1.Controller)('lms/realtime'),
|
|
32
63
|
__metadata("design:paramtypes", [lms_realtime_service_1.LmsRealtimeService])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lms-realtime.controller.js","sourceRoot":"","sources":["../../src/realtime/lms-realtime.controller.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lms-realtime.controller.js","sourceRoot":"","sources":["../../src/realtime/lms-realtime.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA2D;AAE3D,iEAA+E;AAGxE,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAChC,YAA6B,WAA+B;QAA/B,gBAAW,GAAX,WAAW,CAAoB;IAAG,CAAC;IAGhE,SAAS;QACP,OAAO,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,CAAC;IACtC,CAAC;IAGD,cAAc,CAAQ,GAAY,EAAS,GAAa;QACtD,GAAG,CAAC,GAAG,CAAC;YACN,cAAc,EAAE,mBAAmB;YACnC,eAAe,EAAE,UAAU;YAC3B,UAAU,EAAE,YAAY;YACxB,mBAAmB,EAAE,IAAI;SAC1B,CAAC,CAAC;QACH,GAAG,CAAC,YAAY,EAAE,CAAC;QAEnB,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE;YACjD,IAAI,KAAK,CAAC,MAAM,KAAK,aAAa,EAAE,CAAC;gBACnC,GAAG,CAAC,KAAK,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YAClD,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,0EAA0E;QAC1E,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,KAAM,CAAC,CAAC;QAErE,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;YACnB,aAAa,CAAC,SAAS,CAAC,CAAC;YACzB,KAAK,EAAE,CAAC;QACV,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAhCY,sDAAqB;AAIhC;IADC,IAAA,YAAG,EAAC,QAAQ,CAAC;;;;sDAGb;AAGD;IADC,IAAA,YAAG,EAAC,iBAAiB,CAAC;IACP,WAAA,IAAA,YAAG,GAAE,CAAA;IAAgB,WAAA,IAAA,YAAG,GAAE,CAAA;;;;2DAsBzC;gCA/BU,qBAAqB;IADjC,IAAA,mBAAU,EAAC,cAAc,CAAC;qCAEiB,yCAAkB;GADjD,qBAAqB,CAgCjC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type LmsRealtimeDomain = 'course' | 'training' | 'class_group' | 'certificate_template' | 'exam_attempt' | 'enterprise' | 'instructor' | 'achievement';
|
|
1
|
+
export type LmsRealtimeDomain = 'course' | 'training' | 'class_group' | 'certificate_template' | 'exam_attempt' | 'enterprise' | 'instructor' | 'achievement' | 'lesson_view';
|
|
2
2
|
export type LmsRealtimeEventType = 'created' | 'updated' | 'deleted' | 'student_enrolled' | 'student_removed' | 'submitted';
|
|
3
3
|
export type LmsRealtimeEvent = {
|
|
4
4
|
version: 'lms-realtime-v1';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lms-realtime.service.d.ts","sourceRoot":"","sources":["../../src/realtime/lms-realtime.service.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,iBAAiB,GACzB,QAAQ,GACR,UAAU,GACV,aAAa,GACb,sBAAsB,GACtB,cAAc,GACd,YAAY,GACZ,YAAY,GACZ,aAAa,CAAC;AAElB,MAAM,MAAM,oBAAoB,GAC5B,SAAS,GACT,SAAS,GACT,SAAS,GACT,kBAAkB,GAClB,iBAAiB,GACjB,WAAW,CAAC;AAEhB,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,iBAAiB,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,IAAI,EAAE,oBAAoB,CAAC;IAC3B,Q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A6B1D,SAAS,IAAI,iBAAiB;IAI9B,SAAS,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,GAAG,MAAM,IAAI;CAKlE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lms-realtime.service.js","sourceRoot":"","sources":["../../src/realtime/lms-realtime.service.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAA4C;
|
|
1
|
+
{"version":3,"file":"lms-realtime.service.js","sourceRoot":"","sources":["../../src/realtime/lms-realtime.service.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAA4C;AAmDrC,IAAM,kBAAkB,0BAAxB,MAAM,kBAAkB;IAAxB;QAGG,aAAQ,GAAG,CAAC,CAAC;QACb,cAAS,GAAkB,IAAI,CAAC;QACvB,aAAQ,GAAuB,EAAE,CAAC;QAClC,cAAS,GAAG,IAAI,GAAG,EAA+B,CAAC;QAC5D,qBAAgB,GAAG,CAAC,CAAC;IAwC/B,CAAC;IAtCC,OAAO,CAAC,KAA8B;;QACpC,MAAM,UAAU,GAAG,EAAE,IAAI,CAAC,QAAQ,CAAC;QACnC,MAAM,UAAU,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QAC5C,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC;QAE5B,MAAM,aAAa,GAAqB;YACtC,OAAO,EAAE,iBAAiB;YAC1B,OAAO,EAAE,MAAM,CAAC,UAAU,CAAC;YAC3B,MAAM,EAAE,UAAU;YAClB,UAAU;YACV,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,QAAQ,EAAE,MAAA,KAAK,CAAC,QAAQ,mCAAI,IAAI;YAChC,OAAO,EAAE,MAAA,KAAK,CAAC,OAAO,mCAAI,IAAI;YAC9B,OAAO,EAAE,KAAK,CAAC,OAAO;SACvB,CAAC;QAEF,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAA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
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.GrantSkillCardXpDto = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
class GrantSkillCardXpDto {
|
|
15
|
+
}
|
|
16
|
+
exports.GrantSkillCardXpDto = GrantSkillCardXpDto;
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, class_validator_1.IsString)(),
|
|
19
|
+
__metadata("design:type", String)
|
|
20
|
+
], GrantSkillCardXpDto.prototype, "skillCardSlug", void 0);
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, class_validator_1.IsInt)(),
|
|
23
|
+
(0, class_validator_1.Min)(1),
|
|
24
|
+
__metadata("design:type", Number)
|
|
25
|
+
], GrantSkillCardXpDto.prototype, "xpEarned", void 0);
|
|
26
|
+
//# sourceMappingURL=grant-skill-card-xp.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grant-skill-card-xp.dto.js","sourceRoot":"","sources":["../../../src/student-xp/dto/grant-skill-card-xp.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAuD;AAEvD,MAAa,mBAAmB;CAO/B;AAPD,kDAOC;AALC;IADC,IAAA,0BAAQ,GAAE;;0DACW;AAItB;IAFC,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAG,EAAC,CAAC,CAAC;;qDACU"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { GrantSkillCardXpDto } from './dto/grant-skill-card-xp.dto';
|
|
1
2
|
import { StudentXpService } from './student-xp.service';
|
|
2
3
|
export declare class StudentXpController {
|
|
3
4
|
private readonly studentXpService;
|
|
@@ -37,5 +38,19 @@ export declare class StudentXpController {
|
|
|
37
38
|
skills: any[];
|
|
38
39
|
learningTypes: any[];
|
|
39
40
|
}>;
|
|
41
|
+
getMyBalance(userId: number): Promise<{
|
|
42
|
+
personId: number;
|
|
43
|
+
totalXp: number;
|
|
44
|
+
areas: any[];
|
|
45
|
+
skills: any[];
|
|
46
|
+
learningTypes: any[];
|
|
47
|
+
}>;
|
|
48
|
+
grantSkillCardXp(userId: number, dto: GrantSkillCardXpDto): Promise<{
|
|
49
|
+
personId: number;
|
|
50
|
+
totalXp: number;
|
|
51
|
+
areas: any[];
|
|
52
|
+
skills: any[];
|
|
53
|
+
learningTypes: any[];
|
|
54
|
+
}>;
|
|
40
55
|
}
|
|
41
56
|
//# sourceMappingURL=student-xp.controller.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"student-xp.controller.d.ts","sourceRoot":"","sources":["../../src/student-xp/student-xp.controller.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,qBAEa,mBAAmB;IAClB,OAAO,CAAC,QAAQ,CAAC,gBAAgB;gBAAhB,gBAAgB,EAAE,gBAAgB;IAG/D,UAAU,CACO,IAAI,CAAC,EAAE,MAAM,EACT,QAAQ,CAAC,EAAE,MAAM,EACjB,QAAQ,CAAC,EAAE,MAAM,EACX,cAAc,CAAC,EAAE,MAAM,EAC/B,MAAM,CAAC,EAAE,MAAM;;;;;;;IAYl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BAAwB,CACP,IAAI,CAAC,EAAE,MAAM,EACT,QAAQ,CAAC,EAAE,MAAM,EACjB,QAAQ,CAAC,EAAE,MAAM,EACX,cAAc,CAAC,EAAE,MAAM;;;;;;;IAWlD,uBAAuB,CAAkC,QAAQ,EAAE,MAAM;;;;;;;IAMzE,YAAY,CAAa,MAAM,EAAE,MAAM;;;;;;;IAMvC,gBAAgB,CACF,MAAM,EAAE,MAAM,EAClB,GAAG,EAAE,mBAAmB;;;;;;;CAInC"}
|
|
@@ -15,6 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.StudentXpController = void 0;
|
|
16
16
|
const api_1 = require("@hed-hog/api");
|
|
17
17
|
const common_1 = require("@nestjs/common");
|
|
18
|
+
const grant_skill_card_xp_dto_1 = require("./dto/grant-skill-card-xp.dto");
|
|
18
19
|
const student_xp_service_1 = require("./student-xp.service");
|
|
19
20
|
let StudentXpController = class StudentXpController {
|
|
20
21
|
constructor(studentXpService) {
|
|
@@ -56,6 +57,12 @@ let StudentXpController = class StudentXpController {
|
|
|
56
57
|
getPersonBalanceSummary(personId) {
|
|
57
58
|
return this.studentXpService.getPersonBalanceSummary(personId);
|
|
58
59
|
}
|
|
60
|
+
getMyBalance(userId) {
|
|
61
|
+
return this.studentXpService.getMyBalance(userId);
|
|
62
|
+
}
|
|
63
|
+
grantSkillCardXp(userId, dto) {
|
|
64
|
+
return this.studentXpService.grantSkillCardXp(userId, dto);
|
|
65
|
+
}
|
|
59
66
|
};
|
|
60
67
|
exports.StudentXpController = StudentXpController;
|
|
61
68
|
__decorate([
|
|
@@ -106,6 +113,23 @@ __decorate([
|
|
|
106
113
|
__metadata("design:paramtypes", [Number]),
|
|
107
114
|
__metadata("design:returntype", void 0)
|
|
108
115
|
], StudentXpController.prototype, "getPersonBalanceSummary", null);
|
|
116
|
+
__decorate([
|
|
117
|
+
(0, common_1.Get)('my-balance'),
|
|
118
|
+
(0, api_1.NoRole)(),
|
|
119
|
+
__param(0, (0, api_1.User)('id')),
|
|
120
|
+
__metadata("design:type", Function),
|
|
121
|
+
__metadata("design:paramtypes", [Number]),
|
|
122
|
+
__metadata("design:returntype", void 0)
|
|
123
|
+
], StudentXpController.prototype, "getMyBalance", null);
|
|
124
|
+
__decorate([
|
|
125
|
+
(0, common_1.Post)('skill-card'),
|
|
126
|
+
(0, api_1.NoRole)(),
|
|
127
|
+
__param(0, (0, api_1.User)('id')),
|
|
128
|
+
__param(1, (0, common_1.Body)()),
|
|
129
|
+
__metadata("design:type", Function),
|
|
130
|
+
__metadata("design:paramtypes", [Number, grant_skill_card_xp_dto_1.GrantSkillCardXpDto]),
|
|
131
|
+
__metadata("design:returntype", void 0)
|
|
132
|
+
], StudentXpController.prototype, "grantSkillCardXp", null);
|
|
109
133
|
exports.StudentXpController = StudentXpController = __decorate([
|
|
110
134
|
(0, api_1.Role)(),
|
|
111
135
|
(0, common_1.Controller)('lms/xp'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"student-xp.controller.js","sourceRoot":"","sources":["../../src/student-xp/student-xp.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"student-xp.controller.js","sourceRoot":"","sources":["../../src/student-xp/student-xp.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sCAAkD;AAClD,2CAAyF;AACzF,2EAAoE;AACpE,6DAAwD;AAIjD,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC9B,YAA6B,gBAAkC;QAAlC,qBAAgB,GAAhB,gBAAgB,CAAkB;IAAG,CAAC;IAGnE,UAAU,CACO,IAAa,EACT,QAAiB,EACjB,QAAiB,EACX,cAAuB,EAC/B,MAAe;QAEhC,OAAO,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC;YACtC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;YACvB,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,IAAI,EAA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;;2DAQjB;AAGD;IADC,IAAA,YAAG,EAAC,iBAAiB,CAAC;IAEpB,WAAA,IAAA,cAAK,EAAC,MAAM,CAAC,CAAA;IACb,WAAA,IAAA,cAAK,EAAC,UAAU,CAAC,CAAA;IACjB,WAAA,IAAA,cAAK,EAAC,UAAU,CAAC,CAAA;IACjB,WAAA,IAAA,cAAK,EAAC,SAAS,CAAC,CAAA;;;;4DAQlB;AAGD;IADC,IAAA,YAAG,EAAC,yBAAyB,CAAC;IAE5B,WAAA,IAAA,cAAK,EAAC,MAAM,CAAC,CAAA;IACb,WAAA,IAAA,cAAK,EAAC,UAAU,CAAC,CAAA;IACjB,WAAA,IAAA,cAAK,EAAC,UAAU,CAAC,CAAA;IACjB,WAAA,IAAA,cAAK,EAAC,gBAAgB,CAAC,CAAA;;;;mEAQzB;AAGD;IADC,IAAA,YAAG,EAAC,2BAA2B,CAAC;IACR,WAAA,IAAA,cAAK,EAAC,UAAU,EAAE,qBAAY,CAAC,CAAA;;;;kEAEvD;AAID;IAFC,IAAA,YAAG,EAAC,YAAY,CAAC;IACjB,IAAA,YAAM,GAAE;IACK,WAAA,IAAA,UAAI,EAAC,IAAI,CAAC,CAAA;;;;uDAEvB;AAID;IAFC,IAAA,aAAI,EAAC,YAAY,CAAC;IAClB,IAAA,YAAM,GAAE;IAEN,WAAA,IAAA,UAAI,EAAC,IAAI,CAAC,CAAA;IACV,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAAM,6CAAmB;;2DAGjC;8BAnFU,mBAAmB;IAF/B,IAAA,UAAI,GAAE;IACN,IAAA,mBAAU,EAAC,QAAQ,CAAC;qCAE4B,qCAAgB;GADpD,mBAAmB,CAoF/B"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PrismaService } from '@hed-hog/api-prisma';
|
|
2
|
+
import { GrantSkillCardXpDto } from './dto/grant-skill-card-xp.dto';
|
|
2
3
|
export declare class StudentXpService {
|
|
3
4
|
private readonly prisma;
|
|
4
5
|
constructor(prisma: PrismaService);
|
|
@@ -61,5 +62,20 @@ export declare class StudentXpService {
|
|
|
61
62
|
private param;
|
|
62
63
|
private queryRows;
|
|
63
64
|
private querySingle;
|
|
65
|
+
private resolvePersonId;
|
|
66
|
+
getMyBalance(userId: number): Promise<{
|
|
67
|
+
personId: number;
|
|
68
|
+
totalXp: number;
|
|
69
|
+
areas: any[];
|
|
70
|
+
skills: any[];
|
|
71
|
+
learningTypes: any[];
|
|
72
|
+
}>;
|
|
73
|
+
grantSkillCardXp(userId: number, dto: GrantSkillCardXpDto): Promise<{
|
|
74
|
+
personId: number;
|
|
75
|
+
totalXp: number;
|
|
76
|
+
areas: any[];
|
|
77
|
+
skills: any[];
|
|
78
|
+
learningTypes: any[];
|
|
79
|
+
}>;
|
|
64
80
|
}
|
|
65
81
|
//# sourceMappingURL=student-xp.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"student-xp.service.d.ts","sourceRoot":"","sources":["../../src/student-xp/student-xp.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"student-xp.service.d.ts","sourceRoot":"","sources":["../../src/student-xp/student-xp.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAMpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEpE,qBACa,gBAAgB;IACf,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAE5C,UAAU,CAAC,MAAM,EAAE;QACvB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;;;;;;;IAyDK,gBAAgB,CAAC,MAAM,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;;;;;;;IAqCjG,iBAAiB,CAAC,MAAM,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE;;;;;;;IAqCnG,wBAAwB,CAAC,MAAM,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,cAAc,CAAC,EAAE,MAAM,CAAA;KAAE;;;;;;;IAqCjH,uBAAuB,CAAC,QAAQ,EAAE,MAAM;;;;;;;IA6C9C,OAAO,CAAC,KAAK;YAKC,SAAS;YAIT,WAAW;YAKX,eAAe;IAavB,YAAY,CAAC,MAAM,EAAE,MAAM;;;;;;;IAK3B,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,mBAAmB;;;;;;;CAsDhE"}
|
|
@@ -166,7 +166,11 @@ let StudentXpService = class StudentXpService {
|
|
|
166
166
|
JOIN xp_learning_type t ON t.id = b.xp_learning_type_id
|
|
167
167
|
LEFT JOIN xp_learning_type_locale l ON l.xp_learning_type_id = t.id AND l.locale_id = (SELECT id FROM locale WHERE code = 'pt' LIMIT 1)
|
|
168
168
|
WHERE b.person_id = $1 ORDER BY b.total_xp DESC`, [personId]),
|
|
169
|
-
this.querySingle(`SELECT
|
|
169
|
+
this.querySingle(`SELECT GREATEST(
|
|
170
|
+
(SELECT COALESCE(SUM(total_xp), 0) FROM student_area_xp WHERE person_id = $1),
|
|
171
|
+
(SELECT COALESCE(SUM(total_xp), 0) FROM student_skill_xp WHERE person_id = $1),
|
|
172
|
+
(SELECT COALESCE(SUM(total_xp), 0) FROM student_learning_type_xp WHERE person_id = $1)
|
|
173
|
+
)::text AS total`, [personId]),
|
|
170
174
|
]);
|
|
171
175
|
return {
|
|
172
176
|
personId,
|
|
@@ -188,6 +192,52 @@ let StudentXpService = class StudentXpService {
|
|
|
188
192
|
const rows = await this.prisma.$queryRawUnsafe(query, ...values);
|
|
189
193
|
return (_a = rows[0]) !== null && _a !== void 0 ? _a : null;
|
|
190
194
|
}
|
|
195
|
+
async resolvePersonId(userId) {
|
|
196
|
+
const row = await this.querySingle(`SELECT person_id AS "personId" FROM person_user WHERE user_id = $1 LIMIT 1`, [userId]);
|
|
197
|
+
if (!row) {
|
|
198
|
+
throw new common_1.NotFoundException('No person profile found for this user');
|
|
199
|
+
}
|
|
200
|
+
return Number(row.personId);
|
|
201
|
+
}
|
|
202
|
+
async getMyBalance(userId) {
|
|
203
|
+
const personId = await this.resolvePersonId(userId);
|
|
204
|
+
return this.getPersonBalanceSummary(personId);
|
|
205
|
+
}
|
|
206
|
+
async grantSkillCardXp(userId, dto) {
|
|
207
|
+
var _a;
|
|
208
|
+
const skillCardSlug = String((_a = dto.skillCardSlug) !== null && _a !== void 0 ? _a : '').trim();
|
|
209
|
+
if (!skillCardSlug) {
|
|
210
|
+
throw new common_1.BadRequestException('Skill card slug is required');
|
|
211
|
+
}
|
|
212
|
+
const parsedXpEarned = Math.trunc(Number(dto.xpEarned));
|
|
213
|
+
const xpEarned = Number.isFinite(parsedXpEarned)
|
|
214
|
+
? Math.max(1, parsedXpEarned)
|
|
215
|
+
: 1;
|
|
216
|
+
const personId = await this.resolvePersonId(userId);
|
|
217
|
+
const skill = await this.querySingle(`SELECT id, xp_area_id AS "xpAreaId" FROM xp_skill WHERE slug = $1 LIMIT 1`, [skillCardSlug]);
|
|
218
|
+
if (!skill) {
|
|
219
|
+
throw new common_1.NotFoundException('XP skill not found');
|
|
220
|
+
}
|
|
221
|
+
await this.prisma.$transaction(async (tx) => {
|
|
222
|
+
await tx.$executeRawUnsafe(`INSERT INTO student_skill_xp (person_id, xp_skill_id, total_xp, event_count, last_updated_at, created_at, updated_at)
|
|
223
|
+
VALUES ($1, $2, $3, 1, now(), now(), now())
|
|
224
|
+
ON CONFLICT (person_id, xp_skill_id) DO UPDATE
|
|
225
|
+
SET total_xp = student_skill_xp.total_xp + EXCLUDED.total_xp,
|
|
226
|
+
event_count = student_skill_xp.event_count + 1,
|
|
227
|
+
last_updated_at = now(),
|
|
228
|
+
updated_at = now()`, personId, skill.id, xpEarned);
|
|
229
|
+
if (skill.xpAreaId) {
|
|
230
|
+
await tx.$executeRawUnsafe(`INSERT INTO student_area_xp (person_id, xp_area_id, total_xp, event_count, last_updated_at, created_at, updated_at)
|
|
231
|
+
VALUES ($1, $2, $3, 1, now(), now(), now())
|
|
232
|
+
ON CONFLICT (person_id, xp_area_id) DO UPDATE
|
|
233
|
+
SET total_xp = student_area_xp.total_xp + EXCLUDED.total_xp,
|
|
234
|
+
event_count = student_area_xp.event_count + 1,
|
|
235
|
+
last_updated_at = now(),
|
|
236
|
+
updated_at = now()`, personId, skill.xpAreaId, xpEarned);
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
return this.getPersonBalanceSummary(personId);
|
|
240
|
+
}
|
|
191
241
|
};
|
|
192
242
|
exports.StudentXpService = StudentXpService;
|
|
193
243
|
exports.StudentXpService = StudentXpService = __decorate([
|