@incodetech/core 2.0.1-rc.0 → 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-CGtQJJzB.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 +992 -83
- 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-BR2let5f.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-DG3IdWw6.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-ZPkD7Gjk.esm.js → idCaptureManager-DGVv5l1_.esm.js} +22 -7
- package/dist/{idCaptureStateMachine-BK0bPHoc.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-DZoqeAo9.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-DsM8IG7k.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 +153 -100
- 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
package/dist/geolocation.esm.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "./api-CESGtpbH.esm.js";
|
|
2
|
-
import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-
|
|
3
|
-
import "./endpoints-
|
|
4
|
-
import
|
|
5
|
-
import "./
|
|
6
|
-
import { t as geolocationMachine } from "./geolocationStateMachine-
|
|
2
|
+
import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-Dvvriq9l.esm.js";
|
|
3
|
+
import "./endpoints-BeTK0Mlt.esm.js";
|
|
4
|
+
import "./platform-SKvEfCBh.esm.js";
|
|
5
|
+
import { c as createManager, s as createActor } from "./xstate.esm-C9wncMQa.esm.js";
|
|
6
|
+
import { t as geolocationMachine } from "./geolocationStateMachine-Dvh7X0wF.esm.js";
|
|
7
7
|
|
|
8
8
|
//#region ../infra/src/providers/browser/BrowserGeolocationProvider.ts
|
|
9
9
|
var BrowserGeolocationProvider = class {
|
|
@@ -37,7 +37,7 @@ function mapState(snapshot) {
|
|
|
37
37
|
if (typedSnapshot.matches("submitting")) return { status: "submitting" };
|
|
38
38
|
if (typedSnapshot.matches("locationAcquired")) return {
|
|
39
39
|
status: "locationAcquired",
|
|
40
|
-
location: context.location ??
|
|
40
|
+
location: context.location ?? null
|
|
41
41
|
};
|
|
42
42
|
if (typedSnapshot.matches("permissionDenied")) return {
|
|
43
43
|
status: "permissionDenied",
|
package/dist/{geolocationStateMachine-asasuHY2.esm.js → geolocationStateMachine-Dvh7X0wF.esm.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as api } from "./api-CESGtpbH.esm.js";
|
|
2
|
-
import { t as endpoints } from "./endpoints-
|
|
3
|
-
import {
|
|
4
|
-
import { r as
|
|
2
|
+
import { t as endpoints } from "./endpoints-BeTK0Mlt.esm.js";
|
|
3
|
+
import { r as isIOS, t as isAndroid } from "./platform-SKvEfCBh.esm.js";
|
|
4
|
+
import { a as fromPromise, r as assign, t as setup } from "./xstate.esm-C9wncMQa.esm.js";
|
|
5
5
|
|
|
6
6
|
//#region src/modules/geolocation/geolocationServices.ts
|
|
7
7
|
async function addGeolocation(params, signal) {
|
|
@@ -34,7 +34,7 @@ const geolocationMachine = setup({
|
|
|
34
34
|
try {
|
|
35
35
|
return await addGeolocation(input, signal);
|
|
36
36
|
} catch {
|
|
37
|
-
return { location:
|
|
37
|
+
return { location: null };
|
|
38
38
|
}
|
|
39
39
|
})
|
|
40
40
|
},
|
|
@@ -89,7 +89,7 @@ const geolocationMachine = setup({
|
|
|
89
89
|
},
|
|
90
90
|
onError: {
|
|
91
91
|
target: "locationAcquired",
|
|
92
|
-
actions: assign({ location: () =>
|
|
92
|
+
actions: assign({ location: () => null })
|
|
93
93
|
}
|
|
94
94
|
} },
|
|
95
95
|
locationAcquired: { on: { CONTINUE: { target: "finished" } } },
|
|
@@ -31,11 +31,4 @@ function getWindowDimensions(defaultWidth = 1280, defaultHeight = 720) {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
//#endregion
|
|
34
|
-
|
|
35
|
-
function getUserAgent() {
|
|
36
|
-
if (typeof navigator === "undefined") return "";
|
|
37
|
-
return navigator.userAgent;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
//#endregion
|
|
41
|
-
export { getDeviceInfo as n, getWindowDimensions as r, getUserAgent as t };
|
|
34
|
+
export { getWindowDimensions as n, getDeviceInfo as t };
|
|
@@ -1,16 +1,26 @@
|
|
|
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
|
+
import { t as OtpValidationErrors } from "./otp-DF5A0sFx.js";
|
|
3
4
|
|
|
4
5
|
//#region src/modules/government-validation/types.d.ts
|
|
5
6
|
type GovernmentValidationConfig = {
|
|
6
|
-
validationCountries
|
|
7
|
+
validationCountries?: string[];
|
|
8
|
+
faceAndDataValidation?: boolean;
|
|
9
|
+
addressValidation?: boolean;
|
|
10
|
+
faceMatchOverrideDataScore?: boolean;
|
|
11
|
+
useCroppedIdFacePhoto?: boolean;
|
|
12
|
+
alternativeFacialValidation?: boolean;
|
|
13
|
+
fallbackEnabled?: boolean;
|
|
14
|
+
scrapingMethod?: boolean;
|
|
15
|
+
scrapingV2?: boolean;
|
|
16
|
+
scrapingV3?: boolean;
|
|
17
|
+
failUnsupportedId?: boolean;
|
|
18
|
+
mockConnectionError?: boolean;
|
|
19
|
+
mockUserNotFoundError?: boolean;
|
|
20
|
+
mockOK?: boolean;
|
|
7
21
|
facialValidation: boolean;
|
|
8
22
|
dataValidation: boolean;
|
|
9
|
-
faceAndDataValidation: boolean;
|
|
10
|
-
addressValidation: boolean;
|
|
11
23
|
backgroundExecution: boolean;
|
|
12
|
-
faceMatchOverrideDataScore: boolean;
|
|
13
|
-
useCroppedIdFacePhoto: boolean;
|
|
14
24
|
maxOtpAttempts?: number;
|
|
15
25
|
};
|
|
16
26
|
//#endregion
|
|
@@ -39,9 +49,15 @@ type GovernmentValidationAwaitingOtpState = {
|
|
|
39
49
|
canResend: boolean;
|
|
40
50
|
attemptsRemaining: number;
|
|
41
51
|
otpError?: string;
|
|
52
|
+
otpCode: string;
|
|
53
|
+
otpLength: number;
|
|
54
|
+
otpValidationErrors?: OtpValidationErrors;
|
|
55
|
+
isOtpValid: boolean;
|
|
42
56
|
};
|
|
43
57
|
type GovernmentValidationVerifyingOtpState = {
|
|
44
58
|
status: 'verifyingOtp';
|
|
59
|
+
otpCode: string;
|
|
60
|
+
otpLength: number;
|
|
45
61
|
};
|
|
46
62
|
type GovernmentValidationFinishedState = {
|
|
47
63
|
status: 'finished';
|
|
@@ -50,14 +66,18 @@ type GovernmentValidationErrorState = {
|
|
|
50
66
|
status: 'error';
|
|
51
67
|
error: string;
|
|
52
68
|
};
|
|
69
|
+
type GovernmentValidationSuccessState = {
|
|
70
|
+
status: 'displaySuccess';
|
|
71
|
+
};
|
|
53
72
|
type GovernmentValidationUnknownState = {
|
|
54
73
|
status: 'unknown';
|
|
55
74
|
error: string;
|
|
56
75
|
};
|
|
57
|
-
type GovernmentValidationState = GovernmentValidationIdleState | GovernmentValidationLoadingState | GovernmentValidationProcessingState | GovernmentValidationAwaitingOtpState | GovernmentValidationVerifyingOtpState | GovernmentValidationFinishedState | GovernmentValidationErrorState | GovernmentValidationUnknownState;
|
|
76
|
+
type GovernmentValidationState = GovernmentValidationIdleState | GovernmentValidationLoadingState | GovernmentValidationProcessingState | GovernmentValidationAwaitingOtpState | GovernmentValidationVerifyingOtpState | GovernmentValidationFinishedState | GovernmentValidationErrorState | GovernmentValidationSuccessState | GovernmentValidationUnknownState;
|
|
58
77
|
declare function createGovernmentValidationManager(options: CreateGovernmentValidationActorOptions): Manager<GovernmentValidationState> & {
|
|
59
78
|
load(): void;
|
|
60
79
|
setOtpCode(code: string): void;
|
|
80
|
+
validateOtp(): void;
|
|
61
81
|
submitOtp(code: string): void;
|
|
62
82
|
resendOtp(): void;
|
|
63
83
|
retry(): void;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import "./BrowserTimerProvider-DhNc_x02.esm.js";
|
|
2
2
|
import "./api-CESGtpbH.esm.js";
|
|
3
|
-
import { o as createManagerInstrumentation } from "./events-
|
|
4
|
-
import "./endpoints-
|
|
5
|
-
import { c as createManager, s as createActor } from "./xstate.esm-
|
|
6
|
-
import { t as
|
|
3
|
+
import { o as createManagerInstrumentation } from "./events-Dvvriq9l.esm.js";
|
|
4
|
+
import "./endpoints-BeTK0Mlt.esm.js";
|
|
5
|
+
import { c as createManager, s as createActor } from "./xstate.esm-C9wncMQa.esm.js";
|
|
6
|
+
import { t as OTP_CODE_LENGTH } from "./otp-CGMdUzBC.esm.js";
|
|
7
|
+
import { t as governmentValidationMachine } from "./governmentValidationStateMachine-DcJ-BfsC.esm.js";
|
|
7
8
|
|
|
8
9
|
//#region src/modules/government-validation/governmentValidationActor.ts
|
|
9
10
|
function createGovernmentValidationActor(options) {
|
|
@@ -17,16 +18,23 @@ function mapState(snapshot) {
|
|
|
17
18
|
const { context } = typedSnapshot;
|
|
18
19
|
if (typedSnapshot.matches("idle")) return { status: "idle" };
|
|
19
20
|
if (typedSnapshot.matches("loading")) return { status: "loading" };
|
|
20
|
-
if (typedSnapshot.matches("polling") || typedSnapshot.matches("pollingRequest")) return { status: "processing" };
|
|
21
21
|
if (typedSnapshot.matches("awaitingOtp")) return {
|
|
22
22
|
status: "awaitingOtp",
|
|
23
23
|
resendTimer: context.resendTimer,
|
|
24
24
|
canResend: !context.resendTimerActive,
|
|
25
25
|
attemptsRemaining: context.attemptsRemaining,
|
|
26
|
-
otpError: context.otpError
|
|
26
|
+
otpError: context.otpError,
|
|
27
|
+
otpCode: context.otpCode,
|
|
28
|
+
otpLength: OTP_CODE_LENGTH,
|
|
29
|
+
otpValidationErrors: context.otpValidationErrors,
|
|
30
|
+
isOtpValid: Object.keys(context.otpValidationErrors ?? {}).length === 0
|
|
27
31
|
};
|
|
28
|
-
if (typedSnapshot.matches("verifyingOtp")) return {
|
|
29
|
-
|
|
32
|
+
if (typedSnapshot.matches("verifyingOtp")) return {
|
|
33
|
+
status: "verifyingOtp",
|
|
34
|
+
otpCode: context.otpCode,
|
|
35
|
+
otpLength: OTP_CODE_LENGTH
|
|
36
|
+
};
|
|
37
|
+
if (typedSnapshot.matches("displaySuccess")) return { status: "displaySuccess" };
|
|
30
38
|
if (typedSnapshot.matches("displayProcessing")) return { status: "processing" };
|
|
31
39
|
if (typedSnapshot.matches("finished")) return { status: "finished" };
|
|
32
40
|
if (typedSnapshot.matches("displayError")) return {
|
|
@@ -50,6 +58,9 @@ function createApi({ actor, trackElementClicked }) {
|
|
|
50
58
|
code
|
|
51
59
|
});
|
|
52
60
|
},
|
|
61
|
+
validateOtp() {
|
|
62
|
+
actor.send({ type: "VALIDATE_OTP" });
|
|
63
|
+
},
|
|
53
64
|
submitOtp(code) {
|
|
54
65
|
trackElementClicked?.("submitOtp");
|
|
55
66
|
actor.send({
|
|
@@ -1,7 +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
|
+
import { n as computeOtpValidationErrors, r as isOtpComplete } from "./otp-CGMdUzBC.esm.js";
|
|
5
6
|
|
|
6
7
|
//#region src/modules/government-validation/governmentValidationServices.ts
|
|
7
8
|
async function processGovernmentValidation(signal) {
|
|
@@ -18,8 +19,6 @@ async function submitGovernmentValidationOtp(params, signal) {
|
|
|
18
19
|
//#endregion
|
|
19
20
|
//#region src/modules/government-validation/governmentValidationStateMachine.ts
|
|
20
21
|
const RESEND_TIMER_SECONDS = 30;
|
|
21
|
-
const POLL_INTERVAL_MS = 2e3;
|
|
22
|
-
const MAX_POLL_COUNT = 60;
|
|
23
22
|
const AUTO_PROCEED_DELAY_MS = 3e3;
|
|
24
23
|
const governmentValidationMachine = setup({
|
|
25
24
|
types: {
|
|
@@ -35,13 +34,6 @@ const governmentValidationMachine = setup({
|
|
|
35
34
|
submitOtp: fromPromise(async ({ input, signal }) => {
|
|
36
35
|
return submitGovernmentValidationOtp({ code: input.code }, signal);
|
|
37
36
|
}),
|
|
38
|
-
pollingTimer: fromCallback(({ sendBack }) => {
|
|
39
|
-
const timer = BrowserTimerProvider.getInstance();
|
|
40
|
-
const interval = timer.setInterval(() => {
|
|
41
|
-
sendBack({ type: "POLL" });
|
|
42
|
-
}, POLL_INTERVAL_MS);
|
|
43
|
-
return () => timer.clearInterval(interval);
|
|
44
|
-
}),
|
|
45
37
|
resendTimer: fromCallback(({ sendBack }) => {
|
|
46
38
|
const timer = BrowserTimerProvider.getInstance();
|
|
47
39
|
let seconds = RESEND_TIMER_SECONDS;
|
|
@@ -60,15 +52,21 @@ const governmentValidationMachine = setup({
|
|
|
60
52
|
clearError: assign({ error: () => void 0 }),
|
|
61
53
|
setOtpCode: assign(({ event }) => ({
|
|
62
54
|
otpCode: event.code,
|
|
63
|
-
otpError: void 0
|
|
55
|
+
otpError: void 0,
|
|
56
|
+
otpValidationErrors: void 0
|
|
64
57
|
})),
|
|
58
|
+
validateOtpField: assign(({ context }) => {
|
|
59
|
+
const errors = computeOtpValidationErrors(context.otpCode);
|
|
60
|
+
return { otpValidationErrors: errors.otp ? errors : void 0 };
|
|
61
|
+
}),
|
|
65
62
|
setOtpError: assign(({ context }) => ({
|
|
66
63
|
otpError: "Invalid OTP code",
|
|
67
64
|
attemptsRemaining: context.attemptsRemaining - 1
|
|
68
65
|
})),
|
|
69
66
|
clearOtpError: assign({
|
|
70
67
|
otpError: () => void 0,
|
|
71
|
-
otpCode: () => ""
|
|
68
|
+
otpCode: () => "",
|
|
69
|
+
otpValidationErrors: () => void 0
|
|
72
70
|
}),
|
|
73
71
|
startResendTimer: assign({
|
|
74
72
|
resendTimer: () => RESEND_TIMER_SECONDS,
|
|
@@ -81,28 +79,27 @@ const governmentValidationMachine = setup({
|
|
|
81
79
|
resendTimerActive: newTimer > 0
|
|
82
80
|
};
|
|
83
81
|
}),
|
|
84
|
-
incrementPollCount: assign(({ context }) => ({ pollCount: context.pollCount + 1 })),
|
|
85
|
-
resetPollCount: assign({ pollCount: () => 0 }),
|
|
86
82
|
resetContext: assign(({ context }) => ({
|
|
87
83
|
config: context.config,
|
|
88
84
|
error: void 0,
|
|
89
85
|
otpCode: "",
|
|
90
86
|
otpError: void 0,
|
|
87
|
+
otpValidationErrors: void 0,
|
|
91
88
|
attemptsRemaining: context.config.maxOtpAttempts ?? 3,
|
|
92
89
|
resendTimer: 0,
|
|
93
|
-
resendTimerActive: false
|
|
94
|
-
pollCount: 0
|
|
90
|
+
resendTimerActive: false
|
|
95
91
|
}))
|
|
96
92
|
},
|
|
97
93
|
guards: {
|
|
94
|
+
isBackgroundExecution: ({ context }) => context.config.backgroundExecution,
|
|
98
95
|
isProcessing: (_, params) => params.response.statusCode === -1,
|
|
99
|
-
isSuccess: (_, params) => params.response.statusCode === 0 && params.response.validationStatus?.status
|
|
100
|
-
isError: (_, params) => params.response.statusCode > 0,
|
|
96
|
+
isSuccess: (_, params) => params.response.statusCode === 0 && params.response.governmentValidation?.validationStatus?.status === "OK",
|
|
97
|
+
isError: (_, params) => params.response.statusCode > 0 || params.response.governmentValidation?.validationStatus?.status === "FAIL",
|
|
101
98
|
isOtpRequested: (_, params) => params.response.otpResponse?.authBridge?.otpCodeRequested === true,
|
|
102
|
-
isUnknown: (_, params) => params.response.validationStatus?.status === "UNKNOWN",
|
|
99
|
+
isUnknown: (_, params) => params.response.governmentValidation?.validationStatus?.status === "UNKNOWN",
|
|
103
100
|
hasAttemptsRemaining: ({ context }) => context.attemptsRemaining > 0,
|
|
104
|
-
|
|
105
|
-
|
|
101
|
+
hasCompleteOtp: ({ context }) => isOtpComplete(context.otpCode),
|
|
102
|
+
canResend: ({ context }) => !context.resendTimerActive
|
|
106
103
|
}
|
|
107
104
|
}).createMachine({
|
|
108
105
|
id: "governmentValidation",
|
|
@@ -112,10 +109,10 @@ const governmentValidationMachine = setup({
|
|
|
112
109
|
error: void 0,
|
|
113
110
|
otpCode: "",
|
|
114
111
|
otpError: void 0,
|
|
112
|
+
otpValidationErrors: void 0,
|
|
115
113
|
attemptsRemaining: input.config.maxOtpAttempts ?? 3,
|
|
116
114
|
resendTimer: 0,
|
|
117
|
-
resendTimerActive: false
|
|
118
|
-
pollCount: 0
|
|
115
|
+
resendTimerActive: false
|
|
119
116
|
}),
|
|
120
117
|
states: {
|
|
121
118
|
idle: { on: { LOAD: { target: "loading" } } },
|
|
@@ -123,6 +120,10 @@ const governmentValidationMachine = setup({
|
|
|
123
120
|
id: "processValidation",
|
|
124
121
|
src: "processValidation",
|
|
125
122
|
onDone: [
|
|
123
|
+
{
|
|
124
|
+
target: "finished",
|
|
125
|
+
guard: "isBackgroundExecution"
|
|
126
|
+
},
|
|
126
127
|
{
|
|
127
128
|
target: "awaitingOtp",
|
|
128
129
|
guard: {
|
|
@@ -138,7 +139,7 @@ const governmentValidationMachine = setup({
|
|
|
138
139
|
}
|
|
139
140
|
},
|
|
140
141
|
{
|
|
141
|
-
target: "
|
|
142
|
+
target: "displayProcessing",
|
|
142
143
|
guard: {
|
|
143
144
|
type: "isProcessing",
|
|
144
145
|
params: ({ event }) => ({ response: event.output })
|
|
@@ -157,60 +158,13 @@ const governmentValidationMachine = setup({
|
|
|
157
158
|
actions: "setErrorFromResponse"
|
|
158
159
|
}
|
|
159
160
|
],
|
|
160
|
-
onError: {
|
|
161
|
-
target: "
|
|
162
|
-
|
|
163
|
-
}
|
|
164
|
-
} },
|
|
165
|
-
polling: {
|
|
166
|
-
invoke: {
|
|
167
|
-
id: "pollingTimer",
|
|
168
|
-
src: "pollingTimer"
|
|
169
|
-
},
|
|
170
|
-
on: { POLL: [{
|
|
171
|
-
target: "displayError",
|
|
172
|
-
guard: "hasReachedMaxPolls",
|
|
173
|
-
actions: assign({ error: () => "Validation timed out" })
|
|
161
|
+
onError: [{
|
|
162
|
+
target: "finished",
|
|
163
|
+
guard: "isBackgroundExecution"
|
|
174
164
|
}, {
|
|
175
|
-
target: "pollingRequest",
|
|
176
|
-
actions: "incrementPollCount"
|
|
177
|
-
}] }
|
|
178
|
-
},
|
|
179
|
-
pollingRequest: { invoke: {
|
|
180
|
-
id: "pollValidation",
|
|
181
|
-
src: "processValidation",
|
|
182
|
-
onDone: [
|
|
183
|
-
{
|
|
184
|
-
target: "displaySuccess",
|
|
185
|
-
guard: {
|
|
186
|
-
type: "isSuccess",
|
|
187
|
-
params: ({ event }) => ({ response: event.output })
|
|
188
|
-
}
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
target: "polling",
|
|
192
|
-
guard: {
|
|
193
|
-
type: "isProcessing",
|
|
194
|
-
params: ({ event }) => ({ response: event.output })
|
|
195
|
-
}
|
|
196
|
-
},
|
|
197
|
-
{
|
|
198
|
-
target: "displayUnknown",
|
|
199
|
-
guard: {
|
|
200
|
-
type: "isUnknown",
|
|
201
|
-
params: ({ event }) => ({ response: event.output })
|
|
202
|
-
},
|
|
203
|
-
actions: "setUnknownError"
|
|
204
|
-
},
|
|
205
|
-
{
|
|
206
|
-
target: "displayError",
|
|
207
|
-
actions: "setErrorFromResponse"
|
|
208
|
-
}
|
|
209
|
-
],
|
|
210
|
-
onError: {
|
|
211
165
|
target: "displayError",
|
|
212
166
|
actions: "setError"
|
|
213
|
-
}
|
|
167
|
+
}]
|
|
214
168
|
} },
|
|
215
169
|
awaitingOtp: {
|
|
216
170
|
entry: "startResendTimer",
|
|
@@ -221,7 +175,11 @@ const governmentValidationMachine = setup({
|
|
|
221
175
|
on: {
|
|
222
176
|
TICK: { actions: "tickResendTimer" },
|
|
223
177
|
OTP_CHANGED: { actions: "setOtpCode" },
|
|
224
|
-
|
|
178
|
+
VALIDATE_OTP: { actions: "validateOtpField" },
|
|
179
|
+
SUBMIT_OTP: [{
|
|
180
|
+
guard: "hasCompleteOtp",
|
|
181
|
+
target: "verifyingOtp"
|
|
182
|
+
}, { actions: "validateOtpField" }],
|
|
225
183
|
RESEND_OTP: {
|
|
226
184
|
target: "loading",
|
|
227
185
|
guard: "canResend"
|
package/dist/home.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { t as Manager } from "./Manager-
|
|
2
|
-
import "./camera-
|
|
3
|
-
import "./types-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import { t as Manager } from "./Manager-BHn8wH8K.js";
|
|
2
|
+
import "./camera-SRBpPq2X.js";
|
|
3
|
+
import "./types-Bj9hdFjU.js";
|
|
4
|
+
import "./types-DvGZI7BF.js";
|
|
5
|
+
import { t as EmptyConfig } from "./types-DOUhndhT.js";
|
|
6
|
+
import * as xstate698 from "xstate";
|
|
6
7
|
|
|
7
8
|
//#region src/modules/home/types.d.ts
|
|
8
9
|
type HomeConfig = EmptyConfig;
|
|
@@ -34,41 +35,41 @@ type HomeContext = {
|
|
|
34
35
|
type HomeInput = {
|
|
35
36
|
config: EmptyConfig;
|
|
36
37
|
};
|
|
37
|
-
declare const homeMachine:
|
|
38
|
+
declare const homeMachine: xstate698.StateMachine<HomeContext, {
|
|
38
39
|
type: "LOAD";
|
|
39
40
|
} | {
|
|
40
41
|
type: "COMPLETE";
|
|
41
42
|
} | {
|
|
42
43
|
type: "RESET";
|
|
43
|
-
}, {}, never, never, never, never, "idle" | "finished" | "main", string, HomeInput,
|
|
44
|
+
}, {}, never, never, never, never, "idle" | "finished" | "main", string, HomeInput, xstate698.NonReducibleUnknown, xstate698.EventObject, xstate698.MetaObject, {
|
|
44
45
|
readonly id: "home";
|
|
45
46
|
readonly initial: "idle";
|
|
46
47
|
readonly context: ({
|
|
47
48
|
input
|
|
48
49
|
}: {
|
|
49
50
|
spawn: {
|
|
50
|
-
<TSrc extends never>(logic: TSrc, ...[options]: never):
|
|
51
|
-
<TLogic extends
|
|
51
|
+
<TSrc extends never>(logic: TSrc, ...[options]: never): xstate698.ActorRefFromLogic<never>;
|
|
52
|
+
<TLogic extends xstate698.AnyActorLogic>(src: TLogic, ...[options]: xstate698.ConditionalRequired<[options?: ({
|
|
52
53
|
id?: never;
|
|
53
54
|
systemId?: string;
|
|
54
|
-
input?:
|
|
55
|
+
input?: xstate698.InputFrom<TLogic> | undefined;
|
|
55
56
|
syncSnapshot?: boolean;
|
|
56
|
-
} & { [K in
|
|
57
|
+
} & { [K in xstate698.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate698.IsNotNever<xstate698.RequiredLogicInput<TLogic>>>): xstate698.ActorRefFromLogic<TLogic>;
|
|
57
58
|
};
|
|
58
59
|
input: HomeInput;
|
|
59
|
-
self:
|
|
60
|
+
self: xstate698.ActorRef<xstate698.MachineSnapshot<HomeContext, {
|
|
60
61
|
type: "LOAD";
|
|
61
62
|
} | {
|
|
62
63
|
type: "COMPLETE";
|
|
63
64
|
} | {
|
|
64
65
|
type: "RESET";
|
|
65
|
-
}, Record<string,
|
|
66
|
+
}, Record<string, xstate698.AnyActorRef | undefined>, xstate698.StateValue, string, unknown, any, any>, {
|
|
66
67
|
type: "LOAD";
|
|
67
68
|
} | {
|
|
68
69
|
type: "COMPLETE";
|
|
69
70
|
} | {
|
|
70
71
|
type: "RESET";
|
|
71
|
-
},
|
|
72
|
+
}, xstate698.AnyEventObject>;
|
|
72
73
|
}) => {
|
|
73
74
|
config: EmptyConfig;
|
|
74
75
|
};
|
package/dist/home.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./api-CESGtpbH.esm.js";
|
|
2
|
-
import { o as createManagerInstrumentation } from "./events-
|
|
3
|
-
import { c as createManager, s as createActor, t as setup } from "./xstate.esm-
|
|
2
|
+
import { o as createManagerInstrumentation } from "./events-Dvvriq9l.esm.js";
|
|
3
|
+
import { c as createManager, s as createActor, t as setup } from "./xstate.esm-C9wncMQa.esm.js";
|
|
4
4
|
|
|
5
5
|
//#region src/modules/home/homeStateMachine.ts
|
|
6
6
|
const homeMachine = setup({ types: {
|
|
File without changes
|
package/dist/http.esm.js
CHANGED