@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.
- package/dist/Actor-BAf9LRYf.d.ts +2 -0
- package/dist/StateMachine-DJpZF_HP.d.ts +2 -0
- package/dist/authentication.d.ts +10 -78
- package/dist/authentication.esm.js +11 -195
- package/dist/authenticationManager-4j4j8ac9.esm.js +197 -0
- package/dist/authenticationManager-DQL9XsaI.d.ts +66 -0
- package/dist/{backCameraStream-B57NWDGu.esm.js → backCameraStream-4aLwsDOv.esm.js} +1 -1
- package/dist/curp-validation.d.ts +4 -4
- package/dist/curp-validation.esm.js +5 -5
- package/dist/{deepsightLoader-BXTRzhYx.esm.js → deepsightLoader-C-Xil8cg.esm.js} +4 -4
- package/dist/{deepsightService-CTK55DG8.esm.js → deepsightService-BgqD33AH.esm.js} +3 -3
- package/dist/{deepsightService-CYCDsan2.d.ts → deepsightService-UhtHJCFb.d.ts} +131 -3
- package/dist/document-capture.d.ts +49 -49
- package/dist/document-capture.esm.js +6 -6
- package/dist/document-upload.d.ts +49 -49
- package/dist/document-upload.esm.js +5 -5
- package/dist/ekyb.d.ts +2 -2
- package/dist/ekyb.esm.js +6 -6
- package/dist/ekyc.d.ts +2 -2
- package/dist/ekyc.esm.js +6 -6
- package/dist/email.d.ts +3 -263
- package/dist/email.esm.js +6 -477
- package/dist/emailManager-DZeOYBQ6.d.ts +335 -0
- package/dist/emailManager-e7j__XBB.esm.js +486 -0
- package/dist/{events-b4_xvENs.esm.js → events-3HzCcoEy.esm.js} +2 -2
- package/dist/extensibility.d.ts +95 -0
- package/dist/extensibility.esm.js +17 -0
- package/dist/face-match.d.ts +1 -1
- package/dist/face-match.esm.js +5 -5
- package/dist/faceCaptureManagerFactory-CiQWYHp2.d.ts +610 -0
- package/dist/{faceCaptureSetup-10lCb_yE.esm.js → faceCaptureSetup-CF9TJlsc.esm.js} +11 -11
- package/dist/flow.d.ts +7 -7
- package/dist/flow.esm.js +5 -5
- package/dist/{flowCompletionService-DHXqHOAk.esm.js → flowCompletionService-CV8Ywiut.esm.js} +2 -2
- package/dist/geolocation.d.ts +1 -1
- package/dist/geolocation.esm.js +5 -5
- package/dist/government-validation.d.ts +1 -1
- package/dist/government-validation.esm.js +4 -4
- package/dist/id-A_upgNRR.esm.js +0 -0
- package/dist/id.d.ts +9 -9
- package/dist/id.esm.js +11 -10
- package/dist/{id-TUJyOPso.esm.js → idCaptureManager-B9BsU7-M.esm.js} +18 -11
- package/dist/{index-5ZEjz-8I.d.ts → idCaptureManager-D8FwP0TW.d.ts} +30 -8
- package/dist/index-BtQzTfU9.d.ts +1 -0
- package/dist/index.d.ts +21 -12
- package/dist/index.esm.js +33 -21
- package/dist/{lib-V3Lo-Jit.esm.js → lib-COh1FH9n.esm.js} +1 -1
- package/dist/phone.d.ts +3 -291
- package/dist/phone.esm.js +6 -551
- package/dist/phoneManager-B6fNmxhw.esm.js +560 -0
- package/dist/phoneManager-BsamACjL.d.ts +370 -0
- package/dist/redirect-to-mobile.d.ts +1 -1
- package/dist/redirect-to-mobile.esm.js +4 -4
- package/dist/selfie.d.ts +10 -408
- package/dist/selfie.esm.js +11 -118
- package/dist/selfieManager-ByV0akn-.esm.js +117 -0
- package/dist/selfieManager-Czysy-lv.d.ts +68 -0
- package/dist/session.d.ts +1 -1
- package/dist/session.esm.js +3 -3
- package/dist/{src-D3v6I2la.esm.js → src-BmVrWkLJ.esm.js} +2 -2
- package/dist/{stats-D76Thmqp.esm.js → stats-kLtQIgsA.esm.js} +1 -1
- package/dist/stats.esm.js +2 -2
- package/dist/{streamingEvents-CQq5fJCL.esm.js → streamingEvents-Cw6kqXEh.esm.js} +3 -3
- package/dist/{types-DnrAr9fb.d.ts → types-BugcSDaO.d.ts} +1 -1
- package/dist/{types-Bn54lmeM.d.ts → types-C9Jo2XOb.d.ts} +1 -1
- package/package.json +5 -1
- package/dist/Actor-B6Lr-x6S.d.ts +0 -2
- package/dist/StateMachine-WHeQE3lC.d.ts +0 -2
- package/dist/faceCaptureManagerFactory-D1NUo68Z.d.ts +0 -231
- package/dist/types-B4KNFqC4.d.ts +0 -130
- /package/dist/{Manager-CG5CQ1kY.d.ts → Manager-CXnC-tN_.d.ts} +0 -0
- /package/dist/{api-3fZO5bmj.esm.js → api-C2uzxrpN.esm.js} +0 -0
- /package/dist/{camera-D7zu0Mls.d.ts → camera-DDn9ILon.d.ts} +0 -0
- /package/dist/{chunk-B1Ox1Owh.esm.js → chunk-C4_ANvih.esm.js} +0 -0
- /package/dist/{endpoints-5sPFFmaB.esm.js → endpoints-IAlXA1zN.esm.js} +0 -0
- /package/dist/{flowCompletionService-DeWKduBI.d.ts → flowCompletionService-D4YDcHQR.d.ts} +0 -0
- /package/dist/{types-BYYaKde4.d.ts → types-DTieLton.d.ts} +0 -0
- /package/dist/{usStates-D4SmlpeT.esm.js → usStates-vWM_ZgEH.esm.js} +0 -0
- /package/dist/{warmup-Da5qDIWZ.d.ts → warmup-Bp_1oXoL.d.ts} +0 -0
- /package/dist/{xstate.esm-07M59Cte.esm.js → xstate.esm-CcoTezCZ.esm.js} +0 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { i as SelfieActor, n as FaceCaptureManagerState, r as CreateSelfieActorOptions, t as FaceCaptureManager } from "./faceCaptureManagerFactory-CiQWYHp2.js";
|
|
2
|
+
import { t as Manager } from "./Manager-CXnC-tN_.js";
|
|
3
|
+
|
|
4
|
+
//#region src/modules/selfie/selfieUploadService.d.ts
|
|
5
|
+
type ProcessFaceImageType = 'selfie' | 'videoSelfie';
|
|
6
|
+
type ProcessFaceResponse = {
|
|
7
|
+
faceMatch: boolean;
|
|
8
|
+
confidence: number;
|
|
9
|
+
existingUser: boolean;
|
|
10
|
+
};
|
|
11
|
+
declare function processFace(imageType?: ProcessFaceImageType, signal?: AbortSignal): Promise<ProcessFaceResponse>;
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/modules/selfie/selfieManager.d.ts
|
|
14
|
+
type SelfieState = FaceCaptureManagerState;
|
|
15
|
+
declare function createSelfieManagerFromActor(actor: SelfieActor): Manager<FaceCaptureManagerState> & {
|
|
16
|
+
load(): void;
|
|
17
|
+
nextStep(): void;
|
|
18
|
+
requestPermission(): void;
|
|
19
|
+
goToLearnMore(): void;
|
|
20
|
+
back(): void;
|
|
21
|
+
close(): void;
|
|
22
|
+
reset(): void;
|
|
23
|
+
retryCapture(): void;
|
|
24
|
+
capture(): void;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Creates a selfie manager instance for handling selfie capture flow.
|
|
28
|
+
*
|
|
29
|
+
* The selfie manager provides:
|
|
30
|
+
* - State management with statuses: `idle`, `loading`, `tutorial`, `permissions`, `capture`, `finished`, `closed`, `error`
|
|
31
|
+
* - Permission handling with nested states: `idle`, `requesting`, `denied`, `learnMore`
|
|
32
|
+
* - Capture handling with nested states: `initializing`, `startingRecorder`, `recordingActive`, `detecting`, `capturing`, `uploading`, `uploadError`, `success`
|
|
33
|
+
* - Camera stream access when in `capture` state
|
|
34
|
+
* - Detection status feedback during face detection
|
|
35
|
+
* - Attempt tracking with `attemptsRemaining`
|
|
36
|
+
*
|
|
37
|
+
* @param options - Configuration for the selfie actor
|
|
38
|
+
* @param options.config - The selfie module configuration from the flow
|
|
39
|
+
* @returns A manager instance with state subscription, API methods, and lifecycle controls
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* const selfieManager = createSelfieManager({ config: selfieConfig });
|
|
44
|
+
*
|
|
45
|
+
* selfieManager.subscribe((state) => {
|
|
46
|
+
* if (state.status === 'capture') {
|
|
47
|
+
* console.log('Camera ready:', state.stream);
|
|
48
|
+
* console.log('Detection status:', state.detectionStatus);
|
|
49
|
+
* }
|
|
50
|
+
* });
|
|
51
|
+
*
|
|
52
|
+
* selfieManager.load();
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
declare function createSelfieManager(options: CreateSelfieActorOptions): Manager<FaceCaptureManagerState> & {
|
|
56
|
+
load(): void;
|
|
57
|
+
nextStep(): void;
|
|
58
|
+
requestPermission(): void;
|
|
59
|
+
goToLearnMore(): void;
|
|
60
|
+
back(): void;
|
|
61
|
+
close(): void;
|
|
62
|
+
reset(): void;
|
|
63
|
+
retryCapture(): void;
|
|
64
|
+
capture(): void;
|
|
65
|
+
};
|
|
66
|
+
type SelfieManager = FaceCaptureManager;
|
|
67
|
+
//#endregion
|
|
68
|
+
export { ProcessFaceResponse as a, createSelfieManagerFromActor as i, SelfieState as n, processFace as o, createSelfieManager as r, SelfieManager as t };
|
package/dist/session.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as GetFinishStatusFn, r as getFinishStatus, t as FinishStatus } from "./flowCompletionService-
|
|
1
|
+
import { n as GetFinishStatusFn, r as getFinishStatus, t as FinishStatus } from "./flowCompletionService-D4YDcHQR.js";
|
|
2
2
|
export { type FinishStatus, type GetFinishStatusFn, getFinishStatus };
|
package/dist/session.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./api-
|
|
2
|
-
import "./endpoints-
|
|
3
|
-
import { t as getFinishStatus } from "./flowCompletionService-
|
|
1
|
+
import "./api-C2uzxrpN.esm.js";
|
|
2
|
+
import "./endpoints-IAlXA1zN.esm.js";
|
|
3
|
+
import { t as getFinishStatus } from "./flowCompletionService-CV8Ywiut.esm.js";
|
|
4
4
|
|
|
5
5
|
export { getFinishStatus };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as __toDynamicImportESM } from "./chunk-
|
|
1
|
+
import { a as __toDynamicImportESM } from "./chunk-C4_ANvih.esm.js";
|
|
2
2
|
|
|
3
3
|
//#region ../infra/src/capabilities/platform.ts
|
|
4
4
|
/**
|
|
@@ -4419,7 +4419,7 @@ var MotionSensorProvider = class {
|
|
|
4419
4419
|
let openViduImport;
|
|
4420
4420
|
async function loadOpenVidu() {
|
|
4421
4421
|
if (openViduImport) return openViduImport;
|
|
4422
|
-
openViduImport = import("./lib-
|
|
4422
|
+
openViduImport = import("./lib-COh1FH9n.esm.js").then(__toDynamicImportESM(1));
|
|
4423
4423
|
return openViduImport;
|
|
4424
4424
|
}
|
|
4425
4425
|
|
package/dist/stats.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as queryCameraPermission, M as getDeviceInfo, O as requestCameraAccess, P as getUserAgent, R as isIPad, f as MotionSensorProvider, k as stopCameraStream } from "./src-
|
|
2
|
-
import { t as api } from "./api-
|
|
3
|
-
import { t as endpoints } from "./endpoints-
|
|
1
|
+
import { C as queryCameraPermission, M as getDeviceInfo, O as requestCameraAccess, P as getUserAgent, R as isIPad, f as MotionSensorProvider, k as stopCameraStream } from "./src-BmVrWkLJ.esm.js";
|
|
2
|
+
import { t as api } from "./api-C2uzxrpN.esm.js";
|
|
3
|
+
import { t as endpoints } from "./endpoints-IAlXA1zN.esm.js";
|
|
4
4
|
|
|
5
5
|
//#region src/internal/device/getBrowser.ts
|
|
6
6
|
function getBrowser() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@incodetech/core",
|
|
3
|
-
"version": "0.0.0-dev-20260313-
|
|
3
|
+
"version": "0.0.0-dev-20260313-bc2dab4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.esm.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -73,6 +73,10 @@
|
|
|
73
73
|
"types": "./dist/session.d.ts",
|
|
74
74
|
"import": "./dist/session.esm.js"
|
|
75
75
|
},
|
|
76
|
+
"./extensibility": {
|
|
77
|
+
"types": "./dist/extensibility.d.ts",
|
|
78
|
+
"import": "./dist/extensibility.esm.js"
|
|
79
|
+
},
|
|
76
80
|
"./redirect-to-mobile": {
|
|
77
81
|
"types": "./dist/redirect-to-mobile.d.ts",
|
|
78
82
|
"import": "./dist/redirect-to-mobile.esm.js"
|
package/dist/Actor-B6Lr-x6S.d.ts
DELETED
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
import { i as IRecordingCapability, n as PermissionStatus, r as IStorageCapability, s as MLProviderConfig } from "./types-B4KNFqC4.js";
|
|
2
|
-
import { n as WasmPipeline } from "./warmup-Da5qDIWZ.js";
|
|
3
|
-
import { t as Manager } from "./Manager-CG5CQ1kY.js";
|
|
4
|
-
import { t as CameraStream } from "./camera-D7zu0Mls.js";
|
|
5
|
-
import { t as Flow } from "./types-Bn54lmeM.js";
|
|
6
|
-
|
|
7
|
-
//#region ../infra/src/capabilities/IWasmUtilCapability.d.ts
|
|
8
|
-
type WasmUtilConfig = MLProviderConfig & {
|
|
9
|
-
pipelines?: WasmPipeline[];
|
|
10
|
-
};
|
|
11
|
-
type VirtualCameraCheckOutput = {
|
|
12
|
-
canvas: HTMLCanvasElement | null;
|
|
13
|
-
itr: boolean | null;
|
|
14
|
-
skipped: boolean | null;
|
|
15
|
-
};
|
|
16
|
-
type IWasmUtilCapability = {
|
|
17
|
-
/**
|
|
18
|
-
* Whether the provider has been initialized and is ready to be used.
|
|
19
|
-
*/
|
|
20
|
-
readonly initialized: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* Initializes the provider with the given configuration.
|
|
23
|
-
* If WASM was already warmed up via `warmupWasm()`, this returns almost instantly.
|
|
24
|
-
* @param config - Provider configuration including WASM paths
|
|
25
|
-
*/
|
|
26
|
-
initialize(config: WasmUtilConfig): Promise<void>;
|
|
27
|
-
/**
|
|
28
|
-
* Encrypts a base64 image using the WASM utility API.
|
|
29
|
-
* @param image - Base64 image string (no data URL prefix)
|
|
30
|
-
* @returns Encrypted string
|
|
31
|
-
*/
|
|
32
|
-
encryptImage(image: string): string;
|
|
33
|
-
setSdkVersion(version: string): void;
|
|
34
|
-
setSdkPlatform(platform: string): void;
|
|
35
|
-
setDeviceInfo(deviceInfo: object, overrideExisting?: boolean): void;
|
|
36
|
-
setBrowserInfo(browserInfo: object, overrideExisting?: boolean): void;
|
|
37
|
-
setCameraInfo(cameraInfo: object, overrideExisting?: boolean): void;
|
|
38
|
-
setMotionStatus(status: string): void;
|
|
39
|
-
setBackgroundMode(backgroundMode: boolean): void;
|
|
40
|
-
setZc(zc: string): void;
|
|
41
|
-
setInspectorOpened(opened: boolean): void;
|
|
42
|
-
getMetadata(): string;
|
|
43
|
-
analyzeFrame(image: ImageData): Promise<void>;
|
|
44
|
-
getCheck(): string;
|
|
45
|
-
/**
|
|
46
|
-
* Gets the current pipeline state. Must be called before setMotionStatus(),
|
|
47
|
-
* getCheck(), setBackgroundMode(), and getMetadata() for proper metadata generation.
|
|
48
|
-
*/
|
|
49
|
-
getPipelineState(): string;
|
|
50
|
-
estimatePerformance(): string;
|
|
51
|
-
isVirtualCamera(label: string | null): boolean;
|
|
52
|
-
prc(): Promise<void>;
|
|
53
|
-
poc(output: VirtualCameraCheckOutput): Promise<void>;
|
|
54
|
-
ckvcks(data: ArrayBuffer): void;
|
|
55
|
-
getVersions(): Promise<unknown>;
|
|
56
|
-
/**
|
|
57
|
-
* Disposes of resources and resets initialization state.
|
|
58
|
-
*/
|
|
59
|
-
dispose(): Promise<void>;
|
|
60
|
-
};
|
|
61
|
-
//#endregion
|
|
62
|
-
//#region src/internal/faceCapture/types.d.ts
|
|
63
|
-
type BaseFaceCaptureConfig = {
|
|
64
|
-
showTutorial: boolean;
|
|
65
|
-
showPreview?: boolean;
|
|
66
|
-
assistedOnboarding?: boolean;
|
|
67
|
-
enableFaceRecording?: boolean;
|
|
68
|
-
autoCaptureTimeout: number;
|
|
69
|
-
captureAttempts?: number;
|
|
70
|
-
numberOfAttempts?: number;
|
|
71
|
-
validateLenses?: boolean;
|
|
72
|
-
validateFaceMask?: boolean;
|
|
73
|
-
validateHeadCover?: boolean;
|
|
74
|
-
validateClosedEyes?: boolean;
|
|
75
|
-
validateBrightness?: boolean;
|
|
76
|
-
deepsightLiveness?: 'SINGLE_FRAME' | 'MULTIMODAL' | 'VIDEOLIVENESS';
|
|
77
|
-
recording?: {
|
|
78
|
-
capability?: IRecordingCapability;
|
|
79
|
-
};
|
|
80
|
-
ds?: Flow['ds'];
|
|
81
|
-
};
|
|
82
|
-
type FaceCaptureDependencies = {
|
|
83
|
-
storage: IStorageCapability;
|
|
84
|
-
getWasmUtil: () => Promise<IWasmUtilCapability>;
|
|
85
|
-
};
|
|
86
|
-
type DetectionStatus = 'idle' | 'detecting' | 'noFace' | 'tooManyFaces' | 'tooClose' | 'tooFar' | 'blur' | 'dark' | 'faceAngle' | 'headWear' | 'lenses' | 'eyesClosed' | 'faceMask' | 'centerFace' | 'manualCapture' | 'success' | 'error' | 'capturing' | 'getReady' | 'getReadyFinished' | 'offline';
|
|
87
|
-
declare const FACE_ERROR_CODES: {
|
|
88
|
-
readonly FACE_OCCLUDED: "FACE_OCCLUDED";
|
|
89
|
-
readonly LIVENESS: "LIVENESS_ERROR";
|
|
90
|
-
readonly BRIGHTNESS: "BRIGHTNESS_ERROR";
|
|
91
|
-
readonly LENSES: "LENSES_ERROR";
|
|
92
|
-
readonly MASK: "MASK_ERROR";
|
|
93
|
-
readonly CLOSED_EYES: "CLOSED_EYES_ERROR";
|
|
94
|
-
readonly HEAD_COVER: "HEAD_COVER_ERROR";
|
|
95
|
-
readonly SERVER: "SERVER_ERROR";
|
|
96
|
-
readonly FACE_NOT_FOUND: "FACE_NOT_FOUND";
|
|
97
|
-
readonly MULTIPLE_FACES: "MULTIPLE_FACES";
|
|
98
|
-
readonly TOO_BLURRY: "TOO_BLURRY_ERROR";
|
|
99
|
-
readonly TOO_DARK: "TOO_DARK_ERROR";
|
|
100
|
-
readonly USER_IS_NOT_RECOGNIZED: "USER_IS_NOT_RECOGNIZED";
|
|
101
|
-
readonly SPOOF_ATTEMPT_DETECTED: "SPOOF_ATTEMPT_DETECTED";
|
|
102
|
-
readonly FACE_TOO_DARK: "FACE_TOO_DARK";
|
|
103
|
-
readonly LENSES_DETECTED: "LENSES_DETECTED";
|
|
104
|
-
readonly FACE_MASK_DETECTED: "FACE_MASK_DETECTED";
|
|
105
|
-
readonly CLOSED_EYES_DETECTED: "CLOSED_EYES_DETECTED";
|
|
106
|
-
readonly HEAD_COVER_DETECTED: "HEAD_COVER_DETECTED";
|
|
107
|
-
readonly FACE_CROPPING_FAILED: "FACE_CROPPING_FAILED";
|
|
108
|
-
readonly FACE_TOO_SMALL: "FACE_TOO_SMALL";
|
|
109
|
-
readonly FACE_TOO_BLURRY: "FACE_TOO_BLURRY";
|
|
110
|
-
readonly BAD_PHOTO_QUALITY: "BAD_PHOTO_QUALITY";
|
|
111
|
-
readonly PROCESSING_ERROR: "PROCESSING_ERROR";
|
|
112
|
-
readonly BAD_REQUEST: "BAD_REQUEST";
|
|
113
|
-
readonly NONEXISTENT_CUSTOMER: "NONEXISTENT_CUSTOMER";
|
|
114
|
-
readonly HINT_NOT_PROVIDED: "HINT_NOT_PROVIDED";
|
|
115
|
-
readonly SELFIE_IMAGE_LOW_QUALITY: "SELFIE_IMAGE_LOW_QUALITY";
|
|
116
|
-
};
|
|
117
|
-
type FaceErrorCode = (typeof FACE_ERROR_CODES)[keyof typeof FACE_ERROR_CODES];
|
|
118
|
-
//#endregion
|
|
119
|
-
//#region src/internal/faceCapture/faceCaptureManagerFactory.d.ts
|
|
120
|
-
type CaptureStatus = 'initializing' | 'detecting' | 'capturing' | 'uploading' | 'uploadError' | 'success';
|
|
121
|
-
/** Face capture manager is waiting to be started */
|
|
122
|
-
type FaceCaptureIdleState = {
|
|
123
|
-
status: 'idle';
|
|
124
|
-
};
|
|
125
|
-
/** Checking camera permissions (when no tutorial) */
|
|
126
|
-
type FaceCaptureLoadingState = {
|
|
127
|
-
status: 'loading';
|
|
128
|
-
};
|
|
129
|
-
/** Showing face capture tutorial */
|
|
130
|
-
type FaceCaptureTutorialState = {
|
|
131
|
-
status: 'tutorial';
|
|
132
|
-
};
|
|
133
|
-
/** Handling camera permissions */
|
|
134
|
-
type FaceCapturePermissionsState = {
|
|
135
|
-
status: 'permissions';
|
|
136
|
-
/** Current permission sub-state: initial, requesting, denied, or learnMore */
|
|
137
|
-
permissionStatus: PermissionStatus;
|
|
138
|
-
};
|
|
139
|
-
/** Camera is ready for face capture */
|
|
140
|
-
type FaceCaptureCaptureState = {
|
|
141
|
-
status: 'capture';
|
|
142
|
-
/** Current capture sub-state */
|
|
143
|
-
captureStatus: CaptureStatus;
|
|
144
|
-
/** The active camera stream */
|
|
145
|
-
stream: CameraStream | undefined;
|
|
146
|
-
/** Current face detection status */
|
|
147
|
-
detectionStatus: DetectionStatus;
|
|
148
|
-
/** Latest frame processed in the detection loop (for UI debug rendering) */
|
|
149
|
-
debugFrame: ImageData | undefined;
|
|
150
|
-
/** Number of capture attempts remaining */
|
|
151
|
-
attemptsRemaining: number;
|
|
152
|
-
/** Error message from failed upload */
|
|
153
|
-
uploadError: string | undefined;
|
|
154
|
-
/** Whether assisted onboarding mode is active (back camera, no mirror) */
|
|
155
|
-
assistedOnboarding: boolean;
|
|
156
|
-
};
|
|
157
|
-
/** Processing the captured face */
|
|
158
|
-
type FaceCaptureProcessingState = {
|
|
159
|
-
status: 'processing';
|
|
160
|
-
};
|
|
161
|
-
/** Face capture completed successfully */
|
|
162
|
-
type FaceCaptureFinishedState = {
|
|
163
|
-
status: 'finished';
|
|
164
|
-
/** Face processing result (face match, confidence, existing user) */
|
|
165
|
-
processResponse: Record<string, unknown> | undefined;
|
|
166
|
-
};
|
|
167
|
-
/** User closed the face capture flow */
|
|
168
|
-
type FaceCaptureClosedState = {
|
|
169
|
-
status: 'closed';
|
|
170
|
-
};
|
|
171
|
-
/** An error occurred during the flow */
|
|
172
|
-
type FaceCaptureErrorState = {
|
|
173
|
-
status: 'error';
|
|
174
|
-
/** The error message */
|
|
175
|
-
error: string;
|
|
176
|
-
};
|
|
177
|
-
/** Union of all possible face capture states */
|
|
178
|
-
type FaceCaptureManagerState = FaceCaptureIdleState | FaceCaptureLoadingState | FaceCaptureTutorialState | FaceCapturePermissionsState | FaceCaptureCaptureState | FaceCaptureProcessingState | FaceCaptureFinishedState | FaceCaptureClosedState | FaceCaptureErrorState;
|
|
179
|
-
declare function createFaceCaptureManager(actor: unknown): Manager<FaceCaptureManagerState> & {
|
|
180
|
-
/**
|
|
181
|
-
* Starts the face capture flow.
|
|
182
|
-
* Goes to `tutorial` if showTutorial is true, otherwise to `loading`.
|
|
183
|
-
* Requires setup() to have been called with a token first.
|
|
184
|
-
*/
|
|
185
|
-
load(): void;
|
|
186
|
-
/**
|
|
187
|
-
* Advances to the next step.
|
|
188
|
-
* From `tutorial` → permissions or capture (based on permission status).
|
|
189
|
-
* From `capture` → finished.
|
|
190
|
-
*/
|
|
191
|
-
nextStep(): void;
|
|
192
|
-
/**
|
|
193
|
-
* Requests camera permission via getUserMedia.
|
|
194
|
-
* Only effective when in `permissions.idle` or `permissions.learnMore` state.
|
|
195
|
-
*/
|
|
196
|
-
requestPermission(): void;
|
|
197
|
-
/**
|
|
198
|
-
* Navigates to the "learn more" permission screen.
|
|
199
|
-
* Only effective when in `permissions.idle` state.
|
|
200
|
-
*/
|
|
201
|
-
goToLearnMore(): void;
|
|
202
|
-
/**
|
|
203
|
-
* Goes back from "learn more" to the initial permission screen.
|
|
204
|
-
* Only effective when in `permissions.learnMore` state.
|
|
205
|
-
*/
|
|
206
|
-
back(): void;
|
|
207
|
-
/**
|
|
208
|
-
* Closes the face capture flow and transitions to `closed` state.
|
|
209
|
-
* Can be called from any state.
|
|
210
|
-
*/
|
|
211
|
-
close(): void;
|
|
212
|
-
/**
|
|
213
|
-
* Resets the face capture manager to its initial `idle` state.
|
|
214
|
-
* Can be called from `error` state. Not available from `finished` (final state).
|
|
215
|
-
*/
|
|
216
|
-
reset(): void;
|
|
217
|
-
/**
|
|
218
|
-
* Retries the capture after an upload error.
|
|
219
|
-
* Only effective when in `capture.uploadError` state and `attemptsRemaining > 0`.
|
|
220
|
-
* If no attempts remaining, the transition is blocked.
|
|
221
|
-
*/
|
|
222
|
-
retryCapture(): void;
|
|
223
|
-
/**
|
|
224
|
-
* Captures a face in manual capture mode.
|
|
225
|
-
* Only effective when in `capture.detecting` state and `detectionStatus === 'manualCapture'`.
|
|
226
|
-
*/
|
|
227
|
-
capture(): void;
|
|
228
|
-
};
|
|
229
|
-
type FaceCaptureManager = ReturnType<typeof createFaceCaptureManager>;
|
|
230
|
-
//#endregion
|
|
231
|
-
export { FaceCaptureDependencies as a, DetectionStatus as i, FaceCaptureManagerState as n, FaceErrorCode as o, BaseFaceCaptureConfig as r, FaceCaptureManager as t };
|
package/dist/types-B4KNFqC4.d.ts
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
//#region ../infra/src/capabilities/IMLProviderCapability.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* Base configuration shared by all ML provider capabilities.
|
|
4
|
-
*/
|
|
5
|
-
interface MLProviderConfig {
|
|
6
|
-
/** Path to the WASM binary */
|
|
7
|
-
wasmPath?: string;
|
|
8
|
-
/** Path to the SIMD-optimized WASM binary (optional) */
|
|
9
|
-
wasmSimdPath?: string;
|
|
10
|
-
/** Path to the WASM glue code */
|
|
11
|
-
glueCodePath?: string;
|
|
12
|
-
/** Whether to use SIMD optimizations (default: true) */
|
|
13
|
-
useSimd?: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* Base path for ML model files. Models will be loaded from `${modelsBasePath}/${modelFileName}`.
|
|
16
|
-
* If not provided, models are expected in a 'models' subdirectory relative to the WASM binary.
|
|
17
|
-
*/
|
|
18
|
-
modelsBasePath?: string;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Base interface for ML provider capabilities.
|
|
22
|
-
* Provides common lifecycle and frame processing methods shared by
|
|
23
|
-
* FaceDetectionCapability and IdCaptureCapability.
|
|
24
|
-
*/
|
|
25
|
-
interface IMLProviderCapability<TConfig extends MLProviderConfig> {
|
|
26
|
-
/**
|
|
27
|
-
* Whether the provider has been initialized and is ready to process frames.
|
|
28
|
-
*/
|
|
29
|
-
readonly initialized: boolean;
|
|
30
|
-
/**
|
|
31
|
-
* Initializes the provider with the given configuration.
|
|
32
|
-
* If WASM was already warmed up via `setup()` or `warmupWasm()`, this returns almost instantly.
|
|
33
|
-
* @param config - Provider configuration including WASM paths
|
|
34
|
-
*/
|
|
35
|
-
initialize(config: TConfig): Promise<void>;
|
|
36
|
-
/**
|
|
37
|
-
* Processes a frame through the ML pipeline.
|
|
38
|
-
* Callbacks set via `setCallbacks()` will be invoked based on the analysis results.
|
|
39
|
-
* @param image - Image data to process
|
|
40
|
-
* @throws Error if provider is not initialized
|
|
41
|
-
*/
|
|
42
|
-
processFrame(image: ImageData): Promise<void>;
|
|
43
|
-
/**
|
|
44
|
-
* Resets the pipeline to its initial state.
|
|
45
|
-
* Safe to call even if not initialized (no-op in that case).
|
|
46
|
-
*/
|
|
47
|
-
reset(): void;
|
|
48
|
-
/**
|
|
49
|
-
* Disposes of resources and resets initialization state.
|
|
50
|
-
* Safe to call even if not initialized.
|
|
51
|
-
*/
|
|
52
|
-
dispose(): Promise<void>;
|
|
53
|
-
}
|
|
54
|
-
//#endregion
|
|
55
|
-
//#region ../infra/src/capabilities/IRecordingCapability.d.ts
|
|
56
|
-
type RecordingPublisher = {
|
|
57
|
-
getStreamId: () => string | undefined;
|
|
58
|
-
replaceVideoTrack: (track: MediaStreamTrack) => Promise<void>;
|
|
59
|
-
destroy: () => void;
|
|
60
|
-
};
|
|
61
|
-
type RecordingConnection = {
|
|
62
|
-
sessionId: string | undefined;
|
|
63
|
-
publisher: RecordingPublisher;
|
|
64
|
-
disconnect: () => Promise<void>;
|
|
65
|
-
};
|
|
66
|
-
type RecordingConnectionEvents = {
|
|
67
|
-
onSessionConnected?: (sessionId: string | undefined) => void;
|
|
68
|
-
onSessionDisconnected?: (sessionId: string | undefined) => void;
|
|
69
|
-
onSessionException?: (params: {
|
|
70
|
-
name?: string;
|
|
71
|
-
message?: string;
|
|
72
|
-
sessionId?: string;
|
|
73
|
-
}) => void;
|
|
74
|
-
onPublisherCreated?: (params: {
|
|
75
|
-
streamId?: string;
|
|
76
|
-
sessionId?: string;
|
|
77
|
-
}) => void;
|
|
78
|
-
onPublisherError?: (params: {
|
|
79
|
-
message?: string;
|
|
80
|
-
sessionId?: string;
|
|
81
|
-
streamId?: string;
|
|
82
|
-
}) => void;
|
|
83
|
-
};
|
|
84
|
-
type ConnectRecordingParams = {
|
|
85
|
-
sessionToken: string;
|
|
86
|
-
stream: MediaStream;
|
|
87
|
-
events?: RecordingConnectionEvents;
|
|
88
|
-
};
|
|
89
|
-
type IRecordingCapability = {
|
|
90
|
-
/**
|
|
91
|
-
* Connects to a recording session and publishes the provided media stream.
|
|
92
|
-
* Returns a connection handle that can be disconnected and used to manage the publisher.
|
|
93
|
-
*/
|
|
94
|
-
connect: (params: ConnectRecordingParams) => Promise<RecordingConnection>;
|
|
95
|
-
};
|
|
96
|
-
//#endregion
|
|
97
|
-
//#region ../infra/src/capabilities/IStorageCapability.d.ts
|
|
98
|
-
/**
|
|
99
|
-
* Storage capability interface for abstracting storage operations.
|
|
100
|
-
* Enables swapping between browser localStorage and future WASM-based storage.
|
|
101
|
-
*/
|
|
102
|
-
interface IStorageCapability {
|
|
103
|
-
/**
|
|
104
|
-
* Retrieves a value from storage.
|
|
105
|
-
* @param key - The storage key
|
|
106
|
-
* @returns The stored value or null if not found
|
|
107
|
-
*/
|
|
108
|
-
get<T>(key: string): Promise<T | null>;
|
|
109
|
-
/**
|
|
110
|
-
* Stores a value in storage.
|
|
111
|
-
* @param key - The storage key
|
|
112
|
-
* @param value - The value to store (will be serialized)
|
|
113
|
-
*/
|
|
114
|
-
set<T>(key: string, value: T): Promise<void>;
|
|
115
|
-
/**
|
|
116
|
-
* Removes a value from storage.
|
|
117
|
-
* @param key - The storage key to remove
|
|
118
|
-
*/
|
|
119
|
-
remove(key: string): Promise<void>;
|
|
120
|
-
/**
|
|
121
|
-
* Clears all values from storage.
|
|
122
|
-
*/
|
|
123
|
-
clear(): Promise<void>;
|
|
124
|
-
}
|
|
125
|
-
//#endregion
|
|
126
|
-
//#region src/internal/permissions/types.d.ts
|
|
127
|
-
type PermissionResult = 'granted' | 'denied' | 'prompt';
|
|
128
|
-
type PermissionStatus = 'idle' | 'requesting' | 'denied' | 'learnMore';
|
|
129
|
-
//#endregion
|
|
130
|
-
export { RecordingConnection as a, IRecordingCapability as i, PermissionStatus as n, IMLProviderCapability as o, IStorageCapability as r, MLProviderConfig as s, PermissionResult as t };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|