@incodetech/core 0.0.0-dev-20260421-3ad52f4 → 0.0.0-dev-20260421-ac38ea9

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.
@@ -2,10 +2,10 @@ import { t as Manager } from "./Manager-C1r-74H0.js";
2
2
  import "./Actor-Cqaw-2DF.js";
3
3
  import "./camera-C1Lz6NFz.js";
4
4
  import { n as DocumentUploadContext, r as DocumentUploadInput, t as DocumentUploadConfig } from "./types-DGwsRYfm.js";
5
- import * as xstate466 from "xstate";
5
+ import * as xstate648 from "xstate";
6
6
 
7
7
  //#region src/modules/document-upload/documentUploadStateMachine.d.ts
8
- declare const documentUploadMachine: xstate466.StateMachine<DocumentUploadContext, {
8
+ declare const documentUploadMachine: xstate648.StateMachine<DocumentUploadContext, {
9
9
  type: "START";
10
10
  } | {
11
11
  type: "CAPTURE";
@@ -18,52 +18,52 @@ declare const documentUploadMachine: xstate466.StateMachine<DocumentUploadContex
18
18
  } | {
19
19
  type: "CLOSE";
20
20
  }, {
21
- [x: string]: xstate466.ActorRefFromLogic<xstate466.PromiseActorLogic<void, {
21
+ [x: string]: xstate648.ActorRefFromLogic<xstate648.PromiseActorLogic<MediaStream, void, xstate648.EventObject>> | xstate648.ActorRefFromLogic<xstate648.PromiseActorLogic<void, {
22
22
  imageBase64: string;
23
23
  documentType: string;
24
24
  onProgress: (progress: number) => void;
25
- }, xstate466.EventObject>> | xstate466.ActorRefFromLogic<xstate466.PromiseActorLogic<MediaStream, void, xstate466.EventObject>> | undefined;
26
- }, xstate466.Values<{
25
+ }, xstate648.EventObject>> | undefined;
26
+ }, xstate648.Values<{
27
27
  uploadDocument: {
28
28
  src: "uploadDocument";
29
- logic: xstate466.PromiseActorLogic<void, {
29
+ logic: xstate648.PromiseActorLogic<void, {
30
30
  imageBase64: string;
31
31
  documentType: string;
32
32
  onProgress: (progress: number) => void;
33
- }, xstate466.EventObject>;
33
+ }, xstate648.EventObject>;
34
34
  id: string | undefined;
35
35
  };
36
36
  initCamera: {
37
37
  src: "initCamera";
38
- logic: xstate466.PromiseActorLogic<MediaStream, void, xstate466.EventObject>;
38
+ logic: xstate648.PromiseActorLogic<MediaStream, void, xstate648.EventObject>;
39
39
  id: string | undefined;
40
40
  };
41
- }>, xstate466.Values<{
42
- setError: {
43
- type: "setError";
44
- params: xstate466.NonReducibleUnknown;
45
- };
46
- clearError: {
47
- type: "clearError";
48
- params: xstate466.NonReducibleUnknown;
49
- };
41
+ }>, xstate648.Values<{
50
42
  setStream: {
51
43
  type: "setStream";
52
- params: xstate466.NonReducibleUnknown;
53
- };
54
- setImageAndClearError: {
55
- type: "setImageAndClearError";
56
- params: xstate466.NonReducibleUnknown;
44
+ params: xstate648.NonReducibleUnknown;
57
45
  };
58
46
  setProgress: {
59
47
  type: "setProgress";
60
- params: xstate466.NonReducibleUnknown;
48
+ params: xstate648.NonReducibleUnknown;
49
+ };
50
+ clearError: {
51
+ type: "clearError";
52
+ params: xstate648.NonReducibleUnknown;
61
53
  };
62
54
  stopStream: {
63
55
  type: "stopStream";
64
- params: xstate466.NonReducibleUnknown;
56
+ params: xstate648.NonReducibleUnknown;
57
+ };
58
+ setError: {
59
+ type: "setError";
60
+ params: xstate648.NonReducibleUnknown;
61
+ };
62
+ setImageAndClearError: {
63
+ type: "setImageAndClearError";
64
+ params: xstate648.NonReducibleUnknown;
65
65
  };
66
- }>, never, never, "error" | "idle" | "uploading" | "closed" | "finished" | "initCamera" | "capturing", string, DocumentUploadInput, xstate466.NonReducibleUnknown, xstate466.EventObject, xstate466.MetaObject, {
66
+ }>, never, never, "error" | "idle" | "uploading" | "closed" | "finished" | "initCamera" | "capturing", string, DocumentUploadInput, xstate648.NonReducibleUnknown, xstate648.EventObject, xstate648.MetaObject, {
67
67
  readonly id: "documentUpload";
68
68
  readonly initial: "idle";
69
69
  readonly context: ({
@@ -72,67 +72,67 @@ declare const documentUploadMachine: xstate466.StateMachine<DocumentUploadContex
72
72
  spawn: {
73
73
  <TSrc extends "uploadDocument" | "initCamera">(logic: TSrc, ...[options]: ({
74
74
  src: "uploadDocument";
75
- logic: xstate466.PromiseActorLogic<void, {
75
+ logic: xstate648.PromiseActorLogic<void, {
76
76
  imageBase64: string;
77
77
  documentType: string;
78
78
  onProgress: (progress: number) => void;
79
- }, xstate466.EventObject>;
79
+ }, xstate648.EventObject>;
80
80
  id: string | undefined;
81
81
  } extends infer T ? T extends {
82
82
  src: "uploadDocument";
83
- logic: xstate466.PromiseActorLogic<void, {
83
+ logic: xstate648.PromiseActorLogic<void, {
84
84
  imageBase64: string;
85
85
  documentType: string;
86
86
  onProgress: (progress: number) => void;
87
- }, xstate466.EventObject>;
87
+ }, xstate648.EventObject>;
88
88
  id: string | undefined;
89
89
  } ? T extends {
90
90
  src: TSrc;
91
- } ? xstate466.ConditionalRequired<[options?: ({
91
+ } ? xstate648.ConditionalRequired<[options?: ({
92
92
  id?: T["id"] | undefined;
93
93
  systemId?: string;
94
- input?: xstate466.InputFrom<T["logic"]> | undefined;
94
+ input?: xstate648.InputFrom<T["logic"]> | undefined;
95
95
  syncSnapshot?: boolean;
96
- } & { [K in xstate466.RequiredActorOptions<T>]: unknown }) | undefined], xstate466.IsNotNever<xstate466.RequiredActorOptions<T>>> : never : never : never) | ({
96
+ } & { [K in xstate648.RequiredActorOptions<T>]: unknown }) | undefined], xstate648.IsNotNever<xstate648.RequiredActorOptions<T>>> : never : never : never) | ({
97
97
  src: "initCamera";
98
- logic: xstate466.PromiseActorLogic<MediaStream, void, xstate466.EventObject>;
98
+ logic: xstate648.PromiseActorLogic<MediaStream, void, xstate648.EventObject>;
99
99
  id: string | undefined;
100
100
  } extends infer T_1 ? T_1 extends {
101
101
  src: "initCamera";
102
- logic: xstate466.PromiseActorLogic<MediaStream, void, xstate466.EventObject>;
102
+ logic: xstate648.PromiseActorLogic<MediaStream, void, xstate648.EventObject>;
103
103
  id: string | undefined;
104
104
  } ? T_1 extends {
105
105
  src: TSrc;
106
- } ? xstate466.ConditionalRequired<[options?: ({
106
+ } ? xstate648.ConditionalRequired<[options?: ({
107
107
  id?: T_1["id"] | undefined;
108
108
  systemId?: string;
109
- input?: xstate466.InputFrom<T_1["logic"]> | undefined;
109
+ input?: xstate648.InputFrom<T_1["logic"]> | undefined;
110
110
  syncSnapshot?: boolean;
111
- } & { [K_1 in xstate466.RequiredActorOptions<T_1>]: unknown }) | undefined], xstate466.IsNotNever<xstate466.RequiredActorOptions<T_1>>> : never : never : never)): xstate466.ActorRefFromLogic<xstate466.GetConcreteByKey<xstate466.Values<{
111
+ } & { [K_1 in xstate648.RequiredActorOptions<T_1>]: unknown }) | undefined], xstate648.IsNotNever<xstate648.RequiredActorOptions<T_1>>> : never : never : never)): xstate648.ActorRefFromLogic<xstate648.GetConcreteByKey<xstate648.Values<{
112
112
  uploadDocument: {
113
113
  src: "uploadDocument";
114
- logic: xstate466.PromiseActorLogic<void, {
114
+ logic: xstate648.PromiseActorLogic<void, {
115
115
  imageBase64: string;
116
116
  documentType: string;
117
117
  onProgress: (progress: number) => void;
118
- }, xstate466.EventObject>;
118
+ }, xstate648.EventObject>;
119
119
  id: string | undefined;
120
120
  };
121
121
  initCamera: {
122
122
  src: "initCamera";
123
- logic: xstate466.PromiseActorLogic<MediaStream, void, xstate466.EventObject>;
123
+ logic: xstate648.PromiseActorLogic<MediaStream, void, xstate648.EventObject>;
124
124
  id: string | undefined;
125
125
  };
126
126
  }>, "src", TSrc>["logic"]>;
127
- <TLogic extends xstate466.AnyActorLogic>(src: TLogic, ...[options]: xstate466.ConditionalRequired<[options?: ({
127
+ <TLogic extends xstate648.AnyActorLogic>(src: TLogic, ...[options]: xstate648.ConditionalRequired<[options?: ({
128
128
  id?: never;
129
129
  systemId?: string;
130
- input?: xstate466.InputFrom<TLogic> | undefined;
130
+ input?: xstate648.InputFrom<TLogic> | undefined;
131
131
  syncSnapshot?: boolean;
132
- } & { [K in xstate466.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate466.IsNotNever<xstate466.RequiredLogicInput<TLogic>>>): xstate466.ActorRefFromLogic<TLogic>;
132
+ } & { [K in xstate648.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate648.IsNotNever<xstate648.RequiredLogicInput<TLogic>>>): xstate648.ActorRefFromLogic<TLogic>;
133
133
  };
134
134
  input: DocumentUploadInput;
135
- self: xstate466.ActorRef<xstate466.MachineSnapshot<DocumentUploadContext, {
135
+ self: xstate648.ActorRef<xstate648.MachineSnapshot<DocumentUploadContext, {
136
136
  type: "START";
137
137
  } | {
138
138
  type: "CAPTURE";
@@ -144,7 +144,7 @@ declare const documentUploadMachine: xstate466.StateMachine<DocumentUploadContex
144
144
  type: "RETRY";
145
145
  } | {
146
146
  type: "CLOSE";
147
- }, Record<string, xstate466.AnyActorRef | undefined>, xstate466.StateValue, string, unknown, any, any>, {
147
+ }, Record<string, xstate648.AnyActorRef | undefined>, xstate648.StateValue, string, unknown, any, any>, {
148
148
  type: "START";
149
149
  } | {
150
150
  type: "CAPTURE";
@@ -156,7 +156,7 @@ declare const documentUploadMachine: xstate466.StateMachine<DocumentUploadContex
156
156
  type: "RETRY";
157
157
  } | {
158
158
  type: "CLOSE";
159
- }, xstate466.AnyEventObject>;
159
+ }, xstate648.AnyEventObject>;
160
160
  }) => {
161
161
  config: DocumentUploadConfig;
162
162
  stream: undefined;
@@ -226,7 +226,7 @@ declare const documentUploadMachine: xstate466.StateMachine<DocumentUploadContex
226
226
  } | {
227
227
  type: "CLOSE";
228
228
  };
229
- self: xstate466.ActorRef<xstate466.MachineSnapshot<DocumentUploadContext, {
229
+ self: xstate648.ActorRef<xstate648.MachineSnapshot<DocumentUploadContext, {
230
230
  type: "START";
231
231
  } | {
232
232
  type: "CAPTURE";
@@ -238,7 +238,7 @@ declare const documentUploadMachine: xstate466.StateMachine<DocumentUploadContex
238
238
  type: "RETRY";
239
239
  } | {
240
240
  type: "CLOSE";
241
- }, Record<string, xstate466.AnyActorRef>, xstate466.StateValue, string, unknown, any, any>, {
241
+ }, Record<string, xstate648.AnyActorRef>, xstate648.StateValue, string, unknown, any, any>, {
242
242
  type: "START";
243
243
  } | {
244
244
  type: "CAPTURE";
@@ -250,7 +250,7 @@ declare const documentUploadMachine: xstate466.StateMachine<DocumentUploadContex
250
250
  type: "RETRY";
251
251
  } | {
252
252
  type: "CLOSE";
253
- }, xstate466.AnyEventObject>;
253
+ }, xstate648.AnyEventObject>;
254
254
  }) => {
255
255
  imageBase64: string;
256
256
  documentType: string;
@@ -1,4 +1,4 @@
1
1
  import "./Manager-C1r-74H0.js";
2
2
  import "./Actor-Cqaw-2DF.js";
3
- import { a as AE_CONSENT_KEYS, c as ConsentKey, d as ElectronicSignatureVariant, f as QE_CONSENT_KEYS, g as getDefaultConsentChecks, h as getConsentKeys, i as electronicSignatureMachine, l as ElectronicSignatureConfig, m as areAllConsented, n as ElectronicSignatureState, o as AeConsentKey, p as QeConsentKey, r as createElectronicSignatureManager, s as ConsentChecks, t as ElectronicSignatureManager, u as ElectronicSignatureDocument } from "./index-D98KKBR4.js";
3
+ import { a as AE_CONSENT_KEYS, c as ConsentKey, d as ElectronicSignatureVariant, f as QE_CONSENT_KEYS, g as getDefaultConsentChecks, h as getConsentKeys, i as electronicSignatureMachine, l as ElectronicSignatureConfig, m as areAllConsented, n as ElectronicSignatureState, o as AeConsentKey, p as QeConsentKey, r as createElectronicSignatureManager, s as ConsentChecks, t as ElectronicSignatureManager, u as ElectronicSignatureDocument } from "./index-9p9VlHBc.js";
4
4
  export { AE_CONSENT_KEYS, AeConsentKey, ConsentChecks, ConsentKey, ElectronicSignatureConfig, ElectronicSignatureDocument, ElectronicSignatureManager, ElectronicSignatureState, ElectronicSignatureVariant, QE_CONSENT_KEYS, QeConsentKey, areAllConsented, createElectronicSignatureManager, electronicSignatureMachine, getConsentKeys, getDefaultConsentChecks };
@@ -11,7 +11,7 @@ import "./types-B-JXmW0H.js";
11
11
  import { a as ProcessFaceResponse, i as createSelfieManagerFromActor, n as SelfieState, t as SelfieManager } from "./selfieManager-Bsag2fr3.js";
12
12
  import { i as createAuthenticationManagerFromActor, n as AuthenticationState, t as AuthenticationManager } from "./authenticationManager-C75RqUmN.js";
13
13
  import { i as createEmailManagerFromActor, n as EmailState, t as EmailManager } from "./emailManager-DXdv0T1X.js";
14
- import { C as CaptureIdResponse, i as createIdCaptureManagerFromActor, n as IdCaptureState, t as IdCaptureManager } from "./idCaptureManager-eoc0PvFh.js";
14
+ import { T as CaptureIdResponse, i as createIdCaptureManagerFromActor, n as IdCaptureState, t as IdCaptureManager } from "./idCaptureManager-DaqJk3sg.js";
15
15
  import { i as createPhoneManagerFromActor, n as PhoneState, t as PhoneManager } from "./phoneManager-CZkwAnZA.js";
16
16
 
17
17
  //#region src/modules/authentication/authenticationUploadService.d.ts
@@ -27,8 +27,8 @@ import "./emailStateMachine-CSyUXPrM.esm.js";
27
27
  import { n as createEmailManagerFromActor } from "./emailManager-DZ1bKeHd.esm.js";
28
28
  import "./selfieStateMachine-CYcGwdw6.esm.js";
29
29
  import { n as createSelfieManagerFromActor } from "./selfieManager-BzQvkdCk.esm.js";
30
- import "./idCaptureStateMachine-BFSvu5or.esm.js";
31
- import { n as createIdCaptureManagerFromActor } from "./idCaptureManager-CfHYOEgl.esm.js";
30
+ import "./idCaptureStateMachine-CkDMgCTu.esm.js";
31
+ import { n as createIdCaptureManagerFromActor } from "./idCaptureManager-CxTrbaj_.esm.js";
32
32
  import "./phoneStateMachine-BjhtmUGF.esm.js";
33
33
  import { n as createPhoneManagerFromActor } from "./phoneManager-BFinSDdo.esm.js";
34
34
 
package/dist/home.d.ts CHANGED
@@ -2,7 +2,7 @@ import { t as Manager } from "./Manager-C1r-74H0.js";
2
2
  import "./camera-C1Lz6NFz.js";
3
3
  import "./types-DGwsRYfm.js";
4
4
  import { t as EmptyConfig } from "./types-x6tue2ld.js";
5
- import * as xstate1140 from "xstate";
5
+ import * as xstate631 from "xstate";
6
6
 
7
7
  //#region src/modules/home/types.d.ts
8
8
  type HomeConfig = EmptyConfig;
@@ -34,41 +34,41 @@ type HomeContext = {
34
34
  type HomeInput = {
35
35
  config: EmptyConfig;
36
36
  };
37
- declare const homeMachine: xstate1140.StateMachine<HomeContext, {
37
+ declare const homeMachine: xstate631.StateMachine<HomeContext, {
38
38
  type: "LOAD";
39
39
  } | {
40
40
  type: "COMPLETE";
41
41
  } | {
42
42
  type: "RESET";
43
- }, {}, never, never, never, never, "idle" | "finished" | "main", string, HomeInput, xstate1140.NonReducibleUnknown, xstate1140.EventObject, xstate1140.MetaObject, {
43
+ }, {}, never, never, never, never, "idle" | "finished" | "main", string, HomeInput, xstate631.NonReducibleUnknown, xstate631.EventObject, xstate631.MetaObject, {
44
44
  readonly id: "home";
45
45
  readonly initial: "idle";
46
46
  readonly context: ({
47
47
  input
48
48
  }: {
49
49
  spawn: {
50
- <TSrc extends never>(logic: TSrc, ...[options]: never): xstate1140.ActorRefFromLogic<never>;
51
- <TLogic extends xstate1140.AnyActorLogic>(src: TLogic, ...[options]: xstate1140.ConditionalRequired<[options?: ({
50
+ <TSrc extends never>(logic: TSrc, ...[options]: never): xstate631.ActorRefFromLogic<never>;
51
+ <TLogic extends xstate631.AnyActorLogic>(src: TLogic, ...[options]: xstate631.ConditionalRequired<[options?: ({
52
52
  id?: never;
53
53
  systemId?: string;
54
- input?: xstate1140.InputFrom<TLogic> | undefined;
54
+ input?: xstate631.InputFrom<TLogic> | undefined;
55
55
  syncSnapshot?: boolean;
56
- } & { [K in xstate1140.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate1140.IsNotNever<xstate1140.RequiredLogicInput<TLogic>>>): xstate1140.ActorRefFromLogic<TLogic>;
56
+ } & { [K in xstate631.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate631.IsNotNever<xstate631.RequiredLogicInput<TLogic>>>): xstate631.ActorRefFromLogic<TLogic>;
57
57
  };
58
58
  input: HomeInput;
59
- self: xstate1140.ActorRef<xstate1140.MachineSnapshot<HomeContext, {
59
+ self: xstate631.ActorRef<xstate631.MachineSnapshot<HomeContext, {
60
60
  type: "LOAD";
61
61
  } | {
62
62
  type: "COMPLETE";
63
63
  } | {
64
64
  type: "RESET";
65
- }, Record<string, xstate1140.AnyActorRef | undefined>, xstate1140.StateValue, string, unknown, any, any>, {
65
+ }, Record<string, xstate631.AnyActorRef | undefined>, xstate631.StateValue, string, unknown, any, any>, {
66
66
  type: "LOAD";
67
67
  } | {
68
68
  type: "COMPLETE";
69
69
  } | {
70
70
  type: "RESET";
71
- }, xstate1140.AnyEventObject>;
71
+ }, xstate631.AnyEventObject>;
72
72
  }) => {
73
73
  config: EmptyConfig;
74
74
  };
package/dist/id.d.ts CHANGED
@@ -7,5 +7,5 @@ import "./types-DGwsRYfm.js";
7
7
  import "./types-x6tue2ld.js";
8
8
  import "./deepsightService-D8Kbc-41.js";
9
9
  import { n as PermissionStatus, t as PermissionResult } from "./types-B-JXmW0H.js";
10
- import { A as IdCaptureDependencies, B as RecordingSession, C as CaptureIdResponse, D as ID_ERROR_CODES, E as DetectionStatus, F as IdCaptureThresholds, H as DetectionOrientation, I as IdDocumentType, L as IdError, M as IdCaptureGeometry, N as IdCaptureInput, O as IdCaptureConfig, P as IdCaptureMode, R as IdErrorCode, S as idCaptureMachine, T as DetectionArea, U as IdCaptureSettings, V as UploadIdResponse, _ as validateUploadResponse, a as IdCaptureInitResult, b as createIdCaptureActor, c as UploadIdImageParams, d as preloadIdRecordingProvider, f as processId, g as uploadIdImage, h as stopStream, j as IdCaptureEvent, k as IdCaptureContext, l as ValidationError, m as stopRecording, n as IdCaptureState, o as InitializeIdCaptureParams, p as startRecordingSession, r as createIdCaptureManager, s as StartRecordingParams, t as IdCaptureManager, u as initializeIdCapture, v as CreateIdCaptureActorOptions, w as CapturedImage, x as IdCaptureMachine, y as IdCaptureActor, z as IdFlowStep } from "./idCaptureManager-eoc0PvFh.js";
11
- export { CameraStream, CaptureIdResponse, CapturedImage, type CreateIdCaptureActorOptions, DetectionArea, DetectionOrientation, DetectionStatus, ID_ERROR_CODES, type IdCaptureActor, IdCaptureConfig, type IdCaptureContext, IdCaptureDependencies, type IdCaptureEvent, IdCaptureGeometry, IdCaptureInitResult, type IdCaptureInput, type IdCaptureMachine, type IdCaptureManager, IdCaptureMode, IdCaptureSettings, type IdCaptureState, IdCaptureThresholds, IdDocumentType, IdError, IdErrorCode, IdFlowStep, InitializeIdCaptureParams, PermissionResult, PermissionStatus, RecordingSession, StartRecordingParams, UploadIdImageParams, UploadIdResponse, ValidationError, createIdCaptureActor, createIdCaptureManager, idCaptureMachine, initializeIdCapture, preloadIdRecordingProvider, processId, startRecordingSession, stopRecording, stopStream, uploadIdImage, validateUploadResponse };
10
+ import { A as IdCaptureConfig, B as IdErrorCode, C as IdCaptureMachine, D as DetectionArea, E as CapturedImage, F as IdCaptureInput, G as ManualUploadContext, H as MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS, I as IdCaptureMode, J as RecordingSession, K as ManualUploadSide, L as IdCaptureThresholds, M as IdCaptureDependencies, N as IdCaptureEvent, O as DetectionStatus, P as IdCaptureGeometry, R as IdDocumentType, S as createIdCaptureActor, T as CaptureIdResponse, U as MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES, V as IdFlowStep, W as MANUAL_UPLOAD_MAX_RETRIES, X as DetectionOrientation, Y as UploadIdResponse, Z as IdCaptureSettings, _ as uploadIdImage, a as IdCaptureInitResult, b as CreateIdCaptureActorOptions, c as UploadIdImageParams, d as initializeIdCapture, f as preloadIdRecordingProvider, g as stopStream, h as stopRecording, j as IdCaptureContext, k as ID_ERROR_CODES, l as UploadManualIdFileParams, m as startRecordingSession, n as IdCaptureState, o as InitializeIdCaptureParams, p as processId, q as ManualUploadTab, r as createIdCaptureManager, s as StartRecordingParams, t as IdCaptureManager, u as ValidationError, v as uploadManualIdFile, w as idCaptureMachine, x as IdCaptureActor, y as validateUploadResponse, z as IdError } from "./idCaptureManager-DaqJk3sg.js";
11
+ export { CameraStream, CaptureIdResponse, CapturedImage, type CreateIdCaptureActorOptions, DetectionArea, DetectionOrientation, DetectionStatus, ID_ERROR_CODES, type IdCaptureActor, IdCaptureConfig, type IdCaptureContext, IdCaptureDependencies, type IdCaptureEvent, IdCaptureGeometry, IdCaptureInitResult, type IdCaptureInput, type IdCaptureMachine, type IdCaptureManager, IdCaptureMode, IdCaptureSettings, type IdCaptureState, IdCaptureThresholds, IdDocumentType, IdError, IdErrorCode, IdFlowStep, InitializeIdCaptureParams, MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS, MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES, MANUAL_UPLOAD_MAX_RETRIES, ManualUploadContext, ManualUploadSide, ManualUploadTab, PermissionResult, PermissionStatus, RecordingSession, StartRecordingParams, UploadIdImageParams, UploadIdResponse, UploadManualIdFileParams, ValidationError, createIdCaptureActor, createIdCaptureManager, idCaptureMachine, initializeIdCapture, preloadIdRecordingProvider, processId, startRecordingSession, stopRecording, stopStream, uploadIdImage, uploadManualIdFile, validateUploadResponse };
package/dist/id.esm.js CHANGED
@@ -18,7 +18,7 @@ import "./ITimerCapability-6rqYcRcc.esm.js";
18
18
  import "./backCameraStream-BXfdKlzB.esm.js";
19
19
  import "./getDeviceClass-BiqKa0Vc.esm.js";
20
20
  import "./BrowserTimerProvider-DDCqhG2g.esm.js";
21
- import { a as startRecordingSession, c as uploadIdImage, i as processId, l as validateUploadResponse, n as initializeIdCapture, o as stopRecording, r as preloadIdRecordingProvider, s as stopStream, t as idCaptureMachine, u as ID_ERROR_CODES } from "./idCaptureStateMachine-BFSvu5or.esm.js";
22
- import { r as createIdCaptureActor, t as createIdCaptureManager } from "./idCaptureManager-CfHYOEgl.esm.js";
21
+ import { a as startRecordingSession, c as uploadIdImage, d as ID_ERROR_CODES, f as MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS, i as processId, l as uploadManualIdFile, m as MANUAL_UPLOAD_MAX_RETRIES, n as initializeIdCapture, o as stopRecording, p as MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES, r as preloadIdRecordingProvider, s as stopStream, t as idCaptureMachine, u as validateUploadResponse } from "./idCaptureStateMachine-CkDMgCTu.esm.js";
22
+ import { r as createIdCaptureActor, t as createIdCaptureManager } from "./idCaptureManager-CxTrbaj_.esm.js";
23
23
 
24
- export { ID_ERROR_CODES, createIdCaptureActor, createIdCaptureManager, idCaptureMachine, initializeIdCapture, preloadIdRecordingProvider, processId, startRecordingSession, stopRecording, stopStream, uploadIdImage, validateUploadResponse };
24
+ export { ID_ERROR_CODES, MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS, MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES, MANUAL_UPLOAD_MAX_RETRIES, createIdCaptureActor, createIdCaptureManager, idCaptureMachine, initializeIdCapture, preloadIdRecordingProvider, processId, startRecordingSession, stopRecording, stopStream, uploadIdImage, uploadManualIdFile, validateUploadResponse };
@@ -1,7 +1,7 @@
1
1
  import { n as eventModuleNames, o as createManagerInstrumentation, r as eventScreenNames } from "./events-CLo0CBD5.esm.js";
2
2
  import { a as createActor, o as createManager } from "./xstate.esm-BlgyVBVv.esm.js";
3
3
  import { t as BrowserStorageProvider } from "./BrowserStorageProvider-DOp7HlOV.esm.js";
4
- import { t as idCaptureMachine } from "./idCaptureStateMachine-BFSvu5or.esm.js";
4
+ import { t as idCaptureMachine } from "./idCaptureStateMachine-CkDMgCTu.esm.js";
5
5
 
6
6
  //#region src/modules/id/idCaptureActor.ts
7
7
  function createIdCaptureActor(options) {
@@ -119,6 +119,39 @@ function mapCaptureState(snapshot, context) {
119
119
  function isLoadingPhase(snapshot) {
120
120
  return snapshot.matches({ capture: "checkingStream" }) || snapshot.matches({ capture: "initializingDeepsight" }) || snapshot.matches({ capture: "initializing" }) || snapshot.matches({ permissions: "idle" });
121
121
  }
122
+ function mapManualUploadState(snapshot, context) {
123
+ const { manualUpload, config } = context;
124
+ const phase = snapshot.matches({ manualIdUpload: "retriesExhausted" }) ? "exhausted" : snapshot.matches({ manualIdUpload: "uploadingFront" }) || snapshot.matches({ manualIdUpload: "uploadingBack" }) || snapshot.matches({ manualIdUpload: "uploadingPassport" }) ? "uploading" : "selecting";
125
+ const uploadingSide = snapshot.matches({ manualIdUpload: "uploadingFront" }) ? "front" : snapshot.matches({ manualIdUpload: "uploadingBack" }) ? "back" : snapshot.matches({ manualIdUpload: "uploadingPassport" }) ? "passport" : void 0;
126
+ /**
127
+ * Server told us the document doesn't need a back side (e.g. passport-class
128
+ * docs, single-sided IDs). Treat the back slot as uploaded so the UI shows
129
+ * a green check rather than hiding the slot — matches v1's behavior and
130
+ * keeps both slots visible once the front has been processed.
131
+ */
132
+ const backUploaded = manualUpload.backUploaded || manualUpload.skipBackFromServer;
133
+ const idTabCanContinue = manualUpload.frontUploaded && (config.onlyFront || backUploaded);
134
+ const canContinue = manualUpload.activeTab === "id" ? idTabCanContinue : manualUpload.passportUploaded;
135
+ const showBackSlot = !config.onlyFront;
136
+ return {
137
+ status: "manualUpload",
138
+ phase,
139
+ uploadingSide,
140
+ activeTab: manualUpload.activeTab,
141
+ showIdTab: config.enableId ?? true,
142
+ showPassportTab: config.enablePassport ?? false,
143
+ showBackSlot,
144
+ frontFileName: manualUpload.frontFile?.name,
145
+ backFileName: manualUpload.backFile?.name,
146
+ passportFileName: manualUpload.passportFile?.name,
147
+ frontUploaded: manualUpload.frontUploaded,
148
+ backUploaded,
149
+ passportUploaded: manualUpload.passportUploaded,
150
+ canContinue,
151
+ retriesLeft: manualUpload.retriesLeft,
152
+ errorKey: manualUpload.errorMessage
153
+ };
154
+ }
122
155
  function mapState(snapshot) {
123
156
  const { context } = snapshot;
124
157
  if (snapshot.matches("idle")) return { status: "idle" };
@@ -159,6 +192,7 @@ function mapState(snapshot) {
159
192
  status: "error",
160
193
  error: context.error ?? "Unknown error"
161
194
  };
195
+ if (snapshot.matches("manualIdUpload")) return mapManualUploadState(snapshot, context);
162
196
  return { status: "idle" };
163
197
  }
164
198
  function createApi({ actor, trackElementClicked, trackCaptureAttemptFinished }) {
@@ -239,6 +273,29 @@ function createApi({ actor, trackElementClicked, trackCaptureAttemptFinished })
239
273
  type: "UPDATE_DETECTION_AREA",
240
274
  detectionArea
241
275
  });
276
+ },
277
+ manualUploadChangeTab(tab) {
278
+ trackElementClicked?.(`manualUpload.tab.${tab}`);
279
+ actor.send({
280
+ type: "MANUAL_UPLOAD_TAB_CHANGED",
281
+ tab
282
+ });
283
+ },
284
+ manualUploadSelectFile(side, file) {
285
+ trackElementClicked?.(`manualUpload.select.${side}`);
286
+ actor.send({
287
+ type: "MANUAL_UPLOAD_FILE_SELECTED",
288
+ side,
289
+ file
290
+ });
291
+ },
292
+ manualUploadContinue() {
293
+ trackElementClicked?.("manualUpload.continue");
294
+ actor.send({ type: "MANUAL_UPLOAD_CONTINUE" });
295
+ },
296
+ manualUploadReset() {
297
+ trackElementClicked?.("manualUpload.reset");
298
+ actor.send({ type: "MANUAL_UPLOAD_RESET" });
242
299
  }
243
300
  };
244
301
  }
@@ -258,6 +258,7 @@ type UploadIdResponse = {
258
258
  regulationType?: RegulationTypes;
259
259
  failReason?: string;
260
260
  side?: 'front' | 'back';
261
+ idQualityAttemptApproved?: boolean;
261
262
  };
262
263
  type CaptureIdResponse = UploadIdResponse & {
263
264
  croppedIDFace?: string;
@@ -343,7 +344,33 @@ type IdCaptureContext = {
343
344
  captureResolution?: string;
344
345
  /** Android camera access fallback level that succeeded */
345
346
  cameraFallbackLevel?: number;
346
- };
347
+ /**
348
+ * Manual file-upload flow state. Parallel to the live-camera capture flow;
349
+ * entered via the Chooser's Upload card or auto-routed when manual upload is
350
+ * the only enabled capture mode. Back slot is gated by `config.onlyFront` or
351
+ * by the server returning `skipBackIdCapture: true` on the front response.
352
+ */
353
+ manualUpload: ManualUploadContext;
354
+ };
355
+ type ManualUploadTab = 'id' | 'passport';
356
+ type ManualUploadSide = 'front' | 'back' | 'passport';
357
+ type ManualUploadContext = {
358
+ frontFile: File | null;
359
+ backFile: File | null;
360
+ passportFile: File | null;
361
+ activeTab: ManualUploadTab;
362
+ retriesLeft: number;
363
+ errorMessage: string | null;
364
+ /** Set from the front upload response; when true the back slot is auto-completed */
365
+ skipBackFromServer: boolean;
366
+ /** Whether each side has been successfully uploaded (for Continue gating) */
367
+ frontUploaded: boolean;
368
+ backUploaded: boolean;
369
+ passportUploaded: boolean;
370
+ };
371
+ declare const MANUAL_UPLOAD_MAX_RETRIES = 3;
372
+ declare const MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES: number;
373
+ declare const MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS = 5000;
347
374
  type IdCaptureEvent = {
348
375
  type: 'LOAD';
349
376
  } | {
@@ -435,6 +462,17 @@ type IdCaptureEvent = {
435
462
  } | {
436
463
  type: 'MOTION_STATUS';
437
464
  status: 'PASS' | 'FAIL' | 'UNCLEAR';
465
+ } | {
466
+ type: 'MANUAL_UPLOAD_TAB_CHANGED';
467
+ tab: ManualUploadTab;
468
+ } | {
469
+ type: 'MANUAL_UPLOAD_FILE_SELECTED';
470
+ side: ManualUploadSide;
471
+ file: File;
472
+ } | {
473
+ type: 'MANUAL_UPLOAD_CONTINUE';
474
+ } | {
475
+ type: 'MANUAL_UPLOAD_RESET';
438
476
  };
439
477
  type IdCaptureDependencies = {
440
478
  storage: IStorageCapability;
@@ -520,6 +558,31 @@ declare function stopRecording(session: RecordingSession): void;
520
558
  declare function processId(isSecondId?: boolean, queueName?: string, signal?: AbortSignal): Promise<{
521
559
  isDocumentExpired: boolean;
522
560
  }>;
561
+ type UploadManualIdFileParams = {
562
+ side: 'front' | 'back' | 'passport';
563
+ /**
564
+ * Raw base64 payload (no `data:<mime>;base64,` prefix). Callers must strip
565
+ * the data-URL prefix — the v2 backend rejects data URLs with
566
+ * `IllegalArgumentException: Illegal base64 character 3a`.
567
+ */
568
+ base64Image: string;
569
+ retry?: boolean;
570
+ onlyFront?: boolean;
571
+ signal?: AbortSignal;
572
+ };
573
+ /**
574
+ * Upload a user-selected image as front / back / passport ID.
575
+ *
576
+ * Uses the same request shape as the live-camera path (`uploadIdImage`):
577
+ * JSON body `{ base64Image }` with default application/json Content-Type,
578
+ * `captureType=UPLOAD` query param, `retry=true` when retrying.
579
+ * Back is POSTed to `/omni/add/back-id/v2`; front and passport both go to
580
+ * `/omni/add/front-id/v2` — the server distinguishes by session state.
581
+ *
582
+ * The v2 endpoints reject raw `image/jpeg` bodies with 415, so the caller
583
+ * must convert the File to base64 before calling this service.
584
+ */
585
+ declare function uploadManualIdFile(params: UploadManualIdFileParams): Promise<UploadIdResponse>;
523
586
  //#endregion
524
587
  //#region src/modules/id/idCaptureManager.d.ts
525
588
  type CaptureStatus = 'initializing' | 'detecting' | 'capturing' | 'uploading' | 'uploadError' | 'success';
@@ -592,7 +655,29 @@ type IdCaptureErrorState = {
592
655
  status: 'error';
593
656
  error: string;
594
657
  };
595
- type IdCaptureState = IdCaptureIdleState | IdCaptureChooserState | IdCaptureLoadingState | IdCaptureTutorialState | IdCapturePermissionsState | IdCaptureCaptureState | IdCaptureMandatoryConsentState | IdCaptureFrontFinishedState | IdCaptureBackFinishedState | IdCaptureProcessingState | IdCaptureExpiredState | IdCaptureFinishedState | IdCaptureClosedState | IdCaptureErrorState;
658
+ type ManualUploadUploadingSide = ManualUploadSide;
659
+ type IdCaptureManualUploadState = {
660
+ status: 'manualUpload';
661
+ phase: 'selecting' | 'uploading' | 'exhausted';
662
+ /** Which side is currently uploading (undefined in `selecting`/`exhausted`). */
663
+ uploadingSide: ManualUploadUploadingSide | undefined;
664
+ activeTab: ManualUploadTab;
665
+ showIdTab: boolean;
666
+ showPassportTab: boolean;
667
+ /** Whether the ID tab should render a back-of-ID slot. */
668
+ showBackSlot: boolean;
669
+ frontFileName: string | undefined;
670
+ backFileName: string | undefined;
671
+ passportFileName: string | undefined;
672
+ frontUploaded: boolean;
673
+ backUploaded: boolean;
674
+ passportUploaded: boolean;
675
+ canContinue: boolean;
676
+ retriesLeft: number;
677
+ /** i18n key for the current error message, if any. */
678
+ errorKey: string | null;
679
+ };
680
+ type IdCaptureState = IdCaptureIdleState | IdCaptureChooserState | IdCaptureLoadingState | IdCaptureTutorialState | IdCapturePermissionsState | IdCaptureCaptureState | IdCaptureMandatoryConsentState | IdCaptureFrontFinishedState | IdCaptureBackFinishedState | IdCaptureProcessingState | IdCaptureExpiredState | IdCaptureFinishedState | IdCaptureClosedState | IdCaptureErrorState | IdCaptureManualUploadState;
596
681
  declare function createIdCaptureManager(options: CreateIdCaptureActorOptions): Manager<IdCaptureState> & {
597
682
  load(): void;
598
683
  selectDocument(documentType: IdDocumentType): void;
@@ -617,6 +702,16 @@ declare function createIdCaptureManager(options: CreateIdCaptureActorOptions): M
617
702
  * @param detectionArea - The detection area in canvas coordinates
618
703
  */
619
704
  updateDetectionArea(detectionArea: DetectionArea): void;
705
+ /**
706
+ * Manual upload: tab change (ID / Passport). Resets per-tab file selections.
707
+ * Note: there is intentionally no `switchToManualUpload` method — entry to
708
+ * the manual-upload flow is gated by config + Chooser to prevent a
709
+ * dev-console bypass of live camera capture.
710
+ */
711
+ manualUploadChangeTab(tab: ManualUploadTab): void;
712
+ manualUploadSelectFile(side: ManualUploadSide, file: File): void;
713
+ manualUploadContinue(): void;
714
+ manualUploadReset(): void;
620
715
  };
621
716
  declare function createIdCaptureManagerFromActor(actor: IdCaptureActor): Manager<IdCaptureState> & {
622
717
  load(): void;
@@ -642,7 +737,17 @@ declare function createIdCaptureManagerFromActor(actor: IdCaptureActor): Manager
642
737
  * @param detectionArea - The detection area in canvas coordinates
643
738
  */
644
739
  updateDetectionArea(detectionArea: DetectionArea): void;
740
+ /**
741
+ * Manual upload: tab change (ID / Passport). Resets per-tab file selections.
742
+ * Note: there is intentionally no `switchToManualUpload` method — entry to
743
+ * the manual-upload flow is gated by config + Chooser to prevent a
744
+ * dev-console bypass of live camera capture.
745
+ */
746
+ manualUploadChangeTab(tab: ManualUploadTab): void;
747
+ manualUploadSelectFile(side: ManualUploadSide, file: File): void;
748
+ manualUploadContinue(): void;
749
+ manualUploadReset(): void;
645
750
  };
646
751
  type IdCaptureManager = ReturnType<typeof createIdCaptureManager>;
647
752
  //#endregion
648
- export { IdCaptureDependencies as A, RecordingSession as B, CaptureIdResponse as C, ID_ERROR_CODES as D, DetectionStatus as E, IdCaptureThresholds as F, DetectionOrientation as H, IdDocumentType as I, IdError as L, IdCaptureGeometry as M, IdCaptureInput as N, IdCaptureConfig as O, IdCaptureMode as P, IdErrorCode as R, idCaptureMachine as S, DetectionArea as T, IdCaptureSettings as U, UploadIdResponse as V, validateUploadResponse as _, IdCaptureInitResult as a, createIdCaptureActor as b, UploadIdImageParams as c, preloadIdRecordingProvider as d, processId as f, uploadIdImage as g, stopStream as h, createIdCaptureManagerFromActor as i, IdCaptureEvent as j, IdCaptureContext as k, ValidationError as l, stopRecording as m, IdCaptureState as n, InitializeIdCaptureParams as o, startRecordingSession as p, createIdCaptureManager as r, StartRecordingParams as s, IdCaptureManager as t, initializeIdCapture as u, CreateIdCaptureActorOptions as v, CapturedImage as w, IdCaptureMachine as x, IdCaptureActor as y, IdFlowStep as z };
753
+ export { IdCaptureConfig as A, IdErrorCode as B, IdCaptureMachine as C, DetectionArea as D, CapturedImage as E, IdCaptureInput as F, ManualUploadContext as G, MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS as H, IdCaptureMode as I, RecordingSession as J, ManualUploadSide as K, IdCaptureThresholds as L, IdCaptureDependencies as M, IdCaptureEvent as N, DetectionStatus as O, IdCaptureGeometry as P, IdDocumentType as R, createIdCaptureActor as S, CaptureIdResponse as T, MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES as U, IdFlowStep as V, MANUAL_UPLOAD_MAX_RETRIES as W, DetectionOrientation as X, UploadIdResponse as Y, IdCaptureSettings as Z, uploadIdImage as _, IdCaptureInitResult as a, CreateIdCaptureActorOptions as b, UploadIdImageParams as c, initializeIdCapture as d, preloadIdRecordingProvider as f, stopStream as g, stopRecording as h, createIdCaptureManagerFromActor as i, IdCaptureContext as j, ID_ERROR_CODES as k, UploadManualIdFileParams as l, startRecordingSession as m, IdCaptureState as n, InitializeIdCaptureParams as o, processId as p, ManualUploadTab as q, createIdCaptureManager as r, StartRecordingParams as s, IdCaptureManager as t, ValidationError as u, uploadManualIdFile as v, idCaptureMachine as w, IdCaptureActor as x, validateUploadResponse as y, IdError as z };