@incodetech/core 2.0.0 → 2.0.1-rc.0

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 (178) hide show
  1. package/dist/Actor-CI32dTbG.d.ts +2 -0
  2. package/dist/BaseWasmProvider-C_DLEI40.esm.js +1118 -0
  3. package/dist/BrowserStorageProvider-CuOW1Er2.esm.js +55 -0
  4. package/dist/BrowserTimerProvider-DhNc_x02.esm.js +22 -0
  5. package/dist/ITimerCapability-C67ZRskg.esm.js +7 -0
  6. package/dist/IpifyProvider-D7jx52AL.esm.js +139 -0
  7. package/dist/Manager-C8PrhBOx.d.ts +19 -0
  8. package/dist/MotionSensorProvider-4v7xkqAp.esm.js +254 -0
  9. package/dist/OpenViduRecordingProvider-CMu6XVdc.esm.js +87 -0
  10. package/dist/StateMachine-BCQrZJhf.d.ts +2 -0
  11. package/dist/WasmUtilProvider-j98OJf-S.esm.js +114 -0
  12. package/dist/addressSearch-BpTbTWCa.esm.js +430 -0
  13. package/dist/ae-signature-DDDZmWXj.esm.js +12 -0
  14. package/dist/ae-signature.d.ts +25 -0
  15. package/dist/ae-signature.esm.js +8 -0
  16. package/dist/antifraud.d.ts +57 -0
  17. package/dist/antifraud.esm.js +45 -0
  18. package/dist/antifraudStateMachine-O0TMf6yc.esm.js +39 -0
  19. package/dist/api-CESGtpbH.esm.js +53 -0
  20. package/dist/authentication.d.ts +12 -0
  21. package/dist/authentication.esm.js +25 -0
  22. package/dist/authenticationManager-5M-fKzXx.esm.js +67 -0
  23. package/dist/authenticationManager-C83GNIhl.d.ts +66 -0
  24. package/dist/authenticationStateMachine-BMZqatiF.esm.js +139 -0
  25. package/dist/backCameraStream-DMdMeGk2.esm.js +346 -0
  26. package/dist/browserSimulation-gxD8cSpM.esm.js +20 -0
  27. package/dist/camera-DBSxa6ML.d.ts +4 -0
  28. package/dist/camera-PA2Ljri3.esm.js +22 -0
  29. package/dist/camera.d.ts +15 -0
  30. package/dist/camera.esm.js +5 -0
  31. package/dist/chunk-CRF6K_H_.esm.js +49 -0
  32. package/dist/consent.d.ts +398 -0
  33. package/dist/consent.esm.js +79 -0
  34. package/dist/consentStateMachine-CCT-B60O.esm.js +151 -0
  35. package/dist/cpf-PPz2Njto.esm.js +38 -0
  36. package/dist/cpf-ocr.d.ts +204 -0
  37. package/dist/cpf-ocr.esm.js +177 -0
  38. package/dist/cross-document-data-match.d.ts +34 -0
  39. package/dist/cross-document-data-match.esm.js +71 -0
  40. package/dist/curp-validation.d.ts +188 -0
  41. package/dist/curp-validation.esm.js +110 -0
  42. package/dist/curpValidationStateMachine-CitWLr2c.esm.js +595 -0
  43. package/dist/custom-fields.d.ts +115 -0
  44. package/dist/custom-fields.esm.js +177 -0
  45. package/dist/custom-watchlist.d.ts +66 -0
  46. package/dist/custom-watchlist.esm.js +86 -0
  47. package/dist/dateUtils-UoN5xswP.esm.js +23 -0
  48. package/dist/deepsightLoader-Cm4JIT_z.esm.js +52 -0
  49. package/dist/deepsightService-CEVxzehb.d.ts +412 -0
  50. package/dist/deepsightService-O74l4Y__.esm.js +489 -0
  51. package/dist/device.d.ts +46 -0
  52. package/dist/device.esm.js +106 -0
  53. package/dist/displayErrors-DqJ_IbsG.d.ts +39 -0
  54. package/dist/document-capture.d.ts +906 -0
  55. package/dist/document-capture.esm.js +156 -0
  56. package/dist/document-upload.d.ts +331 -0
  57. package/dist/document-upload.esm.js +203 -0
  58. package/dist/documentCaptureStateMachine-BqzTDy9k.esm.js +394 -0
  59. package/dist/dynamic-forms.d.ts +178 -0
  60. package/dist/dynamic-forms.esm.js +323 -0
  61. package/dist/ekyb.d.ts +148 -0
  62. package/dist/ekyb.esm.js +127 -0
  63. package/dist/ekybStateMachine-BR2let5f.esm.js +674 -0
  64. package/dist/ekyc.d.ts +164 -0
  65. package/dist/ekyc.esm.js +104 -0
  66. package/dist/ekycStateMachine-oeO0Iekd.esm.js +10626 -0
  67. package/dist/electronic-signature.d.ts +4 -0
  68. package/dist/electronic-signature.esm.js +7 -0
  69. package/dist/electronicSignatureManager-D9OHzTpG.esm.js +428 -0
  70. package/dist/email.d.ts +4 -0
  71. package/dist/email.esm.js +9 -0
  72. package/dist/emailManager-DIfnS5g1.d.ts +352 -0
  73. package/dist/emailManager-wAV0LE-H.esm.js +238 -0
  74. package/dist/emailStateMachine-DOf4j58N.esm.js +292 -0
  75. package/dist/endpoints-CnN3SyDa.esm.js +87 -0
  76. package/dist/events-D6-e4vok.esm.js +596 -0
  77. package/dist/events.d.ts +265 -0
  78. package/dist/events.esm.js +4 -0
  79. package/dist/extensibility.d.ts +122 -0
  80. package/dist/extensibility.esm.js +43 -0
  81. package/dist/face-match.d.ts +228 -0
  82. package/dist/face-match.esm.js +173 -0
  83. package/dist/faceCaptureManagerFactory-Dh2PdGlF.esm.js +290 -0
  84. package/dist/faceCaptureManagerFactory-yqtpxjnN.d.ts +690 -0
  85. package/dist/faceCaptureSetup-B3faSpYA.esm.js +873 -0
  86. package/dist/faceMatchStateMachine-DNFrxTFS.esm.js +127 -0
  87. package/dist/flow-events.d.ts +6 -0
  88. package/dist/flow-events.esm.js +0 -0
  89. package/dist/flow.d.ts +358 -0
  90. package/dist/flow.esm.js +825 -0
  91. package/dist/flowCompletionService-DhkT4SRY.d.ts +10 -0
  92. package/dist/flowCompletionService-P54yzGvA.esm.js +13 -0
  93. package/dist/flowServices-DG3IdWw6.esm.js +188 -0
  94. package/dist/geolocation.d.ts +127 -0
  95. package/dist/geolocation.esm.js +89 -0
  96. package/dist/geolocationStateMachine-asasuHY2.esm.js +105 -0
  97. package/dist/getBrowser-BSXUTWXw.esm.js +41 -0
  98. package/dist/getDeviceClass-BSntT9_j.esm.js +14 -0
  99. package/dist/government-validation.d.ts +67 -0
  100. package/dist/government-validation.esm.js +81 -0
  101. package/dist/governmentValidationStateMachine-BDDYrJTo.esm.js +271 -0
  102. package/dist/home.d.ts +99 -0
  103. package/dist/home.esm.js +61 -0
  104. package/dist/http.d.ts +68 -0
  105. package/dist/http.esm.js +3 -0
  106. package/dist/id-ocr.d.ts +635 -0
  107. package/dist/id-ocr.esm.js +86 -0
  108. package/dist/id-verification.d.ts +190 -0
  109. package/dist/id-verification.esm.js +43 -0
  110. package/dist/id.d.ts +24 -0
  111. package/dist/id.esm.js +164 -0
  112. package/dist/idCaptureManager-Fyd0eam-.d.ts +958 -0
  113. package/dist/idCaptureManager-ZPkD7Gjk.esm.js +581 -0
  114. package/dist/idCaptureStateMachine-BK0bPHoc.esm.js +2963 -0
  115. package/dist/idOcrStateMachine-YbjjC_Gg.esm.js +388 -0
  116. package/dist/idVerificationStateMachine-xbw9HP1Z.esm.js +71 -0
  117. package/dist/identity-reuse.d.ts +530 -0
  118. package/dist/identity-reuse.esm.js +274 -0
  119. package/dist/index-BcRG8rtJ.d.ts +97 -0
  120. package/dist/index-DZoqeAo9.d.ts +1177 -0
  121. package/dist/index.d.ts +3 -0
  122. package/dist/index.esm.js +12 -0
  123. package/dist/invokeOnCaptureCallback-rc6kBHo5.esm.js +30 -0
  124. package/dist/lib-BB0B_qQX.esm.js +12499 -0
  125. package/dist/mandatory-consent.d.ts +412 -0
  126. package/dist/mandatory-consent.esm.js +78 -0
  127. package/dist/mandatoryConsentStateMachine-Cnco1jvn.esm.js +126 -0
  128. package/dist/openviduLazy-Cm0XFh_v.esm.js +3 -0
  129. package/dist/openviduLazy-Cok70ZSg.esm.js +12 -0
  130. package/dist/permissionServices-D_i6nzEw.esm.js +50 -0
  131. package/dist/phone.d.ts +4 -0
  132. package/dist/phone.esm.js +9 -0
  133. package/dist/phoneManager-B6M30hKE.d.ts +397 -0
  134. package/dist/phoneManager-DAJbGhlY.esm.js +256 -0
  135. package/dist/phoneStateMachine-CuPARRaT.esm.js +351 -0
  136. package/dist/platform-CfrjKhmi.esm.js +83 -0
  137. package/dist/qe-signature-DFo_Cc-I.esm.js +12 -0
  138. package/dist/qe-signature.d.ts +25 -0
  139. package/dist/qe-signature.esm.js +8 -0
  140. package/dist/recordingService-Ig2UgbLv.esm.js +1003 -0
  141. package/dist/redirect-to-mobile.d.ts +107 -0
  142. package/dist/redirect-to-mobile.esm.js +102 -0
  143. package/dist/redirectToMobileStateMachine-BOEqe46A.esm.js +249 -0
  144. package/dist/runChildModule-CqqwqAkW.esm.js +219 -0
  145. package/dist/selfie.d.ts +26 -0
  146. package/dist/selfie.esm.js +146 -0
  147. package/dist/selfieManager-D0lSgd-J.d.ts +68 -0
  148. package/dist/selfieManager-Duisl7qN.esm.js +60 -0
  149. package/dist/selfieStateMachine-D76whWEf.esm.js +68 -0
  150. package/dist/session-CGtQJJzB.esm.js +3206 -0
  151. package/dist/session.d.ts +217 -0
  152. package/dist/session.esm.js +9 -0
  153. package/dist/setup-C5AITV8m.d.ts +254 -0
  154. package/dist/setup-DsM8IG7k.esm.js +887 -0
  155. package/dist/signature.d.ts +94 -0
  156. package/dist/signature.esm.js +66 -0
  157. package/dist/signatureStateMachine-B5-QVUve.esm.js +132 -0
  158. package/dist/stats-CIfiPzb1.esm.js +16 -0
  159. package/dist/stats.d.ts +16 -0
  160. package/dist/stats.esm.js +4 -0
  161. package/dist/trust-graph.d.ts +54 -0
  162. package/dist/trust-graph.esm.js +56 -0
  163. package/dist/types-B06Ypu2F.d.ts +49 -0
  164. package/dist/types-BP1m8VRw.d.ts +340 -0
  165. package/dist/types-CAD4va6a.d.ts +5 -0
  166. package/dist/types-CFV9G_7j.d.ts +24 -0
  167. package/dist/warmup-CEcppFiS.d.ts +63 -0
  168. package/dist/wasm.d.ts +15 -0
  169. package/dist/wasm.esm.js +12 -0
  170. package/dist/watchlist-for-business.d.ts +79 -0
  171. package/dist/watchlist-for-business.esm.js +148 -0
  172. package/dist/watchlist.d.ts +62 -0
  173. package/dist/watchlist.esm.js +86 -0
  174. package/dist/watchlistServices-DMbUhkBX.esm.js +12 -0
  175. package/dist/workflow.d.ts +907 -0
  176. package/dist/workflow.esm.js +702 -0
  177. package/dist/xstate.esm-B70JrNqo.esm.js +3404 -0
  178. package/package.json +1 -1
