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