@itutoring/itutoring_application_js_api 1.4.32 → 1.5.0

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 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,116 @@
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
+ static async addLector(name, email)
82
+ {
83
+ await APIController.Post(this.#MODULE, this.#ADD_LECTOR, {
84
+ 'name': name,
85
+ 'email': email,
86
+ });
87
+ }
88
+
89
+ /**
90
+ * desc: Reset password
91
+ * @param {string} lectorId
92
+ */
93
+ static async resetPassword(lectorId)
94
+ {
95
+ await APIController.Post(this.#MODULE, this.#RESET_PASSWORD, {
96
+ 'lectorId': lectorId,
97
+ });
98
+ }
99
+
100
+ /**
101
+ * desc: Add module access
102
+ * @param {string} lectorId
103
+ * @param {string} moduleId
104
+ * @param {int} access
105
+ */
106
+ static async addModuleAccess(lectorId, moduleId, access)
107
+ {
108
+ await APIController.Post(this.#MODULE, this.#ADD_MODULE_ACCESS, {
109
+ 'lectorId': lectorId,
110
+ 'module': moduleId,
111
+ 'access': access,
112
+ });
113
+ }
114
+ }
115
+
116
+ export default LectorDatabase;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itutoring/itutoring_application_js_api",
3
- "version": "1.4.32",
3
+ "version": "1.5.0",
4
4
  "description": "Javascript API for iTutoring Application",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",