@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.
- package/.idea/iTutoring_Application_API-js.iml +11 -11
- package/.idea/modules.xml +7 -7
- package/.idea/vcs.xml +5 -5
- package/CookiesManager.js +47 -47
- package/LICENSE +21 -21
- package/README.md +6 -6
- package/apiController.js +436 -436
- package/cache.js +31 -31
- package/index.d.ts +116 -116
- package/index.js +114 -114
- package/modules/AiAssist.js +31 -31
- package/modules/Authentication.js +86 -86
- package/modules/Cart.js +83 -81
- package/modules/Checkout.js +60 -50
- package/modules/CustomerAuth.js +57 -57
- package/modules/CustomerLessonManager.js +29 -29
- package/modules/CustomerPortal.js +31 -31
- package/modules/FAQ.js +39 -39
- package/modules/GoogleReviews.js +36 -36
- package/modules/Inventory.js +51 -51
- package/modules/LectorDatabase.js +185 -185
- package/modules/LectorsCalendar.js +67 -67
- package/modules/LessonInventory.js +47 -47
- package/modules/MarketplaceController.js +86 -86
- package/modules/Models.js +380 -380
- package/modules/Payments.js +75 -75
- package/modules/Pricing.js +70 -70
- package/modules/ReservationSystem.js +48 -48
- package/modules/Reviews.js +53 -53
- package/modules/SubjectManager.js +139 -139
- package/modules/TableExplorer.js +246 -246
- package/modules/TeacherAuth.js +57 -57
- package/modules/TeacherProfileModule.js +299 -299
- package/modules/TeacherProfiles.js +60 -60
- package/modules/Version.js +24 -24
- package/modules/WebController.js +37 -37
- package/objects/AttendanceEvent.js +39 -39
- package/objects/AuthUser.js +24 -24
- package/objects/Course.js +38 -38
- package/objects/CourseReservation.js +22 -22
- package/objects/Customer.js +20 -20
- package/objects/Enums.js +62 -62
- package/objects/Event.js +125 -125
- package/objects/Reservation.js +42 -42
- package/objects/Subject.js +24 -24
- package/objects/Teacher.js +18 -18
- package/objects/TeacherProfile.js +17 -17
- package/objects/Webinar.js +25 -25
- package/objects/billingInfo.js +29 -29
- package/package.json +1 -1
- package/toolkit/Toolkit.jsx +51 -51
package/modules/Payments.js
CHANGED
|
@@ -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;
|
package/modules/Pricing.js
CHANGED
|
@@ -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,49 +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
|
-
/**
|
|
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
|
-
|
|
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
|
+
|
|
49
49
|
export default ReservationSystem;
|
package/modules/Reviews.js
CHANGED
|
@@ -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;
|