ggez-banking-sdk 0.1.105 → 0.1.107

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 (89) hide show
  1. package/dist/api/clients/account.d.ts +8 -8
  2. package/dist/api/clients/account.js +26 -19
  3. package/dist/api/clients/auth.d.ts +22 -17
  4. package/dist/api/clients/auth.js +57 -42
  5. package/dist/api/clients/blockchain.d.ts +16 -16
  6. package/dist/api/clients/blockchain.js +52 -42
  7. package/dist/api/clients/ipAddressAndLocation.js +15 -13
  8. package/dist/api/clients/limited.d.ts +42 -32
  9. package/dist/api/clients/limited.js +100 -82
  10. package/dist/api/clients/order.d.ts +4 -4
  11. package/dist/api/clients/order.js +16 -12
  12. package/dist/api/clients/organization.d.ts +23 -18
  13. package/dist/api/clients/organization.js +57 -45
  14. package/dist/api/clients/promotion.d.ts +28 -13
  15. package/dist/api/clients/promotion.js +32 -30
  16. package/dist/api/clients/transaction.d.ts +9 -9
  17. package/dist/api/clients/transaction.js +30 -24
  18. package/dist/api/clients/user.d.ts +387 -301
  19. package/dist/api/clients/user.js +886 -735
  20. package/dist/api/data/account.d.ts +3 -0
  21. package/dist/api/data/account.js +8 -0
  22. package/dist/api/data/blockchain.d.ts +2 -1
  23. package/dist/api/data/blockchain.js +11 -1
  24. package/dist/api/data/index.d.ts +2 -0
  25. package/dist/api/data/index.js +2 -0
  26. package/dist/api/data/order.d.ts +2 -1
  27. package/dist/api/data/order.js +15 -1
  28. package/dist/api/data/organization.d.ts +2 -1
  29. package/dist/api/data/organization.js +26 -1
  30. package/dist/api/data/result.d.ts +9 -0
  31. package/dist/api/data/result.js +48 -0
  32. package/dist/api/data/transaction.d.ts +4 -2
  33. package/dist/api/data/transaction.js +24 -1
  34. package/dist/api/data/user/confirmUserSecurity.d.ts +3 -0
  35. package/dist/api/data/user/confirmUserSecurity.js +12 -0
  36. package/dist/api/data/user/forgetSecurityData.d.ts +3 -0
  37. package/dist/api/data/user/forgetSecurityData.js +10 -0
  38. package/dist/api/data/user/index.d.ts +8 -8
  39. package/dist/api/data/user/index.js +8 -161
  40. package/dist/api/data/user/user.d.ts +6 -0
  41. package/dist/api/data/user/user.js +159 -0
  42. package/dist/api/data/user/validateLimitedSecurity.d.ts +3 -0
  43. package/dist/api/data/user/validateLimitedSecurity.js +10 -0
  44. package/dist/api/data/user/validateSecurityData.d.ts +3 -0
  45. package/dist/api/data/user/validateSecurityData.js +11 -0
  46. package/dist/api/data/user/verifyUserSecurity.d.ts +3 -0
  47. package/dist/api/data/user/verifyUserSecurity.js +11 -0
  48. package/dist/api/services/account.js +1 -1
  49. package/dist/api/services/auth.js +4 -5
  50. package/dist/api/services/base.d.ts +1 -1
  51. package/dist/api/services/base.js +1 -0
  52. package/dist/api/services/blockchain.js +5 -9
  53. package/dist/api/services/ipAddressAndLocation.js +10 -10
  54. package/dist/api/services/limited.js +2 -1
  55. package/dist/api/services/order.js +2 -3
  56. package/dist/api/services/organization.d.ts +2 -2
  57. package/dist/api/services/organization.js +7 -10
  58. package/dist/api/services/promotion.js +1 -1
  59. package/dist/api/services/transaction.d.ts +2 -2
  60. package/dist/api/services/transaction.js +3 -5
  61. package/dist/api/services/user.js +65 -127
  62. package/dist/constants/structure.d.ts +1 -0
  63. package/dist/constants/structure.js +1 -0
  64. package/dist/helper/api/axiosHelper.js +71 -71
  65. package/dist/helper/api/responseHelper.d.ts +12 -11
  66. package/dist/helper/api/responseHelper.js +24 -25
  67. package/dist/helper/cipherHelper.js +95 -97
  68. package/dist/helper/clientHelper.js +1 -0
  69. package/dist/helper/cookiesHelper.d.ts +5 -0
  70. package/dist/helper/cookiesHelper.js +169 -126
  71. package/dist/helper/deviceHelper.js +31 -31
  72. package/dist/helper/userHelper.d.ts +12 -2
  73. package/dist/helper/userHelper.js +69 -2
  74. package/dist/index.d.ts +1 -1
  75. package/dist/index.js +1 -1
  76. package/dist/tsconfig.tsbuildinfo +1 -1
  77. package/dist/types/banking/common/ResultSet.d.ts +10 -0
  78. package/dist/types/banking/common/ResultSet.js +1 -0
  79. package/dist/types/banking/common/index.d.ts +1 -0
  80. package/dist/types/banking/entities/address.d.ts +1 -0
  81. package/dist/types/banking/oauth/tokenData.d.ts +3 -1
  82. package/dist/types/banking/transaction/index.d.ts +1 -0
  83. package/dist/types/banking/transaction/transactionResultInquiry.d.ts +9 -0
  84. package/dist/types/banking/transaction/transactionResultInquiry.js +1 -0
  85. package/dist/types/helper/index.d.ts +4 -3
  86. package/dist/types/helper/index.js +1 -3
  87. package/dist/types/helper/userHelper.d.ts +17 -0
  88. package/dist/types/helper/userHelper.js +2 -0
  89. package/package.json +2 -2
