@incodetech/core 0.0.0-dev-20260409-a38d5e8 → 0.0.0-dev-20260409-089e5c6

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 (137) hide show
  1. package/dist/BrowserStorageProvider-ByxoNfxC.esm.js +55 -0
  2. package/dist/{OpenViduRecordingProvider-Bn2meybK.esm.js → OpenViduRecordingProvider-JatjSE3h.esm.js} +1 -1
  3. package/dist/{WasmUtilProvider-BpZSvZbg.esm.js → WasmUtilProvider-DRh0wrlm.esm.js} +1 -1
  4. package/dist/{addressSearch-DOFI7lwy.esm.js → addressSearch-CDdN30un.esm.js} +4 -4
  5. package/dist/antifraud.d.ts +1 -1
  6. package/dist/antifraud.esm.js +4 -37
  7. package/dist/antifraudStateMachine-C1AgS0nL.esm.js +39 -0
  8. package/dist/authentication.d.ts +11 -11
  9. package/dist/authentication.esm.js +22 -19
  10. package/dist/{authenticationManager-C2mk36yK.d.ts → authenticationManager-DYFYx68i.d.ts} +2 -2
  11. package/dist/authenticationManager-UaO9UTN7.esm.js +67 -0
  12. package/dist/{authenticationManager-C7dL_avf.esm.js → authenticationStateMachine-DWI65EwK.esm.js} +7 -67
  13. package/dist/{backCameraStream-tabTmwDS.esm.js → backCameraStream-BihRmMzc.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 +57 -57
  17. package/dist/consent.esm.js +4 -149
  18. package/dist/consentStateMachine-CpRu2hF0.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-Czzgv2W1.esm.js +419 -0
  24. package/dist/{deepsightLoader-Cj6SyUQ-.esm.js → deepsightLoader-jIgoauFK.esm.js} +10 -10
  25. package/dist/{deepsightService-BjgXl5hs.esm.js → deepsightService-D4mM8yJ2.esm.js} +5 -5
  26. package/dist/{deepsightService-ByD6uIs7.d.ts → deepsightService-DAeakjDd.d.ts} +2 -2
  27. package/dist/device.esm.js +3 -3
  28. package/dist/document-capture.d.ts +75 -73
  29. package/dist/document-capture.esm.js +8 -403
  30. package/dist/document-upload.d.ts +50 -50
  31. package/dist/document-upload.esm.js +7 -7
  32. package/dist/documentCaptureStateMachine-XbpsHzh5.esm.js +403 -0
  33. package/dist/ekyb.d.ts +3 -3
  34. package/dist/ekyb.esm.js +10 -655
  35. package/dist/ekybStateMachine-BDuCae6s.esm.js +653 -0
  36. package/dist/ekyc.d.ts +3 -3
  37. package/dist/ekyc.esm.js +6 -10614
  38. package/dist/ekycStateMachine-BN4KBDYY.esm.js +10615 -0
  39. package/dist/email.d.ts +3 -3
  40. package/dist/email.esm.js +6 -5
  41. package/dist/emailManager-CAeo59lD.esm.js +238 -0
  42. package/dist/{emailManager-CU_hzrsl.d.ts → emailManager-CZYfcu0n.d.ts} +4 -3
  43. package/dist/{emailManager-_9R4vm6g.esm.js → emailStateMachine-Bqwe_sQS.esm.js} +6 -239
  44. package/dist/{events-DlHrOIRc.esm.js → events-CZ2ka3pu.esm.js} +8 -1
  45. package/dist/events.d.ts +1 -0
  46. package/dist/events.esm.js +2 -2
  47. package/dist/extensibility.d.ts +15 -15
  48. package/dist/extensibility.esm.js +33 -26
  49. package/dist/face-match.d.ts +7 -6
  50. package/dist/face-match.esm.js +8 -129
  51. package/dist/faceCaptureManagerFactory-D8zlMTvd.esm.js +117 -0
  52. package/dist/{faceCaptureManagerFactory-Da_-ohdg.d.ts → faceCaptureManagerFactory-DS-6yCya.d.ts} +8 -8
  53. package/dist/{faceCaptureSetup-CaVWkjvE.esm.js → faceCaptureSetup-1M6uUEjK.esm.js} +5 -119
  54. package/dist/faceMatchStateMachine-D3DuP_ya.esm.js +127 -0
  55. package/dist/flow.d.ts +8 -13
  56. package/dist/flow.esm.js +10 -29
  57. package/dist/{flowCompletionService-B5JemmC6.esm.js → flowCompletionService-W6bj7Xd3.esm.js} +2 -2
  58. package/dist/{flowServices-p22wrYPf.esm.js → flowServices-C4tjBD8q.esm.js} +3 -3
  59. package/dist/geolocation.d.ts +7 -6
  60. package/dist/geolocation.esm.js +7 -105
  61. package/dist/geolocationStateMachine-Bj2LkGwy.esm.js +105 -0
  62. package/dist/{getDeviceClass-DEzz4cmY.esm.js → getDeviceClass-BoiWvKAc.esm.js} +1 -1
  63. package/dist/government-validation.d.ts +2 -2
  64. package/dist/government-validation.esm.js +5 -269
  65. package/dist/governmentValidationStateMachine-W1CzRjVw.esm.js +271 -0
  66. package/dist/http.esm.js +1 -1
  67. package/dist/id.d.ts +10 -10
  68. package/dist/id.esm.js +22 -20
  69. package/dist/idCaptureManager-BcS8fgW4.esm.js +335 -0
  70. package/dist/{idCaptureManager-CV08v1e3.d.ts → idCaptureManager-oR6YPYHj.d.ts} +7 -7
  71. package/dist/{idCaptureManager-dyZzKv8L.esm.js → idCaptureStateMachine-MAzfM_2O.esm.js} +17 -346
  72. package/dist/identity-reuse.d.ts +530 -0
  73. package/dist/identity-reuse.esm.js +273 -0
  74. package/dist/index.d.ts +2 -2
  75. package/dist/index.esm.js +8 -8
  76. package/dist/{lib-Bavz2qmt.esm.js → lib-CxDxnzRd.esm.js} +1 -1
  77. package/dist/mandatory-consent.d.ts +55 -55
  78. package/dist/mandatory-consent.esm.js +4 -124
  79. package/dist/mandatoryConsentStateMachine-BMKi26Re.esm.js +126 -0
  80. package/dist/{openviduLazy-vhrVZCr_.esm.js → openviduLazy-B8tinh9W.esm.js} +2 -2
  81. package/dist/openviduLazy-CItjpMfL.esm.js +3 -0
  82. package/dist/{permissionServices-Cskq32Yd.esm.js → permissionServices-Cj120WaT.esm.js} +2 -2
  83. package/dist/phone.d.ts +3 -3
  84. package/dist/phone.esm.js +6 -5
  85. package/dist/phoneManager-Bvj6Jr4o.esm.js +258 -0
  86. package/dist/{phoneManager-ulJuGvJ8.d.ts → phoneManager-CCMCkyYr.d.ts} +2 -2
  87. package/dist/{phoneManager-DerdUfd4.esm.js → phoneStateMachine-B1t1Z-Dd.esm.js} +5 -258
  88. package/dist/{recordingService-483wQ6kR.esm.js → recordingService-8I_-hhNI.esm.js} +14 -68
  89. package/dist/redirect-to-mobile.d.ts +2 -2
  90. package/dist/redirect-to-mobile.esm.js +5 -247
  91. package/dist/redirectToMobileStateMachine-BVP1KcoO.esm.js +249 -0
  92. package/dist/runChildModule-B5DEiOS7.esm.js +27 -0
  93. package/dist/selfie.d.ts +11 -11
  94. package/dist/selfie.esm.js +22 -19
  95. package/dist/selfieManager-B6x3O5Ns.esm.js +60 -0
  96. package/dist/{selfieManager-DCRP7X75.d.ts → selfieManager-gizt3Zha.d.ts} +2 -2
  97. package/dist/selfieStateMachine-DHPSBFj0.esm.js +56 -0
  98. package/dist/{session-CUh77zj3.esm.js → session-DoI-X9FK.esm.js} +4 -4
  99. package/dist/session.d.ts +1 -1
  100. package/dist/session.esm.js +6 -6
  101. package/dist/{setup-XpxfZgKn.esm.js → setup-Bh2S53NT.esm.js} +6 -5
  102. package/dist/{setup-DpHakxsC.d.ts → setup-Bz3Ffaoc.d.ts} +1 -1
  103. package/dist/signature.d.ts +4 -3
  104. package/dist/signature.esm.js +6 -189
  105. package/dist/signatureStateMachine-Cv7yPuEf.esm.js +189 -0
  106. package/dist/{stats-DHDoqSBV.esm.js → stats-wkQyDFV3.esm.js} +1 -1
  107. package/dist/stats.esm.js +2 -2
  108. package/dist/types-BdEM5Jj7.d.ts +35 -0
  109. package/dist/{types-2OPf1pyv.d.ts → types-CdlQrTiZ.d.ts} +1 -1
  110. package/dist/{types-CVJVQ7fp.d.ts → types-m43DfiSx.d.ts} +1 -1
  111. package/dist/wasm.d.ts +2 -2
  112. package/dist/wasm.esm.js +8 -8
  113. package/dist/workflow.d.ts +813 -0
  114. package/dist/workflow.esm.js +600 -0
  115. package/package.json +11 -3
  116. package/dist/openviduLazy-BIPHozOu.esm.js +0 -3
  117. package/dist/selfieManager-DeOcNel4.esm.js +0 -110
  118. /package/dist/{Actor-Ba71-_30.d.ts → Actor-BkPcZGke.d.ts} +0 -0
  119. /package/dist/{BaseWasmProvider-D-s_6M5H.esm.js → BaseWasmProvider-C73c2nV9.esm.js} +0 -0
  120. /package/dist/{BrowserEnvironmentProvider-DaHeLJQw.esm.js → BrowserEnvironmentProvider-lxn4oxXn.esm.js} +0 -0
  121. /package/dist/{BrowserTimerProvider-BhD2MlHg.esm.js → BrowserTimerProvider-CSdm7__S.esm.js} +0 -0
  122. /package/dist/{ITimerCapability-oixwa6nj.esm.js → ITimerCapability-DAIaq369.esm.js} +0 -0
  123. /package/dist/{Manager-BN2g_I8W.d.ts → Manager-Bcnemkyi.d.ts} +0 -0
  124. /package/dist/{MotionSensorProvider-CodM3e0E.esm.js → MotionSensorProvider-BLnFo6My.esm.js} +0 -0
  125. /package/dist/{StateMachine-BoJsfMvg.d.ts → StateMachine-DIeoDJ7r.d.ts} +0 -0
  126. /package/dist/{api-DzpnV6O7.esm.js → api-CqKwkjJ3.esm.js} +0 -0
  127. /package/dist/{browserSimulation-B4ubb2OL.esm.js → browserSimulation-7W5-A3RV.esm.js} +0 -0
  128. /package/dist/{camera-DmkFpf5N.esm.js → camera-B-5traWf.esm.js} +0 -0
  129. /package/dist/{camera-1eeGnAaL.d.ts → camera-CgnuDuxy.d.ts} +0 -0
  130. /package/dist/{chunk-DsxENsBR.esm.js → chunk-Qw4qVmMx.esm.js} +0 -0
  131. /package/dist/{displayErrors-BZLX7idb.d.ts → displayErrors-C9-VaqmS.d.ts} +0 -0
  132. /package/dist/{flowCompletionService-D-3YCHyO.d.ts → flowCompletionService-CPLdZxe-.d.ts} +0 -0
  133. /package/dist/{getBrowser-Dtyt9J_h.esm.js → getBrowser-DJkbzQ5t.esm.js} +0 -0
  134. /package/dist/{platform-Dv7a2fv-.esm.js → platform-BfoqeM61.esm.js} +0 -0
  135. /package/dist/{types-D_QfFKxT.d.ts → types-CxU9jTRl.d.ts} +0 -0
  136. /package/dist/{warmup-CIj_wEV_.d.ts → warmup-Cs0uqxUW.d.ts} +0 -0
  137. /package/dist/{xstate.esm-Bv55-lJ4.esm.js → xstate.esm-D7D6CGwY.esm.js} +0 -0
@@ -0,0 +1,530 @@
1
+ import { t as Manager } from "./Manager-Bcnemkyi.js";
2
+ import { t as ActorRefFrom } from "./Actor-BkPcZGke.js";
3
+ import * as xstate603 from "xstate";
4
+
5
+ //#region src/modules/identity-reuse/types.d.ts
6
+
7
+ /**
8
+ * Configuration options for the IdentityReuse module.
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * const config: IdentityReuseConfig = {};
13
+ * ```
14
+ */
15
+ type IdentityReuseConfig = {};
16
+ /** @internal Response from GET /omni/identity-reuse/candidates */
17
+ type FetchCandidatesResponse = {
18
+ currentOrganizationName: string;
19
+ candidateOrganizationNames: string[];
20
+ };
21
+ /** @internal Response from POST /omni/identity-reuse/submit — shape TBD */
22
+ type SubmitResponse = {};
23
+ //#endregion
24
+ //#region src/modules/identity-reuse/identityReuseStateMachine.d.ts
25
+ type IdentityReuseContext = {
26
+ config: IdentityReuseConfig;
27
+ currentOrganizationName: string | undefined;
28
+ candidateOrganizationNames: string[];
29
+ selectedOrganizationName: string | undefined;
30
+ error: string | undefined;
31
+ };
32
+ type IdentityReuseInput = {
33
+ config: IdentityReuseConfig;
34
+ };
35
+ declare const identityReuseMachine: xstate603.StateMachine<IdentityReuseContext, {
36
+ type: "LOAD";
37
+ } | {
38
+ type: "START_SELECTION";
39
+ } | {
40
+ type: "CANDIDATE_CHOSEN";
41
+ organizationName: string;
42
+ } | {
43
+ type: "CHANGE_CANDIDATE";
44
+ } | {
45
+ type: "SUBMIT_CANDIDATE";
46
+ } | {
47
+ type: "SKIP";
48
+ } | {
49
+ type: "RETRY";
50
+ }, {
51
+ [x: string]: xstate603.ActorRefFromLogic<xstate603.PromiseActorLogic<FetchCandidatesResponse, void, xstate603.EventObject>> | xstate603.ActorRefFromLogic<xstate603.PromiseActorLogic<SubmitResponse, void, xstate603.EventObject>> | undefined;
52
+ }, xstate603.Values<{
53
+ fetchCandidates: {
54
+ src: "fetchCandidates";
55
+ logic: xstate603.PromiseActorLogic<FetchCandidatesResponse, void, xstate603.EventObject>;
56
+ id: string | undefined;
57
+ };
58
+ submitContinue: {
59
+ src: "submitContinue";
60
+ logic: xstate603.PromiseActorLogic<SubmitResponse, void, xstate603.EventObject>;
61
+ id: string | undefined;
62
+ };
63
+ submitSkip: {
64
+ src: "submitSkip";
65
+ logic: xstate603.PromiseActorLogic<SubmitResponse, void, xstate603.EventObject>;
66
+ id: string | undefined;
67
+ };
68
+ }>, xstate603.Values<{
69
+ clearError: {
70
+ type: "clearError";
71
+ params: xstate603.NonReducibleUnknown;
72
+ };
73
+ setError: {
74
+ type: "setError";
75
+ params: xstate603.NonReducibleUnknown;
76
+ };
77
+ setCandidates: {
78
+ type: "setCandidates";
79
+ params: xstate603.NonReducibleUnknown;
80
+ };
81
+ setSelectedCandidate: {
82
+ type: "setSelectedCandidate";
83
+ params: xstate603.NonReducibleUnknown;
84
+ };
85
+ autoSelectSingleCandidate: {
86
+ type: "autoSelectSingleCandidate";
87
+ params: xstate603.NonReducibleUnknown;
88
+ };
89
+ clearSelection: {
90
+ type: "clearSelection";
91
+ params: xstate603.NonReducibleUnknown;
92
+ };
93
+ }>, xstate603.Values<{
94
+ hasMultipleCandidates: {
95
+ type: "hasMultipleCandidates";
96
+ params: unknown;
97
+ };
98
+ hasOneCandidate: {
99
+ type: "hasOneCandidate";
100
+ params: unknown;
101
+ };
102
+ hasChosenCandidate: {
103
+ type: "hasChosenCandidate";
104
+ params: unknown;
105
+ };
106
+ }>, never, "error" | "finished" | "idle" | "loading" | "submitContinue" | "submitSkip" | "oneCandidateFound" | "noCandidatesFound" | {
107
+ multiCandidatesFound: "noCandidateSelected" | "choosingCandidate" | "candidateSelected";
108
+ }, string, IdentityReuseInput, xstate603.NonReducibleUnknown, xstate603.EventObject, xstate603.MetaObject, {
109
+ readonly id: "identityReuse";
110
+ readonly initial: "idle";
111
+ readonly context: ({
112
+ input
113
+ }: {
114
+ spawn: {
115
+ <TSrc extends "fetchCandidates" | "submitContinue" | "submitSkip">(logic: TSrc, ...[options]: ({
116
+ src: "fetchCandidates";
117
+ logic: xstate603.PromiseActorLogic<FetchCandidatesResponse, void, xstate603.EventObject>;
118
+ id: string | undefined;
119
+ } extends infer T ? T extends {
120
+ src: "fetchCandidates";
121
+ logic: xstate603.PromiseActorLogic<FetchCandidatesResponse, void, xstate603.EventObject>;
122
+ id: string | undefined;
123
+ } ? T extends {
124
+ src: TSrc;
125
+ } ? xstate603.ConditionalRequired<[options?: ({
126
+ id?: T["id"] | undefined;
127
+ systemId?: string;
128
+ input?: xstate603.InputFrom<T["logic"]> | undefined;
129
+ syncSnapshot?: boolean;
130
+ } & { [K in xstate603.RequiredActorOptions<T>]: unknown }) | undefined], xstate603.IsNotNever<xstate603.RequiredActorOptions<T>>> : never : never : never) | ({
131
+ src: "submitContinue";
132
+ logic: xstate603.PromiseActorLogic<SubmitResponse, void, xstate603.EventObject>;
133
+ id: string | undefined;
134
+ } extends infer T_1 ? T_1 extends {
135
+ src: "submitContinue";
136
+ logic: xstate603.PromiseActorLogic<SubmitResponse, void, xstate603.EventObject>;
137
+ id: string | undefined;
138
+ } ? T_1 extends {
139
+ src: TSrc;
140
+ } ? xstate603.ConditionalRequired<[options?: ({
141
+ id?: T_1["id"] | undefined;
142
+ systemId?: string;
143
+ input?: xstate603.InputFrom<T_1["logic"]> | undefined;
144
+ syncSnapshot?: boolean;
145
+ } & { [K_1 in xstate603.RequiredActorOptions<T_1>]: unknown }) | undefined], xstate603.IsNotNever<xstate603.RequiredActorOptions<T_1>>> : never : never : never) | ({
146
+ src: "submitSkip";
147
+ logic: xstate603.PromiseActorLogic<SubmitResponse, void, xstate603.EventObject>;
148
+ id: string | undefined;
149
+ } extends infer T_2 ? T_2 extends {
150
+ src: "submitSkip";
151
+ logic: xstate603.PromiseActorLogic<SubmitResponse, void, xstate603.EventObject>;
152
+ id: string | undefined;
153
+ } ? T_2 extends {
154
+ src: TSrc;
155
+ } ? xstate603.ConditionalRequired<[options?: ({
156
+ id?: T_2["id"] | undefined;
157
+ systemId?: string;
158
+ input?: xstate603.InputFrom<T_2["logic"]> | undefined;
159
+ syncSnapshot?: boolean;
160
+ } & { [K_2 in xstate603.RequiredActorOptions<T_2>]: unknown }) | undefined], xstate603.IsNotNever<xstate603.RequiredActorOptions<T_2>>> : never : never : never)): xstate603.ActorRefFromLogic<xstate603.GetConcreteByKey<xstate603.Values<{
161
+ fetchCandidates: {
162
+ src: "fetchCandidates";
163
+ logic: xstate603.PromiseActorLogic<FetchCandidatesResponse, void, xstate603.EventObject>;
164
+ id: string | undefined;
165
+ };
166
+ submitContinue: {
167
+ src: "submitContinue";
168
+ logic: xstate603.PromiseActorLogic<SubmitResponse, void, xstate603.EventObject>;
169
+ id: string | undefined;
170
+ };
171
+ submitSkip: {
172
+ src: "submitSkip";
173
+ logic: xstate603.PromiseActorLogic<SubmitResponse, void, xstate603.EventObject>;
174
+ id: string | undefined;
175
+ };
176
+ }>, "src", TSrc>["logic"]>;
177
+ <TLogic extends xstate603.AnyActorLogic>(src: TLogic, ...[options]: xstate603.ConditionalRequired<[options?: ({
178
+ id?: never;
179
+ systemId?: string;
180
+ input?: xstate603.InputFrom<TLogic> | undefined;
181
+ syncSnapshot?: boolean;
182
+ } & { [K in xstate603.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate603.IsNotNever<xstate603.RequiredLogicInput<TLogic>>>): xstate603.ActorRefFromLogic<TLogic>;
183
+ };
184
+ input: IdentityReuseInput;
185
+ self: xstate603.ActorRef<xstate603.MachineSnapshot<IdentityReuseContext, {
186
+ type: "LOAD";
187
+ } | {
188
+ type: "START_SELECTION";
189
+ } | {
190
+ type: "CANDIDATE_CHOSEN";
191
+ organizationName: string;
192
+ } | {
193
+ type: "CHANGE_CANDIDATE";
194
+ } | {
195
+ type: "SUBMIT_CANDIDATE";
196
+ } | {
197
+ type: "SKIP";
198
+ } | {
199
+ type: "RETRY";
200
+ }, Record<string, xstate603.AnyActorRef | undefined>, xstate603.StateValue, string, unknown, any, any>, {
201
+ type: "LOAD";
202
+ } | {
203
+ type: "START_SELECTION";
204
+ } | {
205
+ type: "CANDIDATE_CHOSEN";
206
+ organizationName: string;
207
+ } | {
208
+ type: "CHANGE_CANDIDATE";
209
+ } | {
210
+ type: "SUBMIT_CANDIDATE";
211
+ } | {
212
+ type: "SKIP";
213
+ } | {
214
+ type: "RETRY";
215
+ }, xstate603.AnyEventObject>;
216
+ }) => {
217
+ config: IdentityReuseConfig;
218
+ currentOrganizationName: undefined;
219
+ candidateOrganizationNames: never[];
220
+ selectedOrganizationName: undefined;
221
+ error: undefined;
222
+ };
223
+ readonly states: {
224
+ readonly idle: {
225
+ readonly on: {
226
+ readonly LOAD: {
227
+ readonly target: "loading";
228
+ };
229
+ };
230
+ };
231
+ readonly loading: {
232
+ readonly invoke: {
233
+ readonly id: "fetchCandidates";
234
+ readonly src: "fetchCandidates";
235
+ readonly onDone: readonly [{
236
+ readonly target: "multiCandidatesFound";
237
+ readonly guard: "hasMultipleCandidates";
238
+ readonly actions: "setCandidates";
239
+ }, {
240
+ readonly target: "oneCandidateFound";
241
+ readonly guard: "hasOneCandidate";
242
+ readonly actions: "setCandidates";
243
+ }, {
244
+ readonly target: "noCandidatesFound";
245
+ readonly actions: "setCandidates";
246
+ }];
247
+ readonly onError: {
248
+ readonly target: "error";
249
+ readonly actions: "setError";
250
+ };
251
+ };
252
+ };
253
+ readonly multiCandidatesFound: {
254
+ readonly initial: "noCandidateSelected";
255
+ readonly states: {
256
+ readonly noCandidateSelected: {
257
+ readonly on: {
258
+ readonly START_SELECTION: {
259
+ readonly target: "choosingCandidate";
260
+ };
261
+ };
262
+ };
263
+ readonly choosingCandidate: {
264
+ readonly on: {
265
+ readonly CANDIDATE_CHOSEN: {
266
+ readonly target: "candidateSelected";
267
+ readonly actions: "setSelectedCandidate";
268
+ };
269
+ };
270
+ };
271
+ readonly candidateSelected: {
272
+ readonly on: {
273
+ readonly CHANGE_CANDIDATE: {
274
+ readonly target: "choosingCandidate";
275
+ readonly actions: "clearSelection";
276
+ };
277
+ };
278
+ };
279
+ };
280
+ readonly on: {
281
+ readonly SUBMIT_CANDIDATE: {
282
+ readonly target: "submitContinue";
283
+ readonly guard: "hasChosenCandidate";
284
+ };
285
+ readonly SKIP: {
286
+ readonly target: "submitSkip";
287
+ };
288
+ };
289
+ };
290
+ readonly oneCandidateFound: {
291
+ readonly entry: "autoSelectSingleCandidate";
292
+ readonly on: {
293
+ readonly SUBMIT_CANDIDATE: {
294
+ readonly target: "submitContinue";
295
+ };
296
+ readonly SKIP: {
297
+ readonly target: "submitSkip";
298
+ };
299
+ };
300
+ };
301
+ readonly noCandidatesFound: {
302
+ readonly on: {
303
+ readonly SKIP: {
304
+ readonly target: "submitSkip";
305
+ };
306
+ };
307
+ };
308
+ readonly submitContinue: {
309
+ readonly invoke: {
310
+ readonly id: "submitContinue";
311
+ readonly src: "submitContinue";
312
+ readonly onDone: {
313
+ readonly target: "finished";
314
+ };
315
+ readonly onError: {
316
+ readonly target: "error";
317
+ readonly actions: "setError";
318
+ };
319
+ };
320
+ };
321
+ readonly submitSkip: {
322
+ readonly invoke: {
323
+ readonly id: "submitSkip";
324
+ readonly src: "submitSkip";
325
+ readonly onDone: {
326
+ readonly target: "finished";
327
+ };
328
+ readonly onError: {
329
+ readonly target: "error";
330
+ readonly actions: "setError";
331
+ };
332
+ };
333
+ };
334
+ readonly finished: {
335
+ readonly type: "final";
336
+ };
337
+ readonly error: {
338
+ readonly on: {
339
+ readonly RETRY: {
340
+ readonly target: "loading";
341
+ readonly actions: "clearError";
342
+ };
343
+ readonly SKIP: {
344
+ readonly target: "submitSkip";
345
+ };
346
+ };
347
+ };
348
+ };
349
+ }>;
350
+ type IdentityReuseMachine = typeof identityReuseMachine;
351
+ //#endregion
352
+ //#region src/modules/identity-reuse/identityReuseActor.d.ts
353
+ /**
354
+ * Options for creating an IdentityReuse actor.
355
+ */
356
+ type CreateIdentityReuseActorOptions = {
357
+ /** Module configuration */
358
+ config: IdentityReuseConfig;
359
+ };
360
+ /**
361
+ * Type representing a running IdentityReuse actor.
362
+ */
363
+ type IdentityReuseActor = ActorRefFrom<IdentityReuseMachine>;
364
+ //#endregion
365
+ //#region src/modules/identity-reuse/identityReuseManager.d.ts
366
+ type SelectionPhase = 'noCandidateSelected' | 'choosingCandidate' | 'candidateSelected';
367
+ /** IdentityReuse manager is in initial state, waiting for `load()` */
368
+ type IdentityReuseIdleState = {
369
+ status: 'idle';
370
+ };
371
+ /** Fetching candidate organizations from the backend */
372
+ type IdentityReuseLoadingState = {
373
+ status: 'loading';
374
+ };
375
+ /**
376
+ * Multiple candidates available — user must select one
377
+ * @property currentOrganizationName - The organization the user is currently onboarding into
378
+ * @property candidateOrganizationNames - Organizations with reusable identity data
379
+ * @property selectedOrganizationName - The currently chosen candidate, if any
380
+ * @property selectionPhase - Which child state the selection is in
381
+ */
382
+ type IdentityReuseMultiCandidatesState = {
383
+ status: 'multiCandidatesFound';
384
+ currentOrganizationName: string;
385
+ candidateOrganizationNames: string[];
386
+ selectedOrganizationName: string | undefined;
387
+ selectionPhase: SelectionPhase;
388
+ };
389
+ /**
390
+ * Exactly one candidate found — auto-selected on entry
391
+ * @property currentOrganizationName - The organization the user is currently onboarding into
392
+ * @property selectedOrganizationName - The single candidate, auto-selected
393
+ */
394
+ type IdentityReuseOneCandidateState = {
395
+ status: 'oneCandidateFound';
396
+ currentOrganizationName: string;
397
+ selectedOrganizationName: string;
398
+ };
399
+ /**
400
+ * No candidate organizations found
401
+ * @property currentOrganizationName - The organization the user is currently onboarding into
402
+ */
403
+ type IdentityReuseNoCandidatesState = {
404
+ status: 'noCandidatesFound';
405
+ currentOrganizationName: string;
406
+ };
407
+ /** Submitting final decision (reuse: true) */
408
+ type IdentityReuseSubmitContinueState = {
409
+ status: 'submitContinue';
410
+ };
411
+ /** Submitting final decision (reuse: false) */
412
+ type IdentityReuseSubmitSkipState = {
413
+ status: 'submitSkip';
414
+ };
415
+ /** Module completed successfully */
416
+ type IdentityReuseFinishedState = {
417
+ status: 'finished';
418
+ };
419
+ /**
420
+ * A recoverable error occurred — user can retry or skip
421
+ * @property error - Error message describing what went wrong
422
+ */
423
+ type IdentityReuseErrorState = {
424
+ status: 'error';
425
+ error: string;
426
+ };
427
+ /**
428
+ * Union of all possible IdentityReuse manager states.
429
+ *
430
+ * @example
431
+ * ```typescript
432
+ * const state = manager.getState();
433
+ * if (state.status === 'multiCandidatesFound') {
434
+ * console.log(state.candidateOrganizationNames);
435
+ * }
436
+ * ```
437
+ */
438
+ type IdentityReuseState = IdentityReuseIdleState | IdentityReuseLoadingState | IdentityReuseMultiCandidatesState | IdentityReuseOneCandidateState | IdentityReuseNoCandidatesState | IdentityReuseSubmitContinueState | IdentityReuseSubmitSkipState | IdentityReuseFinishedState | IdentityReuseErrorState;
439
+ /**
440
+ * Creates an IdentityReuse manager for headless or UI-driven usage.
441
+ *
442
+ * @example Headless usage
443
+ * ```typescript
444
+ * const manager = createIdentityReuseManager({ config: {} });
445
+ * manager.subscribe((state) => {
446
+ * if (state.status === 'oneCandidateFound') manager.submitCandidate();
447
+ * if (state.status === 'finished') console.log('Done!');
448
+ * });
449
+ * manager.load();
450
+ * ```
451
+ */
452
+ declare function createIdentityReuseManager(options: CreateIdentityReuseActorOptions): Manager<IdentityReuseState> & {
453
+ /**
454
+ * Fetches candidate organizations from the backend.
455
+ * Transitions from 'idle' to 'loading'.
456
+ */
457
+ load(): void;
458
+ /**
459
+ * Begins the candidate selection process.
460
+ * Transitions from 'noCandidateSelected' to 'choosingCandidate'.
461
+ */
462
+ startSelection(): void;
463
+ /**
464
+ * Chooses a candidate organization.
465
+ * Transitions from 'choosingCandidate' to 'candidateSelected'.
466
+ */
467
+ chooseCandidate(organizationName: string): void;
468
+ /**
469
+ * Goes back to choosing a different candidate.
470
+ * Transitions from 'candidateSelected' to 'choosingCandidate'.
471
+ */
472
+ changeCandidate(): void;
473
+ /**
474
+ * Submits the chosen candidate for processing.
475
+ * Guarded by having a chosen candidate.
476
+ */
477
+ submitCandidate(): void;
478
+ /**
479
+ * Skips identity reuse and proceeds with fresh onboarding.
480
+ * Sends /submit with reuse: false.
481
+ */
482
+ skip(): void;
483
+ /**
484
+ * Retries loading candidates after an error.
485
+ */
486
+ retry(): void;
487
+ };
488
+ /**
489
+ * Creates an IdentityReuse manager from a pre-built actor.
490
+ * Use this when overriding the machine via `.provide()` for custom backends or testing.
491
+ */
492
+ declare function createIdentityReuseManagerFromActor(actor: IdentityReuseActor): Manager<IdentityReuseState> & {
493
+ /**
494
+ * Fetches candidate organizations from the backend.
495
+ * Transitions from 'idle' to 'loading'.
496
+ */
497
+ load(): void;
498
+ /**
499
+ * Begins the candidate selection process.
500
+ * Transitions from 'noCandidateSelected' to 'choosingCandidate'.
501
+ */
502
+ startSelection(): void;
503
+ /**
504
+ * Chooses a candidate organization.
505
+ * Transitions from 'choosingCandidate' to 'candidateSelected'.
506
+ */
507
+ chooseCandidate(organizationName: string): void;
508
+ /**
509
+ * Goes back to choosing a different candidate.
510
+ * Transitions from 'candidateSelected' to 'choosingCandidate'.
511
+ */
512
+ changeCandidate(): void;
513
+ /**
514
+ * Submits the chosen candidate for processing.
515
+ * Guarded by having a chosen candidate.
516
+ */
517
+ submitCandidate(): void;
518
+ /**
519
+ * Skips identity reuse and proceeds with fresh onboarding.
520
+ * Sends /submit with reuse: false.
521
+ */
522
+ skip(): void;
523
+ /**
524
+ * Retries loading candidates after an error.
525
+ */
526
+ retry(): void;
527
+ };
528
+ type IdentityReuseManager = ReturnType<typeof createIdentityReuseManager>;
529
+ //#endregion
530
+ export { type FetchCandidatesResponse, type IdentityReuseConfig, type IdentityReuseManager, type IdentityReuseState, type SubmitResponse, createIdentityReuseManager, createIdentityReuseManagerFromActor, identityReuseMachine };