@cuenca-mx/cuenca-js 1.2.2-dev0 → 2.0.0-dev0
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/CHANGELOG.md +19 -0
- package/build/data-91da6d58.mjs +625 -0
- package/build/data-ca00ac2d.cjs +669 -0
- package/build/dts/client/client.d.ts +86 -0
- package/build/dts/client/index.d.ts +1 -0
- package/build/dts/errors.d.ts +25 -0
- package/build/dts/helpers/case.d.ts +5 -0
- package/build/dts/helpers/data.d.ts +3 -0
- package/build/dts/helpers/env.d.ts +7 -0
- package/build/dts/index.d.ts +52 -0
- package/build/dts/jwt.d.ts +8 -0
- package/build/dts/models/account.d.ts +12 -0
- package/build/dts/models/alert.d.ts +32 -0
- package/build/dts/models/apiKey.d.ts +13 -0
- package/build/dts/models/arpc.d.ts +10 -0
- package/build/dts/models/balanceEntry.d.ts +15 -0
- package/build/dts/models/baseUser.d.ts +23 -0
- package/build/dts/models/billPayment.d.ts +10 -0
- package/build/dts/models/bridgeAccount.d.ts +27 -0
- package/build/dts/models/bridgeBankAccount.d.ts +16 -0
- package/build/dts/models/bridgeClabe.d.ts +12 -0
- package/build/dts/models/bridgeTransaction.d.ts +32 -0
- package/build/dts/models/card.d.ts +19 -0
- package/build/dts/models/cardActivation.d.ts +12 -0
- package/build/dts/models/cardTransaction.d.ts +15 -0
- package/build/dts/models/cardValidation.d.ts +19 -0
- package/build/dts/models/commission.d.ts +9 -0
- package/build/dts/models/deposit.d.ts +11 -0
- package/build/dts/models/file.d.ts +10 -0
- package/build/dts/models/fraudFundsTransfer.d.ts +9 -0
- package/build/dts/models/index.d.ts +38 -0
- package/build/dts/models/kycValidations.d.ts +22 -0
- package/build/dts/models/loginToken.d.ts +7 -0
- package/build/dts/models/partner.d.ts +25 -0
- package/build/dts/models/postalCode.d.ts +14 -0
- package/build/dts/models/saving.d.ts +11 -0
- package/build/dts/models/serviceProvider.d.ts +10 -0
- package/build/dts/models/session.d.ts +14 -0
- package/build/dts/models/statement.d.ts +10 -0
- package/build/dts/models/transaction.d.ts +7 -0
- package/build/dts/models/transactionalProfile.d.ts +14 -0
- package/build/dts/models/transfer.d.ts +15 -0
- package/build/dts/models/user.d.ts +42 -0
- package/build/dts/models/userCredential.d.ts +10 -0
- package/build/dts/models/userLogin.d.ts +9 -0
- package/build/dts/models/userReport.d.ts +48 -0
- package/build/dts/models/userTosAgreement.d.ts +13 -0
- package/build/dts/models/verification.d.ts +12 -0
- package/build/dts/models/wallet.d.ts +8 -0
- package/build/dts/models/walletTransaction.d.ts +10 -0
- package/build/dts/models/whatsAppTransfer.d.ts +16 -0
- package/build/dts/requests/addressUpdateRequest.d.ts +17 -0
- package/build/dts/requests/alertRequest.d.ts +31 -0
- package/build/dts/requests/apiKeyRequest.d.ts +9 -0
- package/build/dts/requests/arpcRequest.d.ts +16 -0
- package/build/dts/requests/base.d.ts +2 -0
- package/build/dts/requests/cardActivationRequest.d.ts +11 -0
- package/build/dts/requests/cardRequest.d.ts +18 -0
- package/build/dts/requests/cardValidationRequest.d.ts +15 -0
- package/build/dts/requests/fileUploadRequest.d.ts +12 -0
- package/build/dts/requests/fraudFundsTransferRequest.d.ts +13 -0
- package/build/dts/requests/index.d.ts +24 -0
- package/build/dts/requests/kycValidationsRequest.d.ts +10 -0
- package/build/dts/requests/partnerUserRequest.d.ts +100 -0
- package/build/dts/requests/reportGenerateRequest.d.ts +8 -0
- package/build/dts/requests/savingRequest.d.ts +11 -0
- package/build/dts/requests/sessionRequest.d.ts +12 -0
- package/build/dts/requests/tosUpdateRequest.d.ts +11 -0
- package/build/dts/requests/transferRequest.d.ts +12 -0
- package/build/dts/requests/transferUpdateRequest.d.ts +8 -0
- package/build/dts/requests/userCredentialRequest.d.ts +15 -0
- package/build/dts/requests/userLoginRequest.d.ts +8 -0
- package/build/dts/requests/userReportCreateRequest.d.ts +9 -0
- package/build/dts/requests/userReportUpdateRequest.d.ts +28 -0
- package/build/dts/requests/userRequest.d.ts +39 -0
- package/build/dts/requests/verificationRequest.d.ts +17 -0
- package/build/dts/requests/walletTransactionRequest.d.ts +9 -0
- package/build/dts/resources/accounts.d.ts +33 -0
- package/build/dts/resources/alerts.d.ts +54 -0
- package/build/dts/resources/apiKeys.d.ts +63 -0
- package/build/dts/resources/arpc.d.ts +18 -0
- package/build/dts/resources/balanceEntries.d.ts +37 -0
- package/build/dts/resources/base.d.ts +135 -0
- package/build/dts/resources/billPayments.d.ts +34 -0
- package/build/dts/resources/bridgeAccounts.d.ts +49 -0
- package/build/dts/resources/bridgeBankAccounts.d.ts +33 -0
- package/build/dts/resources/bridgeClabes.d.ts +27 -0
- package/build/dts/resources/bridgeTransactions.d.ts +36 -0
- package/build/dts/resources/cardActivations.d.ts +19 -0
- package/build/dts/resources/cardTransactions.d.ts +34 -0
- package/build/dts/resources/cardValidations.d.ts +19 -0
- package/build/dts/resources/cards.d.ts +63 -0
- package/build/dts/resources/commissions.d.ts +34 -0
- package/build/dts/resources/deposits.d.ts +34 -0
- package/build/dts/resources/files.d.ts +30 -0
- package/build/dts/resources/fraudFundsTransfers.d.ts +18 -0
- package/build/dts/resources/index.d.ts +36 -0
- package/build/dts/resources/kycValidations.d.ts +53 -0
- package/build/dts/resources/loginTokens.d.ts +17 -0
- package/build/dts/resources/partners.d.ts +54 -0
- package/build/dts/resources/postalCodes.d.ts +24 -0
- package/build/dts/resources/reports.d.ts +8 -0
- package/build/dts/resources/savings.d.ts +62 -0
- package/build/dts/resources/serviceProviders.d.ts +32 -0
- package/build/dts/resources/sessions.d.ts +43 -0
- package/build/dts/resources/statements.d.ts +44 -0
- package/build/dts/resources/transfers.d.ts +64 -0
- package/build/dts/resources/userCredentials.d.ts +30 -0
- package/build/dts/resources/userLogins.d.ts +28 -0
- package/build/dts/resources/userReports.d.ts +54 -0
- package/build/dts/resources/users.d.ts +56 -0
- package/build/dts/resources/usersTosAgreements.d.ts +16 -0
- package/build/dts/resources/verifications.d.ts +31 -0
- package/build/dts/resources/walletTransactions.d.ts +48 -0
- package/build/dts/resources/whatsAppTransfers.d.ts +34 -0
- package/build/dts/types/enums.d.ts +579 -0
- package/build/dts/types/identities/address.d.ts +25 -0
- package/build/dts/types/identities/alertLog.d.ts +11 -0
- package/build/dts/types/identities/audit.d.ts +10 -0
- package/build/dts/types/identities/businessDetails.d.ts +9 -0
- package/build/dts/types/identities/externalAccount.d.ts +8 -0
- package/build/dts/types/identities/index.d.ts +17 -0
- package/build/dts/types/identities/kycFile.d.ts +14 -0
- package/build/dts/types/identities/legalRepresentatives.d.ts +12 -0
- package/build/dts/types/identities/license.d.ts +10 -0
- package/build/dts/types/identities/moralOperation.d.ts +8 -0
- package/build/dts/types/identities/physicalPerson.d.ts +12 -0
- package/build/dts/types/identities/shareholderMoral.d.ts +12 -0
- package/build/dts/types/identities/shareholderPhysical.d.ts +9 -0
- package/build/dts/types/identities/tosAgreements.d.ts +10 -0
- package/build/dts/types/identities/transactionalProfileServices.d.ts +10 -0
- package/build/dts/types/identities/verificationError.d.ts +10 -0
- package/build/dts/types/identities/vulnerableActivity.d.ts +10 -0
- package/build/dts/types/index.d.ts +3 -0
- package/build/dts/types/queries/accountQuery.d.ts +4 -0
- package/build/dts/types/queries/alertQuery.d.ts +12 -0
- package/build/dts/types/queries/apiKeyQuery.d.ts +4 -0
- package/build/dts/types/queries/balanceEntryQuery.d.ts +5 -0
- package/build/dts/types/queries/billPaymentQuery.d.ts +4 -0
- package/build/dts/types/queries/bridgeAccountQuery.d.ts +4 -0
- package/build/dts/types/queries/bridgeBankAccountQuery.d.ts +4 -0
- package/build/dts/types/queries/bridgeQuery.d.ts +7 -0
- package/build/dts/types/queries/bridgeTransactionQuery.d.ts +6 -0
- package/build/dts/types/queries/cardTransactionQuery.d.ts +4 -0
- package/build/dts/types/queries/cardsQuery.d.ts +4 -0
- package/build/dts/types/queries/depositQuery.d.ts +5 -0
- package/build/dts/types/queries/index.d.ts +26 -0
- package/build/dts/types/queries/partnerQuery.d.ts +4 -0
- package/build/dts/types/queries/postalCodeQuery.d.ts +4 -0
- package/build/dts/types/queries/queryParams.d.ts +15 -0
- package/build/dts/types/queries/statementQuery.d.ts +6 -0
- package/build/dts/types/queries/transactionQuery.d.ts +4 -0
- package/build/dts/types/queries/transferQuery.d.ts +7 -0
- package/build/dts/types/queries/userQuery.d.ts +11 -0
- package/build/dts/types/queries/userReportQuery.d.ts +4 -0
- package/build/dts/types/queries/walletQuery.d.ts +4 -0
- package/build/dts/types/queries/walletTransactionQuery.d.ts +4 -0
- package/build/errors/index.cjs +10 -0
- package/build/errors/index.mjs +10 -1
- package/build/index.cjs +1305 -2894
- package/build/index.mjs +1307 -2895
- package/build/jwt/index.cjs +11 -8
- package/build/jwt/index.mjs +11 -8
- package/build/requests/index.cjs +4 -22
- package/build/requests/index.mjs +2 -26
- package/build/types/index.cjs +18 -56
- package/build/types/index.mjs +9 -34
- package/build/umd/cuenca.umd.js +1 -1
- package/build/vulnerableActivity-61dc2846.mjs +278 -0
- package/build/vulnerableActivity-d5aed4a7.cjs +299 -0
- package/build/walletTransactionRequest-aab46c5e.cjs +461 -0
- package/build/walletTransactionRequest-dc11fc69.mjs +433 -0
- package/errors/index.d.ts +1 -0
- package/jwt/index.d.ts +1 -0
- package/package.json +26 -8
- package/requests/index.d.ts +1 -0
- package/types/index.d.ts +1 -0
- package/build/data-1fd00e5c.mjs +0 -1199
- package/build/data-72c37b60.cjs +0 -1240
- package/build/vulnerableActivity-7cc1734f.cjs +0 -867
- package/build/vulnerableActivity-bd344332.mjs +0 -831
- package/build/walletTransactionRequest-05d5305a.mjs +0 -1512
- package/build/walletTransactionRequest-c6a5c64d.cjs +0 -1539
|
@@ -1,1539 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var errors_index = require('./errors/index.cjs');
|
|
4
|
-
var data = require('./data-72c37b60.cjs');
|
|
5
|
-
|
|
6
|
-
class BaseRequest {
|
|
7
|
-
toObject() {
|
|
8
|
-
return {};
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
toCleanObject() {
|
|
12
|
-
const obj = this.toObject();
|
|
13
|
-
Object.keys(obj).forEach((k) => {
|
|
14
|
-
if (obj[k] == null) delete obj[k];
|
|
15
|
-
});
|
|
16
|
-
return obj;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
class ApiKeyUpdateRequest extends BaseRequest {
|
|
21
|
-
constructor(userId, metadata) {
|
|
22
|
-
super();
|
|
23
|
-
this.userId = userId;
|
|
24
|
-
this.metadata = metadata;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
toObject() {
|
|
28
|
-
return {
|
|
29
|
-
user_id: this.userId,
|
|
30
|
-
metadata: this.metadata,
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
class AlertUpdateRequest extends BaseRequest {
|
|
36
|
-
constructor({
|
|
37
|
-
accountNumber,
|
|
38
|
-
actualPeriodCount,
|
|
39
|
-
actualPeriodSum,
|
|
40
|
-
agent,
|
|
41
|
-
aggregationType,
|
|
42
|
-
changeLog,
|
|
43
|
-
committeeMeetingDate,
|
|
44
|
-
comments,
|
|
45
|
-
createdAt,
|
|
46
|
-
description,
|
|
47
|
-
id,
|
|
48
|
-
institutionName,
|
|
49
|
-
level,
|
|
50
|
-
manualScenario,
|
|
51
|
-
name,
|
|
52
|
-
period,
|
|
53
|
-
periodNumber,
|
|
54
|
-
status,
|
|
55
|
-
sourceType,
|
|
56
|
-
transactionDate,
|
|
57
|
-
type,
|
|
58
|
-
typeOfFilter,
|
|
59
|
-
updatedAt,
|
|
60
|
-
userId,
|
|
61
|
-
} = {}) {
|
|
62
|
-
super();
|
|
63
|
-
this.accountNumber = accountNumber;
|
|
64
|
-
this.actualPeriodCount = actualPeriodCount;
|
|
65
|
-
this.actualPeriodSum = actualPeriodSum;
|
|
66
|
-
this.agent = agent;
|
|
67
|
-
this.aggregationType = aggregationType;
|
|
68
|
-
this.changeLog = changeLog;
|
|
69
|
-
this.committeeMeetingDate = committeeMeetingDate;
|
|
70
|
-
this.createdAt = createdAt;
|
|
71
|
-
this.comments = comments;
|
|
72
|
-
this.description = description;
|
|
73
|
-
this.id = id;
|
|
74
|
-
this.institutionName = institutionName;
|
|
75
|
-
this.level = level;
|
|
76
|
-
this.name = name;
|
|
77
|
-
this.manualScenario = manualScenario;
|
|
78
|
-
this.period = period;
|
|
79
|
-
this.periodNumber = periodNumber;
|
|
80
|
-
this.status = status;
|
|
81
|
-
this.sourceType = sourceType;
|
|
82
|
-
this.transactionDate = transactionDate;
|
|
83
|
-
this.type = type;
|
|
84
|
-
this.typeOfFilter = typeOfFilter;
|
|
85
|
-
this.updatedAt = updatedAt;
|
|
86
|
-
this.userId = userId;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
toObject() {
|
|
90
|
-
return {
|
|
91
|
-
agent: this.agent,
|
|
92
|
-
change_log: this.changeLog,
|
|
93
|
-
comments: this.comments,
|
|
94
|
-
description: this.description,
|
|
95
|
-
id: this.id,
|
|
96
|
-
level: this.level,
|
|
97
|
-
name: this.name,
|
|
98
|
-
period: this.period,
|
|
99
|
-
status: this.status,
|
|
100
|
-
type: this.type,
|
|
101
|
-
account_number: this.accountNumber,
|
|
102
|
-
actual_period_count: this.actualPeriodCount,
|
|
103
|
-
actual_period_sum: this.actualPeriodSum,
|
|
104
|
-
aggregation_type: this.aggregationType,
|
|
105
|
-
committee_meeting_date: this.committeeMeetingDate,
|
|
106
|
-
created_at: this.createdAt,
|
|
107
|
-
institution_name: this.institutionName,
|
|
108
|
-
manual_scenario: this.manualScenario,
|
|
109
|
-
period_number: this.periodNumber,
|
|
110
|
-
transaction_date: this.transactionDate,
|
|
111
|
-
source_type: this.sourceType,
|
|
112
|
-
type_of_filter: this.typeOfFilter,
|
|
113
|
-
updated_at: this.updatedAt,
|
|
114
|
-
user_id: this.userId,
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
class ArpcRequest extends BaseRequest {
|
|
120
|
-
constructor({
|
|
121
|
-
arpcMethod,
|
|
122
|
-
arqc,
|
|
123
|
-
number,
|
|
124
|
-
panSequence,
|
|
125
|
-
responseCode,
|
|
126
|
-
transactionCounter,
|
|
127
|
-
transactionData,
|
|
128
|
-
trackDataMethod,
|
|
129
|
-
uniqueNumber,
|
|
130
|
-
}) {
|
|
131
|
-
super();
|
|
132
|
-
this.arpcM = arpcMethod;
|
|
133
|
-
this.arqc = arqc;
|
|
134
|
-
this.num = number;
|
|
135
|
-
this.panSequence = panSequence;
|
|
136
|
-
this.responseCode = responseCode;
|
|
137
|
-
this.transactionCounter = transactionCounter;
|
|
138
|
-
this.transactionData = transactionData;
|
|
139
|
-
this.trackDataMethod = trackDataMethod;
|
|
140
|
-
this.uniqueNumber = uniqueNumber;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
get number() {
|
|
144
|
-
return this._number;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
set num(value) {
|
|
148
|
-
if (!value) return;
|
|
149
|
-
const validations = [!!value, value.length === 16, /^\d{16}/.test(value)];
|
|
150
|
-
if (validations.some((x) => !x)) {
|
|
151
|
-
throw new errors_index.ValidationError('Invalid number');
|
|
152
|
-
}
|
|
153
|
-
this._number = value;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
get arpcMethod() {
|
|
157
|
-
return this._arpcMethod;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
set arpcM(value) {
|
|
161
|
-
if (!value) return;
|
|
162
|
-
const validations = [value.length === 1];
|
|
163
|
-
if (validations.some((x) => !x)) {
|
|
164
|
-
throw new errors_index.ValidationError('Invalid method');
|
|
165
|
-
}
|
|
166
|
-
this._arpcMethod = value;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
toObject() {
|
|
170
|
-
return {
|
|
171
|
-
arpc_method: this.arpcMethod,
|
|
172
|
-
arqc: this.arqc,
|
|
173
|
-
number: this.number,
|
|
174
|
-
pan_sequence: this.panSequence,
|
|
175
|
-
response_code: this.responseCode,
|
|
176
|
-
transaction_counter: this.transactionCounter,
|
|
177
|
-
transaction_data: this.transactionData,
|
|
178
|
-
track_data_method: this.trackDataMethod,
|
|
179
|
-
unique_number: this.uniqueNumber,
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
class CardRequest extends BaseRequest {
|
|
185
|
-
constructor(userId, issuer, fundingType) {
|
|
186
|
-
super();
|
|
187
|
-
this.userId = userId;
|
|
188
|
-
this.issuer = issuer;
|
|
189
|
-
this.fundingType = fundingType;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
toObject() {
|
|
193
|
-
return {
|
|
194
|
-
user_id: this.userId,
|
|
195
|
-
issuer: this.issuer,
|
|
196
|
-
funding_type: this.fundingType,
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
class CardUpdateRequest extends BaseRequest {
|
|
202
|
-
constructor(status, pinBlock) {
|
|
203
|
-
super();
|
|
204
|
-
this.status = status;
|
|
205
|
-
this.pinBlock = pinBlock;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
toObject() {
|
|
209
|
-
return {
|
|
210
|
-
status: this.status,
|
|
211
|
-
pin_block: this.pinBlock,
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
class CardActivationRequest extends BaseRequest {
|
|
217
|
-
constructor(number, expMonth, expYear, cvv2) {
|
|
218
|
-
super();
|
|
219
|
-
this.n = number;
|
|
220
|
-
this.eM = expMonth;
|
|
221
|
-
this.eY = expYear;
|
|
222
|
-
this.c2 = cvv2;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
get number() {
|
|
226
|
-
return this._number;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
set n(value) {
|
|
230
|
-
const validations = [!!value, value.length === 16, /^\d{16}/.test(value)];
|
|
231
|
-
if (validations.some((x) => !x)) {
|
|
232
|
-
throw new errors_index.ValidationError('Invalid number');
|
|
233
|
-
}
|
|
234
|
-
this._number = value.trim();
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
get expMonth() {
|
|
238
|
-
return this._expMonth;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
set eM(value) {
|
|
242
|
-
const validations = [!!value, value >= 1, value <= 12];
|
|
243
|
-
if (validations.some((x) => !x)) {
|
|
244
|
-
throw new errors_index.ValidationError('Invalid expiration month');
|
|
245
|
-
}
|
|
246
|
-
this._expMonth = value;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
get expYear() {
|
|
250
|
-
return this._expYear;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
set eY(value) {
|
|
254
|
-
const validations = [!!value, value >= 18, value <= 99];
|
|
255
|
-
if (validations.some((x) => !x)) {
|
|
256
|
-
throw new errors_index.ValidationError('Invalid expiration year');
|
|
257
|
-
}
|
|
258
|
-
this._expYear = value;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
get cvv2() {
|
|
262
|
-
return this._cvv2;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
set c2(value) {
|
|
266
|
-
const validations = [!!value, value.length === 3, /^\d{3}/.test(value)];
|
|
267
|
-
if (validations.some((x) => !x)) {
|
|
268
|
-
throw new errors_index.ValidationError('Invalid cvv2');
|
|
269
|
-
}
|
|
270
|
-
this._cvv2 = value;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
toObject() {
|
|
274
|
-
return {
|
|
275
|
-
number: this.number,
|
|
276
|
-
exp_month: this.expMonth,
|
|
277
|
-
exp_year: this.expYear,
|
|
278
|
-
cvv2: this.cvv2,
|
|
279
|
-
};
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
class CardValidationRequest extends BaseRequest {
|
|
284
|
-
constructor({
|
|
285
|
-
cvv,
|
|
286
|
-
cvv2,
|
|
287
|
-
expMonth,
|
|
288
|
-
expYear,
|
|
289
|
-
icvv,
|
|
290
|
-
number,
|
|
291
|
-
pinBlock,
|
|
292
|
-
pinAttemptsExceeded,
|
|
293
|
-
}) {
|
|
294
|
-
super();
|
|
295
|
-
this.c = cvv;
|
|
296
|
-
this.c2 = cvv2;
|
|
297
|
-
this.em = expMonth;
|
|
298
|
-
this.ey = expYear;
|
|
299
|
-
this.ic = icvv;
|
|
300
|
-
this.n = number;
|
|
301
|
-
this.pinBloc = pinBlock;
|
|
302
|
-
this.pinAttemptsExceeded = pinAttemptsExceeded;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
get cvv() {
|
|
306
|
-
return this._cvv;
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
set c(value) {
|
|
310
|
-
if (!value) return;
|
|
311
|
-
const validations = [value.length === 3];
|
|
312
|
-
if (validations.some((x) => !x)) {
|
|
313
|
-
throw new errors_index.ValidationError('Invalid cvv');
|
|
314
|
-
}
|
|
315
|
-
this._cvv = value;
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
get cvv2() {
|
|
319
|
-
return this._cvv2;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
set c2(value) {
|
|
323
|
-
if (!value) return;
|
|
324
|
-
const validations = [value.length === 3];
|
|
325
|
-
if (validations.some((x) => !x)) {
|
|
326
|
-
throw new errors_index.ValidationError('Invalid cvv2');
|
|
327
|
-
}
|
|
328
|
-
this._cvv2 = value;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
get expMonth() {
|
|
332
|
-
return this._expMonth;
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
set em(value) {
|
|
336
|
-
if (!value) return;
|
|
337
|
-
const validations = [value >= 1, value <= 12];
|
|
338
|
-
if (validations.some((x) => !x)) {
|
|
339
|
-
throw new errors_index.ValidationError('Invalid expiration month');
|
|
340
|
-
}
|
|
341
|
-
this._expMonth = value;
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
get expYear() {
|
|
345
|
-
return this._expYear;
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
set ey(value) {
|
|
349
|
-
if (!value) return;
|
|
350
|
-
const validations = [value >= 18, value <= 99];
|
|
351
|
-
if (validations.some((x) => !x)) {
|
|
352
|
-
throw new errors_index.ValidationError('Invalid expiration year');
|
|
353
|
-
}
|
|
354
|
-
this._expYear = value;
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
get icvv() {
|
|
358
|
-
return this._icvv;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
set ic(value) {
|
|
362
|
-
if (!value) return;
|
|
363
|
-
const validations = [value.length === 3];
|
|
364
|
-
if (validations.some((x) => !x)) {
|
|
365
|
-
throw new errors_index.ValidationError('Invalid icvv');
|
|
366
|
-
}
|
|
367
|
-
this._icvv = value;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
get number() {
|
|
371
|
-
return this._number;
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
set n(value) {
|
|
375
|
-
const validations = [!!value, value.length === 16, /^\d{16}/.test(value)];
|
|
376
|
-
if (validations.some((x) => !x)) {
|
|
377
|
-
throw new errors_index.ValidationError('Invalid number');
|
|
378
|
-
}
|
|
379
|
-
this._number = value;
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
toObject() {
|
|
383
|
-
return {
|
|
384
|
-
cvv: this.cvv,
|
|
385
|
-
cvv2: this.cvv2,
|
|
386
|
-
exp_month: this.expMonth,
|
|
387
|
-
exp_year: this.expYear,
|
|
388
|
-
icvv: this.icvv,
|
|
389
|
-
number: this.number,
|
|
390
|
-
pin_block: this.pinBloc,
|
|
391
|
-
pin_attempts_exceeded: this.pinAttemptsExceeded,
|
|
392
|
-
};
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
class KYCValidationsRequest extends BaseRequest {
|
|
397
|
-
constructor({ userId, force, isBridge = false }) {
|
|
398
|
-
super();
|
|
399
|
-
this.force = force;
|
|
400
|
-
this.userId = userId;
|
|
401
|
-
this.isBridge = isBridge;
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
toObject() {
|
|
405
|
-
return {
|
|
406
|
-
force: this.force,
|
|
407
|
-
[this.isBridge ? 'account_id' : 'user_id']: this.userId,
|
|
408
|
-
};
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
class AddressUpdateRequest extends BaseRequest {
|
|
413
|
-
constructor({
|
|
414
|
-
city,
|
|
415
|
-
colonia,
|
|
416
|
-
country,
|
|
417
|
-
extNumber,
|
|
418
|
-
fullName,
|
|
419
|
-
intNumber,
|
|
420
|
-
postalCode,
|
|
421
|
-
postalCodeId,
|
|
422
|
-
state,
|
|
423
|
-
street,
|
|
424
|
-
} = {}) {
|
|
425
|
-
super();
|
|
426
|
-
this.city = city;
|
|
427
|
-
this.colonia = colonia;
|
|
428
|
-
this.country = country;
|
|
429
|
-
this.extNumber = extNumber;
|
|
430
|
-
this.fullName = fullName;
|
|
431
|
-
this.intNumber = intNumber;
|
|
432
|
-
this.postalCode = postalCode;
|
|
433
|
-
this.postalCodeId = postalCodeId;
|
|
434
|
-
this.state = state;
|
|
435
|
-
this.street = street;
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
toObject() {
|
|
439
|
-
return {
|
|
440
|
-
city: this.city,
|
|
441
|
-
colonia: this.colonia,
|
|
442
|
-
country: this.country,
|
|
443
|
-
ext_number: this.extNumber,
|
|
444
|
-
full_name: this.fullName,
|
|
445
|
-
int_number: this.intNumber,
|
|
446
|
-
postal_code: this.postalCode,
|
|
447
|
-
postal_code_id: this.postalCodeId,
|
|
448
|
-
state: this.state,
|
|
449
|
-
street: this.street,
|
|
450
|
-
};
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
class TransactionalProfileServicesRequest extends BaseRequest {
|
|
455
|
-
constructor({
|
|
456
|
-
speiTransfersNum,
|
|
457
|
-
speiTransfersAmount,
|
|
458
|
-
internalTransfersNum,
|
|
459
|
-
internalTransfersAmount,
|
|
460
|
-
}) {
|
|
461
|
-
super();
|
|
462
|
-
this.speiTransfersNum = speiTransfersNum;
|
|
463
|
-
this.speiTransfersAmount = speiTransfersAmount;
|
|
464
|
-
this.internalTransfersNum = internalTransfersNum;
|
|
465
|
-
this.internalTransfersAmount = internalTransfersAmount;
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
toObject() {
|
|
469
|
-
return {
|
|
470
|
-
spei_transfers_num: this.speiTransfersNum,
|
|
471
|
-
spei_transfers_amount: this.speiTransfersAmount,
|
|
472
|
-
internal_transfers_num: this.internalTransfersNum,
|
|
473
|
-
internal_transfers_amount: this.internalTransfersAmount,
|
|
474
|
-
};
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
class TransactionalProfileRequest {
|
|
479
|
-
constructor({
|
|
480
|
-
currency,
|
|
481
|
-
monthlyAmount,
|
|
482
|
-
recipientsNum,
|
|
483
|
-
payersNum,
|
|
484
|
-
deposits,
|
|
485
|
-
withdrawal,
|
|
486
|
-
}) {
|
|
487
|
-
this.currency = currency;
|
|
488
|
-
this.monthlyAmount = monthlyAmount;
|
|
489
|
-
|
|
490
|
-
this.recipientsNum = recipientsNum;
|
|
491
|
-
this.payersNum = payersNum;
|
|
492
|
-
|
|
493
|
-
this.deposits = deposits;
|
|
494
|
-
this.withdrawal = withdrawal;
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
get deposits() {
|
|
498
|
-
return this._deposits;
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
set deposits(value) {
|
|
502
|
-
if (!value) return;
|
|
503
|
-
this._deposits = new TransactionalProfileServicesRequest(value).toObject();
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
get withdrawal() {
|
|
507
|
-
return this._withdrawal;
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
set withdrawal(value) {
|
|
511
|
-
if (!value) return;
|
|
512
|
-
this._withdrawal = new TransactionalProfileServicesRequest(
|
|
513
|
-
value,
|
|
514
|
-
).toObject();
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
toObject() {
|
|
518
|
-
return {
|
|
519
|
-
currency: this.currency,
|
|
520
|
-
monthly_amount: this.monthlyAmount,
|
|
521
|
-
recipients_num: this.recipientsNum,
|
|
522
|
-
payers_num: this.payersNum,
|
|
523
|
-
deposits: this.deposits,
|
|
524
|
-
withdrawal: this.withdrawal,
|
|
525
|
-
};
|
|
526
|
-
}
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
class BusinessDetailsRequest extends BaseRequest {
|
|
530
|
-
constructor({ accountUsageDescription, businessDescription }) {
|
|
531
|
-
super();
|
|
532
|
-
this.accountUsageDescription = accountUsageDescription;
|
|
533
|
-
this.businessDescription = businessDescription;
|
|
534
|
-
}
|
|
535
|
-
|
|
536
|
-
toObject() {
|
|
537
|
-
return {
|
|
538
|
-
account_usage_description: this.accountUsageDescription,
|
|
539
|
-
business_description: this.businessDescription,
|
|
540
|
-
};
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
|
-
|
|
544
|
-
class ShareholderPhysicalRequest extends BaseRequest {
|
|
545
|
-
constructor({
|
|
546
|
-
names,
|
|
547
|
-
curp,
|
|
548
|
-
rfc,
|
|
549
|
-
firstSurname,
|
|
550
|
-
percentage,
|
|
551
|
-
secondSurname,
|
|
552
|
-
shareCapital,
|
|
553
|
-
}) {
|
|
554
|
-
super();
|
|
555
|
-
this.names = names;
|
|
556
|
-
this.curp = curp;
|
|
557
|
-
this.percentage = percentage;
|
|
558
|
-
this.rfc = rfc;
|
|
559
|
-
this.shareCapital = shareCapital;
|
|
560
|
-
this.firstSurname = firstSurname;
|
|
561
|
-
this.secondSurname = secondSurname;
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
toObject() {
|
|
565
|
-
return {
|
|
566
|
-
curp: this.curp,
|
|
567
|
-
names: this.names,
|
|
568
|
-
percentage: this.percentage,
|
|
569
|
-
rfc: this.rfc,
|
|
570
|
-
share_capital: this.shareCapital,
|
|
571
|
-
first_surname: this.firstSurname,
|
|
572
|
-
second_surname: this.secondSurname,
|
|
573
|
-
};
|
|
574
|
-
}
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
class LegalRepresentativesRequest extends ShareholderPhysicalRequest {
|
|
578
|
-
constructor({
|
|
579
|
-
address,
|
|
580
|
-
curp,
|
|
581
|
-
emailAddress,
|
|
582
|
-
firstSurname,
|
|
583
|
-
job,
|
|
584
|
-
names,
|
|
585
|
-
percentage,
|
|
586
|
-
phoneNumber,
|
|
587
|
-
rfc,
|
|
588
|
-
secondSurname,
|
|
589
|
-
}) {
|
|
590
|
-
super({ curp, firstSurname, names, percentage, rfc, secondSurname });
|
|
591
|
-
this.job = job;
|
|
592
|
-
this.phoneNumber = phoneNumber;
|
|
593
|
-
this.emailAddress = emailAddress;
|
|
594
|
-
this.address = address;
|
|
595
|
-
}
|
|
596
|
-
|
|
597
|
-
get address() {
|
|
598
|
-
return this._address;
|
|
599
|
-
}
|
|
600
|
-
|
|
601
|
-
set address(value) {
|
|
602
|
-
if (!value) return;
|
|
603
|
-
this._address = new AddressUpdateRequest(value).toCleanObject();
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
toObject() {
|
|
607
|
-
return {
|
|
608
|
-
...super.toObject(),
|
|
609
|
-
job: this.job,
|
|
610
|
-
phone_number: this.phoneNumber,
|
|
611
|
-
email_address: this.emailAddress,
|
|
612
|
-
address: this.address,
|
|
613
|
-
};
|
|
614
|
-
}
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
class ShareholderMoralRequest extends BaseRequest {
|
|
618
|
-
constructor({ name, percentage, shareholders, legalRepresentatives }) {
|
|
619
|
-
super();
|
|
620
|
-
this.name = name;
|
|
621
|
-
this.percentage = percentage;
|
|
622
|
-
this.shareholders = shareholders;
|
|
623
|
-
this.legalRepresentatives = legalRepresentatives;
|
|
624
|
-
}
|
|
625
|
-
|
|
626
|
-
get shareholders() {
|
|
627
|
-
return this._shareholders;
|
|
628
|
-
}
|
|
629
|
-
|
|
630
|
-
set shareholders(value) {
|
|
631
|
-
if (!value) return;
|
|
632
|
-
this._shareholders = value.map((sh) =>
|
|
633
|
-
new ShareholderPhysicalRequest(sh).toObject(),
|
|
634
|
-
);
|
|
635
|
-
}
|
|
636
|
-
|
|
637
|
-
get legalRepresentatives() {
|
|
638
|
-
return this._legalRepresentatives;
|
|
639
|
-
}
|
|
640
|
-
|
|
641
|
-
set legalRepresentatives(value) {
|
|
642
|
-
if (!value) return;
|
|
643
|
-
this._legalRepresentatives = value.map((lr) =>
|
|
644
|
-
new LegalRepresentativesRequest(lr).toObject(),
|
|
645
|
-
);
|
|
646
|
-
}
|
|
647
|
-
|
|
648
|
-
toObject() {
|
|
649
|
-
return {
|
|
650
|
-
name: this.name,
|
|
651
|
-
percentage: this.percentage,
|
|
652
|
-
shareholders: this.shareholders,
|
|
653
|
-
legal_representatives: this.legalRepresentatives,
|
|
654
|
-
};
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
|
|
658
|
-
class VulnerableActivityRequest extends BaseRequest {
|
|
659
|
-
constructor({
|
|
660
|
-
isVulnerableActivity,
|
|
661
|
-
hasSatRegister,
|
|
662
|
-
satRegisteredDate,
|
|
663
|
-
isInCompliance,
|
|
664
|
-
}) {
|
|
665
|
-
super();
|
|
666
|
-
this.isVulnerableActivity = isVulnerableActivity;
|
|
667
|
-
this.hasSatRegister = hasSatRegister;
|
|
668
|
-
this.satRegisteredDate = satRegisteredDate;
|
|
669
|
-
this.isInCompliance = isInCompliance;
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
toObject() {
|
|
673
|
-
return {
|
|
674
|
-
is_vulnerable_activity: this.isVulnerableActivity,
|
|
675
|
-
has_sat_register: this.hasSatRegister,
|
|
676
|
-
sat_registered_date: this.satRegisteredDate,
|
|
677
|
-
is_in_compliance: this.isInCompliance,
|
|
678
|
-
};
|
|
679
|
-
}
|
|
680
|
-
}
|
|
681
|
-
|
|
682
|
-
class LicenseRequest extends BaseRequest {
|
|
683
|
-
constructor({
|
|
684
|
-
licenseRequired,
|
|
685
|
-
supervisoryEntity,
|
|
686
|
-
licenseType,
|
|
687
|
-
licenseDate,
|
|
688
|
-
}) {
|
|
689
|
-
super();
|
|
690
|
-
this.licenseRequired = licenseRequired;
|
|
691
|
-
this.supervisoryEntity = supervisoryEntity;
|
|
692
|
-
this.licenseType = licenseType;
|
|
693
|
-
this.licenseDate = licenseDate;
|
|
694
|
-
}
|
|
695
|
-
|
|
696
|
-
toObject() {
|
|
697
|
-
return {
|
|
698
|
-
license_required: this.licenseRequired,
|
|
699
|
-
supervisory_entity: this.supervisoryEntity,
|
|
700
|
-
license_type: this.licenseType,
|
|
701
|
-
license_date: this.licenseDate,
|
|
702
|
-
};
|
|
703
|
-
}
|
|
704
|
-
}
|
|
705
|
-
|
|
706
|
-
class AuditRequest extends BaseRequest {
|
|
707
|
-
constructor({ hasAudit, auditProvider, auditDate, auditComments }) {
|
|
708
|
-
super();
|
|
709
|
-
this.hasAudit = hasAudit;
|
|
710
|
-
this.auditProvider = auditProvider;
|
|
711
|
-
this.auditDate = auditDate;
|
|
712
|
-
this.auditComments = auditComments;
|
|
713
|
-
}
|
|
714
|
-
|
|
715
|
-
toObject() {
|
|
716
|
-
return {
|
|
717
|
-
has_audit: this.hasAudit,
|
|
718
|
-
audit_provider: this.auditProvider,
|
|
719
|
-
audit_date: this.auditDate,
|
|
720
|
-
audit_comments: this.auditComments,
|
|
721
|
-
};
|
|
722
|
-
}
|
|
723
|
-
}
|
|
724
|
-
|
|
725
|
-
class PartnerUserRequest extends BaseRequest {
|
|
726
|
-
constructor({
|
|
727
|
-
address,
|
|
728
|
-
audit,
|
|
729
|
-
businessDetails,
|
|
730
|
-
businessName,
|
|
731
|
-
clabe,
|
|
732
|
-
createdAt,
|
|
733
|
-
documentationUrl,
|
|
734
|
-
emailAddress,
|
|
735
|
-
externalAccount,
|
|
736
|
-
folio,
|
|
737
|
-
id,
|
|
738
|
-
incorporationDate,
|
|
739
|
-
legalName,
|
|
740
|
-
legalRepresentatives,
|
|
741
|
-
level,
|
|
742
|
-
license,
|
|
743
|
-
meta,
|
|
744
|
-
nationality,
|
|
745
|
-
phoneNumber,
|
|
746
|
-
platformId,
|
|
747
|
-
requiredLevel,
|
|
748
|
-
rfc,
|
|
749
|
-
shareholders,
|
|
750
|
-
status,
|
|
751
|
-
transactionalProfile,
|
|
752
|
-
updatedAt,
|
|
753
|
-
userId,
|
|
754
|
-
userType,
|
|
755
|
-
vulnerableActivity,
|
|
756
|
-
webSite,
|
|
757
|
-
} = {}) {
|
|
758
|
-
super();
|
|
759
|
-
this.addressRequest = address;
|
|
760
|
-
this.auditRequest = audit;
|
|
761
|
-
this.businessDetailsRequest = businessDetails;
|
|
762
|
-
this.businessName = businessName;
|
|
763
|
-
this.clabe = clabe;
|
|
764
|
-
this.createdAt = createdAt;
|
|
765
|
-
this.documentationUrl = documentationUrl;
|
|
766
|
-
this.emailAddress = emailAddress;
|
|
767
|
-
this.externalAccountRequest = externalAccount;
|
|
768
|
-
this.folio = folio;
|
|
769
|
-
this.id = id;
|
|
770
|
-
this.incorporationDate = incorporationDate;
|
|
771
|
-
this.legalName = legalName;
|
|
772
|
-
this.legalRepresentativesRequest = legalRepresentatives;
|
|
773
|
-
this.level = level;
|
|
774
|
-
this.licenseRequest = license;
|
|
775
|
-
this.meta = meta;
|
|
776
|
-
this.nationality = nationality;
|
|
777
|
-
this.phoneNumber = phoneNumber;
|
|
778
|
-
this.platformId = platformId;
|
|
779
|
-
this.requiredLevel = requiredLevel;
|
|
780
|
-
this.rfc = rfc;
|
|
781
|
-
this.shareholdersRequest = shareholders;
|
|
782
|
-
this.status = status;
|
|
783
|
-
this.transactionalProfileRequest = transactionalProfile;
|
|
784
|
-
this.updatedAt = updatedAt;
|
|
785
|
-
this.userId = userId;
|
|
786
|
-
this.userType = userType;
|
|
787
|
-
this.vulnerableActivityRequest = vulnerableActivity;
|
|
788
|
-
this.webSite = webSite;
|
|
789
|
-
}
|
|
790
|
-
|
|
791
|
-
get address() {
|
|
792
|
-
return this._address;
|
|
793
|
-
}
|
|
794
|
-
|
|
795
|
-
set addressRequest(value) {
|
|
796
|
-
if (!value) return;
|
|
797
|
-
this._address = new AddressUpdateRequest(value).toCleanObject();
|
|
798
|
-
}
|
|
799
|
-
|
|
800
|
-
get audit() {
|
|
801
|
-
return this._audit;
|
|
802
|
-
}
|
|
803
|
-
|
|
804
|
-
set auditRequest(value) {
|
|
805
|
-
if (!value) return;
|
|
806
|
-
this._audit = new AuditRequest(value).toObject();
|
|
807
|
-
}
|
|
808
|
-
|
|
809
|
-
get businessDetails() {
|
|
810
|
-
return this._businessDetails;
|
|
811
|
-
}
|
|
812
|
-
|
|
813
|
-
set businessDetailsRequest(value) {
|
|
814
|
-
if (!value) return;
|
|
815
|
-
this._businessDetails = new BusinessDetailsRequest(value).toObject();
|
|
816
|
-
}
|
|
817
|
-
|
|
818
|
-
get legalRepresentatives() {
|
|
819
|
-
return this._legalRepresentatives;
|
|
820
|
-
}
|
|
821
|
-
|
|
822
|
-
set legalRepresentativesRequest(value) {
|
|
823
|
-
if (!value) return;
|
|
824
|
-
this._legalRepresentatives = value.map((lr) =>
|
|
825
|
-
new LegalRepresentativesRequest(lr).toObject(),
|
|
826
|
-
);
|
|
827
|
-
}
|
|
828
|
-
|
|
829
|
-
get license() {
|
|
830
|
-
return this._license;
|
|
831
|
-
}
|
|
832
|
-
|
|
833
|
-
set licenseRequest(value) {
|
|
834
|
-
if (!value) return;
|
|
835
|
-
this._license = new LicenseRequest(value).toObject();
|
|
836
|
-
}
|
|
837
|
-
|
|
838
|
-
get shareholders() {
|
|
839
|
-
return this._shareholders;
|
|
840
|
-
}
|
|
841
|
-
|
|
842
|
-
set shareholdersRequest(value) {
|
|
843
|
-
if (!value) return;
|
|
844
|
-
this._shareholders = value.map((sh) =>
|
|
845
|
-
new ShareholderMoralRequest(sh).toObject(),
|
|
846
|
-
);
|
|
847
|
-
}
|
|
848
|
-
|
|
849
|
-
get transactionalProfile() {
|
|
850
|
-
return this._transactionalProfile;
|
|
851
|
-
}
|
|
852
|
-
|
|
853
|
-
set transactionalProfileRequest(value) {
|
|
854
|
-
if (!value) return;
|
|
855
|
-
this._transactionalProfile = new TransactionalProfileRequest(
|
|
856
|
-
value,
|
|
857
|
-
).toObject();
|
|
858
|
-
}
|
|
859
|
-
|
|
860
|
-
get vulnerableActivity() {
|
|
861
|
-
return this._vulnerableActivity;
|
|
862
|
-
}
|
|
863
|
-
|
|
864
|
-
set vulnerableActivityRequest(value) {
|
|
865
|
-
if (!value) return;
|
|
866
|
-
this._vulnerableActivity = new VulnerableActivityRequest(value).toObject();
|
|
867
|
-
}
|
|
868
|
-
|
|
869
|
-
get externalAccount() {
|
|
870
|
-
return this._externalAccount;
|
|
871
|
-
}
|
|
872
|
-
|
|
873
|
-
set externalAccountRequest(value) {
|
|
874
|
-
if (!value) return;
|
|
875
|
-
this._externalAccount = {
|
|
876
|
-
account: value.account,
|
|
877
|
-
bank: value.bank,
|
|
878
|
-
};
|
|
879
|
-
}
|
|
880
|
-
|
|
881
|
-
toObject() {
|
|
882
|
-
return {
|
|
883
|
-
address: this.address,
|
|
884
|
-
audit: this.audit,
|
|
885
|
-
business_details: this.businessDetails,
|
|
886
|
-
business_name: this.businessName,
|
|
887
|
-
clabe: this.clabe,
|
|
888
|
-
created_at: this.createdAt,
|
|
889
|
-
documentation_url: this.documentationUrl,
|
|
890
|
-
email_address: this.emailAddress,
|
|
891
|
-
external_account: this.externalAccount,
|
|
892
|
-
folio: this.folio,
|
|
893
|
-
id: this.id,
|
|
894
|
-
incorporation_date: this.incorporationDate,
|
|
895
|
-
legal_name: this.legalName,
|
|
896
|
-
legal_representatives: this.legalRepresentatives,
|
|
897
|
-
level: this.level,
|
|
898
|
-
license: this.license,
|
|
899
|
-
meta: this.meta,
|
|
900
|
-
nationality: this.nationality,
|
|
901
|
-
phone_number: this.phoneNumber,
|
|
902
|
-
platform_id: this.platformId,
|
|
903
|
-
required_level: this.requiredLevel,
|
|
904
|
-
rfc: this.rfc,
|
|
905
|
-
shareholders: this.shareholders,
|
|
906
|
-
status: this.status,
|
|
907
|
-
transactional_profile: this.transactionalProfile,
|
|
908
|
-
updated_at: this.updatedAt,
|
|
909
|
-
user_id: this.userId,
|
|
910
|
-
user_type: this.userType,
|
|
911
|
-
vulnerable_activity: this.vulnerableActivity,
|
|
912
|
-
web_site: this.webSite,
|
|
913
|
-
};
|
|
914
|
-
}
|
|
915
|
-
}
|
|
916
|
-
|
|
917
|
-
class ReportGenerateRequest extends BaseRequest {
|
|
918
|
-
constructor({ committeeMeetingDate } = {}) {
|
|
919
|
-
super();
|
|
920
|
-
this.committeeMeetingDate = committeeMeetingDate;
|
|
921
|
-
}
|
|
922
|
-
|
|
923
|
-
toObject() {
|
|
924
|
-
return {
|
|
925
|
-
committee_meeting_date: this.committeeMeetingDate,
|
|
926
|
-
};
|
|
927
|
-
}
|
|
928
|
-
}
|
|
929
|
-
|
|
930
|
-
class SavingRequest extends BaseRequest {
|
|
931
|
-
constructor(category, goalAmount, goalDate, name) {
|
|
932
|
-
super();
|
|
933
|
-
this.category = category;
|
|
934
|
-
this.name = name;
|
|
935
|
-
this.goalAmount = goalAmount;
|
|
936
|
-
this.validDate = goalDate;
|
|
937
|
-
}
|
|
938
|
-
|
|
939
|
-
get goalDate() {
|
|
940
|
-
return this._goalDate;
|
|
941
|
-
}
|
|
942
|
-
|
|
943
|
-
set validDate(value) {
|
|
944
|
-
if (!value) return;
|
|
945
|
-
if (data.dateToUTC(value).getTime() <= data.dateToUTC(Date.now()).getTime()) {
|
|
946
|
-
throw new errors_index.ValidationError(
|
|
947
|
-
'The goal_date always need to be higher than now',
|
|
948
|
-
);
|
|
949
|
-
}
|
|
950
|
-
this._goalDate = value;
|
|
951
|
-
}
|
|
952
|
-
|
|
953
|
-
toObject() {
|
|
954
|
-
return {
|
|
955
|
-
category: this.category,
|
|
956
|
-
goal_amount: this.goalAmount,
|
|
957
|
-
goal_date: this.goalDate,
|
|
958
|
-
name: this.name,
|
|
959
|
-
};
|
|
960
|
-
}
|
|
961
|
-
}
|
|
962
|
-
|
|
963
|
-
class SessionRequest extends BaseRequest {
|
|
964
|
-
constructor({ failureUrl, successUrl, type, userId, isBridge = false }) {
|
|
965
|
-
super();
|
|
966
|
-
this.failureUrl = failureUrl;
|
|
967
|
-
this.successUrl = successUrl;
|
|
968
|
-
this.type = type;
|
|
969
|
-
this.userId = userId;
|
|
970
|
-
this.isBridge = isBridge;
|
|
971
|
-
}
|
|
972
|
-
|
|
973
|
-
toObject() {
|
|
974
|
-
return {
|
|
975
|
-
failure_url: this.failureUrl,
|
|
976
|
-
success_url: this.successUrl,
|
|
977
|
-
type: this.type,
|
|
978
|
-
[this.isBridge ? 'account_id' : 'user_id']: this.userId,
|
|
979
|
-
};
|
|
980
|
-
}
|
|
981
|
-
}
|
|
982
|
-
|
|
983
|
-
class FraudFundsTransferRequest extends BaseRequest {
|
|
984
|
-
constructor({ userId, amount, concepto, clabe, reason, bankCode }) {
|
|
985
|
-
super();
|
|
986
|
-
this.userId = userId;
|
|
987
|
-
this.amount = amount;
|
|
988
|
-
this.concepto = concepto;
|
|
989
|
-
this.clabe = clabe;
|
|
990
|
-
this.reason = reason;
|
|
991
|
-
this.bankCode = bankCode;
|
|
992
|
-
}
|
|
993
|
-
|
|
994
|
-
toObject() {
|
|
995
|
-
return {
|
|
996
|
-
user_id: this.userId,
|
|
997
|
-
amount: this.amount,
|
|
998
|
-
concepto: this.concepto,
|
|
999
|
-
clabe: this.clabe,
|
|
1000
|
-
reason: this.reason,
|
|
1001
|
-
bank_code: this.bankCode,
|
|
1002
|
-
};
|
|
1003
|
-
}
|
|
1004
|
-
}
|
|
1005
|
-
|
|
1006
|
-
class TransferRequest extends BaseRequest {
|
|
1007
|
-
constructor(
|
|
1008
|
-
accountNumber,
|
|
1009
|
-
amount,
|
|
1010
|
-
descriptor,
|
|
1011
|
-
idempotencyKey,
|
|
1012
|
-
recipientName,
|
|
1013
|
-
) {
|
|
1014
|
-
super();
|
|
1015
|
-
this.accountNumber = accountNumber;
|
|
1016
|
-
this.amount = amount;
|
|
1017
|
-
this.descriptor = descriptor;
|
|
1018
|
-
this.idempotencyKey = idempotencyKey;
|
|
1019
|
-
this.recipientName = recipientName;
|
|
1020
|
-
}
|
|
1021
|
-
|
|
1022
|
-
toObject() {
|
|
1023
|
-
return {
|
|
1024
|
-
account_number: this.accountNumber,
|
|
1025
|
-
amount: this.amount,
|
|
1026
|
-
descriptor: this.descriptor,
|
|
1027
|
-
idempotency_key: this.idempotencyKey,
|
|
1028
|
-
recipient_name: this.recipientName,
|
|
1029
|
-
};
|
|
1030
|
-
}
|
|
1031
|
-
}
|
|
1032
|
-
|
|
1033
|
-
const VALID_STATUSES = ['succeeded', 'failed'];
|
|
1034
|
-
|
|
1035
|
-
class TransferUpdateRequest extends BaseRequest {
|
|
1036
|
-
constructor({ status } = {}) {
|
|
1037
|
-
super();
|
|
1038
|
-
if (!status || !VALID_STATUSES.includes(status)) {
|
|
1039
|
-
throw new Error(
|
|
1040
|
-
`Invalid status: "${status}". Must be one of: ${VALID_STATUSES.join(
|
|
1041
|
-
', ',
|
|
1042
|
-
)}`,
|
|
1043
|
-
);
|
|
1044
|
-
}
|
|
1045
|
-
this.status = status;
|
|
1046
|
-
}
|
|
1047
|
-
|
|
1048
|
-
toObject() {
|
|
1049
|
-
return {
|
|
1050
|
-
status: this.status,
|
|
1051
|
-
};
|
|
1052
|
-
}
|
|
1053
|
-
}
|
|
1054
|
-
|
|
1055
|
-
class UserCredentialRequest extends BaseRequest {
|
|
1056
|
-
constructor(password) {
|
|
1057
|
-
super();
|
|
1058
|
-
this.pwd = password;
|
|
1059
|
-
}
|
|
1060
|
-
|
|
1061
|
-
get password() {
|
|
1062
|
-
return this._password;
|
|
1063
|
-
}
|
|
1064
|
-
|
|
1065
|
-
set pwd(value) {
|
|
1066
|
-
const validations = [!!value, value.length >= 6];
|
|
1067
|
-
if (validations.some((x) => !x)) {
|
|
1068
|
-
throw new errors_index.ValidationError('Invalid password');
|
|
1069
|
-
}
|
|
1070
|
-
this._password = value;
|
|
1071
|
-
}
|
|
1072
|
-
|
|
1073
|
-
toObject() {
|
|
1074
|
-
return {
|
|
1075
|
-
password: this.password,
|
|
1076
|
-
};
|
|
1077
|
-
}
|
|
1078
|
-
}
|
|
1079
|
-
|
|
1080
|
-
class UserCredentialUpdateRequest extends BaseRequest {
|
|
1081
|
-
constructor(password, isActive) {
|
|
1082
|
-
super();
|
|
1083
|
-
this.pwd = password;
|
|
1084
|
-
this.isActive = isActive;
|
|
1085
|
-
this.req = {
|
|
1086
|
-
password: this.password,
|
|
1087
|
-
isActive: this.isActive,
|
|
1088
|
-
};
|
|
1089
|
-
}
|
|
1090
|
-
|
|
1091
|
-
get password() {
|
|
1092
|
-
return this._password;
|
|
1093
|
-
}
|
|
1094
|
-
|
|
1095
|
-
get request() {
|
|
1096
|
-
return this._request;
|
|
1097
|
-
}
|
|
1098
|
-
|
|
1099
|
-
set pwd(value) {
|
|
1100
|
-
if (!value) {
|
|
1101
|
-
this._password = value;
|
|
1102
|
-
return;
|
|
1103
|
-
}
|
|
1104
|
-
const validations = [value.length >= 6];
|
|
1105
|
-
if (validations.some((x) => !x)) {
|
|
1106
|
-
throw new errors_index.ValidationError('Invalid password');
|
|
1107
|
-
}
|
|
1108
|
-
this._password = value;
|
|
1109
|
-
}
|
|
1110
|
-
|
|
1111
|
-
set req(value) {
|
|
1112
|
-
if (value.password && value.isActive != null) {
|
|
1113
|
-
throw new errors_index.ValidationError('Only one property can be updated at a time');
|
|
1114
|
-
}
|
|
1115
|
-
this._request = value;
|
|
1116
|
-
}
|
|
1117
|
-
|
|
1118
|
-
toObject() {
|
|
1119
|
-
return {
|
|
1120
|
-
password: this.request.password,
|
|
1121
|
-
is_active: this.request.isActive,
|
|
1122
|
-
};
|
|
1123
|
-
}
|
|
1124
|
-
|
|
1125
|
-
toCleanObject() {
|
|
1126
|
-
const obj = this.toObject();
|
|
1127
|
-
Object.keys(obj).forEach((k) => {
|
|
1128
|
-
if (k === 'password' && obj[k] === null) {
|
|
1129
|
-
return;
|
|
1130
|
-
}
|
|
1131
|
-
if (obj[k] == null) {
|
|
1132
|
-
delete obj[k];
|
|
1133
|
-
}
|
|
1134
|
-
});
|
|
1135
|
-
return obj;
|
|
1136
|
-
}
|
|
1137
|
-
}
|
|
1138
|
-
|
|
1139
|
-
class UserLoginRequest extends BaseRequest {
|
|
1140
|
-
constructor(password, userId = 'me') {
|
|
1141
|
-
super();
|
|
1142
|
-
this.pwd = password;
|
|
1143
|
-
this.userId = userId;
|
|
1144
|
-
}
|
|
1145
|
-
|
|
1146
|
-
get password() {
|
|
1147
|
-
return this._password;
|
|
1148
|
-
}
|
|
1149
|
-
|
|
1150
|
-
set pwd(value) {
|
|
1151
|
-
const validations = [!!value, value.length === 6, /^\d{6}$/.test(value)];
|
|
1152
|
-
if (validations.some((x) => !x)) {
|
|
1153
|
-
throw new errors_index.ValidationError('Invalid password');
|
|
1154
|
-
}
|
|
1155
|
-
this._password = value;
|
|
1156
|
-
}
|
|
1157
|
-
|
|
1158
|
-
toObject() {
|
|
1159
|
-
return {
|
|
1160
|
-
password: this.password,
|
|
1161
|
-
user_id: this.userId,
|
|
1162
|
-
};
|
|
1163
|
-
}
|
|
1164
|
-
}
|
|
1165
|
-
|
|
1166
|
-
class UserReportCreateRequest extends BaseRequest {
|
|
1167
|
-
constructor({ committeeMeetingDate, userId } = {}) {
|
|
1168
|
-
super();
|
|
1169
|
-
this.committeeMeetingDate = committeeMeetingDate;
|
|
1170
|
-
this.userId = userId;
|
|
1171
|
-
}
|
|
1172
|
-
|
|
1173
|
-
toObject() {
|
|
1174
|
-
return {
|
|
1175
|
-
committee_meeting_date: this.committeeMeetingDate,
|
|
1176
|
-
user_id: this.userId,
|
|
1177
|
-
};
|
|
1178
|
-
}
|
|
1179
|
-
}
|
|
1180
|
-
|
|
1181
|
-
class UserReportUpdateRequest extends BaseRequest {
|
|
1182
|
-
constructor({
|
|
1183
|
-
actividadEconomica,
|
|
1184
|
-
apellidoMaternoContraparte,
|
|
1185
|
-
apellidoPaternoContraparte,
|
|
1186
|
-
ciudadPoblacion,
|
|
1187
|
-
colonia,
|
|
1188
|
-
cuentaClabeContraparte,
|
|
1189
|
-
descripcionOperacion,
|
|
1190
|
-
entidadFederativaDomicilio,
|
|
1191
|
-
institucionFinancieraContraparte,
|
|
1192
|
-
instrumentoMonetario,
|
|
1193
|
-
mainAlertId,
|
|
1194
|
-
nacionalidadCuentaContraparte,
|
|
1195
|
-
nivelCuenta,
|
|
1196
|
-
nombreContraparte,
|
|
1197
|
-
paisNacionalidad,
|
|
1198
|
-
prioridadReporte,
|
|
1199
|
-
razonDenominacionContraparte,
|
|
1200
|
-
razonInusual,
|
|
1201
|
-
tipoOperacionItf,
|
|
1202
|
-
tipoOperacionPerfil,
|
|
1203
|
-
tipoPersonaContraparte,
|
|
1204
|
-
} = {}) {
|
|
1205
|
-
super();
|
|
1206
|
-
this.actividadEconomica = actividadEconomica;
|
|
1207
|
-
this.apellidoMaternoContraparte = apellidoMaternoContraparte;
|
|
1208
|
-
this.apellidoPaternoContraparte = apellidoPaternoContraparte;
|
|
1209
|
-
this.ciudadPoblacion = ciudadPoblacion;
|
|
1210
|
-
this.colonia = colonia;
|
|
1211
|
-
this.cuentaClabeContraparte = cuentaClabeContraparte;
|
|
1212
|
-
this.descripcionOperacion = descripcionOperacion;
|
|
1213
|
-
this.entidadFederativaDomicilio = entidadFederativaDomicilio;
|
|
1214
|
-
this.institucionFinancieraContraparte = institucionFinancieraContraparte;
|
|
1215
|
-
this.instrumentoMonetario = instrumentoMonetario;
|
|
1216
|
-
this.mainAlertId = mainAlertId;
|
|
1217
|
-
this.nacionalidadCuentaContraparte = nacionalidadCuentaContraparte;
|
|
1218
|
-
this.nivelCuenta = nivelCuenta;
|
|
1219
|
-
this.nombreContraparte = nombreContraparte;
|
|
1220
|
-
this.paisNacionalidad = paisNacionalidad;
|
|
1221
|
-
this.prioridadReporte = prioridadReporte;
|
|
1222
|
-
this.razonDenominacionContraparte = razonDenominacionContraparte;
|
|
1223
|
-
this.razonInusual = razonInusual;
|
|
1224
|
-
this.tipoOperacionItf = tipoOperacionItf;
|
|
1225
|
-
this.tipoOperacionPerfil = tipoOperacionPerfil;
|
|
1226
|
-
this.tipoPersonaContraparte = tipoPersonaContraparte;
|
|
1227
|
-
}
|
|
1228
|
-
|
|
1229
|
-
toObject() {
|
|
1230
|
-
return {
|
|
1231
|
-
actividad_economica: this.actividadEconomica,
|
|
1232
|
-
apellido_materno_contraparte: this.apellidoMaternoContraparte,
|
|
1233
|
-
apellido_paterno_contraparte: this.apellidoPaternoContraparte,
|
|
1234
|
-
ciudad_poblacion: this.ciudadPoblacion,
|
|
1235
|
-
colonia: this.colonia,
|
|
1236
|
-
cuenta_clabe_contraparte: this.cuentaClabeContraparte,
|
|
1237
|
-
descripcion_operacion: this.descripcionOperacion,
|
|
1238
|
-
entidad_federativa_domicilio: this.entidadFederativaDomicilio,
|
|
1239
|
-
institucion_financiera_contraparte: this.institucionFinancieraContraparte,
|
|
1240
|
-
instrumento_monetario: this.instrumentoMonetario,
|
|
1241
|
-
main_alert_id: this.mainAlertId,
|
|
1242
|
-
nacionalidad_cuenta_contraparte: this.nacionalidadCuentaContraparte,
|
|
1243
|
-
nivel_cuenta: this.nivelCuenta,
|
|
1244
|
-
nombre_contraparte: this.nombreContraparte,
|
|
1245
|
-
pais_nacionalidad: this.paisNacionalidad,
|
|
1246
|
-
prioridad_reporte: this.prioridadReporte,
|
|
1247
|
-
razon_denominacion_contraparte: this.razonDenominacionContraparte,
|
|
1248
|
-
razon_inusual: this.razonInusual,
|
|
1249
|
-
tipo_operacion_itf: this.tipoOperacionItf,
|
|
1250
|
-
tipo_operacion_perfil: this.tipoOperacionPerfil,
|
|
1251
|
-
tipo_persona_contraparte: this.tipoPersonaContraparte,
|
|
1252
|
-
};
|
|
1253
|
-
}
|
|
1254
|
-
}
|
|
1255
|
-
|
|
1256
|
-
class TosUpdateRequest extends BaseRequest {
|
|
1257
|
-
constructor({ ip, location, type, version }) {
|
|
1258
|
-
super();
|
|
1259
|
-
this.ipAddress = ip;
|
|
1260
|
-
this.location = location;
|
|
1261
|
-
this.type = type;
|
|
1262
|
-
this.version = version;
|
|
1263
|
-
}
|
|
1264
|
-
|
|
1265
|
-
get ip() {
|
|
1266
|
-
return this._ip;
|
|
1267
|
-
}
|
|
1268
|
-
|
|
1269
|
-
set ipAddress(value) {
|
|
1270
|
-
if (!value) throw new errors_index.ValidationError('missing ip address');
|
|
1271
|
-
const ipBlocks = value.split('.');
|
|
1272
|
-
const blocks = ipBlocks.every((block) => {
|
|
1273
|
-
return block >= 0 && block <= 255;
|
|
1274
|
-
});
|
|
1275
|
-
if (blocks) {
|
|
1276
|
-
this._ip = value;
|
|
1277
|
-
} else {
|
|
1278
|
-
throw new errors_index.ValidationError('Invalid ip address');
|
|
1279
|
-
}
|
|
1280
|
-
}
|
|
1281
|
-
|
|
1282
|
-
toObject() {
|
|
1283
|
-
return {
|
|
1284
|
-
ip: this.ip,
|
|
1285
|
-
location: this.location,
|
|
1286
|
-
type: this.type,
|
|
1287
|
-
version: this.version,
|
|
1288
|
-
};
|
|
1289
|
-
}
|
|
1290
|
-
}
|
|
1291
|
-
|
|
1292
|
-
class KycFileRequest extends BaseRequest {
|
|
1293
|
-
constructor({ data, isMx, status, type, uriBack, uriFront }) {
|
|
1294
|
-
super();
|
|
1295
|
-
this.data = data;
|
|
1296
|
-
this.isMx = isMx;
|
|
1297
|
-
this.status = status;
|
|
1298
|
-
this.type = type;
|
|
1299
|
-
this.uriBack = uriBack;
|
|
1300
|
-
this.uriFront = uriFront;
|
|
1301
|
-
}
|
|
1302
|
-
|
|
1303
|
-
toObject() {
|
|
1304
|
-
return {
|
|
1305
|
-
data: this.data,
|
|
1306
|
-
is_mx: this.isMx,
|
|
1307
|
-
status: this.status,
|
|
1308
|
-
type: this.type,
|
|
1309
|
-
uri_back: this.uriBack,
|
|
1310
|
-
uri_front: this.uriFront,
|
|
1311
|
-
};
|
|
1312
|
-
}
|
|
1313
|
-
}
|
|
1314
|
-
class UserUpdateRequest extends BaseRequest {
|
|
1315
|
-
constructor({
|
|
1316
|
-
address,
|
|
1317
|
-
blacklistValidationStatus,
|
|
1318
|
-
countryOfBirth,
|
|
1319
|
-
curpDocumentUri,
|
|
1320
|
-
fiscalRegimeCode,
|
|
1321
|
-
govtId,
|
|
1322
|
-
emailAddress,
|
|
1323
|
-
isDormant,
|
|
1324
|
-
isFraud,
|
|
1325
|
-
isPldBlocked,
|
|
1326
|
-
isSecurityMode,
|
|
1327
|
-
profession,
|
|
1328
|
-
proofOfAddress,
|
|
1329
|
-
proofOfLife,
|
|
1330
|
-
requiredLevel,
|
|
1331
|
-
termsOfService,
|
|
1332
|
-
phoneNumber,
|
|
1333
|
-
rfc,
|
|
1334
|
-
status,
|
|
1335
|
-
userType,
|
|
1336
|
-
verificationId,
|
|
1337
|
-
}) {
|
|
1338
|
-
super();
|
|
1339
|
-
this.addressProofs = proofOfAddress;
|
|
1340
|
-
this.adrs = address;
|
|
1341
|
-
this.blacklistValidationStatus = blacklistValidationStatus;
|
|
1342
|
-
this.countryOfBirth = countryOfBirth;
|
|
1343
|
-
this.curpDocumentUri = curpDocumentUri;
|
|
1344
|
-
this.emailAddress = emailAddress;
|
|
1345
|
-
this.fiscalRegimeCode = fiscalRegimeCode;
|
|
1346
|
-
this.govstIds = govtId;
|
|
1347
|
-
this.isDormant = isDormant;
|
|
1348
|
-
this.isFraud = isFraud;
|
|
1349
|
-
this.isPldBlocked = isPldBlocked;
|
|
1350
|
-
this.isSecurityMode = isSecurityMode;
|
|
1351
|
-
this.lifeProofs = proofOfLife;
|
|
1352
|
-
this.profession = profession;
|
|
1353
|
-
this.phoneNumber = phoneNumber;
|
|
1354
|
-
this.requiredLevel = requiredLevel;
|
|
1355
|
-
this.termsOfService = termsOfService;
|
|
1356
|
-
this.rfc = rfc;
|
|
1357
|
-
this.status = status;
|
|
1358
|
-
this.userType = userType;
|
|
1359
|
-
this.verificationId = verificationId;
|
|
1360
|
-
}
|
|
1361
|
-
|
|
1362
|
-
get termsOfService() {
|
|
1363
|
-
return this._termsOfService;
|
|
1364
|
-
}
|
|
1365
|
-
|
|
1366
|
-
set termsOfService(value) {
|
|
1367
|
-
if (!value) return;
|
|
1368
|
-
this._termsOfService = new TosUpdateRequest(value).toObject();
|
|
1369
|
-
}
|
|
1370
|
-
|
|
1371
|
-
get address() {
|
|
1372
|
-
return this._address;
|
|
1373
|
-
}
|
|
1374
|
-
|
|
1375
|
-
set adrs(value) {
|
|
1376
|
-
if (!value) return;
|
|
1377
|
-
this._address = new AddressUpdateRequest(value).toCleanObject();
|
|
1378
|
-
}
|
|
1379
|
-
|
|
1380
|
-
get proofOfLife() {
|
|
1381
|
-
return this._proofOfLife;
|
|
1382
|
-
}
|
|
1383
|
-
|
|
1384
|
-
set lifeProofs(value) {
|
|
1385
|
-
if (!value) return;
|
|
1386
|
-
this._proofOfLife = new KycFileRequest(value).toCleanObject();
|
|
1387
|
-
}
|
|
1388
|
-
|
|
1389
|
-
get proofOfAddress() {
|
|
1390
|
-
return this._proofOfAddress;
|
|
1391
|
-
}
|
|
1392
|
-
|
|
1393
|
-
set addressProofs(value) {
|
|
1394
|
-
if (!value) return;
|
|
1395
|
-
this._proofOfAddress = new KycFileRequest(value).toCleanObject();
|
|
1396
|
-
}
|
|
1397
|
-
|
|
1398
|
-
get govtId() {
|
|
1399
|
-
return this._govtId;
|
|
1400
|
-
}
|
|
1401
|
-
|
|
1402
|
-
set govstIds(value) {
|
|
1403
|
-
if (!value) return;
|
|
1404
|
-
this._govtId = new KycFileRequest(value).toCleanObject();
|
|
1405
|
-
}
|
|
1406
|
-
|
|
1407
|
-
toObject() {
|
|
1408
|
-
return {
|
|
1409
|
-
address: this.address,
|
|
1410
|
-
blacklist_validation_status: this.blacklistValidationStatus,
|
|
1411
|
-
country_of_birth: this.countryOfBirth,
|
|
1412
|
-
curp_document_uri: this.curpDocumentUri,
|
|
1413
|
-
email_address: this.emailAddress,
|
|
1414
|
-
fiscal_regime_code: this.fiscalRegimeCode,
|
|
1415
|
-
govt_id: this.govtId,
|
|
1416
|
-
is_dormant: this.isDormant,
|
|
1417
|
-
is_fraud: this.isFraud,
|
|
1418
|
-
is_pld_blocked: this.isPldBlocked,
|
|
1419
|
-
is_security_mode: this.isSecurityMode,
|
|
1420
|
-
phone_number: this.phoneNumber,
|
|
1421
|
-
profession: this.profession,
|
|
1422
|
-
proof_of_life: this.proofOfLife,
|
|
1423
|
-
proof_of_address: this.proofOfAddress,
|
|
1424
|
-
requiredLevel: this.requiredLevel,
|
|
1425
|
-
rfc: this.rfc,
|
|
1426
|
-
status: this.status,
|
|
1427
|
-
terms_of_service: this.termsOfService,
|
|
1428
|
-
verification_id: this.verificationId,
|
|
1429
|
-
user_type: this.userType,
|
|
1430
|
-
};
|
|
1431
|
-
}
|
|
1432
|
-
}
|
|
1433
|
-
|
|
1434
|
-
class VerificationRequest extends BaseRequest {
|
|
1435
|
-
constructor({ platformId, recipient, type }) {
|
|
1436
|
-
super();
|
|
1437
|
-
this.platformId = platformId;
|
|
1438
|
-
this.type = type;
|
|
1439
|
-
this.recipients = recipient;
|
|
1440
|
-
}
|
|
1441
|
-
|
|
1442
|
-
get recipient() {
|
|
1443
|
-
return this._recipient;
|
|
1444
|
-
}
|
|
1445
|
-
|
|
1446
|
-
set recipients(value) {
|
|
1447
|
-
function validateEmail(email) {
|
|
1448
|
-
return email.match(
|
|
1449
|
-
/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
|
|
1450
|
-
);
|
|
1451
|
-
}
|
|
1452
|
-
|
|
1453
|
-
function validatePhone(phone) {
|
|
1454
|
-
return phone.match(/^\+?[0-9]{10,15}$/);
|
|
1455
|
-
}
|
|
1456
|
-
|
|
1457
|
-
switch (data.enumValueFromString(data.VerificationType, this.type)) {
|
|
1458
|
-
case data.VerificationType.Email:
|
|
1459
|
-
if (validateEmail(value)) {
|
|
1460
|
-
this._recipient = value;
|
|
1461
|
-
} else {
|
|
1462
|
-
throw new errors_index.ValidationError('Invalid email address');
|
|
1463
|
-
}
|
|
1464
|
-
break;
|
|
1465
|
-
case data.VerificationType.Phone:
|
|
1466
|
-
if (validatePhone(value)) {
|
|
1467
|
-
this._recipient = value;
|
|
1468
|
-
} else {
|
|
1469
|
-
throw new errors_index.ValidationError('Invalid Phone Number');
|
|
1470
|
-
}
|
|
1471
|
-
break;
|
|
1472
|
-
}
|
|
1473
|
-
}
|
|
1474
|
-
|
|
1475
|
-
toObject() {
|
|
1476
|
-
return {
|
|
1477
|
-
platform_id: this.platformId,
|
|
1478
|
-
recipient: this.recipient,
|
|
1479
|
-
type: this.type,
|
|
1480
|
-
};
|
|
1481
|
-
}
|
|
1482
|
-
}
|
|
1483
|
-
|
|
1484
|
-
class VerificationAttemptRequest extends BaseRequest {
|
|
1485
|
-
constructor({ code }) {
|
|
1486
|
-
super();
|
|
1487
|
-
this.code = code;
|
|
1488
|
-
}
|
|
1489
|
-
|
|
1490
|
-
toObject() {
|
|
1491
|
-
return {
|
|
1492
|
-
code: this.code,
|
|
1493
|
-
};
|
|
1494
|
-
}
|
|
1495
|
-
}
|
|
1496
|
-
|
|
1497
|
-
class WalletTransactionRequest extends BaseRequest {
|
|
1498
|
-
constructor(amount, transactionType, walletUri) {
|
|
1499
|
-
super();
|
|
1500
|
-
this.amount = amount;
|
|
1501
|
-
this.transactionType = transactionType;
|
|
1502
|
-
this.walletUri = walletUri;
|
|
1503
|
-
}
|
|
1504
|
-
|
|
1505
|
-
toObject() {
|
|
1506
|
-
return {
|
|
1507
|
-
amount: this.amount,
|
|
1508
|
-
transaction_type: this.transactionType,
|
|
1509
|
-
wallet_uri: this.walletUri,
|
|
1510
|
-
};
|
|
1511
|
-
}
|
|
1512
|
-
}
|
|
1513
|
-
|
|
1514
|
-
exports.AddressUpdateRequest = AddressUpdateRequest;
|
|
1515
|
-
exports.AlertUpdateRequest = AlertUpdateRequest;
|
|
1516
|
-
exports.ApiKeyUpdateRequest = ApiKeyUpdateRequest;
|
|
1517
|
-
exports.ArpcRequest = ArpcRequest;
|
|
1518
|
-
exports.BaseRequest = BaseRequest;
|
|
1519
|
-
exports.CardActivationRequest = CardActivationRequest;
|
|
1520
|
-
exports.CardRequest = CardRequest;
|
|
1521
|
-
exports.CardUpdateRequest = CardUpdateRequest;
|
|
1522
|
-
exports.CardValidationRequest = CardValidationRequest;
|
|
1523
|
-
exports.FraudFundsTransferRequest = FraudFundsTransferRequest;
|
|
1524
|
-
exports.KYCValidationsRequest = KYCValidationsRequest;
|
|
1525
|
-
exports.PartnerUserRequest = PartnerUserRequest;
|
|
1526
|
-
exports.ReportGenerateRequest = ReportGenerateRequest;
|
|
1527
|
-
exports.SavingRequest = SavingRequest;
|
|
1528
|
-
exports.SessionRequest = SessionRequest;
|
|
1529
|
-
exports.TransferRequest = TransferRequest;
|
|
1530
|
-
exports.TransferUpdateRequest = TransferUpdateRequest;
|
|
1531
|
-
exports.UserCredentialRequest = UserCredentialRequest;
|
|
1532
|
-
exports.UserCredentialUpdateRequest = UserCredentialUpdateRequest;
|
|
1533
|
-
exports.UserLoginRequest = UserLoginRequest;
|
|
1534
|
-
exports.UserReportCreateRequest = UserReportCreateRequest;
|
|
1535
|
-
exports.UserReportUpdateRequest = UserReportUpdateRequest;
|
|
1536
|
-
exports.UserUpdateRequest = UserUpdateRequest;
|
|
1537
|
-
exports.VerificationAttemptRequest = VerificationAttemptRequest;
|
|
1538
|
-
exports.VerificationRequest = VerificationRequest;
|
|
1539
|
-
exports.WalletTransactionRequest = WalletTransactionRequest;
|