@incodetech/core 2.0.0-alpha.13 → 2.0.0-alpha.15
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/{OpenViduLogger-CRbRNZA7.esm.js → OpenViduLogger-BLxxXoyF.esm.js} +1 -1
- package/dist/OpenViduLogger-DyqID_-7.esm.js +3 -0
- package/dist/api-DfRLAneb.esm.js +53 -0
- package/dist/deepsightLoader-Ct3HSIhk.esm.js +24 -0
- package/dist/deepsightService-B8c8aZje.esm.js +236 -0
- package/dist/email.d.ts +5 -5
- package/dist/email.esm.js +16 -17
- package/dist/{xstate.esm-2hDiAXvZ.esm.js → endpoints-BUsSVoJV.esm.js} +28 -1
- package/dist/events-B8ZkhAZo.esm.js +285 -0
- package/dist/flow.d.ts +2 -3
- package/dist/flow.esm.js +18 -7
- package/dist/getDeviceClass-DkfbtsIJ.esm.js +41 -0
- package/dist/{id-DHVSW_wJ.esm.js → id-GPFS1Wo_.esm.js} +38 -36
- package/dist/id.d.ts +4 -5
- package/dist/id.esm.js +7 -6
- package/dist/{index-CbF_uI-x.d.ts → index-CJMK8K5u.d.ts} +3 -7
- package/dist/index.d.ts +220 -6
- package/dist/index.esm.js +12 -8
- package/dist/{lib-BJoLTN_W.esm.js → lib-CbAibJlt.esm.js} +2 -2
- package/dist/phone.d.ts +5 -5
- package/dist/phone.esm.js +16 -14
- package/dist/selfie.d.ts +119 -46
- package/dist/selfie.esm.js +284 -161
- package/dist/{endpoints-D9TGnxRK.esm.js → src-XSoNGEQW.esm.js} +242 -112
- package/dist/stats-DnU4uUFv.esm.js +16 -0
- package/dist/stats.d.ts +12 -0
- package/dist/stats.esm.js +4 -0
- package/dist/{streamingEvents-B3hNanPl.esm.js → streamingEvents-J6ffKmJL.esm.js} +35 -36
- package/dist/{types-BpCrZLU6.d.ts → types-CMR6NkxW.d.ts} +58 -1
- package/dist/{types-DZbrbPgj.d.ts → types-CRVSv38Q.d.ts} +10 -1
- package/package.json +2 -2
- package/dist/OpenViduLogger-Dy5P806a.esm.js +0 -3
- package/dist/StateMachine-pi8byl8C.d.ts +0 -58
- package/dist/addEvent-BGKc_lHF.esm.js +0 -16
- package/dist/deepsightLoader-B36_XZ7r.esm.js +0 -25
- package/dist/deepsightService-BWxcc4OC.esm.js +0 -225
- package/dist/recordingsRepository-D5MURoVB.esm.js +0 -40
- /package/dist/{Manager-BZUZTRPx.d.ts → Manager-Co-PsiG9.d.ts} +0 -0
- /package/dist/{chunk-FbsBJI8u.esm.js → chunk-V5DOKNPJ.esm.js} +0 -0
package/dist/selfie.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as CameraStream, d as IMLProviderCapability, f as MLProviderConfig, i as StreamCanvasCapture, l as MotionPermissionState, n as PermissionStatus, o as IRecordingCapability, p as IncodeCanvas, r as BaseWasmProvider,
|
|
2
|
-
import {
|
|
3
|
-
import { t as Manager } from "./Manager-
|
|
1
|
+
import { a as CameraStream, d as IMLProviderCapability, f as MLProviderConfig, i as StreamCanvasCapture, l as MotionPermissionState, n as PermissionStatus, o as IRecordingCapability, p as IncodeCanvas, r as BaseWasmProvider, t as PermissionResult, u as MotionStatus } from "./types-CRVSv38Q.js";
|
|
2
|
+
import { a as AnyStateMachine, o as StateMachine, r as FlowModuleConfig, s as WasmPipeline, t as Flow } from "./types-CMR6NkxW.js";
|
|
3
|
+
import { t as Manager } from "./Manager-Co-PsiG9.js";
|
|
4
4
|
|
|
5
5
|
//#region ../infra/src/capabilities/IFaceDetectionCapability.d.ts
|
|
6
6
|
|
|
@@ -143,18 +143,83 @@ interface IFaceDetectionCapability extends IMLProviderCapability<FaceDetectionCo
|
|
|
143
143
|
setVideoSelfieMode(enabled: boolean): void;
|
|
144
144
|
}
|
|
145
145
|
//#endregion
|
|
146
|
-
//#region ../infra/src/capabilities/
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
146
|
+
//#region ../infra/src/capabilities/IStorageCapability.d.ts
|
|
147
|
+
/**
|
|
148
|
+
* Storage capability interface for abstracting storage operations.
|
|
149
|
+
* Enables swapping between browser localStorage and future WASM-based storage.
|
|
150
|
+
*/
|
|
151
|
+
interface IStorageCapability {
|
|
152
|
+
/**
|
|
153
|
+
* Retrieves a value from storage.
|
|
154
|
+
* @param key - The storage key
|
|
155
|
+
* @returns The stored value or null if not found
|
|
156
|
+
*/
|
|
157
|
+
get<T>(key: string): Promise<T | null>;
|
|
158
|
+
/**
|
|
159
|
+
* Stores a value in storage.
|
|
160
|
+
* @param key - The storage key
|
|
161
|
+
* @param value - The value to store (will be serialized)
|
|
162
|
+
*/
|
|
163
|
+
set<T>(key: string, value: T): Promise<void>;
|
|
164
|
+
/**
|
|
165
|
+
* Removes a value from storage.
|
|
166
|
+
* @param key - The storage key to remove
|
|
167
|
+
*/
|
|
168
|
+
remove(key: string): Promise<void>;
|
|
169
|
+
/**
|
|
170
|
+
* Clears all values from storage.
|
|
171
|
+
*/
|
|
172
|
+
clear(): Promise<void>;
|
|
173
|
+
}
|
|
174
|
+
//#endregion
|
|
175
|
+
//#region ../infra/src/capabilities/IWasmUtilCapability.d.ts
|
|
176
|
+
type WasmUtilConfig = MLProviderConfig & {
|
|
177
|
+
pipelines?: WasmPipeline[];
|
|
150
178
|
};
|
|
151
|
-
type
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
179
|
+
type VirtualCameraCheckOutput = {
|
|
180
|
+
canvas: HTMLCanvasElement | null;
|
|
181
|
+
itr: boolean | null;
|
|
182
|
+
skipped: boolean | null;
|
|
183
|
+
};
|
|
184
|
+
type IWasmUtilCapability = {
|
|
185
|
+
/**
|
|
186
|
+
* Whether the provider has been initialized and is ready to be used.
|
|
187
|
+
*/
|
|
188
|
+
readonly initialized: boolean;
|
|
189
|
+
/**
|
|
190
|
+
* Initializes the provider with the given configuration.
|
|
191
|
+
* If WASM was already warmed up via `warmupWasm()`, this returns almost instantly.
|
|
192
|
+
* @param config - Provider configuration including WASM paths
|
|
193
|
+
*/
|
|
194
|
+
initialize(config: WasmUtilConfig): Promise<void>;
|
|
195
|
+
/**
|
|
196
|
+
* Encrypts a base64 image using the WASM utility API.
|
|
197
|
+
* @param image - Base64 image string (no data URL prefix)
|
|
198
|
+
* @returns Encrypted string
|
|
199
|
+
*/
|
|
200
|
+
encryptImage(image: string): string;
|
|
201
|
+
setSdkVersion(version: string): void;
|
|
202
|
+
setSdkPlatform(platform: string): void;
|
|
203
|
+
setDeviceInfo(deviceInfo: object, overrideExisting?: boolean): void;
|
|
204
|
+
setBrowserInfo(browserInfo: object, overrideExisting?: boolean): void;
|
|
205
|
+
setCameraInfo(cameraInfo: object, overrideExisting?: boolean): void;
|
|
206
|
+
setMotionStatus(status: string): void;
|
|
207
|
+
setBackgroundMode(backgroundMode: boolean): void;
|
|
208
|
+
setZc(zc: string): void;
|
|
209
|
+
setInspectorOpened(opened: boolean): void;
|
|
210
|
+
getMetadata(): string;
|
|
211
|
+
analyzeFrame(image: ImageData): Promise<void>;
|
|
212
|
+
getCheck(): string;
|
|
213
|
+
estimatePerformance(): string;
|
|
214
|
+
isVirtualCamera(label: string | null): boolean;
|
|
215
|
+
prc(): Promise<void>;
|
|
216
|
+
poc(output: VirtualCameraCheckOutput): Promise<void>;
|
|
217
|
+
ckvcks(data: ArrayBuffer): void;
|
|
218
|
+
getVersions(): Promise<unknown>;
|
|
219
|
+
/**
|
|
220
|
+
* Disposes of resources and resets initialization state.
|
|
221
|
+
*/
|
|
222
|
+
dispose(): Promise<void>;
|
|
158
223
|
};
|
|
159
224
|
//#endregion
|
|
160
225
|
//#region ../infra/src/providers/wasm/FaceDetectionProvider.d.ts
|
|
@@ -203,43 +268,48 @@ type MotionStatusService = {
|
|
|
203
268
|
readonly hasPermission: boolean;
|
|
204
269
|
};
|
|
205
270
|
//#endregion
|
|
206
|
-
//#region src/internal/
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
271
|
+
//#region src/internal/virtualCameraCheck.d.ts
|
|
272
|
+
declare const frameSources: {
|
|
273
|
+
readonly front: "FRONT_ID";
|
|
274
|
+
readonly back: "BACK_ID";
|
|
275
|
+
readonly selfie: "SELFIE";
|
|
210
276
|
};
|
|
277
|
+
type FrameSource = (typeof frameSources)[keyof typeof frameSources];
|
|
278
|
+
//#endregion
|
|
279
|
+
//#region src/internal/deepsight/deepsightService.d.ts
|
|
211
280
|
type DeepsightService = {
|
|
212
281
|
readonly metadata: MetadataService;
|
|
213
282
|
readonly motion: MotionStatusService;
|
|
214
|
-
readonly recorder: IDeepsightRecordingCapability;
|
|
215
283
|
initialize(disableIpify?: boolean): Promise<void>;
|
|
216
284
|
requestMotionPermission(): Promise<'granted' | 'denied' | 'not-required'>;
|
|
217
285
|
startMotionSensors(): Promise<void>;
|
|
218
286
|
stopMotionSensors(): void;
|
|
219
|
-
startRecording(stream: MediaStream): void;
|
|
220
287
|
checkVirtualCamera(videoTrack: MediaStreamTrack): Promise<boolean>;
|
|
221
|
-
performVirtualCameraCheck(): Promise<void>;
|
|
222
|
-
|
|
288
|
+
performVirtualCameraCheck(sessionToken: string | null, source: FrameSource): Promise<void>;
|
|
289
|
+
/**
|
|
290
|
+
* Runs PRC warmup and stores DS flag using infrastructure providers.
|
|
291
|
+
*/
|
|
292
|
+
performPrcCheck(params: DeepsightPrcCheckParams): Promise<void>;
|
|
293
|
+
analyzeFrame(imageData: ImageData): Promise<void>;
|
|
294
|
+
getMetadata(): string;
|
|
223
295
|
cleanup(): void;
|
|
224
296
|
};
|
|
297
|
+
type DeepsightPrcCheckParams = {
|
|
298
|
+
constraints: MediaStreamConstraints;
|
|
299
|
+
ds?: boolean;
|
|
300
|
+
storage: IStorageCapability;
|
|
301
|
+
};
|
|
225
302
|
//#endregion
|
|
226
303
|
//#region src/modules/selfie/types.d.ts
|
|
227
|
-
type SelfieConfig = {
|
|
228
|
-
showTutorial: boolean;
|
|
229
|
-
showPreview: boolean;
|
|
230
|
-
assistedOnboarding: boolean;
|
|
231
|
-
enableFaceRecording: boolean;
|
|
304
|
+
type SelfieConfig = FlowModuleConfig['SELFIE'] & {
|
|
232
305
|
recording?: {
|
|
233
306
|
capability?: IRecordingCapability;
|
|
234
307
|
};
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
validateClosedEyes: boolean;
|
|
241
|
-
validateBrightness: boolean;
|
|
242
|
-
deepsightLiveness: 'SINGLE_FRAME' | 'MULTIMODAL' | 'VIDEOLIVENESS';
|
|
308
|
+
ds?: Flow['ds'];
|
|
309
|
+
};
|
|
310
|
+
type SelfieDependencies = {
|
|
311
|
+
storage: IStorageCapability;
|
|
312
|
+
getWasmUtil: () => Promise<IWasmUtilCapability>;
|
|
243
313
|
};
|
|
244
314
|
type DetectionStatus = 'idle' | 'detecting' | 'noFace' | 'tooManyFaces' | 'tooClose' | 'tooFar' | 'blur' | 'dark' | 'faceAngle' | 'headWear' | 'lenses' | 'eyesClosed' | 'faceMask' | 'centerFace' | 'manualCapture' | 'success' | 'error' | 'capturing' | 'getReady' | 'getReadyFinished' | 'offline';
|
|
245
315
|
type SendFaceImageResponse = {
|
|
@@ -285,14 +355,6 @@ declare const FACE_ERROR_CODES: {
|
|
|
285
355
|
readonly SELFIE_IMAGE_LOW_QUALITY: "SELFIE_IMAGE_LOW_QUALITY";
|
|
286
356
|
};
|
|
287
357
|
type FaceErrorCode = (typeof FACE_ERROR_CODES)[keyof typeof FACE_ERROR_CODES];
|
|
288
|
-
type RecordingSession = {
|
|
289
|
-
token: string;
|
|
290
|
-
sessionId: string;
|
|
291
|
-
videoRecordingId: string;
|
|
292
|
-
connection: RecordingConnection;
|
|
293
|
-
resolution?: string;
|
|
294
|
-
hasAudio: boolean;
|
|
295
|
-
};
|
|
296
358
|
//#endregion
|
|
297
359
|
//#region src/modules/selfie/selfieUploadService.d.ts
|
|
298
360
|
type ProcessFaceImageType = 'selfie' | 'videoSelfie';
|
|
@@ -303,9 +365,19 @@ type ProcessFaceResponse = {
|
|
|
303
365
|
};
|
|
304
366
|
declare function processFace(imageType?: ProcessFaceImageType, signal?: AbortSignal): Promise<ProcessFaceResponse>;
|
|
305
367
|
//#endregion
|
|
368
|
+
//#region src/modules/selfie/recordingService.d.ts
|
|
369
|
+
type RecordingService = {
|
|
370
|
+
start(stream: MediaStream): Promise<void>;
|
|
371
|
+
stop(): Promise<{
|
|
372
|
+
recordingId: string | null;
|
|
373
|
+
}>;
|
|
374
|
+
cleanup(): void;
|
|
375
|
+
};
|
|
376
|
+
//#endregion
|
|
306
377
|
//#region src/modules/selfie/selfieStateMachine.d.ts
|
|
307
378
|
type SelfieContext = {
|
|
308
379
|
config: SelfieConfig;
|
|
380
|
+
dependencies: SelfieDependencies;
|
|
309
381
|
stream: CameraStream | undefined;
|
|
310
382
|
provider: FaceDetectionProvider | undefined;
|
|
311
383
|
frameCapturer: StreamCanvasCapture | undefined;
|
|
@@ -316,8 +388,7 @@ type SelfieContext = {
|
|
|
316
388
|
faceCoordinates: FaceCoordinates | undefined;
|
|
317
389
|
uploadResponse: SendFaceImageResponse | undefined;
|
|
318
390
|
processResponse: ProcessFaceResponse | undefined;
|
|
319
|
-
|
|
320
|
-
recordingStream: MediaStream | undefined;
|
|
391
|
+
recordingService: RecordingService | undefined;
|
|
321
392
|
attemptsRemaining: number;
|
|
322
393
|
uploadError: FaceErrorCode | undefined;
|
|
323
394
|
permissionResult: PermissionResult | 'refresh' | undefined;
|
|
@@ -358,6 +429,7 @@ type SelfieEvent = {
|
|
|
358
429
|
};
|
|
359
430
|
type SelfieInput = {
|
|
360
431
|
config: SelfieConfig;
|
|
432
|
+
dependencies: SelfieDependencies;
|
|
361
433
|
};
|
|
362
434
|
/**
|
|
363
435
|
* The selfie capture state machine.
|
|
@@ -375,6 +447,7 @@ type SelfieMachine = StateMachine<SelfieContext, SelfieEvent, any, any, any, any
|
|
|
375
447
|
//#region src/modules/selfie/selfieActor.d.ts
|
|
376
448
|
type CreateSelfieActorOptions = {
|
|
377
449
|
config: SelfieConfig;
|
|
450
|
+
dependencies?: SelfieDependencies;
|
|
378
451
|
};
|
|
379
452
|
//#endregion
|
|
380
453
|
//#region src/modules/selfie/selfieManager.d.ts
|
|
@@ -499,7 +572,7 @@ declare function createSelfieManager(options: CreateSelfieActorOptions): Manager
|
|
|
499
572
|
close(): void;
|
|
500
573
|
/**
|
|
501
574
|
* Resets the selfie manager to its initial `idle` state.
|
|
502
|
-
* Can be called from `
|
|
575
|
+
* Can be called from `error` state. Not available from `finished` (final state).
|
|
503
576
|
*/
|
|
504
577
|
reset(): void;
|
|
505
578
|
/**
|