UNPKG

@regulaforensics/ionic-native-document-reader

Version:

Ionic Native wrapper for cordova documentreader

1,284 lines 653 kB
import { __decorate, __extends } from "tslib"; import { Injectable } from '@angular/core'; import { AwesomeCordovaNativePlugin, cordova } from '@awesome-cordova-plugins/core'; import { Observable } from 'rxjs'; import * as i0 from "@angular/core"; var DocumentReaderScenario = /** @class */ (function () { function DocumentReaderScenario() { } DocumentReaderScenario.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new DocumentReaderScenario; result.name = jsonObject["name"]; result.caption = jsonObject["caption"]; result.description = jsonObject["description"]; result.multiPageOff = jsonObject["multiPageOff"]; result.frameKWHLandscape = jsonObject["frameKWHLandscape"]; result.frameKWHPortrait = jsonObject["frameKWHPortrait"]; result.frameKWHDoublePageSpreadPortrait = jsonObject["frameKWHDoublePageSpreadPortrait"]; result.frameKWHDoublePageSpreadLandscape = jsonObject["frameKWHDoublePageSpreadLandscape"]; result.frameOrientation = jsonObject["frameOrientation"]; result.uvTorch = jsonObject["uvTorch"]; result.faceExt = jsonObject["faceExt"]; result.seriesProcessMode = jsonObject["seriesProcessMode"]; result.manualCrop = jsonObject["manualCrop"]; return result; }; return DocumentReaderScenario; }()); export { DocumentReaderScenario }; var Rect = /** @class */ (function () { function Rect() { } Rect.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new Rect; result.bottom = jsonObject["bottom"]; result.top = jsonObject["top"]; result.left = jsonObject["left"]; result.right = jsonObject["right"]; return result; }; return Rect; }()); export { Rect }; var DocumentReaderGraphicField = /** @class */ (function () { function DocumentReaderGraphicField() { } DocumentReaderGraphicField.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new DocumentReaderGraphicField; result.sourceType = jsonObject["sourceType"]; result.fieldType = jsonObject["fieldType"]; result.light = jsonObject["light"]; result.pageIndex = jsonObject["pageIndex"]; result.originalPageIndex = jsonObject["originalPageIndex"]; result.fieldName = jsonObject["fieldName"]; result.lightName = jsonObject["lightName"]; result.value = jsonObject["value"]; result.fieldRect = Rect.fromJson(jsonObject["fieldRect"]); return result; }; return DocumentReaderGraphicField; }()); export { DocumentReaderGraphicField }; var DocumentReaderGraphicResult = /** @class */ (function () { function DocumentReaderGraphicResult() { } DocumentReaderGraphicResult.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new DocumentReaderGraphicResult; result.fields = []; if (jsonObject["fields"] != null) { for (var i in jsonObject["fields"]) { var item = DocumentReaderGraphicField.fromJson(jsonObject["fields"][i]); if (item != undefined) result.fields.push(item); } } return result; }; return DocumentReaderGraphicResult; }()); export { DocumentReaderGraphicResult }; var DocumentReaderValue = /** @class */ (function () { function DocumentReaderValue() { } DocumentReaderValue.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new DocumentReaderValue; result.pageIndex = jsonObject["pageIndex"]; result.sourceType = jsonObject["sourceType"]; result.probability = jsonObject["probability"]; result.value = jsonObject["value"]; result.originalValue = jsonObject["originalValue"]; result.boundRect = Rect.fromJson(jsonObject["boundRect"]); result.originalSymbols = []; if (jsonObject["originalSymbols"] != null) { for (var i in jsonObject["originalSymbols"]) { var item = DocumentReaderSymbol.fromJson(jsonObject["originalSymbols"][i]); if (item != undefined) result.originalSymbols.push(item); } } result.rfidOrigin = DocumentReaderRfidOrigin.fromJson(jsonObject["rfidOrigin"]); return result; }; return DocumentReaderValue; }()); export { DocumentReaderValue }; var DocumentReaderTextField = /** @class */ (function () { function DocumentReaderTextField() { } DocumentReaderTextField.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new DocumentReaderTextField; result.fieldType = jsonObject["fieldType"]; result.lcid = jsonObject["lcid"]; result.status = jsonObject["status"]; result.lcidName = jsonObject["lcidName"]; result.fieldName = jsonObject["fieldName"]; result.value = jsonObject["value"]; result.getValue = DocumentReaderValue.fromJson(jsonObject["getValue"]); result.values = []; if (jsonObject["values"] != null) { for (var i in jsonObject["values"]) { var item = DocumentReaderValue.fromJson(jsonObject["values"][i]); if (item != undefined) result.values.push(item); } } result.comparisonList = []; if (jsonObject["comparisonList"] != null) { for (var i in jsonObject["comparisonList"]) { var item = DocumentReaderComparison.fromJson(jsonObject["comparisonList"][i]); if (item != undefined) result.comparisonList.push(item); } } result.validityList = []; if (jsonObject["validityList"] != null) { for (var i in jsonObject["validityList"]) { var item = DocumentReaderValidity.fromJson(jsonObject["validityList"][i]); if (item != undefined) result.validityList.push(item); } } result.comparisonStatus = jsonObject["comparisonStatus"]; result.validityStatus = jsonObject["validityStatus"]; return result; }; return DocumentReaderTextField; }()); export { DocumentReaderTextField }; var DocumentReaderTextResult = /** @class */ (function () { function DocumentReaderTextResult() { } DocumentReaderTextResult.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new DocumentReaderTextResult; result.status = jsonObject["status"]; result.comparisonStatus = jsonObject["comparisonStatus"]; result.validityStatus = jsonObject["validityStatus"]; result.availableSourceList = []; if (jsonObject["availableSourceList"] != null) { for (var i in jsonObject["availableSourceList"]) { var item = DocumentReaderTextSource.fromJson(jsonObject["availableSourceList"][i]); if (item != undefined) result.availableSourceList.push(item); } } result.fields = []; if (jsonObject["fields"] != null) { for (var i in jsonObject["fields"]) { var item = DocumentReaderTextField.fromJson(jsonObject["fields"][i]); if (item != undefined) result.fields.push(item); } } return result; }; return DocumentReaderTextResult; }()); export { DocumentReaderTextResult }; var Coordinate = /** @class */ (function () { function Coordinate() { } Coordinate.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new Coordinate; result.x = jsonObject["x"]; result.y = jsonObject["y"]; return result; }; return Coordinate; }()); export { Coordinate }; var ElementPosition = /** @class */ (function () { function ElementPosition() { } ElementPosition.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new ElementPosition; result.docFormat = jsonObject["docFormat"]; result.width = jsonObject["width"]; result.height = jsonObject["height"]; result.dpi = jsonObject["dpi"]; result.pageIndex = jsonObject["pageIndex"]; result.inverse = jsonObject["inverse"]; result.perspectiveTr = jsonObject["perspectiveTr"]; result.objArea = jsonObject["objArea"]; result.objIntAngleDev = jsonObject["objIntAngleDev"]; result.resultStatus = jsonObject["resultStatus"]; result.angle = jsonObject["angle"]; result.center = Coordinate.fromJson(jsonObject["center"]); result.leftTop = Coordinate.fromJson(jsonObject["leftTop"]); result.leftBottom = Coordinate.fromJson(jsonObject["leftBottom"]); result.rightTop = Coordinate.fromJson(jsonObject["rightTop"]); result.rightBottom = Coordinate.fromJson(jsonObject["rightBottom"]); return result; }; return ElementPosition; }()); export { ElementPosition }; var ImageQuality = /** @class */ (function () { function ImageQuality() { } ImageQuality.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new ImageQuality; result.featureType = jsonObject["featureType"]; result.result = jsonObject["result"]; result.type = jsonObject["type"]; result.boundRects = []; if (jsonObject["boundRects"] != null) { for (var i in jsonObject["boundRects"]) { var item = Rect.fromJson(jsonObject["boundRects"][i]); if (item != undefined) result.boundRects.push(item); } } return result; }; return ImageQuality; }()); export { ImageQuality }; var ImageQualityGroup = /** @class */ (function () { function ImageQualityGroup() { } ImageQualityGroup.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new ImageQualityGroup; result.count = jsonObject["count"]; result.result = jsonObject["result"]; result.imageQualityList = []; if (jsonObject["imageQualityList"] != null) { for (var i in jsonObject["imageQualityList"]) { var item = ImageQuality.fromJson(jsonObject["imageQualityList"][i]); if (item != undefined) result.imageQualityList.push(item); } } result.pageIndex = jsonObject["pageIndex"]; return result; }; return ImageQualityGroup; }()); export { ImageQualityGroup }; var DocumentReaderDocumentType = /** @class */ (function () { function DocumentReaderDocumentType() { } DocumentReaderDocumentType.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new DocumentReaderDocumentType; result.pageIndex = jsonObject["pageIndex"]; result.documentID = jsonObject["documentID"]; result.dType = jsonObject["dType"]; result.dFormat = jsonObject["dFormat"]; result.dMRZ = jsonObject["dMRZ"]; result.isDeprecated = jsonObject["isDeprecated"]; result.name = jsonObject["name"]; result.ICAOCode = jsonObject["ICAOCode"]; result.dDescription = jsonObject["dDescription"]; result.dYear = jsonObject["dYear"]; result.dCountryName = jsonObject["dCountryName"]; result.FDSID = []; if (jsonObject["FDSID"] != null) { for (var i in jsonObject["FDSID"]) { result.FDSID.push(jsonObject["FDSID"][i]); } } return result; }; return DocumentReaderDocumentType; }()); export { DocumentReaderDocumentType }; var DocumentReaderNotification = /** @class */ (function () { function DocumentReaderNotification() { } DocumentReaderNotification.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new DocumentReaderNotification; result.notificationCode = jsonObject["notificationCode"]; result.dataFileType = jsonObject["dataFileType"]; result.progress = jsonObject["progress"]; return result; }; return DocumentReaderNotification; }()); export { DocumentReaderNotification }; var AccessControlProcedureType = /** @class */ (function () { function AccessControlProcedureType() { } AccessControlProcedureType.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new AccessControlProcedureType; result.activeOptionIdx = jsonObject["activeOptionIdx"]; result.type = jsonObject["type"]; result.status = jsonObject["status"]; result.notifications = []; if (jsonObject["notifications"] != null) { for (var i in jsonObject["notifications"]) { result.notifications.push(jsonObject["notifications"][i]); } } return result; }; return AccessControlProcedureType; }()); export { AccessControlProcedureType }; var FileData = /** @class */ (function () { function FileData() { } FileData.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new FileData; result.length = jsonObject["length"]; result.type = jsonObject["type"]; result.status = jsonObject["status"]; result.data = jsonObject["data"]; return result; }; return FileData; }()); export { FileData }; var CertificateData = /** @class */ (function () { function CertificateData() { } CertificateData.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new CertificateData; result.length = jsonObject["length"]; result.data = jsonObject["data"]; return result; }; return CertificateData; }()); export { CertificateData }; var SecurityObjectCertificates = /** @class */ (function () { function SecurityObjectCertificates() { } SecurityObjectCertificates.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new SecurityObjectCertificates; result.securityObject = CertificateData.fromJson(jsonObject["securityObject"]); return result; }; return SecurityObjectCertificates; }()); export { SecurityObjectCertificates }; var File = /** @class */ (function () { function File() { } File.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new File; result.readingTime = jsonObject["readingTime"]; result.type = jsonObject["type"]; result.typeName = jsonObject["typeName"]; result.pAStatus = jsonObject["pAStatus"]; result.readingStatus = jsonObject["readingStatus"]; result.fileID = jsonObject["fileID"]; result.fileData = FileData.fromJson(jsonObject["fileData"]); result.certificates = SecurityObjectCertificates.fromJson(jsonObject["certificates"]); result.docFieldsText = []; if (jsonObject["docFieldsText"] != null) { for (var i in jsonObject["docFieldsText"]) { result.docFieldsText.push(jsonObject["docFieldsText"][i]); } } result.docFieldsGraphics = []; if (jsonObject["docFieldsGraphics"] != null) { for (var i in jsonObject["docFieldsGraphics"]) { result.docFieldsGraphics.push(jsonObject["docFieldsGraphics"][i]); } } result.docFieldsOriginals = []; if (jsonObject["docFieldsOriginals"] != null) { for (var i in jsonObject["docFieldsOriginals"]) { result.docFieldsOriginals.push(jsonObject["docFieldsOriginals"][i]); } } result.notifications = []; if (jsonObject["notifications"] != null) { for (var i in jsonObject["notifications"]) { result.notifications.push(jsonObject["notifications"][i]); } } return result; }; return File; }()); export { File }; var Application = /** @class */ (function () { function Application() { } Application.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new Application; result.type = jsonObject["type"]; result.status = jsonObject["status"]; result.applicationID = jsonObject["applicationID"]; result.dataHashAlgorithm = jsonObject["dataHashAlgorithm"]; result.unicodeVersion = jsonObject["unicodeVersion"]; result.version = jsonObject["version"]; result.files = []; if (jsonObject["files"] != null) { for (var i in jsonObject["files"]) { var item = File.fromJson(jsonObject["files"][i]); if (item != undefined) result.files.push(item); } } return result; }; return Application; }()); export { Application }; var Value = /** @class */ (function () { function Value() { } Value.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new Value; result.length = jsonObject["length"]; result.type = jsonObject["type"]; result.status = jsonObject["status"]; result.data = jsonObject["data"]; result.format = jsonObject["format"]; return result; }; return Value; }()); export { Value }; var Attribute = /** @class */ (function () { function Attribute() { } Attribute.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new Attribute; result.type = jsonObject["type"]; result.value = Value.fromJson(jsonObject["value"]); return result; }; return Attribute; }()); export { Attribute }; var Authority = /** @class */ (function () { function Authority() { } Authority.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new Authority; result.data = jsonObject["data"]; result.friendlyName = Value.fromJson(jsonObject["friendlyName"]); result.attributes = []; if (jsonObject["attributes"] != null) { for (var i in jsonObject["attributes"]) { var item = Attribute.fromJson(jsonObject["attributes"][i]); if (item != undefined) result.attributes.push(item); } } return result; }; return Authority; }()); export { Authority }; var Extension = /** @class */ (function () { function Extension() { } Extension.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new Extension; result.data = jsonObject["data"]; result.type = jsonObject["type"]; return result; }; return Extension; }()); export { Extension }; var Validity = /** @class */ (function () { function Validity() { } Validity.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new Validity; result.notAfter = Value.fromJson(jsonObject["notAfter"]); result.notBefore = Value.fromJson(jsonObject["notBefore"]); return result; }; return Validity; }()); export { Validity }; var CertificateChain = /** @class */ (function () { function CertificateChain() { } CertificateChain.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new CertificateChain; result.origin = jsonObject["origin"]; result.type = jsonObject["type"]; result.version = jsonObject["version"]; result.paStatus = jsonObject["paStatus"]; result.serialNumber = jsonObject["serialNumber"]; result.signatureAlgorithm = jsonObject["signatureAlgorithm"]; result.subjectPKAlgorithm = jsonObject["subjectPKAlgorithm"]; result.fileName = Value.fromJson(jsonObject["fileName"]); result.validity = Validity.fromJson(jsonObject["validity"]); result.issuer = Authority.fromJson(jsonObject["issuer"]); result.subject = Authority.fromJson(jsonObject["subject"]); result.notifications = []; if (jsonObject["notifications"] != null) { for (var i in jsonObject["notifications"]) { result.notifications.push(jsonObject["notifications"][i]); } } result.extensions = []; if (jsonObject["extensions"] != null) { for (var i in jsonObject["extensions"]) { var item = Extension.fromJson(jsonObject["extensions"][i]); if (item != undefined) result.extensions.push(item); } } return result; }; return CertificateChain; }()); export { CertificateChain }; var SignerInfo = /** @class */ (function () { function SignerInfo() { } SignerInfo.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new SignerInfo; result.version = jsonObject["version"]; result.paStatus = jsonObject["paStatus"]; result.dataToHash = jsonObject["dataToHash"]; result.digestAlgorithm = jsonObject["digestAlgorithm"]; result.signatureAlgorithm = jsonObject["signatureAlgorithm"]; result.serialNumber = Value.fromJson(jsonObject["serialNumber"]); result.signature = Value.fromJson(jsonObject["signature"]); result.subjectKeyIdentifier = Value.fromJson(jsonObject["subjectKeyIdentifier"]); result.issuer = Authority.fromJson(jsonObject["issuer"]); result.notifications = []; if (jsonObject["notifications"] != null) { for (var i in jsonObject["notifications"]) { result.notifications.push(jsonObject["notifications"][i]); } } result.signedAttributes = []; if (jsonObject["signedAttributes"] != null) { for (var i in jsonObject["signedAttributes"]) { var item = Extension.fromJson(jsonObject["signedAttributes"][i]); if (item != undefined) result.signedAttributes.push(item); } } result.certificateChain = []; if (jsonObject["certificateChain"] != null) { for (var i in jsonObject["certificateChain"]) { var item = CertificateChain.fromJson(jsonObject["certificateChain"][i]); if (item != undefined) result.certificateChain.push(item); } } return result; }; return SignerInfo; }()); export { SignerInfo }; var SecurityObject = /** @class */ (function () { function SecurityObject() { } SecurityObject.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new SecurityObject; result.fileReference = jsonObject["fileReference"]; result.version = jsonObject["version"]; result.objectType = jsonObject["objectType"]; result.notifications = []; if (jsonObject["notifications"] != null) { for (var i in jsonObject["notifications"]) { result.notifications.push(jsonObject["notifications"][i]); } } result.signerInfos = []; if (jsonObject["signerInfos"] != null) { for (var i in jsonObject["signerInfos"]) { var item = SignerInfo.fromJson(jsonObject["signerInfos"][i]); if (item != undefined) result.signerInfos.push(item); } } return result; }; return SecurityObject; }()); export { SecurityObject }; var CardProperties = /** @class */ (function () { function CardProperties() { } CardProperties.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new CardProperties; result.aTQA = jsonObject["aTQA"]; result.bitRateR = jsonObject["bitRateR"]; result.bitRateS = jsonObject["bitRateS"]; result.chipTypeA = jsonObject["chipTypeA"]; result.mifareMemory = jsonObject["mifareMemory"]; result.rfidType = jsonObject["rfidType"]; result.sAK = jsonObject["sAK"]; result.support4 = jsonObject["support4"]; result.supportMifare = jsonObject["supportMifare"]; result.aTQB = jsonObject["aTQB"]; result.aTR = jsonObject["aTR"]; result.baudrate1 = jsonObject["baudrate1"]; result.baudrate2 = jsonObject["baudrate2"]; result.uID = jsonObject["uID"]; return result; }; return CardProperties; }()); export { CardProperties }; var RFIDSessionData = /** @class */ (function () { function RFIDSessionData() { } RFIDSessionData.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new RFIDSessionData; result.totalBytesReceived = jsonObject["totalBytesReceived"]; result.totalBytesSent = jsonObject["totalBytesSent"]; result.status = jsonObject["status"]; result.extLeSupport = jsonObject["extLeSupport"]; result.processTime = jsonObject["processTime"]; result.cardProperties = CardProperties.fromJson(jsonObject["cardProperties"]); result.accessControls = []; if (jsonObject["accessControls"] != null) { for (var i in jsonObject["accessControls"]) { var item = AccessControlProcedureType.fromJson(jsonObject["accessControls"][i]); if (item != undefined) result.accessControls.push(item); } } result.applications = []; if (jsonObject["applications"] != null) { for (var i in jsonObject["applications"]) { var item = Application.fromJson(jsonObject["applications"][i]); if (item != undefined) result.applications.push(item); } } result.securityObjects = []; if (jsonObject["securityObjects"] != null) { for (var i in jsonObject["securityObjects"]) { var item = SecurityObject.fromJson(jsonObject["securityObjects"][i]); if (item != undefined) result.securityObjects.push(item); } } result.dataGroups = []; if (jsonObject["dataGroups"] != null) { for (var i in jsonObject["dataGroups"]) { result.dataGroups.push(jsonObject["dataGroups"][i]); } } result.dataFields = []; if (jsonObject["dataFields"] != null) { for (var i in jsonObject["dataFields"]) { var item = DataField.fromJson(jsonObject["dataFields"][i]); if (item != undefined) result.dataFields.push(item); } } return result; }; return RFIDSessionData; }()); export { RFIDSessionData }; var DataField = /** @class */ (function () { function DataField() { } DataField.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new DataField; result.data = jsonObject["data"]; result.fieldType = jsonObject["fieldType"]; return result; }; return DataField; }()); export { DataField }; var DocumentReaderAuthenticityCheck = /** @class */ (function () { function DocumentReaderAuthenticityCheck() { } DocumentReaderAuthenticityCheck.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new DocumentReaderAuthenticityCheck; result.type = jsonObject["type"]; result.status = jsonObject["status"]; result.typeName = jsonObject["typeName"]; result.pageIndex = jsonObject["pageIndex"]; result.elements = []; if (jsonObject["elements"] != null) { for (var i in jsonObject["elements"]) { var item = DocumentReaderAuthenticityElement.fromJson(jsonObject["elements"][i]); if (item != undefined) result.elements.push(item); } } return result; }; return DocumentReaderAuthenticityCheck; }()); export { DocumentReaderAuthenticityCheck }; var PDF417Info = /** @class */ (function () { function PDF417Info() { } PDF417Info.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new PDF417Info; result.errorLevel = jsonObject["errorLevel"]; result.columns = jsonObject["columns"]; result.rows = jsonObject["rows"]; return result; }; return PDF417Info; }()); export { PDF417Info }; var DocumentReaderBarcodeResult = /** @class */ (function () { function DocumentReaderBarcodeResult() { } DocumentReaderBarcodeResult.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new DocumentReaderBarcodeResult; result.fields = []; if (jsonObject["fields"] != null) { for (var i in jsonObject["fields"]) { var item = DocumentReaderBarcodeField.fromJson(jsonObject["fields"][i]); if (item != undefined) result.fields.push(item); } } return result; }; return DocumentReaderBarcodeResult; }()); export { DocumentReaderBarcodeResult }; var DocumentReaderBarcodeField = /** @class */ (function () { function DocumentReaderBarcodeField() { } DocumentReaderBarcodeField.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new DocumentReaderBarcodeField; result.barcodeType = jsonObject["barcodeType"]; result.status = jsonObject["status"]; result.pageIndex = jsonObject["pageIndex"]; result.pdf417Info = PDF417Info.fromJson(jsonObject["pdf417Info"]); result.data = jsonObject["data"]; return result; }; return DocumentReaderBarcodeField; }()); export { DocumentReaderBarcodeField }; var DocumentReaderAuthenticityResult = /** @class */ (function () { function DocumentReaderAuthenticityResult() { } DocumentReaderAuthenticityResult.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new DocumentReaderAuthenticityResult; result.status = jsonObject["status"]; result.checks = []; if (jsonObject["checks"] != null) { for (var i in jsonObject["checks"]) { var item = DocumentReaderAuthenticityCheck.fromJson(jsonObject["checks"][i]); if (item != undefined) result.checks.push(item); } } return result; }; return DocumentReaderAuthenticityResult; }()); export { DocumentReaderAuthenticityResult }; var DocumentReaderAuthenticityElement = /** @class */ (function () { function DocumentReaderAuthenticityElement() { } DocumentReaderAuthenticityElement.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new DocumentReaderAuthenticityElement; result.status = jsonObject["status"]; result.elementType = jsonObject["elementType"]; result.elementDiagnose = jsonObject["elementDiagnose"]; result.elementTypeName = jsonObject["elementTypeName"]; result.elementDiagnoseName = jsonObject["elementDiagnoseName"]; return result; }; return DocumentReaderAuthenticityElement; }()); export { DocumentReaderAuthenticityElement }; var DocumentReaderCompletion = /** @class */ (function () { function DocumentReaderCompletion() { } DocumentReaderCompletion.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new DocumentReaderCompletion; result.action = jsonObject["action"]; result.results = DocumentReaderResults.fromJson(jsonObject["results"]); result.error = RegulaException.fromJson(jsonObject["error"]); return result; }; return DocumentReaderCompletion; }()); export { DocumentReaderCompletion }; var RfidNotificationCompletion = /** @class */ (function () { function RfidNotificationCompletion() { } RfidNotificationCompletion.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new RfidNotificationCompletion; result.notification = jsonObject["notification"]; result.value = jsonObject["value"]; return result; }; return RfidNotificationCompletion; }()); export { RfidNotificationCompletion }; var RegulaException = /** @class */ (function () { function RegulaException() { } RegulaException.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new RegulaException; result.code = jsonObject["code"]; result.message = jsonObject["message"]; return result; }; return RegulaException; }()); export { RegulaException }; var PKDCertificate = /** @class */ (function () { function PKDCertificate() { } PKDCertificate.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new PKDCertificate; result.binaryData = jsonObject["binaryData"]; result.resourceType = jsonObject["resourceType"]; result.privateKey = jsonObject["privateKey"]; return result; }; return PKDCertificate; }()); export { PKDCertificate }; var TccParams = /** @class */ (function () { function TccParams() { } TccParams.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new TccParams; result.serviceUrlTA = jsonObject["serviceUrlTA"]; result.serviceUrlPA = jsonObject["serviceUrlPA"]; result.pfxCertUrl = jsonObject["pfxCertUrl"]; result.pfxPassPhrase = jsonObject["pfxPassPhrase"]; result.pfxCert = jsonObject["pfxCert"]; return result; }; return TccParams; }()); export { TccParams }; var ImageInputParam = /** @class */ (function () { function ImageInputParam() { } ImageInputParam.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new ImageInputParam; result.width = jsonObject["width"]; result.height = jsonObject["height"]; result.type = jsonObject["type"]; result.disableFrameShiftIR = jsonObject["disableFrameShiftIR"]; result.doFlipYAxis = jsonObject["doFlipYAxis"]; return result; }; return ImageInputParam; }()); export { ImageInputParam }; var PAResourcesIssuer = /** @class */ (function () { function PAResourcesIssuer() { } PAResourcesIssuer.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new PAResourcesIssuer; result.data = jsonObject["data"]; result.friendlyName = jsonObject["friendlyName"]; result.attributes = []; if (jsonObject["attributes"] != null) { for (var i in jsonObject["attributes"]) { var item = PAAttribute.fromJson(jsonObject["attributes"][i]); if (item != undefined) result.attributes.push(item); } } return result; }; return PAResourcesIssuer; }()); export { PAResourcesIssuer }; var PAAttribute = /** @class */ (function () { function PAAttribute() { } PAAttribute.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new PAAttribute; result.type = jsonObject["type"]; result.value = jsonObject["value"]; return result; }; return PAAttribute; }()); export { PAAttribute }; var TAChallenge = /** @class */ (function () { function TAChallenge() { } TAChallenge.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new TAChallenge; result.data = jsonObject["data"]; result.auxPCD = jsonObject["auxPCD"]; result.challengePICC = jsonObject["challengePICC"]; result.hashPK = jsonObject["hashPK"]; result.idPICC = jsonObject["idPICC"]; return result; }; return TAChallenge; }()); export { TAChallenge }; var DocumentReaderResultsStatus = /** @class */ (function () { function DocumentReaderResultsStatus() { } DocumentReaderResultsStatus.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new DocumentReaderResultsStatus; result.overallStatus = jsonObject["overallStatus"]; result.optical = jsonObject["optical"]; result.detailsOptical = DetailsOptical.fromJson(jsonObject["detailsOptical"]); result.rfid = jsonObject["rfid"]; result.detailsRFID = DetailsRFID.fromJson(jsonObject["detailsRFID"]); result.portrait = jsonObject["portrait"]; result.stopList = jsonObject["stopList"]; return result; }; return DocumentReaderResultsStatus; }()); export { DocumentReaderResultsStatus }; var DetailsOptical = /** @class */ (function () { function DetailsOptical() { } DetailsOptical.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new DetailsOptical; result.overallStatus = jsonObject["overallStatus"]; result.mrz = jsonObject["mrz"]; result.text = jsonObject["text"]; result.docType = jsonObject["docType"]; result.security = jsonObject["security"]; result.imageQA = jsonObject["imageQA"]; result.expiry = jsonObject["expiry"]; result.vds = jsonObject["vds"]; result.pagesCount = jsonObject["pagesCount"]; return result; }; return DetailsOptical; }()); export { DetailsOptical }; var DetailsRFID = /** @class */ (function () { function DetailsRFID() { } DetailsRFID.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new DetailsRFID; result.pa = jsonObject["pa"]; result.ca = jsonObject["ca"]; result.aa = jsonObject["aa"]; result.ta = jsonObject["ta"]; result.bac = jsonObject["bac"]; result.pace = jsonObject["pace"]; result.overallStatus = jsonObject["overallStatus"]; return result; }; return DetailsRFID; }()); export { DetailsRFID }; var VDSNCData = /** @class */ (function () { function VDSNCData() { } VDSNCData.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new VDSNCData; result.type = jsonObject["type"]; result.version = jsonObject["version"]; result.issuingCountry = jsonObject["issuingCountry"]; result.message = jsonObject["message"]; result.signatureAlgorithm = jsonObject["signatureAlgorithm"]; result.signature = BytesData.fromJson(jsonObject["signature"]); result.certificate = BytesData.fromJson(jsonObject["certificate"]); result.certificateChain = []; if (jsonObject["certificateChain"] != null) { for (var i in jsonObject["certificateChain"]) { var item = CertificateChain.fromJson(jsonObject["certificateChain"][i]); if (item != undefined) result.certificateChain.push(item); } } result.notifications = []; if (jsonObject["notifications"] != null) { for (var i in jsonObject["notifications"]) { result.notifications.push(jsonObject["notifications"][i]); } } return result; }; return VDSNCData; }()); export { VDSNCData }; var BytesData = /** @class */ (function () { function BytesData() { } BytesData.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new BytesData; result.data = jsonObject["data"]; result.length = jsonObject["length"]; result.status = jsonObject["status"]; result.type = jsonObject["type"]; return result; }; return BytesData; }()); export { BytesData }; var ImageInputData = /** @class */ (function () { function ImageInputData() { } ImageInputData.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new ImageInputData; result.pageIndex = jsonObject["pageIndex"]; result.light = jsonObject["light"]; result.type = jsonObject["type"]; result.width = jsonObject["width"]; result.height = jsonObject["height"]; result.bitmap = jsonObject["bitmap"]; result.imgBytes = jsonObject["imgBytes"]; return result; }; return ImageInputData; }()); export { ImageInputData }; var DocReaderDocumentsDatabase = /** @class */ (function () { function DocReaderDocumentsDatabase() { } DocReaderDocumentsDatabase.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new DocReaderDocumentsDatabase; result.databaseID = jsonObject["databaseID"]; result.version = jsonObject["version"]; result.date = jsonObject["date"]; result.databaseDescription = jsonObject["databaseDescription"]; result.countriesNumber = jsonObject["countriesNumber"]; result.documentsNumber = jsonObject["documentsNumber"]; result.size = jsonObject["size"]; return result; }; return DocReaderDocumentsDatabase; }()); export { DocReaderDocumentsDatabase }; var DocumentReaderComparison = /** @class */ (function () { function DocumentReaderComparison() { } DocumentReaderComparison.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new DocumentReaderComparison; result.sourceTypeLeft = jsonObject["sourceTypeLeft"]; result.sourceTypeRight = jsonObject["sourceTypeRight"]; result.status = jsonObject["status"]; return result; }; return DocumentReaderComparison; }()); export { DocumentReaderComparison }; var DocumentReaderRfidOrigin = /** @class */ (function () { function DocumentReaderRfidOrigin() { } DocumentReaderRfidOrigin.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new DocumentReaderRfidOrigin; result.dg = jsonObject["dg"]; result.dgTag = jsonObject["dgTag"]; result.entryView = jsonObject["entryView"]; result.tagEntry = jsonObject["tagEntry"]; return result; }; return DocumentReaderRfidOrigin; }()); export { DocumentReaderRfidOrigin }; var DocumentReaderTextSource = /** @class */ (function () { function DocumentReaderTextSource() { } DocumentReaderTextSource.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new DocumentReaderTextSource; result.sourceType = jsonObject["sourceType"]; result.source = jsonObject["source"]; result.validityStatus = jsonObject["validityStatus"]; return result; }; return DocumentReaderTextSource; }()); export { DocumentReaderTextSource }; var DocumentReaderSymbol = /** @class */ (function () { function DocumentReaderSymbol() { } DocumentReaderSymbol.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new DocumentReaderSymbol; result.code = jsonObject["code"]; result.rect = Rect.fromJson(jsonObject["rect"]); result.probability = jsonObject["probability"]; return result; }; return DocumentReaderSymbol; }()); export { DocumentReaderSymbol }; var DocumentReaderValidity = /** @class */ (function () { function DocumentReaderValidity() { } DocumentReaderValidity.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new DocumentReaderValidity; result.sourceType = jsonObject["sourceType"]; result.status = jsonObject["status"]; return result; }; return DocumentReaderValidity; }()); export { DocumentReaderValidity }; var OnlineProcessingConfig = /** @class */ (function () { function OnlineProcessingConfig() { } OnlineProcessingConfig.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new OnlineProcessingConfig; result.mode = jsonObject["mode"]; result.url = jsonObject["url"]; result.processParams = ProcessParams.fromJson(jsonObject["processParams"]); result.imageFormat = jsonObject["imageFormat"]; result.imageCompressionQuality = jsonObject["imageCompressionQuality"]; result.requestHeaders = jsonObject["requestHeaders"]; return result; }; return OnlineProcessingConfig; }()); export { OnlineProcessingConfig }; var DocReaderConfig = /** @class */ (function () { function DocReaderConfig() { } DocReaderConfig.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new DocReaderConfig; result.license = jsonObject["license"]; result.customDb = jsonObject["customDb"]; result.databasePath = jsonObject["databasePath"]; result.licenseUpdate = jsonObject["licenseUpdate"]; result.delayedNNLoad = jsonObject["delayedNNLoad"]; result.blackList = jsonObject["blackList"]; return result; }; return DocReaderConfig; }()); export { DocReaderConfig }; var ScannerConfig = /** @class */ (function () { function ScannerConfig() { } ScannerConfig.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new ScannerConfig; result.scenario = jsonObject["scenario"]; result.livePortrait = jsonObject["livePortrait"]; result.extPortrait = jsonObject["extPortrait"]; result.onlineProcessingConfig = OnlineProcessingConfig.fromJson(jsonObject["onlineProcessingConfig"]); result.cameraId = jsonObject["cameraId"]; return result; }; return ScannerConfig; }()); export { ScannerConfig }; var RecognizeConfig = /** @class */ (function () { function RecognizeConfig() { } RecognizeConfig.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new RecognizeConfig; result.scenario = jsonObject["scenario"]; result.onlineProcessing