@incodetech/core 0.0.0-dev-20260604-edfbb573 → 0.0.0-dev-20260604-0577f678
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/{OpenViduRecordingProvider-CwJjdB_y.esm.js → OpenViduRecordingProvider-BEWn10vB.esm.js} +1 -1
- package/dist/ae-signature.d.ts +3 -3
- package/dist/antifraud.d.ts +3 -3
- package/dist/{antifraudManager-DilnUuVJ.d.ts → antifraudManager-DXDJ88Iy.d.ts} +2 -2
- package/dist/authentication.d.ts +12 -12
- package/dist/authentication.esm.js +4 -4
- package/dist/{authenticationManager-BuofM548.d.ts → authenticationManager-B7066qjf.d.ts} +2 -2
- package/dist/{authenticationManager-DVM4c1N2.esm.js → authenticationManager-BgtXT783.esm.js} +1 -1
- package/dist/{authenticationStateMachine-CWkBPcZL.esm.js → authenticationStateMachine-Bx9QKZmx.esm.js} +2 -2
- package/dist/camera.d.ts +1 -1
- package/dist/consent.d.ts +3 -3
- package/dist/{consentManager-CIQBAgKS.d.ts → consentManager-Dmp2yhJW.d.ts} +52 -52
- package/dist/cpf-ocr.d.ts +3 -3
- package/dist/{cpfOcrManager-DJwjf8zl.d.ts → cpfOcrManager-pQxe0h9U.d.ts} +19 -19
- package/dist/cross-document-data-match.d.ts +1 -1
- package/dist/curp-validation.d.ts +7 -7
- package/dist/{curpValidationManager-A17z2p8Z.d.ts → curpValidationManager-DXSx8qde.d.ts} +3 -3
- package/dist/custom-fields.d.ts +2 -2
- package/dist/custom-watchlist.d.ts +1 -1
- package/dist/{deepsightService-BoGtutuJ.d.ts → deepsightService-BvxizhpY.d.ts} +2 -2
- package/dist/document-capture.d.ts +74 -74
- package/dist/document-upload.d.ts +50 -50
- package/dist/dynamic-forms.d.ts +2 -2
- package/dist/ekyb.d.ts +6 -6
- package/dist/ekyb.esm.js +3 -3
- package/dist/{ekybStateMachine-C4w71OsI.esm.js → ekybStateMachine-D5CVgzWE.esm.js} +1 -1
- package/dist/ekyc.d.ts +3 -3
- package/dist/electronic-signature.d.ts +3 -3
- package/dist/email.d.ts +4 -3
- package/dist/email.esm.js +3 -2
- package/dist/{emailManager-CSCqkDqa.d.ts → emailManager-DWauVgqH.d.ts} +65 -7
- package/dist/{emailManager-BkpKfAWF.esm.js → emailManager-DrAlmZxR.esm.js} +28 -5
- package/dist/{emailStateMachine-DBl6u0yY.esm.js → emailStateMachine-BTlQbFIU.esm.js} +44 -9
- package/dist/extensibility.d.ts +25 -24
- package/dist/extensibility.esm.js +21 -20
- package/dist/face-match.d.ts +1 -1
- package/dist/face-match.esm.js +1 -1
- package/dist/{faceCaptureManagerFactory-Cg6hZagK.d.ts → faceCaptureManagerFactory-BncOywLG.d.ts} +8 -8
- package/dist/{faceCaptureSetup-BE6JdX3x.esm.js → faceCaptureSetup-BV_JfZOM.esm.js} +1 -1
- package/dist/field-comparison.d.ts +3 -3
- package/dist/field-comparison.esm.js +1 -1
- package/dist/{fieldComparisonManager-DMzy5lNY.d.ts → fieldComparisonManager-DLL9MVqE.d.ts} +2 -2
- package/dist/flow-events.d.ts +6 -6
- package/dist/flow.d.ts +12 -12
- package/dist/flow.esm.js +4 -4
- package/dist/{flowServices-sy-cx8x9.esm.js → flowServices-juBbztCy.esm.js} +1 -1
- package/dist/geolocation.d.ts +2 -2
- package/dist/geolocation.esm.js +1 -1
- package/dist/government-validation.d.ts +10 -2
- package/dist/government-validation.esm.js +15 -3
- package/dist/{governmentValidationStateMachine-BA9lwNSL.esm.js → governmentValidationStateMachine-CfxotwRJ.esm.js} +17 -3
- package/dist/home.d.ts +15 -15
- package/dist/id-ocr.d.ts +54 -54
- package/dist/id-ocr.esm.js +1 -1
- package/dist/id-verification.d.ts +27 -27
- package/dist/id-verification.esm.js +1 -1
- package/dist/id.d.ts +11 -11
- package/dist/id.esm.js +5 -5
- package/dist/{idCaptureManager-vAt1jY71.esm.js → idCaptureManager-B2C7sszi.esm.js} +1 -1
- package/dist/{idCaptureManager-CmJuubTO.d.ts → idCaptureManager-Dv5Hb6ZQ.d.ts} +7 -7
- package/dist/{idCaptureStateMachine-BfCiOhLX.esm.js → idCaptureStateMachine-BPlJG8rV.esm.js} +4 -4
- package/dist/identity-reuse.d.ts +3 -3
- package/dist/identity-reuse.esm.js +2 -2
- package/dist/{identityReuseManager-5v-hOOjz.esm.js → identityReuseManager-BUlApFOI.esm.js} +1 -1
- package/dist/{identityReuseManager-G-GKzGDP.d.ts → identityReuseManager-G8OBXRBS.d.ts} +33 -33
- package/dist/{index-D2Mcat5v.d.ts → index-C4i7kdU9.d.ts} +2 -2
- package/dist/{index-F-xtscHn.d.ts → index-Dlszx51Y.d.ts} +127 -127
- package/dist/index.d.ts +2 -2
- package/dist/index.esm.js +2 -2
- package/dist/mandatory-consent.d.ts +7 -7
- package/dist/mandatory-consent.esm.js +2 -2
- package/dist/{mandatoryConsentManager-CoAu8yf4.d.ts → mandatoryConsentManager-DvtPF0wk.d.ts} +50 -50
- package/dist/{mandatoryConsentManager-DaV3Kasq.esm.js → mandatoryConsentManager-vRY1lhnH.esm.js} +1 -1
- package/dist/openviduLazy-Bys_w8LJ.esm.js +3 -0
- package/dist/{openviduLazy--WQ7S77K.esm.js → openviduLazy-DjQv_EQK.esm.js} +1 -1
- package/dist/otp-B33JDqfa.esm.js +33 -0
- package/dist/otp-BEvNq7gp.d.ts +8 -0
- package/dist/phone.d.ts +4 -3
- package/dist/phone.esm.js +3 -2
- package/dist/{phoneManager-CkcMvwa6.esm.js → phoneManager-BAuNvs-i.esm.js} +23 -5
- package/dist/{phoneManager-eEOZV-Ag.d.ts → phoneManager-pvDvZ_gv.d.ts} +40 -2
- package/dist/{phoneStateMachine-XdnP18Rl.esm.js → phoneStateMachine-BfcrU9Ge.esm.js} +18 -3
- package/dist/qe-signature.d.ts +3 -3
- package/dist/qe-signature.esm.js +1 -1
- package/dist/{recordingService-yq4IvyVq.esm.js → recordingService-CGlyfFQ7.esm.js} +4 -4
- package/dist/redirect-to-mobile.d.ts +3 -3
- package/dist/redirect-to-mobile.esm.js +2 -2
- package/dist/{redirectToMobileManager-DC-_CWcd.d.ts → redirectToMobileManager-CquT4odi.d.ts} +2 -2
- package/dist/{redirectToMobileManager-CghtrIDs.esm.js → redirectToMobileManager-DTE12sg_.esm.js} +1 -1
- package/dist/selfie.d.ts +12 -12
- package/dist/selfie.esm.js +5 -5
- package/dist/{selfieManager-DgRA1tKd.esm.js → selfieManager-BdH-6KoN.esm.js} +1 -1
- package/dist/{selfieManager-BWhEOmu5.d.ts → selfieManager-Uk6VyeRs.d.ts} +2 -2
- package/dist/{selfieStateMachine-ijqe-SXy.esm.js → selfieStateMachine-Dwuu_grk.esm.js} +2 -2
- package/dist/session.d.ts +5 -5
- package/dist/session.esm.js +2 -2
- package/dist/{sessionInitializer-CBZGnMbc.esm.js → sessionInitializer-RsPNFUZW.esm.js} +1 -1
- package/dist/{setup-Cl42jOa1.esm.js → setup-6QUffFnD.esm.js} +1 -1
- package/dist/{setup-VFySrRdV.d.ts → setup-DASS8vHb.d.ts} +1 -1
- package/dist/signature.d.ts +2 -2
- package/dist/signature.esm.js +1 -1
- package/dist/trust-graph.d.ts +3 -3
- package/dist/{types-DGzov-rE.d.ts → types-D2CwpM2b.d.ts} +1 -1
- package/dist/{types-BPTRiryB.d.ts → types-DVwRlm7y.d.ts} +2 -2
- package/dist/{types-Cb02Rr8D.d.ts → types-iye7_56N.d.ts} +1 -1
- package/dist/wasm.d.ts +2 -2
- package/dist/wasm.esm.js +2 -2
- package/dist/watchlist-for-business.d.ts +1 -1
- package/dist/watchlist-for-business.esm.js +1 -1
- package/dist/watchlist.d.ts +1 -1
- package/dist/watchlist.esm.js +1 -1
- package/dist/workflow.d.ts +144 -144
- package/dist/workflow.esm.js +25 -24
- package/package.json +1 -1
- package/dist/openviduLazy-BPa_szFr.esm.js +0 -3
- /package/dist/{Actor-CcQ_EteO.d.ts → Actor-JBsgjVQJ.d.ts} +0 -0
- /package/dist/{Manager-C6PZlp2a.d.ts → Manager-BtbwDUTY.d.ts} +0 -0
- /package/dist/{StateMachine-terkPOx4.d.ts → StateMachine-Crq3LOHm.d.ts} +0 -0
- /package/dist/{camera-BCAbwFy2.d.ts → camera-BDklS02l.d.ts} +0 -0
- /package/dist/{deepsightLoader-CCGbu9d3.esm.js → deepsightLoader-YRBL_Fj-.esm.js} +0 -0
- /package/dist/{faceMatchStateMachine-vJUfrhXF.esm.js → faceMatchStateMachine-Da2xvnb3.esm.js} +0 -0
- /package/dist/{fieldComparisonManager-B7BNkgoh.esm.js → fieldComparisonManager-DIxV_S3C.esm.js} +0 -0
- /package/dist/{flowCompletionService-aI4wGC9f.esm.js → flowCompletionService-C-sNwEG5.esm.js} +0 -0
- /package/dist/{flowCompletionService-CCtTGPU9.d.ts → flowCompletionService-DEfKnIhU.d.ts} +0 -0
- /package/dist/{geolocationStateMachine-B9l_wr_h.esm.js → geolocationStateMachine-N_ZKLTIs.esm.js} +0 -0
- /package/dist/{idOcrStateMachine-wRa-XU9T.esm.js → idOcrStateMachine-C8BBD47N.esm.js} +0 -0
- /package/dist/{idVerificationStateMachine-FB5EETJU.esm.js → idVerificationStateMachine-__OS4Ktt.esm.js} +0 -0
- /package/dist/{identityReuseStateMachine-DHVSN2L1.esm.js → identityReuseStateMachine-BN_TuE9C.esm.js} +0 -0
- /package/dist/{invokeOnCaptureCallback-CIfXHrFp.esm.js → invokeOnCaptureCallback-BwWx2Kqq.esm.js} +0 -0
- /package/dist/{lib-Co05siK6.esm.js → lib-Dhki73Gp.esm.js} +0 -0
- /package/dist/{mandatoryConsentStateMachine-BvRq9XtS.esm.js → mandatoryConsentStateMachine-BSqA6UaU.esm.js} +0 -0
- /package/dist/{qe-signature-p2zhYha3.esm.js → qe-signature-DRTvm7c_.esm.js} +0 -0
- /package/dist/{redirectToMobileStateMachine-DfJ6xylP.esm.js → redirectToMobileStateMachine-S55Apm7m.esm.js} +0 -0
- /package/dist/{runChildModule-BPowizCN.esm.js → runChildModule-De5-f8Fk.esm.js} +0 -0
- /package/dist/{signatureStateMachine-vr7sJ5bw.esm.js → signatureStateMachine-DRcJ6Vci.esm.js} +0 -0
- /package/dist/{types-CURk4uNi.d.ts → types-BG62yJk8.d.ts} +0 -0
- /package/dist/{types-C076XDan.d.ts → types-CuY-AIPp.d.ts} +0 -0
- /package/dist/{warmup-L_VrEKjj.d.ts → warmup-C-Me8RNj.d.ts} +0 -0
- /package/dist/{watchlistForBusinessStateMachine-Bu8oGHHk.esm.js → watchlistForBusinessStateMachine-By54Yfgd.esm.js} +0 -0
- /package/dist/{watchlistStateMachine-BUNqDKp4.esm.js → watchlistStateMachine-DHod_nLg.esm.js} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "./warmup-
|
|
2
|
-
import { a as reset, i as isConfigured, s as setup, t as SetupOptions } from "./setup-
|
|
1
|
+
import "./warmup-C-Me8RNj.js";
|
|
2
|
+
import { a as reset, i as isConfigured, s as setup, t as SetupOptions } from "./setup-DASS8vHb.js";
|
|
3
3
|
export { type SetupOptions, isConfigured, reset, setup };
|
package/dist/index.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./WasmUtilProvider-CeyOvhU2.esm.js";
|
|
2
|
-
import { a as setup, n as isConfigured, r as reset } from "./setup-
|
|
2
|
+
import { a as setup, n as isConfigured, r as reset } from "./setup-6QUffFnD.esm.js";
|
|
3
3
|
import "./BrowserTimerProvider-BESs49g_.esm.js";
|
|
4
4
|
import "./api-YxPMtty2.esm.js";
|
|
5
5
|
import "./events-Bsw1l0pH.esm.js";
|
|
@@ -7,7 +7,7 @@ import "./endpoints-BPHddOTi.esm.js";
|
|
|
7
7
|
import "./stats-AwLva7-C.esm.js";
|
|
8
8
|
import "./IpifyProvider-BQKB2PR-.esm.js";
|
|
9
9
|
import "./browserSimulation-CHpyEI-W.esm.js";
|
|
10
|
-
import "./sessionInitializer-
|
|
10
|
+
import "./sessionInitializer-RsPNFUZW.esm.js";
|
|
11
11
|
import "./platform-D871crJL.esm.js";
|
|
12
12
|
import "./getBrowser-CMJJeBF8.esm.js";
|
|
13
13
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "./Manager-
|
|
2
|
-
import "./Actor-
|
|
3
|
-
import "./camera-
|
|
4
|
-
import "./types-
|
|
5
|
-
import "./types-
|
|
6
|
-
import "./types-
|
|
7
|
-
import { a as MandatoryConsentActor, i as createMandatoryConsentManagerFromActor, n as MandatoryConsentState, o as mandatoryConsentMachine, r as createMandatoryConsentManager, s as MandatoryConsentConfig, t as MandatoryConsentManager } from "./mandatoryConsentManager-
|
|
1
|
+
import "./Manager-BtbwDUTY.js";
|
|
2
|
+
import "./Actor-JBsgjVQJ.js";
|
|
3
|
+
import "./camera-BDklS02l.js";
|
|
4
|
+
import "./types-D2CwpM2b.js";
|
|
5
|
+
import "./types-BG62yJk8.js";
|
|
6
|
+
import "./types-DVwRlm7y.js";
|
|
7
|
+
import { a as MandatoryConsentActor, i as createMandatoryConsentManagerFromActor, n as MandatoryConsentState, o as mandatoryConsentMachine, r as createMandatoryConsentManager, s as MandatoryConsentConfig, t as MandatoryConsentManager } from "./mandatoryConsentManager-DvtPF0wk.js";
|
|
8
8
|
export { type MandatoryConsentActor, type MandatoryConsentConfig, type MandatoryConsentManager, type MandatoryConsentState, createMandatoryConsentManager, createMandatoryConsentManagerFromActor, mandatoryConsentMachine };
|
|
@@ -2,7 +2,7 @@ import "./api-YxPMtty2.esm.js";
|
|
|
2
2
|
import "./events-Bsw1l0pH.esm.js";
|
|
3
3
|
import "./endpoints-BPHddOTi.esm.js";
|
|
4
4
|
import "./xstate.esm-CWoFJOio.esm.js";
|
|
5
|
-
import { t as mandatoryConsentMachine } from "./mandatoryConsentStateMachine-
|
|
6
|
-
import { n as createMandatoryConsentManagerFromActor, t as createMandatoryConsentManager } from "./mandatoryConsentManager-
|
|
5
|
+
import { t as mandatoryConsentMachine } from "./mandatoryConsentStateMachine-BSqA6UaU.esm.js";
|
|
6
|
+
import { n as createMandatoryConsentManagerFromActor, t as createMandatoryConsentManager } from "./mandatoryConsentManager-vRY1lhnH.esm.js";
|
|
7
7
|
|
|
8
8
|
export { createMandatoryConsentManager, createMandatoryConsentManagerFromActor, mandatoryConsentMachine };
|
package/dist/{mandatoryConsentManager-CoAu8yf4.d.ts → mandatoryConsentManager-DvtPF0wk.d.ts}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as Manager } from "./Manager-
|
|
2
|
-
import { t as ActorRefFrom } from "./Actor-
|
|
3
|
-
import { a as RegulationTypes } from "./types-
|
|
4
|
-
import * as
|
|
1
|
+
import { t as Manager } from "./Manager-BtbwDUTY.js";
|
|
2
|
+
import { t as ActorRefFrom } from "./Actor-JBsgjVQJ.js";
|
|
3
|
+
import { a as RegulationTypes } from "./types-DVwRlm7y.js";
|
|
4
|
+
import * as xstate991 from "xstate";
|
|
5
5
|
|
|
6
6
|
//#region src/modules/mandatory-consent/types.d.ts
|
|
7
7
|
type MandatoryConsentConfig = {
|
|
@@ -29,7 +29,7 @@ type MandatoryConsentContext = {
|
|
|
29
29
|
type MandatoryConsentInput = {
|
|
30
30
|
config: MandatoryConsentConfig;
|
|
31
31
|
};
|
|
32
|
-
declare const mandatoryConsentMachine:
|
|
32
|
+
declare const mandatoryConsentMachine: xstate991.StateMachine<MandatoryConsentContext, {
|
|
33
33
|
type: "LOAD";
|
|
34
34
|
} | {
|
|
35
35
|
type: "TOGGLE";
|
|
@@ -42,53 +42,53 @@ declare const mandatoryConsentMachine: xstate732.StateMachine<MandatoryConsentCo
|
|
|
42
42
|
} | {
|
|
43
43
|
type: "RESET";
|
|
44
44
|
}, {
|
|
45
|
-
[x: string]:
|
|
45
|
+
[x: string]: xstate991.ActorRefFromLogic<xstate991.PromiseActorLogic<FetchMandatoryConsentResponse, {
|
|
46
46
|
config: MandatoryConsentConfig;
|
|
47
|
-
},
|
|
47
|
+
}, xstate991.EventObject>> | xstate991.ActorRefFromLogic<xstate991.PromiseActorLogic<void, {
|
|
48
48
|
consentId: string;
|
|
49
49
|
isSigned: boolean;
|
|
50
|
-
},
|
|
51
|
-
},
|
|
50
|
+
}, xstate991.EventObject>> | undefined;
|
|
51
|
+
}, xstate991.Values<{
|
|
52
52
|
fetchConsent: {
|
|
53
53
|
src: "fetchConsent";
|
|
54
|
-
logic:
|
|
54
|
+
logic: xstate991.PromiseActorLogic<FetchMandatoryConsentResponse, {
|
|
55
55
|
config: MandatoryConsentConfig;
|
|
56
|
-
},
|
|
56
|
+
}, xstate991.EventObject>;
|
|
57
57
|
id: string | undefined;
|
|
58
58
|
};
|
|
59
59
|
submitConsent: {
|
|
60
60
|
src: "submitConsent";
|
|
61
|
-
logic:
|
|
61
|
+
logic: xstate991.PromiseActorLogic<void, {
|
|
62
62
|
consentId: string;
|
|
63
63
|
isSigned: boolean;
|
|
64
|
-
},
|
|
64
|
+
}, xstate991.EventObject>;
|
|
65
65
|
id: string | undefined;
|
|
66
66
|
};
|
|
67
|
-
}>,
|
|
67
|
+
}>, xstate991.Values<{
|
|
68
68
|
setConsent: {
|
|
69
69
|
type: "setConsent";
|
|
70
|
-
params:
|
|
70
|
+
params: xstate991.NonReducibleUnknown;
|
|
71
71
|
};
|
|
72
72
|
setError: {
|
|
73
73
|
type: "setError";
|
|
74
|
-
params:
|
|
74
|
+
params: xstate991.NonReducibleUnknown;
|
|
75
75
|
};
|
|
76
76
|
clearError: {
|
|
77
77
|
type: "clearError";
|
|
78
|
-
params:
|
|
78
|
+
params: xstate991.NonReducibleUnknown;
|
|
79
79
|
};
|
|
80
80
|
resetContext: {
|
|
81
81
|
type: "resetContext";
|
|
82
|
-
params:
|
|
82
|
+
params: xstate991.NonReducibleUnknown;
|
|
83
83
|
};
|
|
84
84
|
toggleSigned: {
|
|
85
85
|
type: "toggleSigned";
|
|
86
|
-
params:
|
|
86
|
+
params: xstate991.NonReducibleUnknown;
|
|
87
87
|
};
|
|
88
88
|
}>, {
|
|
89
89
|
type: "canSubmit";
|
|
90
90
|
params: unknown;
|
|
91
|
-
}, never, "error" | "idle" | "closed" | "finished" | "loading" | "
|
|
91
|
+
}, never, "error" | "idle" | "closed" | "finished" | "loading" | "submitting" | "display", string, MandatoryConsentInput, xstate991.NonReducibleUnknown, xstate991.EventObject, xstate991.MetaObject, {
|
|
92
92
|
readonly id: "mandatoryConsent";
|
|
93
93
|
readonly initial: "idle";
|
|
94
94
|
readonly context: ({
|
|
@@ -97,70 +97,70 @@ declare const mandatoryConsentMachine: xstate732.StateMachine<MandatoryConsentCo
|
|
|
97
97
|
spawn: {
|
|
98
98
|
<TSrc extends "fetchConsent" | "submitConsent">(logic: TSrc, ...[options]: ({
|
|
99
99
|
src: "fetchConsent";
|
|
100
|
-
logic:
|
|
100
|
+
logic: xstate991.PromiseActorLogic<FetchMandatoryConsentResponse, {
|
|
101
101
|
config: MandatoryConsentConfig;
|
|
102
|
-
},
|
|
102
|
+
}, xstate991.EventObject>;
|
|
103
103
|
id: string | undefined;
|
|
104
104
|
} extends infer T ? T extends {
|
|
105
105
|
src: "fetchConsent";
|
|
106
|
-
logic:
|
|
106
|
+
logic: xstate991.PromiseActorLogic<FetchMandatoryConsentResponse, {
|
|
107
107
|
config: MandatoryConsentConfig;
|
|
108
|
-
},
|
|
108
|
+
}, xstate991.EventObject>;
|
|
109
109
|
id: string | undefined;
|
|
110
110
|
} ? T extends {
|
|
111
111
|
src: TSrc;
|
|
112
|
-
} ?
|
|
112
|
+
} ? xstate991.ConditionalRequired<[options?: ({
|
|
113
113
|
id?: T["id"] | undefined;
|
|
114
114
|
systemId?: string;
|
|
115
|
-
input?:
|
|
115
|
+
input?: xstate991.InputFrom<T["logic"]> | undefined;
|
|
116
116
|
syncSnapshot?: boolean;
|
|
117
|
-
} & { [K in
|
|
117
|
+
} & { [K in xstate991.RequiredActorOptions<T>]: unknown }) | undefined], xstate991.IsNotNever<xstate991.RequiredActorOptions<T>>> : never : never : never) | ({
|
|
118
118
|
src: "submitConsent";
|
|
119
|
-
logic:
|
|
119
|
+
logic: xstate991.PromiseActorLogic<void, {
|
|
120
120
|
consentId: string;
|
|
121
121
|
isSigned: boolean;
|
|
122
|
-
},
|
|
122
|
+
}, xstate991.EventObject>;
|
|
123
123
|
id: string | undefined;
|
|
124
124
|
} extends infer T_1 ? T_1 extends {
|
|
125
125
|
src: "submitConsent";
|
|
126
|
-
logic:
|
|
126
|
+
logic: xstate991.PromiseActorLogic<void, {
|
|
127
127
|
consentId: string;
|
|
128
128
|
isSigned: boolean;
|
|
129
|
-
},
|
|
129
|
+
}, xstate991.EventObject>;
|
|
130
130
|
id: string | undefined;
|
|
131
131
|
} ? T_1 extends {
|
|
132
132
|
src: TSrc;
|
|
133
|
-
} ?
|
|
133
|
+
} ? xstate991.ConditionalRequired<[options?: ({
|
|
134
134
|
id?: T_1["id"] | undefined;
|
|
135
135
|
systemId?: string;
|
|
136
|
-
input?:
|
|
136
|
+
input?: xstate991.InputFrom<T_1["logic"]> | undefined;
|
|
137
137
|
syncSnapshot?: boolean;
|
|
138
|
-
} & { [K_1 in
|
|
138
|
+
} & { [K_1 in xstate991.RequiredActorOptions<T_1>]: unknown }) | undefined], xstate991.IsNotNever<xstate991.RequiredActorOptions<T_1>>> : never : never : never)): xstate991.ActorRefFromLogic<xstate991.GetConcreteByKey<xstate991.Values<{
|
|
139
139
|
fetchConsent: {
|
|
140
140
|
src: "fetchConsent";
|
|
141
|
-
logic:
|
|
141
|
+
logic: xstate991.PromiseActorLogic<FetchMandatoryConsentResponse, {
|
|
142
142
|
config: MandatoryConsentConfig;
|
|
143
|
-
},
|
|
143
|
+
}, xstate991.EventObject>;
|
|
144
144
|
id: string | undefined;
|
|
145
145
|
};
|
|
146
146
|
submitConsent: {
|
|
147
147
|
src: "submitConsent";
|
|
148
|
-
logic:
|
|
148
|
+
logic: xstate991.PromiseActorLogic<void, {
|
|
149
149
|
consentId: string;
|
|
150
150
|
isSigned: boolean;
|
|
151
|
-
},
|
|
151
|
+
}, xstate991.EventObject>;
|
|
152
152
|
id: string | undefined;
|
|
153
153
|
};
|
|
154
154
|
}>, "src", TSrc>["logic"]>;
|
|
155
|
-
<TLogic extends
|
|
155
|
+
<TLogic extends xstate991.AnyActorLogic>(src: TLogic, ...[options]: xstate991.ConditionalRequired<[options?: ({
|
|
156
156
|
id?: never;
|
|
157
157
|
systemId?: string;
|
|
158
|
-
input?:
|
|
158
|
+
input?: xstate991.InputFrom<TLogic> | undefined;
|
|
159
159
|
syncSnapshot?: boolean;
|
|
160
|
-
} & { [K in
|
|
160
|
+
} & { [K in xstate991.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate991.IsNotNever<xstate991.RequiredLogicInput<TLogic>>>): xstate991.ActorRefFromLogic<TLogic>;
|
|
161
161
|
};
|
|
162
162
|
input: MandatoryConsentInput;
|
|
163
|
-
self:
|
|
163
|
+
self: xstate991.ActorRef<xstate991.MachineSnapshot<MandatoryConsentContext, {
|
|
164
164
|
type: "LOAD";
|
|
165
165
|
} | {
|
|
166
166
|
type: "TOGGLE";
|
|
@@ -172,7 +172,7 @@ declare const mandatoryConsentMachine: xstate732.StateMachine<MandatoryConsentCo
|
|
|
172
172
|
type: "RETRY";
|
|
173
173
|
} | {
|
|
174
174
|
type: "RESET";
|
|
175
|
-
}, Record<string,
|
|
175
|
+
}, Record<string, xstate991.AnyActorRef | undefined>, xstate991.StateValue, string, unknown, any, any>, {
|
|
176
176
|
type: "LOAD";
|
|
177
177
|
} | {
|
|
178
178
|
type: "TOGGLE";
|
|
@@ -184,7 +184,7 @@ declare const mandatoryConsentMachine: xstate732.StateMachine<MandatoryConsentCo
|
|
|
184
184
|
type: "RETRY";
|
|
185
185
|
} | {
|
|
186
186
|
type: "RESET";
|
|
187
|
-
},
|
|
187
|
+
}, xstate991.AnyEventObject>;
|
|
188
188
|
}) => {
|
|
189
189
|
config: MandatoryConsentConfig;
|
|
190
190
|
consent: undefined;
|
|
@@ -221,7 +221,7 @@ declare const mandatoryConsentMachine: xstate732.StateMachine<MandatoryConsentCo
|
|
|
221
221
|
} | {
|
|
222
222
|
type: "RESET";
|
|
223
223
|
};
|
|
224
|
-
self:
|
|
224
|
+
self: xstate991.ActorRef<xstate991.MachineSnapshot<MandatoryConsentContext, {
|
|
225
225
|
type: "LOAD";
|
|
226
226
|
} | {
|
|
227
227
|
type: "TOGGLE";
|
|
@@ -233,7 +233,7 @@ declare const mandatoryConsentMachine: xstate732.StateMachine<MandatoryConsentCo
|
|
|
233
233
|
type: "RETRY";
|
|
234
234
|
} | {
|
|
235
235
|
type: "RESET";
|
|
236
|
-
}, Record<string,
|
|
236
|
+
}, Record<string, xstate991.AnyActorRef>, xstate991.StateValue, string, unknown, any, any>, {
|
|
237
237
|
type: "LOAD";
|
|
238
238
|
} | {
|
|
239
239
|
type: "TOGGLE";
|
|
@@ -245,7 +245,7 @@ declare const mandatoryConsentMachine: xstate732.StateMachine<MandatoryConsentCo
|
|
|
245
245
|
type: "RETRY";
|
|
246
246
|
} | {
|
|
247
247
|
type: "RESET";
|
|
248
|
-
},
|
|
248
|
+
}, xstate991.AnyEventObject>;
|
|
249
249
|
}) => {
|
|
250
250
|
config: MandatoryConsentConfig;
|
|
251
251
|
};
|
|
@@ -298,7 +298,7 @@ declare const mandatoryConsentMachine: xstate732.StateMachine<MandatoryConsentCo
|
|
|
298
298
|
} | {
|
|
299
299
|
type: "RESET";
|
|
300
300
|
};
|
|
301
|
-
self:
|
|
301
|
+
self: xstate991.ActorRef<xstate991.MachineSnapshot<MandatoryConsentContext, {
|
|
302
302
|
type: "LOAD";
|
|
303
303
|
} | {
|
|
304
304
|
type: "TOGGLE";
|
|
@@ -310,7 +310,7 @@ declare const mandatoryConsentMachine: xstate732.StateMachine<MandatoryConsentCo
|
|
|
310
310
|
type: "RETRY";
|
|
311
311
|
} | {
|
|
312
312
|
type: "RESET";
|
|
313
|
-
}, Record<string,
|
|
313
|
+
}, Record<string, xstate991.AnyActorRef>, xstate991.StateValue, string, unknown, any, any>, {
|
|
314
314
|
type: "LOAD";
|
|
315
315
|
} | {
|
|
316
316
|
type: "TOGGLE";
|
|
@@ -322,7 +322,7 @@ declare const mandatoryConsentMachine: xstate732.StateMachine<MandatoryConsentCo
|
|
|
322
322
|
type: "RETRY";
|
|
323
323
|
} | {
|
|
324
324
|
type: "RESET";
|
|
325
|
-
},
|
|
325
|
+
}, xstate991.AnyEventObject>;
|
|
326
326
|
}) => {
|
|
327
327
|
consentId: string;
|
|
328
328
|
isSigned: boolean;
|
package/dist/{mandatoryConsentManager-DaV3Kasq.esm.js → mandatoryConsentManager-vRY1lhnH.esm.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-Bsw1l0pH.esm.js";
|
|
2
2
|
import { c as createManager, s as createActor } from "./xstate.esm-CWoFJOio.esm.js";
|
|
3
|
-
import { t as mandatoryConsentMachine } from "./mandatoryConsentStateMachine-
|
|
3
|
+
import { t as mandatoryConsentMachine } from "./mandatoryConsentStateMachine-BSqA6UaU.esm.js";
|
|
4
4
|
|
|
5
5
|
//#region src/modules/mandatory-consent/mandatoryConsentActor.ts
|
|
6
6
|
function createMandatoryConsentActor(options) {
|
|
@@ -4,7 +4,7 @@ import { a as __toDynamicImportESM } from "./chunk-wtC55c3P.esm.js";
|
|
|
4
4
|
let openViduImport;
|
|
5
5
|
async function loadOpenVidu() {
|
|
6
6
|
if (openViduImport) return openViduImport;
|
|
7
|
-
openViduImport = import("./lib-
|
|
7
|
+
openViduImport = import("./lib-Dhki73Gp.esm.js").then(__toDynamicImportESM(1));
|
|
8
8
|
return openViduImport;
|
|
9
9
|
}
|
|
10
10
|
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//#region src/shared/otp.ts
|
|
2
|
+
/**
|
|
3
|
+
* Expected length of an OTP verification code.
|
|
4
|
+
*
|
|
5
|
+
* Owned by Core so the phone, email, and government-validation modules — and
|
|
6
|
+
* the UI (via each manager's exposed `otpLength`) — agree on a single value.
|
|
7
|
+
* This is a pure leaf utility: modules import it independently, so it never
|
|
8
|
+
* introduces a dependency between them.
|
|
9
|
+
*/
|
|
10
|
+
const OTP_CODE_LENGTH = 6;
|
|
11
|
+
/** Validation-error code for an OTP code that is not yet complete. */
|
|
12
|
+
const OTP_INCOMPLETE_ERROR = "incompleteOtp";
|
|
13
|
+
/**
|
|
14
|
+
* Returns true when the code has exactly the expected number of characters.
|
|
15
|
+
* Normalization (casing, stripping separators) is the caller's responsibility.
|
|
16
|
+
*/
|
|
17
|
+
function isOtpComplete(code, length = OTP_CODE_LENGTH) {
|
|
18
|
+
return code.length === length;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Computes client-side OTP validation errors for the given code.
|
|
22
|
+
*
|
|
23
|
+
* Returns `{ otp: OTP_INCOMPLETE_ERROR }` when the code is incomplete (including
|
|
24
|
+
* empty), or an empty object when complete. Mirrors the phone/email
|
|
25
|
+
* `computeValidationErrors` shape so state machines can treat it identically.
|
|
26
|
+
*/
|
|
27
|
+
function computeOtpValidationErrors(code, length = OTP_CODE_LENGTH) {
|
|
28
|
+
if (!isOtpComplete(code, length)) return { otp: OTP_INCOMPLETE_ERROR };
|
|
29
|
+
return {};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
export { computeOtpValidationErrors as n, isOtpComplete as r, OTP_CODE_LENGTH as t };
|
package/dist/phone.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import "./Manager-
|
|
2
|
-
import "./Actor-
|
|
3
|
-
import
|
|
1
|
+
import "./Manager-BtbwDUTY.js";
|
|
2
|
+
import "./Actor-JBsgjVQJ.js";
|
|
3
|
+
import "./otp-BEvNq7gp.js";
|
|
4
|
+
import { n as PhoneState, o as phoneMachine, r as createPhoneManager, s as PhoneConfig, t as PhoneManager } from "./phoneManager-pvDvZ_gv.js";
|
|
4
5
|
export { type PhoneConfig, type PhoneManager, type PhoneState, createPhoneManager, phoneMachine };
|
package/dist/phone.esm.js
CHANGED
|
@@ -3,7 +3,8 @@ import "./api-YxPMtty2.esm.js";
|
|
|
3
3
|
import "./events-Bsw1l0pH.esm.js";
|
|
4
4
|
import "./endpoints-BPHddOTi.esm.js";
|
|
5
5
|
import "./xstate.esm-CWoFJOio.esm.js";
|
|
6
|
-
import
|
|
7
|
-
import { t as
|
|
6
|
+
import "./otp-B33JDqfa.esm.js";
|
|
7
|
+
import { t as phoneMachine } from "./phoneStateMachine-BfcrU9Ge.esm.js";
|
|
8
|
+
import { t as createPhoneManager } from "./phoneManager-BAuNvs-i.esm.js";
|
|
8
9
|
|
|
9
10
|
export { createPhoneManager, phoneMachine };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-Bsw1l0pH.esm.js";
|
|
2
2
|
import { c as createManager, s as createActor } from "./xstate.esm-CWoFJOio.esm.js";
|
|
3
|
-
import { t as
|
|
3
|
+
import { t as OTP_CODE_LENGTH } from "./otp-B33JDqfa.esm.js";
|
|
4
|
+
import { t as phoneMachine } from "./phoneStateMachine-BfcrU9Ge.esm.js";
|
|
4
5
|
|
|
5
6
|
//#region src/modules/phone/phoneActor.ts
|
|
6
7
|
function createPhoneActor(options) {
|
|
@@ -120,25 +121,39 @@ function mapState(snapshot) {
|
|
|
120
121
|
optinEnabled: context.config.optinEnabled ?? false
|
|
121
122
|
};
|
|
122
123
|
if (typedSnapshot.matches("submitting")) return { status: "submitting" };
|
|
123
|
-
if (typedSnapshot.matches("resendingOtp")) return {
|
|
124
|
+
if (typedSnapshot.matches("resendingOtp")) return {
|
|
125
|
+
status: "resendingOtp",
|
|
126
|
+
otpCode: context.otpCode,
|
|
127
|
+
otpLength: OTP_CODE_LENGTH
|
|
128
|
+
};
|
|
124
129
|
if (typedSnapshot.matches("sendingInitialOtp")) return { status: "sendingInitialOtp" };
|
|
125
130
|
if (typedSnapshot.matches("awaitingOtp")) return {
|
|
126
131
|
status: "awaitingOtp",
|
|
127
132
|
resendTimer: context.resendTimer,
|
|
128
133
|
canResend: !context.resendTimerActive,
|
|
129
|
-
attemptsRemaining: context.attemptsRemaining
|
|
134
|
+
attemptsRemaining: context.attemptsRemaining,
|
|
135
|
+
otpCode: context.otpCode,
|
|
136
|
+
otpLength: OTP_CODE_LENGTH,
|
|
137
|
+
otpValidationErrors: context.otpValidationErrors,
|
|
138
|
+
isOtpValid: Object.keys(context.otpValidationErrors ?? {}).length === 0
|
|
130
139
|
};
|
|
131
140
|
if (typedSnapshot.matches("verifyingOtp")) return {
|
|
132
141
|
status: "verifyingOtp",
|
|
133
142
|
resendTimer: context.resendTimer,
|
|
134
|
-
canResend: !context.resendTimerActive
|
|
143
|
+
canResend: !context.resendTimerActive,
|
|
144
|
+
otpCode: context.otpCode,
|
|
145
|
+
otpLength: OTP_CODE_LENGTH
|
|
135
146
|
};
|
|
136
147
|
if (typedSnapshot.matches("otpError")) return {
|
|
137
148
|
status: "otpError",
|
|
138
149
|
otpError: context.otpError ?? "otp.errorv2",
|
|
139
150
|
attemptsRemaining: context.attemptsRemaining,
|
|
140
151
|
resendTimer: context.resendTimer,
|
|
141
|
-
canResend: !context.resendTimerActive
|
|
152
|
+
canResend: !context.resendTimerActive,
|
|
153
|
+
otpCode: context.otpCode,
|
|
154
|
+
otpLength: OTP_CODE_LENGTH,
|
|
155
|
+
otpValidationErrors: context.otpValidationErrors,
|
|
156
|
+
isOtpValid: Object.keys(context.otpValidationErrors ?? {}).length === 0
|
|
142
157
|
};
|
|
143
158
|
if (typedSnapshot.matches("finished")) return { status: "finished" };
|
|
144
159
|
if (typedSnapshot.matches("error")) return {
|
|
@@ -178,6 +193,9 @@ function createApi({ actor, trackElementClicked }) {
|
|
|
178
193
|
code
|
|
179
194
|
});
|
|
180
195
|
},
|
|
196
|
+
validateOtp() {
|
|
197
|
+
actor.send({ type: "VALIDATE_OTP" });
|
|
198
|
+
},
|
|
181
199
|
submitOtp(code) {
|
|
182
200
|
trackElementClicked?.("submitOtp");
|
|
183
201
|
actor.send({
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { t as Manager } from "./Manager-
|
|
2
|
-
import { t as ActorRefFrom } from "./Actor-
|
|
1
|
+
import { t as Manager } from "./Manager-BtbwDUTY.js";
|
|
2
|
+
import { t as ActorRefFrom } from "./Actor-JBsgjVQJ.js";
|
|
3
|
+
import { t as OtpValidationErrors } from "./otp-BEvNq7gp.js";
|
|
3
4
|
|
|
4
5
|
//#region src/modules/phone/types.d.ts
|
|
5
6
|
|
|
@@ -125,6 +126,10 @@ type PhoneSubmittingState = {
|
|
|
125
126
|
/** OTP is being sent to the phone number on resend */
|
|
126
127
|
type PhoneResendingOtpState = {
|
|
127
128
|
status: 'resendingOtp';
|
|
129
|
+
/** The OTP code entered so far (controlled-input value, kept visible while disabled) */
|
|
130
|
+
otpCode: string;
|
|
131
|
+
/** Expected OTP length (owned by Core) */
|
|
132
|
+
otpLength: number;
|
|
128
133
|
};
|
|
129
134
|
/** OTP is being initialy sent to the phone number */
|
|
130
135
|
type PhoneSendingInitialOtp = {
|
|
@@ -135,22 +140,34 @@ type PhoneSendingInitialOtp = {
|
|
|
135
140
|
* @property resendTimer - Seconds remaining before resend is allowed
|
|
136
141
|
* @property canResend - Whether the resend button should be enabled
|
|
137
142
|
* @property attemptsRemaining - Number of OTP verification attempts left
|
|
143
|
+
* @property otpCode - The OTP code entered so far (controlled-input value)
|
|
144
|
+
* @property otpLength - Expected OTP length (owned by Core; the UI should not hardcode it)
|
|
145
|
+
* @property otpValidationErrors - Client-side OTP errors (e.g. incomplete code). Surfaced on blur and submit.
|
|
146
|
+
* @property isOtpValid - True iff `otpValidationErrors` is empty. Optimistic semantic: starts true.
|
|
138
147
|
*/
|
|
139
148
|
type PhoneAwaitingOtpState = {
|
|
140
149
|
status: 'awaitingOtp';
|
|
141
150
|
resendTimer: number;
|
|
142
151
|
canResend: boolean;
|
|
143
152
|
attemptsRemaining: number;
|
|
153
|
+
otpCode: string;
|
|
154
|
+
otpLength: number;
|
|
155
|
+
otpValidationErrors?: OtpValidationErrors;
|
|
156
|
+
isOtpValid: boolean;
|
|
144
157
|
};
|
|
145
158
|
/**
|
|
146
159
|
* OTP code is being verified against the backend
|
|
147
160
|
* @property resendTimer - Seconds remaining on resend cooldown (unchanged while verifying)
|
|
148
161
|
* @property canResend - Whether resend is allowed (cooldown finished)
|
|
162
|
+
* @property otpCode - The code being verified (controlled-input value, kept visible while disabled)
|
|
163
|
+
* @property otpLength - Expected OTP length (owned by Core)
|
|
149
164
|
*/
|
|
150
165
|
type PhoneVerifyingOtpState = {
|
|
151
166
|
status: 'verifyingOtp';
|
|
152
167
|
resendTimer: number;
|
|
153
168
|
canResend: boolean;
|
|
169
|
+
otpCode: string;
|
|
170
|
+
otpLength: number;
|
|
154
171
|
};
|
|
155
172
|
/**
|
|
156
173
|
* OTP verification failed - user can retry with `submitOtp()`
|
|
@@ -158,6 +175,10 @@ type PhoneVerifyingOtpState = {
|
|
|
158
175
|
* @property attemptsRemaining - Number of remaining attempts before lockout
|
|
159
176
|
* @property resendTimer - Seconds remaining on resend cooldown (same as awaiting OTP)
|
|
160
177
|
* @property canResend - Whether resend is allowed (cooldown finished)
|
|
178
|
+
* @property otpCode - The OTP code entered so far (controlled-input value)
|
|
179
|
+
* @property otpLength - Expected OTP length (owned by Core)
|
|
180
|
+
* @property otpValidationErrors - Client-side OTP errors (e.g. incomplete code). Server `otpError` takes precedence in the UI.
|
|
181
|
+
* @property isOtpValid - True iff `otpValidationErrors` is empty. Optimistic semantic: starts true.
|
|
161
182
|
*/
|
|
162
183
|
type PhoneOtpErrorState = {
|
|
163
184
|
status: 'otpError';
|
|
@@ -165,6 +186,10 @@ type PhoneOtpErrorState = {
|
|
|
165
186
|
attemptsRemaining: number;
|
|
166
187
|
resendTimer: number;
|
|
167
188
|
canResend: boolean;
|
|
189
|
+
otpCode: string;
|
|
190
|
+
otpLength: number;
|
|
191
|
+
otpValidationErrors?: OtpValidationErrors;
|
|
192
|
+
isOtpValid: boolean;
|
|
168
193
|
};
|
|
169
194
|
/** Phone verification completed successfully */
|
|
170
195
|
type PhoneFinishedState = {
|
|
@@ -282,6 +307,12 @@ declare function createPhoneManager(options: CreatePhoneActorOptions): Manager<P
|
|
|
282
307
|
* @param code - The OTP code entered by the user
|
|
283
308
|
*/
|
|
284
309
|
setOtpCode(code: string): void;
|
|
310
|
+
/**
|
|
311
|
+
* Validates the current OTP code (e.g. on blur), without submitting.
|
|
312
|
+
* Populates or clears `otpValidationErrors.otp` on the 'awaitingOtp' /
|
|
313
|
+
* 'otpError' states (incomplete code → `isOtpValid` becomes false).
|
|
314
|
+
*/
|
|
315
|
+
validateOtp(): void;
|
|
285
316
|
/**
|
|
286
317
|
* Sets and submits the OTP code in one call.
|
|
287
318
|
* Should be called when state is 'awaitingOtp' or 'otpError'.
|
|
@@ -363,6 +394,12 @@ declare function createPhoneManagerFromActor(actor: PhoneActor): Manager<PhoneSt
|
|
|
363
394
|
* @param code - The OTP code entered by the user
|
|
364
395
|
*/
|
|
365
396
|
setOtpCode(code: string): void;
|
|
397
|
+
/**
|
|
398
|
+
* Validates the current OTP code (e.g. on blur), without submitting.
|
|
399
|
+
* Populates or clears `otpValidationErrors.otp` on the 'awaitingOtp' /
|
|
400
|
+
* 'otpError' states (incomplete code → `isOtpValid` becomes false).
|
|
401
|
+
*/
|
|
402
|
+
validateOtp(): void;
|
|
366
403
|
/**
|
|
367
404
|
* Sets and submits the OTP code in one call.
|
|
368
405
|
* Should be called when state is 'awaitingOtp' or 'otpError'.
|
|
@@ -407,6 +444,7 @@ declare function createPhoneManagerFromActor(actor: PhoneActor): Manager<PhoneSt
|
|
|
407
444
|
* @property setOptInGranted - Sets marketing opt-in preference
|
|
408
445
|
* @property submit - Submits the phone number
|
|
409
446
|
* @property setOtpCode - Sets OTP code without submitting
|
|
447
|
+
* @property validateOtp - Validates the current OTP (e.g. on blur)
|
|
410
448
|
* @property submitOtp - Sets and submits OTP code
|
|
411
449
|
* @property resendOtp - Requests new OTP code
|
|
412
450
|
* @property back - Returns to phone input from OTP screen
|
|
@@ -2,6 +2,7 @@ import { t as BrowserTimerProvider } from "./BrowserTimerProvider-BESs49g_.esm.j
|
|
|
2
2
|
import { t as api } from "./api-YxPMtty2.esm.js";
|
|
3
3
|
import { t as endpoints } from "./endpoints-BPHddOTi.esm.js";
|
|
4
4
|
import { a as fromPromise, i as fromCallback, r as assign, t as setup } from "./xstate.esm-CWoFJOio.esm.js";
|
|
5
|
+
import { n as computeOtpValidationErrors, r as isOtpComplete } from "./otp-B33JDqfa.esm.js";
|
|
5
6
|
|
|
6
7
|
//#region src/modules/phone/phoneServices.ts
|
|
7
8
|
function getPhoneServerFailureReason(error, invalidStatus) {
|
|
@@ -145,8 +146,13 @@ const phoneMachine = setup({
|
|
|
145
146
|
clearPhoneError: assign({ phoneError: () => void 0 }),
|
|
146
147
|
setOtpCode: assign(({ event }) => ({
|
|
147
148
|
otpCode: event.code,
|
|
148
|
-
otpError: void 0
|
|
149
|
+
otpError: void 0,
|
|
150
|
+
otpValidationErrors: void 0
|
|
149
151
|
})),
|
|
152
|
+
validateOtpField: assign(({ context }) => {
|
|
153
|
+
const errors = computeOtpValidationErrors(context.otpCode);
|
|
154
|
+
return { otpValidationErrors: errors.otp ? errors : void 0 };
|
|
155
|
+
}),
|
|
150
156
|
setOtpError: assign(({ context, event }) => ({
|
|
151
157
|
otpError: getErrorMessage(event.error),
|
|
152
158
|
attemptsRemaining: context.attemptsRemaining - 1
|
|
@@ -154,7 +160,8 @@ const phoneMachine = setup({
|
|
|
154
160
|
setOtpRequestError: assign(({ event }) => ({ otpError: getErrorMessage(event.error) })),
|
|
155
161
|
clearOtpError: assign({
|
|
156
162
|
otpError: () => void 0,
|
|
157
|
-
otpCode: () => ""
|
|
163
|
+
otpCode: () => "",
|
|
164
|
+
otpValidationErrors: () => void 0
|
|
158
165
|
}),
|
|
159
166
|
startResendTimer: assign({
|
|
160
167
|
resendTimer: () => RESEND_TIMER_SECONDS,
|
|
@@ -181,6 +188,7 @@ const phoneMachine = setup({
|
|
|
181
188
|
error: void 0,
|
|
182
189
|
otpCode: "",
|
|
183
190
|
otpError: void 0,
|
|
191
|
+
otpValidationErrors: void 0,
|
|
184
192
|
attemptsRemaining: context.config.maxOtpAttempts ?? 3,
|
|
185
193
|
resendTimer: 0,
|
|
186
194
|
resendTimerActive: false
|
|
@@ -191,6 +199,7 @@ const phoneMachine = setup({
|
|
|
191
199
|
hasOtpVerification: ({ context }) => context.config.otpVerification,
|
|
192
200
|
hasNoValidationErrors: ({ context }) => !context.validationErrors || Object.keys(context.validationErrors).length === 0,
|
|
193
201
|
hasAttemptsRemaining: ({ context }) => context.attemptsRemaining > 1,
|
|
202
|
+
hasCompleteOtp: ({ context }) => isOtpComplete(context.otpCode),
|
|
194
203
|
canResend: ({ context }) => !context.resendTimerActive
|
|
195
204
|
}
|
|
196
205
|
}).createMachine({
|
|
@@ -210,6 +219,7 @@ const phoneMachine = setup({
|
|
|
210
219
|
error: void 0,
|
|
211
220
|
otpCode: "",
|
|
212
221
|
otpError: void 0,
|
|
222
|
+
otpValidationErrors: void 0,
|
|
213
223
|
attemptsRemaining: input.config.maxOtpAttempts ?? 3,
|
|
214
224
|
resendTimer: 0,
|
|
215
225
|
resendTimerActive: false
|
|
@@ -301,7 +311,11 @@ const phoneMachine = setup({
|
|
|
301
311
|
on: {
|
|
302
312
|
TICK: { actions: "tickResendTimer" },
|
|
303
313
|
OTP_CHANGED: { actions: "setOtpCode" },
|
|
304
|
-
|
|
314
|
+
VALIDATE_OTP: { actions: "validateOtpField" },
|
|
315
|
+
VERIFY_OTP: [{
|
|
316
|
+
guard: "hasCompleteOtp",
|
|
317
|
+
target: "verifyingOtp"
|
|
318
|
+
}, { actions: "validateOtpField" }],
|
|
305
319
|
RESEND_OTP: {
|
|
306
320
|
target: "resendingOtp",
|
|
307
321
|
guard: "canResend"
|
|
@@ -352,6 +366,7 @@ const phoneMachine = setup({
|
|
|
352
366
|
target: "awaitingOtp",
|
|
353
367
|
actions: "setOtpCode"
|
|
354
368
|
},
|
|
369
|
+
VALIDATE_OTP: { actions: "validateOtpField" },
|
|
355
370
|
RESEND_OTP: {
|
|
356
371
|
target: "resendingOtp",
|
|
357
372
|
guard: "canResend"
|
package/dist/qe-signature.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as Manager } from "./Manager-
|
|
2
|
-
import "./Actor-
|
|
3
|
-
import { c as ConsentKey, f as QE_CONSENT_KEYS, g as getDefaultConsentChecks, i as electronicSignatureMachine, l as ElectronicSignatureConfig, m as areAllConsented, n as ElectronicSignatureState, s as ConsentChecks, u as ElectronicSignatureDocument } from "./index-
|
|
1
|
+
import { t as Manager } from "./Manager-BtbwDUTY.js";
|
|
2
|
+
import "./Actor-JBsgjVQJ.js";
|
|
3
|
+
import { c as ConsentKey, f as QE_CONSENT_KEYS, g as getDefaultConsentChecks, i as electronicSignatureMachine, l as ElectronicSignatureConfig, m as areAllConsented, n as ElectronicSignatureState, s as ConsentChecks, u as ElectronicSignatureDocument } from "./index-Dlszx51Y.js";
|
|
4
4
|
|
|
5
5
|
//#region src/modules/qe-signature/index.d.ts
|
|
6
6
|
|