ggez-banking-sdk 0.1.178 → 0.1.179

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.
Files changed (51) hide show
  1. package/dist/api/clients/account.d.ts +4 -4
  2. package/dist/api/clients/account.js +10 -11
  3. package/dist/api/clients/auth.d.ts +4 -4
  4. package/dist/api/clients/auth.js +13 -14
  5. package/dist/api/clients/base.d.ts +8 -0
  6. package/dist/api/clients/base.js +12 -0
  7. package/dist/api/clients/blockchain.d.ts +8 -8
  8. package/dist/api/clients/blockchain.js +14 -15
  9. package/dist/api/clients/ipAddressAndLocation.d.ts +17 -7
  10. package/dist/api/clients/ipAddressAndLocation.js +26 -14
  11. package/dist/api/clients/limited.d.ts +4 -4
  12. package/dist/api/clients/limited.js +21 -22
  13. package/dist/api/clients/order.d.ts +4 -4
  14. package/dist/api/clients/order.js +7 -8
  15. package/dist/api/clients/organization.d.ts +4 -4
  16. package/dist/api/clients/organization.js +13 -14
  17. package/dist/api/clients/promotion.d.ts +4 -4
  18. package/dist/api/clients/promotion.js +11 -12
  19. package/dist/api/clients/transaction.d.ts +4 -4
  20. package/dist/api/clients/transaction.js +10 -10
  21. package/dist/api/clients/user.d.ts +4 -4
  22. package/dist/api/clients/user.js +159 -159
  23. package/dist/api/data/result.js +3 -3
  24. package/dist/api/services/account.d.ts +1 -1
  25. package/dist/api/services/account.js +7 -9
  26. package/dist/api/services/auth.d.ts +1 -1
  27. package/dist/api/services/auth.js +4 -4
  28. package/dist/api/services/base.d.ts +2 -1
  29. package/dist/api/services/base.js +15 -17
  30. package/dist/api/services/blockchain.d.ts +2 -2
  31. package/dist/api/services/blockchain.js +6 -6
  32. package/dist/api/services/ipAddressAndLocation.d.ts +1 -1
  33. package/dist/api/services/ipAddressAndLocation.js +3 -3
  34. package/dist/api/services/limited.d.ts +1 -1
  35. package/dist/api/services/limited.js +13 -13
  36. package/dist/api/services/order.d.ts +2 -2
  37. package/dist/api/services/order.js +4 -4
  38. package/dist/api/services/organization.d.ts +2 -2
  39. package/dist/api/services/organization.js +7 -7
  40. package/dist/api/services/promotion.d.ts +2 -2
  41. package/dist/api/services/promotion.js +5 -5
  42. package/dist/api/services/transaction.d.ts +2 -2
  43. package/dist/api/services/transaction.js +5 -5
  44. package/dist/api/services/user.d.ts +2 -2
  45. package/dist/api/services/user.js +66 -66
  46. package/dist/helper/api/responseHelper.d.ts +6 -4
  47. package/dist/helper/api/responseHelper.js +8 -4
  48. package/dist/tsconfig.tsbuildinfo +1 -1
  49. package/dist/types/api/service/base.d.ts +2 -1
  50. package/dist/types/api/service/index.d.ts +1 -0
  51. package/package.json +1 -1
@@ -1,17 +1,16 @@
1
1
  import { AxiosHelper } from "../../helper";
2
- import { ResponseHelper } from "../../helper";
3
2
  import { FillCreateOrganizationData, FillCreateOrganizationDocumentData, FillOrganizationData, FillUpdateOrganizationData, } from "../data/organization";
4
3
  import { OrganizationService } from "../services";
5
4
  import { FillDocumentData, FillResultByError } from "../data";
