@cuenca-mx/cuenca-js 0.0.14-dev9 → 1.0.1-dev01
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-92aab1cc.cjs → data-05b2d807.cjs} +30 -6
- package/build/{data-7e8b28c6.mjs → data-efe9e071.mjs} +28 -6
- package/build/index.cjs +468 -74
- package/build/index.mjs +438 -44
- package/build/requests/index.cjs +3 -2
- package/build/requests/index.mjs +3 -3
- package/build/types/index.cjs +70 -28
- package/build/types/index.mjs +36 -2
- package/build/umd/cuenca.umd.js +1 -1
- package/build/{identities-240756bd.cjs → vulnerableActivity-15f3a6ad.cjs} +475 -215
- package/build/{identities-4686dc22.mjs → vulnerableActivity-a6c1d37e.mjs} +466 -214
- package/build/{walletTransactionRequest-da986c71.cjs → walletTransactionRequest-14260846.cjs} +680 -204
- package/build/{walletTransactionRequest-d05a25a9.mjs → walletTransactionRequest-2f6a4c0e.mjs} +680 -205
- 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, S as SourceAlertType, b as MLIndicatorType, c as
|
|
6
|
-
import { A as
|
|
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, V as VerificationStatus, o as KYCValidationSource, U as UserStatus, p as SavingCategory, q as ServiceProviderCategory, r as SessionType, s as TransferNetwork, t as VerificationType, W as WalletTransactionType } from './data-efe9e071.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-a6c1d37e.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-2f6a4c0e.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="
|
|
20
|
+
const name="@cuenca-mx/cuenca-js";const version="1.0.1-dev01";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,7 +237,7 @@ class Account {
|
|
|
237
237
|
|
|
238
238
|
class Alert {
|
|
239
239
|
constructor({
|
|
240
|
-
|
|
240
|
+
agent,
|
|
241
241
|
accountNumber,
|
|
242
242
|
actualPeriodCount,
|
|
243
243
|
actualPeriodSum,
|
|
@@ -266,7 +266,7 @@ class Alert {
|
|
|
266
266
|
this.accountNumber = accountNumber;
|
|
267
267
|
this.actualPeriodCount = actualPeriodCount;
|
|
268
268
|
this.actualPeriodSum = actualPeriodSum;
|
|
269
|
-
this.
|
|
269
|
+
this.agent = agent;
|
|
270
270
|
this.aggregationType = aggregationType;
|
|
271
271
|
this.comments = comments;
|
|
272
272
|
this.committeeMeetingDate = dateToUTC(committeeMeetingDate);
|
|
@@ -284,14 +284,14 @@ class Alert {
|
|
|
284
284
|
this.sourceType = enumValueFromString(SourceAlertType, sourceType);
|
|
285
285
|
this.transactionDate = dateToUTC(transactionDate);
|
|
286
286
|
this.type = enumValueFromString(MLIndicatorType, type);
|
|
287
|
-
this.typeOfFilter = enumValueFromString(
|
|
287
|
+
this.typeOfFilter = enumValueFromString(PLDFilterType, typeOfFilter);
|
|
288
288
|
this.updatedAt = dateToUTC(updatedAt);
|
|
289
289
|
this.userId = userId;
|
|
290
|
-
this.
|
|
290
|
+
this.changeLog = changeLog;
|
|
291
291
|
}
|
|
292
292
|
|
|
293
293
|
static fromObject = ({
|
|
294
|
-
|
|
294
|
+
agent,
|
|
295
295
|
comments,
|
|
296
296
|
description,
|
|
297
297
|
id,
|
|
@@ -303,7 +303,7 @@ class Alert {
|
|
|
303
303
|
...obj
|
|
304
304
|
}) =>
|
|
305
305
|
new Alert({
|
|
306
|
-
|
|
306
|
+
agent,
|
|
307
307
|
comments,
|
|
308
308
|
description,
|
|
309
309
|
id,
|
|
@@ -334,9 +334,9 @@ class Alert {
|
|
|
334
334
|
return this._changeLog;
|
|
335
335
|
}
|
|
336
336
|
|
|
337
|
-
set
|
|
338
|
-
if (!value ||
|
|
339
|
-
this._changeLog =
|
|
337
|
+
set changeLog(value) {
|
|
338
|
+
if (!value || !Array.isArray(value) || value.length === 0) return;
|
|
339
|
+
this._changeLog = value.map((entry) => AlertLog.fromObject(entry));
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
342
|
|
|
@@ -496,7 +496,7 @@ class BridgeAccount {
|
|
|
496
496
|
this.updatedAt = dateToUTC(updatedAt);
|
|
497
497
|
this.emailAddress = emailAddress;
|
|
498
498
|
this.clientClabe = clientClabe;
|
|
499
|
-
this.
|
|
499
|
+
this.govtId = govtId;
|
|
500
500
|
this.names = names;
|
|
501
501
|
this.firstSurname = firstSurname;
|
|
502
502
|
this.secondSurname = secondSurname;
|
|
@@ -507,10 +507,10 @@ class BridgeAccount {
|
|
|
507
507
|
this.userId = userId;
|
|
508
508
|
this.gender = gender;
|
|
509
509
|
this.phoneNumber = phoneNumber;
|
|
510
|
-
this.
|
|
510
|
+
this.proofOfAddress = proofOfAddress;
|
|
511
511
|
this.status = enumValueFromString(BridgeAccountStatus, status);
|
|
512
|
-
this.
|
|
513
|
-
this.
|
|
512
|
+
this.termsOfService = termsOfService;
|
|
513
|
+
this.address = address;
|
|
514
514
|
}
|
|
515
515
|
|
|
516
516
|
static fromObject = ({ status, address, ...obj }) =>
|
|
@@ -541,7 +541,7 @@ class BridgeAccount {
|
|
|
541
541
|
return this._address;
|
|
542
542
|
}
|
|
543
543
|
|
|
544
|
-
set
|
|
544
|
+
set address(value) {
|
|
545
545
|
if (!value || Object.keys(value).length === 0) return;
|
|
546
546
|
this._address = Address.fromObject(value);
|
|
547
547
|
}
|
|
@@ -550,7 +550,7 @@ class BridgeAccount {
|
|
|
550
550
|
return this._proofOfAddress;
|
|
551
551
|
}
|
|
552
552
|
|
|
553
|
-
set
|
|
553
|
+
set proofOfAddress(value) {
|
|
554
554
|
if (!value || Object.keys(value).length === 0) return;
|
|
555
555
|
this._proofOfAddress = KYCFile.fromObject(value);
|
|
556
556
|
}
|
|
@@ -559,7 +559,7 @@ class BridgeAccount {
|
|
|
559
559
|
return this._govtId;
|
|
560
560
|
}
|
|
561
561
|
|
|
562
|
-
set
|
|
562
|
+
set govtId(value) {
|
|
563
563
|
if (!value || Object.keys(value).length === 0) return;
|
|
564
564
|
this._govtId = KYCFile.fromObject(value);
|
|
565
565
|
}
|
|
@@ -568,7 +568,7 @@ class BridgeAccount {
|
|
|
568
568
|
return this._termsOfService;
|
|
569
569
|
}
|
|
570
570
|
|
|
571
|
-
set
|
|
571
|
+
set termsOfService(value) {
|
|
572
572
|
if (!value || Object.keys(value).length === 0) return;
|
|
573
573
|
this._termsOfService = TOSAgreements.fromObject(value);
|
|
574
574
|
}
|
|
@@ -1013,19 +1013,66 @@ class File {
|
|
|
1013
1013
|
}
|
|
1014
1014
|
|
|
1015
1015
|
class KYCValidations {
|
|
1016
|
-
constructor({
|
|
1017
|
-
|
|
1018
|
-
|
|
1016
|
+
constructor({
|
|
1017
|
+
id,
|
|
1018
|
+
createdAt,
|
|
1019
|
+
updatedAt,
|
|
1020
|
+
deactivatedAt,
|
|
1021
|
+
platformId,
|
|
1022
|
+
filesUri,
|
|
1023
|
+
userId,
|
|
1024
|
+
verificationId,
|
|
1025
|
+
identityId,
|
|
1026
|
+
govtIdStatus,
|
|
1027
|
+
proofOfAddressStatus,
|
|
1028
|
+
proofOfLifeStatus,
|
|
1029
|
+
sourceType,
|
|
1030
|
+
flowId,
|
|
1031
|
+
status,
|
|
1032
|
+
providerUrl,
|
|
1033
|
+
}) {
|
|
1034
|
+
this.id = id;
|
|
1035
|
+
this.createdAt = dateToUTC(createdAt);
|
|
1036
|
+
this.updatedAt = dateToUTC(updatedAt);
|
|
1037
|
+
this.deactivatedAt = dateToUTC(deactivatedAt);
|
|
1019
1038
|
this.platformId = platformId;
|
|
1039
|
+
this.filesUri = filesUri || [];
|
|
1040
|
+
this.userId = userId;
|
|
1020
1041
|
this.verificationId = verificationId;
|
|
1042
|
+
this.identityId = identityId;
|
|
1043
|
+
this.govtIdStatus = enumValueFromString(VerificationStatus, govtIdStatus);
|
|
1044
|
+
this.proofOfAddressStatus = enumValueFromString(
|
|
1045
|
+
VerificationStatus,
|
|
1046
|
+
proofOfAddressStatus,
|
|
1047
|
+
);
|
|
1048
|
+
this.proofOfLifeStatus = enumValueFromString(
|
|
1049
|
+
VerificationStatus,
|
|
1050
|
+
proofOfLifeStatus,
|
|
1051
|
+
);
|
|
1052
|
+
this.sourceType = enumValueFromString(KYCValidationSource, sourceType);
|
|
1053
|
+
this.flowId = flowId;
|
|
1054
|
+
this.status = enumValueFromString(VerificationStatus, status);
|
|
1055
|
+
this.providerUrl = providerUrl;
|
|
1021
1056
|
}
|
|
1022
1057
|
|
|
1023
|
-
static fromObject = ({
|
|
1058
|
+
static fromObject = ({ id, status, ...obj }) =>
|
|
1024
1059
|
new KYCValidations({
|
|
1025
|
-
|
|
1026
|
-
|
|
1060
|
+
id,
|
|
1061
|
+
status,
|
|
1062
|
+
createdAt: obj.created_at,
|
|
1063
|
+
updatedAt: obj.updated_at,
|
|
1064
|
+
deactivatedAt: obj.deactivated_at,
|
|
1027
1065
|
platformId: obj.platform_id,
|
|
1066
|
+
filesUri: obj.files_uri,
|
|
1067
|
+
userId: obj.user_id,
|
|
1028
1068
|
verificationId: obj.verification_id,
|
|
1069
|
+
identityId: obj.identity_id,
|
|
1070
|
+
govtIdStatus: obj.govt_id_status,
|
|
1071
|
+
proofOfAddressStatus: obj.proof_of_address_status,
|
|
1072
|
+
proofOfLifeStatus: obj.proof_of_life_status,
|
|
1073
|
+
sourceType: obj.source_type,
|
|
1074
|
+
flowId: obj.flow_id,
|
|
1075
|
+
providerUrl: obj.provider_url,
|
|
1029
1076
|
});
|
|
1030
1077
|
}
|
|
1031
1078
|
|
|
@@ -1037,6 +1084,319 @@ class LoginToken {
|
|
|
1037
1084
|
static fromObject = ({ id }) => new LoginToken({ id });
|
|
1038
1085
|
}
|
|
1039
1086
|
|
|
1087
|
+
class TransactionalProfile {
|
|
1088
|
+
constructor({
|
|
1089
|
+
currency,
|
|
1090
|
+
monthlyAmount,
|
|
1091
|
+
recipientsNum,
|
|
1092
|
+
payersNum,
|
|
1093
|
+
deposits,
|
|
1094
|
+
withdrawal,
|
|
1095
|
+
}) {
|
|
1096
|
+
this.currency = currency;
|
|
1097
|
+
this.monthlyAmount = monthlyAmount;
|
|
1098
|
+
|
|
1099
|
+
this.recipientsNum = recipientsNum;
|
|
1100
|
+
this.payersNum = payersNum;
|
|
1101
|
+
|
|
1102
|
+
this.deposits = deposits;
|
|
1103
|
+
this.withdrawal = withdrawal;
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
get deposits() {
|
|
1107
|
+
return this._deposits;
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
set deposits(value) {
|
|
1111
|
+
if (!value) return;
|
|
1112
|
+
this._deposits = TransactionalProfileServices.fromObject(value);
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1115
|
+
get withdrawal() {
|
|
1116
|
+
return this._withdrawal;
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1119
|
+
set withdrawal(value) {
|
|
1120
|
+
if (!value) return;
|
|
1121
|
+
this._withdrawal = TransactionalProfileServices.fromObject(value);
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1124
|
+
static fromObject = ({ currency, deposits, withdrawal, ...obj }) =>
|
|
1125
|
+
new TransactionalProfile({
|
|
1126
|
+
currency,
|
|
1127
|
+
deposits,
|
|
1128
|
+
withdrawal,
|
|
1129
|
+
payersNum: obj.payers_num,
|
|
1130
|
+
recipientsNum: obj.recipients_num,
|
|
1131
|
+
monthlyAmount: obj.monthly_amount,
|
|
1132
|
+
});
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
class BaseUser {
|
|
1136
|
+
constructor({
|
|
1137
|
+
address,
|
|
1138
|
+
clabe,
|
|
1139
|
+
emailAddress,
|
|
1140
|
+
id,
|
|
1141
|
+
level,
|
|
1142
|
+
meta,
|
|
1143
|
+
nationality,
|
|
1144
|
+
platformId,
|
|
1145
|
+
phoneNumber,
|
|
1146
|
+
requiredLevel,
|
|
1147
|
+
rfc,
|
|
1148
|
+
status,
|
|
1149
|
+
createdAt,
|
|
1150
|
+
updatedAt,
|
|
1151
|
+
userType,
|
|
1152
|
+
}) {
|
|
1153
|
+
this.address = address;
|
|
1154
|
+
this.clabe = clabe;
|
|
1155
|
+
this.createdAt = dateToUTC(createdAt);
|
|
1156
|
+
this.emailAddress = emailAddress;
|
|
1157
|
+
this.id = id;
|
|
1158
|
+
this.level = level;
|
|
1159
|
+
this.meta = meta;
|
|
1160
|
+
this.nationality = nationality;
|
|
1161
|
+
this.platformId = platformId;
|
|
1162
|
+
this.phoneNumber = phoneNumber;
|
|
1163
|
+
this.requiredLevel = requiredLevel;
|
|
1164
|
+
this.rfc = rfc;
|
|
1165
|
+
this.status = enumValueFromString(UserStatus, status);
|
|
1166
|
+
this.updatedAt = dateToUTC(updatedAt);
|
|
1167
|
+
this.userType = userType;
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1170
|
+
get address() {
|
|
1171
|
+
return this._address;
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
set address(value) {
|
|
1175
|
+
if (!value) return;
|
|
1176
|
+
this._address = Address.fromObject(value);
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1179
|
+
static fromObject = ({
|
|
1180
|
+
address,
|
|
1181
|
+
clabe,
|
|
1182
|
+
id,
|
|
1183
|
+
level,
|
|
1184
|
+
nationality,
|
|
1185
|
+
rfc,
|
|
1186
|
+
status,
|
|
1187
|
+
...obj
|
|
1188
|
+
}) =>
|
|
1189
|
+
new BaseUser({
|
|
1190
|
+
address,
|
|
1191
|
+
clabe,
|
|
1192
|
+
id,
|
|
1193
|
+
level,
|
|
1194
|
+
meta: obj.meta,
|
|
1195
|
+
nationality,
|
|
1196
|
+
rfc,
|
|
1197
|
+
status,
|
|
1198
|
+
createdAt: obj.created_at,
|
|
1199
|
+
emailAddress: obj.email_address,
|
|
1200
|
+
phoneNumber: obj.phone_number,
|
|
1201
|
+
platformId: obj.platform_id,
|
|
1202
|
+
requiredLevel: obj.required_level,
|
|
1203
|
+
updatedAt: obj.updated_at,
|
|
1204
|
+
userType: obj.user_type,
|
|
1205
|
+
});
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
class Partner extends BaseUser {
|
|
1209
|
+
constructor({
|
|
1210
|
+
address,
|
|
1211
|
+
audit,
|
|
1212
|
+
businessDetails,
|
|
1213
|
+
businessModel,
|
|
1214
|
+
businessName,
|
|
1215
|
+
clabe,
|
|
1216
|
+
createdAt,
|
|
1217
|
+
documentationUrl,
|
|
1218
|
+
emailAddress,
|
|
1219
|
+
externalAccount,
|
|
1220
|
+
folio,
|
|
1221
|
+
id,
|
|
1222
|
+
incorporationDate,
|
|
1223
|
+
legalName,
|
|
1224
|
+
legalRepresentatives,
|
|
1225
|
+
level,
|
|
1226
|
+
license,
|
|
1227
|
+
meta,
|
|
1228
|
+
nationality,
|
|
1229
|
+
phoneNumber,
|
|
1230
|
+
platformId,
|
|
1231
|
+
requiredLevel,
|
|
1232
|
+
rfc,
|
|
1233
|
+
shareholders,
|
|
1234
|
+
status,
|
|
1235
|
+
transactionalProfile,
|
|
1236
|
+
updatedAt,
|
|
1237
|
+
userId,
|
|
1238
|
+
userType,
|
|
1239
|
+
vulnerableActivity,
|
|
1240
|
+
webSite,
|
|
1241
|
+
}) {
|
|
1242
|
+
super({
|
|
1243
|
+
address,
|
|
1244
|
+
clabe,
|
|
1245
|
+
emailAddress,
|
|
1246
|
+
rfc,
|
|
1247
|
+
id,
|
|
1248
|
+
level,
|
|
1249
|
+
meta,
|
|
1250
|
+
nationality,
|
|
1251
|
+
platformId,
|
|
1252
|
+
phoneNumber,
|
|
1253
|
+
requiredLevel,
|
|
1254
|
+
status,
|
|
1255
|
+
createdAt,
|
|
1256
|
+
updatedAt,
|
|
1257
|
+
userType,
|
|
1258
|
+
});
|
|
1259
|
+
this.audit = audit;
|
|
1260
|
+
this.businessModel = businessModel;
|
|
1261
|
+
this.businessName = businessName;
|
|
1262
|
+
this.businessDetails = businessDetails;
|
|
1263
|
+
this.documentationUrl = documentationUrl;
|
|
1264
|
+
this.incorporationDate = dateToUTC(incorporationDate);
|
|
1265
|
+
this.externalAccount = externalAccount;
|
|
1266
|
+
this.folio = folio;
|
|
1267
|
+
this.legalName = legalName;
|
|
1268
|
+
this.license = license;
|
|
1269
|
+
this.shareholders = shareholders;
|
|
1270
|
+
this.legalRepresentatives = legalRepresentatives;
|
|
1271
|
+
this.transactionalProfile = transactionalProfile;
|
|
1272
|
+
this.userId = userId;
|
|
1273
|
+
this.vulnerableActivity = vulnerableActivity;
|
|
1274
|
+
this.webSite = webSite;
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
get shareholders() {
|
|
1278
|
+
return this._shareholders;
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1281
|
+
set shareholders(value) {
|
|
1282
|
+
if (!value) return;
|
|
1283
|
+
this._shareholders = value.map((sh) => ShareholderMoral.fromObject(sh));
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
get legalRepresentatives() {
|
|
1287
|
+
return this._legalRepresentatives;
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
set legalRepresentatives(value) {
|
|
1291
|
+
if (!value) return;
|
|
1292
|
+
this._legalRepresentatives = value.map((lr) =>
|
|
1293
|
+
LegalRepresentatives.fromObject(lr),
|
|
1294
|
+
);
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
get externalAccount() {
|
|
1298
|
+
return this._externalAccount;
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
set externalAccount(value) {
|
|
1302
|
+
if (!value) return;
|
|
1303
|
+
this._externalAccount = ExternalAccount.fromObject(value);
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1306
|
+
get vulnerableActivity() {
|
|
1307
|
+
return this._vulnerableActivity;
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
set vulnerableActivity(value) {
|
|
1311
|
+
if (!value) return;
|
|
1312
|
+
this._vulnerableActivity = VulnerableActivity.fromObject(value);
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1315
|
+
get audit() {
|
|
1316
|
+
return this._audit;
|
|
1317
|
+
}
|
|
1318
|
+
|
|
1319
|
+
set audit(value) {
|
|
1320
|
+
if (!value) return;
|
|
1321
|
+
this._audit = Audit.fromObject(value);
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
get license() {
|
|
1325
|
+
return this._license;
|
|
1326
|
+
}
|
|
1327
|
+
|
|
1328
|
+
set license(value) {
|
|
1329
|
+
if (!value) return;
|
|
1330
|
+
this._license = License.fromObject(value);
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1333
|
+
get transactionalProfile() {
|
|
1334
|
+
return this._transactionalProfile;
|
|
1335
|
+
}
|
|
1336
|
+
|
|
1337
|
+
set transactionalProfile(value) {
|
|
1338
|
+
if (!value) return;
|
|
1339
|
+
this._transactionalProfile = TransactionalProfile.fromObject(value);
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
get businessDetails() {
|
|
1343
|
+
return this._businessDetails;
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
set businessDetails(value) {
|
|
1347
|
+
if (!value) return;
|
|
1348
|
+
this._businessDetails = BusinessDetails.fromObject(value);
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
static fromObject = ({
|
|
1352
|
+
audit,
|
|
1353
|
+
address,
|
|
1354
|
+
clabe,
|
|
1355
|
+
folio,
|
|
1356
|
+
id,
|
|
1357
|
+
level,
|
|
1358
|
+
license,
|
|
1359
|
+
nationality,
|
|
1360
|
+
rfc,
|
|
1361
|
+
status,
|
|
1362
|
+
shareholders,
|
|
1363
|
+
...obj
|
|
1364
|
+
}) =>
|
|
1365
|
+
new Partner({
|
|
1366
|
+
address,
|
|
1367
|
+
audit,
|
|
1368
|
+
clabe,
|
|
1369
|
+
folio,
|
|
1370
|
+
id,
|
|
1371
|
+
level,
|
|
1372
|
+
license,
|
|
1373
|
+
nationality,
|
|
1374
|
+
rfc,
|
|
1375
|
+
shareholders,
|
|
1376
|
+
status,
|
|
1377
|
+
legalName: obj.legal_name,
|
|
1378
|
+
legalRepresentatives: obj.legal_representatives,
|
|
1379
|
+
businessModel: obj.business_model,
|
|
1380
|
+
businessName: obj.business_name,
|
|
1381
|
+
businessDetails: obj.business_details,
|
|
1382
|
+
createdAt: obj.created_at,
|
|
1383
|
+
documentationUrl: obj.documentation_url,
|
|
1384
|
+
emailAddress: obj.email_address,
|
|
1385
|
+
externalAccount: obj.external_account,
|
|
1386
|
+
incorporationDate: obj.incorporation_date,
|
|
1387
|
+
meta: obj.meta,
|
|
1388
|
+
phoneNumber: obj.phone_number,
|
|
1389
|
+
platformId: obj.platform_id,
|
|
1390
|
+
requiredLevel: obj.required_level,
|
|
1391
|
+
transactionalProfile: obj.transactional_profile,
|
|
1392
|
+
updatedAt: obj.updated_at,
|
|
1393
|
+
userId: obj.user_id,
|
|
1394
|
+
userType: obj.user_type,
|
|
1395
|
+
vulnerableActivity: obj.vulnerable_activity,
|
|
1396
|
+
webSite: obj.web_site,
|
|
1397
|
+
});
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1040
1400
|
class Wallet {
|
|
1041
1401
|
constructor({ balance, createdAt, deactivatedAt, id, userId, updatedAt }) {
|
|
1042
1402
|
this.balance = balance;
|
|
@@ -1244,9 +1604,10 @@ class User {
|
|
|
1244
1604
|
status,
|
|
1245
1605
|
termsOfService,
|
|
1246
1606
|
updatedAt,
|
|
1607
|
+
userType,
|
|
1247
1608
|
verificationId,
|
|
1248
1609
|
}) {
|
|
1249
|
-
this.
|
|
1610
|
+
this.address = address;
|
|
1250
1611
|
this.blacklistValidationStatus = enumValueFromString(
|
|
1251
1612
|
VerificationStatus,
|
|
1252
1613
|
blacklistValidationStatus,
|
|
@@ -1255,7 +1616,7 @@ class User {
|
|
|
1255
1616
|
this.countryOfBirth = countryOfBirth;
|
|
1256
1617
|
this.createdAt = dateToUTC(createdAt);
|
|
1257
1618
|
this.curp = curp;
|
|
1258
|
-
this.
|
|
1619
|
+
this.curpDocument = curpDocument;
|
|
1259
1620
|
this.dateOfBirth = dateOfBirth;
|
|
1260
1621
|
this.emailAddress = emailAddress;
|
|
1261
1622
|
this.firstSurname = firstSurname;
|
|
@@ -1265,16 +1626,17 @@ class User {
|
|
|
1265
1626
|
this.names = names;
|
|
1266
1627
|
this.nationality = nationality;
|
|
1267
1628
|
this.phoneNumber = phoneNumber;
|
|
1268
|
-
this.
|
|
1269
|
-
this.
|
|
1270
|
-
this.
|
|
1629
|
+
this.govtId = govtId;
|
|
1630
|
+
this.proofOfAddress = proofOfAddress;
|
|
1631
|
+
this.proofOfLife = proofOfLife;
|
|
1271
1632
|
this.requiredLevel = requiredLevel;
|
|
1272
1633
|
this.rfc = rfc;
|
|
1273
1634
|
this.secondSurname = secondSurname;
|
|
1274
1635
|
this.stateOfBirth = stateOfBirth;
|
|
1275
1636
|
this.status = enumValueFromString(UserStatus, status);
|
|
1276
|
-
this.
|
|
1637
|
+
this.termsOfService = termsOfService;
|
|
1277
1638
|
this.updatedAt = dateToUTC(updatedAt);
|
|
1639
|
+
this.userType = userType;
|
|
1278
1640
|
this.verificationId = verificationId;
|
|
1279
1641
|
}
|
|
1280
1642
|
|
|
@@ -1282,7 +1644,7 @@ class User {
|
|
|
1282
1644
|
return this._address;
|
|
1283
1645
|
}
|
|
1284
1646
|
|
|
1285
|
-
set
|
|
1647
|
+
set address(value) {
|
|
1286
1648
|
if (!value) return;
|
|
1287
1649
|
this._address = Address.fromObject(value);
|
|
1288
1650
|
}
|
|
@@ -1291,7 +1653,7 @@ class User {
|
|
|
1291
1653
|
return this._proofOfAddress;
|
|
1292
1654
|
}
|
|
1293
1655
|
|
|
1294
|
-
set
|
|
1656
|
+
set proofOfAddress(value) {
|
|
1295
1657
|
if (!value) return;
|
|
1296
1658
|
this._proofOfAddress = KYCFile.fromObject(value);
|
|
1297
1659
|
}
|
|
@@ -1300,7 +1662,7 @@ class User {
|
|
|
1300
1662
|
return this._proofOfLife;
|
|
1301
1663
|
}
|
|
1302
1664
|
|
|
1303
|
-
set
|
|
1665
|
+
set proofOfLife(value) {
|
|
1304
1666
|
if (!value) return;
|
|
1305
1667
|
this._proofOfLife = KYCFile.fromObject(value);
|
|
1306
1668
|
}
|
|
@@ -1309,7 +1671,7 @@ class User {
|
|
|
1309
1671
|
return this._govtId;
|
|
1310
1672
|
}
|
|
1311
1673
|
|
|
1312
|
-
set
|
|
1674
|
+
set govtId(value) {
|
|
1313
1675
|
if (!value) return;
|
|
1314
1676
|
this._govtId = KYCFile.fromObject(value);
|
|
1315
1677
|
}
|
|
@@ -1318,7 +1680,7 @@ class User {
|
|
|
1318
1680
|
return this._termsOfService;
|
|
1319
1681
|
}
|
|
1320
1682
|
|
|
1321
|
-
set
|
|
1683
|
+
set termsOfService(value) {
|
|
1322
1684
|
if (!value) return;
|
|
1323
1685
|
this._termsOfService = TOSAgreements.fromObject(value);
|
|
1324
1686
|
}
|
|
@@ -1327,7 +1689,7 @@ class User {
|
|
|
1327
1689
|
return this._curpDocument;
|
|
1328
1690
|
}
|
|
1329
1691
|
|
|
1330
|
-
set
|
|
1692
|
+
set curpDocument(value) {
|
|
1331
1693
|
if (!value) return;
|
|
1332
1694
|
this._curpDocument = KYCFile.fromObject(value);
|
|
1333
1695
|
}
|
|
@@ -1372,6 +1734,7 @@ class User {
|
|
|
1372
1734
|
stateOfBirth: obj.state_of_birth,
|
|
1373
1735
|
termsOfService: obj.terms_of_service,
|
|
1374
1736
|
updatedAt: obj.updated_at,
|
|
1737
|
+
userType: obj.user_type,
|
|
1375
1738
|
verificationId: obj.verification_id,
|
|
1376
1739
|
});
|
|
1377
1740
|
}
|
|
@@ -1557,6 +1920,7 @@ const getModelFromPath = (path, obj) => {
|
|
|
1557
1920
|
files: () => File.fromObject(obj),
|
|
1558
1921
|
kyc_validations: () => KYCValidations.fromObject(obj),
|
|
1559
1922
|
login_tokens: () => LoginToken.fromObject(obj),
|
|
1923
|
+
partners: () => Partner.fromObject(obj),
|
|
1560
1924
|
savings: () => Saving.fromObject(obj),
|
|
1561
1925
|
service_providers: () => ServiceProvider.fromObject(obj),
|
|
1562
1926
|
sessions: () => Session.fromObject(obj),
|
|
@@ -1730,15 +2094,15 @@ class AlertResource extends mix(Resource).with(
|
|
|
1730
2094
|
super('alerts', AlertQuery, client);
|
|
1731
2095
|
}
|
|
1732
2096
|
|
|
1733
|
-
async create(
|
|
1734
|
-
const request = new AlertUpdateRequest(
|
|
1735
|
-
const alert = await this._create(request.
|
|
2097
|
+
async create(req) {
|
|
2098
|
+
const request = new AlertUpdateRequest(req);
|
|
2099
|
+
const alert = await this._create(request.toCleanObject());
|
|
1736
2100
|
return alert;
|
|
1737
2101
|
}
|
|
1738
2102
|
|
|
1739
|
-
async update(alertId,
|
|
2103
|
+
async update(alertId, req) {
|
|
1740
2104
|
const request = new AlertUpdateRequest(req);
|
|
1741
|
-
const alert = await this._update(alertId, request.
|
|
2105
|
+
const alert = await this._update(alertId, request.toCleanObject());
|
|
1742
2106
|
return alert;
|
|
1743
2107
|
}
|
|
1744
2108
|
}
|
|
@@ -2029,6 +2393,7 @@ class FileResource extends mix(Resource).with(Downlodable, Uploadable) {
|
|
|
2029
2393
|
class KYCValidationsResource extends mix(Resource).with(
|
|
2030
2394
|
Creatable,
|
|
2031
2395
|
Retrievable,
|
|
2396
|
+
Deactivable,
|
|
2032
2397
|
Queryable,
|
|
2033
2398
|
) {
|
|
2034
2399
|
constructor(client, isBridge = false) {
|
|
@@ -2049,6 +2414,11 @@ class KYCValidationsResource extends mix(Resource).with(
|
|
|
2049
2414
|
const kycValidation = await this._create(request.toCleanObject());
|
|
2050
2415
|
return kycValidation;
|
|
2051
2416
|
}
|
|
2417
|
+
|
|
2418
|
+
async deactivate(kycValidationId) {
|
|
2419
|
+
const response = await this._deactivate(kycValidationId);
|
|
2420
|
+
return response;
|
|
2421
|
+
}
|
|
2052
2422
|
}
|
|
2053
2423
|
|
|
2054
2424
|
class LoginTokenResource extends mix(Resource).with(Creatable) {
|
|
@@ -2062,6 +2432,29 @@ class LoginTokenResource extends mix(Resource).with(Creatable) {
|
|
|
2062
2432
|
}
|
|
2063
2433
|
}
|
|
2064
2434
|
|
|
2435
|
+
class PartnerResource extends mix(Resource).with(
|
|
2436
|
+
Creatable,
|
|
2437
|
+
Queryable,
|
|
2438
|
+
Updateable,
|
|
2439
|
+
Retrievable,
|
|
2440
|
+
) {
|
|
2441
|
+
constructor(client) {
|
|
2442
|
+
super('partners', PartnerQuery, client);
|
|
2443
|
+
}
|
|
2444
|
+
|
|
2445
|
+
async create(req) {
|
|
2446
|
+
const request = new PartnerUserRequest(req);
|
|
2447
|
+
const partner = await this._create(request.toCleanObject());
|
|
2448
|
+
return partner;
|
|
2449
|
+
}
|
|
2450
|
+
|
|
2451
|
+
async update(partnerId, req) {
|
|
2452
|
+
const request = new PartnerUserRequest(req);
|
|
2453
|
+
const partner = await this._update(partnerId, request.toCleanObject());
|
|
2454
|
+
return partner;
|
|
2455
|
+
}
|
|
2456
|
+
}
|
|
2457
|
+
|
|
2065
2458
|
class SavingResource extends mix(Resource).with(
|
|
2066
2459
|
Creatable,
|
|
2067
2460
|
Deactivable,
|
|
@@ -2376,6 +2769,7 @@ class Cuenca {
|
|
|
2376
2769
|
this.files = new FileResource(client);
|
|
2377
2770
|
this.kycValidations = new KYCValidationsResource(client);
|
|
2378
2771
|
this.loginTokens = new LoginTokenResource(client);
|
|
2772
|
+
this.partners = new PartnerResource(client);
|
|
2379
2773
|
this.savings = new SavingResource(client);
|
|
2380
2774
|
this.serviceProviders = new ServiceProviderResource(client);
|
|
2381
2775
|
this.sessions = new SessionResource(client);
|