@incodetech/core 0.0.0-dev-20260413-de45fd6 → 0.0.0-dev-20260414-56e3445

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 (138) hide show
  1. package/dist/{OpenViduRecordingProvider-JatjSE3h.esm.js → OpenViduRecordingProvider-D5eKWCUZ.esm.js} +1 -1
  2. package/dist/{WasmUtilProvider-DRh0wrlm.esm.js → WasmUtilProvider-BvXiqQSQ.esm.js} +1 -1
  3. package/dist/{addressSearch-DdrQw-hp.esm.js → addressSearch-C_0wN5KN.esm.js} +4 -4
  4. package/dist/antifraud.d.ts +1 -1
  5. package/dist/antifraud.esm.js +4 -4
  6. package/dist/{antifraudStateMachine-DZKc03yw.esm.js → antifraudStateMachine-WMyzW7FW.esm.js} +3 -3
  7. package/dist/authentication.d.ts +11 -11
  8. package/dist/authentication.esm.js +22 -22
  9. package/dist/{authenticationManager-FnMwzV2u.d.ts → authenticationManager-DrsjKwg6.d.ts} +2 -2
  10. package/dist/{authenticationManager-BAYd8gOR.esm.js → authenticationManager-k9cC-jvW.esm.js} +6 -6
  11. package/dist/{authenticationStateMachine-D12jAEkO.esm.js → authenticationStateMachine-DsePlR1o.esm.js} +6 -6
  12. package/dist/{backCameraStream-BihRmMzc.esm.js → backCameraStream-p9UjczGK.esm.js} +3 -3
  13. package/dist/camera.d.ts +1 -1
  14. package/dist/camera.esm.js +3 -3
  15. package/dist/consent.d.ts +52 -52
  16. package/dist/consent.esm.js +4 -4
  17. package/dist/{consentStateMachine-BPQ4O1Ye.esm.js → consentStateMachine-CKaVliKQ.esm.js} +3 -3
  18. package/dist/cross-document-data-match.d.ts +1 -1
  19. package/dist/cross-document-data-match.esm.js +4 -4
  20. package/dist/curp-validation.d.ts +5 -5
  21. package/dist/curp-validation.esm.js +4 -4
  22. package/dist/{curpValidationStateMachine-DxuEodU2.esm.js → curpValidationStateMachine-TmFjYie1.esm.js} +3 -3
  23. package/dist/{deepsightLoader-jIgoauFK.esm.js → deepsightLoader-B3DY23-5.esm.js} +10 -10
  24. package/dist/{deepsightService-D4mM8yJ2.esm.js → deepsightService-BgvhDdse.esm.js} +5 -5
  25. package/dist/{deepsightService-DAeakjDd.d.ts → deepsightService-Clz07wkf.d.ts} +2 -2
  26. package/dist/device.esm.js +3 -3
  27. package/dist/document-capture.d.ts +79 -79
  28. package/dist/document-capture.esm.js +8 -8
  29. package/dist/document-upload.d.ts +53 -53
  30. package/dist/document-upload.esm.js +7 -7
  31. package/dist/{documentCaptureStateMachine-DLhPQTCu.esm.js → documentCaptureStateMachine-CmUER_Il.esm.js} +5 -5
  32. package/dist/ekyb.d.ts +3 -3
  33. package/dist/ekyb.esm.js +10 -10
  34. package/dist/{ekybStateMachine-M7Upw7fD.esm.js → ekybStateMachine-ENNR09OW.esm.js} +5 -5
  35. package/dist/ekyc.d.ts +3 -3
  36. package/dist/ekyc.esm.js +6 -6
  37. package/dist/{ekycStateMachine-DHyAEUnE.esm.js → ekycStateMachine-BJTwbCcq.esm.js} +4 -4
  38. package/dist/email.d.ts +3 -3
  39. package/dist/email.esm.js +6 -6
  40. package/dist/{emailManager-C8Zbw5xl.esm.js → emailManager-CeOaYSt0.esm.js} +3 -3
  41. package/dist/{emailManager-NVkr3gYf.d.ts → emailManager-mkgZ1sR6.d.ts} +2 -2
  42. package/dist/{emailStateMachine-DSaFON9T.esm.js → emailStateMachine-CQa3EMhA.esm.js} +4 -4
  43. package/dist/{events-BjiB9Q1C.esm.js → events-BSP6Ksh5.esm.js} +3 -1
  44. package/dist/events.d.ts +1 -0
  45. package/dist/events.esm.js +2 -2
  46. package/dist/extensibility.d.ts +15 -15
  47. package/dist/extensibility.esm.js +33 -33
  48. package/dist/face-match.d.ts +1 -1
  49. package/dist/face-match.esm.js +4 -4
  50. package/dist/{faceCaptureManagerFactory-D5WpBtSM.d.ts → faceCaptureManagerFactory-DhKU7cW9.d.ts} +8 -8
  51. package/dist/{faceCaptureManagerFactory-B1-bhK3L.esm.js → faceCaptureManagerFactory-Dr5TSw6i.esm.js} +2 -2
  52. package/dist/{faceCaptureSetup-CnpsYL-c.esm.js → faceCaptureSetup-TT4s3AkW.esm.js} +4 -4
  53. package/dist/{faceMatchStateMachine-DfGqIm8j.esm.js → faceMatchStateMachine-B_CXt9NM.esm.js} +3 -3
  54. package/dist/flow.d.ts +8 -8
  55. package/dist/flow.esm.js +9 -9
  56. package/dist/{flowCompletionService-8Udg-BwW.esm.js → flowCompletionService-CKpuKBHj.esm.js} +2 -2
  57. package/dist/{flowServices-D4yGOYZG.esm.js → flowServices-aa_WK5bT.esm.js} +3 -3
  58. package/dist/geolocation.d.ts +2 -2
  59. package/dist/geolocation.esm.js +5 -5
  60. package/dist/{geolocationStateMachine-NFrAD2gH.esm.js → geolocationStateMachine-_H3mSlsR.esm.js} +4 -4
  61. package/dist/{getDeviceClass-BoiWvKAc.esm.js → getDeviceClass-B1VQriq2.esm.js} +1 -1
  62. package/dist/government-validation.d.ts +2 -2
  63. package/dist/government-validation.esm.js +5 -5
  64. package/dist/{governmentValidationStateMachine-CAxpYlz3.esm.js → governmentValidationStateMachine-C9DWKoT4.esm.js} +4 -4
  65. package/dist/http.esm.js +1 -1
  66. package/dist/id.d.ts +10 -10
  67. package/dist/id.esm.js +22 -22
  68. package/dist/{idCaptureManager-DfaZzJV3.d.ts → idCaptureManager-4tf9GZ-h.d.ts} +7 -7
  69. package/dist/{idCaptureManager-DruPQ5pA.esm.js → idCaptureManager-C-zoK9OY.esm.js} +4 -4
  70. package/dist/{idCaptureStateMachine-CEHQVPXX.esm.js → idCaptureStateMachine-Boqx6C9c.esm.js} +16 -16
  71. package/dist/identity-reuse.d.ts +46 -46
  72. package/dist/identity-reuse.esm.js +3 -3
  73. package/dist/index.d.ts +2 -2
  74. package/dist/index.esm.js +8 -8
  75. package/dist/{lib-CxDxnzRd.esm.js → lib-twqShmWZ.esm.js} +1 -1
  76. package/dist/mandatory-consent.d.ts +58 -58
  77. package/dist/mandatory-consent.esm.js +4 -4
  78. package/dist/{mandatoryConsentStateMachine-zHii57mc.esm.js → mandatoryConsentStateMachine-CaDUQVH2.esm.js} +3 -3
  79. package/dist/{openviduLazy-B8tinh9W.esm.js → openviduLazy-04FW2FLo.esm.js} +2 -2
  80. package/dist/openviduLazy-B8dy_KsG.esm.js +3 -0
  81. package/dist/{permissionServices-Cj120WaT.esm.js → permissionServices-DKkY9SGA.esm.js} +2 -2
  82. package/dist/phone.d.ts +3 -3
  83. package/dist/phone.esm.js +6 -6
  84. package/dist/{phoneManager-Cpd4VD3O.esm.js → phoneManager-DGBqKLwU.esm.js} +3 -3
  85. package/dist/{phoneManager-KeGunMJF.d.ts → phoneManager-OiAoV4_y.d.ts} +2 -2
  86. package/dist/{phoneStateMachine-Bhzv058R.esm.js → phoneStateMachine-BeOW6-sK.esm.js} +4 -4
  87. package/dist/{recordingService-Drvj5nOf.esm.js → recordingService-Chf_ClDh.esm.js} +13 -13
  88. package/dist/redirect-to-mobile.d.ts +2 -2
  89. package/dist/redirect-to-mobile.esm.js +5 -5
  90. package/dist/{redirectToMobileStateMachine-ChdhlqsE.esm.js → redirectToMobileStateMachine-BUmbZaow.esm.js} +4 -4
  91. package/dist/{runChildModule-B5DEiOS7.esm.js → runChildModule-BplQ84Fu.esm.js} +1 -1
  92. package/dist/selfie.d.ts +11 -11
  93. package/dist/selfie.esm.js +22 -22
  94. package/dist/{selfieManager-VXvYzqpE.esm.js → selfieManager-D3MbSLB7.esm.js} +6 -6
  95. package/dist/{selfieManager-LrnnqNh8.d.ts → selfieManager-DV5d7owu.d.ts} +2 -2
  96. package/dist/{selfieStateMachine-UFiVoA2o.esm.js → selfieStateMachine-DrehcPoi.esm.js} +3 -3
  97. package/dist/{session-DFNlZPO2.esm.js → session-C3psgB0o.esm.js} +4 -4
  98. package/dist/session.d.ts +1 -1
  99. package/dist/session.esm.js +6 -6
  100. package/dist/{setup-D4wIfKMo.esm.js → setup-BqE0p_Cg.esm.js} +5 -5
  101. package/dist/{setup-Bz3Ffaoc.d.ts → setup-Dre4G5OX.d.ts} +1 -1
  102. package/dist/signature.d.ts +2 -2
  103. package/dist/signature.esm.js +4 -4
  104. package/dist/{signatureStateMachine-BwEaOwbU.esm.js → signatureStateMachine-2FogXBZb.esm.js} +3 -3
  105. package/dist/{stats-wkQyDFV3.esm.js → stats-CdUiON-w.esm.js} +1 -1
  106. package/dist/stats.esm.js +2 -2
  107. package/dist/{types-CdlQrTiZ.d.ts → types-BPP_nJ2g.d.ts} +1 -1
  108. package/dist/{types-m43DfiSx.d.ts → types-C1lmcLat.d.ts} +1 -1
  109. package/dist/{types-CvrR1E0A.d.ts → types-Dth4P_pY.d.ts} +1 -1
  110. package/dist/wasm.d.ts +2 -2
  111. package/dist/wasm.esm.js +8 -8
  112. package/dist/watchlist.d.ts +62 -0
  113. package/dist/watchlist.esm.js +99 -0
  114. package/dist/workflow.d.ts +86 -86
  115. package/dist/workflow.esm.js +41 -41
  116. package/package.json +5 -1
  117. package/dist/openviduLazy-CItjpMfL.esm.js +0 -3
  118. /package/dist/{Actor-KC-0sV1E.d.ts → Actor-D5JNToUH.d.ts} +0 -0
  119. /package/dist/{BaseWasmProvider-C73c2nV9.esm.js → BaseWasmProvider-ri-WB2II.esm.js} +0 -0
  120. /package/dist/{BrowserEnvironmentProvider-lxn4oxXn.esm.js → BrowserEnvironmentProvider-DHMvtWIH.esm.js} +0 -0
  121. /package/dist/{BrowserStorageProvider-ByxoNfxC.esm.js → BrowserStorageProvider-B5M-3JVi.esm.js} +0 -0
  122. /package/dist/{BrowserTimerProvider-CSdm7__S.esm.js → BrowserTimerProvider-BRXIpp_U.esm.js} +0 -0
  123. /package/dist/{ITimerCapability-DAIaq369.esm.js → ITimerCapability-CCVfd2zh.esm.js} +0 -0
  124. /package/dist/{Manager-Bcnemkyi.d.ts → Manager-B6JdYK1C.d.ts} +0 -0
  125. /package/dist/{MotionSensorProvider-BLnFo6My.esm.js → MotionSensorProvider-BROkQLhB.esm.js} +0 -0
  126. /package/dist/{StateMachine-BQSmCXnT.d.ts → StateMachine-BBuIgsHT.d.ts} +0 -0
  127. /package/dist/{api-CqKwkjJ3.esm.js → api-DTKYcfzy.esm.js} +0 -0
  128. /package/dist/{browserSimulation-7W5-A3RV.esm.js → browserSimulation-_EAOWiA1.esm.js} +0 -0
  129. /package/dist/{camera-CgnuDuxy.d.ts → camera-BFs5UHwW.d.ts} +0 -0
  130. /package/dist/{camera-B-5traWf.esm.js → camera-BKFhs1qx.esm.js} +0 -0
  131. /package/dist/{chunk-Qw4qVmMx.esm.js → chunk-BlT4l8bL.esm.js} +0 -0
  132. /package/dist/{displayErrors-C9-VaqmS.d.ts → displayErrors-ByrthsW3.d.ts} +0 -0
  133. /package/dist/{flowCompletionService-CPLdZxe-.d.ts → flowCompletionService-C9IqrsDT.d.ts} +0 -0
  134. /package/dist/{getBrowser-DJkbzQ5t.esm.js → getBrowser-BBXR_Qw-.esm.js} +0 -0
  135. /package/dist/{platform-BfoqeM61.esm.js → platform-BP2TY6mD.esm.js} +0 -0
  136. /package/dist/{types-CxU9jTRl.d.ts → types-bi1Axaq2.d.ts} +0 -0
  137. /package/dist/{warmup-Cs0uqxUW.d.ts → warmup-DhX_C6wK.d.ts} +0 -0
  138. /package/dist/{xstate.esm-D7D6CGwY.esm.js → xstate.esm-BR_welYq.esm.js} +0 -0
