@moveris/shared 2.9.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/README.md +147 -17
- package/dist/index.d.mts +38 -1
- package/dist/index.d.ts +38 -1
- package/dist/index.js +169 -46
- package/dist/index.mjs +167 -46
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -47,13 +47,14 @@ The main client for interacting with the Moveris Liveness API.
|
|
|
47
47
|
const client = new LivenessClient(config: LivenessClientConfig);
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
| Option
|
|
51
|
-
|
|
|
52
|
-
| `apiKey`
|
|
53
|
-
| `baseUrl`
|
|
54
|
-
| `
|
|
55
|
-
| `
|
|
56
|
-
| `
|
|
50
|
+
| Option | Type | Default | Description |
|
|
51
|
+
| -------------- | -------------- | --------------------------- | ------------------------------------------------------------------ |
|
|
52
|
+
| `apiKey` | `string` | **required** | Your Moveris API key |
|
|
53
|
+
| `baseUrl` | `string` | `'https://api.moveris.com'` | API base URL |
|
|
54
|
+
| `modelVersion` | `ModelVersion` | - | Model version alias for `X-Model-Version` header (e.g. `'latest'`) |
|
|
55
|
+
| `timeout` | `number` | `30000` | Request timeout in milliseconds |
|
|
56
|
+
| `enableRetry` | `boolean` | `true` | Enable automatic retry with exponential backoff |
|
|
57
|
+
| `customFetch` | `typeof fetch` | `fetch` | Custom fetch implementation (for React Native) |
|
|
57
58
|
|
|
58
59
|
#### Methods
|
|
59
60
|
|
|
@@ -71,11 +72,13 @@ const result = await client.fastCheck(frames, {
|
|
|
71
72
|
|
|
72
73
|
**Parameters:**
|
|
73
74
|
|
|
74
|
-
| Option
|
|
75
|
-
|
|
|
76
|
-
| `sessionId`
|
|
77
|
-
| `model`
|
|
78
|
-
| `
|
|
75
|
+
| Option | Type | Default | Description |
|
|
76
|
+
| -------------- | ---------------- | --------------- | ----------------------------------------------------------------- |
|
|
77
|
+
| `sessionId` | `string` | auto-generated | Unique session identifier (UUID) |
|
|
78
|
+
| `model` | `FastCheckModel` | `'mixed-10-v2'` | Model to use (see Models section) |
|
|
79
|
+
| `modelVersion` | `ModelVersion` | - | Version alias sent via `X-Model-Version` header (e.g. `'latest'`) |
|
|
80
|
+
| `frameCount` | `number` | - | Frame count for alias-based model resolution |
|
|
81
|
+
| `source` | `FrameSource` | `'live'` | Frame source: `'live'` (camera) or `'media'` (recorded video) |
|
|
79
82
|
|
|
80
83
|
**Returns:** `Promise<LivenessResult>`
|
|
81
84
|
|
|
@@ -208,11 +211,36 @@ Active models (recommended):
|
|
|
208
211
|
|
|
209
212
|
Legacy models (still supported):
|
|
210
213
|
|
|
211
|
-
| Value | Frames | Description
|
|
212
|
-
| ------- | ------ |
|
|
213
|
-
| `'10'` | 10 | Standard — fast
|
|
214
|
-
| `'50'` | 50 | Standard — balanced |
|
|
215
|
-
| `'250'` | 250 | Standard — highest accuracy |
|
|
214
|
+
| Value | Frames | Description |
|
|
215
|
+
| ------- | ------ | ------------------------------------------------ |
|
|
216
|
+
| `'10'` | 10 | Standard — fast (alias: `'fast'`) |
|
|
217
|
+
| `'50'` | 50 | Standard — balanced (alias: `'spatial'`) |
|
|
218
|
+
| `'250'` | 250 | Standard — highest accuracy (alias: `'spatial'`) |
|
|
219
|
+
|
|
220
|
+
Hybrid-v2 models (alias: `'hybrid'`):
|
|
221
|
+
|
|
222
|
+
| Value | Frames | Description |
|
|
223
|
+
| ----------------- | ------ | ---------------------------- |
|
|
224
|
+
| `'hybrid-v2-10'` | 10 | Hybrid v2 — fast |
|
|
225
|
+
| `'hybrid-v2-30'` | 30 | Hybrid v2 — balanced |
|
|
226
|
+
| `'hybrid-v2-60'` | 60 | Hybrid v2 — higher accuracy |
|
|
227
|
+
| `'hybrid-v2-90'` | 90 | Hybrid v2 — high accuracy |
|
|
228
|
+
| `'hybrid-v2-100'` | 100 | Hybrid v2 — high accuracy |
|
|
229
|
+
| `'hybrid-v2-120'` | 120 | Hybrid v2 — highest accuracy |
|
|
230
|
+
| `'hybrid-v2-125'` | 125 | Hybrid v2 — highest accuracy |
|
|
231
|
+
| `'hybrid-v2-250'` | 250 | Hybrid v2 — maximum accuracy |
|
|
232
|
+
|
|
233
|
+
Deprecated models (v1 — sunset 2026-09-01):
|
|
234
|
+
|
|
235
|
+
| Value | Frames | Replacement |
|
|
236
|
+
| ------------- | ------ | ---------------- |
|
|
237
|
+
| `'mixed-10'` | 10 | `'mixed-10-v2'` |
|
|
238
|
+
| `'mixed-30'` | 30 | `'mixed-30-v2'` |
|
|
239
|
+
| `'mixed-60'` | 60 | `'mixed-60-v2'` |
|
|
240
|
+
| `'mixed-90'` | 90 | `'mixed-90-v2'` |
|
|
241
|
+
| `'mixed-120'` | 120 | `'mixed-120-v2'` |
|
|
242
|
+
| `'mixed-150'` | 150 | — |
|
|
243
|
+
| `'mixed-250'` | 250 | — |
|
|
216
244
|
|
|
217
245
|
#### FrameSource
|
|
218
246
|
|
|
@@ -266,6 +294,7 @@ interface LivenessResult {
|
|
|
266
294
|
sessionId: string; // Session identifier
|
|
267
295
|
processingMs: number; // Server processing time
|
|
268
296
|
framesProcessed: number; // Number of frames analyzed
|
|
297
|
+
deprecation?: DeprecationInfo; // Present when X-Moveris-Model-Resolved header is returned
|
|
269
298
|
}
|
|
270
299
|
```
|
|
271
300
|
|
|
@@ -292,6 +321,80 @@ interface CropData {
|
|
|
292
321
|
}
|
|
293
322
|
```
|
|
294
323
|
|
|
324
|
+
#### ModelVersion
|
|
325
|
+
|
|
326
|
+
Version alias sent via the `X-Model-Version` request header for server-side model resolution.
|
|
327
|
+
|
|
328
|
+
```typescript
|
|
329
|
+
type ModelVersion = 'latest' | 'v2' | 'v1' | 'fast' | 'spatial' | 'hybrid' | (string & object);
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
| Value | Resolves to |
|
|
333
|
+
| ----------- | ----------------------------------- |
|
|
334
|
+
| `'latest'` | Current production mixed-v2 model |
|
|
335
|
+
| `'v2'` | Pinned mixed-v2 version |
|
|
336
|
+
| `'v1'` | Legacy mixed-v1 models (deprecated) |
|
|
337
|
+
| `'fast'` | Model `'10'` |
|
|
338
|
+
| `'spatial'` | Models `'50'` / `'250'` |
|
|
339
|
+
| `'hybrid'` | Hybrid-v2 models |
|
|
340
|
+
|
|
341
|
+
> When `X-Model-Version` is set, the API also requires `frame_count` in the request body. Pass it via the `frameCount` option.
|
|
342
|
+
|
|
343
|
+
#### DeprecationInfo
|
|
344
|
+
|
|
345
|
+
Parsed from API response headers when the server resolves a model.
|
|
346
|
+
|
|
347
|
+
```typescript
|
|
348
|
+
interface DeprecationInfo {
|
|
349
|
+
deprecated: boolean; // true when model is deprecated
|
|
350
|
+
resolvedModel: string; // Concrete model id (X-Moveris-Model-Resolved)
|
|
351
|
+
deprecatedModel?: string; // Deprecated model id (X-Moveris-Deprecated-Model)
|
|
352
|
+
sunsetDate?: string; // ISO date of removal (Sunset header)
|
|
353
|
+
suggestedModel?: string; // Replacement model (X-Moveris-Suggested-Model)
|
|
354
|
+
}
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
---
|
|
358
|
+
|
|
359
|
+
### Model Versioning & Deprecation
|
|
360
|
+
|
|
361
|
+
The client supports model alias resolution via the `X-Model-Version` header and automatically parses deprecation headers from API responses.
|
|
362
|
+
|
|
363
|
+
```typescript
|
|
364
|
+
// Use aliases for automatic server-side resolution
|
|
365
|
+
const client = new LivenessClient({
|
|
366
|
+
apiKey: 'mv_your_api_key',
|
|
367
|
+
modelVersion: 'latest', // sent as X-Model-Version header on every request
|
|
368
|
+
});
|
|
369
|
+
|
|
370
|
+
const result = await client.fastCheck(frames, {
|
|
371
|
+
model: 'mixed-30-v2',
|
|
372
|
+
frameCount: 30, // required when modelVersion is set
|
|
373
|
+
});
|
|
374
|
+
|
|
375
|
+
// Deprecation info is automatically parsed from response headers
|
|
376
|
+
if (result.deprecation?.deprecated) {
|
|
377
|
+
console.warn(`Model "${result.deprecation.resolvedModel}" is deprecated.`);
|
|
378
|
+
console.warn(`Migrate to "${result.deprecation.suggestedModel}".`);
|
|
379
|
+
console.warn(`Sunset date: ${result.deprecation.sunsetDate}`);
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
// Per-call override (takes precedence over client-level modelVersion)
|
|
383
|
+
const result2 = await client.fastCheck(frames, {
|
|
384
|
+
modelVersion: 'v2',
|
|
385
|
+
frameCount: 10,
|
|
386
|
+
});
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
#### Valid Frame Counts
|
|
390
|
+
|
|
391
|
+
When using model version aliases, `frameCount` must be one of:
|
|
392
|
+
|
|
393
|
+
```typescript
|
|
394
|
+
import { VALID_FRAME_COUNTS } from '@moveris/shared';
|
|
395
|
+
// [10, 30, 60, 90, 120]
|
|
396
|
+
```
|
|
397
|
+
|
|
295
398
|
---
|
|
296
399
|
|
|
297
400
|
### Utilities
|
|
@@ -584,6 +687,30 @@ These constants control how face crops are generated for the `fast-check-crops`
|
|
|
584
687
|
|
|
585
688
|
---
|
|
586
689
|
|
|
690
|
+
### Model Configuration
|
|
691
|
+
|
|
692
|
+
```typescript
|
|
693
|
+
import { MODEL_CONFIGS, isDeprecatedModel, getActiveModels } from '@moveris/shared';
|
|
694
|
+
|
|
695
|
+
// Access model metadata
|
|
696
|
+
const config = MODEL_CONFIGS['mixed-10-v2'];
|
|
697
|
+
console.log(config.minFrames); // 10
|
|
698
|
+
console.log(config.deprecated); // false
|
|
699
|
+
console.log(config.aliases); // ['v2', 'latest']
|
|
700
|
+
|
|
701
|
+
// Check if a model is deprecated
|
|
702
|
+
if (isDeprecatedModel('mixed-10')) {
|
|
703
|
+
const mc = MODEL_CONFIGS['mixed-10'];
|
|
704
|
+
console.log(`Deprecated! Sunset: ${mc.sunsetDate}, replace with ${mc.replacement}`);
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
// Get only active (non-deprecated) models
|
|
708
|
+
const active = getActiveModels();
|
|
709
|
+
// ['mixed-10-v2', 'mixed-30-v2', ..., '10', '50', '250', 'hybrid-v2-10', ...]
|
|
710
|
+
```
|
|
711
|
+
|
|
712
|
+
---
|
|
713
|
+
|
|
587
714
|
## Configuration Constants
|
|
588
715
|
|
|
589
716
|
```typescript
|
|
@@ -607,6 +734,9 @@ import type {
|
|
|
607
734
|
LivenessState,
|
|
608
735
|
LivenessConfig,
|
|
609
736
|
FastCheckModel,
|
|
737
|
+
ModelVersion,
|
|
738
|
+
DeprecationInfo,
|
|
739
|
+
ModelConfig,
|
|
610
740
|
FrameSource,
|
|
611
741
|
Verdict,
|
|
612
742
|
CapturedFrame,
|
package/dist/index.d.mts
CHANGED
|
@@ -5,9 +5,18 @@ interface ModelEntry {
|
|
|
5
5
|
description: string;
|
|
6
6
|
min_frames: number;
|
|
7
7
|
deprecated: boolean;
|
|
8
|
+
aliases?: string[];
|
|
8
9
|
}
|
|
9
10
|
type ModelsResponse = ModelEntry[];
|
|
10
11
|
type FastCheckModel = '10' | '50' | '250' | 'hybrid-v2-10' | 'hybrid-v2-30' | 'hybrid-v2-50' | 'hybrid-v2-60' | 'hybrid-v2-90' | 'hybrid-v2-100' | 'hybrid-v2-125' | 'hybrid-v2-150' | 'hybrid-v2-250' | 'mixed-10' | 'mixed-30' | 'mixed-60' | 'mixed-90' | 'mixed-120' | 'mixed-150' | 'mixed-250' | 'mixed-10-v2' | 'mixed-30-v2' | 'mixed-60-v2' | 'mixed-90-v2' | 'mixed-120-v2' | (string & object);
|
|
12
|
+
type ModelVersion = 'latest' | 'v2' | 'v1' | 'fast' | 'spatial' | 'hybrid' | (string & object);
|
|
13
|
+
interface DeprecationInfo {
|
|
14
|
+
deprecated: boolean;
|
|
15
|
+
resolvedModel: string;
|
|
16
|
+
deprecatedModel?: string;
|
|
17
|
+
sunsetDate?: string;
|
|
18
|
+
suggestedModel?: string;
|
|
19
|
+
}
|
|
11
20
|
type StreamingStatus = 'buffering' | 'complete';
|
|
12
21
|
type FrameSource = 'media' | 'live';
|
|
13
22
|
type JobStatus = 'queued' | 'processing' | 'complete' | 'failed';
|
|
@@ -29,6 +38,7 @@ interface FastCheckRequest {
|
|
|
29
38
|
model?: FastCheckModel;
|
|
30
39
|
source?: FrameSource;
|
|
31
40
|
frames: FrameData[];
|
|
41
|
+
frame_count?: number;
|
|
32
42
|
warnings?: string[];
|
|
33
43
|
}
|
|
34
44
|
interface FastCheckCropsRequest {
|
|
@@ -36,6 +46,7 @@ interface FastCheckCropsRequest {
|
|
|
36
46
|
model?: FastCheckModel;
|
|
37
47
|
source?: FrameSource;
|
|
38
48
|
crops: CropData[];
|
|
49
|
+
frame_count?: number;
|
|
39
50
|
}
|
|
40
51
|
interface VerifyRequest {
|
|
41
52
|
session_id: string;
|
|
@@ -65,6 +76,7 @@ interface FastCheckStreamRequest {
|
|
|
65
76
|
model?: FastCheckModel;
|
|
66
77
|
source?: FrameSource;
|
|
67
78
|
frame: FrameData;
|
|
79
|
+
frame_count?: number;
|
|
68
80
|
warnings?: string[];
|
|
69
81
|
}
|
|
70
82
|
interface FastCheckResponse {
|
|
@@ -162,12 +174,14 @@ interface LivenessResult {
|
|
|
162
174
|
processingMs: number;
|
|
163
175
|
framesProcessed: number;
|
|
164
176
|
warnings?: string[];
|
|
177
|
+
deprecation?: DeprecationInfo;
|
|
165
178
|
}
|
|
166
179
|
type LivenessState = 'idle' | 'capturing' | 'uploading' | 'processing' | 'complete' | 'error';
|
|
167
180
|
interface LivenessConfig {
|
|
168
181
|
baseUrl: string;
|
|
169
182
|
apiKey: string;
|
|
170
183
|
model?: FastCheckModel;
|
|
184
|
+
modelVersion?: ModelVersion;
|
|
171
185
|
source?: FrameSource;
|
|
172
186
|
fps?: number;
|
|
173
187
|
frameCount?: number;
|
|
@@ -180,12 +194,16 @@ interface CapturedFrame {
|
|
|
180
194
|
}
|
|
181
195
|
|
|
182
196
|
type ModelType = FastCheckModel;
|
|
197
|
+
declare const VALID_FRAME_COUNTS: readonly [10, 30, 60, 90, 120];
|
|
183
198
|
interface ModelConfig {
|
|
184
199
|
type: FastCheckModel;
|
|
185
200
|
minFrames: number;
|
|
186
201
|
recommendedFrames: number;
|
|
187
202
|
description: string;
|
|
188
203
|
deprecated: boolean;
|
|
204
|
+
aliases?: string[];
|
|
205
|
+
sunsetDate?: string;
|
|
206
|
+
replacement?: string;
|
|
189
207
|
}
|
|
190
208
|
declare const MODEL_CONFIGS: Record<FastCheckModel, ModelConfig>;
|
|
191
209
|
interface HybridModelConfig {
|
|
@@ -318,6 +336,7 @@ declare const FACE_CENTER_VERTICAL_OFFSET = 0.05;
|
|
|
318
336
|
declare const MIN_IDEAL_FACE_RATIO = 0.05;
|
|
319
337
|
declare const MAX_IDEAL_FACE_RATIO = 0.2;
|
|
320
338
|
declare const MIN_FACE_RATIO = 0.036;
|
|
339
|
+
declare const MIN_FACE_AREA_RATIO = 0.04;
|
|
321
340
|
declare const MAX_FACE_RATIO = 0.7;
|
|
322
341
|
declare const FACE_CROP_OUTPUT_SIZE = 224;
|
|
323
342
|
declare const MAX_FACE_PERCENTAGE_IN_CROP = 0.45;
|
|
@@ -454,6 +473,7 @@ declare const DEFAULT_STABILIZER_CONFIG: StabilizerConfig;
|
|
|
454
473
|
interface LivenessClientConfig {
|
|
455
474
|
baseUrl?: string;
|
|
456
475
|
apiKey: string;
|
|
476
|
+
modelVersion?: ModelVersion;
|
|
457
477
|
timeout?: number;
|
|
458
478
|
enableRetry?: boolean;
|
|
459
479
|
customFetch?: typeof fetch;
|
|
@@ -473,28 +493,37 @@ declare function generateSessionId(): string;
|
|
|
473
493
|
declare class LivenessClient {
|
|
474
494
|
private readonly baseUrl;
|
|
475
495
|
private readonly apiKey;
|
|
496
|
+
private readonly modelVersion;
|
|
476
497
|
private readonly timeout;
|
|
477
498
|
private readonly enableRetry;
|
|
478
499
|
private readonly fetchFn;
|
|
479
500
|
constructor(config: LivenessClientConfig);
|
|
480
501
|
private request;
|
|
502
|
+
private requestRaw;
|
|
481
503
|
private parseErrorResponse;
|
|
482
504
|
private static unwrapErrorCode;
|
|
483
505
|
private static unwrapErrorMessage;
|
|
484
506
|
private static extractCodeFromText;
|
|
507
|
+
private static parseDeprecationHeaders;
|
|
508
|
+
private buildModelVersionHeaders;
|
|
485
509
|
private requestWithRetry;
|
|
510
|
+
private requestWithRetryRaw;
|
|
486
511
|
health(): Promise<HealthResponse>;
|
|
487
512
|
getModels(): Promise<ModelEntry[]>;
|
|
488
513
|
queueStats(): Promise<QueueStatsResponse>;
|
|
489
514
|
fastCheck(frames: CapturedFrame[], options?: {
|
|
490
515
|
sessionId?: string;
|
|
491
516
|
model?: FastCheckModel;
|
|
517
|
+
modelVersion?: ModelVersion;
|
|
518
|
+
frameCount?: number;
|
|
492
519
|
source?: FrameSource;
|
|
493
520
|
warnings?: string[];
|
|
494
521
|
}): Promise<LivenessResult>;
|
|
495
522
|
fastCheckCrops(crops: CropData[], options?: {
|
|
496
523
|
sessionId?: string;
|
|
497
524
|
model?: FastCheckModel;
|
|
525
|
+
modelVersion?: ModelVersion;
|
|
526
|
+
frameCount?: number;
|
|
498
527
|
source?: FrameSource;
|
|
499
528
|
warnings?: string[];
|
|
500
529
|
bgSegmentation?: boolean;
|
|
@@ -502,6 +531,8 @@ declare class LivenessClient {
|
|
|
502
531
|
streamFrame(frame: CapturedFrame, options: {
|
|
503
532
|
sessionId: string;
|
|
504
533
|
model?: FastCheckModel;
|
|
534
|
+
modelVersion?: ModelVersion;
|
|
535
|
+
frameCount?: number;
|
|
505
536
|
source?: FrameSource;
|
|
506
537
|
warnings?: string[];
|
|
507
538
|
}): Promise<FastCheckStreamResponse>;
|
|
@@ -509,6 +540,8 @@ declare class LivenessClient {
|
|
|
509
540
|
fastCheckStream(frames: CapturedFrame[], options?: {
|
|
510
541
|
sessionId?: string;
|
|
511
542
|
model?: FastCheckModel;
|
|
543
|
+
modelVersion?: ModelVersion;
|
|
544
|
+
frameCount?: number;
|
|
512
545
|
source?: FrameSource;
|
|
513
546
|
warnings?: string[];
|
|
514
547
|
}, callbacks?: {
|
|
@@ -518,6 +551,8 @@ declare class LivenessClient {
|
|
|
518
551
|
fastCheckStreamSequential(frames: CapturedFrame[], options?: {
|
|
519
552
|
sessionId?: string;
|
|
520
553
|
model?: FastCheckModel;
|
|
554
|
+
modelVersion?: ModelVersion;
|
|
555
|
+
frameCount?: number;
|
|
521
556
|
source?: FrameSource;
|
|
522
557
|
warnings?: string[];
|
|
523
558
|
}, callbacks?: {
|
|
@@ -611,6 +646,7 @@ declare const FRAME_BUFFER_CONFIG: {
|
|
|
611
646
|
declare const AUTH_CONFIG: {
|
|
612
647
|
readonly timeout: 30000;
|
|
613
648
|
readonly apiKeyHeader: "X-API-Key";
|
|
649
|
+
readonly modelVersionHeader: "X-Model-Version";
|
|
614
650
|
};
|
|
615
651
|
declare const FRAME_CONFIG: {
|
|
616
652
|
readonly targetFPS: 30;
|
|
@@ -751,6 +787,7 @@ interface CaptureQualityState {
|
|
|
751
787
|
cameraAngleLow?: boolean;
|
|
752
788
|
cameraAngleHigh?: boolean;
|
|
753
789
|
cameraTilted?: boolean;
|
|
790
|
+
faceAreaLow?: boolean;
|
|
754
791
|
}
|
|
755
792
|
declare function getCaptureQualityFeedback(state: CaptureQualityState): string;
|
|
756
793
|
declare function canCaptureFrame(state: Omit<CaptureQualityState, 'framesCaptured' | 'targetFrames' | 'isCapturing'>): boolean;
|
|
@@ -801,4 +838,4 @@ declare function analyzeEyeRegionContrast(pixels: Uint8Array | Uint8ClampedArray
|
|
|
801
838
|
declare function detectSpecularHighlights(pixels: Uint8Array | Uint8ClampedArray, relativeFactor?: number, meanBrightness?: number): number;
|
|
802
839
|
declare function checkEyeRegionQuality(pixels: Uint8Array | Uint8ClampedArray, thresholds?: EyeQualityThresholds): EyeRegionQuality;
|
|
803
840
|
|
|
804
|
-
export { ALIGNMENT_THRESHOLD_CAPTURE, ALIGNMENT_THRESHOLD_GOOD, ALIGNMENT_THRESHOLD_PERFECT, ALIGNMENT_THRESHOLD_POOR, API_ENDPOINTS, API_ERROR_CODES, API_PATHS, AUTH_CONFIG, type ApiErrorCode, BACKLIT_RATIO_THRESHOLD, BLUR_THRESHOLD_MOBILE, BaseFrameCollector, type BlurAnalysis, CAMERA_ANGLE_HIGH_RATIO, CAMERA_ANGLE_LOW_RATIO, type CameraAngleResult, type CaptureQualityState, type CapturedFrame, type CropData, DEFAULT_BLUR_THRESHOLD, DEFAULT_ENDPOINT, DEFAULT_FACE_DETECTION_TIERS, DEFAULT_GAZE_THRESHOLDS, DEFAULT_HAND_OCCLUSION_CONFIG, DEFAULT_LIVENESS_CONFIG, DEFAULT_LOCALE, DEFAULT_OVAL_REGION, DEFAULT_STABILIZER_CONFIG, DEFAULT_STATUS_MESSAGES, type DetectionResult, type DetectionSummary, type DetectorConfig, ERROR_MESSAGES, ERROR_MESSAGES_ES, ES_LOCALE, EYE_LANDMARK_INDICES, EYE_QUALITY_THRESHOLDS, type ErrorResponse, type EyeQualityThresholds, type EyeRegionBounds, type EyeRegionQuality, type EyeRegionsBounds, FACE_CENTER_VERTICAL_OFFSET, FACE_CROP_OUTPUT_SIZE, FEEDBACK_MESSAGES, FRAME_BUFFER_CONFIG, FRAME_CONFIG, type FaceAlignmentResult, type FaceBoundingBox, type FaceDetectionTiers, type FaceInOvalResult, type FaceLandmarkPoint, type FaceRollResult, type FaceVisibilityResult, type FastCheckCropsRequest, type FastCheckModel, type FastCheckRequest, type FastCheckResponse, type FastCheckStreamRequest, type FastCheckStreamResponse, type FeedbackLocale, type FeedbackMessageKey, type Frame, FrameBuffer, type FrameData, type FrameQualityResult, FrameQueue, type FrameSource, GOOD_ALIGNMENT, type GazeThresholds, HIGH_ALIGNMENT, HYBRID_MODEL_CONFIGS, type HandOcclusionConfig, type HeadPose, type HealthResponse, type Hybrid150CheckRequest, type Hybrid50CheckRequest, type HybridCheckRequest, type HybridCheckResponse, type HybridFrameData, type HybridModelConfig, IDEAL_CROP_MULTIPLIER, type JobStatus, type JobStatusResponse, LANDMARK_INDEX, LANDMARK_MAX_BOUND, LANDMARK_MIN_BOUND, LOW_LIGHT_THRESHOLD, type LandmarkValidationResult, type LightingAnalysis, LivenessApiError, type LivenessCallbacks, LivenessClient, type LivenessClientConfig, type LivenessConfig, type LivenessResult, type LivenessState, MAX_CROP_MULTIPLIER, MAX_FACE_PERCENTAGE_IN_CROP, MAX_FACE_RATIO, MAX_FACE_ROLL_DEGREES, MAX_IDEAL_FACE_RATIO, MIN_CAPTURE_ALIGNMENT, MIN_CROP_MULTIPLIER, MIN_FACE_BOTTOM_MARGIN, MIN_FACE_RATIO, MIN_FACE_SIDE_MARGIN, MIN_FACE_TOP_MARGIN, MIN_IDEAL_FACE_RATIO, MIN_LANDMARK_COUNT, MODEL_CONFIGS, type ModelConfig, type ModelEntry, type ModelType, type ModelsResponse, OVAL_GUIDE_COLORS, OVAL_GUIDE_STYLES, OVAL_REGION_DESKTOP, OVAL_REGION_MOBILE, type OnErrorCallback, type OnFrameCapturedCallback, type OnProgressCallback, type OnResultCallback, type OnStateChangeCallback, type OvalGuideState, type OvalRegion, type QueueStatsResponse, RETRY_CONFIG, type RetryOptions, type StabilizationProgress, type StabilizationResult, type StabilizerConfig, type StatusMessageKey, type StreamingStatus, TARGET_FACE_PERCENTAGE_IN_CROP, type Verdict, type VerifyRequest, type VerifyResponse, type VideoFrameMetadata, analyzeBlur, analyzeEyeRegionBrightness, analyzeEyeRegionContrast, analyzeLighting, calculateAdaptiveCropMultiplier, calculateBrightness, calculateFaceAlignment, calculateFaceCropRegion, canCaptureFrame, checkEyeRegionQuality, checkFrameQuality, decodeBase64, detectCameraAngle, detectFaceRoll, detectSpecularHighlights, encodeBase64, generateSessionId, getActiveModels, getApiErrorMessage, getCaptureQualityFeedback, getEyeRegionBounds, getFeedbackMessage, getMinFramesForModel, getOvalGuideState, getStatusMessage, hasEnoughFrames, isDeprecatedModel, isFaceCropFullyInFrame, isFaceFullyVisible, isFaceInOval, isRetryableError, retryWithBackoff, rgbaToGrayscale, sleep, toFrameData, toHybridFrameData, toLivenessResult, toLivenessResultFromStream, validateApiKey, validateFaceLandmarks, validateFrameCount, validateFrameData, validateFrameIndex, validateTimestamp, validateUUID, validateUrl };
|
|
841
|
+
export { ALIGNMENT_THRESHOLD_CAPTURE, ALIGNMENT_THRESHOLD_GOOD, ALIGNMENT_THRESHOLD_PERFECT, ALIGNMENT_THRESHOLD_POOR, API_ENDPOINTS, API_ERROR_CODES, API_PATHS, AUTH_CONFIG, type ApiErrorCode, BACKLIT_RATIO_THRESHOLD, BLUR_THRESHOLD_MOBILE, BaseFrameCollector, type BlurAnalysis, CAMERA_ANGLE_HIGH_RATIO, CAMERA_ANGLE_LOW_RATIO, type CameraAngleResult, type CaptureQualityState, type CapturedFrame, type CropData, DEFAULT_BLUR_THRESHOLD, DEFAULT_ENDPOINT, DEFAULT_FACE_DETECTION_TIERS, DEFAULT_GAZE_THRESHOLDS, DEFAULT_HAND_OCCLUSION_CONFIG, DEFAULT_LIVENESS_CONFIG, DEFAULT_LOCALE, DEFAULT_OVAL_REGION, DEFAULT_STABILIZER_CONFIG, DEFAULT_STATUS_MESSAGES, type DeprecationInfo, type DetectionResult, type DetectionSummary, type DetectorConfig, ERROR_MESSAGES, ERROR_MESSAGES_ES, ES_LOCALE, EYE_LANDMARK_INDICES, EYE_QUALITY_THRESHOLDS, type ErrorResponse, type EyeQualityThresholds, type EyeRegionBounds, type EyeRegionQuality, type EyeRegionsBounds, FACE_CENTER_VERTICAL_OFFSET, FACE_CROP_OUTPUT_SIZE, FEEDBACK_MESSAGES, FRAME_BUFFER_CONFIG, FRAME_CONFIG, type FaceAlignmentResult, type FaceBoundingBox, type FaceDetectionTiers, type FaceInOvalResult, type FaceLandmarkPoint, type FaceRollResult, type FaceVisibilityResult, type FastCheckCropsRequest, type FastCheckModel, type FastCheckRequest, type FastCheckResponse, type FastCheckStreamRequest, type FastCheckStreamResponse, type FeedbackLocale, type FeedbackMessageKey, type Frame, FrameBuffer, type FrameData, type FrameQualityResult, FrameQueue, type FrameSource, GOOD_ALIGNMENT, type GazeThresholds, HIGH_ALIGNMENT, HYBRID_MODEL_CONFIGS, type HandOcclusionConfig, type HeadPose, type HealthResponse, type Hybrid150CheckRequest, type Hybrid50CheckRequest, type HybridCheckRequest, type HybridCheckResponse, type HybridFrameData, type HybridModelConfig, IDEAL_CROP_MULTIPLIER, type JobStatus, type JobStatusResponse, LANDMARK_INDEX, LANDMARK_MAX_BOUND, LANDMARK_MIN_BOUND, LOW_LIGHT_THRESHOLD, type LandmarkValidationResult, type LightingAnalysis, LivenessApiError, type LivenessCallbacks, LivenessClient, type LivenessClientConfig, type LivenessConfig, type LivenessResult, type LivenessState, MAX_CROP_MULTIPLIER, MAX_FACE_PERCENTAGE_IN_CROP, MAX_FACE_RATIO, MAX_FACE_ROLL_DEGREES, MAX_IDEAL_FACE_RATIO, MIN_CAPTURE_ALIGNMENT, MIN_CROP_MULTIPLIER, MIN_FACE_AREA_RATIO, MIN_FACE_BOTTOM_MARGIN, MIN_FACE_RATIO, MIN_FACE_SIDE_MARGIN, MIN_FACE_TOP_MARGIN, MIN_IDEAL_FACE_RATIO, MIN_LANDMARK_COUNT, MODEL_CONFIGS, type ModelConfig, type ModelEntry, type ModelType, type ModelVersion, type ModelsResponse, OVAL_GUIDE_COLORS, OVAL_GUIDE_STYLES, OVAL_REGION_DESKTOP, OVAL_REGION_MOBILE, type OnErrorCallback, type OnFrameCapturedCallback, type OnProgressCallback, type OnResultCallback, type OnStateChangeCallback, type OvalGuideState, type OvalRegion, type QueueStatsResponse, RETRY_CONFIG, type RetryOptions, type StabilizationProgress, type StabilizationResult, type StabilizerConfig, type StatusMessageKey, type StreamingStatus, TARGET_FACE_PERCENTAGE_IN_CROP, VALID_FRAME_COUNTS, type Verdict, type VerifyRequest, type VerifyResponse, type VideoFrameMetadata, analyzeBlur, analyzeEyeRegionBrightness, analyzeEyeRegionContrast, analyzeLighting, calculateAdaptiveCropMultiplier, calculateBrightness, calculateFaceAlignment, calculateFaceCropRegion, canCaptureFrame, checkEyeRegionQuality, checkFrameQuality, decodeBase64, detectCameraAngle, detectFaceRoll, detectSpecularHighlights, encodeBase64, generateSessionId, getActiveModels, getApiErrorMessage, getCaptureQualityFeedback, getEyeRegionBounds, getFeedbackMessage, getMinFramesForModel, getOvalGuideState, getStatusMessage, hasEnoughFrames, isDeprecatedModel, isFaceCropFullyInFrame, isFaceFullyVisible, isFaceInOval, isRetryableError, retryWithBackoff, rgbaToGrayscale, sleep, toFrameData, toHybridFrameData, toLivenessResult, toLivenessResultFromStream, validateApiKey, validateFaceLandmarks, validateFrameCount, validateFrameData, validateFrameIndex, validateTimestamp, validateUUID, validateUrl };
|
package/dist/index.d.ts
CHANGED
|
@@ -5,9 +5,18 @@ interface ModelEntry {
|
|
|
5
5
|
description: string;
|
|
6
6
|
min_frames: number;
|
|
7
7
|
deprecated: boolean;
|
|
8
|
+
aliases?: string[];
|
|
8
9
|
}
|
|
9
10
|
type ModelsResponse = ModelEntry[];
|
|
10
11
|
type FastCheckModel = '10' | '50' | '250' | 'hybrid-v2-10' | 'hybrid-v2-30' | 'hybrid-v2-50' | 'hybrid-v2-60' | 'hybrid-v2-90' | 'hybrid-v2-100' | 'hybrid-v2-125' | 'hybrid-v2-150' | 'hybrid-v2-250' | 'mixed-10' | 'mixed-30' | 'mixed-60' | 'mixed-90' | 'mixed-120' | 'mixed-150' | 'mixed-250' | 'mixed-10-v2' | 'mixed-30-v2' | 'mixed-60-v2' | 'mixed-90-v2' | 'mixed-120-v2' | (string & object);
|
|
12
|
+
type ModelVersion = 'latest' | 'v2' | 'v1' | 'fast' | 'spatial' | 'hybrid' | (string & object);
|
|
13
|
+
interface DeprecationInfo {
|
|
14
|
+
deprecated: boolean;
|
|
15
|
+
resolvedModel: string;
|
|
16
|
+
deprecatedModel?: string;
|
|
17
|
+
sunsetDate?: string;
|
|
18
|
+
suggestedModel?: string;
|
|
19
|
+
}
|
|
11
20
|
type StreamingStatus = 'buffering' | 'complete';
|
|
12
21
|
type FrameSource = 'media' | 'live';
|
|
13
22
|
type JobStatus = 'queued' | 'processing' | 'complete' | 'failed';
|
|
@@ -29,6 +38,7 @@ interface FastCheckRequest {
|
|
|
29
38
|
model?: FastCheckModel;
|
|
30
39
|
source?: FrameSource;
|
|
31
40
|
frames: FrameData[];
|
|
41
|
+
frame_count?: number;
|
|
32
42
|
warnings?: string[];
|
|
33
43
|
}
|
|
34
44
|
interface FastCheckCropsRequest {
|
|
@@ -36,6 +46,7 @@ interface FastCheckCropsRequest {
|
|
|
36
46
|
model?: FastCheckModel;
|
|
37
47
|
source?: FrameSource;
|
|
38
48
|
crops: CropData[];
|
|
49
|
+
frame_count?: number;
|
|
39
50
|
}
|
|
40
51
|
interface VerifyRequest {
|
|
41
52
|
session_id: string;
|
|
@@ -65,6 +76,7 @@ interface FastCheckStreamRequest {
|
|
|
65
76
|
model?: FastCheckModel;
|
|
66
77
|
source?: FrameSource;
|
|
67
78
|
frame: FrameData;
|
|
79
|
+
frame_count?: number;
|
|
68
80
|
warnings?: string[];
|
|
69
81
|
}
|
|
70
82
|
interface FastCheckResponse {
|
|
@@ -162,12 +174,14 @@ interface LivenessResult {
|
|
|
162
174
|
processingMs: number;
|
|
163
175
|
framesProcessed: number;
|
|
164
176
|
warnings?: string[];
|
|
177
|
+
deprecation?: DeprecationInfo;
|
|
165
178
|
}
|
|
166
179
|
type LivenessState = 'idle' | 'capturing' | 'uploading' | 'processing' | 'complete' | 'error';
|
|
167
180
|
interface LivenessConfig {
|
|
168
181
|
baseUrl: string;
|
|
169
182
|
apiKey: string;
|
|
170
183
|
model?: FastCheckModel;
|
|
184
|
+
modelVersion?: ModelVersion;
|
|
171
185
|
source?: FrameSource;
|
|
172
186
|
fps?: number;
|
|
173
187
|
frameCount?: number;
|
|
@@ -180,12 +194,16 @@ interface CapturedFrame {
|
|
|
180
194
|
}
|
|
181
195
|
|
|
182
196
|
type ModelType = FastCheckModel;
|
|
197
|
+
declare const VALID_FRAME_COUNTS: readonly [10, 30, 60, 90, 120];
|
|
183
198
|
interface ModelConfig {
|
|
184
199
|
type: FastCheckModel;
|
|
185
200
|
minFrames: number;
|
|
186
201
|
recommendedFrames: number;
|
|
187
202
|
description: string;
|
|
188
203
|
deprecated: boolean;
|
|
204
|
+
aliases?: string[];
|
|
205
|
+
sunsetDate?: string;
|
|
206
|
+
replacement?: string;
|
|
189
207
|
}
|
|
190
208
|
declare const MODEL_CONFIGS: Record<FastCheckModel, ModelConfig>;
|
|
191
209
|
interface HybridModelConfig {
|
|
@@ -318,6 +336,7 @@ declare const FACE_CENTER_VERTICAL_OFFSET = 0.05;
|
|
|
318
336
|
declare const MIN_IDEAL_FACE_RATIO = 0.05;
|
|
319
337
|
declare const MAX_IDEAL_FACE_RATIO = 0.2;
|
|
320
338
|
declare const MIN_FACE_RATIO = 0.036;
|
|
339
|
+
declare const MIN_FACE_AREA_RATIO = 0.04;
|
|
321
340
|
declare const MAX_FACE_RATIO = 0.7;
|
|
322
341
|
declare const FACE_CROP_OUTPUT_SIZE = 224;
|
|
323
342
|
declare const MAX_FACE_PERCENTAGE_IN_CROP = 0.45;
|
|
@@ -454,6 +473,7 @@ declare const DEFAULT_STABILIZER_CONFIG: StabilizerConfig;
|
|
|
454
473
|
interface LivenessClientConfig {
|
|
455
474
|
baseUrl?: string;
|
|
456
475
|
apiKey: string;
|
|
476
|
+
modelVersion?: ModelVersion;
|
|
457
477
|
timeout?: number;
|
|
458
478
|
enableRetry?: boolean;
|
|
459
479
|
customFetch?: typeof fetch;
|
|
@@ -473,28 +493,37 @@ declare function generateSessionId(): string;
|
|
|
473
493
|
declare class LivenessClient {
|
|
474
494
|
private readonly baseUrl;
|
|
475
495
|
private readonly apiKey;
|
|
496
|
+
private readonly modelVersion;
|
|
476
497
|
private readonly timeout;
|
|
477
498
|
private readonly enableRetry;
|
|
478
499
|
private readonly fetchFn;
|
|
479
500
|
constructor(config: LivenessClientConfig);
|
|
480
501
|
private request;
|
|
502
|
+
private requestRaw;
|
|
481
503
|
private parseErrorResponse;
|
|
482
504
|
private static unwrapErrorCode;
|
|
483
505
|
private static unwrapErrorMessage;
|
|
484
506
|
private static extractCodeFromText;
|
|
507
|
+
private static parseDeprecationHeaders;
|
|
508
|
+
private buildModelVersionHeaders;
|
|
485
509
|
private requestWithRetry;
|
|
510
|
+
private requestWithRetryRaw;
|
|
486
511
|
health(): Promise<HealthResponse>;
|
|
487
512
|
getModels(): Promise<ModelEntry[]>;
|
|
488
513
|
queueStats(): Promise<QueueStatsResponse>;
|
|
489
514
|
fastCheck(frames: CapturedFrame[], options?: {
|
|
490
515
|
sessionId?: string;
|
|
491
516
|
model?: FastCheckModel;
|
|
517
|
+
modelVersion?: ModelVersion;
|
|
518
|
+
frameCount?: number;
|
|
492
519
|
source?: FrameSource;
|
|
493
520
|
warnings?: string[];
|
|
494
521
|
}): Promise<LivenessResult>;
|
|
495
522
|
fastCheckCrops(crops: CropData[], options?: {
|
|
496
523
|
sessionId?: string;
|
|
497
524
|
model?: FastCheckModel;
|
|
525
|
+
modelVersion?: ModelVersion;
|
|
526
|
+
frameCount?: number;
|
|
498
527
|
source?: FrameSource;
|
|
499
528
|
warnings?: string[];
|
|
500
529
|
bgSegmentation?: boolean;
|
|
@@ -502,6 +531,8 @@ declare class LivenessClient {
|
|
|
502
531
|
streamFrame(frame: CapturedFrame, options: {
|
|
503
532
|
sessionId: string;
|
|
504
533
|
model?: FastCheckModel;
|
|
534
|
+
modelVersion?: ModelVersion;
|
|
535
|
+
frameCount?: number;
|
|
505
536
|
source?: FrameSource;
|
|
506
537
|
warnings?: string[];
|
|
507
538
|
}): Promise<FastCheckStreamResponse>;
|
|
@@ -509,6 +540,8 @@ declare class LivenessClient {
|
|
|
509
540
|
fastCheckStream(frames: CapturedFrame[], options?: {
|
|
510
541
|
sessionId?: string;
|
|
511
542
|
model?: FastCheckModel;
|
|
543
|
+
modelVersion?: ModelVersion;
|
|
544
|
+
frameCount?: number;
|
|
512
545
|
source?: FrameSource;
|
|
513
546
|
warnings?: string[];
|
|
514
547
|
}, callbacks?: {
|
|
@@ -518,6 +551,8 @@ declare class LivenessClient {
|
|
|
518
551
|
fastCheckStreamSequential(frames: CapturedFrame[], options?: {
|
|
519
552
|
sessionId?: string;
|
|
520
553
|
model?: FastCheckModel;
|
|
554
|
+
modelVersion?: ModelVersion;
|
|
555
|
+
frameCount?: number;
|
|
521
556
|
source?: FrameSource;
|
|
522
557
|
warnings?: string[];
|
|
523
558
|
}, callbacks?: {
|
|
@@ -611,6 +646,7 @@ declare const FRAME_BUFFER_CONFIG: {
|
|
|
611
646
|
declare const AUTH_CONFIG: {
|
|
612
647
|
readonly timeout: 30000;
|
|
613
648
|
readonly apiKeyHeader: "X-API-Key";
|
|
649
|
+
readonly modelVersionHeader: "X-Model-Version";
|
|
614
650
|
};
|
|
615
651
|
declare const FRAME_CONFIG: {
|
|
616
652
|
readonly targetFPS: 30;
|
|
@@ -751,6 +787,7 @@ interface CaptureQualityState {
|
|
|
751
787
|
cameraAngleLow?: boolean;
|
|
752
788
|
cameraAngleHigh?: boolean;
|
|
753
789
|
cameraTilted?: boolean;
|
|
790
|
+
faceAreaLow?: boolean;
|
|
754
791
|
}
|
|
755
792
|
declare function getCaptureQualityFeedback(state: CaptureQualityState): string;
|
|
756
793
|
declare function canCaptureFrame(state: Omit<CaptureQualityState, 'framesCaptured' | 'targetFrames' | 'isCapturing'>): boolean;
|
|
@@ -801,4 +838,4 @@ declare function analyzeEyeRegionContrast(pixels: Uint8Array | Uint8ClampedArray
|
|
|
801
838
|
declare function detectSpecularHighlights(pixels: Uint8Array | Uint8ClampedArray, relativeFactor?: number, meanBrightness?: number): number;
|
|
802
839
|
declare function checkEyeRegionQuality(pixels: Uint8Array | Uint8ClampedArray, thresholds?: EyeQualityThresholds): EyeRegionQuality;
|
|
803
840
|
|
|
804
|
-
export { ALIGNMENT_THRESHOLD_CAPTURE, ALIGNMENT_THRESHOLD_GOOD, ALIGNMENT_THRESHOLD_PERFECT, ALIGNMENT_THRESHOLD_POOR, API_ENDPOINTS, API_ERROR_CODES, API_PATHS, AUTH_CONFIG, type ApiErrorCode, BACKLIT_RATIO_THRESHOLD, BLUR_THRESHOLD_MOBILE, BaseFrameCollector, type BlurAnalysis, CAMERA_ANGLE_HIGH_RATIO, CAMERA_ANGLE_LOW_RATIO, type CameraAngleResult, type CaptureQualityState, type CapturedFrame, type CropData, DEFAULT_BLUR_THRESHOLD, DEFAULT_ENDPOINT, DEFAULT_FACE_DETECTION_TIERS, DEFAULT_GAZE_THRESHOLDS, DEFAULT_HAND_OCCLUSION_CONFIG, DEFAULT_LIVENESS_CONFIG, DEFAULT_LOCALE, DEFAULT_OVAL_REGION, DEFAULT_STABILIZER_CONFIG, DEFAULT_STATUS_MESSAGES, type DetectionResult, type DetectionSummary, type DetectorConfig, ERROR_MESSAGES, ERROR_MESSAGES_ES, ES_LOCALE, EYE_LANDMARK_INDICES, EYE_QUALITY_THRESHOLDS, type ErrorResponse, type EyeQualityThresholds, type EyeRegionBounds, type EyeRegionQuality, type EyeRegionsBounds, FACE_CENTER_VERTICAL_OFFSET, FACE_CROP_OUTPUT_SIZE, FEEDBACK_MESSAGES, FRAME_BUFFER_CONFIG, FRAME_CONFIG, type FaceAlignmentResult, type FaceBoundingBox, type FaceDetectionTiers, type FaceInOvalResult, type FaceLandmarkPoint, type FaceRollResult, type FaceVisibilityResult, type FastCheckCropsRequest, type FastCheckModel, type FastCheckRequest, type FastCheckResponse, type FastCheckStreamRequest, type FastCheckStreamResponse, type FeedbackLocale, type FeedbackMessageKey, type Frame, FrameBuffer, type FrameData, type FrameQualityResult, FrameQueue, type FrameSource, GOOD_ALIGNMENT, type GazeThresholds, HIGH_ALIGNMENT, HYBRID_MODEL_CONFIGS, type HandOcclusionConfig, type HeadPose, type HealthResponse, type Hybrid150CheckRequest, type Hybrid50CheckRequest, type HybridCheckRequest, type HybridCheckResponse, type HybridFrameData, type HybridModelConfig, IDEAL_CROP_MULTIPLIER, type JobStatus, type JobStatusResponse, LANDMARK_INDEX, LANDMARK_MAX_BOUND, LANDMARK_MIN_BOUND, LOW_LIGHT_THRESHOLD, type LandmarkValidationResult, type LightingAnalysis, LivenessApiError, type LivenessCallbacks, LivenessClient, type LivenessClientConfig, type LivenessConfig, type LivenessResult, type LivenessState, MAX_CROP_MULTIPLIER, MAX_FACE_PERCENTAGE_IN_CROP, MAX_FACE_RATIO, MAX_FACE_ROLL_DEGREES, MAX_IDEAL_FACE_RATIO, MIN_CAPTURE_ALIGNMENT, MIN_CROP_MULTIPLIER, MIN_FACE_BOTTOM_MARGIN, MIN_FACE_RATIO, MIN_FACE_SIDE_MARGIN, MIN_FACE_TOP_MARGIN, MIN_IDEAL_FACE_RATIO, MIN_LANDMARK_COUNT, MODEL_CONFIGS, type ModelConfig, type ModelEntry, type ModelType, type ModelsResponse, OVAL_GUIDE_COLORS, OVAL_GUIDE_STYLES, OVAL_REGION_DESKTOP, OVAL_REGION_MOBILE, type OnErrorCallback, type OnFrameCapturedCallback, type OnProgressCallback, type OnResultCallback, type OnStateChangeCallback, type OvalGuideState, type OvalRegion, type QueueStatsResponse, RETRY_CONFIG, type RetryOptions, type StabilizationProgress, type StabilizationResult, type StabilizerConfig, type StatusMessageKey, type StreamingStatus, TARGET_FACE_PERCENTAGE_IN_CROP, type Verdict, type VerifyRequest, type VerifyResponse, type VideoFrameMetadata, analyzeBlur, analyzeEyeRegionBrightness, analyzeEyeRegionContrast, analyzeLighting, calculateAdaptiveCropMultiplier, calculateBrightness, calculateFaceAlignment, calculateFaceCropRegion, canCaptureFrame, checkEyeRegionQuality, checkFrameQuality, decodeBase64, detectCameraAngle, detectFaceRoll, detectSpecularHighlights, encodeBase64, generateSessionId, getActiveModels, getApiErrorMessage, getCaptureQualityFeedback, getEyeRegionBounds, getFeedbackMessage, getMinFramesForModel, getOvalGuideState, getStatusMessage, hasEnoughFrames, isDeprecatedModel, isFaceCropFullyInFrame, isFaceFullyVisible, isFaceInOval, isRetryableError, retryWithBackoff, rgbaToGrayscale, sleep, toFrameData, toHybridFrameData, toLivenessResult, toLivenessResultFromStream, validateApiKey, validateFaceLandmarks, validateFrameCount, validateFrameData, validateFrameIndex, validateTimestamp, validateUUID, validateUrl };
|
|
841
|
+
export { ALIGNMENT_THRESHOLD_CAPTURE, ALIGNMENT_THRESHOLD_GOOD, ALIGNMENT_THRESHOLD_PERFECT, ALIGNMENT_THRESHOLD_POOR, API_ENDPOINTS, API_ERROR_CODES, API_PATHS, AUTH_CONFIG, type ApiErrorCode, BACKLIT_RATIO_THRESHOLD, BLUR_THRESHOLD_MOBILE, BaseFrameCollector, type BlurAnalysis, CAMERA_ANGLE_HIGH_RATIO, CAMERA_ANGLE_LOW_RATIO, type CameraAngleResult, type CaptureQualityState, type CapturedFrame, type CropData, DEFAULT_BLUR_THRESHOLD, DEFAULT_ENDPOINT, DEFAULT_FACE_DETECTION_TIERS, DEFAULT_GAZE_THRESHOLDS, DEFAULT_HAND_OCCLUSION_CONFIG, DEFAULT_LIVENESS_CONFIG, DEFAULT_LOCALE, DEFAULT_OVAL_REGION, DEFAULT_STABILIZER_CONFIG, DEFAULT_STATUS_MESSAGES, type DeprecationInfo, type DetectionResult, type DetectionSummary, type DetectorConfig, ERROR_MESSAGES, ERROR_MESSAGES_ES, ES_LOCALE, EYE_LANDMARK_INDICES, EYE_QUALITY_THRESHOLDS, type ErrorResponse, type EyeQualityThresholds, type EyeRegionBounds, type EyeRegionQuality, type EyeRegionsBounds, FACE_CENTER_VERTICAL_OFFSET, FACE_CROP_OUTPUT_SIZE, FEEDBACK_MESSAGES, FRAME_BUFFER_CONFIG, FRAME_CONFIG, type FaceAlignmentResult, type FaceBoundingBox, type FaceDetectionTiers, type FaceInOvalResult, type FaceLandmarkPoint, type FaceRollResult, type FaceVisibilityResult, type FastCheckCropsRequest, type FastCheckModel, type FastCheckRequest, type FastCheckResponse, type FastCheckStreamRequest, type FastCheckStreamResponse, type FeedbackLocale, type FeedbackMessageKey, type Frame, FrameBuffer, type FrameData, type FrameQualityResult, FrameQueue, type FrameSource, GOOD_ALIGNMENT, type GazeThresholds, HIGH_ALIGNMENT, HYBRID_MODEL_CONFIGS, type HandOcclusionConfig, type HeadPose, type HealthResponse, type Hybrid150CheckRequest, type Hybrid50CheckRequest, type HybridCheckRequest, type HybridCheckResponse, type HybridFrameData, type HybridModelConfig, IDEAL_CROP_MULTIPLIER, type JobStatus, type JobStatusResponse, LANDMARK_INDEX, LANDMARK_MAX_BOUND, LANDMARK_MIN_BOUND, LOW_LIGHT_THRESHOLD, type LandmarkValidationResult, type LightingAnalysis, LivenessApiError, type LivenessCallbacks, LivenessClient, type LivenessClientConfig, type LivenessConfig, type LivenessResult, type LivenessState, MAX_CROP_MULTIPLIER, MAX_FACE_PERCENTAGE_IN_CROP, MAX_FACE_RATIO, MAX_FACE_ROLL_DEGREES, MAX_IDEAL_FACE_RATIO, MIN_CAPTURE_ALIGNMENT, MIN_CROP_MULTIPLIER, MIN_FACE_AREA_RATIO, MIN_FACE_BOTTOM_MARGIN, MIN_FACE_RATIO, MIN_FACE_SIDE_MARGIN, MIN_FACE_TOP_MARGIN, MIN_IDEAL_FACE_RATIO, MIN_LANDMARK_COUNT, MODEL_CONFIGS, type ModelConfig, type ModelEntry, type ModelType, type ModelVersion, type ModelsResponse, OVAL_GUIDE_COLORS, OVAL_GUIDE_STYLES, OVAL_REGION_DESKTOP, OVAL_REGION_MOBILE, type OnErrorCallback, type OnFrameCapturedCallback, type OnProgressCallback, type OnResultCallback, type OnStateChangeCallback, type OvalGuideState, type OvalRegion, type QueueStatsResponse, RETRY_CONFIG, type RetryOptions, type StabilizationProgress, type StabilizationResult, type StabilizerConfig, type StatusMessageKey, type StreamingStatus, TARGET_FACE_PERCENTAGE_IN_CROP, VALID_FRAME_COUNTS, type Verdict, type VerifyRequest, type VerifyResponse, type VideoFrameMetadata, analyzeBlur, analyzeEyeRegionBrightness, analyzeEyeRegionContrast, analyzeLighting, calculateAdaptiveCropMultiplier, calculateBrightness, calculateFaceAlignment, calculateFaceCropRegion, canCaptureFrame, checkEyeRegionQuality, checkFrameQuality, decodeBase64, detectCameraAngle, detectFaceRoll, detectSpecularHighlights, encodeBase64, generateSessionId, getActiveModels, getApiErrorMessage, getCaptureQualityFeedback, getEyeRegionBounds, getFeedbackMessage, getMinFramesForModel, getOvalGuideState, getStatusMessage, hasEnoughFrames, isDeprecatedModel, isFaceCropFullyInFrame, isFaceFullyVisible, isFaceInOval, isRetryableError, retryWithBackoff, rgbaToGrayscale, sleep, toFrameData, toHybridFrameData, toLivenessResult, toLivenessResultFromStream, validateApiKey, validateFaceLandmarks, validateFrameCount, validateFrameData, validateFrameIndex, validateTimestamp, validateUUID, validateUrl };
|