@itutoring/itutoring_application_js_api 1.6.43 → 1.6.45

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/apiController.js CHANGED
@@ -28,6 +28,8 @@ class APIController
28
28
  static LastCall = null;
29
29
  static ConfirmationToken = null;
30
30
 
31
+ static IsTestServer = null;
32
+
31
33
  /**
32
34
  * R_KEY MUST be loaded before calling this method!
33
35
  * @returns Returns appropriate rest url based on current server.
@@ -46,7 +48,12 @@ class APIController
46
48
  }
47
49
  }
48
50
 
49
- static CreateVisitorSession()
51
+ static TestServerCheck()
52
+ {
53
+ return this.IsTestServer;
54
+ }
55
+
56
+ static async CreateVisitorSession()
50
57
  {
51
58
  const id = Date.now();
52
59
  const date = new Date();
@@ -54,6 +61,9 @@ class APIController
54
61
 
55
62
  CookiesManager.SetCookie("session", id, date.toUTCString());
56
63
  this.ReadUserSource();
64
+
65
+ var rKey = await this.GetLocalRKey();
66
+ this.IsTestServer = rKey === R_KEYs.r_key_test || location.hostname === 'localhost';
57
67
  }
58
68
 
59
69
  static GetVisitorSessionID()
package/modules/Models.js CHANGED
@@ -209,10 +209,11 @@ class Models
209
209
  });
210
210
  }
211
211
 
212
- static async setLecture(lecture)
212
+ static async setLecture(lecture, draft = false)
213
213
  {
214
214
  return await APIController.Post(this.#MODULE, this.#SET_LECTURE, {
215
215
  'model': JSON.stringify(lecture),
216
+ 'draft': draft,
216
217
  });
217
218
  }
218
219
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itutoring/itutoring_application_js_api",
3
- "version": "1.6.43",
3
+ "version": "1.6.45",
4
4
  "description": "Javascript API for iTutoring Application",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",