@idscan/idvc2 3.0.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/idvc.js.gzip CHANGED
Binary file
@@ -1,8 +1,9 @@
1
1
  import realFaceModes, { RealFaceMode } from './environment/realFaceModes';
2
2
  import { DocumentTypeName } from './environment/documentTypes';
3
3
  import { StepType } from './environment/stepsDescription';
4
- import { supportedLanguages } from './environment/langs';
4
+ import { AllLabels, supportedLanguages} from './environment/langs';
5
5
  import { ModalPositionKeys, modalPositions } from './environment/modalPosition';
6
+ import { DeepPartial } from './types/helpers/DeepPartial';
6
7
 
7
8
  export type ValidationFn =
8
9
  'validateElement'
@@ -11,6 +12,7 @@ export type ValidationFn =
11
12
  | 'validateDistinctStringInArray'
12
13
  | 'validateNumber'
13
14
  | 'validateFunction'
15
+ | 'ValidateDictionaryLangMatch'
14
16
  | 'validateBool';
15
17
  type DefaultValueFunction = () => boolean;
16
18
  export type NormalizedType = 'Path';
@@ -45,6 +47,7 @@ export type DefaultConfigName = 'el'
45
47
  | 'licenseKey'
46
48
  | 'networkUrl'
47
49
  | 'language'
50
+ | 'customTranslations'
48
51
  | 'documentTypes'
49
52
  | 'realFaceMode'
50
53
  | 'modalPosition'
@@ -89,7 +92,7 @@ export interface IDefaultConfig {
89
92
  defaultValue: StepMode | string | boolean | DefaultValueFunction | number | DocumentType[],
90
93
  validationFn: ValidationFn,
91
94
  hidden?: boolean,
92
- values?: ModalPositionKeys[] | RealFaceMode[] | typeof supportedLanguages[number][] | ImageURI[],
95
+ values?: ModalPositionKeys[] | RealFaceMode[] | typeof supportedLanguages[number][] | ImageURI[] | DeepPartial<AllLabels>,
93
96
  arrayValues?: unknown[],
94
97
  multiple?: boolean,
95
98
  normalizedType?: NormalizedType,
@@ -133,6 +136,13 @@ const defaultConfig: IDefaultConfig[] = [
133
136
  arrayValues: Array.from(supportedLanguages),
134
137
  multiple: false,
135
138
  },
139
+ {
140
+ name: 'customTranslations',
141
+ type: 'Object',
142
+ defaultValue: {},
143
+ description: '',
144
+ validationFn: 'ValidateDictionaryLangMatch',
145
+ },
136
146
  {
137
147
  name: 'documentTypes',
138
148
  type: 'Array',
@@ -187,5 +187,26 @@
187
187
  "uploader success sign's checkmark",
188
188
  "description of capture progress"
189
189
  ]
190
+ },
191
+ "--color-loader-primary": {
192
+ "default": "#DCE7FD",
193
+ "type": "Color",
194
+ "description": [
195
+ "Primary brand color of the loader"
196
+ ]
197
+ },
198
+ "--color-loader-secondary": {
199
+ "default": "#5185F3",
200
+ "type": "Color",
201
+ "description": [
202
+ "Secondary brand color of the loader"
203
+ ]
204
+ },
205
+ "--color-loader-tertiary": {
206
+ "default": "#85AAF7",
207
+ "type": "Color",
208
+ "description": [
209
+ "Tertiary accent color of the loader"
210
+ ]
190
211
  }
191
212
  }
