@incodetech/core 0.0.0-dev-20260318-deddf15 → 0.0.0-dev-20260318-ce9c1ed

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,6 +1,6 @@
1
1
  import { t as Manager } from "./Manager-DsNvecSe.js";
2
2
  import { t as CameraStream } from "./camera-Bzi6CMAW.js";
3
- import * as xstate276 from "xstate";
3
+ import * as xstate63 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: xstate276.StateMachine<DocumentCaptureContext, {
75
+ declare const documentCaptureMachine: xstate63.StateMachine<DocumentCaptureContext, {
76
76
  type: "CAPTURE";
77
77
  } | {
78
78
  type: "FILE_SELECTED";
@@ -95,27 +95,27 @@ declare const documentCaptureMachine: xstate276.StateMachine<DocumentCaptureCont
95
95
  } | {
96
96
  type: "CLOSE";
97
97
  }, {
98
- [x: string]: xstate276.ActorRefFromLogic<xstate276.PromiseActorLogic<MediaStream, void, xstate276.EventObject>> | xstate276.ActorRefFromLogic<xstate276.PromiseActorLogic<DocumentUploadResponse, {
98
+ [x: string]: xstate63.ActorRefFromLogic<xstate63.PromiseActorLogic<MediaStream, void, xstate63.EventObject>> | xstate63.ActorRefFromLogic<xstate63.PromiseActorLogic<DocumentUploadResponse, {
99
99
  capturedDocument: NonNullable<DocumentCaptureContext["capturedDocument"]>;
100
100
  processingType: string;
101
101
  onProgress: (progress: number) => void;
102
- }, xstate276.EventObject>> | undefined;
103
- }, xstate276.Values<{
102
+ }, xstate63.EventObject>> | undefined;
103
+ }, xstate63.Values<{
104
104
  initCamera: {
105
105
  src: "initCamera";
106
- logic: xstate276.PromiseActorLogic<MediaStream, void, xstate276.EventObject>;
106
+ logic: xstate63.PromiseActorLogic<MediaStream, void, xstate63.EventObject>;
107
107
  id: string | undefined;
108
108
  };
109
109
  uploadDocument: {
110
110
  src: "uploadDocument";
111
- logic: xstate276.PromiseActorLogic<DocumentUploadResponse, {
111
+ logic: xstate63.PromiseActorLogic<DocumentUploadResponse, {
112
112
  capturedDocument: NonNullable<DocumentCaptureContext["capturedDocument"]>;
113
113
  processingType: string;
114
114
  onProgress: (progress: number) => void;
115
- }, xstate276.EventObject>;
115
+ }, xstate63.EventObject>;
116
116
  id: string | undefined;
117
117
  };
118
- }>, xstate276.Values<{
118
+ }>, xstate63.Values<{
119
119
  setStream: {
120
120
  type: "setStream";
121
121
  params: unknown;
@@ -196,7 +196,7 @@ declare const documentCaptureMachine: xstate276.StateMachine<DocumentCaptureCont
196
196
  type: "trackFailure";
197
197
  params: unknown;
198
198
  };
199
- }>, xstate276.Values<{
199
+ }>, xstate63.Values<{
200
200
  allowSkip: {
201
201
  type: "allowSkip";
202
202
  params: unknown;
@@ -225,11 +225,15 @@ declare const documentCaptureMachine: xstate276.StateMachine<DocumentCaptureCont
225
225
  type: "isCameraMode";
226
226
  params: unknown;
227
227
  };
228
+ isCaptureMethodFile: {
229
+ type: "isCaptureMethodFile";
230
+ params: unknown;
231
+ };
228
232
  isPendingNextPage: {
229
233
  type: "isPendingNextPage";
230
234
  params: unknown;
231
235
  };
232
- }>, never, "initCamera" | "capturing" | "closed" | "uploading" | "finished" | "tutorial" | "preview" | "failure" | "success", string, DocumentCaptureInput, xstate276.NonReducibleUnknown, xstate276.EventObject, xstate276.MetaObject, {
236
+ }>, never, "initCamera" | "capturing" | "closed" | "uploading" | "finished" | "tutorial" | "preview" | "failure" | "success", string, DocumentCaptureInput, xstate63.NonReducibleUnknown, xstate63.EventObject, xstate63.MetaObject, {
233
237
  readonly id: "documentCapture";
234
238
  readonly initial: "tutorial";
235
239
  readonly context: ({
@@ -238,67 +242,67 @@ declare const documentCaptureMachine: xstate276.StateMachine<DocumentCaptureCont
238
242
  spawn: {
239
243
  <TSrc extends "initCamera" | "uploadDocument">(logic: TSrc, ...[options]: ({
240
244
  src: "initCamera";
241
- logic: xstate276.PromiseActorLogic<MediaStream, void, xstate276.EventObject>;
245
+ logic: xstate63.PromiseActorLogic<MediaStream, void, xstate63.EventObject>;
242
246
  id: string | undefined;
243
247
  } extends infer T ? T extends {
244
248
  src: "initCamera";
245
- logic: xstate276.PromiseActorLogic<MediaStream, void, xstate276.EventObject>;
249
+ logic: xstate63.PromiseActorLogic<MediaStream, void, xstate63.EventObject>;
246
250
  id: string | undefined;
247
251
  } ? T extends {
248
252
  src: TSrc;
249
- } ? xstate276.ConditionalRequired<[options?: ({
253
+ } ? xstate63.ConditionalRequired<[options?: ({
250
254
  id?: T["id"] | undefined;
251
255
  systemId?: string;
252
- input?: xstate276.InputFrom<T["logic"]> | undefined;
256
+ input?: xstate63.InputFrom<T["logic"]> | undefined;
253
257
  syncSnapshot?: boolean;
254
- } & { [K in xstate276.RequiredActorOptions<T>]: unknown }) | undefined], xstate276.IsNotNever<xstate276.RequiredActorOptions<T>>> : never : never : never) | ({
258
+ } & { [K in xstate63.RequiredActorOptions<T>]: unknown }) | undefined], xstate63.IsNotNever<xstate63.RequiredActorOptions<T>>> : never : never : never) | ({
255
259
  src: "uploadDocument";
256
- logic: xstate276.PromiseActorLogic<DocumentUploadResponse, {
260
+ logic: xstate63.PromiseActorLogic<DocumentUploadResponse, {
257
261
  capturedDocument: NonNullable<DocumentCaptureContext["capturedDocument"]>;
258
262
  processingType: string;
259
263
  onProgress: (progress: number) => void;
260
- }, xstate276.EventObject>;
264
+ }, xstate63.EventObject>;
261
265
  id: string | undefined;
262
266
  } extends infer T_1 ? T_1 extends {
263
267
  src: "uploadDocument";
264
- logic: xstate276.PromiseActorLogic<DocumentUploadResponse, {
268
+ logic: xstate63.PromiseActorLogic<DocumentUploadResponse, {
265
269
  capturedDocument: NonNullable<DocumentCaptureContext["capturedDocument"]>;
266
270
  processingType: string;
267
271
  onProgress: (progress: number) => void;
268
- }, xstate276.EventObject>;
272
+ }, xstate63.EventObject>;
269
273
  id: string | undefined;
270
274
  } ? T_1 extends {
271
275
  src: TSrc;
272
- } ? xstate276.ConditionalRequired<[options?: ({
276
+ } ? xstate63.ConditionalRequired<[options?: ({
273
277
  id?: T_1["id"] | undefined;
274
278
  systemId?: string;
275
- input?: xstate276.InputFrom<T_1["logic"]> | undefined;
279
+ input?: xstate63.InputFrom<T_1["logic"]> | undefined;
276
280
  syncSnapshot?: boolean;
277
- } & { [K_1 in xstate276.RequiredActorOptions<T_1>]: unknown }) | undefined], xstate276.IsNotNever<xstate276.RequiredActorOptions<T_1>>> : never : never : never)): xstate276.ActorRefFromLogic<xstate276.GetConcreteByKey<xstate276.Values<{
281
+ } & { [K_1 in xstate63.RequiredActorOptions<T_1>]: unknown }) | undefined], xstate63.IsNotNever<xstate63.RequiredActorOptions<T_1>>> : never : never : never)): xstate63.ActorRefFromLogic<xstate63.GetConcreteByKey<xstate63.Values<{
278
282
  initCamera: {
279
283
  src: "initCamera";
280
- logic: xstate276.PromiseActorLogic<MediaStream, void, xstate276.EventObject>;
284
+ logic: xstate63.PromiseActorLogic<MediaStream, void, xstate63.EventObject>;
281
285
  id: string | undefined;
282
286
  };
283
287
  uploadDocument: {
284
288
  src: "uploadDocument";
285
- logic: xstate276.PromiseActorLogic<DocumentUploadResponse, {
289
+ logic: xstate63.PromiseActorLogic<DocumentUploadResponse, {
286
290
  capturedDocument: NonNullable<DocumentCaptureContext["capturedDocument"]>;
287
291
  processingType: string;
288
292
  onProgress: (progress: number) => void;
289
- }, xstate276.EventObject>;
293
+ }, xstate63.EventObject>;
290
294
  id: string | undefined;
291
295
  };
292
296
  }>, "src", TSrc>["logic"]>;
293
- <TLogic extends xstate276.AnyActorLogic>(src: TLogic, ...[options]: xstate276.ConditionalRequired<[options?: ({
297
+ <TLogic extends xstate63.AnyActorLogic>(src: TLogic, ...[options]: xstate63.ConditionalRequired<[options?: ({
294
298
  id?: never;
295
299
  systemId?: string;
296
- input?: xstate276.InputFrom<TLogic> | undefined;
300
+ input?: xstate63.InputFrom<TLogic> | undefined;
297
301
  syncSnapshot?: boolean;
298
- } & { [K in xstate276.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate276.IsNotNever<xstate276.RequiredLogicInput<TLogic>>>): xstate276.ActorRefFromLogic<TLogic>;
302
+ } & { [K in xstate63.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate63.IsNotNever<xstate63.RequiredLogicInput<TLogic>>>): xstate63.ActorRefFromLogic<TLogic>;
299
303
  };
300
304
  input: DocumentCaptureInput;
301
- self: xstate276.ActorRef<xstate276.MachineSnapshot<DocumentCaptureContext, {
305
+ self: xstate63.ActorRef<xstate63.MachineSnapshot<DocumentCaptureContext, {
302
306
  type: "CAPTURE";
303
307
  } | {
304
308
  type: "FILE_SELECTED";
@@ -320,7 +324,7 @@ declare const documentCaptureMachine: xstate276.StateMachine<DocumentCaptureCont
320
324
  type: "SKIP";
321
325
  } | {
322
326
  type: "CLOSE";
323
- }, Record<string, xstate276.AnyActorRef | undefined>, xstate276.StateValue, string, unknown, any, any>, {
327
+ }, Record<string, xstate63.AnyActorRef | undefined>, xstate63.StateValue, string, unknown, any, any>, {
324
328
  type: "CAPTURE";
325
329
  } | {
326
330
  type: "FILE_SELECTED";
@@ -342,7 +346,7 @@ declare const documentCaptureMachine: xstate276.StateMachine<DocumentCaptureCont
342
346
  type: "SKIP";
343
347
  } | {
344
348
  type: "CLOSE";
345
- }, xstate276.AnyEventObject>;
349
+ }, xstate63.AnyEventObject>;
346
350
  }) => {
347
351
  config: {
348
352
  processingType: DocumentType;
@@ -436,10 +440,14 @@ declare const documentCaptureMachine: xstate276.StateMachine<DocumentCaptureCont
436
440
  readonly target: "uploading";
437
441
  readonly actions: "resetProgress";
438
442
  };
439
- readonly RETAKE: {
443
+ readonly RETAKE: readonly [{
444
+ readonly target: "tutorial";
445
+ readonly guard: "isCaptureMethodFile";
446
+ readonly actions: "clearCapturedDocument";
447
+ }, {
440
448
  readonly target: "capturing";
441
449
  readonly actions: "clearCapturedDocument";
442
- };
450
+ }];
443
451
  readonly CLOSE: {
444
452
  readonly target: "closed";
445
453
  readonly actions: "stopStream";
@@ -479,7 +487,7 @@ declare const documentCaptureMachine: xstate276.StateMachine<DocumentCaptureCont
479
487
  } | {
480
488
  type: "CLOSE";
481
489
  };
482
- self: xstate276.ActorRef<xstate276.MachineSnapshot<DocumentCaptureContext, {
490
+ self: xstate63.ActorRef<xstate63.MachineSnapshot<DocumentCaptureContext, {
483
491
  type: "CAPTURE";
484
492
  } | {
485
493
  type: "FILE_SELECTED";
@@ -501,7 +509,7 @@ declare const documentCaptureMachine: xstate276.StateMachine<DocumentCaptureCont
501
509
  type: "SKIP";
502
510
  } | {
503
511
  type: "CLOSE";
504
- }, Record<string, xstate276.AnyActorRef>, xstate276.StateValue, string, unknown, any, any>, {
512
+ }, Record<string, xstate63.AnyActorRef>, xstate63.StateValue, string, unknown, any, any>, {
505
513
  type: "CAPTURE";
506
514
  } | {
507
515
  type: "FILE_SELECTED";
@@ -523,7 +531,7 @@ declare const documentCaptureMachine: xstate276.StateMachine<DocumentCaptureCont
523
531
  type: "SKIP";
524
532
  } | {
525
533
  type: "CLOSE";
526
- }, xstate276.AnyEventObject>;
534
+ }, xstate63.AnyEventObject>;
527
535
  }) => {
528
536
  capturedDocument: CapturedDocument;
529
537
  processingType: DocumentType;
@@ -147,6 +147,7 @@ const documentCaptureMachine = setup({
147
147
  canRetryFile: ({ context }) => context.attemptsRemaining > 0 && context.captureMethod !== "camera",
148
148
  attemptsExhausted: ({ context }) => context.attemptsRemaining <= 0,
149
149
  isCameraMode: ({ context }) => context.config.captureMode === "camera",
150
+ isCaptureMethodFile: ({ context }) => context.captureMethod !== "camera",
150
151
  isPendingNextPage: ({ context }) => context.pendingNextPage
151
152
  }
152
153
  }).createMachine({
@@ -240,10 +241,14 @@ const documentCaptureMachine = setup({
240
241
  target: "uploading",
241
242
  actions: "resetProgress"
242
243
  },
243
- RETAKE: {
244
+ RETAKE: [{
245
+ target: "tutorial",
246
+ guard: "isCaptureMethodFile",
247
+ actions: "clearCapturedDocument"
248
+ }, {
244
249
  target: "capturing",
245
250
  actions: "clearCapturedDocument"
246
- },
251
+ }],
247
252
  CLOSE: {
248
253
  target: "closed",
249
254
  actions: "stopStream"
package/dist/ekyc.esm.js CHANGED
@@ -9993,10 +9993,7 @@ function buildFieldDefs(fields, configSource, country, enablePhoneRisk = false)
9993
9993
  if (fields.email) add("email", "text", "verification.labels.email", fields.email, { placeholder: "verification.placeholder.email" });
9994
9994
  if (fields.phone) {
9995
9995
  const phoneCountrySelectorDisabled = enablePhoneRisk && configSource !== "PHONE_RISK_1" || COUNTRY_SELECTOR_DISABLED_SOURCES.includes(configSource);
9996
- add("phone", "phone", "verification.labels.phone", fields.phone, {
9997
- placeholder: "(123) 123-6789",
9998
- disableCountrySelector: phoneCountrySelectorDisabled
9999
- });
9996
+ add("phone", "phone", "verification.labels.phone", fields.phone, { disableCountrySelector: phoneCountrySelectorDisabled });
10000
9997
  }
10001
9998
  if (fields.SSN) if (country === "BR") add("taxId", "text", "verification.labels.taxId", fields.SSN);
10002
9999
  else if (country === "CN") add("ssn", "text", "verification.labels.prcId", fields.SSN);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@incodetech/core",
3
- "version": "0.0.0-dev-20260318-deddf15",
3
+ "version": "0.0.0-dev-20260318-ce9c1ed",
4
4
  "type": "module",
5
5
  "main": "./dist/index.esm.js",
6
6
  "types": "./dist/index.d.ts",