@itutoring/itutoring_application_js_api 1.11.0 → 1.11.2

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.
Files changed (51) hide show
  1. package/.idea/iTutoring_Application_API-js.iml +11 -11
  2. package/.idea/modules.xml +7 -7
  3. package/.idea/vcs.xml +5 -5
  4. package/CookiesManager.js +47 -47
  5. package/LICENSE +21 -21
  6. package/README.md +6 -6
  7. package/apiController.js +436 -436
  8. package/cache.js +31 -31
  9. package/index.d.ts +116 -116
  10. package/index.js +114 -114
  11. package/modules/AiAssist.js +31 -31
  12. package/modules/Authentication.js +86 -86
  13. package/modules/Cart.js +83 -81
  14. package/modules/Checkout.js +60 -50
  15. package/modules/CustomerAuth.js +57 -57
  16. package/modules/CustomerLessonManager.js +29 -29
  17. package/modules/CustomerPortal.js +31 -31
  18. package/modules/FAQ.js +39 -39
  19. package/modules/GoogleReviews.js +36 -36
  20. package/modules/Inventory.js +51 -51
  21. package/modules/LectorDatabase.js +185 -185
  22. package/modules/LectorsCalendar.js +67 -67
  23. package/modules/LessonInventory.js +47 -47
  24. package/modules/MarketplaceController.js +86 -86
  25. package/modules/Models.js +380 -380
  26. package/modules/Payments.js +75 -75
  27. package/modules/Pricing.js +70 -70
  28. package/modules/ReservationSystem.js +48 -48
  29. package/modules/Reviews.js +53 -53
  30. package/modules/SubjectManager.js +139 -139
  31. package/modules/TableExplorer.js +246 -246
  32. package/modules/TeacherAuth.js +57 -57
  33. package/modules/TeacherProfileModule.js +299 -299
  34. package/modules/TeacherProfiles.js +60 -60
  35. package/modules/Version.js +24 -24
  36. package/modules/WebController.js +37 -37
  37. package/objects/AttendanceEvent.js +39 -39
  38. package/objects/AuthUser.js +24 -24
  39. package/objects/Course.js +38 -38
  40. package/objects/CourseReservation.js +22 -22
  41. package/objects/Customer.js +20 -20
  42. package/objects/Enums.js +62 -62
  43. package/objects/Event.js +125 -125
  44. package/objects/Reservation.js +42 -42
  45. package/objects/Subject.js +24 -24
  46. package/objects/Teacher.js +18 -18
  47. package/objects/TeacherProfile.js +17 -17
  48. package/objects/Webinar.js +25 -25
  49. package/objects/billingInfo.js +29 -29
  50. package/package.json +1 -1
  51. package/toolkit/Toolkit.jsx +51 -51