@@ -0,0 +1,274 @@
1
+ import { t as api } from "./api-CESGtpbH.esm.js";
2
+ import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-D6-e4vok.esm.js";
3
+ import { t as endpoints } from "./endpoints-CnN3SyDa.esm.js";
4
+ import { a as fromPromise, c as createManager, r as assign, s as createActor, t as setup } from "./xstate.esm-B70JrNqo.esm.js";
5
+
6
+ //#region src/modules/identity-reuse/identityReuseServices.ts
7
+ /** Fetches candidate organizations for identity reuse. Throws on failure. */
8
+ async function fetchCandidates(signal) {
9
+ const res = await api.get(endpoints.identityReuseCandidates, { signal });
10
+ if (!res.ok) throw new Error(`GET ${endpoints.identityReuseCandidates} failed: ${res.status} ${res.statusText} — ${JSON.stringify(res.data)}`);
11
+ return res.data;
12
+ }
13
+ /** Submits the final reuse decision. Throws on failure. */
14
+ async function submitDecision(params, signal) {
15
+ const res = await api.post(endpoints.identityReuseSubmit, params, { signal });
16
+ if (!res.ok) throw new Error(`POST ${endpoints.identityReuseSubmit} failed: ${res.status} ${res.statusText} — ${JSON.stringify(res.data)}`);
17
+ return res.data;
18
+ }
19
+
20
+ //#endregion
21
+ //#region src/modules/identity-reuse/identityReuseStateMachine.ts
22
+ const identityReuseMachine = setup({
23
+ types: {
24
+ context: {},
25
+ events: {},
26
+ input: {}
27
+ },
28
+ actors: {
29
+ fetchCandidates: fromPromise(async ({ signal }) => {
30
+ return fetchCandidates(signal);
31
+ }),
32
+ submitContinue: fromPromise(async ({ signal }) => {
33
+ return submitDecision({ accepted: true }, signal);
34
+ }),
35
+ submitSkip: fromPromise(async ({ signal }) => {
36
+ return submitDecision({ accepted: false }, signal);
37
+ })
38
+ },
39
+ actions: {
40
+ setCandidates: assign(({ event }) => {
41
+ const output = event.output;
42
+ return {
43
+ currentOrganizationName: output.currentOrganizationName,
44
+ candidateOrganizationNames: output.candidateOrganizationNames
45
+ };
46
+ }),
47
+ setSelectedCandidate: assign(({ event }) => {
48
+ return { selectedOrganizationName: event.organizationName };
49
+ }),
50
+ autoSelectSingleCandidate: assign(({ context }) => ({ selectedOrganizationName: context.candidateOrganizationNames[0] })),
51
+ clearSelection: assign({ selectedOrganizationName: () => void 0 }),
52
+ setError: assign(({ event }) => ({ error: String(event.error) })),
53
+ clearError: assign({ error: () => void 0 })
54
+ },
55
+ guards: {
56
+ hasMultipleCandidates: ({ event }) => {
57
+ return event.output.candidateOrganizationNames.length > 1;
58
+ },
59
+ hasOneCandidate: ({ event }) => {
60
+ return event.output.candidateOrganizationNames.length === 1;
61
+ },
62
+ hasChosenCandidate: ({ context }) => context.selectedOrganizationName !== void 0 && context.selectedOrganizationName.length > 0
63
+ }
64
+ }).createMachine({
65
+ id: "identityReuse",
66
+ initial: "idle",
67
+ context: ({ input }) => ({
68
+ config: input.config,
69
+ currentOrganizationName: void 0,
70
+ candidateOrganizationNames: [],
71
+ selectedOrganizationName: void 0,
72
+ error: void 0
73
+ }),
74
+ states: {
75
+ idle: { on: { LOAD: { target: "loading" } } },
76
+ loading: { invoke: {
77
+ id: "fetchCandidates",
78
+ src: "fetchCandidates",
79
+ onDone: [
80
+ {
81
+ target: "multiCandidatesFound",
82
+ guard: "hasMultipleCandidates",
83
+ actions: "setCandidates"
84
+ },
85
+ {
86
+ target: "oneCandidateFound",
87
+ guard: "hasOneCandidate",
88
+ actions: "setCandidates"
89
+ },
90
+ {
91
+ target: "noCandidatesFound",
92
+ actions: "setCandidates"
93
+ }
94
+ ],
95
+ onError: {
96
+ target: "error",
97
+ actions: "setError"
98
+ }
99
+ } },
100
+ multiCandidatesFound: {
101
+ initial: "noCandidateSelected",
102
+ states: {
103
+ noCandidateSelected: { on: { START_SELECTION: { target: "choosingCandidate" } } },
104
+ choosingCandidate: { on: { CANDIDATE_CHOSEN: {
105
+ target: "candidateSelected",
106
+ actions: "setSelectedCandidate"
107
+ } } },
108
+ candidateSelected: { on: { CHANGE_CANDIDATE: {
109
+ target: "choosingCandidate",
110
+ actions: "clearSelection"
111
+ } } }
112
+ },
113
+ on: {
114
+ SUBMIT_CANDIDATE: {
115
+ target: "submitContinue",
116
+ guard: "hasChosenCandidate"
117
+ },
118
+ SKIP: { target: "submitSkip" }
119
+ }
120
+ },
121
+ oneCandidateFound: {
122
+ entry: "autoSelectSingleCandidate",
123
+ on: {
124
+ SUBMIT_CANDIDATE: { target: "submitContinue" },
125
+ SKIP: { target: "submitSkip" }
126
+ }
127
+ },
128
+ noCandidatesFound: { on: { SKIP: { target: "submitSkip" } } },
129
+ submitContinue: { invoke: {
130
+ id: "submitContinue",
131
+ src: "submitContinue",
132
+ onDone: { target: "finished" },
133
+ onError: {
134
+ target: "error",
135
+ actions: "setError"
136
+ }
137
+ } },
138
+ submitSkip: { invoke: {
139
+ id: "submitSkip",
140
+ src: "submitSkip",
141
+ onDone: { target: "finished" },
142
+ onError: {
143
+ target: "error",
144
+ actions: "setError"
145
+ }
146
+ } },
147
+ finished: { type: "final" },
148
+ error: { on: {
149
+ RETRY: {
150
+ target: "loading",
151
+ actions: "clearError"
152
+ },
153
+ SKIP: { target: "submitSkip" }
154
+ } }
155
+ }
156
+ });
157
+
158
+ //#endregion
159
+ //#region src/modules/identity-reuse/identityReuseActor.ts
160
+ /**
161
+ * Creates and starts an IdentityReuse actor.
162
+ *
163
+ * The actor begins in 'idle' state, ready to receive events.
164
+ */
165
+ function createIdentityReuseActor(options) {
166
+ return createActor(identityReuseMachine, { input: { config: options.config } }).start();
167
+ }
168
+
169
+ //#endregion
170
+ //#region src/modules/identity-reuse/identityReuseManager.ts
171
+ function mapState(snapshot) {
172
+ const { context } = snapshot;
173
+ if (snapshot.matches("idle")) return { status: "idle" };
174
+ if (snapshot.matches("loading")) return { status: "loading" };
175
+ if (snapshot.matches("multiCandidatesFound")) {
176
+ let selectionPhase = "noCandidateSelected";
177
+ if (snapshot.matches({ multiCandidatesFound: "candidateSelected" })) selectionPhase = "candidateSelected";
178
+ else if (snapshot.matches({ multiCandidatesFound: "choosingCandidate" })) selectionPhase = "choosingCandidate";
179
+ return {
180
+ status: "multiCandidatesFound",
181
+ currentOrganizationName: context.currentOrganizationName,
182
+ candidateOrganizationNames: context.candidateOrganizationNames,
183
+ selectedOrganizationName: context.selectedOrganizationName,
184
+ selectionPhase
185
+ };
186
+ }
187
+ if (snapshot.matches("oneCandidateFound")) return {
188
+ status: "oneCandidateFound",
189
+ currentOrganizationName: context.currentOrganizationName,
190
+ selectedOrganizationName: context.selectedOrganizationName
191
+ };
192
+ if (snapshot.matches("noCandidatesFound")) return {
193
+ status: "noCandidatesFound",
194
+ currentOrganizationName: context.currentOrganizationName
195
+ };
196
+ if (snapshot.matches("submitContinue")) return { status: "submitContinue" };
197
+ if (snapshot.matches("submitSkip")) return { status: "submitSkip" };
198
+ if (snapshot.matches("finished")) return { status: "finished" };
199
+ if (snapshot.matches("error")) return {
200
+ status: "error",
201
+ error: context.error ?? "An error occurred"
202
+ };
203
+ return { status: "idle" };
204
+ }
205
+ function createApi({ actor, trackElementClicked }) {
206
+ return {
207
+ load() {
208
+ actor.send({ type: "LOAD" });
209
+ },
210
+ startSelection() {
211
+ trackElementClicked?.("startSelection");
212
+ actor.send({ type: "START_SELECTION" });
213
+ },
214
+ chooseCandidate(organizationName) {
215
+ trackElementClicked?.("chooseCandidate");
216
+ actor.send({
217
+ type: "CANDIDATE_CHOSEN",
218
+ organizationName
219
+ });
220
+ },
221
+ changeCandidate() {
222
+ trackElementClicked?.("changeCandidate");
223
+ actor.send({ type: "CHANGE_CANDIDATE" });
224
+ },
225
+ submitCandidate() {
226
+ trackElementClicked?.("submitCandidate");
227
+ actor.send({ type: "SUBMIT_CANDIDATE" });
228
+ },
229
+ skip() {
230
+ trackElementClicked?.("skip");
231
+ actor.send({ type: "SKIP" });
232
+ },
233
+ retry() {
234
+ trackElementClicked?.("retry");
235
+ actor.send({ type: "RETRY" });
236
+ }
237
+ };
238
+ }
239
+ /**
240
+ * Creates an IdentityReuse manager for headless or UI-driven usage.
241
+ *
242
+ * @example Headless usage
243
+ * ```typescript
244
+ * const manager = createIdentityReuseManager({ config: {} });
245
+ * manager.subscribe((state) => {
246
+ * if (state.status === 'oneCandidateFound') manager.submitCandidate();
247
+ * if (state.status === 'finished') console.log('Done!');
248
+ * });
249
+ * manager.load();
250
+ * ```
251
+ */
252
+ function createIdentityReuseManager(options) {
253
+ return createManager({
254
+ actor: createIdentityReuseActor(options),
255
+ mapState,
256
+ createApi,
257
+ instrumentation: createManagerInstrumentation(eventModuleNames.identityReuse)
258
+ });
259
+ }
260
+ /**
261
+ * Creates an IdentityReuse manager from a pre-built actor.
262
+ * Use this when overriding the machine via `.provide()` for custom backends or testing.
263
+ */
264
+ function createIdentityReuseManagerFromActor(actor) {
265
+ return createManager({
266
+ actor,
267
+ mapState,
268
+ createApi,
269
+ instrumentation: createManagerInstrumentation(eventModuleNames.identityReuse)
270
+ });
271
+ }
272
+
273
+ //#endregion
274
+ export { createIdentityReuseManager, createIdentityReuseManagerFromActor, identityReuseMachine };
@@ -0,0 +1,97 @@
1
+ import { n as Flow } from "./types-BP1m8VRw.js";
2
+ import { t as FinishStatus } from "./flowCompletionService-DhkT4SRY.js";
3
+
4
+ //#region src/internal/flow-events/flowEvents.d.ts
5
+ type FlowStartedEvent = {
6
+ type: 'flow.started';
7
+ interviewId?: string;
8
+ timestamp: number;
9
+ };
10
+ type FlowReadyEvent = {
11
+ type: 'flow.ready';
12
+ interviewId?: string;
13
+ flowId?: string;
14
+ payload: {
15
+ flow: Flow;
16
+ steps: string[];
17
+ currentStep?: string;
18
+ currentStepIndex: number;
19
+ };
20
+ timestamp: number;
21
+ };
22
+ type FlowCompletedEvent = {
23
+ type: 'flow.completed';
24
+ interviewId?: string;
25
+ flowId?: string;
26
+ payload?: FinishStatus;
27
+ timestamp: number;
28
+ };
29
+ type FlowErrorEvent = {
30
+ type: 'flow.error';
31
+ interviewId?: string;
32
+ flowId?: string;
33
+ error: string;
34
+ timestamp: number;
35
+ };
36
+ type FlowClosedEvent = {
37
+ type: 'flow.closed';
38
+ interviewId?: string;
39
+ flowId?: string;
40
+ timestamp: number;
41
+ };
42
+ type FlowModuleStartedEvent = {
43
+ type: 'flow.module.started';
44
+ interviewId?: string;
45
+ flowId?: string;
46
+ module: string;
47
+ payload: {
48
+ moduleIndex?: number;
49
+ totalModules?: number;
50
+ };
51
+ timestamp: number;
52
+ };
53
+ type FlowModuleCompletedEvent = {
54
+ type: 'flow.module.completed';
55
+ interviewId?: string;
56
+ flowId?: string;
57
+ module: string;
58
+ payload: {
59
+ moduleIndex?: number;
60
+ totalModules?: number;
61
+ };
62
+ timestamp: number;
63
+ };
64
+ /**
65
+ * Curated flow event for consumers that need stable integration milestones.
66
+ *
67
+ * This local-only stream covers high-level flow state changes such as loading,
68
+ * readiness, module changes, completion, errors, and closure. For raw analytics
69
+ * events such as `screenOpened`, `elementClicked`, and
70
+ * `captureAttemptFinished`, use `Event` from `@incodetech/core/events`.
71
+ */
72
+ type FlowEvent = FlowStartedEvent | FlowReadyEvent | FlowCompletedEvent | FlowErrorEvent | FlowClosedEvent | FlowModuleStartedEvent | FlowModuleCompletedEvent;
73
+ type FlowEventListener = (event: FlowEvent) => void;
74
+ /**
75
+ * Manager API for subscribing to curated flow milestones emitted by that
76
+ * specific manager instance.
77
+ *
78
+ * For raw SDK analytics events such as `screenOpened`, `elementClicked`, and
79
+ * `captureAttemptFinished`, use `subscribeEvent` from `@incodetech/core/events`.
80
+ */
81
+ type FlowEventSubscribable = {
82
+ /**
83
+ * Subscribes to curated flow milestones for this manager instance.
84
+ *
85
+ * Use this local-only stream for product and integration milestones such as
86
+ * `flow.started`, `flow.ready`, `flow.module.started`,
87
+ * `flow.module.completed`, `flow.completed`, and `flow.error`.
88
+ *
89
+ * This stream does not queue events or post to the analytics API.
90
+ *
91
+ * @param listener - Callback function that receives each flow event.
92
+ * @returns Unsubscribe function to remove the listener.
93
+ */
94
+ subscribeFlowEvent(listener: FlowEventListener): () => void;
95
+ };
96
+ //#endregion
97
+ export { FlowEventListener as a, FlowModuleStartedEvent as c, FlowEvent as i, FlowReadyEvent as l, FlowCompletedEvent as n, FlowEventSubscribable as o, FlowErrorEvent as r, FlowModuleCompletedEvent as s, FlowClosedEvent as t, FlowStartedEvent as u };