@incodetech/core 2.0.0-rc.0 → 2.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/package.json +3 -3
- package/dist/Actor-CI32dTbG.d.ts +0 -2
- package/dist/BaseWasmProvider-C_DLEI40.esm.js +0 -1118
- package/dist/BrowserStorageProvider-CuOW1Er2.esm.js +0 -55
- package/dist/BrowserTimerProvider-DhNc_x02.esm.js +0 -22
- package/dist/ITimerCapability-C67ZRskg.esm.js +0 -7
- package/dist/IpifyProvider-D7jx52AL.esm.js +0 -139
- package/dist/Manager-C8PrhBOx.d.ts +0 -19
- package/dist/MotionSensorProvider-4v7xkqAp.esm.js +0 -254
- package/dist/OpenViduRecordingProvider-CMu6XVdc.esm.js +0 -87
- package/dist/StateMachine-BCQrZJhf.d.ts +0 -2
- package/dist/WasmUtilProvider-j98OJf-S.esm.js +0 -114
- package/dist/addressSearch-BpTbTWCa.esm.js +0 -430
- package/dist/ae-signature-DDDZmWXj.esm.js +0 -12
- package/dist/ae-signature.d.ts +0 -25
- package/dist/ae-signature.esm.js +0 -8
- package/dist/antifraud.d.ts +0 -57
- package/dist/antifraud.esm.js +0 -45
- package/dist/antifraudStateMachine-O0TMf6yc.esm.js +0 -39
- package/dist/api-CESGtpbH.esm.js +0 -53
- package/dist/authentication.d.ts +0 -12
- package/dist/authentication.esm.js +0 -25
- package/dist/authenticationManager-5M-fKzXx.esm.js +0 -67
- package/dist/authenticationManager-C83GNIhl.d.ts +0 -66
- package/dist/authenticationStateMachine-BMZqatiF.esm.js +0 -139
- package/dist/backCameraStream-DMdMeGk2.esm.js +0 -346
- package/dist/browserSimulation-gxD8cSpM.esm.js +0 -20
- package/dist/camera-DBSxa6ML.d.ts +0 -4
- package/dist/camera-PA2Ljri3.esm.js +0 -22
- package/dist/camera.d.ts +0 -15
- package/dist/camera.esm.js +0 -5
- package/dist/chunk-CRF6K_H_.esm.js +0 -49
- package/dist/consent.d.ts +0 -398
- package/dist/consent.esm.js +0 -79
- package/dist/consentStateMachine-CCT-B60O.esm.js +0 -151
- package/dist/cpf-PPz2Njto.esm.js +0 -38
- package/dist/cpf-ocr.d.ts +0 -204
- package/dist/cpf-ocr.esm.js +0 -177
- package/dist/cross-document-data-match.d.ts +0 -34
- package/dist/cross-document-data-match.esm.js +0 -71
- package/dist/curp-validation.d.ts +0 -188
- package/dist/curp-validation.esm.js +0 -110
- package/dist/curpValidationStateMachine-CitWLr2c.esm.js +0 -595
- package/dist/custom-fields.d.ts +0 -115
- package/dist/custom-fields.esm.js +0 -177
- package/dist/custom-watchlist.d.ts +0 -66
- package/dist/custom-watchlist.esm.js +0 -86
- package/dist/dateUtils-UoN5xswP.esm.js +0 -23
- package/dist/deepsightLoader-Cm4JIT_z.esm.js +0 -52
- package/dist/deepsightService-CEVxzehb.d.ts +0 -412
- package/dist/deepsightService-O74l4Y__.esm.js +0 -489
- package/dist/device.d.ts +0 -46
- package/dist/device.esm.js +0 -106
- package/dist/displayErrors-DqJ_IbsG.d.ts +0 -39
- package/dist/document-capture.d.ts +0 -906
- package/dist/document-capture.esm.js +0 -156
- package/dist/document-upload.d.ts +0 -331
- package/dist/document-upload.esm.js +0 -203
- package/dist/documentCaptureStateMachine-BqzTDy9k.esm.js +0 -394
- package/dist/dynamic-forms.d.ts +0 -178
- package/dist/dynamic-forms.esm.js +0 -323
- package/dist/ekyb.d.ts +0 -148
- package/dist/ekyb.esm.js +0 -127
- package/dist/ekybStateMachine-B59rQjgj.esm.js +0 -674
- package/dist/ekyc.d.ts +0 -164
- package/dist/ekyc.esm.js +0 -104
- package/dist/ekycStateMachine-oeO0Iekd.esm.js +0 -10626
- package/dist/electronic-signature.d.ts +0 -4
- package/dist/electronic-signature.esm.js +0 -7
- package/dist/electronicSignatureManager-D9OHzTpG.esm.js +0 -428
- package/dist/email.d.ts +0 -4
- package/dist/email.esm.js +0 -9
- package/dist/emailManager-DIfnS5g1.d.ts +0 -352
- package/dist/emailManager-wAV0LE-H.esm.js +0 -238
- package/dist/emailStateMachine-DOf4j58N.esm.js +0 -292
- package/dist/endpoints-CnN3SyDa.esm.js +0 -87
- package/dist/events-D6-e4vok.esm.js +0 -596
- package/dist/events.d.ts +0 -265
- package/dist/events.esm.js +0 -4
- package/dist/extensibility.d.ts +0 -122
- package/dist/extensibility.esm.js +0 -43
- package/dist/face-match.d.ts +0 -228
- package/dist/face-match.esm.js +0 -173
- package/dist/faceCaptureManagerFactory-Dh2PdGlF.esm.js +0 -290
- package/dist/faceCaptureManagerFactory-yqtpxjnN.d.ts +0 -690
- package/dist/faceCaptureSetup-B3faSpYA.esm.js +0 -873
- package/dist/faceMatchStateMachine-DNFrxTFS.esm.js +0 -127
- package/dist/flow-events.d.ts +0 -6
- package/dist/flow-events.esm.js +0 -0
- package/dist/flow.d.ts +0 -358
- package/dist/flow.esm.js +0 -825
- package/dist/flowCompletionService-DhkT4SRY.d.ts +0 -10
- package/dist/flowCompletionService-P54yzGvA.esm.js +0 -13
- package/dist/flowServices-DTsm-Vf1.esm.js +0 -188
- package/dist/geolocation.d.ts +0 -127
- package/dist/geolocation.esm.js +0 -89
- package/dist/geolocationStateMachine-asasuHY2.esm.js +0 -105
- package/dist/getBrowser-BSXUTWXw.esm.js +0 -41
- package/dist/getDeviceClass-BSntT9_j.esm.js +0 -14
- package/dist/government-validation.d.ts +0 -67
- package/dist/government-validation.esm.js +0 -81
- package/dist/governmentValidationStateMachine-BDDYrJTo.esm.js +0 -271
- package/dist/home.d.ts +0 -99
- package/dist/home.esm.js +0 -61
- package/dist/http.d.ts +0 -68
- package/dist/http.esm.js +0 -3
- package/dist/id-ocr.d.ts +0 -635
- package/dist/id-ocr.esm.js +0 -86
- package/dist/id-verification.d.ts +0 -190
- package/dist/id-verification.esm.js +0 -43
- package/dist/id.d.ts +0 -24
- package/dist/id.esm.js +0 -164
- package/dist/idCaptureManager-B9TGA5dq.d.ts +0 -956
- package/dist/idCaptureManager-DMK0GIt3.esm.js +0 -581
- package/dist/idCaptureStateMachine-Bq0fVZXl.esm.js +0 -2954
- package/dist/idOcrStateMachine-YbjjC_Gg.esm.js +0 -388
- package/dist/idVerificationStateMachine-xbw9HP1Z.esm.js +0 -71
- package/dist/identity-reuse.d.ts +0 -530
- package/dist/identity-reuse.esm.js +0 -274
- package/dist/index-BLKtMA0g.d.ts +0 -1177
- package/dist/index-BcRG8rtJ.d.ts +0 -97
- package/dist/index.d.ts +0 -3
- package/dist/index.esm.js +0 -12
- package/dist/invokeOnCaptureCallback-rc6kBHo5.esm.js +0 -30
- package/dist/lib-BB0B_qQX.esm.js +0 -12499
- package/dist/mandatory-consent.d.ts +0 -412
- package/dist/mandatory-consent.esm.js +0 -78
- package/dist/mandatoryConsentStateMachine-Cnco1jvn.esm.js +0 -126
- package/dist/openviduLazy-Cm0XFh_v.esm.js +0 -3
- package/dist/openviduLazy-Cok70ZSg.esm.js +0 -12
- package/dist/permissionServices-D_i6nzEw.esm.js +0 -50
- package/dist/phone.d.ts +0 -4
- package/dist/phone.esm.js +0 -9
- package/dist/phoneManager-B6M30hKE.d.ts +0 -397
- package/dist/phoneManager-DAJbGhlY.esm.js +0 -256
- package/dist/phoneStateMachine-CuPARRaT.esm.js +0 -351
- package/dist/platform-CfrjKhmi.esm.js +0 -83
- package/dist/qe-signature-DFo_Cc-I.esm.js +0 -12
- package/dist/qe-signature.d.ts +0 -25
- package/dist/qe-signature.esm.js +0 -8
- package/dist/recordingService-Ig2UgbLv.esm.js +0 -1003
- package/dist/redirect-to-mobile.d.ts +0 -107
- package/dist/redirect-to-mobile.esm.js +0 -102
- package/dist/redirectToMobileStateMachine-BOEqe46A.esm.js +0 -249
- package/dist/runChildModule-CqqwqAkW.esm.js +0 -219
- package/dist/selfie.d.ts +0 -26
- package/dist/selfie.esm.js +0 -146
- package/dist/selfieManager-D0lSgd-J.d.ts +0 -68
- package/dist/selfieManager-Duisl7qN.esm.js +0 -60
- package/dist/selfieStateMachine-D76whWEf.esm.js +0 -68
- package/dist/session-BS-d_vuE.esm.js +0 -3206
- package/dist/session.d.ts +0 -217
- package/dist/session.esm.js +0 -9
- package/dist/setup-Buy-hyj4.esm.js +0 -887
- package/dist/setup-C5AITV8m.d.ts +0 -254
- package/dist/signature.d.ts +0 -94
- package/dist/signature.esm.js +0 -66
- package/dist/signatureStateMachine-B5-QVUve.esm.js +0 -132
- package/dist/stats-CIfiPzb1.esm.js +0 -16
- package/dist/stats.d.ts +0 -16
- package/dist/stats.esm.js +0 -4
- package/dist/trust-graph.d.ts +0 -54
- package/dist/trust-graph.esm.js +0 -56
- package/dist/types-B06Ypu2F.d.ts +0 -49
- package/dist/types-BP1m8VRw.d.ts +0 -340
- package/dist/types-CAD4va6a.d.ts +0 -5
- package/dist/types-CFV9G_7j.d.ts +0 -24
- package/dist/warmup-CEcppFiS.d.ts +0 -63
- package/dist/wasm.d.ts +0 -15
- package/dist/wasm.esm.js +0 -12
- package/dist/watchlist-for-business.d.ts +0 -79
- package/dist/watchlist-for-business.esm.js +0 -148
- package/dist/watchlist.d.ts +0 -62
- package/dist/watchlist.esm.js +0 -86
- package/dist/watchlistServices-DMbUhkBX.esm.js +0 -12
- package/dist/workflow.d.ts +0 -907
- package/dist/workflow.esm.js +0 -702
- package/dist/xstate.esm-B70JrNqo.esm.js +0 -3404
|
@@ -1,690 +0,0 @@
|
|
|
1
|
-
import { n as WasmPipeline } from "./warmup-CEcppFiS.js";
|
|
2
|
-
import { t as Manager } from "./Manager-C8PrhBOx.js";
|
|
3
|
-
import { t as ActorRefFrom } from "./Actor-CI32dTbG.js";
|
|
4
|
-
import { n as StateMachine, t as AnyStateMachine } from "./StateMachine-BCQrZJhf.js";
|
|
5
|
-
import { t as CameraStream } from "./camera-DBSxa6ML.js";
|
|
6
|
-
import { i as FlowModuleConfig, n as Flow } from "./types-BP1m8VRw.js";
|
|
7
|
-
import { a as IWasmUtilCapability, c as IMLProviderCapability, d as IRecordingCapability, i as IncodeCanvas, l as MLProviderConfig, r as StreamCanvasCapture, t as DeepsightService, u as IStorageCapability } from "./deepsightService-CEVxzehb.js";
|
|
8
|
-
import { n as PermissionStatus, t as PermissionResult } from "./types-CAD4va6a.js";
|
|
9
|
-
|
|
10
|
-
//#region src/modules/authentication/authenticationStateMachine.d.ts
|
|
11
|
-
declare const _authenticationMachine: AnyStateMachine;
|
|
12
|
-
type AuthenticationMachine = typeof _authenticationMachine;
|
|
13
|
-
declare const authenticationMachine: AnyStateMachine;
|
|
14
|
-
//#endregion
|
|
15
|
-
//#region src/internal/faceCapture/types.d.ts
|
|
16
|
-
type CameraResolution = {
|
|
17
|
-
width?: number;
|
|
18
|
-
height?: number;
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* Rich captured face payload delivered via `onCapture` in the selfie
|
|
22
|
-
* captureOnly flow.
|
|
23
|
-
*/
|
|
24
|
-
type FaceCapturedImageData = {
|
|
25
|
-
imageBase64: string;
|
|
26
|
-
blob: Blob;
|
|
27
|
-
url: string;
|
|
28
|
-
metadata: string;
|
|
29
|
-
/**
|
|
30
|
-
* Populated when local video recording is active
|
|
31
|
-
* (`enableFaceRecording === true` with `LocalRecordingService`).
|
|
32
|
-
* `undefined` when video recording is disabled, when the provider is
|
|
33
|
-
* OpenVidu (remote server-side recording), or when video assembly fails.
|
|
34
|
-
*
|
|
35
|
-
* Delivered as raw base64 (not encrypted via WASM `ens()` like the regular
|
|
36
|
-
* flow). Integrators receiving this are responsible for handling it as
|
|
37
|
-
* sensitive biometric data.
|
|
38
|
-
*/
|
|
39
|
-
videoBase64: string | undefined;
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* Payload delivered to `SelfieCaptureOnlyConfig.onCapture`.
|
|
43
|
-
*/
|
|
44
|
-
type FaceCaptureOnlyResponse = {
|
|
45
|
-
image: FaceCapturedImageData;
|
|
46
|
-
};
|
|
47
|
-
type BaseFaceCaptureConfig = {
|
|
48
|
-
showTutorial: boolean;
|
|
49
|
-
showPreview?: boolean;
|
|
50
|
-
assistedOnboarding?: boolean;
|
|
51
|
-
enableFaceRecording?: boolean;
|
|
52
|
-
autoCaptureTimeout: number;
|
|
53
|
-
captureAttempts?: number;
|
|
54
|
-
numberOfAttempts?: number;
|
|
55
|
-
validateLenses?: boolean;
|
|
56
|
-
validateFaceMask?: boolean;
|
|
57
|
-
validateHeadCover?: boolean;
|
|
58
|
-
validateClosedEyes?: boolean;
|
|
59
|
-
validateBrightness?: boolean;
|
|
60
|
-
deepsightLiveness?: 'SINGLE_FRAME' | 'MULTIMODAL' | 'VIDEOLIVENESS';
|
|
61
|
-
cameraResolution?: CameraResolution;
|
|
62
|
-
ageAssurance?: boolean;
|
|
63
|
-
recording?: {
|
|
64
|
-
capability?: IRecordingCapability;
|
|
65
|
-
};
|
|
66
|
-
ds?: Flow['ds'];
|
|
67
|
-
/**
|
|
68
|
-
* When true, face analysis runs on-device via the OnDevice WASM workflow
|
|
69
|
-
* (6 models) and only the results JSON is submitted to the backend
|
|
70
|
-
* (`/omni/add/face-results`). Recording is skipped entirely. Used by both
|
|
71
|
-
* SELFIE and AUTHENTICATION modules.
|
|
72
|
-
*/
|
|
73
|
-
onDeviceFaceResultsSubmissionEnabled?: boolean;
|
|
74
|
-
};
|
|
75
|
-
type FaceCaptureDependencies = {
|
|
76
|
-
storage: IStorageCapability;
|
|
77
|
-
getWasmUtil: () => Promise<IWasmUtilCapability>;
|
|
78
|
-
trackCaptureAttemptFinished?: (payload: {
|
|
79
|
-
logs: string;
|
|
80
|
-
}) => void;
|
|
81
|
-
};
|
|
82
|
-
type DetectionStatus = 'idle' | 'detecting' | 'noFace' | 'tooManyFaces' | 'tooClose' | 'tooFar' | 'blur' | 'dark' | 'tooBright' | 'faceAngle' | 'lookAtCamera' | 'headWear' | 'lenses' | 'eyesClosed' | 'faceMask' | 'faceOcclusion' | 'centerFace' | 'moveLeft' | 'moveRight' | 'manualCapture' | 'success' | 'error' | 'capturing' | 'getReady' | 'getReadyFinished' | 'offline';
|
|
83
|
-
declare const FACE_ERROR_CODES: {
|
|
84
|
-
readonly FACE_OCCLUDED: "FACE_OCCLUDED";
|
|
85
|
-
readonly LIVENESS: "LIVENESS_ERROR";
|
|
86
|
-
readonly BRIGHTNESS: "BRIGHTNESS_ERROR";
|
|
87
|
-
readonly LENSES: "LENSES_ERROR";
|
|
88
|
-
readonly MASK: "MASK_ERROR";
|
|
89
|
-
readonly CLOSED_EYES: "CLOSED_EYES_ERROR";
|
|
90
|
-
readonly HEAD_COVER: "HEAD_COVER_ERROR";
|
|
91
|
-
readonly SERVER: "SERVER_ERROR";
|
|
92
|
-
readonly FACE_NOT_FOUND: "FACE_NOT_FOUND";
|
|
93
|
-
readonly MULTIPLE_FACES: "MULTIPLE_FACES";
|
|
94
|
-
readonly TOO_BLURRY: "TOO_BLURRY_ERROR";
|
|
95
|
-
readonly TOO_DARK: "TOO_DARK_ERROR";
|
|
96
|
-
readonly USER_IS_NOT_RECOGNIZED: "USER_IS_NOT_RECOGNIZED";
|
|
97
|
-
readonly SPOOF_ATTEMPT_DETECTED: "SPOOF_ATTEMPT_DETECTED";
|
|
98
|
-
readonly FACE_TOO_DARK: "FACE_TOO_DARK";
|
|
99
|
-
readonly LENSES_DETECTED: "LENSES_DETECTED";
|
|
100
|
-
readonly FACE_MASK_DETECTED: "FACE_MASK_DETECTED";
|
|
101
|
-
readonly CLOSED_EYES_DETECTED: "CLOSED_EYES_DETECTED";
|
|
102
|
-
readonly HEAD_COVER_DETECTED: "HEAD_COVER_DETECTED";
|
|
103
|
-
readonly FACE_CROPPING_FAILED: "FACE_CROPPING_FAILED";
|
|
104
|
-
readonly FACE_TOO_SMALL: "FACE_TOO_SMALL";
|
|
105
|
-
readonly FACE_TOO_BLURRY: "FACE_TOO_BLURRY";
|
|
106
|
-
readonly BAD_PHOTO_QUALITY: "BAD_PHOTO_QUALITY";
|
|
107
|
-
readonly PROCESSING_ERROR: "PROCESSING_ERROR";
|
|
108
|
-
readonly BAD_REQUEST: "BAD_REQUEST";
|
|
109
|
-
readonly NONEXISTENT_CUSTOMER: "NONEXISTENT_CUSTOMER";
|
|
110
|
-
readonly HINT_NOT_PROVIDED: "HINT_NOT_PROVIDED";
|
|
111
|
-
readonly SELFIE_IMAGE_LOW_QUALITY: "SELFIE_IMAGE_LOW_QUALITY";
|
|
112
|
-
};
|
|
113
|
-
type FaceErrorCode = (typeof FACE_ERROR_CODES)[keyof typeof FACE_ERROR_CODES];
|
|
114
|
-
//#endregion
|
|
115
|
-
//#region src/modules/authentication/types.d.ts
|
|
116
|
-
type AuthenticationConfig = FlowModuleConfig['AUTHENTICATION'] & BaseFaceCaptureConfig;
|
|
117
|
-
//#endregion
|
|
118
|
-
//#region src/modules/authentication/authenticationActor.d.ts
|
|
119
|
-
type CreateAuthenticationActorOptions = {
|
|
120
|
-
config: AuthenticationConfig;
|
|
121
|
-
dependencies?: FaceCaptureDependencies;
|
|
122
|
-
authHint?: string;
|
|
123
|
-
};
|
|
124
|
-
type AuthenticationActor = ActorRefFrom<AuthenticationMachine>;
|
|
125
|
-
declare function createAuthenticationActor(options: CreateAuthenticationActorOptions): AuthenticationActor;
|
|
126
|
-
//#endregion
|
|
127
|
-
//#region ../infra/src/wasm/wasmWebClient.d.ts
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Configuration shape that the C++ `WebApi` passes when calling `.post(...)`
|
|
131
|
-
* on its host JS adapter. Mirrors the upstream `ml-wasm-kit/WebClient`
|
|
132
|
-
* `RequestConfig` for the subset of fields actually set by `WebApi`.
|
|
133
|
-
*/
|
|
134
|
-
type WebApiHostRequestConfig = {
|
|
135
|
-
ie?: boolean;
|
|
136
|
-
headers?: Record<string, string>;
|
|
137
|
-
params?: Record<string, string | number | boolean | undefined>;
|
|
138
|
-
timeout?: number;
|
|
139
|
-
};
|
|
140
|
-
//#endregion
|
|
141
|
-
//#region ../infra/src/capabilities/IFaceDetectionCapability.d.ts
|
|
142
|
-
/**
|
|
143
|
-
* Configuration for face detection provider.
|
|
144
|
-
* Extends base ML provider config with face-detection specific options.
|
|
145
|
-
*/
|
|
146
|
-
interface FaceDetectionConfig extends MLProviderConfig {
|
|
147
|
-
autocaptureInterval?: number;
|
|
148
|
-
/**
|
|
149
|
-
* Load the on-device selfie workflow (6 models including liveness + age
|
|
150
|
-
* estimation) instead of the default selfie workflow (4 models). Required
|
|
151
|
-
* when SELFIE/AUTHENTICATION has `onDeviceFaceResultsSubmissionEnabled`.
|
|
152
|
-
*/
|
|
153
|
-
useOnDeviceWorkflow?: boolean;
|
|
154
|
-
}
|
|
155
|
-
interface FacePositionConstraints {
|
|
156
|
-
minX: number;
|
|
157
|
-
minY: number;
|
|
158
|
-
maxX: number;
|
|
159
|
-
maxY: number;
|
|
160
|
-
}
|
|
161
|
-
interface FaceDetectionThresholds {
|
|
162
|
-
brightnessThreshold: number;
|
|
163
|
-
blurrinessThreshold: number;
|
|
164
|
-
tiltRotationAngleThreshold: number;
|
|
165
|
-
minMagicCropSize: number;
|
|
166
|
-
autocaptureInterval: number;
|
|
167
|
-
minFaceQualityScore: number;
|
|
168
|
-
faceOcclusionThreshold: number;
|
|
169
|
-
/**
|
|
170
|
-
* Milliseconds the C++ workflow waits after `onGetReady` fires before
|
|
171
|
-
* triggering autocapture. Mirrors V1's `getReadyDelay` (2000 ms) — without
|
|
172
|
-
* it, autocapture can fire on the first quality-passing frame, before the
|
|
173
|
-
* front camera has finished locking focus, producing blurry captures that
|
|
174
|
-
* the on-device quality model rejects.
|
|
175
|
-
*/
|
|
176
|
-
getReadyDelay: number;
|
|
177
|
-
/**
|
|
178
|
-
* Milliseconds over which face-detection results are aggregated before the
|
|
179
|
-
* autocapture decision. Mirrors V1's `framesAggregationInterval` (2000 ms).
|
|
180
|
-
*/
|
|
181
|
-
framesAggregationInterval: number;
|
|
182
|
-
/**
|
|
183
|
-
* Minimum consecutive frames with a detected face required before
|
|
184
|
-
* autocapture can trigger. Mirrors V1's `minFramesWithFace` (3).
|
|
185
|
-
*/
|
|
186
|
-
minFramesWithFace: number;
|
|
187
|
-
}
|
|
188
|
-
interface FaceAttributesThresholds {
|
|
189
|
-
headwearThreshold: number;
|
|
190
|
-
lensesThreshold: number;
|
|
191
|
-
closedEyesThreshold: number;
|
|
192
|
-
maskThreshold: number;
|
|
193
|
-
}
|
|
194
|
-
interface FaceChecksConfig {
|
|
195
|
-
lenses: boolean;
|
|
196
|
-
mask: boolean;
|
|
197
|
-
closedEyes: boolean;
|
|
198
|
-
headWear: boolean;
|
|
199
|
-
occlusion: boolean;
|
|
200
|
-
}
|
|
201
|
-
type FaceCoordinates = {
|
|
202
|
-
rightEyeX: number;
|
|
203
|
-
rightEyeY: number;
|
|
204
|
-
leftEyeX: number;
|
|
205
|
-
leftEyeY: number;
|
|
206
|
-
noseTipX: number;
|
|
207
|
-
noseTipY: number;
|
|
208
|
-
rightMouthX: number;
|
|
209
|
-
rightMouthY: number;
|
|
210
|
-
mouthX: number;
|
|
211
|
-
mouthY: number;
|
|
212
|
-
x: number;
|
|
213
|
-
y: number;
|
|
214
|
-
width: number;
|
|
215
|
-
height: number;
|
|
216
|
-
};
|
|
217
|
-
interface FaceDetectionCallbacks {
|
|
218
|
-
onFarAway?: () => void;
|
|
219
|
-
onTooClose?: () => void;
|
|
220
|
-
onTooManyFaces?: () => void;
|
|
221
|
-
onNoFace?: () => void;
|
|
222
|
-
onCapture?: (canvas: IncodeCanvas, faceCoordinates: FaceCoordinates) => void;
|
|
223
|
-
onGetReady?: () => void;
|
|
224
|
-
onGetReadyFinished?: () => void;
|
|
225
|
-
onCenterFace?: () => void;
|
|
226
|
-
onDark?: () => void;
|
|
227
|
-
onBlur?: () => void;
|
|
228
|
-
onFaceAngle?: () => void;
|
|
229
|
-
onLenses?: () => void;
|
|
230
|
-
onMask?: () => void;
|
|
231
|
-
onEyesClosed?: () => void;
|
|
232
|
-
onHeadWear?: () => void;
|
|
233
|
-
onSwitchToManualCapture?: () => void;
|
|
234
|
-
onFaceOccluded?: () => void;
|
|
235
|
-
}
|
|
236
|
-
/**
|
|
237
|
-
* Capability interface for face detection and selfie capture.
|
|
238
|
-
* Extends the base ML provider capability with face-detection specific methods.
|
|
239
|
-
*/
|
|
240
|
-
interface IFaceDetectionCapability extends IMLProviderCapability<FaceDetectionConfig> {
|
|
241
|
-
/**
|
|
242
|
-
* Sets callbacks for face detection events.
|
|
243
|
-
* @param callbacks - Object containing callback functions for various detection events
|
|
244
|
-
*/
|
|
245
|
-
setCallbacks(callbacks: FaceDetectionCallbacks): void;
|
|
246
|
-
/**
|
|
247
|
-
* Sets position constraints for face detection.
|
|
248
|
-
* @param constraints - Bounding box constraints for valid face position
|
|
249
|
-
*/
|
|
250
|
-
setPositionConstraints(constraints: FacePositionConstraints): void;
|
|
251
|
-
/**
|
|
252
|
-
* Sets detection thresholds for quality checks.
|
|
253
|
-
* @param thresholds - Threshold values for various quality metrics
|
|
254
|
-
*/
|
|
255
|
-
setThresholds(thresholds: FaceDetectionThresholds): void;
|
|
256
|
-
/**
|
|
257
|
-
* Sets thresholds for face attribute detection.
|
|
258
|
-
* @param thresholds - Threshold values for attribute detection (headwear, lenses, etc.)
|
|
259
|
-
*/
|
|
260
|
-
setAttributesThresholds(thresholds: FaceAttributesThresholds): void;
|
|
261
|
-
/**
|
|
262
|
-
* Enables or disables specific face checks.
|
|
263
|
-
* @param config - Configuration for which checks to enable
|
|
264
|
-
*/
|
|
265
|
-
setChecksEnabled(config: FaceChecksConfig): void;
|
|
266
|
-
/**
|
|
267
|
-
* Sets video selfie mode.
|
|
268
|
-
* @param enabled - Whether to enable video selfie mode
|
|
269
|
-
*/
|
|
270
|
-
setVideoSelfieMode(enabled: boolean): void;
|
|
271
|
-
/**
|
|
272
|
-
* Synchronous manual-capture entry point for the on-device selfie workflow.
|
|
273
|
-
* Runs the full on-device pipeline on a single canvas image and stages the
|
|
274
|
-
* results inside WASM for the next {@link postFaceResults} call. No-op for
|
|
275
|
-
* default (non-on-device) configurations; callers should guard with the
|
|
276
|
-
* `onDeviceFaceResultsSubmissionEnabled` flag.
|
|
277
|
-
*/
|
|
278
|
-
processPhoto(canvas: HTMLCanvasElement): void;
|
|
279
|
-
/**
|
|
280
|
-
* POSTs the staged on-device face-results JSON to `/omni/add/face-results`.
|
|
281
|
-
* The C++ side encrypts the body via `SessionEncryptor` and routes through
|
|
282
|
-
* the WASM `WebClient`, so the SDK's WebClient must be initialized first
|
|
283
|
-
* (consumers calling this must configure `setup({ apiURL, wasm })`).
|
|
284
|
-
*/
|
|
285
|
-
postFaceResults(config?: WebApiHostRequestConfig): Promise<unknown>;
|
|
286
|
-
}
|
|
287
|
-
//#endregion
|
|
288
|
-
//#region ../infra/src/wasm/WasmPipelineType.d.ts
|
|
289
|
-
declare enum WasmPipelineType {
|
|
290
|
-
IdBlurGlarePipeline = 0,
|
|
291
|
-
IdBarcodeAndTextQualityPipeline = 1,
|
|
292
|
-
IdVideoSelfiePipeline = 2,
|
|
293
|
-
SelfieWithAggregationMetrics = 3,
|
|
294
|
-
SelfieWithQualityMetrics = 4,
|
|
295
|
-
OnDeviceSelfieWorkflow = 5,
|
|
296
|
-
}
|
|
297
|
-
//#endregion
|
|
298
|
-
//#region ../infra/src/providers/wasm/BaseWasmProvider.d.ts
|
|
299
|
-
/**
|
|
300
|
-
* Base configuration for WASM providers
|
|
301
|
-
*/
|
|
302
|
-
interface BaseWasmConfig {
|
|
303
|
-
/** Path to the WASM binary */
|
|
304
|
-
wasmPath?: string;
|
|
305
|
-
/** Path to the SIMD-optimized WASM binary (optional) */
|
|
306
|
-
wasmSimdPath?: string;
|
|
307
|
-
/** Path to the WASM glue code (paired with `wasmPath`) */
|
|
308
|
-
glueCodePath?: string;
|
|
309
|
-
/**
|
|
310
|
-
* Path to the SIMD-optimized WASM glue code (paired with `wasmSimdPath`).
|
|
311
|
-
* If omitted, defaults to a sibling `.js` derived from `wasmSimdPath`.
|
|
312
|
-
*/
|
|
313
|
-
glueCodeSimdPath?: string;
|
|
314
|
-
/** Whether to use SIMD optimizations (default: true) */
|
|
315
|
-
useSimd?: boolean;
|
|
316
|
-
/**
|
|
317
|
-
* Base path for ML model files. Models will be loaded from `${modelsBasePath}/${modelFileName}`.
|
|
318
|
-
* If not provided, models are expected in a 'models' subdirectory relative to the WASM binary.
|
|
319
|
-
*/
|
|
320
|
-
modelsBasePath?: string;
|
|
321
|
-
}
|
|
322
|
-
/**
|
|
323
|
-
* Base provider class that abstracts common WASM functionality.
|
|
324
|
-
* This serves as a foundation for specific ML capability providers
|
|
325
|
-
* like FaceDetectionProvider and IdCaptureProvider.
|
|
326
|
-
*/
|
|
327
|
-
declare abstract class BaseWasmProvider {
|
|
328
|
-
private _isInitialized;
|
|
329
|
-
protected pipelineType: WasmPipelineType | undefined;
|
|
330
|
-
/**
|
|
331
|
-
* Creates a new BaseWasmProvider
|
|
332
|
-
* @param pipelineType - The WASM pipeline type this provider uses
|
|
333
|
-
*/
|
|
334
|
-
constructor(pipelineType?: WasmPipelineType);
|
|
335
|
-
/**
|
|
336
|
-
* Returns whether this provider has been initialized.
|
|
337
|
-
*/
|
|
338
|
-
get initialized(): boolean;
|
|
339
|
-
protected getPipelineType(): WasmPipelineType;
|
|
340
|
-
/**
|
|
341
|
-
* Initializes the provider by ensuring WASM is loaded
|
|
342
|
-
* @param config - Provider configuration
|
|
343
|
-
* @param pipeline - The pipeline type to warm up ('selfie', 'idCapture', etc.)
|
|
344
|
-
*/
|
|
345
|
-
protected initializeBase(config: BaseWasmConfig, pipeline: WasmPipeline): Promise<void>;
|
|
346
|
-
/**
|
|
347
|
-
* Ensures the provider is initialized before performing operations.
|
|
348
|
-
* @throws Error if not initialized
|
|
349
|
-
*/
|
|
350
|
-
protected ensureInitialized(): void;
|
|
351
|
-
/**
|
|
352
|
-
* Processes a frame through the WASM pipeline
|
|
353
|
-
* @param image - Image data to process
|
|
354
|
-
* @returns The pipeline result (type depends on pipeline - WASM returns any)
|
|
355
|
-
*/
|
|
356
|
-
protected processFrameWasm(image: ImageData): Promise<any>;
|
|
357
|
-
abstract processFrame(image: ImageData): Promise<void>;
|
|
358
|
-
/**
|
|
359
|
-
* Resets the pipeline to its initial state.
|
|
360
|
-
* Safe to call even if not initialized (no-op in that case).
|
|
361
|
-
*/
|
|
362
|
-
reset(): void;
|
|
363
|
-
/**
|
|
364
|
-
* Disposes of resources and resets initialization state.
|
|
365
|
-
* Safe to call even if not initialized.
|
|
366
|
-
*/
|
|
367
|
-
dispose(): Promise<void>;
|
|
368
|
-
}
|
|
369
|
-
//#endregion
|
|
370
|
-
//#region ../infra/src/providers/wasm/FaceDetectionProvider.d.ts
|
|
371
|
-
declare class FaceDetectionProvider extends BaseWasmProvider implements IFaceDetectionCapability {
|
|
372
|
-
private defaultThresholds;
|
|
373
|
-
private currentThresholds;
|
|
374
|
-
private currentFrame;
|
|
375
|
-
constructor();
|
|
376
|
-
processFrame(image: ImageData): Promise<void>;
|
|
377
|
-
initialize(config: FaceDetectionConfig): Promise<void>;
|
|
378
|
-
processPhoto(canvas: HTMLCanvasElement): void;
|
|
379
|
-
postFaceResults(config?: WebApiHostRequestConfig): Promise<unknown>;
|
|
380
|
-
setCallbacks(callbacks: FaceDetectionCallbacks): void;
|
|
381
|
-
setPositionConstraints(constraints: FacePositionConstraints): void;
|
|
382
|
-
applyDefaults(autocaptureInterval?: number): void;
|
|
383
|
-
setAutocaptureInterval(interval: number): void;
|
|
384
|
-
setThresholds(thresholds: FaceDetectionThresholds): void;
|
|
385
|
-
setAttributesThresholds(thresholds: FaceAttributesThresholds): void;
|
|
386
|
-
setChecksEnabled(config: FaceChecksConfig): void;
|
|
387
|
-
setVideoSelfieMode(enabled: boolean): void;
|
|
388
|
-
reset(): void;
|
|
389
|
-
private createDefaultFaceCoordinates;
|
|
390
|
-
private formatFaceCoordinates;
|
|
391
|
-
}
|
|
392
|
-
//#endregion
|
|
393
|
-
//#region src/modules/selfie/types.d.ts
|
|
394
|
-
/**
|
|
395
|
-
* Public selfie configuration.
|
|
396
|
-
*
|
|
397
|
-
* For the captureOnly flow (delivering the captured image locally instead of
|
|
398
|
-
* uploading to Incode), use `createSelfieCaptureOnlyManager` with
|
|
399
|
-
* `SelfieCaptureOnlyConfig`.
|
|
400
|
-
*/
|
|
401
|
-
type SelfieConfig = FlowModuleConfig['SELFIE'] & BaseFaceCaptureConfig;
|
|
402
|
-
/**
|
|
403
|
-
* Public selfie configuration for the captureOnly flow.
|
|
404
|
-
*
|
|
405
|
-
* Differs from {@link SelfieConfig} by requiring an `onCapture` callback —
|
|
406
|
-
* captureOnly bypasses the Incode upload pipeline and delivers the rich
|
|
407
|
-
* capture payload locally instead. Compile-time enforcement (vs. a runtime
|
|
408
|
-
* check) prevents shipping a captureOnly flow with no destination for the
|
|
409
|
-
* payload.
|
|
410
|
-
*/
|
|
411
|
-
type SelfieCaptureOnlyConfig = SelfieConfig & {
|
|
412
|
-
onCapture: (response: FaceCaptureOnlyResponse) => void | Promise<void>;
|
|
413
|
-
};
|
|
414
|
-
type SelfieDependencies = FaceCaptureDependencies;
|
|
415
|
-
type SendFaceImageResponse = {
|
|
416
|
-
age: number;
|
|
417
|
-
confidence: number;
|
|
418
|
-
hasClosedEyes: boolean;
|
|
419
|
-
hasFaceMask: boolean;
|
|
420
|
-
hasHeadCover: boolean;
|
|
421
|
-
hasLenses: boolean;
|
|
422
|
-
isBright: boolean;
|
|
423
|
-
liveness: boolean;
|
|
424
|
-
imageBase64: string;
|
|
425
|
-
sessionStatus: string;
|
|
426
|
-
};
|
|
427
|
-
//#endregion
|
|
428
|
-
//#region src/internal/faceCapture/recordingService.d.ts
|
|
429
|
-
type RecordingService = {
|
|
430
|
-
start(stream: MediaStream): Promise<void>;
|
|
431
|
-
stop(): Promise<{
|
|
432
|
-
recordingId: string | null;
|
|
433
|
-
}>;
|
|
434
|
-
/**
|
|
435
|
-
* Stops the recorder and returns the raw (un-encrypted, not uploaded)
|
|
436
|
-
* video as base64. Used by the captureOnly flow, which hands video bytes
|
|
437
|
-
* to the integrator via `onCapture` instead of uploading to Incode.
|
|
438
|
-
*
|
|
439
|
-
* Returns `{ videoBase64: undefined }` when video is not available for
|
|
440
|
-
* any reason, including:
|
|
441
|
-
* - the recorder was never started or is already stopped,
|
|
442
|
-
* - the provider is server-side (e.g. OpenVidu) and the client never
|
|
443
|
-
* holds the bytes,
|
|
444
|
-
* - video assembly fails.
|
|
445
|
-
*/
|
|
446
|
-
stopAndGetVideo(): Promise<{
|
|
447
|
-
videoBase64: string | undefined;
|
|
448
|
-
}>;
|
|
449
|
-
cleanup(): void;
|
|
450
|
-
};
|
|
451
|
-
//#endregion
|
|
452
|
-
//#region src/internal/faceCapture/faceCaptureSetup.d.ts
|
|
453
|
-
type FaceCaptureConfig = BaseFaceCaptureConfig;
|
|
454
|
-
type FaceCaptureInput = {
|
|
455
|
-
config: FaceCaptureConfig;
|
|
456
|
-
dependencies: FaceCaptureDependencies;
|
|
457
|
-
authHint?: string;
|
|
458
|
-
};
|
|
459
|
-
type FaceErrorObject = {
|
|
460
|
-
type: string;
|
|
461
|
-
message: string;
|
|
462
|
-
};
|
|
463
|
-
type FaceCaptureContext = {
|
|
464
|
-
config: FaceCaptureConfig;
|
|
465
|
-
dependencies: FaceCaptureDependencies;
|
|
466
|
-
authHint: string | undefined;
|
|
467
|
-
stream: CameraStream | undefined;
|
|
468
|
-
provider: FaceDetectionProvider | undefined;
|
|
469
|
-
frameCapturer: StreamCanvasCapture | undefined;
|
|
470
|
-
error: string | FaceErrorObject | undefined;
|
|
471
|
-
detectionStatus: DetectionStatus;
|
|
472
|
-
debugFrame: ImageData | undefined;
|
|
473
|
-
capturedImage: IncodeCanvas | undefined;
|
|
474
|
-
faceCoordinates: FaceCoordinates | undefined;
|
|
475
|
-
uploadResponse: Record<string, unknown> | undefined;
|
|
476
|
-
processResponse: Record<string, unknown> | undefined;
|
|
477
|
-
recordingService: RecordingService | undefined;
|
|
478
|
-
attemptsRemaining: number;
|
|
479
|
-
uploadError: FaceErrorCode | undefined;
|
|
480
|
-
permissionResult: PermissionResult | 'refresh' | undefined;
|
|
481
|
-
resetDetection: (() => void) | undefined;
|
|
482
|
-
deepsightService: DeepsightService | undefined;
|
|
483
|
-
encryptedBase64Image: string | undefined;
|
|
484
|
-
uploadRecordingId: string | null | undefined;
|
|
485
|
-
manualCaptureTriggered: boolean;
|
|
486
|
-
/**
|
|
487
|
-
* Rich capture payload used only by the captureOnly variant. Populated by
|
|
488
|
-
* the variant's `.provide()` override of `setUploadResponseFromEvent`,
|
|
489
|
-
* which writes the `uploadFace` actor's output here instead of the loose
|
|
490
|
-
* `uploadResponse` channel. Consumed by the captureOnly manager on
|
|
491
|
-
* transition into `finished`. Remains `undefined` in the regular upload
|
|
492
|
-
* flow (the base action writes to `uploadResponse` and never touches this
|
|
493
|
-
* field).
|
|
494
|
-
*/
|
|
495
|
-
captureOnlyResult: FaceCapturedImageData | undefined;
|
|
496
|
-
};
|
|
497
|
-
type FaceCaptureEvent = {
|
|
498
|
-
type: 'LOAD';
|
|
499
|
-
} | {
|
|
500
|
-
type: 'NEXT_STEP';
|
|
501
|
-
} | {
|
|
502
|
-
type: 'REQUEST_PERMISSION';
|
|
503
|
-
} | {
|
|
504
|
-
type: 'GO_TO_LEARN_MORE';
|
|
505
|
-
} | {
|
|
506
|
-
type: 'BACK';
|
|
507
|
-
} | {
|
|
508
|
-
type: 'QUIT';
|
|
509
|
-
} | {
|
|
510
|
-
type: 'RESET';
|
|
511
|
-
} | {
|
|
512
|
-
type: 'MANUAL_CAPTURE';
|
|
513
|
-
} | {
|
|
514
|
-
type: 'DETECTION_UPDATE';
|
|
515
|
-
status: DetectionStatus;
|
|
516
|
-
} | {
|
|
517
|
-
type: 'DETECTION_FRAME';
|
|
518
|
-
frame: ImageData;
|
|
519
|
-
} | {
|
|
520
|
-
type: 'DETECTION_SUCCESS';
|
|
521
|
-
canvas: IncodeCanvas;
|
|
522
|
-
faceCoordinates?: FaceCoordinates;
|
|
523
|
-
} | {
|
|
524
|
-
type: 'DETECTION_RESET_READY';
|
|
525
|
-
reset: () => void;
|
|
526
|
-
} | {
|
|
527
|
-
type: 'RETRY_CAPTURE';
|
|
528
|
-
};
|
|
529
|
-
declare const faceCaptureMachine: AnyStateMachine;
|
|
530
|
-
//#endregion
|
|
531
|
-
//#region src/modules/selfie/selfieStateMachine.d.ts
|
|
532
|
-
type SelfieContext = FaceCaptureContext;
|
|
533
|
-
type SelfieEvent = FaceCaptureEvent;
|
|
534
|
-
type SelfieInput = FaceCaptureInput;
|
|
535
|
-
/**
|
|
536
|
-
* The selfie capture state machine.
|
|
537
|
-
*
|
|
538
|
-
* Note: Uses AnyStateMachine type for declaration file portability.
|
|
539
|
-
* Type safety is ensured via the machine configuration.
|
|
540
|
-
*/
|
|
541
|
-
declare const selfieMachine: AnyStateMachine;
|
|
542
|
-
/**
|
|
543
|
-
* Type representing the selfie machine.
|
|
544
|
-
* For advanced use cases requiring specific machine types.
|
|
545
|
-
*/
|
|
546
|
-
type SelfieMachine = StateMachine<SelfieContext, SelfieEvent, any, any, any, any, any, any, any, SelfieInput, any, any, any, any>;
|
|
547
|
-
//#endregion
|
|
548
|
-
//#region src/modules/selfie/selfieActor.d.ts
|
|
549
|
-
type CreateSelfieActorOptions = {
|
|
550
|
-
config: SelfieConfig;
|
|
551
|
-
dependencies?: SelfieDependencies;
|
|
552
|
-
authHint?: string;
|
|
553
|
-
};
|
|
554
|
-
type SelfieActor = ActorRefFrom<SelfieMachine>;
|
|
555
|
-
//#endregion
|
|
556
|
-
//#region src/modules/selfie/selfieCaptureOnlyStateMachine.d.ts
|
|
557
|
-
type SelfieCaptureOnlyContext = FaceCaptureContext;
|
|
558
|
-
type SelfieCaptureOnlyEvent = FaceCaptureEvent;
|
|
559
|
-
type SelfieCaptureOnlyInput = FaceCaptureInput;
|
|
560
|
-
/**
|
|
561
|
-
* Selfie state machine variant for the captureOnly flow. Shares the full base
|
|
562
|
-
* face-capture state tree; only the upload/process step is local instead of
|
|
563
|
-
* remote.
|
|
564
|
-
*/
|
|
565
|
-
declare const selfieCaptureOnlyMachine: AnyStateMachine;
|
|
566
|
-
type SelfieCaptureOnlyMachine = StateMachine<SelfieCaptureOnlyContext, SelfieCaptureOnlyEvent, any, any, any, any, any, any, any, SelfieCaptureOnlyInput, any, any, any, any>;
|
|
567
|
-
//#endregion
|
|
568
|
-
//#region src/modules/selfie/selfieCaptureOnlyActor.d.ts
|
|
569
|
-
type CreateSelfieCaptureOnlyActorOptions = {
|
|
570
|
-
config: SelfieCaptureOnlyConfig;
|
|
571
|
-
dependencies?: SelfieDependencies;
|
|
572
|
-
};
|
|
573
|
-
type SelfieCaptureOnlyActor = ActorRefFrom<SelfieCaptureOnlyMachine>;
|
|
574
|
-
//#endregion
|
|
575
|
-
//#region src/internal/faceCapture/faceCaptureManagerFactory.d.ts
|
|
576
|
-
type FaceCaptureActor = SelfieActor | AuthenticationActor | SelfieCaptureOnlyActor;
|
|
577
|
-
type CaptureStatus = 'initializing' | 'detecting' | 'capturing' | 'uploading' | 'uploadError' | 'success';
|
|
578
|
-
/** Face capture manager is waiting to be started */
|
|
579
|
-
type FaceCaptureIdleState = {
|
|
580
|
-
status: 'idle';
|
|
581
|
-
};
|
|
582
|
-
/** Checking camera permissions (when no tutorial) */
|
|
583
|
-
type FaceCaptureLoadingState = {
|
|
584
|
-
status: 'loading';
|
|
585
|
-
};
|
|
586
|
-
/** Showing face capture tutorial */
|
|
587
|
-
type FaceCaptureTutorialState = {
|
|
588
|
-
status: 'tutorial';
|
|
589
|
-
ageAssurance?: boolean;
|
|
590
|
-
};
|
|
591
|
-
/** Handling camera permissions */
|
|
592
|
-
type FaceCapturePermissionsState = {
|
|
593
|
-
status: 'permissions';
|
|
594
|
-
/** Current permission sub-state: initial, requesting, denied, or learnMore */
|
|
595
|
-
permissionStatus: PermissionStatus;
|
|
596
|
-
};
|
|
597
|
-
/** Camera is ready for face capture */
|
|
598
|
-
type FaceCaptureCaptureState = {
|
|
599
|
-
status: 'capture';
|
|
600
|
-
/** Current capture sub-state */
|
|
601
|
-
captureStatus: CaptureStatus;
|
|
602
|
-
/** The active camera stream */
|
|
603
|
-
stream: CameraStream | undefined;
|
|
604
|
-
/** Current face detection status */
|
|
605
|
-
detectionStatus: DetectionStatus;
|
|
606
|
-
/** Latest frame processed in the detection loop (for UI debug rendering) */
|
|
607
|
-
debugFrame: ImageData | undefined;
|
|
608
|
-
/** Number of capture attempts remaining */
|
|
609
|
-
attemptsRemaining: number;
|
|
610
|
-
/** Error message from failed upload */
|
|
611
|
-
uploadError: string | undefined;
|
|
612
|
-
/** Whether assisted onboarding mode is active (back camera, no mirror) */
|
|
613
|
-
assistedOnboarding: boolean;
|
|
614
|
-
ageAssurance?: boolean;
|
|
615
|
-
};
|
|
616
|
-
/** Processing the captured face */
|
|
617
|
-
type FaceCaptureProcessingState = {
|
|
618
|
-
status: 'processing';
|
|
619
|
-
};
|
|
620
|
-
/** Face capture completed successfully */
|
|
621
|
-
type FaceCaptureFinishedState = {
|
|
622
|
-
status: 'finished';
|
|
623
|
-
/** Face processing result (face match, confidence, existing user) */
|
|
624
|
-
processResponse: Record<string, unknown> | undefined;
|
|
625
|
-
};
|
|
626
|
-
/** User closed the face capture flow */
|
|
627
|
-
type FaceCaptureClosedState = {
|
|
628
|
-
status: 'closed';
|
|
629
|
-
};
|
|
630
|
-
/** An error occurred during the flow */
|
|
631
|
-
type FaceCaptureErrorState = {
|
|
632
|
-
status: 'error';
|
|
633
|
-
/** The error message */
|
|
634
|
-
error: string;
|
|
635
|
-
};
|
|
636
|
-
/** Union of all possible face capture states */
|
|
637
|
-
type FaceCaptureManagerState = FaceCaptureIdleState | FaceCaptureLoadingState | FaceCaptureTutorialState | FaceCapturePermissionsState | FaceCaptureCaptureState | FaceCaptureProcessingState | FaceCaptureFinishedState | FaceCaptureClosedState | FaceCaptureErrorState;
|
|
638
|
-
declare function createFaceCaptureManagerFromActor(actor: FaceCaptureActor, moduleName: string): Manager<FaceCaptureManagerState> & {
|
|
639
|
-
/**
|
|
640
|
-
* Starts the face capture flow.
|
|
641
|
-
* Goes to `tutorial` if showTutorial is true, otherwise to `loading`.
|
|
642
|
-
* Requires setup() to have been called with a token first.
|
|
643
|
-
*/
|
|
644
|
-
load(): void;
|
|
645
|
-
/**
|
|
646
|
-
* Advances to the next step.
|
|
647
|
-
* From `tutorial` → permissions or capture (based on permission status).
|
|
648
|
-
* From `capture` → finished.
|
|
649
|
-
*/
|
|
650
|
-
nextStep(): void;
|
|
651
|
-
/**
|
|
652
|
-
* Requests camera permission via getUserMedia.
|
|
653
|
-
* Only effective when in `permissions.idle` or `permissions.learnMore` state.
|
|
654
|
-
*/
|
|
655
|
-
requestPermission(): void;
|
|
656
|
-
/**
|
|
657
|
-
* Navigates to the "learn more" permission screen.
|
|
658
|
-
* Only effective when in `permissions.idle` state.
|
|
659
|
-
*/
|
|
660
|
-
goToLearnMore(): void;
|
|
661
|
-
/**
|
|
662
|
-
* Goes back from "learn more" to the initial permission screen.
|
|
663
|
-
* Only effective when in `permissions.learnMore` state.
|
|
664
|
-
*/
|
|
665
|
-
back(): void;
|
|
666
|
-
/**
|
|
667
|
-
* Closes the face capture flow and transitions to `closed` state.
|
|
668
|
-
* Can be called from any state.
|
|
669
|
-
*/
|
|
670
|
-
close(): void;
|
|
671
|
-
/**
|
|
672
|
-
* Resets the face capture manager to its initial `idle` state.
|
|
673
|
-
* Can be called from `error` state. Not available from `finished` (final state).
|
|
674
|
-
*/
|
|
675
|
-
reset(): void;
|
|
676
|
-
/**
|
|
677
|
-
* Retries the capture after an upload error.
|
|
678
|
-
* Only effective when in `capture.uploadError` state and `attemptsRemaining > 0`.
|
|
679
|
-
* If no attempts remaining, the transition is blocked.
|
|
680
|
-
*/
|
|
681
|
-
retryCapture(): void;
|
|
682
|
-
/**
|
|
683
|
-
* Captures a face in manual capture mode.
|
|
684
|
-
* Only effective when in `capture.detecting` state and `detectionStatus === 'manualCapture'`.
|
|
685
|
-
*/
|
|
686
|
-
capture(): void;
|
|
687
|
-
};
|
|
688
|
-
type FaceCaptureManager = ReturnType<typeof createFaceCaptureManagerFromActor>;
|
|
689
|
-
//#endregion
|
|
690
|
-
export { DetectionStatus as C, authenticationMachine as D, FaceErrorCode as E, AuthenticationConfig as S, FaceCapturedImageData as T, SendFaceImageResponse as _, SelfieCaptureOnlyMachine as a, CreateAuthenticationActorOptions as b, SelfieActor as c, FaceCaptureContext as d, FaceCaptureEvent as f, SelfieConfig as g, SelfieCaptureOnlyConfig as h, SelfieCaptureOnlyActor as i, SelfieMachine as l, faceCaptureMachine as m, FaceCaptureManagerState as n, selfieCaptureOnlyMachine as o, FaceCaptureInput as p, CreateSelfieCaptureOnlyActorOptions as r, CreateSelfieActorOptions as s, FaceCaptureManager as t, selfieMachine as u, BaseWasmProvider as v, FaceCaptureOnlyResponse as w, createAuthenticationActor as x, AuthenticationActor as y };
|