6
- class OrganizationClient {
7
- clientData;
5
+ import { BaseClient } from "./base";
6
+ class OrganizationClient extends BaseClient {
8
7
  organizationService;
9
8
  userId;
10
- constructor(clientData) {
11
- this.clientData = clientData;
9
+ constructor(clientData, errorHandler) {
10
+ super(clientData, errorHandler);
12
11
  const { token, baseUrl, userId, lang, installationId } = clientData;
13
12
  const config = AxiosHelper.GetAxiosConfig(token, baseUrl, lang, installationId);
14
- this.organizationService = new OrganizationService({ config, userId });
13
+ this.organizationService = new OrganizationService({ config, userId }, this.errorHandler);
15
14
  this.userId = userId;
16
15
  }
17
16
  // #region "POST"
@@ -19,24 +18,24 @@ class OrganizationClient {
19
18
  try {
20
19
  const organizationData = FillCreateOrganizationData(data, this.userId);
21
20
  const response = await this.organizationService.create(organizationData);
22
- return ResponseHelper.GetResponse(response.data);
21
+ return this.responseHelper.GetResponse(response.data);
23
22
  }
24
23
  catch (error) {
25
24
  const result = FillResultByError(error);
26
25
  const organization = FillOrganizationData("result", result);
27
- return ResponseHelper.GetErrorResponse(organization, "CreateOrganization");
26
+ return this.responseHelper.GetErrorResponse(organization, "CreateOrganization");
28
27
  }
29
28
  };
30
29
  UploadDocument = async (data) => {
31
30
  try {
32
31
  const documentData = FillCreateOrganizationDocumentData(data);
33
32
  const response = await this.organizationService.createDocument(data.id, documentData);
34
- return ResponseHelper.GetResponse(response.data);
33
+ return this.responseHelper.GetResponse(response.data);
35
34
  }
36
35
  catch (error) {
37
36
  const result = FillResultByError(error);
38
37
  const documentData = FillDocumentData("result", result);
39
- return ResponseHelper.GetErrorResponse(documentData, "CreateOrganizationDocument");
38
+ return this.responseHelper.GetErrorResponse(documentData, "CreateOrganizationDocument");
40
39
  }
41
40
  };
42
41
  // #endregion
@@ -45,12 +44,12 @@ class OrganizationClient {
45
44
  try {
46
45
  const organizationData = FillUpdateOrganizationData(data, this.userId);
47
46
  const response = await this.organizationService.update(data.id, organizationData);
48
- return ResponseHelper.GetResponse(response.data);
47
+ return this.responseHelper.GetResponse(response.data);
49
48
  }
50
49
  catch (error) {
51
50
  const result = FillResultByError(error);
52
51
  const organization = FillOrganizationData("result", result);
53
- return ResponseHelper.GetErrorResponse(organization, "UpdateOrganization");
52
+ return this.responseHelper.GetErrorResponse(organization, "UpdateOrganization");
54
53
  }
55
54
  };
56
55
  // #endregion
@@ -58,12 +57,12 @@ class OrganizationClient {
58
57
  DeleteOrganization = async (id) => {
59
58
  try {
60
59
  const response = await this.organizationService.delete(id);
61
- return ResponseHelper.GetResponse(response.data);
60
+ return this.responseHelper.GetResponse(response.data);
62
61
  }
63
62
  catch (error) {
64
63
  const result = FillResultByError(error);
65
64
  const organization = FillOrganizationData("result", result);
66
- return ResponseHelper.GetErrorResponse(organization, "DeleteOrganization");
65
+ return this.responseHelper.GetErrorResponse(organization, "DeleteOrganization");
67
66
  }
68
67
  };
69
68
  }
@@ -1,8 +1,8 @@
1
- import type { BaseResult, GGEZGiftRewards, PromotionClientData } from "../../types";
2
- declare class PromotionClient {
3
- private readonly clientData;
1
+ import type { BaseResult, ErrorHandler, GGEZGiftRewards, PromotionClientData } from "../../types";
2
+ import { BaseClient } from "./base";
3
+ declare class PromotionClient extends BaseClient {
4
4
  private promotionService;
5
- constructor(clientData: PromotionClientData);
5
+ constructor(clientData: PromotionClientData, errorHandler: ErrorHandler);
6
6
  GetPromotionByCode: (code: string) => Promise<{
7
7
  data: BaseResult;
8
8
  success: boolean;
@@ -1,32 +1,31 @@
1
1
  import { AxiosHelper } from "../../helper";
2
- import { ResponseHelper } from "../../helper";
3
2
  import { PromotionService } from "../services";
4
- class PromotionClient {
5
- clientData;
3
+ import { BaseClient } from "./base";
4
+ class PromotionClient extends BaseClient {
6
5
  promotionService;
7
- constructor(clientData) {
8
- this.clientData = clientData;
6
+ constructor(clientData, errorHandler) {
7
+ super(clientData, errorHandler);
9
8
  const { nodeUrl, lang, userId } = this.clientData;
10
9
  const config = AxiosHelper.GetAuthAxiosConfig(nodeUrl, lang, "");
11
- this.promotionService = new PromotionService({ config, userId });
10
+ this.promotionService = new PromotionService({ config, userId }, this.errorHandler);
12
11
  }
13
12
  // #region "GET"
14
13
  GetPromotionByCode = async (code) => {
15
14
  try {
16
15
  const response = await this.promotionService.getPromotionByCode(code);
17
- return ResponseHelper.GetResponse(response.data);
16
+ return this.responseHelper.GetResponse(response.data);
18
17
  }
19
18
  catch (error) {
20
- return ResponseHelper.GetErrorResponse(error, "GetPromotionByCode");
19
+ return this.responseHelper.GetErrorResponse(error, "GetPromotionByCode");
21
20
  }
22
21
  };
23
22
  GetTwitterSpotlightPostIds = async () => {
24
23
  try {
25
24
  const response = await this.promotionService.getTwitterSpotlightPostIds();
26
- return ResponseHelper.GetResponse(response);
25
+ return this.responseHelper.GetResponse(response);
27
26
  }
28
27
  catch (error) {
29
- return ResponseHelper.GetErrorResponse(error, "GetTwitterSpotlightPostIds");
28
+ return this.responseHelper.GetErrorResponse(error, "GetTwitterSpotlightPostIds");
30
29
  }
31
30
  };
32
31
  // #endregion
@@ -34,10 +33,10 @@ class PromotionClient {
34
33
  IncrementPromotionParticipants = async (data) => {
35
34
  try {
36
35
  const response = await this.promotionService.incrementPromotionParticipants(data);
37
- return ResponseHelper.GetResponse(response);
36
+ return this.responseHelper.GetResponse(response);
38
37
  }
39
38
  catch (error) {
40
- return ResponseHelper.GetErrorResponse(error, "IncrementPromotionParticipants");
39
+ return this.responseHelper.GetErrorResponse(error, "IncrementPromotionParticipants");
41
40
  }
42
41
  };
43
42
  }
@@ -1,8 +1,8 @@
1
- import type { ICreateTransactionData, IInquiryTransactionData, TransactionClientData } from "../../types";
2
- declare class TransactionClient {
3
- private readonly clientData;
1
+ import type { ErrorHandler, ICreateTransactionData, IInquiryTransactionData, TransactionClientData } from "../../types";
2
+ import { BaseClient } from "./base";
3
+ declare class TransactionClient extends BaseClient {
4
4
  private transactionService;
5
- constructor(clientData: TransactionClientData);
5
+ constructor(clientData: TransactionClientData, errorHandler: ErrorHandler);
6
6
  InquiryTransaction: (params: IInquiryTransactionData) => Promise<{
7
7
  data: import("../../types").TransactionResultInquiry;
8
8
  success: boolean;
@@ -1,26 +1,26 @@
1
- import { AxiosHelper, ResponseHelper } from "../../helper";
1
+ import { AxiosHelper } from "../../helper";
2
2
  import { FillCreateTransactionData, FillResultByError, FillTransactionData, FillTransactionInquiryData, FillTransactionInquiryResultData, } from "../data";
3
3
  import { TransactionService } from "../services";
4
- class TransactionClient {
5
- clientData;
4
+ import { BaseClient } from "./base";
5
+ class TransactionClient extends BaseClient {
6
6
  transactionService;
7
- constructor(clientData) {
8
- this.clientData = clientData;
7
+ constructor(clientData, errorHandler) {
8
+ super(clientData, errorHandler);
9
9
  const { token, baseUrl, lang, installationId, userId } = clientData;
10
10
  const config = AxiosHelper.GetAxiosConfig(token, baseUrl, lang, installationId);
11
- this.transactionService = new TransactionService({ config, userId });
11
+ this.transactionService = new TransactionService({ config, userId }, this.errorHandler);
12
12
  }
13
13
  // #region "GET"
14
14
  InquiryTransaction = async (params) => {
15
15
  try {
16
16
  const transactionInquiryData = FillTransactionInquiryData(params);
17
17
  const response = await this.transactionService.inquiry(transactionInquiryData);
18
- return ResponseHelper.GetResponse(response.data);
18
+ return this.responseHelper.GetResponse(response.data);
19
19
  }
20
20
  catch (error) {
21
21
  const result = FillResultByError(error);
22
22
  const transactionInquiryResult = FillTransactionInquiryResultData("result", result);
23
- return ResponseHelper.GetErrorResponse(transactionInquiryResult, "InquiryTransaction");
23
+ return this.responseHelper.GetErrorResponse(transactionInquiryResult, "InquiryTransaction");
24
24
  }
25
25
  };
26
26
  // #endregion
@@ -29,12 +29,12 @@ class TransactionClient {
29
29
  try {
30
30
  const transactionData = FillCreateTransactionData(data);
31
31
  const response = await this.transactionService.create(transactionData);
32
- return ResponseHelper.GetResponse(response.data);
32
+ return this.responseHelper.GetResponse(response.data);
33
33
  }
34
34
  catch (error) {
35
35
  const result = FillResultByError(error);
36
36
  const transactionData = FillTransactionData("result", result);
37
- return ResponseHelper.GetErrorResponse(transactionData, "CreateTransaction");
37
+ return this.responseHelper.GetErrorResponse(transactionData, "CreateTransaction");
38
38
  }
39
39
  };
40
40
  }
@@ -1,11 +1,11 @@
1
- import type { IActivateGoogleAuthData, IConfirmDeviceData, IConfirmEmailData, IConfirmPhoneData, ICreateAddressData, ICreateBankAccountData, ICreateDeviceData, ICreateEmailData, ICreateIdentificationData, ICreatePhoneData, ICreateTicketData, ICreateUserData, ICreateUserWithGoogleData, IDeactivateGoogleAuthData, IDeleteAddressData, IDeleteBankAccountData, IDeleteDeviceData, IDeleteEmailData, IDeleteGoogleAuthData, 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";
1
+ import type { ErrorHandler, IActivateGoogleAuthData, IConfirmDeviceData, IConfirmEmailData, IConfirmPhoneData, ICreateAddressData, ICreateBankAccountData, ICreateDeviceData, ICreateEmailData, ICreateIdentificationData, ICreatePhoneData, ICreateTicketData, ICreateUserData, ICreateUserWithGoogleData, IDeactivateGoogleAuthData, IDeleteAddressData, IDeleteBankAccountData, IDeleteDeviceData, IDeleteEmailData, IDeleteGoogleAuthData, 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
- declare class UserClient {
5
- private readonly clientData;
4
+ import { BaseClient } from "./base";
5
+ declare class UserClient extends BaseClient {
6
6
  private userService;
7
7
  private authService;
8
- constructor(clientData: UserClientData);
8
+ constructor(clientData: UserClientData, errorHandler: ErrorHandler);
9
9
  GetUser: (data: IGetUserData) => Promise<{
10
10
  data: UserData;
11
11
  success: boolean;