@cuenca-mx/cuenca-js 0.0.14-dev9 → 1.0.0
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-7e8b28c6.mjs → data-27fc844b.mjs} +18 -6
- package/build/{data-92aab1cc.cjs → data-6c2897da.cjs} +19 -6
- package/build/index.cjs +409 -68
- package/build/index.mjs +379 -38
- package/build/requests/index.cjs +3 -2
- package/build/requests/index.mjs +3 -3
- package/build/types/index.cjs +69 -28
- package/build/types/index.mjs +36 -2
- package/build/umd/cuenca.umd.js +1 -1
- package/build/{identities-4686dc22.mjs → vulnerableActivity-70ff062e.mjs} +466 -214
- package/build/{identities-240756bd.cjs → vulnerableActivity-88488ee4.cjs} +475 -215
- package/build/{walletTransactionRequest-da986c71.cjs → walletTransactionRequest-534ea750.cjs} +680 -204
- package/build/{walletTransactionRequest-d05a25a9.mjs → walletTransactionRequest-80f0424d.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, 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
|
|
20
|
+
const name="@cuenca-mx/cuenca-js";const version="1.0.0";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
|
}
|
|
@@ -1037,6 +1037,319 @@ class LoginToken {
|
|
|
1037
1037
|
static fromObject = ({ id }) => new LoginToken({ id });
|
|
1038
1038
|
}
|
|
1039
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
|
+
meta,
|
|
1203
|
+
nationality,
|
|
1204
|
+
platformId,
|
|
1205
|
+
phoneNumber,
|
|
1206
|
+
requiredLevel,
|
|
1207
|
+
status,
|
|
1208
|
+
createdAt,
|
|
1209
|
+
updatedAt,
|
|
1210
|
+
userType,
|
|
1211
|
+
});
|
|
1212
|
+
this.audit = audit;
|
|
1213
|
+
this.businessModel = businessModel;
|
|
1214
|
+
this.businessName = businessName;
|
|
1215
|
+
this.businessDetails = businessDetails;
|
|
1216
|
+
this.documentationUrl = documentationUrl;
|
|
1217
|
+
this.incorporationDate = dateToUTC(incorporationDate);
|
|
1218
|
+
this.externalAccount = externalAccount;
|
|
1219
|
+
this.folio = folio;
|
|
1220
|
+
this.legalName = legalName;
|
|
1221
|
+
this.license = license;
|
|
1222
|
+
this.shareholders = shareholders;
|
|
1223
|
+
this.legalRepresentatives = legalRepresentatives;
|
|
1224
|
+
this.transactionalProfile = transactionalProfile;
|
|
1225
|
+
this.userId = userId;
|
|
1226
|
+
this.vulnerableActivity = vulnerableActivity;
|
|
1227
|
+
this.webSite = webSite;
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
get shareholders() {
|
|
1231
|
+
return this._shareholders;
|
|
1232
|
+
}
|
|
1233
|
+
|
|
1234
|
+
set shareholders(value) {
|
|
1235
|
+
if (!value) return;
|
|
1236
|
+
this._shareholders = value.map((sh) => ShareholderMoral.fromObject(sh));
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
get legalRepresentatives() {
|
|
1240
|
+
return this._legalRepresentatives;
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
set legalRepresentatives(value) {
|
|
1244
|
+
if (!value) return;
|
|
1245
|
+
this._legalRepresentatives = value.map((lr) =>
|
|
1246
|
+
LegalRepresentatives.fromObject(lr),
|
|
1247
|
+
);
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
get externalAccount() {
|
|
1251
|
+
return this._externalAccount;
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
set externalAccount(value) {
|
|
1255
|
+
if (!value) return;
|
|
1256
|
+
this._externalAccount = ExternalAccount.fromObject(value);
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
get vulnerableActivity() {
|
|
1260
|
+
return this._vulnerableActivity;
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1263
|
+
set vulnerableActivity(value) {
|
|
1264
|
+
if (!value) return;
|
|
1265
|
+
this._vulnerableActivity = VulnerableActivity.fromObject(value);
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1268
|
+
get audit() {
|
|
1269
|
+
return this._audit;
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1272
|
+
set audit(value) {
|
|
1273
|
+
if (!value) return;
|
|
1274
|
+
this._audit = Audit.fromObject(value);
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
get license() {
|
|
1278
|
+
return this._license;
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1281
|
+
set license(value) {
|
|
1282
|
+
if (!value) return;
|
|
1283
|
+
this._license = License.fromObject(value);
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
get transactionalProfile() {
|
|
1287
|
+
return this._transactionalProfile;
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
set transactionalProfile(value) {
|
|
1291
|
+
if (!value) return;
|
|
1292
|
+
this._transactionalProfile = TransactionalProfile.fromObject(value);
|
|
1293
|
+
}
|
|
1294
|
+
|
|
1295
|
+
get businessDetails() {
|
|
1296
|
+
return this._businessDetails;
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
set businessDetails(value) {
|
|
1300
|
+
if (!value) return;
|
|
1301
|
+
this._businessDetails = BusinessDetails.fromObject(value);
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1304
|
+
static fromObject = ({
|
|
1305
|
+
audit,
|
|
1306
|
+
address,
|
|
1307
|
+
clabe,
|
|
1308
|
+
folio,
|
|
1309
|
+
id,
|
|
1310
|
+
level,
|
|
1311
|
+
license,
|
|
1312
|
+
nationality,
|
|
1313
|
+
rfc,
|
|
1314
|
+
status,
|
|
1315
|
+
shareholders,
|
|
1316
|
+
...obj
|
|
1317
|
+
}) =>
|
|
1318
|
+
new Partner({
|
|
1319
|
+
address,
|
|
1320
|
+
audit,
|
|
1321
|
+
clabe,
|
|
1322
|
+
folio,
|
|
1323
|
+
id,
|
|
1324
|
+
level,
|
|
1325
|
+
license,
|
|
1326
|
+
nationality,
|
|
1327
|
+
rfc,
|
|
1328
|
+
shareholders,
|
|
1329
|
+
status,
|
|
1330
|
+
legalName: obj.legal_name,
|
|
1331
|
+
legalRepresentatives: obj.legal_representatives,
|
|
1332
|
+
businessModel: obj.business_model,
|
|
1333
|
+
businessName: obj.business_name,
|
|
1334
|
+
businessDetails: obj.business_details,
|
|
1335
|
+
createdAt: obj.created_at,
|
|
1336
|
+
documentationUrl: obj.documentation_url,
|
|
1337
|
+
emailAddress: obj.email_address,
|
|
1338
|
+
externalAccount: obj.external_account,
|
|
1339
|
+
incorporationDate: obj.incorporation_date,
|
|
1340
|
+
meta: obj.meta,
|
|
1341
|
+
phoneNumber: obj.phone_number,
|
|
1342
|
+
platformId: obj.platform_id,
|
|
1343
|
+
requiredLevel: obj.required_level,
|
|
1344
|
+
transactionalProfile: obj.transactional_profile,
|
|
1345
|
+
updatedAt: obj.updated_at,
|
|
1346
|
+
userId: obj.user_id,
|
|
1347
|
+
userType: obj.user_type,
|
|
1348
|
+
vulnerableActivity: obj.vulnerable_activity,
|
|
1349
|
+
webSite: obj.web_site,
|
|
1350
|
+
});
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1040
1353
|
class Wallet {
|
|
1041
1354
|
constructor({ balance, createdAt, deactivatedAt, id, userId, updatedAt }) {
|
|
1042
1355
|
this.balance = balance;
|
|
@@ -1244,9 +1557,10 @@ class User {
|
|
|
1244
1557
|
status,
|
|
1245
1558
|
termsOfService,
|
|
1246
1559
|
updatedAt,
|
|
1560
|
+
userType,
|
|
1247
1561
|
verificationId,
|
|
1248
1562
|
}) {
|
|
1249
|
-
this.
|
|
1563
|
+
this.address = address;
|
|
1250
1564
|
this.blacklistValidationStatus = enumValueFromString(
|
|
1251
1565
|
VerificationStatus,
|
|
1252
1566
|
blacklistValidationStatus,
|
|
@@ -1255,7 +1569,7 @@ class User {
|
|
|
1255
1569
|
this.countryOfBirth = countryOfBirth;
|
|
1256
1570
|
this.createdAt = dateToUTC(createdAt);
|
|
1257
1571
|
this.curp = curp;
|
|
1258
|
-
this.
|
|
1572
|
+
this.curpDocument = curpDocument;
|
|
1259
1573
|
this.dateOfBirth = dateOfBirth;
|
|
1260
1574
|
this.emailAddress = emailAddress;
|
|
1261
1575
|
this.firstSurname = firstSurname;
|
|
@@ -1265,16 +1579,17 @@ class User {
|
|
|
1265
1579
|
this.names = names;
|
|
1266
1580
|
this.nationality = nationality;
|
|
1267
1581
|
this.phoneNumber = phoneNumber;
|
|
1268
|
-
this.
|
|
1269
|
-
this.
|
|
1270
|
-
this.
|
|
1582
|
+
this.govtId = govtId;
|
|
1583
|
+
this.proofOfAddress = proofOfAddress;
|
|
1584
|
+
this.proofOfLife = proofOfLife;
|
|
1271
1585
|
this.requiredLevel = requiredLevel;
|
|
1272
1586
|
this.rfc = rfc;
|
|
1273
1587
|
this.secondSurname = secondSurname;
|
|
1274
1588
|
this.stateOfBirth = stateOfBirth;
|
|
1275
1589
|
this.status = enumValueFromString(UserStatus, status);
|
|
1276
|
-
this.
|
|
1590
|
+
this.termsOfService = termsOfService;
|
|
1277
1591
|
this.updatedAt = dateToUTC(updatedAt);
|
|
1592
|
+
this.userType = userType;
|
|
1278
1593
|
this.verificationId = verificationId;
|
|
1279
1594
|
}
|
|
1280
1595
|
|
|
@@ -1282,7 +1597,7 @@ class User {
|
|
|
1282
1597
|
return this._address;
|
|
1283
1598
|
}
|
|
1284
1599
|
|
|
1285
|
-
set
|
|
1600
|
+
set address(value) {
|
|
1286
1601
|
if (!value) return;
|
|
1287
1602
|
this._address = Address.fromObject(value);
|
|
1288
1603
|
}
|
|
@@ -1291,7 +1606,7 @@ class User {
|
|
|
1291
1606
|
return this._proofOfAddress;
|
|
1292
1607
|
}
|
|
1293
1608
|
|
|
1294
|
-
set
|
|
1609
|
+
set proofOfAddress(value) {
|
|
1295
1610
|
if (!value) return;
|
|
1296
1611
|
this._proofOfAddress = KYCFile.fromObject(value);
|
|
1297
1612
|
}
|
|
@@ -1300,7 +1615,7 @@ class User {
|
|
|
1300
1615
|
return this._proofOfLife;
|
|
1301
1616
|
}
|
|
1302
1617
|
|
|
1303
|
-
set
|
|
1618
|
+
set proofOfLife(value) {
|
|
1304
1619
|
if (!value) return;
|
|
1305
1620
|
this._proofOfLife = KYCFile.fromObject(value);
|
|
1306
1621
|
}
|
|
@@ -1309,7 +1624,7 @@ class User {
|
|
|
1309
1624
|
return this._govtId;
|
|
1310
1625
|
}
|
|
1311
1626
|
|
|
1312
|
-
set
|
|
1627
|
+
set govtId(value) {
|
|
1313
1628
|
if (!value) return;
|
|
1314
1629
|
this._govtId = KYCFile.fromObject(value);
|
|
1315
1630
|
}
|
|
@@ -1318,7 +1633,7 @@ class User {
|
|
|
1318
1633
|
return this._termsOfService;
|
|
1319
1634
|
}
|
|
1320
1635
|
|
|
1321
|
-
set
|
|
1636
|
+
set termsOfService(value) {
|
|
1322
1637
|
if (!value) return;
|
|
1323
1638
|
this._termsOfService = TOSAgreements.fromObject(value);
|
|
1324
1639
|
}
|
|
@@ -1327,7 +1642,7 @@ class User {
|
|
|
1327
1642
|
return this._curpDocument;
|
|
1328
1643
|
}
|
|
1329
1644
|
|
|
1330
|
-
set
|
|
1645
|
+
set curpDocument(value) {
|
|
1331
1646
|
if (!value) return;
|
|
1332
1647
|
this._curpDocument = KYCFile.fromObject(value);
|
|
1333
1648
|
}
|
|
@@ -1372,6 +1687,7 @@ class User {
|
|
|
1372
1687
|
stateOfBirth: obj.state_of_birth,
|
|
1373
1688
|
termsOfService: obj.terms_of_service,
|
|
1374
1689
|
updatedAt: obj.updated_at,
|
|
1690
|
+
userType: obj.user_type,
|
|
1375
1691
|
verificationId: obj.verification_id,
|
|
1376
1692
|
});
|
|
1377
1693
|
}
|
|
@@ -1557,6 +1873,7 @@ const getModelFromPath = (path, obj) => {
|
|
|
1557
1873
|
files: () => File.fromObject(obj),
|
|
1558
1874
|
kyc_validations: () => KYCValidations.fromObject(obj),
|
|
1559
1875
|
login_tokens: () => LoginToken.fromObject(obj),
|
|
1876
|
+
partners: () => Partner.fromObject(obj),
|
|
1560
1877
|
savings: () => Saving.fromObject(obj),
|
|
1561
1878
|
service_providers: () => ServiceProvider.fromObject(obj),
|
|
1562
1879
|
sessions: () => Session.fromObject(obj),
|
|
@@ -1730,15 +2047,15 @@ class AlertResource extends mix(Resource).with(
|
|
|
1730
2047
|
super('alerts', AlertQuery, client);
|
|
1731
2048
|
}
|
|
1732
2049
|
|
|
1733
|
-
async create(
|
|
1734
|
-
const request = new AlertUpdateRequest(
|
|
1735
|
-
const alert = await this._create(request.
|
|
2050
|
+
async create(req) {
|
|
2051
|
+
const request = new AlertUpdateRequest(req);
|
|
2052
|
+
const alert = await this._create(request.toCleanObject());
|
|
1736
2053
|
return alert;
|
|
1737
2054
|
}
|
|
1738
2055
|
|
|
1739
|
-
async update(alertId,
|
|
2056
|
+
async update(alertId, req) {
|
|
1740
2057
|
const request = new AlertUpdateRequest(req);
|
|
1741
|
-
const alert = await this._update(alertId, request.
|
|
2058
|
+
const alert = await this._update(alertId, request.toCleanObject());
|
|
1742
2059
|
return alert;
|
|
1743
2060
|
}
|
|
1744
2061
|
}
|
|
@@ -2062,6 +2379,29 @@ class LoginTokenResource extends mix(Resource).with(Creatable) {
|
|
|
2062
2379
|
}
|
|
2063
2380
|
}
|
|
2064
2381
|
|
|
2382
|
+
class PartnerResource extends mix(Resource).with(
|
|
2383
|
+
Creatable,
|
|
2384
|
+
Queryable,
|
|
2385
|
+
Updateable,
|
|
2386
|
+
Retrievable,
|
|
2387
|
+
) {
|
|
2388
|
+
constructor(client) {
|
|
2389
|
+
super('partners', PartnerQuery, client);
|
|
2390
|
+
}
|
|
2391
|
+
|
|
2392
|
+
async create(req) {
|
|
2393
|
+
const request = new PartnerUserRequest(req);
|
|
2394
|
+
const partner = await this._create(request.toCleanObject());
|
|
2395
|
+
return partner;
|
|
2396
|
+
}
|
|
2397
|
+
|
|
2398
|
+
async update(partnerId, req) {
|
|
2399
|
+
const request = new PartnerUserRequest(req);
|
|
2400
|
+
const partner = await this._update(partnerId, request.toCleanObject());
|
|
2401
|
+
return partner;
|
|
2402
|
+
}
|
|
2403
|
+
}
|
|
2404
|
+
|
|
2065
2405
|
class SavingResource extends mix(Resource).with(
|
|
2066
2406
|
Creatable,
|
|
2067
2407
|
Deactivable,
|
|
@@ -2376,6 +2716,7 @@ class Cuenca {
|
|
|
2376
2716
|
this.files = new FileResource(client);
|
|
2377
2717
|
this.kycValidations = new KYCValidationsResource(client);
|
|
2378
2718
|
this.loginTokens = new LoginTokenResource(client);
|
|
2719
|
+
this.partners = new PartnerResource(client);
|
|
2379
2720
|
this.savings = new SavingResource(client);
|
|
2380
2721
|
this.serviceProviders = new ServiceProviderResource(client);
|
|
2381
2722
|
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' }) {
|