@@ -1 +1 @@
1
- var e={d:(a,o)=>{for(var t in o)e.o(o,t)&&!e.o(a,t)&&Object.defineProperty(a,t,{enumerable:!0,get:o[t]})},o:(e,a)=>Object.prototype.hasOwnProperty.call(e,a)},a={};e.d(a,{J3:()=>o,_2:()=>r,i0:()=>i});var o=["en","es"],t={es:{errorCodes:{mrzNotFound:"Advertencia: No se ha encontrado MRZ.",mrzNotRecognized:"Advertencia: No se han podido leer los datos MRZ. Intente tomar otra imagen.",barcodeNotFound:"Warning: Código de barras no encontrado.",barcodeNotRecognized:"Advertencia: No se pudieron leer los datos del código de barras.<br/>Intente tomar una imagen de mayor calidad.",heic:"El archivo HEIC está dañado",fileTypeHeic:"Error de tipo de archivo: Sólo se admiten imágenes jpeg, png y heic.",fileType:"Error de Tipo de Archivo. Tipos admitidos: bmp, gif, jpg, png, tiff, webp.",disableStepFileUpload:"Se debe utilizar un dispositivo con una cámara para capturar esta imagen",notAllowedDocument:"Documento no reconocido como tipo de documento requerido",documentSideLowPerimeter:"Advertencia: El documento de la foto es demasiado pequeño, acércalo más",faceOnFrontNotDetected:"Advertencia: No se encuentra ninguna cara en el anverso del documento",frontSideNotDetected:"Advertencia: La imagen no se reconoce como el anverso del tipo de documento elegido",backSideNotDetected:"Advertencia: La imagen no se reconoce como el reverso del tipo de documento elegido",faceNotFound:"Advertencia: No se ha encontrado la cara de una persona en la imagen capturada",disabledManualUpload:{header:"La carga manual está deshabilitada",text:"La captura de documentos mediante carga manual está deshabilitada en la configuración"},default:{header:"Por favor, inténtelo de nuevo",text:"Lo sentimos, <br/>pero hubo un problema al capturar y enviar las imágenes de su documento. Por favor, inténtelo de nuevo."},CameraNotFound:{header:"No se ha encontrado",text:"No se encontró ninguna cámara en su dispositivo"},CameraNotFoundInVerification:{header:"No se ha encontrado",text:"No se ha encontrado ninguna cámara en su dispositivo.<br/> Por favor, utilice un dispositivo diferente o permitir el acceso a la cámara para la verificación"},CameraNotAllowed:{header:"No autorizado",text:"Concede permiso para que el navegador acceda a la cámara del dispositivo <br/>o elige la opción Carga manual."},CameraNotAvailable:{header:"No disponible",text:"La cámara no está disponible en este momento"},CameraInUse:{header:"En uso",text:"La cámara ya está en uso"},MediaDevicesNotSupported:{header:"No se admite",text:"Tu navegador no es compatible"},UnsuitableCamera:{header:"Una cámara inadecuada",text:"La cámara de tu dispositivo no es adecuada para nuestra aplicación (doble cámara, cámara gran angular, etc.)"},lowImageResolution:"La resolución de la imagen cargada es demasiado baja",imageIsBlurred:"La imagen es demasiado borrosa para ser utilizada",faceLowArea:"El área de la cara en la foto ocupa muy poco espacio"},hintTexts:{front:"Coloque el anverso del documento",frontMRZ:"Haga zoom para capturar el código en la parte inferior",mrz:"Haga zoom para capturar el código en la parte posterior",capturing:"Coloque el anverso del documento",pdf:"Coloque el código de barras dentro del marco",switchToUploader:"No se puede leer el código de barras. <br/>Cambie al modo de carga manual de fotos para la validación.",back:"Da la vuelta a tu documento",barcode:"Coloque el código de barras dentro del marco",hold:{front:"Coloque la cara frontal del documento dentro del cuadro delimitador",pdf:"Coloque la cara del documento con un código de barras PDF417 dentro del cuadro delimitador",mrz:"Coloque el lado con MRZ de su documento dentro del cuadro delimitador",back:"Coloque el reverso del documento dentro del cuadro delimitador",barcode:"Posicionar el código de barras dentro del cuadro delimitador"},capture:{pdf:"Alinee el código de barras de su documento con el código de barras de la pantalla.",mrz:"Alinee la MRZ de su documento con la MRZ de la pantalla.",back:"Captura el reverso del documento"},dontSee:"No te veo",dontMove:"No te muevas",turnFaceLeft:"Gira la cara a la izquierda",turnFaceRight:"Gira la cara a la derecha",turnFaceUp:"Levanta tu cara",turnFaceDown:"Bajar la cara",faceCam:"Enfréntate a la cámara",camAway:"Mover la cámara más lejos",moveCenter:"Mover al centro",comeCloser:"Acércate",documentCloser:"Acerque el documento",holdCamera:"Manténgase firme, analizando el documento",captureCorners:"Asegúrese de que todas las esquinas del documento están dentro del marco",frontSideNotMatch:"El anverso del documento no coincide con el documento seleccionado"},keyErrors:["La clave de licencia ha caducado","La Clave de Licencia no es Válida","La URL Configurada De La Clave De Licencia No Coincide"],general:{step:"Paso",scan:"Escanear",front:"Frontal",mrz:"MRZ",mrzFront:"MRZ",pdf:"PDF",face:"Selfie",barcode:"Código de barras",back:"Atrás",awaiting:"A la espera de",notificationStepSuccess:"Añadido con éxito",notificationStepWarning:"No se reconoce la imagen",notificationDocumentTypeChangedInfo:"Se ha modificado el tipo de documento",notificationStepsResetInfo:"Se han restablecido todos los pasos",notificationStepMinSize:"La resolución es demasiado baja",notificationSubmit:"Enviado",notificationCaptureHook:"La captura automática funcionará mejor si el documento se coloca sobre una superficie plana de color oscuro en una zona con buena iluminación. Si el documento no se puede capturar automáticamente, lo mejor es utilizar la opción de carga manual.",notificationCaptureSide:"El lado del documento fue capturado",notificationCaptureWithWarnings:"Pulse el botón Atrás para ir a la página de inicio y presentar los documentos cargados.",idvcVersionPlank:"Desarrollado por",submitProcessSpinner:{top:"El documento se ha presentado para su tramitación",bottom:"Espere la respuesta"},card:{edit:"Editar",complete:"Completo"},modeSwitch:{video:"Escaneado de cámara",uploader:"Carga manual"},uploader:{dragHint:"Haga clic o arrastre y suelte <br> para cargar el archivo",dividerHint:"o",fileHint:"Buscar archivo",successUpload:"subido exitosamente",warningUpload:"resultado incorrecto",mainHint:"Asegúrese de que su identificación llena toda la pantalla <br> con poco o ningún fondo.",complete:"Completo"},messageBox:{default:"Escanee su documento",changeDocumentTypeText:"Cambiar el tipo de documento",documentTypeText:"Tipo de documento",disableProcessing:"Permisos de la cámara la configuración que se está utilizando no permite al usuario completar el proceso de captura/envío de imágenes"},controlButtons:{upload:"Cargar",reset:"Restablecer todos los pasos",submit:"Enviar",start:"Inicio",back:"Volver",edit:"Cambiar foto",continue:"Continuar",capture:"Captura",retake:"Retomar"},desktopNotification:{barcode:"Es posible que el proceso de captura del código de barras con su dispositivo no funcione muy bien. Pruebe a utilizar su dispositivo móvil.",mrz:"Es posible que el proceso de captura de MRZ mediante su dispositivo no funcione muy bien. Pruebe a utilizar su dispositivo móvil.",other:"Es posible que el proceso de captura de imágenes con tu dispositivo no funcione muy bien. Pruebe a utilizar su dispositivo móvil."},documentType:"Su Tipo de Documento es",selectDocumentTypeText:"Cambiar el tipo de documento",changeBtn:"Cambiar",correctBtn:"Corregir",cancelBtn:"Cancelar",doneBtn:"Hecho",closeBtn:"Cerrar",retakeBtn:"VOLVER",continueBtn:"CONTINUAR",submitBtn:"ENVIAR",resetAllStepsBtn:"Restablecer todos los pasos",btnUploader:"Cambiar a cargador manual",btnCamera:"Cambiar al modo de cámara",pressToUpdateText:"Pulse para actualizar",pressToUpdateTextSuccess:"Pulse para actualizar"},uploaderDescription:{textFront:"Haga clic aquí para cargar el frente de su identificación",textBack:"Haga clic aquí para cargar el reverso de una identificación",textFace:"Haga clic aquí para cargar una foto de su rostro",textPdf:"Haga clic aquí para cargar el reverso de una identificación",textMrz:"Haga clic aquí para cargar una foto de su documento'",textFrontBack:"Asegúrese de que su identificación llene toda la pantalla <br> de la cámara con poco o ningún fondo.",textPass:"Asegúrese de que su identificación llene toda la pantalla de la cámara <br> con poco o ningún fondo, y que se incluya el código MRZ completo",textFacePosition:"Coloque su rostro para ocupar toda la pantalla <br> de la cámara con poco o ningún fondo."},documentsTypes:{DL:"Permiso de conducir",IC:"Tarjeta de identificación",Passport:"Pasaporte",PassportCard:"Tarjeta de Pasaporte",GreenCard:"Tarjeta Verde",EmploymentAuthorization:"Autorización de Empleo",InternationalId:"Identificación Internacional",Barcode:"Códigos de barras 1-D y 2-D",FaceAuthorization:"Autorización facial"},loaderText:{warmup:{top:"La red neuronal se está calentando",bottom:"La captura de documentos estará lista para su uso en breve..."},awaiting:"A la espera de la respuesta de la cámara",loadingStep:"Paso de carga",changeMode:"El modo está cambiando",resetting:"Restablecer",uploading:"Cargar",preparingToWork:"Prepararse para trabajar",loadingDocument:"Carga del documento"}},en:{errorCodes:{mrzNotFound:"Warning: MRZ was not found.",mrzNotRecognized:"Warning: MRZ data could not be read. Try taking another image.",barcodeNotFound:"Warning: Barcode not found.",barcodeNotRecognized:"Warning: Barcode data could not be read.<br/>Try taking a higher quality image.",heic:"HEIC file incorrupted",fileType:"File Type Error. Supported types: bmp, gif, jpg, png, tif, webp.",fileTypeHeic:"File Type Error: Only jpeg, png and heic images are supported.",disableStepFileUpload:"A device with a camera must be used to capture this image",notAllowedDocument:"Document not recognized as required document type",documentSideLowPerimeter:"Warning: The document in the photo is too small, bring it closer",frontSideNotDetected:"Warning: The image isn't recognized as the front side of the chosen document type",backSideNotDetected:"Warning: The document's side isn't recognized as the back side of the chosen document type",faceNotFound:"Warning: A person's face was not found in captured image",faceOnFrontNotDetected:"Warning: No face is found on the front of the document",disabledManualUpload:{header:"Manual upload is disabled",text:"Document capture via manual upload is disabled in the configuration"},default:{header:"Please try again",text:"We're sorry, but there was an issue capturing and submitting the images of your document. Please try again"},CameraNotFound:{header:"Not found",text:"No camera was found on your device"},CameraNotFoundInVerification:{header:"Not found",text:"No camera was found on your device. <br/>Please use a different device or allow access to the camera for verification"},CameraNotAllowed:{header:"Not allowed",text:"Grant permission for the browser to access the device camera <br/> or choose the Manual Upload option"},CameraNotAvailable:{header:"Not available",text:"Camera is not available at the moment"},CameraInUse:{header:"In use",text:"Camera is already in use"},MediaDevicesNotSupported:{header:"Not supported",text:"Your browser is not supported"},UnsuitableCamera:{header:"An unsuitable camera",text:"The camera on your device is unsuitable for our application (dual camera, wide-angle camera, etc.)"},lowImageResolution:"The resolution of the uploaded image is too low",imageIsBlurred:"The image is too blurry to be used",faceLowArea:"Face area in the photo takes up too little space"},hintTexts:{front:"Position the front of the document",frontMRZ:"Zoom in to capture code at bottom",mrz:"Zoom in to capture code on back side",capturing:"Position the front of the document",pdf:"Position the barcode inside the frame",switchToUploader:"The barcode cannot be read. <br/>Please switch to manual photo upload mode",back:"Turn around your document",barcode:"Position the barcode inside the frame",hold:{front:"Position the front side of your document inside the bounding box",pdf:"Position the side of your document with a PDF417 barcode inside the bounding box",mrz:"Position the side with MRZ of your document inside the bounding box",back:"Position the back side of your document inside the bounding box",barcode:"Position the barcode inside the bounding box"},capture:{pdf:"Line up the barcode on your document with the barcode on the screen",mrz:"Line up the MRZ on your document with the MRZ on the screen",back:"Capture the back side of your document"},dontSee:"I don't see you",dontMove:"Don't move",turnFaceLeft:"Turn your face left",turnFaceRight:"Turn your face right",turnFaceUp:"Turn your face up",turnFaceDown:"Turn your face down",faceCam:"Face the camera",camAway:"Move camera further away",moveCenter:"Move to the center",comeCloser:"Come closer",documentCloser:"Bring the document closer",holdCamera:"Hold steady, analyzing document",captureCorners:"Make sure all corners of the document are inside the frame",frontSideNotMatch:"The front side of the document does not match the selected document"},keyErrors:["License Key has Expired","License Key is Not Valid","License Key's Configured URL Does Not Match"],general:{step:"Step",scan:"Scan",front:"Front",mrz:"MRZ",mrzFront:"MRZ",pdf:"PDF",face:"Selfie",barcode:"Barcode",back:"Back",awaiting:"Awaiting",notificationStepSuccess:"Successfully added",notificationStepWarning:"Image is not recognized",notificationDocumentTypeChangedInfo:"Document type has been changed",notificationStepsResetInfo:"All steps have been reset",notificationStepMinSize:"The resolution is too low",notificationSubmit:"Submitted",notificationCaptureHook:"Autocapture will work best if the document is placed on a dark colored, flat surface in an area with good lighting. If your document cannot be automatically captured using the Manual Upload option may be best",notificationCaptureSide:"The side of the document was captured",notificationCaptureWithWarnings:"Click on the Back button to go to the start page and submit the uploaded documents.",idvcVersionPlank:"Powered by",submitProcessSpinner:{top:"Document has been submitted for processing",bottom:"Please wait for the response"},card:{edit:"Edit",complete:"Complete"},modeSwitch:{video:"Camera Scan",uploader:"Manual Upload"},uploader:{dragHint:"Click or Drag and Drop <br> to Upload File",dividerHint:"or",fileHint:"Browse File",successUpload:"uploaded successfully",warningUpload:"incorrect result",mainHint:"Ensure that your ID fills the entire screen <br> with little to no background",complete:"Complete"},messageBox:{default:"Scan your Document",changeDocumentTypeText:"Change Document Type",documentTypeText:"Document Type",disableProcessing:"Camera permissions the configuration that is being used does not allow the user to complete the image capture/submission process"},desktopNotification:{barcode:"The barcode capturing process using your device may not work very well. Try using your mobile device instead.",mrz:"The MRZ capturing process using your device may not work very well. Try using your mobile device instead.",other:"The image capturing process using your device may not work very well. Try using your mobile device instead."},controlButtons:{upload:"Upload",reset:"Reset all steps",submit:"Submit",start:"Start",back:"Back",edit:"Change Photo",continue:"Continue",capture:"Capture",retake:"Retake"},documentType:"Your document type is",selectDocumentTypeText:"Select Document Type",changeBtn:"Change",correctBtn:"Correct",cancelBtn:"Cancel",doneBtn:"Done",closeBtn:"CLOSE",retakeBtn:"Retake",continueBtn:"CONTINUE",submitBtn:"SUBMIT",resetAllStepsBtn:"Reset all steps",btnUploader:"Switch to manual uploader",btnCamera:"Switch to camera mode",pressToUpdateText:"Press to update",pressToUpdateTextSuccess:"Press to update"},documentsTypes:{DL:"Driver's License",IC:"Identification Card",Passport:"Passport",PassportCard:"US Passport Card",GreenCard:"Green Card",EmploymentAuthorization:"Employment Authorization",InternationalId:"International ID",Barcode:"1-D and 2-D Barcodes",FaceAuthorization:"Face Authorization"},uploaderDescription:{textFront:"Click here to upload the front of your ID",textBack:"Click here to upload the back of your ID",textFace:"Click here to upload a photo of your face",textPdf:"Click here to upload the back of a ID",textMrz:"Click here to upload a photo of your document",textFrontBack:"Please make sure your ID fills up the entire <br> camera screen with little to no background.",textPass:"Please make sure your ID fills up the entire camera screen <br> with little to no background, and the full MRZ code is included.",textFacePosition:"Please position your face to take up <br> the full camera screen with little to no background."},loaderText:{warmup:{top:"Neural network is warming up",bottom:"Document capture will be ready to use shortly..."},awaiting:"Awaiting camera response",loadingStep:"Loading step",changeMode:"Mode is changing",resetting:"Resetting",uploading:"Uploading",preparingToWork:"Preparing to work",loadingDocument:"Loading document"}}},n=t.en,r=function(e){if(e){var a=e.toLowerCase(),o=Object.keys(t).includes(a)?a:"en";n=t[o]}else n=t.en},i=function(e){return e?n[e]:n},d=a.i0,c=a._2,s=a.J3;export{d as getTranslation,c as setTranslation,s as supportedLanguages};
1
+ var e={5950:(e,a,o)=>{o.d(a,{L5:()=>t});var t=function(e){return!(!e||"object"!=typeof e||Array.isArray(e))}}},a={};function o(t){var r=a[t];if(void 0!==r)return r.exports;var n=a[t]={exports:{}};return e[t](n,n.exports,o),n.exports}o.d=(e,a)=>{for(var t in a)o.o(a,t)&&!o.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:a[t]})},o.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a);var t={};(()=>{o.d(t,{J3:()=>a,_2:()=>d,i0:()=>c,p8:()=>r});var e=o(5950),a=["en","es"],r={es:{errorCodes:{mrzNotFound:"Advertencia: No se ha encontrado MRZ.",mrzNotRecognized:"Advertencia: No se han podido leer los datos MRZ. Intente tomar otra imagen.",barcodeNotFound:"Warning: Código de barras no encontrado.",barcodeNotRecognized:"Advertencia: No se pudieron leer los datos del código de barras.<br/>Intente tomar una imagen de mayor calidad.",heic:"El archivo HEIC está dañado",fileTypeHeic:"Error de tipo de archivo: Sólo se admiten imágenes jpeg, png y heic.",fileType:"Error de Tipo de Archivo. Tipos admitidos: bmp, gif, jpg, png, tiff, webp.",disableStepFileUpload:"Se debe utilizar un dispositivo con una cámara para capturar esta imagen",notAllowedDocument:"Documento no reconocido como tipo de documento requerido",documentSideLowPerimeter:"Advertencia: El documento de la foto es demasiado pequeño, acércalo más",faceOnFrontNotDetected:"Advertencia: No se encuentra ninguna cara en el anverso del documento",frontSideNotDetected:"Advertencia: La imagen no se reconoce como el anverso del tipo de documento elegido",backSideNotDetected:"Advertencia: La imagen no se reconoce como el reverso del tipo de documento elegido",faceNotFound:"Advertencia: No se ha encontrado la cara de una persona en la imagen capturada",disabledManualUpload:{header:"La carga manual está deshabilitada",text:"La captura de documentos mediante carga manual está deshabilitada en la configuración"},default:{header:"Por favor, inténtelo de nuevo",text:"Lo sentimos, <br/>pero hubo un problema al capturar y enviar las imágenes de su documento. Por favor, inténtelo de nuevo."},CameraNotFound:{header:"No se ha encontrado",text:"No se encontró ninguna cámara en su dispositivo"},CameraNotFoundInVerification:{header:"No se ha encontrado",text:"No se ha encontrado ninguna cámara en su dispositivo.<br/> Por favor, utilice un dispositivo diferente o permitir el acceso a la cámara para la verificación"},CameraNotAllowed:{header:"No autorizado",text:"Concede permiso para que el navegador acceda a la cámara del dispositivo <br/>o elige la opción Carga manual."},CameraNotAvailable:{header:"No disponible",text:"La cámara no está disponible en este momento"},CameraInUse:{header:"En uso",text:"La cámara ya está en uso"},MediaDevicesNotSupported:{header:"No se admite",text:"Tu navegador no es compatible"},UnsuitableCamera:{header:"Una cámara inadecuada",text:"La cámara de tu dispositivo no es adecuada para nuestra aplicación (doble cámara, cámara gran angular, etc.)"},lowImageResolution:"La resolución de la imagen cargada es demasiado baja",imageIsBlurred:"La imagen es demasiado borrosa para ser utilizada",faceLowArea:"El área de la cara en la foto ocupa muy poco espacio"},hintTexts:{front:"Coloque el anverso del documento",frontMRZ:"Haga zoom para capturar el código en la parte inferior",mrz:"Haga zoom para capturar el código en la parte posterior",capturing:"Coloque el anverso del documento",pdf:"Coloque el código de barras dentro del marco",switchToUploader:"No se puede leer el código de barras. <br/>Cambie al modo de carga manual de fotos para la validación.",back:"Da la vuelta a tu documento",barcode:"Coloque el código de barras dentro del marco",hold:{front:"Coloque la cara frontal del documento dentro del cuadro delimitador",pdf:"Coloque la cara del documento con un código de barras PDF417 dentro del cuadro delimitador",mrz:"Coloque el lado con MRZ de su documento dentro del cuadro delimitador",back:"Coloque el reverso del documento dentro del cuadro delimitador",barcode:"Posicionar el código de barras dentro del cuadro delimitador"},capture:{pdf:"Alinee el código de barras de su documento con el código de barras de la pantalla.",mrz:"Alinee la MRZ de su documento con la MRZ de la pantalla.",back:"Captura el reverso del documento"},dontSee:"No te veo",dontMove:"No te muevas",turnFaceLeft:"Gira la cara a la izquierda",turnFaceRight:"Gira la cara a la derecha",turnFaceUp:"Levanta tu cara",turnFaceDown:"Bajar la cara",faceCam:"Enfréntate a la cámara",camAway:"Mover la cámara más lejos",moveCenter:"Mover al centro",comeCloser:"Acércate",documentCloser:"Acerque el documento",holdCamera:"Manténgase firme, analizando el documento",captureCorners:"Asegúrese de que todas las esquinas del documento están dentro del marco",frontSideNotMatch:"El anverso del documento no coincide con el documento seleccionado"},keyErrors:["La clave de licencia ha caducado","La Clave de Licencia no es Válida","La URL Configurada De La Clave De Licencia No Coincide"],general:{step:"Paso",scan:"Escanear",front:"Frontal",mrz:"MRZ",mrzFront:"MRZ",pdf:"PDF",face:"Selfie",barcode:"Código de barras",back:"Atrás",awaiting:"A la espera de",notificationStepSuccess:"Añadido con éxito",notificationStepWarning:"No se reconoce la imagen",notificationDocumentTypeChangedInfo:"Se ha modificado el tipo de documento",notificationStepsResetInfo:"Se han restablecido todos los pasos",notificationStepMinSize:"La resolución es demasiado baja",notificationSubmit:"Enviado",notificationCaptureHook:"La captura automática funcionará mejor si el documento se coloca sobre una superficie plana de color oscuro en una zona con buena iluminación. Si el documento no se puede capturar automáticamente, lo mejor es utilizar la opción de carga manual.",notificationCaptureSide:"El lado del documento fue capturado",notificationCaptureWithWarnings:"Pulse el botón Atrás para ir a la página de inicio y presentar los documentos cargados.",idvcVersionPlank:"Desarrollado por",submitProcessSpinner:{top:"El documento se ha presentado para su tramitación",bottom:"Espere la respuesta"},card:{edit:"Editar",complete:"Completo"},modeSwitch:{video:"Escaneado de cámara",uploader:"Carga manual"},uploader:{dragHint:"Haga clic o arrastre y suelte <br> para cargar el archivo",dividerHint:"o",fileHint:"Buscar archivo",successUpload:"subido exitosamente",warningUpload:"resultado incorrecto",mainHint:"Asegúrese de que su identificación llena toda la pantalla <br> con poco o ningún fondo.",complete:"Completo"},messageBox:{default:"Escanee su documento",changeDocumentTypeText:"Cambiar el tipo de documento",documentTypeText:"Tipo de documento",disableProcessing:"Permisos de la cámara la configuración que se está utilizando no permite al usuario completar el proceso de captura/envío de imágenes"},controlButtons:{upload:"Cargar",reset:"Restablecer todos los pasos",submit:"Enviar",start:"Inicio",back:"Volver",edit:"Cambiar foto",continue:"Continuar",capture:"Captura",retake:"Retomar"},desktopNotification:{barcode:"Es posible que el proceso de captura del código de barras con su dispositivo no funcione muy bien. Pruebe a utilizar su dispositivo móvil.",mrz:"Es posible que el proceso de captura de MRZ mediante su dispositivo no funcione muy bien. Pruebe a utilizar su dispositivo móvil.",other:"Es posible que el proceso de captura de imágenes con tu dispositivo no funcione muy bien. Pruebe a utilizar su dispositivo móvil."},documentType:"Su Tipo de Documento es",selectDocumentTypeText:"Cambiar el tipo de documento",changeBtn:"Cambiar",correctBtn:"Corregir",cancelBtn:"Cancelar",doneBtn:"Hecho",closeBtn:"Cerrar",retakeBtn:"VOLVER",continueBtn:"CONTINUAR",submitBtn:"ENVIAR",resetAllStepsBtn:"Restablecer todos los pasos",btnUploader:"Cambiar a cargador manual",btnCamera:"Cambiar al modo de cámara",pressToUpdateText:"Pulse para actualizar",pressToUpdateTextSuccess:"Pulse para actualizar"},uploaderDescription:{textFront:"Haga clic aquí para cargar el frente de su identificación",textBack:"Haga clic aquí para cargar el reverso de una identificación",textFace:"Haga clic aquí para cargar una foto de su rostro",textPdf:"Haga clic aquí para cargar el reverso de una identificación",textMrz:"Haga clic aquí para cargar una foto de su documento'",textFrontBack:"Asegúrese de que su identificación llene toda la pantalla <br> de la cámara con poco o ningún fondo.",textPass:"Asegúrese de que su identificación llene toda la pantalla de la cámara <br> con poco o ningún fondo, y que se incluya el código MRZ completo",textFacePosition:"Coloque su rostro para ocupar toda la pantalla <br> de la cámara con poco o ningún fondo."},documentsTypes:{DL:"Permiso de conducir",IC:"Tarjeta de identificación",Passport:"Pasaporte",PassportCard:"Tarjeta de Pasaporte",GreenCard:"Tarjeta Verde",EmploymentAuthorization:"Autorización de Empleo",InternationalId:"Identificación Internacional",Barcode:"Códigos de barras 1-D y 2-D",FaceAuthorization:"Autorización facial"},loaderText:{warmup:{top:"La red neuronal se está calentando",bottom:"La captura de documentos estará lista para su uso en breve..."},awaiting:"A la espera de la respuesta de la cámara",loadingStep:"Paso de carga",changeMode:"El modo está cambiando",resetting:"Restablecer",uploading:"Cargar",preparingToWork:"Prepararse para trabajar",loadingDocument:"Carga del documento"}},en:{errorCodes:{mrzNotFound:"Warning: MRZ was not found.",mrzNotRecognized:"Warning: MRZ data could not be read. Try taking another image.",barcodeNotFound:"Warning: Barcode not found.",barcodeNotRecognized:"Warning: Barcode data could not be read.<br/>Try taking a higher quality image.",heic:"HEIC file incorrupted",fileType:"File Type Error. Supported types: bmp, gif, jpg, png, tif, webp.",fileTypeHeic:"File Type Error: Only jpeg, png and heic images are supported.",disableStepFileUpload:"A device with a camera must be used to capture this image",notAllowedDocument:"Document not recognized as required document type",documentSideLowPerimeter:"Warning: The document in the photo is too small, bring it closer",frontSideNotDetected:"Warning: The image isn't recognized as the front side of the chosen document type",backSideNotDetected:"Warning: The document's side isn't recognized as the back side of the chosen document type",faceNotFound:"Warning: A person's face was not found in captured image",faceOnFrontNotDetected:"Warning: No face is found on the front of the document",disabledManualUpload:{header:"Manual upload is disabled",text:"Document capture via manual upload is disabled in the configuration"},default:{header:"Please try again",text:"We're sorry, but there was an issue capturing and submitting the images of your document. Please try again"},CameraNotFound:{header:"Not found",text:"No camera was found on your device"},CameraNotFoundInVerification:{header:"Not found",text:"No camera was found on your device. <br/>Please use a different device or allow access to the camera for verification"},CameraNotAllowed:{header:"Not allowed",text:"Grant permission for the browser to access the device camera <br/> or choose the Manual Upload option"},CameraNotAvailable:{header:"Not available",text:"Camera is not available at the moment"},CameraInUse:{header:"In use",text:"Camera is already in use"},MediaDevicesNotSupported:{header:"Not supported",text:"Your browser is not supported"},UnsuitableCamera:{header:"An unsuitable camera",text:"The camera on your device is unsuitable for our application (dual camera, wide-angle camera, etc.)"},lowImageResolution:"The resolution of the uploaded image is too low",imageIsBlurred:"The image is too blurry to be used",faceLowArea:"Face area in the photo takes up too little space"},hintTexts:{front:"Position the front of the document",frontMRZ:"Zoom in to capture code at bottom",mrz:"Zoom in to capture code on back side",capturing:"Position the front of the document",pdf:"Position the barcode inside the frame",switchToUploader:"The barcode cannot be read. <br/>Please switch to manual photo upload mode",back:"Turn around your document",barcode:"Position the barcode inside the frame",hold:{front:"Position the front side of your document inside the bounding box",pdf:"Position the side of your document with a PDF417 barcode inside the bounding box",mrz:"Position the side with MRZ of your document inside the bounding box",back:"Position the back side of your document inside the bounding box",barcode:"Position the barcode inside the bounding box"},capture:{pdf:"Line up the barcode on your document with the barcode on the screen",mrz:"Line up the MRZ on your document with the MRZ on the screen",back:"Capture the back side of your document"},dontSee:"I don't see you",dontMove:"Don't move",turnFaceLeft:"Turn your face left",turnFaceRight:"Turn your face right",turnFaceUp:"Turn your face up",turnFaceDown:"Turn your face down",faceCam:"Face the camera",camAway:"Move camera further away",moveCenter:"Move to the center",comeCloser:"Come closer",documentCloser:"Bring the document closer",holdCamera:"Hold steady, analyzing document",captureCorners:"Make sure all corners of the document are inside the frame",frontSideNotMatch:"The front side of the document does not match the selected document"},keyErrors:["License Key has Expired","License Key is Not Valid","License Key's Configured URL Does Not Match"],general:{step:"Step",scan:"Scan",front:"Front",mrz:"MRZ",mrzFront:"MRZ",pdf:"PDF",face:"Selfie",barcode:"Barcode",back:"Back",awaiting:"Awaiting",notificationStepSuccess:"Successfully added",notificationStepWarning:"Image is not recognized",notificationDocumentTypeChangedInfo:"Document type has been changed",notificationStepsResetInfo:"All steps have been reset",notificationStepMinSize:"The resolution is too low",notificationSubmit:"Submitted",notificationCaptureHook:"Autocapture will work best if the document is placed on a dark colored, flat surface in an area with good lighting. If your document cannot be automatically captured using the Manual Upload option may be best",notificationCaptureSide:"The side of the document was captured",notificationCaptureWithWarnings:"Click on the Back button to go to the start page and submit the uploaded documents.",idvcVersionPlank:"Powered by",submitProcessSpinner:{top:"Document has been submitted for processing",bottom:"Please wait for the response"},card:{edit:"Edit",complete:"Complete"},modeSwitch:{video:"Camera Scan",uploader:"Manual Upload"},uploader:{dragHint:"Click or Drag and Drop <br> to Upload File",dividerHint:"or",fileHint:"Browse File",successUpload:"uploaded successfully",warningUpload:"incorrect result",mainHint:"Ensure that your ID fills the entire screen <br> with little to no background",complete:"Complete"},messageBox:{default:"Scan your Document",changeDocumentTypeText:"Change Document Type",documentTypeText:"Document Type",disableProcessing:"Camera permissions the configuration that is being used does not allow the user to complete the image capture/submission process"},desktopNotification:{barcode:"The barcode capturing process using your device may not work very well. Try using your mobile device instead.",mrz:"The MRZ capturing process using your device may not work very well. Try using your mobile device instead.",other:"The image capturing process using your device may not work very well. Try using your mobile device instead."},controlButtons:{upload:"Upload",reset:"Reset all steps",submit:"Submit",start:"Start",back:"Back",edit:"Change Photo",continue:"Continue",capture:"Capture",retake:"Retake"},documentType:"Your document type is",selectDocumentTypeText:"Select Document Type",changeBtn:"Change",correctBtn:"Correct",cancelBtn:"Cancel",doneBtn:"Done",closeBtn:"CLOSE",retakeBtn:"Retake",continueBtn:"CONTINUE",submitBtn:"SUBMIT",resetAllStepsBtn:"Reset all steps",btnUploader:"Switch to manual uploader",btnCamera:"Switch to camera mode",pressToUpdateText:"Press to update",pressToUpdateTextSuccess:"Press to update"},documentsTypes:{DL:"Driver's License",IC:"Identification Card",Passport:"Passport",PassportCard:"US Passport Card",GreenCard:"Green Card",EmploymentAuthorization:"Employment Authorization",InternationalId:"International ID",Barcode:"1-D and 2-D Barcodes",FaceAuthorization:"Face Authorization"},uploaderDescription:{textFront:"Click here to upload the front of your ID",textBack:"Click here to upload the back of your ID",textFace:"Click here to upload a photo of your face",textPdf:"Click here to upload the back of a ID",textMrz:"Click here to upload a photo of your document",textFrontBack:"Please make sure your ID fills up the entire <br> camera screen with little to no background.",textPass:"Please make sure your ID fills up the entire camera screen <br> with little to no background, and the full MRZ code is included.",textFacePosition:"Please position your face to take up <br> the full camera screen with little to no background."},loaderText:{warmup:{top:"Neural network is warming up",bottom:"Document capture will be ready to use shortly..."},awaiting:"Awaiting camera response",loadingStep:"Loading step",changeMode:"Mode is changing",resetting:"Resetting",uploading:"Uploading",preparingToWork:"Preparing to work",loadingDocument:"Loading document"}}};function n(a,o){if(!o)return a;var t=structuredClone(a);return Object.keys(o).forEach((function(r){var i=o[r],d=a[r];void 0!==i&&((0,e.L5)(d)&&(0,e.L5)(i)?t[r]=n(d,i):t[r]=i)})),t}var i=r.en,d=function(e,a){var o="en";if(e){var t=e.toLowerCase();o=Object.keys(r).includes(t)?t:"en"}i=n(r[o],a[o])},c=function(e){return e?i[e]:i}})();var r=t.i0,n=t.p8,i=t._2,d=t.J3;export{r as getTranslation,n as labels,i as setTranslation,d as supportedLanguages};
Binary file
@@ -1,9 +1,10 @@
1
1
  import { RealFaceMode } from './environment/realFaceModes';
