@incodetech/core 0.0.0-dev-20260313-486e658 → 0.0.0-dev-20260313-bc2dab4

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.
Files changed (80) hide show
  1. package/dist/Actor-BAf9LRYf.d.ts +2 -0
  2. package/dist/StateMachine-DJpZF_HP.d.ts +2 -0
  3. package/dist/authentication.d.ts +10 -78
  4. package/dist/authentication.esm.js +11 -195
  5. package/dist/authenticationManager-4j4j8ac9.esm.js +197 -0
  6. package/dist/authenticationManager-DQL9XsaI.d.ts +66 -0
  7. package/dist/{backCameraStream-B57NWDGu.esm.js → backCameraStream-4aLwsDOv.esm.js} +1 -1
  8. package/dist/curp-validation.d.ts +4 -4
  9. package/dist/curp-validation.esm.js +5 -5
  10. package/dist/{deepsightLoader-BXTRzhYx.esm.js → deepsightLoader-C-Xil8cg.esm.js} +4 -4
  11. package/dist/{deepsightService-CTK55DG8.esm.js → deepsightService-BgqD33AH.esm.js} +3 -3
  12. package/dist/{deepsightService-CYCDsan2.d.ts → deepsightService-UhtHJCFb.d.ts} +131 -3
  13. package/dist/document-capture.d.ts +49 -49
  14. package/dist/document-capture.esm.js +6 -6
  15. package/dist/document-upload.d.ts +49 -49
  16. package/dist/document-upload.esm.js +5 -5
  17. package/dist/ekyb.d.ts +2 -2
  18. package/dist/ekyb.esm.js +6 -6
  19. package/dist/ekyc.d.ts +2 -2
  20. package/dist/ekyc.esm.js +6 -6
  21. package/dist/email.d.ts +3 -263
  22. package/dist/email.esm.js +6 -477
  23. package/dist/emailManager-DZeOYBQ6.d.ts +335 -0
  24. package/dist/emailManager-e7j__XBB.esm.js +486 -0
  25. package/dist/{events-b4_xvENs.esm.js → events-3HzCcoEy.esm.js} +2 -2
  26. package/dist/extensibility.d.ts +95 -0
  27. package/dist/extensibility.esm.js +17 -0
  28. package/dist/face-match.d.ts +1 -1
  29. package/dist/face-match.esm.js +5 -5
  30. package/dist/faceCaptureManagerFactory-CiQWYHp2.d.ts +610 -0
  31. package/dist/{faceCaptureSetup-10lCb_yE.esm.js → faceCaptureSetup-CF9TJlsc.esm.js} +11 -11
  32. package/dist/flow.d.ts +7 -7
  33. package/dist/flow.esm.js +5 -5
  34. package/dist/{flowCompletionService-DHXqHOAk.esm.js → flowCompletionService-CV8Ywiut.esm.js} +2 -2
  35. package/dist/geolocation.d.ts +1 -1
  36. package/dist/geolocation.esm.js +5 -5
  37. package/dist/government-validation.d.ts +1 -1
  38. package/dist/government-validation.esm.js +4 -4
  39. package/dist/id-A_upgNRR.esm.js +0 -0
  40. package/dist/id.d.ts +9 -9
  41. package/dist/id.esm.js +11 -10
  42. package/dist/{id-TUJyOPso.esm.js → idCaptureManager-B9BsU7-M.esm.js} +18 -11
  43. package/dist/{index-5ZEjz-8I.d.ts → idCaptureManager-D8FwP0TW.d.ts} +30 -8
  44. package/dist/index-BtQzTfU9.d.ts +1 -0
  45. package/dist/index.d.ts +21 -12
  46. package/dist/index.esm.js +33 -21
  47. package/dist/{lib-V3Lo-Jit.esm.js → lib-COh1FH9n.esm.js} +1 -1
  48. package/dist/phone.d.ts +3 -291
  49. package/dist/phone.esm.js +6 -551
  50. package/dist/phoneManager-B6fNmxhw.esm.js +560 -0
  51. package/dist/phoneManager-BsamACjL.d.ts +370 -0
  52. package/dist/redirect-to-mobile.d.ts +1 -1
  53. package/dist/redirect-to-mobile.esm.js +4 -4
  54. package/dist/selfie.d.ts +10 -408
  55. package/dist/selfie.esm.js +11 -118
  56. package/dist/selfieManager-ByV0akn-.esm.js +117 -0
  57. package/dist/selfieManager-Czysy-lv.d.ts +68 -0
  58. package/dist/session.d.ts +1 -1
  59. package/dist/session.esm.js +3 -3
  60. package/dist/{src-D3v6I2la.esm.js → src-BmVrWkLJ.esm.js} +2 -2
  61. package/dist/{stats-D76Thmqp.esm.js → stats-kLtQIgsA.esm.js} +1 -1
  62. package/dist/stats.esm.js +2 -2
  63. package/dist/{streamingEvents-CQq5fJCL.esm.js → streamingEvents-Cw6kqXEh.esm.js} +3 -3
  64. package/dist/{types-DnrAr9fb.d.ts → types-BugcSDaO.d.ts} +1 -1
  65. package/dist/{types-Bn54lmeM.d.ts → types-C9Jo2XOb.d.ts} +1 -1
  66. package/package.json +5 -1
  67. package/dist/Actor-B6Lr-x6S.d.ts +0 -2
  68. package/dist/StateMachine-WHeQE3lC.d.ts +0 -2
  69. package/dist/faceCaptureManagerFactory-D1NUo68Z.d.ts +0 -231
  70. package/dist/types-B4KNFqC4.d.ts +0 -130
  71. /package/dist/{Manager-CG5CQ1kY.d.ts → Manager-CXnC-tN_.d.ts} +0 -0
  72. /package/dist/{api-3fZO5bmj.esm.js → api-C2uzxrpN.esm.js} +0 -0
  73. /package/dist/{camera-D7zu0Mls.d.ts → camera-DDn9ILon.d.ts} +0 -0
  74. /package/dist/{chunk-B1Ox1Owh.esm.js → chunk-C4_ANvih.esm.js} +0 -0
  75. /package/dist/{endpoints-5sPFFmaB.esm.js → endpoints-IAlXA1zN.esm.js} +0 -0
  76. /package/dist/{flowCompletionService-DeWKduBI.d.ts → flowCompletionService-D4YDcHQR.d.ts} +0 -0
  77. /package/dist/{types-BYYaKde4.d.ts → types-DTieLton.d.ts} +0 -0
  78. /package/dist/{usStates-D4SmlpeT.esm.js → usStates-vWM_ZgEH.esm.js} +0 -0
  79. /package/dist/{warmup-Da5qDIWZ.d.ts → warmup-Bp_1oXoL.d.ts} +0 -0
  80. /package/dist/{xstate.esm-07M59Cte.esm.js → xstate.esm-CcoTezCZ.esm.js} +0 -0
