@insignia-education/api-sdk-js 0.9.18 → 0.9.19

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.9.18",
3
+ "version": "0.9.19",
4
4
  "description": "JavaScript SDK for the Insignia Education API",
5
5
  "main": "index.js",
6
6
  "type": "module",
package/src/api/index.js CHANGED
@@ -3,7 +3,12 @@ import Insignia from '../index.js';
3
3
  export default class InsigniaApi extends Insignia {
4
4
  constructor(baseUrl = null) {
5
5
  let url = InsigniaApi._resolve(baseUrl);
6
- if (!/\/api(\/|$)/.test(url)) url += '/api';
7
6
  super(url);
8
7
  }
8
+
9
+ static _resolve(baseUrl) {
10
+ baseUrl = Insignia._resolve(baseUrl);
11
+ baseUrl += !/\/api(\/|$)/.test(baseUrl) ? '/api' : '';
12
+ return baseUrl;
13
+ }
9
14
  }
@@ -29,10 +29,14 @@ import Users from './Users.js';
29
29
  import Zoom from './Zoom.js';
30
30
 
31
31
  export default class InsigniaApiV1 extends InsigniaApi {
32
+
33
+ static _resolve(baseUrl) {
34
+ baseUrl = InsigniaApi._resolve(baseUrl);
35
+ baseUrl += !/\/v1(\/|$)/.test(baseUrl) ? '/v1' : '';
36
+ return baseUrl;
37
+ }
32
38
  constructor(baseUrl = null) {
33
39
  let url = InsigniaApiV1._resolve(baseUrl);
34
- if (!/\/api(\/|$)/.test(url)) url += '/api';
35
- if (!/\/v1(\/|$)/.test(url)) url += '/v1';
36
40
  super(url);
37
41
 
38
42
  this.auth = new Auth(this);