@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
@@ -1,4 +1,4 @@
1
- import { t as Manager } from "./Manager-BN2g_I8W.js";
1
+ import { t as Manager } from "./Manager-DcPMRgTm.js";
2
2
 
3
3
  //#region src/modules/face-match/types.d.ts
4
4
 
@@ -13,7 +13,7 @@ type FaceMatchVariant = 'selfieVsId' | 'selfieVsNfc' | 'idVsNfc' | 'nfc3Way' | '
13
13
  * @example Standard face match with animation
14
14
  * ```typescript
15
15
  * const config: FaceMatchConfig = {
16
- * variant: 'selfieVsId',
16
+ * matchingType: 'selfieVsId',
17
17
  * disableFaceMatchAnimation: false,
18
18
  * };
19
19
  * ```
@@ -21,7 +21,7 @@ type FaceMatchVariant = 'selfieVsId' | 'selfieVsNfc' | 'idVsNfc' | 'nfc3Way' | '
21
21
  * @example Auto-skip mode (headless)
22
22
  * ```typescript
23
23
  * const config: FaceMatchConfig = {
24
- * variant: 'selfieVsId',
24
+ * matchingType: 'selfieVsId',
25
25
  * disableFaceMatchAnimation: true,
26
26
  * };
27
27
  * ```
