@incodetech/core 0.0.0-dev-20260403-eccc51c → 0.0.0-dev-20260407-4677d7f
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/{BaseWasmProvider--AzPfwOm.esm.js → BaseWasmProvider-CQgeReKV.esm.js} +1 -785
- package/dist/MotionSensorProvider-BTDLt08l.esm.js +254 -0
- package/dist/StateMachine-8d441d6x.d.ts +2 -0
- package/dist/{WasmUtilProvider-BonqBWdj.esm.js → WasmUtilProvider-C45HStLj.esm.js} +1 -1
- package/dist/{addressSearch-DC5By0cC.esm.js → addressSearch-C5qzDvkN.esm.js} +15 -8
- package/dist/antifraud.d.ts +1 -1
- package/dist/antifraud.esm.js +3 -3
- package/dist/authentication.d.ts +11 -9
- package/dist/authentication.esm.js +18 -13
- package/dist/{authenticationManager-B4gSCgrO.esm.js → authenticationManager-CW4qxgcq.esm.js} +7 -6
- package/dist/{authenticationManager-Bd10YGSO.d.ts → authenticationManager-CiXsOTdM.d.ts} +2 -2
- package/dist/{backCameraStream-DF_d7hTz.esm.js → backCameraStream-CUo1USCT.esm.js} +2 -2
- package/dist/camera.d.ts +16 -0
- package/dist/camera.esm.js +5 -0
- package/dist/consent.d.ts +52 -52
- package/dist/consent.esm.js +3 -3
- package/dist/curp-validation.d.ts +5 -5
- package/dist/curp-validation.esm.js +3 -3
- package/dist/{deepsightLoader-DKgEdLIS.esm.js → deepsightLoader-Bs5jHgca.esm.js} +10 -7
- package/dist/deepsightService-C3gQ_9Ml.esm.js +493 -0
- package/dist/{deepsightService-Ciu0atv5.d.ts → deepsightService-CMAtxAC9.d.ts} +193 -197
- package/dist/device.d.ts +46 -0
- package/dist/device.esm.js +106 -0
- package/dist/document-capture.d.ts +78 -78
- package/dist/document-capture.esm.js +6 -6
- package/dist/document-upload.d.ts +53 -53
- package/dist/document-upload.esm.js +6 -6
- package/dist/ekyb.d.ts +3 -3
- package/dist/ekyb.esm.js +11 -10
- package/dist/ekyc.d.ts +3 -3
- package/dist/ekyc.esm.js +104 -22
- package/dist/email.d.ts +3 -3
- package/dist/email.esm.js +5 -5
- package/dist/{emailManager-CpAwvP3v.esm.js → emailManager-CZ2IGW0g.esm.js} +4 -4
- package/dist/{emailManager-BQPIJR_O.d.ts → emailManager-DEIxY7l6.d.ts} +2 -2
- package/dist/events-BlVGS-8F.esm.js +472 -0
- package/dist/events.d.ts +232 -0
- package/dist/events.esm.js +4 -0
- package/dist/extensibility.d.ts +15 -13
- package/dist/extensibility.esm.js +25 -20
- package/dist/face-match.d.ts +1 -1
- package/dist/face-match.esm.js +3 -3
- package/dist/{faceCaptureManagerFactory-CdwpYykv.d.ts → faceCaptureManagerFactory-CWj-nXdx.d.ts} +8 -6
- package/dist/{faceCaptureSetup-DbXgtcp7.esm.js → faceCaptureSetup-DIE5cftl.esm.js} +13 -10
- package/dist/flow.d.ts +7 -6
- package/dist/flow.esm.js +8 -8
- package/dist/{flowCompletionService-TnWijsSw.esm.js → flowCompletionService-N6-xypy-.esm.js} +2 -2
- package/dist/{flowServices-CO2sIR3D.esm.js → flowServices-xgqnJ64L.esm.js} +3 -3
- package/dist/geolocation.d.ts +2 -2
- package/dist/geolocation.esm.js +4 -4
- package/dist/getBrowser-B800KRAi.esm.js +41 -0
- package/dist/getDeviceClass-BKd2FOAf.esm.js +14 -0
- package/dist/government-validation.d.ts +2 -2
- package/dist/government-validation.esm.js +4 -4
- package/dist/http.d.ts +57 -0
- package/dist/http.esm.js +3 -0
- package/dist/id.d.ts +11 -10
- package/dist/id.esm.js +19 -15
- package/dist/{idCaptureManager-IdqsAASp.d.ts → idCaptureManager-H-rkXnbK.d.ts} +7 -6
- package/dist/{idCaptureManager-DaLU1ug7.esm.js → idCaptureManager-SHBRQ-X_.esm.js} +15 -11
- package/dist/index.d.ts +3 -611
- package/dist/index.esm.js +10 -562
- package/dist/{lib-i-4qLKdG.esm.js → lib-Cq5Wc-Hd.esm.js} +1 -1
- package/dist/mandatory-consent.d.ts +58 -58
- package/dist/mandatory-consent.esm.js +3 -3
- package/dist/permissionServices-CDqkkway.esm.js +50 -0
- package/dist/phone.d.ts +3 -3
- package/dist/phone.esm.js +5 -5
- package/dist/{phoneManager-DA8WUJtl.d.ts → phoneManager-Clfbrs6b.d.ts} +2 -2
- package/dist/{phoneManager-BAPHSXx8.esm.js → phoneManager-CscgaER2.esm.js} +4 -4
- package/dist/{StreamCanvasCapture-DkpkIgyL.esm.js → recordingsRepository-blYn-iKZ.esm.js} +157 -215
- package/dist/redirect-to-mobile.d.ts +2 -2
- package/dist/redirect-to-mobile.esm.js +4 -4
- package/dist/selfie.d.ts +11 -9
- package/dist/selfie.esm.js +18 -13
- package/dist/{selfieManager-BSkzncsa.esm.js → selfieManager-DeGqD5aN.esm.js} +5 -4
- package/dist/{selfieManager-Dft5wZQ_.d.ts → selfieManager-h_hhEefT.d.ts} +2 -2
- package/dist/{session-OglUYC9l.esm.js → session-PLjFj_T3.esm.js} +5 -19
- package/dist/session.d.ts +46 -2
- package/dist/session.esm.js +7 -4
- package/dist/setup-DJ3dFl5k.d.ts +120 -0
- package/dist/setup-fvDWE7f8.esm.js +450 -0
- package/dist/signature.d.ts +2 -2
- package/dist/signature.esm.js +3 -3
- package/dist/{stats-BVigf5Rn.esm.js → stats-BZ1kFW4p.esm.js} +1 -1
- package/dist/stats.esm.js +2 -2
- package/dist/{types-CiLyvJGb.d.ts → types-T0VjZW3T.d.ts} +1 -1
- package/dist/types-qhLxpptI.d.ts +5 -0
- package/dist/{types-D8Y1faI5.d.ts → types-zH5PDmSe.d.ts} +1 -1
- package/dist/{StateMachine-CM_aOfNL.d.ts → warmup-CEOVQKby.d.ts} +1 -4
- package/dist/wasm.d.ts +15 -0
- package/dist/wasm.esm.js +10 -0
- package/dist/{Manager-C6AGXEq_.esm.js → xstate.esm-BXrcOcSC.esm.js} +103 -507
- package/package.json +18 -2
- package/dist/endpoints-CI5-28jT.esm.js +0 -69
- package/dist/id-CzDAG_kM.esm.js +0 -0
- package/dist/index-BuVKc9bv.d.ts +0 -1
- /package/dist/{Actor-By8WNHi-.d.ts → Actor-C-jivmFF.d.ts} +0 -0
- /package/dist/{BrowserEnvironmentProvider-BECjyw3_.esm.js → BrowserEnvironmentProvider--xQUs3sg.esm.js} +0 -0
- /package/dist/{BrowserTimerProvider-CIqH6hJp.esm.js → BrowserTimerProvider-CkHEwJFa.esm.js} +0 -0
- /package/dist/{Manager-CCT_-HuZ.d.ts → Manager-BqFybBV-.d.ts} +0 -0
- /package/dist/{api-C2uzxrpN.esm.js → api-CyI8qTie.esm.js} +0 -0
- /package/dist/{browserSimulation-DYAk0Ipe.esm.js → browserSimulation-yzDdWSBf.esm.js} +0 -0
- /package/dist/{camera-6XJdOeBF.d.ts → camera-CKsQVNlH.d.ts} +0 -0
- /package/dist/{camera-DAuRUvnp.esm.js → camera-CsT06Zqy.esm.js} +0 -0
- /package/dist/{chunk-D6hkk-hd.esm.js → chunk-BcQWkoAq.esm.js} +0 -0
- /package/dist/{displayErrors-CGJwvrTl.d.ts → displayErrors-CjMXlBnu.d.ts} +0 -0
- /package/dist/{flowCompletionService-BOd4Rk8n.d.ts → flowCompletionService-BV6ThEJ1.d.ts} +0 -0
- /package/dist/{platform-DdhkonXk.esm.js → platform-Dcuv6w60.esm.js} +0 -0
|
@@ -1,6 +1,186 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as CameraStream } from "./camera-
|
|
1
|
+
import { n as WasmPipeline } from "./warmup-CEOVQKby.js";
|
|
2
|
+
import { t as CameraStream } from "./camera-CKsQVNlH.js";
|
|
3
3
|
|
|
4
|
+
//#region ../infra/src/capabilities/IRecordingCapability.d.ts
|
|
5
|
+
type RecordingPublisher = {
|
|
6
|
+
getStreamId: () => string | undefined;
|
|
7
|
+
replaceVideoTrack: (track: MediaStreamTrack) => Promise<void>;
|
|
8
|
+
destroy: () => void;
|
|
9
|
+
};
|
|
10
|
+
type RecordingConnection = {
|
|
11
|
+
sessionId: string | undefined;
|
|
12
|
+
publisher: RecordingPublisher;
|
|
13
|
+
disconnect: () => Promise<void>;
|
|
14
|
+
};
|
|
15
|
+
type RecordingConnectionEvents = {
|
|
16
|
+
onSessionConnected?: (sessionId: string | undefined) => void;
|
|
17
|
+
onSessionDisconnected?: (sessionId: string | undefined) => void;
|
|
18
|
+
onSessionException?: (params: {
|
|
19
|
+
name?: string;
|
|
20
|
+
message?: string;
|
|
21
|
+
sessionId?: string;
|
|
22
|
+
}) => void;
|
|
23
|
+
onPublisherCreated?: (params: {
|
|
24
|
+
streamId?: string;
|
|
25
|
+
sessionId?: string;
|
|
26
|
+
}) => void;
|
|
27
|
+
onPublisherError?: (params: {
|
|
28
|
+
message?: string;
|
|
29
|
+
sessionId?: string;
|
|
30
|
+
streamId?: string;
|
|
31
|
+
}) => void;
|
|
32
|
+
};
|
|
33
|
+
type ConnectRecordingParams = {
|
|
34
|
+
sessionToken: string;
|
|
35
|
+
stream: MediaStream;
|
|
36
|
+
events?: RecordingConnectionEvents;
|
|
37
|
+
};
|
|
38
|
+
type IRecordingCapability = {
|
|
39
|
+
/**
|
|
40
|
+
* Connects to a recording session and publishes the provided media stream.
|
|
41
|
+
* Returns a connection handle that can be disconnected and used to manage the publisher.
|
|
42
|
+
*/
|
|
43
|
+
connect: (params: ConnectRecordingParams) => Promise<RecordingConnection>;
|
|
44
|
+
};
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region ../infra/src/capabilities/IStorageCapability.d.ts
|
|
47
|
+
/**
|
|
48
|
+
* Storage capability interface for abstracting storage operations.
|
|
49
|
+
* Enables swapping between browser localStorage and future WASM-based storage.
|
|
50
|
+
*/
|
|
51
|
+
interface IStorageCapability {
|
|
52
|
+
/**
|
|
53
|
+
* Retrieves a value from storage.
|
|
54
|
+
* @param key - The storage key
|
|
55
|
+
* @returns The stored value or null if not found
|
|
56
|
+
*/
|
|
57
|
+
get<T>(key: string): Promise<T | null>;
|
|
58
|
+
/**
|
|
59
|
+
* Stores a value in storage.
|
|
60
|
+
* @param key - The storage key
|
|
61
|
+
* @param value - The value to store (will be serialized)
|
|
62
|
+
*/
|
|
63
|
+
set<T>(key: string, value: T): Promise<void>;
|
|
64
|
+
/**
|
|
65
|
+
* Removes a value from storage.
|
|
66
|
+
* @param key - The storage key to remove
|
|
67
|
+
*/
|
|
68
|
+
remove(key: string): Promise<void>;
|
|
69
|
+
/**
|
|
70
|
+
* Clears all values from storage.
|
|
71
|
+
*/
|
|
72
|
+
clear(): Promise<void>;
|
|
73
|
+
}
|
|
74
|
+
//#endregion
|
|
75
|
+
//#region ../infra/src/capabilities/IMLProviderCapability.d.ts
|
|
76
|
+
/**
|
|
77
|
+
* Base configuration shared by all ML provider capabilities.
|
|
78
|
+
*/
|
|
79
|
+
interface MLProviderConfig {
|
|
80
|
+
/** Path to the WASM binary */
|
|
81
|
+
wasmPath?: string;
|
|
82
|
+
/** Path to the SIMD-optimized WASM binary (optional) */
|
|
83
|
+
wasmSimdPath?: string;
|
|
84
|
+
/** Path to the WASM glue code */
|
|
85
|
+
glueCodePath?: string;
|
|
86
|
+
/** Whether to use SIMD optimizations (default: true) */
|
|
87
|
+
useSimd?: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Base path for ML model files. Models will be loaded from `${modelsBasePath}/${modelFileName}`.
|
|
90
|
+
* If not provided, models are expected in a 'models' subdirectory relative to the WASM binary.
|
|
91
|
+
*/
|
|
92
|
+
modelsBasePath?: string;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Base interface for ML provider capabilities.
|
|
96
|
+
* Provides common lifecycle and frame processing methods shared by
|
|
97
|
+
* FaceDetectionCapability and IdCaptureCapability.
|
|
98
|
+
*/
|
|
99
|
+
interface IMLProviderCapability<TConfig extends MLProviderConfig> {
|
|
100
|
+
/**
|
|
101
|
+
* Whether the provider has been initialized and is ready to process frames.
|
|
102
|
+
*/
|
|
103
|
+
readonly initialized: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Initializes the provider with the given configuration.
|
|
106
|
+
* If WASM was already warmed up via `setup()` or `warmupWasm()`, this returns almost instantly.
|
|
107
|
+
* @param config - Provider configuration including WASM paths
|
|
108
|
+
*/
|
|
109
|
+
initialize(config: TConfig): Promise<void>;
|
|
110
|
+
/**
|
|
111
|
+
* Processes a frame through the ML pipeline.
|
|
112
|
+
* Callbacks set via `setCallbacks()` will be invoked based on the analysis results.
|
|
113
|
+
* @param image - Image data to process
|
|
114
|
+
* @throws Error if provider is not initialized
|
|
115
|
+
*/
|
|
116
|
+
processFrame(image: ImageData): Promise<void>;
|
|
117
|
+
/**
|
|
118
|
+
* Resets the pipeline to its initial state.
|
|
119
|
+
* Safe to call even if not initialized (no-op in that case).
|
|
120
|
+
*/
|
|
121
|
+
reset(): void;
|
|
122
|
+
/**
|
|
123
|
+
* Disposes of resources and resets initialization state.
|
|
124
|
+
* Safe to call even if not initialized.
|
|
125
|
+
*/
|
|
126
|
+
dispose(): Promise<void>;
|
|
127
|
+
}
|
|
128
|
+
//#endregion
|
|
129
|
+
//#region ../infra/src/capabilities/IWasmUtilCapability.d.ts
|
|
130
|
+
type WasmUtilConfig = MLProviderConfig & {
|
|
131
|
+
pipelines?: WasmPipeline[];
|
|
132
|
+
};
|
|
133
|
+
type VirtualCameraCheckOutput = {
|
|
134
|
+
canvas: HTMLCanvasElement | null;
|
|
135
|
+
itr: boolean | null;
|
|
136
|
+
skipped: boolean | null;
|
|
137
|
+
};
|
|
138
|
+
type IWasmUtilCapability = {
|
|
139
|
+
/**
|
|
140
|
+
* Whether the provider has been initialized and is ready to be used.
|
|
141
|
+
*/
|
|
142
|
+
readonly initialized: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* Initializes the provider with the given configuration.
|
|
145
|
+
* If WASM was already warmed up via `warmupWasm()`, this returns almost instantly.
|
|
146
|
+
* @param config - Provider configuration including WASM paths
|
|
147
|
+
*/
|
|
148
|
+
initialize(config: WasmUtilConfig): Promise<void>;
|
|
149
|
+
/**
|
|
150
|
+
* Encrypts a base64 image using the WASM utility API.
|
|
151
|
+
* @param image - Base64 image string (no data URL prefix)
|
|
152
|
+
* @returns Encrypted string
|
|
153
|
+
*/
|
|
154
|
+
encryptImage(image: string): string;
|
|
155
|
+
setSdkVersion(version: string): void;
|
|
156
|
+
setSdkPlatform(platform: string): void;
|
|
157
|
+
setDeviceInfo(deviceInfo: object, overrideExisting?: boolean): void;
|
|
158
|
+
setBrowserInfo(browserInfo: object, overrideExisting?: boolean): void;
|
|
159
|
+
setCameraInfo(cameraInfo: object, overrideExisting?: boolean): void;
|
|
160
|
+
setMotionStatus(status: string): void;
|
|
161
|
+
setBackgroundMode(backgroundMode: boolean): void;
|
|
162
|
+
setZc(zc: string): void;
|
|
163
|
+
setInspectorOpened(opened: boolean): void;
|
|
164
|
+
getMetadata(): string;
|
|
165
|
+
analyzeFrame(image: ImageData): Promise<void>;
|
|
166
|
+
getCheck(): string;
|
|
167
|
+
/**
|
|
168
|
+
* Gets the current pipeline state. Must be called before setMotionStatus(),
|
|
169
|
+
* getCheck(), setBackgroundMode(), and getMetadata() for proper metadata generation.
|
|
170
|
+
*/
|
|
171
|
+
getPipelineState(): string;
|
|
172
|
+
estimatePerformance(): string;
|
|
173
|
+
isVirtualCamera(label: string | null): boolean;
|
|
174
|
+
prc(): Promise<void>;
|
|
175
|
+
poc(output: VirtualCameraCheckOutput): Promise<void>;
|
|
176
|
+
ckvcks(data: ArrayBuffer): void;
|
|
177
|
+
getVersions(): Promise<unknown>;
|
|
178
|
+
/**
|
|
179
|
+
* Disposes of resources and resets initialization state.
|
|
180
|
+
*/
|
|
181
|
+
dispose(): Promise<void>;
|
|
182
|
+
};
|
|
183
|
+
//#endregion
|
|
4
184
|
//#region ../infra/src/media/canvas.d.ts
|
|
5
185
|
/**
|
|
6
186
|
* Class representing a canvas element for image capture and manipulation.
|
|
@@ -112,147 +292,6 @@ declare class IncodeCanvas {
|
|
|
112
292
|
getResizedCanvas(videoElementWidth: number, videoElementHeight: number): IncodeCanvas | null;
|
|
113
293
|
}
|
|
114
294
|
//#endregion
|
|
115
|
-
//#region ../infra/src/capabilities/IMLProviderCapability.d.ts
|
|
116
|
-
/**
|
|
117
|
-
* Base configuration shared by all ML provider capabilities.
|
|
118
|
-
*/
|
|
119
|
-
interface MLProviderConfig {
|
|
120
|
-
/** Path to the WASM binary */
|
|
121
|
-
wasmPath?: string;
|
|
122
|
-
/** Path to the SIMD-optimized WASM binary (optional) */
|
|
123
|
-
wasmSimdPath?: string;
|
|
124
|
-
/** Path to the WASM glue code */
|
|
125
|
-
glueCodePath?: string;
|
|
126
|
-
/** Whether to use SIMD optimizations (default: true) */
|
|
127
|
-
useSimd?: boolean;
|
|
128
|
-
/**
|
|
129
|
-
* Base path for ML model files. Models will be loaded from `${modelsBasePath}/${modelFileName}`.
|
|
130
|
-
* If not provided, models are expected in a 'models' subdirectory relative to the WASM binary.
|
|
131
|
-
*/
|
|
132
|
-
modelsBasePath?: string;
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Base interface for ML provider capabilities.
|
|
136
|
-
* Provides common lifecycle and frame processing methods shared by
|
|
137
|
-
* FaceDetectionCapability and IdCaptureCapability.
|
|
138
|
-
*/
|
|
139
|
-
interface IMLProviderCapability<TConfig extends MLProviderConfig> {
|
|
140
|
-
/**
|
|
141
|
-
* Whether the provider has been initialized and is ready to process frames.
|
|
142
|
-
*/
|
|
143
|
-
readonly initialized: boolean;
|
|
144
|
-
/**
|
|
145
|
-
* Initializes the provider with the given configuration.
|
|
146
|
-
* If WASM was already warmed up via `setup()` or `warmupWasm()`, this returns almost instantly.
|
|
147
|
-
* @param config - Provider configuration including WASM paths
|
|
148
|
-
*/
|
|
149
|
-
initialize(config: TConfig): Promise<void>;
|
|
150
|
-
/**
|
|
151
|
-
* Processes a frame through the ML pipeline.
|
|
152
|
-
* Callbacks set via `setCallbacks()` will be invoked based on the analysis results.
|
|
153
|
-
* @param image - Image data to process
|
|
154
|
-
* @throws Error if provider is not initialized
|
|
155
|
-
*/
|
|
156
|
-
processFrame(image: ImageData): Promise<void>;
|
|
157
|
-
/**
|
|
158
|
-
* Resets the pipeline to its initial state.
|
|
159
|
-
* Safe to call even if not initialized (no-op in that case).
|
|
160
|
-
*/
|
|
161
|
-
reset(): void;
|
|
162
|
-
/**
|
|
163
|
-
* Disposes of resources and resets initialization state.
|
|
164
|
-
* Safe to call even if not initialized.
|
|
165
|
-
*/
|
|
166
|
-
dispose(): Promise<void>;
|
|
167
|
-
}
|
|
168
|
-
//#endregion
|
|
169
|
-
//#region ../infra/src/capabilities/IRecordingCapability.d.ts
|
|
170
|
-
type RecordingPublisher = {
|
|
171
|
-
getStreamId: () => string | undefined;
|
|
172
|
-
replaceVideoTrack: (track: MediaStreamTrack) => Promise<void>;
|
|
173
|
-
destroy: () => void;
|
|
174
|
-
};
|
|
175
|
-
type RecordingConnection = {
|
|
176
|
-
sessionId: string | undefined;
|
|
177
|
-
publisher: RecordingPublisher;
|
|
178
|
-
disconnect: () => Promise<void>;
|
|
179
|
-
};
|
|
180
|
-
type RecordingConnectionEvents = {
|
|
181
|
-
onSessionConnected?: (sessionId: string | undefined) => void;
|
|
182
|
-
onSessionDisconnected?: (sessionId: string | undefined) => void;
|
|
183
|
-
onSessionException?: (params: {
|
|
184
|
-
name?: string;
|
|
185
|
-
message?: string;
|
|
186
|
-
sessionId?: string;
|
|
187
|
-
}) => void;
|
|
188
|
-
onPublisherCreated?: (params: {
|
|
189
|
-
streamId?: string;
|
|
190
|
-
sessionId?: string;
|
|
191
|
-
}) => void;
|
|
192
|
-
onPublisherError?: (params: {
|
|
193
|
-
message?: string;
|
|
194
|
-
sessionId?: string;
|
|
195
|
-
streamId?: string;
|
|
196
|
-
}) => void;
|
|
197
|
-
};
|
|
198
|
-
type ConnectRecordingParams = {
|
|
199
|
-
sessionToken: string;
|
|
200
|
-
stream: MediaStream;
|
|
201
|
-
events?: RecordingConnectionEvents;
|
|
202
|
-
};
|
|
203
|
-
type IRecordingCapability = {
|
|
204
|
-
/**
|
|
205
|
-
* Connects to a recording session and publishes the provided media stream.
|
|
206
|
-
* Returns a connection handle that can be disconnected and used to manage the publisher.
|
|
207
|
-
*/
|
|
208
|
-
connect: (params: ConnectRecordingParams) => Promise<RecordingConnection>;
|
|
209
|
-
};
|
|
210
|
-
//#endregion
|
|
211
|
-
//#region src/internal/permissions/types.d.ts
|
|
212
|
-
type PermissionResult = 'granted' | 'denied' | 'prompt';
|
|
213
|
-
type PermissionStatus = 'idle' | 'requesting' | 'denied' | 'learnMore';
|
|
214
|
-
//#endregion
|
|
215
|
-
//#region ../infra/src/capabilities/IMotionSensorCapability.d.ts
|
|
216
|
-
type MotionStatus = 'PASS' | 'FAIL' | 'UNCLEAR';
|
|
217
|
-
type MotionPermissionState = 'granted' | 'denied' | 'not-required';
|
|
218
|
-
type IMotionSensorCapability = {
|
|
219
|
-
requestPermission(): Promise<MotionPermissionState>;
|
|
220
|
-
start(): Promise<void>;
|
|
221
|
-
stop(): void;
|
|
222
|
-
check(): MotionStatus;
|
|
223
|
-
readonly isRunning: boolean;
|
|
224
|
-
readonly hasPermission: boolean;
|
|
225
|
-
};
|
|
226
|
-
//#endregion
|
|
227
|
-
//#region ../infra/src/capabilities/IStorageCapability.d.ts
|
|
228
|
-
/**
|
|
229
|
-
* Storage capability interface for abstracting storage operations.
|
|
230
|
-
* Enables swapping between browser localStorage and future WASM-based storage.
|
|
231
|
-
*/
|
|
232
|
-
interface IStorageCapability {
|
|
233
|
-
/**
|
|
234
|
-
* Retrieves a value from storage.
|
|
235
|
-
* @param key - The storage key
|
|
236
|
-
* @returns The stored value or null if not found
|
|
237
|
-
*/
|
|
238
|
-
get<T>(key: string): Promise<T | null>;
|
|
239
|
-
/**
|
|
240
|
-
* Stores a value in storage.
|
|
241
|
-
* @param key - The storage key
|
|
242
|
-
* @param value - The value to store (will be serialized)
|
|
243
|
-
*/
|
|
244
|
-
set<T>(key: string, value: T): Promise<void>;
|
|
245
|
-
/**
|
|
246
|
-
* Removes a value from storage.
|
|
247
|
-
* @param key - The storage key to remove
|
|
248
|
-
*/
|
|
249
|
-
remove(key: string): Promise<void>;
|
|
250
|
-
/**
|
|
251
|
-
* Clears all values from storage.
|
|
252
|
-
*/
|
|
253
|
-
clear(): Promise<void>;
|
|
254
|
-
}
|
|
255
|
-
//#endregion
|
|
256
295
|
//#region ../infra/src/media/StreamCanvasCapture.d.ts
|
|
257
296
|
type StreamCanvasCaptureOptions = {
|
|
258
297
|
fps?: number;
|
|
@@ -291,59 +330,16 @@ declare class StreamCanvasCapture {
|
|
|
291
330
|
private tick;
|
|
292
331
|
}
|
|
293
332
|
//#endregion
|
|
294
|
-
//#region ../infra/src/capabilities/
|
|
295
|
-
type
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
/**
|
|
305
|
-
* Whether the provider has been initialized and is ready to be used.
|
|
306
|
-
*/
|
|
307
|
-
readonly initialized: boolean;
|
|
308
|
-
/**
|
|
309
|
-
* Initializes the provider with the given configuration.
|
|
310
|
-
* If WASM was already warmed up via `warmupWasm()`, this returns almost instantly.
|
|
311
|
-
* @param config - Provider configuration including WASM paths
|
|
312
|
-
*/
|
|
313
|
-
initialize(config: WasmUtilConfig): Promise<void>;
|
|
314
|
-
/**
|
|
315
|
-
* Encrypts a base64 image using the WASM utility API.
|
|
316
|
-
* @param image - Base64 image string (no data URL prefix)
|
|
317
|
-
* @returns Encrypted string
|
|
318
|
-
*/
|
|
319
|
-
encryptImage(image: string): string;
|
|
320
|
-
setSdkVersion(version: string): void;
|
|
321
|
-
setSdkPlatform(platform: string): void;
|
|
322
|
-
setDeviceInfo(deviceInfo: object, overrideExisting?: boolean): void;
|
|
323
|
-
setBrowserInfo(browserInfo: object, overrideExisting?: boolean): void;
|
|
324
|
-
setCameraInfo(cameraInfo: object, overrideExisting?: boolean): void;
|
|
325
|
-
setMotionStatus(status: string): void;
|
|
326
|
-
setBackgroundMode(backgroundMode: boolean): void;
|
|
327
|
-
setZc(zc: string): void;
|
|
328
|
-
setInspectorOpened(opened: boolean): void;
|
|
329
|
-
getMetadata(): string;
|
|
330
|
-
analyzeFrame(image: ImageData): Promise<void>;
|
|
331
|
-
getCheck(): string;
|
|
332
|
-
/**
|
|
333
|
-
* Gets the current pipeline state. Must be called before setMotionStatus(),
|
|
334
|
-
* getCheck(), setBackgroundMode(), and getMetadata() for proper metadata generation.
|
|
335
|
-
*/
|
|
336
|
-
getPipelineState(): string;
|
|
337
|
-
estimatePerformance(): string;
|
|
338
|
-
isVirtualCamera(label: string | null): boolean;
|
|
339
|
-
prc(): Promise<void>;
|
|
340
|
-
poc(output: VirtualCameraCheckOutput): Promise<void>;
|
|
341
|
-
ckvcks(data: ArrayBuffer): void;
|
|
342
|
-
getVersions(): Promise<unknown>;
|
|
343
|
-
/**
|
|
344
|
-
* Disposes of resources and resets initialization state.
|
|
345
|
-
*/
|
|
346
|
-
dispose(): Promise<void>;
|
|
333
|
+
//#region ../infra/src/capabilities/IMotionSensorCapability.d.ts
|
|
334
|
+
type MotionStatus = 'PASS' | 'FAIL' | 'UNCLEAR';
|
|
335
|
+
type MotionPermissionState = 'granted' | 'denied' | 'not-required';
|
|
336
|
+
type IMotionSensorCapability = {
|
|
337
|
+
requestPermission(): Promise<MotionPermissionState>;
|
|
338
|
+
start(): Promise<void>;
|
|
339
|
+
stop(): void;
|
|
340
|
+
check(): MotionStatus;
|
|
341
|
+
readonly isRunning: boolean;
|
|
342
|
+
readonly hasPermission: boolean;
|
|
347
343
|
};
|
|
348
344
|
//#endregion
|
|
349
345
|
//#region src/internal/deepsight/metadataService.d.ts
|
|
@@ -408,4 +404,4 @@ type DeepsightPrcCheckParams = {
|
|
|
408
404
|
constraints: MediaStreamConstraints;
|
|
409
405
|
};
|
|
410
406
|
//#endregion
|
|
411
|
-
export {
|
|
407
|
+
export { IWasmUtilCapability as a, IMLProviderCapability as c, IRecordingCapability as d, RecordingConnection as f, IncodeCanvas as i, MLProviderConfig as l, IMotionSensorCapability as n, VirtualCameraCheckOutput as o, StreamCanvasCapture as r, WasmUtilConfig as s, DeepsightService as t, IStorageCapability as u };
|
package/dist/device.d.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
//#region ../infra/src/capabilities/platform.d.ts
|
|
2
|
+
|
|
3
|
+
declare function isIPad(userAgent?: string): boolean;
|
|
4
|
+
//#endregion
|
|
5
|
+
//#region ../infra/src/capabilities/IScreenOrientationCapability.d.ts
|
|
6
|
+
type ScreenOrientationState = 'portrait' | 'landscape';
|
|
7
|
+
type IScreenOrientationCapability = {
|
|
8
|
+
readonly current: ScreenOrientationState;
|
|
9
|
+
subscribe(callback: (state: ScreenOrientationState) => void): () => void;
|
|
10
|
+
cleanup(): void;
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region ../infra/src/providers/browser/ScreenOrientationProvider.d.ts
|
|
14
|
+
declare class ScreenOrientationProvider implements IScreenOrientationCapability {
|
|
15
|
+
private _current;
|
|
16
|
+
private subscribers;
|
|
17
|
+
private orientationChangeHandler;
|
|
18
|
+
private resizeHandler;
|
|
19
|
+
private mediaQueryList;
|
|
20
|
+
private mediaQueryHandler;
|
|
21
|
+
constructor();
|
|
22
|
+
get current(): ScreenOrientationState;
|
|
23
|
+
subscribe(callback: (state: ScreenOrientationState) => void): () => void;
|
|
24
|
+
cleanup(): void;
|
|
25
|
+
private handleOrientationChange;
|
|
26
|
+
private handleResize;
|
|
27
|
+
private updateState;
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/internal/device/getBrowser.d.ts
|
|
31
|
+
type Browser = 'chrome' | 'firefox' | 'safari' | 'edge' | 'opera' | 'other' | 'samsung_browser';
|
|
32
|
+
declare function getBrowser(): Browser;
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region src/internal/device/getDeviceClass.d.ts
|
|
35
|
+
type DeviceClass = 'ios' | 'android' | 'desktop';
|
|
36
|
+
declare function getDeviceClass(): DeviceClass;
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/internal/device/screenOrientation.d.ts
|
|
39
|
+
type ScreenOrientationObserver = {
|
|
40
|
+
get isLandscapeMobile(): boolean;
|
|
41
|
+
subscribe(callback: (isLandscapeMobile: boolean) => void): () => void;
|
|
42
|
+
cleanup(): void;
|
|
43
|
+
};
|
|
44
|
+
declare function createScreenOrientationObserver(provider: IScreenOrientationCapability, deviceClass: DeviceClass): ScreenOrientationObserver;
|
|
45
|
+
//#endregion
|
|
46
|
+
export { type Browser, type DeviceClass, type ScreenOrientationObserver, ScreenOrientationProvider, createScreenOrientationObserver, getBrowser, getDeviceClass, isIPad };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { t as getUserAgent } from "./getBrowser-B800KRAi.esm.js";
|
|
2
|
+
import { i as isIPad } from "./platform-Dcuv6w60.esm.js";
|
|
3
|
+
import { t as getDeviceClass } from "./getDeviceClass-BKd2FOAf.esm.js";
|
|
4
|
+
|
|
5
|
+
//#region src/internal/device/getBrowser.ts
|
|
6
|
+
function getBrowser() {
|
|
7
|
+
const userAgent = getUserAgent();
|
|
8
|
+
if (!userAgent) return "other";
|
|
9
|
+
const ua = userAgent.toLowerCase();
|
|
10
|
+
if (ua.includes("edg/") || ua.includes("edgios/")) return "edge";
|
|
11
|
+
if (ua.includes("samsungbrowser/")) return "samsung_browser";
|
|
12
|
+
if (ua.includes("opr/") || ua.includes("opera") || ua.includes("opios/") || ua.includes("opt/")) return "opera";
|
|
13
|
+
if (ua.includes("chrome") || ua.includes("crios")) return "chrome";
|
|
14
|
+
if (ua.includes("firefox") || ua.includes("fxios")) return "firefox";
|
|
15
|
+
if (ua.includes("safari")) return "safari";
|
|
16
|
+
return "other";
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/internal/device/screenOrientation.ts
|
|
21
|
+
function createScreenOrientationObserver(provider, deviceClass) {
|
|
22
|
+
const getIsLandscapeMobile = () => deviceClass !== "desktop" && !isIPad() && provider.current === "landscape";
|
|
23
|
+
return {
|
|
24
|
+
get isLandscapeMobile() {
|
|
25
|
+
return getIsLandscapeMobile();
|
|
26
|
+
},
|
|
27
|
+
subscribe(callback) {
|
|
28
|
+
return provider.subscribe(() => {
|
|
29
|
+
callback(getIsLandscapeMobile());
|
|
30
|
+
});
|
|
31
|
+
},
|
|
32
|
+
cleanup: () => provider.cleanup()
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region ../infra/src/providers/browser/ScreenOrientationProvider.ts
|
|
38
|
+
function isPortrait() {
|
|
39
|
+
if (typeof window === "undefined" || typeof screen === "undefined") return true;
|
|
40
|
+
if (typeof window.matchMedia === "function") return !window.matchMedia("(orientation: landscape)").matches;
|
|
41
|
+
if (screen.orientation?.type?.includes("portrait")) return true;
|
|
42
|
+
if (screen.orientation?.type?.includes("landscape")) return false;
|
|
43
|
+
const orientation = window.orientation;
|
|
44
|
+
if (typeof orientation === "number") return Math.abs(orientation) === 0;
|
|
45
|
+
return window.innerHeight >= window.innerWidth;
|
|
46
|
+
}
|
|
47
|
+
function toState(portrait) {
|
|
48
|
+
return portrait ? "portrait" : "landscape";
|
|
49
|
+
}
|
|
50
|
+
var ScreenOrientationProvider = class {
|
|
51
|
+
constructor() {
|
|
52
|
+
this._current = toState(isPortrait());
|
|
53
|
+
this.subscribers = /* @__PURE__ */ new Set();
|
|
54
|
+
this.orientationChangeHandler = this.handleOrientationChange.bind(this);
|
|
55
|
+
this.resizeHandler = this.handleResize.bind(this);
|
|
56
|
+
this.mediaQueryList = null;
|
|
57
|
+
this.mediaQueryHandler = this.handleResize.bind(this);
|
|
58
|
+
if (typeof window === "undefined") return;
|
|
59
|
+
if (screen.orientation) screen.orientation.addEventListener("change", this.orientationChangeHandler);
|
|
60
|
+
else window.addEventListener("orientationchange", this.orientationChangeHandler);
|
|
61
|
+
window.addEventListener("resize", this.resizeHandler);
|
|
62
|
+
if (typeof window.matchMedia === "function") {
|
|
63
|
+
this.mediaQueryList = window.matchMedia("(orientation: landscape)");
|
|
64
|
+
this.mediaQueryList.addEventListener("change", this.mediaQueryHandler);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
get current() {
|
|
68
|
+
return this._current;
|
|
69
|
+
}
|
|
70
|
+
subscribe(callback) {
|
|
71
|
+
this.subscribers.add(callback);
|
|
72
|
+
callback(this._current);
|
|
73
|
+
return () => {
|
|
74
|
+
this.subscribers.delete(callback);
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
cleanup() {
|
|
78
|
+
if (typeof window === "undefined") return;
|
|
79
|
+
if (screen.orientation) screen.orientation.removeEventListener("change", this.orientationChangeHandler);
|
|
80
|
+
else window.removeEventListener("orientationchange", this.orientationChangeHandler);
|
|
81
|
+
window.removeEventListener("resize", this.resizeHandler);
|
|
82
|
+
this.mediaQueryList?.removeEventListener("change", this.mediaQueryHandler);
|
|
83
|
+
this.mediaQueryList = null;
|
|
84
|
+
this.subscribers.clear();
|
|
85
|
+
}
|
|
86
|
+
handleOrientationChange() {
|
|
87
|
+
setTimeout(() => {
|
|
88
|
+
this.updateState();
|
|
89
|
+
if (document.activeElement instanceof HTMLElement) document.activeElement.blur();
|
|
90
|
+
window.focus();
|
|
91
|
+
}, 0);
|
|
92
|
+
}
|
|
93
|
+
handleResize() {
|
|
94
|
+
this.updateState();
|
|
95
|
+
}
|
|
96
|
+
updateState() {
|
|
97
|
+
const next = toState(isPortrait());
|
|
98
|
+
if (next !== this._current) {
|
|
99
|
+
this._current = next;
|
|
100
|
+
for (const cb of this.subscribers) cb(this._current);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
//#endregion
|
|
106
|
+
export { ScreenOrientationProvider, createScreenOrientationObserver, getBrowser, getDeviceClass, isIPad };
|