@ptkl/sdk 0.9.6 → 0.9.7

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
@@ -19140,6 +19140,14 @@ class Users extends PlatformBaseClient {
19140
19140
  roles,
19141
19141
  });
19142
19142
  }
19143
+ //Gets the current user's claims
19144
+ async getClaims() {
19145
+ return await this.client.get("/v1/user/claims");
19146
+ }
19147
+ //Gets the current user's model
19148
+ async getUser() {
19149
+ return await this.client.get("/v1/user/model");
19150
+ }
19143
19151
  async delete(uuid) {
19144
19152
  return await this.client.delete(`/v1/project/user/${uuid}`);
19145
19153
  }
package/dist/index.esm.js CHANGED
@@ -171,6 +171,14 @@ class Users extends PlatformBaseClient {
171
171
  roles,
172
172
  });
173
173
  }
174
+ //Gets the current user's claims
175
+ async getClaims() {
176
+ return await this.client.get("/v1/user/claims");
177
+ }
178
+ //Gets the current user's model
179
+ async getUser() {
180
+ return await this.client.get("/v1/user/model");
181
+ }
174
182
  async delete(uuid) {
175
183
  return await this.client.delete(`/v1/project/user/${uuid}`);
176
184
  }
@@ -172,6 +172,14 @@ var ProtokolSDK09 = (function (exports, axios) {
172
172
  roles,
173
173
  });
174
174
  }
175
+ //Gets the current user's claims
176
+ async getClaims() {
177
+ return await this.client.get("/v1/user/claims");
178
+ }
179
+ //Gets the current user's model
180
+ async getUser() {
181
+ return await this.client.get("/v1/user/model");
182
+ }
175
183
  async delete(uuid) {
176
184
  return await this.client.delete(`/v1/project/user/${uuid}`);
177
185
  }
@@ -1,7 +1,11 @@
1
1
  import PlatformBaseClient from "./platformBaseClient";
2
+ import { UserClaims, UserModel } from "../types/users";
3
+ import { AxiosResponse } from "axios";
2
4
  export default class Users extends PlatformBaseClient {
3
- invite(email: string, roles: string[]): Promise<import("axios").AxiosResponse<any, any>>;
4
- delete(uuid: string): Promise<import("axios").AxiosResponse<any, any>>;
5
- permissions(): Promise<import("axios").AxiosResponse<any, any>>;
6
- auth(username: string, password: string, project: string): Promise<import("axios").AxiosResponse<any, any>>;
5
+ invite(email: string, roles: string[]): Promise<AxiosResponse<any, any>>;
6
+ getClaims(): Promise<AxiosResponse<UserClaims>>;
7
+ getUser(): Promise<AxiosResponse<UserModel>>;
8
+ delete(uuid: string): Promise<AxiosResponse<any, any>>;
9
+ permissions(): Promise<AxiosResponse<any, any>>;
10
+ auth(username: string, password: string, project: string): Promise<AxiosResponse<any, any>>;
7
11
  }
@@ -21,4 +21,5 @@ export { default as SerbiaUtil } from './api/integrations/serbiaUtil';
21
21
  export { default as VPFR } from './api/integrations/vpfr';
22
22
  export type * from './types/component';
23
23
  export type * from './types/integrations';
24
+ export type * from './types/users';
24
25
  export default Platform;
@@ -0,0 +1,34 @@
1
+ export interface UserModel {
2
+ uuid: string;
3
+ name: string;
4
+ email: string;
5
+ login_at: string;
6
+ credits: number;
7
+ ref: string;
8
+ expires_at: string | null;
9
+ settings: {
10
+ uuid: string;
11
+ CreatedAt: string;
12
+ UpdatedAt: string;
13
+ DeletedAt: string | null;
14
+ user_uuid: string;
15
+ timezone: string;
16
+ two_auth: boolean;
17
+ billing_address: string | null;
18
+ };
19
+ custom_fields: unknown[];
20
+ }
21
+ export interface UserClaims {
22
+ Entity: {
23
+ uuid: string;
24
+ identificator: string;
25
+ name: string;
26
+ };
27
+ Type: string;
28
+ TwoFactor: boolean;
29
+ ProjectUUID: string;
30
+ IsAdmin: boolean;
31
+ Metadata: unknown | null;
32
+ Version: string;
33
+ exp: number;
34
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ptkl/sdk",
3
- "version": "0.9.6",
3
+ "version": "0.9.7",
4
4
  "scripts": {
5
5
  "build": "rollup -c",
6
6
  "docs": "typedoc"