ggez-banking-sdk 0.2.28 → 0.2.29

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.
@@ -26,6 +26,11 @@ declare class AuthClient extends BaseClient {
26
26
  data: import("../../types").TokenData;
27
27
  success: boolean;
28
28
  message: string;
29
+ error: string;
30
+ } | {
31
+ data: import("../../types").NodeTokenData;
32
+ success: boolean;
33
+ message: string;
29
34
  error: any;
30
35
  }>;
31
36
  }
@@ -250,7 +250,7 @@ class UserClient extends BaseClient {
250
250
  installationId: data.installationID,
251
251
  });
252
252
  const config = {
253
- headers: { Authorization: `Bearer ${tokenData.access_token}` },
253
+ headers: { Authorization: `Bearer ${tokenData.data.access_token}` },
254
254
  };
255
255
  const response = await this.userService.createUser(userData, config);
256
256
  return this.responseHelper.GetResponse(response.data);
@@ -268,7 +268,7 @@ class UserClient extends BaseClient {
268
268
  installationId: data.installationID,
269
269
  });
270
270
  const config = {
271
- headers: { Authorization: `Bearer ${tokenData.access_token}` },
271
+ headers: { Authorization: `Bearer ${tokenData.data.access_token}` },
272
272
  };
273
273
  const response = await this.userService.createUser(userData, config);
274
274
  return this.responseHelper.GetResponse(response.data);
@@ -1,11 +1,11 @@
1
1
  import { BaseService } from "./base";
2
- import type { TokenData, IGenerateLimitedTokenData, AuthServiceParameters } from "../../types";
2
+ import type { TokenData, IGenerateLimitedTokenData, AuthServiceParameters, NodeTokenData } from "../../types";
3
3
  declare class AuthService extends BaseService {
4
4
  nodeUrl: string;
5
5
  userId: number;
6
6
  endpoint: string;
7
7
  constructor(data: AuthServiceParameters, errorHandler: (error: any) => void);
8
8
  login(data: string): Promise<import("axios").AxiosResponse<TokenData, any, {}>>;
9
- generateLimitedToken(data: IGenerateLimitedTokenData): Promise<import("axios").AxiosResponse<TokenData, any, {}>>;
9
+ generateLimitedToken(data: IGenerateLimitedTokenData): Promise<import("axios").AxiosResponse<NodeTokenData, any, {}>>;
10
10
  }
11
11
  export { AuthService };
@@ -15,7 +15,7 @@ class AuthService extends BaseService {
15
15
  return this.POST(url, data);
16
16
  }
17
17
  generateLimitedToken(data) {
18
- return this.POST(`${this.nodeUrl}/v1/limited-token`, data);
18
+ return this.POST(`${this.nodeUrl}/token/limited-token`, data);
19
19
  }
20
20
  }
21
21
  export { AuthService };
@@ -20,7 +20,7 @@ class LimitedService extends BaseService {
20
20
  const { data } = await authService.generateLimitedToken({
21
21
  installationId: "",
22
22
  });
23
- const token = data?.access_token;
23
+ const token = data?.data.access_token;
24
24
  if (token) {
25
25
  req.headers.setAuthorization(`Bearer ${token}`);
26
26
  }
@@ -1,4 +1,26 @@
1
1
  import { BaseResult } from "../common";
2
+ type NodeTokenData = BaseResult & {
3
+ data: {
4
+ access_token: string;
5
+ token_type: string;
6
+ expires_in: number;
7
+ cluster_id: string;
8
+ program_id: string;
9
+ user_id: string;
10
+ device_id: string;
11
+ role: string;
12
+ role_type: string;
13
+ user_type: string;
14
+ ip_address: string;
15
+ jwt_token: string;
16
+ installation_id: string;
17
+ device_status: string;
18
+ device_verification_status: string;
19
+ device_encryption_key: string;
20
+ };
21
+ success: boolean;
22
+ error: string;
23
+ };
2
24
  type TokenData = BaseResult & {
3
25
  access_token: string;
4
26
  token_type: string;
@@ -18,4 +40,4 @@ type TokenData = BaseResult & {
18
40
  device_encryption_key: string;
19
41
  error: string;
20
42
  };
21
- export { TokenData };
43
+ export { TokenData, NodeTokenData };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ggez-banking-sdk",
3
- "version": "0.2.28",
3
+ "version": "0.2.29",
4
4
  "description": "A Node.js package to handle GGEZ Banking API endpoints, Simplify the process of managing CRUD operations with this efficient and easy-to-use package.",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",