@@ -1,140 +1,140 @@
1
- /*
2
- * Copyright (C) 2024 iTutoring s.r.o.
3
- * All rights reserved.
4
- *
5
-
6
- *
7
- */
8
-
9
-
10
- import Subject from "./../objects/Subject";
11
- import APIController from "./../apiController";
12
- import Course from "./../objects/Course";
13
-
14
- class SubjectManager
15
- {
16
- /**
17
- * Respective module name for this class
18
- */
19
- static #MODULE = "SubjectManager";
20
-
21
- // All method names
22
- static #GET_ALL_AVAILABLE_SUBJECTS = "GetAllAvailableSubjects";
23
- static #GET_ALL_AVAILABLE_COURSES = "GetAllAvailableCourses";
24
- static #GET_ALL_AVAILABLE_PLACES = "GetAllAvailablePlaces";
25
- static #GET_ALL_AVAILABLE_CLASSES = "GetAllAvailableClasses";
26
- static #GET_ALL_AVAILABLE_LOCATIONS = "GetAllAvailableLocations";
27
-
28
- // Cache keys
29
- static #SUBJECTS_CACHE_KEY = "json_subjects_c_k";
30
- static #COURSES_CACHE_KEY = "json_courses_c_k";
31
-
32
- static async getAllAvailableLocations()
33
- {
34
- var data = await APIController.Get(this.#MODULE, this.#GET_ALL_AVAILABLE_LOCATIONS, {}, true);
35
- var arr = JSON.parse(data);
36
- return arr;
37
- }
38
-
39
- /**
40
- *
41
- * @returns Array (Subject[id]) of all available subjects as array of Subject objects. Key is id of subject.
42
- */
43
- static async GetAllAvailableSubjects()
44
- {
45
- var data = await APIController.Get(this.#MODULE, this.#GET_ALL_AVAILABLE_SUBJECTS, {}, true);
46
-
47
- var dataArray = JSON.parse(data);
48
-
49
- var availableSubjects = [];
50
-
51
- for (const [key, value] of Object.entries(dataArray))
52
- {
53
- var subject = new Subject();
54
- subject.CreditPrice = value['CreditPrice'];
55
- subject.Description = value['Description'];
56
- subject.ID = value['ID'];
57
- subject.IconPath = value['IconPath'];
58
- subject.Name = value['Name'];
59
- subject.Price = value['Price'];
60
- subject.NameRaw = value['NameRaw'];
61
- subject.Level = value['Level'];
62
- subject.Item = value['Item'];
63
- subject.PriceBeforeSale = value['PriceBeforeSale'];
64
- subject.IsSaled = value['IsSaled'];
65
-
66
- availableSubjects[subject.ID] = subject;
67
- }
68
-
69
- return availableSubjects;
70
- }
71
-
72
- /**
73
- * @deprecated
74
- * @param {*} requestReload
75
- * @returns
76
- */
77
- static async GetAllAvailableCourses(requestReload = false)
78
- {
79
- var data;
80
-
81
- /*if (APICache.IsCached(this.#COURSES_CACHE_KEY) && !requestReload)
82
- {
83
- data = APICache.Retrive(this.#COURSES_CACHE_KEY);
84
- }
85
- else
86
- {
87
- data = await APIController.Get(this.#MODULE, this.#GET_ALL_AVAILABLE_COURSES);
88
- APICache.Cache(this.#COURSES_CACHE_KEY, data);
89
- }*/
90
-
91
- data = await APIController.Get(this.#MODULE, this.#GET_ALL_AVAILABLE_COURSES);
92
-
93
- var dataArray = JSON.parse(data);
94
-
95
- var availableCourses = [];
96
-
97
- for (const [key, value] of Object.entries(dataArray))
98
- {
99
- var course = new Course();
100
-
101
- course.Name = value['Name'];
102
- course.NameRaw = value['NameRaw'];
103
- course.School = value['School'];
104
- course.Price = value['Price'];
105
- course.CreditPrice = value['CreditPrice'];
106
- course.ID = value['ID'];
107
- course.Day = value['Day'];
108
- course.Time = value['Time'];
109
- course.Length = value['Length'];
110
- course.Lessons = value['Lessons'];
111
- course.Capacity = value['Capacity'];
112
- course.Item = value['Item'];
113
- course.Subject = value['Subject'];
114
- course.PriceBeforeSale = value['PriceBeforeSale'];
115
- course.IsSaled = value['IsSaled'];
116
-
117
- availableCourses[course.ID] = course;
118
- }
119
-
120
- return availableCourses;
121
- }
122
-
123
- static async GetAllAvailablePlaces()
124
- {
125
- var data = await APIController.Get(this.#MODULE, this.#GET_ALL_AVAILABLE_PLACES, {}, true);
126
-
127
- var arr = JSON.parse(data);
128
-
129
- return arr;
130
- }
131
-
132
- static async GetAllAvailableClasses()
133
- {
134
- var data = await APIController.Get(this.#MODULE, this.#GET_ALL_AVAILABLE_CLASSES, {}, true);
135
- var arr = JSON.parse(JSON.parse(data));
136
- return arr;
137
- }
138
- }
139
-
1
+ /*
2
+ * Copyright (C) 2024 iTutoring s.r.o.
3
+ * All rights reserved.
4
+ *
5
+
6
+ *
7
+ */
8
+
9
+
10
+ import Subject from "./../objects/Subject";
11
+ import APIController from "./../apiController";
12
+ import Course from "./../objects/Course";
13
+
14
+ class SubjectManager
15
+ {
16
+ /**
17
+ * Respective module name for this class
18
+ */
19
+ static #MODULE = "SubjectManager";
20
+
21
+ // All method names
22
+ static #GET_ALL_AVAILABLE_SUBJECTS = "GetAllAvailableSubjects";
23
+ static #GET_ALL_AVAILABLE_COURSES = "GetAllAvailableCourses";
24
+ static #GET_ALL_AVAILABLE_PLACES = "GetAllAvailablePlaces";
25
+ static #GET_ALL_AVAILABLE_CLASSES = "GetAllAvailableClasses";
26
+ static #GET_ALL_AVAILABLE_LOCATIONS = "GetAllAvailableLocations";
27
+
28
+ // Cache keys
29
+ static #SUBJECTS_CACHE_KEY = "json_subjects_c_k";
30
+ static #COURSES_CACHE_KEY = "json_courses_c_k";
31
+
32
+ static async getAllAvailableLocations()
33
+ {
34
+ var data = await APIController.Get(this.#MODULE, this.#GET_ALL_AVAILABLE_LOCATIONS, {}, true);
35
+ var arr = JSON.parse(data);
36
+ return arr;
37
+ }
38
+
39
+ /**
40
+ *
41
+ * @returns Array (Subject[id]) of all available subjects as array of Subject objects. Key is id of subject.
42
+ */
43
+ static async GetAllAvailableSubjects()
44
+ {
45
+ var data = await APIController.Get(this.#MODULE, this.#GET_ALL_AVAILABLE_SUBJECTS, {}, true);
46
+
47
+ var dataArray = JSON.parse(data);
48
+
49
+ var availableSubjects = [];
50
+
51
+ for (const [key, value] of Object.entries(dataArray))
52
+ {
53
+ var subject = new Subject();
54
+ subject.CreditPrice = value['CreditPrice'];
55
+ subject.Description = value['Description'];
56
+ subject.ID = value['ID'];
57
+ subject.IconPath = value['IconPath'];
58
+ subject.Name = value['Name'];
59
+ subject.Price = value['Price'];
60
+ subject.NameRaw = value['NameRaw'];
61
+ subject.Level = value['Level'];
62
+ subject.Item = value['Item'];
63
+ subject.PriceBeforeSale = value['PriceBeforeSale'];
64
+ subject.IsSaled = value['IsSaled'];
65
+
66
+ availableSubjects[subject.ID] = subject;
67
+ }
68
+
69
+ return availableSubjects;
70
+ }
71
+
72
+ /**
73
+ * @deprecated
74
+ * @param {*} requestReload
75
+ * @returns
76
+ */
77
+ static async GetAllAvailableCourses(requestReload = false)
78
+ {
79
+ var data;
80
+
81
+ /*if (APICache.IsCached(this.#COURSES_CACHE_KEY) && !requestReload)
82
+ {
83
+ data = APICache.Retrive(this.#COURSES_CACHE_KEY);
84
+ }
85
+ else
86
+ {
87
+ data = await APIController.Get(this.#MODULE, this.#GET_ALL_AVAILABLE_COURSES);
88
+ APICache.Cache(this.#COURSES_CACHE_KEY, data);
89
+ }*/
90
+
91
+ data = await APIController.Get(this.#MODULE, this.#GET_ALL_AVAILABLE_COURSES);
92
+
93
+ var dataArray = JSON.parse(data);
94
+
95
+ var availableCourses = [];
96
+
97
+ for (const [key, value] of Object.entries(dataArray))
98
+ {
99
+ var course = new Course();
100
+
101
+ course.Name = value['Name'];
102
+ course.NameRaw = value['NameRaw'];
103
+ course.School = value['School'];
104
+ course.Price = value['Price'];
105
+ course.CreditPrice = value['CreditPrice'];
106
+ course.ID = value['ID'];
107
+ course.Day = value['Day'];
108
+ course.Time = value['Time'];
109
+ course.Length = value['Length'];
110
+ course.Lessons = value['Lessons'];
111
+ course.Capacity = value['Capacity'];
112
+ course.Item = value['Item'];
113
+ course.Subject = value['Subject'];
114
+ course.PriceBeforeSale = value['PriceBeforeSale'];
115
+ course.IsSaled = value['IsSaled'];
116
+
117
+ availableCourses[course.ID] = course;
118
+ }
119
+
120
+ return availableCourses;
121
+ }
122
+
123
+ static async GetAllAvailablePlaces()
124
+ {
125
+ var data = await APIController.Get(this.#MODULE, this.#GET_ALL_AVAILABLE_PLACES, {}, true);
126
+
127
+ var arr = JSON.parse(data);
128
+
129
+ return arr;
130
+ }
131
+
132
+ static async GetAllAvailableClasses()
133
+ {
134
+ var data = await APIController.Get(this.#MODULE, this.#GET_ALL_AVAILABLE_CLASSES, {}, true);
135
+ var arr = JSON.parse(JSON.parse(data));
136
+ return arr;
137
+ }
138
+ }
139
+
140
140
  export default SubjectManager;