@cuenca-mx/cuenca-js 0.0.14-dev11 → 0.0.14-dev13
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 +363 -35
- package/build/index.mjs +332 -4
- 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-2fdef0f0.mjs → vulnerableActivity-2fdebcc2.mjs} +383 -194
- package/build/{identities-21139389.cjs → vulnerableActivity-aad6b958.cjs} +390 -194
- package/build/{walletTransactionRequest-d488d4ff.cjs → walletTransactionRequest-7a9ae1a7.cjs} +106 -1
- package/build/{walletTransactionRequest-158d4fc6.mjs → walletTransactionRequest-dcc77215.mjs} +106 -2
- 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-aad6b958.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-dev13";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({
|
|
@@ -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,306 @@ 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
|
+
static fromObject = ({
|
|
1142
|
+
address,
|
|
1143
|
+
clabe,
|
|
1144
|
+
id,
|
|
1145
|
+
level,
|
|
1146
|
+
nationality,
|
|
1147
|
+
rfc,
|
|
1148
|
+
status,
|
|
1149
|
+
...obj
|
|
1150
|
+
}) =>
|
|
1151
|
+
new BaseUser({
|
|
1152
|
+
address,
|
|
1153
|
+
clabe,
|
|
1154
|
+
id,
|
|
1155
|
+
level,
|
|
1156
|
+
nationality,
|
|
1157
|
+
rfc,
|
|
1158
|
+
status,
|
|
1159
|
+
createdAt: obj.created_at,
|
|
1160
|
+
emailAddress: obj.email_address,
|
|
1161
|
+
phoneNumber: obj.phone_number,
|
|
1162
|
+
platformId: obj.platform_id,
|
|
1163
|
+
requiredLevel: obj.required_level,
|
|
1164
|
+
updatedAt: obj.updated_at,
|
|
1165
|
+
userType: obj.user_type,
|
|
1166
|
+
});
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
class Partner extends BaseUser {
|
|
1170
|
+
constructor({
|
|
1171
|
+
address,
|
|
1172
|
+
audit,
|
|
1173
|
+
businessDetails,
|
|
1174
|
+
businessName,
|
|
1175
|
+
clabe,
|
|
1176
|
+
createdAt,
|
|
1177
|
+
documentationUrl,
|
|
1178
|
+
emailAddress,
|
|
1179
|
+
externalAccount,
|
|
1180
|
+
folio,
|
|
1181
|
+
id,
|
|
1182
|
+
incorporationDate,
|
|
1183
|
+
legalName,
|
|
1184
|
+
legalRepresentatives,
|
|
1185
|
+
level,
|
|
1186
|
+
license,
|
|
1187
|
+
meta,
|
|
1188
|
+
nationality,
|
|
1189
|
+
phoneNumber,
|
|
1190
|
+
platformId,
|
|
1191
|
+
requiredLevel,
|
|
1192
|
+
rfc,
|
|
1193
|
+
shareholders,
|
|
1194
|
+
status,
|
|
1195
|
+
transactionalProfile,
|
|
1196
|
+
updatedAt,
|
|
1197
|
+
userId,
|
|
1198
|
+
userType,
|
|
1199
|
+
vulnerableActivity,
|
|
1200
|
+
webSite,
|
|
1201
|
+
}) {
|
|
1202
|
+
super({
|
|
1203
|
+
address,
|
|
1204
|
+
clabe,
|
|
1205
|
+
emailAddress,
|
|
1206
|
+
rfc,
|
|
1207
|
+
id,
|
|
1208
|
+
level,
|
|
1209
|
+
license,
|
|
1210
|
+
meta,
|
|
1211
|
+
nationality,
|
|
1212
|
+
platformId,
|
|
1213
|
+
phoneNumber,
|
|
1214
|
+
requiredLevel,
|
|
1215
|
+
status,
|
|
1216
|
+
createdAt,
|
|
1217
|
+
updatedAt,
|
|
1218
|
+
userType,
|
|
1219
|
+
});
|
|
1220
|
+
this.setAudit = audit;
|
|
1221
|
+
this.businessName = businessName;
|
|
1222
|
+
this.setBusinessDetails = businessDetails;
|
|
1223
|
+
this.documentationUrl = documentationUrl;
|
|
1224
|
+
this.incorporationDate = data.dateToUTC(incorporationDate);
|
|
1225
|
+
this.externalAccount = externalAccount;
|
|
1226
|
+
this.folio = folio;
|
|
1227
|
+
this.legalName = legalName;
|
|
1228
|
+
this.setLicense = license;
|
|
1229
|
+
this.setShareholders = shareholders;
|
|
1230
|
+
this.setLegalRepresentatives = legalRepresentatives;
|
|
1231
|
+
this.setTransactionalProfile = transactionalProfile;
|
|
1232
|
+
this.userId = userId;
|
|
1233
|
+
this.setVulnerableActivity = vulnerableActivity;
|
|
1234
|
+
this.webSite = webSite;
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1237
|
+
get shareholders() {
|
|
1238
|
+
return this._shareholders;
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
set setShareholders(value) {
|
|
1242
|
+
if (!value) return;
|
|
1243
|
+
this._shareholders = value.map((sh) => vulnerableActivity.ShareholderMoral.fromObject(sh));
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
get legalRepresentatives() {
|
|
1247
|
+
return this._legalRepresentatives;
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
set setLegalRepresentatives(value) {
|
|
1251
|
+
if (!value) return;
|
|
1252
|
+
this._legalRepresentatives = value.map((lr) =>
|
|
1253
|
+
vulnerableActivity.LegalRepresentatives.fromObject(lr),
|
|
1254
|
+
);
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
get vulnerableActivity() {
|
|
1258
|
+
return this._vulnerableActivity;
|
|
1259
|
+
}
|
|
1260
|
+
|
|
1261
|
+
set setVulnerableActivity(value) {
|
|
1262
|
+
if (!value) return;
|
|
1263
|
+
this._vulnerableActivity = vulnerableActivity.VulnerableActivity.fromObject(value);
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
get audit() {
|
|
1267
|
+
return this._audit;
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
set setAudit(value) {
|
|
1271
|
+
if (!value) return;
|
|
1272
|
+
this._audit = vulnerableActivity.Audit.fromObject(value);
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1275
|
+
get license() {
|
|
1276
|
+
return this._license;
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1279
|
+
set setLicense(value) {
|
|
1280
|
+
if (!value) return;
|
|
1281
|
+
this._license = vulnerableActivity.License.fromObject(value);
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1284
|
+
get transactionalProfile() {
|
|
1285
|
+
return this._transactionalProfile;
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1288
|
+
set setTransactionalProfile(value) {
|
|
1289
|
+
if (!value) return;
|
|
1290
|
+
this._transactionalProfile = TransactionalProfile.fromObject(value);
|
|
1291
|
+
}
|
|
1292
|
+
|
|
1293
|
+
get businessDetails() {
|
|
1294
|
+
return this._businessDetails;
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
set setBusinessDetails(value) {
|
|
1298
|
+
if (!value) return;
|
|
1299
|
+
this._businessDetails = vulnerableActivity.BusinessDetails.fromObject(value);
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
static fromObject = ({
|
|
1303
|
+
audit,
|
|
1304
|
+
address,
|
|
1305
|
+
clabe,
|
|
1306
|
+
folio,
|
|
1307
|
+
id,
|
|
1308
|
+
level,
|
|
1309
|
+
license,
|
|
1310
|
+
nationality,
|
|
1311
|
+
rfc,
|
|
1312
|
+
status,
|
|
1313
|
+
shareholders,
|
|
1314
|
+
...obj
|
|
1315
|
+
}) =>
|
|
1316
|
+
new Partner({
|
|
1317
|
+
address,
|
|
1318
|
+
audit,
|
|
1319
|
+
clabe,
|
|
1320
|
+
folio,
|
|
1321
|
+
id,
|
|
1322
|
+
level,
|
|
1323
|
+
license,
|
|
1324
|
+
nationality,
|
|
1325
|
+
rfc,
|
|
1326
|
+
shareholders,
|
|
1327
|
+
status,
|
|
1328
|
+
legalName: obj.legal_name,
|
|
1329
|
+
legalRepresentatives: obj.legal_representatives,
|
|
1330
|
+
businessModel: obj.business_model,
|
|
1331
|
+
businessName: obj.business_name,
|
|
1332
|
+
businessDetails: obj.business_details,
|
|
1333
|
+
createdAt: obj.created_at,
|
|
1334
|
+
documentationUrl: obj.documentation_url,
|
|
1335
|
+
emailAddress: obj.email_address,
|
|
1336
|
+
externalAccount: obj.external_account,
|
|
1337
|
+
incorporationDate: obj.incorporation_date,
|
|
1338
|
+
phoneNumber: obj.phone_number,
|
|
1339
|
+
platformId: obj.platform_id,
|
|
1340
|
+
requiredLevel: obj.required_level,
|
|
1341
|
+
transactionalProfile: obj.transactional_profile,
|
|
1342
|
+
updatedAt: obj.updated_at,
|
|
1343
|
+
userType: obj.user_type,
|
|
1344
|
+
vulnerableActivity: obj.vulnerable_activity,
|
|
1345
|
+
webSite: obj.web_site,
|
|
1346
|
+
});
|
|
1347
|
+
}
|
|
1348
|
+
|
|
1049
1349
|
class Wallet {
|
|
1050
1350
|
constructor({ balance, createdAt, deactivatedAt, id, userId, updatedAt }) {
|
|
1051
1351
|
this.balance = balance;
|
|
@@ -1253,6 +1553,7 @@ class User {
|
|
|
1253
1553
|
status,
|
|
1254
1554
|
termsOfService,
|
|
1255
1555
|
updatedAt,
|
|
1556
|
+
userType,
|
|
1256
1557
|
verificationId,
|
|
1257
1558
|
}) {
|
|
1258
1559
|
this.setAddress = address;
|
|
@@ -1284,6 +1585,7 @@ class User {
|
|
|
1284
1585
|
this.status = data.enumValueFromString(data.UserStatus, status);
|
|
1285
1586
|
this.setTerms = termsOfService;
|
|
1286
1587
|
this.updatedAt = data.dateToUTC(updatedAt);
|
|
1588
|
+
this.userType = userType;
|
|
1287
1589
|
this.verificationId = verificationId;
|
|
1288
1590
|
}
|
|
1289
1591
|
|
|
@@ -1293,7 +1595,7 @@ class User {
|
|
|
1293
1595
|
|
|
1294
1596
|
set setAddress(value) {
|
|
1295
1597
|
if (!value) return;
|
|
1296
|
-
this._address =
|
|
1598
|
+
this._address = vulnerableActivity.Address.fromObject(value);
|
|
1297
1599
|
}
|
|
1298
1600
|
|
|
1299
1601
|
get proofOfAddress() {
|
|
@@ -1302,7 +1604,7 @@ class User {
|
|
|
1302
1604
|
|
|
1303
1605
|
set setProofOfAddress(value) {
|
|
1304
1606
|
if (!value) return;
|
|
1305
|
-
this._proofOfAddress =
|
|
1607
|
+
this._proofOfAddress = vulnerableActivity.KYCFile.fromObject(value);
|
|
1306
1608
|
}
|
|
1307
1609
|
|
|
1308
1610
|
get proofOfLife() {
|
|
@@ -1311,7 +1613,7 @@ class User {
|
|
|
1311
1613
|
|
|
1312
1614
|
set setProofOfLife(value) {
|
|
1313
1615
|
if (!value) return;
|
|
1314
|
-
this._proofOfLife =
|
|
1616
|
+
this._proofOfLife = vulnerableActivity.KYCFile.fromObject(value);
|
|
1315
1617
|
}
|
|
1316
1618
|
|
|
1317
1619
|
get govtId() {
|
|
@@ -1320,7 +1622,7 @@ class User {
|
|
|
1320
1622
|
|
|
1321
1623
|
set setGovtId(value) {
|
|
1322
1624
|
if (!value) return;
|
|
1323
|
-
this._govtId =
|
|
1625
|
+
this._govtId = vulnerableActivity.KYCFile.fromObject(value);
|
|
1324
1626
|
}
|
|
1325
1627
|
|
|
1326
1628
|
get termsOfService() {
|
|
@@ -1329,7 +1631,7 @@ class User {
|
|
|
1329
1631
|
|
|
1330
1632
|
set setTerms(value) {
|
|
1331
1633
|
if (!value) return;
|
|
1332
|
-
this._termsOfService =
|
|
1634
|
+
this._termsOfService = vulnerableActivity.TOSAgreements.fromObject(value);
|
|
1333
1635
|
}
|
|
1334
1636
|
|
|
1335
1637
|
get curpDocument() {
|
|
@@ -1338,7 +1640,7 @@ class User {
|
|
|
1338
1640
|
|
|
1339
1641
|
set setCurpDoc(value) {
|
|
1340
1642
|
if (!value) return;
|
|
1341
|
-
this._curpDocument =
|
|
1643
|
+
this._curpDocument = vulnerableActivity.KYCFile.fromObject(value);
|
|
1342
1644
|
}
|
|
1343
1645
|
|
|
1344
1646
|
static fromObject = ({
|
|
@@ -1381,6 +1683,7 @@ class User {
|
|
|
1381
1683
|
stateOfBirth: obj.state_of_birth,
|
|
1382
1684
|
termsOfService: obj.terms_of_service,
|
|
1383
1685
|
updatedAt: obj.updated_at,
|
|
1686
|
+
userType: obj.user_type,
|
|
1384
1687
|
verificationId: obj.verification_id,
|
|
1385
1688
|
});
|
|
1386
1689
|
}
|
|
@@ -1566,6 +1869,7 @@ const getModelFromPath = (path, obj) => {
|
|
|
1566
1869
|
files: () => File.fromObject(obj),
|
|
1567
1870
|
kyc_validations: () => KYCValidations.fromObject(obj),
|
|
1568
1871
|
login_tokens: () => LoginToken.fromObject(obj),
|
|
1872
|
+
partners: () => Partner.fromObject(obj),
|
|
1569
1873
|
savings: () => Saving.fromObject(obj),
|
|
1570
1874
|
service_providers: () => ServiceProvider.fromObject(obj),
|
|
1571
1875
|
sessions: () => Session.fromObject(obj),
|
|
@@ -1725,7 +2029,7 @@ const Queryable = (SuperClass) =>
|
|
|
1725
2029
|
|
|
1726
2030
|
class AccountResource extends mix(Resource).with(Queryable, Retrievable) {
|
|
1727
2031
|
constructor(client) {
|
|
1728
|
-
super('accounts',
|
|
2032
|
+
super('accounts', vulnerableActivity.AccountQuery, client);
|
|
1729
2033
|
}
|
|
1730
2034
|
}
|
|
1731
2035
|
|
|
@@ -1736,7 +2040,7 @@ class AlertResource extends mix(Resource).with(
|
|
|
1736
2040
|
Updateable,
|
|
1737
2041
|
) {
|
|
1738
2042
|
constructor(client) {
|
|
1739
|
-
super('alerts',
|
|
2043
|
+
super('alerts', vulnerableActivity.AlertQuery, client);
|
|
1740
2044
|
}
|
|
1741
2045
|
|
|
1742
2046
|
async create(...req) {
|
|
@@ -1760,7 +2064,7 @@ class ApiKeyResource extends mix(Resource).with(
|
|
|
1760
2064
|
Updateable,
|
|
1761
2065
|
) {
|
|
1762
2066
|
constructor(client) {
|
|
1763
|
-
super('api_keys',
|
|
2067
|
+
super('api_keys', vulnerableActivity.ApiKeyQuery, client);
|
|
1764
2068
|
}
|
|
1765
2069
|
|
|
1766
2070
|
async create() {
|
|
@@ -1814,7 +2118,7 @@ class ArpcResource extends mix(Resource).with(Creatable) {
|
|
|
1814
2118
|
|
|
1815
2119
|
class BalanceEntryResource extends mix(Resource).with(Queryable, Retrievable) {
|
|
1816
2120
|
constructor(client) {
|
|
1817
|
-
super('balance_entries',
|
|
2121
|
+
super('balance_entries', vulnerableActivity.BalanceEntryQuery, client);
|
|
1818
2122
|
}
|
|
1819
2123
|
|
|
1820
2124
|
async relatedTransaction(relatedTransactionUri) {
|
|
@@ -1840,7 +2144,7 @@ class BalanceEntryResource extends mix(Resource).with(Queryable, Retrievable) {
|
|
|
1840
2144
|
|
|
1841
2145
|
class BillPaymentResource extends mix(Resource).with(Queryable, Retrievable) {
|
|
1842
2146
|
constructor(client) {
|
|
1843
|
-
super('bill_payments',
|
|
2147
|
+
super('bill_payments', vulnerableActivity.BillPaymentQuery, client);
|
|
1844
2148
|
}
|
|
1845
2149
|
|
|
1846
2150
|
async serviceProvider(providerUri) {
|
|
@@ -1858,7 +2162,7 @@ class BridegAccountResource extends mix(Resource).with(
|
|
|
1858
2162
|
Retrievable,
|
|
1859
2163
|
) {
|
|
1860
2164
|
constructor(client) {
|
|
1861
|
-
super('bridge/accounts',
|
|
2165
|
+
super('bridge/accounts', vulnerableActivity.BridgeAccountQuery, client);
|
|
1862
2166
|
}
|
|
1863
2167
|
|
|
1864
2168
|
async update({ userId = 'me', ...req }) {
|
|
@@ -1873,13 +2177,13 @@ class BridgeBankAccountResource extends mix(Resource).with(
|
|
|
1873
2177
|
Retrievable,
|
|
1874
2178
|
) {
|
|
1875
2179
|
constructor(client) {
|
|
1876
|
-
super('bridge/bank_accounts',
|
|
2180
|
+
super('bridge/bank_accounts', vulnerableActivity.BridgeBankAccountQuery, client);
|
|
1877
2181
|
}
|
|
1878
2182
|
}
|
|
1879
2183
|
|
|
1880
2184
|
class BridgeClabeResource extends mix(Resource).with(Queryable) {
|
|
1881
2185
|
constructor(client) {
|
|
1882
|
-
super('bridge/clabes',
|
|
2186
|
+
super('bridge/clabes', vulnerableActivity.BridgeQuery, client);
|
|
1883
2187
|
}
|
|
1884
2188
|
}
|
|
1885
2189
|
|
|
@@ -1888,7 +2192,7 @@ class BridgeTransactionResource extends mix(Resource).with(
|
|
|
1888
2192
|
Retrievable,
|
|
1889
2193
|
) {
|
|
1890
2194
|
constructor(client) {
|
|
1891
|
-
super('bridge/transactions',
|
|
2195
|
+
super('bridge/transactions', vulnerableActivity.BridgeTransactionQuery, client);
|
|
1892
2196
|
}
|
|
1893
2197
|
}
|
|
1894
2198
|
|
|
@@ -1918,7 +2222,7 @@ class CardResource extends mix(Resource).with(
|
|
|
1918
2222
|
Updateable,
|
|
1919
2223
|
) {
|
|
1920
2224
|
constructor(client) {
|
|
1921
|
-
super('cards',
|
|
2225
|
+
super('cards', vulnerableActivity.CardsQuery, client);
|
|
1922
2226
|
}
|
|
1923
2227
|
|
|
1924
2228
|
async create(userId, issuer, fundingType) {
|
|
@@ -1944,7 +2248,7 @@ class CardTransactionResource extends mix(Resource).with(
|
|
|
1944
2248
|
Retrievable,
|
|
1945
2249
|
) {
|
|
1946
2250
|
constructor(client) {
|
|
1947
|
-
super('card_transactions',
|
|
2251
|
+
super('card_transactions', vulnerableActivity.CardTransactionQuery, client);
|
|
1948
2252
|
}
|
|
1949
2253
|
|
|
1950
2254
|
async relatedCard(relatedCardUri) {
|
|
@@ -1996,7 +2300,7 @@ class CardValidationResource extends mix(Resource).with(Creatable) {
|
|
|
1996
2300
|
|
|
1997
2301
|
class CommissionResource extends mix(Resource).with(Queryable, Retrievable) {
|
|
1998
2302
|
constructor(client) {
|
|
1999
|
-
super('commissions',
|
|
2303
|
+
super('commissions', vulnerableActivity.QueryParams, client);
|
|
2000
2304
|
}
|
|
2001
2305
|
|
|
2002
2306
|
async relatedTransaction(relatedTransactionUri) {
|
|
@@ -2010,7 +2314,7 @@ class CommissionResource extends mix(Resource).with(Queryable, Retrievable) {
|
|
|
2010
2314
|
|
|
2011
2315
|
class DepositResource extends mix(Resource).with(Queryable, Retrievable) {
|
|
2012
2316
|
constructor(client) {
|
|
2013
|
-
super('deposits',
|
|
2317
|
+
super('deposits', vulnerableActivity.DepositQuery, client);
|
|
2014
2318
|
}
|
|
2015
2319
|
|
|
2016
2320
|
async source(sourceUri) {
|
|
@@ -2071,6 +2375,29 @@ class LoginTokenResource extends mix(Resource).with(Creatable) {
|
|
|
2071
2375
|
}
|
|
2072
2376
|
}
|
|
2073
2377
|
|
|
2378
|
+
class PartnerResource extends mix(Resource).with(
|
|
2379
|
+
Creatable,
|
|
2380
|
+
Queryable,
|
|
2381
|
+
Updateable,
|
|
2382
|
+
Retrievable,
|
|
2383
|
+
) {
|
|
2384
|
+
constructor(client) {
|
|
2385
|
+
super('partners', vulnerableActivity.QueryParams, client);
|
|
2386
|
+
}
|
|
2387
|
+
|
|
2388
|
+
async create({ ...req }) {
|
|
2389
|
+
const request = new walletTransactionRequest.PartnerUserRequest(req);
|
|
2390
|
+
const moral = await this._create(request.toObect());
|
|
2391
|
+
return moral;
|
|
2392
|
+
}
|
|
2393
|
+
|
|
2394
|
+
async update({ userId = 'me', ...req }) {
|
|
2395
|
+
const request = new walletTransactionRequest.PartnerUserRequest(req);
|
|
2396
|
+
const moral = await this._update(userId, request.toObject());
|
|
2397
|
+
return moral;
|
|
2398
|
+
}
|
|
2399
|
+
}
|
|
2400
|
+
|
|
2074
2401
|
class SavingResource extends mix(Resource).with(
|
|
2075
2402
|
Creatable,
|
|
2076
2403
|
Deactivable,
|
|
@@ -2079,7 +2406,7 @@ class SavingResource extends mix(Resource).with(
|
|
|
2079
2406
|
Updateable,
|
|
2080
2407
|
) {
|
|
2081
2408
|
constructor(client) {
|
|
2082
|
-
super('savings',
|
|
2409
|
+
super('savings', vulnerableActivity.WalletQuery, client);
|
|
2083
2410
|
}
|
|
2084
2411
|
|
|
2085
2412
|
async create(category, goalAmount, goalDate, name) {
|
|
@@ -2105,7 +2432,7 @@ class ServiceProviderResource extends mix(Resource).with(
|
|
|
2105
2432
|
Retrievable,
|
|
2106
2433
|
) {
|
|
2107
2434
|
constructor(client) {
|
|
2108
|
-
super('service_providers',
|
|
2435
|
+
super('service_providers', vulnerableActivity.QueryParams, client);
|
|
2109
2436
|
}
|
|
2110
2437
|
}
|
|
2111
2438
|
|
|
@@ -2134,7 +2461,7 @@ class SessionResource extends mix(Resource).with(
|
|
|
2134
2461
|
|
|
2135
2462
|
class StatementResource extends mix(Resource).with(Downlodable, Queryable) {
|
|
2136
2463
|
constructor(client) {
|
|
2137
|
-
super('statements',
|
|
2464
|
+
super('statements', vulnerableActivity.StatementQuery, client);
|
|
2138
2465
|
}
|
|
2139
2466
|
|
|
2140
2467
|
async pdf(id) {
|
|
@@ -2154,7 +2481,7 @@ class TransferResource extends mix(Resource).with(
|
|
|
2154
2481
|
Retrievable,
|
|
2155
2482
|
) {
|
|
2156
2483
|
constructor(client) {
|
|
2157
|
-
super('transfers',
|
|
2484
|
+
super('transfers', vulnerableActivity.TransferQuery, client);
|
|
2158
2485
|
}
|
|
2159
2486
|
|
|
2160
2487
|
async destination(destinationUri) {
|
|
@@ -2280,7 +2607,7 @@ class UserResourse extends mix(Resource).with(
|
|
|
2280
2607
|
Retrievable,
|
|
2281
2608
|
) {
|
|
2282
2609
|
constructor(client) {
|
|
2283
|
-
super('users',
|
|
2610
|
+
super('users', vulnerableActivity.UserQuery, client);
|
|
2284
2611
|
}
|
|
2285
2612
|
|
|
2286
2613
|
async update({ userId = 'me', ...req }) {
|
|
@@ -2314,7 +2641,7 @@ class WalletTransactionsResource extends mix(Resource).with(
|
|
|
2314
2641
|
Retrievable,
|
|
2315
2642
|
) {
|
|
2316
2643
|
constructor(client) {
|
|
2317
|
-
super('wallet_transactions',
|
|
2644
|
+
super('wallet_transactions', vulnerableActivity.WalletTransactionQuery, client);
|
|
2318
2645
|
}
|
|
2319
2646
|
|
|
2320
2647
|
async create(amount, transactionType, walletUri) {
|
|
@@ -2341,7 +2668,7 @@ class WhatsAppTransferResource extends mix(Resource).with(
|
|
|
2341
2668
|
Retrievable,
|
|
2342
2669
|
) {
|
|
2343
2670
|
constructor(client) {
|
|
2344
|
-
super('whatsapp_transfers',
|
|
2671
|
+
super('whatsapp_transfers', vulnerableActivity.QueryParams, client);
|
|
2345
2672
|
}
|
|
2346
2673
|
|
|
2347
2674
|
async accountDestination(destinationUri) {
|
|
@@ -2385,6 +2712,7 @@ class Cuenca {
|
|
|
2385
2712
|
this.files = new FileResource(client);
|
|
2386
2713
|
this.kycValidations = new KYCValidationsResource(client);
|
|
2387
2714
|
this.loginTokens = new LoginTokenResource(client);
|
|
2715
|
+
this.partners = new PartnerResource(client);
|
|
2388
2716
|
this.savings = new SavingResource(client);
|
|
2389
2717
|
this.serviceProviders = new ServiceProviderResource(client);
|
|
2390
2718
|
this.sessions = new SessionResource(client);
|