UNPKG

@idscan/idvc

Version:

component for the capturing documents

1 lines 9.61 kB
import loadModes from"./environment/loadModes.json";import capturingModes from"./environment/capturingModes.json";import priorityModes from"./environment/priorityModes.json";import realFaceModes from"./environment/realFaceModes.json";import stepDescriptions from"./environment/stepsDescription.json";export default[{name:"el",type:"String",description:"This option shows an ID of an element on the page where the component will be integrated.",defaultValue:"videoCapturingEl",validationFn:"validateElement"},{name:"licenseKey",type:"String",description:"key for the library",defaultValue:"",validationFn:"validateString"},{name:"networkUrl",type:"String",description:"path to the folder with neural networks. Specify the path on the server if you need to remove the folder to another location. The default path is 'networks'.",defaultValue:"networks",validationFn:"validateString"},{name:"steps",type:"Array",description:"array of steps which are necessary for you. Every step represents an object with the fields 'type' and 'name'. The field 'name' is the name of a step, which will be represented in the header. The field 'type' is a type of a step. Possible variants are:\nfront – capture of a document with the following analysis of the document type. In case if a document requires the back side, the step for the back side of a document will be added automatically. Use the step 'front' if you use the component for the document validation.\nmrz – detection, capture and parsing of the mrz-code of a document\npdf – detection and capture of pdf417 of a document\nface – detection and capture of a face using the front camera\ncapturing – capture of a document without analysis\nbarcode – detection, capture and parsing 1 dimensional (barcodes) or 2 dimensional (qr codes)\n",defaultValue:[{type:"front",name:"Document Front"},{type:"face",name:"Face"}],values:["front","mrz","capturing","pdf","back","face","barcode"],arrayValues:Object.keys(stepDescriptions),validationFn:"validateSteps",multiple:!0},{name:"types",type:"Array",description:"This option shows an array of acceptable documents. If you are going to use the component for the document validation, you can limit the list of acceptable documents.\nAvailable types (int):\nID (1) – USA driver license and USA ID (non-driver license), Canadian driver licenses,\nPassport (2) – with 2 lines MRZ\nPassportCard (3) – with 3 lines MRZ (most European IDs, USA passports/cards)\nGreenCard (6) – USA Permanent Resident Cards (only MRZ),\nInternationalId (7) – Internationally approved U.S. IDs with 3 lines MRZ\n",values:["ID","Passport","PassportCard","GreenCard","InternationalId"],defaultValue:[],validationFn:"validateTypes",multiple:!0},{name:"priority",type:"Array",description:"This option shows an initial method of work of the component. Available values: 'uploader', 'camera', 'auto' (on desktop - uploader, on mobile - camera).",values:["uploader","camera","auto"],defaultValue:"auto",validationFn:"validateDistinctStringInArray",arrayValues:Object.keys(priorityModes),multiple:!1},{name:"capturingMode",type:"Array",description:"The option switches the mode of capturing the front of the documents. Available values are 2,4, ‘none’. Type 2 - auto capturing with the help of determining the borders. Type 4 - auto capturing which analyses the text in the image. ‘None’ - switch off the auto capturing. This method should be used together with the option showForceCapturingBtn:true.",values:["2","4","none"],defaultValue:"4",validationFn:"validateDistinctStringInArray",arrayValues:Object.keys(capturingModes),multiple:!1},{name:"realFaceMode",values:["auto","all","none"],type:"Array",description:"This option enables advanced capture with volumetric face detection. Available values: 'auto', 'all', 'none'. Auto - enable \"realFaceMode\" only for iphone. All - enable \"realFaceMode\" for all devices. None - disable this option.",defaultValue:"auto",validationFn:"validateDistinctStringInArray",arrayValues:Object.keys(realFaceModes),multiple:!1},{name:"resizeUploadedImage",type:"Number",description:"sets the maximum size for manually loaded pictures.",defaultValue:-1,validationFn:"validateNumber"},{name:"minPDFframes",type:"Number",description:'the option "minPDFframes" which determines the minimal number of frames for capturing the PDF417',defaultValue:2,validationFn:"validateNumber"},{name:"isShowManualSwitchButton",type:"Boolean",description:"This option enables/disables the button you are able to switch between the uploader and the video with.",defaultValue:!0,validationFn:"validateShowManualSwitchButton"},{name:"showSubmitBtn",type:"Boolean",description:'This option enables/disables the "submit" button after capturing all the images.',defaultValue:!0,validationFn:"validateBool"},{name:"useCDN",type:"Boolean",description:"set to true if you prefer to load neural networks from cdn instead of your domain.",defaultValue:!1,validationFn:"validateBool"},{name:"enableLimitation",type:"Boolean",description:"Using Boolean parameter you are able to switch off the limitation for desktop browsers.",defaultValue:!0,validationFn:"validateBool"},{name:"showPreviewForOneStep",type:"Boolean",description:"using this option you can hide the preview if you have only one step configured.",defaultValue:!0,validationFn:"validateBool"},{name:"autoContinue",type:"Boolean",description:"This option switches on/off the automatic transition to the next step.",defaultValue:!0,validationFn:"validateBool"},{name:"isShowVersion",type:"Boolean",description:"hide/show version of library in the bottom",defaultValue:!0,validationFn:"validateBool"},{name:"tapOnVideo",type:"Boolean",description:"Tap and hold the video if you want to capture frame manual.",defaultValue:!1,validationFn:"validateBool"},{name:"tapBackSide",type:"Boolean",description:"tap and hold the screen to capture the back side of the ID",defaultValue:!1,validationFn:"validateBool"},{name:"tapFace",type:"Boolean",description:"tap and hold the screen to capture the face.",defaultValue:!1,validationFn:"validateBool"},{name:"disableFaceStepFileUpload",type:"Boolean",description:"",defaultValue:!1,validationFn:"validateBool"},{name:"enableFlash",type:"Boolean",description:"This option turns on/off the flash while capturing an image.",defaultValue:!1,validationFn:"validateBool"},{name:"showForceCapturingBtn",type:"Boolean",description:"Switches on the button over the video. On pressing this button, the capturing of the image will take place.",defaultValue:!1,validationFn:"validateBool"},{name:"isShowGuidlinesButton",type:"Boolean",description:"Switches on the button show guidLines",defaultValue:!1,validationFn:"validateBool"},{name:"parsePDF",type:"Boolean",description:"if it is enabled, the received trackstring is converted into the parsed document fields. Thus on-server parsing won’t be necessary. At the PDF step, the parsedData object would be available.",defaultValue:!1,validationFn:"validateBool"},{name:"fixFrontOrientAfterUpload",type:"Boolean",description:"This option provides the possibility to adjust the correct position of the document in case of manual uploading.",defaultValue:!1,validationFn:"validateBool"},{name:"enableGeolocation",type:"Boolean",description:"the option which allows to get user's latitude and longitude location.",defaultValue:!1,validationFn:"validateBool"},{name:"displayParsedData",type:"Boolean",description:"the option which allows to show parsed results in modal window on submit.",defaultValue:!1,validationFn:"validateBool"},{name:"isSubmitMetaData",type:"Boolean",description:"",defaultValue:!0,validationFn:"validateBool"},{name:"parseMRZ",type:"Boolean",description:"if it is enabled, the captured mrz strings is converted into the parsed document fields. Thus on-server parsing won’t be necessary. At the Front and mrz steps, the parsedData object would be available.",defaultValue:!1,validationFn:"validateBool"},{name:"strictAllowedTypes",type:"Boolean",description:"The Strict Allowed Types mode shows an error when a document used is not from the list of acceptable documents.",defaultValue:!1,validationFn:"validateBool"},{name:"onChange",type:"Function",description:"callback-function which will be called after change one step. The returnable value is the object with the type and the image",defaultValue:()=>!0,validationFn:"validateFunction"},{name:"clickGuidlines",type:"Function",description:"callback-function which will be called after guidLines button.",defaultValue:()=>!0,validationFn:"validateFunction"},{name:"onReset",type:"Function",description:"callback-function which will be called after reset all the steps. The returnable value is the object with the steps",defaultValue:()=>!0,validationFn:"validateFunction"},{name:"submit",type:"Function",description:"callback-function which will be called after completing all the steps.",defaultValue:()=>!0,validationFn:"validateFunction"},{name:"onRetakeHook",type:"Function",description:"the function that will be called before reset the current step. The returnable value is the object with the current step",defaultValue:()=>!0,validationFn:"validateFunction"},{name:"onCameraError",type:"Function",description:"The function that is invoked in case if the camera is not available. The response value is the object with the error code and the message",defaultValue:()=>!0,validationFn:"validateFunction"},{name:"onMounted",type:"Function",description:"the function that will be called on the component mounted. This function doesn't return a value.",defaultValue:()=>!0,validationFn:"validateFunction"}];