react-native-scanbot-sdk
Version:
Scanbot Document and Barcode Scanner SDK React Native Plugin for Android and iOS
1,554 lines (1,327 loc) • 64.2 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.TwEntryAndExitPermitDocumentType = exports.TwEntryAndExitPermit = exports.ParsedDeAddressDocumentType = exports.ParsedDeAddress = exports.MoIdentityCardFrontDocumentType = exports.MoIdentityCardFront = exports.MoIdentityCardBackDocumentType = exports.MoIdentityCardBack = exports.MRZDocumentType = exports.MRZ = exports.HkIdentityCardFrontDocumentType = exports.HkIdentityCardFront = exports.EuropeanHealthInsuranceCardDocumentType = exports.EuropeanHealthInsuranceCard = exports.EuropeanDriverLicenseFrontDocumentType = exports.EuropeanDriverLicenseFront = exports.EuropeanDriverLicenseBackDocumentType = exports.EuropeanDriverLicenseBackCategoryDocumentType = exports.EuropeanDriverLicenseBackCategoriesTDocumentType = exports.EuropeanDriverLicenseBackCategoriesLDocumentType = exports.EuropeanDriverLicenseBackCategoriesDocumentType = exports.EuropeanDriverLicenseBackCategoriesDEDocumentType = exports.EuropeanDriverLicenseBackCategoriesDDocumentType = exports.EuropeanDriverLicenseBackCategoriesD1EDocumentType = exports.EuropeanDriverLicenseBackCategoriesD1DocumentType = exports.EuropeanDriverLicenseBackCategoriesCEDocumentType = exports.EuropeanDriverLicenseBackCategoriesCDocumentType = exports.EuropeanDriverLicenseBackCategoriesC1EDocumentType = exports.EuropeanDriverLicenseBackCategoriesC1DocumentType = exports.EuropeanDriverLicenseBackCategoriesBEDocumentType = exports.EuropeanDriverLicenseBackCategoriesBDocumentType = exports.EuropeanDriverLicenseBackCategoriesB1DocumentType = exports.EuropeanDriverLicenseBackCategoriesAMDocumentType = exports.EuropeanDriverLicenseBackCategoriesADocumentType = exports.EuropeanDriverLicenseBackCategoriesA2DocumentType = exports.EuropeanDriverLicenseBackCategoriesA1DocumentType = exports.EuropeanDriverLicenseBack = 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.CnPermanentResidentCardFrontDocumentType = exports.CnPermanentResidentCardFront = exports.CnEntryAndExitPermitFrontDocumentType = exports.CnEntryAndExitPermitFront = exports.CnEntryAndExitPermitBackDocumentType = exports.CnEntryAndExitPermitBack = exports.BrIdCardFrontPhotoOnlyDocumentType = exports.BrIdCardFrontPhotoOnly = exports.BrIdCardFrontDocumentType = exports.BrIdCardFront = exports.BrIdCardBackDocumentType = exports.BrIdCardBack = void 0;
/// Auto-generated. Modifications will be overwritten.
/// Generated from core/document-schemas/DocumentsModel.yaml
/// All possible root document types.
const MRZDocumentType = exports.MRZDocumentType = 'MRZ';
const ParsedDeAddressDocumentType = exports.ParsedDeAddressDocumentType = 'ParsedDeAddress';
const DeIdCardFrontDocumentType = exports.DeIdCardFrontDocumentType = 'DeIdCardFront';
const DeIdCardBackDocumentType = exports.DeIdCardBackDocumentType = 'DeIdCardBack';
const DePassportDocumentType = exports.DePassportDocumentType = 'DePassport';
const EuropeanDriverLicenseFrontDocumentType = exports.EuropeanDriverLicenseFrontDocumentType = 'EuropeanDriverLicenseFront';
const EuropeanDriverLicenseBackDocumentType = exports.EuropeanDriverLicenseBackDocumentType = 'EuropeanDriverLicenseBack';
const EuropeanDriverLicenseBackCategoryDocumentType = exports.EuropeanDriverLicenseBackCategoryDocumentType = 'Category';
const EuropeanDriverLicenseBackCategoriesDocumentType = exports.EuropeanDriverLicenseBackCategoriesDocumentType = 'Categories';
const EuropeanDriverLicenseBackCategoriesADocumentType = exports.EuropeanDriverLicenseBackCategoriesADocumentType = 'A';
const EuropeanDriverLicenseBackCategoriesA1DocumentType = exports.EuropeanDriverLicenseBackCategoriesA1DocumentType = 'A1';
const EuropeanDriverLicenseBackCategoriesA2DocumentType = exports.EuropeanDriverLicenseBackCategoriesA2DocumentType = 'A2';
const EuropeanDriverLicenseBackCategoriesAMDocumentType = exports.EuropeanDriverLicenseBackCategoriesAMDocumentType = 'AM';
const EuropeanDriverLicenseBackCategoriesBDocumentType = exports.EuropeanDriverLicenseBackCategoriesBDocumentType = 'B';
const EuropeanDriverLicenseBackCategoriesB1DocumentType = exports.EuropeanDriverLicenseBackCategoriesB1DocumentType = 'B1';
const EuropeanDriverLicenseBackCategoriesBEDocumentType = exports.EuropeanDriverLicenseBackCategoriesBEDocumentType = 'BE';
const EuropeanDriverLicenseBackCategoriesCDocumentType = exports.EuropeanDriverLicenseBackCategoriesCDocumentType = 'C';
const EuropeanDriverLicenseBackCategoriesC1DocumentType = exports.EuropeanDriverLicenseBackCategoriesC1DocumentType = 'C1';
const EuropeanDriverLicenseBackCategoriesC1EDocumentType = exports.EuropeanDriverLicenseBackCategoriesC1EDocumentType = 'C1E';
const EuropeanDriverLicenseBackCategoriesCEDocumentType = exports.EuropeanDriverLicenseBackCategoriesCEDocumentType = 'CE';
const EuropeanDriverLicenseBackCategoriesDDocumentType = exports.EuropeanDriverLicenseBackCategoriesDDocumentType = 'D';
const EuropeanDriverLicenseBackCategoriesD1DocumentType = exports.EuropeanDriverLicenseBackCategoriesD1DocumentType = 'D1';
const EuropeanDriverLicenseBackCategoriesD1EDocumentType = exports.EuropeanDriverLicenseBackCategoriesD1EDocumentType = 'D1E';
const EuropeanDriverLicenseBackCategoriesDEDocumentType = exports.EuropeanDriverLicenseBackCategoriesDEDocumentType = 'DE';
const EuropeanDriverLicenseBackCategoriesLDocumentType = exports.EuropeanDriverLicenseBackCategoriesLDocumentType = 'L';
const EuropeanDriverLicenseBackCategoriesTDocumentType = exports.EuropeanDriverLicenseBackCategoriesTDocumentType = 'T';
const DeResidencePermitFrontDocumentType = exports.DeResidencePermitFrontDocumentType = 'DeResidencePermitFront';
const DeResidencePermitBackDocumentType = exports.DeResidencePermitBackDocumentType = 'DeResidencePermitBack';
const EuropeanHealthInsuranceCardDocumentType = exports.EuropeanHealthInsuranceCardDocumentType = 'EuropeanHealthInsuranceCard';
const DeHealthInsuranceCardFrontDocumentType = exports.DeHealthInsuranceCardFrontDocumentType = 'DeHealthInsuranceCardFront';
const BrIdCardFrontDocumentType = exports.BrIdCardFrontDocumentType = 'BrIdCardFront';
const BrIdCardBackDocumentType = exports.BrIdCardBackDocumentType = 'BrIdCardBack';
const BrIdCardFrontPhotoOnlyDocumentType = exports.BrIdCardFrontPhotoOnlyDocumentType = 'BrIdCardFrontPhotoOnly';
const CnEntryAndExitPermitBackDocumentType = exports.CnEntryAndExitPermitBackDocumentType = 'CnEntryAndExitPermitBack';
const CnEntryAndExitPermitFrontDocumentType = exports.CnEntryAndExitPermitFrontDocumentType = 'CnEntryAndExitPermitFront';
const CnPermanentResidentCardFrontDocumentType = exports.CnPermanentResidentCardFrontDocumentType = 'CnPermanentResidentCardFront';
const HkIdentityCardFrontDocumentType = exports.HkIdentityCardFrontDocumentType = 'HkIdentityCardFront';
const TwEntryAndExitPermitDocumentType = exports.TwEntryAndExitPermitDocumentType = 'TwEntryAndExitPermit';
const MoIdentityCardBackDocumentType = exports.MoIdentityCardBackDocumentType = 'MoIdentityCardBack';
const MoIdentityCardFrontDocumentType = exports.MoIdentityCardFrontDocumentType = 'MoIdentityCardFront';
/** 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 from the DocumentType enum */
get documentType() {
return this.document.fields.find(f => f.type.name === 'DocumentType');
}
/** 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');
}
}
/** Parsed German Address part of the document */
exports.MRZ = MRZ;
class ParsedDeAddress {
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 ParsedDeAddressDocumentType;
}
/** District or city area corresponding to postal code */
get district() {
return this.document.fields.find(f => f.type.name === 'District');
}
/** Additional information to district or city area (e.g. Ortsteil, Stadtteil) */
get districtAddition() {
return this.document.fields.find(f => f.type.name === 'DistrictAddition');
}
/** House number */
get houseNumber() {
return this.document.fields.find(f => f.type.name === 'HouseNumber');
}
/** postal code */
get postalCode() {
return this.document.fields.find(f => f.type.name === 'PostalCode');
}
/** Street name */
get streetName() {
return this.document.fields.find(f => f.type.name === 'StreetName');
}
}
/** German ID card, front side */
exports.ParsedDeAddress = ParsedDeAddress;
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');
}
/** Series of the document. The format is YYMM. */
get series() {
return this.document.fields.find(f => f.type.name === 'Series');
}
/** 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;
}
/** Raw Address text value */
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');
}
/** Series of the document. The format is YYMM. */
get series() {
return this.document.fields.find(f => f.type.name === 'Series');
}
/** The child document of type "MRZ". */
get mrz() {
const child = this.document.children.find(c => c.type.name === 'MRZ');
return new MRZ(child);
}
/** The child document of type "ParsedDeAddress". */
get parsedDeAddress() {
const child = this.document.children.find(c => c.type.name === 'ParsedDeAddress');
return new ParsedDeAddress(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;
/** European driver license, front side */
class EuropeanDriverLicenseFront {
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 EuropeanDriverLicenseFrontDocumentType;
}
/** Address (Field 8.) */
get address() {
return this.document.fields.find(f => f.type.name === 'Address');
}
/** Administrative number (Field 10.) */
get administrativeNumber() {
return this.document.fields.find(f => f.type.name === 'AdministrativeNumber');
}
/** Barcode */
get barcode() {
return this.document.fields.find(f => f.type.name === 'Barcode');
}
/** 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');
}
/** Citizenship (Field 4f.) */
get citizenship() {
return this.document.fields.find(f => f.type.name === 'Citizenship');
}
/** Country of the driver license */
get country() {
return this.document.fields.find(f => f.type.name === 'Country');
}
/** Expiry date (Field 4b.) */
get expiryDate() {
return this.document.fields.find(f => f.type.name === 'ExpiryDate');
}
/** Gender (Field 4e.) */
get gender() {
return this.document.fields.find(f => f.type.name === 'Gender');
}
/** 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');
}
/** MRZ part of the document */
get mrz() {
return this.document.fields.find(f => f.type.name === 'MRZ');
}
/** Photo image */
get photo() {
return this.document.fields.find(f => f.type.name === 'Photo');
}
/** Restrictions applied for the driver's license (Field 12.) */
get restrictions() {
return this.document.fields.find(f => f.type.name === 'Restrictions');
}
/** Serial number (Field 5b. on Driver Qualification Card) */
get serialNumber() {
return this.document.fields.find(f => f.type.name === 'SerialNumber');
}
/** 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');
}
}
/** European driver license, back side */
exports.EuropeanDriverLicenseFront = EuropeanDriverLicenseFront;
class EuropeanDriverLicenseBack {
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 EuropeanDriverLicenseBackDocumentType;
}
/** Country of the driver license */
get country() {
return this.document.fields.find(f => f.type.name === 'Country');
}
/** 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 EuropeanDriverLicenseBack.Categories(child);
}
}
exports.EuropeanDriverLicenseBack = EuropeanDriverLicenseBack;
(function (_EuropeanDriverLicenseBack) {
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');
}
}
_EuropeanDriverLicenseBack.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 EuropeanDriverLicenseBackCategoriesDocumentType;
}
/** The child document of type "A". */
get a() {
const child = this.document.children.find(c => c.type.name === 'A');
return new EuropeanDriverLicenseBack.Categories.A(child);
}
/** The child document of type "A1". */
get a1() {
const child = this.document.children.find(c => c.type.name === 'A1');
return new EuropeanDriverLicenseBack.Categories.A1(child);
}
/** The child document of type "A2". */
get a2() {
const child = this.document.children.find(c => c.type.name === 'A2');
return new EuropeanDriverLicenseBack.Categories.A2(child);
}
/** The child document of type "AM". */
get am() {
const child = this.document.children.find(c => c.type.name === 'AM');
return new EuropeanDriverLicenseBack.Categories.AM(child);
}
/** The child document of type "B". */
get b() {
const child = this.document.children.find(c => c.type.name === 'B');
return new EuropeanDriverLicenseBack.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 EuropeanDriverLicenseBack.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 EuropeanDriverLicenseBack.Categories.BE(child);
}
/** The child document of type "C". */
get c() {
const child = this.document.children.find(c => c.type.name === 'C');
return new EuropeanDriverLicenseBack.Categories.C(child);
}
/** The child document of type "C1". */
get c1() {
const child = this.document.children.find(c => c.type.name === 'C1');
return new EuropeanDriverLicenseBack.Categories.C1(child);
}
/** The child document of type "C1E". */
get c1E() {
const child = this.document.children.find(c => c.type.name === 'C1E');
return new EuropeanDriverLicenseBack.Categories.C1E(child);
}
/** The child document of type "CE". */
get ce() {
const child = this.document.children.find(c => c.type.name === 'CE');
return new EuropeanDriverLicenseBack.Categories.CE(child);
}
/** The child document of type "D". */
get d() {
const child = this.document.children.find(c => c.type.name === 'D');
return new EuropeanDriverLicenseBack.Categories.D(child);
}
/** The child document of type "D1". */
get d1() {
const child = this.document.children.find(c => c.type.name === 'D1');
return new EuropeanDriverLicenseBack.Categories.D1(child);
}
/** The child document of type "D1E". */
get d1E() {
const child = this.document.children.find(c => c.type.name === 'D1E');
return new EuropeanDriverLicenseBack.Categories.D1E(child);
}
/** The child document of type "DE". */
get de() {
const child = this.document.children.find(c => c.type.name === 'DE');
return new EuropeanDriverLicenseBack.Categories.DE(child);
}
/** The child document of type "L". */
get l() {
const child = this.document.children.find(c => c.type.name === 'L');
return new EuropeanDriverLicenseBack.Categories.L(child);
}
/** The child document of type "T". */
get t() {
const child = this.document.children.find(c => c.type.name === 'T');
return new EuropeanDriverLicenseBack.Categories.T(child);
}
}
_EuropeanDriverLicenseBack.Categories = Categories;
(function (_Categories) {
class A extends Category {
constructor(document) {
super(document);
}
requiredDocumentType() {
return EuropeanDriverLicenseBackCategoriesADocumentType;
}
}
_Categories.A = A;
class A1 extends Category {
constructor(document) {
super(document);
}
requiredDocumentType() {
return EuropeanDriverLicenseBackCategoriesA1DocumentType;
}
}
_Categories.A1 = A1;
class A2 extends Category {
constructor(document) {
super(document);
}
requiredDocumentType() {
return EuropeanDriverLicenseBackCategoriesA2DocumentType;
}
}
_Categories.A2 = A2;
class AM extends Category {
constructor(document) {
super(document);
}
requiredDocumentType() {
return EuropeanDriverLicenseBackCategoriesAMDocumentType;
}
}
_Categories.AM = AM;
class B extends Category {
constructor(document) {
super(document);
}
requiredDocumentType() {
return EuropeanDriverLicenseBackCategoriesBDocumentType;
}
}
_Categories.B = B;
class B1 extends Category {
constructor(document) {
super(document);
}
requiredDocumentType() {
return EuropeanDriverLicenseBackCategoriesB1DocumentType;
}
}
_Categories.B1 = B1;
class BE extends Category {
constructor(document) {
super(document);
}
requiredDocumentType() {
return EuropeanDriverLicenseBackCategoriesBEDocumentType;
}
}
_Categories.BE = BE;
class C extends Category {
constructor(document) {
super(document);
}
requiredDocumentType() {
return EuropeanDriverLicenseBackCategoriesCDocumentType;
}
}
_Categories.C = C;
class C1 extends Category {
constructor(document) {
super(document);
}
requiredDocumentType() {
return EuropeanDriverLicenseBackCategoriesC1DocumentType;
}
}
_Categories.C1 = C1;
class C1E extends Category {
constructor(document) {
super(document);
}
requiredDocumentType() {
return EuropeanDriverLicenseBackCategoriesC1EDocumentType;
}
}
_Categories.C1E = C1E;
class CE extends Category {
constructor(document) {
super(document);
}
requiredDocumentType() {
return EuropeanDriverLicenseBackCategoriesCEDocumentType;
}
}
_Categories.CE = CE;
class D extends Category {
constructor(document) {
super(document);
}
requiredDocumentType() {
return EuropeanDriverLicenseBackCategoriesDDocumentType;
}
}
_Categories.D = D;
class D1 extends Category {
constructor(document) {
super(document);
}
requiredDocumentType() {
return EuropeanDriverLicenseBackCategoriesD1DocumentType;
}
}
_Categories.D1 = D1;
class D1E extends Category {
constructor(document) {
super(document);
}
requiredDocumentType() {
return EuropeanDriverLicenseBackCategoriesD1EDocumentType;
}
}
_Categories.D1E = D1E;
class DE extends Category {
constructor(document) {
super(document);
}
requiredDocumentType() {
return EuropeanDriverLicenseBackCategoriesDEDocumentType;
}
}
_Categories.DE = DE;
class L extends Category {
constructor(document) {
super(document);
}
requiredDocumentType() {
return EuropeanDriverLicenseBackCategoriesLDocumentType;
}
}
_Categories.L = L;
class T extends Category {
constructor(document) {
super(document);
}
requiredDocumentType() {
return EuropeanDriverLicenseBackCategoriesTDocumentType;
}
}
_Categories.T = T;
})(Categories || (Categories = _EuropeanDriverLicenseBack.Categories || (_EuropeanDriverLicenseBack.Categories = {})));
})(EuropeanDriverLicenseBack || (exports.EuropeanDriverLicenseBack = EuropeanDriverLicenseBack = {}));
/** 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);
}
/** The child document of type "ParsedDeAddress". */
get parsedDeAddress() {
const child = this.document.children.find(c => c.type.name === 'ParsedDeAddress');
return new ParsedDeAddress(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');
}
}
/** Brazilian National Identity Card (Registro Geral) */
exports.DeHealthInsuranceCardFront = DeHealthInsuranceCardFront;
class BrIdCardFront {
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 BrIdCardFrontDocumentType;
}
/** Código de Barras - Barcode */
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');
}
/** Birthplace */
get birthplace() {
return this.document.fields.find(f => f.type.name === 'Birthplace');
}
/** Tipo Sanguíneo/Fator RH - Blood type and RH factor */
get bloodType() {
return this.document.fields.find(f => f.type.name === 'BloodType');
}
/** Dados do Registro Civil - Civil Registry Details */
get civilRegistryDetails() {
return this.document.fields.find(f => f.type.name === 'CivilRegistryDetails');
}
/** CNH (Carteira Nacional de Habilitação) - Driver’s license number */
get driverLicenseNumber() {
return this.document.fields.find(f => f.type.name === 'DriverLicenseNumber');
}
/** Expiry date */
get expiryDate() {
return this.document.fields.find(f => f.type.name === 'ExpiryDate');
}
/** Polegar Direito - Right thumbprint */
get fingerprint() {
return this.document.fields.find(f => f.type.name === 'Fingerprint');
}
/** 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');
}
/** CNS (Cartão Nacional de Saúde) - National Health Card number */
get healthCardNumber() {
return this.document.fields.find(f => f.type.name === 'HealthCardNumber');
}
/** DNI (Documento Nacional de Identidade) - National Identity Document number */
get id() {
return this.document.fields.find(f => f.type.name === 'ID');
}
/** Data de Expedição - Date the document was issued */
get issueDate() {
return this.document.fields.find(f => f.type.name === 'IssueDate');
}
/** Órgão Expedidor - Issuing Authority */
get issuingAuthority() {
return this.document.fields.find(f => f.type.name === 'IssuingAuthority');
}
/** Assinatura do Diretor - Signature of the issuing authority */
get issuingAuthoritySignature() {
return this.document.fields.find(f => f.type.name === 'IssuingAuthoritySignature');
}
/** Certificado Militar - Military certificate number */
get militaryCertificateNumber() {
return this.document.fields.find(f => f.type.name === 'MilitaryCertificateNumber');
}
/** Nacionalidade - Nationality */
get nationality() {
return this.document.fields.find(f => f.type.name === 'Nationality');
}
/** Observações - Observations */
get observations() {
return this.document.fields.find(f => f.type.name === 'Observations');
}
/** Pais - Parents */
get parents() {
return this.document.fields.find(f => f.type.name === 'Parents');
}
/** Registro Geral (RG) - General Registration number, main ID number */
get personalNumber() {
return this.document.fields.find(f => f.type.name === 'PersonalNumber');
}
/** Photo image */
get photo() {
return this.document.fields.find(f => f.type.name === 'Photo');
}
/** Local de Emissão - Place of Issue */
get placeOfIssue() {
return this.document.fields.find(f => f.type.name === 'PlaceOfIssue');
}
/** Identidade Profissional - Professional identity number */
get professionalIdentityNumber() {
return this.document.fields.find(f => f.type.name === 'ProfessionalIdentityNumber');
}
/** Assinatura - Signature */
get signature() {
return this.document.fields.find(f => f.type.name === 'Signature');
}
/** NIS/PIS/PASEP - Social Security and Employment benefits number */
get socialSecurityNumber() {
return this.document.fields.find(f => f.type.name === 'SocialSecurityNumber');
}
/** UF - Brazilian state code for the Work Card */
get stateCode() {
return this.document.fields.find(f => f.type.name === 'StateCode');
}
/** Surname */
get surname() {
return this.document.fields.find(f => f.type.name === 'Surname');
}
/** CPF (Cadastro de Pessoas Físicas) - Brazilian taxpayer number */
get taxpayerNumber() {
return this.document.fields.find(f => f.type.name === 'TaxpayerNumber');
}
/** Título de Eleitor - Voter registration number */
get voterRegistrationNumber() {
return this.document.fields.find(f => f.type.name === 'VoterRegistrationNumber');
}
/** CTPS (Carteira de Trabalho e Previdência Social) - Work Card number */
get workCardNumber() {
return this.document.fields.find(f => f.type.name === 'WorkCardNumber');
}
/** Série - Series number associated with the Work Card */
get workCardSeries() {
return this.document.fields.find(f => f.type.name === 'WorkCardSeries');
}
}
/** Brazilian National Identity Card (Registro Geral), back side */
exports.BrIdCardFront = BrIdCardFront;
class BrIdCardBack {
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 BrIdCardBackDocumentType;
}
/** Barcode */
get barcode() {
return this.document.fields.find(f => f.type.name === 'Barcode');
}
/** Date of Birth */
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');
}
/** Dados do Registro Civil - Civil Registry Details */
get civilRegistryDetails() {
return this.document.fields.find(f => f.type.name === 'CivilRegistryDetails');
}
/** CNH (Carteira Nacional de Habilitação) - Driver’s license number */
get driverLicenseNumber() {
return this.document.fields.find(f => f.type.name === 'DriverLicenseNumber');
}
/** Expiry Date */
get expiryDate() {
return this.document.fields.find(f => f.type.name === 'ExpiryDate');
}
/** Fingerprint */
get fingerprint() {
return this.document.fields.find(f => f.type.name === 'Fingerprint');
}
/** Given Names */
get givenNames() {
return this.document.fields.find(f => f.type.name === 'GivenNames');
}
/** CNS (Cartão Nacional de Saúde) - National Health Card number */
get healthCardNumber() {
return this.document.fields.find(f => f.type.name === 'HealthCardNumber');
}
/** DNI (Documento Nacional de Identidade) - National Identity Document number */
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');
}
/** Órgão Expedidor - Issuing Authority */
get issuingAuthority() {
return this.document.fields.find(f => f.type.name === 'IssuingAuthority');
}
/** Certificado Militar - Military certificate number */
get militaryCertificateNumber() {
return this.document.fields.find(f => f.type.name === 'MilitaryCertificateNumber');
}
/** Page Number of the document */
get pageNumber() {
return this.document.fields.find(f => f.type.name === 'PageNumber');
}
/** Filiação - Parents */
get parents() {
return this.document.fields.find(f => f.type.name === 'Parents');
}
/** Registro Geral (RG) - General Registration number, main ID number */
get personalNumber() {
return this.document.fields.find(f => f.type.name === 'PersonalNumber');
}
/** Photo */
get photo() {
return this.document.fields.find(f => f.type.name === 'Photo');
}
/** Local de Emissão - Place where the identity card was issued */
get placeOfIssue() {
return this.document.fields.find(f => f.type.name === 'PlaceOfIssue');
}
/** Naturalidade - Place of Origin */
get placeOfOrigin() {
return this.document.fields.find(f => f.type.name === 'PlaceOfOrigin');
}
/** Identidade Profissional - Professional identity number */
get professionalIdentityNumber() {
return this.document.fields.find(f => f.type.name === 'ProfessionalIdentityNumber');
}
/** Raw MRZ text value */
get rawMRZ() {
return this.document.fields.find(f => f.type.name === 'RawMRZ');
}
/** Assinatura - Signature */
get signature() {
return this.document.fields.find(f => f.type.name === 'Signature');
}
/** NIS/PIS/PASEP - Social Security and Employment benefits number */
get socialSecurityNumber() {
return this.document.fields.find(f => f.type.name === 'SocialSecurityNumber');
}
/** UF - Brazilian state code related to the Work Card */
get stateCode() {
return this.document.fields.find(f => f.type.name === 'StateCode');
}
/** CPF (Cadastro de Pessoas Físicas) - Brazilian taxpayer number */
get taxpayerNumber() {
return this.document.fields.find(f => f.type.name === 'TaxpayerNumber');
}
/** Título de Eleitor - Voter registration number */
get voterRegistrationNumber() {
return this.document.fields.find(f => f.type.name === 'VoterRegistrationNumber');
}
/** CTPS (Carteira de Trabalho e Previdência Social) - Work Card number */
get workCardNumber() {
return this.document.fields.find(f => f.type.name === 'WorkCardNumber');
}
/** Série - Series number associated with the Work Card */
get workCardSeries() {
return this.document.fields.find(f => f.type.name === 'WorkCardSeries');
}
/** The child document of type "MRZ". */
get mrz() {
const child = this.document.chil