@ptkl/sdk 0.4.0 → 0.8.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/dist/index.cjs.js CHANGED
@@ -17855,11 +17855,15 @@ class PlatformBaseClient extends BaseClient {
17855
17855
  // this potentially means that it is running as dev server in local
17856
17856
  headers['X-Project-Env'] = "dev";
17857
17857
  }
17858
+ }
17859
+ if (window) {
17858
17860
  // @ts-ignore
17859
17861
  const __global_env__ = window === null || window === undefined ? undefined : window.__ENV_VARIABLES__;
17860
17862
  host = (_b = __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.API_HOST) !== null && _b !== undefined ? _b : host;
17861
17863
  // @ts-ignore
17862
17864
  token = token !== null && token !== undefined ? token : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_API_TOKEN;
17865
+ // @ts-ignore
17866
+ env = env !== null && env !== undefined ? env : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_ENV;
17863
17867
  }
17864
17868
  if (token) {
17865
17869
  headers['Authorization'] = `Bearer ${token}`;
@@ -17977,6 +17981,9 @@ class Users extends PlatformBaseClient {
17977
17981
  async delete(uuid) {
17978
17982
  return await this.client.delete(`/v1/project/user/${uuid}`);
17979
17983
  }
17984
+ async permissions() {
17985
+ return await this.client.delete(`/v1/user/role/permissions`);
17986
+ }
17980
17987
  }
17981
17988
 
17982
17989
  class Apps extends PlatformBaseClient {
@@ -18412,11 +18419,15 @@ class IntegrationsBaseClient extends BaseClient {
18412
18419
  // this potentially means that it is running as dev server in local
18413
18420
  headers['X-Project-Env'] = "dev";
18414
18421
  }
18422
+ }
18423
+ if (window) {
18415
18424
  // @ts-ignore
18416
18425
  const __global_env__ = window === null || window === undefined ? undefined : window.__ENV_VARIABLES__;
18417
18426
  host = (_b = __global_env__.INTEGRATION_API) !== null && _b !== undefined ? _b : host;
18418
18427
  // @ts-ignore
18419
18428
  token = token !== null && token !== undefined ? token : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_API_TOKEN;
18429
+ // @ts-ignore
18430
+ env = env !== null && env !== undefined ? env : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_ENV;
18420
18431
  }
18421
18432
  if (token) {
18422
18433
  headers['Authorization'] = `Bearer ${token}`;
package/dist/index.esm.js CHANGED
@@ -45,11 +45,15 @@ class PlatformBaseClient extends BaseClient {
45
45
  // this potentially means that it is running as dev server in local
46
46
  headers['X-Project-Env'] = "dev";
47
47
  }
48
+ }
49
+ if (window) {
48
50
  // @ts-ignore
49
51
  const __global_env__ = window === null || window === undefined ? undefined : window.__ENV_VARIABLES__;
50
52
  host = (_b = __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.API_HOST) !== null && _b !== undefined ? _b : host;
51
53
  // @ts-ignore
52
54
  token = token !== null && token !== undefined ? token : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_API_TOKEN;
55
+ // @ts-ignore
56
+ env = env !== null && env !== undefined ? env : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_ENV;
53
57
  }
54
58
  if (token) {
55
59
  headers['Authorization'] = `Bearer ${token}`;
@@ -167,6 +171,9 @@ class Users extends PlatformBaseClient {
167
171
  async delete(uuid) {
168
172
  return await this.client.delete(`/v1/project/user/${uuid}`);
169
173
  }
174
+ async permissions() {
175
+ return await this.client.delete(`/v1/user/role/permissions`);
176
+ }
170
177
  }
171
178
 
172
179
  class Apps extends PlatformBaseClient {
@@ -602,11 +609,15 @@ class IntegrationsBaseClient extends BaseClient {
602
609
  // this potentially means that it is running as dev server in local
603
610
  headers['X-Project-Env'] = "dev";
604
611
  }
612
+ }
613
+ if (window) {
605
614
  // @ts-ignore
606
615
  const __global_env__ = window === null || window === undefined ? undefined : window.__ENV_VARIABLES__;
607
616
  host = (_b = __global_env__.INTEGRATION_API) !== null && _b !== undefined ? _b : host;
608
617
  // @ts-ignore
609
618
  token = token !== null && token !== undefined ? token : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_API_TOKEN;
619
+ // @ts-ignore
620
+ env = env !== null && env !== undefined ? env : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_ENV;
610
621
  }
611
622
  if (token) {
612
623
  headers['Authorization'] = `Bearer ${token}`;
@@ -1,8 +1,5 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('axios')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'axios'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ProtokolSDK = {}, global.axios));
5
- })(this, (function (exports, axios) { 'use strict';
1
+ var ProtokolSDK = (function (exports, axios) {
2
+ 'use strict';
6
3
 
7
4
  class BaseClient {
8
5
  constructor(client) {
@@ -49,11 +46,15 @@
49
46
  // this potentially means that it is running as dev server in local
50
47
  headers['X-Project-Env'] = "dev";
51
48
  }
49
+ }
50
+ if (window) {
52
51
  // @ts-ignore
53
52
  const __global_env__ = window === null || window === undefined ? undefined : window.__ENV_VARIABLES__;
54
53
  host = (_b = __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.API_HOST) !== null && _b !== undefined ? _b : host;
55
54
  // @ts-ignore
56
55
  token = token !== null && token !== undefined ? token : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_API_TOKEN;
56
+ // @ts-ignore
57
+ env = env !== null && env !== undefined ? env : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_ENV;
57
58
  }
58
59
  if (token) {
59
60
  headers['Authorization'] = `Bearer ${token}`;
@@ -171,6 +172,9 @@
171
172
  async delete(uuid) {
172
173
  return await this.client.delete(`/v1/project/user/${uuid}`);
173
174
  }
175
+ async permissions() {
176
+ return await this.client.delete(`/v1/user/role/permissions`);
177
+ }
174
178
  }
175
179
 
176
180
  class Apps extends PlatformBaseClient {
@@ -606,11 +610,15 @@
606
610
  // this potentially means that it is running as dev server in local
607
611
  headers['X-Project-Env'] = "dev";
608
612
  }
613
+ }
614
+ if (window) {
609
615
  // @ts-ignore
610
616
  const __global_env__ = window === null || window === undefined ? undefined : window.__ENV_VARIABLES__;
611
617
  host = (_b = __global_env__.INTEGRATION_API) !== null && _b !== undefined ? _b : host;
612
618
  // @ts-ignore
613
619
  token = token !== null && token !== undefined ? token : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_API_TOKEN;
620
+ // @ts-ignore
621
+ env = env !== null && env !== undefined ? env : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_ENV;
614
622
  }
615
623
  if (token) {
616
624
  headers['Authorization'] = `Bearer ${token}`;
@@ -831,4 +839,6 @@
831
839
 
832
840
  Object.defineProperty(exports, '__esModule', { value: true });
833
841
 
834
- }));
842
+ return exports;
843
+
844
+ })({}, http);
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ptkl/sdk",
3
- "version": "0.3.1",
3
+ "version": "0.8.0",
4
4
  "scripts": {
5
5
  "build": "rollup -c",
6
6
  "docs": "typedoc"
@@ -2,4 +2,5 @@ import PlatformBaseClient from "./platformBaseClient";
2
2
  export default class Users extends PlatformBaseClient {
3
3
  invite(email: string, roles: string[]): Promise<import("axios").AxiosResponse<any, any>>;
4
4
  delete(uuid: string): Promise<import("axios").AxiosResponse<any, any>>;
5
+ permissions(): Promise<import("axios").AxiosResponse<any, any>>;
5
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ptkl/sdk",
3
- "version": "0.4.0",
3
+ "version": "0.8.1",
4
4
  "scripts": {
5
5
  "build": "rollup -c",
6
6
  "docs": "typedoc"