@incodetech/core 0.0.0-dev-20260409-a38d5e8 → 0.0.0-dev-20260409-09dfd52

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 (134) hide show
  1. package/dist/BrowserStorageProvider-CXaS5Ooj.esm.js +55 -0
  2. package/dist/{OpenViduRecordingProvider-Bn2meybK.esm.js → OpenViduRecordingProvider-D_cVAwYQ.esm.js} +1 -1
  3. package/dist/{WasmUtilProvider-BpZSvZbg.esm.js → WasmUtilProvider-mWSXzp7b.esm.js} +1 -1
  4. package/dist/{addressSearch-DOFI7lwy.esm.js → addressSearch-C26OZIx0.esm.js} +4 -4
  5. package/dist/antifraud.d.ts +1 -1
  6. package/dist/antifraud.esm.js +4 -37
  7. package/dist/antifraudStateMachine-B74mO8vr.esm.js +39 -0
  8. package/dist/authentication.d.ts +11 -11
  9. package/dist/authentication.esm.js +22 -19
  10. package/dist/authenticationManager-BBQHippG.esm.js +67 -0
  11. package/dist/{authenticationManager-C2mk36yK.d.ts → authenticationManager-DOTo1EYF.d.ts} +2 -2
  12. package/dist/{authenticationManager-C7dL_avf.esm.js → authenticationStateMachine-DCJ0ArAt.esm.js} +7 -67
  13. package/dist/{backCameraStream-tabTmwDS.esm.js → backCameraStream-D9g2wyil.esm.js} +3 -3
  14. package/dist/camera.d.ts +1 -1
  15. package/dist/camera.esm.js +3 -3
  16. package/dist/consent.d.ts +55 -55
  17. package/dist/consent.esm.js +4 -149
  18. package/dist/consentStateMachine-DIdJXJW0.esm.js +151 -0
  19. package/dist/cross-document-data-match.d.ts +1 -1
  20. package/dist/cross-document-data-match.esm.js +4 -4
  21. package/dist/curp-validation.d.ts +5 -5
  22. package/dist/curp-validation.esm.js +4 -417
  23. package/dist/curpValidationStateMachine-Dp5WB6__.esm.js +419 -0
  24. package/dist/{deepsightLoader-Cj6SyUQ-.esm.js → deepsightLoader-CaULV07H.esm.js} +10 -10
  25. package/dist/{deepsightService-ByD6uIs7.d.ts → deepsightService-S-tU77m-.d.ts} +2 -2
  26. package/dist/{deepsightService-BjgXl5hs.esm.js → deepsightService-rPGLH8Xp.esm.js} +5 -5
  27. package/dist/device.esm.js +3 -3
  28. package/dist/document-capture.d.ts +80 -78
  29. package/dist/document-capture.esm.js +8 -403
  30. package/dist/document-upload.d.ts +53 -53
  31. package/dist/document-upload.esm.js +7 -7
  32. package/dist/documentCaptureStateMachine-ByYOCKz5.esm.js +403 -0
  33. package/dist/ekyb.d.ts +3 -3
  34. package/dist/ekyb.esm.js +10 -655
  35. package/dist/ekybStateMachine-DRku_YmR.esm.js +653 -0
  36. package/dist/ekyc.d.ts +3 -3
  37. package/dist/ekyc.esm.js +6 -10614
  38. package/dist/ekycStateMachine-CSWaaWVl.esm.js +10615 -0
  39. package/dist/email.d.ts +3 -3
  40. package/dist/email.esm.js +6 -5
  41. package/dist/{emailManager-CU_hzrsl.d.ts → emailManager-D6CHM2QO.d.ts} +4 -3
  42. package/dist/emailManager-DByjyeY8.esm.js +238 -0
  43. package/dist/{emailManager-_9R4vm6g.esm.js → emailStateMachine-BoIkeCw5.esm.js} +6 -239
  44. package/dist/{events-DlHrOIRc.esm.js → events-W91zLpx4.esm.js} +5 -1
  45. package/dist/events.esm.js +2 -2
  46. package/dist/extensibility.d.ts +15 -15
  47. package/dist/extensibility.esm.js +33 -26
  48. package/dist/face-match.d.ts +7 -6
  49. package/dist/face-match.esm.js +8 -129
  50. package/dist/faceCaptureManagerFactory-Bspg2Tyf.esm.js +117 -0
  51. package/dist/{faceCaptureManagerFactory-Da_-ohdg.d.ts → faceCaptureManagerFactory-P2yy30KU.d.ts} +8 -8
  52. package/dist/{faceCaptureSetup-CaVWkjvE.esm.js → faceCaptureSetup-CQevz86q.esm.js} +5 -119
  53. package/dist/faceMatchStateMachine-CLterVEC.esm.js +127 -0
  54. package/dist/flow.d.ts +8 -13
  55. package/dist/flow.esm.js +10 -29
  56. package/dist/{flowCompletionService-B5JemmC6.esm.js → flowCompletionService-DZSDUXus.esm.js} +2 -2
  57. package/dist/{flowServices-p22wrYPf.esm.js → flowServices-YATk0fgY.esm.js} +3 -3
  58. package/dist/geolocation.d.ts +7 -6
  59. package/dist/geolocation.esm.js +7 -105
  60. package/dist/geolocationStateMachine-CRRUCl9K.esm.js +105 -0
  61. package/dist/{getDeviceClass-DEzz4cmY.esm.js → getDeviceClass-DBF-ExLR.esm.js} +1 -1
  62. package/dist/government-validation.d.ts +2 -2
  63. package/dist/government-validation.esm.js +5 -269
  64. package/dist/governmentValidationStateMachine-C_iPX9VE.esm.js +271 -0
  65. package/dist/http.esm.js +1 -1
  66. package/dist/id.d.ts +10 -10
  67. package/dist/id.esm.js +22 -20
  68. package/dist/idCaptureManager-CJfatzuY.esm.js +335 -0
  69. package/dist/{idCaptureManager-CV08v1e3.d.ts → idCaptureManager-CbZvdr9y.d.ts} +7 -7
  70. package/dist/{idCaptureManager-dyZzKv8L.esm.js → idCaptureStateMachine-gf-Q9piu.esm.js} +17 -346
  71. package/dist/index.d.ts +2 -2
  72. package/dist/index.esm.js +8 -8
  73. package/dist/{lib-Bavz2qmt.esm.js → lib-BzVJ-zxG.esm.js} +1 -1
  74. package/dist/mandatory-consent.d.ts +55 -55
  75. package/dist/mandatory-consent.esm.js +4 -124
  76. package/dist/mandatoryConsentStateMachine-BZNBJ1fK.esm.js +126 -0
  77. package/dist/{openviduLazy-vhrVZCr_.esm.js → openviduLazy-CLg_-u0m.esm.js} +2 -2
  78. package/dist/openviduLazy-rFXBtZVZ.esm.js +3 -0
  79. package/dist/{permissionServices-Cskq32Yd.esm.js → permissionServices-Cisv73eQ.esm.js} +2 -2
  80. package/dist/phone.d.ts +3 -3
  81. package/dist/phone.esm.js +6 -5
  82. package/dist/phoneManager-DhC4obPF.esm.js +258 -0
  83. package/dist/{phoneManager-ulJuGvJ8.d.ts → phoneManager-Zwr-qCnC.d.ts} +2 -2
  84. package/dist/{phoneManager-DerdUfd4.esm.js → phoneStateMachine-Cc_w4tC0.esm.js} +5 -258
  85. package/dist/{recordingService-483wQ6kR.esm.js → recordingService-CCfxUY7-.esm.js} +14 -68
  86. package/dist/redirect-to-mobile.d.ts +2 -2
  87. package/dist/redirect-to-mobile.esm.js +5 -247
  88. package/dist/redirectToMobileStateMachine-vOe27Ufw.esm.js +249 -0
  89. package/dist/runChildModule-DVC4JEjp.esm.js +27 -0
  90. package/dist/selfie.d.ts +11 -11
  91. package/dist/selfie.esm.js +22 -19
  92. package/dist/selfieManager-CorEST5h.esm.js +60 -0
  93. package/dist/{selfieManager-DCRP7X75.d.ts → selfieManager-DNwfxieF.d.ts} +2 -2
  94. package/dist/selfieStateMachine-3b19ON1z.esm.js +56 -0
  95. package/dist/{session-CUh77zj3.esm.js → session-B_rKSRql.esm.js} +4 -4
  96. package/dist/session.d.ts +1 -1
  97. package/dist/session.esm.js +6 -6
  98. package/dist/{setup-DpHakxsC.d.ts → setup-BYqwVLiv.d.ts} +1 -1
  99. package/dist/{setup-XpxfZgKn.esm.js → setup-DLvhsDol.esm.js} +6 -5
  100. package/dist/signature.d.ts +4 -3
  101. package/dist/signature.esm.js +6 -189
  102. package/dist/signatureStateMachine-CU92zCXU.esm.js +189 -0
  103. package/dist/{stats-DHDoqSBV.esm.js → stats-gFD2351t.esm.js} +1 -1
  104. package/dist/stats.esm.js +2 -2
  105. package/dist/{types-2OPf1pyv.d.ts → types-CYJ0Ish6.d.ts} +1 -1
  106. package/dist/types-CjsEZRcz.d.ts +35 -0
  107. package/dist/{types-CVJVQ7fp.d.ts → types-DU8HmI5U.d.ts} +1 -1
  108. package/dist/wasm.d.ts +2 -2
  109. package/dist/wasm.esm.js +8 -8
  110. package/dist/workflow.d.ts +813 -0
  111. package/dist/workflow.esm.js +600 -0
  112. package/package.json +7 -3
  113. package/dist/openviduLazy-BIPHozOu.esm.js +0 -3
  114. package/dist/selfieManager-DeOcNel4.esm.js +0 -110
  115. /package/dist/{Actor-Ba71-_30.d.ts → Actor-DbWH1K6E.d.ts} +0 -0
  116. /package/dist/{BaseWasmProvider-D-s_6M5H.esm.js → BaseWasmProvider-DoYDYH1z.esm.js} +0 -0
  117. /package/dist/{BrowserEnvironmentProvider-DaHeLJQw.esm.js → BrowserEnvironmentProvider-BtKLxTx4.esm.js} +0 -0
  118. /package/dist/{BrowserTimerProvider-BhD2MlHg.esm.js → BrowserTimerProvider-v7bpbrAk.esm.js} +0 -0
  119. /package/dist/{ITimerCapability-oixwa6nj.esm.js → ITimerCapability-BZO_FsCo.esm.js} +0 -0
  120. /package/dist/{Manager-BN2g_I8W.d.ts → Manager-DcPMRgTm.d.ts} +0 -0
  121. /package/dist/{MotionSensorProvider-CodM3e0E.esm.js → MotionSensorProvider-D90R4qwV.esm.js} +0 -0
  122. /package/dist/{StateMachine-BoJsfMvg.d.ts → StateMachine-BBuIgsHT.d.ts} +0 -0
  123. /package/dist/{api-DzpnV6O7.esm.js → api-aa9Mx20l.esm.js} +0 -0
  124. /package/dist/{browserSimulation-B4ubb2OL.esm.js → browserSimulation-DFqGKQAD.esm.js} +0 -0
  125. /package/dist/{camera-1eeGnAaL.d.ts → camera-DATT31my.d.ts} +0 -0
  126. /package/dist/{camera-DmkFpf5N.esm.js → camera-DpPQS_-5.esm.js} +0 -0
  127. /package/dist/{chunk-DsxENsBR.esm.js → chunk-YGHKo4MY.esm.js} +0 -0
  128. /package/dist/{displayErrors-BZLX7idb.d.ts → displayErrors-xrg0ejaS.d.ts} +0 -0
  129. /package/dist/{flowCompletionService-D-3YCHyO.d.ts → flowCompletionService-gxt5reFV.d.ts} +0 -0
  130. /package/dist/{getBrowser-Dtyt9J_h.esm.js → getBrowser-DCcD7H-M.esm.js} +0 -0
  131. /package/dist/{platform-Dv7a2fv-.esm.js → platform-DctkySJU.esm.js} +0 -0
  132. /package/dist/{types-D_QfFKxT.d.ts → types-CIjb0FKu.d.ts} +0 -0
  133. /package/dist/{warmup-CIj_wEV_.d.ts → warmup-Ckb1hN85.d.ts} +0 -0
  134. /package/dist/{xstate.esm-Bv55-lJ4.esm.js → xstate.esm-B7FPE6br.esm.js} +0 -0