2
2
  import { DocumentTypeName } from './environment/documentTypes';
3
3
  import { StepType } from './environment/stepsDescription';
4
- import { supportedLanguages } from './environment/langs';
4
+ import { AllLabels, supportedLanguages } from './environment/langs';
5
5
  import { ModalPositionKeys } from './environment/modalPosition';
6
- export type ValidationFn = 'validateElement' | 'validateString' | 'validateDocumentTypes' | 'validateDistinctStringInArray' | 'validateNumber' | 'validateFunction' | 'validateBool';
6
+ import { DeepPartial } from './types/helpers/DeepPartial';
7
+ export type ValidationFn = 'validateElement' | 'validateString' | 'validateDocumentTypes' | 'validateDistinctStringInArray' | 'validateNumber' | 'validateFunction' | 'ValidateDictionaryLangMatch' | 'validateBool';
7
8
  type DefaultValueFunction = () => boolean;
8
9
  export type NormalizedType = 'Path';
9
10
  /**
@@ -29,7 +30,7 @@ export type DocumentType = {
29
30
  mode?: StepMode;
30
31
  };
31
32
  type ImageURI = 'png' | 'jpeg' | 'webp';
32
- export type DefaultConfigName = 'el' | 'licenseKey' | 'networkUrl' | 'language' | 'documentTypes' | 'realFaceMode' | 'modalPosition' | 'resizeUploadedImage' | 'showSubmitBtn' | 'isShowDocumentTypeSelect' | 'useCDN' | 'processingImageFormat' | 'allowSubmitWithWarnings' | 'autocaptureConfidence' | 'autoContinue' | 'autoStart' | 'playPreviewAnimations' | 'autocaptureDelay' | 'fixFrontOrientAfterUpload' | 'onChange' | 'onReset' | 'submit' | 'onRetakeHook' | 'onCameraError' | 'onMounted' | 'onReloaded';
33
+ export type DefaultConfigName = 'el' | 'licenseKey' | 'networkUrl' | 'language' | 'customTranslations' | 'documentTypes' | 'realFaceMode' | 'modalPosition' | 'resizeUploadedImage' | 'showSubmitBtn' | 'isShowDocumentTypeSelect' | 'useCDN' | 'processingImageFormat' | 'allowSubmitWithWarnings' | 'autocaptureConfidence' | 'autoContinue' | 'autoStart' | 'playPreviewAnimations' | 'autocaptureDelay' | 'fixFrontOrientAfterUpload' | 'onChange' | 'onReset' | 'submit' | 'onRetakeHook' | 'onCameraError' | 'onMounted' | 'onReloaded';
33
34
  /**
34
35
  * IDefaultConfig
35
36
  * @param {string} name,
@@ -49,7 +50,7 @@ export interface IDefaultConfig {
49
50
  defaultValue: StepMode | string | boolean | DefaultValueFunction | number | DocumentType[];
50
51
  validationFn: ValidationFn;
51
52
  hidden?: boolean;
52
- values?: ModalPositionKeys[] | RealFaceMode[] | typeof supportedLanguages[number][] | ImageURI[];
53
+ values?: ModalPositionKeys[] | RealFaceMode[] | typeof supportedLanguages[number][] | ImageURI[] | DeepPartial<AllLabels>;
53
54
  arrayValues?: unknown[];
54
55
  multiple?: boolean;
55
56
  normalizedType?: NormalizedType;
@@ -2,6 +2,7 @@ import { CameraNotSupportedReason } from '../types/modules/camera.enum';
2
2
  type LabelGroup = 'errorCodes' | 'hintTexts' | 'keyErrors' | 'general' | 'uploaderDescription' | 'documentsTypes' | 'loaderText';
3
3
  type AllTypes = IErrorCodes | IHintTexts | KeyError | IGeneral | IDocumentsTypes | IUploaderDescription | ISpinnerText;
4
4
  type Label = Record<LabelGroup, AllTypes>;
5
+ export type AllLabels = Record<SupportedLanguage, Label>;
5
6
  type KeyError = string[];
6
7
  type GetTranslation = {
7
8
  (): Label;
@@ -167,6 +168,7 @@ interface ISpinnerText {
167
168
  loadingDocument: string;
168
169
  }
169
170
  export declare const supportedLanguages: readonly ["en", "es"];
170
- export declare const setTranslation: (translationLang?: SupportedLanguage) => void;
171
+ export declare const labels: AllLabels;
172
+ export declare const setTranslation: (translationLang?: SupportedLanguage, customLang?: Partial<AllLabels>) => void;
171
173
  export declare const getTranslation: GetTranslation;
172
174
  export {};
@@ -9,7 +9,7 @@ export declare const isValidBool: (val: any) => boolean;
9
9
  * @param val
10
10
  * @return {boolean}
11
11
  */
