@incodetech/core 0.0.0-dev-20260818-8d8c8078 → 0.0.0-dev-20260819-0bebbdc2

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 (83) hide show
  1. package/dist/{BrowserDiagnosticsCryptoProvider-Cu1IKjNM.esm.js → BrowserDiagnosticsCryptoProvider-6aqaVS6s.esm.js} +1 -1
  2. package/dist/ae-signature.esm.js +1 -1
  3. package/dist/{apiError-CKBlCigk.esm.js → apiError-C8O9Jo18.esm.js} +1 -1
  4. package/dist/authentication.d.ts +3 -3
  5. package/dist/authentication.esm.js +2 -2
  6. package/dist/{authenticationManager-D1VqcMBJ.esm.js → authenticationManager-BDwG2MBg.esm.js} +2 -2
  7. package/dist/{authenticationManager-Cb4b4dgt.d.ts → authenticationManager-Bo5oW5Rh.d.ts} +1 -1
  8. package/dist/{authenticationStateMachine-BjnHIxpe.esm.js → authenticationStateMachine-B_k1nxxF.esm.js} +2 -2
  9. package/dist/curp-validation.d.ts +1 -1
  10. package/dist/{curpValidationManager-C_TQjX2P.d.ts → curpValidationManager-BAE-uh7L.d.ts} +1 -1
  11. package/dist/{deepsightLoader-CwhGc3xA.esm.js → deepsightLoader-DZOieIHK.esm.js} +3 -3
  12. package/dist/document-capture.d.ts +1 -1
  13. package/dist/document-upload.d.ts +4 -4
  14. package/dist/{documentCaptureManager-BykkLCQD.d.ts → documentCaptureManager-B3t0ydtg.d.ts} +1 -1
  15. package/dist/dynamic-forms.esm.js +2 -2
  16. package/dist/{dynamicFormsManager-DT2qxj2N.esm.js → dynamicFormsManager-CA2tDe_k.esm.js} +1 -1
  17. package/dist/{dynamicFormsStateMachine-DOQgp-9E.esm.js → dynamicFormsStateMachine-B4vHfk-3.esm.js} +1 -1
  18. package/dist/ekyb.d.ts +1 -1
  19. package/dist/ekyb.esm.js +3 -3
  20. package/dist/{ekybManager-DpdJpiHF.esm.js → ekybManager-DCQJu92m.esm.js} +1 -1
  21. package/dist/{ekybStateMachine-C_IZxlCB.esm.js → ekybStateMachine-DcNX5OXv.esm.js} +1 -1
  22. package/dist/electronic-signature.esm.js +1 -1
  23. package/dist/{electronicSignatureManager-DwWl9IZi.esm.js → electronicSignatureManager-C8pORqlF.esm.js} +1 -1
  24. package/dist/extensibility.d.ts +9 -9
  25. package/dist/extensibility.esm.js +9 -9
  26. package/dist/{faceCaptureManagerFactory-CKyaVKsu.d.ts → faceCaptureManagerFactory-C8MlI6-0.d.ts} +3 -3
  27. package/dist/{faceCaptureManagerFactory-BQRhQGax.esm.js → faceCaptureManagerFactory-DccAZCel.esm.js} +1 -1
  28. package/dist/{faceCaptureSetup-CojnhiBs.esm.js → faceCaptureSetup-eQ57H0LP.esm.js} +2 -2
  29. package/dist/flow-events.d.ts +1 -1
  30. package/dist/flow.d.ts +5 -5
  31. package/dist/flow.esm.js +3 -3
  32. package/dist/{flowCompletionService-C67N1vaw.esm.js → flowCompletionService-C6llWAAo.esm.js} +1 -1
  33. package/dist/{flowServices-DgCqlGY_.esm.js → flowServices-BwFbhVDV.esm.js} +3 -3
  34. package/dist/geolocation.esm.js +2 -2
  35. package/dist/{geolocationManager-CbA_9m_k.esm.js → geolocationManager-DIiUsJfx.esm.js} +1 -1
  36. package/dist/{geolocationStateMachine-KJiRrK1U.esm.js → geolocationStateMachine-C0RXwD9o.esm.js} +1 -1
  37. package/dist/home.d.ts +1 -1
  38. package/dist/id-selfie-flow.d.ts +1 -1
  39. package/dist/id-selfie-flow.esm.js +6 -6
  40. package/dist/id.d.ts +2 -2
  41. package/dist/id.esm.js +3 -3
  42. package/dist/{idCaptureManager-DlCqj6R1.d.ts → idCaptureManager-LCsgD9lb.d.ts} +2 -2
  43. package/dist/{idCaptureManager-45bnf4N4.esm.js → idCaptureManager-NBeR-cgG.esm.js} +2 -2
  44. package/dist/{idCaptureServices-P9EWJxOj.esm.js → idCaptureServices-p3NtcUxw.esm.js} +2 -2
  45. package/dist/{idCaptureStateMachine-CwaKLtJJ.esm.js → idCaptureStateMachine-BKbLET7m.esm.js} +7 -7
  46. package/dist/{index-BwudEtre.d.ts → index-LHJIYIKJ.d.ts} +1 -1
  47. package/dist/index.esm.js +1 -1
  48. package/dist/mandatory-consent.d.ts +2 -2
  49. package/dist/{mandatoryConsentManager-BZpKPJ1b.d.ts → mandatoryConsentManager-Cz98fh9O.d.ts} +1 -1
  50. package/dist/{onDeviceFaceResults-CDDraq7B.esm.js → onDeviceFaceResults-DFirNde6.esm.js} +3 -3
  51. package/dist/personhood.d.ts +1 -1
  52. package/dist/personhood.esm.js +3 -3
  53. package/dist/qe-signature.esm.js +1 -1
  54. package/dist/{recordingService-Bf2UJ7NW.esm.js → recordingService-Cs-zgcly.esm.js} +1 -1
  55. package/dist/{runChildModule-DWb9CUDi.esm.js → runChildModule-CJBpdJ9L.esm.js} +1 -1
  56. package/dist/selfie.d.ts +3 -3
  57. package/dist/selfie.esm.js +4 -4
  58. package/dist/{selfieManager-BiKEmAq3.esm.js → selfieManager-C6nSxXbC.esm.js} +2 -2
  59. package/dist/{selfieManager-Dxj984_L.d.ts → selfieManager-yz6zt2t0.d.ts} +1 -1
  60. package/dist/{selfieStateMachine-CH-eKkT_.esm.js → selfieStateMachine-CNBYEUhy.esm.js} +2 -2
  61. package/dist/{session-CjhWOIqO.esm.js → session-BpBMD2qe.esm.js} +4 -4
  62. package/dist/session.d.ts +1 -1
  63. package/dist/session.esm.js +4 -4
  64. package/dist/{sessionInitializer-DLUuR_hw.esm.js → sessionInitializer-CNBU6Zmm.esm.js} +2 -2
  65. package/dist/{setup-CTLBAXkq.esm.js → setup-MP1cPm8J.esm.js} +4 -4
  66. package/dist/trueSight-B42F3cH3.esm.js +1 -0
  67. package/dist/{trueSightService-DxdwurF6.esm.js → trueSightService-7S24UFNk.esm.js} +2 -2
  68. package/dist/{types-W5OCjqmi.d.ts → types-BNs7Klh_.d.ts} +1 -1
  69. package/dist/{types-RMhiEIm9.d.ts → types-CaqgEfzk.d.ts} +1 -1
  70. package/dist/{types-s0fF3TpX.d.ts → types-DNNUCM_n.d.ts} +1 -0
  71. package/dist/types-Dm7dzIXw.d.ts +6 -0
  72. package/dist/{types-BlrYfFj3.d.ts → types-DqtyPNWa.d.ts} +1 -1
  73. package/dist/{types-BUdX2CB-.d.ts → types-XXfuK9d8.d.ts} +1 -1
  74. package/dist/video-selfie.d.ts +27 -6
  75. package/dist/video-selfie.esm.js +213 -93
  76. package/dist/{videoSelfieCameraWarmer-DNbH5cem.esm.js → videoSelfieCameraWarmer-BIRjIgms.esm.js} +2 -2
  77. package/dist/{videoSelfieStepDetector-SuOT83r7.d.ts → videoSelfieStepDetector-CcBSD8Gc.d.ts} +2 -2
  78. package/dist/wasm.esm.js +1 -1
  79. package/dist/workflow.d.ts +5 -5
  80. package/dist/workflow.esm.js +14 -14
  81. package/package.json +3 -3
  82. package/dist/trueSight-DgMn_r0u.esm.js +0 -1
  83. package/dist/types-OehE3PKn.d.ts +0 -6
