@idscan/idvc2 2.0.1
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/LICENSE.txt +202 -0
- package/README.md +727 -0
- package/dist/LICENSE.txt +202 -0
- package/dist/README.md +727 -0
- package/dist/css/idvc.css +1 -0
- package/dist/index.html +96 -0
- package/dist/js/defaultConfig.ts +246 -0
- package/dist/js/environment/capturingModes.json +4 -0
- package/dist/js/environment/cssVariables.json +184 -0
- package/dist/js/environment/designations.ts +19 -0
- package/dist/js/environment/documentTypes.ts +145 -0
- package/dist/js/environment/langs.ts +270 -0
- package/dist/js/environment/loadModes.json +11 -0
- package/dist/js/environment/loopResult.ts +14 -0
- package/dist/js/environment/networkNames.json +27 -0
- package/dist/js/environment/realFaceModes.ts +15 -0
- package/dist/js/environment/stepsDescription.ts +85 -0
- package/dist/js/environment/triangulation.ts +188 -0
- package/dist/js/idvc.d.ts +2 -0
- package/dist/js/idvc.js +2 -0
- package/dist/js/idvc.js.LICENSE.txt +266 -0
- package/dist/js/mrz.d.ts +105 -0
- package/dist/networks/angles20210831.bin +0 -0
- package/dist/networks/angles20210831.json +1 -0
- package/dist/networks/blazeface20210831.bin +0 -0
- package/dist/networks/blazeface20210831.json +1 -0
- package/dist/networks/facemesh20210831.bin +0 -0
- package/dist/networks/facemesh20210831.json +1 -0
- package/dist/networks/mrz20210831.bin +0 -0
- package/dist/networks/mrz20210831.json +1 -0
- package/dist/networks/types20220505.bin +0 -0
- package/dist/networks/types20220505.json +1 -0
- package/dist/notes.txt +23 -0
- package/package.json +101 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
export type DocumentTypeIndex = 1 | 2 | 3 | 6 | 7 | 8 | 9;
|
|
2
|
+
export type DocumentTypeName = 'ID' | 'Passport' | 'PassportCard' | 'GreenCard' | 'InternationalId' | 'VIN' | 'Barcode';
|
|
3
|
+
export type HumanName = 'Driver\'s License or ID card' | 'Passport' | 'Passport Card' | 'Green Card or Employment Authorization' | 'International ID' | 'Vehicle Identification Number' | '1-D and 2-D Barcodes';
|
|
4
|
+
export type ImageSource = 'video' | 'file';
|
|
5
|
+
|
|
6
|
+
export interface DocumentRecord {
|
|
7
|
+
name: DocumentTypeName,
|
|
8
|
+
id: DocumentTypeIndex,
|
|
9
|
+
nName: string,
|
|
10
|
+
humanName: HumanName,
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface DocumentType {
|
|
14
|
+
readonly items: DocumentRecord[],
|
|
15
|
+
length: number,
|
|
16
|
+
ids(): DocumentTypeIndex[],
|
|
17
|
+
names(): DocumentTypeName[],
|
|
18
|
+
nameById(id: DocumentTypeIndex): DocumentTypeName | '',
|
|
19
|
+
humanNameById(id: DocumentTypeIndex | 0): HumanName | '',
|
|
20
|
+
humanNames(): HumanName[],
|
|
21
|
+
humanNameByName(name: DocumentTypeName): HumanName | '',
|
|
22
|
+
idByName(name: DocumentTypeName): DocumentTypeIndex | 0,
|
|
23
|
+
idsByNames(names: DocumentTypeName[]): (DocumentTypeIndex | 0)[],
|
|
24
|
+
recordById(id: DocumentTypeIndex | 0): DocumentRecord | null,
|
|
25
|
+
setHumanName(names): void,
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const documentType: DocumentType = {
|
|
29
|
+
items: [
|
|
30
|
+
{
|
|
31
|
+
name: 'ID',
|
|
32
|
+
id: 1,
|
|
33
|
+
nName: '',
|
|
34
|
+
humanName: 'Driver\'s License or ID card',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: 'Passport',
|
|
38
|
+
id: 2,
|
|
39
|
+
nName: 'passp',
|
|
40
|
+
humanName: 'Passport',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'PassportCard',
|
|
44
|
+
id: 3,
|
|
45
|
+
nName: 'passpcard',
|
|
46
|
+
humanName: 'Passport Card',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: 'GreenCard',
|
|
50
|
+
id: 6,
|
|
51
|
+
nName: 'gc',
|
|
52
|
+
humanName: 'Green Card or Employment Authorization',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: 'InternationalId',
|
|
56
|
+
id: 7,
|
|
57
|
+
nName: 'iid',
|
|
58
|
+
humanName: 'International ID',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'VIN',
|
|
62
|
+
id: 8,
|
|
63
|
+
nName: 'vin',
|
|
64
|
+
humanName: 'Vehicle Identification Number',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: 'Barcode',
|
|
68
|
+
id: 9,
|
|
69
|
+
nName: 'barcode',
|
|
70
|
+
humanName: '1-D and 2-D Barcodes',
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
get length() {
|
|
74
|
+
return this.items.length;
|
|
75
|
+
},
|
|
76
|
+
ids() {
|
|
77
|
+
return this.items.map((item) => item.id);
|
|
78
|
+
},
|
|
79
|
+
names() {
|
|
80
|
+
return this.items.map((item) => item.name);
|
|
81
|
+
},
|
|
82
|
+
nameById(id) {
|
|
83
|
+
const res = this.items.filter((item) => item.id === id);
|
|
84
|
+
return res.length ? res[0].name : '';
|
|
85
|
+
},
|
|
86
|
+
humanNameById(id) {
|
|
87
|
+
const res = this.items.filter((item) => item.id === id);
|
|
88
|
+
return res.length ? res[0].humanName : '';
|
|
89
|
+
},
|
|
90
|
+
humanNames() {
|
|
91
|
+
const names: HumanName[] = [];
|
|
92
|
+
this.items.forEach((item) => {
|
|
93
|
+
names[item.id] = item.humanName;
|
|
94
|
+
});
|
|
95
|
+
return names;
|
|
96
|
+
},
|
|
97
|
+
humanNameByName(name) {
|
|
98
|
+
const lowerName = name.toLowerCase();
|
|
99
|
+
const record = this.items.find((item) => item.name.toLowerCase() === lowerName);
|
|
100
|
+
if (record) {
|
|
101
|
+
return record.humanName;
|
|
102
|
+
}
|
|
103
|
+
return '';
|
|
104
|
+
},
|
|
105
|
+
setHumanName(names) {
|
|
106
|
+
Object.keys(names).forEach((key) => {
|
|
107
|
+
const record = this.items.find((item) => item.name === key);
|
|
108
|
+
record.humanName = names[key];
|
|
109
|
+
});
|
|
110
|
+
},
|
|
111
|
+
/**
|
|
112
|
+
* return object's id by its name
|
|
113
|
+
* @param {string} name
|
|
114
|
+
* @returns {Number} id of element by its name or 0 if name not found
|
|
115
|
+
*/
|
|
116
|
+
idByName(name) {
|
|
117
|
+
const lowerName = name.toLowerCase();
|
|
118
|
+
if (this.items && this.items.length > 0) {
|
|
119
|
+
const item = this.items.find((record) => record?.name.toLowerCase() === lowerName);
|
|
120
|
+
return item?.id || 0;
|
|
121
|
+
}
|
|
122
|
+
return 0;
|
|
123
|
+
},
|
|
124
|
+
/**
|
|
125
|
+
* return ids by names
|
|
126
|
+
* @param {[string]} names
|
|
127
|
+
* @return {[Number]}
|
|
128
|
+
*/
|
|
129
|
+
idsByNames(names) {
|
|
130
|
+
return names.map(this.idByName.bind(this));
|
|
131
|
+
},
|
|
132
|
+
/**
|
|
133
|
+
* return type item { name: String, id: Number, nName: String, humanName: String }
|
|
134
|
+
* @param {number} id
|
|
135
|
+
*/
|
|
136
|
+
recordById(id) {
|
|
137
|
+
if (id === 0) return null;
|
|
138
|
+
for (let i = 0; i <= this.length; i += 1) {
|
|
139
|
+
if (this.items[i].id === id) return this.items[i];
|
|
140
|
+
}
|
|
141
|
+
return null;
|
|
142
|
+
},
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
export default documentType;
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
type LabelGroup = 'errorCodes' | 'hintTexts' | 'keyErrors' | 'typeError'
|
|
2
|
+
| 'camera' | 'general' | 'uploaderDescription' | 'documentsTypes';
|
|
3
|
+
|
|
4
|
+
type AllTypes = IErrorCodes | IHintTexts | KeyError | ITypeError
|
|
5
|
+
| ICameraLabels | IGeneral | IDocumentsTypes | IUploaderDescription;
|
|
6
|
+
|
|
7
|
+
type Label = Record<LabelGroup, AllTypes>;
|
|
8
|
+
type AllLabels = Record<SupportedLanguage, Label>;
|
|
9
|
+
type KeyError = string[];
|
|
10
|
+
type GetTranslation = {
|
|
11
|
+
(): Label,
|
|
12
|
+
(groupName: 'errorCodes'): IErrorCodes,
|
|
13
|
+
(groupName: 'hintTexts'): IHintTexts,
|
|
14
|
+
(groupName: 'keyErrors'): KeyError,
|
|
15
|
+
(groupName: 'typeError'): ITypeError,
|
|
16
|
+
(groupName: 'camera'): ICameraLabels,
|
|
17
|
+
(groupName: 'general'): IGeneral,
|
|
18
|
+
(groupName: LabelGroup): AllTypes,
|
|
19
|
+
};
|
|
20
|
+
export type ErrorCodeNames = keyof IErrorCodes;
|
|
21
|
+
export type SupportedLanguage = typeof supportedLanguages[number];
|
|
22
|
+
|
|
23
|
+
interface IErrorCodes {
|
|
24
|
+
mrz: string,
|
|
25
|
+
barcode: string,
|
|
26
|
+
heic: string,
|
|
27
|
+
fileType: string,
|
|
28
|
+
disableStepFileUpload: string,
|
|
29
|
+
notAllowedDocument: string,
|
|
30
|
+
frontSide: string,
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
interface IHintTexts {
|
|
34
|
+
front: string,
|
|
35
|
+
frontMRZ: string,
|
|
36
|
+
mrz: string,
|
|
37
|
+
capturing: string,
|
|
38
|
+
pdf: string,
|
|
39
|
+
back: string,
|
|
40
|
+
barcode: string,
|
|
41
|
+
hold: string,
|
|
42
|
+
dontSee: string,
|
|
43
|
+
dontMove: string,
|
|
44
|
+
turnFace: string,
|
|
45
|
+
turnFaceLR: string,
|
|
46
|
+
faceCam: string,
|
|
47
|
+
camAway: string,
|
|
48
|
+
moveCenter: string,
|
|
49
|
+
comeCloser: string,
|
|
50
|
+
holdCamera: string,
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface ITypeError {
|
|
54
|
+
typeSelectHeader: string,
|
|
55
|
+
typeErrorHeader: string,
|
|
56
|
+
typeErrorBody: string,
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
interface ICameraLabels {
|
|
60
|
+
loading: string,
|
|
61
|
+
awaiting: string,
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
interface IGeneral {
|
|
65
|
+
documentType: string,
|
|
66
|
+
selectDocumentTypeText: string,
|
|
67
|
+
changeBtn: string,
|
|
68
|
+
correctBtn: string,
|
|
69
|
+
cancelBtn: string,
|
|
70
|
+
doneBtn: string,
|
|
71
|
+
closeBtn: string,
|
|
72
|
+
retakeBtn: string,
|
|
73
|
+
continueBtn: string,
|
|
74
|
+
submitBtn: string,
|
|
75
|
+
resetAllStepsBtn: string,
|
|
76
|
+
btnUploader: string,
|
|
77
|
+
btnCamera: string,
|
|
78
|
+
pressToUpdateText: string,
|
|
79
|
+
pressToUpdateTextSuccess: string
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
interface IDocumentsTypes {
|
|
83
|
+
ID: string,
|
|
84
|
+
Passport: string,
|
|
85
|
+
PassportCard: string,
|
|
86
|
+
GreenCard: string,
|
|
87
|
+
InternationalId: string
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
interface IUploaderDescription {
|
|
91
|
+
textFront: string,
|
|
92
|
+
textBack: string,
|
|
93
|
+
textFace: string,
|
|
94
|
+
textPdf: string,
|
|
95
|
+
textMrz: string,
|
|
96
|
+
textFrontBack: string,
|
|
97
|
+
textPass: string,
|
|
98
|
+
textFacePosition: string,
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export type CameraLabels = keyof ICameraLabels;
|
|
102
|
+
|
|
103
|
+
export const supportedLanguages = ['en', 'es'] as const;
|
|
104
|
+
|
|
105
|
+
const labels: AllLabels = {
|
|
106
|
+
es: {
|
|
107
|
+
errorCodes: {
|
|
108
|
+
mrz: 'MRZ no fue reconocido',
|
|
109
|
+
barcode: 'Advertencia: <br/>No se pudieron leer los datos del código de barras.<br/>Intenta tomar una imagen de mayor calidad.',
|
|
110
|
+
heic: 'El archivo HEIC está dañado',
|
|
111
|
+
fileType: 'Error de tipo de archivo. Solo se admiten los tipos de archivo JPEG, PNG y HEIC.',
|
|
112
|
+
disableStepFileUpload: 'Se debe utilizar un dispositivo con una cámara para capturar esta imagen',
|
|
113
|
+
notAllowedDocument: 'Este tipo de documento no está permitido',
|
|
114
|
+
frontSide: 'Advertencia: <br/>No se pudo leer la parte frontal del documento. <br/>Intenta tomar una imagen de mayor calidad',
|
|
115
|
+
},
|
|
116
|
+
hintTexts: {
|
|
117
|
+
front: 'Coloque el anverso del documento',
|
|
118
|
+
frontMRZ: 'Haga zoom para capturar el código en la parte inferior',
|
|
119
|
+
mrz: 'Haga zoom para capturar el código en la parte posterior',
|
|
120
|
+
capturing: 'Coloque el anverso del documento',
|
|
121
|
+
pdf: 'Coloque el código de barras dentro del marco',
|
|
122
|
+
back: 'Da la vuelta a tu documento',
|
|
123
|
+
barcode: 'Coloque el código de barras dentro del marco',
|
|
124
|
+
hold: 'Sostener el **placeholder** lado del documento <br> dentro de la caja',
|
|
125
|
+
dontSee: 'No te veo',
|
|
126
|
+
dontMove: 'No te muevas',
|
|
127
|
+
turnFace: 'Gira la cara <br> a la izquierda o a la derecha (**data**)',
|
|
128
|
+
turnFaceLR: 'Gira la cara <br> a la izquierda o a la derecha',
|
|
129
|
+
faceCam: 'Enfréntate a la cámara',
|
|
130
|
+
camAway: 'Mover la cámara más lejos',
|
|
131
|
+
moveCenter: 'Mover al centro',
|
|
132
|
+
comeCloser: 'Acércate',
|
|
133
|
+
holdCamera: 'Manténgase firme, analizando el documento <br>',
|
|
134
|
+
},
|
|
135
|
+
keyErrors: ['La clave de licencia ha caducado', 'Clave de licencia no válida'],
|
|
136
|
+
typeError: {
|
|
137
|
+
typeSelectHeader: 'Tipo no definido. <br> Seleccione manualmente',
|
|
138
|
+
typeErrorHeader: 'Este tipo de documento no está permitido',
|
|
139
|
+
typeErrorBody: 'Solo se permiten los siguientes tipos de documentos:',
|
|
140
|
+
},
|
|
141
|
+
camera: {
|
|
142
|
+
loading: 'Carga',
|
|
143
|
+
awaiting: 'A la espera de la respuesta de la cámara',
|
|
144
|
+
},
|
|
145
|
+
general: {
|
|
146
|
+
documentType: 'Su Tipo de Documento es',
|
|
147
|
+
selectDocumentTypeText: 'Seleccionar Tipo de Documento',
|
|
148
|
+
changeBtn: 'Cambiar',
|
|
149
|
+
correctBtn: 'Corregir',
|
|
150
|
+
cancelBtn: 'Cancelar',
|
|
151
|
+
doneBtn: 'Hecho',
|
|
152
|
+
closeBtn: 'Cerrar',
|
|
153
|
+
retakeBtn: 'VOLVER',
|
|
154
|
+
continueBtn: 'CONTINUAR',
|
|
155
|
+
submitBtn: 'ENVIAR',
|
|
156
|
+
resetAllStepsBtn: 'Restablecer todos los pasos',
|
|
157
|
+
btnUploader: 'Cambiar a cargador manual',
|
|
158
|
+
btnCamera: 'Cambiar al modo de cámara',
|
|
159
|
+
pressToUpdateText: 'Pulse para actualizar',
|
|
160
|
+
pressToUpdateTextSuccess: 'Pulse para actualizar',
|
|
161
|
+
},
|
|
162
|
+
uploaderDescription: {
|
|
163
|
+
textFront: 'Haga clic aquí para cargar el frente de su identificación',
|
|
164
|
+
textBack: 'Haga clic aquí para cargar el reverso de una identificación',
|
|
165
|
+
textFace: 'Haga clic aquí para cargar una foto de su rostro',
|
|
166
|
+
textPdf: 'Haga clic aquí para cargar el reverso de una identificación',
|
|
167
|
+
textMrz: 'Haga clic aquí para cargar una foto de su documento\'',
|
|
168
|
+
textFrontBack: 'Asegúrese de que su identificación llene toda la pantalla de la cámara con poco o ningún fondo.',
|
|
169
|
+
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',
|
|
170
|
+
textFacePosition: 'Coloque su rostro para ocupar toda la pantalla de la cámara con poco o ningún fondo.',
|
|
171
|
+
},
|
|
172
|
+
documentsTypes: {
|
|
173
|
+
ID: 'Licencia de Conducir',
|
|
174
|
+
Passport: 'Pasaporte',
|
|
175
|
+
PassportCard: 'Tarjeta de Pasaporte',
|
|
176
|
+
GreenCard: 'Tarjeta Verde o Autorización de Empleo',
|
|
177
|
+
InternationalId: 'Identificación Internacional',
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
en: {
|
|
181
|
+
errorCodes: {
|
|
182
|
+
mrz: 'MRZ not recognized',
|
|
183
|
+
barcode: 'Warning: <br/>Barcode data could not be read.<br/>Try taking a higher quality image.',
|
|
184
|
+
heic: 'HEIC file incorrupted',
|
|
185
|
+
fileType: 'Error file type. Only jpeg, png and heic supported.',
|
|
186
|
+
disableStepFileUpload: 'A device with a camera must be used to capture this image',
|
|
187
|
+
notAllowedDocument: 'This document type is not allowed',
|
|
188
|
+
frontSide: 'Warning: <br/>Front of the document could not be read. <br/>Try taking a higher quality image',
|
|
189
|
+
},
|
|
190
|
+
hintTexts: {
|
|
191
|
+
front: 'Position the front of the document',
|
|
192
|
+
frontMRZ: 'Zoom in to capture code at bottom',
|
|
193
|
+
mrz: 'Zoom in to capture code on back side',
|
|
194
|
+
capturing: 'Position the front of the document',
|
|
195
|
+
pdf: 'Position the barcode inside the frame',
|
|
196
|
+
back: 'Turn around your document',
|
|
197
|
+
barcode: 'Position the barcode inside the frame',
|
|
198
|
+
hold: 'Hold the **placeholder** side of the document <br> inside the box',
|
|
199
|
+
dontSee: 'I don\'t see you',
|
|
200
|
+
dontMove: 'Don\'t move',
|
|
201
|
+
turnFace: 'Turn your face <br> left or right (**data**)',
|
|
202
|
+
turnFaceLR: 'Turn your face <br> left or right',
|
|
203
|
+
faceCam: 'Face the camera',
|
|
204
|
+
camAway: 'Move camera further away',
|
|
205
|
+
moveCenter: 'Move to the center',
|
|
206
|
+
comeCloser: 'Come closer',
|
|
207
|
+
holdCamera: 'Hold steady, analyzing document <br>',
|
|
208
|
+
},
|
|
209
|
+
keyErrors: ['License Key has expired', 'Invalid license key'],
|
|
210
|
+
typeError: {
|
|
211
|
+
typeSelectHeader: 'Type not defined. <br> Please select manually',
|
|
212
|
+
typeErrorHeader: 'This document type is not allowed',
|
|
213
|
+
typeErrorBody: 'Only the following document types are allowed:',
|
|
214
|
+
},
|
|
215
|
+
camera: {
|
|
216
|
+
loading: 'Loading',
|
|
217
|
+
awaiting: 'Awaiting camera response',
|
|
218
|
+
},
|
|
219
|
+
general: {
|
|
220
|
+
documentType: 'Your document type is',
|
|
221
|
+
selectDocumentTypeText: 'Select Document Type',
|
|
222
|
+
changeBtn: 'Change',
|
|
223
|
+
correctBtn: 'Correct',
|
|
224
|
+
cancelBtn: 'Cancel',
|
|
225
|
+
doneBtn: 'Done',
|
|
226
|
+
closeBtn: 'CLOSE',
|
|
227
|
+
retakeBtn: 'Retake',
|
|
228
|
+
continueBtn: 'CONTINUE',
|
|
229
|
+
submitBtn: 'SUBMIT',
|
|
230
|
+
resetAllStepsBtn: 'Reset all steps',
|
|
231
|
+
btnUploader: 'Switch to manual uploader',
|
|
232
|
+
btnCamera: 'Switch to camera mode',
|
|
233
|
+
pressToUpdateText: 'Press to update',
|
|
234
|
+
pressToUpdateTextSuccess: 'Press to update',
|
|
235
|
+
},
|
|
236
|
+
documentsTypes: {
|
|
237
|
+
ID: "Driver\'s License",
|
|
238
|
+
Passport: 'Passport',
|
|
239
|
+
PassportCard: 'Passport Card',
|
|
240
|
+
GreenCard: 'Green Card or Employment Authorization',
|
|
241
|
+
InternationalId: 'International ID',
|
|
242
|
+
},
|
|
243
|
+
uploaderDescription: {
|
|
244
|
+
textFront: 'Click here to upload the front of your ID',
|
|
245
|
+
textBack: 'Click here to upload the back of your ID',
|
|
246
|
+
textFace: 'Click here to upload a photo of your face',
|
|
247
|
+
textPdf: 'Click here to upload the back of a ID',
|
|
248
|
+
textMrz: 'Click here to upload a photo of your document',
|
|
249
|
+
textFrontBack: 'Please make sure your ID fills up the entire <br> camera screen with little to no background.',
|
|
250
|
+
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.',
|
|
251
|
+
textFacePosition: 'Please position your face to take up <br> the full camera screen with little to no background.',
|
|
252
|
+
},
|
|
253
|
+
},
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
let translation:Label = labels.en;
|
|
257
|
+
|
|
258
|
+
export const setTranslation = (translationLang?: SupportedLanguage): void => {
|
|
259
|
+
if (translationLang) {
|
|
260
|
+
const lang = translationLang.toLowerCase();
|
|
261
|
+
const trnaslation = Object.keys(labels).includes(lang) ? lang as SupportedLanguage : 'en';
|
|
262
|
+
translation = labels[trnaslation];
|
|
263
|
+
} else {
|
|
264
|
+
translation = labels.en;
|
|
265
|
+
}
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
export const getTranslation: GetTranslation = (groupName?) => (groupName
|
|
269
|
+
? translation[groupName]
|
|
270
|
+
: translation);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cdn": {
|
|
3
|
+
"description": "Take loaders from cdn. No additional webpack config."
|
|
4
|
+
},
|
|
5
|
+
"asyncLocal": {
|
|
6
|
+
"description": "Take local loaders. Required additional webpack config."
|
|
7
|
+
},
|
|
8
|
+
"syncLocal": {
|
|
9
|
+
"description": "Loads all required modules synchronous. No additional webpack config."
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface ILoopResult {
|
|
2
|
+
status: boolean,
|
|
3
|
+
cancel: boolean,
|
|
4
|
+
touch: boolean,
|
|
5
|
+
image: ImageData | null,
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const defaultLoopResult: ILoopResult = {
|
|
9
|
+
status: false,
|
|
10
|
+
cancel: false,
|
|
11
|
+
touch: false,
|
|
12
|
+
image: null,
|
|
13
|
+
};
|
|
14
|
+
export default defaultLoopResult;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"neurons": {
|
|
3
|
+
"angles": "angles20210831.json",
|
|
4
|
+
"blazeface": "blazeface20210831.json",
|
|
5
|
+
"facemesh": "facemesh20210831.json",
|
|
6
|
+
"mrz": "mrz20210831.json",
|
|
7
|
+
"types": "types20220505.json"
|
|
8
|
+
},
|
|
9
|
+
"modules": {
|
|
10
|
+
"IMGPROCModule": "IMGPROCModule20220324.js",
|
|
11
|
+
"MRZModule": "MRZModule20220324.js",
|
|
12
|
+
"docDetectorModule": "docDetectorModule20220324.js",
|
|
13
|
+
"PDF417MODULE": "PDF417MODULE20220324.js",
|
|
14
|
+
"SimpleFaceModule": "SimpleFaceModule20220324.js",
|
|
15
|
+
"BlazeFaceModule": "BlazeFaceModule20220324.js",
|
|
16
|
+
"MeshFaceModule": "MeshFaceModule20220324.js",
|
|
17
|
+
"BarcodeModule": "BarcodeModule20220324.js",
|
|
18
|
+
"PICO": "PICO20220324.js",
|
|
19
|
+
"PDF417": "PDF41720220324.js",
|
|
20
|
+
"PDF417PARSER": "PDF417PARSER20220324.js",
|
|
21
|
+
"MRZCore": "MRZCore20220324.js",
|
|
22
|
+
"IMGPROCCore": "IMGPROCCore20220324.js",
|
|
23
|
+
"ZXingReader": "ZXingReader20220324.js",
|
|
24
|
+
"TFBlazeFace": "blazeface.js",
|
|
25
|
+
"FaceLandmarksDetector": "face-landmarks-detection.js"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type RealFaceMode = keyof typeof realFaceModes;
|
|
2
|
+
|
|
3
|
+
const realFaceModes = {
|
|
4
|
+
auto: {
|
|
5
|
+
description: 'enable "realFaceMode" only for iphone.',
|
|
6
|
+
},
|
|
7
|
+
none: {
|
|
8
|
+
description: 'disable this option.',
|
|
9
|
+
},
|
|
10
|
+
all: {
|
|
11
|
+
description: 'enable "realFaceMode" for all devices.',
|
|
12
|
+
},
|
|
13
|
+
} as const;
|
|
14
|
+
|
|
15
|
+
export default realFaceModes;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
export type StepType = 'auto' | 'mrz' | 'front' | 'pdf' | 'back' | 'face' | 'barcode' | 'photo';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
auto: {
|
|
5
|
+
id: 0,
|
|
6
|
+
camera: 'environment',
|
|
7
|
+
name: 'Front Scan',
|
|
8
|
+
time: 5,
|
|
9
|
+
max: 0.15,
|
|
10
|
+
core: [
|
|
11
|
+
'imgProc', 'tf', 'mrz',
|
|
12
|
+
],
|
|
13
|
+
description: '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.',
|
|
14
|
+
},
|
|
15
|
+
mrz: {
|
|
16
|
+
id: 1,
|
|
17
|
+
camera: 'environment',
|
|
18
|
+
name: 'MRZ',
|
|
19
|
+
time: 5,
|
|
20
|
+
core: [
|
|
21
|
+
'mrz',
|
|
22
|
+
],
|
|
23
|
+
description: 'detection, capture and parsing of the mrz-code of a document.',
|
|
24
|
+
},
|
|
25
|
+
front: {
|
|
26
|
+
id: 2,
|
|
27
|
+
camera: 'environment',
|
|
28
|
+
name: 'Front Scan',
|
|
29
|
+
time: 5,
|
|
30
|
+
max: 0.15,
|
|
31
|
+
core: [
|
|
32
|
+
'imgProc', 'mrz', 'tf',
|
|
33
|
+
],
|
|
34
|
+
description: 'capture front of a document without analysis.',
|
|
35
|
+
},
|
|
36
|
+
pdf: {
|
|
37
|
+
id: 3,
|
|
38
|
+
camera: 'environment',
|
|
39
|
+
name: 'PDF',
|
|
40
|
+
time: 5,
|
|
41
|
+
core: [
|
|
42
|
+
'pdf',
|
|
43
|
+
],
|
|
44
|
+
description: 'detection and capture of pdf417 of a document.',
|
|
45
|
+
},
|
|
46
|
+
back: {
|
|
47
|
+
id: 4,
|
|
48
|
+
camera: 'environment',
|
|
49
|
+
name: 'Back Scan',
|
|
50
|
+
time: 5,
|
|
51
|
+
core: [
|
|
52
|
+
'mrz', 'pdf',
|
|
53
|
+
],
|
|
54
|
+
description: '',
|
|
55
|
+
},
|
|
56
|
+
face: {
|
|
57
|
+
id: 5,
|
|
58
|
+
camera: 'user',
|
|
59
|
+
name: 'Face',
|
|
60
|
+
time: 10,
|
|
61
|
+
max: 0.33,
|
|
62
|
+
core: [
|
|
63
|
+
'imgProc', 'face',
|
|
64
|
+
],
|
|
65
|
+
description: 'detection and capture of a face using the front camera.',
|
|
66
|
+
},
|
|
67
|
+
barcode: {
|
|
68
|
+
id: 6,
|
|
69
|
+
camera: 'environment',
|
|
70
|
+
name: 'Barcode',
|
|
71
|
+
time: 5,
|
|
72
|
+
core: [
|
|
73
|
+
'barcode',
|
|
74
|
+
],
|
|
75
|
+
description: 'detection, capture and parsing 1 dimensional (barcodes) or 2 dimensional (qr codes).',
|
|
76
|
+
},
|
|
77
|
+
photo: {
|
|
78
|
+
id: 7,
|
|
79
|
+
camera: 'environment',
|
|
80
|
+
name: 'Photo',
|
|
81
|
+
time: 5,
|
|
82
|
+
core: [],
|
|
83
|
+
description: 'Take a photo.',
|
|
84
|
+
},
|
|
85
|
+
};
|