scandit-datacapture-frameworks-id 7.6.2 → 8.0.0-beta.2
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/dist/dts/common/DataConsistencyCheck.d.ts +9 -0
- package/dist/dts/common/DateResult.d.ts +1 -1
- package/dist/dts/common/RegionSpecificSubtype.d.ts +0 -1
- package/dist/dts/common/Sex.d.ts +5 -0
- package/dist/dts/common/index.d.ts +2 -0
- package/dist/dts/defaults/IdDefaults.d.ts +7 -1
- package/dist/dts/defaults/SerializedTypes.d.ts +68 -33
- package/dist/dts/id/AamvaBarcodeVerificationResult.d.ts +0 -3
- package/dist/dts/id/BarcodeResult.d.ts +10 -0
- package/dist/dts/id/CapturedId.d.ts +29 -13
- package/dist/dts/id/DataConsistencyResult.d.ts +14 -0
- package/dist/dts/id/DrivingLicenseCategory.d.ts +12 -0
- package/dist/dts/id/DrivingLicenseDetails.d.ts +13 -0
- package/dist/dts/id/IdFieldType.d.ts +31 -0
- package/dist/dts/id/MRZResult.d.ts +11 -9
- package/dist/dts/id/MobileDocumentDataElement.d.ts +33 -0
- package/dist/dts/id/MobileDocumentOCRResult.d.ts +22 -0
- package/dist/dts/id/MobileDocumentResult.d.ts +35 -0
- package/dist/dts/id/ProfessionalDrivingPermit.d.ts +1 -1
- package/dist/dts/id/VIZResult.d.ts +12 -3
- package/dist/dts/id/VerificationResult.d.ts +14 -0
- package/dist/dts/id/index.d.ts +10 -4
- package/dist/dts/idcapture/IdCapture.d.ts +11 -21
- package/dist/dts/idcapture/IdCaptureFeedback.d.ts +3 -1
- package/dist/dts/idcapture/IdCaptureOverlay.d.ts +4 -16
- package/dist/dts/idcapture/IdCaptureSettings.d.ts +4 -1
- package/dist/dts/idcapture/controller/IdCaptureController.d.ts +22 -11
- package/dist/dts/idcapture/controller/IdCaptureListenerController.d.ts +34 -5
- package/dist/dts/idcapture/index.d.ts +0 -1
- package/dist/dts/scanner/FullDocumentScanner.d.ts +2 -2
- package/dist/dts/scanner/IdCaptureScanner.d.ts +9 -1
- package/dist/dts/scanner/MobileDocumentScanner.d.ts +11 -0
- package/dist/dts/scanner/PhysicalDocumentScanner.d.ts +2 -0
- package/dist/dts/scanner/SingleSideScanner.d.ts +2 -2
- package/dist/dts/scanner/index.d.ts +2 -0
- package/dist/index.js +755 -481
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/dist/dts/id/AamvaBarcodeVerifier.d.ts +0 -16
- package/dist/dts/id/CommonCapturedIdFields.d.ts +0 -28
- package/dist/dts/idcapture/controller/IdCaptureListenerProxy.d.ts +0 -12
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { nameForSerialization, DefaultSerializeable, FactoryMaker, Color, CameraSettings, Feedback,
|
|
1
|
+
import { nameForSerialization, DefaultSerializeable, FactoryMaker, Color, CameraSettings, Sound, Feedback, BaseNewController, EventDataParser, ignoreFromSerialization, ignoreFromSerializationIfNull, Brush } from 'scandit-datacapture-frameworks-core';
|
|
2
2
|
|
|
3
3
|
class DateResult {
|
|
4
4
|
get day() { return this.json.day; }
|
|
@@ -11,7 +11,7 @@ class DateResult {
|
|
|
11
11
|
return new Date(Date.UTC(this.json.year, this.json.month ? this.json.month - 1 : 1, this.json.day || 1));
|
|
12
12
|
}
|
|
13
13
|
static fromJSON(json) {
|
|
14
|
-
if (json === null) {
|
|
14
|
+
if (json === null || json === undefined) {
|
|
15
15
|
return null;
|
|
16
16
|
}
|
|
17
17
|
const dateResult = new DateResult();
|
|
@@ -20,6 +20,17 @@ class DateResult {
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
var DataConsistencyCheck;
|
|
24
|
+
(function (DataConsistencyCheck) {
|
|
25
|
+
DataConsistencyCheck["IssuingCountryComparison"] = "issuingCountryComparison";
|
|
26
|
+
DataConsistencyCheck["IssuingJurisdictionComparison"] = "issuingJurisdictionComparison";
|
|
27
|
+
DataConsistencyCheck["FullNameComparison"] = "fullNameComparison";
|
|
28
|
+
DataConsistencyCheck["DocumentNumberComparison"] = "documentNumberComparison";
|
|
29
|
+
DataConsistencyCheck["DateOfBirthComparison"] = "dateOfBirthComparison";
|
|
30
|
+
DataConsistencyCheck["DateOfExpiryComparison"] = "dateOfExpiryComparison";
|
|
31
|
+
DataConsistencyCheck["DateOfIssueComparison"] = "dateOfIssueComparison";
|
|
32
|
+
})(DataConsistencyCheck || (DataConsistencyCheck = {}));
|
|
33
|
+
|
|
23
34
|
var IdAnonymizationMode;
|
|
24
35
|
(function (IdAnonymizationMode) {
|
|
25
36
|
IdAnonymizationMode["None"] = "none";
|
|
@@ -338,7 +349,6 @@ var RegionSpecificSubtype;
|
|
|
338
349
|
RegionSpecificSubtype["ApecBusinessTravelCard"] = "apecBusinessTravelCard";
|
|
339
350
|
RegionSpecificSubtype["PakistanAfghanCitizenCard"] = "pakistanAfghanCitizenCard";
|
|
340
351
|
RegionSpecificSubtype["SingaporeFinCard"] = "singaporeFinCard";
|
|
341
|
-
RegionSpecificSubtype["UsGreenCard"] = "usGreenCard";
|
|
342
352
|
RegionSpecificSubtype["MalaysiaIkad"] = "malaysiaIkad";
|
|
343
353
|
RegionSpecificSubtype["MalaysiaMykad"] = "malaysiaMykad";
|
|
344
354
|
RegionSpecificSubtype["MalaysiaMypr"] = "malaysiaMypr";
|
|
@@ -505,6 +515,13 @@ __decorate([
|
|
|
505
515
|
nameForSerialization('years')
|
|
506
516
|
], Duration.prototype, "_years", void 0);
|
|
507
517
|
|
|
518
|
+
var Sex;
|
|
519
|
+
(function (Sex) {
|
|
520
|
+
Sex["Female"] = "female";
|
|
521
|
+
Sex["Male"] = "male";
|
|
522
|
+
Sex["Unspecified"] = "unspecified";
|
|
523
|
+
})(Sex || (Sex = {}));
|
|
524
|
+
|
|
508
525
|
function getIdDefaults() {
|
|
509
526
|
return FactoryMaker.getInstance('IdDefaults');
|
|
510
527
|
}
|
|
@@ -515,6 +532,8 @@ function parseIdDefaults(jsonDefaults) {
|
|
|
515
532
|
idCaptured: Feedback.fromJSON(JSON.parse(jsonDefaults.IdCaptureFeedback).idCaptured),
|
|
516
533
|
idRejected: Feedback.fromJSON(JSON.parse(jsonDefaults.IdCaptureFeedback).idRejected),
|
|
517
534
|
},
|
|
535
|
+
DefaultSuccessSound: Sound.fromJSON(JSON.parse(jsonDefaults.defaultSuccessSound)),
|
|
536
|
+
DefaultFailureSound: Sound.fromJSON(JSON.parse(jsonDefaults.defaultFailureSound)),
|
|
518
537
|
RecommendedCameraSettings: CameraSettings
|
|
519
538
|
.fromJSON(jsonDefaults.RecommendedCameraSettings),
|
|
520
539
|
IdCaptureOverlayDefaults: {
|
|
@@ -539,6 +558,8 @@ function parseIdDefaults(jsonDefaults) {
|
|
|
539
558
|
.fromJSON(jsonDefaults.IdCaptureOverlay.DefaultRejectedBrush.strokeColor),
|
|
540
559
|
strokeWidth: jsonDefaults.IdCaptureOverlay.DefaultRejectedBrush.strokeWidth,
|
|
541
560
|
},
|
|
561
|
+
defaultIdLayoutStyle: jsonDefaults.IdCaptureOverlay.defaultIdLayoutStyle,
|
|
562
|
+
defaultIdLayoutLineStyle: jsonDefaults.IdCaptureOverlay.defaultIdLayoutLineStyle,
|
|
542
563
|
},
|
|
543
564
|
IdCaptureSettings: {
|
|
544
565
|
anonymizationMode: jsonDefaults.IdCaptureSettings.anonymizationMode,
|
|
@@ -570,9 +591,6 @@ var AamvaBarcodeVerificationStatus;
|
|
|
570
591
|
})(AamvaBarcodeVerificationStatus || (AamvaBarcodeVerificationStatus = {}));
|
|
571
592
|
|
|
572
593
|
class AamvaBarcodeVerificationResult {
|
|
573
|
-
/**
|
|
574
|
-
* @deprecated
|
|
575
|
-
*/
|
|
576
594
|
get allChecksPassed() { return this.json.allChecksPassed; }
|
|
577
595
|
get status() {
|
|
578
596
|
return this._status;
|
|
@@ -595,283 +613,11 @@ class AamvaBarcodeVerificationResult {
|
|
|
595
613
|
}
|
|
596
614
|
}
|
|
597
615
|
|
|
598
|
-
class IdCaptureController extends BaseController {
|
|
599
|
-
// This is also accpeting null here because the AamvaBarcodeVerifier is using this controller.
|
|
600
|
-
// Once we remove the AamvaBarcodeVerifier, we can remove the null here.
|
|
601
|
-
constructor(idCapture = null) {
|
|
602
|
-
super('IdCaptureProxy');
|
|
603
|
-
this.idCapture = null;
|
|
604
|
-
this.idCapture = idCapture;
|
|
605
|
-
}
|
|
606
|
-
reset() {
|
|
607
|
-
return this._proxy.resetMode();
|
|
608
|
-
}
|
|
609
|
-
createContextForBarcodeVerification(context) {
|
|
610
|
-
return this._proxy.createContextForBarcodeVerification(JSON.stringify(context.toJSON()));
|
|
611
|
-
}
|
|
612
|
-
verifyCapturedIdAsync(capturedId) {
|
|
613
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
614
|
-
const result = yield this._proxy.verifyCapturedIdAsync(capturedId);
|
|
615
|
-
if (result == null) {
|
|
616
|
-
return null;
|
|
617
|
-
}
|
|
618
|
-
return result.data;
|
|
619
|
-
});
|
|
620
|
-
}
|
|
621
|
-
setModeEnabledState(enabled) {
|
|
622
|
-
this._proxy.setModeEnabledState(enabled);
|
|
623
|
-
}
|
|
624
|
-
updateIdCaptureMode() {
|
|
625
|
-
if (this.idCapture == null) {
|
|
626
|
-
throw new Error('IdCaptureController is not initialized with an IdCapture instance');
|
|
627
|
-
}
|
|
628
|
-
return this._proxy.updateIdCaptureMode(JSON.stringify(this.idCapture.toJSON()));
|
|
629
|
-
}
|
|
630
|
-
applyIdCaptureModeSettings(newSettings) {
|
|
631
|
-
return this._proxy.applyIdCaptureModeSettings(JSON.stringify(newSettings.toJSON()));
|
|
632
|
-
}
|
|
633
|
-
updateFeedback(feedback) {
|
|
634
|
-
return this._proxy.updateFeedback(JSON.stringify(feedback.toJSON()));
|
|
635
|
-
}
|
|
636
|
-
}
|
|
637
|
-
|
|
638
|
-
var IdCaptureListenerEvents;
|
|
639
|
-
(function (IdCaptureListenerEvents) {
|
|
640
|
-
IdCaptureListenerEvents["didCapture"] = "IdCaptureListener.didCaptureId";
|
|
641
|
-
IdCaptureListenerEvents["didReject"] = "IdCaptureListener.didRejectId";
|
|
642
|
-
})(IdCaptureListenerEvents || (IdCaptureListenerEvents = {}));
|
|
643
|
-
|
|
644
|
-
class MRZResult {
|
|
645
|
-
get documentCode() { return this.json.documentCode; }
|
|
646
|
-
get namesAreTruncated() { return this.json.namesAreTruncated; }
|
|
647
|
-
/**
|
|
648
|
-
* @deprecated Use optionalDataInLine1 and optionalDataInLine2 instead. This property will be removed in SDK version 8.0.
|
|
649
|
-
*/
|
|
650
|
-
get optional() { return this.json.optional; }
|
|
651
|
-
/**
|
|
652
|
-
* @deprecated Use optionalDataInLine1 and optionalDataInLine2 instead. This property will be removed in SDK version 8.0.
|
|
653
|
-
*/
|
|
654
|
-
get optional1() { return this.json.optional1; }
|
|
655
|
-
get optionalDataInLine1() { return this.json.optionalDataInLine1; }
|
|
656
|
-
get optionalDataInLine2() { return this.json.optionalDataInLine2; }
|
|
657
|
-
get capturedMrz() { return this.json.capturedMrz; }
|
|
658
|
-
get personalIdNumber() { return this.json.personalIdNumber; }
|
|
659
|
-
get renewalTimes() { return this.json.renewalTimes; }
|
|
660
|
-
get fullNameSimplifiedChinese() { return this.json.fullNameSimplifiedChinese; }
|
|
661
|
-
get omittedCharacterCountInGbkName() { return this.json.omittedCharacterCountInGbkName; }
|
|
662
|
-
get omittedNameCount() { return this.json.omittedNameCount; }
|
|
663
|
-
get issuingAuthorityCode() { return this.json.issuingAuthorityCode; }
|
|
664
|
-
get passportIssuerIso() { return this.json.passportIssuerIso; }
|
|
665
|
-
get passportNumber() { return this.json.passportNumber; }
|
|
666
|
-
get passportDateOfExpiry() {
|
|
667
|
-
return DateResult.fromJSON(this.json.passportDateOfExpiry);
|
|
668
|
-
}
|
|
669
|
-
static fromJSON(json) {
|
|
670
|
-
const result = new MRZResult();
|
|
671
|
-
result.json = json;
|
|
672
|
-
return result;
|
|
673
|
-
}
|
|
674
|
-
}
|
|
675
|
-
|
|
676
|
-
class CommonCapturedIdFields {
|
|
677
|
-
get firstName() { return this.json.firstName; }
|
|
678
|
-
get lastName() { return this.json.lastName; }
|
|
679
|
-
get fullName() { return this.json.fullName; }
|
|
680
|
-
get secondaryLastName() { return this.json.secondaryLastName; }
|
|
681
|
-
get sex() { return this.json.sex; }
|
|
682
|
-
get dateOfBirth() {
|
|
683
|
-
return DateResult.fromJSON(this.json.dateOfBirth);
|
|
684
|
-
}
|
|
685
|
-
get age() { return this.json.age; }
|
|
686
|
-
get isExpired() { return this.json.isExpired; }
|
|
687
|
-
get nationality() { return this.json.nationality; }
|
|
688
|
-
get address() { return this.json.address; }
|
|
689
|
-
get documentAdditionalNumber() { return this.json.documentAdditionalNumber; }
|
|
690
|
-
get documentType() { return this.json.documentType; }
|
|
691
|
-
get documentSubtype() { return this.json.documentSubtype; }
|
|
692
|
-
get documentNumber() { return this.json.documentNumber; }
|
|
693
|
-
get issuingCountry() { return this.json.issuingCountry; }
|
|
694
|
-
get issuingCountryIso() { return this.json.issuingCountryIso; }
|
|
695
|
-
get dateOfExpiry() {
|
|
696
|
-
return DateResult.fromJSON(this.json.dateOfExpiry);
|
|
697
|
-
}
|
|
698
|
-
get dateOfIssue() {
|
|
699
|
-
return DateResult.fromJSON(this.json.dateOfIssue);
|
|
700
|
-
}
|
|
701
|
-
static fromJSON(json, existingInstance) {
|
|
702
|
-
if (json === null) {
|
|
703
|
-
return null;
|
|
704
|
-
}
|
|
705
|
-
const firstName = json.firstName;
|
|
706
|
-
const lastName = json.lastName;
|
|
707
|
-
const fullName = json.fullName;
|
|
708
|
-
const secondaryLastName = json.secondaryLastName;
|
|
709
|
-
const sex = json.sex;
|
|
710
|
-
const dateOfBirth = DateResult.fromJSON(json.dateOfBirth);
|
|
711
|
-
const age = json.age;
|
|
712
|
-
const isExpired = json.isExpired;
|
|
713
|
-
const nationality = json.nationality;
|
|
714
|
-
const address = json.address;
|
|
715
|
-
const documentType = json.documentType;
|
|
716
|
-
const documentSubtype = json.documentSubtype;
|
|
717
|
-
const documentNumber = json.documentNumber;
|
|
718
|
-
const issuingCountry = json.issuingCountry;
|
|
719
|
-
const issuingCountryIso = json.issuingCountryIso;
|
|
720
|
-
const dateOfExpiry = DateResult.fromJSON(json.dateOfExpiry);
|
|
721
|
-
const dateOfIssue = DateResult.fromJSON(json.dateOfIssue);
|
|
722
|
-
if (existingInstance) {
|
|
723
|
-
if (!existingInstance.firstName) {
|
|
724
|
-
json.firstName = firstName;
|
|
725
|
-
}
|
|
726
|
-
if (!existingInstance.lastName) {
|
|
727
|
-
json.lastName = lastName;
|
|
728
|
-
}
|
|
729
|
-
if (!existingInstance.fullName) {
|
|
730
|
-
json.fullName = fullName;
|
|
731
|
-
}
|
|
732
|
-
if (!existingInstance.secondaryLastName) {
|
|
733
|
-
json.secondaryLastName = secondaryLastName;
|
|
734
|
-
}
|
|
735
|
-
if (!existingInstance.sex) {
|
|
736
|
-
json.sex = sex;
|
|
737
|
-
}
|
|
738
|
-
if (!existingInstance.dateOfBirth) {
|
|
739
|
-
json.dateOfBirth = dateOfBirth;
|
|
740
|
-
}
|
|
741
|
-
if (!existingInstance.age) {
|
|
742
|
-
json.age = age;
|
|
743
|
-
}
|
|
744
|
-
if (!existingInstance.isExpired) {
|
|
745
|
-
json.isExpired = isExpired;
|
|
746
|
-
}
|
|
747
|
-
if (!existingInstance.nationality) {
|
|
748
|
-
json.nationality = nationality;
|
|
749
|
-
}
|
|
750
|
-
if (!existingInstance.address) {
|
|
751
|
-
json.address = address;
|
|
752
|
-
}
|
|
753
|
-
if (!existingInstance.documentType) {
|
|
754
|
-
json.documentType = documentType;
|
|
755
|
-
}
|
|
756
|
-
if (!existingInstance.documentSubtype) {
|
|
757
|
-
json.documentSubtype = documentSubtype;
|
|
758
|
-
}
|
|
759
|
-
if (!existingInstance.documentNumber) {
|
|
760
|
-
json.documentNumber = documentNumber;
|
|
761
|
-
}
|
|
762
|
-
if (!existingInstance.issuingCountry) {
|
|
763
|
-
json.issuingCountry = issuingCountry;
|
|
764
|
-
}
|
|
765
|
-
if (!existingInstance.issuingCountryIso) {
|
|
766
|
-
json.issuingCountryIso = issuingCountryIso;
|
|
767
|
-
}
|
|
768
|
-
if (!existingInstance.dateOfExpiry) {
|
|
769
|
-
json.dateOfExpiry = dateOfExpiry;
|
|
770
|
-
}
|
|
771
|
-
if (!existingInstance.dateOfIssue) {
|
|
772
|
-
json.dateOfIssue = dateOfIssue;
|
|
773
|
-
}
|
|
774
|
-
}
|
|
775
|
-
const object = new CommonCapturedIdFields();
|
|
776
|
-
object.json = json;
|
|
777
|
-
return object;
|
|
778
|
-
}
|
|
779
|
-
}
|
|
780
|
-
|
|
781
|
-
class VIZResult {
|
|
782
|
-
get additionalAddressInformation() {
|
|
783
|
-
return this.json.additionalAddressInformation;
|
|
784
|
-
}
|
|
785
|
-
get additionalNameInformation() {
|
|
786
|
-
return this.json.additionalNameInformation;
|
|
787
|
-
}
|
|
788
|
-
get documentAdditionalNumber() {
|
|
789
|
-
return this.json.documentAdditionalNumber;
|
|
790
|
-
}
|
|
791
|
-
get employer() {
|
|
792
|
-
return this.json.employer;
|
|
793
|
-
}
|
|
794
|
-
get issuingAuthority() {
|
|
795
|
-
return this.json.issuingAuthority;
|
|
796
|
-
}
|
|
797
|
-
get issuingJurisdiction() {
|
|
798
|
-
return this.json.issuingJurisdiction;
|
|
799
|
-
}
|
|
800
|
-
get issuingJurisdictionIso() {
|
|
801
|
-
return this.json.issuingJurisdictionIso;
|
|
802
|
-
}
|
|
803
|
-
get maritalStatus() {
|
|
804
|
-
return this.json.maritalStatus;
|
|
805
|
-
}
|
|
806
|
-
get personalIdNumber() {
|
|
807
|
-
return this.json.personalIdNumber;
|
|
808
|
-
}
|
|
809
|
-
get placeOfBirth() {
|
|
810
|
-
return this.json.placeOfBirth;
|
|
811
|
-
}
|
|
812
|
-
get profession() {
|
|
813
|
-
return this.json.profession;
|
|
814
|
-
}
|
|
815
|
-
get race() {
|
|
816
|
-
return this.json.race;
|
|
817
|
-
}
|
|
818
|
-
get religion() {
|
|
819
|
-
return this.json.religion;
|
|
820
|
-
}
|
|
821
|
-
get residentialStatus() {
|
|
822
|
-
return this.json.residentialStatus;
|
|
823
|
-
}
|
|
824
|
-
get usRealIdStatus() {
|
|
825
|
-
return this.json.usRealIdStatus;
|
|
826
|
-
}
|
|
827
|
-
get capturedSides() {
|
|
828
|
-
return this.json.capturedSides;
|
|
829
|
-
}
|
|
830
|
-
get isBackSideCaptureSupported() {
|
|
831
|
-
return this.json.isBackSideCaptureSupported;
|
|
832
|
-
}
|
|
833
|
-
get bloodType() {
|
|
834
|
-
return this.json.bloodType;
|
|
835
|
-
}
|
|
836
|
-
get sponsor() {
|
|
837
|
-
return this.json.sponsor;
|
|
838
|
-
}
|
|
839
|
-
get mothersName() {
|
|
840
|
-
return this.json.mothersName;
|
|
841
|
-
}
|
|
842
|
-
get fathersName() {
|
|
843
|
-
return this.json.fathersName;
|
|
844
|
-
}
|
|
845
|
-
get passportNumber() {
|
|
846
|
-
return this.json.passportNumber;
|
|
847
|
-
}
|
|
848
|
-
get visaNumber() {
|
|
849
|
-
return this.json.visaNumber;
|
|
850
|
-
}
|
|
851
|
-
get firstName() {
|
|
852
|
-
return this.json.firstName;
|
|
853
|
-
}
|
|
854
|
-
get lastName() {
|
|
855
|
-
return this.json.lastName;
|
|
856
|
-
}
|
|
857
|
-
get secondaryLastName() {
|
|
858
|
-
return this.json.secondaryLastName;
|
|
859
|
-
}
|
|
860
|
-
get fullName() {
|
|
861
|
-
return this.json.fullName;
|
|
862
|
-
}
|
|
863
|
-
static fromJSON(json) {
|
|
864
|
-
const result = new VIZResult();
|
|
865
|
-
result.json = json;
|
|
866
|
-
return result;
|
|
867
|
-
}
|
|
868
|
-
}
|
|
869
|
-
|
|
870
616
|
class ProfessionalDrivingPermit {
|
|
871
617
|
get dateOfExpiry() { return DateResult.fromJSON(this.json.dateOfExpiry); }
|
|
872
618
|
get codes() { return this.json.codes; }
|
|
873
619
|
static fromJSON(json) {
|
|
874
|
-
if (json === null) {
|
|
620
|
+
if (json === null || json === undefined) {
|
|
875
621
|
return null;
|
|
876
622
|
}
|
|
877
623
|
const object = new ProfessionalDrivingPermit();
|
|
@@ -1150,30 +896,214 @@ class BarcodeResult {
|
|
|
1150
896
|
get barcodeDataElements() {
|
|
1151
897
|
return this.json.barcodeDataElements;
|
|
1152
898
|
}
|
|
899
|
+
// Common Fields
|
|
900
|
+
get firstName() { return this.json.firstName; }
|
|
901
|
+
get lastName() { return this.json.lastName; }
|
|
902
|
+
get fullName() { return this.json.fullName; }
|
|
903
|
+
get sex() { return this.json.sex; }
|
|
904
|
+
get dateOfBirth() { return DateResult.fromJSON(this.json.dateOfBirth); }
|
|
905
|
+
get nationality() { return this.json.nationality; }
|
|
906
|
+
get address() { return this.json.address; }
|
|
907
|
+
get documentNumber() { return this.json.documentNumber; }
|
|
908
|
+
get dateOfExpiry() { return DateResult.fromJSON(this.json.dateOfExpiry); }
|
|
909
|
+
get dateOfIssue() { return DateResult.fromJSON(this.json.dateOfIssue); }
|
|
1153
910
|
}
|
|
1154
911
|
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
this.
|
|
912
|
+
class MRZResult {
|
|
913
|
+
get documentCode() { return this.json.documentCode; }
|
|
914
|
+
get namesAreTruncated() { return this.json.namesAreTruncated; }
|
|
915
|
+
get optionalDataInLine1() { return this.json.optionalDataInLine1; }
|
|
916
|
+
get optionalDataInLine2() { return this.json.optionalDataInLine2; }
|
|
917
|
+
get capturedMrz() { return this.json.capturedMrz; }
|
|
918
|
+
get personalIdNumber() { return this.json.personalIdNumber; }
|
|
919
|
+
get renewalTimes() { return this.json.renewalTimes; }
|
|
920
|
+
get fullNameSimplifiedChinese() { return this.json.fullNameSimplifiedChinese; }
|
|
921
|
+
get omittedCharacterCountInGbkName() { return this.json.omittedCharacterCountInGbkName; }
|
|
922
|
+
get omittedNameCount() { return this.json.omittedNameCount; }
|
|
923
|
+
get issuingAuthorityCode() { return this.json.issuingAuthorityCode; }
|
|
924
|
+
get passportIssuerIso() { return this.json.passportIssuerIso; }
|
|
925
|
+
get passportNumber() { return this.json.passportNumber; }
|
|
926
|
+
get passportDateOfExpiry() {
|
|
927
|
+
return DateResult.fromJSON(this.json.passportDateOfExpiry);
|
|
1171
928
|
}
|
|
1172
|
-
|
|
1173
|
-
|
|
929
|
+
// Common Fields
|
|
930
|
+
get firstName() { return this.json.firstName; }
|
|
931
|
+
get lastName() { return this.json.lastName; }
|
|
932
|
+
get fullName() { return this.json.fullName; }
|
|
933
|
+
get sex() { return this.json.sex; }
|
|
934
|
+
get dateOfBirth() { return DateResult.fromJSON(this.json.dateOfBirth); }
|
|
935
|
+
get nationality() { return this.json.nationality; }
|
|
936
|
+
get address() { return this.json.address; }
|
|
937
|
+
get documentNumber() { return this.json.documentNumber; }
|
|
938
|
+
get dateOfExpiry() { return DateResult.fromJSON(this.json.dateOfExpiry); }
|
|
939
|
+
get dateOfIssue() { return DateResult.fromJSON(this.json.dateOfIssue); }
|
|
940
|
+
static fromJSON(json) {
|
|
941
|
+
const result = new MRZResult();
|
|
942
|
+
result.json = json;
|
|
943
|
+
return result;
|
|
1174
944
|
}
|
|
1175
|
-
|
|
1176
|
-
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
class DrivingLicenseCategory {
|
|
948
|
+
get code() { return this.json.code; }
|
|
949
|
+
get dateOfIssue() {
|
|
950
|
+
return DateResult.fromJSON(this.json.dateOfIssue);
|
|
951
|
+
}
|
|
952
|
+
get dateOfExpiry() {
|
|
953
|
+
return DateResult.fromJSON(this.json.dateOfExpiry);
|
|
954
|
+
}
|
|
955
|
+
static fromJSON(json) {
|
|
956
|
+
if (json === null || json === undefined) {
|
|
957
|
+
return null;
|
|
958
|
+
}
|
|
959
|
+
const result = new DrivingLicenseCategory();
|
|
960
|
+
result.json = json;
|
|
961
|
+
return result;
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
class DrivingLicenseDetails {
|
|
966
|
+
constructor() {
|
|
967
|
+
this._drivingLicenseCategories = [];
|
|
968
|
+
}
|
|
969
|
+
get drivingLicenseCategories() {
|
|
970
|
+
if (this._drivingLicenseCategories.length === 0) {
|
|
971
|
+
this._drivingLicenseCategories = this.json.drivingLicenseCategories.map(categoryJson => DrivingLicenseCategory.fromJSON(categoryJson)).filter(category => category !== null);
|
|
972
|
+
}
|
|
973
|
+
return this._drivingLicenseCategories;
|
|
974
|
+
}
|
|
975
|
+
get restrictions() {
|
|
976
|
+
return this.json.restrictions;
|
|
977
|
+
}
|
|
978
|
+
get endorsements() {
|
|
979
|
+
return this.json.endorsements;
|
|
980
|
+
}
|
|
981
|
+
static fromJSON(json) {
|
|
982
|
+
if (json === null) {
|
|
983
|
+
return null;
|
|
984
|
+
}
|
|
985
|
+
const result = new DrivingLicenseDetails();
|
|
986
|
+
result.json = json;
|
|
987
|
+
return result;
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
class VIZResult {
|
|
992
|
+
get additionalAddressInformation() {
|
|
993
|
+
return this.json.additionalAddressInformation;
|
|
994
|
+
}
|
|
995
|
+
get additionalNameInformation() {
|
|
996
|
+
return this.json.additionalNameInformation;
|
|
997
|
+
}
|
|
998
|
+
get documentAdditionalNumber() {
|
|
999
|
+
return this.json.documentAdditionalNumber;
|
|
1000
|
+
}
|
|
1001
|
+
get employer() {
|
|
1002
|
+
return this.json.employer;
|
|
1003
|
+
}
|
|
1004
|
+
get issuingAuthority() {
|
|
1005
|
+
return this.json.issuingAuthority;
|
|
1006
|
+
}
|
|
1007
|
+
get issuingJurisdiction() {
|
|
1008
|
+
return this.json.issuingJurisdiction;
|
|
1009
|
+
}
|
|
1010
|
+
get issuingJurisdictionIso() {
|
|
1011
|
+
return this.json.issuingJurisdictionIso;
|
|
1012
|
+
}
|
|
1013
|
+
get maritalStatus() {
|
|
1014
|
+
return this.json.maritalStatus;
|
|
1015
|
+
}
|
|
1016
|
+
get personalIdNumber() {
|
|
1017
|
+
return this.json.personalIdNumber;
|
|
1018
|
+
}
|
|
1019
|
+
get placeOfBirth() {
|
|
1020
|
+
return this.json.placeOfBirth;
|
|
1021
|
+
}
|
|
1022
|
+
get profession() {
|
|
1023
|
+
return this.json.profession;
|
|
1024
|
+
}
|
|
1025
|
+
get race() {
|
|
1026
|
+
return this.json.race;
|
|
1027
|
+
}
|
|
1028
|
+
get religion() {
|
|
1029
|
+
return this.json.religion;
|
|
1030
|
+
}
|
|
1031
|
+
get residentialStatus() {
|
|
1032
|
+
return this.json.residentialStatus;
|
|
1033
|
+
}
|
|
1034
|
+
get usRealIdStatus() {
|
|
1035
|
+
return this.json.usRealIdStatus;
|
|
1036
|
+
}
|
|
1037
|
+
get capturedSides() {
|
|
1038
|
+
return this.json.capturedSides;
|
|
1039
|
+
}
|
|
1040
|
+
get isBackSideCaptureSupported() {
|
|
1041
|
+
return this.json.isBackSideCaptureSupported;
|
|
1042
|
+
}
|
|
1043
|
+
get bloodType() {
|
|
1044
|
+
return this.json.bloodType;
|
|
1045
|
+
}
|
|
1046
|
+
get sponsor() {
|
|
1047
|
+
return this.json.sponsor;
|
|
1048
|
+
}
|
|
1049
|
+
get mothersName() {
|
|
1050
|
+
return this.json.mothersName;
|
|
1051
|
+
}
|
|
1052
|
+
get fathersName() {
|
|
1053
|
+
return this.json.fathersName;
|
|
1054
|
+
}
|
|
1055
|
+
get passportNumber() {
|
|
1056
|
+
return this.json.passportNumber;
|
|
1057
|
+
}
|
|
1058
|
+
get visaNumber() {
|
|
1059
|
+
return this.json.visaNumber;
|
|
1060
|
+
}
|
|
1061
|
+
get vehicleOwner() {
|
|
1062
|
+
return this.json.vehicleOwner;
|
|
1063
|
+
}
|
|
1064
|
+
get drivingLicenseDetails() {
|
|
1065
|
+
return DrivingLicenseDetails.fromJSON(this.json.drivingLicenseDetails);
|
|
1066
|
+
}
|
|
1067
|
+
// Common Fields
|
|
1068
|
+
get firstName() { return this.json.firstName; }
|
|
1069
|
+
get lastName() { return this.json.lastName; }
|
|
1070
|
+
get fullName() { return this.json.fullName; }
|
|
1071
|
+
get sex() { return this.json.sex; }
|
|
1072
|
+
get dateOfBirth() { return DateResult.fromJSON(this.json.dateOfBirth); }
|
|
1073
|
+
get nationality() { return this.json.nationality; }
|
|
1074
|
+
get address() { return this.json.address; }
|
|
1075
|
+
get documentNumber() { return this.json.documentNumber; }
|
|
1076
|
+
get dateOfExpiry() { return DateResult.fromJSON(this.json.dateOfExpiry); }
|
|
1077
|
+
get dateOfIssue() { return DateResult.fromJSON(this.json.dateOfIssue); }
|
|
1078
|
+
static fromJSON(json) {
|
|
1079
|
+
const result = new VIZResult();
|
|
1080
|
+
result.json = json;
|
|
1081
|
+
return result;
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1085
|
+
var IdCaptureDocumentType;
|
|
1086
|
+
(function (IdCaptureDocumentType) {
|
|
1087
|
+
IdCaptureDocumentType["IdCard"] = "idCard";
|
|
1088
|
+
IdCaptureDocumentType["DriverLicense"] = "driverLicense";
|
|
1089
|
+
IdCaptureDocumentType["Passport"] = "passport";
|
|
1090
|
+
IdCaptureDocumentType["VisaIcao"] = "visaIcao";
|
|
1091
|
+
IdCaptureDocumentType["RegionSpecific"] = "regionSpecific";
|
|
1092
|
+
IdCaptureDocumentType["ResidencePermit"] = "residencePermit";
|
|
1093
|
+
IdCaptureDocumentType["HealthInsuranceCard"] = "healthInsuranceCard";
|
|
1094
|
+
})(IdCaptureDocumentType || (IdCaptureDocumentType = {}));
|
|
1095
|
+
|
|
1096
|
+
class DriverLicense extends DefaultSerializeable {
|
|
1097
|
+
constructor(region) {
|
|
1098
|
+
super();
|
|
1099
|
+
this._documentType = IdCaptureDocumentType.DriverLicense;
|
|
1100
|
+
this._region = region;
|
|
1101
|
+
}
|
|
1102
|
+
get region() {
|
|
1103
|
+
return this._region;
|
|
1104
|
+
}
|
|
1105
|
+
get isIdCard() {
|
|
1106
|
+
return this._documentType === IdCaptureDocumentType.IdCard;
|
|
1177
1107
|
}
|
|
1178
1108
|
get isDriverLicense() {
|
|
1179
1109
|
return this._documentType === IdCaptureDocumentType.DriverLicense;
|
|
@@ -1436,60 +1366,228 @@ __decorate([
|
|
|
1436
1366
|
nameForSerialization('documentType')
|
|
1437
1367
|
], VisaIcao.prototype, "_documentType", void 0);
|
|
1438
1368
|
|
|
1439
|
-
class
|
|
1369
|
+
class MobileDocumentOCRResult {
|
|
1370
|
+
get firstName() {
|
|
1371
|
+
return this.json.firstName;
|
|
1372
|
+
}
|
|
1373
|
+
get lastName() {
|
|
1374
|
+
return this.json.lastName;
|
|
1375
|
+
}
|
|
1376
|
+
get fullName() {
|
|
1377
|
+
return this.json.fullName;
|
|
1378
|
+
}
|
|
1379
|
+
get dateOfBirth() {
|
|
1380
|
+
return DateResult.fromJSON(this.json.dateOfBirth);
|
|
1381
|
+
}
|
|
1382
|
+
get documentNumber() {
|
|
1383
|
+
return this.json.documentNumber;
|
|
1384
|
+
}
|
|
1385
|
+
get dateOfExpiry() {
|
|
1386
|
+
return DateResult.fromJSON(this.json.dateOfExpiry);
|
|
1387
|
+
}
|
|
1388
|
+
get issuingJurisdiction() {
|
|
1389
|
+
return this.json.issuingJurisdiction;
|
|
1390
|
+
}
|
|
1391
|
+
get issuingJurisdictionIso() {
|
|
1392
|
+
return this.json.issuingJurisdictionIso;
|
|
1393
|
+
}
|
|
1394
|
+
get sex() {
|
|
1395
|
+
return this.json.sex;
|
|
1396
|
+
}
|
|
1397
|
+
get nationality() {
|
|
1398
|
+
return this.json.nationality;
|
|
1399
|
+
}
|
|
1400
|
+
get address() {
|
|
1401
|
+
return this.json.address;
|
|
1402
|
+
}
|
|
1403
|
+
get documentAdditionalNumber() {
|
|
1404
|
+
return this.json.documentAdditionalNumber;
|
|
1405
|
+
}
|
|
1406
|
+
get dateOfIssue() {
|
|
1407
|
+
return DateResult.fromJSON(this.json.dateOfIssue);
|
|
1408
|
+
}
|
|
1409
|
+
static fromJSON(json) {
|
|
1410
|
+
if (json === null) {
|
|
1411
|
+
return null;
|
|
1412
|
+
}
|
|
1413
|
+
const result = new MobileDocumentOCRResult();
|
|
1414
|
+
result.json = json;
|
|
1415
|
+
return result;
|
|
1416
|
+
}
|
|
1417
|
+
}
|
|
1418
|
+
|
|
1419
|
+
class MobileDocumentResult {
|
|
1440
1420
|
constructor() {
|
|
1441
|
-
this.
|
|
1421
|
+
this._drivingLicenseCategories = [];
|
|
1422
|
+
}
|
|
1423
|
+
get portrait() {
|
|
1424
|
+
return this.json.portrait;
|
|
1425
|
+
}
|
|
1426
|
+
get issuingAuthority() {
|
|
1427
|
+
return this.json.issuingAuthority;
|
|
1428
|
+
}
|
|
1429
|
+
get administrativeNumber() {
|
|
1430
|
+
return this.json.administrativeNumber;
|
|
1431
|
+
}
|
|
1432
|
+
get height() {
|
|
1433
|
+
return this.json.height;
|
|
1434
|
+
}
|
|
1435
|
+
get weight() {
|
|
1436
|
+
return this.json.weight;
|
|
1437
|
+
}
|
|
1438
|
+
get eyeColor() {
|
|
1439
|
+
return this.json.eyeColor;
|
|
1440
|
+
}
|
|
1441
|
+
get hairColor() {
|
|
1442
|
+
return this.json.hairColor;
|
|
1443
|
+
}
|
|
1444
|
+
get birthPlace() {
|
|
1445
|
+
return this.json.birthPlace;
|
|
1446
|
+
}
|
|
1447
|
+
get drivingLicenseCategories() {
|
|
1448
|
+
if (this._drivingLicenseCategories.length === 0) {
|
|
1449
|
+
this._drivingLicenseCategories = this.json.drivingLicenseCategories.map(categoryJson => DrivingLicenseCategory.fromJSON(categoryJson)).filter(category => category !== null);
|
|
1450
|
+
}
|
|
1451
|
+
return this._drivingLicenseCategories;
|
|
1452
|
+
}
|
|
1453
|
+
get residentCity() {
|
|
1454
|
+
return this.json.residentCity;
|
|
1455
|
+
}
|
|
1456
|
+
get residentCountry() {
|
|
1457
|
+
return this.json.residentCountry;
|
|
1442
1458
|
}
|
|
1443
1459
|
get firstName() {
|
|
1444
|
-
return this.
|
|
1460
|
+
return this.json.firstName;
|
|
1445
1461
|
}
|
|
1446
1462
|
get lastName() {
|
|
1447
|
-
return this.
|
|
1463
|
+
return this.json.lastName;
|
|
1448
1464
|
}
|
|
1449
1465
|
get fullName() {
|
|
1450
|
-
return this.
|
|
1451
|
-
}
|
|
1452
|
-
get secondaryLastName() {
|
|
1453
|
-
return this.commonCapturedFields.secondaryLastName;
|
|
1466
|
+
return this.json.fullName;
|
|
1454
1467
|
}
|
|
1455
1468
|
get sex() {
|
|
1456
|
-
return this.
|
|
1469
|
+
return this.json.sex;
|
|
1457
1470
|
}
|
|
1458
1471
|
get dateOfBirth() {
|
|
1459
|
-
return DateResult.fromJSON(this.
|
|
1472
|
+
return DateResult.fromJSON(this.json.dateOfBirth);
|
|
1460
1473
|
}
|
|
1461
1474
|
get age() {
|
|
1462
1475
|
return this.json.age;
|
|
1463
1476
|
}
|
|
1464
|
-
get isExpired() {
|
|
1465
|
-
return this.json.isExpired;
|
|
1466
|
-
}
|
|
1467
1477
|
get nationality() {
|
|
1468
|
-
return this.
|
|
1478
|
+
return this.json.nationality;
|
|
1469
1479
|
}
|
|
1470
1480
|
get address() {
|
|
1471
|
-
return this.
|
|
1472
|
-
}
|
|
1473
|
-
get document() {
|
|
1474
|
-
return this._document;
|
|
1481
|
+
return this.json.address;
|
|
1475
1482
|
}
|
|
1476
1483
|
get issuingCountryIso() {
|
|
1477
|
-
return this.
|
|
1478
|
-
}
|
|
1479
|
-
get issuingCountry() {
|
|
1480
|
-
return this.commonCapturedFields.issuingCountry;
|
|
1484
|
+
return this.json.issuingCountryIso;
|
|
1481
1485
|
}
|
|
1482
|
-
get
|
|
1483
|
-
return this.
|
|
1486
|
+
get issuingJurisdictionIso() {
|
|
1487
|
+
return this.json.issuingJurisdictionIso;
|
|
1484
1488
|
}
|
|
1485
1489
|
get documentNumber() {
|
|
1486
|
-
return this.
|
|
1490
|
+
return this.json.documentNumber;
|
|
1487
1491
|
}
|
|
1488
1492
|
get dateOfExpiry() {
|
|
1489
|
-
return DateResult.fromJSON(this.
|
|
1493
|
+
return DateResult.fromJSON(this.json.dateOfExpiry);
|
|
1490
1494
|
}
|
|
1491
1495
|
get dateOfIssue() {
|
|
1492
|
-
return DateResult.fromJSON(this.
|
|
1496
|
+
return DateResult.fromJSON(this.json.dateOfIssue);
|
|
1497
|
+
}
|
|
1498
|
+
static fromJSON(json) {
|
|
1499
|
+
if (json === null) {
|
|
1500
|
+
return null;
|
|
1501
|
+
}
|
|
1502
|
+
const result = new MobileDocumentResult();
|
|
1503
|
+
result.json = json;
|
|
1504
|
+
return result;
|
|
1505
|
+
}
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1508
|
+
class DataConsistencyResult {
|
|
1509
|
+
get allChecksPassed() {
|
|
1510
|
+
return this.json.allChecksPassed;
|
|
1511
|
+
}
|
|
1512
|
+
get failedChecks() {
|
|
1513
|
+
return this.json.failedChecks.map(check => check);
|
|
1514
|
+
}
|
|
1515
|
+
get skippedChecks() {
|
|
1516
|
+
return this.json.skippedChecks.map(check => check);
|
|
1517
|
+
}
|
|
1518
|
+
get passedChecks() {
|
|
1519
|
+
return this.json.passedChecks.map(check => check);
|
|
1520
|
+
}
|
|
1521
|
+
get frontReviewImage() {
|
|
1522
|
+
return this.json.frontReviewImage;
|
|
1523
|
+
}
|
|
1524
|
+
static fromJSON(json) {
|
|
1525
|
+
if (json === null || json === undefined) {
|
|
1526
|
+
return null;
|
|
1527
|
+
}
|
|
1528
|
+
const result = new DataConsistencyResult();
|
|
1529
|
+
result.json = json;
|
|
1530
|
+
return result;
|
|
1531
|
+
}
|
|
1532
|
+
}
|
|
1533
|
+
|
|
1534
|
+
class VerificationResult {
|
|
1535
|
+
constructor() {
|
|
1536
|
+
this.json = null;
|
|
1537
|
+
this._dataConsistency = null;
|
|
1538
|
+
this._aamvaBarcodeVerification = null;
|
|
1539
|
+
}
|
|
1540
|
+
get dataConsistency() {
|
|
1541
|
+
var _a;
|
|
1542
|
+
if (this._dataConsistency == null && ((_a = this.json) === null || _a === void 0 ? void 0 : _a.dataConsistencyResult) != null) {
|
|
1543
|
+
this._dataConsistency = DataConsistencyResult.fromJSON(this.json.dataConsistencyResult);
|
|
1544
|
+
}
|
|
1545
|
+
return this._dataConsistency;
|
|
1546
|
+
}
|
|
1547
|
+
get aamvaBarcodeVerification() {
|
|
1548
|
+
var _a;
|
|
1549
|
+
if (this._aamvaBarcodeVerification == null && ((_a = this.json) === null || _a === void 0 ? void 0 : _a.aamvaBarcodeVerification) != null) {
|
|
1550
|
+
this._aamvaBarcodeVerification = AamvaBarcodeVerificationResult.fromJSON(this.json.aamvaBarcodeVerification);
|
|
1551
|
+
}
|
|
1552
|
+
return this._aamvaBarcodeVerification;
|
|
1553
|
+
}
|
|
1554
|
+
static fromJSON(json) {
|
|
1555
|
+
if (json === null || json === undefined) {
|
|
1556
|
+
return new VerificationResult();
|
|
1557
|
+
}
|
|
1558
|
+
const result = new VerificationResult();
|
|
1559
|
+
result.json = json;
|
|
1560
|
+
return result;
|
|
1561
|
+
}
|
|
1562
|
+
}
|
|
1563
|
+
|
|
1564
|
+
class CapturedId {
|
|
1565
|
+
constructor() {
|
|
1566
|
+
this._document = null;
|
|
1567
|
+
this._mobileDocument = null;
|
|
1568
|
+
this._mobileDocumentOcr = null;
|
|
1569
|
+
this._verificationResult = null;
|
|
1570
|
+
}
|
|
1571
|
+
get age() {
|
|
1572
|
+
return this.json.age;
|
|
1573
|
+
}
|
|
1574
|
+
get isExpired() {
|
|
1575
|
+
return this.json.isExpired;
|
|
1576
|
+
}
|
|
1577
|
+
get isCitizenPassport() {
|
|
1578
|
+
return this.json.isCitizenPassport;
|
|
1579
|
+
}
|
|
1580
|
+
get document() {
|
|
1581
|
+
return this._document;
|
|
1582
|
+
}
|
|
1583
|
+
get issuingCountryIso() {
|
|
1584
|
+
return this.json.issuingCountryIso;
|
|
1585
|
+
}
|
|
1586
|
+
get issuingCountry() {
|
|
1587
|
+
return this.json.issuingCountry;
|
|
1588
|
+
}
|
|
1589
|
+
get documentAdditionalNumber() {
|
|
1590
|
+
return this.json.documentAdditionalNumber;
|
|
1493
1591
|
}
|
|
1494
1592
|
get barcode() {
|
|
1495
1593
|
if (this._barcodeResult == null && this.json.barcodeResult != null) {
|
|
@@ -1553,20 +1651,56 @@ class CapturedId {
|
|
|
1553
1651
|
get images() {
|
|
1554
1652
|
return this._images;
|
|
1555
1653
|
}
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1654
|
+
get firstName() { return this.json.firstName; }
|
|
1655
|
+
get lastName() { return this.json.lastName; }
|
|
1656
|
+
get fullName() { return this.json.fullName; }
|
|
1657
|
+
get sex() { return this.json.sex; }
|
|
1658
|
+
get dateOfBirth() { return DateResult.fromJSON(this.json.dateOfBirth); }
|
|
1659
|
+
get nationality() { return this.json.nationality; }
|
|
1660
|
+
get address() { return this.json.address; }
|
|
1661
|
+
get documentNumber() { return this.json.documentNumber; }
|
|
1662
|
+
get dateOfExpiry() { return DateResult.fromJSON(this.json.dateOfExpiry); }
|
|
1663
|
+
get dateOfIssue() { return DateResult.fromJSON(this.json.dateOfIssue); }
|
|
1664
|
+
get sexType() {
|
|
1665
|
+
if (this.json.sex) {
|
|
1666
|
+
return this.json.sex;
|
|
1561
1667
|
}
|
|
1562
|
-
|
|
1563
|
-
|
|
1668
|
+
return Sex.Unspecified;
|
|
1669
|
+
}
|
|
1670
|
+
get mobileDocument() {
|
|
1671
|
+
if (this._mobileDocument === null && this.json.mobileDocument !== null) {
|
|
1672
|
+
this._mobileDocument = MobileDocumentResult.fromJSON(this.json.mobileDocument);
|
|
1673
|
+
}
|
|
1674
|
+
return this._mobileDocument;
|
|
1675
|
+
}
|
|
1676
|
+
/**
|
|
1677
|
+
* The additional information extracted from a mobile document using optical character recognition (OCR).
|
|
1678
|
+
* Returns null if not available.
|
|
1679
|
+
*/
|
|
1680
|
+
get mobileDocumentOcr() {
|
|
1681
|
+
if (this._mobileDocumentOcr === null && this.json.mobileDocumentOcrResult !== null) {
|
|
1682
|
+
this._mobileDocumentOcr = MobileDocumentOCRResult
|
|
1683
|
+
.fromJSON(this.json.mobileDocumentOcrResult);
|
|
1564
1684
|
}
|
|
1565
|
-
|
|
1566
|
-
|
|
1685
|
+
return this._mobileDocumentOcr;
|
|
1686
|
+
}
|
|
1687
|
+
get verificationResult() {
|
|
1688
|
+
if (this._verificationResult === null) {
|
|
1689
|
+
this._verificationResult = VerificationResult.fromJSON(this.json.verificationResult);
|
|
1567
1690
|
}
|
|
1568
|
-
|
|
1569
|
-
|
|
1691
|
+
return this._verificationResult;
|
|
1692
|
+
}
|
|
1693
|
+
get anonymizedFields() {
|
|
1694
|
+
return this.json.anonymizedFields.map(field => field);
|
|
1695
|
+
}
|
|
1696
|
+
isAnonymized(field) {
|
|
1697
|
+
return this.json.anonymizedFields.includes(field);
|
|
1698
|
+
}
|
|
1699
|
+
static fromJSON(json) {
|
|
1700
|
+
const result = new CapturedId();
|
|
1701
|
+
result.json = json;
|
|
1702
|
+
if (result.json.documentType) {
|
|
1703
|
+
result._document = this.getDocument(result.issuingCountry, result.json.documentType, result.json.documentSubtype);
|
|
1570
1704
|
}
|
|
1571
1705
|
result._images = IdImages.fromJSON(json.imageInfo);
|
|
1572
1706
|
return result;
|
|
@@ -1596,15 +1730,124 @@ class CapturedId {
|
|
|
1596
1730
|
}
|
|
1597
1731
|
}
|
|
1598
1732
|
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1733
|
+
/*
|
|
1734
|
+
* This file is part of the Scandit Data Capture SDK
|
|
1735
|
+
*
|
|
1736
|
+
* Copyright (C) 2025 Scandit AG. All rights reserved.
|
|
1737
|
+
*/
|
|
1738
|
+
var IdFieldType;
|
|
1739
|
+
(function (IdFieldType) {
|
|
1740
|
+
IdFieldType["AdditionalAddressInformation"] = "additionalAddressInformation";
|
|
1741
|
+
IdFieldType["AdditionalNameInformation"] = "additionalNameInformation";
|
|
1742
|
+
IdFieldType["Address"] = "address";
|
|
1743
|
+
IdFieldType["Age"] = "age";
|
|
1744
|
+
IdFieldType["BarcodeDictionary"] = "barcodeDictionary";
|
|
1745
|
+
IdFieldType["BloodType"] = "bloodType";
|
|
1746
|
+
IdFieldType["DateOfBirth"] = "dateOfBirth";
|
|
1747
|
+
IdFieldType["DateOfExpiry"] = "dateOfExpiry";
|
|
1748
|
+
IdFieldType["DateOfIssue"] = "dateOfIssue";
|
|
1749
|
+
IdFieldType["DocumentAdditionalNumber"] = "documentAdditionalNumber";
|
|
1750
|
+
IdFieldType["DocumentNumber"] = "documentNumber";
|
|
1751
|
+
IdFieldType["Employer"] = "employer";
|
|
1752
|
+
IdFieldType["FathersName"] = "fathersName";
|
|
1753
|
+
IdFieldType["FirstName"] = "firstName";
|
|
1754
|
+
IdFieldType["FullName"] = "fullName";
|
|
1755
|
+
IdFieldType["IssuingAuthority"] = "issuingAuthority";
|
|
1756
|
+
IdFieldType["LastName"] = "lastName";
|
|
1757
|
+
IdFieldType["MaritalStatus"] = "maritalStatus";
|
|
1758
|
+
IdFieldType["MothersName"] = "mothersName";
|
|
1759
|
+
IdFieldType["MrzOptionalDataInLine1"] = "mrzOptionalDataInLine1";
|
|
1760
|
+
IdFieldType["MrzOptionalDataInLine2"] = "mrzOptionalDataInLine2";
|
|
1761
|
+
IdFieldType["Nationality"] = "nationality";
|
|
1762
|
+
IdFieldType["PersonalIdNumber"] = "personalIdNumber";
|
|
1763
|
+
IdFieldType["PlaceOfBirth"] = "placeOfBirth";
|
|
1764
|
+
IdFieldType["Profession"] = "profession";
|
|
1765
|
+
IdFieldType["Race"] = "race";
|
|
1766
|
+
IdFieldType["Religion"] = "religion";
|
|
1767
|
+
IdFieldType["ResidentialStatus"] = "residentialStatus";
|
|
1768
|
+
IdFieldType["Sex"] = "sex";
|
|
1769
|
+
})(IdFieldType || (IdFieldType = {}));
|
|
1770
|
+
|
|
1771
|
+
var MobileDocumentDataElement;
|
|
1772
|
+
(function (MobileDocumentDataElement) {
|
|
1773
|
+
MobileDocumentDataElement["FamilyName"] = "familyName";
|
|
1774
|
+
MobileDocumentDataElement["GivenName"] = "givenName";
|
|
1775
|
+
MobileDocumentDataElement["BirthDate"] = "birthDate";
|
|
1776
|
+
MobileDocumentDataElement["IssueDate"] = "issueDate";
|
|
1777
|
+
MobileDocumentDataElement["ExpiryDate"] = "expiryDate";
|
|
1778
|
+
MobileDocumentDataElement["IssuingCountry"] = "issuingCountry";
|
|
1779
|
+
MobileDocumentDataElement["IssuingAuthority"] = "issuingAuthority";
|
|
1780
|
+
MobileDocumentDataElement["DocumentNumber"] = "documentNumber";
|
|
1781
|
+
MobileDocumentDataElement["Portrait"] = "portrait";
|
|
1782
|
+
MobileDocumentDataElement["DrivingPrivileges"] = "drivingPrivileges";
|
|
1783
|
+
MobileDocumentDataElement["AdministrativeNumber"] = "administrativeNumber";
|
|
1784
|
+
MobileDocumentDataElement["SexIso"] = "sexIso";
|
|
1785
|
+
MobileDocumentDataElement["Height"] = "height";
|
|
1786
|
+
MobileDocumentDataElement["Weight"] = "weight";
|
|
1787
|
+
MobileDocumentDataElement["EyeColour"] = "eyeColour";
|
|
1788
|
+
MobileDocumentDataElement["HairColour"] = "hairColour";
|
|
1789
|
+
MobileDocumentDataElement["BirthPlace"] = "birthPlace";
|
|
1790
|
+
MobileDocumentDataElement["ResidentAddress"] = "residentAddress";
|
|
1791
|
+
MobileDocumentDataElement["IssuingJurisdiction"] = "issuingJurisdiction";
|
|
1792
|
+
MobileDocumentDataElement["Nationality"] = "nationality";
|
|
1793
|
+
MobileDocumentDataElement["NameSuffix"] = "nameSuffix";
|
|
1794
|
+
MobileDocumentDataElement["FamilyNameTruncation"] = "familyNameTruncation";
|
|
1795
|
+
MobileDocumentDataElement["GivenNameTruncation"] = "givenNameTruncation";
|
|
1796
|
+
MobileDocumentDataElement["AkaFamilyName"] = "akaFamilyName";
|
|
1797
|
+
MobileDocumentDataElement["AkaGivenName"] = "akaGivenName";
|
|
1798
|
+
MobileDocumentDataElement["AkaSuffix"] = "akaSuffix";
|
|
1799
|
+
MobileDocumentDataElement["WeightRange"] = "weightRange";
|
|
1800
|
+
MobileDocumentDataElement["RaceEthnicity"] = "raceEthnicity";
|
|
1801
|
+
MobileDocumentDataElement["ResidentCounty"] = "residentCounty";
|
|
1802
|
+
MobileDocumentDataElement["SexAamva"] = "sexAamva";
|
|
1803
|
+
MobileDocumentDataElement["AamvaVersion"] = "aamvaVersion";
|
|
1804
|
+
})(MobileDocumentDataElement || (MobileDocumentDataElement = {}));
|
|
1805
|
+
|
|
1806
|
+
class IdCaptureController extends BaseNewController {
|
|
1807
|
+
constructor(idCapture = null) {
|
|
1808
|
+
super('IdCaptureProxy');
|
|
1809
|
+
this.idCapture = null;
|
|
1810
|
+
this.idCapture = idCapture;
|
|
1811
|
+
}
|
|
1812
|
+
reset() {
|
|
1813
|
+
return this._proxy.$resetIdCaptureMode({ modeId: this.modeId });
|
|
1814
|
+
}
|
|
1815
|
+
setModeEnabledState(enabled) {
|
|
1816
|
+
this._proxy.$setModeEnabledState({ modeId: this.modeId, enabled: enabled });
|
|
1817
|
+
}
|
|
1818
|
+
updateIdCaptureMode() {
|
|
1819
|
+
if (this.idCapture == null) {
|
|
1820
|
+
throw new Error('IdCaptureController is not initialized with an IdCapture instance');
|
|
1821
|
+
}
|
|
1822
|
+
return this._proxy.$updateIdCaptureMode({ modeJson: JSON.stringify(this.idCapture.toJSON()), modeId: this.modeId });
|
|
1602
1823
|
}
|
|
1824
|
+
applyIdCaptureModeSettings(newSettings) {
|
|
1825
|
+
return this._proxy.$applyIdCaptureModeSettings({ settingsJson: JSON.stringify(newSettings.toJSON()), modeId: this.modeId });
|
|
1826
|
+
}
|
|
1827
|
+
updateFeedback(feedback) {
|
|
1828
|
+
return this._proxy.$updateFeedback({ feedbackJson: JSON.stringify(feedback.toJSON()), modeId: this.modeId });
|
|
1829
|
+
}
|
|
1830
|
+
get modeId() {
|
|
1831
|
+
return this.idCapture.modeId;
|
|
1832
|
+
}
|
|
1833
|
+
}
|
|
1834
|
+
|
|
1835
|
+
var IdCaptureListenerEvents;
|
|
1836
|
+
(function (IdCaptureListenerEvents) {
|
|
1837
|
+
IdCaptureListenerEvents["didCapture"] = "IdCaptureListener.didCaptureId";
|
|
1838
|
+
IdCaptureListenerEvents["didReject"] = "IdCaptureListener.didRejectId";
|
|
1839
|
+
})(IdCaptureListenerEvents || (IdCaptureListenerEvents = {}));
|
|
1840
|
+
class IdCaptureListenerController extends BaseNewController {
|
|
1603
1841
|
constructor(idCapture) {
|
|
1842
|
+
super('IdCaptureListenerProxy');
|
|
1604
1843
|
this.hasListeners = false;
|
|
1605
|
-
this.
|
|
1844
|
+
this.handleDidCaptureWrapper = (ev) => __awaiter(this, void 0, void 0, function* () {
|
|
1845
|
+
return this.handleDidCapture(ev);
|
|
1846
|
+
});
|
|
1847
|
+
this.handleDidRejectWrapper = (ev) => __awaiter(this, void 0, void 0, function* () {
|
|
1848
|
+
return this.handleDidReject(ev);
|
|
1849
|
+
});
|
|
1606
1850
|
this.idCapture = idCapture;
|
|
1607
|
-
this._proxy.isModeEnabled = () => idCapture.isEnabled;
|
|
1608
1851
|
this.initialize();
|
|
1609
1852
|
}
|
|
1610
1853
|
initialize() {
|
|
@@ -1615,27 +1858,34 @@ class IdCaptureListenerController {
|
|
|
1615
1858
|
});
|
|
1616
1859
|
}
|
|
1617
1860
|
subscribeListener() {
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1861
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1862
|
+
if (this.hasListeners) {
|
|
1863
|
+
return;
|
|
1864
|
+
}
|
|
1865
|
+
this._proxy.subscribeForEvents(Object.values(IdCaptureListenerEvents));
|
|
1866
|
+
this._proxy.eventEmitter.on(IdCaptureListenerEvents.didCapture, this.handleDidCaptureWrapper);
|
|
1867
|
+
this._proxy.eventEmitter.on(IdCaptureListenerEvents.didReject, this.handleDidRejectWrapper);
|
|
1868
|
+
yield this._proxy.$addIdCaptureListener({ modeId: this.modeId });
|
|
1869
|
+
this.hasListeners = true;
|
|
1870
|
+
});
|
|
1871
|
+
}
|
|
1872
|
+
handleDidCapture(ev) {
|
|
1873
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1874
|
+
const event = EventDataParser.parse(ev.data);
|
|
1625
1875
|
if (event === null) {
|
|
1626
1876
|
console.error('IdCaptureListenerController didCapture payload is null');
|
|
1627
1877
|
return;
|
|
1628
1878
|
}
|
|
1629
1879
|
const capturedIdJson = JSON.parse(event.id);
|
|
1630
|
-
|
|
1631
|
-
capturedIdJson.imageInfo = event.imageInfo;
|
|
1632
|
-
}
|
|
1880
|
+
this.enrichCapturedIdJson(capturedIdJson, event.imageInfo, event.frontReviewImage);
|
|
1633
1881
|
const captureId = CapturedId.fromJSON(capturedIdJson);
|
|
1634
1882
|
this.notifyListenersOfDidCapture(captureId);
|
|
1635
|
-
this._proxy
|
|
1883
|
+
this._proxy.$finishDidCaptureCallback({ modeId: this.modeId, enabled: this.idCapture.isEnabled });
|
|
1636
1884
|
});
|
|
1637
|
-
|
|
1638
|
-
|
|
1885
|
+
}
|
|
1886
|
+
handleDidReject(ev) {
|
|
1887
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1888
|
+
const event = EventDataParser.parse(ev.data);
|
|
1639
1889
|
if (event === null) {
|
|
1640
1890
|
console.error('IdCaptureListenerController didReject payload is null');
|
|
1641
1891
|
return;
|
|
@@ -1643,24 +1893,24 @@ class IdCaptureListenerController {
|
|
|
1643
1893
|
let rejectedId = null;
|
|
1644
1894
|
if (event.id != null) {
|
|
1645
1895
|
const rejectedIdJson = JSON.parse(event.id);
|
|
1646
|
-
|
|
1647
|
-
rejectedIdJson.imageInfo = event.imageInfo;
|
|
1648
|
-
}
|
|
1896
|
+
this.enrichCapturedIdJson(rejectedIdJson, event.imageInfo, event.frontReviewImage);
|
|
1649
1897
|
rejectedId = CapturedId.fromJSON(rejectedIdJson);
|
|
1650
1898
|
}
|
|
1651
1899
|
this.notifyListenersOfDidReject(rejectedId, event.rejectionReason);
|
|
1652
|
-
this._proxy
|
|
1900
|
+
this._proxy.$finishDidRejectCallback({ modeId: this.modeId, enabled: this.idCapture.isEnabled });
|
|
1653
1901
|
});
|
|
1654
|
-
this.hasListeners = true;
|
|
1655
1902
|
}
|
|
1656
1903
|
unsubscribeListener() {
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1904
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1905
|
+
if (!this.hasListeners) {
|
|
1906
|
+
return;
|
|
1907
|
+
}
|
|
1908
|
+
yield this._proxy.$removeIdCaptureListener({ modeId: this.modeId });
|
|
1909
|
+
this._proxy.unsubscribeFromEvents(Object.values(IdCaptureListenerEvents));
|
|
1910
|
+
this._proxy.eventEmitter.off(IdCaptureListenerEvents.didCapture, this.handleDidCaptureWrapper);
|
|
1911
|
+
this._proxy.eventEmitter.off(IdCaptureListenerEvents.didReject, this.handleDidRejectWrapper);
|
|
1912
|
+
this.hasListeners = false;
|
|
1913
|
+
});
|
|
1664
1914
|
}
|
|
1665
1915
|
notifyListenersOfDidCapture(captureId) {
|
|
1666
1916
|
const mode = this.idCapture;
|
|
@@ -1678,8 +1928,21 @@ class IdCaptureListenerController {
|
|
|
1678
1928
|
}
|
|
1679
1929
|
});
|
|
1680
1930
|
}
|
|
1931
|
+
enrichCapturedIdJson(capturedIdJson, imageInfo, frontReviewImage) {
|
|
1932
|
+
var _a;
|
|
1933
|
+
if (imageInfo) {
|
|
1934
|
+
capturedIdJson.imageInfo = imageInfo;
|
|
1935
|
+
}
|
|
1936
|
+
if (frontReviewImage && ((_a = capturedIdJson.verificationResult) === null || _a === void 0 ? void 0 : _a.dataConsistencyResult)) {
|
|
1937
|
+
capturedIdJson.verificationResult.dataConsistencyResult.frontReviewImage = frontReviewImage;
|
|
1938
|
+
}
|
|
1939
|
+
}
|
|
1681
1940
|
dispose() {
|
|
1682
1941
|
this.unsubscribeListener();
|
|
1942
|
+
this._proxy.dispose();
|
|
1943
|
+
}
|
|
1944
|
+
get modeId() {
|
|
1945
|
+
return this.idCapture.modeId;
|
|
1683
1946
|
}
|
|
1684
1947
|
}
|
|
1685
1948
|
|
|
@@ -1714,6 +1977,12 @@ class IdCaptureFeedback extends DefaultSerializeable {
|
|
|
1714
1977
|
this._idRejected = idRejected;
|
|
1715
1978
|
this.updateFeedback();
|
|
1716
1979
|
}
|
|
1980
|
+
static get defaultSuccessSound() {
|
|
1981
|
+
return IdCaptureFeedback.idDefaults.IdCapture.DefaultSuccessSound;
|
|
1982
|
+
}
|
|
1983
|
+
static get defaultFailureSound() {
|
|
1984
|
+
return IdCaptureFeedback.idDefaults.IdCapture.DefaultFailureSound;
|
|
1985
|
+
}
|
|
1717
1986
|
static fromJSON(json) {
|
|
1718
1987
|
const idCaptured = Feedback.fromJSON(json.idCaptured);
|
|
1719
1988
|
const idRejected = Feedback.fromJSON(json.idRejected);
|
|
@@ -1749,13 +2018,6 @@ __decorate([
|
|
|
1749
2018
|
], IdCaptureFeedback, "idDefaults", null);
|
|
1750
2019
|
|
|
1751
2020
|
class IdCapture extends DefaultSerializeable {
|
|
1752
|
-
get isEnabled() {
|
|
1753
|
-
return this._isEnabled;
|
|
1754
|
-
}
|
|
1755
|
-
set isEnabled(isEnabled) {
|
|
1756
|
-
this._isEnabled = isEnabled;
|
|
1757
|
-
this.controller.setModeEnabledState(isEnabled);
|
|
1758
|
-
}
|
|
1759
2021
|
get context() {
|
|
1760
2022
|
return this._context;
|
|
1761
2023
|
}
|
|
@@ -1770,14 +2032,19 @@ class IdCapture extends DefaultSerializeable {
|
|
|
1770
2032
|
static createRecommendedCameraSettings() {
|
|
1771
2033
|
return new CameraSettings(IdCapture.idCaptureDefaults.IdCapture.RecommendedCameraSettings);
|
|
1772
2034
|
}
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
2035
|
+
get isEnabled() {
|
|
2036
|
+
return this._isEnabled;
|
|
2037
|
+
}
|
|
2038
|
+
set isEnabled(isEnabled) {
|
|
2039
|
+
this._isEnabled = isEnabled;
|
|
2040
|
+
this.controller.setModeEnabledState(isEnabled);
|
|
2041
|
+
}
|
|
2042
|
+
get externalTransactionId() {
|
|
2043
|
+
return this._externalTransactionId;
|
|
2044
|
+
}
|
|
2045
|
+
set externalTransactionId(externalTransactionId) {
|
|
2046
|
+
this._externalTransactionId = externalTransactionId;
|
|
2047
|
+
this.controller.updateIdCaptureMode();
|
|
1781
2048
|
}
|
|
1782
2049
|
get _context() {
|
|
1783
2050
|
return this.privateContext;
|
|
@@ -1796,29 +2063,17 @@ class IdCapture extends DefaultSerializeable {
|
|
|
1796
2063
|
static get idCaptureDefaults() {
|
|
1797
2064
|
return FactoryMaker.getInstance('IdDefaults');
|
|
1798
2065
|
}
|
|
1799
|
-
/**
|
|
1800
|
-
* @deprecated Since 7.6. This factory will be removed in 8.0.
|
|
1801
|
-
* Use the public constructor instead and configure the instance manually:
|
|
1802
|
-
* ```ts
|
|
1803
|
-
* const idCapture = new IdCapture(settings);
|
|
1804
|
-
* context.addMode(idCapture);
|
|
1805
|
-
* ```
|
|
1806
|
-
*/
|
|
1807
|
-
static forContext(context, settings) {
|
|
1808
|
-
const idCapture = new IdCapture(settings);
|
|
1809
|
-
if (context) {
|
|
1810
|
-
context.addMode(idCapture);
|
|
1811
|
-
}
|
|
1812
|
-
return idCapture;
|
|
1813
|
-
}
|
|
1814
2066
|
constructor(settings) {
|
|
1815
2067
|
super();
|
|
1816
2068
|
this.type = 'idCapture';
|
|
1817
2069
|
this.modeId = Math.floor(Math.random() * 100000000);
|
|
2070
|
+
this.parentId = null;
|
|
1818
2071
|
this._isEnabled = true;
|
|
2072
|
+
this._externalTransactionId = null;
|
|
1819
2073
|
this._feedback = IdCaptureFeedback.defaultFeedback;
|
|
1820
2074
|
this.privateContext = null;
|
|
1821
2075
|
this.listeners = [];
|
|
2076
|
+
this._hasListeners = false;
|
|
1822
2077
|
this.listenerController = null;
|
|
1823
2078
|
this.isInListenerCallback = false;
|
|
1824
2079
|
this.settings = settings;
|
|
@@ -1830,33 +2085,45 @@ class IdCapture extends DefaultSerializeable {
|
|
|
1830
2085
|
return this.controller.applyIdCaptureModeSettings(settings);
|
|
1831
2086
|
}
|
|
1832
2087
|
addListener(listener) {
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
2088
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2089
|
+
var _a;
|
|
2090
|
+
if (this.listeners.includes(listener)) {
|
|
2091
|
+
return;
|
|
2092
|
+
}
|
|
2093
|
+
this.listeners.push(listener);
|
|
2094
|
+
if (this.listeners.length === 0) {
|
|
2095
|
+
yield ((_a = this.listenerController) === null || _a === void 0 ? void 0 : _a.subscribeListener());
|
|
2096
|
+
}
|
|
2097
|
+
this._hasListeners = this.listeners.length > 0;
|
|
2098
|
+
});
|
|
1841
2099
|
}
|
|
1842
2100
|
removeListener(listener) {
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
(
|
|
1850
|
-
|
|
2101
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2102
|
+
var _a;
|
|
2103
|
+
if (!this.listeners.includes(listener)) {
|
|
2104
|
+
return;
|
|
2105
|
+
}
|
|
2106
|
+
this.listeners.splice(this.listeners.indexOf(listener), 1);
|
|
2107
|
+
if (this.listeners.length === 0) {
|
|
2108
|
+
yield ((_a = this.listenerController) === null || _a === void 0 ? void 0 : _a.unsubscribeListener());
|
|
2109
|
+
}
|
|
2110
|
+
this._hasListeners = this.listeners.length > 0;
|
|
2111
|
+
});
|
|
1851
2112
|
}
|
|
1852
2113
|
reset() {
|
|
1853
2114
|
return this.controller.reset();
|
|
1854
2115
|
}
|
|
1855
2116
|
}
|
|
1856
|
-
IdCapture._recommendedCameraSettings = null;
|
|
1857
2117
|
__decorate([
|
|
1858
|
-
|
|
2118
|
+
nameForSerialization('parentId'),
|
|
2119
|
+
ignoreFromSerializationIfNull
|
|
2120
|
+
], IdCapture.prototype, "parentId", void 0);
|
|
2121
|
+
__decorate([
|
|
2122
|
+
nameForSerialization('enabled')
|
|
1859
2123
|
], IdCapture.prototype, "_isEnabled", void 0);
|
|
2124
|
+
__decorate([
|
|
2125
|
+
nameForSerialization('externalTransactionId')
|
|
2126
|
+
], IdCapture.prototype, "_externalTransactionId", void 0);
|
|
1860
2127
|
__decorate([
|
|
1861
2128
|
nameForSerialization('feedback')
|
|
1862
2129
|
], IdCapture.prototype, "_feedback", void 0);
|
|
@@ -1866,6 +2133,9 @@ __decorate([
|
|
|
1866
2133
|
__decorate([
|
|
1867
2134
|
ignoreFromSerialization
|
|
1868
2135
|
], IdCapture.prototype, "listeners", void 0);
|
|
2136
|
+
__decorate([
|
|
2137
|
+
nameForSerialization('hasListeners')
|
|
2138
|
+
], IdCapture.prototype, "_hasListeners", void 0);
|
|
1869
2139
|
__decorate([
|
|
1870
2140
|
ignoreFromSerialization
|
|
1871
2141
|
], IdCapture.prototype, "controller", void 0);
|
|
@@ -1909,27 +2179,11 @@ class IdCaptureOverlay extends DefaultSerializeable {
|
|
|
1909
2179
|
static get idCaptureDefaults() {
|
|
1910
2180
|
return FactoryMaker.getInstance('IdDefaults');
|
|
1911
2181
|
}
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
* Use the public constructor instead and add the overlay to the view manually:
|
|
1915
|
-
* const overlay = new IdCaptureOverlay(idCapture);
|
|
1916
|
-
* view.addOverlay(overlay);
|
|
1917
|
-
*/
|
|
1918
|
-
static withIdCapture(idCapture) {
|
|
1919
|
-
return IdCaptureOverlay.withIdCaptureForView(idCapture, null);
|
|
2182
|
+
static get defaultIdLayoutStyle() {
|
|
2183
|
+
return IdCaptureOverlay.idCaptureDefaults.IdCapture.IdCaptureOverlayDefaults.defaultIdLayoutStyle;
|
|
1920
2184
|
}
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
* Use the public constructor instead and add the overlay to the view manually:
|
|
1924
|
-
* const overlay = new IdCaptureOverlay(idCapture);
|
|
1925
|
-
* view.addOverlay(overlay);
|
|
1926
|
-
*/
|
|
1927
|
-
static withIdCaptureForView(idCapture, view) {
|
|
1928
|
-
const overlay = new IdCaptureOverlay(idCapture);
|
|
1929
|
-
if (view) {
|
|
1930
|
-
view.addOverlay(overlay);
|
|
1931
|
-
}
|
|
1932
|
-
return overlay;
|
|
2185
|
+
static get defaultIdLayoutLineStyle() {
|
|
2186
|
+
return IdCaptureOverlay.idCaptureDefaults.IdCapture.IdCaptureOverlayDefaults.defaultIdLayoutLineStyle;
|
|
1933
2187
|
}
|
|
1934
2188
|
constructor(mode) {
|
|
1935
2189
|
super();
|
|
@@ -2062,6 +2316,34 @@ __decorate([
|
|
|
2062
2316
|
__decorate([
|
|
2063
2317
|
ignoreFromSerialization
|
|
2064
2318
|
], IdCaptureOverlay, "idCaptureDefaults", null);
|
|
2319
|
+
__decorate([
|
|
2320
|
+
ignoreFromSerialization
|
|
2321
|
+
], IdCaptureOverlay, "defaultIdLayoutStyle", null);
|
|
2322
|
+
__decorate([
|
|
2323
|
+
ignoreFromSerialization
|
|
2324
|
+
], IdCaptureOverlay, "defaultIdLayoutLineStyle", null);
|
|
2325
|
+
|
|
2326
|
+
class IdCaptureScanner extends DefaultSerializeable {
|
|
2327
|
+
constructor(physicalDocumentScanner, mobileDocumentScanner) {
|
|
2328
|
+
super();
|
|
2329
|
+
this._physicalDocumentScanner = physicalDocumentScanner !== null && physicalDocumentScanner !== void 0 ? physicalDocumentScanner : null;
|
|
2330
|
+
this._mobileDocumentScanner = mobileDocumentScanner !== null && mobileDocumentScanner !== void 0 ? mobileDocumentScanner : null;
|
|
2331
|
+
}
|
|
2332
|
+
get physicalDocument() {
|
|
2333
|
+
return this._physicalDocumentScanner;
|
|
2334
|
+
}
|
|
2335
|
+
get mobileDocument() {
|
|
2336
|
+
return this._mobileDocumentScanner;
|
|
2337
|
+
}
|
|
2338
|
+
}
|
|
2339
|
+
__decorate([
|
|
2340
|
+
nameForSerialization('physicalDocument'),
|
|
2341
|
+
ignoreFromSerializationIfNull
|
|
2342
|
+
], IdCaptureScanner.prototype, "_physicalDocumentScanner", void 0);
|
|
2343
|
+
__decorate([
|
|
2344
|
+
nameForSerialization('mobileDocument'),
|
|
2345
|
+
ignoreFromSerializationIfNull
|
|
2346
|
+
], IdCaptureScanner.prototype, "_mobileDocumentScanner", void 0);
|
|
2065
2347
|
|
|
2066
2348
|
class SingleSideScanner extends DefaultSerializeable {
|
|
2067
2349
|
constructor(barcode, machineReadableZone, visualInspectionZone) {
|
|
@@ -2126,17 +2408,45 @@ __decorate([
|
|
|
2126
2408
|
ignoreFromSerialization
|
|
2127
2409
|
], FullDocumentScanner.prototype, "_visualInspectionZone", void 0);
|
|
2128
2410
|
|
|
2411
|
+
class MobileDocumentScanner extends DefaultSerializeable {
|
|
2412
|
+
constructor(iso180135, ocr, elementsToRetain) {
|
|
2413
|
+
super();
|
|
2414
|
+
this._iso180135 = iso180135;
|
|
2415
|
+
this._ocr = ocr;
|
|
2416
|
+
this._elementsToRetain = elementsToRetain !== null && elementsToRetain !== void 0 ? elementsToRetain : new Set();
|
|
2417
|
+
}
|
|
2418
|
+
get iso180135() {
|
|
2419
|
+
return this._iso180135;
|
|
2420
|
+
}
|
|
2421
|
+
get ocr() {
|
|
2422
|
+
return this._ocr;
|
|
2423
|
+
}
|
|
2424
|
+
get elementsToRetain() {
|
|
2425
|
+
return this._elementsToRetain;
|
|
2426
|
+
}
|
|
2427
|
+
}
|
|
2428
|
+
__decorate([
|
|
2429
|
+
nameForSerialization('iso18013_5')
|
|
2430
|
+
], MobileDocumentScanner.prototype, "_iso180135", void 0);
|
|
2431
|
+
__decorate([
|
|
2432
|
+
nameForSerialization('ocr')
|
|
2433
|
+
], MobileDocumentScanner.prototype, "_ocr", void 0);
|
|
2434
|
+
__decorate([
|
|
2435
|
+
nameForSerialization('elements_to_retain')
|
|
2436
|
+
], MobileDocumentScanner.prototype, "_elementsToRetain", void 0);
|
|
2437
|
+
|
|
2129
2438
|
class IdCaptureSettings extends DefaultSerializeable {
|
|
2130
2439
|
constructor() {
|
|
2131
2440
|
super();
|
|
2132
2441
|
this.properties = {};
|
|
2133
2442
|
this.imageToResult = {};
|
|
2443
|
+
this.anonymizationMap = {};
|
|
2134
2444
|
this.anonymizationMode = IdCaptureSettings.idCaptureDefaults.IdCapture.IdCaptureSettings.anonymizationMode;
|
|
2135
2445
|
this.rejectVoidedIds = IdCaptureSettings.idCaptureDefaults.IdCapture.IdCaptureSettings.rejectVoidedIds;
|
|
2136
2446
|
this.decodeBackOfEuropeanDrivingLicense = IdCaptureSettings.idCaptureDefaults.IdCapture.IdCaptureSettings.decodeBackOfEuropeanDrivingLicense;
|
|
2137
2447
|
this.acceptedDocuments = [];
|
|
2138
2448
|
this.rejectedDocuments = [];
|
|
2139
|
-
this.
|
|
2449
|
+
this.scanner = new IdCaptureScanner();
|
|
2140
2450
|
this.rejectExpiredIds = IdCaptureSettings.idCaptureDefaults.IdCapture.IdCaptureSettings.rejectExpiredIds;
|
|
2141
2451
|
this.rejectIdsExpiringIn = IdCaptureSettings.idCaptureDefaults.IdCapture.IdCaptureSettings.rejectIdsExpiringIn;
|
|
2142
2452
|
this.rejectNotRealIdCompliant = IdCaptureSettings.idCaptureDefaults.IdCapture.IdCaptureSettings.rejectNotRealIdCompliant;
|
|
@@ -2159,54 +2469,18 @@ class IdCaptureSettings extends DefaultSerializeable {
|
|
|
2159
2469
|
getShouldPassImageTypeToResult(type) {
|
|
2160
2470
|
return this.imageToResult[type] || false;
|
|
2161
2471
|
}
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
]
|
|
2166
|
-
|
|
2167
|
-
/**
|
|
2168
|
-
* @deprecated Replaced by IdCaptureSettings.rejectForgedAamvaBarcodes
|
|
2169
|
-
*/
|
|
2170
|
-
class AamvaBarcodeVerifier {
|
|
2171
|
-
constructor() {
|
|
2172
|
-
this.controller = new IdCaptureController(null);
|
|
2173
|
-
}
|
|
2174
|
-
static create(context) {
|
|
2175
|
-
const verifier = new AamvaBarcodeVerifier();
|
|
2176
|
-
return new Promise((resolve, reject) => {
|
|
2177
|
-
verifier
|
|
2178
|
-
.controller
|
|
2179
|
-
.createContextForBarcodeVerification(context)
|
|
2180
|
-
.then(() => {
|
|
2181
|
-
verifier.context = context;
|
|
2182
|
-
resolve(verifier);
|
|
2183
|
-
}, reject);
|
|
2184
|
-
});
|
|
2185
|
-
}
|
|
2186
|
-
verify(capturedId) {
|
|
2187
|
-
// Necessary for not exposing internal API on CapturedId, while only passing the private "json" property
|
|
2188
|
-
// to native iOS and Android.
|
|
2189
|
-
const capturedIdAsString = JSON.stringify(capturedId);
|
|
2190
|
-
const capturedIdJsonData = JSON.parse(capturedIdAsString).json;
|
|
2191
|
-
return new Promise((resolve, reject) => {
|
|
2192
|
-
this.controller
|
|
2193
|
-
.verifyCapturedIdAsync(JSON.stringify(capturedIdJsonData))
|
|
2194
|
-
.then((json) => {
|
|
2195
|
-
if (!json) {
|
|
2196
|
-
resolve(AamvaBarcodeVerificationResult
|
|
2197
|
-
.fromJSON(JSON.parse('{}')));
|
|
2198
|
-
}
|
|
2199
|
-
else {
|
|
2200
|
-
resolve(AamvaBarcodeVerificationResult
|
|
2201
|
-
.fromJSON(JSON.parse(json)));
|
|
2202
|
-
}
|
|
2203
|
-
}, reject);
|
|
2204
|
-
});
|
|
2472
|
+
addAnonymizedField(document, fieldType) {
|
|
2473
|
+
var _a;
|
|
2474
|
+
const key = JSON.stringify(document);
|
|
2475
|
+
this.anonymizationMap[key] = [...new Set([...((_a = this.anonymizationMap[key]) !== null && _a !== void 0 ? _a : []), fieldType.toString()])];
|
|
2205
2476
|
}
|
|
2206
2477
|
}
|
|
2478
|
+
__decorate([
|
|
2479
|
+
nameForSerialization('scannerType')
|
|
2480
|
+
], IdCaptureSettings.prototype, "scanner", void 0);
|
|
2207
2481
|
__decorate([
|
|
2208
2482
|
ignoreFromSerialization
|
|
2209
|
-
],
|
|
2483
|
+
], IdCaptureSettings, "idCaptureDefaults", null);
|
|
2210
2484
|
|
|
2211
|
-
export { AamvaBarcodeVerificationResult, AamvaBarcodeVerificationStatus,
|
|
2485
|
+
export { AamvaBarcodeVerificationResult, AamvaBarcodeVerificationStatus, BarcodeResult, CapturedId, CapturedSides, DataConsistencyCheck, DataConsistencyResult, DateResult, DriverLicense, DrivingLicenseCategory, DrivingLicenseDetails, Duration, FullDocumentScanner, HealthInsuranceCard, IdAnonymizationMode, IdCapture, IdCaptureController, IdCaptureDocumentType, IdCaptureFeedback, IdCaptureListenerController, IdCaptureListenerEvents, IdCaptureOverlay, IdCaptureOverlayController, IdCaptureRegion, IdCaptureScanner, IdCaptureSettings, IdCard, IdFieldType, IdImageType, IdImages, IdLayoutLineStyle, IdLayoutStyle, IdSide, MRZResult, MobileDocumentDataElement, MobileDocumentOCRResult, MobileDocumentResult, MobileDocumentScanner, Passport, ProfessionalDrivingPermit, RegionSpecific, RegionSpecificSubtype, RejectionReason, ResidencePermit, Sex, SingleSideScanner, TextHintPosition, UsRealIdStatus, VIZResult, VehicleRestriction, VerificationResult, VisaIcao, getIdDefaults, loadIdDefaults, parseIdDefaults };
|
|
2212
2486
|
//# sourceMappingURL=index.js.map
|