@cuenca-mx/cuenca-js 0.0.14-dev14 → 0.0.14-dev16
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/index.cjs +10 -11
- package/build/index.mjs +10 -11
- package/build/requests/index.cjs +1 -2
- package/build/requests/index.mjs +2 -3
- package/build/types/index.cjs +1 -2
- package/build/types/index.mjs +1 -2
- package/build/umd/cuenca.umd.js +1 -1
- package/build/{vulnerableActivity-59447f0d.cjs → vulnerableActivity-88dfbcae.cjs} +33 -3
- package/build/{vulnerableActivity-06ee32f1.mjs → vulnerableActivity-f14186ae.mjs} +33 -3
- package/build/{walletTransactionRequest-a1dd48ce.mjs → walletTransactionRequest-9f750f1b.mjs} +559 -202
- package/build/{walletTransactionRequest-75d84011.cjs → walletTransactionRequest-eccf98d1.cjs} +559 -202
- package/package.json +3 -2
package/build/{walletTransactionRequest-a1dd48ce.mjs → walletTransactionRequest-9f750f1b.mjs}
RENAMED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ValidationError } from './errors/index.mjs';
|
|
2
2
|
import { d as dateToUTC, e as enumValueFromString, s as VerificationType } from './data-fa5e8a84.mjs';
|
|
3
|
-
import 'constants';
|
|
4
3
|
|
|
5
4
|
class BaseRequest {
|
|
6
5
|
toObject() {
|
|
@@ -408,13 +407,475 @@ class KYCValidationsRequest extends BaseRequest {
|
|
|
408
407
|
}
|
|
409
408
|
}
|
|
410
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
|
+
class AddressUpdateRequest extends BaseRequest {
|
|
447
|
+
constructor({
|
|
448
|
+
city,
|
|
449
|
+
colonia,
|
|
450
|
+
country,
|
|
451
|
+
extNumber,
|
|
452
|
+
fullName,
|
|
453
|
+
intNumber,
|
|
454
|
+
postalCode,
|
|
455
|
+
state,
|
|
456
|
+
street,
|
|
457
|
+
} = {}) {
|
|
458
|
+
super();
|
|
459
|
+
this.city = city;
|
|
460
|
+
this.colonia = colonia;
|
|
461
|
+
this.country = country;
|
|
462
|
+
this.extNumber = extNumber;
|
|
463
|
+
this.fullName = fullName;
|
|
464
|
+
this.intNumber = intNumber;
|
|
465
|
+
this.postalCode = postalCode;
|
|
466
|
+
this.state = state;
|
|
467
|
+
this.street = street;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
toObject() {
|
|
471
|
+
return {
|
|
472
|
+
city: this.city,
|
|
473
|
+
colonia: this.colonia,
|
|
474
|
+
country: this.country,
|
|
475
|
+
ext_number: this.extNumber,
|
|
476
|
+
full_name: this.fullName,
|
|
477
|
+
int_number: this.intNumber,
|
|
478
|
+
postal_code: this.postalCode,
|
|
479
|
+
state: this.state,
|
|
480
|
+
street: this.street,
|
|
481
|
+
};
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
|
|
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
|
+
profession,
|
|
514
|
+
proofOfAddress,
|
|
515
|
+
proofOfLife,
|
|
516
|
+
requiredLevel,
|
|
517
|
+
termsOfService,
|
|
518
|
+
phoneNumber,
|
|
519
|
+
rfc,
|
|
520
|
+
userType,
|
|
521
|
+
verificationId,
|
|
522
|
+
}) {
|
|
523
|
+
super();
|
|
524
|
+
this.addressProofs = proofOfAddress;
|
|
525
|
+
this.adrs = address;
|
|
526
|
+
this.curpDocumentUri = curpDocumentUri;
|
|
527
|
+
this.govstIds = govtId;
|
|
528
|
+
this.lifeProofs = proofOfLife;
|
|
529
|
+
this.profession = profession;
|
|
530
|
+
this.phoneNumber = phoneNumber;
|
|
531
|
+
this.requiredLevel = requiredLevel;
|
|
532
|
+
this.termsOfService = termsOfService;
|
|
533
|
+
this.rfc = rfc;
|
|
534
|
+
this.userType = userType;
|
|
535
|
+
this.verificationId = verificationId;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
get termsOfService() {
|
|
539
|
+
return this._termsOfService;
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
set termsOfService(value) {
|
|
543
|
+
if (!value) return;
|
|
544
|
+
this._termsOfService = new TosUpdateRequest(value).toObject();
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
get address() {
|
|
548
|
+
return this._address;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
set adrs(value) {
|
|
552
|
+
if (!value) return;
|
|
553
|
+
this._address = new AddressUpdateRequest(value).toCleanObject();
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
get proofOfLife() {
|
|
557
|
+
return this._proofOfLife;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
set lifeProofs(value) {
|
|
561
|
+
if (!value) return;
|
|
562
|
+
this._proofOfLife = new KycFileRequest(value).toCleanObject();
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
get proofOfAddress() {
|
|
566
|
+
return this._proofOfAddress;
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
set addressProofs(value) {
|
|
570
|
+
if (!value) return;
|
|
571
|
+
this._proofOfAddress = new KycFileRequest(value).toCleanObject();
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
get govtId() {
|
|
575
|
+
return this._govtId;
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
set govstIds(value) {
|
|
579
|
+
if (!value) return;
|
|
580
|
+
this._govtId = new KycFileRequest(value).toCleanObject();
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
toObject() {
|
|
584
|
+
return {
|
|
585
|
+
address: this.address,
|
|
586
|
+
curp_document_uri: this.curpDocumentUri,
|
|
587
|
+
govt_id: this.govtId,
|
|
588
|
+
phone_number: this.phoneNumber,
|
|
589
|
+
profession: this.profession,
|
|
590
|
+
proof_of_life: this.proofOfLife,
|
|
591
|
+
proof_of_address: this.proofOfAddress,
|
|
592
|
+
requiredLevel: this.requiredLevel,
|
|
593
|
+
rfc: this.rfc,
|
|
594
|
+
terms_of_service: this.termsOfService,
|
|
595
|
+
verification_id: this.verificationId,
|
|
596
|
+
user_type: this.userType,
|
|
597
|
+
};
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
class TransactionalProfileServicesRequest extends BaseRequest {
|
|
602
|
+
constructor({
|
|
603
|
+
speiTransfersNum,
|
|
604
|
+
speiTransfersAmount,
|
|
605
|
+
internalTransfersNum,
|
|
606
|
+
internalTransfersAmount,
|
|
607
|
+
}) {
|
|
608
|
+
super();
|
|
609
|
+
this.speiTransfersNum = speiTransfersNum;
|
|
610
|
+
this.speiTransfersAmount = speiTransfersAmount;
|
|
611
|
+
this.internalTransfersNum = internalTransfersNum;
|
|
612
|
+
this.internalTransfersAmount = internalTransfersAmount;
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
toObject() {
|
|
616
|
+
const response = {
|
|
617
|
+
spei_transfers_num: this.speiTransfersNum,
|
|
618
|
+
spei_transfers_amount: this.speiTransfersAmount,
|
|
619
|
+
internal_transfers_num: this.internalTransfersNum,
|
|
620
|
+
internal_transfers_amount: this.internalTransfersAmount,
|
|
621
|
+
};
|
|
622
|
+
return response;
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
class TransactionalProfileRequest {
|
|
627
|
+
constructor({
|
|
628
|
+
currency,
|
|
629
|
+
monthlyAmount,
|
|
630
|
+
recipientsNum,
|
|
631
|
+
payersNum,
|
|
632
|
+
deposits,
|
|
633
|
+
withdrawal,
|
|
634
|
+
}) {
|
|
635
|
+
this.currency = currency;
|
|
636
|
+
this.monthlyAmount = monthlyAmount;
|
|
637
|
+
|
|
638
|
+
this.recipientsNum = recipientsNum;
|
|
639
|
+
this.payersNum = payersNum;
|
|
640
|
+
|
|
641
|
+
this.setDeposits = deposits;
|
|
642
|
+
this.setWithdrawal = withdrawal;
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
get deposits() {
|
|
646
|
+
return this._deposits;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
set setDeposits(value) {
|
|
650
|
+
if (!value) return;
|
|
651
|
+
this._deposits = new TransactionalProfileServicesRequest(value).toObject();
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
get withdrawal() {
|
|
655
|
+
return this._withdrawal;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
set setWithdrawal(value) {
|
|
659
|
+
if (!value) return;
|
|
660
|
+
this._withdrawal = new TransactionalProfileServicesRequest(
|
|
661
|
+
value,
|
|
662
|
+
).toObject();
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
toObject() {
|
|
666
|
+
return {
|
|
667
|
+
currency: this.currency,
|
|
668
|
+
monthly_amount: this.monthlyAmount,
|
|
669
|
+
recipients_num: this.recipientsNum,
|
|
670
|
+
payers_num: this.payersNum,
|
|
671
|
+
deposits: this.deposits,
|
|
672
|
+
withdrawal: this.withdrawal,
|
|
673
|
+
};
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
class BusinessDetailsRequest extends BaseRequest {
|
|
678
|
+
constructor({ accountUsageDescription, businessDescription }) {
|
|
679
|
+
super();
|
|
680
|
+
this.accountUsageDescription = accountUsageDescription;
|
|
681
|
+
this.businessDescription = businessDescription;
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
toObject() {
|
|
685
|
+
return {
|
|
686
|
+
account_usage_description: this.accountUsageDescription,
|
|
687
|
+
business_description: this.businessDescription,
|
|
688
|
+
};
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
class ShareholderPhysicalRequest extends BaseRequest {
|
|
693
|
+
constructor({
|
|
694
|
+
names,
|
|
695
|
+
curp,
|
|
696
|
+
rfc,
|
|
697
|
+
firstSurname,
|
|
698
|
+
percentage,
|
|
699
|
+
secondSurname,
|
|
700
|
+
shareCapital,
|
|
701
|
+
}) {
|
|
702
|
+
super();
|
|
703
|
+
this.names = names;
|
|
704
|
+
this.curp = curp;
|
|
705
|
+
this.percentage = percentage;
|
|
706
|
+
this.rfc = rfc;
|
|
707
|
+
this.shareCapital = shareCapital;
|
|
708
|
+
this.firstSurname = firstSurname;
|
|
709
|
+
this.secondSurname = secondSurname;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
toObject() {
|
|
713
|
+
return {
|
|
714
|
+
curp: this.curp,
|
|
715
|
+
names: this.names,
|
|
716
|
+
percentage: this.percentage,
|
|
717
|
+
rfc: this.rfc,
|
|
718
|
+
share_capital: this.shareCapital,
|
|
719
|
+
first_surname: this.firstSurname,
|
|
720
|
+
second_surname: this.secondSurname,
|
|
721
|
+
};
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
class LegalRepresentativesRequest extends ShareholderPhysicalRequest {
|
|
726
|
+
constructor({
|
|
727
|
+
address,
|
|
728
|
+
curp,
|
|
729
|
+
emailAddress,
|
|
730
|
+
firstSurname,
|
|
731
|
+
job,
|
|
732
|
+
names,
|
|
733
|
+
percentage,
|
|
734
|
+
phoneNumber,
|
|
735
|
+
rfc,
|
|
736
|
+
secondSurname,
|
|
737
|
+
}) {
|
|
738
|
+
super({ curp, firstSurname, names, percentage, rfc, secondSurname });
|
|
739
|
+
this.job = job;
|
|
740
|
+
this.phoneNumber = phoneNumber;
|
|
741
|
+
this.emailAddress = emailAddress;
|
|
742
|
+
this.setAddress = address;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
get address() {
|
|
746
|
+
return this._address;
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
set setAddress(value) {
|
|
750
|
+
if (!value) return;
|
|
751
|
+
this._address = new AddressUpdateRequest(value).toCleanObject();
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
toObject() {
|
|
755
|
+
return {
|
|
756
|
+
...super.toObject(),
|
|
757
|
+
job: this.job,
|
|
758
|
+
phone_number: this.phoneNumber,
|
|
759
|
+
email_address: this.emailAddress,
|
|
760
|
+
address: this.address,
|
|
761
|
+
};
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
class ShareholderMoralRequest extends BaseRequest {
|
|
766
|
+
constructor({ name, percentage, shareholders, legalRepresentatives }) {
|
|
767
|
+
super();
|
|
768
|
+
this.name = name;
|
|
769
|
+
this.percentage = percentage;
|
|
770
|
+
this.setShareholders = shareholders;
|
|
771
|
+
this.setLegalRepresentatives = legalRepresentatives;
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
get shareholders() {
|
|
775
|
+
return this._shareholders;
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
set setShareholders(value) {
|
|
779
|
+
if (!value) return;
|
|
780
|
+
this._shareholders = value.map((sh) =>
|
|
781
|
+
new ShareholderPhysicalRequest(sh).toObject(),
|
|
782
|
+
);
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
get legalRepresentatives() {
|
|
786
|
+
return this._legalRepresentatives;
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
set setLegalRepresentatives(value) {
|
|
790
|
+
if (!value) return;
|
|
791
|
+
this._legalRepresentatives = value.map((lr) =>
|
|
792
|
+
new LegalRepresentativesRequest(lr).toObject(),
|
|
793
|
+
);
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
toObject() {
|
|
797
|
+
return {
|
|
798
|
+
name: this.name,
|
|
799
|
+
percentage: this.percentage,
|
|
800
|
+
shareholders: this.shareholders,
|
|
801
|
+
legal_representatives: this.legalRepresentatives,
|
|
802
|
+
};
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
class VulnerableActivityRequest extends BaseRequest {
|
|
807
|
+
constructor({
|
|
808
|
+
isVulnerableActivity,
|
|
809
|
+
hasSatRegister,
|
|
810
|
+
satRegisteredDate,
|
|
811
|
+
isInCompliance,
|
|
812
|
+
}) {
|
|
813
|
+
super();
|
|
814
|
+
this.isVulnerableActivity = isVulnerableActivity;
|
|
815
|
+
this.hasSatRegister = hasSatRegister;
|
|
816
|
+
this.satRegisteredDate = satRegisteredDate;
|
|
817
|
+
this.isInCompliance = isInCompliance;
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
toObject() {
|
|
821
|
+
return {
|
|
822
|
+
is_vulnerable_activity: this.isVulnerableActivity,
|
|
823
|
+
has_sat_register: this.hasSatRegister,
|
|
824
|
+
sat_registered_date: this.satRegisteredDate,
|
|
825
|
+
is_in_compliance: this.isInCompliance,
|
|
826
|
+
};
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
class LicenseRequest extends BaseRequest {
|
|
831
|
+
constructor({
|
|
832
|
+
licenseRequired,
|
|
833
|
+
supervisoryEntity,
|
|
834
|
+
licenseType,
|
|
835
|
+
licenseDate,
|
|
836
|
+
}) {
|
|
837
|
+
super();
|
|
838
|
+
this.licenseRequired = licenseRequired;
|
|
839
|
+
this.supervisoryEntity = supervisoryEntity;
|
|
840
|
+
this.licenseType = licenseType;
|
|
841
|
+
this.licenseDate = licenseDate;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
toObject() {
|
|
845
|
+
return {
|
|
846
|
+
license_required: this.licenseRequired,
|
|
847
|
+
supervisory_entity: this.supervisoryEntity,
|
|
848
|
+
license_type: this.licenseType,
|
|
849
|
+
license_date: this.licenseDate,
|
|
850
|
+
};
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
class AuditRequest extends BaseRequest {
|
|
855
|
+
constructor({ hasAudit, auditProvider, auditDate, auditComments }) {
|
|
856
|
+
super();
|
|
857
|
+
this.hasAudit = hasAudit;
|
|
858
|
+
this.auditProvider = auditProvider;
|
|
859
|
+
this.auditDate = auditDate;
|
|
860
|
+
this.auditComments = auditComments;
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
toObject() {
|
|
864
|
+
return {
|
|
865
|
+
has_audit: this.hasAudit,
|
|
866
|
+
audit_provider: this.auditProvider,
|
|
867
|
+
audit_date: this.auditDate,
|
|
868
|
+
audit_comments: this.auditComments,
|
|
869
|
+
};
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
|
|
411
873
|
class PartnerUserRequest extends BaseRequest {
|
|
412
874
|
constructor({
|
|
413
875
|
address,
|
|
414
876
|
audit,
|
|
415
877
|
businessDetails,
|
|
416
878
|
businessName,
|
|
417
|
-
cert,
|
|
418
879
|
clabe,
|
|
419
880
|
createdAt,
|
|
420
881
|
documentationUrl,
|
|
@@ -428,9 +889,11 @@ class PartnerUserRequest extends BaseRequest {
|
|
|
428
889
|
level,
|
|
429
890
|
license,
|
|
430
891
|
meta,
|
|
892
|
+
nationality,
|
|
431
893
|
phoneNumber,
|
|
432
894
|
platformId,
|
|
433
895
|
requiredLevel,
|
|
896
|
+
rfc,
|
|
434
897
|
shareholders,
|
|
435
898
|
status,
|
|
436
899
|
transactionalProfile,
|
|
@@ -441,11 +904,10 @@ class PartnerUserRequest extends BaseRequest {
|
|
|
441
904
|
webSite,
|
|
442
905
|
} = {}) {
|
|
443
906
|
super(); // Asegúrate de pasar cualquier argumento necesario al constructor de la clase base, si es aplicable
|
|
444
|
-
this.
|
|
445
|
-
this.
|
|
446
|
-
this.
|
|
907
|
+
this.adrs = address;
|
|
908
|
+
this.auditMap = audit;
|
|
909
|
+
this.businessDetailsMap = businessDetails;
|
|
447
910
|
this.businessName = businessName;
|
|
448
|
-
this.cert = cert;
|
|
449
911
|
this.clabe = clabe;
|
|
450
912
|
this.createdAt = createdAt;
|
|
451
913
|
this.documentationUrl = documentationUrl;
|
|
@@ -455,30 +917,109 @@ class PartnerUserRequest extends BaseRequest {
|
|
|
455
917
|
this.id = id;
|
|
456
918
|
this.incorporationDate = incorporationDate;
|
|
457
919
|
this.legalName = legalName;
|
|
458
|
-
this.
|
|
920
|
+
this.legalRepresentativesMap = legalRepresentatives; // Asegúrate de manejar correctamente las listas de objetos
|
|
459
921
|
this.level = level;
|
|
460
|
-
this.
|
|
922
|
+
this.licenseMap = license;
|
|
461
923
|
this.meta = meta;
|
|
924
|
+
this.nationality = nationality;
|
|
462
925
|
this.phoneNumber = phoneNumber;
|
|
463
926
|
this.platformId = platformId;
|
|
464
927
|
this.requiredLevel = requiredLevel;
|
|
465
|
-
this.
|
|
928
|
+
this.rfc = rfc;
|
|
929
|
+
this.shareholdersMap = shareholders;
|
|
466
930
|
this.status = status;
|
|
467
|
-
this.
|
|
931
|
+
this.transactionalProfileMap = transactionalProfile;
|
|
468
932
|
this.updatedAt = updatedAt;
|
|
469
933
|
this.userId = userId;
|
|
470
934
|
this.userType = userType;
|
|
471
|
-
this.
|
|
935
|
+
this.vulnerableActivitMAP = vulnerableActivity;
|
|
472
936
|
this.webSite = webSite;
|
|
473
937
|
}
|
|
474
938
|
|
|
939
|
+
get businessDetails() {
|
|
940
|
+
return this._businessDetails;
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
set businessDetailsMap(value) {
|
|
944
|
+
if (!value) return;
|
|
945
|
+
this._businessDetails = new BusinessDetailsRequest(value).toObject();
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
get address() {
|
|
949
|
+
return this._address;
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
set adrs(value) {
|
|
953
|
+
if (!value) return;
|
|
954
|
+
this._address = new AddressUpdateRequest(value).toCleanObject();
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
get transactionalProfile() {
|
|
958
|
+
return this._transactionalProfile;
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
set transactionalProfileMap(value) {
|
|
962
|
+
if (!value) return;
|
|
963
|
+
this._transactionalProfile = new TransactionalProfileRequest(
|
|
964
|
+
value,
|
|
965
|
+
).toObject();
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
get shareholders() {
|
|
969
|
+
return this._shareholders;
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
set shareholdersMap(value) {
|
|
973
|
+
if (!value) return;
|
|
974
|
+
this._shareholders = value.map((sh) =>
|
|
975
|
+
new ShareholderMoralRequest(sh).toObject(),
|
|
976
|
+
);
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
get legalRepresentatives() {
|
|
980
|
+
return this._legalRepresentatives;
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
set legalRepresentativesMap(value) {
|
|
984
|
+
if (!value) return;
|
|
985
|
+
this._legalRepresentatives = value.map((lr) =>
|
|
986
|
+
new LegalRepresentativesRequest(lr).toObject(),
|
|
987
|
+
);
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
get vulnerableActivity() {
|
|
991
|
+
return this._vulnerableActivity;
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
set vulnerableActivitMAP(value) {
|
|
995
|
+
if (!value) return;
|
|
996
|
+
this._vulnerableActivity = new VulnerableActivityRequest(value).toObject();
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
get license() {
|
|
1000
|
+
return this._license;
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
set licenseMap(value) {
|
|
1004
|
+
if (!value) return;
|
|
1005
|
+
this._license = new LicenseRequest(value).toObject();
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
get audit() {
|
|
1009
|
+
return this._audit;
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
set auditMap(value) {
|
|
1013
|
+
if (!value) return;
|
|
1014
|
+
this._audit = new AuditRequest(value).toObject();
|
|
1015
|
+
}
|
|
1016
|
+
|
|
475
1017
|
toObject() {
|
|
476
|
-
|
|
1018
|
+
const obj = {
|
|
477
1019
|
address: this.address,
|
|
478
1020
|
audit: this.audit,
|
|
479
1021
|
business_details: this.businessDetails,
|
|
480
1022
|
business_name: this.businessName,
|
|
481
|
-
cert: this.cert,
|
|
482
1023
|
clabe: this.clabe,
|
|
483
1024
|
created_at: this.createdAt,
|
|
484
1025
|
documentation_url: this.documentationUrl,
|
|
@@ -488,16 +1029,16 @@ class PartnerUserRequest extends BaseRequest {
|
|
|
488
1029
|
id: this.id,
|
|
489
1030
|
incorporation_date: this.incorporationDate,
|
|
490
1031
|
legal_name: this.legalName,
|
|
491
|
-
legal_representatives: this.legalRepresentatives
|
|
492
|
-
lr.toObject(),
|
|
493
|
-
),
|
|
1032
|
+
legal_representatives: this.legalRepresentatives,
|
|
494
1033
|
level: this.level,
|
|
495
1034
|
license: this.license,
|
|
496
1035
|
meta: this.meta,
|
|
1036
|
+
nationality: this.nationality,
|
|
497
1037
|
phone_number: this.phoneNumber,
|
|
498
1038
|
platform_id: this.platformId,
|
|
499
1039
|
required_level: this.requiredLevel,
|
|
500
|
-
|
|
1040
|
+
rfc: this.rfc,
|
|
1041
|
+
shareholders: this.shareholders,
|
|
501
1042
|
status: this.status,
|
|
502
1043
|
transactional_profile: this.transactionalProfile,
|
|
503
1044
|
updated_at: this.updatedAt,
|
|
@@ -506,6 +1047,7 @@ class PartnerUserRequest extends BaseRequest {
|
|
|
506
1047
|
vulnerable_activity: this.vulnerableActivity,
|
|
507
1048
|
web_site: this.webSite,
|
|
508
1049
|
};
|
|
1050
|
+
return obj;
|
|
509
1051
|
}
|
|
510
1052
|
}
|
|
511
1053
|
|
|
@@ -687,191 +1229,6 @@ class UserLoginRequest extends BaseRequest {
|
|
|
687
1229
|
}
|
|
688
1230
|
}
|
|
689
1231
|
|
|
690
|
-
class TosUpdateRequest extends BaseRequest {
|
|
691
|
-
constructor({ ip, location, type, version }) {
|
|
692
|
-
super();
|
|
693
|
-
this.ipAddress = ip;
|
|
694
|
-
this.location = location;
|
|
695
|
-
this.type = type;
|
|
696
|
-
this.version = version;
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
get ip() {
|
|
700
|
-
return this._ip;
|
|
701
|
-
}
|
|
702
|
-
|
|
703
|
-
set ipAddress(value) {
|
|
704
|
-
if (!value) throw new ValidationError('missing ip address');
|
|
705
|
-
const ipBlocks = value.split('.');
|
|
706
|
-
const blocks = ipBlocks.every((block) => {
|
|
707
|
-
return block >= 0 && block <= 255;
|
|
708
|
-
});
|
|
709
|
-
if (blocks) {
|
|
710
|
-
this._ip = value;
|
|
711
|
-
} else {
|
|
712
|
-
throw new ValidationError('Invalid ip address');
|
|
713
|
-
}
|
|
714
|
-
}
|
|
715
|
-
|
|
716
|
-
toObject() {
|
|
717
|
-
return {
|
|
718
|
-
ip: this.ip,
|
|
719
|
-
location: this.location,
|
|
720
|
-
type: this.type,
|
|
721
|
-
version: this.version,
|
|
722
|
-
};
|
|
723
|
-
}
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
class AddressUpdateRequest extends BaseRequest {
|
|
727
|
-
constructor({
|
|
728
|
-
city,
|
|
729
|
-
colonia,
|
|
730
|
-
country,
|
|
731
|
-
extNumber,
|
|
732
|
-
fullName,
|
|
733
|
-
intNumber,
|
|
734
|
-
postalCode,
|
|
735
|
-
state,
|
|
736
|
-
street,
|
|
737
|
-
} = {}) {
|
|
738
|
-
super();
|
|
739
|
-
this.city = city;
|
|
740
|
-
this.colonia = colonia;
|
|
741
|
-
this.country = country;
|
|
742
|
-
this.extNumber = extNumber;
|
|
743
|
-
this.fullName = fullName;
|
|
744
|
-
this.intNumber = intNumber;
|
|
745
|
-
this.postalCode = postalCode;
|
|
746
|
-
this.state = state;
|
|
747
|
-
this.street = street;
|
|
748
|
-
}
|
|
749
|
-
|
|
750
|
-
toObject() {
|
|
751
|
-
return {
|
|
752
|
-
city: this.city,
|
|
753
|
-
colonia: this.colonia,
|
|
754
|
-
country: this.country,
|
|
755
|
-
ext_number: this.extNumber,
|
|
756
|
-
full_name: this.fullName,
|
|
757
|
-
int_number: this.intNumber,
|
|
758
|
-
postal_code: this.postalCode,
|
|
759
|
-
state: this.state,
|
|
760
|
-
street: this.street,
|
|
761
|
-
};
|
|
762
|
-
}
|
|
763
|
-
}
|
|
764
|
-
|
|
765
|
-
class KycFileRequest extends BaseRequest {
|
|
766
|
-
constructor({ data, isMx, status, type, uriBack, uriFront }) {
|
|
767
|
-
super();
|
|
768
|
-
this.data = data;
|
|
769
|
-
this.isMx = isMx;
|
|
770
|
-
this.status = status;
|
|
771
|
-
this.type = type;
|
|
772
|
-
this.uriBack = uriBack;
|
|
773
|
-
this.uriFront = uriFront;
|
|
774
|
-
}
|
|
775
|
-
|
|
776
|
-
toObject() {
|
|
777
|
-
return {
|
|
778
|
-
data: this.data,
|
|
779
|
-
is_mx: this.isMx,
|
|
780
|
-
status: this.status,
|
|
781
|
-
type: this.type,
|
|
782
|
-
uri_back: this.uriBack,
|
|
783
|
-
uri_front: this.uriFront,
|
|
784
|
-
};
|
|
785
|
-
}
|
|
786
|
-
}
|
|
787
|
-
|
|
788
|
-
class UserUpdateRequest extends BaseRequest {
|
|
789
|
-
constructor({
|
|
790
|
-
address,
|
|
791
|
-
curpDocumentUri,
|
|
792
|
-
govtId,
|
|
793
|
-
profession,
|
|
794
|
-
proofOfAddress,
|
|
795
|
-
proofOfLife,
|
|
796
|
-
requiredLevel,
|
|
797
|
-
termsOfService,
|
|
798
|
-
userType,
|
|
799
|
-
verificationId,
|
|
800
|
-
}) {
|
|
801
|
-
super();
|
|
802
|
-
this.adrs = address;
|
|
803
|
-
this.curpDocumentUri = curpDocumentUri;
|
|
804
|
-
this.govstIds = govtId;
|
|
805
|
-
this.profession = profession;
|
|
806
|
-
this.addressProofs = proofOfAddress;
|
|
807
|
-
this.lifeProofs = proofOfLife;
|
|
808
|
-
this.requiredLevel = requiredLevel;
|
|
809
|
-
this.terms = termsOfService;
|
|
810
|
-
this.userType = userType;
|
|
811
|
-
this.verificationId = verificationId;
|
|
812
|
-
}
|
|
813
|
-
|
|
814
|
-
get termsOfService() {
|
|
815
|
-
return this._termsOfService;
|
|
816
|
-
}
|
|
817
|
-
|
|
818
|
-
set terms(value) {
|
|
819
|
-
if (!value) return;
|
|
820
|
-
this._termsOfService = new TosUpdateRequest(value).toObject();
|
|
821
|
-
}
|
|
822
|
-
|
|
823
|
-
get address() {
|
|
824
|
-
return this._address;
|
|
825
|
-
}
|
|
826
|
-
|
|
827
|
-
set adrs(value) {
|
|
828
|
-
if (!value) return;
|
|
829
|
-
this._address = new AddressUpdateRequest(value).toCleanObject();
|
|
830
|
-
}
|
|
831
|
-
|
|
832
|
-
get proofOfLife() {
|
|
833
|
-
return this._proofOfLife;
|
|
834
|
-
}
|
|
835
|
-
|
|
836
|
-
set lifeProofs(value) {
|
|
837
|
-
if (!value) return;
|
|
838
|
-
this._proofOfLife = new KycFileRequest(value).toCleanObject();
|
|
839
|
-
}
|
|
840
|
-
|
|
841
|
-
get proofOfAddress() {
|
|
842
|
-
return this._proofOfAddress;
|
|
843
|
-
}
|
|
844
|
-
|
|
845
|
-
set addressProofs(value) {
|
|
846
|
-
if (!value) return;
|
|
847
|
-
this._proofOfAddress = new KycFileRequest(value).toCleanObject();
|
|
848
|
-
}
|
|
849
|
-
|
|
850
|
-
get govtId() {
|
|
851
|
-
return this._govtId;
|
|
852
|
-
}
|
|
853
|
-
|
|
854
|
-
set govstIds(value) {
|
|
855
|
-
if (!value) return;
|
|
856
|
-
this._govtId = new KycFileRequest(value).toCleanObject();
|
|
857
|
-
}
|
|
858
|
-
|
|
859
|
-
toObject() {
|
|
860
|
-
return {
|
|
861
|
-
address: this.address,
|
|
862
|
-
curp_document_uri: this.curpDocumentUri,
|
|
863
|
-
profession: this.profession,
|
|
864
|
-
requiredLevel: this.requiredLevel,
|
|
865
|
-
terms_of_service: this.termsOfService,
|
|
866
|
-
verification_id: this.verificationId,
|
|
867
|
-
proof_of_life: this.proofOfLife,
|
|
868
|
-
proof_of_address: this.proofOfAddress,
|
|
869
|
-
govt_id: this.govtId,
|
|
870
|
-
user_type: this.userType,
|
|
871
|
-
};
|
|
872
|
-
}
|
|
873
|
-
}
|
|
874
|
-
|
|
875
1232
|
class VerificationRequest extends BaseRequest {
|
|
876
1233
|
constructor({ platformId, recipient, type }) {
|
|
877
1234
|
super();
|