@cuenca-mx/cuenca-js 1.0.1 → 1.0.3

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.
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var errors_index = require('./errors/index.cjs');
4
- var data = require('./data-6a1372ed.cjs');
4
+ var data = require('./data-05e6356c.cjs');
5
5
 
6
6
  class BaseRequest {
7
7
  toObject() {
@@ -409,42 +409,6 @@ class KYCValidationsRequest extends BaseRequest {
409
409
  }
410
410
  }
411
411
 
412
- class TosUpdateRequest extends BaseRequest {
413
- constructor({ ip, location, type, version }) {
414
- super();
415
- this.ipAddress = ip;
416
- this.location = location;
417
- this.type = type;
418
- this.version = version;
419
- }
420
-
421
- get ip() {
422
- return this._ip;
423
- }
424
-
425
- set ipAddress(value) {
426
- if (!value) throw new errors_index.ValidationError('missing ip address');
427
- const ipBlocks = value.split('.');
428
- const blocks = ipBlocks.every((block) => {
429
- return block >= 0 && block <= 255;
430
- });
431
- if (blocks) {
432
- this._ip = value;
433
- } else {
434
- throw new errors_index.ValidationError('Invalid ip address');
435
- }
436
- }
437
-
438
- toObject() {
439
- return {
440
- ip: this.ip,
441
- location: this.location,
442
- type: this.type,
443
- version: this.version,
444
- };
445
- }
446
- }
447
-
448
412
  class AddressUpdateRequest extends BaseRequest {
449
413
  constructor({
450
414
  city,
@@ -454,6 +418,7 @@ class AddressUpdateRequest extends BaseRequest {
454
418
  fullName,
455
419
  intNumber,
456
420
  postalCode,
421
+ postalCodeId,
457
422
  state,
458
423
  street,
459
424
  } = {}) {
@@ -465,6 +430,7 @@ class AddressUpdateRequest extends BaseRequest {
465
430
  this.fullName = fullName;
466
431
  this.intNumber = intNumber;
467
432
  this.postalCode = postalCode;
433
+ this.postalCodeId = postalCodeId;
468
434
  this.state = state;
469
435
  this.street = street;
470
436
  }
@@ -478,134 +444,13 @@ class AddressUpdateRequest extends BaseRequest {
478
444
  full_name: this.fullName,
479
445
  int_number: this.intNumber,
480
446
  postal_code: this.postalCode,
447
+ postal_code_id: this.postalCodeId,
481
448
  state: this.state,
482
449
  street: this.street,
483
450
  };
484
451
  }
485
452
  }
486
453
 
487
- class KycFileRequest extends BaseRequest {
488
- constructor({ data, isMx, status, type, uriBack, uriFront }) {
489
- super();
490
- this.data = data;
491
- this.isMx = isMx;
492
- this.status = status;
493
- this.type = type;
494
- this.uriBack = uriBack;
495
- this.uriFront = uriFront;
496
- }
497
-
498
- toObject() {
499
- return {
500
- data: this.data,
501
- is_mx: this.isMx,
502
- status: this.status,
503
- type: this.type,
504
- uri_back: this.uriBack,
505
- uri_front: this.uriFront,
506
- };
507
- }
508
- }
509
-
510
- class UserUpdateRequest extends BaseRequest {
511
- constructor({
512
- address,
513
- curpDocumentUri,
514
- govtId,
515
- emailAddress,
516
- profession,
517
- proofOfAddress,
518
- proofOfLife,
519
- requiredLevel,
520
- termsOfService,
521
- phoneNumber,
522
- rfc,
523
- status,
524
- userType,
525
- verificationId,
526
- }) {
527
- super();
528
- this.addressProofs = proofOfAddress;
529
- this.adrs = address;
530
- this.curpDocumentUri = curpDocumentUri;
531
- this.emailAddress = emailAddress;
532
- this.govstIds = govtId;
533
- this.lifeProofs = proofOfLife;
534
- this.profession = profession;
535
- this.phoneNumber = phoneNumber;
536
- this.requiredLevel = requiredLevel;
537
- this.termsOfService = termsOfService;
538
- this.rfc = rfc;
539
- this.status = status;
540
- this.userType = userType;
541
- this.verificationId = verificationId;
542
- }
543
-
544
- get termsOfService() {
545
- return this._termsOfService;
546
- }
547
-
548
- set termsOfService(value) {
549
- if (!value) return;
550
- this._termsOfService = new TosUpdateRequest(value).toObject();
551
- }
552
-
553
- get address() {
554
- return this._address;
555
- }
556
-
557
- set adrs(value) {
558
- if (!value) return;
559
- this._address = new AddressUpdateRequest(value).toCleanObject();
560
- }
561
-
562
- get proofOfLife() {
563
- return this._proofOfLife;
564
- }
565
-
566
- set lifeProofs(value) {
567
- if (!value) return;
568
- this._proofOfLife = new KycFileRequest(value).toCleanObject();
569
- }
570
-
571
- get proofOfAddress() {
572
- return this._proofOfAddress;
573
- }
574
-
575
- set addressProofs(value) {
576
- if (!value) return;
577
- this._proofOfAddress = new KycFileRequest(value).toCleanObject();
578
- }
579
-
580
- get govtId() {
581
- return this._govtId;
582
- }
583
-
584
- set govstIds(value) {
585
- if (!value) return;
586
- this._govtId = new KycFileRequest(value).toCleanObject();
587
- }
588
-
589
- toObject() {
590
- return {
591
- address: this.address,
592
- curp_document_uri: this.curpDocumentUri,
593
- email_address: this.emailAddress,
594
- govt_id: this.govtId,
595
- phone_number: this.phoneNumber,
596
- profession: this.profession,
597
- proof_of_life: this.proofOfLife,
598
- proof_of_address: this.proofOfAddress,
599
- requiredLevel: this.requiredLevel,
600
- rfc: this.rfc,
601
- status: this.status,
602
- terms_of_service: this.termsOfService,
603
- verification_id: this.verificationId,
604
- user_type: this.userType,
605
- };
606
- }
607
- }
608
-
609
454
  class TransactionalProfileServicesRequest extends BaseRequest {
610
455
  constructor({
611
456
  speiTransfersNum,
@@ -1247,6 +1092,163 @@ class UserLoginRequest extends BaseRequest {
1247
1092
  }
1248
1093
  }
1249
1094
 
1095
+ class TosUpdateRequest extends BaseRequest {
1096
+ constructor({ ip, location, type, version }) {
1097
+ super();
1098
+ this.ipAddress = ip;
1099
+ this.location = location;
1100
+ this.type = type;
1101
+ this.version = version;
1102
+ }
1103
+
1104
+ get ip() {
1105
+ return this._ip;
1106
+ }
1107
+
1108
+ set ipAddress(value) {
1109
+ if (!value) throw new errors_index.ValidationError('missing ip address');
1110
+ const ipBlocks = value.split('.');
1111
+ const blocks = ipBlocks.every((block) => {
1112
+ return block >= 0 && block <= 255;
1113
+ });
1114
+ if (blocks) {
1115
+ this._ip = value;
1116
+ } else {
1117
+ throw new errors_index.ValidationError('Invalid ip address');
1118
+ }
1119
+ }
1120
+
1121
+ toObject() {
1122
+ return {
1123
+ ip: this.ip,
1124
+ location: this.location,
1125
+ type: this.type,
1126
+ version: this.version,
1127
+ };
1128
+ }
1129
+ }
1130
+
1131
+ class KycFileRequest extends BaseRequest {
1132
+ constructor({ data, isMx, status, type, uriBack, uriFront }) {
1133
+ super();
1134
+ this.data = data;
1135
+ this.isMx = isMx;
1136
+ this.status = status;
1137
+ this.type = type;
1138
+ this.uriBack = uriBack;
1139
+ this.uriFront = uriFront;
1140
+ }
1141
+
1142
+ toObject() {
1143
+ return {
1144
+ data: this.data,
1145
+ is_mx: this.isMx,
1146
+ status: this.status,
1147
+ type: this.type,
1148
+ uri_back: this.uriBack,
1149
+ uri_front: this.uriFront,
1150
+ };
1151
+ }
1152
+ }
1153
+ class UserUpdateRequest extends BaseRequest {
1154
+ constructor({
1155
+ address,
1156
+ curpDocumentUri,
1157
+ govtId,
1158
+ emailAddress,
1159
+ profession,
1160
+ proofOfAddress,
1161
+ proofOfLife,
1162
+ requiredLevel,
1163
+ termsOfService,
1164
+ phoneNumber,
1165
+ rfc,
1166
+ status,
1167
+ userType,
1168
+ verificationId,
1169
+ }) {
1170
+ super();
1171
+ this.addressProofs = proofOfAddress;
1172
+ this.adrs = address;
1173
+ this.curpDocumentUri = curpDocumentUri;
1174
+ this.emailAddress = emailAddress;
1175
+ this.govstIds = govtId;
1176
+ this.lifeProofs = proofOfLife;
1177
+ this.profession = profession;
1178
+ this.phoneNumber = phoneNumber;
1179
+ this.requiredLevel = requiredLevel;
1180
+ this.termsOfService = termsOfService;
1181
+ this.rfc = rfc;
1182
+ this.status = status;
1183
+ this.userType = userType;
1184
+ this.verificationId = verificationId;
1185
+ }
1186
+
1187
+ get termsOfService() {
1188
+ return this._termsOfService;
1189
+ }
1190
+
1191
+ set termsOfService(value) {
1192
+ if (!value) return;
1193
+ this._termsOfService = new TosUpdateRequest(value).toObject();
1194
+ }
1195
+
1196
+ get address() {
1197
+ return this._address;
1198
+ }
1199
+
1200
+ set adrs(value) {
1201
+ if (!value) return;
1202
+ this._address = new AddressUpdateRequest(value).toCleanObject();
1203
+ }
1204
+
1205
+ get proofOfLife() {
1206
+ return this._proofOfLife;
1207
+ }
1208
+
1209
+ set lifeProofs(value) {
1210
+ if (!value) return;
1211
+ this._proofOfLife = new KycFileRequest(value).toCleanObject();
1212
+ }
1213
+
1214
+ get proofOfAddress() {
1215
+ return this._proofOfAddress;
1216
+ }
1217
+
1218
+ set addressProofs(value) {
1219
+ if (!value) return;
1220
+ this._proofOfAddress = new KycFileRequest(value).toCleanObject();
1221
+ }
1222
+
1223
+ get govtId() {
1224
+ return this._govtId;
1225
+ }
1226
+
1227
+ set govstIds(value) {
1228
+ if (!value) return;
1229
+ this._govtId = new KycFileRequest(value).toCleanObject();
1230
+ }
1231
+
1232
+ toObject() {
1233
+ return {
1234
+ address: this.address,
1235
+ curp_document_uri: this.curpDocumentUri,
1236
+ email_address: this.emailAddress,
1237
+ govt_id: this.govtId,
1238
+ phone_number: this.phoneNumber,
1239
+ profession: this.profession,
1240
+ proof_of_life: this.proofOfLife,
1241
+ proof_of_address: this.proofOfAddress,
1242
+ requiredLevel: this.requiredLevel,
1243
+ rfc: this.rfc,
1244
+ status: this.status,
1245
+ terms_of_service: this.termsOfService,
1246
+ verification_id: this.verificationId,
1247
+ user_type: this.userType,
1248
+ };
1249
+ }
1250
+ }
1251
+
1250
1252
  class VerificationRequest extends BaseRequest {
1251
1253
  constructor({ platformId, recipient, type }) {
1252
1254
  super();
@@ -1327,6 +1329,7 @@ class WalletTransactionRequest extends BaseRequest {
1327
1329
  }
1328
1330
  }
1329
1331
 
1332
+ exports.AddressUpdateRequest = AddressUpdateRequest;
1330
1333
  exports.AlertUpdateRequest = AlertUpdateRequest;
1331
1334
  exports.ApiKeyUpdateRequest = ApiKeyUpdateRequest;
1332
1335
  exports.ArpcRequest = ArpcRequest;