@itutoring/itutoring_application_js_api 1.1.42 → 1.1.44
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 +3 -1
- package/index.js +2 -0
- package/modules/LessonManager.js +58 -0
- package/objects/Event.js +3 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ import GoogleReviews from "./modules/GoogleReviews";
|
|
|
22
22
|
import CustomerEduPortal from "./modules/CustomerEduPortal";
|
|
23
23
|
import EventManager from "./modules/EventManager";
|
|
24
24
|
import iTutoringApplicationVersion from "./modules/Version";
|
|
25
|
+
import LessonManager from "./modules/LessonManager";
|
|
25
26
|
|
|
26
27
|
import Course from "./objects/Course";
|
|
27
28
|
import CourseReservation from "./objects/CourseReservation";
|
|
@@ -64,7 +65,8 @@ export
|
|
|
64
65
|
CustomerEduPortal,
|
|
65
66
|
EventManager,
|
|
66
67
|
iTutoringApplicationVersion,
|
|
67
|
-
|
|
68
|
+
LessonManager,
|
|
69
|
+
|
|
68
70
|
Course,
|
|
69
71
|
CourseReservation,
|
|
70
72
|
Customer,
|
package/index.js
CHANGED
|
@@ -20,6 +20,7 @@ import GoogleReviews from "./modules/GoogleReviews";
|
|
|
20
20
|
import CustomerEduPortal from "./modules/CustomerEduPortal";
|
|
21
21
|
import EventManager from "./modules/EventManager";
|
|
22
22
|
import iTutoringApplicationVersion from "./modules/Version";
|
|
23
|
+
import LessonManager from "./modules/LessonManager";
|
|
23
24
|
|
|
24
25
|
import Course from "./objects/Course";
|
|
25
26
|
import CourseReservation from "./objects/CourseReservation";
|
|
@@ -62,6 +63,7 @@ export
|
|
|
62
63
|
CustomerEduPortal,
|
|
63
64
|
EventManager,
|
|
64
65
|
iTutoringApplicationVersion,
|
|
66
|
+
LessonManager,
|
|
65
67
|
|
|
66
68
|
Course,
|
|
67
69
|
CourseReservation,
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import APIController from "../apiController";
|
|
2
|
+
import iEvent from "../objects/Event";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class LessonManager
|
|
6
|
+
{
|
|
7
|
+
/**
|
|
8
|
+
* Respective module name for this class
|
|
9
|
+
*/
|
|
10
|
+
static #MODULE = "LessonManager";
|
|
11
|
+
|
|
12
|
+
// All method names
|
|
13
|
+
static #GET_ALL_EVENTS = "GetAllEvents";
|
|
14
|
+
static #DELETE_EVENT = "DeleteEvent";
|
|
15
|
+
static #UPDATE_EVENT = "UpdateEvent";
|
|
16
|
+
static #CREATE_EVENT = "CreateEvent";
|
|
17
|
+
|
|
18
|
+
static async GetAllEvents()
|
|
19
|
+
{
|
|
20
|
+
var events = await APIController.Get(this.#MODULE, this.#GET_ALL_EVENTS);
|
|
21
|
+
|
|
22
|
+
var eventObjs = [];
|
|
23
|
+
var eventsJson = JSON.parse(events)
|
|
24
|
+
for (const [key, value] of Object.entries(eventsJson))
|
|
25
|
+
{
|
|
26
|
+
var ev = new iEvent();
|
|
27
|
+
ev.CreateFromJSON(JSON.parse(value))
|
|
28
|
+
eventObjs.push(ev);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return eventObjs;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
static async DeleteEvent(eventId)
|
|
35
|
+
{
|
|
36
|
+
await APIController.Post(this.#MODULE, this.#DELETE_EVENT, {
|
|
37
|
+
"id": eventId,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
static async UpdateEvent(event)
|
|
42
|
+
{
|
|
43
|
+
var eventJson = JSON.stringify(event);
|
|
44
|
+
await APIController.Post(this.#MODULE, this.#UPDATE_EVENT, {
|
|
45
|
+
"event": eventJson,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Will create a new event.
|
|
51
|
+
*/
|
|
52
|
+
static async CreateEvent()
|
|
53
|
+
{
|
|
54
|
+
await APIController.Post(this.#MODULE, this.#CREATE_EVENT);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export default LessonManager;
|
package/objects/Event.js
CHANGED
|
@@ -79,6 +79,8 @@ class iEvent
|
|
|
79
79
|
|
|
80
80
|
ReadOnly;
|
|
81
81
|
|
|
82
|
+
State;
|
|
83
|
+
|
|
82
84
|
|
|
83
85
|
CreateFromJSON(json)
|
|
84
86
|
{
|
|
@@ -99,6 +101,7 @@ class iEvent
|
|
|
99
101
|
this.Recursivity = json['Recursivity'];
|
|
100
102
|
this.IsVideoConference = json['IsVideoConference'];
|
|
101
103
|
this.ReadOnly = json['ReadOnly'];
|
|
104
|
+
this.State = json['State'];
|
|
102
105
|
}
|
|
103
106
|
}
|
|
104
107
|
|