@incodetech/core 2.0.0-rc.0 → 2.0.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.
- package/package.json +3 -3
- package/dist/Actor-CI32dTbG.d.ts +0 -2
- package/dist/BaseWasmProvider-C_DLEI40.esm.js +0 -1118
- package/dist/BrowserStorageProvider-CuOW1Er2.esm.js +0 -55
- package/dist/BrowserTimerProvider-DhNc_x02.esm.js +0 -22
- package/dist/ITimerCapability-C67ZRskg.esm.js +0 -7
- package/dist/IpifyProvider-D7jx52AL.esm.js +0 -139
- package/dist/Manager-C8PrhBOx.d.ts +0 -19
- package/dist/MotionSensorProvider-4v7xkqAp.esm.js +0 -254
- package/dist/OpenViduRecordingProvider-CMu6XVdc.esm.js +0 -87
- package/dist/StateMachine-BCQrZJhf.d.ts +0 -2
- package/dist/WasmUtilProvider-j98OJf-S.esm.js +0 -114
- package/dist/addressSearch-BpTbTWCa.esm.js +0 -430
- package/dist/ae-signature-DDDZmWXj.esm.js +0 -12
- package/dist/ae-signature.d.ts +0 -25
- package/dist/ae-signature.esm.js +0 -8
- package/dist/antifraud.d.ts +0 -57
- package/dist/antifraud.esm.js +0 -45
- package/dist/antifraudStateMachine-O0TMf6yc.esm.js +0 -39
- package/dist/api-CESGtpbH.esm.js +0 -53
- package/dist/authentication.d.ts +0 -12
- package/dist/authentication.esm.js +0 -25
- package/dist/authenticationManager-5M-fKzXx.esm.js +0 -67
- package/dist/authenticationManager-C83GNIhl.d.ts +0 -66
- package/dist/authenticationStateMachine-BMZqatiF.esm.js +0 -139
- package/dist/backCameraStream-DMdMeGk2.esm.js +0 -346
- package/dist/browserSimulation-gxD8cSpM.esm.js +0 -20
- package/dist/camera-DBSxa6ML.d.ts +0 -4
- package/dist/camera-PA2Ljri3.esm.js +0 -22
- package/dist/camera.d.ts +0 -15
- package/dist/camera.esm.js +0 -5
- package/dist/chunk-CRF6K_H_.esm.js +0 -49
- package/dist/consent.d.ts +0 -398
- package/dist/consent.esm.js +0 -79
- package/dist/consentStateMachine-CCT-B60O.esm.js +0 -151
- package/dist/cpf-PPz2Njto.esm.js +0 -38
- package/dist/cpf-ocr.d.ts +0 -204
- package/dist/cpf-ocr.esm.js +0 -177
- package/dist/cross-document-data-match.d.ts +0 -34
- package/dist/cross-document-data-match.esm.js +0 -71
- package/dist/curp-validation.d.ts +0 -188
- package/dist/curp-validation.esm.js +0 -110
- package/dist/curpValidationStateMachine-CitWLr2c.esm.js +0 -595
- package/dist/custom-fields.d.ts +0 -115
- package/dist/custom-fields.esm.js +0 -177
- package/dist/custom-watchlist.d.ts +0 -66
- package/dist/custom-watchlist.esm.js +0 -86
- package/dist/dateUtils-UoN5xswP.esm.js +0 -23
- package/dist/deepsightLoader-Cm4JIT_z.esm.js +0 -52
- package/dist/deepsightService-CEVxzehb.d.ts +0 -412
- package/dist/deepsightService-O74l4Y__.esm.js +0 -489
- package/dist/device.d.ts +0 -46
- package/dist/device.esm.js +0 -106
- package/dist/displayErrors-DqJ_IbsG.d.ts +0 -39
- package/dist/document-capture.d.ts +0 -906
- package/dist/document-capture.esm.js +0 -156
- package/dist/document-upload.d.ts +0 -331
- package/dist/document-upload.esm.js +0 -203
- package/dist/documentCaptureStateMachine-BqzTDy9k.esm.js +0 -394
- package/dist/dynamic-forms.d.ts +0 -178
- package/dist/dynamic-forms.esm.js +0 -323
- package/dist/ekyb.d.ts +0 -148
- package/dist/ekyb.esm.js +0 -127
- package/dist/ekybStateMachine-B59rQjgj.esm.js +0 -674
- package/dist/ekyc.d.ts +0 -164
- package/dist/ekyc.esm.js +0 -104
- package/dist/ekycStateMachine-oeO0Iekd.esm.js +0 -10626
- package/dist/electronic-signature.d.ts +0 -4
- package/dist/electronic-signature.esm.js +0 -7
- package/dist/electronicSignatureManager-D9OHzTpG.esm.js +0 -428
- package/dist/email.d.ts +0 -4
- package/dist/email.esm.js +0 -9
- package/dist/emailManager-DIfnS5g1.d.ts +0 -352
- package/dist/emailManager-wAV0LE-H.esm.js +0 -238
- package/dist/emailStateMachine-DOf4j58N.esm.js +0 -292
- package/dist/endpoints-CnN3SyDa.esm.js +0 -87
- package/dist/events-D6-e4vok.esm.js +0 -596
- package/dist/events.d.ts +0 -265
- package/dist/events.esm.js +0 -4
- package/dist/extensibility.d.ts +0 -122
- package/dist/extensibility.esm.js +0 -43
- package/dist/face-match.d.ts +0 -228
- package/dist/face-match.esm.js +0 -173
- package/dist/faceCaptureManagerFactory-Dh2PdGlF.esm.js +0 -290
- package/dist/faceCaptureManagerFactory-yqtpxjnN.d.ts +0 -690
- package/dist/faceCaptureSetup-B3faSpYA.esm.js +0 -873
- package/dist/faceMatchStateMachine-DNFrxTFS.esm.js +0 -127
- package/dist/flow-events.d.ts +0 -6
- package/dist/flow-events.esm.js +0 -0
- package/dist/flow.d.ts +0 -358
- package/dist/flow.esm.js +0 -825
- package/dist/flowCompletionService-DhkT4SRY.d.ts +0 -10
- package/dist/flowCompletionService-P54yzGvA.esm.js +0 -13
- package/dist/flowServices-DTsm-Vf1.esm.js +0 -188
- package/dist/geolocation.d.ts +0 -127
- package/dist/geolocation.esm.js +0 -89
- package/dist/geolocationStateMachine-asasuHY2.esm.js +0 -105
- package/dist/getBrowser-BSXUTWXw.esm.js +0 -41
- package/dist/getDeviceClass-BSntT9_j.esm.js +0 -14
- package/dist/government-validation.d.ts +0 -67
- package/dist/government-validation.esm.js +0 -81
- package/dist/governmentValidationStateMachine-BDDYrJTo.esm.js +0 -271
- package/dist/home.d.ts +0 -99
- package/dist/home.esm.js +0 -61
- package/dist/http.d.ts +0 -68
- package/dist/http.esm.js +0 -3
- package/dist/id-ocr.d.ts +0 -635
- package/dist/id-ocr.esm.js +0 -86
- package/dist/id-verification.d.ts +0 -190
- package/dist/id-verification.esm.js +0 -43
- package/dist/id.d.ts +0 -24
- package/dist/id.esm.js +0 -164
- package/dist/idCaptureManager-B9TGA5dq.d.ts +0 -956
- package/dist/idCaptureManager-DMK0GIt3.esm.js +0 -581
- package/dist/idCaptureStateMachine-Bq0fVZXl.esm.js +0 -2954
- package/dist/idOcrStateMachine-YbjjC_Gg.esm.js +0 -388
- package/dist/idVerificationStateMachine-xbw9HP1Z.esm.js +0 -71
- package/dist/identity-reuse.d.ts +0 -530
- package/dist/identity-reuse.esm.js +0 -274
- package/dist/index-BLKtMA0g.d.ts +0 -1177
- package/dist/index-BcRG8rtJ.d.ts +0 -97
- package/dist/index.d.ts +0 -3
- package/dist/index.esm.js +0 -12
- package/dist/invokeOnCaptureCallback-rc6kBHo5.esm.js +0 -30
- package/dist/lib-BB0B_qQX.esm.js +0 -12499
- package/dist/mandatory-consent.d.ts +0 -412
- package/dist/mandatory-consent.esm.js +0 -78
- package/dist/mandatoryConsentStateMachine-Cnco1jvn.esm.js +0 -126
- package/dist/openviduLazy-Cm0XFh_v.esm.js +0 -3
- package/dist/openviduLazy-Cok70ZSg.esm.js +0 -12
- package/dist/permissionServices-D_i6nzEw.esm.js +0 -50
- package/dist/phone.d.ts +0 -4
- package/dist/phone.esm.js +0 -9
- package/dist/phoneManager-B6M30hKE.d.ts +0 -397
- package/dist/phoneManager-DAJbGhlY.esm.js +0 -256
- package/dist/phoneStateMachine-CuPARRaT.esm.js +0 -351
- package/dist/platform-CfrjKhmi.esm.js +0 -83
- package/dist/qe-signature-DFo_Cc-I.esm.js +0 -12
- package/dist/qe-signature.d.ts +0 -25
- package/dist/qe-signature.esm.js +0 -8
- package/dist/recordingService-Ig2UgbLv.esm.js +0 -1003
- package/dist/redirect-to-mobile.d.ts +0 -107
- package/dist/redirect-to-mobile.esm.js +0 -102
- package/dist/redirectToMobileStateMachine-BOEqe46A.esm.js +0 -249
- package/dist/runChildModule-CqqwqAkW.esm.js +0 -219
- package/dist/selfie.d.ts +0 -26
- package/dist/selfie.esm.js +0 -146
- package/dist/selfieManager-D0lSgd-J.d.ts +0 -68
- package/dist/selfieManager-Duisl7qN.esm.js +0 -60
- package/dist/selfieStateMachine-D76whWEf.esm.js +0 -68
- package/dist/session-BS-d_vuE.esm.js +0 -3206
- package/dist/session.d.ts +0 -217
- package/dist/session.esm.js +0 -9
- package/dist/setup-Buy-hyj4.esm.js +0 -887
- package/dist/setup-C5AITV8m.d.ts +0 -254
- package/dist/signature.d.ts +0 -94
- package/dist/signature.esm.js +0 -66
- package/dist/signatureStateMachine-B5-QVUve.esm.js +0 -132
- package/dist/stats-CIfiPzb1.esm.js +0 -16
- package/dist/stats.d.ts +0 -16
- package/dist/stats.esm.js +0 -4
- package/dist/trust-graph.d.ts +0 -54
- package/dist/trust-graph.esm.js +0 -56
- package/dist/types-B06Ypu2F.d.ts +0 -49
- package/dist/types-BP1m8VRw.d.ts +0 -340
- package/dist/types-CAD4va6a.d.ts +0 -5
- package/dist/types-CFV9G_7j.d.ts +0 -24
- package/dist/warmup-CEcppFiS.d.ts +0 -63
- package/dist/wasm.d.ts +0 -15
- package/dist/wasm.esm.js +0 -12
- package/dist/watchlist-for-business.d.ts +0 -79
- package/dist/watchlist-for-business.esm.js +0 -148
- package/dist/watchlist.d.ts +0 -62
- package/dist/watchlist.esm.js +0 -86
- package/dist/watchlistServices-DMbUhkBX.esm.js +0 -12
- package/dist/workflow.d.ts +0 -907
- package/dist/workflow.esm.js +0 -702
- package/dist/xstate.esm-B70JrNqo.esm.js +0 -3404
|
@@ -1,148 +0,0 @@
|
|
|
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/watchlist-for-business/watchlistForBusinessServices.ts
|
|
7
|
-
async function submitWatchlistForBusiness(data, signal) {
|
|
8
|
-
const res = await api.post(endpoints.watchlistForBusinessSubmit, data, { signal });
|
|
9
|
-
if (!res.ok) throw new Error(`POST ${endpoints.watchlistForBusinessSubmit} failed: ${res.status} ${res.statusText}`);
|
|
10
|
-
return res.data;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
//#endregion
|
|
14
|
-
//#region src/modules/watchlist-for-business/watchlistForBusinessStateMachine.ts
|
|
15
|
-
const DEFAULT_COUNTRY = "US";
|
|
16
|
-
function computeIsValid(businessName) {
|
|
17
|
-
return businessName.trim().length > 0;
|
|
18
|
-
}
|
|
19
|
-
const watchlistForBusinessMachine = setup({
|
|
20
|
-
types: {
|
|
21
|
-
context: {},
|
|
22
|
-
events: {}
|
|
23
|
-
},
|
|
24
|
-
actors: { submitWatchlistForBusiness: fromPromise(async ({ input, signal }) => {
|
|
25
|
-
await submitWatchlistForBusiness(input, signal);
|
|
26
|
-
}) },
|
|
27
|
-
actions: {
|
|
28
|
-
setCountry: assign(({ event }) => {
|
|
29
|
-
const { country } = event;
|
|
30
|
-
return { country };
|
|
31
|
-
}),
|
|
32
|
-
setBusinessName: assign(({ event }) => {
|
|
33
|
-
const { value } = event;
|
|
34
|
-
return {
|
|
35
|
-
businessName: value,
|
|
36
|
-
isValid: computeIsValid(value)
|
|
37
|
-
};
|
|
38
|
-
})
|
|
39
|
-
},
|
|
40
|
-
guards: { isValid: ({ context }) => context.isValid }
|
|
41
|
-
}).createMachine({
|
|
42
|
-
id: "watchlist-for-business",
|
|
43
|
-
initial: "idle",
|
|
44
|
-
context: {
|
|
45
|
-
country: DEFAULT_COUNTRY,
|
|
46
|
-
businessName: "",
|
|
47
|
-
isValid: false
|
|
48
|
-
},
|
|
49
|
-
states: {
|
|
50
|
-
idle: { on: { LOAD: { target: "form" } } },
|
|
51
|
-
form: { on: {
|
|
52
|
-
SET_COUNTRY: { actions: "setCountry" },
|
|
53
|
-
SET_BUSINESS_NAME: { actions: "setBusinessName" },
|
|
54
|
-
SUBMIT: {
|
|
55
|
-
target: "submitting",
|
|
56
|
-
guard: "isValid"
|
|
57
|
-
}
|
|
58
|
-
} },
|
|
59
|
-
submitting: { invoke: {
|
|
60
|
-
id: "submitWatchlistForBusiness",
|
|
61
|
-
src: "submitWatchlistForBusiness",
|
|
62
|
-
input: ({ context }) => ({
|
|
63
|
-
countryCodes: [context.country],
|
|
64
|
-
businessName: context.businessName
|
|
65
|
-
}),
|
|
66
|
-
onDone: { target: "success" },
|
|
67
|
-
onError: { target: "finished" }
|
|
68
|
-
} },
|
|
69
|
-
success: { after: { 3e3: { target: "finished" } } },
|
|
70
|
-
finished: { type: "final" }
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
//#endregion
|
|
75
|
-
//#region src/modules/watchlist-for-business/watchlistForBusinessActor.ts
|
|
76
|
-
function createWatchlistForBusinessActor() {
|
|
77
|
-
return createActor(watchlistForBusinessMachine).start();
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
//#endregion
|
|
81
|
-
//#region src/modules/watchlist-for-business/watchlistForBusinessManager.ts
|
|
82
|
-
function mapState(snapshot) {
|
|
83
|
-
const typedSnapshot = snapshot;
|
|
84
|
-
const { context } = typedSnapshot;
|
|
85
|
-
if (typedSnapshot.matches("form")) return {
|
|
86
|
-
status: "form",
|
|
87
|
-
country: context.country,
|
|
88
|
-
businessName: context.businessName,
|
|
89
|
-
isValid: context.isValid
|
|
90
|
-
};
|
|
91
|
-
if (typedSnapshot.matches("submitting")) return { status: "submitting" };
|
|
92
|
-
if (typedSnapshot.matches("success")) return { status: "success" };
|
|
93
|
-
if (typedSnapshot.matches("finished")) return { status: "finished" };
|
|
94
|
-
return { status: "idle" };
|
|
95
|
-
}
|
|
96
|
-
function createApi({ actor }) {
|
|
97
|
-
return {
|
|
98
|
-
load() {
|
|
99
|
-
actor.send({ type: "LOAD" });
|
|
100
|
-
},
|
|
101
|
-
setCountry(country) {
|
|
102
|
-
actor.send({
|
|
103
|
-
type: "SET_COUNTRY",
|
|
104
|
-
country
|
|
105
|
-
});
|
|
106
|
-
},
|
|
107
|
-
setBusinessName(value) {
|
|
108
|
-
actor.send({
|
|
109
|
-
type: "SET_BUSINESS_NAME",
|
|
110
|
-
value
|
|
111
|
-
});
|
|
112
|
-
},
|
|
113
|
-
submit() {
|
|
114
|
-
actor.send({ type: "SUBMIT" });
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Creates a watchlist-for-business manager for headless or UI-driven usage.
|
|
120
|
-
*
|
|
121
|
-
* On API error the module completes silently (fire-and-forget).
|
|
122
|
-
*
|
|
123
|
-
* @example Headless usage
|
|
124
|
-
* ```typescript
|
|
125
|
-
* import { createWatchlistForBusinessManager } from '@incodetech/core/watchlist-for-business';
|
|
126
|
-
*
|
|
127
|
-
* const manager = createWatchlistForBusinessManager();
|
|
128
|
-
* manager.subscribe((state) => {
|
|
129
|
-
* if (state.status === 'finished') console.log('Done');
|
|
130
|
-
* });
|
|
131
|
-
* manager.load();
|
|
132
|
-
* manager.setCountry('MX');
|
|
133
|
-
* manager.setBusinessName('Acme Corp');
|
|
134
|
-
* manager.submit();
|
|
135
|
-
* manager.stop();
|
|
136
|
-
* ```
|
|
137
|
-
*/
|
|
138
|
-
function createWatchlistForBusinessManager() {
|
|
139
|
-
return createManager({
|
|
140
|
-
actor: createWatchlistForBusinessActor(),
|
|
141
|
-
mapState,
|
|
142
|
-
createApi,
|
|
143
|
-
instrumentation: createManagerInstrumentation(eventModuleNames.watchlistForBusiness)
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
//#endregion
|
|
148
|
-
export { createWatchlistForBusinessManager, watchlistForBusinessMachine };
|
package/dist/watchlist.d.ts
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { t as Manager } from "./Manager-C8PrhBOx.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 };
|
package/dist/watchlist.esm.js
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import "./api-CESGtpbH.esm.js";
|
|
2
|
-
import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-D6-e4vok.esm.js";
|
|
3
|
-
import "./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
|
-
import { t as processWatchlist } from "./watchlistServices-DMbUhkBX.esm.js";
|
|
6
|
-
|
|
7
|
-
//#region src/modules/watchlist/watchlistStateMachine.ts
|
|
8
|
-
const watchlistMachine = setup({
|
|
9
|
-
types: {
|
|
10
|
-
context: {},
|
|
11
|
-
events: {}
|
|
12
|
-
},
|
|
13
|
-
actors: { processWatchlist: fromPromise(async ({ signal }) => {
|
|
14
|
-
await processWatchlist(signal);
|
|
15
|
-
}) },
|
|
16
|
-
actions: {
|
|
17
|
-
markSuccess: assign({ result: "success" }),
|
|
18
|
-
markSkipped: assign({ result: "skipped" })
|
|
19
|
-
}
|
|
20
|
-
}).createMachine({
|
|
21
|
-
id: "watchlist",
|
|
22
|
-
initial: "idle",
|
|
23
|
-
context: { result: null },
|
|
24
|
-
states: {
|
|
25
|
-
idle: { on: { LOAD: { target: "processing" } } },
|
|
26
|
-
processing: { invoke: {
|
|
27
|
-
id: "processWatchlist",
|
|
28
|
-
src: "processWatchlist",
|
|
29
|
-
onDone: { target: "success" },
|
|
30
|
-
onError: {
|
|
31
|
-
target: "finished",
|
|
32
|
-
actions: "markSkipped"
|
|
33
|
-
}
|
|
34
|
-
} },
|
|
35
|
-
success: { after: { 3e3: {
|
|
36
|
-
target: "finished",
|
|
37
|
-
actions: "markSuccess"
|
|
38
|
-
} } },
|
|
39
|
-
finished: { type: "final" }
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
//#endregion
|
|
44
|
-
//#region src/modules/watchlist/watchlistActor.ts
|
|
45
|
-
function createWatchlistActor() {
|
|
46
|
-
return createActor(watchlistMachine).start();
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
//#endregion
|
|
50
|
-
//#region src/modules/watchlist/watchlistManager.ts
|
|
51
|
-
function mapState(snapshot) {
|
|
52
|
-
const typedSnapshot = snapshot;
|
|
53
|
-
if (typedSnapshot.matches("processing")) return { status: "processing" };
|
|
54
|
-
if (typedSnapshot.matches("success")) return { status: "success" };
|
|
55
|
-
if (typedSnapshot.matches("finished")) return {
|
|
56
|
-
status: "finished",
|
|
57
|
-
result: typedSnapshot.context.result ?? "skipped"
|
|
58
|
-
};
|
|
59
|
-
return { status: "idle" };
|
|
60
|
-
}
|
|
61
|
-
function createApi({ actor }) {
|
|
62
|
-
return { load() {
|
|
63
|
-
actor.send({ type: "LOAD" });
|
|
64
|
-
} };
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Creates a global watchlist manager for headless or UI-driven usage.
|
|
68
|
-
*
|
|
69
|
-
* @example Headless usage
|
|
70
|
-
* ```typescript
|
|
71
|
-
* const manager = createWatchlistManager();
|
|
72
|
-
* manager.subscribe((state) => console.log(state.status));
|
|
73
|
-
* manager.load();
|
|
74
|
-
* ```
|
|
75
|
-
*/
|
|
76
|
-
function createWatchlistManager() {
|
|
77
|
-
return createManager({
|
|
78
|
-
actor: createWatchlistActor(),
|
|
79
|
-
mapState,
|
|
80
|
-
createApi,
|
|
81
|
-
instrumentation: createManagerInstrumentation(eventModuleNames.watchlist)
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
//#endregion
|
|
86
|
-
export { createWatchlistManager, watchlistMachine };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { t as api } from "./api-CESGtpbH.esm.js";
|
|
2
|
-
import { t as endpoints } from "./endpoints-CnN3SyDa.esm.js";
|
|
3
|
-
|
|
4
|
-
//#region src/modules/watchlist/watchlistServices.ts
|
|
5
|
-
async function processWatchlist(signal) {
|
|
6
|
-
const res = await api.post(endpoints.processWatchlist, {}, { signal });
|
|
7
|
-
if (!res.ok) throw new Error(`POST ${endpoints.processWatchlist} failed: ${res.status} ${res.statusText}`);
|
|
8
|
-
return res.data;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
//#endregion
|
|
12
|
-
export { processWatchlist as t };
|