@@ -0,0 +1,56 @@
1
+ import { i as fromPromise, n as assign } from "./xstate.esm-B7FPE6br.esm.js";
2
+ import { l as processFace, u as uploadSelfie, v as FACE_ERROR_CODES } from "./recordingService-CCfxUY7-.esm.js";
3
+ import { t as faceCaptureMachine } from "./faceCaptureSetup-CQevz86q.esm.js";
4
+
5
+ //#region src/modules/selfie/selfieErrorUtils.ts
6
+ const FACE_ERROR_CODE_VALUES = Object.values(FACE_ERROR_CODES);
7
+ const validateUploadResponse = ({ config, response }) => {
8
+ if (!response) return FACE_ERROR_CODES.SERVER;
9
+ if (response.confidence !== 0) return FACE_ERROR_CODES.LIVENESS;
10
+ if (config.validateBrightness && !response.isBright) return FACE_ERROR_CODES.BRIGHTNESS;
11
+ if (config.validateLenses && response.hasLenses) return FACE_ERROR_CODES.LENSES;
12
+ if (config.validateFaceMask && response.hasFaceMask) return FACE_ERROR_CODES.MASK;
13
+ if (config.validateClosedEyes && response.hasClosedEyes) return FACE_ERROR_CODES.CLOSED_EYES;
14
+ if (config.validateHeadCover && response.hasHeadCover) return FACE_ERROR_CODES.HEAD_COVER;
15
+ };
16
+
17
+ //#endregion
18
+ //#region src/modules/selfie/selfieStateMachine.ts
19
+ const _selfieMachine = faceCaptureMachine.provide({
20
+ actors: {
21
+ uploadFace: fromPromise(async ({ input, signal }) => {
22
+ const ctx = input;
23
+ return uploadSelfie({
24
+ encryptedBase64Image: ctx.encryptedBase64Image,
25
+ faceCoordinates: ctx.faceCoordinates,
26
+ metadata: ctx.deepsightService?.getMetadata(),
27
+ recordingId: ctx.uploadRecordingId,
28
+ signal
29
+ });
30
+ }),
31
+ processFace: fromPromise(async ({ signal }) => {
32
+ return processFace("selfie", signal);
33
+ })
34
+ },
35
+ actions: { setUploadErrorFromUploadValidation: assign({ uploadError: ({ context }) => validateUploadResponse({
36
+ config: context.config,
37
+ response: context.uploadResponse
38
+ }) ?? FACE_ERROR_CODES.SERVER }) },
39
+ guards: {
40
+ hasUploadValidationError: ({ context }) => validateUploadResponse({
41
+ config: context.config,
42
+ response: context.uploadResponse
43
+ }) !== void 0,
44
+ isTerminalUploadError: () => false
45
+ }
46
+ });
47
+ /**
48
+ * The selfie capture state machine.
49
+ *
50
+ * Note: Uses AnyStateMachine type for declaration file portability.
51
+ * Type safety is ensured via the machine configuration.
52
+ */
53
+ const selfieMachine = _selfieMachine;
54
+
55
+ //#endregion
56
+ export { selfieMachine as t };
@@ -1,7 +1,7 @@
1
- import { n as getApi, t as api } from "./api-DzpnV6O7.esm.js";
2
- import { _ as endpoints, m as addEvent } from "./events-DlHrOIRc.esm.js";
3
- import { t as BrowserEnvironmentProvider } from "./BrowserEnvironmentProvider-DaHeLJQw.esm.js";
4
- import { t as isBrowserSimulation } from "./browserSimulation-B4ubb2OL.esm.js";
1
+ import { n as getApi, t as api } from "./api-aa9Mx20l.esm.js";
2
+ import { _ as endpoints, m as addEvent } from "./events-W91zLpx4.esm.js";
3
+ import { t as BrowserEnvironmentProvider } from "./BrowserEnvironmentProvider-BtKLxTx4.esm.js";
4
+ import { t as isBrowserSimulation } from "./browserSimulation-DFqGKQAD.esm.js";
5
5
 
