@itutoring/itutoring_application_js_api 1.21.0 → 1.22.1
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/index.d.ts +4 -0
- package/index.js +4 -0
- package/modules/ActiveTraining.js +77 -0
- package/modules/Training.js +80 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -33,6 +33,8 @@ import Cart from "./modules/Cart";
|
|
|
33
33
|
import Checkout from "./modules/Checkout";
|
|
34
34
|
import InquiryCheckout from "./modules/InquiryCheckout";
|
|
35
35
|
import DbTags from "./modules/DbTags";
|
|
36
|
+
import ActiveTraining from "./modules/ActiveTraining";
|
|
37
|
+
import Training from "./modules/Training";
|
|
36
38
|
|
|
37
39
|
import Course from "./objects/Course";
|
|
38
40
|
import CourseReservation from "./objects/CourseReservation";
|
|
@@ -100,6 +102,8 @@ export
|
|
|
100
102
|
Checkout,
|
|
101
103
|
InquiryCheckout,
|
|
102
104
|
DbTags,
|
|
105
|
+
ActiveTraining,
|
|
106
|
+
Training,
|
|
103
107
|
|
|
104
108
|
Course,
|
|
105
109
|
CourseReservation,
|
package/index.js
CHANGED
|
@@ -30,6 +30,8 @@ import Cart from "./modules/Cart";
|
|
|
30
30
|
import Checkout from "./modules/Checkout";
|
|
31
31
|
import InquiryCheckout from "./modules/InquiryCheckout";
|
|
32
32
|
import DbTags from "./modules/DbTags";
|
|
33
|
+
import ActiveTraining from "./modules/ActiveTraining";
|
|
34
|
+
import Training from "./modules/Training";
|
|
33
35
|
|
|
34
36
|
import Course from "./objects/Course";
|
|
35
37
|
import CourseReservation from "./objects/CourseReservation";
|
|
@@ -98,6 +100,8 @@ export
|
|
|
98
100
|
Checkout,
|
|
99
101
|
InquiryCheckout,
|
|
100
102
|
DbTags,
|
|
103
|
+
ActiveTraining,
|
|
104
|
+
Training,
|
|
101
105
|
|
|
102
106
|
Course,
|
|
103
107
|
CourseReservation,
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2025 iTutoring s.r.o.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import APIController from "../apiController";
|
|
9
|
+
|
|
10
|
+
class ActiveTraining
|
|
11
|
+
{
|
|
12
|
+
static #MODULE = "ActiveTraining";
|
|
13
|
+
|
|
14
|
+
static #GET_CURRENT_STEP = "GetCurrentStep";
|
|
15
|
+
static COMPLETE_CURRENT_STEP = "CompleteCurrentStep";
|
|
16
|
+
static REPORT_VIDEO_TIMESTAMP = "ReportVideoTimestamp";
|
|
17
|
+
static GET_FINAL_TEST = "GetFinalTest";
|
|
18
|
+
static SET_TEST_ANSWER = "SetTestAnswer";
|
|
19
|
+
static #COMPLETE = "Complete";
|
|
20
|
+
static #END_TRAINING = "EndTraining";
|
|
21
|
+
static #ACK = "Ack";
|
|
22
|
+
|
|
23
|
+
static async getCurrentStep()
|
|
24
|
+
{
|
|
25
|
+
var res = await APIController.Get(this.#MODULE, this.#GET_CURRENT_STEP);
|
|
26
|
+
return res;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
static async completeCurrentStep()
|
|
30
|
+
{
|
|
31
|
+
var res = await APIController.Post(this.#MODULE, this.COMPLETE_CURRENT_STEP);
|
|
32
|
+
return res;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
static async reportVideoTimestamp(timestamp)
|
|
36
|
+
{
|
|
37
|
+
var res = await APIController.Post(this.#MODULE, this.REPORT_VIDEO_TIMESTAMP, {
|
|
38
|
+
'timestamp': timestamp
|
|
39
|
+
});
|
|
40
|
+
return res;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
static async getFinalTest()
|
|
44
|
+
{
|
|
45
|
+
var res = await APIController.Get(this.#MODULE, this.GET_FINAL_TEST);
|
|
46
|
+
return res;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
static async setTestAnswer(questionId, optionId)
|
|
50
|
+
{
|
|
51
|
+
var res = await APIController.Post(this.#MODULE, this.SET_TEST_ANSWER, {
|
|
52
|
+
'questionId': questionId,
|
|
53
|
+
'optionId': optionId
|
|
54
|
+
});
|
|
55
|
+
return res;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
static async complete()
|
|
59
|
+
{
|
|
60
|
+
var res = await APIController.Post(this.#MODULE, this.#COMPLETE);
|
|
61
|
+
return res;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
static async endTraining()
|
|
65
|
+
{
|
|
66
|
+
var res = await APIController.Post(this.#MODULE, this.#END_TRAINING);
|
|
67
|
+
return res;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
static async ack()
|
|
71
|
+
{
|
|
72
|
+
var res = await APIController.Post(this.#MODULE, this.#ACK);
|
|
73
|
+
return res;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export default ActiveTraining;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2025 iTutoring s.r.o.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
import APIController from "../apiController";
|
|
10
|
+
|
|
11
|
+
class Training
|
|
12
|
+
{
|
|
13
|
+
static #MODULE = "Training";
|
|
14
|
+
|
|
15
|
+
static #ASSIGN_TRAINING = "AssignTraining";
|
|
16
|
+
static #UNASSIGN_TRAINING = "UnassignTraining";
|
|
17
|
+
static #GET_ASSIGNED_TRAININGS = "GetAssignedTrainings";
|
|
18
|
+
static #GET_TRAINING_DETAILS = "GetTrainingDetails";
|
|
19
|
+
static #START_TRAINING = "StartTraining";
|
|
20
|
+
static #GET_ACTIVE_TRAINING = "GetActiveTraining";
|
|
21
|
+
static #GET_TRAINING_RESULT = "GetTrainingResult";
|
|
22
|
+
|
|
23
|
+
static async assignTraining(trainingId, lectorId)
|
|
24
|
+
{
|
|
25
|
+
var res = await APIController.Post(this.#MODULE, this.#ASSIGN_TRAINING, {
|
|
26
|
+
'trainingId': trainingId,
|
|
27
|
+
'lectorId': lectorId
|
|
28
|
+
});
|
|
29
|
+
return res;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
static async unassignTraining(trainingId, lectorId)
|
|
33
|
+
{
|
|
34
|
+
var res = await APIController.Post(this.#MODULE, this.#UNASSIGN_TRAINING, {
|
|
35
|
+
'trainingId': trainingId,
|
|
36
|
+
'lectorId': lectorId
|
|
37
|
+
});
|
|
38
|
+
return res;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
static async getAssignedTrainings(completedOnly)
|
|
42
|
+
{
|
|
43
|
+
var res = await APIController.Get(this.#MODULE, this.#GET_ASSIGNED_TRAININGS, {
|
|
44
|
+
'completedOnly': completedOnly
|
|
45
|
+
});
|
|
46
|
+
return res;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
static async getTrainingDetails(trainingId)
|
|
50
|
+
{
|
|
51
|
+
var res = await APIController.Get(this.#MODULE, this.#GET_TRAINING_DETAILS, {
|
|
52
|
+
'trainingId': trainingId
|
|
53
|
+
});
|
|
54
|
+
return JSON.parse(res);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
static async startTraining(trainingId)
|
|
58
|
+
{
|
|
59
|
+
var res = await APIController.Post(this.#MODULE, this.#START_TRAINING, {
|
|
60
|
+
'trainingId': trainingId
|
|
61
|
+
});
|
|
62
|
+
return res;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
static async getActiveTraining()
|
|
66
|
+
{
|
|
67
|
+
var res = await APIController.Get(this.#MODULE, this.#GET_ACTIVE_TRAINING);
|
|
68
|
+
return res;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
static async getTrainingResult(trainingId)
|
|
72
|
+
{
|
|
73
|
+
var res = await APIController.Get(this.#MODULE, this.#GET_TRAINING_RESULT, {
|
|
74
|
+
'trainingId': trainingId
|
|
75
|
+
});
|
|
76
|
+
return res;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export default Training;
|