12
- export declare const isValidObject: (val: any) => boolean;
12
+ export declare const isValidObject: (val: unknown) => val is Record<string, unknown>;
13
13
  /**
14
14
  * check value to be function
15
15
  * @param val
@@ -34,11 +34,20 @@ export declare const isValidNumber: (val: any) => boolean;
34
34
  * @param {String} valueToSet - value that should be set
35
35
  */
36
36
  export declare const isValidDistinctStringInArray: (availableValues: string[], valueToSet: string) => boolean;
37
+ type ValidationResult = {
38
+ isValid: true;
39
+ invalidPathsWithReason: null;
40
+ } | {
41
+ isValid: false;
42
+ invalidPathsWithReason: Record<string, string>;
43
+ };
44
+ export declare const isValidDeepPartial: <T extends Record<string, unknown>>(original: T, candidate: unknown) => ValidationResult;
37
45
  declare const _default: {
38
46
  isValidBool: (val: any) => boolean;
39
47
  isValidFunction: (val: any) => boolean;
40
48
  isValidString: (val: any) => boolean;
41
49
  isValidNumber: (val: any) => boolean;
42
50
  isValidDistinctStringInArray: (availableValues: string[], valueToSet: string) => boolean;
51
+ isValidDeepPartial: <T extends Record<string, unknown>>(original: T, candidate: unknown) => ValidationResult;
43
52
  };
