@incodetech/core 0.0.0-dev-20260311-b46342c → 0.0.0-dev-20260311-787552e

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.
@@ -1,12 +1,12 @@
1
1
  import "./types-dSdX5z-n.js";
2
2
  import "./warmup-CO10kO5G.js";
3
- import { a as FaceCaptureDependencies, n as FaceCaptureManagerState, r as BaseFaceCaptureConfig, t as FaceCaptureManager } from "./faceCaptureManagerFactory-CftLkmnH.js";
3
+ import { a as FaceCaptureDependencies, n as FaceCaptureManagerState, r as BaseFaceCaptureConfig, t as FaceCaptureManager } from "./faceCaptureManagerFactory-FEuTMK4j.js";
4
4
  import { t as Manager } from "./Manager-CVog-etk.js";
5
5
  import "./camera-HI2fNiV5.js";
6
6
  import { t as ActorRefFrom } from "./Actor-SKZvDOCc.js";
7
7
  import { t as AnyStateMachine } from "./StateMachine-Coiuk0UD.js";
8
8
  import "./types-B_l5fu_D.js";
9
- import { r as FlowModuleConfig } from "./types-BcGRS3lW.js";
9
+ import { r as FlowModuleConfig } from "./types-DrdrHHxZ.js";
10
10
 
11
11
  //#region src/modules/authentication/authenticationStateMachine.d.ts
12
12
  declare const _authenticationMachine: AnyStateMachine;
@@ -1,7 +1,7 @@
1
1
  import { t as Manager } from "./Manager-CVog-etk.js";
2
2
  import "./camera-HI2fNiV5.js";
3
3
  import "./types-B_l5fu_D.js";
4
- import { r as FlowModuleConfig } from "./types-BcGRS3lW.js";
4
+ import { r as FlowModuleConfig } from "./types-DrdrHHxZ.js";
5
5
 
6
6
  //#region src/modules/curp-validation/types.d.ts