6
6
  //#region src/internal/session/sessionService.ts
7
7
  /**
package/dist/session.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { n as GetFinishStatusFn, r as getFinishStatus, t as FinishStatus } from "./flowCompletionService-D-3YCHyO.js";
1
+ import { n as GetFinishStatusFn, r as getFinishStatus, t as FinishStatus } from "./flowCompletionService-gxt5reFV.js";
2
2
 
3
3
  //#region src/internal/session/sessionService.d.ts
4
4
  type CreateSessionOptions = {
@@ -1,8 +1,8 @@
1
- import "./api-DzpnV6O7.esm.js";
2
- import "./events-DlHrOIRc.esm.js";
3
- import { c as createSession } from "./session-CUh77zj3.esm.js";
4
- import "./BrowserEnvironmentProvider-DaHeLJQw.esm.js";
5
- import "./browserSimulation-B4ubb2OL.esm.js";
6
- import { t as getFinishStatus } from "./flowCompletionService-B5JemmC6.esm.js";
1
+ import "./api-aa9Mx20l.esm.js";
2
+ import "./events-W91zLpx4.esm.js";
3
+ import { c as createSession } from "./session-B_rKSRql.esm.js";
4
+ import "./BrowserEnvironmentProvider-BtKLxTx4.esm.js";
5
+ import "./browserSimulation-DFqGKQAD.esm.js";
6
+ import { t as getFinishStatus } from "./flowCompletionService-DZSDUXus.esm.js";
7
7
 
8
8
  export { createSession, getFinishStatus };
@@ -1,4 +1,4 @@
1
- import { n as WasmPipeline } from "./warmup-CIj_wEV_.js";
1
+ import { n as WasmPipeline } from "./warmup-Ckb1hN85.js";
2
2
 
3
3
  //#region src/setup.d.ts
4
4
 
@@ -1,8 +1,8 @@
1
- import { n as warmupWasm } from "./BaseWasmProvider-D-s_6M5H.esm.js";
2
- import { t as WasmUtilProvider } from "./WasmUtilProvider-BpZSvZbg.esm.js";
3
- import { a as resetApi, o as setClient, s as setToken } from "./api-DzpnV6O7.esm.js";
4
- import { h as flushEventQueue } from "./events-DlHrOIRc.esm.js";
5
- import { i as resetSessionInit, r as initializeSession } from "./session-CUh77zj3.esm.js";
1
+ import { n as warmupWasm } from "./BaseWasmProvider-DoYDYH1z.esm.js";
2
+ import { t as WasmUtilProvider } from "./WasmUtilProvider-mWSXzp7b.esm.js";
3
+ import { a as resetApi, o as setClient, s as setToken } from "./api-aa9Mx20l.esm.js";
4
+ import { h as flushEventQueue } from "./events-W91zLpx4.esm.js";
5
+ import { i as resetSessionInit, r as initializeSession } from "./session-B_rKSRql.esm.js";
6
6
 
7
7
  //#region ../infra/src/http/createApi.ts
8
8
  var FetchHttpError = class extends Error {
@@ -386,6 +386,7 @@ async function setup(options) {
386
386
  if (options.token) {
387
387
  setToken(options.token);
388
388
  flushEventQueue();
389
+ resetSessionInit();
389
390
  initializeSession({ hostingApp: options.hostingApp }).catch((error) => {
390
391
  console.warn("Session initialization failed:", error);
391
392
  });
@@ -1,5 +1,5 @@
1
- import { t as Manager } from "./Manager-BN2g_I8W.js";
2
- import "./Actor-Ba71-_30.js";
1
+ import { t as Manager } from "./Manager-DcPMRgTm.js";
2
+ import "./Actor-DbWH1K6E.js";
3
3
 
4
4
  //#region src/modules/signature/types.d.ts
5
5
  /**
@@ -15,8 +15,9 @@ type SignatureConfig = {
15
15
  title?: string;
16
16
  /**
17
17
  * Optional subtitle for both steps. When omitted, the UI uses the default finger/mouse copy.
18
+ * Backend field name: `subTitle` (capital T).
18
19
  */
