ggez-banking-sdk 0.0.2 → 0.0.4
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/package.json +10 -2
- package/README.md +0 -0
- package/dist/bank-system/constants/enum.d.ts +0 -1057
- package/dist/bank-system/constants/enum.js +0 -1110
- package/dist/bank-system/constants/index.d.ts +0 -1
- package/dist/bank-system/constants/index.js +0 -17
- package/dist/bank-system/content/accountCurrencies.d.ts +0 -12
- package/dist/bank-system/content/accountCurrencies.js +0 -37
- package/dist/bank-system/content/countries.d.ts +0 -24
- package/dist/bank-system/content/countries.js +0 -6472
- package/dist/bank-system/content/currencies.d.ts +0 -32
- package/dist/bank-system/content/currencies.js +0 -5836
- package/dist/bank-system/content/index.d.ts +0 -4
- package/dist/bank-system/content/index.js +0 -12
- package/dist/bank-system/content/state.d.ts +0 -6
- package/dist/bank-system/content/state.js +0 -350
- package/dist/bank-system/helper/data.d.ts +0 -46
- package/dist/bank-system/helper/data.js +0 -57
- package/dist/bank-system/helper/dataStructure.d.ts +0 -3220
- package/dist/bank-system/helper/dataStructure.js +0 -1051
- package/dist/bank-system/helper/index.d.ts +0 -28
- package/dist/bank-system/helper/index.js +0 -394
- package/dist/bank-system/interfaces/accountInterface.d.ts +0 -26
- package/dist/bank-system/interfaces/accountInterface.js +0 -2
- package/dist/bank-system/interfaces/bankingSystemInterface.d.ts +0 -306
- package/dist/bank-system/interfaces/bankingSystemInterface.js +0 -2
- package/dist/bank-system/interfaces/deviceInterface.d.ts +0 -34
- package/dist/bank-system/interfaces/deviceInterface.js +0 -2
- package/dist/bank-system/interfaces/index.d.ts +0 -4
- package/dist/bank-system/interfaces/index.js +0 -20
- package/dist/bank-system/interfaces/interface.d.ts +0 -460
- package/dist/bank-system/interfaces/interface.js +0 -2
- package/dist/bank-system/interfaces/organizationInterface.d.ts +0 -118
- package/dist/bank-system/interfaces/organizationInterface.js +0 -2
- package/dist/bank-system/interfaces/signInterface.d.ts +0 -89
- package/dist/bank-system/interfaces/signInterface.js +0 -2
- package/dist/bank-system/interfaces/transactionInterface.d.ts +0 -17
- package/dist/bank-system/interfaces/transactionInterface.js +0 -2
- package/dist/bank-system/restApi/index.d.ts +0 -8
- package/dist/bank-system/restApi/index.js +0 -41
- package/dist/bank-system/services/account.d.ts +0 -33
- package/dist/bank-system/services/account.js +0 -129
- package/dist/bank-system/services/addresses.d.ts +0 -48
- package/dist/bank-system/services/addresses.js +0 -130
- package/dist/bank-system/services/auth.d.ts +0 -71
- package/dist/bank-system/services/auth.js +0 -250
- package/dist/bank-system/services/bankAccount.d.ts +0 -48
- package/dist/bank-system/services/bankAccount.js +0 -131
- package/dist/bank-system/services/device.d.ts +0 -46
- package/dist/bank-system/services/device.js +0 -212
- package/dist/bank-system/services/document.d.ts +0 -15
- package/dist/bank-system/services/document.js +0 -58
- package/dist/bank-system/services/email.d.ts +0 -70
- package/dist/bank-system/services/email.js +0 -175
- package/dist/bank-system/services/history.d.ts +0 -14
- package/dist/bank-system/services/history.js +0 -55
- package/dist/bank-system/services/identification.d.ts +0 -37
- package/dist/bank-system/services/identification.js +0 -107
- package/dist/bank-system/services/index.d.ts +0 -17
- package/dist/bank-system/services/index.js +0 -35
- package/dist/bank-system/services/organization.d.ts +0 -28
- package/dist/bank-system/services/organization.js +0 -129
- package/dist/bank-system/services/personalInfo.d.ts +0 -26
- package/dist/bank-system/services/personalInfo.js +0 -91
- package/dist/bank-system/services/phone.d.ts +0 -70
- package/dist/bank-system/services/phone.js +0 -175
- package/dist/bank-system/services/security.d.ts +0 -114
- package/dist/bank-system/services/security.js +0 -267
- package/dist/bank-system/services/token.d.ts +0 -11
- package/dist/bank-system/services/token.js +0 -83
- package/dist/bank-system/services/transaction.d.ts +0 -9
- package/dist/bank-system/services/transaction.js +0 -62
- package/dist/bank-system/services/verifyAndConfirm.d.ts +0 -116
- package/dist/bank-system/services/verifyAndConfirm.js +0 -308
- package/dist/bank-system/utils/chainAddressMasking.d.ts +0 -2
- package/dist/bank-system/utils/chainAddressMasking.js +0 -12
- package/dist/bank-system/utils/copyText.d.ts +0 -5
- package/dist/bank-system/utils/copyText.js +0 -22
- package/dist/bank-system/utils/countryAndCurrencyData.d.ts +0 -11
- package/dist/bank-system/utils/countryAndCurrencyData.js +0 -22
- package/dist/bank-system/utils/enumToOption.d.ts +0 -4
- package/dist/bank-system/utils/enumToOption.js +0 -18
- package/dist/bank-system/utils/fillDeviceDetails.d.ts +0 -23
- package/dist/bank-system/utils/fillDeviceDetails.js +0 -44
- package/dist/bank-system/utils/generateOneLiner.d.ts +0 -1
- package/dist/bank-system/utils/generateOneLiner.js +0 -17
- package/dist/bank-system/utils/generateSourceId.d.ts +0 -1
- package/dist/bank-system/utils/generateSourceId.js +0 -13
- package/dist/bank-system/utils/getCountryName.d.ts +0 -1
- package/dist/bank-system/utils/getCountryName.js +0 -16
- package/dist/bank-system/utils/getEnumName.d.ts +0 -1
- package/dist/bank-system/utils/getEnumName.js +0 -10
- package/dist/bank-system/utils/getStateByCountryCode.d.ts +0 -1
- package/dist/bank-system/utils/getStateByCountryCode.js +0 -15
- package/dist/bank-system/utils/handleEncryption/decryptData.d.ts +0 -15
- package/dist/bank-system/utils/handleEncryption/decryptData.js +0 -78
- package/dist/bank-system/utils/handleEncryption/encryptData.d.ts +0 -2
- package/dist/bank-system/utils/handleEncryption/encryptData.js +0 -37
- package/dist/bank-system/utils/handleEncryption/index.d.ts +0 -4
- package/dist/bank-system/utils/handleEncryption/index.js +0 -12
- package/dist/bank-system/utils/handleEncryption/key.d.ts +0 -13
- package/dist/bank-system/utils/handleEncryption/key.js +0 -40
- package/dist/bank-system/utils/index.d.ts +0 -15
- package/dist/bank-system/utils/index.js +0 -42
- package/dist/bank-system/utils/info.d.ts +0 -8
- package/dist/bank-system/utils/info.js +0 -79
- package/dist/bank-system/utils/maskingFunction.d.ts +0 -1
- package/dist/bank-system/utils/maskingFunction.js +0 -28
- package/dist/bank-system/utils/regex.d.ts +0 -106
- package/dist/bank-system/utils/regex.js +0 -110
- package/dist/bank-system/utils/sortUserInfo.d.ts +0 -1
- package/dist/bank-system/utils/sortUserInfo.js +0 -43
- package/dist/index.d.ts +0 -8
- package/dist/index.js +0 -54
- package/dist/keplr-config/chainInfo.d.ts +0 -8
- package/dist/keplr-config/chainInfo.js +0 -111
|
@@ -1,1051 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const enum_1 = require("../constants/enum");
|
|
7
|
-
//import { fingerPrintHandler } from "../utils";
|
|
8
|
-
const clientjs_1 = require("clientjs");
|
|
9
|
-
const data_1 = require("./data");
|
|
10
|
-
const dayjs_1 = __importDefault(require("dayjs"));
|
|
11
|
-
const utc_1 = __importDefault(require("dayjs/plugin/utc"));
|
|
12
|
-
const timezone_1 = __importDefault(require("dayjs/plugin/timezone"));
|
|
13
|
-
dayjs_1.default.extend(utc_1.default);
|
|
14
|
-
dayjs_1.default.extend(timezone_1.default);
|
|
15
|
-
const Data = () => {
|
|
16
|
-
const dataOrder = () => {
|
|
17
|
-
const dataOrderRequest = (values) => {
|
|
18
|
-
let { processType, variantType, deliveryMobile, deliveryEmail, customerInfo, adminNotesItems, userNotesItems, paymentMethodAccountId, paymentMethodType, transactionType, adminNotes, userNotes, validate, geoCoordinates, } = values;
|
|
19
|
-
let data = {
|
|
20
|
-
info: {
|
|
21
|
-
process_type: processType,
|
|
22
|
-
},
|
|
23
|
-
items: [
|
|
24
|
-
{
|
|
25
|
-
variant: {
|
|
26
|
-
type: variantType,
|
|
27
|
-
},
|
|
28
|
-
custom_form_data: {
|
|
29
|
-
features: {
|
|
30
|
-
delivery_mobile: deliveryMobile,
|
|
31
|
-
delivery_email: deliveryEmail,
|
|
32
|
-
},
|
|
33
|
-
customer_info: customerInfo,
|
|
34
|
-
},
|
|
35
|
-
notes: {
|
|
36
|
-
admin_notes: adminNotesItems,
|
|
37
|
-
user_notes: userNotesItems,
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
],
|
|
41
|
-
payment_method: {
|
|
42
|
-
type: paymentMethodType,
|
|
43
|
-
account: {
|
|
44
|
-
info: {
|
|
45
|
-
id: paymentMethodAccountId,
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
transaction: {
|
|
50
|
-
info: {
|
|
51
|
-
type: transactionType,
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
notes: {
|
|
55
|
-
admin_notes: adminNotes,
|
|
56
|
-
user_notes: userNotes,
|
|
57
|
-
},
|
|
58
|
-
validate: validate,
|
|
59
|
-
geo_coordinates: geoCoordinates,
|
|
60
|
-
};
|
|
61
|
-
return data;
|
|
62
|
-
};
|
|
63
|
-
return {
|
|
64
|
-
dataOrderRequest,
|
|
65
|
-
};
|
|
66
|
-
};
|
|
67
|
-
const dataSignUpApi = (values) => {
|
|
68
|
-
const client = new clientjs_1.ClientJS();
|
|
69
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { info: {
|
|
70
|
-
type: values.userType,
|
|
71
|
-
}, personal_info: {
|
|
72
|
-
title: "1",
|
|
73
|
-
first_name: values.firstName,
|
|
74
|
-
last_name: values.lastName,
|
|
75
|
-
date_of_birth: values.dateOfBirth,
|
|
76
|
-
gender: values.gender,
|
|
77
|
-
verification_status: 1,
|
|
78
|
-
}, address: {
|
|
79
|
-
country_code: values.country,
|
|
80
|
-
state_region: values.state,
|
|
81
|
-
verification_status: 0,
|
|
82
|
-
}, email: [
|
|
83
|
-
{
|
|
84
|
-
id: 0,
|
|
85
|
-
address: values.email,
|
|
86
|
-
is_primary: 1,
|
|
87
|
-
verification_status: 1,
|
|
88
|
-
},
|
|
89
|
-
], phone: [
|
|
90
|
-
{
|
|
91
|
-
id: 0,
|
|
92
|
-
type: 1,
|
|
93
|
-
country_code: values.country,
|
|
94
|
-
number: values.mobileNumber,
|
|
95
|
-
is_primary: 1,
|
|
96
|
-
verification_status: 1,
|
|
97
|
-
},
|
|
98
|
-
], authentication: [
|
|
99
|
-
{
|
|
100
|
-
type: 10,
|
|
101
|
-
code: values.mobileAuthenticationCode,
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
type: 9,
|
|
105
|
-
code: values.emailAuthenticationCode,
|
|
106
|
-
},
|
|
107
|
-
], security: {
|
|
108
|
-
password: values.password,
|
|
109
|
-
security_code: values.securityCode,
|
|
110
|
-
}, preferences: {
|
|
111
|
-
preferred_language_code: "en",
|
|
112
|
-
enable_promotion_notification: "1",
|
|
113
|
-
enable_email_notification: "1",
|
|
114
|
-
enable_sms_notification: "1",
|
|
115
|
-
enable_push_notification: "1",
|
|
116
|
-
enable_device_authentication: "1",
|
|
117
|
-
time_zone: "UTC +02:30",
|
|
118
|
-
}, currency: [
|
|
119
|
-
{
|
|
120
|
-
id: 0,
|
|
121
|
-
code: values.currency,
|
|
122
|
-
is_primary: 0,
|
|
123
|
-
},
|
|
124
|
-
], terms_conditions: {
|
|
125
|
-
id: 0,
|
|
126
|
-
acceptance: "1",
|
|
127
|
-
}, device: [
|
|
128
|
-
{
|
|
129
|
-
type: enum_1.DeviceType.Browser,
|
|
130
|
-
brand: `${client.getBrowser()}-${client.getBrowserVersion()}`,
|
|
131
|
-
os: client.getOS(),
|
|
132
|
-
status: enum_1.EntityStatus.Active,
|
|
133
|
-
verification_status: values.deviceVerificationStatus,
|
|
134
|
-
installation_id: values.installationID,
|
|
135
|
-
extended_info: {
|
|
136
|
-
cpu: client.getCPU(),
|
|
137
|
-
//fingerprint: fingerPrintHandler().fingerPrintCode,
|
|
138
|
-
system_language: client.getSystemLanguage(),
|
|
139
|
-
user_agent: client.getUserAgent(),
|
|
140
|
-
},
|
|
141
|
-
},
|
|
142
|
-
], custom_field: {
|
|
143
|
-
referral_code: values.referralCode,
|
|
144
|
-
type: values.referralCodeType,
|
|
145
|
-
}, geo_coordinates: values.geoCoordinates });
|
|
146
|
-
return data;
|
|
147
|
-
};
|
|
148
|
-
const dataSignUpWithGoogle = (values) => {
|
|
149
|
-
const client = new clientjs_1.ClientJS();
|
|
150
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { info: {
|
|
151
|
-
type: values.userType,
|
|
152
|
-
}, personal_info: {
|
|
153
|
-
title: "1",
|
|
154
|
-
first_name: values.firstName,
|
|
155
|
-
last_name: values.lastName,
|
|
156
|
-
date_of_birth: values.dateOfBirth,
|
|
157
|
-
gender: values.gender,
|
|
158
|
-
verification_status: 1,
|
|
159
|
-
}, address: {
|
|
160
|
-
country_code: values.country,
|
|
161
|
-
state_region: values.state,
|
|
162
|
-
verification_status: 0,
|
|
163
|
-
}, email: [
|
|
164
|
-
{
|
|
165
|
-
id: 0,
|
|
166
|
-
address: values.email,
|
|
167
|
-
is_primary: 1,
|
|
168
|
-
verification_status: 1,
|
|
169
|
-
},
|
|
170
|
-
], phone: [
|
|
171
|
-
{
|
|
172
|
-
id: 0,
|
|
173
|
-
type: 1,
|
|
174
|
-
country_code: values.country,
|
|
175
|
-
number: values.mobileNumber,
|
|
176
|
-
is_primary: 1,
|
|
177
|
-
verification_status: 1,
|
|
178
|
-
},
|
|
179
|
-
], authentication: [
|
|
180
|
-
{
|
|
181
|
-
type: 10,
|
|
182
|
-
code: values.mobileAuthenticationCode,
|
|
183
|
-
},
|
|
184
|
-
], security: {
|
|
185
|
-
password: values.password,
|
|
186
|
-
security_code: values.securityCode,
|
|
187
|
-
}, preferences: {
|
|
188
|
-
preferred_language_code: "en",
|
|
189
|
-
enable_promotion_notification: "1",
|
|
190
|
-
enable_email_notification: "1",
|
|
191
|
-
enable_sms_notification: "1",
|
|
192
|
-
enable_push_notification: "1",
|
|
193
|
-
enable_device_authentication: "1",
|
|
194
|
-
time_zone: "UTC +02:30",
|
|
195
|
-
}, currency: [
|
|
196
|
-
{
|
|
197
|
-
id: 0,
|
|
198
|
-
code: values.currency,
|
|
199
|
-
is_primary: 0,
|
|
200
|
-
},
|
|
201
|
-
], terms_conditions: {
|
|
202
|
-
id: 0,
|
|
203
|
-
acceptance: "1",
|
|
204
|
-
}, external_auth: [
|
|
205
|
-
{
|
|
206
|
-
id: 0,
|
|
207
|
-
login_id: values.loginId,
|
|
208
|
-
token: values.token,
|
|
209
|
-
status: 1,
|
|
210
|
-
type: 3,
|
|
211
|
-
verification_status: 1,
|
|
212
|
-
},
|
|
213
|
-
], device: [
|
|
214
|
-
{
|
|
215
|
-
type: enum_1.DeviceType.Browser,
|
|
216
|
-
brand: `${client.getBrowser()}-${client.getBrowserVersion()}`,
|
|
217
|
-
os: client.getOS(),
|
|
218
|
-
status: enum_1.EntityStatus.Active,
|
|
219
|
-
verification_status: values.deviceVerificationStatus,
|
|
220
|
-
installation_id: values.installationID,
|
|
221
|
-
extended_info: {
|
|
222
|
-
cpu: client.getCPU(),
|
|
223
|
-
//fingerprint: fingerPrintHandler().fingerPrintCode,
|
|
224
|
-
system_language: client.getSystemLanguage(),
|
|
225
|
-
user_agent: client.getUserAgent(),
|
|
226
|
-
},
|
|
227
|
-
},
|
|
228
|
-
], custom_field: {
|
|
229
|
-
referral_code: values.referralCode,
|
|
230
|
-
type: values.referralCodeType,
|
|
231
|
-
}, geo_coordinates: values.geoCoordinates, client_time_zone: `UTC ${dayjs_1.default.tz(new Date()).format("Z")}` });
|
|
232
|
-
return data;
|
|
233
|
-
};
|
|
234
|
-
const dataDevice = () => {
|
|
235
|
-
let dataCreateDevice = (values) => {
|
|
236
|
-
let { authenticationType, code, deviceVerificationStatus, installationID, geoCoordinates, } = values;
|
|
237
|
-
const client = new clientjs_1.ClientJS();
|
|
238
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { device: [
|
|
239
|
-
{
|
|
240
|
-
type: enum_1.DeviceType.Browser,
|
|
241
|
-
brand: `${client.getBrowser()}-${client.getBrowserVersion()}`,
|
|
242
|
-
os: client.getOS(),
|
|
243
|
-
status: enum_1.EntityStatus.Active,
|
|
244
|
-
verification_status: deviceVerificationStatus,
|
|
245
|
-
installation_id: installationID,
|
|
246
|
-
extended_info: {
|
|
247
|
-
cpu: client.getCPU(),
|
|
248
|
-
system_language: client.getSystemLanguage(),
|
|
249
|
-
user_agent: client.getUserAgent(),
|
|
250
|
-
},
|
|
251
|
-
},
|
|
252
|
-
], authentication: authenticationData(authenticationType, code), geo_coordinates: geoCoordinates });
|
|
253
|
-
return data;
|
|
254
|
-
};
|
|
255
|
-
let dataUpdateDevice = (values) => {
|
|
256
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { device: [
|
|
257
|
-
{
|
|
258
|
-
id: values.deviceId,
|
|
259
|
-
type: enum_1.DeviceType.Browser,
|
|
260
|
-
status: values === null || values === void 0 ? void 0 : values.deviceStatus,
|
|
261
|
-
verification_status: values === null || values === void 0 ? void 0 : values.deviceVerificationStatus,
|
|
262
|
-
is_online: values === null || values === void 0 ? void 0 : values.deviceIsOnline, // true 1, false 0
|
|
263
|
-
},
|
|
264
|
-
], geo_coordinates: values.geoCoordinates });
|
|
265
|
-
return data;
|
|
266
|
-
};
|
|
267
|
-
let dataDeleteDevice = (values) => {
|
|
268
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { device: [
|
|
269
|
-
{
|
|
270
|
-
id: values.deviceId,
|
|
271
|
-
},
|
|
272
|
-
], geo_coordinates: values.geoCoordinates });
|
|
273
|
-
return data;
|
|
274
|
-
};
|
|
275
|
-
let dataVerifyDevice = (values) => {
|
|
276
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { info: {
|
|
277
|
-
type: values.authenticationType,
|
|
278
|
-
authorization_request_type: enum_1.AuthorizationOperationRequestType.Update_Device_Verification_Status,
|
|
279
|
-
}, verify_data: {
|
|
280
|
-
device: {
|
|
281
|
-
id: values.deviceId,
|
|
282
|
-
},
|
|
283
|
-
}, geo_coordinates: values.geoCoordinates });
|
|
284
|
-
return data;
|
|
285
|
-
};
|
|
286
|
-
const dataConfirmDevice = (values) => {
|
|
287
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { info: {
|
|
288
|
-
type: values.authenticationType,
|
|
289
|
-
authorization_request_type: enum_1.AuthorizationOperationRequestType.Update_Device_Verification_Status,
|
|
290
|
-
}, verify_data: {
|
|
291
|
-
device: {
|
|
292
|
-
id: values.deviceId,
|
|
293
|
-
},
|
|
294
|
-
}, confirm_data: {
|
|
295
|
-
verification_code: values.code,
|
|
296
|
-
}, geo_coordinates: values.geoCoordinates });
|
|
297
|
-
return data;
|
|
298
|
-
};
|
|
299
|
-
const dataLogoutDevice = (values) => {
|
|
300
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { device: [
|
|
301
|
-
{
|
|
302
|
-
id: values.deviceId,
|
|
303
|
-
},
|
|
304
|
-
], geo_coordinates: values.geoCoordinates });
|
|
305
|
-
return data;
|
|
306
|
-
};
|
|
307
|
-
return {
|
|
308
|
-
dataCreateDevice,
|
|
309
|
-
dataUpdateDevice,
|
|
310
|
-
dataDeleteDevice,
|
|
311
|
-
dataVerifyDevice,
|
|
312
|
-
dataConfirmDevice,
|
|
313
|
-
dataLogoutDevice,
|
|
314
|
-
};
|
|
315
|
-
};
|
|
316
|
-
const dataOrganization = () => {
|
|
317
|
-
let dataCreateOrganization = (values, userId) => {
|
|
318
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { info: {
|
|
319
|
-
name: values.name,
|
|
320
|
-
local_name: values.localName,
|
|
321
|
-
status: 1,
|
|
322
|
-
verification_status: 0,
|
|
323
|
-
type: values.organizationType,
|
|
324
|
-
entity: enum_1.Entity.User,
|
|
325
|
-
entity_id: userId,
|
|
326
|
-
}, details: {
|
|
327
|
-
established_date: values.establishedDate,
|
|
328
|
-
registration_number: values.registrationNumber,
|
|
329
|
-
trade_license_number: values.tradeLicenseNumber,
|
|
330
|
-
}, address: [
|
|
331
|
-
{
|
|
332
|
-
type: enum_1.AddressType.Work,
|
|
333
|
-
is_primary: 1,
|
|
334
|
-
is_billing: values.isBilling,
|
|
335
|
-
address_line1: values.addressLine1,
|
|
336
|
-
address_line2: values.addressLine2,
|
|
337
|
-
postal_zip_code: values.postalZipCode,
|
|
338
|
-
country_code: values.countryCode,
|
|
339
|
-
state_region: values.stateRegion,
|
|
340
|
-
city_town: values.cityTown,
|
|
341
|
-
status: 1,
|
|
342
|
-
},
|
|
343
|
-
], geo_coordinates: values.geoCoordinates });
|
|
344
|
-
return data;
|
|
345
|
-
};
|
|
346
|
-
let dataUpdateOrganization = (values, userId) => {
|
|
347
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { info: {
|
|
348
|
-
name: values.name,
|
|
349
|
-
local_name: values.localName,
|
|
350
|
-
status: values.status,
|
|
351
|
-
verification_status: 0,
|
|
352
|
-
type: values.organizationType,
|
|
353
|
-
entity: enum_1.Entity.User,
|
|
354
|
-
entity_id: userId,
|
|
355
|
-
}, details: {
|
|
356
|
-
registration_number: values.registrationNumber,
|
|
357
|
-
trade_license_number: values.tradeLicenseNumber,
|
|
358
|
-
}, address: [
|
|
359
|
-
{
|
|
360
|
-
id: values.addressId,
|
|
361
|
-
type: enum_1.AddressType.Work,
|
|
362
|
-
is_primary: 1,
|
|
363
|
-
is_billing: values.isBilling,
|
|
364
|
-
address_line1: values.addressLine1,
|
|
365
|
-
address_line2: values.addressLine2,
|
|
366
|
-
postal_zip_code: values.postalZipCode,
|
|
367
|
-
country_code: values.countryCode,
|
|
368
|
-
state_region: values.stateRegion,
|
|
369
|
-
city_town: values.cityTown,
|
|
370
|
-
status: 1,
|
|
371
|
-
},
|
|
372
|
-
], geo_coordinates: values.geoCoordinates });
|
|
373
|
-
return data;
|
|
374
|
-
};
|
|
375
|
-
let dataCreateDocumentOrganization = (values) => {
|
|
376
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { info: {
|
|
377
|
-
type: enum_1.DocumentType.Organization_Document,
|
|
378
|
-
language: "en",
|
|
379
|
-
subject: values.subject,
|
|
380
|
-
}, attachment: values.attachment, custom_field: {
|
|
381
|
-
"custom notes": "jpg document",
|
|
382
|
-
}, validate: "0", geo_coordinates: values.geoCoordinates });
|
|
383
|
-
return data;
|
|
384
|
-
};
|
|
385
|
-
return {
|
|
386
|
-
dataCreateOrganization,
|
|
387
|
-
dataUpdateOrganization,
|
|
388
|
-
dataCreateDocumentOrganization,
|
|
389
|
-
};
|
|
390
|
-
};
|
|
391
|
-
const authenticationData = (type, code) => {
|
|
392
|
-
if (type && code)
|
|
393
|
-
return [
|
|
394
|
-
{
|
|
395
|
-
type: type,
|
|
396
|
-
code: code,
|
|
397
|
-
},
|
|
398
|
-
];
|
|
399
|
-
return null;
|
|
400
|
-
};
|
|
401
|
-
const dataAddress = () => {
|
|
402
|
-
const createDataAddress = (values) => {
|
|
403
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { addresses: [
|
|
404
|
-
{
|
|
405
|
-
type: values.type,
|
|
406
|
-
address_line1: values.addressLine1,
|
|
407
|
-
address_line2: values.addressLine2,
|
|
408
|
-
country_code: values.countryCode,
|
|
409
|
-
city_town: values.cityTown,
|
|
410
|
-
state_region: values.stateRegion,
|
|
411
|
-
verification_status: 0,
|
|
412
|
-
postal_zip_code: values.postalZipCode,
|
|
413
|
-
},
|
|
414
|
-
], geo_coordinates: values.geoCoordinates });
|
|
415
|
-
return data;
|
|
416
|
-
};
|
|
417
|
-
const updateDataAddress = (values) => {
|
|
418
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { addresses: [
|
|
419
|
-
{
|
|
420
|
-
id: values.id,
|
|
421
|
-
type: values.type,
|
|
422
|
-
address_line1: values.addressLine1,
|
|
423
|
-
address_line2: values.addressLine2,
|
|
424
|
-
country_code: values.countryCode,
|
|
425
|
-
city_town: values.cityTown,
|
|
426
|
-
state_region: values.stateRegion,
|
|
427
|
-
verification_status: 0,
|
|
428
|
-
postal_zip_code: values.postalZipCode,
|
|
429
|
-
},
|
|
430
|
-
], geo_coordinates: values.geoCoordinates });
|
|
431
|
-
return data;
|
|
432
|
-
};
|
|
433
|
-
const deleteDataAddress = (values) => {
|
|
434
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { addresses: [
|
|
435
|
-
{
|
|
436
|
-
id: values.id,
|
|
437
|
-
},
|
|
438
|
-
], geo_coordinates: values.geoCoordinates });
|
|
439
|
-
return data;
|
|
440
|
-
};
|
|
441
|
-
const primaryDataAddress = (values) => {
|
|
442
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { addresses: [
|
|
443
|
-
{
|
|
444
|
-
id: values.id,
|
|
445
|
-
is_primary: 1,
|
|
446
|
-
},
|
|
447
|
-
], geo_coordinates: values.geoCoordinates });
|
|
448
|
-
return data;
|
|
449
|
-
};
|
|
450
|
-
return {
|
|
451
|
-
createDataAddress,
|
|
452
|
-
updateDataAddress,
|
|
453
|
-
deleteDataAddress,
|
|
454
|
-
primaryDataAddress,
|
|
455
|
-
};
|
|
456
|
-
};
|
|
457
|
-
const dataEmail = () => {
|
|
458
|
-
const createDataEmail = (values) => {
|
|
459
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { email: [
|
|
460
|
-
{
|
|
461
|
-
address: values.address,
|
|
462
|
-
is_primary: "0",
|
|
463
|
-
},
|
|
464
|
-
], geo_coordinates: values.geoCoordinates });
|
|
465
|
-
return data;
|
|
466
|
-
};
|
|
467
|
-
const verifyDataEmail = (values) => {
|
|
468
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { verify_data: {
|
|
469
|
-
email: {
|
|
470
|
-
address: values.address,
|
|
471
|
-
},
|
|
472
|
-
}, info: {
|
|
473
|
-
type: "9",
|
|
474
|
-
}, geo_coordinates: values.geoCoordinates });
|
|
475
|
-
return data;
|
|
476
|
-
};
|
|
477
|
-
const confirmDataEmail = (values) => {
|
|
478
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { verify_data: {
|
|
479
|
-
email: {
|
|
480
|
-
address: values.address,
|
|
481
|
-
},
|
|
482
|
-
}, confirm_data: {
|
|
483
|
-
verification_code: values.verificationCode,
|
|
484
|
-
}, info: {
|
|
485
|
-
type: "9",
|
|
486
|
-
}, geo_coordinates: values.geoCoordinates });
|
|
487
|
-
return data;
|
|
488
|
-
};
|
|
489
|
-
const updateDataEmail = (values) => {
|
|
490
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { email: [
|
|
491
|
-
{
|
|
492
|
-
id: values.id,
|
|
493
|
-
address: values.address,
|
|
494
|
-
verification_status: 0,
|
|
495
|
-
},
|
|
496
|
-
], geo_coordinates: values.geoCoordinates });
|
|
497
|
-
return data;
|
|
498
|
-
};
|
|
499
|
-
const deleteDataEmail = (values) => {
|
|
500
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { email: [
|
|
501
|
-
{
|
|
502
|
-
id: values.id,
|
|
503
|
-
},
|
|
504
|
-
], geo_coordinates: values.geoCoordinates });
|
|
505
|
-
return data;
|
|
506
|
-
};
|
|
507
|
-
const primaryDataEmail = (values) => {
|
|
508
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { email: [
|
|
509
|
-
{
|
|
510
|
-
id: values.id,
|
|
511
|
-
address: values.address,
|
|
512
|
-
is_primary: 1,
|
|
513
|
-
},
|
|
514
|
-
], geo_coordinates: values.geoCoordinates });
|
|
515
|
-
return data;
|
|
516
|
-
};
|
|
517
|
-
return {
|
|
518
|
-
createDataEmail,
|
|
519
|
-
verifyDataEmail,
|
|
520
|
-
confirmDataEmail,
|
|
521
|
-
updateDataEmail,
|
|
522
|
-
deleteDataEmail,
|
|
523
|
-
primaryDataEmail,
|
|
524
|
-
};
|
|
525
|
-
};
|
|
526
|
-
const dataPhone = () => {
|
|
527
|
-
const createDataPhone = (values) => {
|
|
528
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { phone: [
|
|
529
|
-
{
|
|
530
|
-
type: "0",
|
|
531
|
-
country_code: values.countryCode,
|
|
532
|
-
number: values.number,
|
|
533
|
-
verification_status: "0",
|
|
534
|
-
is_primary: "0",
|
|
535
|
-
},
|
|
536
|
-
], geo_coordinates: values.geoCoordinates });
|
|
537
|
-
return data;
|
|
538
|
-
};
|
|
539
|
-
const deleteDataPhone = (values) => {
|
|
540
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { phone: [
|
|
541
|
-
{
|
|
542
|
-
id: values.id,
|
|
543
|
-
},
|
|
544
|
-
], geo_coordinates: values.geoCoordinates });
|
|
545
|
-
return data;
|
|
546
|
-
};
|
|
547
|
-
const verifyDataPhone = (values) => {
|
|
548
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { verify_data: {
|
|
549
|
-
phone: {
|
|
550
|
-
number: values.number,
|
|
551
|
-
},
|
|
552
|
-
}, info: {
|
|
553
|
-
type: "10",
|
|
554
|
-
}, geo_coordinates: values.geoCoordinates });
|
|
555
|
-
return data;
|
|
556
|
-
};
|
|
557
|
-
const confirmDataPhone = (values) => {
|
|
558
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { verify_data: {
|
|
559
|
-
phone: {
|
|
560
|
-
number: values.number,
|
|
561
|
-
},
|
|
562
|
-
}, confirm_data: {
|
|
563
|
-
verification_code: values.verificationCode,
|
|
564
|
-
}, info: {
|
|
565
|
-
type: "10",
|
|
566
|
-
}, geo_coordinates: values.geoCoordinates });
|
|
567
|
-
return data;
|
|
568
|
-
};
|
|
569
|
-
const updateDataPhone = (values) => {
|
|
570
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { phone: [
|
|
571
|
-
{
|
|
572
|
-
id: values.id,
|
|
573
|
-
number: values.number,
|
|
574
|
-
verification_status: 0,
|
|
575
|
-
},
|
|
576
|
-
], geo_coordinates: values.geoCoordinates });
|
|
577
|
-
return data;
|
|
578
|
-
};
|
|
579
|
-
const makePrimaryDataPhone = (values) => {
|
|
580
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { phone: [
|
|
581
|
-
{
|
|
582
|
-
id: values.id,
|
|
583
|
-
number: values.number,
|
|
584
|
-
is_primary: 1,
|
|
585
|
-
},
|
|
586
|
-
], geo_coordinates: values.geoCoordinates });
|
|
587
|
-
return data;
|
|
588
|
-
};
|
|
589
|
-
return {
|
|
590
|
-
createDataPhone,
|
|
591
|
-
deleteDataPhone,
|
|
592
|
-
verifyDataPhone,
|
|
593
|
-
confirmDataPhone,
|
|
594
|
-
updateDataPhone,
|
|
595
|
-
makePrimaryDataPhone,
|
|
596
|
-
};
|
|
597
|
-
};
|
|
598
|
-
const dataBank = () => {
|
|
599
|
-
const createDataBank = (values) => {
|
|
600
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { bank_account: [
|
|
601
|
-
{
|
|
602
|
-
name: values.name,
|
|
603
|
-
holder_name: values.holderName,
|
|
604
|
-
country_code: values.countryCode,
|
|
605
|
-
currency_code: values.currencyCode,
|
|
606
|
-
settlement_currency_code: values.settlementCurrency,
|
|
607
|
-
type: enum_1.BankAccountTypes.Personal_Checking,
|
|
608
|
-
number: values.number,
|
|
609
|
-
swift_code: values.swiftCode,
|
|
610
|
-
iban: values.iban,
|
|
611
|
-
transit_number: values.transitNumber,
|
|
612
|
-
institution_number: values.institutionNumber,
|
|
613
|
-
routing_number: values.routingNumber,
|
|
614
|
-
beneficiary_type: enum_1.BankBeneficiaryType.My_Account,
|
|
615
|
-
verification_status: 0,
|
|
616
|
-
bank_address: values.bankAddress,
|
|
617
|
-
state_region: values.stateRegion || "",
|
|
618
|
-
},
|
|
619
|
-
], geo_coordinates: values.geoCoordinates });
|
|
620
|
-
return data;
|
|
621
|
-
};
|
|
622
|
-
const updateDataBank = (values) => {
|
|
623
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { bank_account: [
|
|
624
|
-
{
|
|
625
|
-
id: values.id,
|
|
626
|
-
name: values.name,
|
|
627
|
-
holder_name: values.holderName,
|
|
628
|
-
country_code: values.countryCode,
|
|
629
|
-
currency_code: values.currencyCode,
|
|
630
|
-
settlement_currency_code: values.settlementCurrency,
|
|
631
|
-
type: enum_1.BankAccountTypes.Personal_Checking,
|
|
632
|
-
number: values.number,
|
|
633
|
-
swift_code: values.swiftCode,
|
|
634
|
-
iban: values.iban,
|
|
635
|
-
transit_number: values.transitNumber,
|
|
636
|
-
institution_number: values.institutionNumber,
|
|
637
|
-
routing_number: values.routingNumber,
|
|
638
|
-
status: values.status,
|
|
639
|
-
beneficiary_type: enum_1.BankBeneficiaryType.My_Account,
|
|
640
|
-
verification_status: 0,
|
|
641
|
-
bank_address: values.bankAddress,
|
|
642
|
-
state_region: values.stateRegion || "",
|
|
643
|
-
},
|
|
644
|
-
], geo_coordinates: values.geoCoordinates });
|
|
645
|
-
return data;
|
|
646
|
-
};
|
|
647
|
-
const deleteDataBank = (values) => {
|
|
648
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { bank_account: [
|
|
649
|
-
{
|
|
650
|
-
id: values.id,
|
|
651
|
-
},
|
|
652
|
-
], geo_coordinates: values.geoCoordinates });
|
|
653
|
-
return data;
|
|
654
|
-
};
|
|
655
|
-
const primaryDataBank = (values) => {
|
|
656
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { bank_account: [
|
|
657
|
-
{
|
|
658
|
-
id: values.id,
|
|
659
|
-
is_primary: 1,
|
|
660
|
-
},
|
|
661
|
-
], geo_coordinates: values.geoCoordinates });
|
|
662
|
-
return data;
|
|
663
|
-
};
|
|
664
|
-
return {
|
|
665
|
-
createDataBank,
|
|
666
|
-
updateDataBank,
|
|
667
|
-
deleteDataBank,
|
|
668
|
-
primaryDataBank,
|
|
669
|
-
};
|
|
670
|
-
};
|
|
671
|
-
const dataIdentification = () => {
|
|
672
|
-
const createDataIdentification = (values) => {
|
|
673
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { identification: [
|
|
674
|
-
{
|
|
675
|
-
type: values.type,
|
|
676
|
-
country_of_issue: values.countryOfIssue,
|
|
677
|
-
country_of_residence: values.countryOfResidence,
|
|
678
|
-
issue_date: values.issueDate,
|
|
679
|
-
expiry_date: values.expiryDate,
|
|
680
|
-
number: values.number,
|
|
681
|
-
verification_status: 0,
|
|
682
|
-
},
|
|
683
|
-
], geo_coordinates: values.geoCoordinates });
|
|
684
|
-
return data;
|
|
685
|
-
};
|
|
686
|
-
const updateDataIdentification = (values) => {
|
|
687
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { identification: [
|
|
688
|
-
{
|
|
689
|
-
id: values.id,
|
|
690
|
-
type: values.type,
|
|
691
|
-
country_of_issue: values.countryOfIssue,
|
|
692
|
-
country_of_residence: values.countryOfResidence,
|
|
693
|
-
issue_date: values.issueDate,
|
|
694
|
-
expiry_date: values.expiryDate,
|
|
695
|
-
number: values.number,
|
|
696
|
-
verification_status: 0,
|
|
697
|
-
},
|
|
698
|
-
], geo_coordinates: values.geoCoordinates });
|
|
699
|
-
return data;
|
|
700
|
-
};
|
|
701
|
-
const deleteDataIdentification = (values) => {
|
|
702
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { identification: [
|
|
703
|
-
{
|
|
704
|
-
id: values.id,
|
|
705
|
-
},
|
|
706
|
-
], geo_coordinates: values.geoCoordinates });
|
|
707
|
-
return data;
|
|
708
|
-
};
|
|
709
|
-
return {
|
|
710
|
-
createDataIdentification,
|
|
711
|
-
updateDataIdentification,
|
|
712
|
-
deleteDataIdentification,
|
|
713
|
-
};
|
|
714
|
-
};
|
|
715
|
-
const dataDocument = (values) => {
|
|
716
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { info: {
|
|
717
|
-
subject: values.subject,
|
|
718
|
-
entity: values.entity,
|
|
719
|
-
entity_id: values.entityID,
|
|
720
|
-
type: values.type,
|
|
721
|
-
}, attachment: values.attachment, geo_coordinates: values.geoCoordinates });
|
|
722
|
-
return data;
|
|
723
|
-
};
|
|
724
|
-
const dataPersonalInfo = () => {
|
|
725
|
-
const updateDataPersonalInfo = (values) => {
|
|
726
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { personal_info: {
|
|
727
|
-
first_name: values.firstName,
|
|
728
|
-
last_name: values.lastName,
|
|
729
|
-
gender: values.gender,
|
|
730
|
-
date_of_birth: values.dateOfBirth,
|
|
731
|
-
}, geo_coordinates: values.geoCoordinates });
|
|
732
|
-
return data;
|
|
733
|
-
};
|
|
734
|
-
const updateProfilePicture = (values) => {
|
|
735
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { info: {
|
|
736
|
-
type: 1,
|
|
737
|
-
subject: "profile picture",
|
|
738
|
-
}, attachment: [
|
|
739
|
-
{
|
|
740
|
-
file_name: values.fileName,
|
|
741
|
-
file_extension: values.fileExtension,
|
|
742
|
-
content: values.content,
|
|
743
|
-
},
|
|
744
|
-
], geo_coordinates: values.geoCoordinates });
|
|
745
|
-
return data;
|
|
746
|
-
};
|
|
747
|
-
return {
|
|
748
|
-
updateDataPersonalInfo,
|
|
749
|
-
updateProfilePicture,
|
|
750
|
-
};
|
|
751
|
-
};
|
|
752
|
-
const dataSecurity = () => {
|
|
753
|
-
const resetDataPassword = (values) => {
|
|
754
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { reset_security_data: {
|
|
755
|
-
reset_password: {
|
|
756
|
-
current_password: values.currentPassword,
|
|
757
|
-
new_password: values.newPassword,
|
|
758
|
-
},
|
|
759
|
-
}, info: {
|
|
760
|
-
type: "1",
|
|
761
|
-
}, authentication: [
|
|
762
|
-
{
|
|
763
|
-
type: values.authenticationType,
|
|
764
|
-
code: values.code,
|
|
765
|
-
},
|
|
766
|
-
], geo_coordinates: values.geoCoordinates });
|
|
767
|
-
return data;
|
|
768
|
-
};
|
|
769
|
-
const resetDataQuestion = (values) => {
|
|
770
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { reset_security_data: {
|
|
771
|
-
reset_security_questions: {
|
|
772
|
-
current_password: values.currentPassword,
|
|
773
|
-
secret_question_1: values.questionOne,
|
|
774
|
-
secret_answer_1: values.questionOneAnswer,
|
|
775
|
-
secret_question_2: values.questionTwo,
|
|
776
|
-
secret_answer_2: values.questionTwoAnswer,
|
|
777
|
-
},
|
|
778
|
-
}, info: {
|
|
779
|
-
type: "4",
|
|
780
|
-
}, authentication: [
|
|
781
|
-
{
|
|
782
|
-
type: values.authenticationType,
|
|
783
|
-
code: values.code,
|
|
784
|
-
},
|
|
785
|
-
], geo_coordinates: values.geoCoordinates });
|
|
786
|
-
return data;
|
|
787
|
-
};
|
|
788
|
-
const changeDataSecurityCode = (values) => {
|
|
789
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { reset_security_data: {
|
|
790
|
-
reset_security_code: {
|
|
791
|
-
current_password: values.currentPassword,
|
|
792
|
-
new_security_code: values.userSecurityCode,
|
|
793
|
-
},
|
|
794
|
-
}, info: {
|
|
795
|
-
type: "2",
|
|
796
|
-
}, authentication: [
|
|
797
|
-
{
|
|
798
|
-
type: values.authenticationType,
|
|
799
|
-
code: values.code,
|
|
800
|
-
},
|
|
801
|
-
], geo_coordinates: values.geoCoordinates });
|
|
802
|
-
return data;
|
|
803
|
-
};
|
|
804
|
-
const updateDataUserPreferences = (values) => {
|
|
805
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { preferences: {
|
|
806
|
-
preferred_language_code: values.preferredLanguageCode,
|
|
807
|
-
enable_promotion_notification: values.enablePromotionNotification,
|
|
808
|
-
enable_sms_notification: values.enableSMSNotification,
|
|
809
|
-
enable_push_notification: values.enablePushNotification,
|
|
810
|
-
}, geo_coordinates: values.geoCoordinates });
|
|
811
|
-
return data;
|
|
812
|
-
};
|
|
813
|
-
const dataValidateSecurityCode = (values) => {
|
|
814
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { validate_data: {
|
|
815
|
-
security_code: values.securityCode,
|
|
816
|
-
}, info: {
|
|
817
|
-
type: values.type,
|
|
818
|
-
}, geo_coordinates: values.geoCoordinates });
|
|
819
|
-
return data;
|
|
820
|
-
};
|
|
821
|
-
const dataEnrollGoogleAuth = () => {
|
|
822
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { authentication_data: [
|
|
823
|
-
{
|
|
824
|
-
type: 11,
|
|
825
|
-
},
|
|
826
|
-
] });
|
|
827
|
-
return data;
|
|
828
|
-
};
|
|
829
|
-
const dataActivateGoogleAuth = (values) => {
|
|
830
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { authentication_data: [
|
|
831
|
-
{
|
|
832
|
-
type: 11,
|
|
833
|
-
code: values.code,
|
|
834
|
-
},
|
|
835
|
-
], geo_coordinates: values.geoCoordinates });
|
|
836
|
-
return data;
|
|
837
|
-
};
|
|
838
|
-
const dataDeleteGoogleAuth = (values) => {
|
|
839
|
-
let data = {
|
|
840
|
-
authentication: [
|
|
841
|
-
{
|
|
842
|
-
type: values.authenticationType,
|
|
843
|
-
code: values.code,
|
|
844
|
-
},
|
|
845
|
-
],
|
|
846
|
-
geo_coordinates: values.geoCoordinates,
|
|
847
|
-
};
|
|
848
|
-
return data;
|
|
849
|
-
};
|
|
850
|
-
return {
|
|
851
|
-
resetDataPassword,
|
|
852
|
-
resetDataQuestion,
|
|
853
|
-
changeDataSecurityCode,
|
|
854
|
-
updateDataUserPreferences,
|
|
855
|
-
dataValidateSecurityCode,
|
|
856
|
-
dataEnrollGoogleAuth,
|
|
857
|
-
dataActivateGoogleAuth,
|
|
858
|
-
dataDeleteGoogleAuth,
|
|
859
|
-
};
|
|
860
|
-
};
|
|
861
|
-
const dataValidate = () => {
|
|
862
|
-
let dataValidatePhone = (values) => {
|
|
863
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { info: {
|
|
864
|
-
type: 10,
|
|
865
|
-
}, validate_data: {
|
|
866
|
-
phone: {
|
|
867
|
-
country_code: values.countryCode,
|
|
868
|
-
number: values.number,
|
|
869
|
-
},
|
|
870
|
-
}, geo_coordinates: values.geoCoordinates });
|
|
871
|
-
return data;
|
|
872
|
-
};
|
|
873
|
-
let dataVerifyEmail = (values) => {
|
|
874
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { info: {
|
|
875
|
-
type: 9,
|
|
876
|
-
}, verify_data: {
|
|
877
|
-
email: {
|
|
878
|
-
address: values.address,
|
|
879
|
-
},
|
|
880
|
-
}, geo_coordinates: values.geoCoordinates });
|
|
881
|
-
return data;
|
|
882
|
-
};
|
|
883
|
-
let dataVerifyPhone = (values) => {
|
|
884
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { info: {
|
|
885
|
-
type: 10,
|
|
886
|
-
}, verify_data: {
|
|
887
|
-
phone: {
|
|
888
|
-
number: values.number,
|
|
889
|
-
},
|
|
890
|
-
}, geo_coordinates: values.geoCoordinates });
|
|
891
|
-
return data;
|
|
892
|
-
};
|
|
893
|
-
let dataSendOTPPhone = (values) => {
|
|
894
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { info: {
|
|
895
|
-
type: 6,
|
|
896
|
-
authorization_request_type: values.authorizationRequestType,
|
|
897
|
-
}, verify_data: {
|
|
898
|
-
phone: {
|
|
899
|
-
number: values.number,
|
|
900
|
-
},
|
|
901
|
-
}, geo_coordinates: values.geoCoordinates });
|
|
902
|
-
return data;
|
|
903
|
-
};
|
|
904
|
-
let dataSendOTPEmail = (values) => {
|
|
905
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { info: {
|
|
906
|
-
type: 7,
|
|
907
|
-
authorization_request_type: values.authorizationRequestType,
|
|
908
|
-
}, verify_data: {
|
|
909
|
-
email: {
|
|
910
|
-
address: values.address,
|
|
911
|
-
},
|
|
912
|
-
}, geo_coordinates: values.geoCoordinates });
|
|
913
|
-
return data;
|
|
914
|
-
};
|
|
915
|
-
let dataConfirmEmail = (values) => {
|
|
916
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { info: {
|
|
917
|
-
type: 9,
|
|
918
|
-
}, verify_data: {
|
|
919
|
-
email: {
|
|
920
|
-
address: values.address,
|
|
921
|
-
},
|
|
922
|
-
}, confirm_data: {
|
|
923
|
-
verification_code: values.verificationCode,
|
|
924
|
-
}, geo_coordinates: values.geoCoordinates });
|
|
925
|
-
return data;
|
|
926
|
-
};
|
|
927
|
-
let dataConfirmPhone = (values) => {
|
|
928
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { info: {
|
|
929
|
-
type: 10,
|
|
930
|
-
}, verify_data: {
|
|
931
|
-
phone: {
|
|
932
|
-
number: values.number,
|
|
933
|
-
},
|
|
934
|
-
}, confirm_data: {
|
|
935
|
-
verification_code: values.verificationCode,
|
|
936
|
-
verification_status: 1,
|
|
937
|
-
}, geo_coordinates: values.geoCoordinates });
|
|
938
|
-
return data;
|
|
939
|
-
};
|
|
940
|
-
let dataISEmailUsed = (values) => {
|
|
941
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { info: {
|
|
942
|
-
type: 8,
|
|
943
|
-
}, validate_data: {
|
|
944
|
-
email: {
|
|
945
|
-
id: 0,
|
|
946
|
-
address: values.emailAddress,
|
|
947
|
-
},
|
|
948
|
-
}, geo_coordinates: values.geoCoordinates });
|
|
949
|
-
return data;
|
|
950
|
-
};
|
|
951
|
-
let dataIsPhoneUsed = (values) => {
|
|
952
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { info: {
|
|
953
|
-
type: 9,
|
|
954
|
-
}, validate_data: {
|
|
955
|
-
phone: {
|
|
956
|
-
id: 0,
|
|
957
|
-
number: values.mobileNumber,
|
|
958
|
-
},
|
|
959
|
-
}, geo_coordinates: values.geoCoordinates });
|
|
960
|
-
return data;
|
|
961
|
-
};
|
|
962
|
-
const dataValidateForgetPassword = (values) => {
|
|
963
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { validate_data: {
|
|
964
|
-
email: values.email,
|
|
965
|
-
phone: values.phone,
|
|
966
|
-
additional_security_type: values.additional_security_type,
|
|
967
|
-
additional_security_value: values.additional_security_value,
|
|
968
|
-
}, info: {
|
|
969
|
-
type: values.type,
|
|
970
|
-
}, geo_coordinates: values.geoCoordinates });
|
|
971
|
-
return data;
|
|
972
|
-
};
|
|
973
|
-
const dataConfirmForgetPassword = (values) => {
|
|
974
|
-
let data = Object.assign(Object.assign({}, data_1.userData), { confirm_data: {
|
|
975
|
-
password: values.password,
|
|
976
|
-
verification_code: values.verification_code,
|
|
977
|
-
}, info: {
|
|
978
|
-
type: values.type,
|
|
979
|
-
user_id: values.user_id,
|
|
980
|
-
sub_entity: values.sub_entity,
|
|
981
|
-
sub_entity_id: values.sub_entity_id,
|
|
982
|
-
}, geo_coordinates: values.geoCoordinates });
|
|
983
|
-
return data;
|
|
984
|
-
};
|
|
985
|
-
return {
|
|
986
|
-
dataValidatePhone,
|
|
987
|
-
dataVerifyEmail,
|
|
988
|
-
dataVerifyPhone,
|
|
989
|
-
dataConfirmEmail,
|
|
990
|
-
dataConfirmPhone,
|
|
991
|
-
dataISEmailUsed,
|
|
992
|
-
dataIsPhoneUsed,
|
|
993
|
-
dataSendOTPEmail,
|
|
994
|
-
dataSendOTPPhone,
|
|
995
|
-
dataValidateForgetPassword,
|
|
996
|
-
dataConfirmForgetPassword,
|
|
997
|
-
};
|
|
998
|
-
};
|
|
999
|
-
const dataAccount = () => {
|
|
1000
|
-
let dataDoTransaction = (values) => {
|
|
1001
|
-
const data = Object.assign(Object.assign({}, data_1.userData), { info: {
|
|
1002
|
-
type: values.type,
|
|
1003
|
-
amount: values.amount,
|
|
1004
|
-
currency: values.currency,
|
|
1005
|
-
notes: values.note,
|
|
1006
|
-
}, account: {
|
|
1007
|
-
info: {
|
|
1008
|
-
id: values.accountId,
|
|
1009
|
-
},
|
|
1010
|
-
}, validate: values.validate, bank_account: {
|
|
1011
|
-
id: values === null || values === void 0 ? void 0 : values.bankId,
|
|
1012
|
-
}, geo_coordinates: values.geoCoordinates });
|
|
1013
|
-
return data;
|
|
1014
|
-
};
|
|
1015
|
-
let paramGetTransaction = (values, userId) => {
|
|
1016
|
-
let data = {
|
|
1017
|
-
user_id: userId,
|
|
1018
|
-
status: values.status,
|
|
1019
|
-
page_size: values.page_size,
|
|
1020
|
-
from_date: values.from_date,
|
|
1021
|
-
to_date: values.to_date,
|
|
1022
|
-
start_index: values.start_index,
|
|
1023
|
-
transaction_type: values.transaction_type,
|
|
1024
|
-
account_id: values.account_id,
|
|
1025
|
-
classification: values.classification,
|
|
1026
|
-
geo_coordinates: values.geoCoordinates,
|
|
1027
|
-
time_zone: `UTC ${dayjs_1.default.tz(new Date()).format("Z")}`,
|
|
1028
|
-
};
|
|
1029
|
-
return data;
|
|
1030
|
-
};
|
|
1031
|
-
return { dataDoTransaction, paramGetTransaction };
|
|
1032
|
-
};
|
|
1033
|
-
return {
|
|
1034
|
-
dataSignUpApi,
|
|
1035
|
-
dataSignUpWithGoogle,
|
|
1036
|
-
dataAddress,
|
|
1037
|
-
dataEmail,
|
|
1038
|
-
dataPhone,
|
|
1039
|
-
dataBank,
|
|
1040
|
-
dataIdentification,
|
|
1041
|
-
dataDocument,
|
|
1042
|
-
dataPersonalInfo,
|
|
1043
|
-
dataSecurity,
|
|
1044
|
-
dataValidate,
|
|
1045
|
-
dataAccount,
|
|
1046
|
-
dataDevice,
|
|
1047
|
-
dataOrder,
|
|
1048
|
-
dataOrganization,
|
|
1049
|
-
};
|
|
1050
|
-
};
|
|
1051
|
-
exports.default = Data;
|