@itutoring/itutoring_application_js_api 1.9.1 → 1.10.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.
package/index.d.ts CHANGED
@@ -29,6 +29,8 @@ import LectorsCalendar from "./modules/LectorsCalendar";
29
29
  import AiAssist from "./modules/AiAssist";
30
30
  import CustomerLessonManager from "./modules/CustomerLessonManager";
31
31
  import WebController from "./modules/WebController";
32
+ import MarketplaceController from "./modules/MarketplaceController";
33
+ import LessonInventory from "./modules/LessonInventory";
32
34
 
33
35
  import Course from "./objects/Course";
34
36
  import CourseReservation from "./objects/CourseReservation";
@@ -85,6 +87,8 @@ export
85
87
  AiAssist,
86
88
  CustomerLessonManager,
87
89
  WebController,
90
+ MarketplaceController,
91
+ LessonInventory,
88
92
 
89
93
  Course,
90
94
  CourseReservation,
package/index.js CHANGED
@@ -26,6 +26,8 @@ import LectorsCalendar from "./modules/LectorsCalendar";
26
26
  import AiAssist from "./modules/AiAssist";
27
27
  import CustomerLessonManager from "./modules/CustomerLessonManager";
28
28
  import WebController from "./modules/WebController";
29
+ import MarketplaceController from "./modules/MarketplaceController";
30
+ import LessonInventory from "./modules/LessonInventory";
29
31
 
30
32
  import Course from "./objects/Course";
31
33
  import CourseReservation from "./objects/CourseReservation";
@@ -83,6 +85,8 @@ export
83
85
  AiAssist,
84
86
  CustomerLessonManager,
85
87
  WebController,
88
+ MarketplaceController,
89
+ LessonInventory,
86
90
 
87
91
  Course,
88
92
  CourseReservation,
@@ -15,6 +15,7 @@ class Inventory
15
15
 
16
16
  static #GET_AVAILABLE_ITEMS = "GetAvailableItems";
17
17
  static #SALE_COUPON_EXISTS = "SaleCouponExists";
18
+ static #SEARCH = "Search";
18
19
 
19
20
  static async saleCouponExists(code)
20
21
  {
@@ -25,13 +26,23 @@ class Inventory
25
26
  return exists;
26
27
  }
27
28
 
28
- static async getAvailableItems(category = "ANY", max = -1, offset = 0, filter = {})
29
+ static async getAvailableItems(category = "ANY", max = -1, offset = 0, filter = {}, startingWithinHours = -1)
29
30
  {
30
31
  var items = await APIController.Get(this.#MODULE, this.#GET_AVAILABLE_ITEMS, {
31
32
  'category': category,
32
33
  'max': max,
33
34
  'offset': offset,
34
35
  'filter': JSON.stringify(filter),
36
+ 'startingWithinHours': startingWithinHours
37
+ });
38
+
39
+ return items;
40
+ }
41
+
42
+ static async search(query)
43
+ {
44
+ var items = await APIController.Get(this.#MODULE, this.#SEARCH, {
45
+ 'query': query
35
46
  });
36
47
 
37
48
  return items;
@@ -0,0 +1,48 @@
1
+ /*
2
+ * Copyright (C) 2025 iTutoring s.r.o.
3
+ * All rights reserved.
4
+ *
5
+ *
6
+ */
7
+
8
+ class LessonInventory
9
+ {
10
+ static #MODULE = "LessonInventory";
11
+
12
+ static #GET_AVAILABLE_SUBJECTS = "GetAvailableSubjects";
13
+ static #GET_SUBJECT = "GetSubject";
14
+ static #GET_SUBJECT_NAME = "GetSubjectName";
15
+ static #SEARCH = "Search";
16
+
17
+ static async getAvailableSubjects()
18
+ {
19
+ var subjects = await APIController.Get(this.#MODULE, this.#GET_AVAILABLE_SUBJECTS);
20
+ return JSON.parse(subjects);
21
+ }
22
+
23
+ static async getSubject(id)
24
+ {
25
+ var subject = await APIController.Get(this.#MODULE, this.#GET_SUBJECT, {
26
+ 'id': id
27
+ });
28
+ return JSON.parse(subject);
29
+ }
30
+
31
+ static async getSubjectName(id)
32
+ {
33
+ var name = await APIController.Get(this.#MODULE, this.#GET_SUBJECT_NAME, {
34
+ 'id': id
35
+ });
36
+ return JSON.parse(name);
37
+ }
38
+
39
+ static async search(query)
40
+ {
41
+ var subjects = await APIController.Get(this.#MODULE, this.#SEARCH, {
42
+ 'query': query
43
+ });
44
+ return JSON.parse(subjects);
45
+ }
46
+ }
47
+
48
+ export default LessonInventory;
@@ -0,0 +1,77 @@
1
+ /*
2
+ * Copyright (C) 2025 iTutoring s.r.o.
3
+ * All rights reserved.
4
+ *
5
+ *
6
+ */
7
+
8
+ import APIController from "../apiController";
9
+
10
+ class MarketplaceController
11
+ {
12
+ static #MODULE = "MarketplaceController";
13
+
14
+ static #GET_HOME_PAGE = "GetHome";
15
+ static #GET_TUTORING_LECTURES = "GetTutoringLectures";
16
+ static #GET_PZK = "GetPzk";
17
+ static #GET_VS_EXAMS = "GetVsExams";
18
+ static #GET_KROUZKY = "GetKrouzky";
19
+ static #SEARCH = "Search";
20
+
21
+ static async getHome()
22
+ {
23
+ var res = await APIController.Get(this.#MODULE, this.#GET_HOME_PAGE);
24
+ return JSON.parse(res);
25
+ }
26
+
27
+ static async getTutoringLectures(category, level, max, offset)
28
+ {
29
+ var res = await APIController.Get(this.#MODULE, this.#GET_TUTORING_LECTURES, {
30
+ 'category': category,
31
+ 'level': level,
32
+ 'max': max,
33
+ 'offset': offset
34
+ });
35
+ return JSON.parse(res);
36
+ }
37
+
38
+ static async getPzk(lessonType, max, offset, obor = null, dayIndex = null, lessonCount = null, subject = null)
39
+ {
40
+ var res = await APIController.Get(this.#MODULE, this.#GET_PZK, {
41
+ 'lessonType': lessonType,
42
+ 'max': max,
43
+ 'offset': offset,
44
+ 'obor': obor,
45
+ 'dayIndex': dayIndex,
46
+ 'lessonCount': lessonCount,
47
+ 'subject': subject
48
+ });
49
+ return JSON.parse(res);
50
+ }
51
+
52
+ static async getVsExams()
53
+ {
54
+ var res = await APIController.Get(this.#MODULE, this.#GET_VS_EXAMS);
55
+ return JSON.parse(res);
56
+ }
57
+
58
+ static async getKrouzky(subcategory = null, dayIndex = null, level = null)
59
+ {
60
+ var res = await APIController.Get(this.#MODULE, this.#GET_KROUZKY, {
61
+ 'subcategory': subcategory,
62
+ 'dayIndex': dayIndex,
63
+ 'level': level
64
+ });
65
+ return JSON.parse(res);
66
+ }
67
+
68
+ static async search(query)
69
+ {
70
+ var res = await APIController.Get(this.#MODULE, this.#SEARCH, {
71
+ 'query': query
72
+ });
73
+ return JSON.parse(res);
74
+ }
75
+ }
76
+
77
+ export default MarketplaceController;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itutoring/itutoring_application_js_api",
3
- "version": "1.9.1",
3
+ "version": "1.10.1",
4
4
  "description": "Javascript API for iTutoring Application",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",