@@ -1,94 +1,112 @@
1
1
  import { AxiosHelper } from "../../helper";
2
2
  import { ResponseHelper } from "../../helper";
3
- import { FillConfirmEmailData, FillConfirmForgetPasswordData, FillConfirmPhoneData, FillValidateEmailData, FillValidateForgetPasswordData, FillValidatePhoneData, FillVerifyEmailData, FillVerifyPhoneData, } from "../data";
3
+ import { FillConfirmEmailData, FillConfirmForgetPasswordData, FillConfirmPhoneData, FillConfirmUserSecurityData, FillForgetSecurityData, FillResultByError, FillValidateEmailData, FillValidateForgetPasswordData, FillValidateLimitedSecurityData, FillValidatePhoneData, FillVerifyEmailData, FillVerifyPhoneData, } from "../data";
4
4
  import { LimitedService } from "../services";
5
5
  class LimitedClient {
6
+ clientData;
7
+ limitedService;
6
8
  constructor(clientData) {
7
9
  this.clientData = clientData;
8
- // #region "POST"
9
- this.ValidateForgetPassword = async (data) => {
10
- try {
11
- const forgetSecurityData = FillValidateForgetPasswordData(data);
12
- const response = await this.limitedService.validateForgetSecurityData(forgetSecurityData);
13
- return ResponseHelper.GetSuccessResponse(response, {}, "", "validateForgetPassword", "validate");
14
- }
15
- catch (error) {
16
- return ResponseHelper.GetErrorResponse(error);
17
- }
18
- };
19
- this.ConfirmForgetPassword = async (data) => {
20
- try {
21
- const forgetSecurityData = FillConfirmForgetPasswordData(data);
22
- const response = await this.limitedService.confirmForgetSecurityData(forgetSecurityData);
23
- return ResponseHelper.GetSuccessResponse(response, {}, "", "confirmForgetPassword");
24
- }
25
- catch (error) {
26
- return ResponseHelper.GetErrorResponse(error);
27
- }
28
- };
29
- this.ValidateEmail = async (data) => {
30
- try {
31
- const validateLimitedSecurity = FillValidateEmailData(data);
32
- const response = await this.limitedService.validateSecurityData(validateLimitedSecurity);
33
- return ResponseHelper.GetSuccessResponse(response, {}, "email", "validateEmail", "validate");
34
- }
35
- catch (error) {
36
- return ResponseHelper.GetErrorResponse(error);
37
- }
38
- };
39
- this.ValidatePhone = async (data) => {
40
- try {
41
- const validateLimitedSecurity = FillValidatePhoneData(data);
42
- const response = await this.limitedService.validateSecurityData(validateLimitedSecurity);
43
- return ResponseHelper.GetSuccessResponse(response, {}, "phone", "validatePhone", "validate");
44
- }
45
- catch (error) {
46
- return ResponseHelper.GetErrorResponse(error);
47
- }
48
- };
49
- this.VerifyEmail = async (data) => {
50
- try {
51
- const verifyUserSecurity = FillVerifyEmailData(data);
52
- const response = await this.limitedService.verifySecurityData(verifyUserSecurity);
53
- return ResponseHelper.GetSuccessResponse(response, {}, "email", "verifyEmail", "verify");
54
- }
55
- catch (error) {
56
- return ResponseHelper.GetErrorResponse(error);
57
- }
58
- };
59
- this.VerifyPhone = async (data) => {
60
- try {
61
- const verifyUserSecurity = FillVerifyPhoneData(data);
62
- const response = await this.limitedService.verifySecurityData(verifyUserSecurity);
63
- return ResponseHelper.GetSuccessResponse(response, {}, "phone", "verifyPhone", "verify");
64
- }
65
- catch (error) {
66
- return ResponseHelper.GetErrorResponse(error);
67
- }
68
- };
69
- this.ConfirmEmail = async (data) => {
70
- try {
71
- const confirmUserSecurity = FillConfirmEmailData(data);
72
- const response = await this.limitedService.confirmSecurityData(confirmUserSecurity);
73
- return ResponseHelper.GetSuccessResponse(response, {}, "email", "confirmEmail");
74
- }
75
- catch (error) {
76
- return ResponseHelper.GetErrorResponse(error);
77
- }
78
- };
79
- this.ConfirmPhone = async (data) => {
80
- try {
81
- const confirmUserSecurity = FillConfirmPhoneData(data);
82
- const response = await this.limitedService.confirmSecurityData(confirmUserSecurity);
83
- return ResponseHelper.GetSuccessResponse(response, {}, "phone", "confirmPhone");
84
- }
85
- catch (error) {
86
- return ResponseHelper.GetErrorResponse(error);
87
- }
88
- };
89
10
  const { token, baseUrl, nodeUrl, lang } = this.clientData;
90
11
  const config = AxiosHelper.GetAxiosConfig(token, baseUrl, lang);
91
12
  this.limitedService = new LimitedService(config, nodeUrl);
92
13
  }
14
+ // #region "POST"
15
+ ValidateForgetPassword = async (data) => {
16
+ try {
17
+ const forgetSecurityData = FillValidateForgetPasswordData(data);
18
+ const response = await this.limitedService.validateForgetSecurityData(forgetSecurityData);
19
+ return ResponseHelper.GetResponse(response.data);
20
+ }
21
+ catch (error) {
22
+ const result = FillResultByError(error);
23
+ const forgetSecurityData = FillForgetSecurityData("result", result);
24
+ return ResponseHelper.GetErrorResponse(forgetSecurityData, "ValidateForgetPassword");
25
+ }
26
+ };
27
+ ConfirmForgetPassword = async (data) => {
28
+ try {
29
+ const forgetSecurityData = FillConfirmForgetPasswordData(data);
30
+ const response = await this.limitedService.confirmForgetSecurityData(forgetSecurityData);
31
+ return ResponseHelper.GetResponse(response.data);
32
+ }
33
+ catch (error) {
34
+ const result = FillResultByError(error);
35
+ const forgetSecurityData = FillForgetSecurityData("result", result);
36
+ return ResponseHelper.GetErrorResponse(forgetSecurityData, "ConfirmForgetPassword");
37
+ }
38
+ };
39
+ ValidateEmail = async (data) => {
40
+ try {
41
+ const validateLimitedSecurity = FillValidateEmailData(data);
42
+ const response = await this.limitedService.validateSecurityData(validateLimitedSecurity);
43
+ return ResponseHelper.GetResponse(response.data);
44
+ }
45
+ catch (error) {
46
+ const result = FillResultByError(error);
47
+ const forgetSecurityData = FillValidateLimitedSecurityData("result", result);
48
+ return ResponseHelper.GetErrorResponse(forgetSecurityData, "ConfirmForgetPassword");
49
+ }
50
+ };
51
+ ValidatePhone = async (data) => {
52
+ try {
53
+ const validateLimitedSecurity = FillValidatePhoneData(data);
54
+ const response = await this.limitedService.validateSecurityData(validateLimitedSecurity);
55
+ return ResponseHelper.GetResponse(response.data);
56
+ }
57
+ catch (error) {
58
+ const result = FillResultByError(error);
59
+ const forgetSecurityData = FillValidateLimitedSecurityData("result", result);
60
+ return ResponseHelper.GetErrorResponse(forgetSecurityData, "ValidatePhone");
61
+ }
62
+ };
63
+ VerifyEmail = async (data) => {
64
+ try {
65
+ const verifyUserSecurity = FillVerifyEmailData(data);
66
+ const response = await this.limitedService.verifySecurityData(verifyUserSecurity);
67
+ return ResponseHelper.GetResponse(response.data);
68
+ }
69
+ catch (error) {
70
+ const result = FillResultByError(error);
71
+ const verifySecurityData = FillValidateLimitedSecurityData("result", result);
72
+ return ResponseHelper.GetErrorResponse(verifySecurityData, "VerifyEmail");
73
+ }
74
+ };
75
+ VerifyPhone = async (data) => {
76
+ try {
77
+ const verifyUserSecurity = FillVerifyPhoneData(data);
78
+ const response = await this.limitedService.verifySecurityData(verifyUserSecurity);
79
+ return ResponseHelper.GetResponse(response.data);
80
+ }
81
+ catch (error) {
82
+ const result = FillResultByError(error);
83
+ const verifySecurityData = FillValidateLimitedSecurityData("result", result);
84
+ return ResponseHelper.GetErrorResponse(verifySecurityData, "VerifyPhone");
85
+ }
86
+ };
87
+ ConfirmEmail = async (data) => {
88
+ try {
89
+ const confirmUserSecurity = FillConfirmEmailData(data);
90
+ const response = await this.limitedService.confirmSecurityData(confirmUserSecurity);
91
+ return ResponseHelper.GetResponse(response.data);
92
+ }
93
+ catch (error) {
94
+ const result = FillResultByError(error);
95
+ const confirmUserSecurity = FillConfirmUserSecurityData("result", result);
96
+ return ResponseHelper.GetErrorResponse(confirmUserSecurity, "ConfirmEmail");
97
+ }
98
+ };
99
+ ConfirmPhone = async (data) => {
100
+ try {
101
+ const confirmUserSecurity = FillConfirmPhoneData(data);
102
+ const response = await this.limitedService.confirmSecurityData(confirmUserSecurity);
103
+ return ResponseHelper.GetResponse(response.data);
104
+ }
105
+ catch (error) {
106
+ const result = FillResultByError(error);
107
+ const confirmUserSecurity = FillConfirmUserSecurityData("result", result);
108
+ return ResponseHelper.GetErrorResponse(confirmUserSecurity, "ConfirmPhone");
109
+ }
110
+ };
93
111
  }