@@ -0,0 +1,610 @@
1
+ import { a as IStorageCapability, d as IncodeCanvas, i as StreamCanvasCapture, l as IMLProviderCapability, n as PermissionResult, o as IRecordingCapability, r as PermissionStatus, t as DeepsightService, u as MLProviderConfig } from "./deepsightService-UhtHJCFb.js";
2
+ import { n as WasmPipeline } from "./warmup-Bp_1oXoL.js";
3
+ import { t as Manager } from "./Manager-CXnC-tN_.js";
4
+ import { t as CameraStream } from "./camera-DDn9ILon.js";
5
+ import { t as ActorRefFrom } from "./Actor-BAf9LRYf.js";
6
+ import { n as StateMachine, t as AnyStateMachine } from "./StateMachine-DJpZF_HP.js";
7
+ import { r as FlowModuleConfig, t as Flow } from "./types-C9Jo2XOb.js";
8
+
9
+ //#region ../infra/src/capabilities/IFaceDetectionCapability.d.ts
10
+ /**
11
+ * Configuration for face detection provider.
12
+ * Extends base ML provider config with face-detection specific options.
13
+ */
14
+ interface FaceDetectionConfig extends MLProviderConfig {
15
+ autocaptureInterval?: number;
16
+ }
17
+ interface FacePositionConstraints {
18
+ minX: number;
19
+ minY: number;
20
+ maxX: number;
21
+ maxY: number;
22
+ }
23
+ interface FaceDetectionThresholds {
24
+ brightnessThreshold: number;
25
+ blurrinessThreshold: number;
26
+ tiltRotationAngleThreshold: number;
27
+ minMagicCropSize: number;
28
+ autocaptureInterval: number;
29
+ minFaceQualityScore: number;
30
+ faceOcclusionThreshold: number;
31
+ }
32
+ interface FaceAttributesThresholds {
33
+ headwearThreshold: number;
34
+ lensesThreshold: number;
35
+ closedEyesThreshold: number;
36
+ maskThreshold: number;
37
+ }
38
+ interface FaceChecksConfig {
39
+ lenses: boolean;
40
+ mask: boolean;
41
+ closedEyes: boolean;
42
+ headWear: boolean;
43
+ occlusion: boolean;
44
+ }
45
+ interface FaceData {
46
+ rect: {
47
+ x: number;
48
+ y: number;
49
+ width: number;
50
+ height: number;
51
+ };
52
+ rightEye: {
53
+ x: number;
54
+ y: number;
55
+ };
56
+ leftEye: {
57
+ x: number;
58
+ y: number;
59
+ };
60
+ noseTip: {
61
+ x: number;
62
+ y: number;
63
+ };
64
+ rightMouthCorner: {
65
+ x: number;
66
+ y: number;
67
+ };
68
+ leftMouthCorner: {
69
+ x: number;
70
+ y: number;
71
+ };
72
+ pitch: number;
73
+ yaw: number;
74
+ roll: number;
75
+ }
76
+ type FaceCoordinates = {
77
+ rightEyeX: number;
78
+ rightEyeY: number;
79
+ leftEyeX: number;
80
+ leftEyeY: number;
81
+ noseTipX: number;
82
+ noseTipY: number;
83
+ rightMouthX: number;
84
+ rightMouthY: number;
85
+ mouthX: number;
86
+ mouthY: number;
87
+ x: number;
88
+ y: number;
89
+ width: number;
90
+ height: number;
91
+ };
92
+ interface FaceDetectionCallbacks {
93
+ onFarAway?: () => void;
94
+ onTooClose?: () => void;
95
+ onTooManyFaces?: () => void;
96
+ onNoFace?: () => void;
97
+ onCapture?: (canvas: IncodeCanvas, faceCoordinates: FaceCoordinates) => void;
98
+ onGetReady?: () => void;
99
+ onGetReadyFinished?: () => void;
100
+ onCenterFace?: () => void;
101
+ onDark?: () => void;
102
+ onBlur?: () => void;
103
+ onFaceAngle?: () => void;
104
+ onBestShot?: (face: FaceData) => void;
105
+ onLenses?: () => void;
106
+ onMask?: () => void;
107
+ onEyesClosed?: () => void;
108
+ onHeadWear?: () => void;
109
+ onSwitchToManualCapture?: () => void;
110
+ onFaceOccluded?: () => void;
111
+ }
112
+ /**
113
+ * Capability interface for face detection and selfie capture.
114
+ * Extends the base ML provider capability with face-detection specific methods.
115
+ */
116
+ interface IFaceDetectionCapability extends IMLProviderCapability<FaceDetectionConfig> {
117
+ /**
118
+ * Sets callbacks for face detection events.
119
+ * @param callbacks - Object containing callback functions for various detection events
120
+ */
121
+ setCallbacks(callbacks: FaceDetectionCallbacks): void;
122
+ /**
123
+ * Sets position constraints for face detection.
124
+ * @param constraints - Bounding box constraints for valid face position
125
+ */
126
+ setPositionConstraints(constraints: FacePositionConstraints): void;
127
+ /**
128
+ * Sets detection thresholds for quality checks.
129
+ * @param thresholds - Threshold values for various quality metrics
130
+ */
131
+ setThresholds(thresholds: FaceDetectionThresholds): void;
132
+ /**
133
+ * Sets thresholds for face attribute detection.
134
+ * @param thresholds - Threshold values for attribute detection (headwear, lenses, etc.)
135
+ */
136
+ setAttributesThresholds(thresholds: FaceAttributesThresholds): void;
137
+ /**
138
+ * Enables or disables specific face checks.
139
+ * @param config - Configuration for which checks to enable
140
+ */
141
+ setChecksEnabled(config: FaceChecksConfig): void;
142
+ /**
143
+ * Sets video selfie mode.
144
+ * @param enabled - Whether to enable video selfie mode
145
+ */
146
+ setVideoSelfieMode(enabled: boolean): void;
147
+ }
148
+ //#endregion
149
+ //#region ../infra/src/capabilities/IWasmUtilCapability.d.ts
150
+ type WasmUtilConfig = MLProviderConfig & {
151
+ pipelines?: WasmPipeline[];
152
+ };
153
+ type VirtualCameraCheckOutput = {
154
+ canvas: HTMLCanvasElement | null;
155
+ itr: boolean | null;
156
+ skipped: boolean | null;
157
+ };
158
+ type IWasmUtilCapability = {
159
+ /**
160
+ * Whether the provider has been initialized and is ready to be used.
161
+ */
162
+ readonly initialized: boolean;
163
+ /**
164
+ * Initializes the provider with the given configuration.
165
+ * If WASM was already warmed up via `warmupWasm()`, this returns almost instantly.
166
+ * @param config - Provider configuration including WASM paths
167
+ */
168
+ initialize(config: WasmUtilConfig): Promise<void>;
169
+ /**
170
+ * Encrypts a base64 image using the WASM utility API.
171
+ * @param image - Base64 image string (no data URL prefix)
172
+ * @returns Encrypted string
173
+ */
174
+ encryptImage(image: string): string;
175
+ setSdkVersion(version: string): void;
176
+ setSdkPlatform(platform: string): void;
177
+ setDeviceInfo(deviceInfo: object, overrideExisting?: boolean): void;
178
+ setBrowserInfo(browserInfo: object, overrideExisting?: boolean): void;
179
+ setCameraInfo(cameraInfo: object, overrideExisting?: boolean): void;
180
+ setMotionStatus(status: string): void;
181
+ setBackgroundMode(backgroundMode: boolean): void;
182
+ setZc(zc: string): void;
183
+ setInspectorOpened(opened: boolean): void;
184
+ getMetadata(): string;
185
+ analyzeFrame(image: ImageData): Promise<void>;
186
+ getCheck(): string;
187
+ /**
188
+ * Gets the current pipeline state. Must be called before setMotionStatus(),
189
+ * getCheck(), setBackgroundMode(), and getMetadata() for proper metadata generation.
190
+ */
191
+ getPipelineState(): string;
192
+ estimatePerformance(): string;
193
+ isVirtualCamera(label: string | null): boolean;
194
+ prc(): Promise<void>;
195
+ poc(output: VirtualCameraCheckOutput): Promise<void>;
196
+ ckvcks(data: ArrayBuffer): void;
197
+ getVersions(): Promise<unknown>;
198
+ /**
199
+ * Disposes of resources and resets initialization state.
200
+ */
201
+ dispose(): Promise<void>;
202
+ };
203
+ //#endregion
204
+ //#region ../infra/src/wasm/WasmPipelineType.d.ts
205
+ declare enum WasmPipelineType {
206
+ IdBlurGlarePipeline = 0,
207
+ IdBarcodeAndTextQualityPipeline = 1,
208
+ IdVideoSelfiePipeline = 2,
209
+ SelfieWithAggregationMetrics = 3,
210
+ SelfieWithQualityMetrics = 4,
211
+ IdFaceDetectionPipeline = 5,
212
+ }
213
+ //#endregion
214
+ //#region ../infra/src/providers/wasm/BaseWasmProvider.d.ts
215
+ /**
216
+ * Base configuration for WASM providers
217
+ */
218
+ interface BaseWasmConfig {
219
+ /** Path to the WASM binary */
220
+ wasmPath?: string;
221
+ /** Path to the SIMD-optimized WASM binary (optional) */
222
+ wasmSimdPath?: string;
223
+ /** Path to the WASM glue code */
224
+ glueCodePath?: string;
225
+ /** Whether to use SIMD optimizations (default: true) */
226
+ useSimd?: boolean;
227
+ /**
228
+ * Base path for ML model files. Models will be loaded from `${modelsBasePath}/${modelFileName}`.
229
+ * If not provided, models are expected in a 'models' subdirectory relative to the WASM binary.
230
+ */
231
+ modelsBasePath?: string;
232
+ }
233
+ /**
234
+ * Base provider class that abstracts common WASM functionality.
235
+ * This serves as a foundation for specific ML capability providers
236
+ * like FaceDetectionProvider and IdCaptureProvider.
237
+ */
238
+ declare abstract class BaseWasmProvider {
239
+ private _isInitialized;
240
+ protected pipelineType: WasmPipelineType | undefined;
241
+ /**
242
+ * Creates a new BaseWasmProvider
243
+ * @param pipelineType - The WASM pipeline type this provider uses
244
+ */
245
+ constructor(pipelineType?: WasmPipelineType);
246
+ /**
247
+ * Returns whether this provider has been initialized.
248
+ */
249
+ get initialized(): boolean;
250
+ protected getPipelineType(): WasmPipelineType;
251
+ /**
252
+ * Initializes the provider by ensuring WASM is loaded
253
+ * @param config - Provider configuration
254
+ * @param pipeline - The pipeline type to warm up ('selfie', 'idCapture', etc.)
255
+ */
256
+ protected initializeBase(config: BaseWasmConfig, pipeline: WasmPipeline): Promise<void>;
257
+ /**
258
+ * Ensures the provider is initialized before performing operations.
259
+ * @throws Error if not initialized
260
+ */
261
+ protected ensureInitialized(): void;
262
+ /**
263
+ * Processes a frame through the WASM pipeline
264
+ * @param image - Image data to process
265
+ * @returns The pipeline result (type depends on pipeline - WASM returns any)
266
+ */
267
+ protected processFrameWasm(image: ImageData): Promise<any>;
268
+ abstract processFrame(image: ImageData): Promise<void>;
269
+ /**
270
+ * Resets the pipeline to its initial state.
271
+ * Safe to call even if not initialized (no-op in that case).
272
+ */
273
+ reset(): void;
274
+ /**
275
+ * Disposes of resources and resets initialization state.
276
+ * Safe to call even if not initialized.
277
+ */
278
+ dispose(): Promise<void>;
279
+ }
280
+ //#endregion
281
+ //#region ../infra/src/providers/wasm/FaceDetectionProvider.d.ts
282
+ declare class FaceDetectionProvider extends BaseWasmProvider implements IFaceDetectionCapability {
283
+ private defaultThresholds;
284
+ private currentThresholds;
285
+ private currentFrame;
286
+ private bestCanvas;
287
+ private bestFace;
288
+ constructor();
289
+ processFrame(image: ImageData): Promise<void>;
290
+ initialize(config: FaceDetectionConfig): Promise<void>;
291
+ setCallbacks(callbacks: FaceDetectionCallbacks): void;
292
+ setPositionConstraints(constraints: FacePositionConstraints): void;
293
+ applyDefaults(autocaptureInterval?: number): void;
294
+ setAutocaptureInterval(interval: number): void;
295
+ setThresholds(thresholds: FaceDetectionThresholds): void;
296
+ setAttributesThresholds(thresholds: FaceAttributesThresholds): void;
297
+ setChecksEnabled(config: FaceChecksConfig): void;
298
+ setVideoSelfieMode(enabled: boolean): void;
299
+ reset(): void;
300
+ private createDefaultFaceCoordinates;
301
+ private formatFaceCoordinates;
302
+ }
303
+ //#endregion
304
+ //#region src/modules/authentication/authenticationStateMachine.d.ts
305
+ declare const _authenticationMachine: AnyStateMachine;
306
+ type AuthenticationMachine = typeof _authenticationMachine;
307
+ declare const authenticationMachine: AnyStateMachine;
308
+ //#endregion
309
+ //#region src/internal/faceCapture/types.d.ts
310
+ type BaseFaceCaptureConfig = {
311
+ showTutorial: boolean;
312
+ showPreview?: boolean;
313
+ assistedOnboarding?: boolean;
314
+ enableFaceRecording?: boolean;
315
+ autoCaptureTimeout: number;
316
+ captureAttempts?: number;
317
+ numberOfAttempts?: number;
318
+ validateLenses?: boolean;
319
+ validateFaceMask?: boolean;
320
+ validateHeadCover?: boolean;
321
+ validateClosedEyes?: boolean;
322
+ validateBrightness?: boolean;
323
+ deepsightLiveness?: 'SINGLE_FRAME' | 'MULTIMODAL' | 'VIDEOLIVENESS';
324
+ recording?: {
325
+ capability?: IRecordingCapability;
326
+ };
327
+ ds?: Flow['ds'];
328
+ };
329
+ type FaceCaptureDependencies = {
330
+ storage: IStorageCapability;
331
+ getWasmUtil: () => Promise<IWasmUtilCapability>;
332
+ };
333
+ type DetectionStatus = 'idle' | 'detecting' | 'noFace' | 'tooManyFaces' | 'tooClose' | 'tooFar' | 'blur' | 'dark' | 'faceAngle' | 'headWear' | 'lenses' | 'eyesClosed' | 'faceMask' | 'centerFace' | 'manualCapture' | 'success' | 'error' | 'capturing' | 'getReady' | 'getReadyFinished' | 'offline';
334
+ declare const FACE_ERROR_CODES: {
335
+ readonly FACE_OCCLUDED: "FACE_OCCLUDED";
336
+ readonly LIVENESS: "LIVENESS_ERROR";
337
+ readonly BRIGHTNESS: "BRIGHTNESS_ERROR";
338
+ readonly LENSES: "LENSES_ERROR";
339
+ readonly MASK: "MASK_ERROR";
340
+ readonly CLOSED_EYES: "CLOSED_EYES_ERROR";
341
+ readonly HEAD_COVER: "HEAD_COVER_ERROR";
342
+ readonly SERVER: "SERVER_ERROR";
343
+ readonly FACE_NOT_FOUND: "FACE_NOT_FOUND";
344
+ readonly MULTIPLE_FACES: "MULTIPLE_FACES";
345
+ readonly TOO_BLURRY: "TOO_BLURRY_ERROR";
346
+ readonly TOO_DARK: "TOO_DARK_ERROR";
347
+ readonly USER_IS_NOT_RECOGNIZED: "USER_IS_NOT_RECOGNIZED";
348
+ readonly SPOOF_ATTEMPT_DETECTED: "SPOOF_ATTEMPT_DETECTED";
349
+ readonly FACE_TOO_DARK: "FACE_TOO_DARK";
350
+ readonly LENSES_DETECTED: "LENSES_DETECTED";
351
+ readonly FACE_MASK_DETECTED: "FACE_MASK_DETECTED";
352
+ readonly CLOSED_EYES_DETECTED: "CLOSED_EYES_DETECTED";
353
+ readonly HEAD_COVER_DETECTED: "HEAD_COVER_DETECTED";
354
+ readonly FACE_CROPPING_FAILED: "FACE_CROPPING_FAILED";
355
+ readonly FACE_TOO_SMALL: "FACE_TOO_SMALL";
356
+ readonly FACE_TOO_BLURRY: "FACE_TOO_BLURRY";
357
+ readonly BAD_PHOTO_QUALITY: "BAD_PHOTO_QUALITY";
358
+ readonly PROCESSING_ERROR: "PROCESSING_ERROR";
359
+ readonly BAD_REQUEST: "BAD_REQUEST";
360
+ readonly NONEXISTENT_CUSTOMER: "NONEXISTENT_CUSTOMER";
361
+ readonly HINT_NOT_PROVIDED: "HINT_NOT_PROVIDED";
362
+ readonly SELFIE_IMAGE_LOW_QUALITY: "SELFIE_IMAGE_LOW_QUALITY";
363
+ };
364
+ type FaceErrorCode = (typeof FACE_ERROR_CODES)[keyof typeof FACE_ERROR_CODES];
365
+ //#endregion
366
+ //#region src/modules/authentication/types.d.ts
367
+ type AuthenticationConfig = FlowModuleConfig['AUTHENTICATION'] & BaseFaceCaptureConfig;
368
+ //#endregion
369
+ //#region src/modules/authentication/authenticationActor.d.ts
370
+ type CreateAuthenticationActorOptions = {
371
+ config: AuthenticationConfig;
372
+ dependencies?: FaceCaptureDependencies;
373
+ authHint?: string;
374
+ };
375
+ type AuthenticationActor = ActorRefFrom<AuthenticationMachine>;
376
+ declare function createAuthenticationActor(options: CreateAuthenticationActorOptions): AuthenticationActor;
377
+ //#endregion
378
+ //#region src/modules/selfie/types.d.ts
379
+ type SelfieConfig = FlowModuleConfig['SELFIE'] & BaseFaceCaptureConfig;
380
+ type SelfieDependencies = FaceCaptureDependencies;
381
+ type SendFaceImageResponse = {
382
+ age: number;
383
+ confidence: number;
384
+ hasClosedEyes: boolean;
385
+ hasFaceMask: boolean;
386
+ hasHeadCover: boolean;
387
+ hasLenses: boolean;
388
+ isBright: boolean;
389
+ liveness: boolean;
390
+ imageBase64: string;
391
+ sessionStatus: string;
392
+ };
393
+ //#endregion
394
+ //#region src/internal/faceCapture/recordingService.d.ts
395
+ type RecordingService = {
396
+ start(stream: MediaStream): Promise<void>;
397
+ stop(): Promise<{
398
+ recordingId: string | null;
399
+ }>;
400
+ cleanup(): void;
401
+ };
402
+ //#endregion
403
+ //#region src/internal/faceCapture/faceCaptureSetup.d.ts
404
+ type FaceCaptureConfig = BaseFaceCaptureConfig;
405
+ type FaceCaptureInput = {
406
+ config: FaceCaptureConfig;
407
+ dependencies: FaceCaptureDependencies;
408
+ authHint?: string;
409
+ };
410
+ type FaceErrorObject = {
411
+ type: string;
412
+ message: string;
413
+ };
414
+ type FaceCaptureContext = {
415
+ config: FaceCaptureConfig;
416
+ dependencies: FaceCaptureDependencies;
417
+ authHint: string | undefined;
418
+ stream: CameraStream | undefined;
419
+ provider: FaceDetectionProvider | undefined;
420
+ frameCapturer: StreamCanvasCapture | undefined;
421
+ error: string | FaceErrorObject | undefined;
422
+ detectionStatus: DetectionStatus;
423
+ debugFrame: ImageData | undefined;
424
+ capturedImage: IncodeCanvas | undefined;
425
+ faceCoordinates: FaceCoordinates | undefined;
426
+ uploadResponse: Record<string, unknown> | undefined;
427
+ processResponse: Record<string, unknown> | undefined;
428
+ recordingService: RecordingService | undefined;
429
+ attemptsRemaining: number;
430
+ uploadError: FaceErrorCode | undefined;
431
+ permissionResult: PermissionResult | 'refresh' | undefined;
432
+ resetDetection: (() => void) | undefined;
433
+ deepsightService: DeepsightService | undefined;
434
+ encryptedBase64Image: string | undefined;
435
+ uploadRecordingId: string | null | undefined;
436
+ manualCaptureTriggered: boolean;
437
+ };
438
+ type FaceCaptureEvent = {
439
+ type: 'LOAD';
440
+ } | {
441
+ type: 'NEXT_STEP';
442
+ } | {
443
+ type: 'REQUEST_PERMISSION';
444
+ } | {
445
+ type: 'GO_TO_LEARN_MORE';
446
+ } | {
447
+ type: 'BACK';
448
+ } | {
449
+ type: 'QUIT';
450
+ } | {
451
+ type: 'RESET';
452
+ } | {
453
+ type: 'MANUAL_CAPTURE';
454
+ } | {
455
+ type: 'DETECTION_UPDATE';
456
+ status: DetectionStatus;
457
+ } | {
458
+ type: 'DETECTION_FRAME';
459
+ frame: ImageData;
460
+ } | {
461
+ type: 'DETECTION_SUCCESS';
462
+ canvas: IncodeCanvas;
463
+ faceCoordinates?: FaceCoordinates;
464
+ } | {
465
+ type: 'DETECTION_RESET_READY';
466
+ reset: () => void;
467
+ } | {
468
+ type: 'RETRY_CAPTURE';
469
+ };
470
+ declare const faceCaptureMachine: AnyStateMachine;
471
+ //#endregion
472
+ //#region src/modules/selfie/selfieStateMachine.d.ts
473
+ type SelfieContext = FaceCaptureContext;
474
+ type SelfieEvent = FaceCaptureEvent;
475
+ type SelfieInput = FaceCaptureInput;
476
+ /**
477
+ * The selfie capture state machine.
478
+ *
479
+ * Note: Uses AnyStateMachine type for declaration file portability.
480
+ * Type safety is ensured via the machine configuration.
481
+ */
482
+ declare const selfieMachine: AnyStateMachine;
483
+ /**
484
+ * Type representing the selfie machine.
485
+ * For advanced use cases requiring specific machine types.
486
+ */
487
+ type SelfieMachine = StateMachine<SelfieContext, SelfieEvent, any, any, any, any, any, any, any, SelfieInput, any, any, any, any>;
488
+ //#endregion
489
+ //#region src/modules/selfie/selfieActor.d.ts
490
+ type CreateSelfieActorOptions = {
491
+ config: SelfieConfig;
492
+ dependencies?: SelfieDependencies;
493
+ authHint?: string;
494
+ };
495
+ type SelfieActor = ActorRefFrom<SelfieMachine>;
496
+ //#endregion
497
+ //#region src/internal/faceCapture/faceCaptureManagerFactory.d.ts
498
+ type FaceCaptureActor = SelfieActor | AuthenticationActor;
499
+ type CaptureStatus = 'initializing' | 'detecting' | 'capturing' | 'uploading' | 'uploadError' | 'success';
500
+ /** Face capture manager is waiting to be started */
501
+ type FaceCaptureIdleState = {
502
+ status: 'idle';
503
+ };
504
+ /** Checking camera permissions (when no tutorial) */
505
+ type FaceCaptureLoadingState = {
506
+ status: 'loading';
507
+ };
508
+ /** Showing face capture tutorial */
509
+ type FaceCaptureTutorialState = {
510
+ status: 'tutorial';
511
+ };
512
+ /** Handling camera permissions */
513
+ type FaceCapturePermissionsState = {
514
+ status: 'permissions';
515
+ /** Current permission sub-state: initial, requesting, denied, or learnMore */
516
+ permissionStatus: PermissionStatus;
517
+ };
518
+ /** Camera is ready for face capture */
519
+ type FaceCaptureCaptureState = {
520
+ status: 'capture';
521
+ /** Current capture sub-state */
522
+ captureStatus: CaptureStatus;
523
+ /** The active camera stream */
524
+ stream: CameraStream | undefined;
525
+ /** Current face detection status */
526
+ detectionStatus: DetectionStatus;
527
+ /** Latest frame processed in the detection loop (for UI debug rendering) */
528
+ debugFrame: ImageData | undefined;
529
+ /** Number of capture attempts remaining */
530
+ attemptsRemaining: number;
531
+ /** Error message from failed upload */
532
+ uploadError: string | undefined;
533
+ /** Whether assisted onboarding mode is active (back camera, no mirror) */
534
+ assistedOnboarding: boolean;
535
+ };
536
+ /** Processing the captured face */
537
+ type FaceCaptureProcessingState = {
538
+ status: 'processing';
539
+ };
540
+ /** Face capture completed successfully */
541
+ type FaceCaptureFinishedState = {
542
+ status: 'finished';
543
+ /** Face processing result (face match, confidence, existing user) */
544
+ processResponse: Record<string, unknown> | undefined;
545
+ };
546
+ /** User closed the face capture flow */
547
+ type FaceCaptureClosedState = {
548
+ status: 'closed';
549
+ };
550
+ /** An error occurred during the flow */
551
+ type FaceCaptureErrorState = {
552
+ status: 'error';
553
+ /** The error message */
554
+ error: string;
555
+ };
556
+ /** Union of all possible face capture states */
557
+ type FaceCaptureManagerState = FaceCaptureIdleState | FaceCaptureLoadingState | FaceCaptureTutorialState | FaceCapturePermissionsState | FaceCaptureCaptureState | FaceCaptureProcessingState | FaceCaptureFinishedState | FaceCaptureClosedState | FaceCaptureErrorState;
558
+ declare function createFaceCaptureManagerFromActor(actor: FaceCaptureActor): Manager<FaceCaptureManagerState> & {
559
+ /**
560
+ * Starts the face capture flow.
561
+ * Goes to `tutorial` if showTutorial is true, otherwise to `loading`.
562
+ * Requires setup() to have been called with a token first.
563
+ */
564
+ load(): void;
565
+ /**
566
+ * Advances to the next step.
567
+ * From `tutorial` → permissions or capture (based on permission status).
568
+ * From `capture` → finished.
569
+ */
570
+ nextStep(): void;
571
+ /**
572
+ * Requests camera permission via getUserMedia.
573
+ * Only effective when in `permissions.idle` or `permissions.learnMore` state.
574
+ */
575
+ requestPermission(): void;
576
+ /**
577
+ * Navigates to the "learn more" permission screen.
578
+ * Only effective when in `permissions.idle` state.
579
+ */
580
+ goToLearnMore(): void;
581
+ /**
582
+ * Goes back from "learn more" to the initial permission screen.
583
+ * Only effective when in `permissions.learnMore` state.
584
+ */
585
+ back(): void;
586
+ /**
587
+ * Closes the face capture flow and transitions to `closed` state.
588
+ * Can be called from any state.
589
+ */
590
+ close(): void;
591
+ /**
592
+ * Resets the face capture manager to its initial `idle` state.
593
+ * Can be called from `error` state. Not available from `finished` (final state).
594
+ */
595
+ reset(): void;
596
+ /**
597
+ * Retries the capture after an upload error.
598
+ * Only effective when in `capture.uploadError` state and `attemptsRemaining > 0`.
599
+ * If no attempts remaining, the transition is blocked.
600
+ */
601
+ retryCapture(): void;
602
+ /**
603
+ * Captures a face in manual capture mode.
604
+ * Only effective when in `capture.detecting` state and `detectionStatus === 'manualCapture'`.
605
+ */
606
+ capture(): void;
607
+ };
608
+ type FaceCaptureManager = ReturnType<typeof createFaceCaptureManagerFromActor>;
609
+ //#endregion
610
+ export { WasmUtilConfig as C, VirtualCameraCheckOutput as S, DetectionStatus as _, SelfieMachine as a, BaseWasmProvider as b, FaceCaptureEvent as c, SelfieConfig as d, SendFaceImageResponse as f, AuthenticationConfig as g, createAuthenticationActor as h, SelfieActor as i, FaceCaptureInput as l, CreateAuthenticationActorOptions as m, FaceCaptureManagerState as n, selfieMachine as o, AuthenticationActor as p, CreateSelfieActorOptions as r, FaceCaptureContext as s, FaceCaptureManager as t, faceCaptureMachine as u, FaceErrorCode as v, IWasmUtilCapability as x, authenticationMachine as y };
@@ -1,11 +1,11 @@
1
- import { d as addEvent, n as eventModuleNames } from "./events-b4_xvENs.esm.js";
2
- import { t as getBackCameraStream } from "./backCameraStream-B57NWDGu.esm.js";
3
- import { A as createManager, O as requestCameraAccess, S as StreamCanvasCapture, d as OpenViduRecordingProvider, k as stopCameraStream, p as LocalRecordingProvider, s as FaceDetectionProvider, x as StreamCanvasProcessingSession } from "./src-D3v6I2la.esm.js";
4
- import { i as fromPromise, n as assign, r as fromCallback, t as setup } from "./xstate.esm-07M59Cte.esm.js";
5
- import { a as uploadDeepsightVideo, i as stopRecording$1, l as getDeviceClass, n as createRecordingSession, o as checkPermission, r as startRecording, s as requestPermission, t as streamingEvents } from "./streamingEvents-CQq5fJCL.esm.js";
6
- import { r as getToken, t as api } from "./api-3fZO5bmj.esm.js";
7
- import { t as endpoints } from "./endpoints-5sPFFmaB.esm.js";
8
- import { t as addDeviceStats } from "./stats-D76Thmqp.esm.js";
1
+ import { d as addEvent, n as eventModuleNames } from "./events-3HzCcoEy.esm.js";
2
+ import { t as getBackCameraStream } from "./backCameraStream-4aLwsDOv.esm.js";
3
+ import { A as createManager, O as requestCameraAccess, S as StreamCanvasCapture, d as OpenViduRecordingProvider, k as stopCameraStream, p as LocalRecordingProvider, s as FaceDetectionProvider, x as StreamCanvasProcessingSession } from "./src-BmVrWkLJ.esm.js";
4
+ import { i as fromPromise, n as assign, r as fromCallback, t as setup } from "./xstate.esm-CcoTezCZ.esm.js";
5
+ import { a as uploadDeepsightVideo, i as stopRecording$1, l as getDeviceClass, n as createRecordingSession, o as checkPermission, r as startRecording, s as requestPermission, t as streamingEvents } from "./streamingEvents-Cw6kqXEh.esm.js";
6
+ import { r as getToken, t as api } from "./api-C2uzxrpN.esm.js";
7
+ import { t as endpoints } from "./endpoints-IAlXA1zN.esm.js";
8
+ import { t as addDeviceStats } from "./stats-kLtQIgsA.esm.js";
9
9
 
