@cuenca-mx/cuenca-js 0.0.14-dev2 → 0.0.14-dev20
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/README.md +3 -1
- package/build/{data-15b623a1.mjs → data-27fc844b.mjs} +48 -14
- package/build/{data-665e0ec5.cjs → data-6c2897da.cjs} +50 -14
- package/build/index.cjs +427 -59
- package/build/index.mjs +397 -29
- package/build/requests/index.cjs +3 -2
- package/build/requests/index.mjs +3 -3
- package/build/types/index.cjs +70 -26
- package/build/types/index.mjs +36 -2
- package/build/umd/cuenca.umd.js +1 -1
- package/build/{identities-ca4f29bd.mjs → vulnerableActivity-70ff062e.mjs} +477 -193
- package/build/{identities-4ff313d8.cjs → vulnerableActivity-88488ee4.cjs} +487 -193
- package/build/{walletTransactionRequest-f733313f.cjs → walletTransactionRequest-534ea750.cjs} +700 -218
- package/build/{walletTransactionRequest-ada06c52.mjs → walletTransactionRequest-80f0424d.mjs} +700 -219
- package/package.json +4 -2
package/build/index.mjs
CHANGED
|
@@ -2,9 +2,9 @@ import axios from 'axios';
|
|
|
2
2
|
import Buffer from 'buffer';
|
|
3
3
|
import { CuencaResponseException, CuencaException, NoResultFound, MultipleResultsFound, InvalidPassword } from './errors/index.mjs';
|
|
4
4
|
import { Jwt } from './jwt/index.mjs';
|
|
5
|
-
import { P as Phase, F as FileFormat, d as dateToUTC, e as enumValueFromString, M as MLIndicatorLevel, a as MLIndicatorPeriod, A as AlertStatus, b as MLIndicatorType, c as
|
|
6
|
-
import { A as Address, K as KYCFile, T as TOSAgreements,
|
|
7
|
-
import { A as AlertUpdateRequest, a as ApiKeyUpdateRequest, b as ArpcRequest, U as UserUpdateRequest, C as CardActivationRequest, c as CardRequest, d as CardUpdateRequest, e as CardValidationRequest, K as KYCValidationsRequest, S as SavingRequest, f as SessionRequest, T as TransferRequest, g as UserCredentialRequest, h as UserCredentialUpdateRequest, i as UserLoginRequest, V as VerificationRequest, j as VerificationAttemptRequest, W as WalletTransactionRequest } from './walletTransactionRequest-
|
|
5
|
+
import { P as Phase, F as FileFormat, d as dateToUTC, e as enumValueFromString, M as MLIndicatorLevel, a as MLIndicatorPeriod, A as AlertStatus, S as SourceAlertType, b as MLIndicatorType, c as PLDFilterType, E as EntryType, T as TransactionStatus, B as BridgeAccountStatus, f as BridgeBankAccountStatus, C as Currency, N as Network, g as BridgeTransactionType, h as CardFundingType, i as CardIssuer, j as CardStatus, k as CardType, l as CardErrorType, m as CardTransactionType, n as CommissionType, D as DepositNetwork, K as KYCFileType, U as UserStatus, o as SavingCategory, p as ServiceProviderCategory, q as SessionType, r as TransferNetwork, V as VerificationStatus, s as VerificationType, W as WalletTransactionType } from './data-27fc844b.mjs';
|
|
6
|
+
import { A as AlertLog, a as Address, K as KYCFile, T as TOSAgreements, b as TransactionalProfileServices, S as ShareholderMoral, L as LegalRepresentatives, E as ExternalAccount, V as VulnerableActivity, c as Audit, d as License, B as BusinessDetails, e as AccountQuery, f as AlertQuery, g as ApiKeyQuery, h as BalanceEntryQuery, i as BillPaymentQuery, j as BridgeAccountQuery, k as BridgeBankAccountQuery, l as BridgeQuery, m as BridgeTransactionQuery, C as CardsQuery, n as CardTransactionQuery, Q as QueryParams, D as DepositQuery, P as PartnerQuery, W as WalletQuery, o as StatementQuery, p as TransferQuery, U as UserQuery, q as WalletTransactionQuery } from './vulnerableActivity-70ff062e.mjs';
|
|
7
|
+
import { A as AlertUpdateRequest, a as ApiKeyUpdateRequest, b as ArpcRequest, U as UserUpdateRequest, C as CardActivationRequest, c as CardRequest, d as CardUpdateRequest, e as CardValidationRequest, K as KYCValidationsRequest, P as PartnerUserRequest, S as SavingRequest, f as SessionRequest, T as TransferRequest, g as UserCredentialRequest, h as UserCredentialUpdateRequest, i as UserLoginRequest, V as VerificationRequest, j as VerificationAttemptRequest, W as WalletTransactionRequest } from './walletTransactionRequest-80f0424d.mjs';
|
|
8
8
|
|
|
9
9
|
/* global window */
|
|
10
10
|
|
|
@@ -17,7 +17,7 @@ const isNode =
|
|
|
17
17
|
|
|
18
18
|
const runtimeEnv = { isBrowser, isNode };
|
|
19
19
|
|
|
20
|
-
const name="@cuenca-mx/cuenca-js";const version="0.0.14-
|
|
20
|
+
const name="@cuenca-mx/cuenca-js";const version="0.0.14-dev20";const description="Cuenca client for JS";const main="./build/index.cjs";const module="./build/index.mjs";const browser="./build/umd/cuenca.umd.js";const files=["build/**/*"];const exports={".":{"import":"./build/index.mjs",require:"./build/index.cjs"},"./errors":{"import":"./build/errors/index.mjs",require:"./build/errors/index.cjs"},"./jwt":{"import":"./build/jwt/index.mjs",require:"./build/jwt/index.cjs"},"./requests":{"import":"./build/requests/index.mjs",require:"./build/requests/index.cjs"},"./types":{"import":"./build/types/index.mjs",require:"./build/types/index.cjs"}};const packageManager="yarn@3.0.2";const type="module";const repository={type:"git",url:"https://github.com/cuenca-mx/cuenca-js.git",directory:"packages/cuenca-js"};const keywords=["cuenca"];const license="MIT";const bugs={url:"https://github.com/cuenca-mx/cuenca-js/issues"};const homepage="https://cuenca.com";const scripts={build:"rm -rf build/ && yarn rollup --config",test:"yarn node --experimental-vm-modules $(yarn bin jest)",publish:"yarn build && yarn npm publish",dev:"rm -rf build/ && yarn rollup --config && yarn node ../example.cjs",example:"yarn node ../example.cjs"};const devDependencies={"@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^13.1.1",jest:"^27.4.5",rollup:"^2.61.1","rollup-plugin-terser":"^7.0.2"};const dependencies={axios:"^0.24.0",buffer:"^6.0.3"};var pkg = {name:name,version:version,description:description,main:main,module:module,browser:browser,files:files,exports:exports,packageManager:packageManager,type:type,repository:repository,keywords:keywords,license:license,bugs:bugs,homepage:homepage,scripts:scripts,devDependencies:devDependencies,dependencies:dependencies};
|
|
21
21
|
|
|
22
22
|
class Client {
|
|
23
23
|
constructor({
|
|
@@ -237,12 +237,16 @@ class Account {
|
|
|
237
237
|
|
|
238
238
|
class Alert {
|
|
239
239
|
constructor({
|
|
240
|
+
agent,
|
|
240
241
|
accountNumber,
|
|
241
242
|
actualPeriodCount,
|
|
242
243
|
actualPeriodSum,
|
|
243
244
|
aggregationType,
|
|
245
|
+
changeLog,
|
|
246
|
+
comments,
|
|
244
247
|
committeeMeetingDate,
|
|
245
248
|
createdAt,
|
|
249
|
+
questionnaireId,
|
|
246
250
|
description,
|
|
247
251
|
hasQuestionnaire,
|
|
248
252
|
id,
|
|
@@ -252,6 +256,7 @@ class Alert {
|
|
|
252
256
|
period,
|
|
253
257
|
periodNumber,
|
|
254
258
|
status,
|
|
259
|
+
sourceType,
|
|
255
260
|
transactionDate,
|
|
256
261
|
type,
|
|
257
262
|
typeOfFilter,
|
|
@@ -261,9 +266,12 @@ class Alert {
|
|
|
261
266
|
this.accountNumber = accountNumber;
|
|
262
267
|
this.actualPeriodCount = actualPeriodCount;
|
|
263
268
|
this.actualPeriodSum = actualPeriodSum;
|
|
269
|
+
this.agent = agent;
|
|
264
270
|
this.aggregationType = aggregationType;
|
|
271
|
+
this.comments = comments;
|
|
265
272
|
this.committeeMeetingDate = dateToUTC(committeeMeetingDate);
|
|
266
273
|
this.createdAt = dateToUTC(createdAt);
|
|
274
|
+
this.questionnaireId = questionnaireId;
|
|
267
275
|
this.description = description;
|
|
268
276
|
this.hasQuestionnaire = hasQuestionnaire;
|
|
269
277
|
this.id = id;
|
|
@@ -273,14 +281,18 @@ class Alert {
|
|
|
273
281
|
this.period = enumValueFromString(MLIndicatorPeriod, period);
|
|
274
282
|
this.periodNumber = periodNumber;
|
|
275
283
|
this.status = enumValueFromString(AlertStatus, status);
|
|
284
|
+
this.sourceType = enumValueFromString(SourceAlertType, sourceType);
|
|
276
285
|
this.transactionDate = dateToUTC(transactionDate);
|
|
277
286
|
this.type = enumValueFromString(MLIndicatorType, type);
|
|
278
|
-
this.typeOfFilter = enumValueFromString(
|
|
287
|
+
this.typeOfFilter = enumValueFromString(PLDFilterType, typeOfFilter);
|
|
279
288
|
this.updatedAt = dateToUTC(updatedAt);
|
|
280
289
|
this.userId = userId;
|
|
290
|
+
this.changeLog = changeLog;
|
|
281
291
|
}
|
|
282
292
|
|
|
283
293
|
static fromObject = ({
|
|
294
|
+
agent,
|
|
295
|
+
comments,
|
|
284
296
|
description,
|
|
285
297
|
id,
|
|
286
298
|
level,
|
|
@@ -291,6 +303,8 @@ class Alert {
|
|
|
291
303
|
...obj
|
|
292
304
|
}) =>
|
|
293
305
|
new Alert({
|
|
306
|
+
agent,
|
|
307
|
+
comments,
|
|
294
308
|
description,
|
|
295
309
|
id,
|
|
296
310
|
level,
|
|
@@ -302,16 +316,28 @@ class Alert {
|
|
|
302
316
|
actualPeriodCount: obj.actual_period_count,
|
|
303
317
|
actualPeriodSum: obj.actual_period_sum,
|
|
304
318
|
aggregationType: obj.aggregation_type,
|
|
319
|
+
changeLog: obj.change_log,
|
|
305
320
|
committeeMeetingDate: obj.committee_meeting_date,
|
|
306
321
|
createdAt: obj.created_at,
|
|
322
|
+
questionnaireId: obj.questionnaire_id,
|
|
307
323
|
hasQuestionnaire: obj.has_questionnaire,
|
|
308
324
|
institutionName: obj.institution_name,
|
|
309
325
|
periodNumber: obj.period_number,
|
|
326
|
+
sourceType: obj.source_type,
|
|
310
327
|
transactionDate: obj.transaction_date,
|
|
311
328
|
typeOfFilter: obj.type_of_filter,
|
|
312
329
|
updatedAt: obj.updated_at,
|
|
313
330
|
userId: obj.user_id,
|
|
314
331
|
});
|
|
332
|
+
|
|
333
|
+
get changeLog() {
|
|
334
|
+
return this._changeLog;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
set changeLog(value) {
|
|
338
|
+
if (!value || !Array.isArray(value) || value.length === 0) return;
|
|
339
|
+
this._changeLog = value.map((entry) => AlertLog.fromObject(entry));
|
|
340
|
+
}
|
|
315
341
|
}
|
|
316
342
|
|
|
317
343
|
class ApiKey {
|
|
@@ -470,7 +496,7 @@ class BridgeAccount {
|
|
|
470
496
|
this.updatedAt = dateToUTC(updatedAt);
|
|
471
497
|
this.emailAddress = emailAddress;
|
|
472
498
|
this.clientClabe = clientClabe;
|
|
473
|
-
this.
|
|
499
|
+
this.govtId = govtId;
|
|
474
500
|
this.names = names;
|
|
475
501
|
this.firstSurname = firstSurname;
|
|
476
502
|
this.secondSurname = secondSurname;
|
|
@@ -481,10 +507,10 @@ class BridgeAccount {
|
|
|
481
507
|
this.userId = userId;
|
|
482
508
|
this.gender = gender;
|
|
483
509
|
this.phoneNumber = phoneNumber;
|
|
484
|
-
this.
|
|
510
|
+
this.proofOfAddress = proofOfAddress;
|
|
485
511
|
this.status = enumValueFromString(BridgeAccountStatus, status);
|
|
486
|
-
this.
|
|
487
|
-
this.
|
|
512
|
+
this.termsOfService = termsOfService;
|
|
513
|
+
this.address = address;
|
|
488
514
|
}
|
|
489
515
|
|
|
490
516
|
static fromObject = ({ status, address, ...obj }) =>
|
|
@@ -515,7 +541,7 @@ class BridgeAccount {
|
|
|
515
541
|
return this._address;
|
|
516
542
|
}
|
|
517
543
|
|
|
518
|
-
set
|
|
544
|
+
set address(value) {
|
|
519
545
|
if (!value || Object.keys(value).length === 0) return;
|
|
520
546
|
this._address = Address.fromObject(value);
|
|
521
547
|
}
|
|
@@ -524,7 +550,7 @@ class BridgeAccount {
|
|
|
524
550
|
return this._proofOfAddress;
|
|
525
551
|
}
|
|
526
552
|
|
|
527
|
-
set
|
|
553
|
+
set proofOfAddress(value) {
|
|
528
554
|
if (!value || Object.keys(value).length === 0) return;
|
|
529
555
|
this._proofOfAddress = KYCFile.fromObject(value);
|
|
530
556
|
}
|
|
@@ -533,7 +559,7 @@ class BridgeAccount {
|
|
|
533
559
|
return this._govtId;
|
|
534
560
|
}
|
|
535
561
|
|
|
536
|
-
set
|
|
562
|
+
set govtId(value) {
|
|
537
563
|
if (!value || Object.keys(value).length === 0) return;
|
|
538
564
|
this._govtId = KYCFile.fromObject(value);
|
|
539
565
|
}
|
|
@@ -542,7 +568,7 @@ class BridgeAccount {
|
|
|
542
568
|
return this._termsOfService;
|
|
543
569
|
}
|
|
544
570
|
|
|
545
|
-
set
|
|
571
|
+
set termsOfService(value) {
|
|
546
572
|
if (!value || Object.keys(value).length === 0) return;
|
|
547
573
|
this._termsOfService = TOSAgreements.fromObject(value);
|
|
548
574
|
}
|
|
@@ -1011,6 +1037,320 @@ class LoginToken {
|
|
|
1011
1037
|
static fromObject = ({ id }) => new LoginToken({ id });
|
|
1012
1038
|
}
|
|
1013
1039
|
|
|
1040
|
+
class TransactionalProfile {
|
|
1041
|
+
constructor({
|
|
1042
|
+
currency,
|
|
1043
|
+
monthlyAmount,
|
|
1044
|
+
recipientsNum,
|
|
1045
|
+
payersNum,
|
|
1046
|
+
deposits,
|
|
1047
|
+
withdrawal,
|
|
1048
|
+
}) {
|
|
1049
|
+
this.currency = currency;
|
|
1050
|
+
this.monthlyAmount = monthlyAmount;
|
|
1051
|
+
|
|
1052
|
+
this.recipientsNum = recipientsNum;
|
|
1053
|
+
this.payersNum = payersNum;
|
|
1054
|
+
|
|
1055
|
+
this.deposits = deposits;
|
|
1056
|
+
this.withdrawal = withdrawal;
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
get deposits() {
|
|
1060
|
+
return this._deposits;
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
set deposits(value) {
|
|
1064
|
+
if (!value) return;
|
|
1065
|
+
this._deposits = TransactionalProfileServices.fromObject(value);
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
get withdrawal() {
|
|
1069
|
+
return this._withdrawal;
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
set withdrawal(value) {
|
|
1073
|
+
if (!value) return;
|
|
1074
|
+
this._withdrawal = TransactionalProfileServices.fromObject(value);
|
|
1075
|
+
}
|
|
1076
|
+
|
|
1077
|
+
static fromObject = ({ currency, deposits, withdrawal, ...obj }) =>
|
|
1078
|
+
new TransactionalProfile({
|
|
1079
|
+
currency,
|
|
1080
|
+
deposits,
|
|
1081
|
+
withdrawal,
|
|
1082
|
+
payersNum: obj.payers_num,
|
|
1083
|
+
recipientsNum: obj.recipients_num,
|
|
1084
|
+
monthlyAmount: obj.monthly_amount,
|
|
1085
|
+
});
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
class BaseUser {
|
|
1089
|
+
constructor({
|
|
1090
|
+
address,
|
|
1091
|
+
clabe,
|
|
1092
|
+
emailAddress,
|
|
1093
|
+
id,
|
|
1094
|
+
level,
|
|
1095
|
+
meta,
|
|
1096
|
+
nationality,
|
|
1097
|
+
platformId,
|
|
1098
|
+
phoneNumber,
|
|
1099
|
+
requiredLevel,
|
|
1100
|
+
rfc,
|
|
1101
|
+
status,
|
|
1102
|
+
createdAt,
|
|
1103
|
+
updatedAt,
|
|
1104
|
+
userType,
|
|
1105
|
+
}) {
|
|
1106
|
+
this.address = address;
|
|
1107
|
+
this.clabe = clabe;
|
|
1108
|
+
this.createdAt = dateToUTC(createdAt);
|
|
1109
|
+
this.emailAddress = emailAddress;
|
|
1110
|
+
this.id = id;
|
|
1111
|
+
this.level = level;
|
|
1112
|
+
this.meta = meta;
|
|
1113
|
+
this.nationality = nationality;
|
|
1114
|
+
this.platformId = platformId;
|
|
1115
|
+
this.phoneNumber = phoneNumber;
|
|
1116
|
+
this.requiredLevel = requiredLevel;
|
|
1117
|
+
this.rfc = rfc;
|
|
1118
|
+
this.status = enumValueFromString(UserStatus, status);
|
|
1119
|
+
this.updatedAt = dateToUTC(updatedAt);
|
|
1120
|
+
this.userType = userType;
|
|
1121
|
+
}
|
|
1122
|
+
|
|
1123
|
+
get address() {
|
|
1124
|
+
return this._address;
|
|
1125
|
+
}
|
|
1126
|
+
|
|
1127
|
+
set address(value) {
|
|
1128
|
+
if (!value) return;
|
|
1129
|
+
this._address = Address.fromObject(value);
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
static fromObject = ({
|
|
1133
|
+
address,
|
|
1134
|
+
clabe,
|
|
1135
|
+
id,
|
|
1136
|
+
level,
|
|
1137
|
+
nationality,
|
|
1138
|
+
rfc,
|
|
1139
|
+
status,
|
|
1140
|
+
...obj
|
|
1141
|
+
}) =>
|
|
1142
|
+
new BaseUser({
|
|
1143
|
+
address,
|
|
1144
|
+
clabe,
|
|
1145
|
+
id,
|
|
1146
|
+
level,
|
|
1147
|
+
meta: obj.meta,
|
|
1148
|
+
nationality,
|
|
1149
|
+
rfc,
|
|
1150
|
+
status,
|
|
1151
|
+
createdAt: obj.created_at,
|
|
1152
|
+
emailAddress: obj.email_address,
|
|
1153
|
+
phoneNumber: obj.phone_number,
|
|
1154
|
+
platformId: obj.platform_id,
|
|
1155
|
+
requiredLevel: obj.required_level,
|
|
1156
|
+
updatedAt: obj.updated_at,
|
|
1157
|
+
userType: obj.user_type,
|
|
1158
|
+
});
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
class Partner extends BaseUser {
|
|
1162
|
+
constructor({
|
|
1163
|
+
address,
|
|
1164
|
+
audit,
|
|
1165
|
+
businessDetails,
|
|
1166
|
+
businessModel,
|
|
1167
|
+
businessName,
|
|
1168
|
+
clabe,
|
|
1169
|
+
createdAt,
|
|
1170
|
+
documentationUrl,
|
|
1171
|
+
emailAddress,
|
|
1172
|
+
externalAccount,
|
|
1173
|
+
folio,
|
|
1174
|
+
id,
|
|
1175
|
+
incorporationDate,
|
|
1176
|
+
legalName,
|
|
1177
|
+
legalRepresentatives,
|
|
1178
|
+
level,
|
|
1179
|
+
license,
|
|
1180
|
+
meta,
|
|
1181
|
+
nationality,
|
|
1182
|
+
phoneNumber,
|
|
1183
|
+
platformId,
|
|
1184
|
+
requiredLevel,
|
|
1185
|
+
rfc,
|
|
1186
|
+
shareholders,
|
|
1187
|
+
status,
|
|
1188
|
+
transactionalProfile,
|
|
1189
|
+
updatedAt,
|
|
1190
|
+
userId,
|
|
1191
|
+
userType,
|
|
1192
|
+
vulnerableActivity,
|
|
1193
|
+
webSite,
|
|
1194
|
+
}) {
|
|
1195
|
+
super({
|
|
1196
|
+
address,
|
|
1197
|
+
clabe,
|
|
1198
|
+
emailAddress,
|
|
1199
|
+
rfc,
|
|
1200
|
+
id,
|
|
1201
|
+
level,
|
|
1202
|
+
license,
|
|
1203
|
+
meta,
|
|
1204
|
+
nationality,
|
|
1205
|
+
platformId,
|
|
1206
|
+
phoneNumber,
|
|
1207
|
+
requiredLevel,
|
|
1208
|
+
status,
|
|
1209
|
+
createdAt,
|
|
1210
|
+
updatedAt,
|
|
1211
|
+
userType,
|
|
1212
|
+
});
|
|
1213
|
+
this.audit = audit;
|
|
1214
|
+
this.businessModel = businessModel;
|
|
1215
|
+
this.businessName = businessName;
|
|
1216
|
+
this.businessDetails = businessDetails;
|
|
1217
|
+
this.documentationUrl = documentationUrl;
|
|
1218
|
+
this.incorporationDate = dateToUTC(incorporationDate);
|
|
1219
|
+
this.externalAccount = externalAccount;
|
|
1220
|
+
this.folio = folio;
|
|
1221
|
+
this.legalName = legalName;
|
|
1222
|
+
this.license = license;
|
|
1223
|
+
this.shareholders = shareholders;
|
|
1224
|
+
this.legalRepresentatives = legalRepresentatives;
|
|
1225
|
+
this.transactionalProfile = transactionalProfile;
|
|
1226
|
+
this.userId = userId;
|
|
1227
|
+
this.vulnerableActivity = vulnerableActivity;
|
|
1228
|
+
this.webSite = webSite;
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
get shareholders() {
|
|
1232
|
+
return this._shareholders;
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
set shareholders(value) {
|
|
1236
|
+
if (!value) return;
|
|
1237
|
+
this._shareholders = value.map((sh) => ShareholderMoral.fromObject(sh));
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
get legalRepresentatives() {
|
|
1241
|
+
return this._legalRepresentatives;
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
set legalRepresentatives(value) {
|
|
1245
|
+
if (!value) return;
|
|
1246
|
+
this._legalRepresentatives = value.map((lr) =>
|
|
1247
|
+
LegalRepresentatives.fromObject(lr),
|
|
1248
|
+
);
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
get externalAccount() {
|
|
1252
|
+
return this._externalAccount;
|
|
1253
|
+
}
|
|
1254
|
+
|
|
1255
|
+
set externalAccount(value) {
|
|
1256
|
+
if (!value) return;
|
|
1257
|
+
this._externalAccount = ExternalAccount.fromObject(value);
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
get vulnerableActivity() {
|
|
1261
|
+
return this._vulnerableActivity;
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
set vulnerableActivity(value) {
|
|
1265
|
+
if (!value) return;
|
|
1266
|
+
this._vulnerableActivity = VulnerableActivity.fromObject(value);
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
get audit() {
|
|
1270
|
+
return this._audit;
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1273
|
+
set audit(value) {
|
|
1274
|
+
if (!value) return;
|
|
1275
|
+
this._audit = Audit.fromObject(value);
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
get license() {
|
|
1279
|
+
return this._license;
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
set license(value) {
|
|
1283
|
+
if (!value) return;
|
|
1284
|
+
this._license = License.fromObject(value);
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
get transactionalProfile() {
|
|
1288
|
+
return this._transactionalProfile;
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1291
|
+
set transactionalProfile(value) {
|
|
1292
|
+
if (!value) return;
|
|
1293
|
+
this._transactionalProfile = TransactionalProfile.fromObject(value);
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
get businessDetails() {
|
|
1297
|
+
return this._businessDetails;
|
|
1298
|
+
}
|
|
1299
|
+
|
|
1300
|
+
set businessDetails(value) {
|
|
1301
|
+
if (!value) return;
|
|
1302
|
+
this._businessDetails = BusinessDetails.fromObject(value);
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
static fromObject = ({
|
|
1306
|
+
audit,
|
|
1307
|
+
address,
|
|
1308
|
+
clabe,
|
|
1309
|
+
folio,
|
|
1310
|
+
id,
|
|
1311
|
+
level,
|
|
1312
|
+
license,
|
|
1313
|
+
nationality,
|
|
1314
|
+
rfc,
|
|
1315
|
+
status,
|
|
1316
|
+
shareholders,
|
|
1317
|
+
...obj
|
|
1318
|
+
}) =>
|
|
1319
|
+
new Partner({
|
|
1320
|
+
address,
|
|
1321
|
+
audit,
|
|
1322
|
+
clabe,
|
|
1323
|
+
folio,
|
|
1324
|
+
id,
|
|
1325
|
+
level,
|
|
1326
|
+
license,
|
|
1327
|
+
nationality,
|
|
1328
|
+
rfc,
|
|
1329
|
+
shareholders,
|
|
1330
|
+
status,
|
|
1331
|
+
legalName: obj.legal_name,
|
|
1332
|
+
legalRepresentatives: obj.legal_representatives,
|
|
1333
|
+
businessModel: obj.business_model,
|
|
1334
|
+
businessName: obj.business_name,
|
|
1335
|
+
businessDetails: obj.business_details,
|
|
1336
|
+
createdAt: obj.created_at,
|
|
1337
|
+
documentationUrl: obj.documentation_url,
|
|
1338
|
+
emailAddress: obj.email_address,
|
|
1339
|
+
externalAccount: obj.external_account,
|
|
1340
|
+
incorporationDate: obj.incorporation_date,
|
|
1341
|
+
meta: obj.meta,
|
|
1342
|
+
phoneNumber: obj.phone_number,
|
|
1343
|
+
platformId: obj.platform_id,
|
|
1344
|
+
requiredLevel: obj.required_level,
|
|
1345
|
+
transactionalProfile: obj.transactional_profile,
|
|
1346
|
+
updatedAt: obj.updated_at,
|
|
1347
|
+
userId: obj.user_id,
|
|
1348
|
+
userType: obj.user_type,
|
|
1349
|
+
vulnerableActivity: obj.vulnerable_activity,
|
|
1350
|
+
webSite: obj.web_site,
|
|
1351
|
+
});
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1014
1354
|
class Wallet {
|
|
1015
1355
|
constructor({ balance, createdAt, deactivatedAt, id, userId, updatedAt }) {
|
|
1016
1356
|
this.balance = balance;
|
|
@@ -1218,9 +1558,10 @@ class User {
|
|
|
1218
1558
|
status,
|
|
1219
1559
|
termsOfService,
|
|
1220
1560
|
updatedAt,
|
|
1561
|
+
userType,
|
|
1221
1562
|
verificationId,
|
|
1222
1563
|
}) {
|
|
1223
|
-
this.
|
|
1564
|
+
this.address = address;
|
|
1224
1565
|
this.blacklistValidationStatus = enumValueFromString(
|
|
1225
1566
|
VerificationStatus,
|
|
1226
1567
|
blacklistValidationStatus,
|
|
@@ -1229,7 +1570,7 @@ class User {
|
|
|
1229
1570
|
this.countryOfBirth = countryOfBirth;
|
|
1230
1571
|
this.createdAt = dateToUTC(createdAt);
|
|
1231
1572
|
this.curp = curp;
|
|
1232
|
-
this.
|
|
1573
|
+
this.curpDocument = curpDocument;
|
|
1233
1574
|
this.dateOfBirth = dateOfBirth;
|
|
1234
1575
|
this.emailAddress = emailAddress;
|
|
1235
1576
|
this.firstSurname = firstSurname;
|
|
@@ -1239,16 +1580,17 @@ class User {
|
|
|
1239
1580
|
this.names = names;
|
|
1240
1581
|
this.nationality = nationality;
|
|
1241
1582
|
this.phoneNumber = phoneNumber;
|
|
1242
|
-
this.
|
|
1243
|
-
this.
|
|
1244
|
-
this.
|
|
1583
|
+
this.govtId = govtId;
|
|
1584
|
+
this.proofOfAddress = proofOfAddress;
|
|
1585
|
+
this.proofOfLife = proofOfLife;
|
|
1245
1586
|
this.requiredLevel = requiredLevel;
|
|
1246
1587
|
this.rfc = rfc;
|
|
1247
1588
|
this.secondSurname = secondSurname;
|
|
1248
1589
|
this.stateOfBirth = stateOfBirth;
|
|
1249
1590
|
this.status = enumValueFromString(UserStatus, status);
|
|
1250
|
-
this.
|
|
1591
|
+
this.termsOfService = termsOfService;
|
|
1251
1592
|
this.updatedAt = dateToUTC(updatedAt);
|
|
1593
|
+
this.userType = userType;
|
|
1252
1594
|
this.verificationId = verificationId;
|
|
1253
1595
|
}
|
|
1254
1596
|
|
|
@@ -1256,7 +1598,7 @@ class User {
|
|
|
1256
1598
|
return this._address;
|
|
1257
1599
|
}
|
|
1258
1600
|
|
|
1259
|
-
set
|
|
1601
|
+
set address(value) {
|
|
1260
1602
|
if (!value) return;
|
|
1261
1603
|
this._address = Address.fromObject(value);
|
|
1262
1604
|
}
|
|
@@ -1265,7 +1607,7 @@ class User {
|
|
|
1265
1607
|
return this._proofOfAddress;
|
|
1266
1608
|
}
|
|
1267
1609
|
|
|
1268
|
-
set
|
|
1610
|
+
set proofOfAddress(value) {
|
|
1269
1611
|
if (!value) return;
|
|
1270
1612
|
this._proofOfAddress = KYCFile.fromObject(value);
|
|
1271
1613
|
}
|
|
@@ -1274,7 +1616,7 @@ class User {
|
|
|
1274
1616
|
return this._proofOfLife;
|
|
1275
1617
|
}
|
|
1276
1618
|
|
|
1277
|
-
set
|
|
1619
|
+
set proofOfLife(value) {
|
|
1278
1620
|
if (!value) return;
|
|
1279
1621
|
this._proofOfLife = KYCFile.fromObject(value);
|
|
1280
1622
|
}
|
|
@@ -1283,7 +1625,7 @@ class User {
|
|
|
1283
1625
|
return this._govtId;
|
|
1284
1626
|
}
|
|
1285
1627
|
|
|
1286
|
-
set
|
|
1628
|
+
set govtId(value) {
|
|
1287
1629
|
if (!value) return;
|
|
1288
1630
|
this._govtId = KYCFile.fromObject(value);
|
|
1289
1631
|
}
|
|
@@ -1292,7 +1634,7 @@ class User {
|
|
|
1292
1634
|
return this._termsOfService;
|
|
1293
1635
|
}
|
|
1294
1636
|
|
|
1295
|
-
set
|
|
1637
|
+
set termsOfService(value) {
|
|
1296
1638
|
if (!value) return;
|
|
1297
1639
|
this._termsOfService = TOSAgreements.fromObject(value);
|
|
1298
1640
|
}
|
|
@@ -1301,7 +1643,7 @@ class User {
|
|
|
1301
1643
|
return this._curpDocument;
|
|
1302
1644
|
}
|
|
1303
1645
|
|
|
1304
|
-
set
|
|
1646
|
+
set curpDocument(value) {
|
|
1305
1647
|
if (!value) return;
|
|
1306
1648
|
this._curpDocument = KYCFile.fromObject(value);
|
|
1307
1649
|
}
|
|
@@ -1346,6 +1688,7 @@ class User {
|
|
|
1346
1688
|
stateOfBirth: obj.state_of_birth,
|
|
1347
1689
|
termsOfService: obj.terms_of_service,
|
|
1348
1690
|
updatedAt: obj.updated_at,
|
|
1691
|
+
userType: obj.user_type,
|
|
1349
1692
|
verificationId: obj.verification_id,
|
|
1350
1693
|
});
|
|
1351
1694
|
}
|
|
@@ -1531,6 +1874,7 @@ const getModelFromPath = (path, obj) => {
|
|
|
1531
1874
|
files: () => File.fromObject(obj),
|
|
1532
1875
|
kyc_validations: () => KYCValidations.fromObject(obj),
|
|
1533
1876
|
login_tokens: () => LoginToken.fromObject(obj),
|
|
1877
|
+
partners: () => Partner.fromObject(obj),
|
|
1534
1878
|
savings: () => Saving.fromObject(obj),
|
|
1535
1879
|
service_providers: () => ServiceProvider.fromObject(obj),
|
|
1536
1880
|
sessions: () => Session.fromObject(obj),
|
|
@@ -1704,15 +2048,15 @@ class AlertResource extends mix(Resource).with(
|
|
|
1704
2048
|
super('alerts', AlertQuery, client);
|
|
1705
2049
|
}
|
|
1706
2050
|
|
|
1707
|
-
async create(
|
|
2051
|
+
async create(req) {
|
|
1708
2052
|
const request = new AlertUpdateRequest(req);
|
|
1709
|
-
const alert = await this._create(request.
|
|
2053
|
+
const alert = await this._create(request.toCleanObject());
|
|
1710
2054
|
return alert;
|
|
1711
2055
|
}
|
|
1712
2056
|
|
|
1713
|
-
async update(
|
|
2057
|
+
async update(alertId, req) {
|
|
1714
2058
|
const request = new AlertUpdateRequest(req);
|
|
1715
|
-
const alert = await this._update(alertId, request.
|
|
2059
|
+
const alert = await this._update(alertId, request.toCleanObject());
|
|
1716
2060
|
return alert;
|
|
1717
2061
|
}
|
|
1718
2062
|
}
|
|
@@ -2036,6 +2380,29 @@ class LoginTokenResource extends mix(Resource).with(Creatable) {
|
|
|
2036
2380
|
}
|
|
2037
2381
|
}
|
|
2038
2382
|
|
|
2383
|
+
class PartnerResource extends mix(Resource).with(
|
|
2384
|
+
Creatable,
|
|
2385
|
+
Queryable,
|
|
2386
|
+
Updateable,
|
|
2387
|
+
Retrievable,
|
|
2388
|
+
) {
|
|
2389
|
+
constructor(client) {
|
|
2390
|
+
super('partners', PartnerQuery, client);
|
|
2391
|
+
}
|
|
2392
|
+
|
|
2393
|
+
async create(req) {
|
|
2394
|
+
const request = new PartnerUserRequest(req);
|
|
2395
|
+
const partner = await this._create(request.toCleanObject());
|
|
2396
|
+
return partner;
|
|
2397
|
+
}
|
|
2398
|
+
|
|
2399
|
+
async update(partnerId, req) {
|
|
2400
|
+
const request = new PartnerUserRequest(req);
|
|
2401
|
+
const partner = await this._update(partnerId, request.toCleanObject());
|
|
2402
|
+
return partner;
|
|
2403
|
+
}
|
|
2404
|
+
}
|
|
2405
|
+
|
|
2039
2406
|
class SavingResource extends mix(Resource).with(
|
|
2040
2407
|
Creatable,
|
|
2041
2408
|
Deactivable,
|
|
@@ -2350,6 +2717,7 @@ class Cuenca {
|
|
|
2350
2717
|
this.files = new FileResource(client);
|
|
2351
2718
|
this.kycValidations = new KYCValidationsResource(client);
|
|
2352
2719
|
this.loginTokens = new LoginTokenResource(client);
|
|
2720
|
+
this.partners = new PartnerResource(client);
|
|
2353
2721
|
this.savings = new SavingResource(client);
|
|
2354
2722
|
this.serviceProviders = new ServiceProviderResource(client);
|
|
2355
2723
|
this.sessions = new SessionResource(client);
|
package/build/requests/index.cjs
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var walletTransactionRequest = require('../walletTransactionRequest-
|
|
5
|
+
var walletTransactionRequest = require('../walletTransactionRequest-534ea750.cjs');
|
|
6
6
|
require('../errors/index.cjs');
|
|
7
|
-
require('../data-
|
|
7
|
+
require('../data-6c2897da.cjs');
|
|
8
8
|
|
|
9
9
|
class UploadRequest extends walletTransactionRequest.BaseRequest {
|
|
10
10
|
constructor({ isBack = false, file, extension, type, userId = 'me' }) {
|
|
@@ -35,6 +35,7 @@ exports.CardRequest = walletTransactionRequest.CardRequest;
|
|
|
35
35
|
exports.CardUpdateRequest = walletTransactionRequest.CardUpdateRequest;
|
|
36
36
|
exports.CardValidationRequest = walletTransactionRequest.CardValidationRequest;
|
|
37
37
|
exports.KYCValidationsRequest = walletTransactionRequest.KYCValidationsRequest;
|
|
38
|
+
exports.PartnerUserRequest = walletTransactionRequest.PartnerUserRequest;
|
|
38
39
|
exports.SavingRequest = walletTransactionRequest.SavingRequest;
|
|
39
40
|
exports.SessionRequest = walletTransactionRequest.SessionRequest;
|
|
40
41
|
exports.TransferRequest = walletTransactionRequest.TransferRequest;
|
package/build/requests/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { B as BaseRequest } from '../walletTransactionRequest-
|
|
2
|
-
export { A as AlertUpdateRequest, a as ApiKeyUpdateRequest, b as ArpcRequest, C as CardActivationRequest, c as CardRequest, d as CardUpdateRequest, e as CardValidationRequest, K as KYCValidationsRequest, S as SavingRequest, f as SessionRequest, T as TransferRequest, g as UserCredentialRequest, h as UserCredentialUpdateRequest, i as UserLoginRequest, U as UserUpdateRequest, j as VerificationAttemptRequest, V as VerificationRequest, W as WalletTransactionRequest } from '../walletTransactionRequest-
|
|
1
|
+
import { B as BaseRequest } from '../walletTransactionRequest-80f0424d.mjs';
|
|
2
|
+
export { A as AlertUpdateRequest, a as ApiKeyUpdateRequest, b as ArpcRequest, C as CardActivationRequest, c as CardRequest, d as CardUpdateRequest, e as CardValidationRequest, K as KYCValidationsRequest, P as PartnerUserRequest, S as SavingRequest, f as SessionRequest, T as TransferRequest, g as UserCredentialRequest, h as UserCredentialUpdateRequest, i as UserLoginRequest, U as UserUpdateRequest, j as VerificationAttemptRequest, V as VerificationRequest, W as WalletTransactionRequest } from '../walletTransactionRequest-80f0424d.mjs';
|
|
3
3
|
import '../errors/index.mjs';
|
|
4
|
-
import '../data-
|
|
4
|
+
import '../data-27fc844b.mjs';
|
|
5
5
|
|
|
6
6
|
class UploadRequest extends BaseRequest {
|
|
7
7
|
constructor({ isBack = false, file, extension, type, userId = 'me' }) {
|