94
112
  export { LimitedClient };
@@ -4,10 +4,10 @@ declare class OrderClient {
4
4
  private orderService;
5
5
  constructor(clientData: OrderClientData);
6
6
  CreateOrder: (data: ICreateOrderData) => Promise<{
7
- response: any;
8
- status: string;
9
- newUser: any;
10
- message: any;
7
+ data: import("../../types").OrderData;
8
+ success: boolean;
9
+ message: string;
10
+ error: any;
11
11
  }>;
12
12
  }
13
13
  export { OrderClient };
@@ -1,24 +1,28 @@
1
1
  import { AxiosHelper } from "../../helper";
2
2
  import { ResponseHelper } from "../../helper";
3
- import { FillCreateOrderData } from "../data/order";
3
+ import { FillCreateOrderData, FillOrderData, FillResultByError } from "../data";
4
4
  import { OrderService } from "../services";
5
5
  class OrderClient {
6
+ clientData;
7
+ orderService;
6
8
  constructor(clientData) {
7
9
  this.clientData = clientData;
8
- // #region "POST"
9
- this.CreateOrder = async (data) => {
10
- try {
11
- const createOrderData = FillCreateOrderData(data);
12
- const response = await this.orderService.create(createOrderData);
13
- return ResponseHelper.GetSuccessResponse(response, this.clientData.userInfo, "order", "OrderRequest", "OrderRequest");
14
- }
15
- catch (error) {
16
- return ResponseHelper.GetErrorResponse(error);
17
- }
18
- };
19
10
  const { token, baseUrl, lang, installationId } = clientData;
20
11
  const config = AxiosHelper.GetAxiosConfig(token, baseUrl, lang, installationId);
21
12
  this.orderService = new OrderService(config);
22
13
  }
14
+ // #region "POST"
15
+ CreateOrder = async (data) => {
16
+ try {
17
+ const createOrderData = FillCreateOrderData(data);
18
+ const response = await this.orderService.create(createOrderData);
19
+ return ResponseHelper.GetResponse(response.data);
20
+ }
21
+ catch (error) {
22
+ const result = FillResultByError(error);
23
+ const orderData = FillOrderData("result", result);
24
+ return ResponseHelper.GetErrorResponse(orderData, "CreateOrder");
25
+ }
26
+ };
23
27
  }
