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