44
53
  export default _default;
@@ -1,11 +1,13 @@
1
1
  import { StepConfig, ValidationFn } from '../defaultConfig';
2
2
  import { RealFaceMode } from '../environment/realFaceModes';
3
- import { SupportedLanguage } from '../environment/langs';
3
+ import { AllLabels, SupportedLanguage } from '../environment/langs';
4
4
  import { StepType } from '../environment/stepsDescription';
5
5
  import { DocumentTypeName } from '../environment/documentTypes';
6
+ import { DeepPartial } from '../types/helpers/DeepPartial';
6
7
  import { IDocumentTypeConfig } from './validator';
7
8
  import { IStepCallback } from './Step';
8
9
  import { IDataForSubmit } from '../util';
10
+ import ValidateDocumentTypes from './validation/ValidateDocumentTypes';
9
11
  /**
10
12
  * @param {string} el,
11
13
  * @param {string} licenseKey,
@@ -72,6 +74,10 @@ export interface IConfig {
72
74
  networkUrl?: string;
73
75
  /** the web library supports two languages, english and spanish. English uses en and Spanish uses es */
74
76
  language?: SupportedLanguage;
77
+ /**
78
+ * Custom translations for UI strings (e.g., titles, buttons). Overrides the default library translations if provided.
79
+ */
80
+ customTranslations?: DeepPartial<AllLabels>;
75
81
  /**
76
82
  * if this setting is set to false the document type dialog will not be displayed to the end user
77
83
  */
