@insignia-education/api-sdk-js 0.15.15 → 0.15.18

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insignia-education/api-sdk-js",
3
- "version": "0.15.15",
3
+ "version": "0.15.18",
4
4
  "description": "JavaScript SDK for the Insignia Education API",
5
5
  "main": "index.js",
6
6
  "type": "module",
package/src/Client.js CHANGED
@@ -22,6 +22,8 @@ export default class InsigniaClient {
22
22
  'Content-Type': 'application/json',
23
23
  };
24
24
 
25
+ if (this.#baseUrl.includes('ngrok')) headers['ngrok-skip-browser-warning'] = 'true';
26
+
25
27
  const cookie = this.#cookieHeader();
26
28
  if (cookie) headers.Cookie = cookie;
27
29
 
@@ -88,6 +90,7 @@ export default class InsigniaClient {
88
90
 
89
91
  async upload(path, formData) {
90
92
  const headers = { 'Accept': 'application/json' };
93
+ if (this.#baseUrl.includes('ngrok')) headers['ngrok-skip-browser-warning'] = 'true';
91
94
  const cookie = this.#cookieHeader();
92
95
  if (cookie) headers.Cookie = cookie;
93
96
  const response = await fetch(`${this.#baseUrl}${path}`, {
@@ -31,6 +31,8 @@ export default class Courses {
31
31
  const base = `/courses/${courseId}/dates`;
32
32
  return {
33
33
  get: (id = null) => id ? this.#client.get(`${base}/${id}`) : this.#client.get(base),
34
+ /** Public dates list with enrollment counts, for the public course page. */
35
+ getPublic: () => this.#client.get(`${base}/public`),
34
36
  create: (data) => this.#client.put(base, data),
35
37
  edit: (id, data) => this.#client.patch(`${base}/${id}`, data),
36
38
  delete: (id) => this.#client.del(`${base}/${id}`),
@@ -54,6 +56,8 @@ export default class Courses {
54
56
  const base = `/courses/${courseId}/premiums`;
55
57
  return {
56
58
  get: (id = null) => id ? client.get(`${base}/${id}`) : client.get(base),
59
+ /** Public premiums list with items, for the public course page. */
60
+ getPublic: () => client.get(`${base}/public`),
57
61
  create: (data) => client.put(base, data),
58
62
  edit: (id, data) => client.patch(`${base}/${id}`, data),
59
63
  delete: (id) => client.del(`${base}/${id}`),