19
- subtitle?: string;
20
+ subTitle?: string;
20
21
  /**
21
22
  * When true, uploads base64 via Omni `addSignature` v2 JSON body.
22
23
  * When false (default), uploads JPEG bytes (`image/jpeg`).
@@ -1,191 +1,8 @@
1
- import { t as api } from "./api-DzpnV6O7.esm.js";
2
- import { _ as endpoints, m as addEvent, n as eventModuleNames, o as createManagerInstrumentation, r as eventScreenNames } from "./events-DlHrOIRc.esm.js";
3
- import { a as createActor, i as fromPromise, n as assign, o as createManager, t as setup } from "./xstate.esm-Bv55-lJ4.esm.js";
1
+ import "./api-aa9Mx20l.esm.js";
2
+ import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-W91zLpx4.esm.js";
3
+ import { a as createActor, o as createManager } from "./xstate.esm-B7FPE6br.esm.js";
4
+ import { t as signatureMachine } from "./signatureStateMachine-CU92zCXU.esm.js";
4
5
 
5
- //#region src/modules/signature/signatureServices.ts
6
- /**
7
- * Uploads a signature image to the Omni API.
8
- * Uses JSON + base64 when `sendBase64` is true, otherwise sends raw JPEG bytes.
9
- * Throws on failure.
10
- */
11
- async function addSignature(params, signal) {
12
- const { image, type, sendBase64 = false } = params;
13
- const url = sendBase64 ? endpoints.addSignatureV2 : endpoints.addSignature;
14
- const body = sendBase64 ? { base64Image: image } : image;
15
- const res = await api.post(url, body, {
16
- signal,
17
- headers: { "Content-Type": sendBase64 ? "application/json" : "image/jpeg" },
18
- query: { type }
19
- });
20
- if (!res.ok) throw new Error(`POST ${url} failed: ${res.status} ${res.statusText}`);
21
- return res.data;
22
- }
23
- /**
24
- * Uploads a initials image to the Omni API.
25
- * Uses JSON + base64 when `sendBase64` is true, otherwise sends raw JPEG bytes.
26
- * Throws on failure.
27
- */
28
- async function addInitials(params, signal) {
29
- const { image, type, sendBase64 = false } = params;
30
- const url = endpoints.addInitials;
31
- const body = sendBase64 ? { base64Image: image } : image;
32
- const res = await api.post(url, body, {
33
- signal,
34
- headers: { "Content-Type": sendBase64 ? "application/json" : "image/jpeg" },
35
- query: { type }
36
- });
37
- if (!res.ok) throw new Error(`POST ${url} failed: ${res.status} ${res.statusText}`);
38
- return res.data;
39
- }
40
-
41
- //#endregion
42
- //#region src/modules/signature/signatureStateMachine.ts
43
- function emptyCaptureState() {
44
- return {
45
- image: void 0,
46
- isValid: false,
47
- error: void 0,
48
- signatureSubmitResult: void 0,
49
- initialsSubmitResult: void 0
50
- };
51
- }
52
- const signatureMachine = setup({
53
- types: {
54
- context: {},
55
- events: {},
56
- input: {}
57
- },
58
- actors: {
59
- submitInitials: fromPromise(async ({ input, signal }) => addInitials({
60
- image: input.image,
61
- type: input.type,
62
- sendBase64: input.sendBase64
63
- }, signal)),
64
- submitSignature: fromPromise(async ({ input, signal }) => addSignature({
65
- image: input.image,
66
- type: input.type,
67
- sendBase64: input.sendBase64
68
- }, signal))
69
- },
70
- actions: {
71
- setSignatureValidity: assign(({ event }) => {
72
- return {
73
- isValid: event.isValid,
74
- error: void 0
75
- };
76
- }),
77
- assignImageForSubmit: assign(({ event }) => {
78
- return {
79
- image: event.image,
80
- error: void 0
81
- };
82
- }),
83
- setInitialsSubmitResult: assign(({ event }) => ({
84
- initialsSubmitResult: event.output,
85
- error: void 0
86
- })),
87
- setSignatureSubmitResult: assign(({ event }) => ({
88
- signatureSubmitResult: event.output,
89
- error: void 0
90
- })),
91
- setErrorFromInvoke: assign(({ event }) => {
92
- const error = event.error;
93
- return { error: error instanceof Error ? error.message : typeof error === "string" ? error : "Something went wrong" };
94
- }),
95
- clearError: assign({ error: () => void 0 }),
96
- resetContext: assign({
97
- isValid: () => false,
98
- image: () => void 0,
99
- error: () => void 0
100
- }),
101
- trackSubmitAttempt: () => {
102
- addEvent({
103
- code: "continue",
104
- module: eventModuleNames.signature,
105
- screen: eventScreenNames.signatureInput
106
- });
107
- },
108
- trackError: ({ context }) => {
109
- addEvent({
110
- code: "verificationError",
111
- module: eventModuleNames.signature,
112
- payload: context.error ? { error: context.error } : void 0
113
- });
114
- }
115
- },
116
- guards: { canContinue: ({ context, event }) => context.isValid && event.type === "CONTINUE" && !!event.image }
117
- }).createMachine({
118
- id: "signature",
119
- initial: "idle",
120
- context: ({ input }) => ({
121
- config: input.config,
122
- ...emptyCaptureState()
123
- }),
124
- states: {
125
- idle: { on: { LOAD: "captureInitials" } },
126
- captureInitials: { on: {
127
- SIGNATURE_CHANGED: { actions: "setSignatureValidity" },
128
- CONTINUE: {
129
- target: "submittingInitials",
130
- guard: "canContinue",
131
- actions: "assignImageForSubmit"
132
- }
133
- } },
134
- submittingInitials: {
135
- entry: "trackSubmitAttempt",
136
- invoke: {
137
- id: "submitInitials",
138
- src: "submitInitials",
139
- input: ({ context }) => ({
140
- image: context.image,
141
- type: context.config.type,
142
- sendBase64: context.config.sendBase64 ?? false
143
- }),
144
- onDone: {
145
- target: "captureSignature",
146
- actions: ["setInitialsSubmitResult", "resetContext"]
147
- },
148
- onError: {
149
- target: "error",
150
- actions: ["setErrorFromInvoke"]
151
- }
152
- }
153
- },
154
- captureSignature: { on: {
155
- SIGNATURE_CHANGED: { actions: "setSignatureValidity" },
156
- CONTINUE: {
157
- target: "submittingSignature",
158
- guard: "canContinue",
159
- actions: "assignImageForSubmit"
160
- }
161
- } },
162
- submittingSignature: {
163
- entry: "trackSubmitAttempt",
164
- invoke: {
165
- id: "submitSignature",
166
- src: "submitSignature",
167
- input: ({ context }) => ({
168
- image: context.image,
169
- type: context.config.type,
170
- sendBase64: context.config.sendBase64 ?? false
171
- }),
172
- onDone: {
173
- target: "success",
174
- actions: "setSignatureSubmitResult"
175
- },
176
- onError: {
177
- target: "error",
178
- actions: ["setErrorFromInvoke"]
179
- }
180
- }
181
- },
182
- success: { after: { 3e3: "finished" } },
183
- finished: { type: "final" },
184
- error: { entry: "trackError" }
185
- }
186
- });
187
-
188
- //#endregion
189
6
  //#region src/modules/signature/signatureActor.ts