@@ -1,13 +1,13 @@
1
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-CTLBAXkq.esm.js";
2
+ import { d as initiateVideoSelfieUpload, f as uploadVideoSelfiePart, l as abortVideoSelfieUpload, t as ensureWasmPipelines, u as completeVideoSelfieUpload } from "./setup-MP1cPm8J.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-DgCqlGY_.esm.js";
7
- import { c as createManager, o as createActor, r as assign, t as setup } from "./xstate.esm-Cf4e0Cfd.esm.js";
6
+ import { d as videoSelfieWasmPipelines, l as facingModeForStep, u as resolveVideoSelfieSteps } from "./flowServices-BwFbhVDV.esm.js";
7
+ import { c as createManager, n as sendTo, 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-DNbH5cem.esm.js";
10
+ import { i as createDefaultStepDetector, n as defaultAcquireCamera, o as isConnectionError, r as CameraCompositor, t as createVideoSelfieCameraWarmer } from "./videoSelfieCameraWarmer-BIRjIgms.esm.js";
11
11
  //#region ../infra/src/providers/browser/MultipartRecordingProvider.ts
12
12
  /**
13
13
  * How often `MediaRecorder` hands us buffered data (incremental blobs).
@@ -246,7 +246,7 @@ var VideoSelfieChunkUploader = class {
246
246
  await this.settleLiveRound();
247
247
  if (this.parked.some((p) => p.partNumber === chunk.partNumber)) return false;
248
248
  }
249
- return !this.fatal && this.parked.length === 0;
249
+ return !this.disposed && !this.fatal && this.parked.length === 0;
250
250
  }
251
251
  /** Cancels all pending work; held blobs are released. */
252
252
  dispose() {
@@ -350,6 +350,8 @@ var MultipartRecordingService = class {
350
350
  this.session = null;
351
351
  this.uploader = null;
352
352
  this.chunksEmitted = 0;
353
+ this.stopPromise = null;
354
+ this.abandonRequested = false;
353
355
  }
354
356
  get isRecording() {
355
357
  return this.recorder.isRecording;
@@ -366,19 +368,43 @@ var MultipartRecordingService = class {
366
368
  };
367
369
  this.uploader = new VideoSelfieChunkUploader(this.session);
368
370
  this.chunksEmitted = 0;
371
+ this.abandonRequested = false;
369
372
  this.recorder.startRecording(stream, ({ chunk, partNumber }) => {
370
373
  this.chunksEmitted += 1;
371
374
  this.uploader?.enqueue(partNumber, chunk);
372
375
  });
373
376
  }
374
- async stop() {
377
+ stop() {
378
+ if (this.stopPromise) return this.stopPromise;
379
+ const stopPromise = this.finalizeRecording();
380
+ this.stopPromise = stopPromise;
381
+ const clearStopPromise = () => {
382
+ if (this.stopPromise === stopPromise) {
383
+ this.stopPromise = null;
384
+ this.abandonRequested = false;
385
+ }
386
+ };
387
+ stopPromise.then(clearStopPromise, clearStopPromise);
388
+ return stopPromise;
389
+ }
390
+ async finalizeRecording() {
375
391
  const session = this.session;
376
392
  const uploader = this.uploader;
377
393
  if (!this.recorder.isRecording || !session || !uploader) return { recordingId: null };
378
- await this.recorder.stopRecording();
379
- if (!await uploader.drain() || uploader.failed || this.chunksEmitted === 0) {
394
+ try {
395
+ await this.recorder.stopRecording();
396
+ if (this.abandonRequested) {
397
+ this.abandonUpload(session);
398
+ return { recordingId: null };
399
+ }
400
+ const delivered = await uploader.drain();
401
+ if (this.abandonRequested || !delivered || uploader.failed || this.chunksEmitted === 0) {
402
+ this.abandonUpload(session);
403
+ return { recordingId: null };
404
+ }
405
+ } catch (error) {
380
406
  this.abandonUpload(session);
381
- return { recordingId: null };
407
+ throw error;
382
408
  }
383
409
  try {
384
410
  await this.completeWithRetry(session);
@@ -391,7 +417,10 @@ var MultipartRecordingService = class {
391
417
  }
392
418
  }
393
419
  cleanup() {
394
- if (this.session) this.abandonUpload(this.session);
420
+ if (this.session) if (this.stopPromise) {
421
+ this.abandonRequested = true;
422
+ this.uploader?.dispose();
423
+ } else this.abandonUpload(this.session);
395
424
  this.recorder.reset();
396
425
  }
397
426
  /**
@@ -402,15 +431,18 @@ var MultipartRecordingService = class {
402
431
  * chunk was acked, so a reported hole cannot be filled from here.
403
432
  */
404
433
  async completeWithRetry(session) {
405
- for (let attempt = 1;; attempt += 1) try {
406
- await completeVideoSelfieUpload(session);
407
- return;
408
- } catch (error) {
409
- const status = httpStatusOf(error);
410
- if (status !== null && status >= 400 && status < 500 && status !== 408 && status !== 429 || attempt >= COMPLETE_ATTEMPTS) throw error;
411
- await new Promise((resolve) => {
412
- this.timer.setTimeout(resolve, COMPLETE_BACKOFF_MS * attempt);
413
- });
434
+ for (let attempt = 1;; attempt += 1) {
435
+ if (this.abandonRequested) throw new Error("Video upload abandoned");
436
+ try {
437
+ await completeVideoSelfieUpload(session);
438
+ return;
439
+ } catch (error) {
440
+ const status = httpStatusOf(error);
441
+ if (status !== null && status >= 400 && status < 500 && status !== 408 && status !== 429 || attempt >= COMPLETE_ATTEMPTS) throw error;
442
+ await new Promise((resolve) => {
443
+ this.timer.setTimeout(resolve, COMPLETE_BACKOFF_MS * attempt);
444
+ });
445
+ }
414
446
  }
415
447
  }
416
448
  /**
@@ -420,6 +452,7 @@ var MultipartRecordingService = class {
420
452
  * taken over) just means the server falls back to expiry or salvage.
421
453
  */
422
454
  abandonUpload(session) {
455
+ if (this.session !== session) return;
423
456
  this.session = null;
424
457
  this.uploader?.dispose();
425
458
  this.uploader = null;
@@ -460,14 +493,20 @@ function orientationFromEvent(event) {
460
493
  const SWITCHING_CAMERA_MIN_DWELL_MS = 3e3;
461
494
  const ID_FLIP_DWELL_MS = 4e3;
462
495
  const FINAL_SUCCESS_DWELL_MS = 3e3;
496
+ const MAX_VIDEO_LENGTH_ERROR_DWELL_MS = 3e3;
463
497
  const VALIDATION_FEEDBACK_DWELL_MS = 3e3;
464
498
  const DEFAULT_ATTEMPTS_PER_STEP = 3;
499
+ const DEFAULT_MAX_VIDEO_LENGTH_SECONDS = 300;
465
500
  const UNLIMITED_ATTEMPTS = -1;
466
501
  function normalizeAttempts(attempts) {
467
502
  if (attempts === UNLIMITED_ATTEMPTS) return UNLIMITED_ATTEMPTS;
468
503
  if (typeof attempts === "number" && attempts > 0) return attempts;
469
504
  return DEFAULT_ATTEMPTS_PER_STEP;
470
505
  }
506
+ function normalizeMaxVideoLength(seconds) {
507
+ if (typeof seconds === "number" && Number.isFinite(seconds) && seconds > 0) return seconds;
508
+ return DEFAULT_MAX_VIDEO_LENGTH_SECONDS;
509
+ }
471
510
  function isIdStep(step) {
472
511
  return step === "frontId" || step === "backId";
473
512
  }
@@ -519,9 +558,27 @@ const videoSelfieRecordingSetup = setup({
519
558
  delays: {
520
559
  ID_FLIP_DWELL: ID_FLIP_DWELL_MS,
521
560
  FINAL_SUCCESS_DWELL: FINAL_SUCCESS_DWELL_MS,
561
+ MAX_VIDEO_LENGTH_ERROR_DWELL: MAX_VIDEO_LENGTH_ERROR_DWELL_MS,
522
562
  VALIDATION_FEEDBACK_DWELL: VALIDATION_FEEDBACK_DWELL_MS
523
563
  },
524
564
  actors: {
565
+ executionTimer: fromCallback(({ input, sendBack, receive }) => {
566
+ let handle;
567
+ const cancel = () => {
568
+ if (handle !== void 0) {
569
+ input.timer.clearTimeout(handle);
570
+ handle = void 0;
571
+ }
572
+ };
573
+ receive((event) => {
574
+ cancel();
575
+ if (event.type === "ARM") handle = input.timer.setTimeout(() => {
576
+ handle = void 0;
577
+ sendBack({ type: "MAX_VIDEO_LENGTH_REACHED" });
578
+ }, event.durationMs);
579
+ });
580
+ return cancel;
581
+ }),
525
582
  acquireCamera: fromPromise(async ({ input, signal }) => {
526
583
  const stream = await input.acquire(input.facingMode, input.withAudio);
527
584
  if (signal.aborted) {
@@ -592,6 +649,11 @@ const videoSelfieRecordingSetup = setup({
592
649
  })
593
650
  },
594
651
  actions: {
652
+ armExecutionTimer: sendTo("executionTimer", ({ context }) => ({
653
+ type: "ARM",
654
+ durationMs: context.maxVideoLengthSeconds * 1e3
655
+ })),
656
+ cancelExecutionTimer: sendTo("executionTimer", { type: "CANCEL" }),
595
657
  advanceStep: assign({
596
658
  stepIndex: ({ context }) => context.stepIndex + 1,
597
659
  attemptsRemaining: ({ context }) => context.attemptsPerStep,
@@ -628,6 +690,10 @@ const videoSelfieRecordingSetup = setup({
628
690
  error: () => "Video upload failed",
629
691
  errorKind: () => "connection"
630
692
  }),
693
+ setMaxVideoLengthReached: assign({
694
+ error: () => "maxVideoLengthReached",
695
+ errorKind: () => "maxVideoLengthReached"
696
+ }),
631
697
  resetSession: assign(({ context }) => ({
632
698
  stepIndex: 0,
633
699
  stream: void 0,
@@ -658,7 +724,9 @@ const videoSelfieRecordingSetup = setup({
658
724
  exhaustedNonIdNextStepFlipsCamera: ({ context }) => !isIdStep(context.steps[context.stepIndex]) && facingModeForStep(context.steps[context.stepIndex]) !== facingModeForStep(context.steps[context.stepIndex + 1]),
659
725
  isNonIdExhaustion: ({ context }) => !isIdStep(context.steps[context.stepIndex]),
660
726
  nextStepFlipsCamera: ({ context }) => facingModeForStep(context.steps[context.stepIndex]) !== facingModeForStep(context.steps[context.stepIndex + 1]),
661
- uploadReturnedNoRecordingId: ({ event }) => recordingIdFromEvent(event) === null
727
+ uploadReturnedNoRecordingId: ({ event }) => recordingIdFromEvent(event) === null,
728
+ maxVideoLengthWasReached: ({ context }) => context.errorKind === "maxVideoLengthReached",
729
+ errorIsRetryable: ({ context }) => context.errorKind !== "maxVideoLengthReached"
662
730
  }
663
731
  });
664
732
  const ADVANCE_TRANSITIONS = [
@@ -689,6 +757,7 @@ const videoSelfieRecordingMachine = videoSelfieRecordingSetup.createMachine({
689
757
  compositor: input.dependencies?.createCompositor?.() ?? new CameraCompositor(),
690
758
  acquireCamera: input.dependencies?.acquireCamera ?? defaultAcquireCamera,
691
759
  detect: input.dependencies?.detect ?? manualStepDetector,
760
+ timer: input.dependencies?.timer ?? BrowserTimerProvider.getInstance(),
692
761
  steps: input.steps && input.steps.length > 0 ? input.steps : ["selfie"],
693
762
  stepIndex: 0,
694
763
  stream: void 0,
@@ -699,11 +768,17 @@ const videoSelfieRecordingMachine = videoSelfieRecordingSetup.createMachine({
699
768
  validationFailure: void 0,
700
769
  attemptsPerStep: normalizeAttempts(input.attemptsPerStep),
701
770
  attemptsRemaining: normalizeAttempts(input.attemptsPerStep),
771
+ maxVideoLengthSeconds: normalizeMaxVideoLength(input.maxVideoLengthSeconds),
702
772
  recordingId: null,
703
773
  error: void 0,
704
774
  errorKind: void 0,
705
775
  switchingCameraMinDwellMs: input.dependencies?.switchingCameraMinDwellMs ?? SWITCHING_CAMERA_MIN_DWELL_MS
706
776
  }),
777
+ invoke: {
778
+ id: "executionTimer",
779
+ src: "executionTimer",
780
+ input: ({ context }) => ({ timer: context.timer })
781
+ },
707
782
  on: { ABORT: { target: ".aborted" } },
708
783
  states: {
709
784
  idle: { on: { START: { target: "acquiringCamera" } } },
@@ -734,7 +809,10 @@ const videoSelfieRecordingMachine = videoSelfieRecordingSetup.createMachine({
734
809
  service: context.service,
735
810
  stream: context.composite
736
811
  }),
737
- onDone: { target: "recording" },
812
+ onDone: {
813
+ target: "recording",
814
+ actions: "armExecutionTimer"
815
+ },
738
816
  onError: {
739
817
  target: "error",
740
818
  actions: assign({ error: ({ event }) => errorFromEvent(event) })
@@ -751,6 +829,10 @@ const videoSelfieRecordingMachine = videoSelfieRecordingSetup.createMachine({
751
829
  })
752
830
  },
753
831
  on: {
832
+ MAX_VIDEO_LENGTH_REACHED: {
833
+ target: "finalizing",
834
+ actions: "setMaxVideoLengthReached"
835
+ },
754
836
  DETECTION_STATUS: { actions: "setDetectionStatus" },
755
837
  ORIENTATION: { actions: "setOrientation" },
756
838
  DETECTION_DONE: ADVANCE_TRANSITIONS,
@@ -769,100 +851,137 @@ const videoSelfieRecordingMachine = videoSelfieRecordingSetup.createMachine({
769
851
  }
770
852
  }
771
853
  },
772
- validationFeedback: { after: { VALIDATION_FEEDBACK_DWELL: [{
773
- target: "recording",
774
- guard: "hasAttemptsRemaining"
775
- }, ...[
776
- {
854
+ validationFeedback: {
855
+ on: { MAX_VIDEO_LENGTH_REACHED: {
777
856
  target: "finalizing",
778
- guard: "exhaustedIdFinishes"
779
- },
780
- {
781
- target: "switchingCamera",
782
- guard: "nextModuleFlipsCamera",
783
- actions: "advancePastIdSection"
784
- },
785
- {
786
- target: "recording",
787
- reenter: true,
788
- guard: "isIdExhaustion",
789
- actions: "advancePastIdSection"
790
- },
791
- {
792
- target: "finalizing",
793
- guard: "exhaustedNonIdFinishes"
794
- },
795
- {
796
- target: "switchingCamera",
797
- guard: "exhaustedNonIdNextStepFlipsCamera",
798
- actions: "advanceStep"
799
- },
800
- {
857
+ actions: "setMaxVideoLengthReached"
858
+ } },
859
+ after: { VALIDATION_FEEDBACK_DWELL: [{
801
860
  target: "recording",
802
- reenter: true,
803
- guard: "isNonIdExhaustion",
804
- actions: "advanceStep"
805
- }
806
- ]] } },
861
+ guard: "hasAttemptsRemaining"
862
+ }, ...[
863
+ {
864
+ target: "finalizing",
865
+ guard: "exhaustedIdFinishes"
866
+ },
867
+ {
868
+ target: "switchingCamera",
869
+ guard: "nextModuleFlipsCamera",
870
+ actions: "advancePastIdSection"
871
+ },
872
+ {
873
+ target: "recording",
874
+ reenter: true,
875
+ guard: "isIdExhaustion",
876
+ actions: "advancePastIdSection"
877
+ },
878
+ {
879
+ target: "finalizing",
880
+ guard: "exhaustedNonIdFinishes"
881
+ },
882
+ {
883
+ target: "switchingCamera",
884
+ guard: "exhaustedNonIdNextStepFlipsCamera",
885
+ actions: "advanceStep"
886
+ },
887
+ {
888
+ target: "recording",
889
+ reenter: true,
890
+ guard: "isNonIdExhaustion",
891
+ actions: "advanceStep"
892
+ }
893
+ ]] }
894
+ },
807
895
  flippingId: {
808
896
  after: { ID_FLIP_DWELL: {
809
897
  target: "recording",
810
898
  actions: "advanceStep"
811
899
  } },
812
- on: { NEXT_STEP: {
813
- target: "recording",
814
- actions: "advanceStep"
815
- } }
900
+ on: {
901
+ MAX_VIDEO_LENGTH_REACHED: {
902
+ target: "finalizing",
903
+ actions: "setMaxVideoLengthReached"
904
+ },
905
+ NEXT_STEP: {
906
+ target: "recording",
907
+ actions: "advanceStep"
908
+ }
909
+ }
816
910
  },
817
- switchingCamera: { invoke: {
818
- src: "switchCamera",
819
- input: ({ context }) => ({
820
- acquire: context.acquireCamera,
821
- facingMode: facingModeForStep(context.steps[context.stepIndex]),
822
- minDwellMs: context.switchingCameraMinDwellMs
823
- }),
824
- onDone: {
825
- target: "recording",
826
- actions: [({ context, event }) => {
827
- context.compositor.switchVideo(eventOutputStream(event));
828
- }, assign({ stream: ({ event }) => eventOutputStream(event) })]
829
- },
830
- onError: {
831
- target: "error",
832
- actions: assign({ error: ({ event }) => errorFromEvent(event) })
911
+ switchingCamera: {
912
+ on: { MAX_VIDEO_LENGTH_REACHED: {
913
+ target: "finalizing",
914
+ actions: "setMaxVideoLengthReached"
915
+ } },
916
+ invoke: {
917
+ src: "switchCamera",
918
+ input: ({ context }) => ({
919
+ acquire: context.acquireCamera,
920
+ facingMode: facingModeForStep(context.steps[context.stepIndex]),
921
+ minDwellMs: context.switchingCameraMinDwellMs
922
+ }),
923
+ onDone: {
924
+ target: "recording",
925
+ actions: [({ context, event }) => {
926
+ context.compositor.switchVideo(eventOutputStream(event));
927
+ }, assign({ stream: ({ event }) => eventOutputStream(event) })]
928
+ },
929
+ onError: {
930
+ target: "error",
931
+ actions: assign({ error: ({ event }) => errorFromEvent(event) })
932
+ }
833
933
  }
834
- } },
835
- finalizing: { invoke: {
836
- src: "finalizeRecording",
837
- input: ({ context }) => ({ service: context.service }),
838
- onDone: [{
839
- target: "error",
840
- guard: "uploadReturnedNoRecordingId",
841
- actions: [assign({ recordingId: ({ event }) => recordingIdFromEvent(event) }), "setUploadFailedError"]
842
- }, {
843
- target: "success",
844
- actions: assign({ recordingId: ({ event }) => recordingIdFromEvent(event) })
845
- }],
846
- onError: {
847
- target: "error",
848
- actions: assign({ error: ({ event }) => errorFromEvent(event) })
934
+ },
935
+ finalizing: {
936
+ entry: "cancelExecutionTimer",
937
+ invoke: {
938
+ src: "finalizeRecording",
939
+ input: ({ context }) => ({ service: context.service }),
940
+ onDone: [
941
+ {
942
+ target: "error",
943
+ guard: "maxVideoLengthWasReached",
944
+ actions: assign({ recordingId: ({ event }) => recordingIdFromEvent(event) })
945
+ },
946
+ {
947
+ target: "error",
948
+ guard: "uploadReturnedNoRecordingId",
949
+ actions: [assign({ recordingId: ({ event }) => recordingIdFromEvent(event) }), "setUploadFailedError"]
950
+ },
951
+ {
952
+ target: "success",
953
+ actions: assign({ recordingId: ({ event }) => recordingIdFromEvent(event) })
954
+ }
955
+ ],
956
+ onError: [{
957
+ target: "error",
958
+ guard: "maxVideoLengthWasReached"
959
+ }, {
960
+ target: "error",
961
+ actions: assign({ error: ({ event }) => errorFromEvent(event) })
962
+ }]
849
963
  }
850
- } },
964
+ },
851
965
  success: {
852
- entry: "cleanup",
966
+ entry: ["cancelExecutionTimer", "cleanup"],
853
967
  after: { FINAL_SUCCESS_DWELL: "finished" }
854
968
  },
855
969
  finished: { type: "final" },
856
970
  error: {
857
- entry: "cleanup",
971
+ entry: ["cancelExecutionTimer", "cleanup"],
972
+ after: { MAX_VIDEO_LENGTH_ERROR_DWELL: {
973
+ target: "finished",
974
+ guard: "maxVideoLengthWasReached"
975
+ } },
858
976
  on: { RETRY: {
859
977
  target: "acquiringCamera",
978
+ guard: "errorIsRetryable",
860
979
  actions: "resetSession"
861
980
  } }
862
981
  },
863
982
  aborted: {
864
983
  type: "final",
865
- entry: "cleanup"
984
+ entry: ["cancelExecutionTimer", "cleanup"]
866
985
  }
867
986
  }
868
987
  });
@@ -879,6 +998,7 @@ function createVideoSelfieRecordingActor(options = {}) {
879
998
  return createActor(videoSelfieRecordingMachine, { input: {
880
999
  steps,
881
1000
  attemptsPerStep: config?.numberOfTries,
1001
+ maxVideoLengthSeconds: config?.maxWaitingVideoSelfieFile,
882
1002
  dependencies: {
883
1003
  ...options.dependencies,
884
1004
  detect
@@ -1,10 +1,10 @@
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-DgCqlGY_.esm.js";
4
+ import { l as facingModeForStep, u as resolveVideoSelfieSteps } from "./flowServices-BwFbhVDV.esm.js";
5
5
  import { i as requestCameraWithFallback, r as requestCameraAccess } from "./camera-_2sXMXiF.esm.js";
6
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-CDDraq7B.esm.js";
7
+ import { _ as StreamCanvasProcessingSession, a as encryptSelfieImage, l as startDetection, v as FaceDetectionProvider } from "./onDeviceFaceResults-DFirNde6.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";
@@ -1,7 +1,7 @@
1
1
  import { t as CameraStream } from "./camera-9wWD-pwg.js";
2
- import { i as FlowModuleConfig } from "./types-s0fF3TpX.js";
2
+ import { i as FlowModuleConfig } from "./types-DNNUCM_n.js";
3
3
  import "./IWasmUtilCapability-5-Pncgma.js";
4
- import { n as DetectionStatus } from "./types-RMhiEIm9.js";
4
+ import { n as DetectionStatus } from "./types-CaqgEfzk.js";
5
5
  import { t as DetectionOrientation } from "./IIdCaptureCapability-DDWlQzhi.js";
6
6
  //#region src/modules/video-selfie/types.d.ts
7
7
  /**
package/dist/wasm.esm.js CHANGED
@@ -1,7 +1,7 @@
1
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
2
  import { a as resolveWasmConfig, n as buildDefaultWasmConfig, r as buildWasmConfigFromBasePath, t as DEFAULT_WASM_VERSION } from "./wasmDefaults-BrwMccqW.esm.js";
3
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-CTLBAXkq.esm.js";
4
+ import { a as resolveWasmConfigForPipelines, c as upgradeToWasmHttpClient, n as initializeWasmUtil, o as setWasmConfig, t as ensureWasmPipelines } from "./setup-MP1cPm8J.esm.js";
5
5
  //#region src/defineWasm.ts
6
6
  function requiredModels(pipelines) {
7
7
  const models = /* @__PURE__ */ new Set();
@@ -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-BwudEtre.js";
6
+ import { o as FlowEventSubscribable } from "./index-LHJIYIKJ.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,10 +334,6 @@ declare const workflowMachine: StateMachine<WorkflowContext, {
334
334
  id: string | undefined;
335
335
  };
336
336
  }>, Values<{
337
- setError: {
338
- type: "setError";
339
- params: NonReducibleUnknown;
340
- };
341
337
  setLoadingResult: {
342
338
  type: "setLoadingResult";
343
339
  params: NonReducibleUnknown;
@@ -370,6 +366,10 @@ declare const workflowMachine: StateMachine<WorkflowContext, {
370
366
  type: "setFinishStatusFailed";
371
367
  params: NonReducibleUnknown;
372
368
  };
369
+ setError: {
370
+ type: "setError";
371
+ params: NonReducibleUnknown;
372
+ };
373
373
  setModuleError: {
374
374
  type: "setModuleError";
375
375
  params: NonReducibleUnknown;
@@ -1,30 +1,30 @@
1
1
  import { E as updateFeatureManagementUser } from "./feature-management-DS_Nj5Gg.esm.js";
2
2
  import { t as api } from "./api-Bx3gKW_y.esm.js";
3
- import { l as trueSightLog } from "./trueSightService-DxdwurF6.esm.js";
3
+ import { l as trueSightLog } from "./trueSightService-7S24UFNk.esm.js";
4
4
  import { n as eventModuleNames, o as createManagerInstrumentation, v as addEvent } from "./events-CxfNJVZW.esm.js";
5
- import { i as initializeSession, r as getSessionFingerprintResult } from "./sessionInitializer-DLUuR_hw.esm.js";
5
+ import { i as initializeSession, r as getSessionFingerprintResult } from "./sessionInitializer-CNBU6Zmm.esm.js";
6
6
  import { t as endpoints } from "./endpoints-CCzL3XD_.esm.js";
7
- import "./trueSight-DgMn_r0u.esm.js";
8
- import { r as toIncodeApiError } from "./apiError-CKBlCigk.esm.js";
9
- import { g as toEkybConfig } from "./flowServices-DgCqlGY_.esm.js";
7
+ import "./trueSight-B42F3cH3.esm.js";
8
+ import { r as toIncodeApiError } from "./apiError-C8O9Jo18.esm.js";
9
+ import { g as toEkybConfig } from "./flowServices-BwFbhVDV.esm.js";
10
10
  import { i as toEkycConfig } from "./ekycUtils-Dew1rBG0.esm.js";
11
11
  import { c as createManager, o as createActor, r as assign, t as setup } from "./xstate.esm-Cf4e0Cfd.esm.js";
12
12
  import { n as fromPromise } from "./xstate-actors.esm-CtI5S0f4.esm.js";
13
- import { r as electronicSignatureMachine } from "./electronicSignatureManager-DwWl9IZi.esm.js";
13
+ import { r as electronicSignatureMachine } from "./electronicSignatureManager-C8pORqlF.esm.js";
14
14
  import "./ae-signature.esm.js";
15
15
  import { t as antifraudMachine } from "./antifraudStateMachine-r4VxSBS4.esm.js";
16
- import { t as authenticationMachine } from "./authenticationStateMachine-BjnHIxpe.esm.js";
16
+ import { t as authenticationMachine } from "./authenticationStateMachine-B_k1nxxF.esm.js";
17
17
  import { t as certificateIssuanceMachine } from "./certificateIssuanceStateMachine-COd7_l2T.esm.js";
18
18
  import { t as consentMachine } from "./consentStateMachine-WD-S-Yhs.esm.js";
19
19
  import { t as curpValidationMachine } from "./curpValidationStateMachine-9KwnqeoB.esm.js";
20
20
  import { t as customWatchlistMachine } from "./customWatchlistStateMachine-B_ey3TFj.esm.js";
21
21
  import { t as documentCaptureMachine } from "./documentCaptureStateMachine-fk7MDfSZ.esm.js";
22
- import { t as dynamicFormsMachine } from "./dynamicFormsStateMachine-DOQgp-9E.esm.js";
23
- import { t as ekybMachine } from "./ekybStateMachine-C_IZxlCB.esm.js";
22
+ import { t as dynamicFormsMachine } from "./dynamicFormsStateMachine-B4vHfk-3.esm.js";
23
+ import { t as ekybMachine } from "./ekybStateMachine-DcNX5OXv.esm.js";
24
24
  import { t as ekycMachine } from "./ekycStateMachine-DHvksnrr.esm.js";
25
25
  import { t as emailMachine } from "./emailStateMachine-Bm894MHB.esm.js";
26
- import { t as selfieMachine } from "./selfieStateMachine-CH-eKkT_.esm.js";
27
- import { t as idCaptureMachine } from "./idCaptureStateMachine-CwaKLtJJ.esm.js";
26
+ import { t as selfieMachine } from "./selfieStateMachine-CNBYEUhy.esm.js";
27
+ import { t as idCaptureMachine } from "./idCaptureStateMachine-BKbLET7m.esm.js";
28
28
  import { t as phoneMachine } from "./phoneStateMachine-E1fUUcNM.esm.js";
29
29
  import { t as watchlistMachine } from "./watchlistStateMachine-Bl7Wy9Cm.esm.js";
30
30
  import { n as identityReuseMachine } from "./identityReuseStateMachine-AubRPhIi.esm.js";
@@ -32,12 +32,12 @@ import { t as mandatoryConsentMachine } from "./mandatoryConsentStateMachine-zro
32
32
  import { t as idOcrStateMachine } from "./idOcrStateMachine-Bq_e3l4E.esm.js";
33
33
  import { n as redirectToMobileMachine } from "./redirectToMobileStateMachine-C9SYCJcH.esm.js";
34
34
  import { t as signatureMachine } from "./signatureStateMachine-Cf73DGWO.esm.js";
35
- import { t as geolocationMachine } from "./geolocationStateMachine-KJiRrK1U.esm.js";
35
+ import { t as geolocationMachine } from "./geolocationStateMachine-C0RXwD9o.esm.js";
36
36
  import { t as governmentValidationMachine } from "./governmentValidationStateMachine-BYKYUdza.esm.js";
37
37
  import { t as idVerificationMachine } from "./idVerificationStateMachine-GEQWUPU2.esm.js";
38
38
  import { t as faceMatchMachine } from "./faceMatchStateMachine-CJiO2yLO.esm.js";
39
- import { n as getFinishStatus, r as getTotalScoreStatus } from "./flowCompletionService-C67N1vaw.esm.js";
40
- import { n as isAdvanceableError, r as attachFlowEventEmitter, t as runChildModule } from "./runChildModule-DWb9CUDi.esm.js";
39
+ import { n as getFinishStatus, r as getTotalScoreStatus } from "./flowCompletionService-C6llWAAo.esm.js";
40
+ import { n as isAdvanceableError, r as attachFlowEventEmitter, t as runChildModule } from "./runChildModule-CJBpdJ9L.esm.js";
41
41
  import "./qe-signature.esm.js";
42
42
  import { t as watchlistForBusinessMachine } from "./watchlistForBusinessStateMachine-BcBMkMvV.esm.js";
43
43
  //#region src/internal/orchestration/defaultModules.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@incodetech/core",
3
- "version": "0.0.0-dev-20260818-8d8c8078",
3
+ "version": "0.0.0-dev-20260819-0bebbdc2",
4
4
  "license": "ISC",
5
5
  "repository": {
6
6
  "type": "git",
@@ -282,8 +282,8 @@
282
282
  "tsdown": "^0.22.8",
283
283
  "typescript": "^5.9.3",
284
284
  "vitest": "4.1.10",
285
- "@incodetech/infra": "1.2.1",
286
- "@incodetech/config": "1.0.2"
285
+ "@incodetech/config": "1.0.2",
286
+ "@incodetech/infra": "1.2.1"
287
287
  },
288
288
  "scripts": {
289
289
  "build": "tsdown -c tsdown.config.ts",
@@ -1 +0,0 @@
1
- import "./trueSightService-DxdwurF6.esm.js";
@@ -1,6 +0,0 @@
1
- import { i as FlowModuleConfig } from "./types-s0fF3TpX.js";
2
- import { t as BaseFaceCaptureConfig } from "./types-RMhiEIm9.js";
3
- //#region src/modules/authentication/types.d.ts
4
- type AuthenticationConfig = FlowModuleConfig['AUTHENTICATION'] & BaseFaceCaptureConfig;
5
- //#endregion
6
- export { AuthenticationConfig as t };