7
7
  type CurpValidationConfig = FlowModuleConfig['CURP_VALIDATION'] & {
@@ -1,6 +1,6 @@
1
1
  import { t as Manager } from "./Manager-CVog-etk.js";
2
2
  import { t as CameraStream } from "./camera-HI2fNiV5.js";
3
- import * as xstate212 from "xstate";
3
+ import * as xstate0 from "xstate";
4
4
 
5
5
  //#region src/modules/document-capture/types.d.ts
6
6
  type DocumentType = 'addressStatement' | 'otherDocument1' | 'otherDocument2' | 'otherDocument3' | 'v5cMultiPageLogbook' | 'circulationCard' | 'financeSettlement' | 'carInvoice' | 'capture' | 'processPoaOcr' | 'processLoaOcr' | 'processAsylumSeekerVisaZaf' | 'processBankStatementOCR' | 'processBankCheck' | 'processV5CLogbook' | 'processCarInvoice' | 'processCirculationCard' | 'processFinanceSettlement';
@@ -72,7 +72,7 @@ type DocumentCaptureInput = {
72
72
  };
73
73
  //#endregion
74
74
  //#region src/modules/document-capture/documentCaptureStateMachine.d.ts
75
- declare const documentCaptureMachine: xstate212.StateMachine<DocumentCaptureContext, {
75
+ declare const documentCaptureMachine: xstate0.StateMachine<DocumentCaptureContext, {
76
76
  type: "CAPTURE";
77
77
  } | {
78
78
  type: "FILE_SELECTED";
@@ -95,27 +95,27 @@ declare const documentCaptureMachine: xstate212.StateMachine<DocumentCaptureCont
95
95
  } | {
96
96
  type: "CLOSE";
97
97
  }, {
98
- [x: string]: xstate212.ActorRefFromLogic<xstate212.PromiseActorLogic<MediaStream, void, xstate212.EventObject>> | xstate212.ActorRefFromLogic<xstate212.PromiseActorLogic<DocumentUploadResponse, {
98
+ [x: string]: xstate0.ActorRefFromLogic<xstate0.PromiseActorLogic<MediaStream, void, xstate0.EventObject>> | xstate0.ActorRefFromLogic<xstate0.PromiseActorLogic<DocumentUploadResponse, {
99
99
  capturedDocument: NonNullable<DocumentCaptureContext["capturedDocument"]>;
100
100
  processingType: string;
101
101
  onProgress: (progress: number) => void;
102
- }, xstate212.EventObject>> | undefined;
103
- }, xstate212.Values<{
102
+ }, xstate0.EventObject>> | undefined;
103
+ }, xstate0.Values<{
104
104
  initCamera: {
105
105
  src: "initCamera";
106
- logic: xstate212.PromiseActorLogic<MediaStream, void, xstate212.EventObject>;
106
+ logic: xstate0.PromiseActorLogic<MediaStream, void, xstate0.EventObject>;
107
107
  id: string | undefined;
108
108
  };
109
109
  uploadDocument: {
110
110
  src: "uploadDocument";
111
- logic: xstate212.PromiseActorLogic<DocumentUploadResponse, {
111
+ logic: xstate0.PromiseActorLogic<DocumentUploadResponse, {
112
112
  capturedDocument: NonNullable<DocumentCaptureContext["capturedDocument"]>;
113
113
  processingType: string;
114
114
  onProgress: (progress: number) => void;
115
- }, xstate212.EventObject>;
115
+ }, xstate0.EventObject>;
116
116
  id: string | undefined;
117
117
  };
118
- }>, xstate212.Values<{
118
+ }>, xstate0.Values<{
119
119
  setStream: {
120
120
  type: "setStream";
121
121
  params: unknown;
@@ -196,7 +196,7 @@ declare const documentCaptureMachine: xstate212.StateMachine<DocumentCaptureCont
196
196
  type: "trackFailure";
197
197
  params: unknown;
198
198
  };
199
- }>, xstate212.Values<{
199
+ }>, xstate0.Values<{
200
200
  allowSkip: {
201
201
  type: "allowSkip";
202
202
  params: unknown;
@@ -229,7 +229,7 @@ declare const documentCaptureMachine: xstate212.StateMachine<DocumentCaptureCont
229
229
  type: "isPendingNextPage";
230
230
  params: unknown;
231
231
  };
232
- }>, never, "finished" | "initCamera" | "tutorial" | "capturing" | "preview" | "closed" | "failure" | "uploading" | "success", string, DocumentCaptureInput, xstate212.NonReducibleUnknown, xstate212.EventObject, xstate212.MetaObject, {
232
+ }>, never, "initCamera" | "tutorial" | "capturing" | "preview" | "finished" | "closed" | "failure" | "uploading" | "success", string, DocumentCaptureInput, xstate0.NonReducibleUnknown, xstate0.EventObject, xstate0.MetaObject, {
233
233
  readonly id: "documentCapture";
234
234
  readonly initial: "tutorial";
235
235
  readonly context: ({
@@ -238,67 +238,67 @@ declare const documentCaptureMachine: xstate212.StateMachine<DocumentCaptureCont
238
238
  spawn: {
239
239
  <TSrc extends "initCamera" | "uploadDocument">(logic: TSrc, ...[options]: ({
240
240
  src: "initCamera";
241
- logic: xstate212.PromiseActorLogic<MediaStream, void, xstate212.EventObject>;
241
+ logic: xstate0.PromiseActorLogic<MediaStream, void, xstate0.EventObject>;
242
242
  id: string | undefined;
243
243
  } extends infer T ? T extends {
244
244
  src: "initCamera";
245
- logic: xstate212.PromiseActorLogic<MediaStream, void, xstate212.EventObject>;
245
+ logic: xstate0.PromiseActorLogic<MediaStream, void, xstate0.EventObject>;
246
246
  id: string | undefined;
247
247
  } ? T extends {
248
248
  src: TSrc;
249
- } ? xstate212.ConditionalRequired<[options?: ({
249
+ } ? xstate0.ConditionalRequired<[options?: ({
250
250
  id?: T["id"] | undefined;
251
251
  systemId?: string;
252
- input?: xstate212.InputFrom<T["logic"]> | undefined;
252
+ input?: xstate0.InputFrom<T["logic"]> | undefined;
253
253
  syncSnapshot?: boolean;
254
- } & { [K in xstate212.RequiredActorOptions<T>]: unknown }) | undefined], xstate212.IsNotNever<xstate212.RequiredActorOptions<T>>> : never : never : never) | ({
254
+ } & { [K in xstate0.RequiredActorOptions<T>]: unknown }) | undefined], xstate0.IsNotNever<xstate0.RequiredActorOptions<T>>> : never : never : never) | ({
255
255
  src: "uploadDocument";
256
- logic: xstate212.PromiseActorLogic<DocumentUploadResponse, {
256
+ logic: xstate0.PromiseActorLogic<DocumentUploadResponse, {
257
257
  capturedDocument: NonNullable<DocumentCaptureContext["capturedDocument"]>;
258
258
  processingType: string;
259
259
  onProgress: (progress: number) => void;
260
- }, xstate212.EventObject>;
260
+ }, xstate0.EventObject>;
261
261
  id: string | undefined;
262
262
  } extends infer T_1 ? T_1 extends {
263
263
  src: "uploadDocument";
264
- logic: xstate212.PromiseActorLogic<DocumentUploadResponse, {
264
+ logic: xstate0.PromiseActorLogic<DocumentUploadResponse, {
265
265
  capturedDocument: NonNullable<DocumentCaptureContext["capturedDocument"]>;
266
266
  processingType: string;
267
267
  onProgress: (progress: number) => void;
268
- }, xstate212.EventObject>;
268
+ }, xstate0.EventObject>;
269
269
  id: string | undefined;
270
270
  } ? T_1 extends {
271
271
  src: TSrc;
272
- } ? xstate212.ConditionalRequired<[options?: ({
272
+ } ? xstate0.ConditionalRequired<[options?: ({
273
273
  id?: T_1["id"] | undefined;
274
274
  systemId?: string;
275
- input?: xstate212.InputFrom<T_1["logic"]> | undefined;
275
+ input?: xstate0.InputFrom<T_1["logic"]> | undefined;
276
276
  syncSnapshot?: boolean;
277
- } & { [K_1 in xstate212.RequiredActorOptions<T_1>]: unknown }) | undefined], xstate212.IsNotNever<xstate212.RequiredActorOptions<T_1>>> : never : never : never)): xstate212.ActorRefFromLogic<xstate212.GetConcreteByKey<xstate212.Values<{
277
+ } & { [K_1 in xstate0.RequiredActorOptions<T_1>]: unknown }) | undefined], xstate0.IsNotNever<xstate0.RequiredActorOptions<T_1>>> : never : never : never)): xstate0.ActorRefFromLogic<xstate0.GetConcreteByKey<xstate0.Values<{
278
278
  initCamera: {
279
279
  src: "initCamera";
280
- logic: xstate212.PromiseActorLogic<MediaStream, void, xstate212.EventObject>;
280
+ logic: xstate0.PromiseActorLogic<MediaStream, void, xstate0.EventObject>;
281
281
  id: string | undefined;
282
282
  };
283
283
  uploadDocument: {
284
284
  src: "uploadDocument";
285
- logic: xstate212.PromiseActorLogic<DocumentUploadResponse, {
285
+ logic: xstate0.PromiseActorLogic<DocumentUploadResponse, {
286
286
  capturedDocument: NonNullable<DocumentCaptureContext["capturedDocument"]>;
287
287
  processingType: string;
288
288
  onProgress: (progress: number) => void;
289
- }, xstate212.EventObject>;
289
+ }, xstate0.EventObject>;
290
290
  id: string | undefined;
291
291
  };
292
292
  }>, "src", TSrc>["logic"]>;
293
- <TLogic extends xstate212.AnyActorLogic>(src: TLogic, ...[options]: xstate212.ConditionalRequired<[options?: ({
293
+ <TLogic extends xstate0.AnyActorLogic>(src: TLogic, ...[options]: xstate0.ConditionalRequired<[options?: ({
294
294
  id?: never;
295
295
  systemId?: string;
296
- input?: xstate212.InputFrom<TLogic> | undefined;
296
+ input?: xstate0.InputFrom<TLogic> | undefined;
297
297
  syncSnapshot?: boolean;
298
- } & { [K in xstate212.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate212.IsNotNever<xstate212.RequiredLogicInput<TLogic>>>): xstate212.ActorRefFromLogic<TLogic>;
298
+ } & { [K in xstate0.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate0.IsNotNever<xstate0.RequiredLogicInput<TLogic>>>): xstate0.ActorRefFromLogic<TLogic>;
299
299
  };
300
300
  input: DocumentCaptureInput;
301
- self: xstate212.ActorRef<xstate212.MachineSnapshot<DocumentCaptureContext, {
301
+ self: xstate0.ActorRef<xstate0.MachineSnapshot<DocumentCaptureContext, {
302
302
  type: "CAPTURE";
303
303
  } | {
304
304
  type: "FILE_SELECTED";
@@ -320,7 +320,7 @@ declare const documentCaptureMachine: xstate212.StateMachine<DocumentCaptureCont
320
320
  type: "SKIP";
321
321
  } | {
322
322
  type: "CLOSE";
323
- }, Record<string, xstate212.AnyActorRef | undefined>, xstate212.StateValue, string, unknown, any, any>, {
323
+ }, Record<string, xstate0.AnyActorRef | undefined>, xstate0.StateValue, string, unknown, any, any>, {
324
324
  type: "CAPTURE";
325
325
  } | {
326
326
  type: "FILE_SELECTED";
@@ -342,7 +342,7 @@ declare const documentCaptureMachine: xstate212.StateMachine<DocumentCaptureCont
342
342
  type: "SKIP";
343
343
  } | {
344
344
  type: "CLOSE";
345
- }, xstate212.AnyEventObject>;
345
+ }, xstate0.AnyEventObject>;
346
346
  }) => {
347
347
  config: {
348
348
  processingType: DocumentType;
@@ -479,7 +479,7 @@ declare const documentCaptureMachine: xstate212.StateMachine<DocumentCaptureCont
479
479
  } | {
480
480
  type: "CLOSE";
481
481
  };
482
- self: xstate212.ActorRef<xstate212.MachineSnapshot<DocumentCaptureContext, {
482
+ self: xstate0.ActorRef<xstate0.MachineSnapshot<DocumentCaptureContext, {
483
483
  type: "CAPTURE";
484
484
  } | {
485
485
  type: "FILE_SELECTED";
@@ -501,7 +501,7 @@ declare const documentCaptureMachine: xstate212.StateMachine<DocumentCaptureCont
501
501
  type: "SKIP";
502
502
  } | {
503
503
  type: "CLOSE";
504
- }, Record<string, xstate212.AnyActorRef>, xstate212.StateValue, string, unknown, any, any>, {
504
+ }, Record<string, xstate0.AnyActorRef>, xstate0.StateValue, string, unknown, any, any>, {
505
505
  type: "CAPTURE";
506
506
  } | {
507
507
  type: "FILE_SELECTED";
@@ -523,7 +523,7 @@ declare const documentCaptureMachine: xstate212.StateMachine<DocumentCaptureCont
523
523
  type: "SKIP";
524
524
  } | {
525
525
  type: "CLOSE";
526
- }, xstate212.AnyEventObject>;
526
+ }, xstate0.AnyEventObject>;
527
527
  }) => {
528
528
  capturedDocument: CapturedDocument;
529
529
  processingType: DocumentType;
@@ -38,10 +38,6 @@ declare const documentUploadMachine: xstate271.StateMachine<DocumentUploadContex
38
38
  id: string | undefined;
39
39
  };
40
40
  }>, xstate271.Values<{
41
- setError: {
42
- type: "setError";
43
- params: xstate271.NonReducibleUnknown;
44
- };
45
41
  setStream: {
46
42
  type: "setStream";
47
43
  params: xstate271.NonReducibleUnknown;
@@ -58,11 +54,15 @@ declare const documentUploadMachine: xstate271.StateMachine<DocumentUploadContex
58
54
  type: "stopStream";
59
55
  params: xstate271.NonReducibleUnknown;
60
56
  };
57
+ setError: {
58
+ type: "setError";
59
+ params: xstate271.NonReducibleUnknown;
60
+ };
61
61
  setImageAndClearError: {
62
62
  type: "setImageAndClearError";
63
63
  params: xstate271.NonReducibleUnknown;
64
64
  };
65
- }>, never, never, "error" | "idle" | "finished" | "initCamera" | "capturing" | "closed" | "uploading", string, DocumentUploadInput, xstate271.NonReducibleUnknown, xstate271.EventObject, xstate271.MetaObject, {
65
+ }>, never, never, "error" | "initCamera" | "capturing" | "finished" | "closed" | "uploading" | "idle", string, DocumentUploadInput, xstate271.NonReducibleUnknown, xstate271.EventObject, xstate271.MetaObject, {
66
66
  readonly id: "documentUpload";
67
67
  readonly initial: "idle";
68
68
  readonly context: ({
package/dist/ekyb.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { t as Manager } from "./Manager-CVog-etk.js";
2
- import { t as FieldDef } from "./types-vXjqO0B-.js";
2
+ import { t as FieldDef } from "./types-WhAUdEJw.js";
3
3
 
4
4
  //#region src/modules/ekyb/types.d.ts
5
5
  type UboEntry = {
package/dist/ekyc.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { t as Manager } from "./Manager-CVog-etk.js";
2
- import { t as FieldDef } from "./types-vXjqO0B-.js";
2
+ import { t as FieldDef } from "./types-WhAUdEJw.js";
3
3
 
4
4
  //#region src/modules/ekyc/types.d.ts
5
5
  type EkycFieldSource = 'user_input' | 'document_scan' | 'poa_document' | 'phone_module_input' | 'email_module_input' | false;
package/dist/ekyc.esm.js CHANGED
@@ -9784,6 +9784,90 @@ function isValidPhoneNumber() {
9784
9784
  return withMetadataArgument(isValidPhoneNumber$1, arguments);
9785
9785
  }
9786
9786
 
9787
+ //#endregion
9788
+ //#region src/modules/ekyc/ekycConsts.ts
9789
+ const COUNTRY_SELECTOR_DISABLED_SOURCES = ["UK_VOTER_REGISTER"];
9790
+ const STATE_CODE_HINTS = {
9791
+ US: "CA, NY",
9792
+ CA: "ON, QC",
9793
+ BR: "RJ, SP",
9794
+ MX: "JAL, NLE",
9795
+ GB: "ENG, SCT",
9796
+ ES: "MD, CT",
9797
+ AR: "B, C, K"
9798
+ };
9799
+ const ADDRESS_FIELDS = [
9800
+ "address",
9801
+ "houseNo",
9802
+ "street",
9803
+ "address2",
9804
+ "city",
9805
+ "state",
9806
+ "postalCode"
9807
+ ];
9808
+ const DRIVERS_LICENSE_FIELDS = [
9809
+ "dlNumber",
9810
+ "dlState",
9811
+ "dlExpireAt"
9812
+ ];
9813
+ const REQUIRED_ERROR_KEYS = new Set(["verification.errors.required"]);
9814
+ const FIELD_REQUIRED_DISPLAY_KEY = {
9815
+ firstName: "verification.errors.firstNameRequired",
9816
+ surName: "verification.errors.surNameRequired",
9817
+ maternalSurname: "verification.errors.maternalSurnameRequired",
9818
+ dateOfBirth: "verification.errors.dateOfBirthRequired",
9819
+ street: "verification.errors.streetRequired",
9820
+ city: "verification.errors.cityRequired",
9821
+ state: "verification.errors.stateRequired",
9822
+ houseNo: "verification.errors.houseNoRequired",
9823
+ ssn: "verification.errors.ssnRequired",
9824
+ taxId: "verification.errors.taxIdRequired",
9825
+ last4SSN: "verification.errors.last4SSNRequired",
9826
+ nationality: "verification.errors.nationality",
9827
+ phone: "verification.errors.phoneRequired",
9828
+ email: "verification.errors.emailRequired",
9829
+ dlNumber: "verification.errors.dlNumber",
9830
+ dlState: "verification.errors.dlStateRequired",
9831
+ dlExpireAt: "verification.errors.dlExpireAtRequired",
9832
+ idNum: "verification.errors.prcId"
9833
+ };
9834
+ const POSTAL_CODE_FORMAT_ERROR_KEYS = new Set([
9835
+ "verification.errors.zipCodeInvalidFormat",
9836
+ "verification.errors.postalCodeInvalidFormat",
9837
+ "verification.errors.CAPostalCodeInvalidFormat",
9838
+ "verification.errors.ESPostalCodeInvalidFormat",
9839
+ "verification.errors.UKPostalCodeInvalidFormat",
9840
+ "verification.errors.ARPostalCodeInvalidFormat"
9841
+ ]);
9842
+ const POSTAL_CODE_MAX_LENGTH_BY_COUNTRY = {
9843
+ US: 10,
9844
+ BR: 9,
9845
+ CA: 7,
9846
+ ES: 5,
9847
+ GB: 8,
9848
+ UK: 8,
9849
+ AR: 8
9850
+ };
9851
+ const DEFAULT_POSTAL_CODE_MAX_LENGTH = 8;
9852
+ const INVALID_CPF_PATTERNS = [
9853
+ "00000000000",
9854
+ "11111111111",
9855
+ "22222222222",
9856
+ "33333333333",
9857
+ "44444444444",
9858
+ "55555555555",
9859
+ "66666666666",
9860
+ "77777777777",
9861
+ "88888888888",
9862
+ "99999999999"
9863
+ ];
9864
+ const DOB_OPTIONAL_SOURCES = ["US_TELCO_1", "UK_VOTER_REGISTER"];
9865
+ const ADDRESS_OPTIONAL_SOURCES = ["US_TELCO_1", "UK_VOTER_REGISTER"];
9866
+ const LAST4SSN_OPTIONAL_SOURCES = ["US_TELCO_1"];
9867
+ const DRIVERS_LICENSE_OPTIONAL_SOURCES = ["US_TELCO_1"];
9868
+ const EMAIL_OPTIONAL_SOURCES = ["US_TELCO_1"];
9869
+ const PHONE_OPTIONAL_SOURCES = ["CA_RES_CREDIT", "UK_VOTER_REGISTER"];
9870
+
9787
9871
  //#endregion
9788
9872
  //#region src/modules/ekyc/ekycUtils.ts
9789
9873
  function mapToEKYCvalue(field) {
@@ -9832,26 +9916,6 @@ function getEKYCCountry(source) {
9832
9916
  default: return "US";
9833
9917
  }
9834
9918
  }
9835
- const ADDRESS_FIELDS = [
9836
- "address",
9837
- "houseNo",
9838
- "street",
9839
- "address2",
9840
- "city",
9841
- "state",
9842
- "postalCode"
9843
- ];
9844
- const DRIVERS_LICENSE_FIELDS = [
9845
- "dlNumber",
9846
- "dlState",
9847
- "dlExpireAt"
9848
- ];
9849
- const DOB_OPTIONAL_SOURCES = ["US_TELCO_1", "UK_VOTER_REGISTER"];
9850
- const ADDRESS_OPTIONAL_SOURCES = ["US_TELCO_1", "UK_VOTER_REGISTER"];
9851
- const LAST4SSN_OPTIONAL_SOURCES = ["US_TELCO_1"];
9852
- const DRIVERS_LICENSE_OPTIONAL_SOURCES = ["US_TELCO_1"];
9853
- const EMAIL_OPTIONAL_SOURCES = ["US_TELCO_1"];
9854
- const PHONE_OPTIONAL_SOURCES = ["CA_RES_CREDIT", "UK_VOTER_REGISTER"];
9855
9919
  /** Determines if a field is optional given the current config source */
9856
9920
  function isFieldOptional(fieldName, configSource) {
9857
9921
  if (fieldName === "middleName") return true;
@@ -9866,18 +9930,6 @@ function isFieldOptional(fieldName, configSource) {
9866
9930
 
9867
9931
  //#endregion
9868
9932
  //#region src/modules/ekyc/ekycValidators.ts
9869
- const INVALID_CPF_PATTERNS = [
9870
- "00000000000",
9871
- "11111111111",
9872
- "22222222222",
9873
- "33333333333",
9874
- "44444444444",
9875
- "55555555555",
9876
- "66666666666",
9877
- "77777777777",
9878
- "88888888888",
9879
- "99999999999"
9880
- ];
9881
9933
  /**
9882
9934
  * Validates a Brazilian CPF number (11-digit checksum).
9883
9935
  * Accepts formatted (000.000.000-00) or unformatted input.
@@ -9925,7 +9977,6 @@ const CA_POSTAL_CODE_REGEX = /^[A-Za-z]\d[A-Za-z] \d[A-Za-z]\d$/;
9925
9977
  const ES_POSTAL_CODE_REGEX = /^\d{5}$/;
9926
9978
  const UK_POSTAL_CODE_REGEX = /^(?:[A-Z]{2}\d|[A-Z]{2}\d{2}|[A-Z]\d|[A-Z]\d{2}|[A-Z]\d[A-Z]|[A-Z]{2}\d[A-Z]) \d[A-Z]{2}$/;
9927
9979
  const AR_POSTAL_CODE_REGEX = /^[A-Za-z]\d{4}[A-Za-z]{3}$/;
9928
- const DEFAULT_POSTAL_CODE_MAX = 8;
9929
9980
  /**
9930
9981
  * Validates postal code by country:
9931
9982
  * - US: 5-digit, 9-digit, or ZIP+4
@@ -9945,8 +9996,7 @@ function validatePostalCode(postalCode, country) {
9945
9996
  if (country === "GB" || country === "UK") return UK_POSTAL_CODE_REGEX.test(postalCode.toUpperCase());
9946
9997
  if (country === "AR") return AR_POSTAL_CODE_REGEX.test(postalCode.replace(/\s/g, "").toUpperCase());
9947
9998
  const stripped = postalCode.replace(/\D/g, "");
9948
- const maxLen = DEFAULT_POSTAL_CODE_MAX;
9949
- return /^\d+$/.test(stripped) && [5, maxLen].includes(stripped.length);
9999
+ return /^\d+$/.test(stripped) && [5, DEFAULT_POSTAL_CODE_MAX_LENGTH].includes(stripped.length);
9950
10000
  }
9951
10001
  /**
9952
10002
  * Normalizes ZIP input to digits and an optional dash after 5 digits.
@@ -9980,7 +10030,7 @@ function formatPostalCode(value, country) {
9980
10030
  return `${normalized.slice(0, -3)} ${normalized.slice(-3)}`;
9981
10031
  }
9982
10032
  if (country === "AR") return value.replace(/[^A-Za-z0-9]/g, "").toUpperCase().slice(0, 8);
9983
- return value.replace(/\D/g, "").slice(0, DEFAULT_POSTAL_CODE_MAX);
10033
+ return value.replace(/\D/g, "").slice(0, DEFAULT_POSTAL_CODE_MAX_LENGTH);
9984
10034
  }
9985
10035
  /** Validates a phone number using libphonenumber-js country rules */
9986
10036
  function validatePhone(phone, country) {
@@ -10020,27 +10070,15 @@ function parsePrefilledPhone(phone) {
10020
10070
 
10021
10071
  //#endregion
10022
10072
  //#region src/modules/ekyc/ekycActions.ts
10023
- const COUNTRY_SELECTOR_DISABLED_SOURCES = ["UK_VOTER_REGISTER"];
10024
- const STATE_CODE_HINTS = {
10025
- US: "CA, NY",
10026
- CA: "ON, QC",
10027
- BR: "RJ, SP",
10028
- MX: "JAL, NLE",
10029
- GB: "LND, MAN",
10030
- ES: "MD, CT",
10031
- AR: "B, C, K"
10032
- };
10033
- const REQUIRED_ERROR_KEYS = new Set(["verification.errors.required"]);
10034
- const POSTAL_CODE_MAX_LENGTH_BY_COUNTRY = {
10035
- US: 10,
10036
- BR: 9,
10037
- CA: 7,
10038
- ES: 5,
10039
- GB: 8,
10040
- UK: 8,
10041
- AR: 8
10042
- };
10043
- const DEFAULT_POSTAL_CODE_MAX_LENGTH = 8;
10073
+ function getRequiredDisplayKey(field, country) {
10074
+ if (field === "postalCode") return country === "US" ? "verification.errors.zipCodeRequired" : "verification.errors.postalCodeRequired";
10075
+ else if (field === "ssn") {
10076
+ if (country === "BR") return "verification.errors.taxIdRequired";
10077
+ else if (country === "CN") return "verification.errors.prcId";
10078
+ return "verification.errors.ssnRequired";
10079
+ }
10080
+ return FIELD_REQUIRED_DISPLAY_KEY[field] ?? "verification.errors.required";
10081
+ }
10044
10082
  function getPostalCodeMaxLength(country) {
10045
10083
  return POSTAL_CODE_MAX_LENGTH_BY_COUNTRY[country] ?? DEFAULT_POSTAL_CODE_MAX_LENGTH;
10046
10084
  }
@@ -10072,7 +10110,8 @@ function buildFieldDefs(fields, configSource, country, enablePhoneRisk = false)
10072
10110
  });
10073
10111
  if (configSource === "US_CREDIT_BUREAU_1" || configSource === "CA_RES_CREDIT") add("middleName", "text", "verification.labels.middleName", fields.name, {
10074
10112
  maxLength: 100,
10075
- placeholder: "verification.placeholder.middleName"
10113
+ placeholder: "verification.placeholder.middleName",
10114
+ optional: true
10076
10115
  });
10077
10116
  add("surName", "text", country === "US" ? "verification.labels.lastName" : "verification.labels.surName", fields.name, {
10078
10117
  maxLength: 100,
@@ -10176,20 +10215,12 @@ function computeValidation(fields, values, country, configSource) {
10176
10215
  isValid: Object.keys(errors).length === 0
10177
10216
  };
10178
10217
  }
10179
- const POSTAL_CODE_FORMAT_ERROR_KEYS = new Set([
10180
- "verification.errors.zipCodeInvalidFormat",
10181
- "verification.errors.postalCodeInvalidFormat",
10182
- "verification.errors.CAPostalCodeInvalidFormat",
10183
- "verification.errors.ESPostalCodeInvalidFormat",
10184
- "verification.errors.UKPostalCodeInvalidFormat",
10185
- "verification.errors.ARPostalCodeInvalidFormat"
10186
- ]);
10187
10218
  function computeDisplayErrors(errors, touched, submitAttempted, country) {
10188
10219
  const display = {};
10189
10220
  const errorParams = {};
10190
10221
  for (const [field, err] of Object.entries(errors)) {
10191
10222
  const isRequiredErr = REQUIRED_ERROR_KEYS.has(err);
10192
- if (isRequiredErr && submitAttempted) display[field] = err;
10223
+ if (isRequiredErr && (submitAttempted || touched[field])) display[field] = getRequiredDisplayKey(field, country);
10193
10224
  else if (!isRequiredErr && touched[field]) display[field] = err;
10194
10225
  if (display[field] && field === "postalCode" && POSTAL_CODE_FORMAT_ERROR_KEYS.has(err)) {
10195
10226
  let length = getPostalCodeMaxLength(country);
@@ -2,7 +2,7 @@ import { i as IRecordingCapability, n as PermissionStatus, r as IStorageCapabili
2
2
  import { t as WasmPipeline } from "./warmup-CO10kO5G.js";
3
3
  import { t as Manager } from "./Manager-CVog-etk.js";
4
4
  import { t as CameraStream } from "./camera-HI2fNiV5.js";
5
- import { t as Flow } from "./types-BcGRS3lW.js";
5
+ import { t as Flow } from "./types-DrdrHHxZ.js";
6
6
 
7
7
  //#region ../infra/src/capabilities/IWasmUtilCapability.d.ts
8
8
  type WasmUtilConfig = MLProviderConfig & {
package/dist/flow.d.ts CHANGED
@@ -3,7 +3,7 @@ import { t as Manager } from "./Manager-CVog-etk.js";
3
3
  import "./camera-HI2fNiV5.js";
4
4
  import { t as AnyStateMachine } from "./StateMachine-Coiuk0UD.js";
5
5
  import "./types-B_l5fu_D.js";
6
- import { n as FlowModule, r as FlowModuleConfig, t as Flow } from "./types-BcGRS3lW.js";
6
+ import { n as FlowModule, r as FlowModuleConfig, t as Flow } from "./types-DrdrHHxZ.js";
7
7
  import { n as GetFinishStatusFn, t as FinishStatus } from "./flowCompletionService-DtL1jOz4.js";
8
8
 
9
9
  //#region src/modules/flow/flowUtils.d.ts
@@ -25,12 +25,12 @@ import { n as GetFinishStatusFn, t as FinishStatus } from "./flowCompletionServi
25
25
  */
26
26
  declare function getRequiredWasmPipelines(flow: Flow): WasmPipeline[];
27
27
  /**
28
- * Normalizes flow modules by expanding TUTORIAL_ID into ID + SECOND_ID + THIRD_ID
28
+ * Normalizes flow modules by expanding TUTORIAL_ID into ID + SECOND_ID
29
29
  * based on configuration flags. Matches legacy flowService behavior.
30
30
  *
31
31
  * - TUTORIAL_ID becomes ID (with same config)
32
32
  * - If secondId: true, adds SECOND_ID module with isSecondId: true
33
- * - If thirdId: true, adds THIRD_ID module with documentType: 'thirdId'
33
+ * - thirdId is deprecated and ignored; the flow continues to the next step
34
34
  * - Bare ID following TUTORIAL_ID is dropped (already merged)
35
35
  */
36
36
  declare function normalizeFlowModules(modules: FlowModule[]): FlowModule[];
package/dist/flow.esm.js CHANGED
@@ -38,12 +38,12 @@ function getRequiredWasmPipelines(flow) {
38
38
  return [...pipelines];
39
39
  }
40
40
  /**
41
- * Normalizes flow modules by expanding TUTORIAL_ID into ID + SECOND_ID + THIRD_ID
41
+ * Normalizes flow modules by expanding TUTORIAL_ID into ID + SECOND_ID
42
42
  * based on configuration flags. Matches legacy flowService behavior.
43
43
  *
44
44
  * - TUTORIAL_ID becomes ID (with same config)
45
45
  * - If secondId: true, adds SECOND_ID module with isSecondId: true
46
- * - If thirdId: true, adds THIRD_ID module with documentType: 'thirdId'
46
+ * - thirdId is deprecated and ignored; the flow continues to the next step
47
47
  * - Bare ID following TUTORIAL_ID is dropped (already merged)
48
48
  */
49
49
  function normalizeFlowModules(modules) {
@@ -61,10 +61,6 @@ function normalizeFlowModules(modules) {
61
61
  isSecondId: true
62
62
  }
63
63
  });
64
- if (idConfig.thirdId) result.push({
65
- key: "THIRD_ID",
66
- configuration: { documentType: "thirdId" }
67
- });
68
64
  return result;
69
65
  }
70
66
  const prev = arr[idx - 1];
package/dist/id.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as IdCaptureGeometry, B as DetectionOrientation, C as DetectionArea, D as IdCaptureContext, E as IdCaptureConfig, F as IdError, I as IdErrorCode, L as IdFlowStep, M as IdCaptureMode, N as IdCaptureThresholds, O as IdCaptureDependencies, P as IdDocumentType, R as RecordingSession, S as CapturedImage, T as ID_ERROR_CODES, V as IdCaptureSettings, _ as IdCaptureActor, a as InitializeIdCaptureParams, b as idCaptureMachine, c as ValidationError, d as startRecordingSession, f as stopRecording, g as CreateIdCaptureActorOptions, h as validateUploadResponse, i as IdCaptureInitResult, j as IdCaptureInput, k as IdCaptureEvent, l as initializeIdCapture, m as uploadIdImage, n as IdCaptureState, o as StartRecordingParams, p as stopStream, r as createIdCaptureManager, s as UploadIdImageParams, t as IdCaptureManager, u as processId, v as createIdCaptureActor, w as DetectionStatus, x as CaptureIdResponse, y as IdCaptureMachine, z as UploadIdResponse } from "./index-_guGVj8K.js";
1
+ import { A as IdCaptureGeometry, B as DetectionOrientation, C as DetectionArea, D as IdCaptureContext, E as IdCaptureConfig, F as IdError, I as IdErrorCode, L as IdFlowStep, M as IdCaptureMode, N as IdCaptureThresholds, O as IdCaptureDependencies, P as IdDocumentType, R as RecordingSession, S as CapturedImage, T as ID_ERROR_CODES, V as IdCaptureSettings, _ as IdCaptureActor, a as InitializeIdCaptureParams, b as idCaptureMachine, c as ValidationError, d as startRecordingSession, f as stopRecording, g as CreateIdCaptureActorOptions, h as validateUploadResponse, i as IdCaptureInitResult, j as IdCaptureInput, k as IdCaptureEvent, l as initializeIdCapture, m as uploadIdImage, n as IdCaptureState, o as StartRecordingParams, p as stopStream, r as createIdCaptureManager, s as UploadIdImageParams, t as IdCaptureManager, u as processId, v as createIdCaptureActor, w as DetectionStatus, x as CaptureIdResponse, y as IdCaptureMachine, z as UploadIdResponse } from "./index-C_QjKcTy.js";
2
2
  import "./deepsightService-Dv1ILk27.js";
3
3
  import { n as PermissionStatus, t as PermissionResult } from "./types-dSdX5z-n.js";
4
4
  import "./Manager-CVog-etk.js";
@@ -6,5 +6,5 @@ import { t as CameraStream } from "./camera-HI2fNiV5.js";
6
6
  import "./Actor-SKZvDOCc.js";
7
7
  import "./StateMachine-Coiuk0UD.js";
8
8
  import "./types-B_l5fu_D.js";
9
- import "./types-BcGRS3lW.js";
9
+ import "./types-DrdrHHxZ.js";
10
10
  export { CameraStream, CaptureIdResponse, CapturedImage, CreateIdCaptureActorOptions, DetectionArea, DetectionOrientation, DetectionStatus, ID_ERROR_CODES, IdCaptureActor, IdCaptureConfig, IdCaptureContext, IdCaptureDependencies, IdCaptureEvent, IdCaptureGeometry, IdCaptureInitResult, IdCaptureInput, IdCaptureMachine, IdCaptureManager, IdCaptureMode, IdCaptureSettings, IdCaptureState, IdCaptureThresholds, IdDocumentType, IdError, IdErrorCode, IdFlowStep, InitializeIdCaptureParams, PermissionResult, PermissionStatus, RecordingSession, StartRecordingParams, UploadIdImageParams, UploadIdResponse, ValidationError, createIdCaptureActor, createIdCaptureManager, idCaptureMachine, initializeIdCapture, processId, startRecordingSession, stopRecording, stopStream, uploadIdImage, validateUploadResponse };
@@ -4,7 +4,7 @@ import { t as Manager } from "./Manager-CVog-etk.js";
4
4
  import { t as CameraStream } from "./camera-HI2fNiV5.js";
5
5
  import { t as ActorRefFrom } from "./Actor-SKZvDOCc.js";
6
6
  import { n as StateMachine, t as AnyStateMachine } from "./StateMachine-Coiuk0UD.js";
7
- import { i as TutorialIdConfig, t as Flow } from "./types-BcGRS3lW.js";
7
+ import { i as TutorialIdConfig, t as Flow } from "./types-DrdrHHxZ.js";
8
8
 
9
9
  //#region ../infra/src/capabilities/IAnalyticsCapability.d.ts
10
10
  interface IAnalyticsCapability {
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as IdCaptureGeometry, B as DetectionOrientation, C as DetectionArea, D as IdCaptureContext, E as IdCaptureConfig, F as IdError, I as IdErrorCode, L as IdFlowStep, M as IdCaptureMode, N as IdCaptureThresholds, O as IdCaptureDependencies, P as IdDocumentType, R as RecordingSession, S as CapturedImage, T as ID_ERROR_CODES, V as IdCaptureSettings, _ as IdCaptureActor, a as InitializeIdCaptureParams, b as idCaptureMachine, c as ValidationError, d as startRecordingSession, f as stopRecording, g as CreateIdCaptureActorOptions, h as validateUploadResponse, i as IdCaptureInitResult, j as IdCaptureInput, k as IdCaptureEvent, l as initializeIdCapture, m as uploadIdImage, n as IdCaptureState, o as StartRecordingParams, p as stopStream, r as createIdCaptureManager, s as UploadIdImageParams, t as IdCaptureManager, u as processId, v as createIdCaptureActor, w as DetectionStatus, x as CaptureIdResponse, y as IdCaptureMachine, z as UploadIdResponse } from "./index-_guGVj8K.js";
1
+ import { A as IdCaptureGeometry, B as DetectionOrientation, C as DetectionArea, D as IdCaptureContext, E as IdCaptureConfig, F as IdError, I as IdErrorCode, L as IdFlowStep, M as IdCaptureMode, N as IdCaptureThresholds, O as IdCaptureDependencies, P as IdDocumentType, R as RecordingSession, S as CapturedImage, T as ID_ERROR_CODES, V as IdCaptureSettings, _ as IdCaptureActor, a as InitializeIdCaptureParams, b as idCaptureMachine, c as ValidationError, d as startRecordingSession, f as stopRecording, g as CreateIdCaptureActorOptions, h as validateUploadResponse, i as IdCaptureInitResult, j as IdCaptureInput, k as IdCaptureEvent, l as initializeIdCapture, m as uploadIdImage, n as IdCaptureState, o as StartRecordingParams, p as stopStream, r as createIdCaptureManager, s as UploadIdImageParams, t as IdCaptureManager, u as processId, v as createIdCaptureActor, w as DetectionStatus, x as CaptureIdResponse, y as IdCaptureMachine, z as UploadIdResponse } from "./index-C_QjKcTy.js";
2
2
  import "./deepsightService-Dv1ILk27.js";
3
3
  import { n as PermissionStatus, t as PermissionResult } from "./types-dSdX5z-n.js";
4
4
  import { n as warmupWasm, t as WasmPipeline } from "./warmup-CO10kO5G.js";
@@ -7,7 +7,7 @@ import { t as CameraStream } from "./camera-HI2fNiV5.js";
7
7
  import "./Actor-SKZvDOCc.js";
8
8
  import "./StateMachine-Coiuk0UD.js";
9
9
  import "./types-B_l5fu_D.js";
10
- import "./types-BcGRS3lW.js";
10
+ import "./types-DrdrHHxZ.js";
11
11
 
12
12
  //#region ../infra/src/capabilities/IScreenOrientationCapability.d.ts
13
13
  type ScreenOrientationState = 'portrait' | 'landscape';
package/dist/selfie.d.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  import { i as IncodeCanvas, n as StreamCanvasCapture, t as DeepsightService } from "./deepsightService-Dv1ILk27.js";
2
2
  import { n as PermissionStatus, o as IMLProviderCapability, s as MLProviderConfig, t as PermissionResult } from "./types-dSdX5z-n.js";
3
3
  import { t as WasmPipeline } from "./warmup-CO10kO5G.js";
4
- import { a as FaceCaptureDependencies, i as DetectionStatus, n as FaceCaptureManagerState, o as FaceErrorCode, r as BaseFaceCaptureConfig, t as FaceCaptureManager } from "./faceCaptureManagerFactory-CftLkmnH.js";
4
+ import { a as FaceCaptureDependencies, i as DetectionStatus, n as FaceCaptureManagerState, o as FaceErrorCode, r as BaseFaceCaptureConfig, t as FaceCaptureManager } from "./faceCaptureManagerFactory-FEuTMK4j.js";
5
5
  import { t as Manager } from "./Manager-CVog-etk.js";
6
6
  import { t as CameraStream } from "./camera-HI2fNiV5.js";
7
7
  import { n as StateMachine, t as AnyStateMachine } from "./StateMachine-Coiuk0UD.js";
8
8
  import "./types-B_l5fu_D.js";
9
- import { r as FlowModuleConfig } from "./types-BcGRS3lW.js";
9
+ import { r as FlowModuleConfig } from "./types-DrdrHHxZ.js";
10
10
 
11
11
  //#region ../infra/src/capabilities/IFaceDetectionCapability.d.ts
12
12
  /**
@@ -12,6 +12,7 @@ type TutorialIdConfig = {
12
12
  barcodeCapture: boolean;
13
13
  fetchAdditionalPage: boolean;
14
14
  secondId: boolean;
15
+ /** @deprecated Third ID capture is deprecated; config is ignored and flow continues to next step */
15
16
  thirdId: boolean;
16
17
  autoCaptureTimeout: number;
17
18
  deviceIdleTimeout: number;
@@ -153,6 +154,7 @@ type FlowModuleConfig = {
153
154
  TUTORIAL_ID: TutorialIdConfig;
154
155
  ID: TutorialIdConfig;
155
156
  SECOND_ID: TutorialIdConfig;
157
+ /** @deprecated Third ID step is deprecated; SDK skips this step and continues flow */
156
158
  THIRD_ID: DocumentUploadConfig;
157
159
  ID_OCR: {
158
160
  editableOcr: boolean;
@@ -7,6 +7,7 @@ type FieldDef = {
7
7
  placeholder?: string;
8
8
  placeholderParams?: Record<string, string>;
9
9
  required: boolean;
10
+ optional?: boolean;
10
11
  maxLength?: number;
11
12
  options?: {
12
13
  value: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@incodetech/core",
3
- "version": "0.0.0-dev-20260311-b46342c",
3
+ "version": "0.0.0-dev-20260311-787552e",
4
4
  "type": "module",
5
5
  "main": "./dist/index.esm.js",
6
6
  "types": "./dist/index.d.ts",