@itutoring/itutoring_application_js_api 1.1.41 → 1.1.43

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
@@ -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,49 @@
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
+
17
+ static async GetAllEvents()
18
+ {
19
+ var events = await APIController.Get(this.#MODULE, this.#GET_ALL_EVENTS);
20
+
21
+ var eventObjs = [];
22
+ var eventsJson = JSON.parse(events)
23
+ for (const [key, value] of Object.entries(eventsJson))
24
+ {
25
+ var ev = new iEvent();
26
+ ev.CreateFromJSON(JSON.parse(value))
27
+ eventObjs.push(ev);
28
+ }
29
+
30
+ return eventObjs;
31
+ }
32
+
33
+ static async DeleteEvent(eventId)
34
+ {
35
+ await APIController.Post(this.#MODULE, this.#DELETE_EVENT, {
36
+ "id": eventId,
37
+ });
38
+ }
39
+
40
+ static async UpdateEvent(event)
41
+ {
42
+ var eventJson = JSON.stringify(event);
43
+ await APIController.Post(this.#MODULE, this.#UPDATE_EVENT, {
44
+ "event": eventJson,
45
+ });
46
+ }
47
+ }
48
+
49
+ export default LessonManager;
@@ -16,9 +16,9 @@ class TeacherAuth
16
16
  /**
17
17
  * This mothod will force default auth dialog
18
18
  */
19
- static async Auth()
19
+ static async Auth(callbackUrl)
20
20
  {
21
- location.href = APIController.REST_URL() + 'auth/AuthScreens/tauth?s=' + encodeURI(APIController.GetVisitorSessionID());
21
+ location.href = APIController.REST_URL() + encodeURI(APIController.GetVisitorSessionID() + '/auth/tauth?c=' + encodeURI(callbackUrl));
22
22
  }
23
23
 
24
24
  /**
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itutoring/itutoring_application_js_api",
3
- "version": "1.1.41",
3
+ "version": "1.1.43",
4
4
  "description": "Javascript API for iTutoring Application",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",