@incodetech/core 2.4.1-agentic.5 → 2.4.1-agentic.7
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/DateFormattingProvider-DPq9zco-.esm.js +25 -0
- package/dist/{FaceDetectionProvider-ZiDiL_hY.esm.js → FaceDetectionProvider-CFYVWVLU.esm.js} +7 -7
- package/dist/addressSearch-D6cKPWmk.esm.js +72 -0
- package/dist/ae-signature.esm.js +1 -1
- package/dist/antifraud.esm.js +2 -2
- package/dist/{antifraudManager-BObuHBjn.esm.js → antifraudManager-CbIwM35x.esm.js} +2 -2
- package/dist/{antifraudStateMachine-Dfrd2-26.esm.js → antifraudStateMachine-qNNXrlsP.esm.js} +1 -1
- package/dist/{api-CpP4PS4S.esm.js → api-C_P9YXbL.esm.js} +1 -0
- package/dist/{apiError-CeyLcwt3.esm.js → apiError-B-pHP4hU.esm.js} +1 -1
- package/dist/{attemptCarry-WOkfvFMw.esm.js → attemptCarry-BaAXPR_w.esm.js} +1 -1
- package/dist/authentication.d.ts +3 -3
- package/dist/authentication.esm.js +2 -2
- package/dist/{authenticationManager-ffZXiENz.esm.js → authenticationManager-Cw5nswyP.esm.js} +4 -4
- package/dist/{authenticationManager-CWmh7aSY.d.ts → authenticationManager-DKLRA91K.d.ts} +1 -1
- package/dist/{authenticationStateMachine-ebqsPLXI.esm.js → authenticationStateMachine-Czd4u-94.esm.js} +3 -3
- package/dist/{browser-pQZA35G2-Bu4in9gN.esm.js → browser-pQZA35G2-DJEJnmCd.esm.js} +1 -1
- package/dist/certificate-issuance.esm.js +2 -2
- package/dist/{certificateIssuanceManager-IRO_1Ug6.esm.js → certificateIssuanceManager-CrF3wjCH.esm.js} +2 -2
- package/dist/{certificateIssuanceStateMachine-CjxTBZuH.esm.js → certificateIssuanceStateMachine-uSD9IkcV.esm.js} +1 -1
- package/dist/consent.d.ts +1 -1
- package/dist/consent.esm.js +2 -2
- package/dist/{consentManager-DXetSxcx.d.ts → consentManager-7aHaehwF.d.ts} +4 -4
- package/dist/{consentManager-DMlSL6Ax.esm.js → consentManager-BD7wwgat.esm.js} +2 -2
- package/dist/{consentStateMachine-DIYSMxKQ.esm.js → consentStateMachine-BAiLDE3D.esm.js} +1 -1
- package/dist/{cpf-uAZTPUBy.esm.js → cpf-BIADjddF.esm.js} +1 -25
- package/dist/cross-document-data-match.esm.js +1 -1
- package/dist/{crossDocumentDataMatchManager-BFTdiEDB.esm.js → crossDocumentDataMatchManager-CUc1uACE.esm.js} +2 -2
- package/dist/curp-validation.d.ts +1 -1
- package/dist/curp-validation.esm.js +2 -2
- package/dist/{curpValidationManager-z8428oCM.d.ts → curpValidationManager-Crz3bnCo.d.ts} +1 -1
- package/dist/{curpValidationManager-DNpC3wyf.esm.js → curpValidationManager-DBfZSQbu.esm.js} +2 -2
- package/dist/{curpValidationStateMachine-B3iVsDyt.esm.js → curpValidationStateMachine-DyAEyScb.esm.js} +2 -2
- package/dist/custom-fields.esm.js +1 -1
- package/dist/custom-watchlist.esm.js +2 -2
- package/dist/{customFieldsManager-CvI-pDT3.esm.js → customFieldsManager-BZhIPyaY.esm.js} +2 -2
- package/dist/{customWatchlistManager-BuHtUb0y.esm.js → customWatchlistManager-B4cmxi__.esm.js} +2 -2
- package/dist/{customWatchlistStateMachine-CiVD9wyF.esm.js → customWatchlistStateMachine-ZZoDGRAZ.esm.js} +1 -1
- package/dist/{deepsightLoader-CJbBiTpq.esm.js → deepsightLoader-UDNbSO_O.esm.js} +3 -3
- package/dist/{addressSearch-DzbE9Ogt.esm.js → definitionSource-1vPLtuXE.esm.js} +1 -72
- package/dist/{desktopCameraElection-BGMtYwk3.esm.js → desktopCameraElection-m2dAj6Zu.esm.js} +1 -1
- package/dist/document-capture.esm.js +2 -2
- package/dist/{documentCaptureManager-DLPqruXJ.esm.js → documentCaptureManager-v57klTso.esm.js} +2 -2
- package/dist/{documentCaptureStateMachine-DCvWQhFG.esm.js → documentCaptureStateMachine-CgCtimSa.esm.js} +2 -2
- package/dist/dynamic-forms.esm.js +2 -2
- package/dist/{dynamicFormsManager-C1pBbCWs.esm.js → dynamicFormsManager-Bx4jzvI6.esm.js} +2 -2
- package/dist/{dynamicFormsStateMachine-iVdrXC1r.esm.js → dynamicFormsStateMachine-DK-O_wyz.esm.js} +2 -2
- package/dist/ekyb.d.ts +1 -1
- package/dist/ekyb.esm.js +2 -2
- package/dist/{ekybManager-OZ0SeXvq.esm.js → ekybManager-DgBvPmSW.esm.js} +2 -2
- package/dist/{ekybStateMachine-BDh-yJkS.esm.js → ekybStateMachine-mo6zRyPH.esm.js} +6 -4
- package/dist/ekyc-prefill.d.ts +17 -0
- package/dist/ekyc-prefill.esm.js +3 -0
- package/dist/ekyc.d.ts +2 -2
- package/dist/ekyc.esm.js +3 -3
- package/dist/{ekycManager-DymCvmVB.esm.js → ekycManager-Bwv-qYAZ.esm.js} +2 -2
- package/dist/{ekycManager-DlGIn9wA.d.ts → ekycManager-CERRvIfg.d.ts} +1 -1
- package/dist/ekycPrefillManager-DHfC1T9s.d.ts +565 -0
- package/dist/ekycPrefillManager-Pgb16lcO.esm.js +102 -0
- package/dist/ekycPrefillStateMachine-j_WwaTPe.esm.js +686 -0
- package/dist/ekycRules-B7vXnbdg.esm.js +319 -0
- package/dist/{ekycStateMachine-CoFCUJ2z.esm.js → ekycStateMachine-DlN1RCob.esm.js} +418 -533
- package/dist/{ekycUtils-GRuMELYr.esm.js → ekycUtils-K6VJXnOg.esm.js} +18 -6
- package/dist/electronic-signature.esm.js +1 -1
- package/dist/{electronicSignatureManager-CHe4KM2h.esm.js → electronicSignatureManager-BG10ax7f.esm.js} +3 -3
- package/dist/email.esm.js +2 -2
- package/dist/{emailManager-CGoE3CUe.esm.js → emailManager-BSaGg1Gl.esm.js} +2 -2
- package/dist/{emailStateMachine-KgHfDNvM.esm.js → emailStateMachine-CaoPZtZN.esm.js} +2 -2
- package/dist/{events-ggpBBaZ8.esm.js → events-kU5WJU4B.esm.js} +1 -1
- package/dist/events.esm.js +1 -1
- package/dist/extensibility.d.ts +14 -13
- package/dist/extensibility.esm.js +36 -35
- package/dist/face-match.esm.js +2 -2
- package/dist/{faceCaptureManagerFactory-GmZMp6TR.esm.js → faceCaptureManagerFactory-DDnkBGNU.esm.js} +2 -2
- package/dist/{faceCaptureManagerFactory-DV2ULUYS.d.ts → faceCaptureManagerFactory-ZudYP6Qp.d.ts} +3 -3
- package/dist/{faceCaptureSetup--MEv7wIJ.esm.js → faceCaptureSetup-C0svTi1Y.esm.js} +9 -9
- package/dist/{faceMatchManager-D2xKPjjQ.esm.js → faceMatchManager-qPJsa5Ac.esm.js} +2 -2
- package/dist/{faceMatchStateMachine-CUvwiQi9.esm.js → faceMatchStateMachine-D90ZHY1r.esm.js} +2 -2
- package/dist/{feature-management-hZhfjdAu.esm.js → feature-management-jqhhP3Bu.esm.js} +1 -1
- package/dist/feature-management.esm.js +1 -1
- package/dist/field-comparison.esm.js +1 -1
- package/dist/{fieldComparisonManager-DgDbEeFZ.esm.js → fieldComparisonManager-BLLj_Ey1.esm.js} +2 -2
- package/dist/fiscal-qr.esm.js +1 -1
- package/dist/{fiscalQrManager-BZeklojR.esm.js → fiscalQrManager-Bh3rxb7Y.esm.js} +2 -2
- package/dist/flow-events.d.ts +1 -1
- package/dist/flow.d.ts +9 -8
- package/dist/flow.esm.js +46 -10
- package/dist/{flowCompletionService-E8ipjpAG.esm.js → flowCompletionService-BNoVcNAa.esm.js} +2 -2
- package/dist/{flowServices-Co77kn9L.esm.js → flowServices-Bzlb_4VT.esm.js} +8 -8
- package/dist/geolocation.esm.js +2 -2
- package/dist/{geolocationManager-C8DY8c1D.esm.js → geolocationManager-Ck2V9vfc.esm.js} +2 -2
- package/dist/{geolocationStateMachine-BluJR9Ew.esm.js → geolocationStateMachine-toB05StJ.esm.js} +3 -3
- package/dist/government-validation.esm.js +2 -2
- package/dist/{governmentValidationManager-CjChjZ3C.esm.js → governmentValidationManager-D5HkBqfr.esm.js} +2 -2
- package/dist/{governmentValidationStateMachine-AEbn3Afi.esm.js → governmentValidationStateMachine-BwMClTqC.esm.js} +1 -1
- package/dist/home.d.ts +1 -1
- package/dist/home.esm.js +1 -1
- package/dist/http.esm.js +1 -1
- package/dist/id-ocr.d.ts +2 -2
- package/dist/id-ocr.esm.js +3 -19
- package/dist/id-selfie-flow.d.ts +1 -1
- package/dist/id-selfie-flow.esm.js +6 -6
- package/dist/id-verification.esm.js +2 -2
- package/dist/id.d.ts +2 -2
- package/dist/id.esm.js +3 -3
- package/dist/{idCaptureManager-6amWi8Ko.esm.js → idCaptureManager-BXs_sb4-.esm.js} +6 -6
- package/dist/{idCaptureManager-CCA2D1Ah.d.ts → idCaptureManager-NRGuCVv2.d.ts} +2 -2
- package/dist/{idCaptureServices-Bpa4MmVC.esm.js → idCaptureServices-DEhJe_fA.esm.js} +4 -4
- package/dist/{idCaptureStateMachine-BzBA2B4_.esm.js → idCaptureStateMachine-CH3gW-gJ.esm.js} +42 -14
- package/dist/idOcrCpfUtils-Nfln1Psb.esm.js +18 -0
- package/dist/{idOcrManager-BTdHlJ9D.d.ts → idOcrManager-B5xeI2lg.d.ts} +2 -2
- package/dist/{idOcrManager-xyEZNOBa.esm.js → idOcrManager-BMK2oou0.esm.js} +2 -2
- package/dist/{idOcrStateMachine-DNKXh4Rn.esm.js → idOcrStateMachine-RjNycN07.esm.js} +8 -7
- package/dist/{idVerificationManager-DdnvYfgN.esm.js → idVerificationManager-4wY-Ee4j.esm.js} +2 -2
- package/dist/{idVerificationStateMachine-DtIBCa32.esm.js → idVerificationStateMachine-Bj00uWvh.esm.js} +1 -1
- package/dist/identity-reuse.d.ts +1 -1
- package/dist/identity-reuse.esm.js +2 -2
- package/dist/{identityReuseManager-CcpovlfD.esm.js → identityReuseManager-CCZ-ES2E.esm.js} +2 -2
- package/dist/{identityReuseManager-B1birg5X.d.ts → identityReuseManager-ooAbp6Kc.d.ts} +4 -4
- package/dist/{identityReuseStateMachine-DxZFWy47.esm.js → identityReuseStateMachine-BtpkGpYZ.esm.js} +1 -1
- package/dist/{index-DC0P2Vzw.d.ts → index-BGnYn_4J.d.ts} +1 -1
- package/dist/{index-bD4-zpjs.d.ts → index-DlVDVTcf.d.ts} +31 -16
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/{invokeOnCaptureCallback-BJ0GVHGr.esm.js → invokeOnCaptureCallback-BkvXSZfa.esm.js} +1 -1
- package/dist/kyb-checks.esm.js +2 -2
- package/dist/{kybChecksManager-CbqLrEox.esm.js → kybChecksManager-PIRw77NR.esm.js} +1 -1
- package/dist/{kybChecksStateMachine-B_GS-KmL.esm.js → kybChecksStateMachine-Deabuca9.esm.js} +5 -4
- package/dist/mandatory-consent.d.ts +2 -2
- package/dist/mandatory-consent.esm.js +2 -2
- package/dist/{mandatoryConsentManager-B4vCYslr.esm.js → mandatoryConsentManager-BBeOo3Sz.esm.js} +2 -2
- package/dist/{mandatoryConsentManager-CEn59Ytw.d.ts → mandatoryConsentManager-Dr3pcPt_.d.ts} +5 -5
- package/dist/{mandatoryConsentStateMachine-DWslYPA3.esm.js → mandatoryConsentStateMachine-BJEyS63E.esm.js} +1 -1
- package/dist/{multipartRecordingService-BTqkHGG9.esm.js → multipartRecordingService-2iVLb-2Y.esm.js} +1 -1
- package/dist/phone.esm.js +2 -2
- package/dist/{phoneFormat-JJNaWthV.esm.js → phoneFormat-DEpESpz2.esm.js} +13 -1
- package/dist/{phoneManager-Dy5tODCU.esm.js → phoneManager-BylOWecM.esm.js} +2 -2
- package/dist/{phoneServices-DJgyOzU2.esm.js → phoneServices-Crge7uSV.esm.js} +1 -1
- package/dist/{phoneStateMachine-DnlPhnw7.esm.js → phoneStateMachine-CHnhCS-4.esm.js} +2 -2
- package/dist/{processFaceMatch-Bst83HaS.esm.js → processFaceMatch-BveUAHts.esm.js} +1 -1
- package/dist/qe-signature.esm.js +1 -1
- package/dist/{recordingService-CTko6Cjn.esm.js → recordingService-DKXaaOHO.esm.js} +2 -2
- package/dist/redirect-to-mobile.esm.js +2 -2
- package/dist/{redirectToMobileManager-CCSNyi19.esm.js → redirectToMobileManager-DUpLyXsq.esm.js} +2 -2
- package/dist/{redirectToMobileStateMachine-BKyOdAUe.esm.js → redirectToMobileStateMachine-D0DW4y-f.esm.js} +1 -1
- package/dist/{resolveForm-O7-r79VA.esm.js → resolveForm-f9PhUo9j.esm.js} +1 -209
- package/dist/{runChildModule-DHDczcGZ.esm.js → runChildModule-CMxMWHBm.esm.js} +2 -2
- package/dist/{sdkVersion-CxaRTa9r.esm.js → sdkVersion-C8FKcN44.esm.js} +1 -1
- package/dist/selfie.d.ts +3 -3
- package/dist/selfie.esm.js +9 -9
- package/dist/{selfieErrorUtils-Dk0ofKio.esm.js → selfieErrorUtils-CS1xwN-1.esm.js} +1 -1
- package/dist/{selfieManager-DmZFzs1-.d.ts → selfieManager-BPOlD-UN.d.ts} +1 -1
- package/dist/{selfieManager-EgnSX_Hu.esm.js → selfieManager-DBc_zThO.esm.js} +4 -4
- package/dist/{selfieStateMachine-B8pBvum8.esm.js → selfieStateMachine-C3mqlhwI.esm.js} +3 -3
- package/dist/{session-CaliXPVw.esm.js → session-C9v6HFIu.esm.js} +4 -4
- package/dist/session.d.ts +1 -1
- package/dist/session.esm.js +5 -5
- package/dist/{sessionInitializer-Tr_ZkaSs.esm.js → sessionInitializer-CVFa4wKw.esm.js} +7 -7
- package/dist/{setup-Bz4l-E3R.esm.js → setup-BlJx-S74.esm.js} +10 -13
- package/dist/{setup-Dyv1tJFj.d.ts → setup-prV5HQCQ.d.ts} +1 -1
- package/dist/signature.esm.js +2 -2
- package/dist/{signatureManager-CwqjcxPg.esm.js → signatureManager-QlegdTo3.esm.js} +2 -2
- package/dist/{signatureStateMachine-DBVDd1Eu.esm.js → signatureStateMachine-DFbbbFwg.esm.js} +1 -1
- package/dist/{stats-CatA2dea.esm.js → stats-Bv5PiWvo.esm.js} +1 -1
- package/dist/stats.esm.js +1 -1
- package/dist/step-up.d.ts +3 -5
- package/dist/step-up.esm.js +5 -11
- package/dist/{tri-CKUbuky5.esm.js → tri-DFho7f3x.esm.js} +3 -32
- package/dist/tri.d.ts +1 -1
- package/dist/tri.esm-DgtAka_v.esm.js +2145 -0
- package/dist/tri.esm.js +1 -1
- package/dist/{trueSightService-DDdJ8TrY.esm.js → trueSightService-B3SMJJ9O.esm.js} +3 -3
- package/dist/trust-graph.esm.js +1 -1
- package/dist/{types-Csh8vzPo.d.ts → types-0Rr7etmf.d.ts} +1 -1
- package/dist/types-B2M1IPZn.d.ts +6 -0
- package/dist/{types-BEVHQbbC.d.ts → types-BD9sV5oG.d.ts} +1 -1
- package/dist/{types-CuMJ2M7D.d.ts → types-BaDx6utW.d.ts} +4 -1
- package/dist/{types-BPm1JSu7.d.ts → types-BpJ21a4T.d.ts} +1 -1
- package/dist/{types-CJ7Yl9K-.d.ts → types-Bpo97EOh.d.ts} +4 -2
- package/dist/{types-CRaFu6wS.d.ts → types-CquDWYfv.d.ts} +6 -2
- package/dist/types-D9vIGFbl.d.ts +115 -0
- package/dist/{types-Cd0J0F9D.d.ts → types-NMBsvLIN.d.ts} +1 -1
- package/dist/usStates-CwOQ2kAx.esm.js +209 -0
- package/dist/video-selfie.d.ts +1 -1
- package/dist/video-selfie.esm.js +6 -6
- package/dist/{videoSelfieCameraWarmer-Dsk8JQNy.esm.js → videoSelfieCameraWarmer-BtlqdcFh.esm.js} +4 -4
- package/dist/{videoSelfieStepDetector-Dv3Mgws-.d.ts → videoSelfieStepDetector-B78BE_x9.d.ts} +2 -2
- package/dist/wasm.d.ts +1 -1
- package/dist/wasm.esm.js +1 -1
- package/dist/watchlist-for-business.esm.js +2 -2
- package/dist/watchlist.esm.js +2 -2
- package/dist/{watchlistForBusinessManager-DqUpAEj_.esm.js → watchlistForBusinessManager-DOYmIiaj.esm.js} +2 -2
- package/dist/{watchlistForBusinessStateMachine-DdaPl2PS.esm.js → watchlistForBusinessStateMachine-D8qIyL8w.esm.js} +1 -1
- package/dist/{watchlistManager-CdpXzT4B.esm.js → watchlistManager-BJGLRv-x.esm.js} +2 -2
- package/dist/{watchlistStateMachine-ofHW_lPk.esm.js → watchlistStateMachine-DeLfuGSl.esm.js} +1 -1
- package/dist/workflow.d.ts +1 -1
- package/dist/workflow.esm.js +42 -36
- package/package.json +6 -1
- package/dist/tri.esm-DvgaFxHR.esm.js +0 -3838
- package/dist/types-J6g6iKe_.d.ts +0 -6
|
@@ -0,0 +1,565 @@
|
|
|
1
|
+
import { A as StateMachine, C as StateValue, D as PromiseActorLogic, a as ActorRefFromLogic, b as RequiredActorOptions, c as AnyEventObject, g as IsNotNever, h as InputFrom, i as ActorRefFrom, k as MachineSnapshot, m as GetConcreteByKey, o as AnyActorLogic, p as EventObject, r as ActorRef, s as AnyActorRef, u as ConditionalRequired, v as MetaObject, w as Values, x as RequiredLogicInput, y as NonReducibleUnknown } from "./spawn-D9jgw9pW.js";
|
|
2
|
+
import { t as Manager } from "./Manager-C9T5amUN.js";
|
|
3
|
+
import "./Actor-DpTj5PFb.js";
|
|
4
|
+
import { a as EkycFormValues, c as EkycValidationErrors } from "./types-BaDx6utW.js";
|
|
5
|
+
import { a as EkycPrefillFieldDef, c as EkycPrefillModuleConfig, d as EkycPrefillSubmitResponse, i as EkycPrefillErrorKind, o as EkycPrefillInput, r as EkycPrefillContext, t as EkycPrefillConfig, u as EkycPrefillSubmitPlan } from "./types-D9vIGFbl.js";
|
|
6
|
+
//#region src/modules/ekyc-prefill/ekycPrefillStateMachine.d.ts
|
|
7
|
+
type SubmitInput = {
|
|
8
|
+
submit: EkycPrefillSubmitPlan;
|
|
9
|
+
values: EkycFormValues;
|
|
10
|
+
};
|
|
11
|
+
declare const ekycPrefillMachine: StateMachine<EkycPrefillContext, {
|
|
12
|
+
type: "LOAD";
|
|
13
|
+
} | {
|
|
14
|
+
type: "SET_FIELD";
|
|
15
|
+
name: string;
|
|
16
|
+
value: string;
|
|
17
|
+
isValid?: boolean;
|
|
18
|
+
} | {
|
|
19
|
+
type: "VALIDATE_FIELD";
|
|
20
|
+
name: string;
|
|
21
|
+
} | {
|
|
22
|
+
type: "SUBMIT";
|
|
23
|
+
} | {
|
|
24
|
+
type: "RETRY";
|
|
25
|
+
} | {
|
|
26
|
+
type: "CONTINUE";
|
|
27
|
+
} | {
|
|
28
|
+
type: "CLOSE";
|
|
29
|
+
}, {
|
|
30
|
+
[x: string]: ActorRefFromLogic<PromiseActorLogic<EkycPrefillSubmitResponse, SubmitInput, EventObject>> | ActorRefFromLogic<PromiseActorLogic<void, {
|
|
31
|
+
hasPhone: boolean;
|
|
32
|
+
}, EventObject>> | undefined;
|
|
33
|
+
}, Values<{
|
|
34
|
+
submit: {
|
|
35
|
+
src: "submit";
|
|
36
|
+
logic: PromiseActorLogic<EkycPrefillSubmitResponse, SubmitInput, EventObject>;
|
|
37
|
+
id: string | undefined;
|
|
38
|
+
};
|
|
39
|
+
loadPhoneRules: {
|
|
40
|
+
src: "loadPhoneRules";
|
|
41
|
+
logic: PromiseActorLogic<void, {
|
|
42
|
+
hasPhone: boolean;
|
|
43
|
+
}, EventObject>;
|
|
44
|
+
id: string | undefined;
|
|
45
|
+
};
|
|
46
|
+
}>, Values<{
|
|
47
|
+
applyForm: {
|
|
48
|
+
type: "applyForm";
|
|
49
|
+
params: NonReducibleUnknown;
|
|
50
|
+
};
|
|
51
|
+
setPhoneRulesLoaded: {
|
|
52
|
+
type: "setPhoneRulesLoaded";
|
|
53
|
+
params: NonReducibleUnknown;
|
|
54
|
+
};
|
|
55
|
+
setPhoneRulesFailed: {
|
|
56
|
+
type: "setPhoneRulesFailed";
|
|
57
|
+
params: NonReducibleUnknown;
|
|
58
|
+
};
|
|
59
|
+
setFieldValue: {
|
|
60
|
+
type: "setFieldValue";
|
|
61
|
+
params: NonReducibleUnknown;
|
|
62
|
+
};
|
|
63
|
+
validateOneField: {
|
|
64
|
+
type: "validateOneField";
|
|
65
|
+
params: NonReducibleUnknown;
|
|
66
|
+
};
|
|
67
|
+
validateAll: {
|
|
68
|
+
type: "validateAll";
|
|
69
|
+
params: NonReducibleUnknown;
|
|
70
|
+
};
|
|
71
|
+
applyRejection: {
|
|
72
|
+
type: "applyRejection";
|
|
73
|
+
params: NonReducibleUnknown;
|
|
74
|
+
};
|
|
75
|
+
setSubmitError: {
|
|
76
|
+
type: "setSubmitError";
|
|
77
|
+
params: NonReducibleUnknown;
|
|
78
|
+
};
|
|
79
|
+
clearError: {
|
|
80
|
+
type: "clearError";
|
|
81
|
+
params: NonReducibleUnknown;
|
|
82
|
+
};
|
|
83
|
+
}>, Values<{
|
|
84
|
+
isValid: {
|
|
85
|
+
type: "isValid";
|
|
86
|
+
params: unknown;
|
|
87
|
+
};
|
|
88
|
+
phoneRulesFailed: {
|
|
89
|
+
type: "phoneRulesFailed";
|
|
90
|
+
params: unknown;
|
|
91
|
+
};
|
|
92
|
+
isAutoExecution: {
|
|
93
|
+
type: "isAutoExecution";
|
|
94
|
+
params: unknown;
|
|
95
|
+
};
|
|
96
|
+
canRender: {
|
|
97
|
+
type: "canRender";
|
|
98
|
+
params: unknown;
|
|
99
|
+
};
|
|
100
|
+
isBadRequest: {
|
|
101
|
+
type: "isBadRequest";
|
|
102
|
+
params: unknown;
|
|
103
|
+
};
|
|
104
|
+
isForbidden: {
|
|
105
|
+
type: "isForbidden";
|
|
106
|
+
params: unknown;
|
|
107
|
+
};
|
|
108
|
+
isLimitReached: {
|
|
109
|
+
type: "isLimitReached";
|
|
110
|
+
params: unknown;
|
|
111
|
+
};
|
|
112
|
+
}>, never, "error" | "idle" | "closed" | "finished" | "submitting" | "misconfigured" | "limitReached" | {
|
|
113
|
+
form: "inputting" | "validating";
|
|
114
|
+
}, string, EkycPrefillInput, NonReducibleUnknown, EventObject, MetaObject, {
|
|
115
|
+
readonly id: "ekycPrefill";
|
|
116
|
+
readonly initial: "idle";
|
|
117
|
+
readonly context: ({ input }: {
|
|
118
|
+
spawn: {
|
|
119
|
+
<TSrc extends "submit" | "loadPhoneRules">(logic: TSrc, ...[options]: ({
|
|
120
|
+
src: "submit";
|
|
121
|
+
logic: PromiseActorLogic<EkycPrefillSubmitResponse, SubmitInput, EventObject>;
|
|
122
|
+
id: string | undefined;
|
|
123
|
+
} extends (infer T) ? T extends {
|
|
124
|
+
src: "submit";
|
|
125
|
+
logic: PromiseActorLogic<EkycPrefillSubmitResponse, SubmitInput, EventObject>;
|
|
126
|
+
id: string | undefined;
|
|
127
|
+
} ? T extends {
|
|
128
|
+
src: TSrc;
|
|
129
|
+
} ? ConditionalRequired<[options?: ({
|
|
130
|
+
id?: T["id"] | undefined;
|
|
131
|
+
systemId?: string;
|
|
132
|
+
input?: InputFrom<T["logic"]> | undefined;
|
|
133
|
+
syncSnapshot?: boolean;
|
|
134
|
+
} & { [K in RequiredActorOptions<T>]: unknown; }) | undefined], IsNotNever<RequiredActorOptions<T>>> : never : never : never) | ({
|
|
135
|
+
src: "loadPhoneRules";
|
|
136
|
+
logic: PromiseActorLogic<void, {
|
|
137
|
+
hasPhone: boolean;
|
|
138
|
+
}, EventObject>;
|
|
139
|
+
id: string | undefined;
|
|
140
|
+
} extends (infer T_1) ? T_1 extends {
|
|
141
|
+
src: "loadPhoneRules";
|
|
142
|
+
logic: PromiseActorLogic<void, {
|
|
143
|
+
hasPhone: boolean;
|
|
144
|
+
}, EventObject>;
|
|
145
|
+
id: string | undefined;
|
|
146
|
+
} ? T_1 extends {
|
|
147
|
+
src: TSrc;
|
|
148
|
+
} ? ConditionalRequired<[options?: ({
|
|
149
|
+
id?: T_1["id"] | undefined;
|
|
150
|
+
systemId?: string;
|
|
151
|
+
input?: InputFrom<T_1["logic"]> | undefined;
|
|
152
|
+
syncSnapshot?: boolean;
|
|
153
|
+
} & { [K_1 in RequiredActorOptions<T_1>]: unknown; }) | undefined], IsNotNever<RequiredActorOptions<T_1>>> : never : never : never)): ActorRefFromLogic<GetConcreteByKey<Values<{
|
|
154
|
+
submit: {
|
|
155
|
+
src: "submit";
|
|
156
|
+
logic: PromiseActorLogic<EkycPrefillSubmitResponse, SubmitInput, EventObject>;
|
|
157
|
+
id: string | undefined;
|
|
158
|
+
};
|
|
159
|
+
loadPhoneRules: {
|
|
160
|
+
src: "loadPhoneRules";
|
|
161
|
+
logic: PromiseActorLogic<void, {
|
|
162
|
+
hasPhone: boolean;
|
|
163
|
+
}, EventObject>;
|
|
164
|
+
id: string | undefined;
|
|
165
|
+
};
|
|
166
|
+
}>, "src", TSrc>["logic"]>;
|
|
167
|
+
<TLogic extends AnyActorLogic>(src: TLogic, ...[options]: ConditionalRequired<[options?: ({
|
|
168
|
+
id?: never;
|
|
169
|
+
systemId?: string;
|
|
170
|
+
input?: InputFrom<TLogic> | undefined;
|
|
171
|
+
syncSnapshot?: boolean;
|
|
172
|
+
} & { [K in RequiredLogicInput<TLogic>]: unknown; }) | undefined], IsNotNever<RequiredLogicInput<TLogic>>>): ActorRefFromLogic<TLogic>;
|
|
173
|
+
};
|
|
174
|
+
input: EkycPrefillInput;
|
|
175
|
+
self: ActorRef<MachineSnapshot<EkycPrefillContext, {
|
|
176
|
+
type: "LOAD";
|
|
177
|
+
} | {
|
|
178
|
+
type: "SET_FIELD";
|
|
179
|
+
name: string;
|
|
180
|
+
value: string;
|
|
181
|
+
isValid?: boolean;
|
|
182
|
+
} | {
|
|
183
|
+
type: "VALIDATE_FIELD";
|
|
184
|
+
name: string;
|
|
185
|
+
} | {
|
|
186
|
+
type: "SUBMIT";
|
|
187
|
+
} | {
|
|
188
|
+
type: "RETRY";
|
|
189
|
+
} | {
|
|
190
|
+
type: "CONTINUE";
|
|
191
|
+
} | {
|
|
192
|
+
type: "CLOSE";
|
|
193
|
+
}, Record<string, AnyActorRef | undefined>, StateValue, string, unknown, any, any>, {
|
|
194
|
+
type: "LOAD";
|
|
195
|
+
} | {
|
|
196
|
+
type: "SET_FIELD";
|
|
197
|
+
name: string;
|
|
198
|
+
value: string;
|
|
199
|
+
isValid?: boolean;
|
|
200
|
+
} | {
|
|
201
|
+
type: "VALIDATE_FIELD";
|
|
202
|
+
name: string;
|
|
203
|
+
} | {
|
|
204
|
+
type: "SUBMIT";
|
|
205
|
+
} | {
|
|
206
|
+
type: "RETRY";
|
|
207
|
+
} | {
|
|
208
|
+
type: "CONTINUE";
|
|
209
|
+
} | {
|
|
210
|
+
type: "CLOSE";
|
|
211
|
+
}, AnyEventObject>;
|
|
212
|
+
}) => {
|
|
213
|
+
config: EkycPrefillConfig;
|
|
214
|
+
prepared: undefined;
|
|
215
|
+
values: {};
|
|
216
|
+
errors: {};
|
|
217
|
+
invalidFormats: {};
|
|
218
|
+
anyOfError: false;
|
|
219
|
+
phoneRulesLoaded: false;
|
|
220
|
+
phoneRulesFailed: false;
|
|
221
|
+
submitError: undefined;
|
|
222
|
+
errorKind: undefined;
|
|
223
|
+
errorMessage: undefined;
|
|
224
|
+
};
|
|
225
|
+
readonly states: {
|
|
226
|
+
readonly idle: {
|
|
227
|
+
readonly on: {
|
|
228
|
+
readonly LOAD: readonly [{
|
|
229
|
+
readonly guard: "isAutoExecution";
|
|
230
|
+
readonly target: "finished";
|
|
231
|
+
}, {
|
|
232
|
+
readonly guard: "canRender";
|
|
233
|
+
readonly target: "form";
|
|
234
|
+
readonly actions: "applyForm";
|
|
235
|
+
}, {
|
|
236
|
+
readonly target: "misconfigured";
|
|
237
|
+
}];
|
|
238
|
+
};
|
|
239
|
+
};
|
|
240
|
+
readonly form: {
|
|
241
|
+
readonly invoke: {
|
|
242
|
+
readonly id: "loadPhoneRules";
|
|
243
|
+
readonly src: "loadPhoneRules";
|
|
244
|
+
readonly input: ({ context }: {
|
|
245
|
+
context: EkycPrefillContext;
|
|
246
|
+
event: {
|
|
247
|
+
type: "LOAD";
|
|
248
|
+
} | {
|
|
249
|
+
type: "SET_FIELD";
|
|
250
|
+
name: string;
|
|
251
|
+
value: string;
|
|
252
|
+
isValid?: boolean;
|
|
253
|
+
} | {
|
|
254
|
+
type: "VALIDATE_FIELD";
|
|
255
|
+
name: string;
|
|
256
|
+
} | {
|
|
257
|
+
type: "SUBMIT";
|
|
258
|
+
} | {
|
|
259
|
+
type: "RETRY";
|
|
260
|
+
} | {
|
|
261
|
+
type: "CONTINUE";
|
|
262
|
+
} | {
|
|
263
|
+
type: "CLOSE";
|
|
264
|
+
};
|
|
265
|
+
self: ActorRef<MachineSnapshot<EkycPrefillContext, {
|
|
266
|
+
type: "LOAD";
|
|
267
|
+
} | {
|
|
268
|
+
type: "SET_FIELD";
|
|
269
|
+
name: string;
|
|
270
|
+
value: string;
|
|
271
|
+
isValid?: boolean;
|
|
272
|
+
} | {
|
|
273
|
+
type: "VALIDATE_FIELD";
|
|
274
|
+
name: string;
|
|
275
|
+
} | {
|
|
276
|
+
type: "SUBMIT";
|
|
277
|
+
} | {
|
|
278
|
+
type: "RETRY";
|
|
279
|
+
} | {
|
|
280
|
+
type: "CONTINUE";
|
|
281
|
+
} | {
|
|
282
|
+
type: "CLOSE";
|
|
283
|
+
}, Record<string, AnyActorRef>, StateValue, string, unknown, any, any>, {
|
|
284
|
+
type: "LOAD";
|
|
285
|
+
} | {
|
|
286
|
+
type: "SET_FIELD";
|
|
287
|
+
name: string;
|
|
288
|
+
value: string;
|
|
289
|
+
isValid?: boolean;
|
|
290
|
+
} | {
|
|
291
|
+
type: "VALIDATE_FIELD";
|
|
292
|
+
name: string;
|
|
293
|
+
} | {
|
|
294
|
+
type: "SUBMIT";
|
|
295
|
+
} | {
|
|
296
|
+
type: "RETRY";
|
|
297
|
+
} | {
|
|
298
|
+
type: "CONTINUE";
|
|
299
|
+
} | {
|
|
300
|
+
type: "CLOSE";
|
|
301
|
+
}, AnyEventObject>;
|
|
302
|
+
}) => {
|
|
303
|
+
hasPhone: boolean;
|
|
304
|
+
};
|
|
305
|
+
readonly onDone: {
|
|
306
|
+
readonly actions: "setPhoneRulesLoaded";
|
|
307
|
+
};
|
|
308
|
+
readonly onError: {
|
|
309
|
+
readonly target: "#ekycPrefill.error";
|
|
310
|
+
readonly actions: "setPhoneRulesFailed";
|
|
311
|
+
};
|
|
312
|
+
};
|
|
313
|
+
readonly initial: "inputting";
|
|
314
|
+
readonly states: {
|
|
315
|
+
readonly inputting: {
|
|
316
|
+
readonly on: {
|
|
317
|
+
readonly SET_FIELD: {
|
|
318
|
+
readonly actions: "setFieldValue";
|
|
319
|
+
};
|
|
320
|
+
readonly VALIDATE_FIELD: {
|
|
321
|
+
readonly actions: "validateOneField";
|
|
322
|
+
};
|
|
323
|
+
readonly SUBMIT: "validating";
|
|
324
|
+
};
|
|
325
|
+
};
|
|
326
|
+
readonly validating: {
|
|
327
|
+
readonly entry: "validateAll";
|
|
328
|
+
readonly always: readonly [{
|
|
329
|
+
readonly guard: "isValid";
|
|
330
|
+
readonly target: "#ekycPrefill.submitting";
|
|
331
|
+
}, {
|
|
332
|
+
readonly target: "inputting";
|
|
333
|
+
}];
|
|
334
|
+
};
|
|
335
|
+
};
|
|
336
|
+
readonly on: {
|
|
337
|
+
readonly CLOSE: "closed";
|
|
338
|
+
};
|
|
339
|
+
};
|
|
340
|
+
readonly submitting: {
|
|
341
|
+
readonly invoke: {
|
|
342
|
+
readonly id: "submit";
|
|
343
|
+
readonly src: "submit";
|
|
344
|
+
readonly input: ({ context }: {
|
|
345
|
+
context: EkycPrefillContext;
|
|
346
|
+
event: {
|
|
347
|
+
type: "LOAD";
|
|
348
|
+
} | {
|
|
349
|
+
type: "SET_FIELD";
|
|
350
|
+
name: string;
|
|
351
|
+
value: string;
|
|
352
|
+
isValid?: boolean;
|
|
353
|
+
} | {
|
|
354
|
+
type: "VALIDATE_FIELD";
|
|
355
|
+
name: string;
|
|
356
|
+
} | {
|
|
357
|
+
type: "SUBMIT";
|
|
358
|
+
} | {
|
|
359
|
+
type: "RETRY";
|
|
360
|
+
} | {
|
|
361
|
+
type: "CONTINUE";
|
|
362
|
+
} | {
|
|
363
|
+
type: "CLOSE";
|
|
364
|
+
};
|
|
365
|
+
self: ActorRef<MachineSnapshot<EkycPrefillContext, {
|
|
366
|
+
type: "LOAD";
|
|
367
|
+
} | {
|
|
368
|
+
type: "SET_FIELD";
|
|
369
|
+
name: string;
|
|
370
|
+
value: string;
|
|
371
|
+
isValid?: boolean;
|
|
372
|
+
} | {
|
|
373
|
+
type: "VALIDATE_FIELD";
|
|
374
|
+
name: string;
|
|
375
|
+
} | {
|
|
376
|
+
type: "SUBMIT";
|
|
377
|
+
} | {
|
|
378
|
+
type: "RETRY";
|
|
379
|
+
} | {
|
|
380
|
+
type: "CONTINUE";
|
|
381
|
+
} | {
|
|
382
|
+
type: "CLOSE";
|
|
383
|
+
}, Record<string, AnyActorRef>, StateValue, string, unknown, any, any>, {
|
|
384
|
+
type: "LOAD";
|
|
385
|
+
} | {
|
|
386
|
+
type: "SET_FIELD";
|
|
387
|
+
name: string;
|
|
388
|
+
value: string;
|
|
389
|
+
isValid?: boolean;
|
|
390
|
+
} | {
|
|
391
|
+
type: "VALIDATE_FIELD";
|
|
392
|
+
name: string;
|
|
393
|
+
} | {
|
|
394
|
+
type: "SUBMIT";
|
|
395
|
+
} | {
|
|
396
|
+
type: "RETRY";
|
|
397
|
+
} | {
|
|
398
|
+
type: "CONTINUE";
|
|
399
|
+
} | {
|
|
400
|
+
type: "CLOSE";
|
|
401
|
+
}, AnyEventObject>;
|
|
402
|
+
}) => {
|
|
403
|
+
submit: EkycPrefillSubmitPlan;
|
|
404
|
+
values: EkycFormValues;
|
|
405
|
+
};
|
|
406
|
+
readonly onDone: {
|
|
407
|
+
readonly target: "finished";
|
|
408
|
+
};
|
|
409
|
+
readonly onError: readonly [{
|
|
410
|
+
readonly guard: "isLimitReached";
|
|
411
|
+
readonly target: "limitReached";
|
|
412
|
+
}, {
|
|
413
|
+
readonly guard: "isBadRequest";
|
|
414
|
+
readonly target: "form.inputting";
|
|
415
|
+
readonly actions: "applyRejection";
|
|
416
|
+
}, {
|
|
417
|
+
readonly guard: "isForbidden";
|
|
418
|
+
readonly target: "misconfigured";
|
|
419
|
+
}, {
|
|
420
|
+
readonly target: "error";
|
|
421
|
+
readonly actions: "setSubmitError";
|
|
422
|
+
}];
|
|
423
|
+
};
|
|
424
|
+
};
|
|
425
|
+
/**
|
|
426
|
+
* The lookup could not run (409, 503, a network failure), or the phone
|
|
427
|
+
* rules did not load: offer a retry of whichever failed.
|
|
428
|
+
*/
|
|
429
|
+
readonly error: {
|
|
430
|
+
readonly on: {
|
|
431
|
+
readonly RETRY: readonly [{
|
|
432
|
+
readonly guard: "phoneRulesFailed";
|
|
433
|
+
readonly target: "form";
|
|
434
|
+
readonly actions: "clearError";
|
|
435
|
+
}, {
|
|
436
|
+
readonly target: "submitting";
|
|
437
|
+
readonly actions: "clearError";
|
|
438
|
+
}];
|
|
439
|
+
readonly CLOSE: "closed";
|
|
440
|
+
};
|
|
441
|
+
};
|
|
442
|
+
/** The lookup limit is reached; it does not reset within the session, so the flow moves on. */
|
|
443
|
+
readonly limitReached: {
|
|
444
|
+
readonly on: {
|
|
445
|
+
readonly CONTINUE: "finished";
|
|
446
|
+
readonly CLOSE: "closed";
|
|
447
|
+
};
|
|
448
|
+
};
|
|
449
|
+
/** The configuration can't be rendered, or the session's flow doesn't allow the lookup. */
|
|
450
|
+
readonly misconfigured: {
|
|
451
|
+
readonly on: {
|
|
452
|
+
readonly CLOSE: "closed";
|
|
453
|
+
};
|
|
454
|
+
};
|
|
455
|
+
readonly finished: {
|
|
456
|
+
readonly type: "final";
|
|
457
|
+
};
|
|
458
|
+
readonly closed: {
|
|
459
|
+
readonly type: "final";
|
|
460
|
+
};
|
|
461
|
+
};
|
|
462
|
+
}>;
|
|
463
|
+
type EkycPrefillMachine = typeof ekycPrefillMachine;
|
|
464
|
+
//#endregion
|
|
465
|
+
//#region src/modules/ekyc-prefill/ekycPrefillActor.d.ts
|
|
466
|
+
type EkycPrefillActor = ActorRefFrom<EkycPrefillMachine>;
|
|
467
|
+
type CreateEkycPrefillActorOptions = {
|
|
468
|
+
/** The served `EKYC_PREFILL` module configuration, raw or normalized. */
|
|
469
|
+
config?: EkycPrefillModuleConfig | EkycPrefillConfig;
|
|
470
|
+
};
|
|
471
|
+
//#endregion
|
|
472
|
+
//#region src/modules/ekyc-prefill/ekycPrefillManager.d.ts
|
|
473
|
+
type EkycPrefillIdleState = {
|
|
474
|
+
status: 'idle';
|
|
475
|
+
};
|
|
476
|
+
/** The "at least one of" rule: its members and the message shown under them. */
|
|
477
|
+
type EkycPrefillAnyOfState = {
|
|
478
|
+
fields: string[];
|
|
479
|
+
/** Message key. Its `fields` param lists the members' labels. */
|
|
480
|
+
message: string;
|
|
481
|
+
/** Show the message as an error; otherwise as a hint. */
|
|
482
|
+
showError: boolean;
|
|
483
|
+
};
|
|
484
|
+
type EkycPrefillFormState = {
|
|
485
|
+
status: 'form';
|
|
486
|
+
country: string;
|
|
487
|
+
fields: EkycPrefillFieldDef[];
|
|
488
|
+
values: EkycFormValues;
|
|
489
|
+
errors: EkycValidationErrors;
|
|
490
|
+
anyOf: EkycPrefillAnyOfState | undefined;
|
|
491
|
+
/** A rejection the form can't pin on one field. Message key. */
|
|
492
|
+
submitError: string | undefined;
|
|
493
|
+
/** Every rule passes, so the lookup can be submitted. */
|
|
494
|
+
canSubmit: boolean;
|
|
495
|
+
};
|
|
496
|
+
type EkycPrefillSubmittingState = {
|
|
497
|
+
status: 'submitting';
|
|
498
|
+
};
|
|
499
|
+
/** The lookup could not run. `retry()` repeats it. */
|
|
500
|
+
type EkycPrefillErrorState = {
|
|
501
|
+
status: 'error';
|
|
502
|
+
/** `busy`: another lookup for the session is running (409). */
|
|
503
|
+
errorKind: EkycPrefillErrorKind | undefined;
|
|
504
|
+
errorMessage: string | undefined;
|
|
505
|
+
};
|
|
506
|
+
/** The session's lookup limit is reached. `continue()` moves on. */
|
|
507
|
+
type EkycPrefillLimitReachedState = {
|
|
508
|
+
status: 'limitReached';
|
|
509
|
+
};
|
|
510
|
+
/** The configuration can't be rendered, or the session's flow doesn't allow the lookup. */
|
|
511
|
+
type EkycPrefillMisconfiguredState = {
|
|
512
|
+
status: 'misconfigured';
|
|
513
|
+
};
|
|
514
|
+
type EkycPrefillFinishedState = {
|
|
515
|
+
status: 'finished';
|
|
516
|
+
};
|
|
517
|
+
type EkycPrefillClosedState = {
|
|
518
|
+
status: 'closed';
|
|
519
|
+
};
|
|
520
|
+
/** Discriminated union of all eKYC Pre-fill manager states. */
|
|
521
|
+
type EkycPrefillState = EkycPrefillIdleState | EkycPrefillFormState | EkycPrefillSubmittingState | EkycPrefillErrorState | EkycPrefillLimitReachedState | EkycPrefillMisconfiguredState | EkycPrefillFinishedState | EkycPrefillClosedState;
|
|
522
|
+
declare function createEkycPrefillManagerFromActor(actor: EkycPrefillActor): Manager<EkycPrefillState> & {
|
|
523
|
+
/** Builds the form from the configuration, or finishes at once when the backend runs the lookup itself. */
|
|
524
|
+
load(): void;
|
|
525
|
+
/**
|
|
526
|
+
* Sets a field's value, formatted as typed, and clears its error. Pass
|
|
527
|
+
* `isValid: false` when the input itself knows the value is malformed
|
|
528
|
+
* (a phone number).
|
|
529
|
+
*/
|
|
530
|
+
setField(name: string, value: string, isValid?: boolean): void;
|
|
531
|
+
/** Validates one field, typically when it loses focus. */
|
|
532
|
+
validateField(name: string): void;
|
|
533
|
+
/** Validates the form and, when it passes, runs the lookup. */
|
|
534
|
+
submit(): void;
|
|
535
|
+
/** Repeats the lookup that could not run. */
|
|
536
|
+
retry(): void;
|
|
537
|
+
/** Moves on after the lookup limit is reached. */
|
|
538
|
+
continue(): void;
|
|
539
|
+
/** Closes the module. */
|
|
540
|
+
close(): void;
|
|
541
|
+
};
|
|
542
|
+
/** Creates an eKYC Pre-fill manager for headless or UI-driven usage. */
|
|
543
|
+
declare function createEkycPrefillManager(options?: CreateEkycPrefillActorOptions): Manager<EkycPrefillState> & {
|
|
544
|
+
/** Builds the form from the configuration, or finishes at once when the backend runs the lookup itself. */
|
|
545
|
+
load(): void;
|
|
546
|
+
/**
|
|
547
|
+
* Sets a field's value, formatted as typed, and clears its error. Pass
|
|
548
|
+
* `isValid: false` when the input itself knows the value is malformed
|
|
549
|
+
* (a phone number).
|
|
550
|
+
*/
|
|
551
|
+
setField(name: string, value: string, isValid?: boolean): void;
|
|
552
|
+
/** Validates one field, typically when it loses focus. */
|
|
553
|
+
validateField(name: string): void;
|
|
554
|
+
/** Validates the form and, when it passes, runs the lookup. */
|
|
555
|
+
submit(): void;
|
|
556
|
+
/** Repeats the lookup that could not run. */
|
|
557
|
+
retry(): void;
|
|
558
|
+
/** Moves on after the lookup limit is reached. */
|
|
559
|
+
continue(): void;
|
|
560
|
+
/** Closes the module. */
|
|
561
|
+
close(): void;
|
|
562
|
+
};
|
|
563
|
+
type EkycPrefillManager = ReturnType<typeof createEkycPrefillManager>;
|
|
564
|
+
//#endregion
|
|
565
|
+
export { EkycPrefillFormState as a, EkycPrefillManager as c, EkycPrefillSubmittingState as d, createEkycPrefillManager as f, ekycPrefillMachine as h, EkycPrefillFinishedState as i, EkycPrefillMisconfiguredState as l, EkycPrefillActor as m, EkycPrefillClosedState as n, EkycPrefillIdleState as o, createEkycPrefillManagerFromActor as p, EkycPrefillErrorState as r, EkycPrefillLimitReachedState as s, EkycPrefillAnyOfState as t, EkycPrefillState as u };
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { s as createActor, u as createManager } from "./xstate.esm-DSajW7CJ.esm.js";
|
|
2
|
+
import { n as isAnyOfMissing, r as validateForm, t as ekycPrefillMachine } from "./ekycPrefillStateMachine-j_WwaTPe.esm.js";
|
|
3
|
+
//#region src/modules/ekyc-prefill/ekycPrefillActor.ts
|
|
4
|
+
/** Creates and starts an eKYC Pre-fill actor, idle until `LOAD`. */
|
|
5
|
+
function createEkycPrefillActor(options = {}) {
|
|
6
|
+
return createActor(ekycPrefillMachine, { input: { config: options.config } }).start();
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region src/modules/ekyc-prefill/ekycPrefillManager.ts
|
|
10
|
+
function mapState(snapshot) {
|
|
11
|
+
const typedSnapshot = snapshot;
|
|
12
|
+
const { context } = typedSnapshot;
|
|
13
|
+
if (typedSnapshot.matches("form") && context.prepared) {
|
|
14
|
+
const { prepared, values, invalidFormats } = context;
|
|
15
|
+
const canSubmit = Object.keys(validateForm(prepared, values, invalidFormats)).length === 0 && !isAnyOfMissing(prepared, values);
|
|
16
|
+
return {
|
|
17
|
+
status: "form",
|
|
18
|
+
country: prepared.country,
|
|
19
|
+
fields: prepared.fields,
|
|
20
|
+
values,
|
|
21
|
+
errors: context.errors,
|
|
22
|
+
anyOf: prepared.anyOf && {
|
|
23
|
+
...prepared.anyOf,
|
|
24
|
+
showError: context.anyOfError
|
|
25
|
+
},
|
|
26
|
+
submitError: context.submitError,
|
|
27
|
+
canSubmit
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
if (typedSnapshot.matches("submitting")) return { status: "submitting" };
|
|
31
|
+
if (typedSnapshot.matches("error")) return {
|
|
32
|
+
status: "error",
|
|
33
|
+
errorKind: context.errorKind,
|
|
34
|
+
errorMessage: context.errorMessage
|
|
35
|
+
};
|
|
36
|
+
if (typedSnapshot.matches("limitReached")) return { status: "limitReached" };
|
|
37
|
+
if (typedSnapshot.matches("misconfigured")) return { status: "misconfigured" };
|
|
38
|
+
if (typedSnapshot.matches("finished")) return { status: "finished" };
|
|
39
|
+
if (typedSnapshot.matches("closed")) return { status: "closed" };
|
|
40
|
+
return { status: "idle" };
|
|
41
|
+
}
|
|
42
|
+
function createApi({ actor, trackElementClicked }) {
|
|
43
|
+
return {
|
|
44
|
+
/** Builds the form from the configuration, or finishes at once when the backend runs the lookup itself. */
|
|
45
|
+
load() {
|
|
46
|
+
actor.send({ type: "LOAD" });
|
|
47
|
+
},
|
|
48
|
+
/**
|
|
49
|
+
* Sets a field's value, formatted as typed, and clears its error. Pass
|
|
50
|
+
* `isValid: false` when the input itself knows the value is malformed
|
|
51
|
+
* (a phone number).
|
|
52
|
+
*/
|
|
53
|
+
setField(name, value, isValid) {
|
|
54
|
+
actor.send({
|
|
55
|
+
type: "SET_FIELD",
|
|
56
|
+
name,
|
|
57
|
+
value,
|
|
58
|
+
isValid
|
|
59
|
+
});
|
|
60
|
+
},
|
|
61
|
+
/** Validates one field, typically when it loses focus. */
|
|
62
|
+
validateField(name) {
|
|
63
|
+
actor.send({
|
|
64
|
+
type: "VALIDATE_FIELD",
|
|
65
|
+
name
|
|
66
|
+
});
|
|
67
|
+
},
|
|
68
|
+
/** Validates the form and, when it passes, runs the lookup. */
|
|
69
|
+
submit() {
|
|
70
|
+
trackElementClicked?.("submit");
|
|
71
|
+
actor.send({ type: "SUBMIT" });
|
|
72
|
+
},
|
|
73
|
+
/** Repeats the lookup that could not run. */
|
|
74
|
+
retry() {
|
|
75
|
+
trackElementClicked?.("retry");
|
|
76
|
+
actor.send({ type: "RETRY" });
|
|
77
|
+
},
|
|
78
|
+
/** Moves on after the lookup limit is reached. */
|
|
79
|
+
continue() {
|
|
80
|
+
trackElementClicked?.("continue");
|
|
81
|
+
actor.send({ type: "CONTINUE" });
|
|
82
|
+
},
|
|
83
|
+
/** Closes the module. */
|
|
84
|
+
close() {
|
|
85
|
+
trackElementClicked?.("close");
|
|
86
|
+
actor.send({ type: "CLOSE" });
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
function createEkycPrefillManagerFromActor(actor) {
|
|
91
|
+
return createManager({
|
|
92
|
+
actor,
|
|
93
|
+
mapState,
|
|
94
|
+
createApi
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
/** Creates an eKYC Pre-fill manager for headless or UI-driven usage. */
|
|
98
|
+
function createEkycPrefillManager(options = {}) {
|
|
99
|
+
return createEkycPrefillManagerFromActor(createEkycPrefillActor(options));
|
|
100
|
+
}
|
|
101
|
+
//#endregion
|
|
102
|
+
export { createEkycPrefillManagerFromActor as n, createEkycPrefillManager as t };
|