@incodetech/core 0.0.0-dev-20260409-0e64d73 → 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.
- package/dist/{OpenViduRecordingProvider-JatjSE3h.esm.js → OpenViduRecordingProvider-D5eKWCUZ.esm.js} +1 -1
- package/dist/{WasmUtilProvider-DRh0wrlm.esm.js → WasmUtilProvider-BvXiqQSQ.esm.js} +1 -1
- package/dist/{addressSearch-CDdN30un.esm.js → addressSearch-C_0wN5KN.esm.js} +4 -4
- package/dist/antifraud.d.ts +1 -1
- package/dist/antifraud.esm.js +4 -4
- package/dist/{antifraudStateMachine-C1AgS0nL.esm.js → antifraudStateMachine-WMyzW7FW.esm.js} +3 -3
- package/dist/authentication.d.ts +11 -11
- package/dist/authentication.esm.js +22 -22
- package/dist/{authenticationManager-DYFYx68i.d.ts → authenticationManager-DrsjKwg6.d.ts} +2 -2
- package/dist/{authenticationManager-UaO9UTN7.esm.js → authenticationManager-k9cC-jvW.esm.js} +6 -6
- package/dist/{authenticationStateMachine-DWI65EwK.esm.js → authenticationStateMachine-DsePlR1o.esm.js} +6 -6
- package/dist/{backCameraStream-BihRmMzc.esm.js → backCameraStream-p9UjczGK.esm.js} +3 -3
- package/dist/camera.d.ts +1 -1
- package/dist/camera.esm.js +3 -3
- package/dist/consent.d.ts +55 -55
- package/dist/consent.esm.js +4 -4
- package/dist/{consentStateMachine-CpRu2hF0.esm.js → consentStateMachine-CKaVliKQ.esm.js} +3 -3
- package/dist/cross-document-data-match.d.ts +1 -1
- package/dist/cross-document-data-match.esm.js +4 -4
- package/dist/curp-validation.d.ts +5 -5
- package/dist/curp-validation.esm.js +4 -4
- package/dist/{curpValidationStateMachine-Czzgv2W1.esm.js → curpValidationStateMachine-TmFjYie1.esm.js} +3 -3
- package/dist/{deepsightLoader-jIgoauFK.esm.js → deepsightLoader-B3DY23-5.esm.js} +10 -10
- package/dist/{deepsightService-D4mM8yJ2.esm.js → deepsightService-BgvhDdse.esm.js} +5 -5
- package/dist/{deepsightService-DAeakjDd.d.ts → deepsightService-Clz07wkf.d.ts} +2 -2
- package/dist/device.esm.js +3 -3
- package/dist/document-capture.d.ts +76 -76
- package/dist/document-capture.esm.js +8 -8
- package/dist/document-upload.d.ts +47 -47
- package/dist/document-upload.esm.js +7 -7
- package/dist/{documentCaptureStateMachine-XbpsHzh5.esm.js → documentCaptureStateMachine-CmUER_Il.esm.js} +5 -5
- package/dist/ekyb.d.ts +3 -3
- package/dist/ekyb.esm.js +10 -10
- package/dist/{ekybStateMachine-BDuCae6s.esm.js → ekybStateMachine-ENNR09OW.esm.js} +5 -5
- package/dist/ekyc.d.ts +3 -3
- package/dist/ekyc.esm.js +6 -6
- package/dist/{ekycStateMachine-DCeUngwi.esm.js → ekycStateMachine-BJTwbCcq.esm.js} +4 -4
- package/dist/email.d.ts +3 -3
- package/dist/email.esm.js +6 -6
- package/dist/{emailManager-CAeo59lD.esm.js → emailManager-CeOaYSt0.esm.js} +3 -3
- package/dist/{emailManager-CZYfcu0n.d.ts → emailManager-mkgZ1sR6.d.ts} +2 -2
- package/dist/{emailStateMachine-Bqwe_sQS.esm.js → emailStateMachine-CQa3EMhA.esm.js} +4 -4
- package/dist/{events-CZ2ka3pu.esm.js → events-BSP6Ksh5.esm.js} +4 -1
- package/dist/events.d.ts +2 -0
- package/dist/events.esm.js +2 -2
- package/dist/extensibility.d.ts +15 -15
- package/dist/extensibility.esm.js +33 -33
- package/dist/face-match.d.ts +1 -1
- package/dist/face-match.esm.js +4 -4
- package/dist/{faceCaptureManagerFactory-DS-6yCya.d.ts → faceCaptureManagerFactory-DhKU7cW9.d.ts} +8 -8
- package/dist/{faceCaptureManagerFactory-D8zlMTvd.esm.js → faceCaptureManagerFactory-Dr5TSw6i.esm.js} +69 -3
- package/dist/{faceCaptureSetup-1M6uUEjK.esm.js → faceCaptureSetup-TT4s3AkW.esm.js} +4 -4
- package/dist/{faceMatchStateMachine-D3DuP_ya.esm.js → faceMatchStateMachine-B_CXt9NM.esm.js} +3 -3
- package/dist/flow.d.ts +8 -8
- package/dist/flow.esm.js +9 -9
- package/dist/{flowCompletionService-W6bj7Xd3.esm.js → flowCompletionService-CKpuKBHj.esm.js} +2 -2
- package/dist/{flowServices-C4tjBD8q.esm.js → flowServices-aa_WK5bT.esm.js} +3 -3
- package/dist/geolocation.d.ts +2 -2
- package/dist/geolocation.esm.js +5 -5
- package/dist/{geolocationStateMachine-Bj2LkGwy.esm.js → geolocationStateMachine-_H3mSlsR.esm.js} +4 -4
- package/dist/{getDeviceClass-BoiWvKAc.esm.js → getDeviceClass-B1VQriq2.esm.js} +1 -1
- package/dist/government-validation.d.ts +2 -2
- package/dist/government-validation.esm.js +5 -5
- package/dist/{governmentValidationStateMachine-W1CzRjVw.esm.js → governmentValidationStateMachine-C9DWKoT4.esm.js} +4 -4
- package/dist/http.esm.js +1 -1
- package/dist/id.d.ts +10 -10
- package/dist/id.esm.js +22 -22
- package/dist/{idCaptureManager-oR6YPYHj.d.ts → idCaptureManager-4tf9GZ-h.d.ts} +7 -7
- package/dist/{idCaptureManager-BcS8fgW4.esm.js → idCaptureManager-C-zoK9OY.esm.js} +4 -4
- package/dist/{idCaptureStateMachine-MAzfM_2O.esm.js → idCaptureStateMachine-Boqx6C9c.esm.js} +16 -16
- package/dist/identity-reuse.d.ts +42 -42
- package/dist/identity-reuse.esm.js +3 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.esm.js +8 -8
- package/dist/{lib-CxDxnzRd.esm.js → lib-twqShmWZ.esm.js} +1 -1
- package/dist/mandatory-consent.d.ts +58 -58
- package/dist/mandatory-consent.esm.js +4 -4
- package/dist/{mandatoryConsentStateMachine-BMKi26Re.esm.js → mandatoryConsentStateMachine-CaDUQVH2.esm.js} +3 -3
- package/dist/{openviduLazy-B8tinh9W.esm.js → openviduLazy-04FW2FLo.esm.js} +2 -2
- package/dist/openviduLazy-B8dy_KsG.esm.js +3 -0
- package/dist/{permissionServices-Cj120WaT.esm.js → permissionServices-DKkY9SGA.esm.js} +2 -2
- package/dist/phone.d.ts +3 -3
- package/dist/phone.esm.js +6 -6
- package/dist/{phoneManager-Bvj6Jr4o.esm.js → phoneManager-DGBqKLwU.esm.js} +3 -3
- package/dist/{phoneManager-CCMCkyYr.d.ts → phoneManager-OiAoV4_y.d.ts} +2 -2
- package/dist/{phoneStateMachine-B1t1Z-Dd.esm.js → phoneStateMachine-BeOW6-sK.esm.js} +4 -4
- package/dist/{recordingService-8I_-hhNI.esm.js → recordingService-Chf_ClDh.esm.js} +13 -13
- package/dist/redirect-to-mobile.d.ts +2 -2
- package/dist/redirect-to-mobile.esm.js +5 -5
- package/dist/{redirectToMobileStateMachine-BVP1KcoO.esm.js → redirectToMobileStateMachine-BUmbZaow.esm.js} +4 -4
- package/dist/{runChildModule-B5DEiOS7.esm.js → runChildModule-BplQ84Fu.esm.js} +1 -1
- package/dist/selfie.d.ts +11 -11
- package/dist/selfie.esm.js +22 -22
- package/dist/{selfieManager-B6x3O5Ns.esm.js → selfieManager-D3MbSLB7.esm.js} +6 -6
- package/dist/{selfieManager-gizt3Zha.d.ts → selfieManager-DV5d7owu.d.ts} +2 -2
- package/dist/{selfieStateMachine-DHPSBFj0.esm.js → selfieStateMachine-DrehcPoi.esm.js} +3 -3
- package/dist/{session-DoI-X9FK.esm.js → session-C3psgB0o.esm.js} +4 -4
- package/dist/session.d.ts +1 -1
- package/dist/session.esm.js +6 -6
- package/dist/{setup-Bh2S53NT.esm.js → setup-BqE0p_Cg.esm.js} +5 -5
- package/dist/{setup-Bz3Ffaoc.d.ts → setup-Dre4G5OX.d.ts} +1 -1
- package/dist/signature.d.ts +2 -2
- package/dist/signature.esm.js +4 -4
- package/dist/{signatureStateMachine-Cv7yPuEf.esm.js → signatureStateMachine-2FogXBZb.esm.js} +3 -3
- package/dist/{stats-wkQyDFV3.esm.js → stats-CdUiON-w.esm.js} +1 -1
- package/dist/stats.esm.js +2 -2
- package/dist/{types-CdlQrTiZ.d.ts → types-BPP_nJ2g.d.ts} +1 -1
- package/dist/{types-m43DfiSx.d.ts → types-C1lmcLat.d.ts} +1 -1
- package/dist/{types-BdEM5Jj7.d.ts → types-Dth4P_pY.d.ts} +1 -1
- package/dist/wasm.d.ts +2 -2
- package/dist/wasm.esm.js +8 -8
- package/dist/watchlist.d.ts +62 -0
- package/dist/watchlist.esm.js +99 -0
- package/dist/workflow.d.ts +86 -86
- package/dist/workflow.esm.js +41 -41
- package/package.json +5 -1
- package/dist/openviduLazy-CItjpMfL.esm.js +0 -3
- /package/dist/{Actor-BkPcZGke.d.ts → Actor-D5JNToUH.d.ts} +0 -0
- /package/dist/{BaseWasmProvider-C73c2nV9.esm.js → BaseWasmProvider-ri-WB2II.esm.js} +0 -0
- /package/dist/{BrowserEnvironmentProvider-lxn4oxXn.esm.js → BrowserEnvironmentProvider-DHMvtWIH.esm.js} +0 -0
- /package/dist/{BrowserStorageProvider-ByxoNfxC.esm.js → BrowserStorageProvider-B5M-3JVi.esm.js} +0 -0
- /package/dist/{BrowserTimerProvider-CSdm7__S.esm.js → BrowserTimerProvider-BRXIpp_U.esm.js} +0 -0
- /package/dist/{ITimerCapability-DAIaq369.esm.js → ITimerCapability-CCVfd2zh.esm.js} +0 -0
- /package/dist/{Manager-Bcnemkyi.d.ts → Manager-B6JdYK1C.d.ts} +0 -0
- /package/dist/{MotionSensorProvider-BLnFo6My.esm.js → MotionSensorProvider-BROkQLhB.esm.js} +0 -0
- /package/dist/{StateMachine-DIeoDJ7r.d.ts → StateMachine-BBuIgsHT.d.ts} +0 -0
- /package/dist/{api-CqKwkjJ3.esm.js → api-DTKYcfzy.esm.js} +0 -0
- /package/dist/{browserSimulation-7W5-A3RV.esm.js → browserSimulation-_EAOWiA1.esm.js} +0 -0
- /package/dist/{camera-CgnuDuxy.d.ts → camera-BFs5UHwW.d.ts} +0 -0
- /package/dist/{camera-B-5traWf.esm.js → camera-BKFhs1qx.esm.js} +0 -0
- /package/dist/{chunk-Qw4qVmMx.esm.js → chunk-BlT4l8bL.esm.js} +0 -0
- /package/dist/{displayErrors-C9-VaqmS.d.ts → displayErrors-ByrthsW3.d.ts} +0 -0
- /package/dist/{flowCompletionService-CPLdZxe-.d.ts → flowCompletionService-C9IqrsDT.d.ts} +0 -0
- /package/dist/{getBrowser-DJkbzQ5t.esm.js → getBrowser-BBXR_Qw-.esm.js} +0 -0
- /package/dist/{platform-BfoqeM61.esm.js → platform-BP2TY6mD.esm.js} +0 -0
- /package/dist/{types-CxU9jTRl.d.ts → types-bi1Axaq2.d.ts} +0 -0
- /package/dist/{warmup-Cs0uqxUW.d.ts → warmup-DhX_C6wK.d.ts} +0 -0
- /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-
|
|
2
|
-
import { t as WasmUtilProvider } from "./WasmUtilProvider-
|
|
3
|
-
import { a as resetApi, o as setClient, s as setToken } from "./api-
|
|
4
|
-
import { h as flushEventQueue } from "./events-
|
|
5
|
-
import { i as resetSessionInit, r as initializeSession } from "./session-
|
|
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 {
|
package/dist/signature.d.ts
CHANGED
package/dist/signature.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "./api-
|
|
2
|
-
import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-
|
|
3
|
-
import { a as createActor, o as createManager } from "./xstate.esm-
|
|
4
|
-
import { t as signatureMachine } from "./signatureStateMachine-
|
|
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) {
|
package/dist/{signatureStateMachine-Cv7yPuEf.esm.js → signatureStateMachine-2FogXBZb.esm.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as api } from "./api-
|
|
2
|
-
import { _ as endpoints, m as addEvent, n as eventModuleNames, r as eventScreenNames } from "./events-
|
|
3
|
-
import { i as fromPromise, n as assign, t as setup } from "./xstate.esm-
|
|
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
|
/**
|
package/dist/stats.esm.js
CHANGED
package/dist/wasm.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as WasmPipeline, r as warmupWasm, t as WarmupConfig } from "./warmup-
|
|
2
|
-
import { n as WasmConfig, o as setWasmConfig, r as initializeWasmUtil } from "./setup-
|
|
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-
|
|
2
|
-
import { n as warmupWasm } from "./BaseWasmProvider-
|
|
3
|
-
import "./WasmUtilProvider-
|
|
4
|
-
import "./api-
|
|
5
|
-
import "./events-
|
|
6
|
-
import "./session-
|
|
7
|
-
import "./BrowserEnvironmentProvider-
|
|
8
|
-
import "./browserSimulation-
|
|
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 };
|