@cuenca-mx/cuenca-js 0.0.14-dev10 → 0.0.14-dev12
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/build/{data-92aab1cc.cjs → data-e4c28528.cjs} +13 -0
- package/build/{data-7e8b28c6.mjs → data-fa5e8a84.mjs} +13 -1
- package/build/index.cjs +412 -39
- package/build/index.mjs +381 -8
- package/build/requests/index.cjs +3 -2
- package/build/requests/index.mjs +3 -3
- package/build/types/index.cjs +80 -26
- package/build/types/index.mjs +49 -2
- package/build/umd/cuenca.umd.js +1 -1
- package/build/{identities-0e0a6f42.cjs → vulnerableActivity-8f7d19e6.cjs} +388 -194
- package/build/{identities-38d66e33.mjs → vulnerableActivity-e1e6fdf0.mjs} +381 -194
- package/build/{walletTransactionRequest-da986c71.cjs → walletTransactionRequest-7a9ae1a7.cjs} +109 -4
- package/build/{walletTransactionRequest-d05a25a9.mjs → walletTransactionRequest-dcc77215.mjs} +109 -5
- package/package.json +3 -2
package/build/index.cjs
CHANGED
|
@@ -6,9 +6,9 @@ var axios = require('axios');
|
|
|
6
6
|
var Buffer = require('buffer');
|
|
7
7
|
var errors_index = require('./errors/index.cjs');
|
|
8
8
|
var jwt_index = require('./jwt/index.cjs');
|
|
9
|
-
var data = require('./data-
|
|
10
|
-
var
|
|
11
|
-
var walletTransactionRequest = require('./walletTransactionRequest-
|
|
9
|
+
var data = require('./data-e4c28528.cjs');
|
|
10
|
+
var vulnerableActivity = require('./vulnerableActivity-8f7d19e6.cjs');
|
|
11
|
+
var walletTransactionRequest = require('./walletTransactionRequest-7a9ae1a7.cjs');
|
|
12
12
|
|
|
13
13
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
14
|
|
|
@@ -26,7 +26,7 @@ const isNode =
|
|
|
26
26
|
|
|
27
27
|
const runtimeEnv = { isBrowser, isNode };
|
|
28
28
|
|
|
29
|
-
const name="@cuenca-mx/cuenca-js";const version="0.0.14-
|
|
29
|
+
const name="@cuenca-mx/cuenca-js";const version="0.0.14-dev12";const description="Cuenca client for JS";const main="./build/index.cjs";const module$1="./build/index.mjs";const browser="./build/umd/cuenca.umd.js";const files=["build/**/*"];const exports$1={".":{"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"};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$1,browser:browser,files:files,exports:exports$1,packageManager:packageManager,type:type,repository:repository,keywords:keywords,license:license,bugs:bugs,homepage:homepage,scripts:scripts,devDependencies:devDependencies,dependencies:dependencies};
|
|
30
30
|
|
|
31
31
|
class Client {
|
|
32
32
|
constructor({
|
|
@@ -246,7 +246,7 @@ class Account {
|
|
|
246
246
|
|
|
247
247
|
class Alert {
|
|
248
248
|
constructor({
|
|
249
|
-
|
|
249
|
+
agent,
|
|
250
250
|
accountNumber,
|
|
251
251
|
actualPeriodCount,
|
|
252
252
|
actualPeriodSum,
|
|
@@ -275,7 +275,7 @@ class Alert {
|
|
|
275
275
|
this.accountNumber = accountNumber;
|
|
276
276
|
this.actualPeriodCount = actualPeriodCount;
|
|
277
277
|
this.actualPeriodSum = actualPeriodSum;
|
|
278
|
-
this.
|
|
278
|
+
this.agent = agent;
|
|
279
279
|
this.aggregationType = aggregationType;
|
|
280
280
|
this.comments = comments;
|
|
281
281
|
this.committeeMeetingDate = data.dateToUTC(committeeMeetingDate);
|
|
@@ -300,7 +300,7 @@ class Alert {
|
|
|
300
300
|
}
|
|
301
301
|
|
|
302
302
|
static fromObject = ({
|
|
303
|
-
|
|
303
|
+
agent,
|
|
304
304
|
comments,
|
|
305
305
|
description,
|
|
306
306
|
id,
|
|
@@ -312,7 +312,7 @@ class Alert {
|
|
|
312
312
|
...obj
|
|
313
313
|
}) =>
|
|
314
314
|
new Alert({
|
|
315
|
-
|
|
315
|
+
agent,
|
|
316
316
|
comments,
|
|
317
317
|
description,
|
|
318
318
|
id,
|
|
@@ -345,7 +345,7 @@ class Alert {
|
|
|
345
345
|
|
|
346
346
|
set setChangeLog(value) {
|
|
347
347
|
if (!value || Object.keys(value).length === 0) return;
|
|
348
|
-
this._changeLog = value.map((log) =>
|
|
348
|
+
this._changeLog = value.map((log) => vulnerableActivity.AlertLog.fromObject(log));
|
|
349
349
|
}
|
|
350
350
|
}
|
|
351
351
|
|
|
@@ -552,7 +552,7 @@ class BridgeAccount {
|
|
|
552
552
|
|
|
553
553
|
set setAddress(value) {
|
|
554
554
|
if (!value || Object.keys(value).length === 0) return;
|
|
555
|
-
this._address =
|
|
555
|
+
this._address = vulnerableActivity.Address.fromObject(value);
|
|
556
556
|
}
|
|
557
557
|
|
|
558
558
|
get proofOfAddress() {
|
|
@@ -561,7 +561,7 @@ class BridgeAccount {
|
|
|
561
561
|
|
|
562
562
|
set setProofOfAddress(value) {
|
|
563
563
|
if (!value || Object.keys(value).length === 0) return;
|
|
564
|
-
this._proofOfAddress =
|
|
564
|
+
this._proofOfAddress = vulnerableActivity.KYCFile.fromObject(value);
|
|
565
565
|
}
|
|
566
566
|
|
|
567
567
|
get govtId() {
|
|
@@ -570,7 +570,7 @@ class BridgeAccount {
|
|
|
570
570
|
|
|
571
571
|
set setGovtId(value) {
|
|
572
572
|
if (!value || Object.keys(value).length === 0) return;
|
|
573
|
-
this._govtId =
|
|
573
|
+
this._govtId = vulnerableActivity.KYCFile.fromObject(value);
|
|
574
574
|
}
|
|
575
575
|
|
|
576
576
|
get termsOfService() {
|
|
@@ -579,7 +579,7 @@ class BridgeAccount {
|
|
|
579
579
|
|
|
580
580
|
set setTerms(value) {
|
|
581
581
|
if (!value || Object.keys(value).length === 0) return;
|
|
582
|
-
this._termsOfService =
|
|
582
|
+
this._termsOfService = vulnerableActivity.TOSAgreements.fromObject(value);
|
|
583
583
|
}
|
|
584
584
|
}
|
|
585
585
|
|
|
@@ -1046,6 +1046,351 @@ class LoginToken {
|
|
|
1046
1046
|
static fromObject = ({ id }) => new LoginToken({ id });
|
|
1047
1047
|
}
|
|
1048
1048
|
|
|
1049
|
+
class TransactionalProfile {
|
|
1050
|
+
constructor({
|
|
1051
|
+
currency,
|
|
1052
|
+
monthlyAmount,
|
|
1053
|
+
recipientsNum,
|
|
1054
|
+
payersNum,
|
|
1055
|
+
deposits,
|
|
1056
|
+
withdrawal,
|
|
1057
|
+
}) {
|
|
1058
|
+
this.currency = currency;
|
|
1059
|
+
this.monthlyAmount = monthlyAmount;
|
|
1060
|
+
|
|
1061
|
+
this.recipientsNum = recipientsNum;
|
|
1062
|
+
this.payersNum = payersNum;
|
|
1063
|
+
|
|
1064
|
+
this.setDeposits = deposits;
|
|
1065
|
+
this.setWithdrawal = withdrawal;
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
get deposits() {
|
|
1069
|
+
return this._deposits;
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
set setDeposits(value) {
|
|
1073
|
+
if (!value) return;
|
|
1074
|
+
this._deposits = vulnerableActivity.TransactionalProfileServices.fromObject(value);
|
|
1075
|
+
}
|
|
1076
|
+
|
|
1077
|
+
get withdrawal() {
|
|
1078
|
+
return this._withdrawal;
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
set setWithdrawal(value) {
|
|
1082
|
+
if (!value) return;
|
|
1083
|
+
this._withdrawal = vulnerableActivity.TransactionalProfileServices.fromObject(value);
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
static fromObject = ({ currency, deposits, withdrawal, ...obj }) =>
|
|
1087
|
+
new TransactionalProfile({
|
|
1088
|
+
currency,
|
|
1089
|
+
deposits,
|
|
1090
|
+
withdrawal,
|
|
1091
|
+
payersNum: obj.payers_num,
|
|
1092
|
+
recipientsNum: obj.recipients_num,
|
|
1093
|
+
monthlyAmount: obj.monthly_amount,
|
|
1094
|
+
});
|
|
1095
|
+
}
|
|
1096
|
+
|
|
1097
|
+
class BaseUser {
|
|
1098
|
+
constructor({
|
|
1099
|
+
address,
|
|
1100
|
+
clabe,
|
|
1101
|
+
emailAddress,
|
|
1102
|
+
id,
|
|
1103
|
+
level,
|
|
1104
|
+
meta,
|
|
1105
|
+
nationality,
|
|
1106
|
+
platformId,
|
|
1107
|
+
phoneNumber,
|
|
1108
|
+
requiredLevel,
|
|
1109
|
+
rfc,
|
|
1110
|
+
status,
|
|
1111
|
+
createdAt,
|
|
1112
|
+
updatedAt,
|
|
1113
|
+
userType,
|
|
1114
|
+
}) {
|
|
1115
|
+
this.setAddress = address;
|
|
1116
|
+
this.clabe = clabe;
|
|
1117
|
+
this.createdAt = data.dateToUTC(createdAt);
|
|
1118
|
+
this.emailAddress = emailAddress;
|
|
1119
|
+
this.id = id;
|
|
1120
|
+
this.level = level;
|
|
1121
|
+
this.meta = meta;
|
|
1122
|
+
this.nationality = nationality;
|
|
1123
|
+
this.platformId = platformId;
|
|
1124
|
+
this.phoneNumber = phoneNumber;
|
|
1125
|
+
this.requiredLevel = requiredLevel;
|
|
1126
|
+
this.rfc = rfc;
|
|
1127
|
+
this.status = data.enumValueFromString(data.UserStatus, status);
|
|
1128
|
+
this.updatedAt = data.dateToUTC(updatedAt);
|
|
1129
|
+
this.userType = userType;
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
get address() {
|
|
1133
|
+
return this._address;
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
set setAddress(value) {
|
|
1137
|
+
if (!value) return;
|
|
1138
|
+
this._address = vulnerableActivity.Address.fromObject(value);
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
get proofOfAddress() {
|
|
1142
|
+
return this._proofOfAddress;
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
set setProofOfAddress(value) {
|
|
1146
|
+
if (!value) return;
|
|
1147
|
+
this._proofOfAddress = vulnerableActivity.KYCFile.fromObject(value);
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
get proofOfLife() {
|
|
1151
|
+
return this._proofOfLife;
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
set setProofOfLife(value) {
|
|
1155
|
+
if (!value) return;
|
|
1156
|
+
this._proofOfLife = vulnerableActivity.KYCFile.fromObject(value);
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
get govtId() {
|
|
1160
|
+
return this._govtId;
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
set setGovtId(value) {
|
|
1164
|
+
if (!value) return;
|
|
1165
|
+
this._govtId = vulnerableActivity.KYCFile.fromObject(value);
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
get termsOfService() {
|
|
1169
|
+
return this._termsOfService;
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
set setTerms(value) {
|
|
1173
|
+
if (!value) return;
|
|
1174
|
+
this._termsOfService = vulnerableActivity.TOSAgreements.fromObject(value);
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1177
|
+
get curpDocument() {
|
|
1178
|
+
return this._curpDocument;
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
set setCurpDoc(value) {
|
|
1182
|
+
if (!value) return;
|
|
1183
|
+
this._curpDocument = vulnerableActivity.KYCFile.fromObject(value);
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1186
|
+
static fromObject = ({
|
|
1187
|
+
address,
|
|
1188
|
+
clabe,
|
|
1189
|
+
id,
|
|
1190
|
+
level,
|
|
1191
|
+
nationality,
|
|
1192
|
+
rfc,
|
|
1193
|
+
status,
|
|
1194
|
+
...obj
|
|
1195
|
+
}) =>
|
|
1196
|
+
new BaseUser({
|
|
1197
|
+
address,
|
|
1198
|
+
clabe,
|
|
1199
|
+
id,
|
|
1200
|
+
level,
|
|
1201
|
+
nationality,
|
|
1202
|
+
rfc,
|
|
1203
|
+
status,
|
|
1204
|
+
createdAt: obj.created_at,
|
|
1205
|
+
emailAddress: obj.email_address,
|
|
1206
|
+
phoneNumber: obj.phone_number,
|
|
1207
|
+
platformId: obj.platform_id,
|
|
1208
|
+
requiredLevel: obj.required_level,
|
|
1209
|
+
updatedAt: obj.updated_at,
|
|
1210
|
+
userType: obj.user_type,
|
|
1211
|
+
});
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
class Partner extends BaseUser {
|
|
1215
|
+
constructor({
|
|
1216
|
+
address,
|
|
1217
|
+
audit,
|
|
1218
|
+
businessDetails,
|
|
1219
|
+
businessName,
|
|
1220
|
+
clabe,
|
|
1221
|
+
createdAt,
|
|
1222
|
+
documentationUrl,
|
|
1223
|
+
emailAddress,
|
|
1224
|
+
externalAccount,
|
|
1225
|
+
folio,
|
|
1226
|
+
id,
|
|
1227
|
+
incorporationDate,
|
|
1228
|
+
legalName,
|
|
1229
|
+
legalRepresentatives,
|
|
1230
|
+
level,
|
|
1231
|
+
license,
|
|
1232
|
+
meta,
|
|
1233
|
+
nationality,
|
|
1234
|
+
phoneNumber,
|
|
1235
|
+
platformId,
|
|
1236
|
+
requiredLevel,
|
|
1237
|
+
rfc,
|
|
1238
|
+
shareholders,
|
|
1239
|
+
status,
|
|
1240
|
+
transactionalProfile,
|
|
1241
|
+
updatedAt,
|
|
1242
|
+
userId,
|
|
1243
|
+
userType,
|
|
1244
|
+
vulnerableActivity,
|
|
1245
|
+
webSite,
|
|
1246
|
+
}) {
|
|
1247
|
+
super({
|
|
1248
|
+
address,
|
|
1249
|
+
clabe,
|
|
1250
|
+
emailAddress,
|
|
1251
|
+
rfc,
|
|
1252
|
+
id,
|
|
1253
|
+
level,
|
|
1254
|
+
license,
|
|
1255
|
+
meta,
|
|
1256
|
+
nationality,
|
|
1257
|
+
platformId,
|
|
1258
|
+
phoneNumber,
|
|
1259
|
+
requiredLevel,
|
|
1260
|
+
status,
|
|
1261
|
+
createdAt,
|
|
1262
|
+
updatedAt,
|
|
1263
|
+
userType,
|
|
1264
|
+
});
|
|
1265
|
+
this.setAudit = audit;
|
|
1266
|
+
this.businessName = businessName;
|
|
1267
|
+
this.setBusinessDetails = businessDetails;
|
|
1268
|
+
this.documentationUrl = documentationUrl;
|
|
1269
|
+
this.incorporationDate = data.dateToUTC(incorporationDate);
|
|
1270
|
+
this.externalAccount = externalAccount;
|
|
1271
|
+
this.folio = folio;
|
|
1272
|
+
this.legalName = legalName;
|
|
1273
|
+
this.setLicense = license;
|
|
1274
|
+
this.setShareholders = shareholders;
|
|
1275
|
+
this.setLegalRepresentatives = legalRepresentatives;
|
|
1276
|
+
this.setTransactionalProfile = transactionalProfile;
|
|
1277
|
+
this.userId = userId;
|
|
1278
|
+
this.setVulnerableActivity = vulnerableActivity;
|
|
1279
|
+
this.webSite = webSite;
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
get shareholders() {
|
|
1283
|
+
return this._shareholders;
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
set setShareholders(value) {
|
|
1287
|
+
if (!value) return;
|
|
1288
|
+
this._shareholders = value.map((sh) => vulnerableActivity.ShareholderMoral.fromObject(sh));
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1291
|
+
get legalRepresentatives() {
|
|
1292
|
+
return this._legalRepresentatives;
|
|
1293
|
+
}
|
|
1294
|
+
|
|
1295
|
+
set setLegalRepresentatives(value) {
|
|
1296
|
+
if (!value) return;
|
|
1297
|
+
this._legalRepresentatives = value.map((lr) =>
|
|
1298
|
+
vulnerableActivity.LegalRepresentatives.fromObject(lr),
|
|
1299
|
+
);
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
get vulnerableActivity() {
|
|
1303
|
+
return this._vulnerableActivity;
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1306
|
+
set setVulnerableActivity(value) {
|
|
1307
|
+
if (!value) return;
|
|
1308
|
+
this._vulnerableActivity = vulnerableActivity.VulnerableActivity.fromObject(value);
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1311
|
+
get audit() {
|
|
1312
|
+
return this._audit;
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1315
|
+
set setAudit(value) {
|
|
1316
|
+
if (!value) return;
|
|
1317
|
+
this._audit = vulnerableActivity.Audit.fromObject(value);
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1320
|
+
get license() {
|
|
1321
|
+
return this._license;
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
set setLicense(value) {
|
|
1325
|
+
if (!value) return;
|
|
1326
|
+
this._license = vulnerableActivity.License.fromObject(value);
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
get transactionalProfile() {
|
|
1330
|
+
return this._transactionalProfile;
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1333
|
+
set setTransactionalProfile(value) {
|
|
1334
|
+
if (!value) return;
|
|
1335
|
+
this._transactionalProfile = TransactionalProfile.fromObject(value);
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
get businessDetails() {
|
|
1339
|
+
return this._businessDetails;
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
set setBusinessDetails(value) {
|
|
1343
|
+
if (!value) return;
|
|
1344
|
+
this._businessDetails = vulnerableActivity.BusinessDetails.fromObject(value);
|
|
1345
|
+
}
|
|
1346
|
+
|
|
1347
|
+
static fromObject = ({
|
|
1348
|
+
audit,
|
|
1349
|
+
address,
|
|
1350
|
+
clabe,
|
|
1351
|
+
folio,
|
|
1352
|
+
id,
|
|
1353
|
+
level,
|
|
1354
|
+
license,
|
|
1355
|
+
nationality,
|
|
1356
|
+
rfc,
|
|
1357
|
+
status,
|
|
1358
|
+
shareholders,
|
|
1359
|
+
...obj
|
|
1360
|
+
}) =>
|
|
1361
|
+
new Partner({
|
|
1362
|
+
address,
|
|
1363
|
+
audit,
|
|
1364
|
+
clabe,
|
|
1365
|
+
folio,
|
|
1366
|
+
id,
|
|
1367
|
+
level,
|
|
1368
|
+
license,
|
|
1369
|
+
nationality,
|
|
1370
|
+
rfc,
|
|
1371
|
+
shareholders,
|
|
1372
|
+
status,
|
|
1373
|
+
legalName: obj.legal_name,
|
|
1374
|
+
legalRepresentatives: obj.legal_representatives,
|
|
1375
|
+
businessModel: obj.business_model,
|
|
1376
|
+
businessName: obj.business_name,
|
|
1377
|
+
businessDetails: obj.business_details,
|
|
1378
|
+
createdAt: obj.created_at,
|
|
1379
|
+
documentationUrl: obj.documentation_url,
|
|
1380
|
+
emailAddress: obj.email_address,
|
|
1381
|
+
externalAccount: obj.external_account,
|
|
1382
|
+
incorporationDate: obj.incorporation_date,
|
|
1383
|
+
phoneNumber: obj.phone_number,
|
|
1384
|
+
platformId: obj.platform_id,
|
|
1385
|
+
requiredLevel: obj.required_level,
|
|
1386
|
+
transactionalProfile: obj.transactional_profile,
|
|
1387
|
+
updatedAt: obj.updated_at,
|
|
1388
|
+
userType: obj.user_type,
|
|
1389
|
+
vulnerableActivity: obj.vulnerable_activity,
|
|
1390
|
+
webSite: obj.web_site,
|
|
1391
|
+
});
|
|
1392
|
+
}
|
|
1393
|
+
|
|
1049
1394
|
class Wallet {
|
|
1050
1395
|
constructor({ balance, createdAt, deactivatedAt, id, userId, updatedAt }) {
|
|
1051
1396
|
this.balance = balance;
|
|
@@ -1253,6 +1598,7 @@ class User {
|
|
|
1253
1598
|
status,
|
|
1254
1599
|
termsOfService,
|
|
1255
1600
|
updatedAt,
|
|
1601
|
+
userType,
|
|
1256
1602
|
verificationId,
|
|
1257
1603
|
}) {
|
|
1258
1604
|
this.setAddress = address;
|
|
@@ -1284,6 +1630,7 @@ class User {
|
|
|
1284
1630
|
this.status = data.enumValueFromString(data.UserStatus, status);
|
|
1285
1631
|
this.setTerms = termsOfService;
|
|
1286
1632
|
this.updatedAt = data.dateToUTC(updatedAt);
|
|
1633
|
+
this.userType = userType;
|
|
1287
1634
|
this.verificationId = verificationId;
|
|
1288
1635
|
}
|
|
1289
1636
|
|
|
@@ -1293,7 +1640,7 @@ class User {
|
|
|
1293
1640
|
|
|
1294
1641
|
set setAddress(value) {
|
|
1295
1642
|
if (!value) return;
|
|
1296
|
-
this._address =
|
|
1643
|
+
this._address = vulnerableActivity.Address.fromObject(value);
|
|
1297
1644
|
}
|
|
1298
1645
|
|
|
1299
1646
|
get proofOfAddress() {
|
|
@@ -1302,7 +1649,7 @@ class User {
|
|
|
1302
1649
|
|
|
1303
1650
|
set setProofOfAddress(value) {
|
|
1304
1651
|
if (!value) return;
|
|
1305
|
-
this._proofOfAddress =
|
|
1652
|
+
this._proofOfAddress = vulnerableActivity.KYCFile.fromObject(value);
|
|
1306
1653
|
}
|
|
1307
1654
|
|
|
1308
1655
|
get proofOfLife() {
|
|
@@ -1311,7 +1658,7 @@ class User {
|
|
|
1311
1658
|
|
|
1312
1659
|
set setProofOfLife(value) {
|
|
1313
1660
|
if (!value) return;
|
|
1314
|
-
this._proofOfLife =
|
|
1661
|
+
this._proofOfLife = vulnerableActivity.KYCFile.fromObject(value);
|
|
1315
1662
|
}
|
|
1316
1663
|
|
|
1317
1664
|
get govtId() {
|
|
@@ -1320,7 +1667,7 @@ class User {
|
|
|
1320
1667
|
|
|
1321
1668
|
set setGovtId(value) {
|
|
1322
1669
|
if (!value) return;
|
|
1323
|
-
this._govtId =
|
|
1670
|
+
this._govtId = vulnerableActivity.KYCFile.fromObject(value);
|
|
1324
1671
|
}
|
|
1325
1672
|
|
|
1326
1673
|
get termsOfService() {
|
|
@@ -1329,7 +1676,7 @@ class User {
|
|
|
1329
1676
|
|
|
1330
1677
|
set setTerms(value) {
|
|
1331
1678
|
if (!value) return;
|
|
1332
|
-
this._termsOfService =
|
|
1679
|
+
this._termsOfService = vulnerableActivity.TOSAgreements.fromObject(value);
|
|
1333
1680
|
}
|
|
1334
1681
|
|
|
1335
1682
|
get curpDocument() {
|
|
@@ -1338,7 +1685,7 @@ class User {
|
|
|
1338
1685
|
|
|
1339
1686
|
set setCurpDoc(value) {
|
|
1340
1687
|
if (!value) return;
|
|
1341
|
-
this._curpDocument =
|
|
1688
|
+
this._curpDocument = vulnerableActivity.KYCFile.fromObject(value);
|
|
1342
1689
|
}
|
|
1343
1690
|
|
|
1344
1691
|
static fromObject = ({
|
|
@@ -1381,6 +1728,7 @@ class User {
|
|
|
1381
1728
|
stateOfBirth: obj.state_of_birth,
|
|
1382
1729
|
termsOfService: obj.terms_of_service,
|
|
1383
1730
|
updatedAt: obj.updated_at,
|
|
1731
|
+
userType: obj.user_type,
|
|
1384
1732
|
verificationId: obj.verification_id,
|
|
1385
1733
|
});
|
|
1386
1734
|
}
|
|
@@ -1566,6 +1914,7 @@ const getModelFromPath = (path, obj) => {
|
|
|
1566
1914
|
files: () => File.fromObject(obj),
|
|
1567
1915
|
kyc_validations: () => KYCValidations.fromObject(obj),
|
|
1568
1916
|
login_tokens: () => LoginToken.fromObject(obj),
|
|
1917
|
+
partners: () => Partner.fromObject(obj),
|
|
1569
1918
|
savings: () => Saving.fromObject(obj),
|
|
1570
1919
|
service_providers: () => ServiceProvider.fromObject(obj),
|
|
1571
1920
|
sessions: () => Session.fromObject(obj),
|
|
@@ -1725,7 +2074,7 @@ const Queryable = (SuperClass) =>
|
|
|
1725
2074
|
|
|
1726
2075
|
class AccountResource extends mix(Resource).with(Queryable, Retrievable) {
|
|
1727
2076
|
constructor(client) {
|
|
1728
|
-
super('accounts',
|
|
2077
|
+
super('accounts', vulnerableActivity.AccountQuery, client);
|
|
1729
2078
|
}
|
|
1730
2079
|
}
|
|
1731
2080
|
|
|
@@ -1736,7 +2085,7 @@ class AlertResource extends mix(Resource).with(
|
|
|
1736
2085
|
Updateable,
|
|
1737
2086
|
) {
|
|
1738
2087
|
constructor(client) {
|
|
1739
|
-
super('alerts',
|
|
2088
|
+
super('alerts', vulnerableActivity.AlertQuery, client);
|
|
1740
2089
|
}
|
|
1741
2090
|
|
|
1742
2091
|
async create(...req) {
|
|
@@ -1760,7 +2109,7 @@ class ApiKeyResource extends mix(Resource).with(
|
|
|
1760
2109
|
Updateable,
|
|
1761
2110
|
) {
|
|
1762
2111
|
constructor(client) {
|
|
1763
|
-
super('api_keys',
|
|
2112
|
+
super('api_keys', vulnerableActivity.ApiKeyQuery, client);
|
|
1764
2113
|
}
|
|
1765
2114
|
|
|
1766
2115
|
async create() {
|
|
@@ -1814,7 +2163,7 @@ class ArpcResource extends mix(Resource).with(Creatable) {
|
|
|
1814
2163
|
|
|
1815
2164
|
class BalanceEntryResource extends mix(Resource).with(Queryable, Retrievable) {
|
|
1816
2165
|
constructor(client) {
|
|
1817
|
-
super('balance_entries',
|
|
2166
|
+
super('balance_entries', vulnerableActivity.BalanceEntryQuery, client);
|
|
1818
2167
|
}
|
|
1819
2168
|
|
|
1820
2169
|
async relatedTransaction(relatedTransactionUri) {
|
|
@@ -1840,7 +2189,7 @@ class BalanceEntryResource extends mix(Resource).with(Queryable, Retrievable) {
|
|
|
1840
2189
|
|
|
1841
2190
|
class BillPaymentResource extends mix(Resource).with(Queryable, Retrievable) {
|
|
1842
2191
|
constructor(client) {
|
|
1843
|
-
super('bill_payments',
|
|
2192
|
+
super('bill_payments', vulnerableActivity.BillPaymentQuery, client);
|
|
1844
2193
|
}
|
|
1845
2194
|
|
|
1846
2195
|
async serviceProvider(providerUri) {
|
|
@@ -1858,7 +2207,7 @@ class BridegAccountResource extends mix(Resource).with(
|
|
|
1858
2207
|
Retrievable,
|
|
1859
2208
|
) {
|
|
1860
2209
|
constructor(client) {
|
|
1861
|
-
super('bridge/accounts',
|
|
2210
|
+
super('bridge/accounts', vulnerableActivity.BridgeAccountQuery, client);
|
|
1862
2211
|
}
|
|
1863
2212
|
|
|
1864
2213
|
async update({ userId = 'me', ...req }) {
|
|
@@ -1873,13 +2222,13 @@ class BridgeBankAccountResource extends mix(Resource).with(
|
|
|
1873
2222
|
Retrievable,
|
|
1874
2223
|
) {
|
|
1875
2224
|
constructor(client) {
|
|
1876
|
-
super('bridge/bank_accounts',
|
|
2225
|
+
super('bridge/bank_accounts', vulnerableActivity.BridgeBankAccountQuery, client);
|
|
1877
2226
|
}
|
|
1878
2227
|
}
|
|
1879
2228
|
|
|
1880
2229
|
class BridgeClabeResource extends mix(Resource).with(Queryable) {
|
|
1881
2230
|
constructor(client) {
|
|
1882
|
-
super('bridge/clabes',
|
|
2231
|
+
super('bridge/clabes', vulnerableActivity.BridgeQuery, client);
|
|
1883
2232
|
}
|
|
1884
2233
|
}
|
|
1885
2234
|
|
|
@@ -1888,7 +2237,7 @@ class BridgeTransactionResource extends mix(Resource).with(
|
|
|
1888
2237
|
Retrievable,
|
|
1889
2238
|
) {
|
|
1890
2239
|
constructor(client) {
|
|
1891
|
-
super('bridge/transactions',
|
|
2240
|
+
super('bridge/transactions', vulnerableActivity.BridgeTransactionQuery, client);
|
|
1892
2241
|
}
|
|
1893
2242
|
}
|
|
1894
2243
|
|
|
@@ -1918,7 +2267,7 @@ class CardResource extends mix(Resource).with(
|
|
|
1918
2267
|
Updateable,
|
|
1919
2268
|
) {
|
|
1920
2269
|
constructor(client) {
|
|
1921
|
-
super('cards',
|
|
2270
|
+
super('cards', vulnerableActivity.CardsQuery, client);
|
|
1922
2271
|
}
|
|
1923
2272
|
|
|
1924
2273
|
async create(userId, issuer, fundingType) {
|
|
@@ -1944,7 +2293,7 @@ class CardTransactionResource extends mix(Resource).with(
|
|
|
1944
2293
|
Retrievable,
|
|
1945
2294
|
) {
|
|
1946
2295
|
constructor(client) {
|
|
1947
|
-
super('card_transactions',
|
|
2296
|
+
super('card_transactions', vulnerableActivity.CardTransactionQuery, client);
|
|
1948
2297
|
}
|
|
1949
2298
|
|
|
1950
2299
|
async relatedCard(relatedCardUri) {
|
|
@@ -1996,7 +2345,7 @@ class CardValidationResource extends mix(Resource).with(Creatable) {
|
|
|
1996
2345
|
|
|
1997
2346
|
class CommissionResource extends mix(Resource).with(Queryable, Retrievable) {
|
|
1998
2347
|
constructor(client) {
|
|
1999
|
-
super('commissions',
|
|
2348
|
+
super('commissions', vulnerableActivity.QueryParams, client);
|
|
2000
2349
|
}
|
|
2001
2350
|
|
|
2002
2351
|
async relatedTransaction(relatedTransactionUri) {
|
|
@@ -2010,7 +2359,7 @@ class CommissionResource extends mix(Resource).with(Queryable, Retrievable) {
|
|
|
2010
2359
|
|
|
2011
2360
|
class DepositResource extends mix(Resource).with(Queryable, Retrievable) {
|
|
2012
2361
|
constructor(client) {
|
|
2013
|
-
super('deposits',
|
|
2362
|
+
super('deposits', vulnerableActivity.DepositQuery, client);
|
|
2014
2363
|
}
|
|
2015
2364
|
|
|
2016
2365
|
async source(sourceUri) {
|
|
@@ -2071,6 +2420,29 @@ class LoginTokenResource extends mix(Resource).with(Creatable) {
|
|
|
2071
2420
|
}
|
|
2072
2421
|
}
|
|
2073
2422
|
|
|
2423
|
+
class PartnerResource extends mix(Resource).with(
|
|
2424
|
+
Creatable,
|
|
2425
|
+
Queryable,
|
|
2426
|
+
Updateable,
|
|
2427
|
+
Retrievable,
|
|
2428
|
+
) {
|
|
2429
|
+
constructor(client) {
|
|
2430
|
+
super('partners', vulnerableActivity.QueryParams, client);
|
|
2431
|
+
}
|
|
2432
|
+
|
|
2433
|
+
async create({ ...req }) {
|
|
2434
|
+
const request = new walletTransactionRequest.PartnerUserRequest(req);
|
|
2435
|
+
const moral = await this._create(request.toObect());
|
|
2436
|
+
return moral;
|
|
2437
|
+
}
|
|
2438
|
+
|
|
2439
|
+
async update({ userId = 'me', ...req }) {
|
|
2440
|
+
const request = new walletTransactionRequest.PartnerUserRequest(req);
|
|
2441
|
+
const moral = await this._update(userId, request.toObject());
|
|
2442
|
+
return moral;
|
|
2443
|
+
}
|
|
2444
|
+
}
|
|
2445
|
+
|
|
2074
2446
|
class SavingResource extends mix(Resource).with(
|
|
2075
2447
|
Creatable,
|
|
2076
2448
|
Deactivable,
|
|
@@ -2079,7 +2451,7 @@ class SavingResource extends mix(Resource).with(
|
|
|
2079
2451
|
Updateable,
|
|
2080
2452
|
) {
|
|
2081
2453
|
constructor(client) {
|
|
2082
|
-
super('savings',
|
|
2454
|
+
super('savings', vulnerableActivity.WalletQuery, client);
|
|
2083
2455
|
}
|
|
2084
2456
|
|
|
2085
2457
|
async create(category, goalAmount, goalDate, name) {
|
|
@@ -2105,7 +2477,7 @@ class ServiceProviderResource extends mix(Resource).with(
|
|
|
2105
2477
|
Retrievable,
|
|
2106
2478
|
) {
|
|
2107
2479
|
constructor(client) {
|
|
2108
|
-
super('service_providers',
|
|
2480
|
+
super('service_providers', vulnerableActivity.QueryParams, client);
|
|
2109
2481
|
}
|
|
2110
2482
|
}
|
|
2111
2483
|
|
|
@@ -2134,7 +2506,7 @@ class SessionResource extends mix(Resource).with(
|
|
|
2134
2506
|
|
|
2135
2507
|
class StatementResource extends mix(Resource).with(Downlodable, Queryable) {
|
|
2136
2508
|
constructor(client) {
|
|
2137
|
-
super('statements',
|
|
2509
|
+
super('statements', vulnerableActivity.StatementQuery, client);
|
|
2138
2510
|
}
|
|
2139
2511
|
|
|
2140
2512
|
async pdf(id) {
|
|
@@ -2154,7 +2526,7 @@ class TransferResource extends mix(Resource).with(
|
|
|
2154
2526
|
Retrievable,
|
|
2155
2527
|
) {
|
|
2156
2528
|
constructor(client) {
|
|
2157
|
-
super('transfers',
|
|
2529
|
+
super('transfers', vulnerableActivity.TransferQuery, client);
|
|
2158
2530
|
}
|
|
2159
2531
|
|
|
2160
2532
|
async destination(destinationUri) {
|
|
@@ -2280,7 +2652,7 @@ class UserResourse extends mix(Resource).with(
|
|
|
2280
2652
|
Retrievable,
|
|
2281
2653
|
) {
|
|
2282
2654
|
constructor(client) {
|
|
2283
|
-
super('users',
|
|
2655
|
+
super('users', vulnerableActivity.UserQuery, client);
|
|
2284
2656
|
}
|
|
2285
2657
|
|
|
2286
2658
|
async update({ userId = 'me', ...req }) {
|
|
@@ -2314,7 +2686,7 @@ class WalletTransactionsResource extends mix(Resource).with(
|
|
|
2314
2686
|
Retrievable,
|
|
2315
2687
|
) {
|
|
2316
2688
|
constructor(client) {
|
|
2317
|
-
super('wallet_transactions',
|
|
2689
|
+
super('wallet_transactions', vulnerableActivity.WalletTransactionQuery, client);
|
|
2318
2690
|
}
|
|
2319
2691
|
|
|
2320
2692
|
async create(amount, transactionType, walletUri) {
|
|
@@ -2341,7 +2713,7 @@ class WhatsAppTransferResource extends mix(Resource).with(
|
|
|
2341
2713
|
Retrievable,
|
|
2342
2714
|
) {
|
|
2343
2715
|
constructor(client) {
|
|
2344
|
-
super('whatsapp_transfers',
|
|
2716
|
+
super('whatsapp_transfers', vulnerableActivity.QueryParams, client);
|
|
2345
2717
|
}
|
|
2346
2718
|
|
|
2347
2719
|
async accountDestination(destinationUri) {
|
|
@@ -2385,6 +2757,7 @@ class Cuenca {
|
|
|
2385
2757
|
this.files = new FileResource(client);
|
|
2386
2758
|
this.kycValidations = new KYCValidationsResource(client);
|
|
2387
2759
|
this.loginTokens = new LoginTokenResource(client);
|
|
2760
|
+
this.partners = new PartnerResource(client);
|
|
2388
2761
|
this.savings = new SavingResource(client);
|
|
2389
2762
|
this.serviceProviders = new ServiceProviderResource(client);
|
|
2390
2763
|
this.sessions = new SessionResource(client);
|