@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.
Files changed (111) hide show
  1. package/dist/{FaceDetectionProvider-BI2xJOZi.esm.js → FaceDetectionProvider-CSiQ4_ay.esm.js} +4 -4
  2. package/dist/ae-signature.esm.js +1 -1
  3. package/dist/{apiError-Dxfixsln.esm.js → apiError-D8p92jfK.esm.js} +1 -1
  4. package/dist/authentication.d.ts +3 -3
  5. package/dist/authentication.esm.js +2 -2
  6. package/dist/{authenticationManager-BJElkTsj.d.ts → authenticationManager-CLG0PAw9.d.ts} +1 -1
  7. package/dist/{authenticationManager-BVx-rrQx.esm.js → authenticationManager-DzwIWNvb.esm.js} +3 -3
  8. package/dist/{authenticationStateMachine-Bi3xyJd8.esm.js → authenticationStateMachine-QgXVzF_L.esm.js} +3 -3
  9. package/dist/consent.d.ts +1 -1
  10. package/dist/{consentManager-Duzd8paN.d.ts → consentManager-Bx_osBME.d.ts} +9 -9
  11. package/dist/curp-validation.d.ts +1 -1
  12. package/dist/{curpValidationManager-CmL52FU8.d.ts → curpValidationManager-CA9w3fO6.d.ts} +1 -1
  13. package/dist/{deepsightCaptureConfig-Bp3ttC6f.esm.js → deepsightCaptureConfig-Bcrw2pFu.esm.js} +2 -2
  14. package/dist/{deepsightLoader-AlFo55X0.esm.js → deepsightLoader-DRDK4yts.esm.js} +4 -4
  15. package/dist/{desktopCameraElection-CNXGgnSo.esm.js → desktopCameraElection-BvPHvAA4.esm.js} +4 -4
  16. package/dist/document-capture.d.ts +1 -1
  17. package/dist/document-signature.esm.js +1 -1
  18. package/dist/{documentCaptureManager-DOgJTJ4F.d.ts → documentCaptureManager-DLWTqjUr.d.ts} +5 -5
  19. package/dist/{documentSignatureStateMachine-_51mBEGo.esm.js → documentSignatureStateMachine-PMOkZDCn.esm.js} +1 -1
  20. package/dist/dynamic-forms.esm.js +2 -2
  21. package/dist/{dynamicFormsManager-CmGK8Nmm.esm.js → dynamicFormsManager-BOQRxy_t.esm.js} +1 -1
  22. package/dist/{dynamicFormsStateMachine-BUzOuzaA.esm.js → dynamicFormsStateMachine-Bv8m-KhL.esm.js} +1 -1
  23. package/dist/ekyb.d.ts +1 -1
  24. package/dist/ekyb.esm.js +2 -2
  25. package/dist/{ekybManager-C49pcveL.esm.js → ekybManager-Dt7Z6NEX.esm.js} +1 -1
  26. package/dist/{ekybStateMachine-IWnhPTLm.esm.js → ekybStateMachine-DExt873D.esm.js} +1 -1
  27. package/dist/ekyc-prefill.d.ts +5 -4
  28. package/dist/ekyc-prefill.esm.js +2 -2
  29. package/dist/ekyc.esm.js +3 -3
  30. package/dist/{ekycManager-CsknO0Rw.esm.js → ekycManager-N2EAITDJ.esm.js} +1 -1
  31. package/dist/{ekycPrefillManager-ObAVm5GR.esm.js → ekycPrefillManager-B1i-Fgy-.esm.js} +1 -1
  32. package/dist/{ekycPrefillManager-C11D5yiF.d.ts → ekycPrefillManager-BzM-GMVT.d.ts} +6 -6
  33. package/dist/{ekycPrefillStateMachine-BoVSVydv.esm.js → ekycPrefillStateMachine-DlUZGMCd.esm.js} +333 -131
  34. package/dist/{ekycRules-BH_Ll_0A.esm.js → ekycRules-B7kUzSgu.esm.js} +117 -1
  35. package/dist/{ekycStateMachine-CJHaHgfD.esm.js → ekycStateMachine-1qQi52Ih.esm.js} +274 -361
  36. package/dist/{ekycUtils-DEvtEyBI.esm.js → ekycUtils-D4CwNG7Y.esm.js} +5 -3
  37. package/dist/electronic-signature.esm.js +1 -1
  38. package/dist/{electronicSignatureManager-BNxHsiOA.esm.js → electronicSignatureManager-YyQFeYTi.esm.js} +1 -1
  39. package/dist/extensibility.d.ts +14 -14
  40. package/dist/extensibility.esm.js +13 -13
  41. package/dist/{faceCaptureManagerFactory-CHqmyOjM.d.ts → faceCaptureManagerFactory-BNY7JNj3.d.ts} +3 -3
  42. package/dist/{faceCaptureManagerFactory-DlQAlE2f.esm.js → faceCaptureManagerFactory-BOu2eQns.esm.js} +2 -2
  43. package/dist/{faceCaptureSetup-B7RaB0_O.esm.js → faceCaptureSetup-CopYy5_O.esm.js} +7 -7
  44. package/dist/{feature-management-CfDygYqM.esm.js → feature-management-CGHalFcv.esm.js} +1 -1
  45. package/dist/feature-management.esm.js +1 -1
  46. package/dist/flow-events.d.ts +1 -1
  47. package/dist/flow.d.ts +5 -5
  48. package/dist/flow.esm.js +3 -3
  49. package/dist/{flowCompletionService-BBk66S3P.esm.js → flowCompletionService-BETSa4vN.esm.js} +1 -1
  50. package/dist/{flowServices-DtMnUqOb.esm.js → flowServices-Adu2JkFA.esm.js} +5 -5
  51. package/dist/geolocation.d.ts +1 -1
  52. package/dist/geolocation.esm.js +2 -2
  53. package/dist/{geolocationManager-Del2ddmt.d.ts → geolocationManager-CENrvxpK.d.ts} +1 -1
  54. package/dist/{geolocationManager-BiKEQCE2.esm.js → geolocationManager-CFSS2JSp.esm.js} +1 -1
  55. package/dist/{geolocationStateMachine-FtmVonRL.esm.js → geolocationStateMachine-yhJy-Oli.esm.js} +1 -1
  56. package/dist/home.d.ts +1 -1
  57. package/dist/id-ocr.d.ts +1 -1
  58. package/dist/id-ocr.esm.js +17 -1
  59. package/dist/id-selfie-flow.d.ts +1 -1
  60. package/dist/id-selfie-flow.esm.js +6 -6
  61. package/dist/id.d.ts +2 -2
  62. package/dist/id.esm.js +3 -3
  63. package/dist/{idCaptureManager-CgkQW3Xc.d.ts → idCaptureManager-DksvDJ5Y.d.ts} +2 -2
  64. package/dist/{idCaptureManager-ColRR6SE.esm.js → idCaptureManager-biMO4ti8.esm.js} +4 -4
  65. package/dist/{idCaptureServices-Bss4WmTf.esm.js → idCaptureServices-DsBCDgPq.esm.js} +2 -2
  66. package/dist/{idCaptureStateMachine-DZD2WfHO.esm.js → idCaptureStateMachine-DSVxM1sV.esm.js} +11 -11
  67. package/dist/{idOcrManager-C3BHGgSb.d.ts → idOcrManager-CNGVEZ7B.d.ts} +1 -1
  68. package/dist/identity-reuse.d.ts +1 -1
  69. package/dist/{identityReuseManager-CZ-qJ_Aa.d.ts → identityReuseManager-D_jiHp1n.d.ts} +4 -4
  70. package/dist/{index-CoePktWH.d.ts → index-BsqGSj_x.d.ts} +1 -1
  71. package/dist/index.esm.js +1 -1
  72. package/dist/kyb-checks.esm.js +2 -2
  73. package/dist/{kybChecksManager-BG31cWgX.esm.js → kybChecksManager-BELqX_Lm.esm.js} +1 -1
  74. package/dist/{kybChecksStateMachine-BmNu0IZs.esm.js → kybChecksStateMachine-DK41gj76.esm.js} +1 -1
  75. package/dist/mandatory-consent.d.ts +2 -2
  76. package/dist/{mandatoryConsentManager-kzr5kdc_.d.ts → mandatoryConsentManager-B4-gw9FV.d.ts} +10 -10
  77. package/dist/qe-signature.esm.js +1 -1
  78. package/dist/{recordingService-CAnEoIxy.esm.js → recordingService-C092bHW7.esm.js} +1 -1
  79. package/dist/{runChildModule-CYyC2Qsm.esm.js → runChildModule-BImyqF65.esm.js} +1 -1
  80. package/dist/{sdkVersion-CbYAyk-3.esm.js → sdkVersion-BGEzZXPX.esm.js} +1 -1
  81. package/dist/selfie.d.ts +3 -3
  82. package/dist/selfie.esm.js +7 -7
  83. package/dist/{selfieErrorUtils-DFZDaTym.esm.js → selfieErrorUtils-BbrtgKm7.esm.js} +1 -1
  84. package/dist/{selfieManager-DrBYj5kA.d.ts → selfieManager-CSxlf4Ls.d.ts} +1 -1
  85. package/dist/{selfieManager-ByE5lOdT.esm.js → selfieManager-Cdj5fjRN.esm.js} +3 -3
  86. package/dist/{selfieStateMachine-aApsBvH8.esm.js → selfieStateMachine-CAlutNlH.esm.js} +3 -3
  87. package/dist/{session-CjD_xiZa.esm.js → session-BlpaoMHX.esm.js} +4 -4
  88. package/dist/session.d.ts +1 -1
  89. package/dist/session.esm.js +4 -4
  90. package/dist/{sessionInitializer-B7b9nwEd.esm.js → sessionInitializer-DmGppDQX.esm.js} +4 -4
  91. package/dist/{setup-D6Gomd33.esm.js → setup-DA07nIIF.esm.js} +5 -5
  92. package/dist/trueSight-BAtlP0U8.esm.js +1 -0
  93. package/dist/{trueSightService-BHmpDnvW.esm.js → trueSightService-DSDSHENR.esm.js} +1 -1
  94. package/dist/{types-B-PIc0en.d.ts → types-Ct3OFmQs.d.ts} +25 -9
  95. package/dist/{types-DHpz4Y37.d.ts → types-CzoXVfgt.d.ts} +1 -1
  96. package/dist/{types-C1056-J1.d.ts → types-DQ2BSAKU.d.ts} +1 -1
  97. package/dist/types-DQACmFP1.d.ts +6 -0
  98. package/dist/{types-4Re9FSOw.d.ts → types-D_-0O9pg.d.ts} +1 -1
  99. package/dist/{types-CEGG70FK.d.ts → types-E4jPC3M2.d.ts} +1 -1
  100. package/dist/{types-b0l9b83G.d.ts → types-eMmhwENp.d.ts} +1 -1
  101. package/dist/video-selfie.d.ts +1 -1
  102. package/dist/video-selfie.esm.js +3 -3
  103. package/dist/{videoSelfieCameraWarmer-O-uRRcju.esm.js → videoSelfieCameraWarmer-DWrg6vQd.esm.js} +3 -3
  104. package/dist/{videoSelfieStepDetector-DC_Qh7qI.d.ts → videoSelfieStepDetector-Cu7EZdcz.d.ts} +2 -2
  105. package/dist/wasm.esm.js +1 -1
  106. package/dist/workflow.d.ts +1 -1
  107. package/dist/workflow.esm.js +19 -19
  108. package/package.json +1 -1
  109. package/dist/idOcrCpfUtils-D5Gwskxu.esm.js +0 -18
  110. package/dist/trueSight-CsGhFXTr.esm.js +0 -1
  111. 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 { formatPhoneNational as a, oneOfRequiredErrorKey as c, cleanName as i, validateEkycField as l, projectRules as n, formatSSN as o, ONE_OF_REQUIRED_ERROR_KEY as r, loadPhoneValidator as s, RULES as t, validateEkycForm as u };
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 };