@hexar/biometric-identity-sdk-core 1.2.0 → 1.3.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/api/BackendClient.js +5 -1
- package/dist/encryption/index.d.ts +1 -1
- package/dist/encryption/index.js +2 -2
- package/dist/i18n/languages/en.js +2 -2
- package/dist/i18n/languages/es-AR.js +2 -2
- package/dist/i18n/languages/es.js +2 -2
- package/dist/i18n/languages/pt-BR.js +2 -2
- package/package.json +1 -1
- package/src/api/BackendClient.ts +6 -5
- package/src/encryption/index.ts +2 -2
- package/src/i18n/languages/en.ts +2 -2
- package/src/i18n/languages/es-AR.ts +2 -2
- package/src/i18n/languages/es.ts +2 -2
- package/src/i18n/languages/pt-BR.ts +2 -2
|
@@ -3,8 +3,12 @@
|
|
|
3
3
|
* Backend API Client for Biometric Identity SDK
|
|
4
4
|
* Communicates with the Python backend for AI-powered validation
|
|
5
5
|
*/
|
|
6
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
6
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
10
|
exports.BackendClient = void 0;
|
|
11
|
+
const crypto_1 = __importDefault(require("crypto"));
|
|
8
12
|
const logger_1 = require("../utils/logger");
|
|
9
13
|
/**
|
|
10
14
|
* Client for communicating with the Biometric Identity Backend
|
|
@@ -60,7 +64,7 @@ class BackendClient {
|
|
|
60
64
|
});
|
|
61
65
|
}
|
|
62
66
|
generateSDKSessionId() {
|
|
63
|
-
return `sdk-${
|
|
67
|
+
return `sdk-${crypto_1.default.randomBytes(16).toString('hex')}`;
|
|
64
68
|
}
|
|
65
69
|
/**
|
|
66
70
|
* Compare faces between document and live capture
|
|
@@ -35,4 +35,4 @@ export declare function encryptImages(images: string[], encryptionKey?: string):
|
|
|
35
35
|
/**
|
|
36
36
|
* Create integrity signature for data
|
|
37
37
|
*/
|
|
38
|
-
export declare function createIntegritySignature(data: any): string;
|
|
38
|
+
export declare function createIntegritySignature(data: any, key: string): string;
|
package/dist/encryption/index.js
CHANGED
|
@@ -90,10 +90,10 @@ async function encryptImages(images, encryptionKey) {
|
|
|
90
90
|
/**
|
|
91
91
|
* Create integrity signature for data
|
|
92
92
|
*/
|
|
93
|
-
function createIntegritySignature(data) {
|
|
93
|
+
function createIntegritySignature(data, key) {
|
|
94
94
|
const dataString = JSON.stringify(data);
|
|
95
95
|
return crypto_1.default
|
|
96
|
-
.createHmac('sha256',
|
|
96
|
+
.createHmac('sha256', key)
|
|
97
97
|
.update(dataString)
|
|
98
98
|
.digest('hex');
|
|
99
99
|
}
|
|
@@ -73,8 +73,8 @@ exports.en = {
|
|
|
73
73
|
processing: 'Processing video...',
|
|
74
74
|
facePositioningGuide: {
|
|
75
75
|
title: 'Position your face',
|
|
76
|
-
description: '
|
|
77
|
-
tip: 'Face
|
|
76
|
+
description: 'Your face should border the oval: don\'t leave too much space between the oval and your face. If your face is too far from the oval edge or outside it, approval chances go down.',
|
|
77
|
+
tip: 'Face bordering the oval = better approval • Too much space or outside = lower chances',
|
|
78
78
|
continue: 'Continue',
|
|
79
79
|
},
|
|
80
80
|
},
|
|
@@ -73,8 +73,8 @@ exports.esAR = {
|
|
|
73
73
|
processing: 'Procesando video...',
|
|
74
74
|
facePositioningGuide: {
|
|
75
75
|
title: 'Posicioná tu rostro',
|
|
76
|
-
description: '
|
|
77
|
-
tip: 'Rostro
|
|
76
|
+
description: 'Tu rostro debe bordear el óvalo: que no quede mucho espacio entre el óvalo y tu cara. Si el rostro está muy alejado del borde del óvalo o queda fuera, bajan las chances de aprobación.',
|
|
77
|
+
tip: 'Rostro bordeando el óvalo = mejor aprobación • Mucho espacio o afuera = menos chances',
|
|
78
78
|
continue: 'Continuar',
|
|
79
79
|
},
|
|
80
80
|
},
|
|
@@ -73,8 +73,8 @@ exports.es = {
|
|
|
73
73
|
processing: 'Procesando video...',
|
|
74
74
|
facePositioningGuide: {
|
|
75
75
|
title: 'Posiciona tu rostro',
|
|
76
|
-
description: '
|
|
77
|
-
tip: 'Rostro
|
|
76
|
+
description: 'Tu rostro debe bordear el óvalo: que no quede mucho espacio entre el óvalo y tu cara. Si el rostro está muy alejado del borde del óvalo o queda fuera, disminuyen las probabilidades de aprobación.',
|
|
77
|
+
tip: 'Rostro bordeando el óvalo = mejor aprobación • Mucho espacio o fuera = menos probabilidades',
|
|
78
78
|
continue: 'Continuar',
|
|
79
79
|
},
|
|
80
80
|
},
|
|
@@ -73,8 +73,8 @@ exports.ptBR = {
|
|
|
73
73
|
processing: 'Processando vídeo...',
|
|
74
74
|
facePositioningGuide: {
|
|
75
75
|
title: 'Posicione seu rosto',
|
|
76
|
-
description: '
|
|
77
|
-
tip: 'Rosto
|
|
76
|
+
description: 'Seu rosto deve bordear o óvalo: não deixe muito espaço entre o óvalo e seu rosto. Se o rosto estiver muito longe da borda do óvalo ou fora dele, as chances de aprovação diminuem.',
|
|
77
|
+
tip: 'Rosto bordejando o óvalo = melhor aprovação • Muito espaço ou fora = menos chances',
|
|
78
78
|
continue: 'Continuar',
|
|
79
79
|
},
|
|
80
80
|
},
|
package/package.json
CHANGED
package/src/api/BackendClient.ts
CHANGED
|
@@ -3,12 +3,13 @@
|
|
|
3
3
|
* Communicates with the Python backend for AI-powered validation
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
import crypto from 'crypto';
|
|
7
|
+
import {
|
|
8
|
+
ValidationResult,
|
|
9
|
+
VideoResult,
|
|
9
10
|
LivenessValidationResult,
|
|
10
11
|
DocumentData,
|
|
11
|
-
BiometricConfig
|
|
12
|
+
BiometricConfig
|
|
12
13
|
} from '../types';
|
|
13
14
|
import { logger } from '../utils/logger';
|
|
14
15
|
|
|
@@ -221,7 +222,7 @@ export class BackendClient {
|
|
|
221
222
|
}
|
|
222
223
|
|
|
223
224
|
private generateSDKSessionId(): string {
|
|
224
|
-
return `sdk-${
|
|
225
|
+
return `sdk-${crypto.randomBytes(16).toString('hex')}`;
|
|
225
226
|
}
|
|
226
227
|
|
|
227
228
|
/**
|
package/src/encryption/index.ts
CHANGED
|
@@ -99,10 +99,10 @@ export async function encryptImages(
|
|
|
99
99
|
/**
|
|
100
100
|
* Create integrity signature for data
|
|
101
101
|
*/
|
|
102
|
-
export function createIntegritySignature(data: any): string {
|
|
102
|
+
export function createIntegritySignature(data: any, key: string): string {
|
|
103
103
|
const dataString = JSON.stringify(data);
|
|
104
104
|
return crypto
|
|
105
|
-
.createHmac('sha256',
|
|
105
|
+
.createHmac('sha256', key)
|
|
106
106
|
.update(dataString)
|
|
107
107
|
.digest('hex');
|
|
108
108
|
}
|
package/src/i18n/languages/en.ts
CHANGED
|
@@ -76,8 +76,8 @@ export const en: LanguageStrings = {
|
|
|
76
76
|
processing: 'Processing video...',
|
|
77
77
|
facePositioningGuide: {
|
|
78
78
|
title: 'Position your face',
|
|
79
|
-
description: '
|
|
80
|
-
tip: 'Face
|
|
79
|
+
description: 'Your face should border the oval: don\'t leave too much space between the oval and your face. If your face is too far from the oval edge or outside it, approval chances go down.',
|
|
80
|
+
tip: 'Face bordering the oval = better approval • Too much space or outside = lower chances',
|
|
81
81
|
continue: 'Continue',
|
|
82
82
|
},
|
|
83
83
|
},
|
|
@@ -76,8 +76,8 @@ export const esAR: LanguageStrings = {
|
|
|
76
76
|
processing: 'Procesando video...',
|
|
77
77
|
facePositioningGuide: {
|
|
78
78
|
title: 'Posicioná tu rostro',
|
|
79
|
-
description: '
|
|
80
|
-
tip: 'Rostro
|
|
79
|
+
description: 'Tu rostro debe bordear el óvalo: que no quede mucho espacio entre el óvalo y tu cara. Si el rostro está muy alejado del borde del óvalo o queda fuera, bajan las chances de aprobación.',
|
|
80
|
+
tip: 'Rostro bordeando el óvalo = mejor aprobación • Mucho espacio o afuera = menos chances',
|
|
81
81
|
continue: 'Continuar',
|
|
82
82
|
},
|
|
83
83
|
},
|
package/src/i18n/languages/es.ts
CHANGED
|
@@ -76,8 +76,8 @@ export const es: LanguageStrings = {
|
|
|
76
76
|
processing: 'Procesando video...',
|
|
77
77
|
facePositioningGuide: {
|
|
78
78
|
title: 'Posiciona tu rostro',
|
|
79
|
-
description: '
|
|
80
|
-
tip: 'Rostro
|
|
79
|
+
description: 'Tu rostro debe bordear el óvalo: que no quede mucho espacio entre el óvalo y tu cara. Si el rostro está muy alejado del borde del óvalo o queda fuera, disminuyen las probabilidades de aprobación.',
|
|
80
|
+
tip: 'Rostro bordeando el óvalo = mejor aprobación • Mucho espacio o fuera = menos probabilidades',
|
|
81
81
|
continue: 'Continuar',
|
|
82
82
|
},
|
|
83
83
|
},
|
|
@@ -76,8 +76,8 @@ export const ptBR: LanguageStrings = {
|
|
|
76
76
|
processing: 'Processando vídeo...',
|
|
77
77
|
facePositioningGuide: {
|
|
78
78
|
title: 'Posicione seu rosto',
|
|
79
|
-
description: '
|
|
80
|
-
tip: 'Rosto
|
|
79
|
+
description: 'Seu rosto deve bordear o óvalo: não deixe muito espaço entre o óvalo e seu rosto. Se o rosto estiver muito longe da borda do óvalo ou fora dele, as chances de aprovação diminuem.',
|
|
80
|
+
tip: 'Rosto bordejando o óvalo = melhor aprovação • Muito espaço ou fora = menos chances',
|
|
81
81
|
continue: 'Continuar',
|
|
82
82
|
},
|
|
83
83
|
},
|