@@ -1,8 +1,8 @@
1
- import { n as warmupWasm } from "./BaseWasmProvider-C73c2nV9.esm.js";
2
- import { t as WasmUtilProvider } from "./WasmUtilProvider-DRh0wrlm.esm.js";
3
- import { a as resetApi, o as setClient, s as setToken } from "./api-CqKwkjJ3.esm.js";
4
- import { h as flushEventQueue } from "./events-BjiB9Q1C.esm.js";
5
- import { i as resetSessionInit, r as initializeSession } from "./session-DFNlZPO2.esm.js";
1
+ import { n as warmupWasm } from "./BaseWasmProvider-ri-WB2II.esm.js";
2
+ import { t as WasmUtilProvider } from "./WasmUtilProvider-BvXiqQSQ.esm.js";
3
+ import { a as resetApi, o as setClient, s as setToken } from "./api-DTKYcfzy.esm.js";
4
+ import { h as flushEventQueue } from "./events-BSP6Ksh5.esm.js";
5
+ import { i as resetSessionInit, r as initializeSession } from "./session-C3psgB0o.esm.js";
6
6
 
7
7
  //#region ../infra/src/http/createApi.ts
8
8
  var FetchHttpError = class extends Error {
@@ -1,4 +1,4 @@
1
- import { n as WasmPipeline } from "./warmup-Cs0uqxUW.js";
1
+ import { n as WasmPipeline } from "./warmup-DhX_C6wK.js";
2
2
 
3
3
  //#region src/setup.d.ts
4
4
 
@@ -1,5 +1,5 @@
1
- import { t as Manager } from "./Manager-Bcnemkyi.js";
2
- import "./Actor-KC-0sV1E.js";
1
+ import { t as Manager } from "./Manager-B6JdYK1C.js";
2
+ import "./Actor-D5JNToUH.js";
3
3
 
4
4
  //#region src/modules/signature/types.d.ts
5
5
  /**
@@ -1,7 +1,7 @@
1
- import "./api-CqKwkjJ3.esm.js";
2
- import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-BjiB9Q1C.esm.js";
3
- import { a as createActor, o as createManager } from "./xstate.esm-D7D6CGwY.esm.js";
4
- import { t as signatureMachine } from "./signatureStateMachine-BwEaOwbU.esm.js";
1
+ import "./api-DTKYcfzy.esm.js";
2
+ import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-BSP6Ksh5.esm.js";
3
+ import { a as createActor, o as createManager } from "./xstate.esm-BR_welYq.esm.js";
4
+ import { t as signatureMachine } from "./signatureStateMachine-2FogXBZb.esm.js";
5
5
 
6
6
  //#region src/modules/signature/signatureActor.ts
7
7
  function createSignatureActor(options) {
@@ -1,6 +1,6 @@
1
- import { t as api } from "./api-CqKwkjJ3.esm.js";
2
- import { _ as endpoints, m as addEvent, n as eventModuleNames, r as eventScreenNames } from "./events-BjiB9Q1C.esm.js";
3
- import { i as fromPromise, n as assign, t as setup } from "./xstate.esm-D7D6CGwY.esm.js";
1
+ import { t as api } from "./api-DTKYcfzy.esm.js";
2
+ import { _ as endpoints, m as addEvent, n as eventModuleNames, r as eventScreenNames } from "./events-BSP6Ksh5.esm.js";
3
+ import { i as fromPromise, n as assign, t as setup } from "./xstate.esm-BR_welYq.esm.js";
4
4
 
5
5
  //#region src/modules/signature/signatureServices.ts
6
6
  /**
@@ -1,4 +1,4 @@
1
- import { t as api } from "./api-CqKwkjJ3.esm.js";
1
+ import { t as api } from "./api-DTKYcfzy.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-CqKwkjJ3.esm.js";
2
- import { t as addDeviceStats } from "./stats-wkQyDFV3.esm.js";
1
+ import "./api-DTKYcfzy.esm.js";
2
+ import { t as addDeviceStats } from "./stats-CdUiON-w.esm.js";
3
3
 
4
4
  export { addDeviceStats };
@@ -1,4 +1,4 @@
1
- import { t as CameraStream } from "./camera-CgnuDuxy.js";
1
+ import { t as CameraStream } from "./camera-BFs5UHwW.js";
2
2
 
3
3
  //#region src/modules/document-upload/types.d.ts
4
4
 
@@ -1,4 +1,4 @@
1
- import { t as DocumentUploadConfig } from "./types-CdlQrTiZ.js";
1
+ import { t as DocumentUploadConfig } from "./types-BPP_nJ2g.js";
2
2
 
3
3
  //#region src/modules/flow/types.d.ts
4
4
  type EmptyConfig = Record<string, never>;
@@ -1,4 +1,4 @@
1
- import { t as AnyStateMachine } from "./StateMachine-BQSmCXnT.js";
1
+ import { t as AnyStateMachine } from "./StateMachine-BBuIgsHT.js";
2
2
 
3
3
  //#region src/internal/orchestration/types.d.ts
4
4
  /** Eager module: a pre-imported state machine. */
package/dist/wasm.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { n as WasmPipeline, r as warmupWasm, t as WarmupConfig } from "./warmup-Cs0uqxUW.js";
2
- import { n as WasmConfig, o as setWasmConfig, r as initializeWasmUtil } from "./setup-Bz3Ffaoc.js";
1
+ import { n as WasmPipeline, r as warmupWasm, t as WarmupConfig } from "./warmup-DhX_C6wK.js";
2
+ import { n as WasmConfig, o as setWasmConfig, r as initializeWasmUtil } from "./setup-Dre4G5OX.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-D4wIfKMo.esm.js";
2
- import { n as warmupWasm } from "./BaseWasmProvider-C73c2nV9.esm.js";
3
- import "./WasmUtilProvider-DRh0wrlm.esm.js";
4
- import "./api-CqKwkjJ3.esm.js";
5
- import "./events-BjiB9Q1C.esm.js";
6
- import "./session-DFNlZPO2.esm.js";
7
- import "./BrowserEnvironmentProvider-lxn4oxXn.esm.js";
8
- import "./browserSimulation-7W5-A3RV.esm.js";
1
+ import { c as resolveWasmConfig, i as setWasmConfig, o as DEFAULT_WASM_VERSION, s as buildDefaultWasmConfig, t as initializeWasmUtil } from "./setup-BqE0p_Cg.esm.js";
2
+ import { n as warmupWasm } from "./BaseWasmProvider-ri-WB2II.esm.js";
3
+ import "./WasmUtilProvider-BvXiqQSQ.esm.js";
4
+ import "./api-DTKYcfzy.esm.js";
5
+ import "./events-BSP6Ksh5.esm.js";
6
+ import "./session-C3psgB0o.esm.js";
7
+ import "./BrowserEnvironmentProvider-DHMvtWIH.esm.js";
8
+ import "./browserSimulation-_EAOWiA1.esm.js";
9
9
 
10
10
  export { DEFAULT_WASM_VERSION, buildDefaultWasmConfig, initializeWasmUtil, resolveWasmConfig, setWasmConfig, warmupWasm };
@@ -0,0 +1,62 @@
1
+ import { t as Manager } from "./Manager-B6JdYK1C.js";
2
+
3
+ //#region src/modules/watchlist/watchlistStateMachine.d.ts
4
+ type WatchlistResult = 'success' | 'skipped';
5
+ declare const watchlistMachine: any;
6
+ //#endregion
7
+ //#region src/modules/watchlist/watchlistManager.d.ts
8
+ type WatchlistIdleState = {
9
+ status: 'idle';
10
+ };
11
+ type WatchlistProcessingState = {
12
+ status: 'processing';
13
+ };
14
+ type WatchlistSuccessState = {
15
+ status: 'success';
16
+ };
17
+ type WatchlistFinishedState = {
18
+ status: 'finished';
19
+ result: WatchlistResult;
20
+ };
21
+ /**
22
+ * Union of all possible global watchlist manager states.
23
+ *
24
+ * @example
25
+ * ```typescript
26
+ * const state = watchlistManager.getState();
27
+ * if (state.status === 'finished') {
28
+ * console.log('Global watchlist check complete');
29
+ * }
30
+ * ```
31
+ */
32
+ type WatchlistState = WatchlistIdleState | WatchlistProcessingState | WatchlistSuccessState | WatchlistFinishedState;
33
+ /**
34
+ * Creates a global watchlist manager for headless or UI-driven usage.
35
+ *
36
+ * @example Headless usage
37
+ * ```typescript
38
+ * const manager = createWatchlistManager();
39
+ * manager.subscribe((state) => console.log(state.status));
40
+ * manager.load();
41
+ * ```
42
+ */
43
+ declare function createWatchlistManager(): Manager<WatchlistState> & {
44
+ /**
45
+ * Kicks off the global watchlist check.
46
+ * Transitions from 'idle' to 'processing'.
47
+ */
48
+ load(): void;
49
+ };
50
+ type WatchlistManager = ReturnType<typeof createWatchlistManager>;
51
+ //#endregion
52
+ //#region src/modules/watchlist/types.d.ts
53
+ /**
54
+ * Configuration options for the global watchlist module.
55
+ *
56
+ * The global watchlist module requires no configuration — it is a fire-and-forget
57
+ * process that runs the backend global watchlist check (OFAC, PEP, etc.) and
58
+ * completes regardless of the API outcome.
59
+ */
60
+ type WatchlistConfig = Record<string, never>;
61
+ //#endregion
62
+ export { type WatchlistConfig, type WatchlistManager, type WatchlistState, createWatchlistManager, watchlistMachine };
@@ -0,0 +1,99 @@
1
+ import { t as api } from "./api-DTKYcfzy.esm.js";
2
+ import { _ as endpoints, n as eventModuleNames, o as createManagerInstrumentation } from "./events-BSP6Ksh5.esm.js";
3
+ import { a as createActor, i as fromPromise, n as assign, o as createManager, t as setup } from "./xstate.esm-BR_welYq.esm.js";
4
+
5
+ //#region src/modules/watchlist/watchlistServices.ts
6
+ async function processWatchlist(signal) {
7
+ const res = await api.post(endpoints.processWatchlist, {}, { signal });
8
+ if (!res.ok) throw new Error(`POST ${endpoints.processWatchlist} failed: ${res.status} ${res.statusText}`);
9
+ return res.data;
10
+ }
11
+
12
+ //#endregion
13
+ //#region src/modules/watchlist/watchlistStateMachine.ts
14
+ const watchlistMachine = setup({
15
+ types: {
16
+ context: {},
17
+ events: {}
18
+ },
19
+ actors: { processWatchlist: fromPromise(async ({ signal }) => {
20
+ return processWatchlist(signal);
21
+ }) },
22
+ actions: {
23
+ markSuccess: assign({ result: "success" }),
24
+ markSkipped: assign({ result: "skipped" })
25
+ },
26
+ guards: { apiSucceeded: ({ event }) => event.output.success }
27
+ }).createMachine({
28
+ id: "watchlist",
29
+ initial: "idle",
30
+ context: { result: null },
31
+ states: {
32
+ idle: { on: { LOAD: { target: "processing" } } },
33
+ processing: { invoke: {
34
+ id: "processWatchlist",
35
+ src: "processWatchlist",
36
+ onDone: [{
37
+ target: "success",
38
+ guard: "apiSucceeded"
39
+ }, {
40
+ target: "finished",
41
+ actions: "markSkipped"
42
+ }],
43
+ onError: {
44
+ target: "finished",
45
+ actions: "markSkipped"
46
+ }
47
+ } },
48
+ success: { after: { 3e3: {
49
+ target: "finished",
50
+ actions: "markSuccess"
51
+ } } },
52
+ finished: { type: "final" }
53
+ }
54
+ });
55
+
56
+ //#endregion
57
+ //#region src/modules/watchlist/watchlistActor.ts
58
+ function createWatchlistActor() {
59
+ return createActor(watchlistMachine).start();
60
+ }
61
+
62
+ //#endregion
63
+ //#region src/modules/watchlist/watchlistManager.ts
64
+ function mapState(snapshot) {
65
+ const typedSnapshot = snapshot;
66
+ if (typedSnapshot.matches("processing")) return { status: "processing" };
67
+ if (typedSnapshot.matches("success")) return { status: "success" };
68
+ if (typedSnapshot.matches("finished")) return {
69
+ status: "finished",
70
+ result: typedSnapshot.context.result ?? "skipped"
71
+ };
72
+ return { status: "idle" };
73
+ }
74
+ function createApi({ actor }) {
75
+ return { load() {
76
+ actor.send({ type: "LOAD" });
77
+ } };
78
+ }
79
+ /**
80
+ * Creates a global watchlist manager for headless or UI-driven usage.
81
+ *
82
+ * @example Headless usage
83
+ * ```typescript
84
+ * const manager = createWatchlistManager();
85
+ * manager.subscribe((state) => console.log(state.status));
86
+ * manager.load();
87
+ * ```
88
+ */
89
+ function createWatchlistManager() {
90
+ return createManager({
91
+ actor: createWatchlistActor(),
92
+ mapState,
93
+ createApi,
94
+ instrumentation: createManagerInstrumentation(eventModuleNames.watchlist)
95
+ });
96
+ }
97
+
98
+ //#endregion
99
+ export { createWatchlistManager, watchlistMachine };