@incodetech/core 0.0.0-dev-20260817-acfa6f73 → 0.0.0-dev-20260817-941e76d2
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/{BrowserDiagnosticsCryptoProvider-Bm4ZX5t3.esm.js → BrowserDiagnosticsCryptoProvider-CPcF1K4D.esm.js} +1 -1
- package/dist/{BrowserStorageProvider-k-FDkC4W.esm.js → BrowserStorageProvider-C8847M9W.esm.js} +1 -1
- package/dist/FaceDetectionProvider-Cn1wS-sA.d.ts +95 -0
- package/dist/{IIdCaptureCapability-DHTT3FC2.d.ts → IIdCaptureCapability-DDWlQzhi.d.ts} +2 -32
- package/dist/IWasmUtilCapability-5-Pncgma.d.ts +149 -0
- package/dist/{MotionSensorProvider-DGiV77J_.esm.js → MotionSensorProvider-CxTjgXe6.esm.js} +1 -1
- package/dist/ae-signature.esm.js +1 -1
- package/dist/{apiError-B3T64yxT.esm.js → apiError-B3TI9TK9.esm.js} +1 -1
- package/dist/authentication.d.ts +3 -3
- package/dist/authentication.esm.js +2 -2
- package/dist/{authenticationManager-CVURxKl7.esm.js → authenticationManager-BL7RvcC8.esm.js} +4 -4
- package/dist/{authenticationManager-D8DEugXP.d.ts → authenticationManager-Cb4b4dgt.d.ts} +1 -1
- package/dist/{authenticationStateMachine-B-0XBXp-.esm.js → authenticationStateMachine-D1XsBKTx.esm.js} +2 -2
- package/dist/avatar.d.ts +1 -2
- package/dist/camera.esm.js +1 -1
- package/dist/createFaceAvatar-pUEkdk4X.d.ts +489 -0
- package/dist/curp-validation.d.ts +1 -1
- package/dist/{curpValidationManager-BxWhpCLA.d.ts → curpValidationManager-C_TQjX2P.d.ts} +1 -1
- package/dist/{deepsightLoader-C9G0gmwl.esm.js → deepsightLoader-BnU_V6rk.esm.js} +6 -6
- package/dist/{deepsightService-DLVQS_RH.d.ts → deepsightService-Dr7sNZ5r.d.ts} +2 -1
- package/dist/document-capture.d.ts +2 -2
- package/dist/document-capture.esm.js +2 -2
- package/dist/document-upload.d.ts +4 -4
- package/dist/{documentCaptureManager-CaXWUo_N.esm.js → documentCaptureManager-D7A4k-GE.esm.js} +1 -1
- package/dist/{documentCaptureManager-Bvipl_tY.d.ts → documentCaptureManager-DlGYd-sJ.d.ts} +67 -67
- package/dist/{documentCaptureStateMachine-DpWiaUPB.esm.js → documentCaptureStateMachine-fk7MDfSZ.esm.js} +2 -2
- package/dist/dynamic-forms.d.ts +2 -2
- package/dist/dynamic-forms.esm.js +2 -2
- package/dist/{dynamicFormsManager-CIFvUb6Q.esm.js → dynamicFormsManager-CH1eSNvy.esm.js} +1 -1
- package/dist/{dynamicFormsManager-fhK0yINk.d.ts → dynamicFormsManager-DhveFHPS.d.ts} +1 -1
- package/dist/{dynamicFormsStateMachine-C8_koaQ2.esm.js → dynamicFormsStateMachine-D144f-2m.esm.js} +1 -1
- package/dist/ekyb.d.ts +1 -1
- package/dist/ekyb.esm.js +3 -3
- package/dist/{ekybManager-DvHK24Ai.esm.js → ekybManager-BBJwCOsR.esm.js} +1 -1
- package/dist/{ekybStateMachine-Bd9SGUOZ.esm.js → ekybStateMachine-jym81TFF.esm.js} +1 -1
- package/dist/electronic-signature.esm.js +1 -1
- package/dist/{electronicSignatureManager-DdhVjAVe.esm.js → electronicSignatureManager-CWYfI4hO.esm.js} +1 -1
- package/dist/extensibility.d.ts +14 -12
- package/dist/extensibility.esm.js +12 -12
- package/dist/{faceCaptureManagerFactory-fq0Rl3ik.d.ts → faceCaptureManagerFactory-CKyaVKsu.d.ts} +17 -45
- package/dist/{faceCaptureManagerFactory-9X4WspD-.esm.js → faceCaptureManagerFactory-DysNuSGO.esm.js} +3 -3
- package/dist/{faceCaptureSetup-D1xDWdEi.esm.js → faceCaptureSetup-DXCPmEv2.esm.js} +4 -4
- package/dist/flow-events.d.ts +1 -1
- package/dist/flow.d.ts +8 -8
- package/dist/flow.esm.js +3 -3
- package/dist/{flowCompletionService-CBCd4sTT.esm.js → flowCompletionService-DvWL2nH-.esm.js} +1 -1
- package/dist/{flowServices-Clyz_AFS.esm.js → flowServices-CAz3XO92.esm.js} +3 -3
- package/dist/geolocation.esm.js +2 -2
- package/dist/{geolocationManager-Dnp8XTcy.esm.js → geolocationManager-CPwKn86Q.esm.js} +1 -1
- package/dist/{geolocationStateMachine-BBMCEfv9.esm.js → geolocationStateMachine-Cm28EW1O.esm.js} +1 -1
- package/dist/home.d.ts +1 -1
- package/dist/id-selfie-flow.d.ts +3 -2
- package/dist/id-selfie-flow.esm.js +8 -8
- package/dist/id.d.ts +3 -3
- package/dist/id.esm.js +4 -4
- package/dist/{idCaptureDefaults-WeHbQM7W.esm.js → idCaptureDefaults-Dowxd3J3.esm.js} +4 -3
- package/dist/{idCaptureManager-BG07OgVe.esm.js → idCaptureManager-BuFn4xQl.esm.js} +5 -5
- package/dist/{idCaptureManager-DVWM-L4V.d.ts → idCaptureManager-DlCqj6R1.d.ts} +4 -4
- package/dist/{idCaptureServices-CqRJOcig.esm.js → idCaptureServices-Bn656NFx.esm.js} +3 -3
- package/dist/{idCaptureStateMachine-DhnmhN0s.esm.js → idCaptureStateMachine-CBpdXe7D.esm.js} +9 -9
- package/dist/{index-Bivs6yJF.d.ts → index-BwudEtre.d.ts} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/mandatory-consent.d.ts +2 -2
- package/dist/{mandatoryConsentManager-CVxw-noP.d.ts → mandatoryConsentManager-BZpKPJ1b.d.ts} +1 -1
- package/dist/{onDeviceFaceResults-DnxtQAz3.esm.js → onDeviceFaceResults-DT9SoUq7.esm.js} +4 -4
- package/dist/{permissionGuards-D2OgV9XX.esm.js → permissionGuards-BEgOUwwQ.esm.js} +1 -1
- package/dist/{permissionServices-B7sMtZ8f.esm.js → permissionServices-BPUkbztJ.esm.js} +2 -2
- package/dist/personhood.d.ts +5 -4
- package/dist/personhood.esm.js +6 -6
- package/dist/qe-signature.esm.js +1 -1
- package/dist/{recordingService-0VWL71An.esm.js → recordingService-DgwNVrR4.esm.js} +1 -1
- package/dist/{runChildModule-Dlr2Kwvn.esm.js → runChildModule-BCd-d039.esm.js} +1 -1
- package/dist/{safeStorage-Ep56I-f_.esm.js → safeStorage-2nOSCCnG.esm.js} +43 -70
- package/dist/selfie.d.ts +4 -4
- package/dist/selfie.esm.js +6 -6
- package/dist/{selfieManager-CsFpBfry.esm.js → selfieManager-DfeUZfgL.esm.js} +4 -4
- package/dist/{selfieManager-DlAKn0rp.d.ts → selfieManager-Dxj984_L.d.ts} +2 -11
- package/dist/{selfieStateMachine-DWDmcet8.esm.js → selfieStateMachine-CHSNxzhO.esm.js} +2 -2
- package/dist/{session-BuGZN95Y.esm.js → session-CuM9od2S.esm.js} +4 -4
- package/dist/session.d.ts +1 -9
- package/dist/session.esm.js +4 -4
- package/dist/{sessionInitializer-ShclX9vD.esm.js → sessionInitializer-D_B-8Ujt.esm.js} +2 -2
- package/dist/{setup-DywQeePQ.d.ts → setup-BwA7zG5D.d.ts} +19 -31
- package/dist/{setup-1lLa3WHQ.esm.js → setup-y1bXyMoz.esm.js} +14 -8
- package/dist/trueSight-lNCajJAf.esm.js +1 -0
- package/dist/{trueSightService-CNuiVjvN.esm.js → trueSightService-zTWODJoh.esm.js} +4 -4
- package/dist/{types-GqIocZi-.d.ts → types-BUdX2CB-.d.ts} +5 -4
- package/dist/{types-8LPRL1Ni2.d.ts → types-BlrYfFj3.d.ts} +1 -1
- package/dist/types-OehE3PKn.d.ts +6 -0
- package/dist/{types-Cyiwbg-r.d.ts → types-RMhiEIm9.d.ts} +4 -80
- package/dist/types-W5OCjqmi.d.ts +10 -0
- package/dist/{types-CRw2IBPn.d.ts → types-s0fF3TpX.d.ts} +1 -0
- package/dist/video-selfie.d.ts +3 -3
- package/dist/video-selfie.esm.js +4 -4
- package/dist/{videoSelfieCameraWarmer-C95ZbuSU.esm.js → videoSelfieCameraWarmer-Da9lJmK8.esm.js} +4 -4
- package/dist/{videoSelfieStepDetector-TyrYWahm.d.ts → videoSelfieStepDetector-Bw5t6XCU.d.ts} +4 -3
- package/dist/warmup-CXHBgvFC.d.ts +117 -0
- package/dist/wasm.d.ts +23 -5
- package/dist/wasm.esm.js +31 -4
- package/dist/{wasmDefaults-DTUrftxR.esm.js → wasmDefaults-BrwMccqW.esm.js} +27 -12
- package/dist/{wasmDsFlagSync-BqUCwLY8.esm.js → wasmDsFlagSync-Dd7Yj25O.esm.js} +1 -1
- package/dist/{wasmWebClient-DM8lkb0z.esm.js → wasmWebClient-BzFsDjU6.esm.js} +82 -22
- package/dist/workflow.d.ts +5 -5
- package/dist/workflow.esm.js +15 -15
- package/package.json +1 -1
- package/dist/FaceDetectionProvider-Mh6q3EbA.d.ts +0 -349
- package/dist/IFaceAvatarCapability-BrL19G0s.d.ts +0 -23
- package/dist/IStorageCapability-ORkQfK3F.d.ts +0 -242
- package/dist/createFaceAvatar-BEj18KXi.d.ts +0 -50
- package/dist/trueSight-BxA2W2OB.esm.js +0 -1
- package/dist/types-C2JzKH_L.d.ts +0 -6
- package/dist/warmup-Dv2alr2-.d.ts +0 -82
- /package/dist/{types-BSBzhHRH.d.ts → types-BSBzhHRH2.d.ts} +0 -0
- /package/dist/{types-DelMqZLe2.d.ts → types-DelMqZLe.d.ts} +0 -0
|
@@ -1,82 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
4
|
-
import { n as Flow, s as SelfieConcealmentOption } from "./types-CRw2IBPn.js";
|
|
5
|
-
//#region ../infra/src/capabilities/IWasmUtilCapability.d.ts
|
|
6
|
-
type WasmUtilConfig = MLProviderConfig & {
|
|
7
|
-
pipelines?: WasmPipeline[];
|
|
8
|
-
};
|
|
9
|
-
type VirtualCameraCheckOutput = {
|
|
10
|
-
canvas: HTMLCanvasElement | null;
|
|
11
|
-
itr: boolean | null;
|
|
12
|
-
skipped: boolean | null;
|
|
13
|
-
};
|
|
14
|
-
type IWasmUtilCapability = {
|
|
15
|
-
/**
|
|
16
|
-
* Whether the provider has been initialized and is ready to be used.
|
|
17
|
-
*/
|
|
18
|
-
readonly initialized: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Initializes the provider with the given configuration.
|
|
21
|
-
* If WASM was already warmed up via `warmupWasm()`, this returns almost instantly.
|
|
22
|
-
* @param config - Provider configuration including WASM paths
|
|
23
|
-
*/
|
|
24
|
-
initialize(config: WasmUtilConfig): Promise<void>;
|
|
25
|
-
/**
|
|
26
|
-
* Encrypts a base64 image using the WASM utility API.
|
|
27
|
-
* @param image - Base64 image string (no data URL prefix)
|
|
28
|
-
* @returns Encrypted string
|
|
29
|
-
*/
|
|
30
|
-
encryptImage(image: string): string;
|
|
31
|
-
setSdkVersion(version: string): void;
|
|
32
|
-
setSdkPlatform(platform: string): void;
|
|
33
|
-
setDeviceInfo(deviceInfo: object, overrideExisting?: boolean): void;
|
|
34
|
-
setBrowserInfo(browserInfo: object, overrideExisting?: boolean): void;
|
|
35
|
-
setCameraInfo(cameraInfo: object, overrideExisting?: boolean): void;
|
|
36
|
-
setMotionStatus(status: string): void;
|
|
37
|
-
setBackgroundMode(backgroundMode: boolean): void;
|
|
38
|
-
/**
|
|
39
|
-
* Enables on-device mode: the native WASM module skips full fingerprint
|
|
40
|
-
* collection and keeps only the device-detection DTO. Additive; default off.
|
|
41
|
-
*/
|
|
42
|
-
setOnDeviceMode(enabled: boolean): void;
|
|
43
|
-
setZc(zc: string): void;
|
|
44
|
-
setInspectorOpened(opened: boolean): void;
|
|
45
|
-
/**
|
|
46
|
-
* Returns whether the DevTools inspector has been detected as open.
|
|
47
|
-
* Safe to call before WASM initialization (returns the in-memory flag).
|
|
48
|
-
*/
|
|
49
|
-
getInspectorOpened(): boolean;
|
|
50
|
-
/**
|
|
51
|
-
* Toggles the WASM module's production mode. When `true`, the native module
|
|
52
|
-
* suppresses its verbose debug logging/console output.
|
|
53
|
-
*/
|
|
54
|
-
setProductionMode(productionMode: boolean): Promise<void>;
|
|
55
|
-
getMetadata(): string;
|
|
56
|
-
analyzeFrame(image: ImageData): Promise<void>;
|
|
57
|
-
getCheck(): string;
|
|
58
|
-
/**
|
|
59
|
-
* Gets the current pipeline state. Must be called before setMotionStatus(),
|
|
60
|
-
* getCheck(), setBackgroundMode(), and getMetadata() for proper metadata generation.
|
|
61
|
-
*/
|
|
62
|
-
getPipelineState(): string;
|
|
63
|
-
estimatePerformance(): string;
|
|
64
|
-
isVirtualCamera(label: string | null): boolean;
|
|
65
|
-
prc(): Promise<void>;
|
|
66
|
-
poc(output: VirtualCameraCheckOutput): Promise<void>;
|
|
67
|
-
rsp(): Promise<void>;
|
|
68
|
-
ssl(): void;
|
|
69
|
-
stl(): void;
|
|
70
|
-
osv(): void;
|
|
71
|
-
oev(): void;
|
|
72
|
-
ckvcks(data: ArrayBuffer): void;
|
|
73
|
-
getVersions(): Promise<unknown>;
|
|
74
|
-
/**
|
|
75
|
-
* Disposes of resources and resets initialization state.
|
|
76
|
-
*/
|
|
77
|
-
dispose(): Promise<void>;
|
|
78
|
-
};
|
|
79
|
-
//#endregion
|
|
1
|
+
import { a as AvatarAssetsOverrides } from "./createFaceAvatar-pUEkdk4X.js";
|
|
2
|
+
import { n as Flow, s as SelfieConcealmentOption } from "./types-s0fF3TpX.js";
|
|
3
|
+
import { a as IRecordingCapability, i as IStorageCapability, t as IWasmUtilCapability } from "./IWasmUtilCapability-5-Pncgma.js";
|
|
80
4
|
//#region src/internal/faceCapture/types.d.ts
|
|
81
5
|
type CameraResolution = {
|
|
82
6
|
width?: number;
|
|
@@ -204,4 +128,4 @@ declare const FACE_ERROR_CODES: {
|
|
|
204
128
|
};
|
|
205
129
|
type FaceErrorCode = (typeof FACE_ERROR_CODES)[keyof typeof FACE_ERROR_CODES];
|
|
206
130
|
//#endregion
|
|
207
|
-
export { FaceCapturedImageData as a,
|
|
131
|
+
export { FaceCapturedImageData as a, FaceCaptureOnlyResponse as i, DetectionStatus as n, FaceErrorCode as o, FaceCaptureDependencies as r, BaseFaceCaptureConfig as t };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { a as RegulationTypes } from "./types-s0fF3TpX.js";
|
|
2
|
+
//#region src/internal/fingerprint/types.d.ts
|
|
3
|
+
type DeviceFingerprintResult = {
|
|
4
|
+
success: boolean;
|
|
5
|
+
sessionStatus: string;
|
|
6
|
+
showMandatoryConsent?: boolean;
|
|
7
|
+
regulationType?: RegulationTypes;
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
export { DeviceFingerprintResult as t };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { t as DocumentUploadConfig } from "./types-Vb4P9ovf.js";
|
|
2
2
|
import { s as RiskAddon } from "./types-Bk_6dmDa.js";
|
|
3
|
+
import "./createFaceAvatar-pUEkdk4X.js";
|
|
3
4
|
//#region src/internal/avatar/concealment.d.ts
|
|
4
5
|
/**
|
|
5
6
|
* Backend-aligned selfie/auth face-concealment options. The backend returns a
|
package/dist/video-selfie.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as WasmPipeline } from "./warmup-CXHBgvFC.js";
|
|
2
2
|
import { A as StateMachine, _ as MachineContext, c as AnyEventObject, p as EventObject, v as MetaObject, y as NonReducibleUnknown } from "./spawn-D9jgw9pW.js";
|
|
3
3
|
import "./StateMachine-EDpYWy0i.js";
|
|
4
4
|
import "./Actor-iTq7YY48.js";
|
|
5
5
|
import { t as CameraStream } from "./camera-9wWD-pwg.js";
|
|
6
|
-
import { t as DetectionOrientation } from "./IIdCaptureCapability-
|
|
7
|
-
import { a as FacingMode, i as CameraCompositor, n as VideoSelfieDetectionStatus, o as VideoSelfieConfig, r as VideoSelfieValidationFailure, s as VideoSelfieStep, t as StepDetector } from "./videoSelfieStepDetector-
|
|
6
|
+
import { t as DetectionOrientation } from "./IIdCaptureCapability-DDWlQzhi.js";
|
|
7
|
+
import { a as FacingMode, i as CameraCompositor, n as VideoSelfieDetectionStatus, o as VideoSelfieConfig, r as VideoSelfieValidationFailure, s as VideoSelfieStep, t as StepDetector } from "./videoSelfieStepDetector-Bw5t6XCU.js";
|
|
8
8
|
//#region src/internal/recordings/multipartRecordingService.d.ts
|
|
9
9
|
type MultipartRecordingResult = {
|
|
10
10
|
/**
|
package/dist/video-selfie.esm.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { r as WasmUtilProvider } from "./safeStorage-
|
|
2
|
-
import {
|
|
1
|
+
import { r as WasmUtilProvider } from "./safeStorage-2nOSCCnG.esm.js";
|
|
2
|
+
import { d as initiateVideoSelfieUpload, f as uploadVideoSelfiePart, l as abortVideoSelfieUpload, t as ensureWasmPipelines, u as completeVideoSelfieUpload } from "./setup-y1bXyMoz.esm.js";
|
|
3
3
|
import { t as BrowserTimerProvider } from "./BrowserTimerProvider-BXhgNxLt.esm.js";
|
|
4
4
|
import { t as api } from "./api-Bx3gKW_y.esm.js";
|
|
5
5
|
import { t as endpoints } from "./endpoints-CCzL3XD_.esm.js";
|
|
6
|
-
import { d as videoSelfieWasmPipelines, l as facingModeForStep, u as resolveVideoSelfieSteps } from "./flowServices-
|
|
6
|
+
import { d as videoSelfieWasmPipelines, l as facingModeForStep, u as resolveVideoSelfieSteps } from "./flowServices-CAz3XO92.esm.js";
|
|
7
7
|
import { c as createManager, o as createActor, r as assign, t as setup } from "./xstate.esm-Cf4e0Cfd.esm.js";
|
|
8
8
|
import { n as fromPromise, t as fromCallback } from "./xstate-actors.esm-CtI5S0f4.esm.js";
|
|
9
9
|
import { n as getSupportedMediaRecorderMimeType } from "./mediaRecorderOptions-vXDI73LZ.esm.js";
|
|
10
|
-
import { i as createDefaultStepDetector, n as defaultAcquireCamera, o as isConnectionError, r as CameraCompositor, t as createVideoSelfieCameraWarmer } from "./videoSelfieCameraWarmer-
|
|
10
|
+
import { i as createDefaultStepDetector, n as defaultAcquireCamera, o as isConnectionError, r as CameraCompositor, t as createVideoSelfieCameraWarmer } from "./videoSelfieCameraWarmer-Da9lJmK8.esm.js";
|
|
11
11
|
//#region ../infra/src/providers/browser/MultipartRecordingProvider.ts
|
|
12
12
|
/**
|
|
13
13
|
* How often `MediaRecorder` hands us buffered data (incremental blobs).
|
package/dist/{videoSelfieCameraWarmer-C95ZbuSU.esm.js → videoSelfieCameraWarmer-Da9lJmK8.esm.js}
RENAMED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { t as BrowserTimerProvider } from "./BrowserTimerProvider-BXhgNxLt.esm.js";
|
|
2
2
|
import { t as api } from "./api-Bx3gKW_y.esm.js";
|
|
3
3
|
import { t as endpoints } from "./endpoints-CCzL3XD_.esm.js";
|
|
4
|
-
import { l as facingModeForStep, u as resolveVideoSelfieSteps } from "./flowServices-
|
|
4
|
+
import { l as facingModeForStep, u as resolveVideoSelfieSteps } from "./flowServices-CAz3XO92.esm.js";
|
|
5
5
|
import { i as requestCameraWithFallback, r as requestCameraAccess } from "./camera-_2sXMXiF.esm.js";
|
|
6
|
-
import { t as checkPermission } from "./permissionServices-
|
|
7
|
-
import { _ as StreamCanvasProcessingSession, a as encryptSelfieImage, l as startDetection, v as FaceDetectionProvider } from "./onDeviceFaceResults-
|
|
6
|
+
import { t as checkPermission } from "./permissionServices-BPUkbztJ.esm.js";
|
|
7
|
+
import { _ as StreamCanvasProcessingSession, a as encryptSelfieImage, l as startDetection, v as FaceDetectionProvider } from "./onDeviceFaceResults-DT9SoUq7.esm.js";
|
|
8
8
|
import { n as getBackCameraStream } from "./backCameraStream-BMGalshK.esm.js";
|
|
9
9
|
import { n as getWindowDimensions } from "./getDeviceClass-CeBiEayS.esm.js";
|
|
10
10
|
import { t as FACE_ERROR_CODES } from "./types-BN5RPPIZ.esm.js";
|
|
11
11
|
import { a as uploadSelfie, r as processFace, t as getFaceErrorCodeFromUnknown } from "./selfieErrorUtils-ArUCoICg.esm.js";
|
|
12
12
|
import { t as StreamCanvasCapture } from "./StreamCanvasCapture-D2XcXCZ4.esm.js";
|
|
13
|
-
import { n as DEFAULT_ID_CAPTURE_THRESHOLDS, r as IdCaptureProvider, t as DEFAULT_ID_CAPTURE_GEOMETRY } from "./idCaptureDefaults-
|
|
13
|
+
import { n as DEFAULT_ID_CAPTURE_THRESHOLDS, r as IdCaptureProvider, t as DEFAULT_ID_CAPTURE_GEOMETRY } from "./idCaptureDefaults-Dowxd3J3.esm.js";
|
|
14
14
|
//#region src/modules/video-selfie/videoSelfieCompareService.ts
|
|
15
15
|
async function postVideoSelfieCompare(endpoint, base64Image) {
|
|
16
16
|
return (await api.post(endpoint, { base64Image })).data;
|
package/dist/{videoSelfieStepDetector-TyrYWahm.d.ts → videoSelfieStepDetector-Bw5t6XCU.d.ts}
RENAMED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { t as CameraStream } from "./camera-9wWD-pwg.js";
|
|
2
|
-
import { i as FlowModuleConfig } from "./types-
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
2
|
+
import { i as FlowModuleConfig } from "./types-s0fF3TpX.js";
|
|
3
|
+
import "./IWasmUtilCapability-5-Pncgma.js";
|
|
4
|
+
import { n as DetectionStatus } from "./types-RMhiEIm9.js";
|
|
5
|
+
import { t as DetectionOrientation } from "./IIdCaptureCapability-DDWlQzhi.js";
|
|
5
6
|
//#region src/modules/video-selfie/types.d.ts
|
|
6
7
|
/**
|
|
7
8
|
* The capture steps a Video Selfie session can run, in flow order. Which steps
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
//#region ../infra/src/wasm/wasmAssets.d.ts
|
|
2
|
+
type WasmSource = string | ArrayBuffer | Uint8Array;
|
|
3
|
+
type WasmGlueModule = {
|
|
4
|
+
Module?: unknown;
|
|
5
|
+
};
|
|
6
|
+
type WasmGlueLoader = () => Promise<WasmGlueModule>;
|
|
7
|
+
type WasmPipeline = 'selfie' | 'onDeviceSelfie' | 'idCapture' | 'videoSelfie' | 'videoSelfieId';
|
|
8
|
+
declare const WASM_MODEL_FILES: {
|
|
9
|
+
readonly idCapture: "id_capture_2_01_fp16.ortmodelv2";
|
|
10
|
+
readonly idFiqa: "id_fiqa_19a81a0b9bf6492eb03b4667f6db4c85_fp16.ortmodelv2";
|
|
11
|
+
readonly barcode: "barcode_enhance_896x224_fp16.ortmodelv2";
|
|
12
|
+
readonly selfie: "selfie_bf_angles_192x192_opset9_fp16.ortmodelv2";
|
|
13
|
+
readonly faceAttributes: "face_attributes_v1_3_fp16.ortmodelv2";
|
|
14
|
+
readonly faceOcclusion: "face_occlusion_v0_2_fp16.ortmodelv2";
|
|
15
|
+
readonly mlsRegressor: "mls_regressor_4773007c657b4f05a460321456740d0f_fp16.ortmodelv2";
|
|
16
|
+
readonly liveness: "ondevice_physical_liveness_v2_1_fp16.ortmodelv2";
|
|
17
|
+
readonly ageEstimation: "age_estimation_v2_2_2_fp16.ortmodelv2";
|
|
18
|
+
};
|
|
19
|
+
type WasmModelName = keyof typeof WASM_MODEL_FILES;
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region ../infra/src/wasm/apiUtilities.d.ts
|
|
22
|
+
declare global {
|
|
23
|
+
interface Window {
|
|
24
|
+
Module?: WasmGlueFactory;
|
|
25
|
+
wasmArrayBuffer: Uint8Array | null;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/** Opaque handle for the loaded WASM module instance. */
|
|
29
|
+
type WasmModule = Record<string, unknown>;
|
|
30
|
+
type WasmGlueFactory = () => Promise<WasmModule>;
|
|
31
|
+
/**
|
|
32
|
+
* Binary and glue configuration for one WASM module instance.
|
|
33
|
+
*
|
|
34
|
+
* The ML pipeline and HTTP client share this object because both consumers
|
|
35
|
+
* use the same memoized module.
|
|
36
|
+
*/
|
|
37
|
+
type WasmModuleConfig = {
|
|
38
|
+
/** URL or bytes for the standard WASM binary. */
|
|
39
|
+
wasmPath: WasmSource;
|
|
40
|
+
/**
|
|
41
|
+
* URL or bytes for the SIMD WASM binary.
|
|
42
|
+
*
|
|
43
|
+
* When omitted, the loader uses `wasmPath` and skips the SIMD attempt.
|
|
44
|
+
*/
|
|
45
|
+
wasmSimdPath?: WasmSource;
|
|
46
|
+
/** URL of the JavaScript glue paired with `wasmPath`. */
|
|
47
|
+
glueCodePath: string;
|
|
48
|
+
/**
|
|
49
|
+
* URL of the JavaScript glue paired with `wasmSimdPath`.
|
|
50
|
+
*
|
|
51
|
+
* When omitted or empty, the loader derives a sibling `.js` URL from
|
|
52
|
+
* `wasmSimdPath`.
|
|
53
|
+
*/
|
|
54
|
+
glueCodeSimdPath?: string;
|
|
55
|
+
/** Lazy ES-module loader for the standard JavaScript glue. */
|
|
56
|
+
loadGlue?: WasmGlueLoader;
|
|
57
|
+
/** Lazy ES-module loader for the SIMD JavaScript glue. */
|
|
58
|
+
loadGlueSimd?: WasmGlueLoader;
|
|
59
|
+
/**
|
|
60
|
+
* Enables the SIMD-first load attempt.
|
|
61
|
+
*
|
|
62
|
+
* Defaults to `true`. If SIMD loading fails, the loader uses the standard
|
|
63
|
+
* binary and glue pair.
|
|
64
|
+
*/
|
|
65
|
+
useSimd?: boolean;
|
|
66
|
+
};
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region ../infra/src/wasm/warmup.d.ts
|
|
69
|
+
type WasmModelsConfig = {
|
|
70
|
+
/** Root URL that contains the model files. */
|
|
71
|
+
modelsBasePath?: string;
|
|
72
|
+
/** Fully resolved source for each model filename. */
|
|
73
|
+
modelUrls?: Readonly<Record<string, WasmSource>>;
|
|
74
|
+
/** Prevents unresolved models from falling back to the Incode CDN. */
|
|
75
|
+
selfHosted?: boolean;
|
|
76
|
+
};
|
|
77
|
+
type WarmupConfig = WasmModuleConfig & WasmModelsConfig & {
|
|
78
|
+
/** Root URL of a directory that contains binaries, glue, and models. */
|
|
79
|
+
basePath?: string;
|
|
80
|
+
/** Pipelines whose model bundles load during this warmup. */
|
|
81
|
+
pipelines?: readonly WasmPipeline[];
|
|
82
|
+
/** Model filename overrides for individual pipelines. */
|
|
83
|
+
pipelineModels?: Partial<Record<WasmPipeline, string[]>>;
|
|
84
|
+
/** Limits native initialization to the on-device device-information mode. */
|
|
85
|
+
onDeviceMode?: boolean;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Preloads WASM binary and ML models at app startup.
|
|
89
|
+
* Runs asynchronously - app can continue while WASM loads in background.
|
|
90
|
+
*
|
|
91
|
+
* Model files are automatically loaded based on the pipeline type.
|
|
92
|
+
* By default, models are expected in a 'models' subdirectory relative to the WASM binary.
|
|
93
|
+
*
|
|
94
|
+
* @param config - Configuration for WASM warmup
|
|
95
|
+
* @returns Promise that resolves when WASM is ready
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* ```ts
|
|
99
|
+
* // Basic usage - models loaded from /wasm/v2/models/
|
|
100
|
+
* warmupWasm({
|
|
101
|
+
* wasmPath: '/wasm/v2/ml-wasm.wasm',
|
|
102
|
+
* glueCodePath: '/wasm/v2/ml-wasm.js',
|
|
103
|
+
* pipelines: ['selfie', 'idCapture'],
|
|
104
|
+
* });
|
|
105
|
+
*
|
|
106
|
+
* // With explicit models path
|
|
107
|
+
* warmupWasm({
|
|
108
|
+
* wasmPath: '/wasm/v2/ml-wasm.wasm',
|
|
109
|
+
* glueCodePath: '/wasm/v2/ml-wasm.js',
|
|
110
|
+
* modelsBasePath: 'https://cdn.example.com/wasm/v2/models',
|
|
111
|
+
* pipelines: ['selfie'],
|
|
112
|
+
* });
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
115
|
+
declare function warmupWasm(config: WarmupConfig): Promise<void>;
|
|
116
|
+
//#endregion
|
|
117
|
+
export { WASM_MODEL_FILES as a, WasmPipeline as c, WasmModuleConfig as i, WasmSource as l, WasmModelsConfig as n, WasmGlueLoader as o, warmupWasm as r, WasmModelName as s, WarmupConfig as t };
|
package/dist/wasm.d.ts
CHANGED
|
@@ -1,16 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { a as WASM_MODEL_FILES, c as WasmPipeline, l as WasmSource, o as WasmGlueLoader, r as warmupWasm, s as WasmModelName, t as WarmupConfig } from "./warmup-CXHBgvFC.js";
|
|
2
|
+
import { c as setWasmConfig, i as initializeWasmUtil, n as WasmConfig, r as ensureWasmPipelines, s as resolveWasmConfigForPipelines, u as upgradeToWasmHttpClient } from "./setup-BwA7zG5D.js";
|
|
3
3
|
//#region ../infra/src/wasm/wasmDefaults.d.ts
|
|
4
4
|
/** The WASM version bundled and tested with this SDK release. */
|
|
5
5
|
declare const DEFAULT_WASM_VERSION = "v2.14.07-post7-post3";
|
|
6
|
+
type UrlWasmConfig = WarmupConfig & {
|
|
7
|
+
wasmPath: string;
|
|
8
|
+
wasmSimdPath: string;
|
|
9
|
+
glueCodePath: string;
|
|
10
|
+
glueCodeSimdPath: string;
|
|
11
|
+
modelsBasePath: string;
|
|
12
|
+
};
|
|
6
13
|
/** Builds a WarmupConfig from a directory that mirrors the ml-wasm-kit CDN layout. */
|
|
7
|
-
declare function buildWasmConfigFromBasePath(basePath: string):
|
|
14
|
+
declare function buildWasmConfigFromBasePath(basePath: string): UrlWasmConfig;
|
|
8
15
|
/** Builds the standard WarmupConfig from the Incode CDN. */
|
|
9
|
-
declare function buildDefaultWasmConfig():
|
|
16
|
+
declare function buildDefaultWasmConfig(): UrlWasmConfig;
|
|
10
17
|
/**
|
|
11
18
|
* Merges optional WASM path overrides with CDN defaults. Explicit non-blank
|
|
12
19
|
* paths take precedence. Blank override strings log a warning and fall back to defaults.
|
|
13
20
|
*/
|
|
14
21
|
declare function resolveWasmConfig(overrides?: Partial<WarmupConfig>): WarmupConfig;
|
|
15
22
|
//#endregion
|
|
16
|
-
|
|
23
|
+
//#region src/defineWasm.d.ts
|
|
24
|
+
type DefineWasmOptions = {
|
|
25
|
+
pipelines: readonly WasmPipeline[];
|
|
26
|
+
wasm: WasmSource;
|
|
27
|
+
wasmSimd?: WasmSource;
|
|
28
|
+
glue: WasmGlueLoader;
|
|
29
|
+
glueSimd?: WasmGlueLoader;
|
|
30
|
+
models: Partial<Record<WasmModelName, WasmSource>>;
|
|
31
|
+
};
|
|
32
|
+
declare function defineWasm(options: DefineWasmOptions): WasmConfig;
|
|
33
|
+
//#endregion
|
|
34
|
+
export { DEFAULT_WASM_VERSION, type DefineWasmOptions, WASM_MODEL_FILES, type WasmConfig, type WasmModelName, type WasmPipeline, type WasmSource, buildDefaultWasmConfig, buildWasmConfigFromBasePath, defineWasm, ensureWasmPipelines, initializeWasmUtil, resolveWasmConfig, resolveWasmConfigForPipelines, setWasmConfig, upgradeToWasmHttpClient, warmupWasm };
|
package/dist/wasm.esm.js
CHANGED
|
@@ -1,4 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { d as WASM_MODEL_FILES, f as WASM_PIPELINE_LAZY_MODEL_NAMES, m as WASM_PIPELINE_MODEL_NAMES } from "./wasmWebClient-BzFsDjU6.esm.js";
|
|
2
|
+
import { a as resolveWasmConfig, n as buildDefaultWasmConfig, r as buildWasmConfigFromBasePath, t as DEFAULT_WASM_VERSION } from "./wasmDefaults-BrwMccqW.esm.js";
|
|
3
|
+
import { s as warmupWasm } from "./safeStorage-2nOSCCnG.esm.js";
|
|
4
|
+
import { a as resolveWasmConfigForPipelines, c as upgradeToWasmHttpClient, n as initializeWasmUtil, o as setWasmConfig, t as ensureWasmPipelines } from "./setup-y1bXyMoz.esm.js";
|
|
5
|
+
//#region src/defineWasm.ts
|
|
6
|
+
function requiredModels(pipelines) {
|
|
7
|
+
const models = /* @__PURE__ */ new Set();
|
|
8
|
+
for (const pipeline of pipelines) {
|
|
9
|
+
for (const model of WASM_PIPELINE_MODEL_NAMES[pipeline]) models.add(model);
|
|
10
|
+
for (const model of WASM_PIPELINE_LAZY_MODEL_NAMES[pipeline]) models.add(model);
|
|
11
|
+
}
|
|
12
|
+
return models;
|
|
13
|
+
}
|
|
14
|
+
function defineWasm(options) {
|
|
15
|
+
if (options.wasmSimd === void 0 !== (options.glueSimd === void 0)) throw new Error("[Incode SDK] wasmSimd and glueSimd must be provided together.");
|
|
16
|
+
for (const model of requiredModels(options.pipelines)) if (options.models[model] === void 0) throw new Error(`[Incode SDK] The self-hosted WASM configuration is missing the "${model}" model.`);
|
|
17
|
+
const modelUrls = {};
|
|
18
|
+
for (const [name, source] of Object.entries(options.models)) if (source !== void 0) modelUrls[WASM_MODEL_FILES[name]] = source;
|
|
19
|
+
return {
|
|
20
|
+
wasmPath: options.wasm,
|
|
21
|
+
wasmSimdPath: options.wasmSimd,
|
|
22
|
+
loadGlue: options.glue,
|
|
23
|
+
loadGlueSimd: options.glueSimd,
|
|
24
|
+
useSimd: options.wasmSimd !== void 0,
|
|
25
|
+
pipelines: [...options.pipelines],
|
|
26
|
+
modelUrls,
|
|
27
|
+
selfHosted: true
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
export { DEFAULT_WASM_VERSION, WASM_MODEL_FILES, buildDefaultWasmConfig, buildWasmConfigFromBasePath, defineWasm, ensureWasmPipelines, initializeWasmUtil, resolveWasmConfig, resolveWasmConfigForPipelines, setWasmConfig, upgradeToWasmHttpClient, warmupWasm };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { u as deriveSiblingJsPath } from "./wasmWebClient-
|
|
1
|
+
import { d as WASM_MODEL_FILES, u as deriveSiblingJsPath } from "./wasmWebClient-BzFsDjU6.esm.js";
|
|
2
2
|
//#region ../infra/src/wasm/wasmDefaults.ts
|
|
3
3
|
const WASM_CDN_BASE_URL = "https://cdn.incodesmile.com/ml-wasm-kit-release";
|
|
4
4
|
/** The WASM version bundled and tested with this SDK release. */
|
|
@@ -67,6 +67,19 @@ function pickPath(key, overrides, defaultValue) {
|
|
|
67
67
|
}
|
|
68
68
|
return raw.trim();
|
|
69
69
|
}
|
|
70
|
+
function pickSource(key, overrides, defaultValue) {
|
|
71
|
+
if (!(key in overrides) || overrides[key] === void 0) return defaultValue;
|
|
72
|
+
const source = overrides[key];
|
|
73
|
+
if (typeof source !== "string") return source;
|
|
74
|
+
return pickPath(key, overrides, String(defaultValue));
|
|
75
|
+
}
|
|
76
|
+
function resolveBasePath(overrides) {
|
|
77
|
+
const defaultValue = `${WASM_CDN_BASE_URL}/${DEFAULT_WASM_VERSION}`;
|
|
78
|
+
if (!("basePath" in overrides) || overrides.basePath === void 0) return defaultValue;
|
|
79
|
+
const basePath = overrides.basePath;
|
|
80
|
+
if (typeof basePath !== "string" || isBlank(basePath) || isMalformedPath(basePath)) throw new Error("[Incode SDK] wasm.basePath is invalid.");
|
|
81
|
+
return basePath.trim();
|
|
82
|
+
}
|
|
70
83
|
/** Builds a WarmupConfig from a directory that mirrors the ml-wasm-kit CDN layout. */
|
|
71
84
|
function buildWasmConfigFromBasePath(basePath) {
|
|
72
85
|
const base = basePath.endsWith("/") ? basePath.slice(0, -1) : basePath;
|
|
@@ -82,7 +95,7 @@ function buildWasmConfigFromBasePath(basePath) {
|
|
|
82
95
|
function buildDefaultWasmConfig() {
|
|
83
96
|
return buildWasmConfigFromBasePath(`${WASM_CDN_BASE_URL}/${DEFAULT_WASM_VERSION}`);
|
|
84
97
|
}
|
|
85
|
-
const BARCODE_ENHANCE_MODEL_FILE =
|
|
98
|
+
const BARCODE_ENHANCE_MODEL_FILE = WASM_MODEL_FILES.barcode;
|
|
86
99
|
/**
|
|
87
100
|
* URL of the lazily-loaded PDF417 barcode enhancement model (US Smart Capture).
|
|
88
101
|
* Derived from the resolved `modelsBasePath` so self-hosted / air-gapped
|
|
@@ -100,23 +113,25 @@ function getBarcodeEnhanceModelUrl(modelsBasePath) {
|
|
|
100
113
|
*/
|
|
101
114
|
function resolveWasmConfig(overrides) {
|
|
102
115
|
if (!overrides) return buildDefaultWasmConfig();
|
|
103
|
-
const defaults = buildWasmConfigFromBasePath(
|
|
104
|
-
const
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
const resolvedWasmSimdPath = pickPath("wasmSimdPath", overrides, simdDefault);
|
|
110
|
-
const glueCodeSimdDefault = deriveSiblingJsPath(resolvedWasmSimdPath);
|
|
116
|
+
const defaults = buildWasmConfigFromBasePath(resolveBasePath(overrides));
|
|
117
|
+
const resolvedWasmPath = pickSource("wasmPath", overrides, defaults.wasmPath);
|
|
118
|
+
const simdDefault = overrides.selfHosted ? resolvedWasmPath : defaults.wasmSimdPath;
|
|
119
|
+
const modelsDefault = defaults.modelsBasePath;
|
|
120
|
+
const resolvedWasmSimdPath = pickSource("wasmSimdPath", overrides, simdDefault);
|
|
121
|
+
const glueCodeSimdDefault = typeof resolvedWasmSimdPath === "string" ? deriveSiblingJsPath(resolvedWasmSimdPath) : defaults.glueCodeSimdPath;
|
|
111
122
|
const merged = {
|
|
112
|
-
wasmPath:
|
|
123
|
+
wasmPath: resolvedWasmPath,
|
|
113
124
|
wasmSimdPath: resolvedWasmSimdPath,
|
|
114
125
|
glueCodePath: pickPath("glueCodePath", overrides, defaults.glueCodePath),
|
|
115
126
|
glueCodeSimdPath: pickPath("glueCodeSimdPath", overrides, glueCodeSimdDefault),
|
|
116
127
|
modelsBasePath: pickPath("modelsBasePath", overrides, modelsDefault),
|
|
117
128
|
useSimd: overrides.useSimd,
|
|
118
129
|
pipelines: overrides.pipelines,
|
|
119
|
-
pipelineModels: overrides.pipelineModels
|
|
130
|
+
pipelineModels: overrides.pipelineModels,
|
|
131
|
+
modelUrls: overrides.modelUrls,
|
|
132
|
+
loadGlue: overrides.loadGlue,
|
|
133
|
+
loadGlueSimd: overrides.loadGlueSimd,
|
|
134
|
+
selfHosted: overrides.selfHosted
|
|
120
135
|
};
|
|
121
136
|
validateWasmPaths(merged);
|
|
122
137
|
return merged;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as mlWasmJSApi_default } from "./safeStorage-
|
|
1
|
+
import { c as mlWasmJSApi_default } from "./safeStorage-2nOSCCnG.esm.js";
|
|
2
2
|
//#region ../infra/src/wasm/wasmDsFlagSync.ts
|
|
3
3
|
/**
|
|
4
4
|
* Sets the Deepsight (ds) flag that the WASM utility API receives on every
|
|
@@ -1,3 +1,70 @@
|
|
|
1
|
+
//#region ../infra/src/wasm/wasmAssets.ts
|
|
2
|
+
const WASM_MODEL_FILES = {
|
|
3
|
+
idCapture: "id_capture_2_01_fp16.ortmodelv2",
|
|
4
|
+
idFiqa: "id_fiqa_19a81a0b9bf6492eb03b4667f6db4c85_fp16.ortmodelv2",
|
|
5
|
+
barcode: "barcode_enhance_896x224_fp16.ortmodelv2",
|
|
6
|
+
selfie: "selfie_bf_angles_192x192_opset9_fp16.ortmodelv2",
|
|
7
|
+
faceAttributes: "face_attributes_v1_3_fp16.ortmodelv2",
|
|
8
|
+
faceOcclusion: "face_occlusion_v0_2_fp16.ortmodelv2",
|
|
9
|
+
mlsRegressor: "mls_regressor_4773007c657b4f05a460321456740d0f_fp16.ortmodelv2",
|
|
10
|
+
liveness: "ondevice_physical_liveness_v2_1_fp16.ortmodelv2",
|
|
11
|
+
ageEstimation: "age_estimation_v2_2_2_fp16.ortmodelv2"
|
|
12
|
+
};
|
|
13
|
+
const WASM_PIPELINE_MODEL_NAMES = {
|
|
14
|
+
selfie: [
|
|
15
|
+
"selfie",
|
|
16
|
+
"faceAttributes",
|
|
17
|
+
"mlsRegressor",
|
|
18
|
+
"faceOcclusion"
|
|
19
|
+
],
|
|
20
|
+
onDeviceSelfie: [
|
|
21
|
+
"selfie",
|
|
22
|
+
"faceAttributes",
|
|
23
|
+
"mlsRegressor",
|
|
24
|
+
"faceOcclusion",
|
|
25
|
+
"liveness",
|
|
26
|
+
"ageEstimation"
|
|
27
|
+
],
|
|
28
|
+
idCapture: ["idCapture", "idFiqa"],
|
|
29
|
+
videoSelfie: [
|
|
30
|
+
"selfie",
|
|
31
|
+
"faceAttributes",
|
|
32
|
+
"mlsRegressor",
|
|
33
|
+
"faceOcclusion"
|
|
34
|
+
],
|
|
35
|
+
videoSelfieId: ["idCapture"]
|
|
36
|
+
};
|
|
37
|
+
const WASM_PIPELINE_LAZY_MODEL_NAMES = {
|
|
38
|
+
selfie: [],
|
|
39
|
+
onDeviceSelfie: [],
|
|
40
|
+
idCapture: ["barcode"],
|
|
41
|
+
videoSelfie: [],
|
|
42
|
+
videoSelfieId: []
|
|
43
|
+
};
|
|
44
|
+
const WASM_PIPELINE_MODELS = {
|
|
45
|
+
selfie: WASM_PIPELINE_MODEL_NAMES.selfie.map((model) => WASM_MODEL_FILES[model]),
|
|
46
|
+
onDeviceSelfie: WASM_PIPELINE_MODEL_NAMES.onDeviceSelfie.map((model) => WASM_MODEL_FILES[model]),
|
|
47
|
+
idCapture: WASM_PIPELINE_MODEL_NAMES.idCapture.map((model) => WASM_MODEL_FILES[model]),
|
|
48
|
+
videoSelfie: WASM_PIPELINE_MODEL_NAMES.videoSelfie.map((model) => WASM_MODEL_FILES[model]),
|
|
49
|
+
videoSelfieId: WASM_PIPELINE_MODEL_NAMES.videoSelfieId.map((model) => WASM_MODEL_FILES[model])
|
|
50
|
+
};
|
|
51
|
+
async function resolveWasmSource(source, kind) {
|
|
52
|
+
if (source instanceof Uint8Array) return source;
|
|
53
|
+
if (source instanceof ArrayBuffer) return new Uint8Array(source);
|
|
54
|
+
let response;
|
|
55
|
+
try {
|
|
56
|
+
response = await fetch(source);
|
|
57
|
+
} catch (error) {
|
|
58
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
59
|
+
throw new Error(`[Incode SDK] Could not load the WASM ${kind} at ${source}: ${detail}`);
|
|
60
|
+
}
|
|
61
|
+
if (!response.ok) throw new Error(`[Incode SDK] Could not load the WASM ${kind} at ${source}: ${response.status} ${response.statusText}`);
|
|
62
|
+
return new Uint8Array(await response.arrayBuffer());
|
|
63
|
+
}
|
|
64
|
+
function missingWasmModelError(fileName, pipeline) {
|
|
65
|
+
return /* @__PURE__ */ new Error(`[Incode SDK] The "${pipeline}" pipeline needs ${fileName}, but the self-hosted WASM configuration does not provide it.`);
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
|
1
68
|
//#region ../infra/src/wasm/wasmPathUtils.ts
|
|
2
69
|
function deriveSiblingJsPath(wasmPath) {
|
|
3
70
|
const index = wasmPath.lastIndexOf(".wasm");
|
|
@@ -130,7 +197,7 @@ var SemaphoreProvider = class {
|
|
|
130
197
|
if (typeof window !== "undefined" && window.wasmArrayBuffer === void 0) window.wasmArrayBuffer = null;
|
|
131
198
|
let loadPromise = null;
|
|
132
199
|
let loadedResult = null;
|
|
133
|
-
async function
|
|
200
|
+
async function importGlueAt(glueCodePath) {
|
|
134
201
|
const mod = await import(
|
|
135
202
|
/* @vite-ignore */
|
|
136
203
|
/* webpackIgnore: true */
|
|
@@ -139,14 +206,17 @@ async function importGlue(glueCodePath) {
|
|
|
139
206
|
if (typeof mod.Module !== "function") throw new Error(`WASM glue at ${glueCodePath} did not export a Module factory`);
|
|
140
207
|
return mod.Module;
|
|
141
208
|
}
|
|
142
|
-
async function
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
209
|
+
async function resolveGlue(loader, glueCodePath) {
|
|
210
|
+
if (loader) {
|
|
211
|
+
const module = await loader();
|
|
212
|
+
if (typeof module.Module !== "function") throw new Error("[Incode SDK] WASM glue module did not export a Module factory.");
|
|
213
|
+
return module.Module;
|
|
214
|
+
}
|
|
215
|
+
if (!glueCodePath) throw new Error("WASM glue code is required");
|
|
216
|
+
return await importGlueAt(glueCodePath);
|
|
147
217
|
}
|
|
148
218
|
async function instantiate(factory, libPath) {
|
|
149
|
-
window.wasmArrayBuffer = await
|
|
219
|
+
window.wasmArrayBuffer = await resolveWasmSource(libPath, "binary");
|
|
150
220
|
return await factory();
|
|
151
221
|
}
|
|
152
222
|
/**
|
|
@@ -165,7 +235,7 @@ async function loadWasmModule(config) {
|
|
|
165
235
|
const wantSimd = config.useSimd !== false;
|
|
166
236
|
const simdBinary = config.wasmSimdPath ?? config.wasmPath;
|
|
167
237
|
if (wantSimd && simdBinary !== config.wasmPath) try {
|
|
168
|
-
const simdFactory = await
|
|
238
|
+
const simdFactory = await resolveGlue(config.loadGlueSimd, typeof simdBinary === "string" ? config.glueCodeSimdPath || deriveSiblingJsPath(simdBinary) : config.glueCodeSimdPath);
|
|
169
239
|
window.Module = simdFactory;
|
|
170
240
|
const result = {
|
|
171
241
|
wasmModule: await instantiate(simdFactory, simdBinary),
|
|
@@ -176,7 +246,7 @@ async function loadWasmModule(config) {
|
|
|
176
246
|
} catch (simdError) {
|
|
177
247
|
console.warn("[Incode SDK] SIMD WASM load failed, falling back to non-SIMD", simdError);
|
|
178
248
|
}
|
|
179
|
-
const nonSimdFactory = await
|
|
249
|
+
const nonSimdFactory = await resolveGlue(config.loadGlue, config.glueCodePath);
|
|
180
250
|
window.Module = nonSimdFactory;
|
|
181
251
|
const result = {
|
|
182
252
|
wasmModule: await instantiate(nonSimdFactory, config.wasmPath),
|
|
@@ -273,23 +343,13 @@ const toStringRecord = (obj) => {
|
|
|
273
343
|
/**
|
|
274
344
|
* Loads the shared WASM module (if not already loaded) and instantiates the
|
|
275
345
|
* C++ `WebClient`. Idempotent — repeated calls reuse the existing instance.
|
|
276
|
-
*
|
|
277
|
-
* `glueCodeSimdPath` is paired with `wasmSimdPath` (`webLibSimd.js` for
|
|
278
|
-
* `webLibSimd.wasm`). Pass `''` to derive it automatically from
|
|
279
|
-
* `wasmSimdPath` by replacing the `.wasm` extension with `.js`.
|
|
280
346
|
*/
|
|
281
|
-
async function initializeWasmWebClient(
|
|
347
|
+
async function initializeWasmWebClient(config) {
|
|
282
348
|
if (webClientApi) return;
|
|
283
349
|
if (initPromise) return initPromise;
|
|
284
350
|
initPromise = (async () => {
|
|
285
351
|
try {
|
|
286
|
-
const { wasmModule } = await loadWasmModule(
|
|
287
|
-
wasmPath,
|
|
288
|
-
wasmSimdPath,
|
|
289
|
-
glueCodePath,
|
|
290
|
-
glueCodeSimdPath: glueCodeSimdPath || void 0,
|
|
291
|
-
useSimd
|
|
292
|
-
});
|
|
352
|
+
const { wasmModule } = await loadWasmModule(config);
|
|
293
353
|
if (!isWebClientWasm(wasmModule)) throw new Error("WASM module does not expose a WebClient class. Update webLib.wasm to a build that includes WebClient.");
|
|
294
354
|
webClientApi = new wasmModule.WebClient();
|
|
295
355
|
} catch (error) {
|
|
@@ -404,4 +464,4 @@ function ensureReady() {
|
|
|
404
464
|
return webClientApi;
|
|
405
465
|
}
|
|
406
466
|
//#endregion
|
|
407
|
-
export { setWebApiHttpTransport as a, loadWasmModule as c, initializeWasmWebClient as i, SemaphoreProvider as l, createWebApiHostAdapter as n, setupWasmConnection as o, executeWasmRequest as r, wasmCallWrapper as s, WasmWebClientError as t, deriveSiblingJsPath as u };
|
|
467
|
+
export { setWebApiHttpTransport as a, loadWasmModule as c, WASM_MODEL_FILES as d, WASM_PIPELINE_LAZY_MODEL_NAMES as f, resolveWasmSource as g, missingWasmModelError as h, initializeWasmWebClient as i, SemaphoreProvider as l, WASM_PIPELINE_MODEL_NAMES as m, createWebApiHostAdapter as n, setupWasmConnection as o, WASM_PIPELINE_MODELS as p, executeWasmRequest as r, wasmCallWrapper as s, WasmWebClientError as t, deriveSiblingJsPath as u };
|
package/dist/workflow.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { t as CallbackActorLogic } from "./callback-645_omgz.js";
|
|
|
3
3
|
import "./StateMachine-EDpYWy0i.js";
|
|
4
4
|
import { t as Manager } from "./Manager-CQQ99QOI.js";
|
|
5
5
|
import { a as TotalScore, i as GetTotalScoreStatusFn, n as FinishStatus, r as GetFinishStatusFn } from "./flowCompletionService-BlAHsKyv.js";
|
|
6
|
-
import { o as FlowEventSubscribable } from "./index-
|
|
6
|
+
import { o as FlowEventSubscribable } from "./index-BwudEtre.js";
|
|
7
7
|
import { a as WorkflowModuleRegistry, i as RunChildModuleInput, r as RunChildModuleEvent, t as ModuleConfigMappers } from "./types-BfgmV7s7.js";
|
|
8
8
|
//#region src/modules/workflow/types.d.ts
|
|
9
9
|
/** Possible node types returned by the workflow server. */
|
|
@@ -334,6 +334,10 @@ declare const workflowMachine: StateMachine<WorkflowContext, {
|
|
|
334
334
|
id: string | undefined;
|
|
335
335
|
};
|
|
336
336
|
}>, Values<{
|
|
337
|
+
setError: {
|
|
338
|
+
type: "setError";
|
|
339
|
+
params: NonReducibleUnknown;
|
|
340
|
+
};
|
|
337
341
|
setLoadingResult: {
|
|
338
342
|
type: "setLoadingResult";
|
|
339
343
|
params: NonReducibleUnknown;
|
|
@@ -366,10 +370,6 @@ declare const workflowMachine: StateMachine<WorkflowContext, {
|
|
|
366
370
|
type: "setFinishStatusFailed";
|
|
367
371
|
params: NonReducibleUnknown;
|
|
368
372
|
};
|
|
369
|
-
setError: {
|
|
370
|
-
type: "setError";
|
|
371
|
-
params: NonReducibleUnknown;
|
|
372
|
-
};
|
|
373
373
|
setModuleError: {
|
|
374
374
|
type: "setModuleError";
|
|
375
375
|
params: NonReducibleUnknown;
|