@incodetech/core 2.0.1 → 2.1.0-rc.1
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-BKWm8rSA.esm.js} +202 -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-5M-fKzXx.esm.js → authenticationManager-BlR6mSaG.esm.js} +6 -6
- package/dist/{authenticationManager-C83GNIhl.d.ts → authenticationManager-CaiQbp-q.d.ts} +4 -4
- package/dist/{authenticationStateMachine-BMZqatiF.esm.js → authenticationStateMachine-DkcGUMw5.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-BYo9Nu1r.esm.js +90 -0
- package/dist/consentManager-Cg5Sk2tv.d.ts +419 -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-Dg1s_TY5.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-8tnddNx-.esm.js} +19 -10
- package/dist/deepsightService-CrHmvx8X.esm.js +276 -0
- package/dist/{deepsightService-CEVxzehb.d.ts → deepsightService-Dh5P-hLf.d.ts} +13 -160
- package/dist/device.esm.js +4 -3
- package/dist/document-capture.d.ts +989 -80
- package/dist/document-capture.esm.js +34 -8
- package/dist/document-upload.d.ts +44 -44
- package/dist/document-upload.esm.js +7 -7
- package/dist/{documentCaptureStateMachine-BqzTDy9k.esm.js → documentCaptureStateMachine-CUTUzUw_.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-klc-AImJ.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 +41 -16
- package/dist/extensibility.esm.js +55 -33
- package/dist/face-match.d.ts +21 -2
- package/dist/face-match.esm.js +5 -5
- package/dist/{faceCaptureManagerFactory-yqtpxjnN.d.ts → faceCaptureManagerFactory-CjdBUS6s.d.ts} +48 -17
- package/dist/{faceCaptureManagerFactory-Dh2PdGlF.esm.js → faceCaptureManagerFactory-ej2j1LMr.esm.js} +21 -5
- package/dist/{faceCaptureSetup-B3faSpYA.esm.js → faceCaptureSetup-B9t6bYze.esm.js} +68 -183
- package/dist/{faceMatchStateMachine-DNFrxTFS.esm.js → faceMatchStateMachine-DeXXzSuz.esm.js} +62 -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 +56 -17
- package/dist/flowCompletionService-BdR2cGgB.d.ts +19 -0
- package/dist/flowCompletionService-DdGojV9K.esm.js +20 -0
- package/dist/{flowServices-PiNsxLfK.esm.js → flowServices-ChgTNggJ.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 +70 -27
- package/dist/{idCaptureManager-Fyd0eam-.d.ts → idCaptureManager-ChCNmgBj.d.ts} +40 -20
- package/dist/{idCaptureManager-D0ktk7Hh.esm.js → idCaptureManager-D3pwWutw.esm.js} +22 -7
- package/dist/{idCaptureStateMachine-dwlBUjbC.esm.js → idCaptureStateMachine-B3AiDIsT.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-Cww-NDtd.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-Dq6WiOZh.d.ts +429 -0
- package/dist/mandatoryConsentManager-H6D18cZB.esm.js +89 -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-D0wGddy7.esm.js +23 -0
- package/dist/permissionServices-Doec4X5L.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-yRw7hfzU.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 +53 -24
- package/dist/{selfieManager-Duisl7qN.esm.js → selfieManager-BNuTIGAz.esm.js} +6 -6
- package/dist/{selfieManager-D0lSgd-J.d.ts → selfieManager-C2y_t6DG.d.ts} +4 -4
- package/dist/{selfieStateMachine-D76whWEf.esm.js → selfieStateMachine-Bv99bZJE.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-DRB-hgbV.esm.js +366 -0
- package/dist/{setup-C5AITV8m.d.ts → setup-BwCluiw3.d.ts} +86 -6
- package/dist/{setup-DPPAxmXf.esm.js → setup-CUO4mErT.esm.js} +175 -25
- 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 +146 -100
- package/dist/workflow.esm.js +116 -66
- 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
|
@@ -1,102 +1,9 @@
|
|
|
1
1
|
import "./BrowserTimerProvider-DhNc_x02.esm.js";
|
|
2
2
|
import "./api-CESGtpbH.esm.js";
|
|
3
|
-
import
|
|
4
|
-
import "./endpoints-
|
|
5
|
-
import
|
|
6
|
-
import { t as redirectToMobileMachine } from "./redirectToMobileStateMachine-
|
|
3
|
+
import "./events-Dvvriq9l.esm.js";
|
|
4
|
+
import "./endpoints-BeTK0Mlt.esm.js";
|
|
5
|
+
import "./xstate.esm-C9wncMQa.esm.js";
|
|
6
|
+
import { n as defaultRedirectToMobileServices, t as redirectToMobileMachine } from "./redirectToMobileStateMachine-DyAdRxfP.esm.js";
|
|
7
|
+
import { n as createRedirectToMobileManagerFromActor, t as createRedirectToMobileManager } from "./redirectToMobileManager-Dy3t7o0C.esm.js";
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
function createRedirectToMobileActor(options) {
|
|
10
|
-
return createActor(redirectToMobileMachine, { input: { config: options.config } }).start();
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
//#endregion
|
|
14
|
-
//#region src/modules/redirect-to-mobile/redirectToMobileManager.ts
|
|
15
|
-
function mapState(snapshot) {
|
|
16
|
-
const typedSnapshot = snapshot;
|
|
17
|
-
const { context } = typedSnapshot;
|
|
18
|
-
if (typedSnapshot.matches("idle")) return { status: "idle" };
|
|
19
|
-
if (typedSnapshot.matches("generatingUrl") || typedSnapshot.matches("loadingStartInfo")) return { status: "loading" };
|
|
20
|
-
if (typedSnapshot.matches("showingQr")) return {
|
|
21
|
-
status: "redirecting",
|
|
22
|
-
redirectUrl: context.redirectUrl,
|
|
23
|
-
phonePrefix: context.phonePrefix,
|
|
24
|
-
smsSent: context.smsSent,
|
|
25
|
-
error: context.error
|
|
26
|
-
};
|
|
27
|
-
if (typedSnapshot.matches("finished")) return { status: "finished" };
|
|
28
|
-
if (typedSnapshot.matches("closed")) return { status: "closed" };
|
|
29
|
-
if (typedSnapshot.matches("error")) return {
|
|
30
|
-
status: "error",
|
|
31
|
-
error: context.error ?? "An error occurred"
|
|
32
|
-
};
|
|
33
|
-
return { status: "idle" };
|
|
34
|
-
}
|
|
35
|
-
function createApi({ actor, trackElementClicked }) {
|
|
36
|
-
return {
|
|
37
|
-
load() {
|
|
38
|
-
actor.send({ type: "LOAD" });
|
|
39
|
-
},
|
|
40
|
-
sendSms(phone) {
|
|
41
|
-
trackElementClicked?.("sendSms");
|
|
42
|
-
actor.send({
|
|
43
|
-
type: "SEND_SMS",
|
|
44
|
-
phone
|
|
45
|
-
});
|
|
46
|
-
},
|
|
47
|
-
continueOnDesktop() {
|
|
48
|
-
trackElementClicked?.("continueOnDesktop");
|
|
49
|
-
actor.send({ type: "CONTINUE_ON_DESKTOP" });
|
|
50
|
-
},
|
|
51
|
-
resetSms() {
|
|
52
|
-
actor.send({ type: "RESET_SMS" });
|
|
53
|
-
},
|
|
54
|
-
close() {
|
|
55
|
-
trackElementClicked?.("close");
|
|
56
|
-
actor.send({ type: "CLOSE" });
|
|
57
|
-
},
|
|
58
|
-
retry() {
|
|
59
|
-
trackElementClicked?.("retry");
|
|
60
|
-
actor.send({ type: "RETRY" });
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Creates a redirect-to-mobile manager for cross-device onboarding flows.
|
|
66
|
-
*
|
|
67
|
-
* On desktop, displays a QR code (and optional SMS input) so the user can
|
|
68
|
-
* continue on their mobile device. Polls the backend until the mobile
|
|
69
|
-
* session completes, then transitions to `finished`.
|
|
70
|
-
*
|
|
71
|
-
* @param options - Configuration for the redirect module
|
|
72
|
-
* @returns A manager instance with state subscription and API methods
|
|
73
|
-
*
|
|
74
|
-
* @example
|
|
75
|
-
* ```ts
|
|
76
|
-
* const manager = createRedirectToMobileManager({
|
|
77
|
-
* config: { disableSmsOption: false, addContinueToDesktop: true },
|
|
78
|
-
* });
|
|
79
|
-
*
|
|
80
|
-
* manager.subscribe((state) => {
|
|
81
|
-
* if (state.status === 'redirecting') {
|
|
82
|
-
* renderQrCode(state.redirectUrl);
|
|
83
|
-
* }
|
|
84
|
-
* if (state.status === 'finished') {
|
|
85
|
-
* console.log('Mobile onboarding complete');
|
|
86
|
-
* }
|
|
87
|
-
* });
|
|
88
|
-
*
|
|
89
|
-
* manager.load();
|
|
90
|
-
* ```
|
|
91
|
-
*/
|
|
92
|
-
function createRedirectToMobileManager(options) {
|
|
93
|
-
return createManager({
|
|
94
|
-
actor: createRedirectToMobileActor(options),
|
|
95
|
-
mapState,
|
|
96
|
-
createApi,
|
|
97
|
-
instrumentation: createManagerInstrumentation(eventModuleNames.qr)
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
//#endregion
|
|
102
|
-
export { createRedirectToMobileManager, redirectToMobileMachine };
|
|
9
|
+
export { createRedirectToMobileManager, createRedirectToMobileManagerFromActor, defaultRedirectToMobileServices, redirectToMobileMachine };
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { t as Manager } from "./Manager-BHn8wH8K.js";
|
|
2
|
+
import { t as ActorRefFrom } from "./Actor-Y0_Fj-KL.js";
|
|
3
|
+
|
|
4
|
+
//#region src/modules/redirect-to-mobile/types.d.ts
|
|
5
|
+
type RedirectToMobileConfig = {
|
|
6
|
+
flowId?: string;
|
|
7
|
+
url?: string;
|
|
8
|
+
disableSmsOption?: boolean;
|
|
9
|
+
addContinueToDesktop?: boolean;
|
|
10
|
+
qrPhishingResistance?: boolean;
|
|
11
|
+
authHint?: string;
|
|
12
|
+
externalId?: string;
|
|
13
|
+
lang?: string;
|
|
14
|
+
};
|
|
15
|
+
type OnboardingStatus = 'ONBOARDING_FINISHED' | 'ONBOARDING_IN_PROGRESS' | 'ONBOARDING_NOT_STARTED';
|
|
16
|
+
type OnboardingStatusResponse = {
|
|
17
|
+
onboardingStatus: OnboardingStatus;
|
|
18
|
+
};
|
|
19
|
+
type RedirectUrlResponse = {
|
|
20
|
+
url: string;
|
|
21
|
+
};
|
|
22
|
+
type QrRefreshResponse = {
|
|
23
|
+
urlUuid: string;
|
|
24
|
+
};
|
|
25
|
+
type StartInfoResponse = {
|
|
26
|
+
phonePrefix: string;
|
|
27
|
+
ipIsoCode: string;
|
|
28
|
+
};
|
|
29
|
+
type SendRedirectSmsParams = {
|
|
30
|
+
smsType: 'DESKTOP_ONBOARDING';
|
|
31
|
+
uuid: string;
|
|
32
|
+
params?: string[];
|
|
33
|
+
};
|
|
34
|
+
type RedirectToMobileServices = {
|
|
35
|
+
fetchRedirectUrl: (signal?: AbortSignal) => Promise<RedirectUrlResponse>;
|
|
36
|
+
fetchOnboardingStatus: (signal?: AbortSignal) => Promise<OnboardingStatusResponse>;
|
|
37
|
+
sendRedirectSms: (params: SendRedirectSmsParams, signal?: AbortSignal) => Promise<void>;
|
|
38
|
+
addPhoneForRedirect: (phone: string, signal?: AbortSignal) => Promise<void>;
|
|
39
|
+
refreshQrUuid: (onboardingId: string, signal?: AbortSignal) => Promise<QrRefreshResponse>;
|
|
40
|
+
fetchStartInfo: (signal?: AbortSignal) => Promise<StartInfoResponse>;
|
|
41
|
+
};
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/modules/redirect-to-mobile/redirectToMobileStateMachine.d.ts
|
|
44
|
+
|
|
45
|
+
declare const redirectToMobileMachine: any;
|
|
46
|
+
type RedirectToMobileMachine = typeof redirectToMobileMachine;
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/modules/redirect-to-mobile/redirectToMobileActor.d.ts
|
|
49
|
+
type CreateRedirectToMobileActorOptions = {
|
|
50
|
+
config: RedirectToMobileConfig;
|
|
51
|
+
services?: Partial<RedirectToMobileServices>;
|
|
52
|
+
};
|
|
53
|
+
type RedirectToMobileActor = ActorRefFrom<RedirectToMobileMachine>;
|
|
54
|
+
//#endregion
|
|
55
|
+
//#region src/modules/redirect-to-mobile/redirectToMobileManager.d.ts
|
|
56
|
+
type RedirectToMobileIdleState = {
|
|
57
|
+
status: 'idle';
|
|
58
|
+
};
|
|
59
|
+
type RedirectToMobileLoadingState = {
|
|
60
|
+
status: 'loading';
|
|
61
|
+
};
|
|
62
|
+
type RedirectToMobileRedirectingState = {
|
|
63
|
+
status: 'redirecting';
|
|
64
|
+
redirectUrl: string;
|
|
65
|
+
phonePrefix: string;
|
|
66
|
+
smsSent: boolean;
|
|
67
|
+
error: string | undefined;
|
|
68
|
+
};
|
|
69
|
+
type RedirectToMobileFinishedState = {
|
|
70
|
+
status: 'finished';
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* User pressed "Continue on Desktop" — the desktop flow should advance past
|
|
74
|
+
* this module rather than terminate. Distinct from `closed` (which follows
|
|
75
|
+
* the SDK-wide "user dismissed" convention) so hosts can wire this to a
|
|
76
|
+
* separate `onContinue` callback without conflating it with an error.
|
|
77
|
+
*/
|
|
78
|
+
type RedirectToMobileContinueState = {
|
|
79
|
+
status: 'continue';
|
|
80
|
+
};
|
|
81
|
+
type RedirectToMobileClosedState = {
|
|
82
|
+
status: 'closed';
|
|
83
|
+
};
|
|
84
|
+
type RedirectToMobileErrorState = {
|
|
85
|
+
status: 'error';
|
|
86
|
+
error: string;
|
|
87
|
+
};
|
|
88
|
+
type RedirectToMobileState = RedirectToMobileIdleState | RedirectToMobileLoadingState | RedirectToMobileRedirectingState | RedirectToMobileFinishedState | RedirectToMobileContinueState | RedirectToMobileClosedState | RedirectToMobileErrorState;
|
|
89
|
+
/**
|
|
90
|
+
* Creates a redirect-to-mobile manager for cross-device onboarding flows.
|
|
91
|
+
*
|
|
92
|
+
* On desktop, displays a QR code (and optional SMS input) so the user can
|
|
93
|
+
* continue on their mobile device. Polls the backend until the mobile
|
|
94
|
+
* session completes, then transitions to `finished`.
|
|
95
|
+
*
|
|
96
|
+
* @param options - Configuration for the redirect module
|
|
97
|
+
* @returns A manager instance with state subscription and API methods
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* ```ts
|
|
101
|
+
* const manager = createRedirectToMobileManager({
|
|
102
|
+
* config: { disableSmsOption: false, addContinueToDesktop: true },
|
|
103
|
+
* });
|
|
104
|
+
*
|
|
105
|
+
* manager.subscribe((state) => {
|
|
106
|
+
* if (state.status === 'redirecting') {
|
|
107
|
+
* renderQrCode(state.redirectUrl);
|
|
108
|
+
* }
|
|
109
|
+
* if (state.status === 'finished') {
|
|
110
|
+
* console.log('Mobile onboarding complete');
|
|
111
|
+
* }
|
|
112
|
+
* });
|
|
113
|
+
*
|
|
114
|
+
* manager.load();
|
|
115
|
+
* ```
|
|
116
|
+
*/
|
|
117
|
+
declare function createRedirectToMobileManager(options: CreateRedirectToMobileActorOptions): Manager<RedirectToMobileState> & {
|
|
118
|
+
/**
|
|
119
|
+
* Starts the redirect-to-mobile flow by fetching the redirect URL.
|
|
120
|
+
*/
|
|
121
|
+
load(): void;
|
|
122
|
+
/**
|
|
123
|
+
* Sends an SMS with the redirect link to the given phone number.
|
|
124
|
+
* @param phone - Full phone number with country code
|
|
125
|
+
*/
|
|
126
|
+
sendSms(phone: string): void;
|
|
127
|
+
/**
|
|
128
|
+
* Skips the redirect and allows the user to continue on desktop.
|
|
129
|
+
*/
|
|
130
|
+
continueOnDesktop(): void;
|
|
131
|
+
/**
|
|
132
|
+
* Resets the SMS state so the user can re-enter their phone number.
|
|
133
|
+
*/
|
|
134
|
+
resetSms(): void;
|
|
135
|
+
/**
|
|
136
|
+
* Closes/dismisses the redirect screen.
|
|
137
|
+
*/
|
|
138
|
+
close(): void;
|
|
139
|
+
/**
|
|
140
|
+
* Retries generating the redirect URL after an error.
|
|
141
|
+
*/
|
|
142
|
+
retry(): void;
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* Creates a redirect-to-mobile manager from a pre-built actor.
|
|
146
|
+
* Use this when overriding the machine via `.provide()` for custom backends
|
|
147
|
+
* or for story-isolation testing.
|
|
148
|
+
*/
|
|
149
|
+
declare function createRedirectToMobileManagerFromActor(actor: RedirectToMobileActor): Manager<RedirectToMobileState> & {
|
|
150
|
+
/**
|
|
151
|
+
* Starts the redirect-to-mobile flow by fetching the redirect URL.
|
|
152
|
+
*/
|
|
153
|
+
load(): void;
|
|
154
|
+
/**
|
|
155
|
+
* Sends an SMS with the redirect link to the given phone number.
|
|
156
|
+
* @param phone - Full phone number with country code
|
|
157
|
+
*/
|
|
158
|
+
sendSms(phone: string): void;
|
|
159
|
+
/**
|
|
160
|
+
* Skips the redirect and allows the user to continue on desktop.
|
|
161
|
+
*/
|
|
162
|
+
continueOnDesktop(): void;
|
|
163
|
+
/**
|
|
164
|
+
* Resets the SMS state so the user can re-enter their phone number.
|
|
165
|
+
*/
|
|
166
|
+
resetSms(): void;
|
|
167
|
+
/**
|
|
168
|
+
* Closes/dismisses the redirect screen.
|
|
169
|
+
*/
|
|
170
|
+
close(): void;
|
|
171
|
+
/**
|
|
172
|
+
* Retries generating the redirect URL after an error.
|
|
173
|
+
*/
|
|
174
|
+
retry(): void;
|
|
175
|
+
};
|
|
176
|
+
type RedirectToMobileManager = ReturnType<typeof createRedirectToMobileManager>;
|
|
177
|
+
//#endregion
|
|
178
|
+
export { RedirectToMobileActor as a, RedirectToMobileServices as c, createRedirectToMobileManagerFromActor as i, RedirectToMobileState as n, redirectToMobileMachine as o, createRedirectToMobileManager as r, RedirectToMobileConfig as s, RedirectToMobileManager as t };
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { t as BrowserTimerProvider } from "./BrowserTimerProvider-DhNc_x02.esm.js";
|
|
2
|
+
import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-Dvvriq9l.esm.js";
|
|
3
|
+
import { a as fromPromise, c as createManager, i as fromCallback, s as createActor } from "./xstate.esm-C9wncMQa.esm.js";
|
|
4
|
+
import { n as defaultRedirectToMobileServices, t as redirectToMobileMachine } from "./redirectToMobileStateMachine-DyAdRxfP.esm.js";
|
|
5
|
+
|
|
6
|
+
//#region src/modules/redirect-to-mobile/redirectToMobileActor.ts
|
|
7
|
+
const POLL_INTERVAL_MS = 5e3;
|
|
8
|
+
const QR_REFRESH_INTERVAL_MS = 5e3;
|
|
9
|
+
function resolveServices(overrides) {
|
|
10
|
+
return {
|
|
11
|
+
...defaultRedirectToMobileServices,
|
|
12
|
+
...overrides
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function createRedirectToMobileMachineWithServices(services) {
|
|
16
|
+
return redirectToMobileMachine.provide({ actors: {
|
|
17
|
+
fetchRedirectUrl: fromPromise(async ({ signal }) => services.fetchRedirectUrl(signal)),
|
|
18
|
+
fetchStartInfo: fromPromise(async ({ signal }) => services.fetchStartInfo(signal)),
|
|
19
|
+
pollOnboardingStatus: fromCallback(({ sendBack }) => {
|
|
20
|
+
const timer = BrowserTimerProvider.getInstance();
|
|
21
|
+
const interval = timer.setInterval(async () => {
|
|
22
|
+
try {
|
|
23
|
+
if ((await services.fetchOnboardingStatus()).onboardingStatus === "ONBOARDING_FINISHED") sendBack({ type: "POLL_TICK" });
|
|
24
|
+
} catch {}
|
|
25
|
+
}, POLL_INTERVAL_MS);
|
|
26
|
+
return () => timer.clearInterval(interval);
|
|
27
|
+
}),
|
|
28
|
+
refreshQrUuid: fromCallback(({ sendBack, input }) => {
|
|
29
|
+
const timer = BrowserTimerProvider.getInstance();
|
|
30
|
+
const interval = timer.setInterval(async () => {
|
|
31
|
+
try {
|
|
32
|
+
const res = await services.refreshQrUuid(input.uuid);
|
|
33
|
+
if (res.urlUuid) sendBack({
|
|
34
|
+
type: "QR_REFRESHED",
|
|
35
|
+
urlUuid: res.urlUuid
|
|
36
|
+
});
|
|
37
|
+
} catch {}
|
|
38
|
+
}, QR_REFRESH_INTERVAL_MS);
|
|
39
|
+
return () => timer.clearInterval(interval);
|
|
40
|
+
}),
|
|
41
|
+
sendSms: fromPromise(async ({ input, signal }) => {
|
|
42
|
+
await services.addPhoneForRedirect(input.phone, signal);
|
|
43
|
+
const params = input.lang ? [`lang=${input.lang}`] : [];
|
|
44
|
+
await services.sendRedirectSms({
|
|
45
|
+
smsType: "DESKTOP_ONBOARDING",
|
|
46
|
+
uuid: input.uuid,
|
|
47
|
+
params
|
|
48
|
+
}, signal);
|
|
49
|
+
})
|
|
50
|
+
} });
|
|
51
|
+
}
|
|
52
|
+
function createRedirectToMobileActor(options) {
|
|
53
|
+
return createActor(options.services ? createRedirectToMobileMachineWithServices(resolveServices(options.services)) : redirectToMobileMachine, { input: { config: options.config } }).start();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region src/modules/redirect-to-mobile/redirectToMobileManager.ts
|
|
58
|
+
function mapState(snapshot) {
|
|
59
|
+
const typedSnapshot = snapshot;
|
|
60
|
+
const { context } = typedSnapshot;
|
|
61
|
+
if (typedSnapshot.matches("idle")) return { status: "idle" };
|
|
62
|
+
if (typedSnapshot.matches("generatingUrl") || typedSnapshot.matches("loadingStartInfo")) return { status: "loading" };
|
|
63
|
+
if (typedSnapshot.matches("showingQr")) return {
|
|
64
|
+
status: "redirecting",
|
|
65
|
+
redirectUrl: context.redirectUrl,
|
|
66
|
+
phonePrefix: context.phonePrefix,
|
|
67
|
+
smsSent: context.smsSent,
|
|
68
|
+
error: context.error
|
|
69
|
+
};
|
|
70
|
+
if (typedSnapshot.matches("finished")) return { status: "finished" };
|
|
71
|
+
if (typedSnapshot.matches("continue")) return { status: "continue" };
|
|
72
|
+
if (typedSnapshot.matches("closed")) return { status: "closed" };
|
|
73
|
+
if (typedSnapshot.matches("error")) return {
|
|
74
|
+
status: "error",
|
|
75
|
+
error: context.error ?? "An error occurred"
|
|
76
|
+
};
|
|
77
|
+
return { status: "idle" };
|
|
78
|
+
}
|
|
79
|
+
function createApi({ actor, trackElementClicked }) {
|
|
80
|
+
return {
|
|
81
|
+
load() {
|
|
82
|
+
actor.send({ type: "LOAD" });
|
|
83
|
+
},
|
|
84
|
+
sendSms(phone) {
|
|
85
|
+
trackElementClicked?.("sendSms");
|
|
86
|
+
actor.send({
|
|
87
|
+
type: "SEND_SMS",
|
|
88
|
+
phone
|
|
89
|
+
});
|
|
90
|
+
},
|
|
91
|
+
continueOnDesktop() {
|
|
92
|
+
trackElementClicked?.("continueOnDesktop");
|
|
93
|
+
actor.send({ type: "CONTINUE_ON_DESKTOP" });
|
|
94
|
+
},
|
|
95
|
+
resetSms() {
|
|
96
|
+
actor.send({ type: "RESET_SMS" });
|
|
97
|
+
},
|
|
98
|
+
close() {
|
|
99
|
+
trackElementClicked?.("close");
|
|
100
|
+
actor.send({ type: "CLOSE" });
|
|
101
|
+
},
|
|
102
|
+
retry() {
|
|
103
|
+
trackElementClicked?.("retry");
|
|
104
|
+
actor.send({ type: "RETRY" });
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Creates a redirect-to-mobile manager for cross-device onboarding flows.
|
|
110
|
+
*
|
|
111
|
+
* On desktop, displays a QR code (and optional SMS input) so the user can
|
|
112
|
+
* continue on their mobile device. Polls the backend until the mobile
|
|
113
|
+
* session completes, then transitions to `finished`.
|
|
114
|
+
*
|
|
115
|
+
* @param options - Configuration for the redirect module
|
|
116
|
+
* @returns A manager instance with state subscription and API methods
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* ```ts
|
|
120
|
+
* const manager = createRedirectToMobileManager({
|
|
121
|
+
* config: { disableSmsOption: false, addContinueToDesktop: true },
|
|
122
|
+
* });
|
|
123
|
+
*
|
|
124
|
+
* manager.subscribe((state) => {
|
|
125
|
+
* if (state.status === 'redirecting') {
|
|
126
|
+
* renderQrCode(state.redirectUrl);
|
|
127
|
+
* }
|
|
128
|
+
* if (state.status === 'finished') {
|
|
129
|
+
* console.log('Mobile onboarding complete');
|
|
130
|
+
* }
|
|
131
|
+
* });
|
|
132
|
+
*
|
|
133
|
+
* manager.load();
|
|
134
|
+
* ```
|
|
135
|
+
*/
|
|
136
|
+
function createRedirectToMobileManager(options) {
|
|
137
|
+
return createManager({
|
|
138
|
+
actor: createRedirectToMobileActor(options),
|
|
139
|
+
mapState,
|
|
140
|
+
createApi,
|
|
141
|
+
instrumentation: createManagerInstrumentation(eventModuleNames.qr)
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Creates a redirect-to-mobile manager from a pre-built actor.
|
|
146
|
+
* Use this when overriding the machine via `.provide()` for custom backends
|
|
147
|
+
* or for story-isolation testing.
|
|
148
|
+
*/
|
|
149
|
+
function createRedirectToMobileManagerFromActor(actor) {
|
|
150
|
+
return createManager({
|
|
151
|
+
actor,
|
|
152
|
+
mapState,
|
|
153
|
+
createApi,
|
|
154
|
+
instrumentation: createManagerInstrumentation(eventModuleNames.qr)
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
//#endregion
|
|
159
|
+
export { createRedirectToMobileManagerFromActor as n, createRedirectToMobileManager as t };
|
|
@@ -1,23 +1,8 @@
|
|
|
1
1
|
import { t as BrowserTimerProvider } from "./BrowserTimerProvider-DhNc_x02.esm.js";
|
|
2
2
|
import { t as api } from "./api-CESGtpbH.esm.js";
|
|
3
|
-
import { t as endpoints } from "./endpoints-
|
|
4
|
-
import { a as fromPromise, i as fromCallback, r as assign, t as setup } from "./xstate.esm-
|
|
3
|
+
import { t as endpoints } from "./endpoints-BeTK0Mlt.esm.js";
|
|
4
|
+
import { a as fromPromise, i as fromCallback, r as assign, t as setup } from "./xstate.esm-C9wncMQa.esm.js";
|
|
5
5
|
|
|
6
|
-
//#region ../infra/src/url/urlUtils.ts
|
|
7
|
-
function getUrlSearchParam(url, param) {
|
|
8
|
-
try {
|
|
9
|
-
return new URL(url).searchParams.get(param);
|
|
10
|
-
} catch {
|
|
11
|
-
return null;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
function buildUrlWithSearchParams(baseUrl, params) {
|
|
15
|
-
const url = new URL(baseUrl);
|
|
16
|
-
for (const [key, value] of Object.entries(params)) if (value !== void 0) url.searchParams.set(key, value);
|
|
17
|
-
return url.href;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
//#endregion
|
|
21
6
|
//#region src/modules/redirect-to-mobile/redirectToMobileServices.ts
|
|
22
7
|
async function fetchRedirectUrl(signal) {
|
|
23
8
|
const res = await api.get(endpoints.onboardingUrl, { signal });
|
|
@@ -47,6 +32,29 @@ async function fetchStartInfo(signal) {
|
|
|
47
32
|
if (!res.ok) throw new Error(`GET ${endpoints.startInfo} failed: ${res.status} ${res.statusText}`);
|
|
48
33
|
return res.data;
|
|
49
34
|
}
|
|
35
|
+
const defaultRedirectToMobileServices = {
|
|
36
|
+
fetchRedirectUrl,
|
|
37
|
+
fetchOnboardingStatus,
|
|
38
|
+
sendRedirectSms,
|
|
39
|
+
addPhoneForRedirect,
|
|
40
|
+
refreshQrUuid,
|
|
41
|
+
fetchStartInfo
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region ../infra/src/url/urlUtils.ts
|
|
46
|
+
function getUrlSearchParam(url, param) {
|
|
47
|
+
try {
|
|
48
|
+
return new URL(url).searchParams.get(param);
|
|
49
|
+
} catch {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function buildUrlWithSearchParams(baseUrl, params) {
|
|
54
|
+
const url = new URL(baseUrl);
|
|
55
|
+
for (const [key, value] of Object.entries(params)) if (value !== void 0) url.searchParams.set(key, value);
|
|
56
|
+
return url.href;
|
|
57
|
+
}
|
|
50
58
|
|
|
51
59
|
//#endregion
|
|
52
60
|
//#region src/modules/redirect-to-mobile/redirectToMobileStateMachine.ts
|
|
@@ -235,15 +243,16 @@ const redirectToMobileMachine = setup({
|
|
|
235
243
|
}
|
|
236
244
|
},
|
|
237
245
|
on: {
|
|
238
|
-
CONTINUE_ON_DESKTOP: "
|
|
246
|
+
CONTINUE_ON_DESKTOP: "continue",
|
|
239
247
|
CLOSE: "closed"
|
|
240
248
|
}
|
|
241
249
|
},
|
|
242
250
|
finished: { type: "final" },
|
|
251
|
+
continue: { type: "final" },
|
|
243
252
|
closed: { type: "final" },
|
|
244
253
|
error: { on: { RETRY: "generatingUrl" } }
|
|
245
254
|
}
|
|
246
255
|
});
|
|
247
256
|
|
|
248
257
|
//#endregion
|
|
249
|
-
export { redirectToMobileMachine as t };
|
|
258
|
+
export { defaultRedirectToMobileServices as n, redirectToMobileMachine as t };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { b as createEventBus, x as getTimestamp } from "./events-
|
|
2
|
-
import { i as fromCallback, s as createActor } from "./xstate.esm-
|
|
1
|
+
import { b as createEventBus, x as getTimestamp } from "./events-Dvvriq9l.esm.js";
|
|
2
|
+
import { i as fromCallback, s as createActor } from "./xstate.esm-C9wncMQa.esm.js";
|
|
3
|
+
import { t as FACE_ERROR_CODES } from "./types-DsnEVMhr.esm.js";
|
|
3
4
|
|
|
4
5
|
//#region src/internal/flow-events/flowEvents.ts
|
|
5
6
|
function createFlowEventBus() {
|
|
@@ -191,6 +192,37 @@ function attachFlowEventEmitter(manager, options = {}) {
|
|
|
191
192
|
return manager;
|
|
192
193
|
}
|
|
193
194
|
|
|
195
|
+
//#endregion
|
|
196
|
+
//#region src/internal/orchestration/advanceableErrors.ts
|
|
197
|
+
/**
|
|
198
|
+
* Module terminal-error codes that an orchestrator (workflow / flow) should
|
|
199
|
+
* treat as "advance to the next step" rather than "fail the flow". The
|
|
200
|
+
* advance-vs-fail decision lives here, at the orchestration layer, so every
|
|
201
|
+
* consumer (UI workflow, headless) behaves identically.
|
|
202
|
+
*
|
|
203
|
+
* The codes are currently all `FaceErrorCode`s because the face/auth module is
|
|
204
|
+
* the only producer of advanceable terminal errors today; at this layer they
|
|
205
|
+
* are matched against the opaque `moduleErrorCode` string a module reports.
|
|
206
|
+
*
|
|
207
|
+
* "Advanceable" is independent of "retryable" — it only decides what the flow
|
|
208
|
+
* does *after* a module reports a terminal error. Whether the module retried
|
|
209
|
+
* first is the module's own concern (e.g. the auth module's
|
|
210
|
+
* `NON_RETRYABLE_AUTH_ERROR_CODES`):
|
|
211
|
+
* - `NONEXISTENT_CUSTOMER` / `HINT_NOT_PROVIDED`: retrying the capture is
|
|
212
|
+
* pointless, so the auth module fails on the first attempt, then the flow
|
|
213
|
+
* advances (e.g. route the customer to enrollment / ID capture).
|
|
214
|
+
* - `USER_IS_NOT_RECOGNIZED`: a better-lit / better-aligned retry can still flip
|
|
215
|
+
* a borderline match, so the auth module retries up to the attempt limit; once
|
|
216
|
+
* attempts are exhausted the flow advances.
|
|
217
|
+
*/
|
|
218
|
+
const ADVANCEABLE_ERROR_CODES = [
|
|
219
|
+
FACE_ERROR_CODES.NONEXISTENT_CUSTOMER,
|
|
220
|
+
FACE_ERROR_CODES.HINT_NOT_PROVIDED,
|
|
221
|
+
FACE_ERROR_CODES.USER_IS_NOT_RECOGNIZED
|
|
222
|
+
];
|
|
223
|
+
/** True when the given code is a module terminal error the flow should advance past rather than fail on. */
|
|
224
|
+
const isAdvanceableError = (moduleErrorCode) => moduleErrorCode !== void 0 && ADVANCEABLE_ERROR_CODES.includes(moduleErrorCode);
|
|
225
|
+
|
|
194
226
|
//#endregion
|
|
195
227
|
//#region src/internal/orchestration/runChildModule.ts
|
|
196
228
|
const runChildModule = fromCallback(({ sendBack, input }) => {
|
|
@@ -216,4 +248,4 @@ const runChildModule = fromCallback(({ sendBack, input }) => {
|
|
|
216
248
|
});
|
|
217
249
|
|
|
218
250
|
//#endregion
|
|
219
|
-
export {
|
|
251
|
+
export { isAdvanceableError as n, attachFlowEventEmitter as r, runChildModule as t };
|
package/dist/selfie.d.ts
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import "./warmup-
|
|
2
|
-
import "./Manager-
|
|
3
|
-
import "./Actor-
|
|
4
|
-
import "./StateMachine-
|
|
5
|
-
import { C as DetectionStatus, E as FaceErrorCode, T as FaceCapturedImageData, a as SelfieCaptureOnlyMachine, g as SelfieConfig, h as SelfieCaptureOnlyConfig, i as SelfieCaptureOnlyActor, l as SelfieMachine, n as FaceCaptureManagerState, o as selfieCaptureOnlyMachine, r as CreateSelfieCaptureOnlyActorOptions, t as FaceCaptureManager, u as selfieMachine, w as FaceCaptureOnlyResponse } from "./faceCaptureManagerFactory-
|
|
6
|
-
import { t as CameraStream } from "./camera-
|
|
7
|
-
import "./types-
|
|
8
|
-
import "./types-
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
1
|
+
import "./warmup-Dg8Lh-50.js";
|
|
2
|
+
import "./Manager-BHn8wH8K.js";
|
|
3
|
+
import "./Actor-Y0_Fj-KL.js";
|
|
4
|
+
import "./StateMachine-BC_nGvrc.js";
|
|
5
|
+
import { C as DetectionStatus, E as FaceErrorCode, T as FaceCapturedImageData, a as SelfieCaptureOnlyMachine, g as SelfieConfig, h as SelfieCaptureOnlyConfig, i as SelfieCaptureOnlyActor, l as SelfieMachine, n as FaceCaptureManagerState, o as selfieCaptureOnlyMachine, r as CreateSelfieCaptureOnlyActorOptions, t as FaceCaptureManager, u as selfieMachine, w as FaceCaptureOnlyResponse } from "./faceCaptureManagerFactory-CjdBUS6s.js";
|
|
6
|
+
import { t as CameraStream } from "./camera-SRBpPq2X.js";
|
|
7
|
+
import "./types-Bj9hdFjU.js";
|
|
8
|
+
import "./types-DvGZI7BF.js";
|
|
9
|
+
import "./types-DOUhndhT.js";
|
|
10
|
+
import { t as DeepsightService } from "./deepsightService-Dh5P-hLf.js";
|
|
11
|
+
import { n as PermissionStatus, t as PermissionResult } from "./types-ya0LN_MX.js";
|
|
12
|
+
import "./StreamCanvasCapture-yyl20qd9.js";
|
|
13
|
+
import { a as ProcessFaceResponse, n as SelfieState, o as processFace, r as createSelfieManager, t as SelfieManager } from "./selfieManager-C2y_t6DG.js";
|
|
12
14
|
|
|
13
15
|
//#region src/modules/selfie/selfieCaptureOnlyManager.d.ts
|
|
14
16
|
type SelfieCaptureOnlyState = FaceCaptureManagerState;
|