@incodetech/core 2.0.1 → 2.1.0-rc.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/dist/{BrowserStorageProvider-CuOW1Er2.esm.js → BrowserStorageProvider-BpJM-gIl.esm.js} +8 -1
- package/dist/{IpifyProvider-D7jx52AL.esm.js → IpifyProvider-D4LWD15E.esm.js} +28 -0
- package/dist/{MotionSensorProvider-4v7xkqAp.esm.js → MotionSensorProvider-Bx7Mpzt0.esm.js} +63 -13
- package/dist/{OpenViduRecordingProvider-CMu6XVdc.esm.js → OpenViduRecordingProvider-O4GjBseO.esm.js} +1 -1
- package/dist/StateMachine-BC_nGvrc.d.ts +2 -0
- package/dist/StreamCanvasCapture-ImiDQdVA.esm.js +118 -0
- package/dist/StreamCanvasCapture-yyl20qd9.d.ts +152 -0
- package/dist/{BaseWasmProvider-C_DLEI40.esm.js → WasmUtilProvider-CiEN7Gjn.esm.js} +183 -11
- package/dist/{addressSearch-BpTbTWCa.esm.js → addressSearch-DvmWXKZg.esm.js} +63 -57
- package/dist/{ae-signature-DDDZmWXj.esm.js → ae-signature-BFZta3TZ.esm.js} +1 -1
- package/dist/ae-signature.d.ts +3 -3
- package/dist/ae-signature.esm.js +6 -5
- package/dist/antifraud.d.ts +5 -46
- package/dist/antifraud.esm.js +6 -43
- package/dist/antifraudManager-CkV4u-LE.esm.js +55 -0
- package/dist/antifraudManager-CznnhyvD.d.ts +63 -0
- package/dist/{antifraudStateMachine-O0TMf6yc.esm.js → antifraudStateMachine-Ccrb-Jxc.esm.js} +2 -2
- package/dist/apiError-B-j-gyDx.esm.js +51 -0
- package/dist/authentication.d.ts +13 -11
- package/dist/authentication.esm.js +26 -22
- package/dist/{authenticationManager-C83GNIhl.d.ts → authenticationManager-CIVY80H9.d.ts} +4 -4
- package/dist/{authenticationManager-5M-fKzXx.esm.js → authenticationManager-ZNotsWnC.esm.js} +6 -6
- package/dist/{authenticationStateMachine-BMZqatiF.esm.js → authenticationStateMachine-DksVbF_H.esm.js} +21 -9
- package/dist/{backCameraStream-DMdMeGk2.esm.js → backCameraStream-D7Wo4Nbx.esm.js} +95 -7
- package/dist/{session-CrkWAs-q.esm.js → browserSimulation-B1dWiXp7.esm.js} +61 -476
- package/dist/camera.d.ts +4 -3
- package/dist/camera.esm.js +4 -3
- package/dist/canvas-SKcRBxsk.esm.js +230 -0
- package/dist/consent.d.ts +4 -398
- package/dist/consent.esm.js +6 -77
- package/dist/consentManager-BLd51QiW.d.ts +419 -0
- package/dist/consentManager-BYo9Nu1r.esm.js +90 -0
- package/dist/{consentStateMachine-CCT-B60O.esm.js → consentStateMachine-BG3yL8aC.esm.js} +9 -6
- package/dist/cpf-ocr.d.ts +4 -199
- package/dist/cpf-ocr.esm.js +8 -177
- package/dist/cpfOcrManager-BnieFXuG.d.ts +216 -0
- package/dist/cpfOcrManager-sSKegxox.esm.js +190 -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 +8 -158
- package/dist/curp-validation.esm.js +6 -108
- package/dist/curpValidationManager-CFem6zP9.esm.js +122 -0
- package/dist/curpValidationManager-RttixpIc.d.ts +184 -0
- package/dist/{curpValidationStateMachine-CitWLr2c.esm.js → curpValidationStateMachine-B7V_qp66.esm.js} +20 -13
- package/dist/custom-fields.d.ts +2 -2
- package/dist/custom-fields.esm.js +4 -4
- package/dist/custom-watchlist.d.ts +1 -1
- package/dist/custom-watchlist.esm.js +4 -41
- package/dist/customWatchlistStateMachine-HmFybXLX.esm.js +50 -0
- package/dist/{deepsightLoader-Cm4JIT_z.esm.js → deepsightLoader-65k1Appi.esm.js} +19 -10
- package/dist/{deepsightService-CEVxzehb.d.ts → deepsightService-B7ShOkWL.d.ts} +8 -160
- package/dist/deepsightService-CrHmvx8X.esm.js +276 -0
- package/dist/device.esm.js +4 -3
- package/dist/document-capture.d.ts +995 -86
- package/dist/document-capture.esm.js +34 -8
- package/dist/document-upload.d.ts +47 -47
- package/dist/document-upload.esm.js +7 -7
- package/dist/{documentCaptureStateMachine-BqzTDy9k.esm.js → documentCaptureStateMachine-WYV1r9le.esm.js} +90 -6
- package/dist/dynamic-forms.d.ts +20 -5
- package/dist/dynamic-forms.esm.js +150 -61
- package/dist/ekyb.d.ts +32 -13
- package/dist/ekyb.esm.js +25 -15
- package/dist/{ekybStateMachine-CyMx_kg-.esm.js → ekybStateMachine-aYixw2sL.esm.js} +319 -207
- package/dist/ekyc.d.ts +10 -78
- package/dist/ekyc.esm.js +17 -12
- package/dist/{ekycStateMachine-oeO0Iekd.esm.js → ekycStateMachine-CXbpaJJn.esm.js} +201 -113
- package/dist/electronic-signature.d.ts +3 -3
- package/dist/electronic-signature.esm.js +5 -4
- package/dist/{electronicSignatureManager-D9OHzTpG.esm.js → electronicSignatureManager-BaECdJ1u.esm.js} +91 -23
- package/dist/email.d.ts +4 -3
- package/dist/email.esm.js +6 -5
- package/dist/{emailManager-wAV0LE-H.esm.js → emailManager--D5G3ChB.esm.js} +30 -7
- package/dist/{emailManager-DIfnS5g1.d.ts → emailManager-lAzDoQOs.d.ts} +66 -8
- package/dist/{emailStateMachine-DOf4j58N.esm.js → emailStateMachine-CxTOMAjC.esm.js} +46 -11
- package/dist/{endpoints-CnN3SyDa.esm.js → endpoints-BeTK0Mlt.esm.js} +6 -3
- package/dist/{events-D6-e4vok.esm.js → events-Dvvriq9l.esm.js} +3 -1
- package/dist/events.d.ts +2 -0
- package/dist/events.esm.js +1 -1
- package/dist/extensibility.d.ts +32 -16
- package/dist/extensibility.esm.js +55 -33
- package/dist/face-match.d.ts +32 -2
- package/dist/face-match.esm.js +5 -5
- package/dist/{faceCaptureManagerFactory-yqtpxjnN.d.ts → faceCaptureManagerFactory-C_hRHx8a.d.ts} +35 -11
- package/dist/{faceCaptureManagerFactory-Dh2PdGlF.esm.js → faceCaptureManagerFactory-kqbUqtrr.esm.js} +21 -5
- package/dist/{faceCaptureSetup-B3faSpYA.esm.js → faceCaptureSetup-CtvHWd3x.esm.js} +68 -183
- package/dist/{faceMatchStateMachine-DNFrxTFS.esm.js → faceMatchStateMachine-DdGXUBnx.esm.js} +60 -6
- package/dist/field-comparison.d.ts +4 -0
- package/dist/field-comparison.esm.js +7 -0
- package/dist/fieldComparisonManager-Bu5TaSr3.d.ts +76 -0
- package/dist/fieldComparisonManager-COGI2ARD.esm.js +162 -0
- package/dist/fiscal-qr.d.ts +59 -0
- package/dist/fiscal-qr.esm.js +323 -0
- package/dist/flow-events.d.ts +6 -5
- package/dist/flow.d.ts +23 -15
- package/dist/flow.esm.js +63 -17
- package/dist/flowCompletionService-BdR2cGgB.d.ts +19 -0
- package/dist/flowCompletionService-DdGojV9K.esm.js +20 -0
- package/dist/{flowServices-PiNsxLfK.esm.js → flowServices-BTuHLHVr.esm.js} +10 -5
- package/dist/geolocation.d.ts +4 -4
- package/dist/geolocation.esm.js +6 -6
- package/dist/{geolocationStateMachine-asasuHY2.esm.js → geolocationStateMachine-Dvh7X0wF.esm.js} +5 -5
- package/dist/getBrowser-C8DP7oTB.esm.js +8 -0
- package/dist/{getBrowser-BSXUTWXw.esm.js → getDeviceClass-C0olyNFS.esm.js} +1 -8
- package/dist/{getDeviceClass-BSntT9_j.esm.js → getDeviceClass-C8Do2qYu.esm.js} +1 -1
- package/dist/government-validation.d.ts +28 -8
- package/dist/government-validation.esm.js +19 -8
- package/dist/{governmentValidationStateMachine-BDDYrJTo.esm.js → governmentValidationStateMachine-DcJ-BfsC.esm.js} +35 -77
- package/dist/home.d.ts +15 -14
- package/dist/home.esm.js +2 -2
- package/dist/http-Cai3IoLS.esm.js +0 -0
- package/dist/http.esm.js +1 -0
- package/dist/id-ocr.d.ts +54 -54
- package/dist/id-ocr.esm.js +5 -5
- package/dist/id-verification.d.ts +27 -27
- package/dist/id-verification.esm.js +4 -4
- package/dist/id.d.ts +12 -10
- package/dist/id.esm.js +36 -26
- package/dist/{idCaptureManager-Fyd0eam-.d.ts → idCaptureManager-D-QYESvF.d.ts} +28 -14
- package/dist/{idCaptureManager-D0ktk7Hh.esm.js → idCaptureManager-DGVv5l1_.esm.js} +22 -7
- package/dist/{idCaptureStateMachine-dwlBUjbC.esm.js → idCaptureStateMachine-DHi7HydI.esm.js} +172 -123
- package/dist/{idOcrStateMachine-YbjjC_Gg.esm.js → idOcrStateMachine-CDQ5d_VM.esm.js} +4 -4
- package/dist/{idVerificationStateMachine-xbw9HP1Z.esm.js → idVerificationStateMachine-kRxwImzO.esm.js} +2 -2
- package/dist/identity-reuse.d.ts +4 -530
- package/dist/identity-reuse.esm.js +8 -274
- package/dist/identityReuseManager-C6n_97dw.esm.js +95 -0
- package/dist/identityReuseManager-DwLtVzUn.d.ts +428 -0
- package/dist/identityReuseStateMachine-BfE5YiEr.esm.js +148 -0
- package/dist/{index-BcRG8rtJ.d.ts → index-B5hPA0Bg.d.ts} +2 -2
- package/dist/{index-ChHWNH48.d.ts → index-B9NysVDB.d.ts} +469 -195
- package/dist/index.d.ts +2 -2
- package/dist/index.esm.js +10 -8
- package/dist/{invokeOnCaptureCallback-rc6kBHo5.esm.js → invokeOnCaptureCallback-ygByVdnn.esm.js} +1 -1
- package/dist/{lib-BB0B_qQX.esm.js → lib-BY67lgbq.esm.js} +1 -1
- package/dist/mandatory-consent.d.ts +8 -412
- package/dist/mandatory-consent.esm.js +6 -76
- package/dist/mandatoryConsentManager-H6D18cZB.esm.js +89 -0
- package/dist/mandatoryConsentManager-KfIlURRY.d.ts +429 -0
- package/dist/{mandatoryConsentStateMachine-Cnco1jvn.esm.js → mandatoryConsentStateMachine-DtQNW1ji.esm.js} +6 -6
- package/dist/openviduLazy-B8L--0oe.esm.js +3 -0
- package/dist/{openviduLazy-Cok70ZSg.esm.js → openviduLazy-Dh14JNJc.esm.js} +2 -2
- package/dist/otp-CGMdUzBC.esm.js +33 -0
- package/dist/otp-DF5A0sFx.d.ts +8 -0
- package/dist/permissionGuards-C1ispV96.esm.js +23 -0
- package/dist/permissionServices-CG3bMSfG.esm.js +130 -0
- package/dist/phone.d.ts +4 -3
- package/dist/phone.esm.js +6 -5
- package/dist/{phoneManager-DAJbGhlY.esm.js → phoneManager-BmF-0Ez4.esm.js} +30 -7
- package/dist/{phoneManager-B6M30hKE.d.ts → phoneManager-fPmIBYQK.d.ts} +65 -7
- package/dist/{phoneStateMachine-CuPARRaT.esm.js → phoneStateMachine-BiV0yoEx.esm.js} +46 -11
- package/dist/{qe-signature-DFo_Cc-I.esm.js → qe-signature-CUYPcHVo.esm.js} +1 -1
- package/dist/qe-signature.d.ts +3 -3
- package/dist/qe-signature.esm.js +6 -5
- package/dist/{recordingService-Ig2UgbLv.esm.js → recordingService-Bn9EdCmz.esm.js} +197 -179
- package/dist/redirect-to-mobile.d.ts +6 -104
- package/dist/redirect-to-mobile.esm.js +6 -99
- package/dist/redirectToMobileManager-BNe3IzC_.d.ts +178 -0
- package/dist/redirectToMobileManager-Dy3t7o0C.esm.js +159 -0
- package/dist/{redirectToMobileStateMachine-BOEqe46A.esm.js → redirectToMobileStateMachine-DyAdRxfP.esm.js} +28 -19
- package/dist/{runChildModule-CqqwqAkW.esm.js → runChildModule-CuoHZ1cx.esm.js} +35 -3
- package/dist/selfie.d.ts +13 -11
- package/dist/selfie.esm.js +27 -23
- package/dist/{selfieManager-Duisl7qN.esm.js → selfieManager-BjCoKRy0.esm.js} +6 -6
- package/dist/{selfieManager-D0lSgd-J.d.ts → selfieManager-dUbKRzOh.d.ts} +4 -4
- package/dist/{selfieStateMachine-D76whWEf.esm.js → selfieStateMachine-b4F2q9zw.esm.js} +5 -3
- package/dist/session-DoVb-OcB.esm.js +152 -0
- package/dist/session.d.ts +37 -5
- package/dist/session.esm.js +12 -7
- package/dist/sessionInitializer-B8H5MsXM.esm.js +366 -0
- package/dist/{setup-C5AITV8m.d.ts → setup-BbkprdVv.d.ts} +57 -6
- package/dist/{setup-DPPAxmXf.esm.js → setup-BqEfrdja.esm.js} +162 -24
- package/dist/signature.d.ts +2 -2
- package/dist/signature.esm.js +4 -4
- package/dist/{signatureStateMachine-B5-QVUve.esm.js → signatureStateMachine-C5qqYLRz.esm.js} +3 -3
- package/dist/stats-BMNUG1AU.esm.js +41 -0
- package/dist/stats.d.ts +13 -2
- package/dist/stats.esm.js +3 -2
- package/dist/trust-graph.d.ts +33 -4
- package/dist/trust-graph.esm.js +21 -15
- package/dist/{types-CFV9G_7j.d.ts → types-Bj9hdFjU.d.ts} +1 -1
- package/dist/{types-BP1m8VRw.d.ts → types-DOUhndhT.d.ts} +14 -2
- package/dist/types-DsnEVMhr.esm.js +34 -0
- package/dist/types-DvGZI7BF.d.ts +131 -0
- package/dist/{types-B06Ypu2F.d.ts → types-NuT8ftBV.d.ts} +1 -1
- package/dist/types-ya0LN_MX.d.ts +5 -0
- package/dist/{warmup-CEcppFiS.d.ts → warmup-Dg8Lh-50.d.ts} +8 -0
- package/dist/wasm.d.ts +6 -4
- package/dist/wasm.esm.js +11 -9
- package/dist/watchlist-for-business.d.ts +1 -1
- package/dist/watchlist-for-business.esm.js +5 -73
- package/dist/watchlist.d.ts +1 -1
- package/dist/watchlist.esm.js +4 -41
- package/dist/watchlistForBusinessStateMachine-DMl8j2Ov.esm.js +74 -0
- package/dist/watchlistStateMachine-DmQlqI6L.esm.js +50 -0
- package/dist/workflow.d.ts +150 -97
- package/dist/workflow.esm.js +156 -80
- package/package.json +19 -1
- package/dist/StateMachine-BCQrZJhf.d.ts +0 -2
- package/dist/WasmUtilProvider-j98OJf-S.esm.js +0 -114
- package/dist/browserSimulation-gxD8cSpM.esm.js +0 -20
- package/dist/deepsightService-O74l4Y__.esm.js +0 -489
- package/dist/displayErrors-DqJ_IbsG.d.ts +0 -39
- package/dist/flowCompletionService-DhkT4SRY.d.ts +0 -10
- package/dist/flowCompletionService-P54yzGvA.esm.js +0 -13
- package/dist/openviduLazy-Cm0XFh_v.esm.js +0 -3
- package/dist/permissionServices-D_i6nzEw.esm.js +0 -50
- package/dist/stats-CIfiPzb1.esm.js +0 -16
- package/dist/types-CAD4va6a.d.ts +0 -5
- package/dist/watchlistServices-DMbUhkBX.esm.js +0 -12
- /package/dist/{Actor-CI32dTbG.d.ts → Actor-Y0_Fj-KL.d.ts} +0 -0
- /package/dist/{ITimerCapability-C67ZRskg.esm.js → ITimerCapability-CB0I1Uf2.esm.js} +0 -0
- /package/dist/{Manager-C8PrhBOx.d.ts → Manager-BHn8wH8K.d.ts} +0 -0
- /package/dist/{camera-PA2Ljri3.esm.js → camera-DJWm3V4g.esm.js} +0 -0
- /package/dist/{camera-DBSxa6ML.d.ts → camera-SRBpPq2X.d.ts} +0 -0
- /package/dist/{chunk-CRF6K_H_.esm.js → chunk-CMUKZ2uL.esm.js} +0 -0
- /package/dist/{cpf-PPz2Njto.esm.js → cpf-BRzggV8G.esm.js} +0 -0
- /package/dist/{dateUtils-UoN5xswP.esm.js → dateUtils-AksLQmgV.esm.js} +0 -0
- /package/dist/{platform-CfrjKhmi.esm.js → platform-SKvEfCBh.esm.js} +0 -0
- /package/dist/{xstate.esm-B70JrNqo.esm.js → xstate.esm-C9wncMQa.esm.js} +0 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { t as Manager } from "./Manager-BHn8wH8K.js";
|
|
2
|
+
import "./camera-SRBpPq2X.js";
|
|
3
|
+
import "./StreamCanvasCapture-yyl20qd9.js";
|
|
4
|
+
|
|
5
|
+
//#region src/modules/fiscal-qr/types.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Configuration options for the Fiscal QR module.
|
|
8
|
+
*
|
|
9
|
+
* The backend currently sends an empty module configuration for this step.
|
|
10
|
+
*/
|
|
11
|
+
type FiscalQrConfig = Record<string, never>;
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/modules/fiscal-qr/fiscalQrManager.d.ts
|
|
14
|
+
type FiscalQrIdleState = {
|
|
15
|
+
status: 'idle';
|
|
16
|
+
};
|
|
17
|
+
type FiscalQrScanningState = {
|
|
18
|
+
status: 'scanning';
|
|
19
|
+
stream?: MediaStream;
|
|
20
|
+
error?: string;
|
|
21
|
+
};
|
|
22
|
+
type FiscalQrCapturingState = {
|
|
23
|
+
status: 'capturing';
|
|
24
|
+
stream?: MediaStream;
|
|
25
|
+
};
|
|
26
|
+
type FiscalQrSuccessState = {
|
|
27
|
+
status: 'success';
|
|
28
|
+
stream?: MediaStream;
|
|
29
|
+
};
|
|
30
|
+
type FiscalQrProcessingState = {
|
|
31
|
+
status: 'processing';
|
|
32
|
+
};
|
|
33
|
+
type FiscalQrErrorState = {
|
|
34
|
+
status: 'error';
|
|
35
|
+
error?: string;
|
|
36
|
+
attempts: number;
|
|
37
|
+
stream?: MediaStream;
|
|
38
|
+
};
|
|
39
|
+
type FiscalQrVerifiedState = {
|
|
40
|
+
status: 'verified';
|
|
41
|
+
};
|
|
42
|
+
type FiscalQrFinishedState = {
|
|
43
|
+
status: 'finished';
|
|
44
|
+
};
|
|
45
|
+
type FiscalQrState = FiscalQrIdleState | FiscalQrScanningState | FiscalQrCapturingState | FiscalQrSuccessState | FiscalQrProcessingState | FiscalQrErrorState | FiscalQrVerifiedState | FiscalQrFinishedState;
|
|
46
|
+
declare function createFiscalQrManager(options: {
|
|
47
|
+
config: FiscalQrConfig;
|
|
48
|
+
}): Manager<FiscalQrState> & {
|
|
49
|
+
load(): void;
|
|
50
|
+
continue(): void;
|
|
51
|
+
skip(): void;
|
|
52
|
+
reset(): void;
|
|
53
|
+
};
|
|
54
|
+
type FiscalQrManager = ReturnType<typeof createFiscalQrManager>;
|
|
55
|
+
//#endregion
|
|
56
|
+
//#region src/modules/fiscal-qr/fiscalQrStateMachine.d.ts
|
|
57
|
+
declare const fiscalQrMachine: any;
|
|
58
|
+
//#endregion
|
|
59
|
+
export { type FiscalQrConfig, type FiscalQrManager, type FiscalQrState, createFiscalQrManager, fiscalQrMachine };
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
import { t as BrowserTimerProvider } from "./BrowserTimerProvider-DhNc_x02.esm.js";
|
|
2
|
+
import { t as api } from "./api-CESGtpbH.esm.js";
|
|
3
|
+
import { h as addEvent, n as eventModuleNames, o as createManagerInstrumentation } from "./events-Dvvriq9l.esm.js";
|
|
4
|
+
import { t as endpoints } from "./endpoints-BeTK0Mlt.esm.js";
|
|
5
|
+
import "./platform-SKvEfCBh.esm.js";
|
|
6
|
+
import { a as fromPromise, c as createManager, i as fromCallback, r as assign, s as createActor, t as setup } from "./xstate.esm-C9wncMQa.esm.js";
|
|
7
|
+
import { i as stopCameraStream } from "./camera-DJWm3V4g.esm.js";
|
|
8
|
+
import "./ITimerCapability-CB0I1Uf2.esm.js";
|
|
9
|
+
import "./canvas-SKcRBxsk.esm.js";
|
|
10
|
+
import { n as getBackCameraStream } from "./backCameraStream-D7Wo4Nbx.esm.js";
|
|
11
|
+
import { t as StreamCanvasCapture } from "./StreamCanvasCapture-ImiDQdVA.esm.js";
|
|
12
|
+
import "./http-Cai3IoLS.esm.js";
|
|
13
|
+
import { BrowserQRCodeReader } from "@zxing/browser";
|
|
14
|
+
|
|
15
|
+
//#region src/modules/fiscal-qr/fiscalQrConstants.ts
|
|
16
|
+
const QR_SCAN_FPS = 10;
|
|
17
|
+
const INITIAL_FOCUS_DELAY_MS = 800;
|
|
18
|
+
const SCAN_INTERVAL_MS = 500;
|
|
19
|
+
const SUCCESS_DISPLAY_MS = 1500;
|
|
20
|
+
const PROCESSING_DISPLAY_MS = 3e3;
|
|
21
|
+
const ERROR_DISPLAY_MS = 3e3;
|
|
22
|
+
const MAX_ATTEMPTS = 3;
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/modules/fiscal-qr/qrCodeDecoder.ts
|
|
26
|
+
function createQrCodeDecoder() {
|
|
27
|
+
const reader = new BrowserQRCodeReader();
|
|
28
|
+
return { decode(canvas) {
|
|
29
|
+
try {
|
|
30
|
+
const text = reader.decodeFromCanvas(canvas.canvas).getText().trim();
|
|
31
|
+
return text.length > 0 ? text : void 0;
|
|
32
|
+
} catch {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
} };
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region src/modules/fiscal-qr/fiscalQrUtils.ts
|
|
40
|
+
/**
|
|
41
|
+
* Continuously decodes QR codes from an existing frame capturer until the first
|
|
42
|
+
* hit.
|
|
43
|
+
*
|
|
44
|
+
* When `applyFocusDelay` is true, waits {@link INITIAL_FOCUS_DELAY_MS} (camera
|
|
45
|
+
* focus) before the first attempt; otherwise scans immediately. Either way it
|
|
46
|
+
* then retries every {@link SCAN_INTERVAL_MS}. `onDetected` fires at most once.
|
|
47
|
+
*
|
|
48
|
+
* Takes a shared {@link StreamCanvasCapture} rather than a stream on purpose:
|
|
49
|
+
* the capturer (and its hidden video) is created once for the camera session
|
|
50
|
+
* and reused across scan restarts, so re-entering scanning never spins up a new
|
|
51
|
+
* stream consumer — which would briefly disturb the visible camera feed.
|
|
52
|
+
*
|
|
53
|
+
* @returns a cleanup function that stops the scan loop. It does NOT dispose the
|
|
54
|
+
* capturer or stop the camera — the caller owns those lifecycles.
|
|
55
|
+
*/
|
|
56
|
+
function startQrScan(frameCapturer, onDetected, applyFocusDelay = true) {
|
|
57
|
+
const decoder = createQrCodeDecoder();
|
|
58
|
+
const timer = BrowserTimerProvider.getInstance();
|
|
59
|
+
let disposed = false;
|
|
60
|
+
let hasDetected = false;
|
|
61
|
+
let scanInterval;
|
|
62
|
+
let focusDelay;
|
|
63
|
+
const scan = () => {
|
|
64
|
+
if (disposed || hasDetected) return;
|
|
65
|
+
const canvas = frameCapturer.getLatestCanvas();
|
|
66
|
+
if (!canvas) return;
|
|
67
|
+
try {
|
|
68
|
+
const link = decoder.decode(canvas);
|
|
69
|
+
if (link && !disposed && !hasDetected) {
|
|
70
|
+
hasDetected = true;
|
|
71
|
+
onDetected(link);
|
|
72
|
+
}
|
|
73
|
+
} finally {
|
|
74
|
+
canvas.dispose();
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
const beginScanning = () => {
|
|
78
|
+
scan();
|
|
79
|
+
scanInterval = timer.setInterval(scan, SCAN_INTERVAL_MS);
|
|
80
|
+
};
|
|
81
|
+
if (applyFocusDelay) focusDelay = timer.setTimeout(beginScanning, INITIAL_FOCUS_DELAY_MS);
|
|
82
|
+
else beginScanning();
|
|
83
|
+
return () => {
|
|
84
|
+
disposed = true;
|
|
85
|
+
if (focusDelay !== void 0) timer.clearTimeout(focusDelay);
|
|
86
|
+
if (scanInterval !== void 0) timer.clearInterval(scanInterval);
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
//#endregion
|
|
91
|
+
//#region src/modules/fiscal-qr/fiscalQrServices.ts
|
|
92
|
+
/**
|
|
93
|
+
* Submits a scanned Fiscal QR link to the backend.
|
|
94
|
+
*
|
|
95
|
+
* Throws when the request fails OR when the backend rejects the link
|
|
96
|
+
* (`success === false`), so callers can retry/skip — matching the legacy SDK
|
|
97
|
+
* which only advanced when `postResp.success` was truthy.
|
|
98
|
+
*/
|
|
99
|
+
async function submitFiscalQrLink(params, signal) {
|
|
100
|
+
const res = await api.post(endpoints.addFiscalQrLink, params, { signal });
|
|
101
|
+
if (!res.ok) throw new Error(`POST failed: ${res.status}`);
|
|
102
|
+
if (res.data?.success !== true) throw new Error("Fiscal QR link was not accepted");
|
|
103
|
+
return res.data;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
//#endregion
|
|
107
|
+
//#region src/modules/fiscal-qr/fiscalQrStateMachine.ts
|
|
108
|
+
const fiscalQrMachine = setup({
|
|
109
|
+
types: {
|
|
110
|
+
context: {},
|
|
111
|
+
events: {},
|
|
112
|
+
input: {}
|
|
113
|
+
},
|
|
114
|
+
actors: {
|
|
115
|
+
initCamera: fromPromise(async () => {
|
|
116
|
+
const { stream } = await getBackCameraStream(void 0);
|
|
117
|
+
return {
|
|
118
|
+
stream,
|
|
119
|
+
frameCapturer: new StreamCanvasCapture(stream, { fps: QR_SCAN_FPS })
|
|
120
|
+
};
|
|
121
|
+
}),
|
|
122
|
+
submitFiscalQrLink: fromPromise(async ({ input, signal }) => {
|
|
123
|
+
await submitFiscalQrLink({ poaUrl: input.link }, signal);
|
|
124
|
+
}),
|
|
125
|
+
detectQrCode: fromCallback(({ input, sendBack }) => {
|
|
126
|
+
if (!input.frameCapturer) return () => {};
|
|
127
|
+
return startQrScan(input.frameCapturer, (link) => {
|
|
128
|
+
sendBack({
|
|
129
|
+
type: "QR_DETECTED",
|
|
130
|
+
link
|
|
131
|
+
});
|
|
132
|
+
}, input.applyFocusDelay);
|
|
133
|
+
})
|
|
134
|
+
},
|
|
135
|
+
actions: {
|
|
136
|
+
setLink: assign(({ event }) => {
|
|
137
|
+
if (event.type !== "QR_DETECTED") return {};
|
|
138
|
+
return {
|
|
139
|
+
link: event.link,
|
|
140
|
+
error: void 0
|
|
141
|
+
};
|
|
142
|
+
}),
|
|
143
|
+
setError: assign(({ event }) => ({ error: event.error?.message ?? "Submit failed" })),
|
|
144
|
+
setStream: assign(({ event }) => {
|
|
145
|
+
const { stream, frameCapturer } = event.output;
|
|
146
|
+
return {
|
|
147
|
+
stream,
|
|
148
|
+
frameCapturer,
|
|
149
|
+
error: void 0
|
|
150
|
+
};
|
|
151
|
+
}),
|
|
152
|
+
stopStream: assign(({ context }) => {
|
|
153
|
+
context.frameCapturer?.dispose();
|
|
154
|
+
if (context.stream) stopCameraStream(context.stream);
|
|
155
|
+
return {
|
|
156
|
+
stream: void 0,
|
|
157
|
+
frameCapturer: void 0
|
|
158
|
+
};
|
|
159
|
+
}),
|
|
160
|
+
incrementAttempts: assign(({ context }) => ({ attempts: context.attempts + 1 })),
|
|
161
|
+
resetSession: assign(() => ({
|
|
162
|
+
link: "",
|
|
163
|
+
error: void 0,
|
|
164
|
+
attempts: 0
|
|
165
|
+
})),
|
|
166
|
+
trackSuccess: () => addEvent({
|
|
167
|
+
code: "complete",
|
|
168
|
+
module: eventModuleNames.fiscalQr
|
|
169
|
+
})
|
|
170
|
+
},
|
|
171
|
+
guards: { isMaxAttemptsReached: ({ context }) => context.attempts + 1 >= MAX_ATTEMPTS }
|
|
172
|
+
}).createMachine({
|
|
173
|
+
id: "fiscalQr",
|
|
174
|
+
initial: "idle",
|
|
175
|
+
context: ({ input }) => ({
|
|
176
|
+
config: input.config,
|
|
177
|
+
link: "",
|
|
178
|
+
stream: void 0,
|
|
179
|
+
error: void 0,
|
|
180
|
+
attempts: 0
|
|
181
|
+
}),
|
|
182
|
+
on: { SKIP: ".finished" },
|
|
183
|
+
states: {
|
|
184
|
+
idle: { on: {
|
|
185
|
+
LOAD: "idle",
|
|
186
|
+
CONTINUE: {
|
|
187
|
+
target: "initCamera",
|
|
188
|
+
actions: "resetSession"
|
|
189
|
+
}
|
|
190
|
+
} },
|
|
191
|
+
initCamera: { invoke: {
|
|
192
|
+
id: "initCamera",
|
|
193
|
+
src: "initCamera",
|
|
194
|
+
input: void 0,
|
|
195
|
+
onDone: {
|
|
196
|
+
target: "scanning",
|
|
197
|
+
actions: "setStream"
|
|
198
|
+
},
|
|
199
|
+
onError: {
|
|
200
|
+
target: "scanning",
|
|
201
|
+
actions: "setError"
|
|
202
|
+
}
|
|
203
|
+
} },
|
|
204
|
+
scanning: {
|
|
205
|
+
invoke: {
|
|
206
|
+
id: "detectQrCode",
|
|
207
|
+
src: "detectQrCode",
|
|
208
|
+
input: ({ context }) => ({
|
|
209
|
+
frameCapturer: context.frameCapturer,
|
|
210
|
+
applyFocusDelay: context.attempts === 0
|
|
211
|
+
})
|
|
212
|
+
},
|
|
213
|
+
on: {
|
|
214
|
+
QR_DETECTED: {
|
|
215
|
+
target: "submitting",
|
|
216
|
+
actions: "setLink"
|
|
217
|
+
},
|
|
218
|
+
RESET: {
|
|
219
|
+
target: "idle",
|
|
220
|
+
actions: "stopStream"
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
submitting: { invoke: {
|
|
225
|
+
id: "submitFiscalQrLink",
|
|
226
|
+
src: "submitFiscalQrLink",
|
|
227
|
+
input: ({ context }) => ({ link: context.link }),
|
|
228
|
+
onDone: {
|
|
229
|
+
target: "success",
|
|
230
|
+
actions: "trackSuccess"
|
|
231
|
+
},
|
|
232
|
+
onError: [{
|
|
233
|
+
target: "finished",
|
|
234
|
+
guard: "isMaxAttemptsReached",
|
|
235
|
+
actions: ["incrementAttempts", "setError"]
|
|
236
|
+
}, {
|
|
237
|
+
target: "error",
|
|
238
|
+
actions: ["incrementAttempts", "setError"]
|
|
239
|
+
}]
|
|
240
|
+
} },
|
|
241
|
+
success: { after: { [SUCCESS_DISPLAY_MS]: "processing" } },
|
|
242
|
+
processing: {
|
|
243
|
+
entry: "stopStream",
|
|
244
|
+
after: { [PROCESSING_DISPLAY_MS]: "verified" }
|
|
245
|
+
},
|
|
246
|
+
verified: { after: { [PROCESSING_DISPLAY_MS]: "finished" } },
|
|
247
|
+
error: { after: { [ERROR_DISPLAY_MS]: "scanning" } },
|
|
248
|
+
finished: {
|
|
249
|
+
type: "final",
|
|
250
|
+
entry: "stopStream"
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
//#endregion
|
|
256
|
+
//#region src/modules/fiscal-qr/fiscalQrActor.ts
|
|
257
|
+
/**
|
|
258
|
+
* Creates and starts a Fiscal QR actor.
|
|
259
|
+
* The actor begins in 'idle' state, ready to receive events.
|
|
260
|
+
*/
|
|
261
|
+
function createFiscalQrActor(options) {
|
|
262
|
+
return createActor(fiscalQrMachine, { input: { config: options.config } }).start();
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
//#endregion
|
|
266
|
+
//#region src/modules/fiscal-qr/fiscalQrManager.ts
|
|
267
|
+
function mapState(snapshot) {
|
|
268
|
+
const typedSnapshot = snapshot;
|
|
269
|
+
const { stream, error, attempts } = typedSnapshot.context;
|
|
270
|
+
if (typedSnapshot.matches("idle")) return { status: "idle" };
|
|
271
|
+
if (typedSnapshot.matches("initCamera") || typedSnapshot.matches("scanning")) return {
|
|
272
|
+
status: "scanning",
|
|
273
|
+
stream,
|
|
274
|
+
error
|
|
275
|
+
};
|
|
276
|
+
if (typedSnapshot.matches("submitting")) return {
|
|
277
|
+
status: "capturing",
|
|
278
|
+
stream
|
|
279
|
+
};
|
|
280
|
+
if (typedSnapshot.matches("success")) return {
|
|
281
|
+
status: "success",
|
|
282
|
+
stream
|
|
283
|
+
};
|
|
284
|
+
if (typedSnapshot.matches("processing")) return { status: "processing" };
|
|
285
|
+
if (typedSnapshot.matches("verified")) return { status: "verified" };
|
|
286
|
+
if (typedSnapshot.matches("error")) return {
|
|
287
|
+
status: "error",
|
|
288
|
+
error,
|
|
289
|
+
attempts,
|
|
290
|
+
stream
|
|
291
|
+
};
|
|
292
|
+
if (typedSnapshot.matches("finished")) return { status: "finished" };
|
|
293
|
+
return { status: "idle" };
|
|
294
|
+
}
|
|
295
|
+
function createApi({ actor, trackElementClicked }) {
|
|
296
|
+
return {
|
|
297
|
+
load() {
|
|
298
|
+
actor.send({ type: "LOAD" });
|
|
299
|
+
},
|
|
300
|
+
continue() {
|
|
301
|
+
trackElementClicked?.("continue");
|
|
302
|
+
actor.send({ type: "CONTINUE" });
|
|
303
|
+
},
|
|
304
|
+
skip() {
|
|
305
|
+
trackElementClicked?.("skip");
|
|
306
|
+
actor.send({ type: "SKIP" });
|
|
307
|
+
},
|
|
308
|
+
reset() {
|
|
309
|
+
actor.send({ type: "RESET" });
|
|
310
|
+
}
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
function createFiscalQrManager(options) {
|
|
314
|
+
return createManager({
|
|
315
|
+
actor: createFiscalQrActor(options),
|
|
316
|
+
mapState,
|
|
317
|
+
createApi,
|
|
318
|
+
instrumentation: createManagerInstrumentation(eventModuleNames.fiscalQr)
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
//#endregion
|
|
323
|
+
export { createFiscalQrManager, fiscalQrMachine };
|
package/dist/flow-events.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import "./camera-
|
|
2
|
-
import "./types-
|
|
3
|
-
import "./types-
|
|
4
|
-
import "./
|
|
5
|
-
import
|
|
1
|
+
import "./camera-SRBpPq2X.js";
|
|
2
|
+
import "./types-Bj9hdFjU.js";
|
|
3
|
+
import "./types-DvGZI7BF.js";
|
|
4
|
+
import "./types-DOUhndhT.js";
|
|
5
|
+
import "./flowCompletionService-BdR2cGgB.js";
|
|
6
|
+
import { a as FlowEventListener, c as FlowModuleStartedEvent, i as FlowEvent, l as FlowReadyEvent, n as FlowCompletedEvent, o as FlowEventSubscribable, r as FlowErrorEvent, s as FlowModuleCompletedEvent, t as FlowClosedEvent, u as FlowStartedEvent } from "./index-B5hPA0Bg.js";
|
|
6
7
|
export { FlowClosedEvent, FlowCompletedEvent, FlowErrorEvent, FlowEvent, FlowEventListener, FlowEventSubscribable, FlowModuleCompletedEvent, FlowModuleStartedEvent, FlowReadyEvent, FlowStartedEvent };
|
package/dist/flow.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
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
|
|
7
|
-
import { n as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
1
|
+
import { n as WasmPipeline } from "./warmup-Dg8Lh-50.js";
|
|
2
|
+
import { t as Manager } from "./Manager-BHn8wH8K.js";
|
|
3
|
+
import { t as AnyStateMachine } from "./StateMachine-BC_nGvrc.js";
|
|
4
|
+
import "./camera-SRBpPq2X.js";
|
|
5
|
+
import "./types-Bj9hdFjU.js";
|
|
6
|
+
import "./types-DvGZI7BF.js";
|
|
7
|
+
import { i as FlowModuleConfig, n as Flow, r as FlowModule } from "./types-DOUhndhT.js";
|
|
8
|
+
import { n as GetFinishStatusFn, t as FinishStatus } from "./flowCompletionService-BdR2cGgB.js";
|
|
9
|
+
import { o as FlowEventSubscribable } from "./index-B5hPA0Bg.js";
|
|
10
|
+
import { n as ModuleRegistry } from "./types-NuT8ftBV.js";
|
|
11
|
+
import * as xstate715 from "xstate";
|
|
11
12
|
|
|
12
13
|
//#region src/modules/flow/flowUtils.d.ts
|
|
13
14
|
type NormalizeFlowModulesOptions = {
|
|
@@ -59,7 +60,7 @@ type GetFlow = (signal: AbortSignal, options?: GetFlowOptions) => Promise<Flow>;
|
|
|
59
60
|
declare const getFlow: GetFlow;
|
|
60
61
|
//#endregion
|
|
61
62
|
//#region src/modules/flow/noOpFlowModuleMachine.d.ts
|
|
62
|
-
declare const noOpFlowModuleMachine:
|
|
63
|
+
declare const noOpFlowModuleMachine: xstate715.StateMachine<xstate715.MachineContext, xstate715.AnyEventObject, {}, never, never, never, never, "finished", string, xstate715.NonReducibleUnknown, xstate715.NonReducibleUnknown, xstate715.EventObject, xstate715.MetaObject, {
|
|
63
64
|
readonly id: "noOpFlowModule";
|
|
64
65
|
readonly initial: "finished";
|
|
65
66
|
readonly states: {
|
|
@@ -277,6 +278,8 @@ type OrchestratedFlowFinishedState = {
|
|
|
277
278
|
redirectionUrl: string;
|
|
278
279
|
action: 'approved' | 'rejected' | 'none';
|
|
279
280
|
scoreStatus: 'OK' | 'WARN' | 'MANUAL_OK' | 'FAIL' | 'UNKNOWN' | 'MANUAL_FAIL';
|
|
281
|
+
endScreenTitle: string | null;
|
|
282
|
+
endScreenText: string | null;
|
|
280
283
|
};
|
|
281
284
|
homeScreen: OrchestratedFlowHomeScreen;
|
|
282
285
|
presentation: OrchestratedFlowPresentation;
|
|
@@ -328,13 +331,18 @@ declare function createOrchestratedFlowManager(options: CreateOrchestratedFlowAc
|
|
|
328
331
|
*/
|
|
329
332
|
completeFlow(): void;
|
|
330
333
|
/**
|
|
331
|
-
* Signal that the current module encountered
|
|
332
|
-
*
|
|
333
|
-
*
|
|
334
|
+
* Signal that the current module encountered a terminal error, optionally
|
|
335
|
+
* with its machine-readable `moduleErrorCode`. The flow machine decides what
|
|
336
|
+
* to do: an advanceable terminal error (e.g. `NONEXISTENT_CUSTOMER`,
|
|
337
|
+
* `HINT_NOT_PROVIDED`) advances to the next step; any other error transitions
|
|
338
|
+
* to the terminal error state. Callers always forward the code and let core
|
|
339
|
+
* classify — no per-module branching in the UI.
|
|
334
340
|
*
|
|
335
341
|
* @param error - Error message describing what went wrong
|
|
342
|
+
* @param moduleErrorCode - Optional machine-readable error code (a
|
|
343
|
+
* `FaceErrorCode`) used by the flow machine to decide advance vs terminate
|
|
336
344
|
*/
|
|
337
|
-
errorModule(error: string): void;
|
|
345
|
+
errorModule(error: string, moduleErrorCode?: string): void;
|
|
338
346
|
/**
|
|
339
347
|
* Send a raw event to the flow state machine.
|
|
340
348
|
* Prefer using the typed methods (completeModule, errorModule) when possible.
|
package/dist/flow.esm.js
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import "./api-CESGtpbH.esm.js";
|
|
2
|
-
import "./events-
|
|
3
|
-
import "./endpoints-
|
|
4
|
-
import "./
|
|
5
|
-
import "./IpifyProvider-
|
|
6
|
-
import "./browserSimulation-
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { t as
|
|
2
|
+
import { h as addEvent } from "./events-Dvvriq9l.esm.js";
|
|
3
|
+
import "./endpoints-BeTK0Mlt.esm.js";
|
|
4
|
+
import "./stats-BMNUG1AU.esm.js";
|
|
5
|
+
import "./IpifyProvider-D4LWD15E.esm.js";
|
|
6
|
+
import "./browserSimulation-B1dWiXp7.esm.js";
|
|
7
|
+
import "./sessionInitializer-B8H5MsXM.esm.js";
|
|
8
|
+
import "./platform-SKvEfCBh.esm.js";
|
|
9
|
+
import "./getBrowser-C8DP7oTB.esm.js";
|
|
10
|
+
import { a as fromPromise, c as createManager, r as assign, s as createActor, t as setup } from "./xstate.esm-C9wncMQa.esm.js";
|
|
11
|
+
import "./apiError-B-j-gyDx.esm.js";
|
|
12
|
+
import "./types-DsnEVMhr.esm.js";
|
|
13
|
+
import "./session-DoVb-OcB.esm.js";
|
|
14
|
+
import { n as getRequiredWasmPipelines, r as normalizeFlowModules, t as getFlow } from "./flowServices-BTuHLHVr.esm.js";
|
|
15
|
+
import { n as isAdvanceableError, r as attachFlowEventEmitter, t as runChildModule } from "./runChildModule-CuoHZ1cx.esm.js";
|
|
16
|
+
import { t as getFinishStatus } from "./flowCompletionService-DdGojV9K.esm.js";
|
|
11
17
|
|
|
12
18
|
//#region src/modules/flow/noOpFlowModuleMachine.ts
|
|
13
19
|
const noOpFlowModuleMachine = setup({}).createMachine({
|
|
@@ -304,6 +310,13 @@ function getModuleConfig(module, flow) {
|
|
|
304
310
|
...config,
|
|
305
311
|
ageAssurance: config.ageAssurance ?? flow?.ageAssurance
|
|
306
312
|
};
|
|
313
|
+
if (module?.key === "FACE_MATCH") {
|
|
314
|
+
const hasAuthentication = flow?.flowModules?.some((m) => m.key === "AUTHENTICATION") ?? false;
|
|
315
|
+
return {
|
|
316
|
+
...config,
|
|
317
|
+
processFaceBeforeMatch: hasAuthentication
|
|
318
|
+
};
|
|
319
|
+
}
|
|
307
320
|
return config;
|
|
308
321
|
}
|
|
309
322
|
function createBaseContext(context, isHomeContinueLoading) {
|
|
@@ -311,6 +324,7 @@ function createBaseContext(context, isHomeContinueLoading) {
|
|
|
311
324
|
flow: void 0,
|
|
312
325
|
error: void 0,
|
|
313
326
|
errorCode: void 0,
|
|
327
|
+
moduleErrorCode: void 0,
|
|
314
328
|
steps: [],
|
|
315
329
|
currentStepIndex: -1,
|
|
316
330
|
currentStep: void 0,
|
|
@@ -419,9 +433,22 @@ const orchestratedFlowMachine = setup({
|
|
|
419
433
|
prefetchNextModule: ({ context }) => {
|
|
420
434
|
prefetchNextLazyModule(context);
|
|
421
435
|
},
|
|
422
|
-
setFinishStatus: assign(({ event }) => ({ finishStatus: event.output }))
|
|
436
|
+
setFinishStatus: assign(({ event }) => ({ finishStatus: event.output })),
|
|
437
|
+
setModuleErrorCode: assign(({ event }) => ({ moduleErrorCode: event.moduleErrorCode })),
|
|
438
|
+
trackAdvanceableModuleError: ({ context, event }) => {
|
|
439
|
+
addEvent({
|
|
440
|
+
code: "errorTriggered",
|
|
441
|
+
module: context.currentStep,
|
|
442
|
+
payload: {
|
|
443
|
+
errorCode: event.moduleErrorCode,
|
|
444
|
+
advanced: true
|
|
445
|
+
}
|
|
446
|
+
});
|
|
447
|
+
}
|
|
423
448
|
},
|
|
424
449
|
guards: {
|
|
450
|
+
isAdvanceableModuleError: ({ event }) => isAdvanceableError(event.moduleErrorCode),
|
|
451
|
+
isAdvanceableModuleErrorOnLastStep: ({ context, event }) => isAdvanceableError(event.moduleErrorCode) && context.currentStepIndex >= 0 && context.currentStepIndex === context.steps.length - 1,
|
|
425
452
|
isLastStep: ({ context }) => context.currentStepIndex >= 0 && context.currentStepIndex === context.steps.length - 1,
|
|
426
453
|
canGoNext: ({ context }) => context.currentStepIndex >= 0 && context.currentStepIndex < context.steps.length - 1,
|
|
427
454
|
shouldEnterHome: ({ context }) => shouldEnterHome(context),
|
|
@@ -557,10 +584,26 @@ const orchestratedFlowMachine = setup({
|
|
|
557
584
|
target: "resolvingModule",
|
|
558
585
|
actions: "incrementStep"
|
|
559
586
|
}],
|
|
560
|
-
MODULE_ERROR:
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
587
|
+
MODULE_ERROR: [
|
|
588
|
+
{
|
|
589
|
+
guard: "isAdvanceableModuleErrorOnLastStep",
|
|
590
|
+
target: "completing",
|
|
591
|
+
actions: ["setModuleErrorCode", "trackAdvanceableModuleError"]
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
guard: "isAdvanceableModuleError",
|
|
595
|
+
target: "resolvingModule",
|
|
596
|
+
actions: [
|
|
597
|
+
"setModuleErrorCode",
|
|
598
|
+
"trackAdvanceableModuleError",
|
|
599
|
+
"incrementStep"
|
|
600
|
+
]
|
|
601
|
+
},
|
|
602
|
+
{
|
|
603
|
+
target: "error",
|
|
604
|
+
actions: assign(({ event }) => ({ error: String(event.error) }))
|
|
605
|
+
}
|
|
606
|
+
],
|
|
564
607
|
COMPLETE_FLOW: { target: "completing" },
|
|
565
608
|
RESET: {
|
|
566
609
|
target: "idle",
|
|
@@ -661,7 +704,9 @@ function mapOrchestratedFlowState(snapshot, uiOptions) {
|
|
|
661
704
|
finishStatus: context.finishStatus ?? {
|
|
662
705
|
redirectionUrl: "",
|
|
663
706
|
action: "none",
|
|
664
|
-
scoreStatus: "UNKNOWN"
|
|
707
|
+
scoreStatus: "UNKNOWN",
|
|
708
|
+
endScreenTitle: null,
|
|
709
|
+
endScreenText: null
|
|
665
710
|
},
|
|
666
711
|
homeScreen: uiModel.homeScreen,
|
|
667
712
|
presentation: uiModel.presentation
|
|
@@ -755,10 +800,11 @@ function createOrchestratedFlowApi({ actor, getSnapshot, trackElementClicked },
|
|
|
755
800
|
trackElementClicked?.("completeFlow");
|
|
756
801
|
actor.send({ type: "COMPLETE_FLOW" });
|
|
757
802
|
},
|
|
758
|
-
errorModule(error) {
|
|
803
|
+
errorModule(error, moduleErrorCode) {
|
|
759
804
|
actor.send({
|
|
760
805
|
type: "MODULE_ERROR",
|
|
761
|
-
error
|
|
806
|
+
error,
|
|
807
|
+
moduleErrorCode
|
|
762
808
|
});
|
|
763
809
|
},
|
|
764
810
|
send(event) {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/modules/flow/flowCompletionService.d.ts
|
|
2
|
+
type FinishStatus = {
|
|
3
|
+
redirectionUrl: string;
|
|
4
|
+
action: 'approved' | 'rejected' | 'none';
|
|
5
|
+
scoreStatus: 'OK' | 'WARN' | 'MANUAL_OK' | 'FAIL' | 'UNKNOWN' | 'MANUAL_FAIL';
|
|
6
|
+
/**
|
|
7
|
+
* Dashboard-configured completion-screen copy. Sourced from POST /omni/start
|
|
8
|
+
* (session creation), not /omni/finish-status — `getFinishStatus` itself
|
|
9
|
+
* always returns `null` here and the orchestrated flow overlays the real
|
|
10
|
+
* values captured at session creation. `null` when the dashboard has no
|
|
11
|
+
* end-screen configured. Raw values only; hosts apply their own i18n fallback.
|
|
12
|
+
*/
|
|
13
|
+
endScreenTitle: string | null;
|
|
14
|
+
endScreenText: string | null;
|
|
15
|
+
};
|
|
16
|
+
type GetFinishStatusFn = (flowId: string | undefined | null, signal?: AbortSignal) => Promise<FinishStatus>;
|
|
17
|
+
declare const getFinishStatus: GetFinishStatusFn;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { GetFinishStatusFn as n, getFinishStatus as r, FinishStatus as t };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { t as api } from "./api-CESGtpbH.esm.js";
|
|
2
|
+
import { t as endpoints } from "./endpoints-BeTK0Mlt.esm.js";
|
|
3
|
+
import { n as toIncodeApiError } from "./apiError-B-j-gyDx.esm.js";
|
|
4
|
+
|
|
5
|
+
//#region src/modules/flow/flowCompletionService.ts
|
|
6
|
+
const getFinishStatus = async (flowId, signal) => {
|
|
7
|
+
const url = `${endpoints.finishStatus}${flowId ? `?flowId=${flowId}` : ""}`;
|
|
8
|
+
try {
|
|
9
|
+
return {
|
|
10
|
+
...(await api.get(url, { signal })).data,
|
|
11
|
+
endScreenTitle: null,
|
|
12
|
+
endScreenText: null
|
|
13
|
+
};
|
|
14
|
+
} catch (error) {
|
|
15
|
+
toIncodeApiError(endpoints.finishStatus, error);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
export { getFinishStatus as t };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { t as api } from "./api-CESGtpbH.esm.js";
|
|
2
|
-
import { t as endpoints } from "./endpoints-
|
|
3
|
-
import { n as getSessionFingerprintResult, r as initializeSession } from "./
|
|
2
|
+
import { t as endpoints } from "./endpoints-BeTK0Mlt.esm.js";
|
|
3
|
+
import { n as getSessionFingerprintResult, r as initializeSession } from "./sessionInitializer-B8H5MsXM.esm.js";
|
|
4
|
+
import { n as toIncodeApiError } from "./apiError-B-j-gyDx.esm.js";
|
|
4
5
|
|
|
5
6
|
//#region src/modules/flow/flowUtils.ts
|
|
6
7
|
const WASM_MODULE_PIPELINES = {
|
|
@@ -168,9 +169,13 @@ function prependMandatoryConsent(flow) {
|
|
|
168
169
|
}
|
|
169
170
|
const getFlow = async (signal, options = {}) => {
|
|
170
171
|
const sessionPromise = initializeSession({ signal }).catch(() => void 0);
|
|
171
|
-
const
|
|
172
|
-
|
|
173
|
-
|
|
172
|
+
const flowResponsePromise = api.get(endpoints.flow, { signal });
|
|
173
|
+
let data;
|
|
174
|
+
try {
|
|
175
|
+
data = (await flowResponsePromise).data;
|
|
176
|
+
} catch (error) {
|
|
177
|
+
toIncodeApiError(endpoints.flow, error);
|
|
178
|
+
}
|
|
174
179
|
if (data.mandatoryConsentCheck !== false) await sessionPromise;
|
|
175
180
|
const flow = prependMandatoryConsent(data);
|
|
176
181
|
const normalizedModules = normalizeFlowModules(flow, options);
|
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-BHn8wH8K.js";
|
|
2
|
+
import "./Actor-Y0_Fj-KL.js";
|
|
3
3
|
|
|
4
4
|
//#region ../infra/src/capabilities/IGeolocationCapability.d.ts
|
|
5
5
|
type GeolocationCoords = {
|
|
@@ -56,11 +56,11 @@ type GeolocationSubmittingState = {
|
|
|
56
56
|
};
|
|
57
57
|
/**
|
|
58
58
|
* Location successfully acquired — call `continue()` to proceed
|
|
59
|
-
* @property location - Location name returned from backend, or
|
|
59
|
+
* @property location - Location name returned from backend, or null
|
|
60
60
|
*/
|
|
61
61
|
type GeolocationAcquiredState = {
|
|
62
62
|
status: 'locationAcquired';
|
|
63
|
-
location: string;
|
|
63
|
+
location: string | null;
|
|
64
64
|
};
|
|
65
65
|
/**
|
|
66
66
|
* User denied geolocation permission — shows device-specific instructions
|