@incodetech/core 0.0.0-dev-20261123-f3cecd0f → 0.0.0-dev-20261123-4e85f134
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-BI2xJOZi.esm.js → FaceDetectionProvider-CSiQ4_ay.esm.js} +4 -4
- package/dist/ae-signature.esm.js +1 -1
- package/dist/{apiError-Dxfixsln.esm.js → apiError-D8p92jfK.esm.js} +1 -1
- package/dist/authentication.d.ts +3 -3
- package/dist/authentication.esm.js +2 -2
- package/dist/{authenticationManager-BJElkTsj.d.ts → authenticationManager-CLG0PAw9.d.ts} +1 -1
- package/dist/{authenticationManager-BVx-rrQx.esm.js → authenticationManager-DzwIWNvb.esm.js} +3 -3
- package/dist/{authenticationStateMachine-Bi3xyJd8.esm.js → authenticationStateMachine-QgXVzF_L.esm.js} +3 -3
- package/dist/consent.d.ts +1 -1
- package/dist/{consentManager-Duzd8paN.d.ts → consentManager-Bx_osBME.d.ts} +9 -9
- package/dist/curp-validation.d.ts +1 -1
- package/dist/{curpValidationManager-CmL52FU8.d.ts → curpValidationManager-CA9w3fO6.d.ts} +1 -1
- package/dist/{deepsightCaptureConfig-Bp3ttC6f.esm.js → deepsightCaptureConfig-Bcrw2pFu.esm.js} +2 -2
- package/dist/{deepsightLoader-AlFo55X0.esm.js → deepsightLoader-DRDK4yts.esm.js} +4 -4
- package/dist/{desktopCameraElection-CNXGgnSo.esm.js → desktopCameraElection-BvPHvAA4.esm.js} +4 -4
- package/dist/document-capture.d.ts +1 -1
- package/dist/document-signature.esm.js +1 -1
- package/dist/{documentCaptureManager-DOgJTJ4F.d.ts → documentCaptureManager-DLWTqjUr.d.ts} +5 -5
- package/dist/{documentSignatureStateMachine-_51mBEGo.esm.js → documentSignatureStateMachine-PMOkZDCn.esm.js} +1 -1
- package/dist/dynamic-forms.esm.js +2 -2
- package/dist/{dynamicFormsManager-CmGK8Nmm.esm.js → dynamicFormsManager-BOQRxy_t.esm.js} +1 -1
- package/dist/{dynamicFormsStateMachine-BUzOuzaA.esm.js → dynamicFormsStateMachine-Bv8m-KhL.esm.js} +1 -1
- package/dist/ekyb.d.ts +1 -1
- package/dist/ekyb.esm.js +2 -2
- package/dist/{ekybManager-C49pcveL.esm.js → ekybManager-Dt7Z6NEX.esm.js} +1 -1
- package/dist/{ekybStateMachine-IWnhPTLm.esm.js → ekybStateMachine-DExt873D.esm.js} +1 -1
- package/dist/ekyc-prefill.d.ts +5 -4
- package/dist/ekyc-prefill.esm.js +2 -2
- package/dist/ekyc.esm.js +3 -3
- package/dist/{ekycManager-CsknO0Rw.esm.js → ekycManager-N2EAITDJ.esm.js} +1 -1
- package/dist/{ekycPrefillManager-ObAVm5GR.esm.js → ekycPrefillManager-B1i-Fgy-.esm.js} +1 -1
- package/dist/{ekycPrefillManager-C11D5yiF.d.ts → ekycPrefillManager-BzM-GMVT.d.ts} +6 -6
- package/dist/{ekycPrefillStateMachine-BoVSVydv.esm.js → ekycPrefillStateMachine-DlUZGMCd.esm.js} +333 -131
- package/dist/{ekycRules-BH_Ll_0A.esm.js → ekycRules-B7kUzSgu.esm.js} +117 -1
- package/dist/{ekycStateMachine-CJHaHgfD.esm.js → ekycStateMachine-1qQi52Ih.esm.js} +274 -361
- package/dist/{ekycUtils-DEvtEyBI.esm.js → ekycUtils-D4CwNG7Y.esm.js} +5 -3
- package/dist/electronic-signature.esm.js +1 -1
- package/dist/{electronicSignatureManager-BNxHsiOA.esm.js → electronicSignatureManager-YyQFeYTi.esm.js} +1 -1
- package/dist/extensibility.d.ts +14 -14
- package/dist/extensibility.esm.js +13 -13
- package/dist/{faceCaptureManagerFactory-CHqmyOjM.d.ts → faceCaptureManagerFactory-BNY7JNj3.d.ts} +3 -3
- package/dist/{faceCaptureManagerFactory-DlQAlE2f.esm.js → faceCaptureManagerFactory-BOu2eQns.esm.js} +2 -2
- package/dist/{faceCaptureSetup-B7RaB0_O.esm.js → faceCaptureSetup-CopYy5_O.esm.js} +7 -7
- package/dist/{feature-management-CfDygYqM.esm.js → feature-management-CGHalFcv.esm.js} +1 -1
- package/dist/feature-management.esm.js +1 -1
- package/dist/flow-events.d.ts +1 -1
- package/dist/flow.d.ts +5 -5
- package/dist/flow.esm.js +3 -3
- package/dist/{flowCompletionService-BBk66S3P.esm.js → flowCompletionService-BETSa4vN.esm.js} +1 -1
- package/dist/{flowServices-DtMnUqOb.esm.js → flowServices-Adu2JkFA.esm.js} +5 -5
- package/dist/geolocation.d.ts +1 -1
- package/dist/geolocation.esm.js +2 -2
- package/dist/{geolocationManager-Del2ddmt.d.ts → geolocationManager-CENrvxpK.d.ts} +1 -1
- package/dist/{geolocationManager-BiKEQCE2.esm.js → geolocationManager-CFSS2JSp.esm.js} +1 -1
- package/dist/{geolocationStateMachine-FtmVonRL.esm.js → geolocationStateMachine-yhJy-Oli.esm.js} +1 -1
- package/dist/home.d.ts +1 -1
- package/dist/id-ocr.d.ts +1 -1
- package/dist/id-ocr.esm.js +17 -1
- package/dist/id-selfie-flow.d.ts +1 -1
- package/dist/id-selfie-flow.esm.js +6 -6
- package/dist/id.d.ts +2 -2
- package/dist/id.esm.js +3 -3
- package/dist/{idCaptureManager-CgkQW3Xc.d.ts → idCaptureManager-DksvDJ5Y.d.ts} +2 -2
- package/dist/{idCaptureManager-ColRR6SE.esm.js → idCaptureManager-biMO4ti8.esm.js} +4 -4
- package/dist/{idCaptureServices-Bss4WmTf.esm.js → idCaptureServices-DsBCDgPq.esm.js} +2 -2
- package/dist/{idCaptureStateMachine-DZD2WfHO.esm.js → idCaptureStateMachine-DSVxM1sV.esm.js} +11 -11
- package/dist/{idOcrManager-C3BHGgSb.d.ts → idOcrManager-CNGVEZ7B.d.ts} +1 -1
- 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-CoePktWH.d.ts → index-BsqGSj_x.d.ts} +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/kyb-checks.esm.js +2 -2
- package/dist/{kybChecksManager-BG31cWgX.esm.js → kybChecksManager-BELqX_Lm.esm.js} +1 -1
- package/dist/{kybChecksStateMachine-BmNu0IZs.esm.js → kybChecksStateMachine-DK41gj76.esm.js} +1 -1
- package/dist/mandatory-consent.d.ts +2 -2
- package/dist/{mandatoryConsentManager-kzr5kdc_.d.ts → mandatoryConsentManager-B4-gw9FV.d.ts} +10 -10
- package/dist/qe-signature.esm.js +1 -1
- package/dist/{recordingService-CAnEoIxy.esm.js → recordingService-C092bHW7.esm.js} +1 -1
- package/dist/{runChildModule-CYyC2Qsm.esm.js → runChildModule-BImyqF65.esm.js} +1 -1
- package/dist/{sdkVersion-CbYAyk-3.esm.js → sdkVersion-BGEzZXPX.esm.js} +1 -1
- package/dist/selfie.d.ts +3 -3
- package/dist/selfie.esm.js +7 -7
- package/dist/{selfieErrorUtils-DFZDaTym.esm.js → selfieErrorUtils-BbrtgKm7.esm.js} +1 -1
- package/dist/{selfieManager-DrBYj5kA.d.ts → selfieManager-CSxlf4Ls.d.ts} +1 -1
- package/dist/{selfieManager-ByE5lOdT.esm.js → selfieManager-Cdj5fjRN.esm.js} +3 -3
- package/dist/{selfieStateMachine-aApsBvH8.esm.js → selfieStateMachine-CAlutNlH.esm.js} +3 -3
- package/dist/{session-CjD_xiZa.esm.js → session-BlpaoMHX.esm.js} +4 -4
- package/dist/session.d.ts +1 -1
- package/dist/session.esm.js +4 -4
- package/dist/{sessionInitializer-B7b9nwEd.esm.js → sessionInitializer-DmGppDQX.esm.js} +4 -4
- package/dist/{setup-D6Gomd33.esm.js → setup-DA07nIIF.esm.js} +5 -5
- package/dist/trueSight-BAtlP0U8.esm.js +1 -0
- package/dist/{trueSightService-BHmpDnvW.esm.js → trueSightService-DSDSHENR.esm.js} +1 -1
- package/dist/{types-B-PIc0en.d.ts → types-Ct3OFmQs.d.ts} +25 -9
- package/dist/{types-DHpz4Y37.d.ts → types-CzoXVfgt.d.ts} +1 -1
- package/dist/{types-C1056-J1.d.ts → types-DQ2BSAKU.d.ts} +1 -1
- package/dist/types-DQACmFP1.d.ts +6 -0
- package/dist/{types-4Re9FSOw.d.ts → types-D_-0O9pg.d.ts} +1 -1
- package/dist/{types-CEGG70FK.d.ts → types-E4jPC3M2.d.ts} +1 -1
- package/dist/{types-b0l9b83G.d.ts → types-eMmhwENp.d.ts} +1 -1
- package/dist/video-selfie.d.ts +1 -1
- package/dist/video-selfie.esm.js +3 -3
- package/dist/{videoSelfieCameraWarmer-O-uRRcju.esm.js → videoSelfieCameraWarmer-DWrg6vQd.esm.js} +3 -3
- package/dist/{videoSelfieStepDetector-DC_Qh7qI.d.ts → videoSelfieStepDetector-Cu7EZdcz.d.ts} +2 -2
- package/dist/wasm.esm.js +1 -1
- package/dist/workflow.d.ts +1 -1
- package/dist/workflow.esm.js +19 -19
- package/package.json +1 -1
- package/dist/idOcrCpfUtils-D5Gwskxu.esm.js +0 -18
- package/dist/trueSight-CsGhFXTr.esm.js +0 -1
- package/dist/types-BtrJ5fkm.d.ts +0 -6
|
@@ -94,6 +94,88 @@ function isValidRut(value) {
|
|
|
94
94
|
return check === (rest === 11 ? "0" : rest === 10 ? "K" : String(rest));
|
|
95
95
|
}
|
|
96
96
|
//#endregion
|
|
97
|
+
//#region src/internal/forms/resolvePrefill.ts
|
|
98
|
+
const DISPLAY_MODES = /* @__PURE__ */ new Set([
|
|
99
|
+
"editable",
|
|
100
|
+
"readOnly",
|
|
101
|
+
"hidden"
|
|
102
|
+
]);
|
|
103
|
+
const ONE_OF_REQUIRED = "oneOfRequired";
|
|
104
|
+
const filled = (value) => value !== void 0 && value.trim() !== "";
|
|
105
|
+
function configuredMode(context, group) {
|
|
106
|
+
const mode = context.displayModes?.[group];
|
|
107
|
+
return mode !== void 0 && DISPLAY_MODES.has(mode) ? mode : "editable";
|
|
108
|
+
}
|
|
109
|
+
/** The field's prefill source for its group's origin, if it lists one. */
|
|
110
|
+
function sourceFor(field, context) {
|
|
111
|
+
const origin = context.origins?.[field.group];
|
|
112
|
+
if (!origin) return void 0;
|
|
113
|
+
return field.prefill?.find((id) => id.startsWith(`${origin}.`));
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Decides each shown field's prefilled value and display mode, from the
|
|
117
|
+
* resolved form, module configuration's origins and display modes, and the
|
|
118
|
+
* values the module read. Pure and synchronous.
|
|
119
|
+
*
|
|
120
|
+
* A value that fails its field's checks is dropped. A group configured
|
|
121
|
+
* `hidden` or `readOnly` becomes `editable` as a whole when one of its
|
|
122
|
+
* required fields has no value, or when a `oneOfRequired` rule over it has
|
|
123
|
+
* none, so the user can always complete the form. An optional field without
|
|
124
|
+
* a value keeps its mode and sends nothing. An editable field filled from one
|
|
125
|
+
* of the context's `lockingOrigins` shows read-only.
|
|
126
|
+
*/
|
|
127
|
+
function resolvePrefill(form, context, data, checks) {
|
|
128
|
+
const candidates = {};
|
|
129
|
+
for (const { field } of form.fields) {
|
|
130
|
+
const source = sourceFor(field, context);
|
|
131
|
+
const raw = source ? data[source] : void 0;
|
|
132
|
+
if (filled(raw)) candidates[field.name] = checks.format(field, raw);
|
|
133
|
+
}
|
|
134
|
+
const values = {};
|
|
135
|
+
for (const { field } of form.fields) {
|
|
136
|
+
const value = candidates[field.name];
|
|
137
|
+
if (filled(value) && checks.isValid(field, value, candidates)) values[field.name] = value;
|
|
138
|
+
}
|
|
139
|
+
const isRequired = (resolved) => resolved.required || resolved.requiredIfFilled.some((name) => filled(values[name]));
|
|
140
|
+
const promoted = /* @__PURE__ */ new Set();
|
|
141
|
+
const promote = (group) => {
|
|
142
|
+
if (configuredMode(context, group) !== "editable") promoted.add(group);
|
|
143
|
+
};
|
|
144
|
+
for (const resolved of form.fields) if (isRequired(resolved) && !filled(values[resolved.field.name])) promote(resolved.field.group);
|
|
145
|
+
const groupOf = new Map(form.fields.map(({ field }) => [field.name, field.group]));
|
|
146
|
+
for (const { rule, fields } of form.groupRules) {
|
|
147
|
+
if (rule.id !== ONE_OF_REQUIRED) continue;
|
|
148
|
+
if (fields.some((name) => filled(values[name]))) continue;
|
|
149
|
+
for (const name of fields) {
|
|
150
|
+
const group = groupOf.get(name);
|
|
151
|
+
if (group) promote(group);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return {
|
|
155
|
+
fields: form.fields.map((resolved) => {
|
|
156
|
+
const { group, name } = resolved.field;
|
|
157
|
+
if (promoted.has(group)) return {
|
|
158
|
+
...resolved,
|
|
159
|
+
displayMode: "editable",
|
|
160
|
+
displayReason: "promoted"
|
|
161
|
+
};
|
|
162
|
+
const configured = configuredMode(context, group);
|
|
163
|
+
const origin = context.origins?.[group];
|
|
164
|
+
if (configured === "editable" && filled(values[name]) && origin !== void 0 && context.lockingOrigins?.includes(origin)) return {
|
|
165
|
+
...resolved,
|
|
166
|
+
displayMode: "readOnly",
|
|
167
|
+
displayReason: "locked"
|
|
168
|
+
};
|
|
169
|
+
return {
|
|
170
|
+
...resolved,
|
|
171
|
+
displayMode: configured,
|
|
172
|
+
displayReason: "configured"
|
|
173
|
+
};
|
|
174
|
+
}),
|
|
175
|
+
values
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
//#endregion
|
|
97
179
|
//#region src/internal/forms/checks/digitCount.ts
|
|
98
180
|
/** `digitCount`: only the digits 0-9, with a count in `lengths` or between `min` and `max`. */
|
|
99
181
|
function hasDigitCount(value, count) {
|
|
@@ -197,6 +279,13 @@ function isInNumericRange(value, min, max) {
|
|
|
197
279
|
return number >= min && number <= max;
|
|
198
280
|
}
|
|
199
281
|
//#endregion
|
|
282
|
+
//#region src/shared/validators/textRules.ts
|
|
283
|
+
const CHARACTER_CLASSES = [
|
|
284
|
+
"letter",
|
|
285
|
+
"digit",
|
|
286
|
+
"space"
|
|
287
|
+
];
|
|
288
|
+
//#endregion
|
|
200
289
|
//#region src/modules/ekyc/ekycValidators.ts
|
|
201
290
|
async function loadPhoneValidator() {
|
|
202
291
|
if (!await loadPhoneValidation()) throw new Error("Failed to load the phone validation rules");
|
|
@@ -459,6 +548,33 @@ const RULES = {
|
|
|
459
548
|
inDrivingLicenseNumber: () => ({ type: "inDrivingLicenseNumber" }),
|
|
460
549
|
curp: () => ({ type: "curp" })
|
|
461
550
|
};
|
|
551
|
+
const isCount = (value) => typeof value === "number" && Number.isInteger(value) && value > 0;
|
|
552
|
+
const isInteger = (value) => typeof value === "number" && Number.isInteger(value);
|
|
553
|
+
const isNonEmptyArrayOf = (value, item) => Array.isArray(value) && value.length > 0 && value.every(item);
|
|
554
|
+
const isString = (value) => typeof value === "string";
|
|
555
|
+
const isCharacterClass = (value) => CHARACTER_CLASSES.includes(value);
|
|
556
|
+
/**
|
|
557
|
+
* Params a projected rule reads. The compiler checks params against the
|
|
558
|
+
* vocabulary too; this keeps a definition that skipped it, such as a served
|
|
559
|
+
* one later, from projecting a broken rule.
|
|
560
|
+
*/
|
|
561
|
+
const RULE_PARAMS = {
|
|
562
|
+
exactLength: ({ length }) => isCount(length),
|
|
563
|
+
phoneDigits: ({ min, max }) => isCount(min) && isCount(max) && min <= max,
|
|
564
|
+
digitCount: ({ lengths, min, max }) => lengths !== void 0 ? isNonEmptyArrayOf(lengths, isCount) && min === void 0 && max === void 0 : isCount(min) && isCount(max) && min <= max,
|
|
565
|
+
allowedCharacters: ({ classes, extra }) => isNonEmptyArrayOf(classes, isCharacterClass) && (extra === void 0 || isString(extra)),
|
|
566
|
+
charTemplate: ({ templates, ignoreCase }) => isNonEmptyArrayOf(templates, (t) => isString(t) && t !== "") && (ignoreCase === void 0 || typeof ignoreCase === "boolean"),
|
|
567
|
+
numericRange: ({ min, max }) => isInteger(min) && isInteger(max) && min <= max,
|
|
568
|
+
maxAge: ({ years }) => isCount(years)
|
|
569
|
+
};
|
|
570
|
+
/**
|
|
571
|
+
* Whether a field rule maps onto a validator: a known id, valid params, and
|
|
572
|
+
* a message without params. eKYC's adapter and eKYC Pre-fill's both check
|
|
573
|
+
* their definitions with it.
|
|
574
|
+
*/
|
|
575
|
+
function isProjectableRule(rule) {
|
|
576
|
+
return Object.prototype.hasOwnProperty.call(RULES, rule.id) && !rule.message?.params && (RULE_PARAMS[rule.id]?.(rule.params ?? {}) ?? true);
|
|
577
|
+
}
|
|
462
578
|
/**
|
|
463
579
|
* A field's vocabulary rules as today's `EkycValidationRule`s, which
|
|
464
580
|
* `validateEkycField` runs. eKYC Pre-fill validates with them too.
|
|
@@ -479,4 +595,4 @@ function projectRules(rules, country, required) {
|
|
|
479
595
|
});
|
|
480
596
|
}
|
|
481
597
|
//#endregion
|
|
482
|
-
export {
|
|
598
|
+
export { ONE_OF_REQUIRED_ERROR_KEY as a, formatSSN as c, validateEkycField as d, validateEkycForm as f, projectRules as i, loadPhoneValidator as l, isCount as n, cleanName as o, resolvePrefill as p, isProjectableRule as r, formatPhoneNational as s, RULES as t, oneOfRequiredErrorKey as u };
|