@itutoring/itutoring_application_js_api 1.10.4 → 1.11.1

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 -112
  10. package/index.js +114 -110
  11. package/modules/AiAssist.js +31 -31
  12. package/modules/Authentication.js +86 -86
  13. package/modules/Cart.js +84 -0
  14. package/modules/Checkout.js +51 -0
  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 -159
  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,87 +1,87 @@
1
- /*
2
- * Copyright (C) 2024 iTutoring s.r.o.
3
- * All rights reserved.
4
- *
5
-
6
- *
7
- */
8
-
9
-
10
- import APIController from "../apiController";
11
- import AuthUser from "../objects/AuthUser";
12
- import TeacherProfile from "../objects/TeacherProfile";
13
-
14
- class Authentication
15
- {
16
- static #MODULE = "Authentication";
17
-
18
- static #LOG_IN = "LogIn";
19
- static #IS_AUTHENTICATED = "IsAuthenticated";
20
- static #GET_USER_INFO = "GetUserInfo";
21
- static #SIGN_OUT = "SignOut";
22
- static #SUPER_LOGIN = "SuperLogin";
23
-
24
- static async SuperLogin(email, type)
25
- {
26
- var res = await APIController.Post(this.#MODULE, this.#SUPER_LOGIN, {
27
- "email": email,
28
- "type": type,
29
- });
30
-
31
- return res;
32
- }
33
-
34
- static async SignOut()
35
- {
36
- var res = await APIController.Get(this.#MODULE, this.#SIGN_OUT);
37
- return res;
38
- }
39
-
40
- static async LogIn(email, pass, type)
41
- {
42
- var res = await APIController.Post(this.#MODULE, this.#LOG_IN, {
43
- "email": email,
44
- "pass": pass,
45
- "type": type,
46
- });
47
-
48
- return res;
49
- }
50
-
51
- static async IsAuthenticated()
52
- {
53
- var res = await APIController.Get(this.#MODULE, this.#IS_AUTHENTICATED);
54
- return res;
55
- }
56
-
57
- static async GetUserInfo()
58
- {
59
- var userString = await APIController.Get(this.#MODULE, this.#GET_USER_INFO);
60
- var arr = JSON.parse(userString);
61
-
62
- var user = new AuthUser();
63
- user.AuthenticationMethod = user['AuthenticationMethod'];
64
-
65
- user.ID = arr['ID'];
66
- user.Name = arr['Name'];
67
- user.Email = arr['Email'];
68
- user.Phone = arr['Phone'];
69
- user.EduMeetLink = arr['EduMeetLink'];
70
- user.BitmojiURL = arr['BitmojiURL'];
71
- user.ModuleAccess = arr['ModuleAccess'];
72
- user.TeachedLessons = arr['TeachedLessons'];
73
- if (arr['TeacherProfile'] != undefined | null)
74
- {
75
- var profile = new TeacherProfile();
76
- profile.Bio = arr['TeacherProfile']['Bio'];
77
- profile.Name = arr['TeacherProfile']['Name'];
78
- profile.PhotoPath = arr['TeacherProfile']['PhotoPath'];
79
-
80
- user.TeacherProfile = profile;
81
- }
82
-
83
- return user;
84
- }
85
- }
86
-
1
+ /*
2
+ * Copyright (C) 2024 iTutoring s.r.o.
3
+ * All rights reserved.
4
+ *
5
+
6
+ *
7
+ */
8
+
9
+
10
+ import APIController from "../apiController";
11
+ import AuthUser from "../objects/AuthUser";
12
+ import TeacherProfile from "../objects/TeacherProfile";
13
+
14
+ class Authentication
15
+ {
16
+ static #MODULE = "Authentication";
17
+
18
+ static #LOG_IN = "LogIn";
19
+ static #IS_AUTHENTICATED = "IsAuthenticated";
20
+ static #GET_USER_INFO = "GetUserInfo";
21
+ static #SIGN_OUT = "SignOut";
22
+ static #SUPER_LOGIN = "SuperLogin";
23
+
24
+ static async SuperLogin(email, type)
25
+ {
26
+ var res = await APIController.Post(this.#MODULE, this.#SUPER_LOGIN, {
27
+ "email": email,
28
+ "type": type,
29
+ });
30
+
31
+ return res;
32
+ }
33
+
34
+ static async SignOut()
35
+ {
36
+ var res = await APIController.Get(this.#MODULE, this.#SIGN_OUT);
37
+ return res;
38
+ }
39
+
40
+ static async LogIn(email, pass, type)
41
+ {
42
+ var res = await APIController.Post(this.#MODULE, this.#LOG_IN, {
43
+ "email": email,
44
+ "pass": pass,
45
+ "type": type,
46
+ });
47
+
48
+ return res;
49
+ }
50
+
51
+ static async IsAuthenticated()
52
+ {
53
+ var res = await APIController.Get(this.#MODULE, this.#IS_AUTHENTICATED);
54
+ return res;
55
+ }
56
+
57
+ static async GetUserInfo()
58
+ {
59
+ var userString = await APIController.Get(this.#MODULE, this.#GET_USER_INFO);
60
+ var arr = JSON.parse(userString);
61
+
62
+ var user = new AuthUser();
63
+ user.AuthenticationMethod = user['AuthenticationMethod'];
64
+
65
+ user.ID = arr['ID'];
66
+ user.Name = arr['Name'];
67
+ user.Email = arr['Email'];
68
+ user.Phone = arr['Phone'];
69
+ user.EduMeetLink = arr['EduMeetLink'];
70
+ user.BitmojiURL = arr['BitmojiURL'];
71
+ user.ModuleAccess = arr['ModuleAccess'];
72
+ user.TeachedLessons = arr['TeachedLessons'];
73
+ if (arr['TeacherProfile'] != undefined | null)
74
+ {
75
+ var profile = new TeacherProfile();
76
+ profile.Bio = arr['TeacherProfile']['Bio'];
77
+ profile.Name = arr['TeacherProfile']['Name'];
78
+ profile.PhotoPath = arr['TeacherProfile']['PhotoPath'];
79
+
80
+ user.TeacherProfile = profile;
81
+ }
82
+
83
+ return user;
84
+ }
85
+ }
86
+
87
87
  export default Authentication;
@@ -0,0 +1,84 @@
1
+ import APIController from "../apiController";
2
+
3
+ class Cart
4
+ {
5
+ static #MODULE = "Cart";
6
+
7
+ static #ADD_ITEM = "AddItem";
8
+ static #GET_ITEMS = "GetItems";
9
+ static #GET_TOTAL_PRICE = "GetTotalPrice";
10
+ static #CLEAR = "Clear";
11
+ static #APPLY_SALE_COUPON = "ApplySaleCoupon";
12
+ static #GET_APPLIED_SALE_COUPONS = "GetAppliedSaleCoupons";
13
+ static #REMOVE_SALE_COUPON = "RemoveSaleCoupon";
14
+ static #GET_SALE_AMMOUNTS = "GetSaleAmounts";
15
+ static #GET_ITEMS_COUNT = "GetItemsCount";
16
+ static #REMOVE_ITEM = "RemoveItem";
17
+
18
+ static async addItem(itemInstanceId)
19
+ {
20
+ await APIController.Post(this.#MODULE, this.#ADD_ITEM, {
21
+ "itemInstanceId": itemInstanceId
22
+ });
23
+ }
24
+
25
+ static async getItems()
26
+ {
27
+ var res = await APIController.Get(this.#MODULE, this.#GET_ITEMS);
28
+ return res;
29
+ }
30
+
31
+ static async getTotalPrice()
32
+ {
33
+ var res = await APIController.Get(this.#MODULE, this.#GET_TOTAL_PRICE);
34
+ return res;
35
+ }
36
+
37
+ static async clear()
38
+ {
39
+ await APIController.Post(this.#MODULE, this.#CLEAR);
40
+ }
41
+
42
+ static async applySaleCoupon(code)
43
+ {
44
+ var res = await APIController.Post(this.#MODULE, this.#APPLY_SALE_COUPON, {
45
+ "code": code
46
+ });
47
+
48
+ return res;
49
+ }
50
+
51
+ static async getAppliedSaleCoupons()
52
+ {
53
+ var res = await APIController.Get(this.#MODULE, this.#GET_APPLIED_SALE_COUPONS);
54
+ return res;
55
+ }
56
+
57
+ static async removeSaleCoupon(code)
58
+ {
59
+ await APIController.Post(this.#MODULE, this.#REMOVE_SALE_COUPON, {
60
+ "code": code
61
+ });
62
+ }
63
+
64
+ static async getSaleAmounts()
65
+ {
66
+ var res = await APIController.Get(this.#MODULE, this.#GET_SALE_AMMOUNTS);
67
+ return res;
68
+ }
69
+
70
+ static async getItemsCount()
71
+ {
72
+ var res = await APIController.Get(this.#MODULE, this.#GET_ITEMS_COUNT);
73
+ return res;
74
+ }
75
+
76
+ static async removeItem(itemInstanceId)
77
+ {
78
+ await APIController.Post(this.#MODULE, this.#REMOVE_ITEM, {
79
+ "itemInstanceId": itemInstanceId
80
+ });
81
+ }
82
+ }
83
+
84
+ export default Cart;
@@ -0,0 +1,51 @@
1
+ class Checkout
2
+ {
3
+ static #MODULE = "Checkout";
4
+
5
+ static #GET_AVAILABLE_STATES = "GetAvailableStates";
6
+ static #PLACE_ORDER = "PlaceOrder";
7
+ static #INITIATE_PURCHASE = "InitiatePurchase";
8
+ static #GET_TRANSACTION_STATUS = "GetTransactionStatus";
9
+ static #UPDATE_PAYMENT_STATUS_EXTERNAL = "UpdatePaymentStatusExternal";
10
+
11
+ static async getAvailableStates()
12
+ {
13
+ var res = await APIController.Get(this.#MODULE, this.#GET_AVAILABLE_STATES);
14
+ return res;
15
+ }
16
+
17
+ static async placeOrder(billingInfo, customerId = null)
18
+ {
19
+ var res = await APIController.Post(this.#MODULE, this.#PLACE_ORDER, {
20
+ "billingInfo": JSON.stringify(billingInfo),
21
+ "customerId": customerId
22
+ });
23
+ return res;
24
+ }
25
+
26
+ static async initiatePurchase(orderId)
27
+ {
28
+ var res = await APIController.Post(this.#MODULE, this.#INITIATE_PURCHASE, {
29
+ "orderId": orderId
30
+ });
31
+ return res;
32
+ }
33
+
34
+ static async getTransactionStatus(comgateId)
35
+ {
36
+ var res = await APIController.Get(this.#MODULE, this.#GET_TRANSACTION_STATUS, {
37
+ "comgateId": comgateId
38
+ });
39
+ return res;
40
+ }
41
+
42
+ static async updatePaymentStatusExternal(status, paymentId)
43
+ {
44
+ await APIController.Post(this.#MODULE, this.#UPDATE_PAYMENT_STATUS_EXTERNAL, {
45
+ "status": status,
46
+ "paymentId": paymentId
47
+ });
48
+ }
49
+ }
50
+
51
+ export default Checkout;
@@ -1,58 +1,58 @@
1
- /*
2
- * Copyright (C) 2025 iTutoring s.r.o.
3
- * All rights reserved.
4
- *
5
- *
6
- */
7
-
8
-
9
- import APIController from "./../apiController";
10
-
11
- class CustomerAuth
12
- {
13
- /**
14
- * Respective module name for this class
15
- */
16
- static #MODULE = "CustomerAuth";
17
-
18
- // All method names
19
- static #SIGN_IN = "SignIn";
20
- static #RESEND_CONFIRMATION_EMAIL = 'ResendConfirmationEmail';
21
- static #REQUEST_PASSWORD_CHANGE = 'RequestPasswordChange';
22
-
23
- static async RequestPasswordChange(email)
24
- {
25
- var result = await APIController.Get(this.#MODULE, this.#REQUEST_PASSWORD_CHANGE, {
26
- 'email': email
27
- });
28
-
29
- return result;
30
- }
31
-
32
- static async ResendConfirmationEmail(email)
33
- {
34
- var result = await APIController.Get(this.#MODULE, this.#RESEND_CONFIRMATION_EMAIL, {
35
- 'email': email
36
- });
37
-
38
- return result;
39
- }
40
-
41
- /**
42
- *
43
- * @param {*} email
44
- * @param {*} pass
45
- * @returns Int (AuthResult)
46
- */
47
- static async SignIn(email, pass)
48
- {
49
- var result = await APIController.Post(this.#MODULE, this.#SIGN_IN, {
50
- 'email': email,
51
- 'pass': pass,
52
- });
53
-
54
- return result;
55
- }
56
- }
57
-
1
+ /*
2
+ * Copyright (C) 2025 iTutoring s.r.o.
3
+ * All rights reserved.
4
+ *
5
+ *
6
+ */
7
+
8
+
9
+ import APIController from "./../apiController";
10
+
11
+ class CustomerAuth
12
+ {
13
+ /**
14
+ * Respective module name for this class
15
+ */
16
+ static #MODULE = "CustomerAuth";
17
+
18
+ // All method names
19
+ static #SIGN_IN = "SignIn";
20
+ static #RESEND_CONFIRMATION_EMAIL = 'ResendConfirmationEmail';
21
+ static #REQUEST_PASSWORD_CHANGE = 'RequestPasswordChange';
22
+
23
+ static async RequestPasswordChange(email)
24
+ {
25
+ var result = await APIController.Get(this.#MODULE, this.#REQUEST_PASSWORD_CHANGE, {
26
+ 'email': email
27
+ });
28
+
29
+ return result;
30
+ }
31
+
32
+ static async ResendConfirmationEmail(email)
33
+ {
34
+ var result = await APIController.Get(this.#MODULE, this.#RESEND_CONFIRMATION_EMAIL, {
35
+ 'email': email
36
+ });
37
+
38
+ return result;
39
+ }
40
+
41
+ /**
42
+ *
43
+ * @param {*} email
44
+ * @param {*} pass
45
+ * @returns Int (AuthResult)
46
+ */
47
+ static async SignIn(email, pass)
48
+ {
49
+ var result = await APIController.Post(this.#MODULE, this.#SIGN_IN, {
50
+ 'email': email,
51
+ 'pass': pass,
52
+ });
53
+
54
+ return result;
55
+ }
56
+ }
57
+
58
58
  export default CustomerAuth;