@@ -139,7 +145,7 @@ declare class Config implements IConfig {
139
145
  realFaceMode: "all" | "auto" | "none";
140
146
  language: any;
141
147
  constructor(configObject: IConfig);
142
- getFunction(validationFn: ValidationFn): false | import("./validation/ValidateElement").default | import("./validation/ValidateBool").default | import("./validation/ValidateStringInArray").default | import("./validation/ValidateDocumentTypes").default | import("./validation/ValidateFunction").default | import("./validation/ValidateNumber").default | import("./validation/ValidateString").default;
148
+ getFunction(validationFn: ValidationFn): false | import("./validation/ValidateElement").default | import("./validation/ValidateBool").default | import("./validation/ValidateStringInArray").default | ValidateDocumentTypes | import("./validation/ValidateFunction").default | import("./validation/ValidateNumber").default | import("./validation/ValidateString").default | import("./validation/ValidateDictionaryLangMatch").default<Record<string, unknown>>;
143
149
  validate(configObject: IConfig): void;
144
150
  normalize(configObject: IConfig): void;
145
151
  }
@@ -0,0 +1,6 @@
1
+ import { IValidator } from '../validator';
2
+ import { DeepPartial } from '../../types/helpers/DeepPartial';
3
+ declare class ValidateDictionaryLangMatch<T extends Record<string, unknown>> implements IValidator<T> {
4
+ validate(val: unknown, fallback: T, configName: string): DeepPartial<T>;
5
+ }
6
+ export default ValidateDictionaryLangMatch;
@@ -2,17 +2,19 @@ import { DefaultConfigName, DocumentType } from '../../defaultConfig';
2
2
  import { DocumentTypeName } from '../../environment/documentTypes';
