@incodetech/core 0.0.0-dev-20261116-3ec7b7bd → 0.0.0-dev-20261117-96ea37ad
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/{FaceDetectionProvider-DtWTzhdl.esm.js → FaceDetectionProvider-CNu-TWXu.esm.js} +4 -4
- package/dist/ae-signature.esm.js +1 -1
- package/dist/{apiError-CPNXKYOV.esm.js → apiError-CDvhOvoO.esm.js} +1 -1
- package/dist/authentication.esm.js +2 -2
- package/dist/{authenticationManager-CZp8XZJY.esm.js → authenticationManager-CAZNsfpV.esm.js} +3 -3
- package/dist/{authenticationStateMachine-BFfOIsAw.esm.js → authenticationStateMachine-BmtndZRs.esm.js} +2 -2
- package/dist/calendarDate-DcqGuEht.esm.js +35 -0
- package/dist/consent.d.ts +1 -1
- package/dist/{consentManager-B0YKqYtZ.d.ts → consentManager-CMed_O5F.d.ts} +8 -8
- package/dist/curp-validation.esm.js +2 -2
- package/dist/{curpValidationManager-CbvBDoE1.esm.js → curpValidationManager-BuA6p_T7.esm.js} +1 -1
- package/dist/{curpValidationStateMachine-BQ8XK2Y3.esm.js → curpValidationStateMachine-CgUNfRaR.esm.js} +8 -3
- package/dist/custom-fields.esm.js +1 -1
- package/dist/{customFieldsManager-BRqSCR9R.esm.js → customFieldsManager-BQePQpNk.esm.js} +8 -10
- package/dist/{deepsightLoader-CAx598dT.esm.js → deepsightLoader-Dl7B0eeQ.esm.js} +3 -3
- package/dist/document-capture.d.ts +1 -1
- package/dist/{documentCaptureManager-BZBmcOKI.d.ts → documentCaptureManager-Cs6iJJ_T.d.ts} +5 -5
- package/dist/dynamic-forms.esm.js +2 -2
- package/dist/{dynamicFormsManager-DCvgD3NM.esm.js → dynamicFormsManager-CyhuPTRV.esm.js} +1 -1
- package/dist/{dynamicFormsStateMachine-DfgwjRqH.esm.js → dynamicFormsStateMachine-DJPuqmr0.esm.js} +7 -4
- package/dist/ekyb.esm.js +2 -2
- package/dist/{ekybManager-Bko0uSve.esm.js → ekybManager-C-5mzXHJ.esm.js} +1 -1
- package/dist/{ekybStateMachine-Dh2QeiVL.esm.js → ekybStateMachine-Cseu2q0j.esm.js} +1 -1
- package/dist/ekyc-prefill.d.ts +1 -1
- package/dist/ekyc-prefill.esm.js +2 -2
- package/dist/ekyc.esm.js +2 -2
- package/dist/{ekycManager-nRT0rxei.esm.js → ekycManager-CmgzNQmQ.esm.js} +1 -1
- package/dist/{ekycPrefillManager-GEPxl5VU.esm.js → ekycPrefillManager-CEevGgnk.esm.js} +1 -1
- package/dist/{ekycPrefillManager-BcLhkpp8.d.ts → ekycPrefillManager-CUFTaI8e.d.ts} +30 -30
- package/dist/{ekycPrefillStateMachine-uvDimQw2.esm.js → ekycPrefillStateMachine-CyQMJoRH.esm.js} +2 -2
- package/dist/{ekycRules-DXP2hqVw.esm.js → ekycRules-1hyjJ6bw.esm.js} +7 -4
- package/dist/{ekycStateMachine-nwJRel2s.esm.js → ekycStateMachine-C72Oe1_T.esm.js} +1 -1
- package/dist/electronic-signature.esm.js +1 -1
- package/dist/{electronicSignatureManager-CrNhyWu4.esm.js → electronicSignatureManager-CEOLPWJ5.esm.js} +1 -1
- package/dist/extensibility.d.ts +7 -7
- package/dist/extensibility.esm.js +17 -17
- package/dist/{faceCaptureManagerFactory-BYnWj3Dl.esm.js → faceCaptureManagerFactory-VcuvTFZr.esm.js} +1 -1
- package/dist/{faceCaptureSetup-DODac3ax.esm.js → faceCaptureSetup-BLWPqVmN.esm.js} +3 -3
- package/dist/{feature-management-DgXnJeIf.esm.js → feature-management-C_Mrreiv.esm.js} +1 -1
- package/dist/feature-management.esm.js +1 -1
- package/dist/flow.esm.js +3 -3
- package/dist/{flowCompletionService-B9ustmZu.esm.js → flowCompletionService-BoHW9tIo.esm.js} +1 -1
- package/dist/{flowServices-CRld4kkf.esm.js → flowServices-C4ilAPYa.esm.js} +4 -4
- package/dist/geolocation.d.ts +1 -1
- package/dist/geolocation.esm.js +2 -2
- package/dist/{geolocationManager-CHm7AVPP.esm.js → geolocationManager-Bu0QAfIz.esm.js} +1 -1
- package/dist/{geolocationManager-CENrvxpK.d.ts → geolocationManager-Del2ddmt.d.ts} +1 -1
- package/dist/{geolocationStateMachine-CWXQPhdZ.esm.js → geolocationStateMachine-Bt5oEFcO.esm.js} +1 -1
- package/dist/id-ocr.d.ts +1 -1
- package/dist/id-ocr.esm.js +2 -2
- package/dist/id-selfie-flow.esm.js +6 -6
- package/dist/id.esm.js +3 -3
- package/dist/{idCaptureManager-UKvCqd__.esm.js → idCaptureManager-avinoVFq.esm.js} +3 -3
- package/dist/{idCaptureServices-BRjUnwN9.esm.js → idCaptureServices-C3qNxso4.esm.js} +2 -2
- package/dist/{idCaptureStateMachine-CkadfO_u.esm.js → idCaptureStateMachine-BayI6iu8.esm.js} +8 -8
- package/dist/{idOcrManager-im7VfJQi.esm.js → idOcrManager-TyU_UwSz.esm.js} +1 -1
- package/dist/{idOcrManager-DflRx-_u.d.ts → idOcrManager-voLpv_jJ.d.ts} +1 -1
- package/dist/{idOcrStateMachine-B832arAl.esm.js → idOcrStateMachine-Bjk_SV6h.esm.js} +7 -0
- package/dist/identity-reuse.d.ts +1 -1
- package/dist/{identityReuseManager-CZ-qJ_Aa.d.ts → identityReuseManager-D_jiHp1n.d.ts} +4 -4
- package/dist/index.esm.js +1 -1
- package/dist/kyb-checks.esm.js +2 -2
- package/dist/{kybChecksManager-MUhCAPqf.esm.js → kybChecksManager-D8HIczp0.esm.js} +1 -1
- package/dist/{kybChecksStateMachine-DBy9ZQ0w.esm.js → kybChecksStateMachine-Ba2H0VqB.esm.js} +1 -1
- package/dist/mandatory-consent.d.ts +1 -1
- package/dist/{mandatoryConsentManager-DszYRM5U.d.ts → mandatoryConsentManager-DanZLRn3.d.ts} +8 -8
- package/dist/qe-signature.esm.js +1 -1
- package/dist/{runChildModule-BJIZb9Ud.esm.js → runChildModule-2wK4TTxA.esm.js} +1 -1
- package/dist/{sdkVersion-D7JHf95f.esm.js → sdkVersion-CumgW6tC.esm.js} +1 -1
- package/dist/selfie.esm.js +6 -6
- package/dist/{selfieErrorUtils-DHkfkwwr.esm.js → selfieErrorUtils-CjFjJVXW.esm.js} +1 -1
- package/dist/{selfieManager-CS_MXb7-.esm.js → selfieManager-CQY8VkVe.esm.js} +3 -3
- package/dist/{selfieStateMachine-DCsYEHCR.esm.js → selfieStateMachine-BrJD5L-G.esm.js} +3 -3
- package/dist/{session-DIJHnuWM.esm.js → session-D3uKAAaT.esm.js} +3 -3
- package/dist/session.esm.js +4 -4
- package/dist/{sessionInitializer-AORXxhvP.esm.js → sessionInitializer-eFUOtIdq.esm.js} +3 -3
- package/dist/{setup-BsUYZ5BQ.esm.js → setup-CNR39VJP.esm.js} +4 -4
- package/dist/{trueSightService-CoUZOwrU.esm.js → trueSightService-DrGbuaNH.esm.js} +1 -1
- package/dist/video-selfie.esm.js +3 -3
- package/dist/{videoSelfieCameraWarmer-Cnq1RW9_.esm.js → videoSelfieCameraWarmer-CfQFzYSZ.esm.js} +3 -3
- package/dist/wasm.esm.js +1 -1
- package/dist/watchlist-for-business.esm.js +2 -2
- package/dist/{watchlistForBusinessManager-BH6M4kqA.esm.js → watchlistForBusinessManager-Bd7Vm2Fr.esm.js} +1 -1
- package/dist/{watchlistForBusinessStateMachine-BMWm5mcP.esm.js → watchlistForBusinessStateMachine-B6GOpt-D.esm.js} +7 -2
- package/dist/workflow.esm.js +19 -19
- package/package.json +3 -3
package/dist/{FaceDetectionProvider-DtWTzhdl.esm.js → FaceDetectionProvider-CNu-TWXu.esm.js}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { l as wasmRuntime } from "./warmup-BZOMg303.esm.js";
|
|
2
|
-
import { t as ensureWasmPipelines } from "./setup-
|
|
2
|
+
import { t as ensureWasmPipelines } from "./setup-CNR39VJP.esm.js";
|
|
3
3
|
import { r as BaseWasmProvider } from "./WasmUtilProvider-0xTxgP0R.esm.js";
|
|
4
4
|
import { t as api, u as endpoints } from "./api-CZpuJuZl.esm.js";
|
|
5
|
-
import { l as trueSightHintTransition, r as noteTrueSightCaptureActivity } from "./trueSightService-
|
|
6
|
-
import "./sessionInitializer-
|
|
5
|
+
import { l as trueSightHintTransition, r as noteTrueSightCaptureActivity } from "./trueSightService-DrGbuaNH.esm.js";
|
|
6
|
+
import "./sessionInitializer-eFUOtIdq.esm.js";
|
|
7
7
|
import { t as addDeviceStats } from "./stats-DoByUnTa.esm.js";
|
|
8
8
|
import { t as IncodeCanvas } from "./canvas-BxFzWTt-.esm.js";
|
|
9
9
|
import { t as StreamCanvasProcessingSession } from "./StreamCanvasProcessingSession-CBnbTnOr.esm.js";
|
|
@@ -235,7 +235,7 @@ function startDetection(params) {
|
|
|
235
235
|
};
|
|
236
236
|
}
|
|
237
237
|
async function initializeDeepsightSession(options) {
|
|
238
|
-
const { loadDeepsightSession } = await import("./deepsightLoader-
|
|
238
|
+
const { loadDeepsightSession } = await import("./deepsightLoader-Dl7B0eeQ.esm.js");
|
|
239
239
|
return loadDeepsightSession({
|
|
240
240
|
ds: options.ds,
|
|
241
241
|
storage: options.storage
|
package/dist/ae-signature.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as areAllConsented, i as AE_CONSENT_KEYS, r as electronicSignatureMachine, t as createElectronicSignatureManager, u as getDefaultConsentChecks } from "./electronicSignatureManager-
|
|
1
|
+
import { c as areAllConsented, i as AE_CONSENT_KEYS, r as electronicSignatureMachine, t as createElectronicSignatureManager, u as getDefaultConsentChecks } from "./electronicSignatureManager-CEOLPWJ5.esm.js";
|
|
2
2
|
//#region src/modules/ae-signature/index.ts
|
|
3
3
|
function createAeSignatureManager(options) {
|
|
4
4
|
return createElectronicSignatureManager({ config: {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as authenticationMachine } from "./authenticationStateMachine-
|
|
2
|
-
import { r as createAuthenticationActor, t as createAuthenticationManager } from "./authenticationManager-
|
|
1
|
+
import { t as authenticationMachine } from "./authenticationStateMachine-BmtndZRs.esm.js";
|
|
2
|
+
import { r as createAuthenticationActor, t as createAuthenticationManager } from "./authenticationManager-CAZNsfpV.esm.js";
|
|
3
3
|
export { authenticationMachine, createAuthenticationActor, createAuthenticationManager };
|
package/dist/{authenticationManager-CZp8XZJY.esm.js → authenticationManager-CAZNsfpV.esm.js}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { u as BrowserStorageProvider } from "./setup-
|
|
1
|
+
import { u as BrowserStorageProvider } from "./setup-CNR39VJP.esm.js";
|
|
2
2
|
import { t as WasmUtilProvider } from "./WasmUtilProvider-0xTxgP0R.esm.js";
|
|
3
3
|
import { n as eventModuleNames } from "./types-DYYMdAGv.esm.js";
|
|
4
4
|
import "./events-CP3yOzAl.esm.js";
|
|
5
5
|
import { s as createActor } from "./xstate.esm-CIqUf_i6.esm.js";
|
|
6
|
-
import { t as createFaceCaptureManagerFromActor } from "./faceCaptureManagerFactory-
|
|
7
|
-
import { t as authenticationMachine } from "./authenticationStateMachine-
|
|
6
|
+
import { t as createFaceCaptureManagerFromActor } from "./faceCaptureManagerFactory-VcuvTFZr.esm.js";
|
|
7
|
+
import { t as authenticationMachine } from "./authenticationStateMachine-BmtndZRs.esm.js";
|
|
8
8
|
//#region src/modules/authentication/authenticationActor.ts
|
|
9
9
|
function createAuthenticationActor(options) {
|
|
10
10
|
const dependencies = options.dependencies ?? {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as assign } from "./xstate.esm-CIqUf_i6.esm.js";
|
|
2
2
|
import { n as fromPromise } from "./xstate-actors.esm-BCcwgosu.esm.js";
|
|
3
|
-
import { n as createDefaultProtectedFaceControllerActor, t as faceCaptureMachine } from "./faceCaptureSetup-
|
|
4
|
-
import { d as isOnDeviceMode, u as FACE_ERROR_CODES } from "./FaceDetectionProvider-
|
|
3
|
+
import { n as createDefaultProtectedFaceControllerActor, t as faceCaptureMachine } from "./faceCaptureSetup-BLWPqVmN.esm.js";
|
|
4
|
+
import { d as isOnDeviceMode, u as FACE_ERROR_CODES } from "./FaceDetectionProvider-CNu-TWXu.esm.js";
|
|
5
5
|
import { s as PROTECTED_CAPTURE_TARGET } from "./desktopCameraElection-BKFjsQpO.esm.js";
|
|
6
6
|
//#region src/modules/authentication/authenticationErrorUtils.ts
|
|
7
7
|
const AUTH_ERROR_MAP = {
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
//#region src/internal/forms/checks/calendarDate.ts
|
|
2
|
+
const ISO_DATE = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
3
|
+
const DAYS = [
|
|
4
|
+
31,
|
|
5
|
+
28,
|
|
6
|
+
31,
|
|
7
|
+
30,
|
|
8
|
+
31,
|
|
9
|
+
30,
|
|
10
|
+
31,
|
|
11
|
+
31,
|
|
12
|
+
30,
|
|
13
|
+
31,
|
|
14
|
+
30,
|
|
15
|
+
31
|
|
16
|
+
];
|
|
17
|
+
const INVALID_DATE_ERROR_KEY = "validation.invalidDate";
|
|
18
|
+
/** An ISO date that exists in the Gregorian calendar. */
|
|
19
|
+
function isCalendarDate(value) {
|
|
20
|
+
const match = ISO_DATE.exec(value);
|
|
21
|
+
if (!match) return false;
|
|
22
|
+
const year = Number(match[1]);
|
|
23
|
+
const month = Number(match[2]);
|
|
24
|
+
const day = Number(match[3]);
|
|
25
|
+
if (year < 1 || month < 1 || month > 12 || day < 1) return false;
|
|
26
|
+
const leap = year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
|
|
27
|
+
return day <= (month === 2 && leap ? 29 : DAYS[month - 1] ?? 0);
|
|
28
|
+
}
|
|
29
|
+
/** Leaves required checks and whitespace normalization to the caller. */
|
|
30
|
+
function calendarDateError(value) {
|
|
31
|
+
if (value === void 0 || value === "") return void 0;
|
|
32
|
+
return typeof value === "string" && isCalendarDate(value) ? void 0 : INVALID_DATE_ERROR_KEY;
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
export { calendarDateError as n, INVALID_DATE_ERROR_KEY as t };
|
package/dist/consent.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as ConsentActor, c as ConsentConfig, i as createConsentManagerFromActor, n as ConsentState, o as consentMachine, r as createConsentManager, s as ConsentCheckbox, t as ConsentManager } from "./consentManager-
|
|
1
|
+
import { a as ConsentActor, c as ConsentConfig, i as createConsentManagerFromActor, n as ConsentState, o as consentMachine, r as createConsentManager, s as ConsentCheckbox, t as ConsentManager } from "./consentManager-CMed_O5F.js";
|
|
2
2
|
export { type ConsentActor, type ConsentCheckbox, type ConsentConfig, type ConsentManager, type ConsentState, consentMachine, createConsentManager, createConsentManagerFromActor };
|
|
@@ -75,20 +75,16 @@ declare const consentMachine: StateMachine<ConsentContext, {
|
|
|
75
75
|
id: string | undefined;
|
|
76
76
|
};
|
|
77
77
|
}>, Values<{
|
|
78
|
-
setError: {
|
|
79
|
-
type: "setError";
|
|
80
|
-
params: NonReducibleUnknown;
|
|
81
|
-
};
|
|
82
78
|
clearError: {
|
|
83
79
|
type: "clearError";
|
|
84
80
|
params: NonReducibleUnknown;
|
|
85
81
|
};
|
|
86
|
-
|
|
87
|
-
type: "
|
|
82
|
+
setError: {
|
|
83
|
+
type: "setError";
|
|
88
84
|
params: NonReducibleUnknown;
|
|
89
85
|
};
|
|
90
|
-
|
|
91
|
-
type: "
|
|
86
|
+
setLoadError: {
|
|
87
|
+
type: "setLoadError";
|
|
92
88
|
params: NonReducibleUnknown;
|
|
93
89
|
};
|
|
94
90
|
setConsentData: {
|
|
@@ -99,6 +95,10 @@ declare const consentMachine: StateMachine<ConsentContext, {
|
|
|
99
95
|
type: "toggleCheckbox";
|
|
100
96
|
params: NonReducibleUnknown;
|
|
101
97
|
};
|
|
98
|
+
resetContext: {
|
|
99
|
+
type: "resetContext";
|
|
100
|
+
params: NonReducibleUnknown;
|
|
101
|
+
};
|
|
102
102
|
}>, {
|
|
103
103
|
type: "canSubmit";
|
|
104
104
|
params: unknown;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { i as mexicanStates, n as ENTER_CURP_FIELD, r as GENERATE_CURP_FIELDS, t as curpValidationMachine } from "./curpValidationStateMachine-
|
|
2
|
-
import { n as createCurpValidationManagerFromActor, t as createCurpValidationManager } from "./curpValidationManager-
|
|
1
|
+
import { i as mexicanStates, n as ENTER_CURP_FIELD, r as GENERATE_CURP_FIELDS, t as curpValidationMachine } from "./curpValidationStateMachine-CgUNfRaR.esm.js";
|
|
2
|
+
import { n as createCurpValidationManagerFromActor, t as createCurpValidationManager } from "./curpValidationManager-BuA6p_T7.esm.js";
|
|
3
3
|
export { ENTER_CURP_FIELD, GENERATE_CURP_FIELDS, createCurpValidationManager, createCurpValidationManagerFromActor, curpValidationMachine, mexicanStates };
|
package/dist/{curpValidationManager-CbvBDoE1.esm.js → curpValidationManager-BuA6p_T7.esm.js}
RENAMED
|
@@ -4,7 +4,7 @@ import { t as topLevelStateName } from "./topLevelStateName-B5i2avbh.esm.js";
|
|
|
4
4
|
import { t as createManager } from "./Manager-BvXAwDv9.esm.js";
|
|
5
5
|
import { s as createActor } from "./xstate.esm-CIqUf_i6.esm.js";
|
|
6
6
|
import { t as isValidCurp } from "./curp-DZGvefg3.esm.js";
|
|
7
|
-
import { r as GENERATE_CURP_FIELDS, t as curpValidationMachine } from "./curpValidationStateMachine-
|
|
7
|
+
import { r as GENERATE_CURP_FIELDS, t as curpValidationMachine } from "./curpValidationStateMachine-CgUNfRaR.esm.js";
|
|
8
8
|
//#region src/modules/curp-validation/curpValidationActor.ts
|
|
9
9
|
function createCurpValidationActor(options) {
|
|
10
10
|
return createActor(curpValidationMachine, { input: { config: options.config } }).start();
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { t as getLocalIsoDate } from "./IBrowserEnvironmentCapability-D7JG7ML3.esm.js";
|
|
1
2
|
import { t as api, u as endpoints } from "./api-CZpuJuZl.esm.js";
|
|
2
3
|
import { i as assign, t as setup } from "./xstate.esm-CIqUf_i6.esm.js";
|
|
3
4
|
import { n as fromPromise } from "./xstate-actors.esm-BCcwgosu.esm.js";
|
|
4
5
|
import { t as carryAttempts } from "./attemptCarry-BecGGZK8.esm.js";
|
|
5
6
|
import { t as isValidCurp } from "./curp-DZGvefg3.esm.js";
|
|
7
|
+
import { n as calendarDateError } from "./calendarDate-DcqGuEht.esm.js";
|
|
6
8
|
//#region src/modules/curp-validation/curpValidationUtils.ts
|
|
7
9
|
/** Convert YYYY-MM-DD to DD/MM/YYYY for the API */
|
|
8
10
|
function formatDateForApi(date) {
|
|
@@ -257,7 +259,10 @@ const createValidators = () => ({
|
|
|
257
259
|
}
|
|
258
260
|
});
|
|
259
261
|
const normalizeFieldValue = (value) => typeof value === "string" ? value : String(value ?? "");
|
|
260
|
-
const evaluateRules = (value, validation, validators) => {
|
|
262
|
+
const evaluateRules = (value, validation, validators, type) => {
|
|
263
|
+
const dateError = type === "date" ? calendarDateError(value.trim()) : void 0;
|
|
264
|
+
if (dateError) return dateError;
|
|
265
|
+
if (type === "date" && value.trim() > getLocalIsoDate()) return "verification.errors.futureDate";
|
|
261
266
|
if (!validation) return void 0;
|
|
262
267
|
for (const rule of validation) {
|
|
263
268
|
const error = validators[rule.type](value);
|
|
@@ -273,7 +278,7 @@ const validateGenerateCurpForm = (data, fields) => {
|
|
|
273
278
|
const validators = createValidators();
|
|
274
279
|
return fields.reduce((errors, field) => {
|
|
275
280
|
const value = normalizeFieldValue(data[field.key]);
|
|
276
|
-
const error = evaluateRules(value, field.validation, validators);
|
|
281
|
+
const error = evaluateRules(value, field.validation, validators, field.type);
|
|
277
282
|
if (error) errors[field.key] = error;
|
|
278
283
|
return errors;
|
|
279
284
|
}, {});
|
|
@@ -287,7 +292,7 @@ const validateGenerateCurpField = (data, fieldKey, fields) => {
|
|
|
287
292
|
if (!field) return void 0;
|
|
288
293
|
const validators = createValidators();
|
|
289
294
|
const value = normalizeFieldValue(data[fieldKey]);
|
|
290
|
-
return evaluateRules(value, field.validation, validators);
|
|
295
|
+
return evaluateRules(value, field.validation, validators, field.type);
|
|
291
296
|
};
|
|
292
297
|
/**
|
|
293
298
|
* Runs the single CURP-entry field through its validation rules.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as createCustomFieldsManagerFromActor, r as customFieldsMachine, t as createCustomFieldsManager } from "./customFieldsManager-
|
|
1
|
+
import { n as createCustomFieldsManagerFromActor, r as customFieldsMachine, t as createCustomFieldsManager } from "./customFieldsManager-BQePQpNk.esm.js";
|
|
2
2
|
export { createCustomFieldsManager, createCustomFieldsManagerFromActor, customFieldsMachine };
|
|
@@ -5,6 +5,7 @@ import { t as topLevelStateName } from "./topLevelStateName-B5i2avbh.esm.js";
|
|
|
5
5
|
import { t as createManager } from "./Manager-BvXAwDv9.esm.js";
|
|
6
6
|
import { i as assign, s as createActor, t as setup } from "./xstate.esm-CIqUf_i6.esm.js";
|
|
7
7
|
import { n as fromPromise } from "./xstate-actors.esm-BCcwgosu.esm.js";
|
|
8
|
+
import { n as calendarDateError } from "./calendarDate-DcqGuEht.esm.js";
|
|
8
9
|
import { t as isoDateToMs } from "./dateUtils-CvG0FvK8.esm.js";
|
|
9
10
|
//#region src/modules/custom-fields/customFieldsServices.ts
|
|
10
11
|
async function submitCustomFields(params, signal) {
|
|
@@ -21,19 +22,16 @@ function transformFields(fields, customFields) {
|
|
|
21
22
|
else result[key] = value;
|
|
22
23
|
return result;
|
|
23
24
|
}
|
|
24
|
-
function
|
|
25
|
-
return customFields.every((field) => {
|
|
26
|
-
if (field.type === "BOOLEAN") return true;
|
|
27
|
-
const value = fields[field.name];
|
|
28
|
-
return value !== void 0 && value !== "";
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
function validateRequiredFields(fields, customFields) {
|
|
25
|
+
function validateFields(fields, customFields) {
|
|
32
26
|
const errors = {};
|
|
33
27
|
for (const field of customFields) {
|
|
34
28
|
if (field.type === "BOOLEAN") continue;
|
|
35
29
|
const value = fields[field.name];
|
|
36
30
|
if (value === void 0 || value === "") errors[field.name] = REQUIRED_FIELD_ERROR;
|
|
31
|
+
else if (field.type === "DATE") {
|
|
32
|
+
const dateError = calendarDateError(value);
|
|
33
|
+
if (dateError) errors[field.name] = dateError;
|
|
34
|
+
}
|
|
37
35
|
}
|
|
38
36
|
return Object.keys(errors).length > 0 ? errors : void 0;
|
|
39
37
|
}
|
|
@@ -59,13 +57,13 @@ const customFieldsMachine = setup({
|
|
|
59
57
|
validationErrors: Object.keys(validationErrors).length > 0 ? validationErrors : void 0
|
|
60
58
|
};
|
|
61
59
|
}),
|
|
62
|
-
setValidationErrors: assign(({ context }) => ({ validationErrors:
|
|
60
|
+
setValidationErrors: assign(({ context }) => ({ validationErrors: validateFields(context.fields, context.config.customFields) })),
|
|
63
61
|
markSuccess: assign({ result: "success" }),
|
|
64
62
|
markFailed: assign({ result: "failed" })
|
|
65
63
|
},
|
|
66
64
|
guards: {
|
|
67
65
|
apiSucceeded: ({ event }) => event.output.success,
|
|
68
|
-
isFormComplete: ({ context }) =>
|
|
66
|
+
isFormComplete: ({ context }) => validateFields(context.fields, context.config.customFields) === void 0
|
|
69
67
|
}
|
|
70
68
|
}).createMachine({
|
|
71
69
|
id: "customFields",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as WasmUtilProvider } from "./WasmUtilProvider-0xTxgP0R.esm.js";
|
|
2
|
-
import { u as trueSightLog } from "./trueSightService-
|
|
3
|
-
import { t as SDK_VERSION } from "./sdkVersion-
|
|
4
|
-
import { C as BrowserEnvironmentProvider, S as IpifyProvider, T as SDK_PLATFORM, b as getThumbmarkId, n as getDisableIpify, r as getFingerprintEnabled, v as isBrowserSimulation, w as fingerprintSignalsReporter } from "./sessionInitializer-
|
|
2
|
+
import { u as trueSightLog } from "./trueSightService-DrGbuaNH.esm.js";
|
|
3
|
+
import { t as SDK_VERSION } from "./sdkVersion-CumgW6tC.esm.js";
|
|
4
|
+
import { C as BrowserEnvironmentProvider, S as IpifyProvider, T as SDK_PLATFORM, b as getThumbmarkId, n as getDisableIpify, r as getFingerprintEnabled, v as isBrowserSimulation, w as fingerprintSignalsReporter } from "./sessionInitializer-eFUOtIdq.esm.js";
|
|
5
5
|
import { t as getParsedUserAgent } from "./getParsedUserAgent-DhQPeKqw.esm.js";
|
|
6
6
|
import { t as getUserAgent } from "./getBrowser-CBiibsL-.esm.js";
|
|
7
7
|
import { t as setWasmDsFlagSync } from "./wasmDsFlagSync-DPK7qGgo.esm.js";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { a as DocumentCaptureErrorCode, c as DocumentType, n as DOCUMENT_CAPTURE_ERROR_CODES, r as DocumentCaptureConfig, s as DocumentCaptureNextPageType, u as DocumentUploadStatus } from "./types-CyNndVAT.js";
|
|
2
|
-
import { a as DocumentCaptureActor, i as createDocumentCaptureManagerFromActor, n as DocumentCaptureState, o as documentCaptureMachine, r as createDocumentCaptureManager, t as DocumentCaptureManager } from "./documentCaptureManager-
|
|
2
|
+
import { a as DocumentCaptureActor, i as createDocumentCaptureManagerFromActor, n as DocumentCaptureState, o as documentCaptureMachine, r as createDocumentCaptureManager, t as DocumentCaptureManager } from "./documentCaptureManager-Cs6iJJ_T.js";
|
|
3
3
|
export { DOCUMENT_CAPTURE_ERROR_CODES, type DocumentCaptureActor, type DocumentCaptureConfig, type DocumentCaptureErrorCode, type DocumentCaptureManager, type DocumentCaptureNextPageType, type DocumentCaptureState, type DocumentType, type DocumentUploadStatus, createDocumentCaptureManager, createDocumentCaptureManagerFromActor, documentCaptureMachine };
|
|
@@ -102,14 +102,14 @@ declare const documentCaptureMachine: StateMachine<DocumentCaptureContext, {
|
|
|
102
102
|
id: string | undefined;
|
|
103
103
|
};
|
|
104
104
|
}>, Values<{
|
|
105
|
-
decrementAttemptsRemaining: {
|
|
106
|
-
type: "decrementAttemptsRemaining";
|
|
107
|
-
params: NonReducibleUnknown;
|
|
108
|
-
};
|
|
109
105
|
clearError: {
|
|
110
106
|
type: "clearError";
|
|
111
107
|
params: NonReducibleUnknown;
|
|
112
108
|
};
|
|
109
|
+
decrementAttemptsRemaining: {
|
|
110
|
+
type: "decrementAttemptsRemaining";
|
|
111
|
+
params: NonReducibleUnknown;
|
|
112
|
+
};
|
|
113
113
|
setStream: {
|
|
114
114
|
type: "setStream";
|
|
115
115
|
params: NonReducibleUnknown;
|
|
@@ -263,7 +263,7 @@ declare const documentCaptureMachine: StateMachine<DocumentCaptureContext, {
|
|
|
263
263
|
type: "fileSizeOkForNonGallery";
|
|
264
264
|
params: unknown;
|
|
265
265
|
};
|
|
266
|
-
}>, never, "uploading" | "closed" | "success" | "finished" | "
|
|
266
|
+
}>, never, "uploading" | "closed" | "success" | "finished" | "capturing" | "failure" | "initCamera" | "tutorial" | "preview" | "nextPage" | "finalizing" | {
|
|
267
267
|
permissions: "idle" | "denied" | "waitingForUser" | "requesting" | "learnMore";
|
|
268
268
|
}, string, DocumentCaptureInput, NonReducibleUnknown, EventObject, MetaObject, {
|
|
269
269
|
readonly id: "documentCapture";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as dynamicFormsMachine } from "./dynamicFormsStateMachine-
|
|
2
|
-
import { t as createDynamicFormsManager } from "./dynamicFormsManager-
|
|
1
|
+
import { t as dynamicFormsMachine } from "./dynamicFormsStateMachine-DJPuqmr0.esm.js";
|
|
2
|
+
import { t as createDynamicFormsManager } from "./dynamicFormsManager-CyhuPTRV.esm.js";
|
|
3
3
|
export { createDynamicFormsManager, dynamicFormsMachine };
|
|
@@ -3,7 +3,7 @@ import { t as createManagerInstrumentation } from "./events-CP3yOzAl.esm.js";
|
|
|
3
3
|
import { t as topLevelStateName } from "./topLevelStateName-B5i2avbh.esm.js";
|
|
4
4
|
import { t as createManager } from "./Manager-BvXAwDv9.esm.js";
|
|
5
5
|
import { s as createActor } from "./xstate.esm-CIqUf_i6.esm.js";
|
|
6
|
-
import { t as dynamicFormsMachine } from "./dynamicFormsStateMachine-
|
|
6
|
+
import { t as dynamicFormsMachine } from "./dynamicFormsStateMachine-DJPuqmr0.esm.js";
|
|
7
7
|
//#region src/modules/dynamic-forms/dynamicFormsActor.ts
|
|
8
8
|
function createDynamicFormsActor(options) {
|
|
9
9
|
return createActor(dynamicFormsMachine, { input: { config: options.config } }).start();
|
package/dist/{dynamicFormsStateMachine-DfgwjRqH.esm.js → dynamicFormsStateMachine-DJPuqmr0.esm.js}
RENAMED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { t as api, u as endpoints } from "./api-CZpuJuZl.esm.js";
|
|
2
|
-
import { i as toIncodeApiError, r as isServerError, t as IncodeApiError } from "./apiError-
|
|
2
|
+
import { i as toIncodeApiError, r as isServerError, t as IncodeApiError } from "./apiError-CDvhOvoO.esm.js";
|
|
3
3
|
import { i as assign, t as setup } from "./xstate.esm-CIqUf_i6.esm.js";
|
|
4
4
|
import { n as fromPromise } from "./xstate-actors.esm-BCcwgosu.esm.js";
|
|
5
|
+
import { n as calendarDateError } from "./calendarDate-DcqGuEht.esm.js";
|
|
5
6
|
import { t as isoDateToMs } from "./dateUtils-CvG0FvK8.esm.js";
|
|
6
7
|
//#region src/modules/dynamic-forms/dynamicFormsFields.ts
|
|
7
8
|
function getEffectiveType(question) {
|
|
@@ -38,7 +39,9 @@ const VALIDATORS = {
|
|
|
38
39
|
formatViaAnswerValidity: ({ questionId, answerValidity }, rule) => answerValidity[questionId] === false ? rule.errorKey : void 0
|
|
39
40
|
};
|
|
40
41
|
const normalizeValue = (value) => typeof value === "string" ? value : String(value ?? "");
|
|
41
|
-
function evaluateRules(input, rules) {
|
|
42
|
+
function evaluateRules(input, rules, inputType) {
|
|
43
|
+
const dateError = inputType === "DATE" ? calendarDateError(input.value.trim()) : void 0;
|
|
44
|
+
if (dateError) return dateError;
|
|
42
45
|
for (const rule of rules) {
|
|
43
46
|
const error = rule.type === "required" ? VALIDATORS.required(input) : VALIDATORS.formatViaAnswerValidity(input, rule);
|
|
44
47
|
if (error) return error;
|
|
@@ -51,7 +54,7 @@ function validateScreenForm(answers, fields, answerValidity) {
|
|
|
51
54
|
value: normalizeValue(answers[field.questionId]),
|
|
52
55
|
questionId: field.questionId,
|
|
53
56
|
answerValidity
|
|
54
|
-
}, field.validation);
|
|
57
|
+
}, field.validation, field.inputType);
|
|
55
58
|
if (error) errors[field.questionId] = error;
|
|
56
59
|
return errors;
|
|
57
60
|
}, {});
|
|
@@ -64,7 +67,7 @@ function validateScreenField(answers, questionId, fields, answerValidity) {
|
|
|
64
67
|
value: normalizeValue(answers[questionId]),
|
|
65
68
|
questionId,
|
|
66
69
|
answerValidity
|
|
67
|
-
}, field.validation);
|
|
70
|
+
}, field.validation, field.inputType);
|
|
68
71
|
}
|
|
69
72
|
//#endregion
|
|
70
73
|
//#region src/modules/dynamic-forms/dynamicFormsServices.ts
|
package/dist/ekyb.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { c as ALL_COUNTRIES, f as SUPPORTED_COUNTRIES, l as DEV_ONLY_COUNTRIES, m as isSupportedCountry, o as toEkybConfig } from "./ekybUtils-Cw8Ta9Qi.esm.js";
|
|
2
|
-
import { t as ekybMachine } from "./ekybStateMachine-
|
|
3
|
-
import { t as createEkybManager } from "./ekybManager-
|
|
2
|
+
import { t as ekybMachine } from "./ekybStateMachine-Cseu2q0j.esm.js";
|
|
3
|
+
import { t as createEkybManager } from "./ekybManager-C-5mzXHJ.esm.js";
|
|
4
4
|
export { ALL_COUNTRIES, DEV_ONLY_COUNTRIES, SUPPORTED_COUNTRIES, createEkybManager, ekybMachine, isSupportedCountry, toEkybConfig };
|
|
@@ -3,7 +3,7 @@ import { t as createManagerInstrumentation } from "./events-CP3yOzAl.esm.js";
|
|
|
3
3
|
import { t as topLevelStateName } from "./topLevelStateName-B5i2avbh.esm.js";
|
|
4
4
|
import { t as createManager } from "./Manager-BvXAwDv9.esm.js";
|
|
5
5
|
import { s as createActor } from "./xstate.esm-CIqUf_i6.esm.js";
|
|
6
|
-
import { t as ekybMachine } from "./ekybStateMachine-
|
|
6
|
+
import { t as ekybMachine } from "./ekybStateMachine-Cseu2q0j.esm.js";
|
|
7
7
|
//#region src/modules/ekyb/ekybActor.ts
|
|
8
8
|
/**
|
|
9
9
|
* Creates and starts an eKYB actor.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as api, u as endpoints } from "./api-CZpuJuZl.esm.js";
|
|
2
|
-
import { n as getFlow } from "./flowServices-
|
|
2
|
+
import { n as getFlow } from "./flowServices-C4ilAPYa.esm.js";
|
|
3
3
|
import { i as assign, t as setup } from "./xstate.esm-CIqUf_i6.esm.js";
|
|
4
4
|
import { n as fromPromise } from "./xstate-actors.esm-BCcwgosu.esm.js";
|
|
5
5
|
import { a as sortModulesByOrder, c as ALL_COUNTRIES, d as FIELD_ORDER, i as requiresAddressValidation, m as isSupportedCountry, n as hasAtLeastOneAddressField, o as toEkybConfig, p as UBO_FIELD_LABELS, r as isFieldOptional, s as ADDRESS_FIELDS, u as FIELD_NAME_MAPPING } from "./ekybUtils-Cw8Ta9Qi.esm.js";
|
package/dist/ekyc-prefill.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as EkycFormValues, c as EkycValidationErrors, s as EkycValidationError } from "./types-DEa3taWc.js";
|
|
2
2
|
import { a as EkycPrefillFieldDef, c as EkycPrefillModuleConfig, i as EkycPrefillErrorKind, l as EkycPrefillServedField, n as EkycPrefillConfigField, s as EkycPrefillInputFormat, t as EkycPrefillConfig } from "./types-B-PIc0en.js";
|
|
3
|
-
import { a as EkycPrefillFormState, c as EkycPrefillManager, d as EkycPrefillSubmittingState, f as createEkycPrefillManager, h as ekycPrefillMachine, i as EkycPrefillFinishedState, l as EkycPrefillMisconfiguredState, n as EkycPrefillClosedState, o as EkycPrefillIdleState, r as EkycPrefillErrorState, s as EkycPrefillLimitReachedState, t as EkycPrefillAnyOfState, u as EkycPrefillState } from "./ekycPrefillManager-
|
|
3
|
+
import { a as EkycPrefillFormState, c as EkycPrefillManager, d as EkycPrefillSubmittingState, f as createEkycPrefillManager, h as ekycPrefillMachine, i as EkycPrefillFinishedState, l as EkycPrefillMisconfiguredState, n as EkycPrefillClosedState, o as EkycPrefillIdleState, r as EkycPrefillErrorState, s as EkycPrefillLimitReachedState, t as EkycPrefillAnyOfState, u as EkycPrefillState } from "./ekycPrefillManager-CUFTaI8e.js";
|
|
4
4
|
//#region src/modules/ekyc-prefill/ekycPrefillConfig.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Normalizes the served `EKYC_PREFILL` configuration. Idempotent, so a
|
package/dist/ekyc-prefill.esm.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { i as toEkycPrefillConfig, t as ekycPrefillMachine } from "./ekycPrefillStateMachine-
|
|
2
|
-
import { t as createEkycPrefillManager } from "./ekycPrefillManager-
|
|
1
|
+
import { i as toEkycPrefillConfig, t as ekycPrefillMachine } from "./ekycPrefillStateMachine-CyQMJoRH.esm.js";
|
|
2
|
+
import { t as createEkycPrefillManager } from "./ekycPrefillManager-CEevGgnk.esm.js";
|
|
3
3
|
export { createEkycPrefillManager, ekycPrefillMachine, toEkycPrefillConfig };
|
package/dist/ekyc.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as ekycMachine } from "./ekycStateMachine-
|
|
1
|
+
import { t as ekycMachine } from "./ekycStateMachine-C72Oe1_T.esm.js";
|
|
2
2
|
import { l as toEkycConfig } from "./ekycUtils-FcqA6oU4.esm.js";
|
|
3
|
-
import { t as createEkycManager } from "./ekycManager-
|
|
3
|
+
import { t as createEkycManager } from "./ekycManager-CmgzNQmQ.esm.js";
|
|
4
4
|
export { createEkycManager, ekycMachine, toEkycConfig };
|
|
@@ -3,7 +3,7 @@ import { t as createManagerInstrumentation } from "./events-CP3yOzAl.esm.js";
|
|
|
3
3
|
import { t as topLevelStateName } from "./topLevelStateName-B5i2avbh.esm.js";
|
|
4
4
|
import { t as createManager } from "./Manager-BvXAwDv9.esm.js";
|
|
5
5
|
import { s as createActor } from "./xstate.esm-CIqUf_i6.esm.js";
|
|
6
|
-
import { i as isStepValid, n as buildEkycSteps, r as clampStepIndex, t as ekycMachine } from "./ekycStateMachine-
|
|
6
|
+
import { i as isStepValid, n as buildEkycSteps, r as clampStepIndex, t as ekycMachine } from "./ekycStateMachine-C72Oe1_T.esm.js";
|
|
7
7
|
//#region src/modules/ekyc/ekycActor.ts
|
|
8
8
|
/**
|
|
9
9
|
* Creates and starts an eKYC actor.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as createManager } from "./Manager-BvXAwDv9.esm.js";
|
|
2
2
|
import { s as createActor } from "./xstate.esm-CIqUf_i6.esm.js";
|
|
3
|
-
import { n as isAnyOfMissing, r as validateForm, t as ekycPrefillMachine } from "./ekycPrefillStateMachine-
|
|
3
|
+
import { n as isAnyOfMissing, r as validateForm, t as ekycPrefillMachine } from "./ekycPrefillStateMachine-CyQMJoRH.esm.js";
|
|
4
4
|
//#region src/modules/ekyc-prefill/ekycPrefillActor.ts
|
|
5
5
|
/** Creates and starts an eKYC Pre-fill actor, idle until `LOAD`. */
|
|
6
6
|
function createEkycPrefillActor(options = {}) {
|
|
@@ -28,15 +28,10 @@ declare const ekycPrefillMachine: StateMachine<EkycPrefillContext, {
|
|
|
28
28
|
} | {
|
|
29
29
|
type: "CLOSE";
|
|
30
30
|
}, {
|
|
31
|
-
[x: string]: ActorRefFromLogic<PromiseActorLogic<
|
|
31
|
+
[x: string]: ActorRefFromLogic<PromiseActorLogic<void, {
|
|
32
32
|
hasPhone: boolean;
|
|
33
|
-
}, EventObject>> | undefined;
|
|
33
|
+
}, EventObject>> | ActorRefFromLogic<PromiseActorLogic<EkycPrefillSubmitResponse, SubmitInput, EventObject>> | undefined;
|
|
34
34
|
}, Values<{
|
|
35
|
-
submit: {
|
|
36
|
-
src: "submit";
|
|
37
|
-
logic: PromiseActorLogic<EkycPrefillSubmitResponse, SubmitInput, EventObject>;
|
|
38
|
-
id: string | undefined;
|
|
39
|
-
};
|
|
40
35
|
loadPhoneRules: {
|
|
41
36
|
src: "loadPhoneRules";
|
|
42
37
|
logic: PromiseActorLogic<void, {
|
|
@@ -44,6 +39,11 @@ declare const ekycPrefillMachine: StateMachine<EkycPrefillContext, {
|
|
|
44
39
|
}, EventObject>;
|
|
45
40
|
id: string | undefined;
|
|
46
41
|
};
|
|
42
|
+
submit: {
|
|
43
|
+
src: "submit";
|
|
44
|
+
logic: PromiseActorLogic<EkycPrefillSubmitResponse, SubmitInput, EventObject>;
|
|
45
|
+
id: string | undefined;
|
|
46
|
+
};
|
|
47
47
|
}>, Values<{
|
|
48
48
|
applyForm: {
|
|
49
49
|
type: "applyForm";
|
|
@@ -82,10 +82,6 @@ declare const ekycPrefillMachine: StateMachine<EkycPrefillContext, {
|
|
|
82
82
|
params: NonReducibleUnknown;
|
|
83
83
|
};
|
|
84
84
|
}>, Values<{
|
|
85
|
-
isValid: {
|
|
86
|
-
type: "isValid";
|
|
87
|
-
params: unknown;
|
|
88
|
-
};
|
|
89
85
|
phoneRulesFailed: {
|
|
90
86
|
type: "phoneRulesFailed";
|
|
91
87
|
params: unknown;
|
|
@@ -98,6 +94,10 @@ declare const ekycPrefillMachine: StateMachine<EkycPrefillContext, {
|
|
|
98
94
|
type: "canRender";
|
|
99
95
|
params: unknown;
|
|
100
96
|
};
|
|
97
|
+
isValid: {
|
|
98
|
+
type: "isValid";
|
|
99
|
+
params: unknown;
|
|
100
|
+
};
|
|
101
101
|
isBadRequest: {
|
|
102
102
|
type: "isBadRequest";
|
|
103
103
|
params: unknown;
|
|
@@ -110,20 +110,24 @@ declare const ekycPrefillMachine: StateMachine<EkycPrefillContext, {
|
|
|
110
110
|
type: "isLimitReached";
|
|
111
111
|
params: unknown;
|
|
112
112
|
};
|
|
113
|
-
}>, never, "error" | "idle" | "closed" | "finished" | "
|
|
113
|
+
}>, never, "error" | "idle" | "closed" | "finished" | "misconfigured" | "submitting" | "limitReached" | {
|
|
114
114
|
form: "inputting" | "validating";
|
|
115
115
|
}, string, EkycPrefillInput, NonReducibleUnknown, EventObject, MetaObject, {
|
|
116
116
|
readonly id: "ekycPrefill";
|
|
117
117
|
readonly initial: "idle";
|
|
118
118
|
readonly context: ({ input }: {
|
|
119
119
|
spawn: {
|
|
120
|
-
<TSrc extends "
|
|
121
|
-
src: "
|
|
122
|
-
logic: PromiseActorLogic<
|
|
120
|
+
<TSrc extends "loadPhoneRules" | "submit">(logic: TSrc, ...[options]: ({
|
|
121
|
+
src: "loadPhoneRules";
|
|
122
|
+
logic: PromiseActorLogic<void, {
|
|
123
|
+
hasPhone: boolean;
|
|
124
|
+
}, EventObject>;
|
|
123
125
|
id: string | undefined;
|
|
124
126
|
} extends (infer T) ? T extends {
|
|
125
|
-
src: "
|
|
126
|
-
logic: PromiseActorLogic<
|
|
127
|
+
src: "loadPhoneRules";
|
|
128
|
+
logic: PromiseActorLogic<void, {
|
|
129
|
+
hasPhone: boolean;
|
|
130
|
+
}, EventObject>;
|
|
127
131
|
id: string | undefined;
|
|
128
132
|
} ? T extends {
|
|
129
133
|
src: TSrc;
|
|
@@ -133,16 +137,12 @@ declare const ekycPrefillMachine: StateMachine<EkycPrefillContext, {
|
|
|
133
137
|
input?: InputFrom<T["logic"]> | undefined;
|
|
134
138
|
syncSnapshot?: boolean;
|
|
135
139
|
} & { [K in RequiredActorOptions<T>]: unknown; }) | undefined], IsNotNever<RequiredActorOptions<T>>> : never : never : never) | ({
|
|
136
|
-
src: "
|
|
137
|
-
logic: PromiseActorLogic<
|
|
138
|
-
hasPhone: boolean;
|
|
139
|
-
}, EventObject>;
|
|
140
|
+
src: "submit";
|
|
141
|
+
logic: PromiseActorLogic<EkycPrefillSubmitResponse, SubmitInput, EventObject>;
|
|
140
142
|
id: string | undefined;
|
|
141
143
|
} extends (infer T_1) ? T_1 extends {
|
|
142
|
-
src: "
|
|
143
|
-
logic: PromiseActorLogic<
|
|
144
|
-
hasPhone: boolean;
|
|
145
|
-
}, EventObject>;
|
|
144
|
+
src: "submit";
|
|
145
|
+
logic: PromiseActorLogic<EkycPrefillSubmitResponse, SubmitInput, EventObject>;
|
|
146
146
|
id: string | undefined;
|
|
147
147
|
} ? T_1 extends {
|
|
148
148
|
src: TSrc;
|
|
@@ -152,11 +152,6 @@ declare const ekycPrefillMachine: StateMachine<EkycPrefillContext, {
|
|
|
152
152
|
input?: InputFrom<T_1["logic"]> | undefined;
|
|
153
153
|
syncSnapshot?: boolean;
|
|
154
154
|
} & { [K_1 in RequiredActorOptions<T_1>]: unknown; }) | undefined], IsNotNever<RequiredActorOptions<T_1>>> : never : never : never)): ActorRefFromLogic<GetConcreteByKey<Values<{
|
|
155
|
-
submit: {
|
|
156
|
-
src: "submit";
|
|
157
|
-
logic: PromiseActorLogic<EkycPrefillSubmitResponse, SubmitInput, EventObject>;
|
|
158
|
-
id: string | undefined;
|
|
159
|
-
};
|
|
160
155
|
loadPhoneRules: {
|
|
161
156
|
src: "loadPhoneRules";
|
|
162
157
|
logic: PromiseActorLogic<void, {
|
|
@@ -164,6 +159,11 @@ declare const ekycPrefillMachine: StateMachine<EkycPrefillContext, {
|
|
|
164
159
|
}, EventObject>;
|
|
165
160
|
id: string | undefined;
|
|
166
161
|
};
|
|
162
|
+
submit: {
|
|
163
|
+
src: "submit";
|
|
164
|
+
logic: PromiseActorLogic<EkycPrefillSubmitResponse, SubmitInput, EventObject>;
|
|
165
|
+
id: string | undefined;
|
|
166
|
+
};
|
|
167
167
|
}>, "src", TSrc>["logic"]>;
|
|
168
168
|
<TLogic extends AnyActorLogic>(src: TLogic, ...[options]: ConditionalRequired<[options?: ({
|
|
169
169
|
id?: never;
|
package/dist/{ekycPrefillStateMachine-uvDimQw2.esm.js → ekycPrefillStateMachine-CyQMJoRH.esm.js}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as api, u as endpoints } from "./api-CZpuJuZl.esm.js";
|
|
2
|
-
import { i as toIncodeApiError } from "./apiError-
|
|
2
|
+
import { i as toIncodeApiError } from "./apiError-CDvhOvoO.esm.js";
|
|
3
3
|
import { n as loadPhoneValidation } from "./phoneValidation-OggtfjRt.esm.js";
|
|
4
4
|
import { i as assign, t as setup } from "./xstate.esm-CIqUf_i6.esm.js";
|
|
5
5
|
import { n as fromPromise } from "./xstate-actors.esm-BCcwgosu.esm.js";
|
|
6
|
-
import { i as cleanName, l as validateEkycField, n as projectRules, o as formatSSN } from "./ekycRules-
|
|
6
|
+
import { i as cleanName, l as validateEkycField, n as projectRules, o as formatSSN } from "./ekycRules-1hyjJ6bw.esm.js";
|
|
7
7
|
import { t as createBundledDefinitionSource } from "./definitionSource-Nw0YCbpe.esm.js";
|
|
8
8
|
import { n as checkSupport, t as resolveForm } from "./resolveForm-DaaQSVWp.esm.js";
|
|
9
9
|
import { t as formatPhoneE164 } from "./phoneFormat-C3q0Ukh4.esm.js";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { t as getLocalIsoDate } from "./IBrowserEnvironmentCapability-D7JG7ML3.esm.js";
|
|
2
2
|
import { n as loadPhoneValidation, t as getPhoneValidation } from "./phoneValidation-OggtfjRt.esm.js";
|
|
3
3
|
import { t as isValidCurp } from "./curp-DZGvefg3.esm.js";
|
|
4
|
+
import { n as calendarDateError } from "./calendarDate-DcqGuEht.esm.js";
|
|
4
5
|
import { i as getPostalCodeErrorParams, o as validatePostalCode, r as getPostalCodeErrorKey, s as STREET_LEVEL_REQUIRED_ERROR } from "./definitionSource-Nw0YCbpe.esm.js";
|
|
5
6
|
import { r as DYNAMIC_REQUIRED_KEY } from "./resolveForm-DaaQSVWp.esm.js";
|
|
6
7
|
import { t as validateCPF } from "./cpf-DDXMTLYr.esm.js";
|
|
@@ -160,8 +161,8 @@ function matchesCharTemplate(value, templates, ignoreCase = false) {
|
|
|
160
161
|
/**
|
|
161
162
|
* `maxAge`: an ISO `YYYY-MM-DD` date of birth at most `years` full years
|
|
162
163
|
* before `today`, also ISO, in the user's calendar. As in SDK1, someone turns
|
|
163
|
-
* a year older on their birthday.
|
|
164
|
-
*
|
|
164
|
+
* a year older on their birthday. Field structure validation checks calendar
|
|
165
|
+
* dates before this age rule runs.
|
|
165
166
|
*/
|
|
166
167
|
function isWithinMaxAge(value, today, years) {
|
|
167
168
|
if (!/^\d{4}-\d{2}-\d{2}$/.test(value)) return true;
|
|
@@ -180,8 +181,8 @@ function hasNameCharacters(value) {
|
|
|
180
181
|
//#region src/internal/forms/checks/notFuture.ts
|
|
181
182
|
/**
|
|
182
183
|
* `notFuture`: an ISO `YYYY-MM-DD` date on or before `today`, also ISO, in
|
|
183
|
-
* the user's calendar.
|
|
184
|
-
*
|
|
184
|
+
* the user's calendar. Field structure validation checks calendar dates
|
|
185
|
+
* before this range rule runs.
|
|
185
186
|
*/
|
|
186
187
|
function isNotFuture(value, today) {
|
|
187
188
|
if (!/^\d{4}-\d{2}-\d{2}$/.test(value)) return true;
|
|
@@ -374,6 +375,8 @@ const withRuleMessage = (error, rule) => !rule.message || error.key === rule.mes
|
|
|
374
375
|
key: rule.message
|
|
375
376
|
};
|
|
376
377
|
const evaluateRules = (value, rules, field, values, validators) => {
|
|
378
|
+
const dateError = field.type === "date" ? calendarDateError(value.trim()) : void 0;
|
|
379
|
+
if (dateError) return { key: dateError };
|
|
377
380
|
if (!rules) return void 0;
|
|
378
381
|
for (const rule of rules) {
|
|
379
382
|
const error = validators[rule.type](value, rule, field, values);
|