@ptkl/sdk 0.2.2 → 0.3.0

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/dist/index.cjs.js CHANGED
@@ -17845,7 +17845,7 @@ const isBrowser = typeof window !== "undefined" &&
17845
17845
  class PlatformBaseClient extends BaseClient {
17846
17846
  constructor(options) {
17847
17847
  var _a, _b;
17848
- let { env = null, token, host, } = options !== null && options !== undefined ? options : {};
17848
+ let { env = null, token = null, host = null, } = options !== null && options !== undefined ? options : {};
17849
17849
  let headers = {};
17850
17850
  if (isBrowser) {
17851
17851
  if (localStorage.getItem('protokol_context') == "forge") {
@@ -17858,6 +17858,8 @@ class PlatformBaseClient extends BaseClient {
17858
17858
  // @ts-ignore
17859
17859
  const __global_env__ = window === null || window === undefined ? undefined : window.__ENV_VARIABLES__;
17860
17860
  host = (_b = __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.API_HOST) !== null && _b !== undefined ? _b : host;
17861
+ //@ts-ignore
17862
+ token = token !== null && token !== undefined ? token : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_API_TOKEN;
17861
17863
  }
17862
17864
  if (token) {
17863
17865
  headers['Authorization'] = `Bearer ${token}`;
package/dist/index.esm.js CHANGED
@@ -35,7 +35,7 @@ const isBrowser = typeof window !== "undefined" &&
35
35
  class PlatformBaseClient extends BaseClient {
36
36
  constructor(options) {
37
37
  var _a, _b;
38
- let { env = null, token, host, } = options !== null && options !== undefined ? options : {};
38
+ let { env = null, token = null, host = null, } = options !== null && options !== undefined ? options : {};
39
39
  let headers = {};
40
40
  if (isBrowser) {
41
41
  if (localStorage.getItem('protokol_context') == "forge") {
@@ -48,6 +48,8 @@ class PlatformBaseClient extends BaseClient {
48
48
  // @ts-ignore
49
49
  const __global_env__ = window === null || window === undefined ? undefined : window.__ENV_VARIABLES__;
50
50
  host = (_b = __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.API_HOST) !== null && _b !== undefined ? _b : host;
51
+ //@ts-ignore
52
+ token = token !== null && token !== undefined ? token : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_API_TOKEN;
51
53
  }
52
54
  if (token) {
53
55
  headers['Authorization'] = `Bearer ${token}`;
package/dist/index.umd.js CHANGED
@@ -39,7 +39,7 @@
39
39
  class PlatformBaseClient extends BaseClient {
40
40
  constructor(options) {
41
41
  var _a, _b;
42
- let { env = null, token, host, } = options !== null && options !== undefined ? options : {};
42
+ let { env = null, token = null, host = null, } = options !== null && options !== undefined ? options : {};
43
43
  let headers = {};
44
44
  if (isBrowser) {
45
45
  if (localStorage.getItem('protokol_context') == "forge") {
@@ -52,6 +52,8 @@
52
52
  // @ts-ignore
53
53
  const __global_env__ = window === null || window === undefined ? undefined : window.__ENV_VARIABLES__;
54
54
  host = (_b = __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.API_HOST) !== null && _b !== undefined ? _b : host;
55
+ //@ts-ignore
56
+ token = token !== null && token !== undefined ? token : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_API_TOKEN;
55
57
  }
56
58
  if (token) {
57
59
  headers['Authorization'] = `Bearer ${token}`;
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ptkl/sdk",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "scripts": {
5
5
  "build": "rollup -c",
6
6
  "docs": "typedoc"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ptkl/sdk",
3
- "version": "0.2.2",
3
+ "version": "0.3.0",
4
4
  "scripts": {
5
5
  "build": "rollup -c",
6
6
  "docs": "typedoc"