react-native-scanbot-sdk
Version:
Scanbot Document and Barcode Scanner SDK React Native Plugin for Android and iOS
1,091 lines (948 loc) • 33.8 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.MRZDocumentType = exports.MRZ = exports.EuropeanHealthInsuranceCardDocumentType = exports.EuropeanHealthInsuranceCard = exports.DeResidencePermitFrontDocumentType = exports.DeResidencePermitFront = exports.DeResidencePermitBackDocumentType = exports.DeResidencePermitBack = exports.DePassportDocumentType = exports.DePassport = exports.DeIdCardFrontDocumentType = exports.DeIdCardFront = exports.DeIdCardBackDocumentType = exports.DeIdCardBack = exports.DeHealthInsuranceCardFrontDocumentType = exports.DeHealthInsuranceCardFront = exports.DeDriverLicenseFrontDocumentType = exports.DeDriverLicenseFront = exports.DeDriverLicenseBackDocumentType = exports.DeDriverLicenseBackCategoryDocumentType = exports.DeDriverLicenseBackCategoriesTDocumentType = exports.DeDriverLicenseBackCategoriesLDocumentType = exports.DeDriverLicenseBackCategoriesDocumentType = exports.DeDriverLicenseBackCategoriesDEDocumentType = exports.DeDriverLicenseBackCategoriesDDocumentType = exports.DeDriverLicenseBackCategoriesD1EDocumentType = exports.DeDriverLicenseBackCategoriesD1DocumentType = exports.DeDriverLicenseBackCategoriesCEDocumentType = exports.DeDriverLicenseBackCategoriesCDocumentType = exports.DeDriverLicenseBackCategoriesC1EDocumentType = exports.DeDriverLicenseBackCategoriesC1DocumentType = exports.DeDriverLicenseBackCategoriesBEDocumentType = exports.DeDriverLicenseBackCategoriesBDocumentType = exports.DeDriverLicenseBackCategoriesB1DocumentType = exports.DeDriverLicenseBackCategoriesAMDocumentType = exports.DeDriverLicenseBackCategoriesADocumentType = exports.DeDriverLicenseBackCategoriesA2DocumentType = exports.DeDriverLicenseBackCategoriesA1DocumentType = exports.DeDriverLicenseBack = void 0;
/// All possible root document types.
const MRZDocumentType = exports.MRZDocumentType = 'MRZ';
const DeIdCardFrontDocumentType = exports.DeIdCardFrontDocumentType = 'DeIdCardFront';
const DeIdCardBackDocumentType = exports.DeIdCardBackDocumentType = 'DeIdCardBack';
const DePassportDocumentType = exports.DePassportDocumentType = 'DePassport';
const DeDriverLicenseFrontDocumentType = exports.DeDriverLicenseFrontDocumentType = 'DeDriverLicenseFront';
const DeDriverLicenseBackDocumentType = exports.DeDriverLicenseBackDocumentType = 'DeDriverLicenseBack';
const DeDriverLicenseBackCategoryDocumentType = exports.DeDriverLicenseBackCategoryDocumentType = 'Category';
const DeDriverLicenseBackCategoriesDocumentType = exports.DeDriverLicenseBackCategoriesDocumentType = 'Categories';
const DeDriverLicenseBackCategoriesADocumentType = exports.DeDriverLicenseBackCategoriesADocumentType = 'A';
const DeDriverLicenseBackCategoriesA1DocumentType = exports.DeDriverLicenseBackCategoriesA1DocumentType = 'A1';
const DeDriverLicenseBackCategoriesA2DocumentType = exports.DeDriverLicenseBackCategoriesA2DocumentType = 'A2';
const DeDriverLicenseBackCategoriesAMDocumentType = exports.DeDriverLicenseBackCategoriesAMDocumentType = 'AM';
const DeDriverLicenseBackCategoriesBDocumentType = exports.DeDriverLicenseBackCategoriesBDocumentType = 'B';
const DeDriverLicenseBackCategoriesB1DocumentType = exports.DeDriverLicenseBackCategoriesB1DocumentType = 'B1';
const DeDriverLicenseBackCategoriesBEDocumentType = exports.DeDriverLicenseBackCategoriesBEDocumentType = 'BE';
const DeDriverLicenseBackCategoriesCDocumentType = exports.DeDriverLicenseBackCategoriesCDocumentType = 'C';
const DeDriverLicenseBackCategoriesC1DocumentType = exports.DeDriverLicenseBackCategoriesC1DocumentType = 'C1';
const DeDriverLicenseBackCategoriesC1EDocumentType = exports.DeDriverLicenseBackCategoriesC1EDocumentType = 'C1E';
const DeDriverLicenseBackCategoriesCEDocumentType = exports.DeDriverLicenseBackCategoriesCEDocumentType = 'CE';
const DeDriverLicenseBackCategoriesDDocumentType = exports.DeDriverLicenseBackCategoriesDDocumentType = 'D';
const DeDriverLicenseBackCategoriesD1DocumentType = exports.DeDriverLicenseBackCategoriesD1DocumentType = 'D1';
const DeDriverLicenseBackCategoriesD1EDocumentType = exports.DeDriverLicenseBackCategoriesD1EDocumentType = 'D1E';
const DeDriverLicenseBackCategoriesDEDocumentType = exports.DeDriverLicenseBackCategoriesDEDocumentType = 'DE';
const DeDriverLicenseBackCategoriesLDocumentType = exports.DeDriverLicenseBackCategoriesLDocumentType = 'L';
const DeDriverLicenseBackCategoriesTDocumentType = exports.DeDriverLicenseBackCategoriesTDocumentType = 'T';
const DeResidencePermitFrontDocumentType = exports.DeResidencePermitFrontDocumentType = 'DeResidencePermitFront';
const DeResidencePermitBackDocumentType = exports.DeResidencePermitBackDocumentType = 'DeResidencePermitBack';
const EuropeanHealthInsuranceCardDocumentType = exports.EuropeanHealthInsuranceCardDocumentType = 'EuropeanHealthInsuranceCard';
const DeHealthInsuranceCardFrontDocumentType = exports.DeHealthInsuranceCardFrontDocumentType = 'DeHealthInsuranceCardFront';
/** MRZ part of the document */
class MRZ {
get document() {
return this._document;
}
constructor(document) {
if (document.type.name !== this.requiredDocumentType()) {
throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`);
}
this._document = document;
}
requiredDocumentType() {
return MRZDocumentType;
}
/** Birth date */
get birthDate() {
return this.document.fields.find(f => f.type.name === 'BirthDate');
}
/** Check digit birth date */
get checkDigitBirthDate() {
return this.document.fields.find(f => f.type.name === 'CheckDigitBirthDate');
}
/** Check digit document number */
get checkDigitDocumentNumber() {
return this.document.fields.find(f => f.type.name === 'CheckDigitDocumentNumber');
}
/** Check digit expiry date */
get checkDigitExpiryDate() {
return this.document.fields.find(f => f.type.name === 'CheckDigitExpiryDate');
}
/** Check digit general */
get checkDigitGeneral() {
return this.document.fields.find(f => f.type.name === 'CheckDigitGeneral');
}
/** Check digit personal number */
get checkDigitPersonalNumber() {
return this.document.fields.find(f => f.type.name === 'CheckDigitPersonalNumber');
}
/** Date of issuance */
get dateOfIssuance() {
return this.document.fields.find(f => f.type.name === 'DateOfIssuance');
}
/** Document number */
get documentNumber() {
return this.document.fields.find(f => f.type.name === 'DocumentNumber');
}
/** Document type code */
get documentTypeCode() {
return this.document.fields.find(f => f.type.name === 'DocumentTypeCode');
}
/** Expiry date */
get expiryDate() {
return this.document.fields.find(f => f.type.name === 'ExpiryDate');
}
/** Gender */
get gender() {
return this.document.fields.find(f => f.type.name === 'Gender');
}
/** Given names */
get givenNames() {
return this.document.fields.find(f => f.type.name === 'GivenNames');
}
/** Issuing authority */
get issuingAuthority() {
return this.document.fields.find(f => f.type.name === 'IssuingAuthority');
}
/** Language code */
get languageCode() {
return this.document.fields.find(f => f.type.name === 'LanguageCode');
}
/** Nationality */
get nationality() {
return this.document.fields.find(f => f.type.name === 'Nationality');
}
/** Office of issuance */
get officeOfIssuance() {
return this.document.fields.find(f => f.type.name === 'OfficeOfIssuance');
}
/** TD1 Optional field (line 2) */
get optional1() {
return this.document.fields.find(f => f.type.name === 'Optional1');
}
/** TD1 Optional field (line 3) */
get optional2() {
return this.document.fields.find(f => f.type.name === 'Optional2');
}
/** PIN code */
get pinCode() {
return this.document.fields.find(f => f.type.name === 'PINCode');
}
/** Personal number */
get personalNumber() {
return this.document.fields.find(f => f.type.name === 'PersonalNumber');
}
/** Surname */
get surname() {
return this.document.fields.find(f => f.type.name === 'Surname');
}
/** Travel document type */
get travelDocType() {
return this.document.fields.find(f => f.type.name === 'TravelDocType');
}
/** Travel document type variant */
get travelDocTypeVariant() {
return this.document.fields.find(f => f.type.name === 'TravelDocTypeVariant');
}
/** Unknown */
get unknown() {
return this.document.fields.find(f => f.type.name === 'Unknown');
}
/** Version number */
get versionNumber() {
return this.document.fields.find(f => f.type.name === 'VersionNumber');
}
/** MRV-A/MRV-B (Travel Visa) Optional field */
get visaOptional() {
return this.document.fields.find(f => f.type.name === 'VisaOptional');
}
}
/** German ID card, front side */
exports.MRZ = MRZ;
class DeIdCardFront {
get document() {
return this._document;
}
constructor(document) {
if (document.type.name !== this.requiredDocumentType()) {
throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`);
}
this._document = document;
}
requiredDocumentType() {
return DeIdCardFrontDocumentType;
}
/** Birth date */
get birthDate() {
return this.document.fields.find(f => f.type.name === 'BirthDate');
}
/** Birthplace */
get birthplace() {
return this.document.fields.find(f => f.type.name === 'Birthplace');
}
/** Six digit card access number */
get cardAccessNumber() {
return this.document.fields.find(f => f.type.name === 'CardAccessNumber');
}
/** Expiry date */
get expiryDate() {
return this.document.fields.find(f => f.type.name === 'ExpiryDate');
}
/** Given names */
get givenNames() {
return this.document.fields.find(f => f.type.name === 'GivenNames');
}
/** Document ID number (in the top-right corner) */
get id() {
return this.document.fields.find(f => f.type.name === 'ID');
}
/** Maiden name */
get maidenName() {
return this.document.fields.find(f => f.type.name === 'MaidenName');
}
/** Nationality */
get nationality() {
return this.document.fields.find(f => f.type.name === 'Nationality');
}
/** Photo image */
get photo() {
return this.document.fields.find(f => f.type.name === 'Photo');
}
/** Signature image */
get signature() {
return this.document.fields.find(f => f.type.name === 'Signature');
}
/** Surname */
get surname() {
return this.document.fields.find(f => f.type.name === 'Surname');
}
}
/** German ID card, back side */
exports.DeIdCardFront = DeIdCardFront;
class DeIdCardBack {
get document() {
return this._document;
}
constructor(document) {
if (document.type.name !== this.requiredDocumentType()) {
throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`);
}
this._document = document;
}
requiredDocumentType() {
return DeIdCardBackDocumentType;
}
/** Address */
get address() {
return this.document.fields.find(f => f.type.name === 'Address');
}
/** Eye color */
get eyeColor() {
return this.document.fields.find(f => f.type.name === 'EyeColor');
}
/** Height */
get height() {
return this.document.fields.find(f => f.type.name === 'Height');
}
/** Issue date */
get issueDate() {
return this.document.fields.find(f => f.type.name === 'IssueDate');
}
/** Issuing authority */
get issuingAuthority() {
return this.document.fields.find(f => f.type.name === 'IssuingAuthority');
}
/** Pseudonym */
get pseudonym() {
return this.document.fields.find(f => f.type.name === 'Pseudonym');
}
/** Raw MRZ text value */
get rawMRZ() {
return this.document.fields.find(f => f.type.name === 'RawMRZ');
}
/** The child document of type "MRZ". */
get mrz() {
const child = this.document.children.find(c => c.type.name === 'MRZ');
return new MRZ(child);
}
}
exports.DeIdCardBack = DeIdCardBack;
/** German travel passport (Reisepass) */
class DePassport {
get document() {
return this._document;
}
constructor(document) {
if (document.type.name !== this.requiredDocumentType()) {
throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`);
}
this._document = document;
}
requiredDocumentType() {
return DePassportDocumentType;
}
/** Birth date */
get birthDate() {
return this.document.fields.find(f => f.type.name === 'BirthDate');
}
/** Birthplace */
get birthplace() {
return this.document.fields.find(f => f.type.name === 'Birthplace');
}
/** Country code */
get countryCode() {
return this.document.fields.find(f => f.type.name === 'CountryCode');
}
/** Expiry date */
get expiryDate() {
return this.document.fields.find(f => f.type.name === 'ExpiryDate');
}
/** Gender */
get gender() {
return this.document.fields.find(f => f.type.name === 'Gender');
}
/** Given names */
get givenNames() {
return this.document.fields.find(f => f.type.name === 'GivenNames');
}
/** Document ID number (in the top-right corner) */
get id() {
return this.document.fields.find(f => f.type.name === 'ID');
}
/** Issue date */
get issueDate() {
return this.document.fields.find(f => f.type.name === 'IssueDate');
}
/** Issuing authority */
get issuingAuthority() {
return this.document.fields.find(f => f.type.name === 'IssuingAuthority');
}
/** Maiden name */
get maidenName() {
return this.document.fields.find(f => f.type.name === 'MaidenName');
}
/** Nationality */
get nationality() {
return this.document.fields.find(f => f.type.name === 'Nationality');
}
/** Passport type */
get passportType() {
return this.document.fields.find(f => f.type.name === 'PassportType');
}
/** Photo image */
get photo() {
return this.document.fields.find(f => f.type.name === 'Photo');
}
/** Raw MRZ text value */
get rawMRZ() {
return this.document.fields.find(f => f.type.name === 'RawMRZ');
}
/** Signature image */
get signature() {
return this.document.fields.find(f => f.type.name === 'Signature');
}
/** Surname */
get surname() {
return this.document.fields.find(f => f.type.name === 'Surname');
}
/** The child document of type "MRZ". */
get mrz() {
const child = this.document.children.find(c => c.type.name === 'MRZ');
return new MRZ(child);
}
}
exports.DePassport = DePassport;
/** German driver license (Führerschein), front side */
class DeDriverLicenseFront {
get document() {
return this._document;
}
constructor(document) {
if (document.type.name !== this.requiredDocumentType()) {
throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`);
}
this._document = document;
}
requiredDocumentType() {
return DeDriverLicenseFrontDocumentType;
}
/** Birth date (Field 3.) */
get birthDate() {
return this.document.fields.find(f => f.type.name === 'BirthDate');
}
/** Birthplace (Field 3.) */
get birthplace() {
return this.document.fields.find(f => f.type.name === 'Birthplace');
}
/** Expiry date (Field 4b.) */
get expiryDate() {
return this.document.fields.find(f => f.type.name === 'ExpiryDate');
}
/** Given names (Field 2.) */
get givenNames() {
return this.document.fields.find(f => f.type.name === 'GivenNames');
}
/** Document ID number (in the top-right corner, Field 5.) */
get id() {
return this.document.fields.find(f => f.type.name === 'ID');
}
/** Issue date (Field 4a.) */
get issueDate() {
return this.document.fields.find(f => f.type.name === 'IssueDate');
}
/** Issuing authority (Field 4c.) */
get issuingAuthority() {
return this.document.fields.find(f => f.type.name === 'IssuingAuthority');
}
/** Driver's license categories (Field 9.) */
get licenseCategories() {
return this.document.fields.find(f => f.type.name === 'LicenseCategories');
}
/** Photo image */
get photo() {
return this.document.fields.find(f => f.type.name === 'Photo');
}
/** Signature image (Field 7.) */
get signature() {
return this.document.fields.find(f => f.type.name === 'Signature');
}
/** Surname (Field 1.) */
get surname() {
return this.document.fields.find(f => f.type.name === 'Surname');
}
}
/** German driver license (Führerschein), back side */
exports.DeDriverLicenseFront = DeDriverLicenseFront;
class DeDriverLicenseBack {
get document() {
return this._document;
}
constructor(document) {
if (document.type.name !== this.requiredDocumentType()) {
throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`);
}
this._document = document;
}
requiredDocumentType() {
return DeDriverLicenseBackDocumentType;
}
/** Restrictions applied for the driver's license (Field 12.) */
get restrictions() {
return this.document.fields.find(f => f.type.name === 'Restrictions');
}
/** The child document of type "Categories". */
get categories() {
const child = this.document.children.find(c => c.type.name === 'Categories');
return new DeDriverLicenseBack.Categories(child);
}
}
exports.DeDriverLicenseBack = DeDriverLicenseBack;
(function (_DeDriverLicenseBack) {
class Category {
get document() {
return this._document;
}
constructor(document) {
if (document.type.name !== this.requiredDocumentType()) {
throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`);
}
this._document = document;
}
/** Restrictions (Column 12.) */
get restrictions() {
return this.document.fields.find(f => f.type.name === 'Restrictions');
}
/** Valid from (Column 10.) */
get validFrom() {
return this.document.fields.find(f => f.type.name === 'ValidFrom');
}
/** Valid until (Column 11.) */
get validUntil() {
return this.document.fields.find(f => f.type.name === 'ValidUntil');
}
}
_DeDriverLicenseBack.Category = Category;
class Categories {
get document() {
return this._document;
}
constructor(document) {
if (document.type.name !== this.requiredDocumentType()) {
throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`);
}
this._document = document;
}
requiredDocumentType() {
return DeDriverLicenseBackCategoriesDocumentType;
}
/** The child document of type "A". */
get a() {
const child = this.document.children.find(c => c.type.name === 'A');
return new DeDriverLicenseBack.Categories.A(child);
}
/** The child document of type "A1". */
get a1() {
const child = this.document.children.find(c => c.type.name === 'A1');
return new DeDriverLicenseBack.Categories.A1(child);
}
/** The child document of type "A2". */
get a2() {
const child = this.document.children.find(c => c.type.name === 'A2');
return new DeDriverLicenseBack.Categories.A2(child);
}
/** The child document of type "AM". */
get am() {
const child = this.document.children.find(c => c.type.name === 'AM');
return new DeDriverLicenseBack.Categories.AM(child);
}
/** The child document of type "B". */
get b() {
const child = this.document.children.find(c => c.type.name === 'B');
return new DeDriverLicenseBack.Categories.B(child);
}
/** The child document of type "B1". */
get b1() {
const child = this.document.children.find(c => c.type.name === 'B1');
return child ? new DeDriverLicenseBack.Categories.B1(child) : undefined;
}
/** The child document of type "BE". */
get be() {
const child = this.document.children.find(c => c.type.name === 'BE');
return new DeDriverLicenseBack.Categories.BE(child);
}
/** The child document of type "C". */
get c() {
const child = this.document.children.find(c => c.type.name === 'C');
return new DeDriverLicenseBack.Categories.C(child);
}
/** The child document of type "C1". */
get c1() {
const child = this.document.children.find(c => c.type.name === 'C1');
return new DeDriverLicenseBack.Categories.C1(child);
}
/** The child document of type "C1E". */
get c1E() {
const child = this.document.children.find(c => c.type.name === 'C1E');
return new DeDriverLicenseBack.Categories.C1E(child);
}
/** The child document of type "CE". */
get ce() {
const child = this.document.children.find(c => c.type.name === 'CE');
return new DeDriverLicenseBack.Categories.CE(child);
}
/** The child document of type "D". */
get d() {
const child = this.document.children.find(c => c.type.name === 'D');
return new DeDriverLicenseBack.Categories.D(child);
}
/** The child document of type "D1". */
get d1() {
const child = this.document.children.find(c => c.type.name === 'D1');
return new DeDriverLicenseBack.Categories.D1(child);
}
/** The child document of type "D1E". */
get d1E() {
const child = this.document.children.find(c => c.type.name === 'D1E');
return new DeDriverLicenseBack.Categories.D1E(child);
}
/** The child document of type "DE". */
get de() {
const child = this.document.children.find(c => c.type.name === 'DE');
return new DeDriverLicenseBack.Categories.DE(child);
}
/** The child document of type "L". */
get l() {
const child = this.document.children.find(c => c.type.name === 'L');
return new DeDriverLicenseBack.Categories.L(child);
}
/** The child document of type "T". */
get t() {
const child = this.document.children.find(c => c.type.name === 'T');
return new DeDriverLicenseBack.Categories.T(child);
}
}
_DeDriverLicenseBack.Categories = Categories;
(function (_Categories) {
class A extends Category {
constructor(document) {
super(document);
}
requiredDocumentType() {
return DeDriverLicenseBackCategoriesADocumentType;
}
}
_Categories.A = A;
class A1 extends Category {
constructor(document) {
super(document);
}
requiredDocumentType() {
return DeDriverLicenseBackCategoriesA1DocumentType;
}
}
_Categories.A1 = A1;
class A2 extends Category {
constructor(document) {
super(document);
}
requiredDocumentType() {
return DeDriverLicenseBackCategoriesA2DocumentType;
}
}
_Categories.A2 = A2;
class AM extends Category {
constructor(document) {
super(document);
}
requiredDocumentType() {
return DeDriverLicenseBackCategoriesAMDocumentType;
}
}
_Categories.AM = AM;
class B extends Category {
constructor(document) {
super(document);
}
requiredDocumentType() {
return DeDriverLicenseBackCategoriesBDocumentType;
}
}
_Categories.B = B;
class B1 extends Category {
constructor(document) {
super(document);
}
requiredDocumentType() {
return DeDriverLicenseBackCategoriesB1DocumentType;
}
}
_Categories.B1 = B1;
class BE extends Category {
constructor(document) {
super(document);
}
requiredDocumentType() {
return DeDriverLicenseBackCategoriesBEDocumentType;
}
}
_Categories.BE = BE;
class C extends Category {
constructor(document) {
super(document);
}
requiredDocumentType() {
return DeDriverLicenseBackCategoriesCDocumentType;
}
}
_Categories.C = C;
class C1 extends Category {
constructor(document) {
super(document);
}
requiredDocumentType() {
return DeDriverLicenseBackCategoriesC1DocumentType;
}
}
_Categories.C1 = C1;
class C1E extends Category {
constructor(document) {
super(document);
}
requiredDocumentType() {
return DeDriverLicenseBackCategoriesC1EDocumentType;
}
}
_Categories.C1E = C1E;
class CE extends Category {
constructor(document) {
super(document);
}
requiredDocumentType() {
return DeDriverLicenseBackCategoriesCEDocumentType;
}
}
_Categories.CE = CE;
class D extends Category {
constructor(document) {
super(document);
}
requiredDocumentType() {
return DeDriverLicenseBackCategoriesDDocumentType;
}
}
_Categories.D = D;
class D1 extends Category {
constructor(document) {
super(document);
}
requiredDocumentType() {
return DeDriverLicenseBackCategoriesD1DocumentType;
}
}
_Categories.D1 = D1;
class D1E extends Category {
constructor(document) {
super(document);
}
requiredDocumentType() {
return DeDriverLicenseBackCategoriesD1EDocumentType;
}
}
_Categories.D1E = D1E;
class DE extends Category {
constructor(document) {
super(document);
}
requiredDocumentType() {
return DeDriverLicenseBackCategoriesDEDocumentType;
}
}
_Categories.DE = DE;
class L extends Category {
constructor(document) {
super(document);
}
requiredDocumentType() {
return DeDriverLicenseBackCategoriesLDocumentType;
}
}
_Categories.L = L;
class T extends Category {
constructor(document) {
super(document);
}
requiredDocumentType() {
return DeDriverLicenseBackCategoriesTDocumentType;
}
}
_Categories.T = T;
})(Categories || (Categories = _DeDriverLicenseBack.Categories || (_DeDriverLicenseBack.Categories = {})));
})(DeDriverLicenseBack || (exports.DeDriverLicenseBack = DeDriverLicenseBack = {}));
/** German Residence Permit (Aufenthaltstitel), Front side */
class DeResidencePermitFront {
get document() {
return this._document;
}
constructor(document) {
if (document.type.name !== this.requiredDocumentType()) {
throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`);
}
this._document = document;
}
requiredDocumentType() {
return DeResidencePermitFrontDocumentType;
}
/** Birth date (Geburtsdatum) */
get birthDate() {
return this.document.fields.find(f => f.type.name === 'BirthDate');
}
/** Six digit card access number */
get cardAccessNumber() {
return this.document.fields.find(f => f.type.name === 'CardAccessNumber');
}
/** Expiry date (Gültig bis) */
get expiryDate() {
return this.document.fields.find(f => f.type.name === 'ExpiryDate');
}
/** Gender (Geschlecht) */
get gender() {
return this.document.fields.find(f => f.type.name === 'Gender');
}
/** Given names */
get givenNames() {
return this.document.fields.find(f => f.type.name === 'GivenNames');
}
/** Document ID number (in the top-right corner) */
get id() {
return this.document.fields.find(f => f.type.name === 'ID');
}
/** Nationality (Staatsangehörigkeit) */
get nationality() {
return this.document.fields.find(f => f.type.name === 'Nationality');
}
/** Photo image */
get photo() {
return this.document.fields.find(f => f.type.name === 'Photo');
}
/** Place of issue (Ausstellungsort) */
get placeOfIssue() {
return this.document.fields.find(f => f.type.name === 'PlaceOfIssue');
}
/** Remarks (Anmerkungen) */
get remarks() {
return this.document.fields.find(f => f.type.name === 'Remarks');
}
/** Signature image */
get signature() {
return this.document.fields.find(f => f.type.name === 'Signature');
}
/** Surname */
get surname() {
return this.document.fields.find(f => f.type.name === 'Surname');
}
/** Title type (Art des Titels) */
get titleType() {
return this.document.fields.find(f => f.type.name === 'TitleType');
}
/** Valid from date (Gültig ab) */
get validFrom() {
return this.document.fields.find(f => f.type.name === 'ValidFrom');
}
}
/** German Residence Permit (Aufenthaltstitel), Back side */
exports.DeResidencePermitFront = DeResidencePermitFront;
class DeResidencePermitBack {
get document() {
return this._document;
}
constructor(document) {
if (document.type.name !== this.requiredDocumentType()) {
throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`);
}
this._document = document;
}
requiredDocumentType() {
return DeResidencePermitBackDocumentType;
}
/** Address (Anschrift) */
get address() {
return this.document.fields.find(f => f.type.name === 'Address');
}
/** Birth date (Geburtsdatum) */
get birthDate() {
return this.document.fields.find(f => f.type.name === 'BirthDate');
}
/** Birthplace (Geburtsort) */
get birthplace() {
return this.document.fields.find(f => f.type.name === 'Birthplace');
}
/** Eye color (Augenfarbe) */
get eyeColor() {
return this.document.fields.find(f => f.type.name === 'EyeColor');
}
/** Gender (Geschlecht) */
get gender() {
return this.document.fields.find(f => f.type.name === 'Gender');
}
/** Height (Größe) */
get height() {
return this.document.fields.find(f => f.type.name === 'Height');
}
/** Issuing authority (Ausländerbehörde) */
get issuingAuthority() {
return this.document.fields.find(f => f.type.name === 'IssuingAuthority');
}
/** Nationality (Staatsangehörigkeit) */
get nationality() {
return this.document.fields.find(f => f.type.name === 'Nationality');
}
/** Raw MRZ text value */
get rawMRZ() {
return this.document.fields.find(f => f.type.name === 'RawMRZ');
}
/** Remarks (Anmerkungen) */
get remarks() {
return this.document.fields.find(f => f.type.name === 'Remarks');
}
/** The child document of type "MRZ". */
get mrz() {
const child = this.document.children.find(c => c.type.name === 'MRZ');
return new MRZ(child);
}
}
exports.DeResidencePermitBack = DeResidencePermitBack;
/** European Health Insurance Card (EHIC). Supports formats with both four and five lines of data.
*/
class EuropeanHealthInsuranceCard {
get document() {
return this._document;
}
constructor(document) {
if (document.type.name !== this.requiredDocumentType()) {
throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`);
}
this._document = document;
}
requiredDocumentType() {
return EuropeanHealthInsuranceCardDocumentType;
}
/** Barcode image (only present in some formats) */
get barcode() {
return this.document.fields.find(f => f.type.name === 'Barcode');
}
/** Birth date */
get birthDate() {
return this.document.fields.find(f => f.type.name === 'BirthDate');
}
/** Card number */
get cardNumber() {
return this.document.fields.find(f => f.type.name === 'CardNumber');
}
/** Country code (ISO 3166-1 alpha-2) */
get countryCode() {
return this.document.fields.find(f => f.type.name === 'CountryCode');
}
/** Expiry date */
get expiryDate() {
return this.document.fields.find(f => f.type.name === 'ExpiryDate');
}
/** Given names */
get givenNames() {
return this.document.fields.find(f => f.type.name === 'GivenNames');
}
/** Issuer name */
get issuerName() {
return this.document.fields.find(f => f.type.name === 'IssuerName');
}
/** Issuer number */
get issuerNumber() {
return this.document.fields.find(f => f.type.name === 'IssuerNumber');
}
/** Personal number */
get personalNumber() {
return this.document.fields.find(f => f.type.name === 'PersonalNumber');
}
/** Signature image */
get signature() {
return this.document.fields.find(f => f.type.name === 'Signature');
}
/** Surname */
get surname() {
return this.document.fields.find(f => f.type.name === 'Surname');
}
}
/** Front side of the German health insurance card (elektronische Gesundheitskarte).
For the backside, see EuropeanHealthInsuranceCard.
*/
exports.EuropeanHealthInsuranceCard = EuropeanHealthInsuranceCard;
class DeHealthInsuranceCardFront {
get document() {
return this._document;
}
constructor(document) {
if (document.type.name !== this.requiredDocumentType()) {
throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`);
}
this._document = document;
}
requiredDocumentType() {
return DeHealthInsuranceCardFrontDocumentType;
}
/** Six digit card access number */
get cardAccessNumber() {
return this.document.fields.find(f => f.type.name === 'CardAccessNumber');
}
/** Issuer name */
get issuerName() {
return this.document.fields.find(f => f.type.name === 'IssuerName');
}
/** Issuer number (Versicherung bzw. Kennnummer des Trägers) */
get issuerNumber() {
return this.document.fields.find(f => f.type.name === 'IssuerNumber');
}
/** Full name with title */
get name() {
return this.document.fields.find(f => f.type.name === 'Name');
}
/** Personal number (Versichertennummer) */
get personalNumber() {
return this.document.fields.find(f => f.type.name === 'PersonalNumber');
}
}
exports.DeHealthInsuranceCardFront = DeHealthInsuranceCardFront;
//# sourceMappingURL=DocumentsModel.js.map