3
3
  import { StepType } from '../../environment/stepsDescription';
4
4
  import { IDocumentTypeConfig, IValidator } from '../validator';
5
+ export interface IValidateDocumentTypes {
6
+ types: any[];
7
+ steps: any[];
8
+ commonStepTypes: Set<StepType>;
9
+ documentTypes: IDocumentTypeConfig;
10
+ }
5
11
  declare class ValidateDocumentTypes implements IValidator<DocumentType[]> {
6
12
  types: any[];
7
13
  steps: any[];
8
14
  commonStepTypes: Set<StepType>;
9
15
  documentTypes: IDocumentTypeConfig;
10
- validate(val: DocumentType[], fallback: DocumentType[], configName: DefaultConfigName): {
11
- types: any[];
12
- steps: any[];
13
- commonStepTypes: Set<StepType>;
14
- documentTypes: IDocumentTypeConfig;
15
- };
16
+ static checkIsDocumentTypes(obj: unknown): obj is IValidateDocumentTypes;
17
+ validate(val: DocumentType[], fallback: DocumentType[], configName: DefaultConfigName): IValidateDocumentTypes;
16
18
  validateTypes(types: string[]): DocumentTypeName[];
17
19
  transformDocType({ type, steps }: DocumentType): void;
18
20
  setCommonStepTypes(): void;
@@ -1,2 +1,7 @@
1
- declare const showError: (configName: string, fallback: any) => void;
1
+ interface IShowErrorProps {
2
+ configName: string;
3
+ fallback: any;
4
+ invalidPathsWithReason?: Record<string, string>;
5
+ }
6
+ declare const showError: ({ configName, fallback, invalidPathsWithReason }: IShowErrorProps) => void;
2
7
  export default showError;
@@ -1,10 +1,11 @@
1
1
  import { ValidationFn } from '../../defaultConfig';
2
2
  import ValidateElement from './ValidateElement';
3
3
  import ValidateBool from './ValidateBool';
4
+ import ValidateDictionaryLangMatch from './ValidateDictionaryLangMatch';
4
5
  import ValidateDistinctStringInArray from './ValidateStringInArray';
5
6
  import ValidateDocumentTypes from './ValidateDocumentTypes';
6
7
  import ValidateFunction from './ValidateFunction';
7
8
  import ValidateNumber from './ValidateNumber';
8
9
  import ValidateString from './ValidateString';
9
- declare const validatorFactory: (name: ValidationFn) => false | ValidateElement | ValidateBool | ValidateDistinctStringInArray | ValidateDocumentTypes | ValidateFunction | ValidateNumber | ValidateString;
10
+ declare const validatorFactory: (name: ValidationFn) => false | ValidateElement | ValidateBool | ValidateDistinctStringInArray | ValidateDocumentTypes | ValidateFunction | ValidateNumber | ValidateString | ValidateDictionaryLangMatch<Record<string, unknown>>;
10
11
  export default validatorFactory;
@@ -5,10 +5,12 @@ import MetaData from '../modules/MetaData';
5
5
  import { WebLibManualUploader } from '../modules/App/WebLibManualUploader';
6
6
  import LoggerController from '../controllers/LoggerController';
7
7
  import Step from '../modules/Step';
8
+ import { AllLabels } from '../environment/langs';
8
9
  import { StepType } from '../environment/stepsDescription';
9
10
  import { Base64Image, Offset, Size } from '../helpers/image';
10
11
  import { RealFaceTurnSide } from './enums/realFace';
11
12
  import { StepConfig, StepMode } from '../defaultConfig';
13
+ import { DeepPartial } from './helpers/DeepPartial';
12
14
  import { IMRZResults } from './mrz';
13
15
  type LoopFunction = () => Promise<false>;
14
16
  export type Context = {
@@ -29,6 +31,7 @@ export type Context = {
29
31
  config: Record<string, any>;
30
32
  networkUrl: string;
31
33
  imageFormat: 'webp' | 'jpeg';
34
+ customTranslations?: DeepPartial<AllLabels>;
32
35
  supabase: ReturnType<typeof InitClient> | null;
33
36
  cameraInfo: Record<string, any>;
34
37
  idvcLinkParam: string;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Makes all properties of T optional, recursively.
3
+ */
4
+ export type DeepPartial<T> = {
5
+ [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
6
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@idscan/idvc2",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "description": "component for the capturing documents",
5
5
  "main": "dist/idvc.js",
6
6
  "types": "dist/types/idvc.d.ts",