@@ -1,30 +1,30 @@
1
- /*
2
- * Copyright (C) 2025 iTutoring s.r.o.
3
- * All rights reserved.
4
- *
5
-
6
- *
7
- */
8
-
9
- import APIController from "../apiController";
10
-
11
- class CustomerLessonManager
12
- {
13
- static #MODULE = "CustomerLessonManager";
14
-
15
- static #ADD_LESSONS = "AddLessons";
16
-
17
- static async AddLessons(customerId, count, lessonType, lessonLength)
18
- {
19
- var res = await APIController.Post(this.#MODULE, this.#ADD_LESSONS, {
20
- 'customerId': customerId,
21
- 'count': count,
22
- 'lessonType': lessonType,
23
- 'lessonLength': lessonLength
24
- });
25
-
26
- return res;
27
- }
28
- }
29
-
1
+ /*
2
+ * Copyright (C) 2025 iTutoring s.r.o.
3
+ * All rights reserved.
4
+ *
5
+
6
+ *
7
+ */
8
+
9
+ import APIController from "../apiController";
10
+
11
+ class CustomerLessonManager
12
+ {
13
+ static #MODULE = "CustomerLessonManager";
14
+
15
+ static #ADD_LESSONS = "AddLessons";
16
+
17
+ static async AddLessons(customerId, count, lessonType, lessonLength)
18
+ {
19
+ var res = await APIController.Post(this.#MODULE, this.#ADD_LESSONS, {
20
+ 'customerId': customerId,
21
+ 'count': count,
22
+ 'lessonType': lessonType,
23
+ 'lessonLength': lessonLength
24
+ });
25
+
26
+ return res;
27
+ }
28
+ }
29
+
30
30
  export default CustomerLessonManager;