190
7
  function createSignatureActor(options) {
191
8
  return createActor(signatureMachine, { input: { config: options.config } }).start();
@@ -200,14 +17,14 @@ function mapState(snapshot) {
200
17
  if (typedSnapshot.matches("captureInitials")) return {
201
18
  status: "capture",
202
19
  title: context.config.title,
203
- subtitle: context.config.subtitle,
20
+ subtitle: context.config.subTitle,
204
21
  phase: "initials",
205
22
  canContinue: context.isValid
206
23
  };
207
24
  if (typedSnapshot.matches("captureSignature")) return {
208
25
  status: "capture",
209
26
  title: context.config.title,
210
- subtitle: context.config.subtitle,
27
+ subtitle: context.config.subTitle,
211
28
  phase: "signature",
212
29
  canContinue: context.isValid
213
30
  };
@@ -0,0 +1,189 @@
1
+ import { t as api } from "./api-aa9Mx20l.esm.js";
2
+ import { _ as endpoints, m as addEvent, n as eventModuleNames, r as eventScreenNames } from "./events-W91zLpx4.esm.js";
3
+ import { i as fromPromise, n as assign, t as setup } from "./xstate.esm-B7FPE6br.esm.js";
4
+
5
+ //#region src/modules/signature/signatureServices.ts
6
+ /**
7
+ * Uploads a signature image to the Omni API.
8
+ * Uses JSON + base64 when `sendBase64` is true, otherwise sends raw JPEG bytes.
9
+ * Throws on failure.
10
+ */
11
+ async function addSignature(params, signal) {
12
+ const { image, type, sendBase64 = false } = params;
13
+ const url = sendBase64 ? endpoints.addSignatureV2 : endpoints.addSignature;
14
+ const body = sendBase64 ? { base64Image: image } : image;
15
+ const res = await api.post(url, body, {
16
+ signal,
17
+ headers: { "Content-Type": sendBase64 ? "application/json" : "image/jpeg" },
18
+ query: { type }
19
+ });
20
+ if (!res.ok) throw new Error(`POST ${url} failed: ${res.status} ${res.statusText}`);
21
+ return res.data;
22
+ }
23
+ /**
24
+ * Uploads a initials image to the Omni API.
25
+ * Uses JSON + base64 when `sendBase64` is true, otherwise sends raw JPEG bytes.
26
+ * Throws on failure.
27
+ */
28
+ async function addInitials(params, signal) {
29
+ const { image, type, sendBase64 = false } = params;
30
+ const url = endpoints.addInitials;
31
+ const body = sendBase64 ? { base64Image: image } : image;
32
+ const res = await api.post(url, body, {
33
+ signal,
34
+ headers: { "Content-Type": sendBase64 ? "application/json" : "image/jpeg" },
35
+ query: { type }
36
+ });
37
+ if (!res.ok) throw new Error(`POST ${url} failed: ${res.status} ${res.statusText}`);
38
+ return res.data;
39
+ }
40
+
41
+ //#endregion
42
+ //#region src/modules/signature/signatureStateMachine.ts
43
+ function emptyCaptureState() {
44
+ return {
45
+ image: void 0,
46
+ isValid: false,
47
+ error: void 0,
48
+ signatureSubmitResult: void 0,
49
+ initialsSubmitResult: void 0
50
+ };
51
+ }
52
+ const signatureMachine = setup({
53
+ types: {
54
+ context: {},
55
+ events: {},
56
+ input: {}
57
+ },
58
+ actors: {
59
+ submitInitials: fromPromise(async ({ input, signal }) => addInitials({
60
+ image: input.image,
61
+ type: input.type,
62
+ sendBase64: input.sendBase64
63
+ }, signal)),
64
+ submitSignature: fromPromise(async ({ input, signal }) => addSignature({
65
+ image: input.image,
66
+ type: input.type,
67
+ sendBase64: input.sendBase64
68
+ }, signal))
69
+ },
70
+ actions: {
71
+ setSignatureValidity: assign(({ event }) => {
72
+ return {
73
+ isValid: event.isValid,
74
+ error: void 0
75
+ };
76
+ }),
77
+ assignImageForSubmit: assign(({ event }) => {
78
+ return {
79
+ image: event.image,
80
+ error: void 0
81
+ };
82
+ }),
83
+ setInitialsSubmitResult: assign(({ event }) => ({
84
+ initialsSubmitResult: event.output,
85
+ error: void 0
86
+ })),
87
+ setSignatureSubmitResult: assign(({ event }) => ({
88
+ signatureSubmitResult: event.output,
89
+ error: void 0
90
+ })),
91
+ setErrorFromInvoke: assign(({ event }) => {
92
+ const error = event.error;
93
+ return { error: error instanceof Error ? error.message : typeof error === "string" ? error : "Something went wrong" };
94
+ }),
95
+ clearError: assign({ error: () => void 0 }),
96
+ resetContext: assign({
97
+ isValid: () => false,
98
+ image: () => void 0,
99
+ error: () => void 0
100
+ }),
101
+ trackSubmitAttempt: () => {
102
+ addEvent({
103
+ code: "continue",
104
+ module: eventModuleNames.signature,
105
+ screen: eventScreenNames.signatureInput
106
+ });
107
+ },
108
+ trackError: ({ context }) => {
109
+ addEvent({
110
+ code: "verificationError",
111
+ module: eventModuleNames.signature,
112
+ payload: context.error ? { error: context.error } : void 0
113
+ });
114
+ }
115
+ },
116
+ guards: { canContinue: ({ context, event }) => context.isValid && event.type === "CONTINUE" && !!event.image }
117
+ }).createMachine({
118
+ id: "signature",
119
+ initial: "idle",
120
+ context: ({ input }) => ({
121
+ config: input.config,
122
+ ...emptyCaptureState()
123
+ }),
124
+ states: {
125
+ idle: { on: { LOAD: "captureInitials" } },
126
+ captureInitials: { on: {
127
+ SIGNATURE_CHANGED: { actions: "setSignatureValidity" },
128
+ CONTINUE: {
129
+ target: "submittingInitials",
130
+ guard: "canContinue",
131
+ actions: "assignImageForSubmit"
132
+ }
133
+ } },
134
+ submittingInitials: {
135
+ entry: "trackSubmitAttempt",
136
+ invoke: {
137
+ id: "submitInitials",
138
+ src: "submitInitials",
139
+ input: ({ context }) => ({
140
+ image: context.image,
141
+ type: context.config.type,
142
+ sendBase64: context.config.sendBase64 ?? false
143
+ }),
144
+ onDone: {
145
+ target: "captureSignature",
146
+ actions: ["setInitialsSubmitResult", "resetContext"]
147
+ },
148
+ onError: {
149
+ target: "error",
150
+ actions: ["setErrorFromInvoke"]
151
+ }
152
+ }
153
+ },
154
+ captureSignature: { on: {
155
+ SIGNATURE_CHANGED: { actions: "setSignatureValidity" },
156
+ CONTINUE: {
157
+ target: "submittingSignature",
158
+ guard: "canContinue",
159
+ actions: "assignImageForSubmit"
160
+ }
161
+ } },
162
+ submittingSignature: {
163
+ entry: "trackSubmitAttempt",
164
+ invoke: {
165
+ id: "submitSignature",
166
+ src: "submitSignature",
167
+ input: ({ context }) => ({
168
+ image: context.image,
169
+ type: context.config.type,
170
+ sendBase64: context.config.sendBase64 ?? false
171
+ }),
172
+ onDone: {
173
+ target: "success",
174
+ actions: "setSignatureSubmitResult"
175
+ },
176
+ onError: {
177
+ target: "error",
178
+ actions: ["setErrorFromInvoke"]
179
+ }
180
+ }
181
+ },
182
+ success: { after: { 3e3: "finished" } },
183
+ finished: { type: "final" },
184
+ error: { entry: "trackError" }
185
+ }
186
+ });
187
+
188
+ //#endregion
189
+ export { signatureMachine as t };
@@ -1,4 +1,4 @@
1
- import { t as api } from "./api-DzpnV6O7.esm.js";
1
+ import { t as api } from "./api-aa9Mx20l.esm.js";
2
2
 
3
3
  //#region src/modules/stats/statsServices.ts
4
4
  /**
package/dist/stats.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import "./api-DzpnV6O7.esm.js";
2
- import { t as addDeviceStats } from "./stats-DHDoqSBV.esm.js";
1
+ import "./api-aa9Mx20l.esm.js";
2
+ import { t as addDeviceStats } from "./stats-gFD2351t.esm.js";
3
3
 
4
4
  export { addDeviceStats };
@@ -1,4 +1,4 @@
1
- import { t as CameraStream } from "./camera-1eeGnAaL.js";
1
+ import { t as CameraStream } from "./camera-DATT31my.js";
2
2
 
3
3
  //#region src/modules/document-upload/types.d.ts
4
4
 
@@ -0,0 +1,35 @@
1
+ import { t as AnyStateMachine } from "./StateMachine-BBuIgsHT.js";
2
+
3
+ //#region src/internal/orchestration/types.d.ts
4
+ /** Eager module: a pre-imported state machine. */
5
+ type EagerModule = AnyStateMachine;
6
+ /** Lazy module: a function that dynamically imports a state machine. */
7
+ type LazyModule = () => Promise<AnyStateMachine>;
8
+ /** A module entry in the registry — either eager (pre-loaded) or lazy (dynamically loaded). */
9
+ type ModuleEntry = EagerModule | LazyModule;
10
+ /**
11
+ * Registry mapping module keys to state machines.
12
+ * Used by Flow (eager-only) — all entries are AnyStateMachine.
13
+ */
14
+ type ModuleRegistry = {
15
+ [key: string]: AnyStateMachine | undefined;
16
+ };
17
+ /**
18
+ * Extended registry supporting both eager and lazy module entries.
19
+ * Used by Workflow — entries can be pre-loaded machines or dynamic import functions.
20
+ */
21
+ type WorkflowModuleRegistry = {
22
+ [key: string]: ModuleEntry | undefined;
23
+ };
24
+ type RunChildModuleInput = {
25
+ machine: AnyStateMachine | undefined;
26
+ config: unknown;
27
+ };
28
+ type RunChildModuleEvent = {
29
+ type: 'MODULE_COMPLETE';
30
+ } | {
31
+ type: 'MODULE_ERROR';
32
+ error: unknown;
33
+ };
34
+ //#endregion
35
+ export { WorkflowModuleRegistry as i, RunChildModuleEvent as n, RunChildModuleInput as r, ModuleRegistry as t };
@@ -1,4 +1,4 @@
1
- import { t as DocumentUploadConfig } from "./types-2OPf1pyv.js";
1
+ import { t as DocumentUploadConfig } from "./types-CYJ0Ish6.js";
2
2
 
3
3
  //#region src/modules/flow/types.d.ts
4
4
  type EmptyConfig = Record<string, never>;
package/dist/wasm.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { n as WasmPipeline, r as warmupWasm, t as WarmupConfig } from "./warmup-CIj_wEV_.js";
2
- import { n as WasmConfig, o as setWasmConfig, r as initializeWasmUtil } from "./setup-DpHakxsC.js";
1
+ import { n as WasmPipeline, r as warmupWasm, t as WarmupConfig } from "./warmup-Ckb1hN85.js";
2
+ import { n as WasmConfig, o as setWasmConfig, r as initializeWasmUtil } from "./setup-BYqwVLiv.js";
3
3
 
4
4
  //#region ../infra/src/wasm/wasmDefaults.d.ts
5
5
  /** The WASM version bundled and tested with this SDK release. */
package/dist/wasm.esm.js CHANGED
@@ -1,10 +1,10 @@
1
- import { c as resolveWasmConfig, i as setWasmConfig, o as DEFAULT_WASM_VERSION, s as buildDefaultWasmConfig, t as initializeWasmUtil } from "./setup-XpxfZgKn.esm.js";
2
- import { n as warmupWasm } from "./BaseWasmProvider-D-s_6M5H.esm.js";
3
- import "./WasmUtilProvider-BpZSvZbg.esm.js";
4
- import "./api-DzpnV6O7.esm.js";
5
- import "./events-DlHrOIRc.esm.js";
6
- import "./session-CUh77zj3.esm.js";
7
- import "./BrowserEnvironmentProvider-DaHeLJQw.esm.js";
8
- import "./browserSimulation-B4ubb2OL.esm.js";
1
+ import { c as resolveWasmConfig, i as setWasmConfig, o as DEFAULT_WASM_VERSION, s as buildDefaultWasmConfig, t as initializeWasmUtil } from "./setup-DLvhsDol.esm.js";
2
+ import { n as warmupWasm } from "./BaseWasmProvider-DoYDYH1z.esm.js";
3
+ import "./WasmUtilProvider-mWSXzp7b.esm.js";
4
+ import "./api-aa9Mx20l.esm.js";
5
+ import "./events-W91zLpx4.esm.js";
6
+ import "./session-B_rKSRql.esm.js";
7
+ import "./BrowserEnvironmentProvider-BtKLxTx4.esm.js";
8
+ import "./browserSimulation-DFqGKQAD.esm.js";
9
9
 
10
10
  export { DEFAULT_WASM_VERSION, buildDefaultWasmConfig, initializeWasmUtil, resolveWasmConfig, setWasmConfig, warmupWasm };