@itutoring/itutoring_application_js_api 1.0.6 → 1.0.8
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/README.md +6 -1
- package/apiController.js +9 -19
- package/index.js +69 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# iTutoring Application Javascript API
|
|
2
|
+
|
|
3
|
+
This package contains a javascript API for iTutoring Application.
|
|
4
|
+
In order to use this API you need to obtain an API key.
|
|
5
|
+
|
|
6
|
+
API Documentation for iTutoring Application can be found here: TO BE SOON
|
package/apiController.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import CookiesManager
|
|
2
|
-
import {R_KEYs} from "./objects/Enums";
|
|
1
|
+
import CookiesManager from "./CookiesManager";
|
|
2
|
+
import { R_KEYs } from "./objects/Enums";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Main class for comunicating with our backend REST api.
|
|
@@ -171,25 +171,15 @@ class APIController
|
|
|
171
171
|
resolve(APIController.#CLIENT_KEY);
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
|
|
175
|
-
// return test key.
|
|
176
|
-
if (location.hostname === "localhost")
|
|
177
|
-
{
|
|
178
|
-
APIController.#CLIENT_KEY = "r5u8x/A?D(G+KbPeShVmYp3s6v9y$B&E";
|
|
179
|
-
resolve(APIController.#R_KEY);
|
|
180
|
-
}
|
|
181
|
-
else
|
|
174
|
+
fetch('/client_key.xml').then(response => response.text()).then((data) =>
|
|
182
175
|
{
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
var keyXML = parser.parseFromString(data, "text/xml");
|
|
187
|
-
var key = keyXML.getElementsByTagName("key")[0].childNodes[0].nodeValue;
|
|
176
|
+
var parser = new DOMParser();
|
|
177
|
+
var keyXML = parser.parseFromString(data, "text/xml");
|
|
178
|
+
var key = keyXML.getElementsByTagName("key")[0].childNodes[0].nodeValue;
|
|
188
179
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
}
|
|
180
|
+
APIController.#CLIENT_KEY = key;
|
|
181
|
+
resolve(APIController.#CLIENT_KEY);
|
|
182
|
+
});
|
|
193
183
|
});
|
|
194
184
|
}
|
|
195
185
|
|
package/index.js
CHANGED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import APIController from "./apiController";
|
|
4
|
+
import CookiesManager from "./CookiesManager";
|
|
5
|
+
|
|
6
|
+
import CoursesSystem from "./modules/CoursesSystem";
|
|
7
|
+
import CustomerAuth from "./modules/CustomerAuth";
|
|
8
|
+
import CustomerPortal from "./modules/CustomerPortal";
|
|
9
|
+
import Email from "./modules/Email";
|
|
10
|
+
import Newsletters from "./modules/Newsletters";
|
|
11
|
+
import Payments from "./modules/Payments";
|
|
12
|
+
import ReservationSystem from "./modules/ReservationSystem";
|
|
13
|
+
import SubjectManager from "./modules/SubjectManager";
|
|
14
|
+
import TeacherAuth from "./modules/TeacherAuth";
|
|
15
|
+
import TeacherManager from "./modules/TeacherManager";
|
|
16
|
+
import TeacherPortal from "./modules/TeacherPortal";
|
|
17
|
+
import TeacherProfiles from "./modules/TeacherProfiles";
|
|
18
|
+
|
|
19
|
+
import Course from "./objects/Course";
|
|
20
|
+
import CourseReservation from "./objects/CourseReservation";
|
|
21
|
+
import Customer from "./objects/Customer";
|
|
22
|
+
import Reservation from "./objects/Reservation";
|
|
23
|
+
import Subject from "./objects/Subject";
|
|
24
|
+
import Teacher from "./objects/Teacher";
|
|
25
|
+
import TeacherProfile from "./objects/TeacherProfile";
|
|
26
|
+
|
|
27
|
+
import
|
|
28
|
+
{
|
|
29
|
+
BookReturn,
|
|
30
|
+
AuthResult,
|
|
31
|
+
PaymentType,
|
|
32
|
+
DeviceOS,
|
|
33
|
+
PasswordChange,
|
|
34
|
+
R_KEYs
|
|
35
|
+
} from "./objects/Enums";
|
|
36
|
+
|
|
37
|
+
export
|
|
38
|
+
{
|
|
39
|
+
APIController,
|
|
40
|
+
CookiesManager,
|
|
41
|
+
|
|
42
|
+
CoursesSystem,
|
|
43
|
+
CustomerAuth,
|
|
44
|
+
CustomerPortal,
|
|
45
|
+
Email,
|
|
46
|
+
Newsletters,
|
|
47
|
+
Payments,
|
|
48
|
+
ReservationSystem,
|
|
49
|
+
SubjectManager,
|
|
50
|
+
TeacherAuth,
|
|
51
|
+
TeacherManager,
|
|
52
|
+
TeacherPortal,
|
|
53
|
+
TeacherProfiles,
|
|
54
|
+
|
|
55
|
+
Course,
|
|
56
|
+
CourseReservation,
|
|
57
|
+
Customer,
|
|
58
|
+
Reservation,
|
|
59
|
+
Subject,
|
|
60
|
+
Teacher,
|
|
61
|
+
TeacherProfile,
|
|
62
|
+
|
|
63
|
+
BookReturn,
|
|
64
|
+
AuthResult,
|
|
65
|
+
PaymentType,
|
|
66
|
+
DeviceOS,
|
|
67
|
+
PasswordChange,
|
|
68
|
+
R_KEYs
|
|
69
|
+
}
|