@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,76 +1,76 @@
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 Payments
13
- {
14
- /**
15
- * Respective module name for this class
16
- */
17
- static #MODULE = "Payments";
18
-
19
- // All method names
20
- static #PURCHASE = "Purchase";
21
- static #VALIDATE_PURCHASE = "ValidatePurchase";
22
- static #GET_AVAILABLE_ITEMS = "GetAvailableItems";
23
-
24
- /**
25
- * @deprecated
26
- * Purchase specific product. After calling you'll be redirected depending on the result to success or cancel (failed) url
27
- * @param {*} product product name as defined in php such as HOUR_LESSON
28
- * @param {*} type payment type (credits, card), use PaymentType enum
29
- * @param {*} successUrl
30
- * @param {*} cancelUrl
31
- * @param {*} successUrlParams additional query string to success url - optional
32
- * @returns if stripe payment; returns stripe page url
33
- */
34
- static async Purchase(product, isSaled, type, successUrl, cancelUrl, successUrlParams = "")
35
- {
36
- var url = await APIController.Post(this.#MODULE, this.#PURCHASE, {
37
- 'product': product,
38
- 'saled': APIController.BoolToInt(isSaled),
39
- 'type': type,
40
- 'successUrl': successUrl,
41
- 'cancelUrl': cancelUrl,
42
- 'successUrlParams': successUrlParams,
43
- });
44
-
45
- return url;
46
- }
47
-
48
- /**
49
- * @deprecated
50
- * Call on success page after purchase to mark the payment as successful.
51
- *
52
- * Will return false if is already marked.
53
- * @param {*} id
54
- * @returns bool
55
- */
56
- static async ValidatePurchase(transactionId)
57
- {
58
- var res = await APIController.Get(this.#MODULE, this.#VALIDATE_PURCHASE, { 'id': transactionId });
59
-
60
- return APIController.IntToBool(res);
61
- }
62
-
63
- // Array of avaialable item names. returned as parsed json.
64
- /**
65
- * @deprecated
66
- * @returns
67
- */
68
- static async GetAvailableItems()
69
- {
70
- var res = await APIController.Get(this.#MODULE, this.#GET_AVAILABLE_ITEMS);
71
-
72
- return JSON.parse(res);
73
- }
74
- }
75
-
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 Payments
13
+ {
14
+ /**
15
+ * Respective module name for this class
16
+ */
17
+ static #MODULE = "Payments";
18
+
19
+ // All method names
20
+ static #PURCHASE = "Purchase";
21
+ static #VALIDATE_PURCHASE = "ValidatePurchase";
22
+ static #GET_AVAILABLE_ITEMS = "GetAvailableItems";
23
+
24
+ /**
25
+ * @deprecated
26
+ * Purchase specific product. After calling you'll be redirected depending on the result to success or cancel (failed) url
27
+ * @param {*} product product name as defined in php such as HOUR_LESSON
28
+ * @param {*} type payment type (credits, card), use PaymentType enum
29
+ * @param {*} successUrl
30
+ * @param {*} cancelUrl
31
+ * @param {*} successUrlParams additional query string to success url - optional
32
+ * @returns if stripe payment; returns stripe page url
33
+ */
34
+ static async Purchase(product, isSaled, type, successUrl, cancelUrl, successUrlParams = "")
35
+ {
36
+ var url = await APIController.Post(this.#MODULE, this.#PURCHASE, {
37
+ 'product': product,
38
+ 'saled': APIController.BoolToInt(isSaled),
39
+ 'type': type,
40
+ 'successUrl': successUrl,
41
+ 'cancelUrl': cancelUrl,
42
+ 'successUrlParams': successUrlParams,
43
+ });
44
+
45
+ return url;
46
+ }
47
+
48
+ /**
49
+ * @deprecated
50
+ * Call on success page after purchase to mark the payment as successful.
51
+ *
52
+ * Will return false if is already marked.
53
+ * @param {*} id
54
+ * @returns bool
55
+ */
56
+ static async ValidatePurchase(transactionId)
57
+ {
58
+ var res = await APIController.Get(this.#MODULE, this.#VALIDATE_PURCHASE, { 'id': transactionId });
59
+
60
+ return APIController.IntToBool(res);
61
+ }
62
+
63
+ // Array of avaialable item names. returned as parsed json.
64
+ /**
65
+ * @deprecated
66
+ * @returns
67
+ */
68
+ static async GetAvailableItems()
69
+ {
70
+ var res = await APIController.Get(this.#MODULE, this.#GET_AVAILABLE_ITEMS);
71
+
72
+ return JSON.parse(res);
73
+ }
74
+ }
75
+
76
76
  export default Payments;
@@ -1,71 +1,71 @@
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 Pricing
13
- {
14
- static #MODULE = 'Pricing';
15
-
16
- static #GET_PRICE_TABLE = 'GetPriceTable';
17
- static #GET_LESSON_PRICE = 'GetLessonPrice';
18
- static #GET_LESSON_PRICE_OFFER = 'GetLessonPriceOffer';
19
-
20
- /**
21
- * desc: Get price table
22
- *
23
- * @returns
24
- */
25
- static async getPriceTable()
26
- {
27
- var priceTable = await APIController.Get(this.#MODULE, this.#GET_PRICE_TABLE, {}, true);
28
-
29
- return priceTable;
30
- }
31
-
32
- /**
33
- * desc: Get lesson price
34
- *
35
- * @param {*} type
36
- * @param {*} len
37
- * @param {*} count
38
- * @returns
39
- */
40
- static async getLessonPrice(type, len, count)
41
- {
42
- var price = await APIController.Get(this.#MODULE, this.#GET_LESSON_PRICE, {
43
- 'type': type,
44
- 'len': len,
45
- 'count': count,
46
- });
47
-
48
- return price;
49
- }
50
-
51
- /**
52
- * desc: Get lesson price offer
53
- *
54
- * @param {*} type
55
- * @param {*} len
56
- * @param {*} count
57
- * @returns
58
- */
59
- static async getLessonPriceOffer(type, len, count)
60
- {
61
- var price = await APIController.Get(this.#MODULE, this.#GET_LESSON_PRICE_OFFER, {
62
- 'type': type,
63
- 'len': len,
64
- 'count': count,
65
- });
66
-
67
- return price;
68
- }
69
- }
70
-
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 Pricing
13
+ {
14
+ static #MODULE = 'Pricing';
15
+
16
+ static #GET_PRICE_TABLE = 'GetPriceTable';
17
+ static #GET_LESSON_PRICE = 'GetLessonPrice';
18
+ static #GET_LESSON_PRICE_OFFER = 'GetLessonPriceOffer';
19
+
20
+ /**
21
+ * desc: Get price table
22
+ *
23
+ * @returns
24
+ */
25
+ static async getPriceTable()
26
+ {
27
+ var priceTable = await APIController.Get(this.#MODULE, this.#GET_PRICE_TABLE, {}, true);
28
+
29
+ return priceTable;
30
+ }
31
+
32
+ /**
33
+ * desc: Get lesson price
34
+ *
35
+ * @param {*} type
36
+ * @param {*} len
37
+ * @param {*} count
38
+ * @returns
39
+ */
40
+ static async getLessonPrice(type, len, count)
41
+ {
42
+ var price = await APIController.Get(this.#MODULE, this.#GET_LESSON_PRICE, {
43
+ 'type': type,
44
+ 'len': len,
45
+ 'count': count,
46
+ });
47
+
48
+ return price;
49
+ }
50
+
51
+ /**
52
+ * desc: Get lesson price offer
53
+ *
54
+ * @param {*} type
55
+ * @param {*} len
56
+ * @param {*} count
57
+ * @returns
58
+ */
59
+ static async getLessonPriceOffer(type, len, count)
60
+ {
61
+ var price = await APIController.Get(this.#MODULE, this.#GET_LESSON_PRICE_OFFER, {
62
+ 'type': type,
63
+ 'len': len,
64
+ 'count': count,
65
+ });
66
+
67
+ return price;
68
+ }
69
+ }
70
+
71
71
  export default Pricing;