@@ -1,32 +1,32 @@
1
- /*
2
- * Copyright (C) 2024 iTutoring s.r.o.
3
- * All rights reserved.
4
- *
5
-
6
- *
7
- */
8
-
9
- import APIController from "./../apiController";
10
-
11
- class CustomerPortal
12
- {
13
- /**
14
- * Respective module name for this class
15
- */
16
- static #MODULE = "CustomerPortal";
17
-
18
- // All method names
19
- static #GET_CUSTOMER_INFO = "GetCustomerInfo";
20
-
21
- /**
22
- * Customer must be logged in otherwise this method will return null object.
23
- * @returns Customer (CRM Object)
24
- */
25
- static async GetCustomerInfo()
26
- {
27
- var customer = await APIController.Get(this.#MODULE, this.#GET_CUSTOMER_INFO);
28
- return customer;
29
- }
30
- }
31
-
1
+ /*
2
+ * Copyright (C) 2024 iTutoring s.r.o.
3
+ * All rights reserved.
4
+ *
5
+
6
+ *
7
+ */
8
+
9
+ import APIController from "./../apiController";
10
+
11
+ class CustomerPortal
12
+ {
13
+ /**
14
+ * Respective module name for this class
15
+ */
16
+ static #MODULE = "CustomerPortal";
17
+
18
+ // All method names
19
+ static #GET_CUSTOMER_INFO = "GetCustomerInfo";
20
+
21
+ /**
22
+ * Customer must be logged in otherwise this method will return null object.
23
+ * @returns Customer (CRM Object)
24
+ */
25
+ static async GetCustomerInfo()
26
+ {
27
+ var customer = await APIController.Get(this.#MODULE, this.#GET_CUSTOMER_INFO);
28
+ return customer;
29
+ }
30
+ }
31
+
32
32
  export default CustomerPortal;
package/modules/FAQ.js CHANGED
@@ -1,40 +1,40 @@
1
- /*
2
- * Copyright (C) 2024 iTutoring s.r.o.
3
- * All rights reserved.
4
- *
5
-
6
- *
7
- */
8
-
9
-
10
- import APIController from "../apiController";
11
-
12
- class FAQ
13
- {
14
- static #MODULE = "Faq";
15
-
16
- static #GET_FAQ = "GetFAQ";
17
- static #ASK_QUESTION = "AskQuestion";
18
-
19
- /**
20
- * desc: Get FAQ
21
- * @returns
22
- */
23
- static async GetFAQ()
24
- {
25
- const faq = await APIController.Get(this.#MODULE, this.#GET_FAQ, {}, true);
26
-
27
- return faq;
28
- }
29
-
30
- static async AskQuestion(question)
31
- {
32
- const res = await APIController.Post(this.#MODULE, this.#ASK_QUESTION, {
33
- 'question': question
34
- });
35
-
36
- return res;
37
- }
38
- }
39
-
1
+ /*
2
+ * Copyright (C) 2024 iTutoring s.r.o.
3
+ * All rights reserved.
4
+ *
5
+
6
+ *
7
+ */
8
+
9
+
10
+ import APIController from "../apiController";
11
+
12
+ class FAQ
13
+ {
14
+ static #MODULE = "Faq";
15
+
16
+ static #GET_FAQ = "GetFAQ";
17
+ static #ASK_QUESTION = "AskQuestion";
18
+
19
+ /**
20
+ * desc: Get FAQ
21
+ * @returns
22
+ */
23
+ static async GetFAQ()
24
+ {
25
+ const faq = await APIController.Get(this.#MODULE, this.#GET_FAQ, {}, true);
26
+
27
+ return faq;
28
+ }
29
+
30
+ static async AskQuestion(question)
31
+ {
32
+ const res = await APIController.Post(this.#MODULE, this.#ASK_QUESTION, {
33
+ 'question': question
34
+ });
35
+
36
+ return res;
37
+ }
38
+ }
39
+
40
40
  export default FAQ;