@hexar/biometric-identity-sdk-core 1.0.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/BiometricIdentitySDK.d.ts +111 -0
- package/dist/BiometricIdentitySDK.js +395 -0
- package/dist/ai-models/FaceDetector.d.ts +59 -0
- package/dist/ai-models/FaceDetector.js +167 -0
- package/dist/ai-models/LivenessDetector.d.ts +61 -0
- package/dist/ai-models/LivenessDetector.js +218 -0
- package/dist/api/BackendClient.d.ts +178 -0
- package/dist/api/BackendClient.js +199 -0
- package/dist/api/index.d.ts +5 -0
- package/dist/api/index.js +8 -0
- package/dist/encryption/index.d.ts +38 -0
- package/dist/encryption/index.js +99 -0
- package/dist/i18n/index.d.ts +6 -0
- package/dist/i18n/index.js +47 -0
- package/dist/i18n/languages/en.d.ts +2 -0
- package/dist/i18n/languages/en.js +112 -0
- package/dist/i18n/languages/es-AR.d.ts +2 -0
- package/dist/i18n/languages/es-AR.js +112 -0
- package/dist/i18n/languages/es.d.ts +2 -0
- package/dist/i18n/languages/es.js +112 -0
- package/dist/i18n/languages/pt-BR.d.ts +2 -0
- package/dist/i18n/languages/pt-BR.js +112 -0
- package/dist/i18n/types.d.ts +110 -0
- package/dist/i18n/types.js +2 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +64 -0
- package/dist/services/BackendValidationService.d.ts +84 -0
- package/dist/services/BackendValidationService.js +174 -0
- package/dist/services/IValidationService.d.ts +132 -0
- package/dist/services/IValidationService.js +8 -0
- package/dist/services/index.d.ts +8 -0
- package/dist/services/index.js +10 -0
- package/dist/types/index.d.ts +288 -0
- package/dist/types/index.js +34 -0
- package/dist/validation/DocumentValidator.d.ts +84 -0
- package/dist/validation/DocumentValidator.js +295 -0
- package/dist/validation/OCREngine.d.ts +75 -0
- package/dist/validation/OCREngine.js +225 -0
- package/package.json +24 -0
- package/src/BiometricIdentitySDK.ts +493 -0
- package/src/ai-models/FaceDetector.ts +200 -0
- package/src/ai-models/LivenessDetector.ts +274 -0
- package/src/api/BackendClient.ts +395 -0
- package/src/api/index.ts +15 -0
- package/src/encryption/index.ts +108 -0
- package/src/i18n/index.ts +35 -0
- package/src/i18n/languages/en.ts +121 -0
- package/src/i18n/languages/es-AR.ts +121 -0
- package/src/i18n/languages/es.ts +121 -0
- package/src/i18n/languages/pt-BR.ts +121 -0
- package/src/i18n/types.ts +121 -0
- package/src/index.ts +54 -0
- package/src/services/BackendValidationService.ts +228 -0
- package/src/services/IValidationService.ts +158 -0
- package/src/services/index.ts +17 -0
- package/src/types/index.ts +380 -0
- package/src/validation/DocumentValidator.ts +353 -0
- package/src/validation/OCREngine.ts +265 -0
- package/tsconfig.json +20 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.es = void 0;
|
|
4
|
+
exports.es = {
|
|
5
|
+
common: {
|
|
6
|
+
loading: 'Cargando...',
|
|
7
|
+
error: 'Error',
|
|
8
|
+
retry: 'Reintentar',
|
|
9
|
+
cancel: 'Cancelar',
|
|
10
|
+
continue: 'Continuar',
|
|
11
|
+
close: 'Cerrar',
|
|
12
|
+
done: 'Listo',
|
|
13
|
+
},
|
|
14
|
+
initialization: {
|
|
15
|
+
initializing: 'Iniciando...',
|
|
16
|
+
connectingToServer: 'Conectando al servidor...',
|
|
17
|
+
loadingModels: 'Cargando modelos de IA...',
|
|
18
|
+
},
|
|
19
|
+
instructions: {
|
|
20
|
+
title: 'Verificación de Identidad',
|
|
21
|
+
subtitle: 'Sigue estos pasos para verificar tu identidad',
|
|
22
|
+
step1: 'Captura el frente de tu documento',
|
|
23
|
+
step2: 'Captura el reverso de tu documento',
|
|
24
|
+
step3: 'Graba un video de tu rostro',
|
|
25
|
+
startButton: 'Iniciar Verificación',
|
|
26
|
+
requirements: {
|
|
27
|
+
goodLighting: 'Buena iluminación',
|
|
28
|
+
clearDocument: 'Documento claro',
|
|
29
|
+
stableHand: 'Mano estable',
|
|
30
|
+
followInstructions: 'Sigue las instrucciones',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
capture: {
|
|
34
|
+
frontId: {
|
|
35
|
+
title: 'Frente del Documento',
|
|
36
|
+
instruction: 'Posiciona el frente de tu documento dentro del marco',
|
|
37
|
+
button: 'Capturar Frente',
|
|
38
|
+
},
|
|
39
|
+
backId: {
|
|
40
|
+
title: 'Reverso del Documento',
|
|
41
|
+
instruction: 'Posiciona el reverso de tu documento dentro del marco',
|
|
42
|
+
button: 'Capturar Reverso',
|
|
43
|
+
},
|
|
44
|
+
selfie: {
|
|
45
|
+
title: 'Foto de Rostro',
|
|
46
|
+
instruction: 'Posiciona tu rostro dentro del marco',
|
|
47
|
+
button: 'Tomar Foto',
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
liveness: {
|
|
51
|
+
title: 'Verificación Facial',
|
|
52
|
+
preparing: 'Preparando verificación...',
|
|
53
|
+
instructions: {
|
|
54
|
+
lookLeft: 'Mira a la izquierda',
|
|
55
|
+
lookRight: 'Mira a la derecha',
|
|
56
|
+
lookUp: 'Mira hacia arriba',
|
|
57
|
+
lookDown: 'Mira hacia abajo',
|
|
58
|
+
smile: 'Sonríe',
|
|
59
|
+
blink: 'Parpadea naturalmente',
|
|
60
|
+
turnHeadLeft: 'Gira tu cabeza a la izquierda',
|
|
61
|
+
turnHeadRight: 'Gira tu cabeza a la derecha',
|
|
62
|
+
stayStill: 'Permanece quieto',
|
|
63
|
+
},
|
|
64
|
+
recording: 'Grabando...',
|
|
65
|
+
processing: 'Procesando video...',
|
|
66
|
+
},
|
|
67
|
+
validation: {
|
|
68
|
+
title: 'Validando',
|
|
69
|
+
validating: 'Validando tu identidad...',
|
|
70
|
+
checkingDocument: 'Verificando autenticidad del documento...',
|
|
71
|
+
checkingLiveness: 'Verificando prueba de vida...',
|
|
72
|
+
matchingFaces: 'Comparando rostros...',
|
|
73
|
+
almostDone: 'Casi terminamos...',
|
|
74
|
+
},
|
|
75
|
+
result: {
|
|
76
|
+
success: {
|
|
77
|
+
title: 'Verificación Exitosa',
|
|
78
|
+
message: 'Tu identidad ha sido verificada correctamente',
|
|
79
|
+
verificationComplete: 'Verificación Completa',
|
|
80
|
+
},
|
|
81
|
+
failure: {
|
|
82
|
+
title: 'Verificación Fallida',
|
|
83
|
+
message: 'No pudimos verificar tu identidad',
|
|
84
|
+
tryAgain: 'Por favor, intenta nuevamente',
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
errors: {
|
|
88
|
+
cameraPermissionDenied: 'Permiso de cámara denegado. Habilita el acceso en configuración.',
|
|
89
|
+
cameraNotAvailable: 'Cámara no disponible.',
|
|
90
|
+
faceNotDetected: 'Rostro no detectado. Posiciona tu cara claramente.',
|
|
91
|
+
multipleFacesDetected: 'Múltiples rostros detectados. Solo debe haber una persona.',
|
|
92
|
+
documentNotDetected: 'Documento no detectado. Posiciona tu documento claramente.',
|
|
93
|
+
poorImageQuality: 'Calidad de imagen baja. Asegura buena iluminación.',
|
|
94
|
+
livenessCheckFailed: 'Prueba de vida fallida. Intenta nuevamente.',
|
|
95
|
+
faceMatchFailed: 'El rostro no coincide con la foto del documento.',
|
|
96
|
+
documentTampered: 'El documento parece estar alterado o ser fraudulento.',
|
|
97
|
+
networkError: 'Error de red. Verifica tu conexión.',
|
|
98
|
+
timeout: 'Tiempo de espera agotado. Intenta nuevamente.',
|
|
99
|
+
unknownError: 'Ocurrió un error inesperado.',
|
|
100
|
+
},
|
|
101
|
+
badges: {
|
|
102
|
+
secureVerification: 'Verificación Segura con IA',
|
|
103
|
+
aiPowered: 'Impulsado por IA',
|
|
104
|
+
verified: 'Verificado',
|
|
105
|
+
},
|
|
106
|
+
steps: {
|
|
107
|
+
frontId: 'Frente',
|
|
108
|
+
backId: 'Reverso',
|
|
109
|
+
faceVideo: 'Video',
|
|
110
|
+
validation: 'Validación',
|
|
111
|
+
},
|
|
112
|
+
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ptBR = void 0;
|
|
4
|
+
exports.ptBR = {
|
|
5
|
+
common: {
|
|
6
|
+
loading: 'Carregando...',
|
|
7
|
+
error: 'Erro',
|
|
8
|
+
retry: 'Tentar Novamente',
|
|
9
|
+
cancel: 'Cancelar',
|
|
10
|
+
continue: 'Continuar',
|
|
11
|
+
close: 'Fechar',
|
|
12
|
+
done: 'Pronto',
|
|
13
|
+
},
|
|
14
|
+
initialization: {
|
|
15
|
+
initializing: 'Inicializando...',
|
|
16
|
+
connectingToServer: 'Conectando ao servidor...',
|
|
17
|
+
loadingModels: 'Carregando modelos de IA...',
|
|
18
|
+
},
|
|
19
|
+
instructions: {
|
|
20
|
+
title: 'Verificação de Identidade',
|
|
21
|
+
subtitle: 'Siga estes passos para verificar sua identidade',
|
|
22
|
+
step1: 'Capture a frente do documento',
|
|
23
|
+
step2: 'Capture o verso do documento',
|
|
24
|
+
step3: 'Grave um vídeo do seu rosto',
|
|
25
|
+
startButton: 'Iniciar Verificação',
|
|
26
|
+
requirements: {
|
|
27
|
+
goodLighting: 'Boa iluminação',
|
|
28
|
+
clearDocument: 'Documento claro',
|
|
29
|
+
stableHand: 'Mão estável',
|
|
30
|
+
followInstructions: 'Siga as instruções',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
capture: {
|
|
34
|
+
frontId: {
|
|
35
|
+
title: 'Frente do Documento',
|
|
36
|
+
instruction: 'Posicione a frente do seu documento dentro da moldura',
|
|
37
|
+
button: 'Capturar Frente',
|
|
38
|
+
},
|
|
39
|
+
backId: {
|
|
40
|
+
title: 'Verso do Documento',
|
|
41
|
+
instruction: 'Posicione o verso do seu documento dentro da moldura',
|
|
42
|
+
button: 'Capturar Verso',
|
|
43
|
+
},
|
|
44
|
+
selfie: {
|
|
45
|
+
title: 'Foto do Rosto',
|
|
46
|
+
instruction: 'Posicione seu rosto dentro da moldura',
|
|
47
|
+
button: 'Tirar Foto',
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
liveness: {
|
|
51
|
+
title: 'Verificação Facial',
|
|
52
|
+
preparing: 'Preparando verificação...',
|
|
53
|
+
instructions: {
|
|
54
|
+
lookLeft: 'Olhe para a esquerda',
|
|
55
|
+
lookRight: 'Olhe para a direita',
|
|
56
|
+
lookUp: 'Olhe para cima',
|
|
57
|
+
lookDown: 'Olhe para baixo',
|
|
58
|
+
smile: 'Sorria',
|
|
59
|
+
blink: 'Pisque naturalmente',
|
|
60
|
+
turnHeadLeft: 'Vire sua cabeça para a esquerda',
|
|
61
|
+
turnHeadRight: 'Vire sua cabeça para a direita',
|
|
62
|
+
stayStill: 'Fique parado',
|
|
63
|
+
},
|
|
64
|
+
recording: 'Gravando...',
|
|
65
|
+
processing: 'Processando vídeo...',
|
|
66
|
+
},
|
|
67
|
+
validation: {
|
|
68
|
+
title: 'Validando',
|
|
69
|
+
validating: 'Validando sua identidade...',
|
|
70
|
+
checkingDocument: 'Verificando autenticidade do documento...',
|
|
71
|
+
checkingLiveness: 'Verificando prova de vida...',
|
|
72
|
+
matchingFaces: 'Comparando rostos...',
|
|
73
|
+
almostDone: 'Quase pronto...',
|
|
74
|
+
},
|
|
75
|
+
result: {
|
|
76
|
+
success: {
|
|
77
|
+
title: 'Verificação Bem-Sucedida',
|
|
78
|
+
message: 'Sua identidade foi verificada com sucesso',
|
|
79
|
+
verificationComplete: 'Verificação Completa',
|
|
80
|
+
},
|
|
81
|
+
failure: {
|
|
82
|
+
title: 'Verificação Falhou',
|
|
83
|
+
message: 'Não conseguimos verificar sua identidade',
|
|
84
|
+
tryAgain: 'Por favor, tente novamente',
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
errors: {
|
|
88
|
+
cameraPermissionDenied: 'Permissão de câmera negada. Habilite o acesso nas configurações.',
|
|
89
|
+
cameraNotAvailable: 'Câmera não disponível.',
|
|
90
|
+
faceNotDetected: 'Rosto não detectado. Posicione seu rosto claramente.',
|
|
91
|
+
multipleFacesDetected: 'Múltiplos rostos detectados. Apenas uma pessoa deve estar no quadro.',
|
|
92
|
+
documentNotDetected: 'Documento não detectado. Posicione seu documento claramente.',
|
|
93
|
+
poorImageQuality: 'Qualidade de imagem baixa. Certifique-se de ter boa iluminação.',
|
|
94
|
+
livenessCheckFailed: 'Prova de vida falhou. Tente novamente.',
|
|
95
|
+
faceMatchFailed: 'O rosto não corresponde à foto do documento.',
|
|
96
|
+
documentTampered: 'O documento parece estar adulterado ou fraudulento.',
|
|
97
|
+
networkError: 'Erro de rede. Verifique sua conexão.',
|
|
98
|
+
timeout: 'Tempo esgotado. Tente novamente.',
|
|
99
|
+
unknownError: 'Ocorreu um erro inesperado.',
|
|
100
|
+
},
|
|
101
|
+
badges: {
|
|
102
|
+
secureVerification: 'Verificação Segura com IA',
|
|
103
|
+
aiPowered: 'Impulsionado por IA',
|
|
104
|
+
verified: 'Verificado',
|
|
105
|
+
},
|
|
106
|
+
steps: {
|
|
107
|
+
frontId: 'Frente',
|
|
108
|
+
backId: 'Verso',
|
|
109
|
+
faceVideo: 'Vídeo',
|
|
110
|
+
validation: 'Validação',
|
|
111
|
+
},
|
|
112
|
+
};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
export type SupportedLanguage = 'en' | 'es' | 'es-AR' | 'pt-BR';
|
|
2
|
+
export interface LanguageStrings {
|
|
3
|
+
common: {
|
|
4
|
+
loading: string;
|
|
5
|
+
error: string;
|
|
6
|
+
retry: string;
|
|
7
|
+
cancel: string;
|
|
8
|
+
continue: string;
|
|
9
|
+
close: string;
|
|
10
|
+
done: string;
|
|
11
|
+
};
|
|
12
|
+
initialization: {
|
|
13
|
+
initializing: string;
|
|
14
|
+
connectingToServer: string;
|
|
15
|
+
loadingModels: string;
|
|
16
|
+
};
|
|
17
|
+
instructions: {
|
|
18
|
+
title: string;
|
|
19
|
+
subtitle: string;
|
|
20
|
+
step1: string;
|
|
21
|
+
step2: string;
|
|
22
|
+
step3: string;
|
|
23
|
+
startButton: string;
|
|
24
|
+
requirements: {
|
|
25
|
+
goodLighting: string;
|
|
26
|
+
clearDocument: string;
|
|
27
|
+
stableHand: string;
|
|
28
|
+
followInstructions: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
capture: {
|
|
32
|
+
frontId: {
|
|
33
|
+
title: string;
|
|
34
|
+
instruction: string;
|
|
35
|
+
button: string;
|
|
36
|
+
};
|
|
37
|
+
backId: {
|
|
38
|
+
title: string;
|
|
39
|
+
instruction: string;
|
|
40
|
+
button: string;
|
|
41
|
+
};
|
|
42
|
+
selfie: {
|
|
43
|
+
title: string;
|
|
44
|
+
instruction: string;
|
|
45
|
+
button: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
liveness: {
|
|
49
|
+
title: string;
|
|
50
|
+
preparing: string;
|
|
51
|
+
instructions: {
|
|
52
|
+
lookLeft: string;
|
|
53
|
+
lookRight: string;
|
|
54
|
+
lookUp: string;
|
|
55
|
+
lookDown: string;
|
|
56
|
+
smile: string;
|
|
57
|
+
blink: string;
|
|
58
|
+
turnHeadLeft: string;
|
|
59
|
+
turnHeadRight: string;
|
|
60
|
+
stayStill: string;
|
|
61
|
+
};
|
|
62
|
+
recording: string;
|
|
63
|
+
processing: string;
|
|
64
|
+
};
|
|
65
|
+
validation: {
|
|
66
|
+
title: string;
|
|
67
|
+
validating: string;
|
|
68
|
+
checkingDocument: string;
|
|
69
|
+
checkingLiveness: string;
|
|
70
|
+
matchingFaces: string;
|
|
71
|
+
almostDone: string;
|
|
72
|
+
};
|
|
73
|
+
result: {
|
|
74
|
+
success: {
|
|
75
|
+
title: string;
|
|
76
|
+
message: string;
|
|
77
|
+
verificationComplete: string;
|
|
78
|
+
};
|
|
79
|
+
failure: {
|
|
80
|
+
title: string;
|
|
81
|
+
message: string;
|
|
82
|
+
tryAgain: string;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
errors: {
|
|
86
|
+
cameraPermissionDenied: string;
|
|
87
|
+
cameraNotAvailable: string;
|
|
88
|
+
faceNotDetected: string;
|
|
89
|
+
multipleFacesDetected: string;
|
|
90
|
+
documentNotDetected: string;
|
|
91
|
+
poorImageQuality: string;
|
|
92
|
+
livenessCheckFailed: string;
|
|
93
|
+
faceMatchFailed: string;
|
|
94
|
+
documentTampered: string;
|
|
95
|
+
networkError: string;
|
|
96
|
+
timeout: string;
|
|
97
|
+
unknownError: string;
|
|
98
|
+
};
|
|
99
|
+
badges: {
|
|
100
|
+
secureVerification: string;
|
|
101
|
+
aiPowered: string;
|
|
102
|
+
verified: string;
|
|
103
|
+
};
|
|
104
|
+
steps: {
|
|
105
|
+
frontId: string;
|
|
106
|
+
backId: string;
|
|
107
|
+
faceVideo: string;
|
|
108
|
+
validation: string;
|
|
109
|
+
};
|
|
110
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Biometric Identity SDK - Core Package
|
|
3
|
+
* Main entry point for the SDK
|
|
4
|
+
*/
|
|
5
|
+
export { BiometricIdentitySDK } from './BiometricIdentitySDK';
|
|
6
|
+
export { default } from './BiometricIdentitySDK';
|
|
7
|
+
export * from './types';
|
|
8
|
+
export { FaceDetector, calculateFaceSimilarity, calculateFaceDistance } from './ai-models/FaceDetector';
|
|
9
|
+
export { LivenessDetector } from './ai-models/LivenessDetector';
|
|
10
|
+
export { DocumentValidator, meetsQualityStandards } from './validation/DocumentValidator';
|
|
11
|
+
export { OCREngine, cleanText, isValidDate } from './validation/OCREngine';
|
|
12
|
+
export { EncryptionService, encryptImages, createIntegritySignature } from './encryption';
|
|
13
|
+
export { BackendClient } from './api/BackendClient';
|
|
14
|
+
export type { ChallengeAction, ChallengeResponse, LivenessResponse as BackendLivenessResponse, FaceMatchResponse, DocumentValidationResponse as BackendDocumentResponse, FullValidationResponse, BackendClientConfig, } from './api/BackendClient';
|
|
15
|
+
export { BackendValidationService } from './services/BackendValidationService';
|
|
16
|
+
export type { BackendValidationServiceConfig } from './services/BackendValidationService';
|
|
17
|
+
export type { IValidationService, LivenessChallenge, DocumentValidationResult, LivenessResult, FaceMatchResult, } from './services/IValidationService';
|
|
18
|
+
export { getStrings, setLanguage, getCurrentLanguage } from './i18n';
|
|
19
|
+
export type { SupportedLanguage, LanguageStrings } from './i18n';
|
|
20
|
+
export declare const SDK_VERSION = "1.0.0";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Biometric Identity SDK - Core Package
|
|
4
|
+
* Main entry point for the SDK
|
|
5
|
+
*/
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
18
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
19
|
+
};
|
|
20
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
21
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.SDK_VERSION = exports.getCurrentLanguage = exports.setLanguage = exports.getStrings = exports.BackendValidationService = exports.BackendClient = exports.createIntegritySignature = exports.encryptImages = exports.EncryptionService = exports.isValidDate = exports.cleanText = exports.OCREngine = exports.meetsQualityStandards = exports.DocumentValidator = exports.LivenessDetector = exports.calculateFaceDistance = exports.calculateFaceSimilarity = exports.FaceDetector = exports.default = exports.BiometricIdentitySDK = void 0;
|
|
25
|
+
// Main SDK class
|
|
26
|
+
var BiometricIdentitySDK_1 = require("./BiometricIdentitySDK");
|
|
27
|
+
Object.defineProperty(exports, "BiometricIdentitySDK", { enumerable: true, get: function () { return BiometricIdentitySDK_1.BiometricIdentitySDK; } });
|
|
28
|
+
var BiometricIdentitySDK_2 = require("./BiometricIdentitySDK");
|
|
29
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(BiometricIdentitySDK_2).default; } });
|
|
30
|
+
// Type definitions
|
|
31
|
+
__exportStar(require("./types"), exports);
|
|
32
|
+
// AI Models
|
|
33
|
+
var FaceDetector_1 = require("./ai-models/FaceDetector");
|
|
34
|
+
Object.defineProperty(exports, "FaceDetector", { enumerable: true, get: function () { return FaceDetector_1.FaceDetector; } });
|
|
35
|
+
Object.defineProperty(exports, "calculateFaceSimilarity", { enumerable: true, get: function () { return FaceDetector_1.calculateFaceSimilarity; } });
|
|
36
|
+
Object.defineProperty(exports, "calculateFaceDistance", { enumerable: true, get: function () { return FaceDetector_1.calculateFaceDistance; } });
|
|
37
|
+
var LivenessDetector_1 = require("./ai-models/LivenessDetector");
|
|
38
|
+
Object.defineProperty(exports, "LivenessDetector", { enumerable: true, get: function () { return LivenessDetector_1.LivenessDetector; } });
|
|
39
|
+
// Validation
|
|
40
|
+
var DocumentValidator_1 = require("./validation/DocumentValidator");
|
|
41
|
+
Object.defineProperty(exports, "DocumentValidator", { enumerable: true, get: function () { return DocumentValidator_1.DocumentValidator; } });
|
|
42
|
+
Object.defineProperty(exports, "meetsQualityStandards", { enumerable: true, get: function () { return DocumentValidator_1.meetsQualityStandards; } });
|
|
43
|
+
var OCREngine_1 = require("./validation/OCREngine");
|
|
44
|
+
Object.defineProperty(exports, "OCREngine", { enumerable: true, get: function () { return OCREngine_1.OCREngine; } });
|
|
45
|
+
Object.defineProperty(exports, "cleanText", { enumerable: true, get: function () { return OCREngine_1.cleanText; } });
|
|
46
|
+
Object.defineProperty(exports, "isValidDate", { enumerable: true, get: function () { return OCREngine_1.isValidDate; } });
|
|
47
|
+
// Encryption
|
|
48
|
+
var encryption_1 = require("./encryption");
|
|
49
|
+
Object.defineProperty(exports, "EncryptionService", { enumerable: true, get: function () { return encryption_1.EncryptionService; } });
|
|
50
|
+
Object.defineProperty(exports, "encryptImages", { enumerable: true, get: function () { return encryption_1.encryptImages; } });
|
|
51
|
+
Object.defineProperty(exports, "createIntegritySignature", { enumerable: true, get: function () { return encryption_1.createIntegritySignature; } });
|
|
52
|
+
// Backend API Client
|
|
53
|
+
var BackendClient_1 = require("./api/BackendClient");
|
|
54
|
+
Object.defineProperty(exports, "BackendClient", { enumerable: true, get: function () { return BackendClient_1.BackendClient; } });
|
|
55
|
+
// Validation Services (Clean Architecture)
|
|
56
|
+
var BackendValidationService_1 = require("./services/BackendValidationService");
|
|
57
|
+
Object.defineProperty(exports, "BackendValidationService", { enumerable: true, get: function () { return BackendValidationService_1.BackendValidationService; } });
|
|
58
|
+
// Internationalization
|
|
59
|
+
var i18n_1 = require("./i18n");
|
|
60
|
+
Object.defineProperty(exports, "getStrings", { enumerable: true, get: function () { return i18n_1.getStrings; } });
|
|
61
|
+
Object.defineProperty(exports, "setLanguage", { enumerable: true, get: function () { return i18n_1.setLanguage; } });
|
|
62
|
+
Object.defineProperty(exports, "getCurrentLanguage", { enumerable: true, get: function () { return i18n_1.getCurrentLanguage; } });
|
|
63
|
+
// Version
|
|
64
|
+
exports.SDK_VERSION = '1.0.0';
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Backend Validation Service
|
|
3
|
+
*
|
|
4
|
+
* Implements IValidationService using the Python backend API.
|
|
5
|
+
* This is the recommended service for production use.
|
|
6
|
+
*
|
|
7
|
+
* SOLID Principles Applied:
|
|
8
|
+
* - Single Responsibility: Only handles backend API communication
|
|
9
|
+
* - Open/Closed: Implements interface, can be extended without modification
|
|
10
|
+
* - Liskov Substitution: Can replace any IValidationService implementation
|
|
11
|
+
* - Interface Segregation: Uses focused IValidationService interface
|
|
12
|
+
* - Dependency Inversion: Depends on abstractions (IValidationService)
|
|
13
|
+
*/
|
|
14
|
+
import { IValidationService, LivenessChallenge, DocumentValidationResult, LivenessResult, FaceMatchResult } from './IValidationService';
|
|
15
|
+
import { ValidationResult } from '../types';
|
|
16
|
+
export interface BackendValidationServiceConfig {
|
|
17
|
+
apiEndpoint: string;
|
|
18
|
+
apiKey: string;
|
|
19
|
+
timeout?: number;
|
|
20
|
+
}
|
|
21
|
+
export declare class BackendValidationService implements IValidationService {
|
|
22
|
+
private client;
|
|
23
|
+
private _isAvailable;
|
|
24
|
+
constructor(config: BackendValidationServiceConfig);
|
|
25
|
+
/**
|
|
26
|
+
* Check if backend is available
|
|
27
|
+
*/
|
|
28
|
+
isAvailable(): Promise<boolean>;
|
|
29
|
+
/**
|
|
30
|
+
* Generate liveness challenge from backend
|
|
31
|
+
*
|
|
32
|
+
* API Endpoint: POST /api/v1/liveness/challenge
|
|
33
|
+
*/
|
|
34
|
+
generateLivenessChallenge(type: 'active' | 'passive'): Promise<LivenessChallenge>;
|
|
35
|
+
/**
|
|
36
|
+
* Validate document using backend
|
|
37
|
+
*
|
|
38
|
+
* API Endpoint: POST /api/v1/document/validate
|
|
39
|
+
*/
|
|
40
|
+
validateDocument(frontImage: string, backImage?: string, options?: {
|
|
41
|
+
documentType?: string;
|
|
42
|
+
countryCode?: string;
|
|
43
|
+
}): Promise<DocumentValidationResult>;
|
|
44
|
+
/**
|
|
45
|
+
* Validate liveness from video frames
|
|
46
|
+
*
|
|
47
|
+
* API Endpoint: POST /api/v1/liveness/validate
|
|
48
|
+
*/
|
|
49
|
+
validateLiveness(sessionId: string, videoFrames: string[], videoDurationMs: number, challengesCompleted: string[]): Promise<LivenessResult>;
|
|
50
|
+
/**
|
|
51
|
+
* Compare faces between document and live capture
|
|
52
|
+
*
|
|
53
|
+
* API Endpoint: POST /api/v1/face/match
|
|
54
|
+
*/
|
|
55
|
+
matchFaces(documentImage: string, liveImage: string): Promise<FaceMatchResult>;
|
|
56
|
+
/**
|
|
57
|
+
* Perform full biometric validation
|
|
58
|
+
*
|
|
59
|
+
* API Endpoint: POST /api/v1/validate
|
|
60
|
+
*
|
|
61
|
+
* This is the main validation endpoint that combines:
|
|
62
|
+
* 1. Document validation
|
|
63
|
+
* 2. Liveness detection
|
|
64
|
+
* 3. Face matching
|
|
65
|
+
*/
|
|
66
|
+
fullValidation(params: {
|
|
67
|
+
frontIdImage: string;
|
|
68
|
+
backIdImage?: string;
|
|
69
|
+
videoFrames: string[];
|
|
70
|
+
videoDurationMs: number;
|
|
71
|
+
sessionId: string;
|
|
72
|
+
challengesCompleted: string[];
|
|
73
|
+
documentType?: string;
|
|
74
|
+
countryCode?: string;
|
|
75
|
+
}): Promise<ValidationResult>;
|
|
76
|
+
/**
|
|
77
|
+
* Get current session ID
|
|
78
|
+
*/
|
|
79
|
+
getSessionId(): string | null;
|
|
80
|
+
/**
|
|
81
|
+
* Reset session
|
|
82
|
+
*/
|
|
83
|
+
resetSession(): void;
|
|
84
|
+
}
|