@@ -29,9 +29,10 @@ type FaceMatchVariant = 'selfieVsId' | 'selfieVsNfc' | 'idVsNfc' | 'nfc3Way' | '
29
29
  type FaceMatchConfig = {
30
30
  /**
31
31
  * Which images to compare in the face match flow.
32
+ * Backend field name: `matchingType`.
32
33
  * @default 'selfieVsId'
33
34
  */
34
- variant?: FaceMatchVariant;
35
+ matchingType?: FaceMatchVariant;
35
36
  /**
36
37
  * When true, skips the animation UI and auto-completes immediately after fetching data.
37
38
  * Useful for headless integrations or silent verification flows.
@@ -155,7 +156,7 @@ type FaceMatchState = FaceMatchIdleState | FaceMatchLoadingState | FaceMatchAnim
155
156
  *
156
157
  * @param options - Configuration options
157
158
  * @param options.config - Face match configuration
158
- * @param options.config.variant - Which images to compare (default: 'selfieVsId')
159
+ * @param options.config.matchingType - Which images to compare (default: 'selfieVsId')
159
160
  * @param options.config.disableFaceMatchAnimation - Skip animation and auto-complete (default: false)
160
161
  *
161
162
  * @returns Face match manager with state, API methods, and subscription
@@ -163,7 +164,7 @@ type FaceMatchState = FaceMatchIdleState | FaceMatchLoadingState | FaceMatchAnim
163
164
  * @example Headless usage
164
165
  * ```typescript
165
166
  * const manager = createFaceMatchManager({
166
- * config: { variant: 'selfieVsId', disableFaceMatchAnimation: true },
167
+ * config: { matchingType: 'selfieVsId', disableFaceMatchAnimation: true },
167
168
  * });
168
169
  *
169
170
  * manager.subscribe((state) => console.log(state.status));
@@ -1,129 +1,8 @@
1
- import { t as api } from "./api-DzpnV6O7.esm.js";
2
- import { _ as endpoints, n as eventModuleNames, o as createManagerInstrumentation } 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 faceMatchMachine } from "./faceMatchStateMachine-CLterVEC.esm.js";
4
5
 
5
- //#region src/modules/face-match/faceMatchServices.ts
6
- /**
7
- * Fetches cropped face images from the backend.
8
- */
9
- async function fetchFaceMatchImages(signal) {
10
- const res = await api.post(endpoints.getImagesV2, { images: [
11
- "croppedFace",
12
- "croppedIDFace",
13
- "croppedAuthenticationSelfie"
14
- ] }, { signal });
15
- if (!res.ok) throw new Error(`POST ${endpoints.getImagesV2} failed: ${res.status} ${res.statusText}`);
16
- const data = res.data;
17
- return {
18
- idFace: data.croppedIDFace ?? null,
19
- selfie: data.croppedFace ?? data.croppedAuthenticationSelfie ?? null,
20
- secondIdFace: void 0
21
- };
22
- }
23
- /**
24
- * Fetches face recognition score from the backend.
25
- */
26
- async function fetchScore(signal) {
27
- const res = await api.get(endpoints.getScore, { signal });
28
- if (!res.ok) throw new Error(`GET ${endpoints.getScore} failed: ${res.status} ${res.statusText}`);
29
- const data = res.data;
30
- return {
31
- matched: data.faceRecognition?.overall?.status === "OK" ? true : data.faceRecognition?.overall?.status === "FAIL" ? false : null,
32
- liveness: data.deepsight ? data.deepsight.multimodalIntelligence?.overall?.status === "OK" : data.liveness?.overall?.status === "OK"
33
- };
34
- }
35
- /**
36
- * Fetches second ID face images from the backend.
37
- */
38
- async function fetchSecondIdImages(signal) {
39
- const res = await api.post(endpoints.getImagesSecondId, { images: ["croppedIDFace"] }, { signal });
40
- if (!res.ok) throw new Error(`POST ${endpoints.getImagesSecondId} failed: ${res.status} ${res.statusText}`);
41
- return { secondIdFace: res.data.croppedIDFace ?? null };
42
- }
43
- /**
44
- * Fetches all face match data in parallel (images, score, and optionally second ID images).
45
- */
46
- async function fetchFaceMatchData(config, signal) {
47
- const promises = [fetchFaceMatchImages(signal), fetchScore(signal)];
48
- if (config.variant === "secondId") promises.push(fetchSecondIdImages(signal));
49
- const [imagesRes, resultRes, secondIdRes] = await Promise.all(promises);
50
- return {
51
- images: {
52
- ...imagesRes,
53
- secondIdFace: secondIdRes?.secondIdFace ?? null
54
- },
55
- result: resultRes
56
- };
57
- }
58
-
59
- //#endregion
60
- //#region src/modules/face-match/faceMatchStateMachine.ts
61
- const faceMatchMachine = setup({
62
- types: {
63
- context: {},
64
- events: {},
65
- input: {}
66
- },
67
- actors: { fetchData: fromPromise(async ({ input, signal }) => {
68
- return fetchFaceMatchData(input.config, signal);
69
- }) },
70
- actions: {
71
- setData: assign(({ event }) => {
72
- const output = event.output;
73
- return {
74
- images: output.images,
75
- result: output.result
76
- };
77
- }),
78
- setError: assign(({ event }) => ({ error: String(event.error) })),
79
- clearError: assign({ error: () => void 0 }),
80
- resetContext: assign(({ context }) => ({
81
- config: context.config,
82
- images: null,
83
- result: null,
84
- error: void 0
85
- }))
86
- },
87
- guards: { isAnimationDisabled: ({ context }) => context.config.disableFaceMatchAnimation === true }
88
- }).createMachine({
89
- id: "faceMatch",
90
- initial: "idle",
91
- context: ({ input }) => ({
92
- config: input.config,
93
- images: null,
94
- result: null,
95
- error: void 0
96
- }),
97
- states: {
98
- idle: { on: { LOAD: { target: "loading" } } },
99
- loading: { invoke: {
100
- id: "fetchData",
101
- src: "fetchData",
102
- input: ({ context }) => ({ config: context.config }),
103
- onDone: [{
104
- target: "finished",
105
- guard: "isAnimationDisabled",
106
- actions: "setData"
107
- }, {
108
- target: "animating",
109
- actions: "setData"
110
- }],
111
- onError: {
112
- target: "error",
113
- actions: "setError"
114
- }
115
- } },
116
- animating: { on: { ANIMATION_COMPLETE: { target: "result" } } },
117
- result: { on: { CONTINUE: { target: "finished" } } },
118
- finished: { type: "final" },
119
- error: { on: { RESET: {
120
- target: "idle",
121
- actions: "resetContext"
122
- } } }
123
- }
124
- });
125
-
126
- //#endregion
127
6
  //#region src/modules/face-match/faceMatchActor.ts
128
7
  function createFaceMatchActor(options) {
129
8
  return createActor(faceMatchMachine, { input: { config: options.config } }).start();
@@ -153,7 +32,7 @@ function createFaceMatchActor(options) {
153
32
  * // 2. Create the face match manager
154
33
  * const faceMatchManager = createFaceMatchManager({
155
34
  * config: {
156
- * variant: 'selfieVsId',
35
+ * matchingType: 'selfieVsId',
157
36
  * disableFaceMatchAnimation: true,
158
37
  * },
159
38
  * });
@@ -182,7 +61,7 @@ function createFaceMatchActor(options) {
182
61
  * @example Headless face match with custom UI
183
62
  * ```typescript
184
63
  * const faceMatchManager = createFaceMatchManager({
185
- * config: { variant: 'selfieVsId', disableFaceMatchAnimation: false },
64
+ * config: { matchingType: 'selfieVsId', disableFaceMatchAnimation: false },
186
65
  * });
187
66
  *
188
67
  * faceMatchManager.subscribe((state) => {
@@ -254,7 +133,7 @@ function createApi({ actor, trackElementClicked }) {
254
133
  *
255
134
  * @param options - Configuration options
256
135
  * @param options.config - Face match configuration
257
- * @param options.config.variant - Which images to compare (default: 'selfieVsId')
136
+ * @param options.config.matchingType - Which images to compare (default: 'selfieVsId')
258
137
  * @param options.config.disableFaceMatchAnimation - Skip animation and auto-complete (default: false)
259
138
  *
260
139
  * @returns Face match manager with state, API methods, and subscription
@@ -262,7 +141,7 @@ function createApi({ actor, trackElementClicked }) {
262
141
  * @example Headless usage
263
142
  * ```typescript
264
143
  * const manager = createFaceMatchManager({
265
- * config: { variant: 'selfieVsId', disableFaceMatchAnimation: true },
144
+ * config: { matchingType: 'selfieVsId', disableFaceMatchAnimation: true },
266
145
  * });
267
146
  *
268
147
  * manager.subscribe((state) => console.log(state.status));
@@ -0,0 +1,117 @@
1
+ import { o as createManagerInstrumentation } from "./events-W91zLpx4.esm.js";
2
+ import { o as createManager } from "./xstate.esm-B7FPE6br.esm.js";
3
+
4
+ //#region src/internal/faceCapture/faceCaptureManagerFactory.ts
5
+ function getPermissionStatus(snapshot) {
6
+ if (!snapshot.matches("permissions")) return;
7
+ if (snapshot.matches({ permissions: "idle" })) return "idle";
8
+ if (snapshot.matches({ permissions: "learnMore" })) return "learnMore";
9
+ if (snapshot.matches({ permissions: "requesting" })) return "requesting";
10
+ if (snapshot.matches({ permissions: "denied" })) return "denied";
11
+ }
12
+ function getCaptureStatus(snapshot) {
13
+ if (snapshot.matches({ capture: "initializing" })) return "initializing";
14
+ if (snapshot.matches({ capture: "detecting" })) return "detecting";
15
+ if (snapshot.matches({ capture: "capturing" })) return "capturing";
16
+ if (snapshot.matches({ capture: "capturingManual" })) return "capturing";
17
+ if (snapshot.matches({ capture: "uploading" })) return "uploading";
18
+ if (snapshot.matches({ capture: "uploadError" })) return "uploadError";
19
+ if (snapshot.matches({ capture: "success" })) return "success";
20
+ }
21
+ function mapState(snapshot) {
22
+ const { context } = snapshot;
23
+ if (snapshot.matches("idle")) return { status: "idle" };
24
+ if (snapshot.matches("loading")) return { status: "loading" };
25
+ if (snapshot.matches("tutorial")) return { status: "tutorial" };
26
+ if (snapshot.matches("closed")) return { status: "closed" };
27
+ if (snapshot.matches("permissions")) {
28
+ const permissionStatus = getPermissionStatus(snapshot);
29
+ if (permissionStatus === void 0) return {
30
+ status: "permissions",
31
+ permissionStatus: "idle"
32
+ };
33
+ return {
34
+ status: "permissions",
35
+ permissionStatus
36
+ };
37
+ }
38
+ if (snapshot.matches("capture")) return {
39
+ status: "capture",
40
+ captureStatus: getCaptureStatus(snapshot) ?? "initializing",
41
+ stream: context.stream,
42
+ detectionStatus: context.detectionStatus ?? "idle",
43
+ debugFrame: context.debugFrame,
44
+ attemptsRemaining: context.attemptsRemaining ?? 0,
45
+ uploadError: context.uploadError,
46
+ assistedOnboarding: context.config?.assistedOnboarding ?? false
47
+ };
48
+ if (snapshot.matches("processing")) return { status: "processing" };
49
+ if (snapshot.matches("finished")) return {
50
+ status: "finished",
51
+ processResponse: context.processResponse
52
+ };
53
+ if (snapshot.matches("error")) {
54
+ const errorValue = context.error;
55
+ return {
56
+ status: "error",
57
+ error: typeof errorValue === "string" ? errorValue : errorValue ? errorValue.message : "Unknown error"
58
+ };
59
+ }
60
+ return { status: "idle" };
61
+ }
62
+ function createApi({ actor, trackElementClicked, trackCaptureAttemptFinished }) {
63
+ const snapshot = actor.getSnapshot();
64
+ snapshot.context.dependencies.trackCaptureAttemptFinished = trackCaptureAttemptFinished;
65
+ return {
66
+ load() {
67
+ actor.send({ type: "LOAD" });
68
+ },
69
+ nextStep() {
70
+ trackElementClicked?.("nextStep");
71
+ actor.send({ type: "NEXT_STEP" });
72
+ },
73
+ requestPermission() {
74
+ trackElementClicked?.("requestPermission");
75
+ actor.send({ type: "REQUEST_PERMISSION" });
76
+ },
77
+ goToLearnMore() {
78
+ trackElementClicked?.("goToLearnMore");
79
+ actor.send({ type: "GO_TO_LEARN_MORE" });
80
+ },
81
+ back() {
82
+ trackElementClicked?.("back");
83
+ actor.send({ type: "BACK" });
84
+ },
85
+ close() {
86
+ trackElementClicked?.("close");
87
+ actor.send({ type: "QUIT" });
88
+ },
89
+ reset() {
90
+ actor.send({ type: "RESET" });
91
+ },
92
+ retryCapture() {
93
+ trackElementClicked?.("retryCapture");
94
+ actor.send({ type: "RETRY_CAPTURE" });
95
+ },
96
+ capture() {
97
+ trackElementClicked?.("capture");
98
+ actor.send({ type: "MANUAL_CAPTURE" });
99
+ }
100
+ };
101
+ }
102
+ function getFaceCaptureErrorPayload(snapshot) {
103
+ const errorCode = snapshot.context.uploadError;
104
+ if (typeof errorCode !== "string" || errorCode.length === 0) return;
105
+ return { errorCode };
106
+ }
107
+ function createFaceCaptureManagerFromActor(actor, moduleName) {
108
+ return createManager({
109
+ actor,
110
+ mapState,
111
+ createApi,
112
+ instrumentation: createManagerInstrumentation(moduleName, { getErrorPayload: getFaceCaptureErrorPayload })
113
+ });
114
+ }
115
+
116
+ //#endregion
117
+ export { createFaceCaptureManagerFromActor as t };
@@ -1,11 +1,11 @@
1
- import { n as WasmPipeline } from "./warmup-CIj_wEV_.js";
2
- import { t as Manager } from "./Manager-BN2g_I8W.js";
3
- import { t as ActorRefFrom } from "./Actor-Ba71-_30.js";
4
- import { n as StateMachine, t as AnyStateMachine } from "./StateMachine-BoJsfMvg.js";
5
- import { t as CameraStream } from "./camera-1eeGnAaL.js";
6
- import { r as FlowModuleConfig, t as Flow } from "./types-CVJVQ7fp.js";
7
- import { a as IWasmUtilCapability, c as IMLProviderCapability, d as IRecordingCapability, i as IncodeCanvas, l as MLProviderConfig, r as StreamCanvasCapture, t as DeepsightService, u as IStorageCapability } from "./deepsightService-ByD6uIs7.js";
8
- import { n as PermissionStatus, t as PermissionResult } from "./types-D_QfFKxT.js";
1
+ import { n as WasmPipeline } from "./warmup-Ckb1hN85.js";
2
+ import { t as Manager } from "./Manager-DcPMRgTm.js";
3
+ import { t as ActorRefFrom } from "./Actor-DbWH1K6E.js";
4
+ import { n as StateMachine, t as AnyStateMachine } from "./StateMachine-BBuIgsHT.js";
5
+ import { t as CameraStream } from "./camera-DATT31my.js";
6
+ import { r as FlowModuleConfig, t as Flow } from "./types-DU8HmI5U.js";
7
+ import { a as IWasmUtilCapability, c as IMLProviderCapability, d as IRecordingCapability, i as IncodeCanvas, l as MLProviderConfig, r as StreamCanvasCapture, t as DeepsightService, u as IStorageCapability } from "./deepsightService-S-tU77m-.js";
8
+ import { n as PermissionStatus, t as PermissionResult } from "./types-CIjb0FKu.js";
9
9
 
10
10
  //#region src/modules/authentication/authenticationStateMachine.d.ts
11
11
  declare const _authenticationMachine: AnyStateMachine;
@@ -1,122 +1,8 @@
1
- import { r as getToken } from "./api-DzpnV6O7.esm.js";
2
- import { o as createManagerInstrumentation } from "./events-DlHrOIRc.esm.js";
3
- import { i as fromPromise, n as assign, o as createManager, r as fromCallback, t as setup } from "./xstate.esm-Bv55-lJ4.esm.js";
4
- import { _ as StreamCanvasCapture, a as initializeDeepsightSession, c as stopStream, h as flagFaceManualReview, i as initializeCamera, n as preloadOpenViduProvider, o as sendLabelInspectionEvent, r as encryptSelfieImage, s as startDetection, t as createRecordingService, v as FACE_ERROR_CODES } from "./recordingService-483wQ6kR.esm.js";
5
- import { n as requestPermission, t as checkPermission } from "./permissionServices-Cskq32Yd.esm.js";
1
+ import { r as getToken } from "./api-aa9Mx20l.esm.js";
2
+ import { i as fromPromise, n as assign, r as fromCallback, t as setup } from "./xstate.esm-B7FPE6br.esm.js";
3
+ import { _ as StreamCanvasCapture, a as initializeDeepsightSession, c as stopStream, h as flagFaceManualReview, i as initializeCamera, n as preloadOpenViduProvider, o as sendLabelInspectionEvent, r as encryptSelfieImage, s as startDetection, t as createRecordingService, v as FACE_ERROR_CODES } from "./recordingService-CCfxUY7-.esm.js";
4
+ import { n as requestPermission, t as checkPermission } from "./permissionServices-Cisv73eQ.esm.js";
6
5
 
7
- //#region src/internal/faceCapture/faceCaptureManagerFactory.ts
8
- function getPermissionStatus(snapshot) {
9
- if (!snapshot.matches("permissions")) return;
10
- if (snapshot.matches({ permissions: "idle" })) return "idle";
11
- if (snapshot.matches({ permissions: "learnMore" })) return "learnMore";
12
- if (snapshot.matches({ permissions: "requesting" })) return "requesting";
13
- if (snapshot.matches({ permissions: "denied" })) return "denied";
14
- }
15
- function getCaptureStatus(snapshot) {
16
- if (snapshot.matches({ capture: "initializing" })) return "initializing";
17
- if (snapshot.matches({ capture: "detecting" })) return "detecting";
18
- if (snapshot.matches({ capture: "capturing" })) return "capturing";
19
- if (snapshot.matches({ capture: "capturingManual" })) return "capturing";
20
- if (snapshot.matches({ capture: "uploading" })) return "uploading";
21
- if (snapshot.matches({ capture: "uploadError" })) return "uploadError";
22
- if (snapshot.matches({ capture: "success" })) return "success";
23
- }
24
- function mapState(snapshot) {
25
- const { context } = snapshot;
26
- if (snapshot.matches("idle")) return { status: "idle" };
27
- if (snapshot.matches("loading")) return { status: "loading" };
28
- if (snapshot.matches("tutorial")) return { status: "tutorial" };
29
- if (snapshot.matches("closed")) return { status: "closed" };
30
- if (snapshot.matches("permissions")) {
31
- const permissionStatus = getPermissionStatus(snapshot);
32
- if (permissionStatus === void 0) return {
33
- status: "permissions",
34
- permissionStatus: "idle"
35
- };
36
- return {
37
- status: "permissions",
38
- permissionStatus
39
- };
40
- }
41
- if (snapshot.matches("capture")) return {
42
- status: "capture",
43
- captureStatus: getCaptureStatus(snapshot) ?? "initializing",
44
- stream: context.stream,
45
- detectionStatus: context.detectionStatus ?? "idle",
46
- debugFrame: context.debugFrame,
47
- attemptsRemaining: context.attemptsRemaining ?? 0,
48
- uploadError: context.uploadError,
49
- assistedOnboarding: context.config?.assistedOnboarding ?? false
50
- };
51
- if (snapshot.matches("processing")) return { status: "processing" };
52
- if (snapshot.matches("finished")) return {
53
- status: "finished",
54
- processResponse: context.processResponse
55
- };
56
- if (snapshot.matches("error")) {
57
- const errorValue = context.error;
58
- return {
59
- status: "error",
60
- error: typeof errorValue === "string" ? errorValue : errorValue ? errorValue.message : "Unknown error"
61
- };
62
- }
63
- return { status: "idle" };
64
- }
65
- function createApi({ actor, trackElementClicked, trackCaptureAttemptFinished }) {
66
- const snapshot = actor.getSnapshot();
67
- snapshot.context.dependencies.trackCaptureAttemptFinished = trackCaptureAttemptFinished;
68
- return {
69
- load() {
70
- actor.send({ type: "LOAD" });
71
- },
72
- nextStep() {
73
- trackElementClicked?.("nextStep");
74
- actor.send({ type: "NEXT_STEP" });
75
- },
76
- requestPermission() {
77
- trackElementClicked?.("requestPermission");
78
- actor.send({ type: "REQUEST_PERMISSION" });
79
- },
80
- goToLearnMore() {
81
- trackElementClicked?.("goToLearnMore");
82
- actor.send({ type: "GO_TO_LEARN_MORE" });
83
- },
84
- back() {
85
- trackElementClicked?.("back");
86
- actor.send({ type: "BACK" });
87
- },
88
- close() {
89
- trackElementClicked?.("close");
90
- actor.send({ type: "QUIT" });
91
- },
92
- reset() {
93
- actor.send({ type: "RESET" });
94
- },
95
- retryCapture() {
96
- trackElementClicked?.("retryCapture");
97
- actor.send({ type: "RETRY_CAPTURE" });
98
- },
99
- capture() {
100
- trackElementClicked?.("capture");
101
- actor.send({ type: "MANUAL_CAPTURE" });
102
- }
103
- };
104
- }
105
- function getFaceCaptureErrorPayload(snapshot) {
106
- const errorCode = snapshot.context.uploadError;
107
- if (typeof errorCode !== "string" || errorCode.length === 0) return;
108
- return { errorCode };
109
- }
110
- function createFaceCaptureManagerFromActor(actor, moduleName) {
111
- return createManager({
112
- actor,
113
- mapState,
114
- createApi,
115
- instrumentation: createManagerInstrumentation(moduleName, { getErrorPayload: getFaceCaptureErrorPayload })
116
- });
117
- }
118
-
119
- //#endregion
120
6
  //#region src/internal/faceCapture/faceCaptureSetup.ts
121
7
  const getAttemptsFromConfig = (config) => {
122
8
  return config.captureAttempts ?? config.numberOfAttempts ?? 3;
@@ -825,4 +711,4 @@ const _faceCaptureMachine = setup({
825
711
  const faceCaptureMachine = _faceCaptureMachine;
826
712
 
827
713
  //#endregion
828
- export { createFaceCaptureManagerFromActor as n, faceCaptureMachine as t };
714
+ export { faceCaptureMachine as t };
@@ -0,0 +1,127 @@
1
+ import { t as api } from "./api-aa9Mx20l.esm.js";
2
+ import { _ as endpoints } 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/face-match/faceMatchServices.ts
6
+ /**
7
+ * Fetches cropped face images from the backend.
8
+ */
9
+ async function fetchFaceMatchImages(signal) {
10
+ const res = await api.post(endpoints.getImagesV2, { images: [
11
+ "croppedFace",
12
+ "croppedIDFace",
13
+ "croppedAuthenticationSelfie"
14
+ ] }, { signal });
15
+ if (!res.ok) throw new Error(`POST ${endpoints.getImagesV2} failed: ${res.status} ${res.statusText}`);
16
+ const data = res.data;
17
+ return {
18
+ idFace: data.croppedIDFace ?? null,
19
+ selfie: data.croppedFace ?? data.croppedAuthenticationSelfie ?? null,
20
+ secondIdFace: void 0
21
+ };
22
+ }
23
+ /**
24
+ * Fetches face recognition score from the backend.
25
+ */
26
+ async function fetchScore(signal) {
27
+ const res = await api.get(endpoints.getScore, { signal });
28
+ if (!res.ok) throw new Error(`GET ${endpoints.getScore} failed: ${res.status} ${res.statusText}`);
29
+ const data = res.data;
30
+ return {
31
+ matched: data.faceRecognition?.overall?.status === "OK" ? true : data.faceRecognition?.overall?.status === "FAIL" ? false : null,
32
+ liveness: data.deepsight ? data.deepsight.multimodalIntelligence?.overall?.status === "OK" : data.liveness?.overall?.status === "OK"
33
+ };
34
+ }
35
+ /**
36
+ * Fetches second ID face images from the backend.
37
+ */
38
+ async function fetchSecondIdImages(signal) {
39
+ const res = await api.post(endpoints.getImagesSecondId, { images: ["croppedIDFace"] }, { signal });
40
+ if (!res.ok) throw new Error(`POST ${endpoints.getImagesSecondId} failed: ${res.status} ${res.statusText}`);
41
+ return { secondIdFace: res.data.croppedIDFace ?? null };
42
+ }
43
+ /**
44
+ * Fetches all face match data in parallel (images, score, and optionally second ID images).
45
+ */
46
+ async function fetchFaceMatchData(config, signal) {
47
+ const promises = [fetchFaceMatchImages(signal), fetchScore(signal)];
48
+ if (config.matchingType === "secondId") promises.push(fetchSecondIdImages(signal));
49
+ const [imagesRes, resultRes, secondIdRes] = await Promise.all(promises);
50
+ return {
51
+ images: {
52
+ ...imagesRes,
53
+ secondIdFace: secondIdRes?.secondIdFace ?? null
54
+ },
55
+ result: resultRes
56
+ };
57
+ }
58
+
59
+ //#endregion
60
+ //#region src/modules/face-match/faceMatchStateMachine.ts
61
+ const faceMatchMachine = setup({
62
+ types: {
63
+ context: {},
64
+ events: {},
65
+ input: {}
66
+ },
67
+ actors: { fetchData: fromPromise(async ({ input, signal }) => {
68
+ return fetchFaceMatchData(input.config, signal);
69
+ }) },
70
+ actions: {
71
+ setData: assign(({ event }) => {
72
+ const output = event.output;
73
+ return {
74
+ images: output.images,
75
+ result: output.result
76
+ };
77
+ }),
78
+ setError: assign(({ event }) => ({ error: String(event.error) })),
79
+ clearError: assign({ error: () => void 0 }),
80
+ resetContext: assign(({ context }) => ({
81
+ config: context.config,
82
+ images: null,
83
+ result: null,
84
+ error: void 0
85
+ }))
86
+ },
87
+ guards: { isAnimationDisabled: ({ context }) => context.config.disableFaceMatchAnimation === true }
88
+ }).createMachine({
89
+ id: "faceMatch",
90
+ initial: "idle",
91
+ context: ({ input }) => ({
92
+ config: input.config,
93
+ images: null,
94
+ result: null,
95
+ error: void 0
96
+ }),
97
+ states: {
98
+ idle: { on: { LOAD: { target: "loading" } } },
99
+ loading: { invoke: {
100
+ id: "fetchData",
101
+ src: "fetchData",
102
+ input: ({ context }) => ({ config: context.config }),
103
+ onDone: [{
104
+ target: "finished",
105
+ guard: "isAnimationDisabled",
106
+ actions: "setData"
107
+ }, {
108
+ target: "animating",
109
+ actions: "setData"
110
+ }],
111
+ onError: {
112
+ target: "error",
113
+ actions: "setError"
114
+ }
115
+ } },
116
+ animating: { on: { ANIMATION_COMPLETE: { target: "result" } } },
117
+ result: { on: { CONTINUE: { target: "finished" } } },
118
+ finished: { type: "final" },
119
+ error: { on: { RESET: {
120
+ target: "idle",
121
+ actions: "resetContext"
122
+ } } }
123
+ }
124
+ });
125
+
126
+ //#endregion
127
+ export { faceMatchMachine as t };
package/dist/flow.d.ts CHANGED
@@ -1,10 +1,11 @@
1
- import { n as WasmPipeline } from "./warmup-CIj_wEV_.js";
2
- import { t as Manager } from "./Manager-BN2g_I8W.js";
3
- import { t as AnyStateMachine } from "./StateMachine-BoJsfMvg.js";
4
- import "./camera-1eeGnAaL.js";
5
- import "./types-2OPf1pyv.js";
6
- import { n as FlowModule, r as FlowModuleConfig, t as Flow } from "./types-CVJVQ7fp.js";
7
- import { n as GetFinishStatusFn, t as FinishStatus } from "./flowCompletionService-D-3YCHyO.js";
1
+ import { n as WasmPipeline } from "./warmup-Ckb1hN85.js";
2
+ import { t as Manager } from "./Manager-DcPMRgTm.js";
3
+ import { t as AnyStateMachine } from "./StateMachine-BBuIgsHT.js";
4
+ import "./camera-DATT31my.js";
5
+ import "./types-CYJ0Ish6.js";
6
+ import { n as FlowModule, r as FlowModuleConfig, t as Flow } from "./types-DU8HmI5U.js";
7
+ import { n as GetFinishStatusFn, t as FinishStatus } from "./flowCompletionService-gxt5reFV.js";
8
+ import { t as ModuleRegistry } from "./types-CjsEZRcz.js";
8
9
 
9
10
  //#region src/modules/flow/flowUtils.d.ts
10
11
 
@@ -177,12 +178,6 @@ declare function createModuleLoader(registry: ModuleLoaderRegistry): ModuleLoade
177
178
  //#endregion
178
179
  //#region src/modules/flow/orchestratedFlowStateMachine.d.ts
179
180
  type GetFlowFn = (signal: AbortSignal) => Promise<Flow>;
180
- type ModuleRegistry = {
181
- PHONE?: AnyStateMachine;
182
- EMAIL?: AnyStateMachine;
183
- SELFIE?: AnyStateMachine;
184
- [key: string]: AnyStateMachine | undefined;
185
- };
186
181
  type LazyModuleRegistry = {
187
182
  [key: string]: (() => Promise<AnyStateMachine | {
188
183
  default: AnyStateMachine;