10
10
  //#region src/internal/faceCapture/faceCaptureManagerFactory.ts
11
11
  function getPermissionStatus(snapshot) {
@@ -96,7 +96,7 @@ function createApi({ actor }) {
96
96
  }
97
97
  };
98
98
  }
99
- function createFaceCaptureManager(actor) {
99
+ function createFaceCaptureManagerFromActor(actor) {
100
100
  return createManager({
101
101
  actor,
102
102
  mapState,
@@ -445,7 +445,7 @@ async function stopRecording(session) {
445
445
  }
446
446
  }
447
447
  async function initializeDeepsightSession(options) {
448
- const { loadDeepsightSession } = await import("./deepsightLoader-BXTRzhYx.esm.js");
448
+ const { loadDeepsightSession } = await import("./deepsightLoader-C-Xil8cg.esm.js");
449
449
  return loadDeepsightSession({
450
450
  ds: options.ds,
451
451
  storage: options.storage
@@ -1216,4 +1216,4 @@ const _faceCaptureMachine = setup({
1216
1216
  const faceCaptureMachine = _faceCaptureMachine;
1217
1217
 
1218
1218
  //#endregion
1219
- export { FACE_ERROR_CODES as a, uploadSelfie as i, faceCaptureMachine as n, createFaceCaptureManager as o, processFace as r, FACE_CAPTURE_EVENT_CODES as t };
1219
+ export { FACE_ERROR_CODES as a, uploadSelfie as i, faceCaptureMachine as n, createFaceCaptureManagerFromActor as o, processFace as r, FACE_CAPTURE_EVENT_CODES as t };
package/dist/flow.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { n as WasmPipeline } from "./warmup-Da5qDIWZ.js";
2
- import { t as Manager } from "./Manager-CG5CQ1kY.js";
3
- import "./camera-D7zu0Mls.js";
4
- import { t as AnyStateMachine } from "./StateMachine-WHeQE3lC.js";
5
- import "./types-DnrAr9fb.js";
6
- import { n as FlowModule, r as FlowModuleConfig, t as Flow } from "./types-Bn54lmeM.js";
7
- import { n as GetFinishStatusFn, t as FinishStatus } from "./flowCompletionService-DeWKduBI.js";
1
+ import { n as WasmPipeline } from "./warmup-Bp_1oXoL.js";
2
+ import { t as Manager } from "./Manager-CXnC-tN_.js";
3
+ import "./camera-DDn9ILon.js";
4
+ import { t as AnyStateMachine } from "./StateMachine-DJpZF_HP.js";
5
+ import "./types-BugcSDaO.js";
6
+ import { n as FlowModule, r as FlowModuleConfig, t as Flow } from "./types-C9Jo2XOb.js";
7
+ import { n as GetFinishStatusFn, t as FinishStatus } from "./flowCompletionService-D4YDcHQR.js";
8
8
 
9
9
  //#region src/modules/flow/flowUtils.d.ts
10
10
 
package/dist/flow.esm.js CHANGED
@@ -1,8 +1,8 @@
1
- import { A as createManager } from "./src-D3v6I2la.esm.js";
2
- import { a as createActor, i as fromPromise, n as assign, r as fromCallback, t as setup } from "./xstate.esm-07M59Cte.esm.js";
3
- import { t as api } from "./api-3fZO5bmj.esm.js";
4
- import { t as endpoints } from "./endpoints-5sPFFmaB.esm.js";
5
- import { t as getFinishStatus } from "./flowCompletionService-DHXqHOAk.esm.js";
1
+ import { A as createManager } from "./src-BmVrWkLJ.esm.js";
2
+ import { a as createActor, i as fromPromise, n as assign, r as fromCallback, t as setup } from "./xstate.esm-CcoTezCZ.esm.js";
3
+ import { t as api } from "./api-C2uzxrpN.esm.js";
4
+ import { t as endpoints } from "./endpoints-IAlXA1zN.esm.js";
5
+ import { t as getFinishStatus } from "./flowCompletionService-CV8Ywiut.esm.js";
6
6
 
7
7
  //#region src/modules/flow/flowUtils.ts
8
8
  const WASM_MODULE_PIPELINES = {