@hexar/biometric-identity-sdk-core 1.5.0 → 1.7.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.
@@ -254,8 +254,12 @@ class BiometricIdentitySDK {
254
254
  let videoFrames = params.videoFrames;
255
255
  const MAX_FRAMES = 15;
256
256
  if (videoFrames.length > MAX_FRAMES) {
257
- const step = Math.floor(videoFrames.length / MAX_FRAMES);
258
- videoFrames = videoFrames.filter((_, index) => index % step === 0).slice(0, MAX_FRAMES);
257
+ const sampled = [];
258
+ for (let i = 0; i < MAX_FRAMES; i++) {
259
+ const idx = Math.round(i * (videoFrames.length - 1) / (MAX_FRAMES - 1));
260
+ sampled.push(videoFrames[idx]);
261
+ }
262
+ videoFrames = sampled;
259
263
  logger_1.logger.info('Sampled frames for profile picture validation', {
260
264
  originalCount: params.videoFrames.length,
261
265
  sampledCount: videoFrames.length
@@ -385,8 +389,12 @@ class BiometricIdentitySDK {
385
389
  // (150–300 ms) was statistically unlikely to be captured in any frame.
386
390
  const MAX_FRAMES = 15;
387
391
  if (videoFrames.length > MAX_FRAMES) {
388
- const step = Math.floor(videoFrames.length / MAX_FRAMES);
389
- videoFrames = videoFrames.filter((_, index) => index % step === 0).slice(0, MAX_FRAMES);
392
+ const sampled = [];
393
+ for (let i = 0; i < MAX_FRAMES; i++) {
394
+ const idx = Math.round(i * (videoFrames.length - 1) / (MAX_FRAMES - 1));
395
+ sampled.push(videoFrames[idx]);
396
+ }
397
+ videoFrames = sampled;
390
398
  logger_1.logger.info('Sampled frames for validation', {
391
399
  originalCount: this.state.videoData.frames.length,
392
400
  sampledCount: videoFrames.length
@@ -117,6 +117,8 @@ exports.en = {
117
117
  networkError: 'Network error. Please check your connection.',
118
118
  timeout: 'Request timeout. Please try again.',
119
119
  unknownError: 'An unexpected error occurred.',
120
+ systemBusy: 'Service temporarily unavailable',
121
+ systemBusyMessage: 'Our system is currently processing other requests. Please try again in a few moments.',
120
122
  videoTooShort: {
121
123
  title: 'Recording Too Short',
122
124
  message: 'Video must be at least 8 seconds. Please try again.',
@@ -117,6 +117,8 @@ exports.esAR = {
117
117
  networkError: 'Error de red. Verificá tu conexión.',
118
118
  timeout: 'Tiempo de espera agotado. Intentá nuevamente.',
119
119
  unknownError: 'Ocurrió un error inesperado.',
120
+ systemBusy: 'Servicio temporalmente no disponible',
121
+ systemBusyMessage: 'Nuestro sistema está procesando otras solicitudes en este momento. Por favor, intentá nuevamente en unos instantes.',
120
122
  videoTooShort: {
121
123
  title: 'Grabación Muy Corta',
122
124
  message: 'El video debe durar al menos 8 segundos. Por favor intentá nuevamente.',
@@ -117,6 +117,8 @@ exports.es = {
117
117
  networkError: 'Error de red. Verifica tu conexión.',
118
118
  timeout: 'Tiempo de espera agotado. Intenta nuevamente.',
119
119
  unknownError: 'Ocurrió un error inesperado.',
120
+ systemBusy: 'Servicio temporalmente no disponible',
121
+ systemBusyMessage: 'Nuestro sistema está procesando otras solicitudes en este momento. Por favor, intenta nuevamente en unos instantes.',
120
122
  videoTooShort: {
121
123
  title: 'Grabación Muy Corta',
122
124
  message: 'El video debe durar al menos 8 segundos. Por favor intenta nuevamente.',
@@ -117,6 +117,8 @@ exports.ptBR = {
117
117
  networkError: 'Erro de rede. Verifique sua conexão.',
118
118
  timeout: 'Tempo esgotado. Tente novamente.',
119
119
  unknownError: 'Ocorreu um erro inesperado.',
120
+ systemBusy: 'Serviço temporariamente indisponível',
121
+ systemBusyMessage: 'Nosso sistema está processando outras solicitações no momento. Por favor, tente novamente em alguns instantes.',
120
122
  videoTooShort: {
121
123
  title: 'Gravação Muito Curta',
122
124
  message: 'O vídeo deve durar pelo menos 8 segundos. Por favor, tente novamente.',
@@ -115,6 +115,8 @@ export interface LanguageStrings {
115
115
  networkError: string;
116
116
  timeout: string;
117
117
  unknownError: string;
118
+ systemBusy: string;
119
+ systemBusyMessage: string;
118
120
  videoTooShort: {
119
121
  title: string;
120
122
  message: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hexar/biometric-identity-sdk-core",
3
- "version": "1.5.0",
3
+ "version": "1.7.0",
4
4
  "description": "Core AI engine for biometric identity verification",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -338,8 +338,12 @@ export class BiometricIdentitySDK {
338
338
  let videoFrames = params.videoFrames;
339
339
  const MAX_FRAMES = 15;
340
340
  if (videoFrames.length > MAX_FRAMES) {
341
- const step = Math.floor(videoFrames.length / MAX_FRAMES);
342
- videoFrames = videoFrames.filter((_, index) => index % step === 0).slice(0, MAX_FRAMES);
341
+ const sampled: string[] = [];
342
+ for (let i = 0; i < MAX_FRAMES; i++) {
343
+ const idx = Math.round(i * (videoFrames.length - 1) / (MAX_FRAMES - 1));
344
+ sampled.push(videoFrames[idx]);
345
+ }
346
+ videoFrames = sampled;
343
347
  logger.info('Sampled frames for profile picture validation', {
344
348
  originalCount: params.videoFrames.length,
345
349
  sampledCount: videoFrames.length
@@ -498,8 +502,12 @@ export class BiometricIdentitySDK {
498
502
  // (150–300 ms) was statistically unlikely to be captured in any frame.
499
503
  const MAX_FRAMES = 15;
500
504
  if (videoFrames.length > MAX_FRAMES) {
501
- const step = Math.floor(videoFrames.length / MAX_FRAMES);
502
- videoFrames = videoFrames.filter((_, index) => index % step === 0).slice(0, MAX_FRAMES);
505
+ const sampled: string[] = [];
506
+ for (let i = 0; i < MAX_FRAMES; i++) {
507
+ const idx = Math.round(i * (videoFrames.length - 1) / (MAX_FRAMES - 1));
508
+ sampled.push(videoFrames[idx]);
509
+ }
510
+ videoFrames = sampled;
503
511
  logger.info('Sampled frames for validation', {
504
512
  originalCount: this.state.videoData.frames.length,
505
513
  sampledCount: videoFrames.length
@@ -124,6 +124,8 @@ export const en: LanguageStrings = {
124
124
  networkError: 'Network error. Please check your connection.',
125
125
  timeout: 'Request timeout. Please try again.',
126
126
  unknownError: 'An unexpected error occurred.',
127
+ systemBusy: 'Service temporarily unavailable',
128
+ systemBusyMessage: 'Our system is currently processing other requests. Please try again in a few moments.',
127
129
  videoTooShort: {
128
130
  title: 'Recording Too Short',
129
131
  message: 'Video must be at least 8 seconds. Please try again.',
@@ -124,6 +124,8 @@ export const esAR: LanguageStrings = {
124
124
  networkError: 'Error de red. Verificá tu conexión.',
125
125
  timeout: 'Tiempo de espera agotado. Intentá nuevamente.',
126
126
  unknownError: 'Ocurrió un error inesperado.',
127
+ systemBusy: 'Servicio temporalmente no disponible',
128
+ systemBusyMessage: 'Nuestro sistema está procesando otras solicitudes en este momento. Por favor, intentá nuevamente en unos instantes.',
127
129
  videoTooShort: {
128
130
  title: 'Grabación Muy Corta',
129
131
  message: 'El video debe durar al menos 8 segundos. Por favor intentá nuevamente.',
@@ -124,6 +124,8 @@ export const es: LanguageStrings = {
124
124
  networkError: 'Error de red. Verifica tu conexión.',
125
125
  timeout: 'Tiempo de espera agotado. Intenta nuevamente.',
126
126
  unknownError: 'Ocurrió un error inesperado.',
127
+ systemBusy: 'Servicio temporalmente no disponible',
128
+ systemBusyMessage: 'Nuestro sistema está procesando otras solicitudes en este momento. Por favor, intenta nuevamente en unos instantes.',
127
129
  videoTooShort: {
128
130
  title: 'Grabación Muy Corta',
129
131
  message: 'El video debe durar al menos 8 segundos. Por favor intenta nuevamente.',
@@ -124,6 +124,8 @@ export const ptBR: LanguageStrings = {
124
124
  networkError: 'Erro de rede. Verifique sua conexão.',
125
125
  timeout: 'Tempo esgotado. Tente novamente.',
126
126
  unknownError: 'Ocorreu um erro inesperado.',
127
+ systemBusy: 'Serviço temporariamente indisponível',
128
+ systemBusyMessage: 'Nosso sistema está processando outras solicitações no momento. Por favor, tente novamente em alguns instantes.',
127
129
  videoTooShort: {
128
130
  title: 'Gravação Muito Curta',
129
131
  message: 'O vídeo deve durar pelo menos 8 segundos. Por favor, tente novamente.',
package/src/i18n/types.ts CHANGED
@@ -123,6 +123,8 @@ export interface LanguageStrings {
123
123
  networkError: string;
124
124
  timeout: string;
125
125
  unknownError: string;
126
+ systemBusy: string;
127
+ systemBusyMessage: string;
126
128
  videoTooShort: {
127
129
  title: string;
128
130
  message: string;