@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.
- package/dist/BrowserStorageProvider-ByxoNfxC.esm.js +55 -0
- package/dist/{OpenViduRecordingProvider-Bn2meybK.esm.js → OpenViduRecordingProvider-JatjSE3h.esm.js} +1 -1
- package/dist/{WasmUtilProvider-BpZSvZbg.esm.js → WasmUtilProvider-DRh0wrlm.esm.js} +1 -1
- package/dist/{addressSearch-DOFI7lwy.esm.js → addressSearch-CDdN30un.esm.js} +4 -4
- package/dist/antifraud.d.ts +1 -1
- package/dist/antifraud.esm.js +4 -37
- package/dist/antifraudStateMachine-C1AgS0nL.esm.js +39 -0
- package/dist/authentication.d.ts +11 -11
- package/dist/authentication.esm.js +22 -19
- package/dist/{authenticationManager-C2mk36yK.d.ts → authenticationManager-DYFYx68i.d.ts} +2 -2
- package/dist/authenticationManager-UaO9UTN7.esm.js +67 -0
- package/dist/{authenticationManager-C7dL_avf.esm.js → authenticationStateMachine-DWI65EwK.esm.js} +7 -67
- package/dist/{backCameraStream-tabTmwDS.esm.js → backCameraStream-BihRmMzc.esm.js} +3 -3
- package/dist/camera.d.ts +1 -1
- package/dist/camera.esm.js +3 -3
- package/dist/consent.d.ts +57 -57
- package/dist/consent.esm.js +4 -149
- package/dist/consentStateMachine-CpRu2hF0.esm.js +151 -0
- 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 -417
- package/dist/curpValidationStateMachine-Czzgv2W1.esm.js +419 -0
- package/dist/{deepsightLoader-Cj6SyUQ-.esm.js → deepsightLoader-jIgoauFK.esm.js} +10 -10
- package/dist/{deepsightService-BjgXl5hs.esm.js → deepsightService-D4mM8yJ2.esm.js} +5 -5
- package/dist/{deepsightService-ByD6uIs7.d.ts → deepsightService-DAeakjDd.d.ts} +2 -2
- package/dist/device.esm.js +3 -3
- package/dist/document-capture.d.ts +75 -73
- package/dist/document-capture.esm.js +8 -403
- package/dist/document-upload.d.ts +50 -50
- package/dist/document-upload.esm.js +7 -7
- package/dist/documentCaptureStateMachine-XbpsHzh5.esm.js +403 -0
- package/dist/ekyb.d.ts +3 -3
- package/dist/ekyb.esm.js +10 -655
- package/dist/ekybStateMachine-BDuCae6s.esm.js +653 -0
- package/dist/ekyc.d.ts +3 -3
- package/dist/ekyc.esm.js +6 -10614
- package/dist/ekycStateMachine-BN4KBDYY.esm.js +10615 -0
- package/dist/email.d.ts +3 -3
- package/dist/email.esm.js +6 -5
- package/dist/emailManager-CAeo59lD.esm.js +238 -0
- package/dist/{emailManager-CU_hzrsl.d.ts → emailManager-CZYfcu0n.d.ts} +4 -3
- package/dist/{emailManager-_9R4vm6g.esm.js → emailStateMachine-Bqwe_sQS.esm.js} +6 -239
- package/dist/{events-DlHrOIRc.esm.js → events-CZ2ka3pu.esm.js} +8 -1
- package/dist/events.d.ts +1 -0
- package/dist/events.esm.js +2 -2
- package/dist/extensibility.d.ts +15 -15
- package/dist/extensibility.esm.js +33 -26
- package/dist/face-match.d.ts +7 -6
- package/dist/face-match.esm.js +8 -129
- package/dist/faceCaptureManagerFactory-D8zlMTvd.esm.js +117 -0
- package/dist/{faceCaptureManagerFactory-Da_-ohdg.d.ts → faceCaptureManagerFactory-DS-6yCya.d.ts} +8 -8
- package/dist/{faceCaptureSetup-CaVWkjvE.esm.js → faceCaptureSetup-1M6uUEjK.esm.js} +5 -119
- package/dist/faceMatchStateMachine-D3DuP_ya.esm.js +127 -0
- package/dist/flow.d.ts +8 -13
- package/dist/flow.esm.js +10 -29
- package/dist/{flowCompletionService-B5JemmC6.esm.js → flowCompletionService-W6bj7Xd3.esm.js} +2 -2
- package/dist/{flowServices-p22wrYPf.esm.js → flowServices-C4tjBD8q.esm.js} +3 -3
- package/dist/geolocation.d.ts +7 -6
- package/dist/geolocation.esm.js +7 -105
- package/dist/geolocationStateMachine-Bj2LkGwy.esm.js +105 -0
- package/dist/{getDeviceClass-DEzz4cmY.esm.js → getDeviceClass-BoiWvKAc.esm.js} +1 -1
- package/dist/government-validation.d.ts +2 -2
- package/dist/government-validation.esm.js +5 -269
- package/dist/governmentValidationStateMachine-W1CzRjVw.esm.js +271 -0
- package/dist/http.esm.js +1 -1
- package/dist/id.d.ts +10 -10
- package/dist/id.esm.js +22 -20
- package/dist/idCaptureManager-BcS8fgW4.esm.js +335 -0
- package/dist/{idCaptureManager-CV08v1e3.d.ts → idCaptureManager-oR6YPYHj.d.ts} +7 -7
- package/dist/{idCaptureManager-dyZzKv8L.esm.js → idCaptureStateMachine-MAzfM_2O.esm.js} +17 -346
- package/dist/identity-reuse.d.ts +530 -0
- package/dist/identity-reuse.esm.js +273 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.esm.js +8 -8
- package/dist/{lib-Bavz2qmt.esm.js → lib-CxDxnzRd.esm.js} +1 -1
- package/dist/mandatory-consent.d.ts +55 -55
- package/dist/mandatory-consent.esm.js +4 -124
- package/dist/mandatoryConsentStateMachine-BMKi26Re.esm.js +126 -0
- package/dist/{openviduLazy-vhrVZCr_.esm.js → openviduLazy-B8tinh9W.esm.js} +2 -2
- package/dist/openviduLazy-CItjpMfL.esm.js +3 -0
- package/dist/{permissionServices-Cskq32Yd.esm.js → permissionServices-Cj120WaT.esm.js} +2 -2
- package/dist/phone.d.ts +3 -3
- package/dist/phone.esm.js +6 -5
- package/dist/phoneManager-Bvj6Jr4o.esm.js +258 -0
- package/dist/{phoneManager-ulJuGvJ8.d.ts → phoneManager-CCMCkyYr.d.ts} +2 -2
- package/dist/{phoneManager-DerdUfd4.esm.js → phoneStateMachine-B1t1Z-Dd.esm.js} +5 -258
- package/dist/{recordingService-483wQ6kR.esm.js → recordingService-8I_-hhNI.esm.js} +14 -68
- package/dist/redirect-to-mobile.d.ts +2 -2
- package/dist/redirect-to-mobile.esm.js +5 -247
- package/dist/redirectToMobileStateMachine-BVP1KcoO.esm.js +249 -0
- package/dist/runChildModule-B5DEiOS7.esm.js +27 -0
- package/dist/selfie.d.ts +11 -11
- package/dist/selfie.esm.js +22 -19
- package/dist/selfieManager-B6x3O5Ns.esm.js +60 -0
- package/dist/{selfieManager-DCRP7X75.d.ts → selfieManager-gizt3Zha.d.ts} +2 -2
- package/dist/selfieStateMachine-DHPSBFj0.esm.js +56 -0
- package/dist/{session-CUh77zj3.esm.js → session-DoI-X9FK.esm.js} +4 -4
- package/dist/session.d.ts +1 -1
- package/dist/session.esm.js +6 -6
- package/dist/{setup-XpxfZgKn.esm.js → setup-Bh2S53NT.esm.js} +6 -5
- package/dist/{setup-DpHakxsC.d.ts → setup-Bz3Ffaoc.d.ts} +1 -1
- package/dist/signature.d.ts +4 -3
- package/dist/signature.esm.js +6 -189
- package/dist/signatureStateMachine-Cv7yPuEf.esm.js +189 -0
- package/dist/{stats-DHDoqSBV.esm.js → stats-wkQyDFV3.esm.js} +1 -1
- package/dist/stats.esm.js +2 -2
- package/dist/types-BdEM5Jj7.d.ts +35 -0
- package/dist/{types-2OPf1pyv.d.ts → types-CdlQrTiZ.d.ts} +1 -1
- package/dist/{types-CVJVQ7fp.d.ts → types-m43DfiSx.d.ts} +1 -1
- package/dist/wasm.d.ts +2 -2
- package/dist/wasm.esm.js +8 -8
- package/dist/workflow.d.ts +813 -0
- package/dist/workflow.esm.js +600 -0
- package/package.json +11 -3
- package/dist/openviduLazy-BIPHozOu.esm.js +0 -3
- package/dist/selfieManager-DeOcNel4.esm.js +0 -110
- /package/dist/{Actor-Ba71-_30.d.ts → Actor-BkPcZGke.d.ts} +0 -0
- /package/dist/{BaseWasmProvider-D-s_6M5H.esm.js → BaseWasmProvider-C73c2nV9.esm.js} +0 -0
- /package/dist/{BrowserEnvironmentProvider-DaHeLJQw.esm.js → BrowserEnvironmentProvider-lxn4oxXn.esm.js} +0 -0
- /package/dist/{BrowserTimerProvider-BhD2MlHg.esm.js → BrowserTimerProvider-CSdm7__S.esm.js} +0 -0
- /package/dist/{ITimerCapability-oixwa6nj.esm.js → ITimerCapability-DAIaq369.esm.js} +0 -0
- /package/dist/{Manager-BN2g_I8W.d.ts → Manager-Bcnemkyi.d.ts} +0 -0
- /package/dist/{MotionSensorProvider-CodM3e0E.esm.js → MotionSensorProvider-BLnFo6My.esm.js} +0 -0
- /package/dist/{StateMachine-BoJsfMvg.d.ts → StateMachine-DIeoDJ7r.d.ts} +0 -0
- /package/dist/{api-DzpnV6O7.esm.js → api-CqKwkjJ3.esm.js} +0 -0
- /package/dist/{browserSimulation-B4ubb2OL.esm.js → browserSimulation-7W5-A3RV.esm.js} +0 -0
- /package/dist/{camera-DmkFpf5N.esm.js → camera-B-5traWf.esm.js} +0 -0
- /package/dist/{camera-1eeGnAaL.d.ts → camera-CgnuDuxy.d.ts} +0 -0
- /package/dist/{chunk-DsxENsBR.esm.js → chunk-Qw4qVmMx.esm.js} +0 -0
- /package/dist/{displayErrors-BZLX7idb.d.ts → displayErrors-C9-VaqmS.d.ts} +0 -0
- /package/dist/{flowCompletionService-D-3YCHyO.d.ts → flowCompletionService-CPLdZxe-.d.ts} +0 -0
- /package/dist/{getBrowser-Dtyt9J_h.esm.js → getBrowser-DJkbzQ5t.esm.js} +0 -0
- /package/dist/{platform-Dv7a2fv-.esm.js → platform-BfoqeM61.esm.js} +0 -0
- /package/dist/{types-D_QfFKxT.d.ts → types-CxU9jTRl.d.ts} +0 -0
- /package/dist/{warmup-CIj_wEV_.d.ts → warmup-Cs0uqxUW.d.ts} +0 -0
- /package/dist/{xstate.esm-Bv55-lJ4.esm.js → xstate.esm-D7D6CGwY.esm.js} +0 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { t as api } from "./api-CqKwkjJ3.esm.js";
|
|
2
|
+
import { _ as endpoints } from "./events-CZ2ka3pu.esm.js";
|
|
3
|
+
import { i as fromPromise, n as assign, t as setup } from "./xstate.esm-D7D6CGwY.esm.js";
|
|
4
|
+
|
|
5
|
+
//#region src/modules/face-match/faceMatchServices.ts
|
|
6
|
+
/**
|
|
7
|
+
* Fetches cropped face images from the backend.
|
|
8
|
+
*/
|
|
9
|
+
async function fetchFaceMatchImages(signal) {
|
|
10
|
+
const res = await api.post(endpoints.getImagesV2, { images: [
|
|
11
|
+
"croppedFace",
|
|
12
|
+
"croppedIDFace",
|
|
13
|
+
"croppedAuthenticationSelfie"
|
|
14
|
+
] }, { signal });
|
|
15
|
+
if (!res.ok) throw new Error(`POST ${endpoints.getImagesV2} failed: ${res.status} ${res.statusText}`);
|
|
16
|
+
const data = res.data;
|
|
17
|
+
return {
|
|
18
|
+
idFace: data.croppedIDFace ?? null,
|
|
19
|
+
selfie: data.croppedFace ?? data.croppedAuthenticationSelfie ?? null,
|
|
20
|
+
secondIdFace: void 0
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Fetches face recognition score from the backend.
|
|
25
|
+
*/
|
|
26
|
+
async function fetchScore(signal) {
|
|
27
|
+
const res = await api.get(endpoints.getScore, { signal });
|
|
28
|
+
if (!res.ok) throw new Error(`GET ${endpoints.getScore} failed: ${res.status} ${res.statusText}`);
|
|
29
|
+
const data = res.data;
|
|
30
|
+
return {
|
|
31
|
+
matched: data.faceRecognition?.overall?.status === "OK" ? true : data.faceRecognition?.overall?.status === "FAIL" ? false : null,
|
|
32
|
+
liveness: data.deepsight ? data.deepsight.multimodalIntelligence?.overall?.status === "OK" : data.liveness?.overall?.status === "OK"
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Fetches second ID face images from the backend.
|
|
37
|
+
*/
|
|
38
|
+
async function fetchSecondIdImages(signal) {
|
|
39
|
+
const res = await api.post(endpoints.getImagesSecondId, { images: ["croppedIDFace"] }, { signal });
|
|
40
|
+
if (!res.ok) throw new Error(`POST ${endpoints.getImagesSecondId} failed: ${res.status} ${res.statusText}`);
|
|
41
|
+
return { secondIdFace: res.data.croppedIDFace ?? null };
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Fetches all face match data in parallel (images, score, and optionally second ID images).
|
|
45
|
+
*/
|
|
46
|
+
async function fetchFaceMatchData(config, signal) {
|
|
47
|
+
const promises = [fetchFaceMatchImages(signal), fetchScore(signal)];
|
|
48
|
+
if (config.matchingType === "secondId") promises.push(fetchSecondIdImages(signal));
|
|
49
|
+
const [imagesRes, resultRes, secondIdRes] = await Promise.all(promises);
|
|
50
|
+
return {
|
|
51
|
+
images: {
|
|
52
|
+
...imagesRes,
|
|
53
|
+
secondIdFace: secondIdRes?.secondIdFace ?? null
|
|
54
|
+
},
|
|
55
|
+
result: resultRes
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
//#endregion
|
|
60
|
+
//#region src/modules/face-match/faceMatchStateMachine.ts
|
|
61
|
+
const faceMatchMachine = setup({
|
|
62
|
+
types: {
|
|
63
|
+
context: {},
|
|
64
|
+
events: {},
|
|
65
|
+
input: {}
|
|
66
|
+
},
|
|
67
|
+
actors: { fetchData: fromPromise(async ({ input, signal }) => {
|
|
68
|
+
return fetchFaceMatchData(input.config, signal);
|
|
69
|
+
}) },
|
|
70
|
+
actions: {
|
|
71
|
+
setData: assign(({ event }) => {
|
|
72
|
+
const output = event.output;
|
|
73
|
+
return {
|
|
74
|
+
images: output.images,
|
|
75
|
+
result: output.result
|
|
76
|
+
};
|
|
77
|
+
}),
|
|
78
|
+
setError: assign(({ event }) => ({ error: String(event.error) })),
|
|
79
|
+
clearError: assign({ error: () => void 0 }),
|
|
80
|
+
resetContext: assign(({ context }) => ({
|
|
81
|
+
config: context.config,
|
|
82
|
+
images: null,
|
|
83
|
+
result: null,
|
|
84
|
+
error: void 0
|
|
85
|
+
}))
|
|
86
|
+
},
|
|
87
|
+
guards: { isAnimationDisabled: ({ context }) => context.config.disableFaceMatchAnimation === true }
|
|
88
|
+
}).createMachine({
|
|
89
|
+
id: "faceMatch",
|
|
90
|
+
initial: "idle",
|
|
91
|
+
context: ({ input }) => ({
|
|
92
|
+
config: input.config,
|
|
93
|
+
images: null,
|
|
94
|
+
result: null,
|
|
95
|
+
error: void 0
|
|
96
|
+
}),
|
|
97
|
+
states: {
|
|
98
|
+
idle: { on: { LOAD: { target: "loading" } } },
|
|
99
|
+
loading: { invoke: {
|
|
100
|
+
id: "fetchData",
|
|
101
|
+
src: "fetchData",
|
|
102
|
+
input: ({ context }) => ({ config: context.config }),
|
|
103
|
+
onDone: [{
|
|
104
|
+
target: "finished",
|
|
105
|
+
guard: "isAnimationDisabled",
|
|
106
|
+
actions: "setData"
|
|
107
|
+
}, {
|
|
108
|
+
target: "animating",
|
|
109
|
+
actions: "setData"
|
|
110
|
+
}],
|
|
111
|
+
onError: {
|
|
112
|
+
target: "error",
|
|
113
|
+
actions: "setError"
|
|
114
|
+
}
|
|
115
|
+
} },
|
|
116
|
+
animating: { on: { ANIMATION_COMPLETE: { target: "result" } } },
|
|
117
|
+
result: { on: { CONTINUE: { target: "finished" } } },
|
|
118
|
+
finished: { type: "final" },
|
|
119
|
+
error: { on: { RESET: {
|
|
120
|
+
target: "idle",
|
|
121
|
+
actions: "resetContext"
|
|
122
|
+
} } }
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
//#endregion
|
|
127
|
+
export { faceMatchMachine as t };
|
package/dist/flow.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { n as WasmPipeline } from "./warmup-
|
|
2
|
-
import { t as Manager } from "./Manager-
|
|
3
|
-
import { t as AnyStateMachine } from "./StateMachine-
|
|
4
|
-
import "./camera-
|
|
5
|
-
import "./types-
|
|
6
|
-
import { n as FlowModule, r as FlowModuleConfig, t as Flow } from "./types-
|
|
7
|
-
import { n as GetFinishStatusFn, t as FinishStatus } from "./flowCompletionService-
|
|
1
|
+
import { n as WasmPipeline } from "./warmup-Cs0uqxUW.js";
|
|
2
|
+
import { t as Manager } from "./Manager-Bcnemkyi.js";
|
|
3
|
+
import { t as AnyStateMachine } from "./StateMachine-DIeoDJ7r.js";
|
|
4
|
+
import "./camera-CgnuDuxy.js";
|
|
5
|
+
import "./types-CdlQrTiZ.js";
|
|
6
|
+
import { n as FlowModule, r as FlowModuleConfig, t as Flow } from "./types-m43DfiSx.js";
|
|
7
|
+
import { n as GetFinishStatusFn, t as FinishStatus } from "./flowCompletionService-CPLdZxe-.js";
|
|
8
|
+
import { t as ModuleRegistry } from "./types-BdEM5Jj7.js";
|
|
8
9
|
|
|
9
10
|
//#region src/modules/flow/flowUtils.d.ts
|
|
10
11
|
|
|
@@ -177,12 +178,6 @@ declare function createModuleLoader(registry: ModuleLoaderRegistry): ModuleLoade
|
|
|
177
178
|
//#endregion
|
|
178
179
|
//#region src/modules/flow/orchestratedFlowStateMachine.d.ts
|
|
179
180
|
type GetFlowFn = (signal: AbortSignal) => Promise<Flow>;
|
|
180
|
-
type ModuleRegistry = {
|
|
181
|
-
PHONE?: AnyStateMachine;
|
|
182
|
-
EMAIL?: AnyStateMachine;
|
|
183
|
-
SELFIE?: AnyStateMachine;
|
|
184
|
-
[key: string]: AnyStateMachine | undefined;
|
|
185
|
-
};
|
|
186
181
|
type LazyModuleRegistry = {
|
|
187
182
|
[key: string]: (() => Promise<AnyStateMachine | {
|
|
188
183
|
default: AnyStateMachine;
|
package/dist/flow.esm.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import "./api-
|
|
2
|
-
import { o as createManagerInstrumentation } from "./events-
|
|
3
|
-
import "./session-
|
|
4
|
-
import "./BrowserEnvironmentProvider-
|
|
5
|
-
import "./browserSimulation-
|
|
6
|
-
import { a as createActor, i as fromPromise, n as assign, o as createManager,
|
|
7
|
-
import { n as getRequiredWasmPipelines, r as normalizeFlowModules, t as getFlow } from "./flowServices-
|
|
8
|
-
import { t as getFinishStatus } from "./flowCompletionService-
|
|
1
|
+
import "./api-CqKwkjJ3.esm.js";
|
|
2
|
+
import { o as createManagerInstrumentation } from "./events-CZ2ka3pu.esm.js";
|
|
3
|
+
import "./session-DoI-X9FK.esm.js";
|
|
4
|
+
import "./BrowserEnvironmentProvider-lxn4oxXn.esm.js";
|
|
5
|
+
import "./browserSimulation-7W5-A3RV.esm.js";
|
|
6
|
+
import { a as createActor, i as fromPromise, n as assign, o as createManager, t as setup } from "./xstate.esm-D7D6CGwY.esm.js";
|
|
7
|
+
import { n as getRequiredWasmPipelines, r as normalizeFlowModules, t as getFlow } from "./flowServices-C4tjBD8q.esm.js";
|
|
8
|
+
import { t as getFinishStatus } from "./flowCompletionService-W6bj7Xd3.esm.js";
|
|
9
|
+
import { t as runChildModule } from "./runChildModule-B5DEiOS7.esm.js";
|
|
9
10
|
|
|
10
11
|
//#region src/modules/flow/flowStateMachine.ts
|
|
11
12
|
const flowMachine = setup({
|
|
@@ -299,27 +300,7 @@ const orchestratedFlowMachine = setup({
|
|
|
299
300
|
notifyBackend: fromPromise(async ({ input, signal }) => {
|
|
300
301
|
return await input.getFinishStatus(input.flowId, signal);
|
|
301
302
|
}),
|
|
302
|
-
runChildModule
|
|
303
|
-
const { machine, config } = input;
|
|
304
|
-
if (!machine) return () => {};
|
|
305
|
-
const actor = createActor(machine, { input: { config } });
|
|
306
|
-
const subscription = actor.subscribe({
|
|
307
|
-
complete: () => {
|
|
308
|
-
sendBack({ type: "MODULE_COMPLETE" });
|
|
309
|
-
},
|
|
310
|
-
error: (err) => {
|
|
311
|
-
sendBack({
|
|
312
|
-
type: "MODULE_ERROR",
|
|
313
|
-
error: err
|
|
314
|
-
});
|
|
315
|
-
}
|
|
316
|
-
});
|
|
317
|
-
actor.start();
|
|
318
|
-
return () => {
|
|
319
|
-
subscription.unsubscribe();
|
|
320
|
-
actor.stop();
|
|
321
|
-
};
|
|
322
|
-
}),
|
|
303
|
+
runChildModule,
|
|
323
304
|
resolveCurrentModuleMachine: fromPromise(async ({ input }) => {
|
|
324
305
|
if (!input.moduleKey) return;
|
|
325
306
|
const eagerMachine = input.modules[input.moduleKey];
|
package/dist/{flowCompletionService-B5JemmC6.esm.js → flowCompletionService-W6bj7Xd3.esm.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as api } from "./api-
|
|
2
|
-
import { _ as endpoints } from "./events-
|
|
1
|
+
import { t as api } from "./api-CqKwkjJ3.esm.js";
|
|
2
|
+
import { _ as endpoints } from "./events-CZ2ka3pu.esm.js";
|
|
3
3
|
|
|
4
4
|
//#region src/modules/flow/flowCompletionService.ts
|
|
5
5
|
const getFinishStatus = async (flowId, signal) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as api } from "./api-
|
|
2
|
-
import { _ as endpoints } from "./events-
|
|
3
|
-
import { n as getSessionFingerprintResult, r as initializeSession } from "./session-
|
|
1
|
+
import { t as api } from "./api-CqKwkjJ3.esm.js";
|
|
2
|
+
import { _ as endpoints } from "./events-CZ2ka3pu.esm.js";
|
|
3
|
+
import { n as getSessionFingerprintResult, r as initializeSession } from "./session-DoI-X9FK.esm.js";
|
|
4
4
|
|
|
5
5
|
//#region src/modules/flow/flowUtils.ts
|
|
6
6
|
const WASM_MODULE_PIPELINES = {
|
package/dist/geolocation.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as Manager } from "./Manager-
|
|
2
|
-
import "./Actor-
|
|
1
|
+
import { t as Manager } from "./Manager-Bcnemkyi.js";
|
|
2
|
+
import "./Actor-BkPcZGke.js";
|
|
3
3
|
|
|
4
4
|
//#region ../infra/src/capabilities/IGeolocationCapability.d.ts
|
|
5
5
|
type GeolocationCoords = {
|
|
@@ -17,7 +17,7 @@ type IGeolocationCapability = {
|
|
|
17
17
|
* @example
|
|
18
18
|
* ```typescript
|
|
19
19
|
* const config: GeolocationConfig = {
|
|
20
|
-
*
|
|
20
|
+
* allowUserToSkipGeolocation: true,
|
|
21
21
|
* };
|
|
22
22
|
* ```
|
|
23
23
|
*/
|
|
@@ -25,9 +25,10 @@ type GeolocationConfig = {
|
|
|
25
25
|
/**
|
|
26
26
|
* Whether the user is allowed to skip geolocation capture.
|
|
27
27
|
* When true, a skip button is shown on the permission-denied screen.
|
|
28
|
+
* Backend field name from flow/workflow configuration.
|
|
28
29
|
* @default false
|
|
29
30
|
*/
|
|
30
|
-
|
|
31
|
+
allowUserToSkipGeolocation?: boolean;
|
|
31
32
|
};
|
|
32
33
|
//#endregion
|
|
33
34
|
//#region src/modules/geolocation/geolocationStateMachine.d.ts
|
|
@@ -95,7 +96,7 @@ type GeolocationState = GeolocationIdleState | GeolocationRequestingState | Geol
|
|
|
95
96
|
*
|
|
96
97
|
* @example Headless usage
|
|
97
98
|
* ```typescript
|
|
98
|
-
* const manager = createGeolocationManager({ config: {
|
|
99
|
+
* const manager = createGeolocationManager({ config: { allowUserToSkipGeolocation: true } });
|
|
99
100
|
* manager.subscribe((state) => console.log(state.status));
|
|
100
101
|
* manager.request();
|
|
101
102
|
* ```
|
|
@@ -113,7 +114,7 @@ declare function createGeolocationManager(options: CreateGeolocationActorOptions
|
|
|
113
114
|
continue(): void;
|
|
114
115
|
/**
|
|
115
116
|
* Skips geolocation when the user has denied permission.
|
|
116
|
-
* Only works when `config.
|
|
117
|
+
* Only works when `config.allowUserToSkipGeolocation` is true.
|
|
117
118
|
*/
|
|
118
119
|
skip(): void;
|
|
119
120
|
/**
|
package/dist/geolocation.esm.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { a as createActor,
|
|
4
|
-
import
|
|
1
|
+
import "./api-CqKwkjJ3.esm.js";
|
|
2
|
+
import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-CZ2ka3pu.esm.js";
|
|
3
|
+
import { a as createActor, o as createManager } from "./xstate.esm-D7D6CGwY.esm.js";
|
|
4
|
+
import "./platform-BfoqeM61.esm.js";
|
|
5
|
+
import { t as geolocationMachine } from "./geolocationStateMachine-Bj2LkGwy.esm.js";
|
|
5
6
|
|
|
6
7
|
//#region ../infra/src/providers/browser/BrowserGeolocationProvider.ts
|
|
7
8
|
var BrowserGeolocationProvider = class {
|
|
@@ -15,105 +16,6 @@ var BrowserGeolocationProvider = class {
|
|
|
15
16
|
}
|
|
16
17
|
};
|
|
17
18
|
|
|
18
|
-
//#endregion
|
|
19
|
-
//#region src/modules/geolocation/geolocationServices.ts
|
|
20
|
-
async function addGeolocation(params, signal) {
|
|
21
|
-
const res = await api.post(endpoints.addGeolocation, {
|
|
22
|
-
latitude: params.latitude,
|
|
23
|
-
longitude: params.longitude
|
|
24
|
-
}, { signal });
|
|
25
|
-
if (!res.ok) throw new Error(`POST ${endpoints.addGeolocation} failed: ${res.status} ${res.statusText}`);
|
|
26
|
-
return res.data;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
//#endregion
|
|
30
|
-
//#region src/modules/geolocation/geolocationStateMachine.ts
|
|
31
|
-
function detectDeviceType() {
|
|
32
|
-
if (isIOS()) return "ios";
|
|
33
|
-
if (isAndroid()) return "android";
|
|
34
|
-
return "desktop";
|
|
35
|
-
}
|
|
36
|
-
const geolocationMachine = setup({
|
|
37
|
-
types: {
|
|
38
|
-
context: {},
|
|
39
|
-
events: {},
|
|
40
|
-
input: {}
|
|
41
|
-
},
|
|
42
|
-
actors: {
|
|
43
|
-
requestPosition: fromPromise(async ({ input }) => {
|
|
44
|
-
return input.geolocation.getCurrentPosition();
|
|
45
|
-
}),
|
|
46
|
-
submitPosition: fromPromise(async ({ input, signal }) => {
|
|
47
|
-
try {
|
|
48
|
-
return await addGeolocation(input, signal);
|
|
49
|
-
} catch {
|
|
50
|
-
return { location: "Unknown" };
|
|
51
|
-
}
|
|
52
|
-
})
|
|
53
|
-
},
|
|
54
|
-
actions: {
|
|
55
|
-
setCoords: assign(({ event }) => ({ coords: event.output })),
|
|
56
|
-
setLocation: assign(({ event }) => ({ location: event.output.location })),
|
|
57
|
-
setDeviceType: assign({ deviceType: () => detectDeviceType() }),
|
|
58
|
-
resetContext: assign(({ context }) => ({
|
|
59
|
-
config: context.config,
|
|
60
|
-
geolocation: context.geolocation,
|
|
61
|
-
coords: void 0,
|
|
62
|
-
location: void 0,
|
|
63
|
-
deviceType: detectDeviceType()
|
|
64
|
-
}))
|
|
65
|
-
},
|
|
66
|
-
guards: { canSkip: ({ context }) => context.config.allowSkip === true }
|
|
67
|
-
}).createMachine({
|
|
68
|
-
id: "geolocation",
|
|
69
|
-
initial: "idle",
|
|
70
|
-
context: ({ input }) => ({
|
|
71
|
-
config: input.config,
|
|
72
|
-
geolocation: input.geolocation,
|
|
73
|
-
coords: void 0,
|
|
74
|
-
location: void 0,
|
|
75
|
-
deviceType: detectDeviceType()
|
|
76
|
-
}),
|
|
77
|
-
states: {
|
|
78
|
-
idle: { on: { REQUEST: { target: "requestingLocation" } } },
|
|
79
|
-
requestingLocation: { invoke: {
|
|
80
|
-
id: "requestPosition",
|
|
81
|
-
src: "requestPosition",
|
|
82
|
-
input: ({ context }) => ({ geolocation: context.geolocation }),
|
|
83
|
-
onDone: {
|
|
84
|
-
target: "submitting",
|
|
85
|
-
actions: "setCoords"
|
|
86
|
-
},
|
|
87
|
-
onError: {
|
|
88
|
-
target: "permissionDenied",
|
|
89
|
-
actions: "setDeviceType"
|
|
90
|
-
}
|
|
91
|
-
} },
|
|
92
|
-
submitting: { invoke: {
|
|
93
|
-
id: "submitPosition",
|
|
94
|
-
src: "submitPosition",
|
|
95
|
-
input: ({ context }) => ({
|
|
96
|
-
latitude: context.coords?.latitude ?? 0,
|
|
97
|
-
longitude: context.coords?.longitude ?? 0
|
|
98
|
-
}),
|
|
99
|
-
onDone: {
|
|
100
|
-
target: "locationAcquired",
|
|
101
|
-
actions: "setLocation"
|
|
102
|
-
},
|
|
103
|
-
onError: {
|
|
104
|
-
target: "locationAcquired",
|
|
105
|
-
actions: assign({ location: () => "Unknown" })
|
|
106
|
-
}
|
|
107
|
-
} },
|
|
108
|
-
locationAcquired: { on: { CONTINUE: { target: "finished" } } },
|
|
109
|
-
permissionDenied: { on: { SKIP: {
|
|
110
|
-
target: "finished",
|
|
111
|
-
guard: "canSkip"
|
|
112
|
-
} } },
|
|
113
|
-
finished: { type: "final" }
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
|
|
117
19
|
//#endregion
|
|
118
20
|
//#region src/modules/geolocation/geolocationActor.ts
|
|
119
21
|
function createGeolocationActor(options) {
|
|
@@ -139,7 +41,7 @@ function mapState(snapshot) {
|
|
|
139
41
|
if (typedSnapshot.matches("permissionDenied")) return {
|
|
140
42
|
status: "permissionDenied",
|
|
141
43
|
deviceType: context.deviceType,
|
|
142
|
-
canSkip: context.config.
|
|
44
|
+
canSkip: context.config.allowUserToSkipGeolocation === true
|
|
143
45
|
};
|
|
144
46
|
if (typedSnapshot.matches("finished")) return { status: "finished" };
|
|
145
47
|
return { status: "idle" };
|
|
@@ -168,7 +70,7 @@ function createApi({ actor, trackElementClicked }) {
|
|
|
168
70
|
*
|
|
169
71
|
* @example Headless usage
|
|
170
72
|
* ```typescript
|
|
171
|
-
* const manager = createGeolocationManager({ config: {
|
|
73
|
+
* const manager = createGeolocationManager({ config: { allowUserToSkipGeolocation: true } });
|
|
172
74
|
* manager.subscribe((state) => console.log(state.status));
|
|
173
75
|
* manager.request();
|
|
174
76
|
* ```
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { t as api } from "./api-CqKwkjJ3.esm.js";
|
|
2
|
+
import { _ as endpoints } from "./events-CZ2ka3pu.esm.js";
|
|
3
|
+
import { i as fromPromise, n as assign, t as setup } from "./xstate.esm-D7D6CGwY.esm.js";
|
|
4
|
+
import { r as isIOS, t as isAndroid } from "./platform-BfoqeM61.esm.js";
|
|
5
|
+
|
|
6
|
+
//#region src/modules/geolocation/geolocationServices.ts
|
|
7
|
+
async function addGeolocation(params, signal) {
|
|
8
|
+
const res = await api.post(endpoints.addGeolocation, {
|
|
9
|
+
latitude: params.latitude,
|
|
10
|
+
longitude: params.longitude
|
|
11
|
+
}, { signal });
|
|
12
|
+
if (!res.ok) throw new Error(`POST ${endpoints.addGeolocation} failed: ${res.status} ${res.statusText}`);
|
|
13
|
+
return res.data;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/modules/geolocation/geolocationStateMachine.ts
|
|
18
|
+
function detectDeviceType() {
|
|
19
|
+
if (isIOS()) return "ios";
|
|
20
|
+
if (isAndroid()) return "android";
|
|
21
|
+
return "desktop";
|
|
22
|
+
}
|
|
23
|
+
const geolocationMachine = setup({
|
|
24
|
+
types: {
|
|
25
|
+
context: {},
|
|
26
|
+
events: {},
|
|
27
|
+
input: {}
|
|
28
|
+
},
|
|
29
|
+
actors: {
|
|
30
|
+
requestPosition: fromPromise(async ({ input }) => {
|
|
31
|
+
return input.geolocation.getCurrentPosition();
|
|
32
|
+
}),
|
|
33
|
+
submitPosition: fromPromise(async ({ input, signal }) => {
|
|
34
|
+
try {
|
|
35
|
+
return await addGeolocation(input, signal);
|
|
36
|
+
} catch {
|
|
37
|
+
return { location: "Unknown" };
|
|
38
|
+
}
|
|
39
|
+
})
|
|
40
|
+
},
|
|
41
|
+
actions: {
|
|
42
|
+
setCoords: assign(({ event }) => ({ coords: event.output })),
|
|
43
|
+
setLocation: assign(({ event }) => ({ location: event.output.location })),
|
|
44
|
+
setDeviceType: assign({ deviceType: () => detectDeviceType() }),
|
|
45
|
+
resetContext: assign(({ context }) => ({
|
|
46
|
+
config: context.config,
|
|
47
|
+
geolocation: context.geolocation,
|
|
48
|
+
coords: void 0,
|
|
49
|
+
location: void 0,
|
|
50
|
+
deviceType: detectDeviceType()
|
|
51
|
+
}))
|
|
52
|
+
},
|
|
53
|
+
guards: { canSkip: ({ context }) => context.config.allowUserToSkipGeolocation === true }
|
|
54
|
+
}).createMachine({
|
|
55
|
+
id: "geolocation",
|
|
56
|
+
initial: "idle",
|
|
57
|
+
context: ({ input }) => ({
|
|
58
|
+
config: input.config,
|
|
59
|
+
geolocation: input.geolocation,
|
|
60
|
+
coords: void 0,
|
|
61
|
+
location: void 0,
|
|
62
|
+
deviceType: detectDeviceType()
|
|
63
|
+
}),
|
|
64
|
+
states: {
|
|
65
|
+
idle: { on: { REQUEST: { target: "requestingLocation" } } },
|
|
66
|
+
requestingLocation: { invoke: {
|
|
67
|
+
id: "requestPosition",
|
|
68
|
+
src: "requestPosition",
|
|
69
|
+
input: ({ context }) => ({ geolocation: context.geolocation }),
|
|
70
|
+
onDone: {
|
|
71
|
+
target: "submitting",
|
|
72
|
+
actions: "setCoords"
|
|
73
|
+
},
|
|
74
|
+
onError: {
|
|
75
|
+
target: "permissionDenied",
|
|
76
|
+
actions: "setDeviceType"
|
|
77
|
+
}
|
|
78
|
+
} },
|
|
79
|
+
submitting: { invoke: {
|
|
80
|
+
id: "submitPosition",
|
|
81
|
+
src: "submitPosition",
|
|
82
|
+
input: ({ context }) => ({
|
|
83
|
+
latitude: context.coords?.latitude ?? 0,
|
|
84
|
+
longitude: context.coords?.longitude ?? 0
|
|
85
|
+
}),
|
|
86
|
+
onDone: {
|
|
87
|
+
target: "locationAcquired",
|
|
88
|
+
actions: "setLocation"
|
|
89
|
+
},
|
|
90
|
+
onError: {
|
|
91
|
+
target: "locationAcquired",
|
|
92
|
+
actions: assign({ location: () => "Unknown" })
|
|
93
|
+
}
|
|
94
|
+
} },
|
|
95
|
+
locationAcquired: { on: { CONTINUE: { target: "finished" } } },
|
|
96
|
+
permissionDenied: { on: { SKIP: {
|
|
97
|
+
target: "finished",
|
|
98
|
+
guard: "canSkip"
|
|
99
|
+
} } },
|
|
100
|
+
finished: { type: "final" }
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
//#endregion
|
|
105
|
+
export { geolocationMachine as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as Manager } from "./Manager-
|
|
2
|
-
import "./Actor-
|
|
1
|
+
import { t as Manager } from "./Manager-Bcnemkyi.js";
|
|
2
|
+
import "./Actor-BkPcZGke.js";
|
|
3
3
|
|
|
4
4
|
//#region src/modules/government-validation/types.d.ts
|
|
5
5
|
type GovernmentValidationConfig = {
|