24
28
  export { OrderClient };
@@ -6,28 +6,33 @@ declare class OrganizationClient {
6
6
  private userId;
7
7
  constructor(clientData: OrganizationClientData);
8
8
  CreateOrganization: (data: ICreateOrganizationData) => Promise<{
9
- response: any;
10
- status: string;
11
- newUser: any;
12
- message: any;
9
+ data: import("../../types").OrganizationData;
10
+ success: boolean;
11
+ message: string;
12
+ error: any;
13
13
  }>;
14
- CreateOrganizationDocument: (id: string, data: ICreateOrganizationDocumentData) => Promise<{
15
- response: any;
16
- status: string;
17
- newUser: any;
18
- message: any;
14
+ CreateOrganizationDocument: (id: number, data: ICreateOrganizationDocumentData) => Promise<{
15
+ data: import("../../types").OrganizationData;
16
+ success: boolean;
17
+ message: string;
18
+ error: string;
19
+ } | {
20
+ data: import("../../types").DocumentData;
21
+ success: boolean;
22
+ message: string;
23
+ error: any;
19
24
  }>;
20
- UpdateOrganization: (id: string, data: IUpdateOrganizationData) => Promise<{
21
- response: any;
22
- status: string;
23
- newUser: any;
24
- message: any;
25
+ UpdateOrganization: (id: number, data: IUpdateOrganizationData) => Promise<{
26
+ data: import("../../types").OrganizationData;
27
+ success: boolean;
28
+ message: string;
29
+ error: any;
25
30
  }>;
26
31
  DeleteOrganization: (id: number) => Promise<{
27
- response: any;
28
- status: string;
29
- newUser: any;
30
- message: any;
32
+ data: import("../../types").OrganizationData;
33
+ success: boolean;
34
+ message: string;
35
+ error: any;
31
36
  }>;
32
37
  }
33
38
  export { OrganizationClient };
@@ -1,58 +1,70 @@
1
1
  import { AxiosHelper } from "../../helper";
2
2
  import { ResponseHelper } from "../../helper";
3
- import { FillCreateOrganizationData, FillCreateOrganizationDocumentData, FillUpdateOrganizationData, } from "../data/organization";
3
+ import { FillCreateOrganizationData, FillCreateOrganizationDocumentData, FillOrganizationData, FillUpdateOrganizationData, } from "../data/organization";
4
4
  import { OrganizationService } from "../services";
5
+ import { FillResultByError } from "../data";
5
6
  class OrganizationClient {
7
+ clientData;
8
+ organizationService;
9
+ userId;
6
10
  constructor(clientData) {
7
11
  this.clientData = clientData;
8
- // #region "POST"
9
- this.CreateOrganization = async (data) => {
10
- try {
11
- const organizationData = FillCreateOrganizationData(data, this.userId);
12
- const response = await this.organizationService.create(organizationData);
13
- return ResponseHelper.GetSuccessResponse(response, this.clientData.userInfo, "organization", "CreateOrganization", "createOrganization");
14
- }
15
- catch (error) {
16
- return ResponseHelper.GetErrorResponse(error);
17
- }
18
- };
19
- this.CreateOrganizationDocument = async (id, data) => {
20
- try {
21
- const documentData = FillCreateOrganizationDocumentData(data);
22
- const response = await this.organizationService.createDocument(id, documentData);
23
- return ResponseHelper.GetSuccessResponse(response, this.clientData.userInfo, "organization", "CreateDocumentOrganization", "createDocumentOrganization");
24
- }
25
- catch (error) {
26
- return ResponseHelper.GetErrorResponse(error);
27
- }
28
- };
29
- // #endregion
30
- // #region "PUT"
31
- this.UpdateOrganization = async (id, data) => {
32
- try {
33
- const organizationData = FillUpdateOrganizationData(data, this.userId);
34
- const response = await this.organizationService.update(id, organizationData);
35
- return ResponseHelper.GetSuccessResponse(response, this.clientData.userInfo, "organization", "UpdateOrganization", "updateOrganization");
36
- }
37
- catch (error) {
38
- return ResponseHelper.GetErrorResponse(error);
39
- }
40
- };
41
- // #endregion
42
- // #region "DELETE"
43
- this.DeleteOrganization = async (id) => {
44
- try {
45
- const response = await this.organizationService.delete(id);
46
- return ResponseHelper.GetSuccessResponse(response, this.clientData.userInfo, "organization", "DeleteOrganization", "deleteOrganization");
47
- }
48
- catch (error) {
49
- return ResponseHelper.GetErrorResponse(error);
50
- }
51
- };
52
12
  const { token, baseUrl, userId, lang, installationId } = clientData;
53
13
  const config = AxiosHelper.GetAxiosConfig(token, baseUrl, lang, installationId);
54
14
  this.organizationService = new OrganizationService(config);
55
15
  this.userId = userId;
56
16
  }
17
+ // #region "POST"
18
+ CreateOrganization = async (data) => {
19
+ try {
20
+ const organizationData = FillCreateOrganizationData(data, this.userId);
21
+ const response = await this.organizationService.create(organizationData);
22
+ return ResponseHelper.GetResponse(response.data);
23
+ }
24
+ catch (error) {
25
+ const result = FillResultByError(error);
26
+ const organization = FillOrganizationData("result", result);
27
+ return ResponseHelper.GetErrorResponse(organization, "CreateOrganization");
28
+ }
29
+ };
30
+ CreateOrganizationDocument = async (id, data) => {
31
+ try {
32
+ const documentData = FillCreateOrganizationDocumentData(data);
33
+ const response = await this.organizationService.createDocument(id, documentData);
34
+ return ResponseHelper.GetResponse(response.data);
35
+ }
36
+ catch (error) {
37
+ const result = FillResultByError(error);
38
+ const organization = FillOrganizationData("result", result);
39
+ return ResponseHelper.GetErrorResponse(organization, "CreateOrganizationDocument");
40
+ }
41
+ };
42
+ // #endregion
43
+ // #region "PUT"
44
+ UpdateOrganization = async (id, data) => {
45
+ try {
46
+ const organizationData = FillUpdateOrganizationData(data, this.userId);
47
+ const response = await this.organizationService.update(id, organizationData);
48
+ return ResponseHelper.GetResponse(response.data);
49
+ }
50
+ catch (error) {
51
+ const result = FillResultByError(error);
52
+ const organization = FillOrganizationData("result", result);
53
+ return ResponseHelper.GetErrorResponse(organization, "UpdateOrganization");
54
+ }
55
+ };
56
+ // #endregion
57
+ // #region "DELETE"
58
+ DeleteOrganization = async (id) => {
59
+ try {
60
+ const response = await this.organizationService.delete(id);
61
+ return ResponseHelper.GetResponse(response.data);
62
+ }
63
+ catch (error) {
64
+ const result = FillResultByError(error);
65
+ const organization = FillOrganizationData("result", result);
66
+ return ResponseHelper.GetErrorResponse(organization, "DeleteOrganization");
67
+ }
68
+ };
57
69
  }
58
70
  export { OrganizationClient };
@@ -1,25 +1,40 @@
1
- import type { GGEZGiftRewards, PromotionClientData } from "../../types";
1
+ import type { BaseResult, GGEZGiftRewards, PromotionClientData } from "../../types";
2
2
  declare class PromotionClient {
3
3
  private readonly clientData;
4
4
  private promotionService;
5
5
  constructor(clientData: PromotionClientData);
6
6
  GetPromotionByCode: (code: string) => Promise<{
7
- response: any;
8
- status: string;
9
- newUser: any;
10
- message: any;
7
+ data: BaseResult;
8
+ success: boolean;
9
+ message: string;
10
+ error: any;
11
+ } | {
12
+ data: any;
13
+ success: boolean;
14
+ message: string;
15
+ error: string;
11
16
  }>;
12
17
  GetTwitterSpotlightPostIds: () => Promise<{
13
- response: any;
14
- status: string;
15
- newUser: any;
16
- message: any;
18
+ data: BaseResult;
19
+ success: boolean;
20
+ message: string;
21
+ error: any;
22
+ } | {
23
+ data: any;
24
+ success: boolean;
25
+ message: string;
26
+ error: string;
17
27
  }>;
18
28
  IncrementPromotionParticipants: (data: GGEZGiftRewards) => Promise<{
19
- response: any;
20
- status: string;
21
- newUser: any;
22
- message: any;
29
+ data: BaseResult;
30
+ success: boolean;
31
+ message: string;
32
+ error: any;
33
+ } | {
34
+ data: any;
35
+ success: boolean;
36
+ message: string;
37
+ error: string;
23
38
  }>;
24
39
  }
25
40
  export { PromotionClient };
@@ -2,41 +2,43 @@ import { AxiosHelper } from "../../helper";
2
2
  import { ResponseHelper } from "../../helper";
3
3
  import { PromotionService } from "../services";
4
4
  class PromotionClient {
5
+ clientData;
6
+ promotionService;
5
7
  constructor(clientData) {
6
8
  this.clientData = clientData;
7
- // #region "GET"
8
- this.GetPromotionByCode = async (code) => {
9
- try {
10
- const response = await this.promotionService.getPromotionByCode(code);
11
- return ResponseHelper.GetSuccessResponse(response, {}, "", "getPromotionByCode");
12
- }
13
- catch (error) {
14
- return ResponseHelper.GetErrorResponse(error);
15
- }
16
- };
17
- this.GetTwitterSpotlightPostIds = async () => {
18
- try {
19
- const response = await this.promotionService.getTwitterSpotlightPostIds();
20
- return ResponseHelper.GetSuccessResponse(response, {}, "", "getTwitterSpotlightPostIds");
21
- }
22
- catch (error) {
23
- return ResponseHelper.GetErrorResponse(error);
24
- }
25
- };
26
- // #endregion
27
- // #region "PUT"
28
- this.IncrementPromotionParticipants = async (data) => {
29
- try {
30
- const response = await this.promotionService.incrementPromotionParticipants(data);
31
- return ResponseHelper.GetSuccessResponse(response, {}, "security", "loginGoogleCredentials");
32
- }
33
- catch (error) {
34
- return ResponseHelper.GetErrorResponse(error);
35
- }
36
- };
37
9
  const { nodeUrl, lang } = this.clientData;
38
10
  const config = AxiosHelper.GetAuthAxiosConfig(nodeUrl, lang, "");
39
11
  this.promotionService = new PromotionService(config);
40
12
  }
13
+ // #region "GET"
14
+ GetPromotionByCode = async (code) => {
15
+ try {
16
+ const response = await this.promotionService.getPromotionByCode(code);
17
+ return ResponseHelper.GetResponse(response.data);
18
+ }
19
+ catch (error) {
20
+ return ResponseHelper.GetErrorResponse(error, "GetPromotionByCode");
21
+ }
22
+ };
23
+ GetTwitterSpotlightPostIds = async () => {
24
+ try {
25
+ const response = await this.promotionService.getTwitterSpotlightPostIds();
26
+ return ResponseHelper.GetResponse(response);
27
+ }
28
+ catch (error) {
29
+ return ResponseHelper.GetErrorResponse(error, "GetTwitterSpotlightPostIds");
30
+ }
31
+ };
32
+ // #endregion
33
+ // #region "PUT"
34
+ IncrementPromotionParticipants = async (data) => {
35
+ try {
36
+ const response = await this.promotionService.incrementPromotionParticipants(data);
37
+ return ResponseHelper.GetResponse(response);
38
+ }
39
+ catch (error) {
40
+ return ResponseHelper.GetErrorResponse(error, "IncrementPromotionParticipants");
41
+ }
42
+ };
41
43
  }
42
44
  export { PromotionClient };
@@ -3,17 +3,17 @@ declare class TransactionClient {
3
3
  private readonly clientData;
4
4
  private transactionService;
5
5
  constructor(clientData: TransactionClientData);
6
- InquiryTransaction: (params: IInquiryTransactionData) => Promise<{
7
- response: any;
8
- status: string;
9
- newUser: any;
10
- message: any;
6
+ InquiryTransaction: (params: IInquiryTransactionData) => Promise<import("../../types").TransactionResultInquiry | {
7
+ data: import("../../types").TransactionResultInquiry;
8
+ success: boolean;
9
+ message: string;
10
+ error: string;
11
11
  }>;
12
12
  CreateTransaction: (data: ICreateTransactionData) => Promise<{
13
- response: any;
14
- status: string;
15
- newUser: any;
16
- message: any;
13
+ data: import("../../types").TransactionData;
14
+ success: boolean;
15
+ message: string;
16
+ error: any;
17
17
  }>;
18
18
  }
19
19
  export { TransactionClient };
@@ -1,35 +1,41 @@
1
1
  import { AxiosHelper, ResponseHelper } from "../../helper";
2
- import { FillCreateTransactionData, FillTransactionInquiryData } from "../data";
2
+ import { FillCreateTransactionData, FillResultByError, FillTransactionData, FillTransactionInquiryData, FillTransactionInquiryResultData, } from "../data";
3
3
  import { TransactionService } from "../services";
4
4
  class TransactionClient {
5
+ clientData;
6
+ transactionService;
5
7
  constructor(clientData) {
6
8
  this.clientData = clientData;
7
- // #region "GET"
8
- this.InquiryTransaction = async (params) => {
9
- try {
10
- const transactionInquiryData = FillTransactionInquiryData(params);
11
- const response = await this.transactionService.inquiry(transactionInquiryData);
12
- return ResponseHelper.GetSuccessResponse(response, this.clientData.userInfo, "account", "getTransactionInquiry", "get");
13
- }
14
- catch (error) {
15
- return ResponseHelper.GetErrorResponse(error);
16
- }
17
- };
18
- // #endregion
19
- // #region "POST"
20
- this.CreateTransaction = async (data) => {
21
- try {
22
- const transactionData = FillCreateTransactionData(data);
23
- const response = await this.transactionService.create(transactionData);
24
- return ResponseHelper.GetSuccessResponse(response, this.clientData.userInfo, "account", "doTransaction", "post");
25
- }
26
- catch (error) {
27
- return ResponseHelper.GetErrorResponse(error);
28
- }
29
- };
30
9
  const { token, baseUrl, lang, installationId } = clientData;
31
10
  const config = AxiosHelper.GetAxiosConfig(token, baseUrl, lang, installationId);
32
11
  this.transactionService = new TransactionService(config);
33
12
  }
13
+ // #region "GET"
14
+ InquiryTransaction = async (params) => {
15
+ try {
16
+ const transactionInquiryData = FillTransactionInquiryData(params);
17
+ const response = await this.transactionService.inquiry(transactionInquiryData);
18
+ return response.data;
19
+ }
20
+ catch (error) {
21
+ const result = FillResultByError(error);
22
+ const transactionInquiryResult = FillTransactionInquiryResultData("result", result);
23
+ return ResponseHelper.GetErrorResponse(transactionInquiryResult, "InquiryTransaction");
24
+ }
25
+ };
26
+ // #endregion
27
+ // #region "POST"
28
+ CreateTransaction = async (data) => {
29
+ try {
30
+ const transactionData = FillCreateTransactionData(data);
31
+ const response = await this.transactionService.create(transactionData);
32
+ return ResponseHelper.GetResponse(response.data);
33
+ }
34
+ catch (error) {
35
+ const result = FillResultByError(error);
36
+ const transactionData = FillTransactionData("result", result);
37
+ return ResponseHelper.GetErrorResponse(transactionData, "CreateTransaction");
38
+ }
39
+ };
34
40
  }
35
41
  export { TransactionClient };