@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.
Files changed (39) hide show
  1. package/dist/{OpenViduLogger-CRbRNZA7.esm.js → OpenViduLogger-BLxxXoyF.esm.js} +1 -1
  2. package/dist/OpenViduLogger-DyqID_-7.esm.js +3 -0
  3. package/dist/api-DfRLAneb.esm.js +53 -0
  4. package/dist/deepsightLoader-Ct3HSIhk.esm.js +24 -0
  5. package/dist/deepsightService-B8c8aZje.esm.js +236 -0
  6. package/dist/email.d.ts +5 -5
  7. package/dist/email.esm.js +16 -17
  8. package/dist/{xstate.esm-2hDiAXvZ.esm.js → endpoints-BUsSVoJV.esm.js} +28 -1
  9. package/dist/events-B8ZkhAZo.esm.js +285 -0
  10. package/dist/flow.d.ts +2 -3
  11. package/dist/flow.esm.js +18 -7
  12. package/dist/getDeviceClass-DkfbtsIJ.esm.js +41 -0
  13. package/dist/{id-DHVSW_wJ.esm.js → id-GPFS1Wo_.esm.js} +38 -36
  14. package/dist/id.d.ts +4 -5
  15. package/dist/id.esm.js +7 -6
  16. package/dist/{index-CbF_uI-x.d.ts → index-CJMK8K5u.d.ts} +3 -7
  17. package/dist/index.d.ts +220 -6
  18. package/dist/index.esm.js +12 -8
  19. package/dist/{lib-BJoLTN_W.esm.js → lib-CbAibJlt.esm.js} +2 -2
  20. package/dist/phone.d.ts +5 -5
  21. package/dist/phone.esm.js +16 -14
  22. package/dist/selfie.d.ts +119 -46
  23. package/dist/selfie.esm.js +284 -161
  24. package/dist/{endpoints-D9TGnxRK.esm.js → src-XSoNGEQW.esm.js} +242 -112
  25. package/dist/stats-DnU4uUFv.esm.js +16 -0
  26. package/dist/stats.d.ts +12 -0
  27. package/dist/stats.esm.js +4 -0
  28. package/dist/{streamingEvents-B3hNanPl.esm.js → streamingEvents-J6ffKmJL.esm.js} +35 -36
  29. package/dist/{types-BpCrZLU6.d.ts → types-CMR6NkxW.d.ts} +58 -1
  30. package/dist/{types-DZbrbPgj.d.ts → types-CRVSv38Q.d.ts} +10 -1
  31. package/package.json +2 -2
  32. package/dist/OpenViduLogger-Dy5P806a.esm.js +0 -3
  33. package/dist/StateMachine-pi8byl8C.d.ts +0 -58
  34. package/dist/addEvent-BGKc_lHF.esm.js +0 -16
  35. package/dist/deepsightLoader-B36_XZ7r.esm.js +0 -25
  36. package/dist/deepsightService-BWxcc4OC.esm.js +0 -225
  37. package/dist/recordingsRepository-D5MURoVB.esm.js +0 -40
  38. /package/dist/{Manager-BZUZTRPx.d.ts → Manager-Co-PsiG9.d.ts} +0 -0
  39. /package/dist/{chunk-FbsBJI8u.esm.js → chunk-V5DOKNPJ.esm.js} +0 -0
@@ -1,7 +1,6 @@
1
- import { a as CameraStream, c as IMotionSensorCapability, d as IMLProviderCapability, f as MLProviderConfig, i as StreamCanvasCapture, n as PermissionStatus, o as IRecordingCapability, p as IncodeCanvas, r as BaseWasmProvider, s as RecordingConnection, t as PermissionResult } from "./types-DZbrbPgj.js";
2
- import { n as StateMachine, t as AnyStateMachine } from "./StateMachine-pi8byl8C.js";
3
- import { t as Manager } from "./Manager-BZUZTRPx.js";
4
- import { i as TutorialIdConfig } from "./types-BpCrZLU6.js";
1
+ import { a as CameraStream, c as IMotionSensorCapability, d as IMLProviderCapability, f as MLProviderConfig, i as StreamCanvasCapture, n as PermissionStatus, o as IRecordingCapability, p as IncodeCanvas, r as BaseWasmProvider, s as RecordingConnection, t as PermissionResult } from "./types-CRVSv38Q.js";
2
+ import { a as AnyStateMachine, i as TutorialIdConfig, o as StateMachine } from "./types-CMR6NkxW.js";
3
+ import { t as Manager } from "./Manager-Co-PsiG9.js";
5
4
  import { ActorRefFrom } from "xstate";
6
5
 
7
6
  //#region ../infra/src/capabilities/IIdCaptureCapability.d.ts
@@ -303,9 +302,6 @@ type CaptureIdResponse = UploadIdResponse & {
303
302
  };
