ggez-banking-sdk 0.1.165 → 0.1.166

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.
@@ -1,4 +1,4 @@
1
- import type { IActivateGoogleAuthData, IConfirmDeviceData, IConfirmEmailData, IConfirmPhoneData, ICreateAddressData, ICreateBankAccountData, ICreateDeviceData, ICreateEmailData, ICreateIdentificationData, ICreatePhoneData, ICreateTicketData, ICreateUserData, ICreateUserWithGoogleData, IDeactivateGoogleAuthData, IDeleteAddressData, IDeleteBankAccountData, IDeleteDeviceData, IDeleteEmailData, IDeleteIdentificationData, IDeletePhoneData, ILogoutDeviceData, IMakeAddressPrimaryData, IMakeBankAccountPrimaryData, IMakeEmailPrimaryData, IMakePhonePrimaryData, IResetPasswordData, IResetSecurityCodeData, IResetSecurityQuestionsData, ISendEmailOTPData, ISendPhoneOTPData, IUpdateAddressData, IUpdateBankAccountData, IUpdateDeviceData, IUpdateEmailData, IUpdateIdentificationData, IUpdatePersonalInfoData, IUpdatePhoneData, IUpdatePreferencesData, IUploadDocumentData, IUploadProfilePictureData, IValidateSecurityCodeData, IVerifyDeviceData, IVerifyEmailData, IVerifyPhoneData } from "../../types";
1
+ import type { IActivateGoogleAuthData, IConfirmDeviceData, IConfirmEmailData, IConfirmPhoneData, ICreateAddressData, ICreateBankAccountData, ICreateDeviceData, ICreateEmailData, ICreateIdentificationData, ICreatePhoneData, ICreateTicketData, ICreateUserData, ICreateUserWithGoogleData, IDeactivateGoogleAuthData, IDeleteAddressData, IDeleteBankAccountData, IDeleteDeviceData, IDeleteEmailData, IDeleteIdentificationData, IDeletePhoneData, IGetUserData, ILogoutDeviceData, IMakeAddressPrimaryData, IMakeBankAccountPrimaryData, IMakeEmailPrimaryData, IMakePhonePrimaryData, IResetPasswordData, IResetSecurityCodeData, IResetSecurityQuestionsData, ISendEmailOTPData, ISendPhoneOTPData, IUpdateAddressData, IUpdateBankAccountData, IUpdateDeviceData, IUpdateEmailData, IUpdateIdentificationData, IUpdatePersonalInfoData, IUpdatePhoneData, IUpdatePreferencesData, IUploadDocumentData, IUploadProfilePictureData, IValidateSecurityCodeData, IVerifyDeviceData, IVerifyEmailData, IVerifyPhoneData } from "../../types";
2
2
  import type { UserClientData } from "../../types";
3
3
  import type { ResetUserSecurity, UserData } from "../../types";
4
4
  declare class UserClient {
@@ -6,7 +6,7 @@ declare class UserClient {
6
6
  private userService;
7
7
  private authService;
8
8
  constructor(clientData: UserClientData);
9
- GetUser: (userId: number) => Promise<{
9
+ GetUser: (data: IGetUserData) => Promise<{
10
10
  data: UserData;
11
11
  success: boolean;
12
12
  message: string;
@@ -13,9 +13,17 @@ class UserClient {
13
13
  this.authService = new AuthService(config, nodeUrl);
14
14
  }
15
15
  // #region "GET"
16
- GetUser = async (userId) => {
16
+ GetUser = async (data) => {
17
17
  try {
18
- const response = await this.userService.getUser(userId || this.clientData.userId);
18
+ let response;
19
+ if (data.token && data.id) {
20
+ const config = AxiosHelper.GetAxiosConfig(data.token, this.clientData.baseUrl, this.clientData.lang);
21
+ const userService = new UserService(config);
22
+ response = await userService.getUser(data.id || this.clientData.userId);
23
+ }
24
+ else {
25
+ response = await this.userService.getUser(data.id || this.clientData.userId);
26
+ }
19
27
  return ResponseHelper.GetResponse(response.data);
20
28
  }
21
29
  catch (error) {
@@ -794,8 +802,8 @@ class UserClient {
794
802
  };
795
803
  UpdateDevice = async (data) => {
796
804
  try {
797
- const userData = FillUpdateDeviceData(data);
798
805
  let response;
806
+ const userData = FillUpdateDeviceData(data);
799
807
  if (data.token && data.userId) {
800
808
  const config = AxiosHelper.GetAxiosConfig(data.token, this.clientData.baseUrl, this.clientData.lang);
801
809
  const userService = new UserService(config);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ggez-banking-sdk",
3
- "version": "0.1.165",
3
+ "version": "0.1.166",
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",