UNPKG

@regulaforensics/ionic-native-face-api

Version:
1,367 lines 177 kB
var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); import { AwesomeCordovaNativePlugin, cordova } from '@awesome-cordova-plugins/core'; import { Observable } from 'rxjs'; var Customization = /** @class */ (function () { function Customization() { } Customization.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new Customization; result.colors = jsonObject["colors"]; result.fonts = jsonObject["fonts"]; result.images = jsonObject["images"]; result.uiCustomizationLayer = jsonObject["uiCustomizationLayer"]; return result; }; return Customization; }()); export { Customization }; var Font = /** @class */ (function () { function Font() { } Font.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new Font; result.name = jsonObject["name"]; result.style = jsonObject["style"]; result.size = jsonObject["size"]; return result; }; return Font; }()); export { Font }; var DetectFaceResult = /** @class */ (function () { function DetectFaceResult() { } DetectFaceResult.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new DetectFaceResult; result.quality = []; if (jsonObject["quality"] != null) { for (var i in jsonObject["quality"]) { var item = ImageQualityResult.fromJson(jsonObject["quality"][i]); if (item != undefined) result.quality.push(item); } } result.attributes = []; if (jsonObject["attributes"] != null) { for (var i in jsonObject["attributes"]) { var item = DetectFacesAttributeResult.fromJson(jsonObject["attributes"][i]); if (item != undefined) result.attributes.push(item); } } result.crop = jsonObject["crop"]; result.faceRect = Rect.fromJson(jsonObject["faceRect"]); result.originalRect = Rect.fromJson(jsonObject["originalRect"]); result.landmarks = []; if (jsonObject["landmarks"] != null) { for (var i in jsonObject["landmarks"]) { var item = Point.fromJson(jsonObject["landmarks"][i]); if (item != undefined) result.landmarks.push(item); } } result.isQualityCompliant = jsonObject["isQualityCompliant"]; return result; }; return DetectFaceResult; }()); export { DetectFaceResult }; var DetectFacesAttributeResult = /** @class */ (function () { function DetectFacesAttributeResult() { } DetectFacesAttributeResult.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new DetectFacesAttributeResult; result.attribute = jsonObject["attribute"]; result.value = jsonObject["value"]; result.range = ImageQualityRange.fromJson(jsonObject["range"]); result.confidence = jsonObject["confidence"]; return result; }; return DetectFacesAttributeResult; }()); export { DetectFacesAttributeResult }; var DetectFacesConfig = /** @class */ (function () { function DetectFacesConfig() { } DetectFacesConfig.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new DetectFacesConfig; result.attributes = []; if (jsonObject["attributes"] != null) { for (var i in jsonObject["attributes"]) { result.attributes.push(jsonObject["attributes"][i]); } } result.customQuality = []; if (jsonObject["customQuality"] != null) { for (var i in jsonObject["customQuality"]) { var item = ImageQualityCharacteristic.fromJson(jsonObject["customQuality"][i]); if (item != undefined) result.customQuality.push(item); } } result.outputImageParams = OutputImageParams.fromJson(jsonObject["outputImageParams"]); result.onlyCentralFace = jsonObject["onlyCentralFace"]; return result; }; return DetectFacesConfig; }()); export { DetectFacesConfig }; var UnderlyingException = /** @class */ (function () { function UnderlyingException() { } UnderlyingException.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new UnderlyingException; result.code = jsonObject["code"]; result.message = jsonObject["message"]; return result; }; return UnderlyingException; }()); export { UnderlyingException }; var DetectFacesException = /** @class */ (function () { function DetectFacesException() { } DetectFacesException.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new DetectFacesException; result.code = jsonObject["code"]; result.message = jsonObject["message"]; result.underlyingError = UnderlyingException.fromJson(jsonObject["underlyingError"]); return result; }; return DetectFacesException; }()); export { DetectFacesException }; var DetectFacesRequest = /** @class */ (function () { function DetectFacesRequest() { } DetectFacesRequest.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new DetectFacesRequest; result.tag = jsonObject["tag"]; result.scenario = jsonObject["scenario"]; result.image = jsonObject["image"]; result.configuration = DetectFacesConfig.fromJson(jsonObject["configuration"]); return result; }; return DetectFacesRequest; }()); export { DetectFacesRequest }; var DetectFacesResponse = /** @class */ (function () { function DetectFacesResponse() { } DetectFacesResponse.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new DetectFacesResponse; result.detection = DetectFaceResult.fromJson(jsonObject["detection"]); result.scenario = jsonObject["scenario"]; result.error = DetectFacesException.fromJson(jsonObject["error"]); result.allDetections = []; if (jsonObject["allDetections"] != null) { for (var i in jsonObject["allDetections"]) { var item = DetectFaceResult.fromJson(jsonObject["allDetections"][i]); if (item != undefined) result.allDetections.push(item); } } return result; }; return DetectFacesResponse; }()); export { DetectFacesResponse }; var FaceCaptureConfig = /** @class */ (function () { function FaceCaptureConfig() { } FaceCaptureConfig.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new FaceCaptureConfig; result.copyright = jsonObject["copyright"]; result.cameraSwitchEnabled = jsonObject["cameraSwitchEnabled"]; result.closeButtonEnabled = jsonObject["closeButtonEnabled"]; result.torchButtonEnabled = jsonObject["torchButtonEnabled"]; result.vibrateOnSteps = jsonObject["vibrateOnSteps"]; result.detectOcclusion = jsonObject["detectOcclusion"]; result.showFaceAnimation = jsonObject["showFaceAnimation"]; result.cameraPositionAndroid = jsonObject["cameraPositionAndroid"]; result.cameraPositionIOS = jsonObject["cameraPositionIOS"]; result.screenOrientation = []; if (jsonObject["screenOrientation"] != null) { for (var i in jsonObject["screenOrientation"]) { result.screenOrientation.push(jsonObject["screenOrientation"][i]); } } result.timeout = jsonObject["timeout"]; result.holdStillDuration = jsonObject["holdStillDuration"]; return result; }; return FaceCaptureConfig; }()); export { FaceCaptureConfig }; var FaceCaptureException = /** @class */ (function () { function FaceCaptureException() { } FaceCaptureException.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new FaceCaptureException; result.code = jsonObject["code"]; result.message = jsonObject["message"]; return result; }; return FaceCaptureException; }()); export { FaceCaptureException }; var FaceCaptureImage = /** @class */ (function () { function FaceCaptureImage() { } FaceCaptureImage.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new FaceCaptureImage; result.imageType = jsonObject["imageType"]; result.image = jsonObject["image"]; result.tag = jsonObject["tag"]; return result; }; return FaceCaptureImage; }()); export { FaceCaptureImage }; var FaceCaptureResponse = /** @class */ (function () { function FaceCaptureResponse() { } FaceCaptureResponse.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new FaceCaptureResponse; result.error = FaceCaptureException.fromJson(jsonObject["error"]); result.image = FaceCaptureImage.fromJson(jsonObject["image"]); return result; }; return FaceCaptureResponse; }()); export { FaceCaptureResponse }; var OutputImageCrop = /** @class */ (function () { function OutputImageCrop() { } OutputImageCrop.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new OutputImageCrop; result.type = jsonObject["type"]; result.size = Size.fromJson(jsonObject["size"]); result.padColor = jsonObject["padColor"]; result.returnOriginalRect = jsonObject["returnOriginalRect"]; return result; }; return OutputImageCrop; }()); export { OutputImageCrop }; var OutputImageParams = /** @class */ (function () { function OutputImageParams() { } OutputImageParams.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new OutputImageParams; result.backgroundColor = jsonObject["backgroundColor"]; result.crop = OutputImageCrop.fromJson(jsonObject["crop"]); return result; }; return OutputImageParams; }()); export { OutputImageParams }; var Point = /** @class */ (function () { function Point() { } Point.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new Point; result.x = jsonObject["x"]; result.y = jsonObject["y"]; return result; }; return Point; }()); export { Point }; 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 Size = /** @class */ (function () { function Size() { } Size.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new Size; result.width = jsonObject["width"]; result.height = jsonObject["height"]; return result; }; return Size; }()); export { Size }; var ImageQualityCharacteristic = /** @class */ (function () { function ImageQualityCharacteristic() { } ImageQualityCharacteristic.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new ImageQualityCharacteristic; result.characteristicName = jsonObject["characteristicName"]; result.color = jsonObject["color"]; result.recommendedRange = ImageQualityRange.fromJson(jsonObject["recommendedRange"]); result.customRange = ImageQualityRange.fromJson(jsonObject["customRange"]); return result; }; return ImageQualityCharacteristic; }()); export { ImageQualityCharacteristic }; var ImageQualityRange = /** @class */ (function () { function ImageQualityRange() { } ImageQualityRange.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new ImageQualityRange; result.min = jsonObject["min"]; result.max = jsonObject["max"]; return result; }; return ImageQualityRange; }()); export { ImageQualityRange }; var ImageQualityResult = /** @class */ (function () { function ImageQualityResult() { } ImageQualityResult.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new ImageQualityResult; result.name = jsonObject["name"]; result.group = jsonObject["group"]; result.status = jsonObject["status"]; result.range = ImageQualityRange.fromJson(jsonObject["range"]); result.value = jsonObject["value"]; return result; }; return ImageQualityResult; }()); export { ImageQualityResult }; var FaceSDKVersion = /** @class */ (function () { function FaceSDKVersion() { } FaceSDKVersion.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new FaceSDKVersion; result.api = jsonObject["api"]; result.core = jsonObject["core"]; result.coreMode = jsonObject["coreMode"]; return result; }; return FaceSDKVersion; }()); export { FaceSDKVersion }; var InitConfig = /** @class */ (function () { function InitConfig() { } InitConfig.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new InitConfig; result.license = jsonObject["license"]; result.licenseUpdate = jsonObject["licenseUpdate"]; result.useBleDevice = jsonObject["useBleDevice"]; return result; }; return InitConfig; }()); export { InitConfig }; var InitException = /** @class */ (function () { function InitException() { } InitException.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new InitException; result.code = jsonObject["code"]; result.message = jsonObject["message"]; result.underlyingError = UnderlyingException.fromJson(jsonObject["underlyingError"]); return result; }; return InitException; }()); export { InitException }; var LivenessConfig = /** @class */ (function () { function LivenessConfig() { } LivenessConfig.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new LivenessConfig; result.copyright = jsonObject["copyright"]; result.cameraSwitchEnabled = jsonObject["cameraSwitchEnabled"]; result.closeButtonEnabled = jsonObject["closeButtonEnabled"]; result.torchButtonEnabled = jsonObject["torchButtonEnabled"]; result.vibrateOnSteps = jsonObject["vibrateOnSteps"]; result.cameraPositionAndroid = jsonObject["cameraPositionAndroid"]; result.cameraPositionIOS = jsonObject["cameraPositionIOS"]; result.screenOrientation = []; if (jsonObject["screenOrientation"] != null) { for (var i in jsonObject["screenOrientation"]) { result.screenOrientation.push(jsonObject["screenOrientation"][i]); } } result.locationTrackingEnabled = jsonObject["locationTrackingEnabled"]; result.attemptsCount = jsonObject["attemptsCount"]; result.recordingProcess = jsonObject["recordingProcess"]; result.livenessType = jsonObject["livenessType"]; result.tag = jsonObject["tag"]; result.skipStep = []; if (jsonObject["skipStep"] != null) { for (var i in jsonObject["skipStep"]) { result.skipStep.push(jsonObject["skipStep"][i]); } } result.metadata = jsonObject["metadata"]; return result; }; return LivenessConfig; }()); export { LivenessConfig }; var LivenessException = /** @class */ (function () { function LivenessException() { } LivenessException.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new LivenessException; result.code = jsonObject["code"]; result.message = jsonObject["message"]; result.underlyingError = UnderlyingException.fromJson(jsonObject["underlyingError"]); return result; }; return LivenessException; }()); export { LivenessException }; var LivenessNotification = /** @class */ (function () { function LivenessNotification() { } LivenessNotification.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new LivenessNotification; result.status = jsonObject["status"]; result.response = LivenessResponse.fromJson(jsonObject["response"]); return result; }; return LivenessNotification; }()); export { LivenessNotification }; var LivenessResponse = /** @class */ (function () { function LivenessResponse() { } LivenessResponse.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new LivenessResponse; result.image = jsonObject["image"]; result.liveness = jsonObject["liveness"]; result.tag = jsonObject["tag"]; result.transactionId = jsonObject["transactionId"]; result.estimatedAge = jsonObject["estimatedAge"]; result.error = LivenessException.fromJson(jsonObject["error"]); return result; }; return LivenessResponse; }()); export { LivenessResponse }; var ComparedFace = /** @class */ (function () { function ComparedFace() { } ComparedFace.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new ComparedFace; result.imageIndex = jsonObject["imageIndex"]; result.image = MatchFacesImage.fromJson(jsonObject["image"]); result.faceIndex = jsonObject["faceIndex"]; result.face = MatchFacesDetectionFace.fromJson(jsonObject["face"]); return result; }; return ComparedFace; }()); export { ComparedFace }; var ComparedFacesPair = /** @class */ (function () { function ComparedFacesPair() { } ComparedFacesPair.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new ComparedFacesPair; result.first = ComparedFace.fromJson(jsonObject["first"]); result.second = ComparedFace.fromJson(jsonObject["second"]); result.similarity = jsonObject["similarity"]; result.score = jsonObject["score"]; result.error = MatchFacesException.fromJson(jsonObject["error"]); return result; }; return ComparedFacesPair; }()); export { ComparedFacesPair }; var ComparedFacesSplit = /** @class */ (function () { function ComparedFacesSplit() { } ComparedFacesSplit.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new ComparedFacesSplit; result.matchedFaces = []; if (jsonObject["matchedFaces"] != null) { for (var i in jsonObject["matchedFaces"]) { var item = ComparedFacesPair.fromJson(jsonObject["matchedFaces"][i]); if (item != undefined) result.matchedFaces.push(item); } } result.unmatchedFaces = []; if (jsonObject["unmatchedFaces"] != null) { for (var i in jsonObject["unmatchedFaces"]) { var item = ComparedFacesPair.fromJson(jsonObject["unmatchedFaces"][i]); if (item != undefined) result.unmatchedFaces.push(item); } } return result; }; return ComparedFacesSplit; }()); export { ComparedFacesSplit }; var MatchFacesConfig = /** @class */ (function () { function MatchFacesConfig() { } MatchFacesConfig.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new MatchFacesConfig; result.processingMode = jsonObject["processingMode"]; result.locationTrackingEnabled = jsonObject["locationTrackingEnabled"]; return result; }; return MatchFacesConfig; }()); export { MatchFacesConfig }; var MatchFacesDetection = /** @class */ (function () { function MatchFacesDetection() { } MatchFacesDetection.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new MatchFacesDetection; result.imageIndex = jsonObject["imageIndex"]; result.image = MatchFacesImage.fromJson(jsonObject["image"]); result.faces = []; if (jsonObject["faces"] != null) { for (var i in jsonObject["faces"]) { var item = MatchFacesDetectionFace.fromJson(jsonObject["faces"][i]); if (item != undefined) result.faces.push(item); } } result.error = MatchFacesException.fromJson(jsonObject["error"]); return result; }; return MatchFacesDetection; }()); export { MatchFacesDetection }; var MatchFacesDetectionFace = /** @class */ (function () { function MatchFacesDetectionFace() { } MatchFacesDetectionFace.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new MatchFacesDetectionFace; result.faceIndex = jsonObject["faceIndex"]; result.landmarks = []; if (jsonObject["landmarks"] != null) { for (var i in jsonObject["landmarks"]) { var item = Point.fromJson(jsonObject["landmarks"][i]); if (item != undefined) result.landmarks.push(item); } } result.faceRect = Rect.fromJson(jsonObject["faceRect"]); result.rotationAngle = jsonObject["rotationAngle"]; result.originalRect = Rect.fromJson(jsonObject["originalRect"]); result.crop = jsonObject["crop"]; return result; }; return MatchFacesDetectionFace; }()); export { MatchFacesDetectionFace }; var MatchFacesException = /** @class */ (function () { function MatchFacesException() { } MatchFacesException.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new MatchFacesException; result.code = jsonObject["code"]; result.message = jsonObject["message"]; result.underlyingError = UnderlyingException.fromJson(jsonObject["underlyingError"]); return result; }; return MatchFacesException; }()); export { MatchFacesException }; var MatchFacesImage = /** @class */ (function () { function MatchFacesImage() { } MatchFacesImage.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new MatchFacesImage; result.image = jsonObject["image"]; result.imageType = jsonObject["imageType"]; result.detectAll = jsonObject["detectAll"]; result.identifier = jsonObject["identifier"]; return result; }; return MatchFacesImage; }()); export { MatchFacesImage }; var MatchFacesRequest = /** @class */ (function () { function MatchFacesRequest() { } MatchFacesRequest.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new MatchFacesRequest; result.images = []; if (jsonObject["images"] != null) { for (var i in jsonObject["images"]) { var item = MatchFacesImage.fromJson(jsonObject["images"][i]); if (item != undefined) result.images.push(item); } } result.outputImageParams = OutputImageParams.fromJson(jsonObject["outputImageParams"]); result.tag = jsonObject["tag"]; result.metadata = jsonObject["metadata"]; return result; }; return MatchFacesRequest; }()); export { MatchFacesRequest }; var MatchFacesResponse = /** @class */ (function () { function MatchFacesResponse() { } MatchFacesResponse.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new MatchFacesResponse; result.results = []; if (jsonObject["results"] != null) { for (var i in jsonObject["results"]) { var item = ComparedFacesPair.fromJson(jsonObject["results"][i]); if (item != undefined) result.results.push(item); } } result.detections = []; if (jsonObject["detections"] != null) { for (var i in jsonObject["detections"]) { var item = MatchFacesDetection.fromJson(jsonObject["detections"][i]); if (item != undefined) result.detections.push(item); } } result.tag = jsonObject["tag"]; result.error = MatchFacesException.fromJson(jsonObject["error"]); return result; }; return MatchFacesResponse; }()); export { MatchFacesResponse }; var EditGroupPersonsRequest = /** @class */ (function () { function EditGroupPersonsRequest() { } EditGroupPersonsRequest.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new EditGroupPersonsRequest; result.personIdsToAdd = []; if (jsonObject["personIdsToAdd"] != null) { for (var i in jsonObject["personIdsToAdd"]) { result.personIdsToAdd.push(jsonObject["personIdsToAdd"][i]); } } result.personIdsToRemove = []; if (jsonObject["personIdsToRemove"] != null) { for (var i in jsonObject["personIdsToRemove"]) { result.personIdsToRemove.push(jsonObject["personIdsToRemove"][i]); } } return result; }; return EditGroupPersonsRequest; }()); export { EditGroupPersonsRequest }; var ImageUpload = /** @class */ (function () { function ImageUpload() { } ImageUpload.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new ImageUpload; result.imageData = jsonObject["imageData"]; result.imageUrl = jsonObject["imageUrl"]; return result; }; return ImageUpload; }()); export { ImageUpload }; var PageableItemList = /** @class */ (function () { function PageableItemList() { } PageableItemList.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new PageableItemList; result.items = []; if (jsonObject["items"] != null) { for (var i in jsonObject["items"]) { result.items.push(jsonObject["items"][i]); } } result.page = jsonObject["page"]; result.totalPages = jsonObject["totalPages"]; return result; }; return PageableItemList; }()); export { PageableItemList }; var Person = /** @class */ (function () { function Person() { } Person.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new Person; result.name = jsonObject["name"]; result.updatedAt = jsonObject["updatedAt"]; result.groups = []; if (jsonObject["groups"] != null) { for (var i in jsonObject["groups"]) { result.groups.push(jsonObject["groups"][i]); } } result.id = jsonObject["id"]; result.metadata = jsonObject["metadata"]; result.createdAt = jsonObject["createdAt"]; return result; }; return Person; }()); export { Person }; var PersonGroup = /** @class */ (function () { function PersonGroup() { } PersonGroup.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new PersonGroup; result.name = jsonObject["name"]; result.id = jsonObject["id"]; result.metadata = jsonObject["metadata"]; result.createdAt = jsonObject["createdAt"]; return result; }; return PersonGroup; }()); export { PersonGroup }; var PersonImage = /** @class */ (function () { function PersonImage() { } PersonImage.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new PersonImage; result.path = jsonObject["path"]; result.url = jsonObject["url"]; result.contentType = jsonObject["contentType"]; result.id = jsonObject["id"]; result.metadata = jsonObject["metadata"]; result.createdAt = jsonObject["createdAt"]; return result; }; return PersonImage; }()); export { PersonImage }; var SearchPerson = /** @class */ (function () { function SearchPerson() { } SearchPerson.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new SearchPerson; result.images = []; if (jsonObject["images"] != null) { for (var i in jsonObject["images"]) { var item = SearchPersonImage.fromJson(jsonObject["images"][i]); if (item != undefined) result.images.push(item); } } result.detection = SearchPersonDetection.fromJson(jsonObject["detection"]); result.name = jsonObject["name"]; result.updatedAt = jsonObject["updatedAt"]; result.groups = []; if (jsonObject["groups"] != null) { for (var i in jsonObject["groups"]) { result.groups.push(jsonObject["groups"][i]); } } result.id = jsonObject["id"]; result.metadata = jsonObject["metadata"]; result.createdAt = jsonObject["createdAt"]; return result; }; return SearchPerson; }()); export { SearchPerson }; var SearchPersonDetection = /** @class */ (function () { function SearchPersonDetection() { } SearchPersonDetection.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new SearchPersonDetection; result.landmarks = []; if (jsonObject["landmarks"] != null) { for (var i in jsonObject["landmarks"]) { var item = Point.fromJson(jsonObject["landmarks"][i]); if (item != undefined) result.landmarks.push(item); } } result.rect = Rect.fromJson(jsonObject["rect"]); result.crop = jsonObject["crop"]; result.rotationAngle = jsonObject["rotationAngle"]; return result; }; return SearchPersonDetection; }()); export { SearchPersonDetection }; var SearchPersonImage = /** @class */ (function () { function SearchPersonImage() { } SearchPersonImage.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new SearchPersonImage; result.similarity = jsonObject["similarity"]; result.distance = jsonObject["distance"]; result.path = jsonObject["path"]; result.url = jsonObject["url"]; result.contentType = jsonObject["contentType"]; result.id = jsonObject["id"]; result.metadata = jsonObject["metadata"]; result.createdAt = jsonObject["createdAt"]; return result; }; return SearchPersonImage; }()); export { SearchPersonImage }; var SearchPersonRequest = /** @class */ (function () { function SearchPersonRequest() { } SearchPersonRequest.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new SearchPersonRequest; result.imageUpload = ImageUpload.fromJson(jsonObject["imageUpload"]); result.groupIdsForSearch = []; if (jsonObject["groupIdsForSearch"] != null) { for (var i in jsonObject["groupIdsForSearch"]) { result.groupIdsForSearch.push(jsonObject["groupIdsForSearch"][i]); } } result.threshold = jsonObject["threshold"]; result.limit = jsonObject["limit"]; result.detectAll = jsonObject["detectAll"]; result.outputImageParams = OutputImageParams.fromJson(jsonObject["outputImageParams"]); return result; }; return SearchPersonRequest; }()); export { SearchPersonRequest }; var InitResponse = /** @class */ (function () { function InitResponse() { } InitResponse.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new InitResponse; result.success = jsonObject["success"]; result.error = InitException.fromJson(jsonObject["error"]); return result; }; return InitResponse; }()); export { InitResponse }; var VideoEncoderCompletion = /** @class */ (function () { function VideoEncoderCompletion() { } VideoEncoderCompletion.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new VideoEncoderCompletion; result.success = jsonObject["success"]; result.transactionId = jsonObject["transactionId"]; return result; }; return VideoEncoderCompletion; }()); export { VideoEncoderCompletion }; var PersonDBResponse = /** @class */ (function () { function PersonDBResponse() { } PersonDBResponse.fromJson = function (jsonObject) { if (jsonObject == null || jsonObject == undefined) return undefined; var result = new PersonDBResponse; result.data = jsonObject["data"]; result.error = jsonObject["error"]; return result; }; return PersonDBResponse; }()); export { PersonDBResponse }; export var FontStyle = { NORMAL: 0, BOLD: 1, ITALIC: 2, BOLD_ITALIC: 3, }; export var CustomizationColor = { ONBOARDING_SCREEN_START_BUTTON_BACKGROUND: 100, ONBOARDING_SCREEN_START_BUTTON_TITLE: 101, ONBOARDING_SCREEN_BACKGROUND: 102, ONBOARDING_SCREEN_TITLE_LABEL_TEXT: 103, ONBOARDING_SCREEN_SUBTITLE_LABEL_TEXT: 104, ONBOARDING_SCREEN_MESSAGE_LABELS_TEXT: 105, CAMERA_SCREEN_STROKE_NORMAL: 200, CAMERA_SCREEN_STROKE_ACTIVE: 201, CAMERA_SCREEN_SECTOR_TARGET: 202, CAMERA_SCREEN_SECTOR_ACTIVE: 203, CAMERA_SCREEN_FRONT_HINT_LABEL_BACKGROUND: 204, CAMERA_SCREEN_FRONT_HINT_LABEL_TEXT: 205, CAMERA_SCREEN_BACK_HINT_LABEL_BACKGROUND: 206, CAMERA_SCREEN_BACK_HINT_LABEL_TEXT: 207, CAMERA_SCREEN_LIGHT_TOOLBAR_TINT: 208, CAMERA_SCREEN_DARK_TOOLBAR_TINT: 209, RETRY_SCREEN_BACKGROUND: 300, RETRY_SCREEN_RETRY_BUTTON_BACKGROUND: 301, RETRY_SCREEN_RETRY_BUTTON_TITLE: 302, RETRY_SCREEN_TITLE_LABEL_TEXT: 303, RETRY_SCREEN_SUBTITLE_LABEL_TEXT: 304, RETRY_SCREEN_HINT_LABELS_TEXT: 305, PROCESSING_SCREEN_BACKGROUND: 400, PROCESSING_SCREEN_PROGRESS: 401, PROCESSING_SCREEN_TITLE: 402, SUCCESS_SCREEN_BACKGROUND: 500, }; export var ImageQualityGroupName = { IMAGE_CHARACTERISTICS: 1, HEAD_SIZE_AND_POSITION: 2, FACE_QUALITY: 3, EYES_CHARACTERISTICS: 4, SHADOWS_AND_LIGHTNING: 5, POSE_AND_EXPRESSION: 6, HEAD_OCCLUSION: 7, BACKGROUND: 8, UNKNOWN: 9, }; export var LicensingResultCode = { OK: 0, LICENSE_CORRUPTED: 1, INVALID_DATE: 2, INVALID_VERSION: 3, INVALID_DEVICE_ID: 4, INVALID_SYSTEM_OR_APP_ID: 5, NO_CAPABILITIES: 6, NO_AUTHENTICITY: 7, LICENSE_ABSENT: 8, NO_INTERNET: 9, NO_DATABASE: 10, DATABASE_INCORRECT: 11, }; export var DetectFacesErrorCode = { IMAGE_EMPTY: 0, FR_FACE_NOT_DETECTED: 1, FACER_NO_LICENSE: 2, FACER_IS_NOT_INITIALIZED: 3, FACER_COMMAND_IS_NOT_SUPPORTED: 4, FACER_COMMAND_PARAMS_READ_ERROR: 5, PROCESSING_FAILED: 6, REQUEST_FAILED: 7, API_CALL_FAILED: 8, }; export var CameraPosition = { FRONT: 0, BACK: 1, }; export var InitErrorCode = { IN_PROGRESS_ALREADY: 0, MISSING_CORE: 1, INTERNAL_CORE_ERROR: 2, BAD_LICENSE: 3, UNAVAILABLE: 4, CONTEXT_IS_NULL: 100, RESOURCE_DAT_ABSENT: 101, LICENSE_IS_NULL: 102, }; export var LivenessStatus = { PASSED: 0, UNKNOWN: 1, }; export var LivenessErrorCode = { NOT_INITIALIZED: 0, NO_LICENSE: 1, API_CALL_FAILED: 2, SESSION_START_FAILED: 3, CANCELLED: 4, PROCESSING_TIMEOUT: 5, PROCESSING_FAILED: 6, PROCESSING_FRAME_FAILED: 7, APPLICATION_INACTIVE: 8, CONTEXT_IS_NULL: 9, IN_PROGRESS_ALREADY: 10, ZOOM_NOT_SUPPORTED: 11, CAMERA_NO_PERMISSION: 12, CAMERA_NOT_AVAILABLE: 13, }; export var RecordingProcess = { ASYNCHRONOUS_UPLOAD: 0, SYNCHRONOUS_UPLOAD: 1, NOT_UPLOAD: 2, }; export var DetectFacesBackendErrorCode = { FR_FACE_NOT_DETECTED: 2, FACER_NO_LICENSE: 200, FACER_IS_NOT_INITIALIZED: 201, FACER_COMMAND_IS_NOT_SUPPORTED: 202, FACER_COMMAND_PARAMS_READ_ERROR: 203, UNDEFINED: -1, }; export var MatchFacesErrorCode = { IMAGE_EMPTY: 0, FACE_NOT_DETECTED: 1, LANDMARKS_NOT_DETECTED: 2, FACE_ALIGNER_FAILED: 3, DESCRIPTOR_EXTRACTOR_ERROR: 4, IMAGES_COUNT_LIMIT_EXCEEDED: 5, API_CALL_FAILED: 6, PROCESSING_FAILED: 7, NO_LICENSE: 8, }; export var ImageQualityCharacteristicName = { IMAGE_WIDTH: "ImageWidth", IMAGE_HEIGHT: "ImageHeight", IMAGE_WIDTH_TO_HEIGHT: "ImageWidthToHeight", IMAGE_CHANNELS_NUMBER: "ImageChannelsNumber", ART_FACE: "ArtFace", PADDING_RATIO: "PaddingRatio", FACE_MID_POINT_HORIZONTAL_POSITION: "FaceMidPointHorizontalPosition", FACE_MID_POINT_VERTICAL_POSITION: "FaceMidPointVerticalPosition", HEAD_WIDTH_RATIO: "HeadWidthRatio", HEAD_HEIGHT_RATIO: "HeadHeightRatio", EYES_DISTANCE: "EyesDistance", YAW: "Yaw", PITCH: "Pitch", ROLL: "Roll", BLUR_LEVEL: "BlurLevel", NOISE_LEVEL: "NoiseLevel", UNNATURAL_SKIN_TONE: "UnnaturalSkinTone", FACE_DYNAMIC_RANGE: "FaceDynamicRange", EYE_RIGHT_CLOSED: "EyeRightClosed", EYE_LEFT_CLOSED: "EyeLeftClosed", EYE_RIGHT_OCCLUDED: "EyeRightOccluded", EYE_LEFT_OCCLUDED: "EyeLeftOccluded", EYES_RED: "EyesRed", EYE_RIGHT_COVERED_WITH_HAIR: "EyeRightCoveredWithHair", EYE_LEFT_COVERED_WITH_HAIR: "EyeLeftCoveredWithHair", OFF_GAZE: "OffGaze", TOO_DARK: "TooDark", TOO_LIGHT: "TooLight", FACE_GLARE: "FaceGlare", SHADOWS_ON_FACE: "ShadowsOnFace", SHOULDERS_POSE: "ShouldersPose", EXPRESSION_LEVEL: "ExpressionLevel", MOUTH_OPEN: "MouthOpen", SMILE: "Smile", DARK_GLASSES: "DarkGlasses", REFLECTION_ON_GLASSES: "ReflectionOnGlasses", FRAMES_TOO_HEAVY: "FramesTooHeavy", FACE_OCCLUDED: "FaceOccluded", HEAD_COVERING: "HeadCovering", FOREHEAD_COVERING: "ForeheadCovering", STRONG_MAKEUP: "StrongMakeup", HEAD_PHONES: "Headphones", MEDICAL_MASK: "MedicalMask", BACKGROUND_UNIFORMITY: "BackgroundUniformity", SHADOWS_ON_BACKGROUND: "ShadowsOnBackground", OTHER_FACES: "OtherFaces", BACKGROUND_COLOR_MATCH: "BackgroundColorMatch", UNKNOWN: "Unknown", IMAGE_CHARACTERISTIC_ALL_RECOMMENDED: "ImageCharacteristic", HEAD_SIZE_AND_POSITION_ALL_RECOMMENDED: "HeadSizeAndPosition", FACE_IMAGE_QUALITY_ALL_RECOMMENDED: "FaceImageQuality", EYES_CHARACTERISTICS_ALL_RECOMMENDED: "EyesCharacteristics", SHADOW_AND_LIGHTING_ALL_RECOMMENDED: "ShadowsAndLightning", POSE_AND_EXPRESSION_ALL_RECOMMENDED: "PoseAndExpression", HEAD_OCCLUSION_ALL_RECOMMENDED: "HeadOcclusion", QUALITY_BACKGROUND_ALL_RECOMMENDED: "QualityBackground", }; export var ScreenOrientation = { PORTRAIT: 0, LANDSCAPE: 1, }; export var CustomizationFont = { ONBOARDING_SCREEN_START_BUTTON: 100, ONBOARDING_SCREEN_TITLE_LABEL: 101, ONBOARDING_SCREEN_SUBTITLE_LABEL: 102, ONBOARDING_SCREEN_MESSAGE_LABELS: 103, CAMERA_SCREEN_HINT_LABEL: 200, RETRY_SCREEN_RETRY_BUTTON: 300, RETRY_SCREEN_TITLE_LABEL: 301, RETRY_SCREEN_SUBTITLE_LABEL: 302, RETRY_SCREEN_HINT_LABELS: 303, PROCESSING_SCREEN: 400, }; export var DetectFacesScenario = { CROP_CENTRAL_FACE: "CropCentralFace", CROP_ALL_FACES: "CropAllFaces", THUMBNAIL: "Thumbnail", ATTRIBUTES_ALL: "AttributesAll", QUALITY_FULL: "QualityFull", QUALITY_ICAO: "QualityICAO", QUALITY_VISA_SCHENGEN: "QualityVisaSchengen", QUALITY_VISA_USA: "QualityVisaUSA", }; export var LivenessProcessStatus = { START: 0, PREPARING: 1, NEW_SESSION: 2, NEXT_STAGE: 3, SECTOR_CHANGED: 4, PROGRESS: 5, LOW_BRIGHTNESS: 6, FIT_FACE: 7, MOVE_AWAY: 8, MOVE_CLOSER: 9, TURN_HEAD: 10, PROCESSING: 11, FAILED: 12, RETRY: 13, SUCCESS: 14, }; export var OutputImageCropAspectRatio = { OUTPUT_IMAGE_CROP_ASPECT_RATIO_3X4: 0, OUTPUT_IMAGE_CROP_ASPECT_RATIO_4X5: 1, OUTPUT_IMAGE_CROP_ASPECT_RATIO_2X3: 2, OUTPUT_IMAGE_CROP_ASPECT_RATIO_1X1: 3, OUTPUT_IMAGE_CROP_ASPECT_RATIO_7X9: 4, }; export var LivenessType = { ACTIVE: 0, PASSIVE: 1, }; export var LivenessSkipStep = { ONBOARDING_STEP: 0, SUCCESS_STEP: 1, }; export var ImageQualityResultStatus = { IMAGE_QUALITY_RESULT_STATUS_FALSE: 0, IMAGE_QUALITY_RESULT_STATUS_TRUE: 1, IMAGE_QUALITY_RESULT_STATUS_UNDETERMINED: 2, }; export var ImageType = { PRINTED: 1, RFID: 2, LIVE: 3, DOCUMENT_WITH_LIVE: 4, EXTERNAL: 5, GHOST_PORTRAIT: 6, BARCODE: 7, }; export var FaceCaptureErrorCode = { CANCEL: 0, TIMEOUT: 1, NOT_INITIALIZED: 2, SESSION_START_FAILED: 3, CAMERA_NOT_AVAILABLE: 4, CAMERA_NO_PERMISSION: 5, IN_PROGRESS_ALREADY: 6, CONTEXT_IS_NULL: 7, }; export var LivenessBackendErrorCode = { UNDEFINED: -1, NO_LICENSE: 200, NOT_INITIALIZED: 201, COMMAND_IS_NOT_SUPPORTED: 202, PARAMS_READ_ERROR: 203, LOW_QUALITY: 231, TRACK_BREAK: 246, CLOSED_EYES_DETECTED: 230, HIGH_ASYMMETRY: 232, FACE_OVER_EMOTIONAL: 233, SUNGLASSES_DETECTED: 234, SMALL_AGE: 235, HEADDRESS_DETECTED: 236, MEDICINE_MASK_DETECTED: 239, OCCLUSION_DETECTED: 240, FOREHEAD_GLASSES_DETECTED: 242, MOUTH_OPENED: 243, ART_MASK_DETECTED: 244, NOT_MATCHED: 237, IMAGES_COUNT_LIMIT_EXCEEDED: 238, ELECTRONIC_DEVICE_DETECTED: 245, WRONG_GEO: 247, WRONG_OF: 248, WRONG_VIEW: 249, TIMEOUT_LIVENESS_TRANSACTION: 250, FAILED_LIVENESS_TRANSACTION: 251, ABORTED_LIVENESS_TRANSACTION: 252, GENERAL_CHECK_FAIL: 253, PASSIVE_LIVENESS_FAIL: 254, PRINTED_FACE_DETECTED: 255, BLOCKED_REQUEST: 256, CORRUPTED_REQUEST: 257, }; export var ProcessingMode = { ONLINE: 0, OFFLINE: 1, }; export var CustomizationImage = { ONBOARDING_SCREEN_CLOSE_BUTTON: 100, ONBOARDING_SCREEN_ILLUMINATION: 101, ONBOARDING_SCREEN_ACCESSORIES: 102, ONBOARDING_SCREEN_CAMERA_LEVEL: 103, CAMERA_SCREEN_CLOSE_BUTTON: 200, CAMERA_SCREEN_LIGHT_ON_BUTTON: 201, CAMERA_SCREEN_LIGHT_OFF_BUTTON: 202, CAMERA_SCREEN_SWITCH_BUTTON: 203, RETRY_SCREEN_CLOSE_BUTTON: 300, RETRY_SCREEN_HINT_ENVIRONMENT: 301, RETRY_SCREEN_HINT_SUBJECT: 302, PROCESSING_SCREEN_CLOSE_BUTTON: 400, SUCCESS_SCREEN_IMAGE: 500, }; export var DetectFacesAttribute = { AGE: "Age", EYE_RIGHT: "EyeRight", EYE_LEFT: "EyeLeft", EMOTION: "Emotion", SMILE: "Smile", GLASSES: "Glasses", HEAD_COVERING: "HeadCovering", FOREHEAD_COVERING: "ForeheadCovering", MOUTH: "Mouth", MEDICAL_MASK: "MedicalMask", OCCLUSION: "Occlusion", STRONG_MAKEUP: "StrongMakeup", HEADPHONES: "Headphones", }; export var Enum = { FontStyle: FontStyle, CustomizationColor: CustomizationColor, ImageQualityGroupName: ImageQualityGroupName, LicensingResultCode: LicensingResultCode, DetectFacesErrorCode: DetectFacesErrorCode, CameraPosition: CameraPosition, InitErrorCode: InitErrorCode, LivenessStatus: LivenessStatus, LivenessErrorCode: LivenessErrorCode, RecordingProcess: RecordingProcess, DetectFacesBackendErrorCode: DetectFacesBackendErrorCode, MatchFacesErrorCode: MatchFacesErrorCode, ImageQualityCharacteristicName: ImageQualityCharacteristicName, ScreenOrientation: ScreenOrientation, CustomizationFont: CustomizationFont, DetectFacesScenario: DetectFacesScenario, LivenessProcessStatus: LivenessProcessStatus, OutputImageCropAspectRatio: OutputImageCropAspectRatio, LivenessType: LivenessType, LivenessSkipStep: LivenessSkipStep, ImageQualityResultStatus: ImageQualityResultStatus, ImageType: ImageType, FaceCaptureErrorCode: FaceCaptureErrorCode, LivenessBackendErrorCode: LivenessBackendErrorCode, ProcessingMode: ProcessingMode, CustomizationImage: CustomizationImage, DetectFacesAttribute: DetectFacesAttribute, }; var FaceSDKOriginal = /** @class */ (function (_super) { __extends(FaceSDKOriginal, _super); function FaceSDKOriginal() { return _super !== null && _super.apply(this, arguments) || this; } FaceSDKOriginal.prototype.getVersion = function () { return cordova(this, "getVersion", {}, arguments); }; FaceSDKOriginal.prototype.getServiceUrl = function () { return cordova(this, "getServiceUrl", {}, arguments); }; FaceSDKOriginal.prototype.setServiceUrl = function (url) { return cordova(this, "setServiceUrl", {}, arguments); }; FaceSDKOriginal.prototype.setLocalizationDictionary = function (dictionary) { return cordova(this, "setLocalizationDictionary", {}, arguments); }; FaceSDKOriginal.prototype.setRequestHeaders = function (headers) { return cordova(this, "setRequestHeaders", {}, arguments); }; FaceSDKOriginal.prototype.setCustomization = function (config) { return cordova(this, "setCustomization", {}, arguments); }; FaceSDKOriginal.prototype.isInitialized = function () { return cordova(this, "isInitialized", {}, arguments); }; FaceSDKOriginal.prototype.initialize = function (config) { return cordova(this, "initialize", {}, arguments); }; FaceSDKOriginal.prototype.deinitialize = function () { return cordova(this, "deinitialize", {}, arguments); }; FaceSDKOriginal.prototype.startFaceCapture = function (config) { return cordova(this, "startFaceCapture", { "observable": true }, arguments); }; FaceSDKOriginal.prototype.stopFaceCapture = function () { return cordova(this, "stopFaceCapture", {}, arguments); }; FaceSDKOriginal.prototype.startLiveness = function (config) { return cordova(this, "startLiveness", { "observable": true }, arguments); }; FaceSDKOriginal.prototype.stopLiveness = functi