304
303
  type CapturedImage = {
305
304
  imageBase64: string;
306
- blob: Blob;
307
- url: string;
308
- metadata: string;
309
305
  };
310
306
  type RecordingSession = {
311
307
  token: string;
package/dist/index.d.ts CHANGED
@@ -1,8 +1,7 @@
1
- import { a as CameraStream, n as PermissionStatus, t as PermissionResult } from "./types-DZbrbPgj.js";
2
- import { A as IdCaptureMode, B as IIdCaptureCapability, C as CaptureIdResponse, D as ID_ERROR_CODES, E as DetectionStatus, F as IdFlowStep, I as RecordingSession, L as UploadIdResponse, M as IdDocumentType, N as IdError, O as IdCaptureConfig, P as IdErrorCode, R as IdCaptureProvider, S as validateUploadResponse, T as DetectionArea, V as IdCaptureSettings, _ as processId, a as IdCaptureActor, b as stopStream, c as IdCaptureEvent, d as idCaptureMachine, f as IdCaptureInitResult, g as initializeIdCapture, h as ValidationError, i as CreateIdCaptureActorOptions, j as IdCaptureThresholds, k as IdCaptureGeometry, l as IdCaptureInput, m as UploadIdImageParams, n as IdCaptureState, o as createIdCaptureActor, p as StartRecordingParams, r as createIdCaptureManager, s as IdCaptureContext, t as IdCaptureManager, u as IdCaptureMachine, v as startRecordingSession, w as CapturedImage, x as uploadIdImage, y as stopRecording, z as DetectionOrientation } from "./index-CbF_uI-x.js";
3
- import { i as warmupWasm, r as WasmPipeline } from "./StateMachine-pi8byl8C.js";
4
- import "./Manager-BZUZTRPx.js";
5
- import "./types-BpCrZLU6.js";
1
+ import { a as CameraStream, n as PermissionStatus, t as PermissionResult } from "./types-CRVSv38Q.js";
2
+ import { A as IdCaptureMode, B as IIdCaptureCapability, C as CaptureIdResponse, D as ID_ERROR_CODES, E as DetectionStatus, F as IdFlowStep, I as RecordingSession, L as UploadIdResponse, M as IdDocumentType, N as IdError, O as IdCaptureConfig, P as IdErrorCode, R as IdCaptureProvider, S as validateUploadResponse, T as DetectionArea, V as IdCaptureSettings, _ as processId, a as IdCaptureActor, b as stopStream, c as IdCaptureEvent, d as idCaptureMachine, f as IdCaptureInitResult, g as initializeIdCapture, h as ValidationError, i as CreateIdCaptureActorOptions, j as IdCaptureThresholds, k as IdCaptureGeometry, l as IdCaptureInput, m as UploadIdImageParams, n as IdCaptureState, o as createIdCaptureActor, p as StartRecordingParams, r as createIdCaptureManager, s as IdCaptureContext, t as IdCaptureManager, u as IdCaptureMachine, v as startRecordingSession, w as CapturedImage, x as uploadIdImage, y as stopRecording, z as DetectionOrientation } from "./index-CJMK8K5u.js";
3
+ import { c as warmupWasm, s as WasmPipeline } from "./types-CMR6NkxW.js";
4
+ import "./Manager-Co-PsiG9.js";
6
5
 
7
6
  //#region ../infra/src/http/types.d.ts
8
7
  type CreateApiConfig = {
@@ -228,4 +227,219 @@ declare function isConfigured(): boolean;
228
227
  */
229
228
  declare function reset(): void;
230
229
  //#endregion
231
- export { type Browser, CameraStream, CaptureIdResponse, CapturedImage, CreateIdCaptureActorOptions, type CreateSessionOptions, DetectionArea, DetectionOrientation, DetectionStatus, type DeviceClass, type HttpClient, ID_ERROR_CODES, IIdCaptureCapability, IdCaptureActor, IdCaptureConfig, IdCaptureContext, IdCaptureEvent, IdCaptureGeometry, IdCaptureInitResult, IdCaptureInput, IdCaptureMachine, IdCaptureManager, IdCaptureMode, IdCaptureProvider, IdCaptureSettings, IdCaptureState, IdCaptureThresholds, IdDocumentType, IdError, IdErrorCode, IdFlowStep, type PermissionResult, type PermissionStatus, RecordingSession, type Session, type SetupOptions, StartRecordingParams, UploadIdImageParams, UploadIdResponse, ValidationError, type WasmConfig, type WasmPipeline, api, checkPermission as checkCameraPermission, createApi, createIdCaptureActor, createIdCaptureManager, createSession, getApi, getBrowser, getDeviceClass, idCaptureMachine, initializeIdCapture, initializeWasmUtil, isConfigured, processId, requestPermission as requestCameraPermission, reset, setWasmConfig, setup, startRecordingSession, stopRecording, stopStream, uploadIdImage, validateUploadResponse, warmupWasm };
230
+ //#region src/internal/events/types.d.ts
231
+ type Event = {
232
+ code: string;
233
+ module?: string;
234
+ screen?: string;
235
+ payload?: Record<string, unknown>;
236
+ clientTimestamp?: number;
237
+ };
238
+ declare const eventModuleNames: {
239
+ readonly selfie: "SELFIE";
240
+ readonly authFace: "AUTH_FACE";
241
+ readonly mlConsent: "ML_CONSENT";
242
+ readonly combinedConsent: "COMBINED_CONSENT";
243
+ readonly curpValidation: "CURP_VALIDATION";
244
+ readonly faceMatch: "FACE_MATCH";
245
+ readonly qr: "QR";
246
+ readonly videoSelfie: "VIDEO_ONBOARDING";
247
+ readonly passport: "ID";
248
+ readonly front: "ID";
249
+ readonly back: "ID";
250
+ readonly id: "ID";
251
+ readonly document: "DOCUMENT_CAPTURE";
252
+ readonly creditCard: "CREDIT_CARD_FRONT";
253
+ readonly creditCardBack: "CREDIT_CARD_BACK";
254
+ readonly conference: "CONFERENCE";
255
+ readonly otp: "OTP";
256
+ readonly signature: "SIGNATURE";
257
+ readonly ekyc: "EXTERNAL_VERIFICATION";
258
+ readonly globalWatchList: "GLOBAL_WATCHLIST";
259
+ readonly customWatchList: "CUSTOM_WATCHLIST";
260
+ readonly email: "EMAIL";
261
+ readonly phone: "PHONE";
262
+ readonly instantVerifyEmail: "INSTANT_VERIFY_EMAIL";
263
+ readonly instantVerifyConsent: "INSTANT_VERIFY_CONSENT";
264
+ readonly forms: "FORMS";
265
+ readonly customModule: "CUSTOM_MODULE";
266
+ };
267
+ declare const eventScreenNames: {
268
+ readonly faceMatch: "FACE_MATCH";
269
+ readonly faceCaptureTutorial: "SELFIE_CAPTURE_TUTORIAL";
270
+ readonly faceCaptureCamera: "SELFIE_CAMERA_CAPTURE";
271
+ readonly faceCaptureError: "SELFIE_ATTEMPT_FAILED";
272
+ readonly faceCaptureSuccess: "SELFIE_UPLOAD_SUCCEEDED";
273
+ readonly faceCaptureUpload: "SELFIE_UPLOAD_PROGRESS";
274
+ readonly mlConsent: "MACHINE_LEARNING_CONSENT";
275
+ readonly combinedConsent: "COMBINED_CONSENT";
276
+ readonly curpEnter: "ENTER_CURP";
277
+ readonly curpValidate: "VALIDATE_CURP";
278
+ readonly curpGenerate: "GENERATE_CURP";
279
+ readonly curpValidation: "CURP_VALIDATION_PROGRESS";
280
+ readonly curpValidationFailed: "CURP_VALIDATION_FAILED";
281
+ readonly curpValidationSuccess: "CURP_VALIDATION_SUCCEEDED";
282
+ readonly qrTutorial: "QR_TUTORIAL";
283
+ readonly qrScan: "QR_SCAN";
284
+ readonly smsOtp: "OTP";
285
+ readonly simpleOTP: "OTP";
286
+ readonly signatureInput: "SIGNATURE_INPUT";
287
+ readonly frontTutorial: "FRONT_ID_CAPTURE_TUTORIAL";
288
+ readonly frontCameraCapture: "FRONT_ID_CAMERA_CAPTURE";
289
+ readonly frontHelp: "FRONT_ID_HELP";
290
+ readonly frontReviewPhoto: "FRONT_ID_REVIEW_PHOTO";
291
+ readonly frontUploadProgress: "FRONT_ID_UPLOAD_PROGRESS";
292
+ readonly frontAttemptFailed: "FRONT_ID_ATTEMPT_FAILED";
293
+ readonly frontUploadSuccess: "FRONT_ID_UPLOAD_SUCCEEDED";
294
+ readonly backTutorial: "BACK_ID_CAPTURE_TUTORIAL";
295
+ readonly backCameraCapture: "BACK_ID_CAMERA_CAPTURE";
296
+ readonly backReviewPhoto: "BACK_ID_REVIEW_PHOTO";
297
+ readonly backUploadProgress: "BACK_ID_UPLOAD_PROGRESS";
298
+ readonly backAttemptFailed: "BACK_ID_ATTEMPT_FAILED";
299
+ readonly backUploadSuccess: "BACK_ID_UPLOAD_SUCCEEDED";
300
+ readonly backHelp: "BACK_ID_HELP";
301
+ readonly passportTutorial: "TUTORIAL_PASSPORT";
302
+ readonly documentTutorial: "DOCUMENT_CAPTURE_TUTORIAL";
303
+ readonly documentCameraCapture: "DOCUMENT_CAMERA_CAPTURE";
304
+ readonly documentHelp: "DOCUMENT_HELP";
305
+ readonly documentReviewPhoto: "DOCUMENT_REVIEW_PHOTO";
306
+ readonly documentUploadProgress: "DOCUMENT_UPLOAD_IN_PROGRESS";
307
+ readonly documentAttemptFailed: "DOCUMENT_ATTEMPT_FAILED";
308
+ readonly documentUploadSuccess: "DOCUMENT_UPLOAD_SUCCEEDED";
309
+ readonly conferenceWait: "CONFERENCE_WAIT";
310
+ readonly conferenceVideoChat: "CONFERENCE_VIDEO_CHAT";
311
+ readonly conferenceMessageChat: "CONFERENCE_MESSAGE_CHAT";
312
+ readonly videoSelfieTutorial: "VIDEO_SELFIE_TUTORIAL";
313
+ readonly videoSelfie: "VIDEO_SELFIE";
314
+ readonly videoSelfieFaceCapture: "VIDEO_SELFIE_FACE_CAPTURE";
315
+ readonly videoSelfieFaceUploadProgress: "VIDEO_SELFIE_FACE_UPLOAD_PROGRESS";
316
+ readonly videoSelfieFaceAttemptFailed: "VIDEO_SELFIE_FACE_ATTEMPT_FAILED";
317
+ readonly videoSelfieFaceUploadSucceeded: "VIDEO_SELFIE_FACE_UPLOAD_SUCCEEDED";
318
+ readonly videoSelfieFrontIdCapture: "VIDEO_SELFIE_FRONT_ID_CAPTURE";
319
+ readonly videoSelfieFrontIdUploadProgress: "VIDEO_SELFIE_FRONT_ID_UPLOAD_PROGRESS";
320
+ readonly videoSelfieFrontIdAttemptFailed: "VIDEO_SELFIE_FRONT_ID_ATTEMPT_FAILED";
321
+ readonly videoSelfieFrontIdUploadSucceeded: "VIDEO_SELFIE_FRONT_ID_UPLOAD_SUCCEEDED";
322
+ readonly videoSelfieBackIdCapture: "VIDEO_SELFIE_BACK_ID_CAPTURE";
323
+ readonly videoSelfieBackIdUploadProgress: "VIDEO_SELFIE_BACK_ID_UPLOAD_PROGRESS";
324
+ readonly videoSelfieBackIdAttemptFailed: "VIDEO_SELFIE_BACK_ID_ATTEMPT_FAILED";
325
+ readonly videoSelfieBackIdUploadSucceeded: "VIDEO_SELFIE_BACK_ID_UPLOAD_SUCCEEDED";
326
+ readonly videoSelfieDocumentCapture: "VIDEO_SELFIE_DOCUMENT_CAPTURE";
327
+ readonly videoSelfieVoiceQuestion: "VIDEO_SELFIE_VOICE_QUESTION";
328
+ readonly videoSelfieVoiceFinalQuestion: "VIDEO_SELFIE_VOICE_FINAL_QUESTION";
329
+ readonly videoSelfieVideoUpload: "VIDEO SELFIE VIDEO UPLOAD";
330
+ readonly ekycInput: "EKYC_INPUT";
331
+ readonly ekycProgress: "EKYC_PROGRESS";
332
+ readonly ekycSucceeded: "EKYC_SUCCEEDED";
333
+ readonly ekycFailed: "EKYC_FAILED";
334
+ readonly forms: "FORMS";
335
+ readonly globalWatchListInput: "GLOBAL_WATCHLIST_INPUT";
336
+ readonly globalWatchListProgress: "GLOBAL_WATCHLIST_PROGRESS";
337
+ readonly globalWatchListSuccess: "GLOBAL_WATCHLIST_SUCCEEDED";
338
+ readonly globalWatchListFailed: "GLOBAL_WATCHLIST_FAILED";
339
+ readonly customWatchListInput: "CUSTOM_WATCHLIST_INPUT";
340
+ readonly customWatchListProgress: "CUSTOM_WATCHLIST_PROGRESS";
341
+ readonly customWatchListSuccess: "CUSTOM_WATCHLIST_SUCCEEDED";
342
+ readonly customWatchListFailed: "CUSTOM_WATCHLIST_FAILED";
343
+ readonly emailInput: "EMAIL_INPUT";
344
+ readonly phoneInput: "PHONE_INPUT";
345
+ readonly instantVerify: "INSTANT_VERIFY";
346
+ readonly authFace: "AUTH_FACE";
347
+ readonly authFaceError: "AUTH_FACE_ATTEMPT_FAILED";
348
+ readonly authFaceUpload: "AUTH_FACE_UPLOAD_PROGRESS";
349
+ readonly authFaceUploadSuccess: "AUTH_FACE_UPLOAD_SUCCEEDED";
350
+ readonly authFaceUploadFailed: "AUTH_FACE_UPLOAD_FAILED";
351
+ readonly customModuleCallback: "CUSTOM_MODULE_CALLBACK";
352
+ readonly customModuleProcessing: "CUSTOM_MODULE_PROCESSING";
353
+ readonly digitalIdFileSelection: "DIGITAL_ID_FILE_SELECTION";
354
+ readonly digitalIdFileReview: "DIGITAL_ID_FILE_REVIEW";
355
+ readonly digitalIdUploadProgress: "DIGITAL_ID_UPLOAD_PROGRESS";
356
+ readonly digitalIdUploadSuccess: "DIGITAL_ID_UPLOAD_SUCCEEDED";
357
+ readonly digitalIdUploadFailed: "DIGITAL_ID_UPLOAD_FAILED";
358
+ readonly digitalIdAnalysisProgress: "DIGITAL_ID_ANALYSIS_PROGRESS";
359
+ readonly digitalIdVerificationSuccess: "DIGITAL_ID_VERIFICATION_SUCCESS";
360
+ readonly digitalIdVerificationFailed: "DIGITAL_ID_VERIFICATION_FAILED";
361
+ };
362
+ declare const videoSelfieEvents: {
363
+ readonly imageTooBlurry: "imageTooBlurry";
364
+ readonly fillFrame: "fillFrame";
365
+ readonly checkCameraOrLighting: "checkCameraOrLighting";
366
+ readonly frontIdCaptureStarted: "frontIdCaptureStarted";
367
+ readonly lookAtCamera: "lookAtCamera";
368
+ readonly moveCloser: "moveCloser";
369
+ readonly lookingForFrontId: "lookingForFrontId";
370
+ readonly lookingForBackId: "lookingForBackId";
371
+ readonly cameraSwitchToBack: "cameraSwitchToBack";
372
+ readonly cameraSwitchToFront: "cameraSwitchToFront";
373
+ readonly audioStreamOpened: "audioStreamOpened";
374
+ readonly audioStreamClosed: "audioStreamClosed";
375
+ readonly videoSelfieVideoUploadInProgress: "videoSelfieVideoUploadInProgress";
376
+ readonly videoSelfieTosNotAccepted: "videoSelfieTosNotAccepted";
377
+ readonly videoSelfieTosAccepted: "videoSelfieTosAccepted";
378
+ readonly videoSelfieStreamCreated: "videoSelfieStreamCreated";
379
+ readonly videoSelfieStreamDestroyed: "videoSelfieStreamDestroyed";
380
+ readonly videoSelfieReconnecting: "videoSelfieReconnecting";
381
+ readonly videoSelfieReconnected: "videoSelfieReconnected";
382
+ };
383
+ declare const tutorialScreenNamesMapper: {
384
+ readonly passport: "TUTORIAL_PASSPORT";
385
+ readonly front: "FRONT_ID_CAPTURE_TUTORIAL";
386
+ readonly back: "BACK_ID_CAPTURE_TUTORIAL";
387
+ readonly selfie: "SELFIE_CAPTURE_TUTORIAL";
388
+ };
389
+ declare const cameraScreenNamesMapper: {
390
+ readonly front: "front";
391
+ readonly back: "back";
392
+ readonly passport: "passport";
393
+ readonly creditCard: "front";
394
+ readonly creditCardBack: "back";
395
+ readonly document: "document";
396
+ };
397
+ type EventModule = (typeof eventModuleNames)[keyof typeof eventModuleNames];
398
+ type EventScreen = (typeof eventScreenNames)[keyof typeof eventScreenNames];
399
+ //#endregion
400
+ //#region src/internal/events/addEvent.d.ts
401
+ type EventSubscriber = (event: Event) => void;
402
+ /**
403
+ * Subscribes to all SDK events for logging, debugging, or custom analytics.
404
+ * Returns an unsubscribe function.
405
+ *
406
+ * @param listener - Callback function that receives each event
407
+ * @returns Unsubscribe function to remove the listener
408
+ *
409
+ * @example
410
+ * ```typescript
411
+ * const unsubscribe = subscribeEvent((event) => {
412
+ * console.log('[Event]', event.code, event.module);
413
+ * });
414
+ *
415
+ * // Later
416
+ * unsubscribe();
417
+ * ```
418
+ */
419
+ declare function subscribeEvent(listener: EventSubscriber): () => void;
420
+ /**
421
+ * Sends an event to the dashboard for tracking.
422
+ * Fire-and-forget: never blocks, never throws.
423
+ * Events are queued if SDK is not configured yet.
424
+ */
425
+ declare function addEvent(event: Event): void;
426
+ /**
427
+ * Flushes any queued events that were sent before SDK was configured.
428
+ * Called automatically by setup() after token is set.
429
+ */
430
+ declare function flushEventQueue(): void;
431
+ //#endregion
432
+ //#region src/internal/events/helpers.d.ts
433
+ type ScreenEventParams = {
434
+ module: EventModule | string;
435
+ screen?: EventScreen | string;
436
+ code: string;
437
+ payload?: Record<string, unknown>;
438
+ };
439
+ declare function screenEvent(params: ScreenEventParams): void;
440
+ declare function moduleOpened(module: EventModule | string, screen?: EventScreen | string, payload?: Record<string, unknown>): void;
441
+ declare function moduleClosed(module: EventModule | string, screen?: EventScreen | string, payload?: Record<string, unknown>): void;
442
+ declare function screenOpened(module: EventModule | string, screen: EventScreen | string, payload?: Record<string, unknown>): void;
443
+ declare function screenClosed(module: EventModule | string, screen: EventScreen | string, payload?: Record<string, unknown>): void;
444
+ //#endregion
445
+ export { type Browser, CameraStream, CaptureIdResponse, CapturedImage, CreateIdCaptureActorOptions, type CreateSessionOptions, DetectionArea, DetectionOrientation, DetectionStatus, type DeviceClass, type Event, type EventModule, type EventScreen, type HttpClient, ID_ERROR_CODES, IIdCaptureCapability, IdCaptureActor, IdCaptureConfig, IdCaptureContext, IdCaptureEvent, IdCaptureGeometry, IdCaptureInitResult, IdCaptureInput, IdCaptureMachine, IdCaptureManager, IdCaptureMode, IdCaptureProvider, IdCaptureSettings, IdCaptureState, IdCaptureThresholds, IdDocumentType, IdError, IdErrorCode, IdFlowStep, type PermissionResult, type PermissionStatus, RecordingSession, type Session, type SetupOptions, StartRecordingParams, UploadIdImageParams, UploadIdResponse, ValidationError, type WasmConfig, type WasmPipeline, addEvent, api, cameraScreenNamesMapper, checkPermission as checkCameraPermission, createApi, createIdCaptureActor, createIdCaptureManager, createSession, eventModuleNames, eventScreenNames, flushEventQueue, getApi, getBrowser, getDeviceClass, idCaptureMachine, initializeIdCapture, initializeWasmUtil, isConfigured, moduleClosed, moduleOpened, processId, requestPermission as requestCameraPermission, reset, screenClosed, screenEvent, screenOpened, setWasmConfig, setup, startRecordingSession, stopRecording, stopStream, subscribeEvent, tutorialScreenNamesMapper, uploadIdImage, validateUploadResponse, videoSelfieEvents, warmupWasm };
package/dist/index.esm.js CHANGED
@@ -1,9 +1,10 @@
1
- import { D as createApi_default, a as resetApi, d as IdCaptureProvider, n as api, o as setClient, p as warmupWasm, r as getApi, s as setToken, t as endpoints, u as WasmUtilProvider } from "./endpoints-D9TGnxRK.esm.js";
2
- import "./recordingsRepository-D5MURoVB.esm.js";
3
- import { a as getBrowser, i as getDeviceClass, n as checkPermission, r as requestPermission } from "./streamingEvents-B3hNanPl.esm.js";
4
- import "./xstate.esm-2hDiAXvZ.esm.js";
5
- import "./addEvent-BGKc_lHF.esm.js";
6
- import { a as processId, c as stopStream, d as ID_ERROR_CODES, i as initializeIdCapture, l as uploadIdImage, n as createIdCaptureActor, o as startRecordingSession, r as idCaptureMachine, s as stopRecording, t as createIdCaptureManager, u as validateUploadResponse } from "./id-DHVSW_wJ.esm.js";
1
+ import { a as videoSelfieEvents, c as screenClosed, d as addEvent, f as flushEventQueue, i as tutorialScreenNamesMapper, l as screenEvent, n as eventModuleNames, o as moduleClosed, p as subscribeEvent, r as eventScreenNames, s as moduleOpened, t as cameraScreenNamesMapper, u as screenOpened } from "./events-B8ZkhAZo.esm.js";
2
+ import { a as processId, c as stopStream, d as ID_ERROR_CODES, i as initializeIdCapture, l as uploadIdImage, n as createIdCaptureActor, o as startRecordingSession, r as idCaptureMachine, s as stopRecording, t as createIdCaptureManager, u as validateUploadResponse } from "./id-GPFS1Wo_.esm.js";
3
+ import { i as IdCaptureProvider, o as warmupWasm, r as WasmUtilProvider, w as createApi_default } from "./src-XSoNGEQW.esm.js";
4
+ import "./getDeviceClass-DkfbtsIJ.esm.js";
5
+ import { t as endpoints } from "./endpoints-BUsSVoJV.esm.js";
6
+ import { c as getDeviceClass, l as getBrowser, o as checkPermission, s as requestPermission } from "./streamingEvents-J6ffKmJL.esm.js";
7
+ import { a as resetApi, n as getApi, o as setClient, s as setToken, t as api } from "./api-DfRLAneb.esm.js";
7
8
 
8
9
  //#region src/internal/session/sessionService.ts
9
10
  /**
@@ -88,7 +89,10 @@ async function setup(options) {
88
89
  customHeaders: options.customHeaders,
89
90
  timeout: options.timeout
90
91
  }));
91
- if (options.token) setToken(options.token);
92
+ if (options.token) {
93
+ setToken(options.token);
94
+ flushEventQueue();
95
+ }
92
96
  configured = true;
93
97
  if (options.wasm) {
94
98
  await warmupWasm({
@@ -156,4 +160,4 @@ function reset() {
156
160
  }
157
161
 
158
162
  //#endregion
159
- export { ID_ERROR_CODES, IdCaptureProvider, api, checkPermission as checkCameraPermission, createApi_default as createApi, createIdCaptureActor, createIdCaptureManager, createSession, getApi, getBrowser, getDeviceClass, idCaptureMachine, initializeIdCapture, initializeWasmUtil, isConfigured, processId, requestPermission as requestCameraPermission, reset, setWasmConfig, setup, startRecordingSession, stopRecording, stopStream, uploadIdImage, validateUploadResponse, warmupWasm };
163
+ export { ID_ERROR_CODES, IdCaptureProvider, addEvent, api, cameraScreenNamesMapper, checkPermission as checkCameraPermission, createApi_default as createApi, createIdCaptureActor, createIdCaptureManager, createSession, eventModuleNames, eventScreenNames, flushEventQueue, getApi, getBrowser, getDeviceClass, idCaptureMachine, initializeIdCapture, initializeWasmUtil, isConfigured, moduleClosed, moduleOpened, processId, requestPermission as requestCameraPermission, reset, screenClosed, screenEvent, screenOpened, setWasmConfig, setup, startRecordingSession, stopRecording, stopStream, subscribeEvent, tutorialScreenNamesMapper, uploadIdImage, validateUploadResponse, videoSelfieEvents, warmupWasm };
@@ -1,5 +1,5 @@
1
- import { i as __toCommonJS, n as __esm, r as __export, t as __commonJS } from "./chunk-FbsBJI8u.esm.js";
2
- import { n as require_jsnlog, t as require_OpenViduLogger } from "./OpenViduLogger-CRbRNZA7.esm.js";
1
+ import { i as __toCommonJS, n as __esm, r as __export, t as __commonJS } from "./chunk-V5DOKNPJ.esm.js";
2
+ import { n as require_jsnlog, t as require_OpenViduLogger } from "./OpenViduLogger-BLxxXoyF.esm.js";
3
3
 
4
4
  //#region ../../node_modules/.pnpm/openvidu-browser@2.32.1/node_modules/openvidu-browser/lib/OpenViduInternal/Enums/LocalRecorderState.js
5
5
  var require_LocalRecorderState = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/openvidu-browser@2.32.1/node_modules/openvidu-browser/lib/OpenViduInternal/Enums/LocalRecorderState.js": ((exports) => {
package/dist/phone.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { t as Manager } from "./Manager-BZUZTRPx.js";
1
+ import { t as Manager } from "./Manager-Co-PsiG9.js";
2
2
 
3
3
  //#region src/modules/phone/types.d.ts
4
4
 
@@ -128,9 +128,9 @@ type PhoneOtpErrorState = {
128
128
  error: string;
129
129
  attemptsRemaining: number;
130
130
  };
131
- /** Phone verification completed successfully - call `reset()` to start over */
132
- type PhoneSuccessState = {
133
- status: 'success';
131
+ /** Phone verification completed successfully */
132
+ type PhoneFinishedState = {
133
+ status: 'finished';
134
134
  };
135
135
  /**
136
136
  * Fatal error occurred - call `reset()` to start over
@@ -153,7 +153,7 @@ type PhoneErrorState = {
153
153
  * }
154
154
  * ```
155
155
  */
156
- type PhoneState = PhoneIdleState | PhoneLoadingPrefillState | PhoneInputtingState | PhoneSubmittingState | PhoneSendingOtpState | PhoneAwaitingOtpState | PhoneVerifyingOtpState | PhoneOtpErrorState | PhoneSuccessState | PhoneErrorState;
156
+ type PhoneState = PhoneIdleState | PhoneLoadingPrefillState | PhoneInputtingState | PhoneSubmittingState | PhoneSendingOtpState | PhoneAwaitingOtpState | PhoneVerifyingOtpState | PhoneOtpErrorState | PhoneFinishedState | PhoneErrorState;
157
157
  /**
158
158
  * Creates a phone verification manager for headless or UI-driven usage.
159
159
  *
package/dist/phone.esm.js CHANGED
@@ -1,6 +1,7 @@
1
- import { E as createManager, n as api, t as endpoints } from "./endpoints-D9TGnxRK.esm.js";
2
- import { a as createActor, i as fromPromise, n as assign, r as fromCallback, t as setup } from "./xstate.esm-2hDiAXvZ.esm.js";
3
- import { t as addEvent } from "./addEvent-BGKc_lHF.esm.js";
1
+ import { d as addEvent, n as eventModuleNames, r as eventScreenNames } from "./events-B8ZkhAZo.esm.js";
2
+ import { C as createManager, d as BrowserTimerProvider } from "./src-XSoNGEQW.esm.js";
3
+ import { a as fromPromise, i as fromCallback, n as setup, o as createActor, r as assign, t as endpoints } from "./endpoints-BUsSVoJV.esm.js";
4
+ import { t as api } from "./api-DfRLAneb.esm.js";
4
5
 
5
6
  //#region src/modules/phone/phoneServices.ts
6
7
  async function fetchPhone(signal) {
@@ -72,13 +73,14 @@ const phoneMachine = setup({
72
73
  return verifyOtp(input.code, signal);
73
74
  }),
74
75
  resendTimer: fromCallback(({ sendBack }) => {
76
+ const timer = BrowserTimerProvider.getInstance();
75
77
  let seconds = RESEND_TIMER_SECONDS;
76
- const interval = setInterval(() => {
78
+ const interval = timer.setInterval(() => {
77
79
  seconds -= 1;
78
80
  sendBack({ type: "TICK" });
79
- if (seconds <= 0) clearInterval(interval);
81
+ if (seconds <= 0) timer.clearInterval(interval);
80
82
  }, 1e3);
81
- return () => clearInterval(interval);
83
+ return () => timer.clearInterval(interval);
82
84
  })
83
85
  },
84
86
  actions: {
@@ -154,8 +156,8 @@ const phoneMachine = setup({
154
156
  sendPhoneSubmitEvent: () => {
155
157
  addEvent({
156
158
  code: "continue",
157
- module: "phone",
158
- screen: "phoneInput"
159
+ module: eventModuleNames.phone,
160
+ screen: eventScreenNames.phoneInput
159
161
  });
160
162
  }
161
163
  },
@@ -233,7 +235,7 @@ const phoneMachine = setup({
233
235
  guard: "hasOtpVerification",
234
236
  actions: "sendPhoneSubmitEvent"
235
237
  }, {
236
- target: "success",
238
+ target: "finished",
237
239
  actions: "sendPhoneSubmitEvent"
238
240
  }],
239
241
  onError: {
@@ -273,7 +275,7 @@ const phoneMachine = setup({
273
275
  input: ({ context }) => ({ code: context.otpCode }),
274
276
  onDone: [
275
277
  {
276
- target: "success",
278
+ target: "finished",
277
279
  guard: ({ event }) => event.output.success === true
278
280
  },
279
281
  {
@@ -309,7 +311,7 @@ const phoneMachine = setup({
309
311
  },
310
312
  BACK: { target: "inputting" }
311
313
  } },
312
- success: { type: "final" },
314
+ finished: { type: "final" },
313
315
  error: { on: { RESET: {
314
316
  target: "idle",
315
317
  actions: "resetContext"
@@ -357,7 +359,7 @@ function createPhoneActor(options) {
357
359
  * // 3. Subscribe to state changes (optional but recommended)
358
360
  * phoneManager.subscribe((state) => {
359
361
  * console.log('Phone state:', state.status);
360
- * if (state.status === 'success') {
362
+ * if (state.status === 'finished') {
361
363
  * console.log('Phone verified successfully!');
362
364
  * }
363
365
  * if (state.status === 'error') {
@@ -400,7 +402,7 @@ function createPhoneActor(options) {
400
402
  * // Get OTP from user or external source
401
403
  * phoneManager.submitOtp(otpCode);
402
404
  * break;
403
- * case 'success':
405
+ * case 'finished':
404
406
  * clearInterval(interval);
405
407
  * phoneManager.stop();
406
408
  * break;
@@ -445,7 +447,7 @@ function mapState(snapshot) {
445
447
  error: context.otpError ?? "Invalid OTP code",
446
448
  attemptsRemaining: context.attemptsRemaining
447
449
  };
448
- if (typedSnapshot.matches("success")) return { status: "success" };
450
+ if (typedSnapshot.matches("finished")) return { status: "finished" };
449
451
  if (typedSnapshot.matches("error")) return {
450
452
  status: "error",
451
453
  error: context.error ?? "An error occurred"