@itutoring/itutoring_application_js_api 1.4.32 → 1.5.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 +2 -0
- package/index.js +2 -0
- package/modules/LectorDatabase.js +120 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ import iTutoringApplicationVersion from "./modules/Version";
|
|
|
25
25
|
import LessonManager from "./modules/LessonManager";
|
|
26
26
|
import AttendanceManager from "./modules/AttendanceManager";
|
|
27
27
|
import TeacherProfileModule from "./modules/TeacherProfileModule";
|
|
28
|
+
import LectorDatabase from "./modules/LectorDatabase";
|
|
28
29
|
|
|
29
30
|
import Course from "./objects/Course";
|
|
30
31
|
import CourseReservation from "./objects/CourseReservation";
|
|
@@ -77,6 +78,7 @@ export
|
|
|
77
78
|
AttendanceManager,
|
|
78
79
|
Toolkit,
|
|
79
80
|
TeacherProfileModule,
|
|
81
|
+
LectorDatabase,
|
|
80
82
|
|
|
81
83
|
Course,
|
|
82
84
|
CourseReservation,
|
package/index.js
CHANGED
|
@@ -22,6 +22,7 @@ import EventManager from "./modules/EventManager";
|
|
|
22
22
|
import iTutoringApplicationVersion from "./modules/Version";
|
|
23
23
|
import LessonManager from "./modules/LessonManager";
|
|
24
24
|
import AttendanceManager from "./modules/AttendanceManager";
|
|
25
|
+
import LectorDatabase from "./modules/LectorDatabase";
|
|
25
26
|
|
|
26
27
|
import Course from "./objects/Course";
|
|
27
28
|
import CourseReservation from "./objects/CourseReservation";
|
|
@@ -75,6 +76,7 @@ export
|
|
|
75
76
|
AttendanceManager,
|
|
76
77
|
Toolkit,
|
|
77
78
|
TeacherProfileModule,
|
|
79
|
+
LectorDatabase,
|
|
78
80
|
|
|
79
81
|
Course,
|
|
80
82
|
CourseReservation,
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import APIController from "../apiController";
|
|
2
|
+
|
|
3
|
+
class LectorDatabase
|
|
4
|
+
{
|
|
5
|
+
/**
|
|
6
|
+
* Respective module name for this class
|
|
7
|
+
*/
|
|
8
|
+
static #MODULE = "LectorDatabase";
|
|
9
|
+
|
|
10
|
+
// All method names
|
|
11
|
+
static #GET_LECTORS = "GetLectors";
|
|
12
|
+
static #GET_LECTOR_INFO = "GetLectorInfo";
|
|
13
|
+
static #QUERY_LECTOR_DSS = "QueryLectorDSS";
|
|
14
|
+
static #REMOVE_LECTOR = "RemoveLector";
|
|
15
|
+
static #ADD_LECTOR = "AddLector";
|
|
16
|
+
static #RESET_PASSWORD = "ResetPassword";
|
|
17
|
+
static #ADD_MODULE_ACCESS = "AddModuleAccess";
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* desc: Get all lectors
|
|
21
|
+
* @param {int} listOffset
|
|
22
|
+
* @param {int} maxCount
|
|
23
|
+
* @returns
|
|
24
|
+
*/
|
|
25
|
+
static async getLectors(listOffset = 0, maxCount = -1)
|
|
26
|
+
{
|
|
27
|
+
var lectors = await APIController.Get(this.#MODULE, this.#GET_LECTORS, {
|
|
28
|
+
'listOffset': listOffset,
|
|
29
|
+
'maxCount': maxCount,
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
return JSON.parse(lectors);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* desc: Get lector info
|
|
37
|
+
* @param {string} lectorId
|
|
38
|
+
* @returns
|
|
39
|
+
*/
|
|
40
|
+
static async getLectorInfo(lectorId)
|
|
41
|
+
{
|
|
42
|
+
var lector = await APIController.Get(this.#MODULE, this.#GET_LECTOR_INFO, {
|
|
43
|
+
'lectorId': lectorId,
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
return JSON.parse(lector);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* desc: Query lector DSS
|
|
52
|
+
* @param {string} dssQuery
|
|
53
|
+
* @returns
|
|
54
|
+
*/
|
|
55
|
+
static async queryLectorDSS(dssQuery)
|
|
56
|
+
{
|
|
57
|
+
var lector = await APIController.Get(this.#MODULE, this.#QUERY_LECTOR_DSS, {
|
|
58
|
+
"query": dssQuery
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
return JSON.parse(lector);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* desc: Remove lector
|
|
67
|
+
* @param {string} lectorId
|
|
68
|
+
*/
|
|
69
|
+
static async removeLector(lectorId)
|
|
70
|
+
{
|
|
71
|
+
await APIController.Post(this.#MODULE, this.#REMOVE_LECTOR, {
|
|
72
|
+
'lectorId': lectorId,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* desc: Add lector
|
|
78
|
+
* @param {string} name
|
|
79
|
+
* @param {string} email
|
|
80
|
+
*
|
|
81
|
+
* @returns {string} lectorId
|
|
82
|
+
*/
|
|
83
|
+
static async addLector(name, email)
|
|
84
|
+
{
|
|
85
|
+
var id = await APIController.Post(this.#MODULE, this.#ADD_LECTOR, {
|
|
86
|
+
'name': name,
|
|
87
|
+
'email': email,
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
return id;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* desc: Reset password
|
|
95
|
+
* @param {string} lectorId
|
|
96
|
+
*/
|
|
97
|
+
static async resetPassword(lectorId)
|
|
98
|
+
{
|
|
99
|
+
await APIController.Post(this.#MODULE, this.#RESET_PASSWORD, {
|
|
100
|
+
'lectorId': lectorId,
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* desc: Add module access
|
|
106
|
+
* @param {string} lectorId
|
|
107
|
+
* @param {string} moduleId
|
|
108
|
+
* @param {int} access
|
|
109
|
+
*/
|
|
110
|
+
static async addModuleAccess(lectorId, moduleId, access)
|
|
111
|
+
{
|
|
112
|
+
await APIController.Post(this.#MODULE, this.#ADD_MODULE_ACCESS, {
|
|
113
|
+
'lectorId': lectorId,
|
|
114
|
+
'module': moduleId,
|
|
115
|
+
'access': access,
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export default LectorDatabase;
|