@@ -1,160 +1,49 @@
1
- /*
2
- * Copyright (C) 2024 iTutoring s.r.o.
3
- * All rights reserved.
4
- *
5
-
6
- *
7
- */
8
-
9
-
10
- import BillingInfo from "../objects/billingInfo";
11
- import APIController from "./../apiController";
12
-
13
- class ReservationSystem
14
- {
15
- /**
16
- * Respective module name for this class
17
- */
18
- static #MODULE = "ReservationSystem";
19
-
20
- static #SEND_REQUEST = "SendRequest";
21
- static #ADD_ITEM_TO_CART = "AddItemToCart";
22
- static #GET_CART_ITEMS = "GetCartItems";
23
- static #GET_TOTAL_PRICE = "GetTotalPrice";
24
- static #PLACE_ORDER = "PlaceOrder";
25
- static #SEND_ORDER_CONFIRMATION_EMAIL = "SendOrderConfirmationEmail";
26
- static #CLEAR_CART = "ClearCart";
27
- static #APPLY_SALE_COUPON = "ApplySaleCoupon";
28
- static #GET_APPLIED_SALE_COUPONS = "GetAppliedSaleCoupons";
29
- static #REMOVE_SALE_COUPON = "RemoveSaleCoupon";
30
- static #GET_SALE_AMOUNTS = "GetSaleAmounts";
31
- static #GET_CART_ITEMS_COUNT = "GetCartItemsCount";
32
- static #REMOVE_ITEM_FROM_CART = "RemoveItemFromCart";
33
- static #GET_AVAILABLE_STATES = "GetAvailableStates";
34
- static #ORDER_IS_PLACED = "OrderIsPlaced";
35
-
36
- static async orderIsPlaced()
37
- {
38
- var res = await APIController.Get(this.#MODULE, this.#ORDER_IS_PLACED);
39
-
40
- return res;
41
- }
42
-
43
- static async getAvailableStates()
44
- {
45
- var states = await APIController.Get(this.#MODULE, this.#GET_AVAILABLE_STATES, {}, true);
46
- return states;
47
- }
48
-
49
- static async removeItemFromCart(itemSku)
50
- {
51
- await APIController.Post(this.#MODULE, this.#REMOVE_ITEM_FROM_CART, { 'sku': itemSku });
52
- }
53
-
54
- static async getCartItemsCount()
55
- {
56
- var count = await APIController.Get(this.#MODULE, this.#GET_CART_ITEMS_COUNT);
57
- return count;
58
- }
59
-
60
-
61
- static async addItemToCart(itemSku)
62
- {
63
- await APIController.Post(this.#MODULE, this.#ADD_ITEM_TO_CART, { 'itemSku': itemSku });
64
- }
65
-
66
- static async getCartItems()
67
- {
68
- var items = await APIController.Get(this.#MODULE, this.#GET_CART_ITEMS);
69
-
70
- return items;
71
- }
72
-
73
- static async getTotalPrice()
74
- {
75
- var price = await APIController.Get(this.#MODULE, this.#GET_TOTAL_PRICE);
76
-
77
- return price;
78
- }
79
-
80
- /**
81
- *
82
- * @param {BillingInfo} billingInfo - BillingInfo model expected. You can use prepared js object or create just array.
83
- * @param {*} proforma
84
- * @param {*} vopAgree
85
- * @param {*} gdprAgree
86
- * @returns order id
87
- */
88
- static async placeOrder(billingInfo, proforma = 1, vopAgree = 0, gdprAgree = 0)
89
- {
90
- var orderId = await APIController.Post(this.#MODULE, this.#PLACE_ORDER, {
91
- 'billingInfo': JSON.stringify(billingInfo),
92
- 'proforma': proforma,
93
- 'vopAgree': vopAgree,
94
- 'gdprAgree': gdprAgree
95
- });
96
-
97
- return orderId;
98
- }
99
-
100
- static async sendOrderConfirmationEmail()
101
- {
102
- await APIController.Get(this.#MODULE, this.#SEND_ORDER_CONFIRMATION_EMAIL);
103
- }
104
-
105
- static async clearCart()
106
- {
107
- await APIController.Post(this.#MODULE, this.#CLEAR_CART);
108
- }
109
-
110
- static async applySaleCoupon(code)
111
- {
112
- await APIController.Post(this.#MODULE, this.#APPLY_SALE_COUPON, { 'code': code });
113
- }
114
-
115
- static async getAppliedSaleCoupons()
116
- {
117
- var coupons = await APIController.Get(this.#MODULE, this.#GET_APPLIED_SALE_COUPONS);
118
-
119
- return coupons;
120
- }
121
-
122
- static async removeSaleCoupon(code)
123
- {
124
- await APIController.Post(this.#MODULE, this.#REMOVE_SALE_COUPON, { 'code': code });
125
- }
126
-
127
- /**
128
- *
129
- * @returns {Promise<array>} - array - sale amounts as sku=>amount
130
- */
131
- static async getSaleAmounts()
132
- {
133
- var amounts = await APIController.Get(this.#MODULE, this.#GET_SALE_AMOUNTS);
134
-
135
- return amounts;
136
- }
137
-
138
- /**
139
- * Send request for tutoring. Will register as inquiry and it's id will be returned.
140
- * @param {*} name
141
- * @param {*} email
142
- * @param {*} tel
143
- * @param {*} msg
144
- * @param {*} place must be PlaceID !
145
- */
146
- static async SendRequest(fname, lname, email, tel, msg, place)
147
- {
148
- var id = await APIController.Post(this.#MODULE, this.#SEND_REQUEST, {
149
- "fname": fname,
150
- "lname": lname,
151
- "email": email,
152
- "tel": tel,
153
- "msg": msg,
154
- "place": place
155
- })
156
- return id;
157
- }
158
- }
159
-
1
+ /*
2
+ * Copyright (C) 2024 iTutoring s.r.o.
3
+ * All rights reserved.
4
+ *
5
+
6
+ *
7
+ */
8
+
9
+
10
+ import BillingInfo from "../objects/billingInfo";
11
+ import APIController from "./../apiController";
12
+
13
+ /**
14
+ * @deprecated
15
+ */
16
+ class ReservationSystem
17
+ {
18
+ /**
19
+ * Respective module name for this class
20
+ */
21
+ static #MODULE = "ReservationSystem";
22
+
23
+ static #SEND_REQUEST = "SendRequest";
24
+
25
+
26
+
27
+ /**
28
+ * Send request for tutoring. Will register as inquiry and it's id will be returned.
29
+ * @param {*} name
30
+ * @param {*} email
31
+ * @param {*} tel
32
+ * @param {*} msg
33
+ * @param {*} place must be PlaceID !
34
+ */
35
+ static async SendRequest(fname, lname, email, tel, msg, place)
36
+ {
37
+ var id = await APIController.Post(this.#MODULE, this.#SEND_REQUEST, {
38
+ "fname": fname,
39
+ "lname": lname,
40
+ "email": email,
41
+ "tel": tel,
42
+ "msg": msg,
43
+ "place": place
44
+ })
45
+ return id;
46
+ }
47
+ }
48
+
160
49
  export default ReservationSystem;
@@ -1,54 +1,54 @@
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 Reviews
13
- {
14
- static #MODULE = "Reviews";
15
-
16
- static #GET_RANDOM_REVIEW = "GetRandomReview";
17
- static #GET_REVIEWS = "GetReviews";
18
- static #GET_RATING = "GetRating";
19
-
20
- /**
21
- * desc: Get random review
22
- * @returns
23
- */
24
- static async GetRandomReview()
25
- {
26
- const review = await APIController.Get(this.#MODULE, this.#GET_RANDOM_REVIEW, {});
27
-
28
- return review;
29
- }
30
-
31
- /**
32
- * desc: Get reviews
33
- * @returns
34
- */
35
- static async GetReviews()
36
- {
37
- const reviews = await APIController.Get(this.#MODULE, this.#GET_REVIEWS, {}, true);
38
-
39
- return reviews;
40
- }
41
-
42
- /**
43
- * desc: Get rating
44
- * @returns
45
- */
46
- static async GetRating()
47
- {
48
- const rating = await APIController.Get(this.#MODULE, this.#GET_RATING, {}, true);
49
-
50
- return rating;
51
- }
52
- }
53
-
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 Reviews
13
+ {
14
+ static #MODULE = "Reviews";
15
+
16
+ static #GET_RANDOM_REVIEW = "GetRandomReview";
17
+ static #GET_REVIEWS = "GetReviews";
18
+ static #GET_RATING = "GetRating";
19
+
20
+ /**
21
+ * desc: Get random review
22
+ * @returns
23
+ */
24
+ static async GetRandomReview()
25
+ {
26
+ const review = await APIController.Get(this.#MODULE, this.#GET_RANDOM_REVIEW, {});
27
+
28
+ return review;
29
+ }
30
+
31
+ /**
32
+ * desc: Get reviews
33
+ * @returns
34
+ */
35
+ static async GetReviews()
36
+ {
37
+ const reviews = await APIController.Get(this.#MODULE, this.#GET_REVIEWS, {}, true);
38
+
39
+ return reviews;
40
+ }
41
+
42
+ /**
43
+ * desc: Get rating
44
+ * @returns
45
+ */
46
+ static async GetRating()
47
+ {
48
+ const rating = await APIController.Get(this.#MODULE, this.#GET_RATING, {}, true);
49
+
50
+ return rating;
51
+ }
52
+ }
53
+
54
54
  export default Reviews;