ggez-banking-sdk 0.1.178 → 0.1.180
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/api/clients/account.d.ts +4 -4
- package/dist/api/clients/account.js +10 -11
- package/dist/api/clients/auth.d.ts +4 -4
- package/dist/api/clients/auth.js +13 -14
- package/dist/api/clients/base.d.ts +8 -0
- package/dist/api/clients/base.js +12 -0
- package/dist/api/clients/blockchain.d.ts +8 -8
- package/dist/api/clients/blockchain.js +14 -15
- package/dist/api/clients/ipAddressAndLocation.d.ts +17 -7
- package/dist/api/clients/ipAddressAndLocation.js +26 -14
- package/dist/api/clients/limited.d.ts +4 -4
- package/dist/api/clients/limited.js +21 -22
- package/dist/api/clients/order.d.ts +4 -4
- package/dist/api/clients/order.js +7 -8
- package/dist/api/clients/organization.d.ts +4 -4
- package/dist/api/clients/organization.js +13 -14
- package/dist/api/clients/promotion.d.ts +4 -4
- package/dist/api/clients/promotion.js +11 -12
- package/dist/api/clients/transaction.d.ts +4 -4
- package/dist/api/clients/transaction.js +10 -10
- package/dist/api/clients/user.d.ts +4 -4
- package/dist/api/clients/user.js +159 -159
- package/dist/api/data/result.js +3 -3
- package/dist/api/services/account.d.ts +1 -1
- package/dist/api/services/account.js +7 -9
- package/dist/api/services/auth.d.ts +1 -1
- package/dist/api/services/auth.js +4 -4
- package/dist/api/services/base.d.ts +2 -1
- package/dist/api/services/base.js +15 -17
- package/dist/api/services/blockchain.d.ts +2 -2
- package/dist/api/services/blockchain.js +6 -6
- package/dist/api/services/ipAddressAndLocation.d.ts +1 -1
- package/dist/api/services/ipAddressAndLocation.js +3 -3
- package/dist/api/services/limited.d.ts +1 -1
- package/dist/api/services/limited.js +13 -13
- package/dist/api/services/order.d.ts +2 -2
- package/dist/api/services/order.js +4 -4
- package/dist/api/services/organization.d.ts +2 -2
- package/dist/api/services/organization.js +7 -7
- package/dist/api/services/promotion.d.ts +2 -2
- package/dist/api/services/promotion.js +5 -5
- package/dist/api/services/transaction.d.ts +2 -2
- package/dist/api/services/transaction.js +5 -5
- package/dist/api/services/user.d.ts +2 -2
- package/dist/api/services/user.js +66 -66
- package/dist/helper/api/responseHelper.d.ts +6 -4
- package/dist/helper/api/responseHelper.js +8 -4
- package/dist/helper/storage/localStorageHelper.d.ts +1 -0
- package/dist/helper/storage/localStorageHelper.js +5 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/api/service/base.d.ts +2 -1
- package/dist/types/api/service/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/api/clients/user.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { AxiosHelper
|
|
1
|
+
import { AxiosHelper } from "../../helper";
|
|
2
2
|
import { FillActivateGoogleAuthData, FillConfirmDeviceData, FillConfirmEmailData, FillConfirmPhoneData, FillConfirmUserSecurityData, FillCreateAddressData, FillCreateBankAccountData, FillCreateDeviceData, FillCreateEmailData, FillCreateIdentificationData, FillCreatePhoneData, FillCreateTicketData, FillCreateUserData, FillCreateUserWithGoogleData, FillDeactivateGoogleAuthData, FillDeleteAddressData, FillDeleteBankAccountData, FillDeleteDeviceData, FillDeleteEmailData, FillDeleteGoogleAuthData, FillDeleteIdentificationData, FillDeletePhoneData, FillDocumentData, FillEnrollGoogleAuthData, FillLogoutDeviceData, FillMakeAddressPrimaryData, FillMakeBankAccountPrimaryData, FillMakeEmailPrimaryData, FillMakePhonePrimaryData, FillResetPasswordData, FillResetSecurityCodeData, FillResetSecurityQuestionsData, FillResetUserSecurityData, FillResultByError, FillSendEmailOTPData, FillSendPhoneOTPData, FillUpdateAddressData, FillUpdateBankAccountData, FillUpdateDeviceData, FillUpdateEmailData, FillUpdateIdentificationData, FillUpdatePersonalInfoData, FillUpdatePhoneData, FillUpdatePreferencesData, FillUploadDocumentData, FillUploadProfilePictureData, FillUserData, FillValidateSecurityCodeData, FillValidateSecurityData, FillVerifyDeviceData, FillVerifyEmailData, FillVerifyPhoneData, FillVerifyUserSecurityData, } from "../data";
|
|
3
3
|
import { AuthService, UserService } from "../services";
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
import { BaseClient } from "./base";
|
|
5
|
+
class UserClient extends BaseClient {
|
|
6
6
|
userService;
|
|
7
7
|
authService;
|
|
8
|
-
constructor(clientData) {
|
|
9
|
-
|
|
8
|
+
constructor(clientData, errorHandler) {
|
|
9
|
+
super(clientData, errorHandler);
|
|
10
10
|
const { token, baseUrl, nodeUrl, lang, userId } = this.clientData;
|
|
11
11
|
const config = AxiosHelper.GetAxiosConfig(token, baseUrl, lang);
|
|
12
|
-
this.userService = new UserService({ config, userId });
|
|
13
|
-
this.authService = new AuthService({ config, nodeUrl, userId });
|
|
12
|
+
this.userService = new UserService({ config, userId }, this.errorHandler);
|
|
13
|
+
this.authService = new AuthService({ config, nodeUrl, userId }, this.errorHandler);
|
|
14
14
|
}
|
|
15
15
|
// #region "GET"
|
|
16
16
|
GetUser = async (data) => {
|
|
@@ -18,227 +18,227 @@ class UserClient {
|
|
|
18
18
|
let response;
|
|
19
19
|
if (data.token && data.id) {
|
|
20
20
|
const config = AxiosHelper.GetAxiosConfig(data.token, this.clientData.baseUrl, this.clientData.lang);
|
|
21
|
-
const userService = new UserService({ config, userId: data.id });
|
|
21
|
+
const userService = new UserService({ config, userId: data.id }, this.errorHandler);
|
|
22
22
|
response = await userService.getUser(data.id || this.clientData.userId);
|
|
23
23
|
}
|
|
24
24
|
else {
|
|
25
25
|
response = await this.userService.getUser(data.id || this.clientData.userId);
|
|
26
26
|
}
|
|
27
|
-
return
|
|
27
|
+
return this.responseHelper.GetResponse(response.data);
|
|
28
28
|
}
|
|
29
29
|
catch (error) {
|
|
30
30
|
const result = FillResultByError(error);
|
|
31
31
|
const userData = FillUserData("result", result);
|
|
32
|
-
return
|
|
32
|
+
return this.responseHelper.GetErrorResponse(userData, "GetUser");
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
GetTermsAndConditions = async () => {
|
|
36
36
|
try {
|
|
37
37
|
const response = await this.userService.getTermsAndConditions(this.clientData.userId);
|
|
38
|
-
return
|
|
38
|
+
return this.responseHelper.GetResponse(response.data);
|
|
39
39
|
}
|
|
40
40
|
catch (error) {
|
|
41
41
|
const result = FillResultByError(error);
|
|
42
42
|
const userData = FillUserData("result", result);
|
|
43
|
-
return
|
|
43
|
+
return this.responseHelper.GetErrorResponse(userData, "GetTermsAndConditions");
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
46
|
GetSecurity = async () => {
|
|
47
47
|
try {
|
|
48
48
|
const response = await this.userService.getSecurity(this.clientData.userId);
|
|
49
|
-
return
|
|
49
|
+
return this.responseHelper.GetResponse(response.data);
|
|
50
50
|
}
|
|
51
51
|
catch (error) {
|
|
52
52
|
const result = FillResultByError(error);
|
|
53
53
|
const userData = FillUserData("result", result);
|
|
54
|
-
return
|
|
54
|
+
return this.responseHelper.GetErrorResponse(userData, "GetSecurity");
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
57
|
GetPhone = async () => {
|
|
58
58
|
try {
|
|
59
59
|
const response = await this.userService.getPhone(this.clientData.userId);
|
|
60
|
-
return
|
|
60
|
+
return this.responseHelper.GetResponse(response.data);
|
|
61
61
|
}
|
|
62
62
|
catch (error) {
|
|
63
63
|
const result = FillResultByError(error);
|
|
64
64
|
const userData = FillUserData("result", result);
|
|
65
|
-
return
|
|
65
|
+
return this.responseHelper.GetErrorResponse(userData, "GetPhone");
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
68
|
GetPreferences = async () => {
|
|
69
69
|
try {
|
|
70
70
|
const response = await this.userService.getPreferences(this.clientData.userId);
|
|
71
|
-
return
|
|
71
|
+
return this.responseHelper.GetResponse(response.data);
|
|
72
72
|
}
|
|
73
73
|
catch (error) {
|
|
74
74
|
const result = FillResultByError(error);
|
|
75
75
|
const userData = FillUserData("result", result);
|
|
76
|
-
return
|
|
76
|
+
return this.responseHelper.GetErrorResponse(userData, "GetPreferences");
|
|
77
77
|
}
|
|
78
78
|
};
|
|
79
79
|
GetPersonalInfo = async () => {
|
|
80
80
|
try {
|
|
81
81
|
const response = await this.userService.getPersonalInfo(this.clientData.userId);
|
|
82
|
-
return
|
|
82
|
+
return this.responseHelper.GetResponse(response.data);
|
|
83
83
|
}
|
|
84
84
|
catch (error) {
|
|
85
85
|
const result = FillResultByError(error);
|
|
86
86
|
const userData = FillUserData("result", result);
|
|
87
|
-
return
|
|
87
|
+
return this.responseHelper.GetErrorResponse(userData, "GetPersonalInfo");
|
|
88
88
|
}
|
|
89
89
|
};
|
|
90
90
|
GetLatestHistory = async () => {
|
|
91
91
|
try {
|
|
92
92
|
const response = await this.userService.getLatestHistory(this.clientData.userId);
|
|
93
|
-
return
|
|
93
|
+
return this.responseHelper.GetResponse(response.data);
|
|
94
94
|
}
|
|
95
95
|
catch (error) {
|
|
96
96
|
const result = FillResultByError(error);
|
|
97
97
|
const userData = FillUserData("result", result);
|
|
98
|
-
return
|
|
98
|
+
return this.responseHelper.GetErrorResponse(userData, "GetLatestHistory");
|
|
99
99
|
}
|
|
100
100
|
};
|
|
101
101
|
GetIdentification = async () => {
|
|
102
102
|
try {
|
|
103
103
|
const response = await this.userService.getIdentification(this.clientData.userId);
|
|
104
|
-
return
|
|
104
|
+
return this.responseHelper.GetResponse(response.data);
|
|
105
105
|
}
|
|
106
106
|
catch (error) {
|
|
107
107
|
const result = FillResultByError(error);
|
|
108
108
|
const userData = FillUserData("result", result);
|
|
109
|
-
return
|
|
109
|
+
return this.responseHelper.GetErrorResponse(userData, "GetIdentification");
|
|
110
110
|
}
|
|
111
111
|
};
|
|
112
112
|
GetHistory = async () => {
|
|
113
113
|
try {
|
|
114
114
|
const response = await this.userService.getHistory(this.clientData.userId);
|
|
115
|
-
return
|
|
115
|
+
return this.responseHelper.GetResponse(response.data);
|
|
116
116
|
}
|
|
117
117
|
catch (error) {
|
|
118
118
|
const result = FillResultByError(error);
|
|
119
119
|
const userData = FillUserData("result", result);
|
|
120
|
-
return
|
|
120
|
+
return this.responseHelper.GetErrorResponse(userData, "GetHistory");
|
|
121
121
|
}
|
|
122
122
|
};
|
|
123
123
|
GetGroup = async () => {
|
|
124
124
|
try {
|
|
125
125
|
const response = await this.userService.getGroup(this.clientData.userId);
|
|
126
|
-
return
|
|
126
|
+
return this.responseHelper.GetResponse(response.data);
|
|
127
127
|
}
|
|
128
128
|
catch (error) {
|
|
129
129
|
const result = FillResultByError(error);
|
|
130
130
|
const userData = FillUserData("result", result);
|
|
131
|
-
return
|
|
131
|
+
return this.responseHelper.GetErrorResponse(userData, "GetGroup");
|
|
132
132
|
}
|
|
133
133
|
};
|
|
134
134
|
GetExternalAuth = async () => {
|
|
135
135
|
try {
|
|
136
136
|
const response = await this.userService.getExternalAuth(this.clientData.userId);
|
|
137
|
-
return
|
|
137
|
+
return this.responseHelper.GetResponse(response.data);
|
|
138
138
|
}
|
|
139
139
|
catch (error) {
|
|
140
140
|
const result = FillResultByError(error);
|
|
141
141
|
const userData = FillUserData("result", result);
|
|
142
|
-
return
|
|
142
|
+
return this.responseHelper.GetErrorResponse(userData, "GetExternalAuth");
|
|
143
143
|
}
|
|
144
144
|
};
|
|
145
145
|
GetEmail = async () => {
|
|
146
146
|
try {
|
|
147
147
|
const response = await this.userService.getEmail(this.clientData.userId);
|
|
148
|
-
return
|
|
148
|
+
return this.responseHelper.GetResponse(response.data);
|
|
149
149
|
}
|
|
150
150
|
catch (error) {
|
|
151
151
|
const result = FillResultByError(error);
|
|
152
152
|
const userData = FillUserData("result", result);
|
|
153
|
-
return
|
|
153
|
+
return this.responseHelper.GetErrorResponse(userData, "GetEmail");
|
|
154
154
|
}
|
|
155
155
|
};
|
|
156
156
|
GetDocuments = async () => {
|
|
157
157
|
try {
|
|
158
158
|
const response = await this.userService.getDocuments(this.clientData.userId);
|
|
159
|
-
return
|
|
159
|
+
return this.responseHelper.GetResponse(response.data);
|
|
160
160
|
}
|
|
161
161
|
catch (error) {
|
|
162
162
|
const result = FillResultByError(error);
|
|
163
163
|
const userData = FillUserData("result", result);
|
|
164
|
-
return
|
|
164
|
+
return this.responseHelper.GetErrorResponse(userData, "GetDocuments");
|
|
165
165
|
}
|
|
166
166
|
};
|
|
167
167
|
GetCurrency = async () => {
|
|
168
168
|
try {
|
|
169
169
|
const response = await this.userService.getCurrency(this.clientData.userId);
|
|
170
|
-
return
|
|
170
|
+
return this.responseHelper.GetResponse(response.data);
|
|
171
171
|
}
|
|
172
172
|
catch (error) {
|
|
173
173
|
const result = FillResultByError(error);
|
|
174
174
|
const userData = FillUserData("result", result);
|
|
175
|
-
return
|
|
175
|
+
return this.responseHelper.GetErrorResponse(userData, "GetCurrency");
|
|
176
176
|
}
|
|
177
177
|
};
|
|
178
178
|
GetCreditCard = async () => {
|
|
179
179
|
try {
|
|
180
180
|
const response = await this.userService.getCreditCard(this.clientData.userId);
|
|
181
|
-
return
|
|
181
|
+
return this.responseHelper.GetResponse(response.data);
|
|
182
182
|
}
|
|
183
183
|
catch (error) {
|
|
184
184
|
const result = FillResultByError(error);
|
|
185
185
|
const userData = FillUserData("result", result);
|
|
186
|
-
return
|
|
186
|
+
return this.responseHelper.GetErrorResponse(userData, "GetCreditCard");
|
|
187
187
|
}
|
|
188
188
|
};
|
|
189
189
|
GetBankAccount = async () => {
|
|
190
190
|
try {
|
|
191
191
|
const response = await this.userService.getBankAccount(this.clientData.userId);
|
|
192
|
-
return
|
|
192
|
+
return this.responseHelper.GetResponse(response.data);
|
|
193
193
|
}
|
|
194
194
|
catch (error) {
|
|
195
195
|
const result = FillResultByError(error);
|
|
196
196
|
const userData = FillUserData("result", result);
|
|
197
|
-
return
|
|
197
|
+
return this.responseHelper.GetErrorResponse(userData, "GetBankAccount");
|
|
198
198
|
}
|
|
199
199
|
};
|
|
200
200
|
GetAddress = async () => {
|
|
201
201
|
try {
|
|
202
202
|
const response = await this.userService.getAddress(this.clientData.userId);
|
|
203
|
-
return
|
|
203
|
+
return this.responseHelper.GetResponse(response.data);
|
|
204
204
|
}
|
|
205
205
|
catch (error) {
|
|
206
206
|
const result = FillResultByError(error);
|
|
207
207
|
const userData = FillUserData("result", result);
|
|
208
|
-
return
|
|
208
|
+
return this.responseHelper.GetErrorResponse(userData, "GetAddress");
|
|
209
209
|
}
|
|
210
210
|
};
|
|
211
211
|
GetAccount = async () => {
|
|
212
212
|
try {
|
|
213
213
|
const response = await this.userService.getAccount(this.clientData.userId);
|
|
214
|
-
return
|
|
214
|
+
return this.responseHelper.GetResponse(response.data);
|
|
215
215
|
}
|
|
216
216
|
catch (error) {
|
|
217
217
|
const result = FillResultByError(error);
|
|
218
218
|
const userData = FillUserData("result", result);
|
|
219
|
-
return
|
|
219
|
+
return this.responseHelper.GetErrorResponse(userData, "GetAccount");
|
|
220
220
|
}
|
|
221
221
|
};
|
|
222
222
|
GetSecurityOperations = async () => {
|
|
223
223
|
try {
|
|
224
224
|
const response = await this.userService.getActivity(this.clientData.userId);
|
|
225
|
-
return
|
|
225
|
+
return this.responseHelper.GetResponse(response.data);
|
|
226
226
|
}
|
|
227
227
|
catch (error) {
|
|
228
228
|
const result = FillResultByError(error);
|
|
229
229
|
const userData = FillUserData("result", result);
|
|
230
|
-
return
|
|
230
|
+
return this.responseHelper.GetErrorResponse(userData, "GetSecurityOperations");
|
|
231
231
|
}
|
|
232
232
|
};
|
|
233
233
|
GetDeviceHistory = async () => {
|
|
234
234
|
try {
|
|
235
235
|
const response = await this.userService.getDeviceHistory(this.clientData.userId);
|
|
236
|
-
return
|
|
236
|
+
return this.responseHelper.GetResponse(response.data);
|
|
237
237
|
}
|
|
238
238
|
catch (error) {
|
|
239
239
|
const result = FillResultByError(error);
|
|
240
240
|
const userData = FillUserData("result", result);
|
|
241
|
-
return
|
|
241
|
+
return this.responseHelper.GetErrorResponse(userData, "GetDeviceHistory");
|
|
242
242
|
}
|
|
243
243
|
};
|
|
244
244
|
// #endregion
|
|
@@ -253,12 +253,12 @@ class UserClient {
|
|
|
253
253
|
headers: { Authorization: `Bearer ${tokenData.access_token}` },
|
|
254
254
|
};
|
|
255
255
|
const response = await this.userService.createUser(userData, config);
|
|
256
|
-
return
|
|
256
|
+
return this.responseHelper.GetResponse(response.data);
|
|
257
257
|
}
|
|
258
258
|
catch (error) {
|
|
259
259
|
const result = FillResultByError(error);
|
|
260
260
|
const userData = FillUserData("result", result);
|
|
261
|
-
return
|
|
261
|
+
return this.responseHelper.GetErrorResponse(userData, "CreateUser");
|
|
262
262
|
}
|
|
263
263
|
};
|
|
264
264
|
CreateUserWithGoogle = async (data) => {
|
|
@@ -271,341 +271,341 @@ class UserClient {
|
|
|
271
271
|
headers: { Authorization: `Bearer ${tokenData.access_token}` },
|
|
272
272
|
};
|
|
273
273
|
const response = await this.userService.createUser(userData, config);
|
|
274
|
-
return
|
|
274
|
+
return this.responseHelper.GetResponse(response.data);
|
|
275
275
|
}
|
|
276
276
|
catch (error) {
|
|
277
277
|
const result = FillResultByError(error);
|
|
278
278
|
const userData = FillUserData("result", result);
|
|
279
|
-
return
|
|
279
|
+
return this.responseHelper.GetErrorResponse(userData, "CreateUserWithGoogle");
|
|
280
280
|
}
|
|
281
281
|
};
|
|
282
282
|
CreatePhone = async (data) => {
|
|
283
283
|
try {
|
|
284
284
|
const userData = FillCreatePhoneData(data);
|
|
285
285
|
const response = await this.userService.createPhone(this.clientData.userId, userData);
|
|
286
|
-
return
|
|
286
|
+
return this.responseHelper.GetResponse(response.data);
|
|
287
287
|
}
|
|
288
288
|
catch (error) {
|
|
289
289
|
const result = FillResultByError(error);
|
|
290
290
|
const userData = FillUserData("result", result);
|
|
291
|
-
return
|
|
291
|
+
return this.responseHelper.GetErrorResponse(userData, "CreatePhone");
|
|
292
292
|
}
|
|
293
293
|
};
|
|
294
294
|
CreateIdentification = async (data) => {
|
|
295
295
|
try {
|
|
296
296
|
const userData = FillCreateIdentificationData(data);
|
|
297
297
|
const response = await this.userService.createIdentification(this.clientData.userId, userData);
|
|
298
|
-
return
|
|
298
|
+
return this.responseHelper.GetResponse(response.data);
|
|
299
299
|
}
|
|
300
300
|
catch (error) {
|
|
301
301
|
const result = FillResultByError(error);
|
|
302
302
|
const userData = FillUserData("result", result);
|
|
303
|
-
return
|
|
303
|
+
return this.responseHelper.GetErrorResponse(userData, "CreateIdentification");
|
|
304
304
|
}
|
|
305
305
|
};
|
|
306
306
|
CreateExternalAuth = async (data) => {
|
|
307
307
|
try {
|
|
308
308
|
const response = await this.userService.createExternalAuth(this.clientData.userId, data);
|
|
309
|
-
return
|
|
309
|
+
return this.responseHelper.GetResponse(response.data);
|
|
310
310
|
}
|
|
311
311
|
catch (error) {
|
|
312
312
|
const result = FillResultByError(error);
|
|
313
313
|
const userData = FillUserData("result", result);
|
|
314
|
-
return
|
|
314
|
+
return this.responseHelper.GetErrorResponse(userData, "CreateExternalAuth");
|
|
315
315
|
}
|
|
316
316
|
};
|
|
317
317
|
CreateEmail = async (data) => {
|
|
318
318
|
try {
|
|
319
319
|
const userData = FillCreateEmailData(data);
|
|
320
320
|
const response = await this.userService.createEmail(this.clientData.userId, userData);
|
|
321
|
-
return
|
|
321
|
+
return this.responseHelper.GetResponse(response.data);
|
|
322
322
|
}
|
|
323
323
|
catch (error) {
|
|
324
324
|
const result = FillResultByError(error);
|
|
325
325
|
const userData = FillUserData("result", result);
|
|
326
|
-
return
|
|
326
|
+
return this.responseHelper.GetErrorResponse(userData, "CreateEmail");
|
|
327
327
|
}
|
|
328
328
|
};
|
|
329
329
|
CreateCurrency = async (data) => {
|
|
330
330
|
try {
|
|
331
331
|
const response = await this.userService.createCurrency(this.clientData.userId, data);
|
|
332
|
-
return
|
|
332
|
+
return this.responseHelper.GetResponse(response.data);
|
|
333
333
|
}
|
|
334
334
|
catch (error) {
|
|
335
335
|
const result = FillResultByError(error);
|
|
336
336
|
const userData = FillUserData("result", result);
|
|
337
|
-
return
|
|
337
|
+
return this.responseHelper.GetErrorResponse(userData, "CreateCurrency");
|
|
338
338
|
}
|
|
339
339
|
};
|
|
340
340
|
CreateCreditCard = async (data) => {
|
|
341
341
|
try {
|
|
342
342
|
const response = await this.userService.createCreditCard(this.clientData.userId, data);
|
|
343
|
-
return
|
|
343
|
+
return this.responseHelper.GetResponse(response.data);
|
|
344
344
|
}
|
|
345
345
|
catch (error) {
|
|
346
346
|
const result = FillResultByError(error);
|
|
347
347
|
const userData = FillUserData("result", result);
|
|
348
|
-
return
|
|
348
|
+
return this.responseHelper.GetErrorResponse(userData, "CreateCreditCard");
|
|
349
349
|
}
|
|
350
350
|
};
|
|
351
351
|
CreateTicket = async (data) => {
|
|
352
352
|
try {
|
|
353
353
|
const userData = FillCreateTicketData(data);
|
|
354
354
|
const response = await this.userService.createTicket(this.clientData.userId, userData);
|
|
355
|
-
return
|
|
355
|
+
return this.responseHelper.GetResponse(response.data);
|
|
356
356
|
}
|
|
357
357
|
catch (error) {
|
|
358
358
|
const result = FillResultByError(error);
|
|
359
359
|
const userData = FillUserData("result", result);
|
|
360
|
-
return
|
|
360
|
+
return this.responseHelper.GetErrorResponse(userData, "CreateTicket");
|
|
361
361
|
}
|
|
362
362
|
};
|
|
363
363
|
CreateBankAccount = async (data) => {
|
|
364
364
|
try {
|
|
365
365
|
const userData = FillCreateBankAccountData(data);
|
|
366
366
|
const response = await this.userService.createBankAccount(this.clientData.userId, userData);
|
|
367
|
-
return
|
|
367
|
+
return this.responseHelper.GetResponse(response.data);
|
|
368
368
|
}
|
|
369
369
|
catch (error) {
|
|
370
370
|
const result = FillResultByError(error);
|
|
371
371
|
const userData = FillUserData("result", result);
|
|
372
|
-
return
|
|
372
|
+
return this.responseHelper.GetErrorResponse(userData, "CreateBankAccount");
|
|
373
373
|
}
|
|
374
374
|
};
|
|
375
375
|
CreateAddress = async (data) => {
|
|
376
376
|
try {
|
|
377
377
|
const userData = FillCreateAddressData(data);
|
|
378
378
|
const response = await this.userService.createAddress(this.clientData.userId, userData);
|
|
379
|
-
return
|
|
379
|
+
return this.responseHelper.GetResponse(response.data);
|
|
380
380
|
}
|
|
381
381
|
catch (error) {
|
|
382
382
|
const result = FillResultByError(error);
|
|
383
383
|
const userData = FillUserData("result", result);
|
|
384
|
-
return
|
|
384
|
+
return this.responseHelper.GetErrorResponse(userData, "CreateAddress");
|
|
385
385
|
}
|
|
386
386
|
};
|
|
387
387
|
CreateDevice = async (data) => {
|
|
388
388
|
try {
|
|
389
389
|
const userData = FillCreateDeviceData(data);
|
|
390
390
|
const response = await this.userService.createDevice(this.clientData.userId, userData);
|
|
391
|
-
return
|
|
391
|
+
return this.responseHelper.GetResponse(response.data);
|
|
392
392
|
}
|
|
393
393
|
catch (error) {
|
|
394
394
|
const result = FillResultByError(error);
|
|
395
395
|
const userData = FillUserData("result", result);
|
|
396
|
-
return
|
|
396
|
+
return this.responseHelper.GetErrorResponse(userData, "CreateDevice");
|
|
397
397
|
}
|
|
398
398
|
};
|
|
399
399
|
SecurityAccess = async (data) => {
|
|
400
400
|
try {
|
|
401
401
|
const response = await this.userService.securityAccess(this.clientData.userId, data);
|
|
402
|
-
return
|
|
402
|
+
return this.responseHelper.GetResponse(response.data);
|
|
403
403
|
}
|
|
404
404
|
catch (error) {
|
|
405
405
|
const result = FillResultByError(error);
|
|
406
406
|
const userData = FillUserData("result", result);
|
|
407
|
-
return
|
|
407
|
+
return this.responseHelper.GetErrorResponse(userData, "SecurityAccess");
|
|
408
408
|
}
|
|
409
409
|
};
|
|
410
410
|
UploadDocument = async (data) => {
|
|
411
411
|
try {
|
|
412
412
|
const documentData = FillUploadDocumentData(data);
|
|
413
413
|
const response = await this.userService.uploadDocument(this.clientData.userId, documentData);
|
|
414
|
-
return
|
|
414
|
+
return this.responseHelper.GetResponse(response.data);
|
|
415
415
|
}
|
|
416
416
|
catch (error) {
|
|
417
417
|
const result = FillResultByError(error);
|
|
418
418
|
const documentData = FillDocumentData("result", result);
|
|
419
|
-
return
|
|
419
|
+
return this.responseHelper.GetErrorResponse(documentData, "UploadDocument");
|
|
420
420
|
}
|
|
421
421
|
};
|
|
422
422
|
UpdateProfilePicture = async (data) => {
|
|
423
423
|
try {
|
|
424
424
|
const documentData = FillUploadProfilePictureData(data);
|
|
425
425
|
const response = await this.userService.uploadDocument(this.clientData.userId, documentData);
|
|
426
|
-
return
|
|
426
|
+
return this.responseHelper.GetResponse(response.data);
|
|
427
427
|
}
|
|
428
428
|
catch (error) {
|
|
429
429
|
const result = FillResultByError(error);
|
|
430
430
|
const documentData = FillDocumentData("result", result);
|
|
431
|
-
return
|
|
431
|
+
return this.responseHelper.GetErrorResponse(documentData, "UpdateProfilePicture");
|
|
432
432
|
}
|
|
433
433
|
};
|
|
434
434
|
VerifySecurityData = async (data) => {
|
|
435
435
|
try {
|
|
436
436
|
const response = await this.userService.verifySecurityData(this.clientData.userId, data);
|
|
437
|
-
return
|
|
437
|
+
return this.responseHelper.GetResponse(response.data);
|
|
438
438
|
}
|
|
439
439
|
catch (error) {
|
|
440
440
|
const result = FillResultByError(error);
|
|
441
441
|
const verifyUserSecurity = FillVerifyUserSecurityData("result", result);
|
|
442
|
-
return
|
|
442
|
+
return this.responseHelper.GetErrorResponse(verifyUserSecurity, "VerifySecurityData");
|
|
443
443
|
}
|
|
444
444
|
};
|
|
445
445
|
VerifyEmail = async (data) => {
|
|
446
446
|
try {
|
|
447
447
|
const verifyUserSecurity = FillVerifyEmailData(data);
|
|
448
448
|
const response = await this.userService.verifySecurityData(this.clientData.userId, verifyUserSecurity);
|
|
449
|
-
return
|
|
449
|
+
return this.responseHelper.GetResponse(response.data);
|
|
450
450
|
}
|
|
451
451
|
catch (error) {
|
|
452
452
|
const result = FillResultByError(error);
|
|
453
453
|
const verifyUserSecurity = FillVerifyUserSecurityData("result", result);
|
|
454
|
-
return
|
|
454
|
+
return this.responseHelper.GetErrorResponse(verifyUserSecurity, "VerifyEmail");
|
|
455
455
|
}
|
|
456
456
|
};
|
|
457
457
|
SendEmailOTP = async (data) => {
|
|
458
458
|
try {
|
|
459
459
|
const verifyUserSecurity = FillSendEmailOTPData(data);
|
|
460
460
|
const response = await this.userService.verifySecurityData(this.clientData.userId, verifyUserSecurity);
|
|
461
|
-
return
|
|
461
|
+
return this.responseHelper.GetResponse(response.data);
|
|
462
462
|
}
|
|
463
463
|
catch (error) {
|
|
464
464
|
const result = FillResultByError(error);
|
|
465
465
|
const verifyUserSecurity = FillVerifyUserSecurityData("result", result);
|
|
466
|
-
return
|
|
466
|
+
return this.responseHelper.GetErrorResponse(verifyUserSecurity, "SendEmailOTP");
|
|
467
467
|
}
|
|
468
468
|
};
|
|
469
469
|
VerifyPhone = async (data) => {
|
|
470
470
|
try {
|
|
471
471
|
const verifyUserSecurity = FillVerifyPhoneData(data);
|
|
472
472
|
const response = await this.userService.verifySecurityData(this.clientData.userId, verifyUserSecurity);
|
|
473
|
-
return
|
|
473
|
+
return this.responseHelper.GetResponse(response.data);
|
|
474
474
|
}
|
|
475
475
|
catch (error) {
|
|
476
476
|
const result = FillResultByError(error);
|
|
477
477
|
const verifyUserSecurity = FillVerifyUserSecurityData("result", result);
|
|
478
|
-
return
|
|
478
|
+
return this.responseHelper.GetErrorResponse(verifyUserSecurity, "VerifyPhone");
|
|
479
479
|
}
|
|
480
480
|
};
|
|
481
481
|
SendPhoneOTP = async (data) => {
|
|
482
482
|
try {
|
|
483
483
|
const verifyUserSecurity = FillSendPhoneOTPData(data);
|
|
484
484
|
const response = await this.userService.verifySecurityData(this.clientData.userId, verifyUserSecurity);
|
|
485
|
-
return
|
|
485
|
+
return this.responseHelper.GetResponse(response.data);
|
|
486
486
|
}
|
|
487
487
|
catch (error) {
|
|
488
488
|
const result = FillResultByError(error);
|
|
489
489
|
const verifyUserSecurity = FillVerifyUserSecurityData("result", result);
|
|
490
|
-
return
|
|
490
|
+
return this.responseHelper.GetErrorResponse(verifyUserSecurity, "SendPhoneOTP");
|
|
491
491
|
}
|
|
492
492
|
};
|
|
493
493
|
VerifyDevice = async (data) => {
|
|
494
494
|
try {
|
|
495
495
|
const verifyUserSecurity = FillVerifyDeviceData(data);
|
|
496
496
|
const response = await this.userService.verifySecurityData(this.clientData.userId, verifyUserSecurity);
|
|
497
|
-
return
|
|
497
|
+
return this.responseHelper.GetResponse(response.data);
|
|
498
498
|
}
|
|
499
499
|
catch (error) {
|
|
500
500
|
const result = FillResultByError(error);
|
|
501
501
|
const verifyUserSecurity = FillVerifyUserSecurityData("result", result);
|
|
502
|
-
return
|
|
502
|
+
return this.responseHelper.GetErrorResponse(verifyUserSecurity, "VerifyDevice");
|
|
503
503
|
}
|
|
504
504
|
};
|
|
505
505
|
ConfirmSecurityData = async (data) => {
|
|
506
506
|
try {
|
|
507
507
|
const response = await this.userService.confirmSecurityData(this.clientData.userId, data);
|
|
508
|
-
return
|
|
508
|
+
return this.responseHelper.GetResponse(response.data);
|
|
509
509
|
}
|
|
510
510
|
catch (error) {
|
|
511
511
|
const result = FillResultByError(error);
|
|
512
512
|
const confirmUserSecurity = FillConfirmUserSecurityData("result", result);
|
|
513
|
-
return
|
|
513
|
+
return this.responseHelper.GetErrorResponse(confirmUserSecurity, "ConfirmSecurityData");
|
|
514
514
|
}
|
|
515
515
|
};
|
|
516
516
|
ConfirmEmail = async (data) => {
|
|
517
517
|
try {
|
|
518
518
|
const confirmUserSecurity = FillConfirmEmailData(data);
|
|
519
519
|
const response = await this.userService.confirmSecurityData(this.clientData.userId, confirmUserSecurity);
|
|
520
|
-
return
|
|
520
|
+
return this.responseHelper.GetResponse(response.data);
|
|
521
521
|
}
|
|
522
522
|
catch (error) {
|
|
523
523
|
const result = FillResultByError(error);
|
|
524
524
|
const confirmUserSecurity = FillConfirmUserSecurityData("result", result);
|
|
525
|
-
return
|
|
525
|
+
return this.responseHelper.GetErrorResponse(confirmUserSecurity, "ConfirmEmail");
|
|
526
526
|
}
|
|
527
527
|
};
|
|
528
528
|
ConfirmPhone = async (data) => {
|
|
529
529
|
try {
|
|
530
530
|
const confirmUserSecurity = FillConfirmPhoneData(data);
|
|
531
531
|
const response = await this.userService.confirmSecurityData(this.clientData.userId, confirmUserSecurity);
|
|
532
|
-
return
|
|
532
|
+
return this.responseHelper.GetResponse(response.data);
|
|
533
533
|
}
|
|
534
534
|
catch (error) {
|
|
535
535
|
const result = FillResultByError(error);
|
|
536
536
|
const confirmUserSecurity = FillConfirmUserSecurityData("result", result);
|
|
537
|
-
return
|
|
537
|
+
return this.responseHelper.GetErrorResponse(confirmUserSecurity, "ConfirmPhone");
|
|
538
538
|
}
|
|
539
539
|
};
|
|
540
540
|
ConfirmDevice = async (data) => {
|
|
541
541
|
try {
|
|
542
542
|
const confirmUserSecurity = FillConfirmDeviceData(data);
|
|
543
543
|
const response = await this.userService.confirmSecurityData(this.clientData.userId, confirmUserSecurity);
|
|
544
|
-
return
|
|
544
|
+
return this.responseHelper.GetResponse(response.data);
|
|
545
545
|
}
|
|
546
546
|
catch (error) {
|
|
547
547
|
const result = FillResultByError(error);
|
|
548
548
|
const confirmUserSecurity = FillConfirmUserSecurityData("result", result);
|
|
549
|
-
return
|
|
549
|
+
return this.responseHelper.GetErrorResponse(confirmUserSecurity, "ConfirmDevice");
|
|
550
550
|
}
|
|
551
551
|
};
|
|
552
552
|
ResetSecurityData = async (data) => {
|
|
553
553
|
try {
|
|
554
554
|
const response = await this.userService.resetSecurityData(this.clientData.userId, data);
|
|
555
|
-
return
|
|
555
|
+
return this.responseHelper.GetResponse(response.data);
|
|
556
556
|
}
|
|
557
557
|
catch (error) {
|
|
558
558
|
const result = FillResultByError(error);
|
|
559
559
|
const resetUserSecurity = FillResetUserSecurityData("result", result);
|
|
560
|
-
return
|
|
560
|
+
return this.responseHelper.GetErrorResponse(resetUserSecurity, "ResetSecurityData");
|
|
561
561
|
}
|
|
562
562
|
};
|
|
563
563
|
EnrollGoogleAuth = async () => {
|
|
564
564
|
try {
|
|
565
565
|
const userData = FillEnrollGoogleAuthData();
|
|
566
566
|
const response = await this.userService.enrollGoogleAuth(this.clientData.userId, userData);
|
|
567
|
-
return
|
|
567
|
+
return this.responseHelper.GetResponse(response.data);
|
|
568
568
|
}
|
|
569
569
|
catch (error) {
|
|
570
570
|
const result = FillResultByError(error);
|
|
571
571
|
const userData = FillUserData("result", result);
|
|
572
|
-
return
|
|
572
|
+
return this.responseHelper.GetErrorResponse(userData, "EnrollGoogleAuth");
|
|
573
573
|
}
|
|
574
574
|
};
|
|
575
575
|
ActivateGoogleAuth = async (data) => {
|
|
576
576
|
try {
|
|
577
577
|
const userData = FillActivateGoogleAuthData(data);
|
|
578
578
|
const response = await this.userService.activateGoogleAuth(this.clientData.userId, userData);
|
|
579
|
-
return
|
|
579
|
+
return this.responseHelper.GetResponse(response.data);
|
|
580
580
|
}
|
|
581
581
|
catch (error) {
|
|
582
582
|
const result = FillResultByError(error);
|
|
583
583
|
const userData = FillUserData("result", result);
|
|
584
|
-
return
|
|
584
|
+
return this.responseHelper.GetErrorResponse(userData, "ActivateGoogleAuth");
|
|
585
585
|
}
|
|
586
586
|
};
|
|
587
587
|
DeleteGoogleAuth = async (data) => {
|
|
588
588
|
try {
|
|
589
589
|
const userData = FillDeleteGoogleAuthData(data);
|
|
590
590
|
const response = await this.userService.deleteGoogleAuth(this.clientData.userId, userData);
|
|
591
|
-
return
|
|
591
|
+
return this.responseHelper.GetResponse(response.data);
|
|
592
592
|
}
|
|
593
593
|
catch (error) {
|
|
594
594
|
const result = FillResultByError(error);
|
|
595
595
|
const userData = FillUserData("result", result);
|
|
596
|
-
return
|
|
596
|
+
return this.responseHelper.GetErrorResponse(userData, "DeleteGoogleAuth");
|
|
597
597
|
}
|
|
598
598
|
};
|
|
599
599
|
DeactivateGoogleAuth = async (data) => {
|
|
600
600
|
try {
|
|
601
601
|
const userData = FillDeactivateGoogleAuthData(data);
|
|
602
602
|
const response = await this.userService.deactivateGoogleAuth(this.clientData.userId, userData);
|
|
603
|
-
return
|
|
603
|
+
return this.responseHelper.GetResponse(response.data);
|
|
604
604
|
}
|
|
605
605
|
catch (error) {
|
|
606
606
|
const result = FillResultByError(error);
|
|
607
607
|
const userData = FillUserData("result", result);
|
|
608
|
-
return
|
|
608
|
+
return this.responseHelper.GetErrorResponse(userData, "DeactivateGoogleAuth");
|
|
609
609
|
}
|
|
610
610
|
};
|
|
611
611
|
// #endregion
|
|
@@ -613,203 +613,203 @@ class UserClient {
|
|
|
613
613
|
UpdateUser = async (data) => {
|
|
614
614
|
try {
|
|
615
615
|
const response = await this.userService.updateUser(this.clientData.userId, data);
|
|
616
|
-
return
|
|
616
|
+
return this.responseHelper.GetResponse(response.data);
|
|
617
617
|
}
|
|
618
618
|
catch (error) {
|
|
619
619
|
const result = FillResultByError(error);
|
|
620
620
|
const userData = FillUserData("result", result);
|
|
621
|
-
return
|
|
621
|
+
return this.responseHelper.GetErrorResponse(userData, "UpdateUser");
|
|
622
622
|
}
|
|
623
623
|
};
|
|
624
624
|
ResetPassword = async (data) => {
|
|
625
625
|
try {
|
|
626
626
|
const resetSecurityData = FillResetPasswordData(data);
|
|
627
627
|
const response = await this.userService.resetSecurityData(this.clientData.userId, resetSecurityData);
|
|
628
|
-
return
|
|
628
|
+
return this.responseHelper.GetResponse(response.data);
|
|
629
629
|
}
|
|
630
630
|
catch (error) {
|
|
631
631
|
const result = FillResultByError(error);
|
|
632
632
|
const resetSecurityData = FillResetUserSecurityData("result", result);
|
|
633
|
-
return
|
|
633
|
+
return this.responseHelper.GetErrorResponse(resetSecurityData, "ResetPassword");
|
|
634
634
|
}
|
|
635
635
|
};
|
|
636
636
|
ResetSecurityCode = async (data) => {
|
|
637
637
|
try {
|
|
638
638
|
const resetSecurityData = FillResetSecurityCodeData(data);
|
|
639
639
|
const response = await this.userService.resetSecurityData(this.clientData.userId, resetSecurityData);
|
|
640
|
-
return
|
|
640
|
+
return this.responseHelper.GetResponse(response.data);
|
|
641
641
|
}
|
|
642
642
|
catch (error) {
|
|
643
643
|
const result = FillResultByError(error);
|
|
644
644
|
const resetSecurityData = FillResetUserSecurityData("result", result);
|
|
645
|
-
return
|
|
645
|
+
return this.responseHelper.GetErrorResponse(resetSecurityData, "ResetSecurityCode");
|
|
646
646
|
}
|
|
647
647
|
};
|
|
648
648
|
ResetSecurityQuestions = async (data) => {
|
|
649
649
|
try {
|
|
650
650
|
const resetSecurityData = FillResetSecurityQuestionsData(data);
|
|
651
651
|
const response = await this.userService.resetSecurityData(this.clientData.userId, resetSecurityData);
|
|
652
|
-
return
|
|
652
|
+
return this.responseHelper.GetResponse(response.data);
|
|
653
653
|
}
|
|
654
654
|
catch (error) {
|
|
655
655
|
const result = FillResultByError(error);
|
|
656
656
|
const resetSecurityData = FillResetUserSecurityData("result", result);
|
|
657
|
-
return
|
|
657
|
+
return this.responseHelper.GetErrorResponse(resetSecurityData, "ResetSecurityQuestions");
|
|
658
658
|
}
|
|
659
659
|
};
|
|
660
660
|
ValidateSecurityCode = async (data) => {
|
|
661
661
|
try {
|
|
662
662
|
const validateUserSecurityData = FillValidateSecurityCodeData(data);
|
|
663
663
|
const response = await this.userService.validateSecurityData(this.clientData.userId, validateUserSecurityData);
|
|
664
|
-
return
|
|
664
|
+
return this.responseHelper.GetResponse(response.data);
|
|
665
665
|
}
|
|
666
666
|
catch (error) {
|
|
667
667
|
const result = FillResultByError(error);
|
|
668
668
|
const validateUserSecurity = FillValidateSecurityData("result", result);
|
|
669
|
-
return
|
|
669
|
+
return this.responseHelper.GetErrorResponse(validateUserSecurity, "ValidateSecurityCode");
|
|
670
670
|
}
|
|
671
671
|
};
|
|
672
672
|
UpdatePreferences = async (data) => {
|
|
673
673
|
try {
|
|
674
674
|
const userData = FillUpdatePreferencesData(data);
|
|
675
675
|
const response = await this.userService.updatePreferences(this.clientData.userId, userData);
|
|
676
|
-
return
|
|
676
|
+
return this.responseHelper.GetResponse(response.data);
|
|
677
677
|
}
|
|
678
678
|
catch (error) {
|
|
679
679
|
const result = FillResultByError(error);
|
|
680
680
|
const userData = FillUserData("result", result);
|
|
681
|
-
return
|
|
681
|
+
return this.responseHelper.GetErrorResponse(userData, "UpdatePreferences");
|
|
682
682
|
}
|
|
683
683
|
};
|
|
684
684
|
UpdatePhone = async (data) => {
|
|
685
685
|
try {
|
|
686
686
|
const userData = FillUpdatePhoneData(data);
|
|
687
687
|
const response = await this.userService.updatePhone(this.clientData.userId, userData);
|
|
688
|
-
return
|
|
688
|
+
return this.responseHelper.GetResponse(response.data);
|
|
689
689
|
}
|
|
690
690
|
catch (error) {
|
|
691
691
|
const result = FillResultByError(error);
|
|
692
692
|
const userData = FillUserData("result", result);
|
|
693
|
-
return
|
|
693
|
+
return this.responseHelper.GetErrorResponse(userData, "UpdatePhone");
|
|
694
694
|
}
|
|
695
695
|
};
|
|
696
696
|
MakePhonePrimary = async (data) => {
|
|
697
697
|
try {
|
|
698
698
|
const userData = FillMakePhonePrimaryData(data);
|
|
699
699
|
const response = await this.userService.updatePhone(this.clientData.userId, userData);
|
|
700
|
-
return
|
|
700
|
+
return this.responseHelper.GetResponse(response.data);
|
|
701
701
|
}
|
|
702
702
|
catch (error) {
|
|
703
703
|
const result = FillResultByError(error);
|
|
704
704
|
const userData = FillUserData("result", result);
|
|
705
|
-
return
|
|
705
|
+
return this.responseHelper.GetErrorResponse(userData, "MakePhonePrimary");
|
|
706
706
|
}
|
|
707
707
|
};
|
|
708
708
|
UpdatePersonalInfo = async (data) => {
|
|
709
709
|
try {
|
|
710
710
|
const userData = FillUpdatePersonalInfoData(data);
|
|
711
711
|
const response = await this.userService.updatePersonalInfo(this.clientData.userId, userData);
|
|
712
|
-
return
|
|
712
|
+
return this.responseHelper.GetResponse(response.data);
|
|
713
713
|
}
|
|
714
714
|
catch (error) {
|
|
715
715
|
const result = FillResultByError(error);
|
|
716
716
|
const userData = FillUserData("result", result);
|
|
717
|
-
return
|
|
717
|
+
return this.responseHelper.GetErrorResponse(userData, "UpdatePersonalInfo");
|
|
718
718
|
}
|
|
719
719
|
};
|
|
720
720
|
UpdateIdentification = async (data) => {
|
|
721
721
|
try {
|
|
722
722
|
const userData = FillUpdateIdentificationData(data);
|
|
723
723
|
const response = await this.userService.updateIdentification(this.clientData.userId, userData);
|
|
724
|
-
return
|
|
724
|
+
return this.responseHelper.GetResponse(response.data);
|
|
725
725
|
}
|
|
726
726
|
catch (error) {
|
|
727
727
|
const result = FillResultByError(error);
|
|
728
728
|
const userData = FillUserData("result", result);
|
|
729
|
-
return
|
|
729
|
+
return this.responseHelper.GetErrorResponse(userData, "UpdateIdentification");
|
|
730
730
|
}
|
|
731
731
|
};
|
|
732
732
|
UpdateExternalAuth = async (data) => {
|
|
733
733
|
try {
|
|
734
734
|
const response = await this.userService.updateExternalAuth(this.clientData.userId, data);
|
|
735
|
-
return
|
|
735
|
+
return this.responseHelper.GetResponse(response.data);
|
|
736
736
|
}
|
|
737
737
|
catch (error) {
|
|
738
738
|
const result = FillResultByError(error);
|
|
739
739
|
const userData = FillUserData("result", result);
|
|
740
|
-
return
|
|
740
|
+
return this.responseHelper.GetErrorResponse(userData, "UpdateExternalAuth");
|
|
741
741
|
}
|
|
742
742
|
};
|
|
743
743
|
UpdateEmail = async (data) => {
|
|
744
744
|
try {
|
|
745
745
|
const userData = FillUpdateEmailData(data);
|
|
746
746
|
const response = await this.userService.updateEmail(this.clientData.userId, userData);
|
|
747
|
-
return
|
|
747
|
+
return this.responseHelper.GetResponse(response.data);
|
|
748
748
|
}
|
|
749
749
|
catch (error) {
|
|
750
750
|
const result = FillResultByError(error);
|
|
751
751
|
const userData = FillUserData("result", result);
|
|
752
|
-
return
|
|
752
|
+
return this.responseHelper.GetErrorResponse(userData, "UpdateEmail");
|
|
753
753
|
}
|
|
754
754
|
};
|
|
755
755
|
MakeEmailPrimary = async (data) => {
|
|
756
756
|
try {
|
|
757
757
|
const userData = FillMakeEmailPrimaryData(data);
|
|
758
758
|
const response = await this.userService.updateEmail(this.clientData.userId, userData);
|
|
759
|
-
return
|
|
759
|
+
return this.responseHelper.GetResponse(response.data);
|
|
760
760
|
}
|
|
761
761
|
catch (error) {
|
|
762
762
|
const result = FillResultByError(error);
|
|
763
763
|
const userData = FillUserData("result", result);
|
|
764
|
-
return
|
|
764
|
+
return this.responseHelper.GetErrorResponse(userData, "MakeEmailPrimary");
|
|
765
765
|
}
|
|
766
766
|
};
|
|
767
767
|
UpdateBankAccount = async (data) => {
|
|
768
768
|
try {
|
|
769
769
|
const userData = FillUpdateBankAccountData(data);
|
|
770
770
|
const response = await this.userService.updateBankAccount(this.clientData.userId, userData);
|
|
771
|
-
return
|
|
771
|
+
return this.responseHelper.GetResponse(response.data);
|
|
772
772
|
}
|
|
773
773
|
catch (error) {
|
|
774
774
|
const result = FillResultByError(error);
|
|
775
775
|
const userData = FillUserData("result", result);
|
|
776
|
-
return
|
|
776
|
+
return this.responseHelper.GetErrorResponse(userData, "UpdateBankAccount");
|
|
777
777
|
}
|
|
778
778
|
};
|
|
779
779
|
MakeBankAccountPrimary = async (data) => {
|
|
780
780
|
try {
|
|
781
781
|
const userData = FillMakeBankAccountPrimaryData(data);
|
|
782
782
|
const response = await this.userService.updateBankAccount(this.clientData.userId, userData);
|
|
783
|
-
return
|
|
783
|
+
return this.responseHelper.GetResponse(response.data);
|
|
784
784
|
}
|
|
785
785
|
catch (error) {
|
|
786
786
|
const result = FillResultByError(error);
|
|
787
787
|
const userData = FillUserData("result", result);
|
|
788
|
-
return
|
|
788
|
+
return this.responseHelper.GetErrorResponse(userData, "MakeBankAccountPrimary");
|
|
789
789
|
}
|
|
790
790
|
};
|
|
791
791
|
UpdateAddress = async (data) => {
|
|
792
792
|
try {
|
|
793
793
|
const userData = FillUpdateAddressData(data);
|
|
794
794
|
const response = await this.userService.updateAddress(this.clientData.userId, userData);
|
|
795
|
-
return
|
|
795
|
+
return this.responseHelper.GetResponse(response.data);
|
|
796
796
|
}
|
|
797
797
|
catch (error) {
|
|
798
798
|
const result = FillResultByError(error);
|
|
799
799
|
const userData = FillUserData("result", result);
|
|
800
|
-
return
|
|
800
|
+
return this.responseHelper.GetErrorResponse(userData, "UpdateAddress");
|
|
801
801
|
}
|
|
802
802
|
};
|
|
803
803
|
MakeAddressPrimary = async (data) => {
|
|
804
804
|
try {
|
|
805
805
|
const userData = FillMakeAddressPrimaryData(data);
|
|
806
806
|
const response = await this.userService.updateAddress(this.clientData.userId, userData);
|
|
807
|
-
return
|
|
807
|
+
return this.responseHelper.GetResponse(response.data);
|
|
808
808
|
}
|
|
809
809
|
catch (error) {
|
|
810
810
|
const result = FillResultByError(error);
|
|
811
811
|
const userData = FillUserData("result", result);
|
|
812
|
-
return
|
|
812
|
+
return this.responseHelper.GetErrorResponse(userData, "MakeAddressPrimary");
|
|
813
813
|
}
|
|
814
814
|
};
|
|
815
815
|
UpdateDevice = async (data) => {
|
|
@@ -818,30 +818,30 @@ class UserClient {
|
|
|
818
818
|
const userData = FillUpdateDeviceData(data);
|
|
819
819
|
if (data.token && data.userId) {
|
|
820
820
|
const config = AxiosHelper.GetAxiosConfig(data.token, this.clientData.baseUrl, this.clientData.lang);
|
|
821
|
-
const userService = new UserService({ config, userId: data.userId });
|
|
821
|
+
const userService = new UserService({ config, userId: data.userId }, this.errorHandler);
|
|
822
822
|
response = await userService.updateDevice(data.userId, userData);
|
|
823
823
|
}
|
|
824
824
|
else {
|
|
825
825
|
response = await this.userService.updateDevice(this.clientData.userId, userData);
|
|
826
826
|
}
|
|
827
|
-
return
|
|
827
|
+
return this.responseHelper.GetResponse(response.data);
|
|
828
828
|
}
|
|
829
829
|
catch (error) {
|
|
830
830
|
const result = FillResultByError(error);
|
|
831
831
|
const userData = FillUserData("result", result);
|
|
832
|
-
return
|
|
832
|
+
return this.responseHelper.GetErrorResponse(userData, "UpdateDevice");
|
|
833
833
|
}
|
|
834
834
|
};
|
|
835
835
|
LogoutDevice = async (data) => {
|
|
836
836
|
try {
|
|
837
837
|
const userData = FillLogoutDeviceData(data);
|
|
838
838
|
const response = await this.userService.logoutDevice(this.clientData.userId, userData);
|
|
839
|
-
return
|
|
839
|
+
return this.responseHelper.GetResponse(response.data);
|
|
840
840
|
}
|
|
841
841
|
catch (error) {
|
|
842
842
|
const result = FillResultByError(error);
|
|
843
843
|
const userData = FillUserData("result", result);
|
|
844
|
-
return
|
|
844
|
+
return this.responseHelper.GetErrorResponse(userData, "LogoutDevice");
|
|
845
845
|
}
|
|
846
846
|
};
|
|
847
847
|
// #endregion
|
|
@@ -850,72 +850,72 @@ class UserClient {
|
|
|
850
850
|
try {
|
|
851
851
|
const userData = FillDeleteAddressData(data);
|
|
852
852
|
const response = await this.userService.deleteAddress(this.clientData.userId, userData);
|
|
853
|
-
return
|
|
853
|
+
return this.responseHelper.GetResponse(response.data);
|
|
854
854
|
}
|
|
855
855
|
catch (error) {
|
|
856
856
|
const result = FillResultByError(error);
|
|
857
857
|
const userData = FillUserData("result", result);
|
|
858
|
-
return
|
|
858
|
+
return this.responseHelper.GetErrorResponse(userData, "DeleteAddress");
|
|
859
859
|
}
|
|
860
860
|
};
|
|
861
861
|
DeleteBankAccount = async (data) => {
|
|
862
862
|
try {
|
|
863
863
|
const userData = FillDeleteBankAccountData(data);
|
|
864
864
|
const response = await this.userService.deleteBankAccount(this.clientData.userId, userData);
|
|
865
|
-
return
|
|
865
|
+
return this.responseHelper.GetResponse(response.data);
|
|
866
866
|
}
|
|
867
867
|
catch (error) {
|
|
868
868
|
const result = FillResultByError(error);
|
|
869
869
|
const userData = FillUserData("result", result);
|
|
870
|
-
return
|
|
870
|
+
return this.responseHelper.GetErrorResponse(userData, "DeleteBankAccount");
|
|
871
871
|
}
|
|
872
872
|
};
|
|
873
873
|
DeleteDevice = async (data) => {
|
|
874
874
|
try {
|
|
875
875
|
const userData = FillDeleteDeviceData(data);
|
|
876
876
|
const response = await this.userService.deleteDevice(this.clientData.userId, userData);
|
|
877
|
-
return
|
|
877
|
+
return this.responseHelper.GetResponse(response.data);
|
|
878
878
|
}
|
|
879
879
|
catch (error) {
|
|
880
880
|
const result = FillResultByError(error);
|
|
881
881
|
const userData = FillUserData("result", result);
|
|
882
|
-
return
|
|
882
|
+
return this.responseHelper.GetErrorResponse(userData, "DeleteDevice");
|
|
883
883
|
}
|
|
884
884
|
};
|
|
885
885
|
DeleteEmail = async (data) => {
|
|
886
886
|
try {
|
|
887
887
|
const userData = FillDeleteEmailData(data);
|
|
888
888
|
const response = await this.userService.deleteEmail(this.clientData.userId, userData);
|
|
889
|
-
return
|
|
889
|
+
return this.responseHelper.GetResponse(response.data);
|
|
890
890
|
}
|
|
891
891
|
catch (error) {
|
|
892
892
|
const result = FillResultByError(error);
|
|
893
893
|
const userData = FillUserData("result", result);
|
|
894
|
-
return
|
|
894
|
+
return this.responseHelper.GetErrorResponse(userData, "DeleteEmail");
|
|
895
895
|
}
|
|
896
896
|
};
|
|
897
897
|
DeleteIdentification = async (data) => {
|
|
898
898
|
try {
|
|
899
899
|
const userData = FillDeleteIdentificationData(data);
|
|
900
900
|
const response = await this.userService.deleteIdentification(this.clientData.userId, userData);
|
|
901
|
-
return
|
|
901
|
+
return this.responseHelper.GetResponse(response.data);
|
|
902
902
|
}
|
|
903
903
|
catch (error) {
|
|
904
904
|
const result = FillResultByError(error);
|
|
905
905
|
const userData = FillUserData("result", result);
|
|
906
|
-
return
|
|
906
|
+
return this.responseHelper.GetErrorResponse(userData, "DeleteIdentification");
|
|
907
907
|
}
|
|
908
908
|
};
|
|
909
909
|
DeletePhone = async (data) => {
|
|
910
910
|
try {
|
|
911
911
|
const userData = FillDeletePhoneData(data);
|
|
912
912
|
const response = await this.userService.deletePhone(this.clientData.userId, userData);
|
|
913
|
-
return
|
|
913
|
+
return this.responseHelper.GetResponse(response.data);
|
|
914
914
|
}
|
|
915
915
|
catch (error) {
|
|
916
916
|
const result = FillResultByError(error);
|
|
917
917
|
const userData = FillUserData("result", result);
|
|
918
|
-
return
|
|
918
|
+
return this.responseHelper.GetErrorResponse(userData, "DeletePhone");
|
|
919
919
|
}
|
|
920
920
|
};
|
|
921
921
|
}
|