@incodetech/core 2.0.0-rc.0 → 2.0.0

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 (178) hide show
  1. package/package.json +3 -3
  2. package/dist/Actor-CI32dTbG.d.ts +0 -2
  3. package/dist/BaseWasmProvider-C_DLEI40.esm.js +0 -1118
  4. package/dist/BrowserStorageProvider-CuOW1Er2.esm.js +0 -55
  5. package/dist/BrowserTimerProvider-DhNc_x02.esm.js +0 -22
  6. package/dist/ITimerCapability-C67ZRskg.esm.js +0 -7
  7. package/dist/IpifyProvider-D7jx52AL.esm.js +0 -139
  8. package/dist/Manager-C8PrhBOx.d.ts +0 -19
  9. package/dist/MotionSensorProvider-4v7xkqAp.esm.js +0 -254
  10. package/dist/OpenViduRecordingProvider-CMu6XVdc.esm.js +0 -87
  11. package/dist/StateMachine-BCQrZJhf.d.ts +0 -2
  12. package/dist/WasmUtilProvider-j98OJf-S.esm.js +0 -114
  13. package/dist/addressSearch-BpTbTWCa.esm.js +0 -430
  14. package/dist/ae-signature-DDDZmWXj.esm.js +0 -12
  15. package/dist/ae-signature.d.ts +0 -25
  16. package/dist/ae-signature.esm.js +0 -8
  17. package/dist/antifraud.d.ts +0 -57
  18. package/dist/antifraud.esm.js +0 -45
  19. package/dist/antifraudStateMachine-O0TMf6yc.esm.js +0 -39
  20. package/dist/api-CESGtpbH.esm.js +0 -53
  21. package/dist/authentication.d.ts +0 -12
  22. package/dist/authentication.esm.js +0 -25
  23. package/dist/authenticationManager-5M-fKzXx.esm.js +0 -67
  24. package/dist/authenticationManager-C83GNIhl.d.ts +0 -66
  25. package/dist/authenticationStateMachine-BMZqatiF.esm.js +0 -139
  26. package/dist/backCameraStream-DMdMeGk2.esm.js +0 -346
  27. package/dist/browserSimulation-gxD8cSpM.esm.js +0 -20
  28. package/dist/camera-DBSxa6ML.d.ts +0 -4
  29. package/dist/camera-PA2Ljri3.esm.js +0 -22
  30. package/dist/camera.d.ts +0 -15
  31. package/dist/camera.esm.js +0 -5
  32. package/dist/chunk-CRF6K_H_.esm.js +0 -49
  33. package/dist/consent.d.ts +0 -398
  34. package/dist/consent.esm.js +0 -79
  35. package/dist/consentStateMachine-CCT-B60O.esm.js +0 -151
  36. package/dist/cpf-PPz2Njto.esm.js +0 -38
  37. package/dist/cpf-ocr.d.ts +0 -204
  38. package/dist/cpf-ocr.esm.js +0 -177
  39. package/dist/cross-document-data-match.d.ts +0 -34
  40. package/dist/cross-document-data-match.esm.js +0 -71
  41. package/dist/curp-validation.d.ts +0 -188
  42. package/dist/curp-validation.esm.js +0 -110
  43. package/dist/curpValidationStateMachine-CitWLr2c.esm.js +0 -595
  44. package/dist/custom-fields.d.ts +0 -115
  45. package/dist/custom-fields.esm.js +0 -177
  46. package/dist/custom-watchlist.d.ts +0 -66
  47. package/dist/custom-watchlist.esm.js +0 -86
  48. package/dist/dateUtils-UoN5xswP.esm.js +0 -23
  49. package/dist/deepsightLoader-Cm4JIT_z.esm.js +0 -52
  50. package/dist/deepsightService-CEVxzehb.d.ts +0 -412
  51. package/dist/deepsightService-O74l4Y__.esm.js +0 -489
  52. package/dist/device.d.ts +0 -46
  53. package/dist/device.esm.js +0 -106
  54. package/dist/displayErrors-DqJ_IbsG.d.ts +0 -39
  55. package/dist/document-capture.d.ts +0 -906
  56. package/dist/document-capture.esm.js +0 -156
  57. package/dist/document-upload.d.ts +0 -331
  58. package/dist/document-upload.esm.js +0 -203
  59. package/dist/documentCaptureStateMachine-BqzTDy9k.esm.js +0 -394
  60. package/dist/dynamic-forms.d.ts +0 -178
  61. package/dist/dynamic-forms.esm.js +0 -323
  62. package/dist/ekyb.d.ts +0 -148
  63. package/dist/ekyb.esm.js +0 -127
  64. package/dist/ekybStateMachine-B59rQjgj.esm.js +0 -674
  65. package/dist/ekyc.d.ts +0 -164
  66. package/dist/ekyc.esm.js +0 -104
  67. package/dist/ekycStateMachine-oeO0Iekd.esm.js +0 -10626
  68. package/dist/electronic-signature.d.ts +0 -4
  69. package/dist/electronic-signature.esm.js +0 -7
  70. package/dist/electronicSignatureManager-D9OHzTpG.esm.js +0 -428
  71. package/dist/email.d.ts +0 -4
  72. package/dist/email.esm.js +0 -9
  73. package/dist/emailManager-DIfnS5g1.d.ts +0 -352
  74. package/dist/emailManager-wAV0LE-H.esm.js +0 -238
  75. package/dist/emailStateMachine-DOf4j58N.esm.js +0 -292
  76. package/dist/endpoints-CnN3SyDa.esm.js +0 -87
  77. package/dist/events-D6-e4vok.esm.js +0 -596
  78. package/dist/events.d.ts +0 -265
  79. package/dist/events.esm.js +0 -4
  80. package/dist/extensibility.d.ts +0 -122
  81. package/dist/extensibility.esm.js +0 -43
  82. package/dist/face-match.d.ts +0 -228
  83. package/dist/face-match.esm.js +0 -173
  84. package/dist/faceCaptureManagerFactory-Dh2PdGlF.esm.js +0 -290
  85. package/dist/faceCaptureManagerFactory-yqtpxjnN.d.ts +0 -690
  86. package/dist/faceCaptureSetup-B3faSpYA.esm.js +0 -873
  87. package/dist/faceMatchStateMachine-DNFrxTFS.esm.js +0 -127
  88. package/dist/flow-events.d.ts +0 -6
  89. package/dist/flow-events.esm.js +0 -0
  90. package/dist/flow.d.ts +0 -358
  91. package/dist/flow.esm.js +0 -825
  92. package/dist/flowCompletionService-DhkT4SRY.d.ts +0 -10
  93. package/dist/flowCompletionService-P54yzGvA.esm.js +0 -13
  94. package/dist/flowServices-DTsm-Vf1.esm.js +0 -188
  95. package/dist/geolocation.d.ts +0 -127
  96. package/dist/geolocation.esm.js +0 -89
  97. package/dist/geolocationStateMachine-asasuHY2.esm.js +0 -105
  98. package/dist/getBrowser-BSXUTWXw.esm.js +0 -41
  99. package/dist/getDeviceClass-BSntT9_j.esm.js +0 -14
  100. package/dist/government-validation.d.ts +0 -67
  101. package/dist/government-validation.esm.js +0 -81
  102. package/dist/governmentValidationStateMachine-BDDYrJTo.esm.js +0 -271
  103. package/dist/home.d.ts +0 -99
  104. package/dist/home.esm.js +0 -61
  105. package/dist/http.d.ts +0 -68
  106. package/dist/http.esm.js +0 -3
  107. package/dist/id-ocr.d.ts +0 -635
  108. package/dist/id-ocr.esm.js +0 -86
  109. package/dist/id-verification.d.ts +0 -190
  110. package/dist/id-verification.esm.js +0 -43
  111. package/dist/id.d.ts +0 -24
  112. package/dist/id.esm.js +0 -164
  113. package/dist/idCaptureManager-B9TGA5dq.d.ts +0 -956
  114. package/dist/idCaptureManager-DMK0GIt3.esm.js +0 -581
  115. package/dist/idCaptureStateMachine-Bq0fVZXl.esm.js +0 -2954
  116. package/dist/idOcrStateMachine-YbjjC_Gg.esm.js +0 -388
  117. package/dist/idVerificationStateMachine-xbw9HP1Z.esm.js +0 -71
  118. package/dist/identity-reuse.d.ts +0 -530
  119. package/dist/identity-reuse.esm.js +0 -274
  120. package/dist/index-BLKtMA0g.d.ts +0 -1177
  121. package/dist/index-BcRG8rtJ.d.ts +0 -97
  122. package/dist/index.d.ts +0 -3
  123. package/dist/index.esm.js +0 -12
  124. package/dist/invokeOnCaptureCallback-rc6kBHo5.esm.js +0 -30
  125. package/dist/lib-BB0B_qQX.esm.js +0 -12499
  126. package/dist/mandatory-consent.d.ts +0 -412
  127. package/dist/mandatory-consent.esm.js +0 -78
  128. package/dist/mandatoryConsentStateMachine-Cnco1jvn.esm.js +0 -126
  129. package/dist/openviduLazy-Cm0XFh_v.esm.js +0 -3
  130. package/dist/openviduLazy-Cok70ZSg.esm.js +0 -12
  131. package/dist/permissionServices-D_i6nzEw.esm.js +0 -50
  132. package/dist/phone.d.ts +0 -4
  133. package/dist/phone.esm.js +0 -9
  134. package/dist/phoneManager-B6M30hKE.d.ts +0 -397
  135. package/dist/phoneManager-DAJbGhlY.esm.js +0 -256
  136. package/dist/phoneStateMachine-CuPARRaT.esm.js +0 -351
  137. package/dist/platform-CfrjKhmi.esm.js +0 -83
  138. package/dist/qe-signature-DFo_Cc-I.esm.js +0 -12
  139. package/dist/qe-signature.d.ts +0 -25
  140. package/dist/qe-signature.esm.js +0 -8
  141. package/dist/recordingService-Ig2UgbLv.esm.js +0 -1003
  142. package/dist/redirect-to-mobile.d.ts +0 -107
  143. package/dist/redirect-to-mobile.esm.js +0 -102
  144. package/dist/redirectToMobileStateMachine-BOEqe46A.esm.js +0 -249
  145. package/dist/runChildModule-CqqwqAkW.esm.js +0 -219
  146. package/dist/selfie.d.ts +0 -26
  147. package/dist/selfie.esm.js +0 -146
  148. package/dist/selfieManager-D0lSgd-J.d.ts +0 -68
  149. package/dist/selfieManager-Duisl7qN.esm.js +0 -60
  150. package/dist/selfieStateMachine-D76whWEf.esm.js +0 -68
  151. package/dist/session-BS-d_vuE.esm.js +0 -3206
  152. package/dist/session.d.ts +0 -217
  153. package/dist/session.esm.js +0 -9
  154. package/dist/setup-Buy-hyj4.esm.js +0 -887
  155. package/dist/setup-C5AITV8m.d.ts +0 -254
  156. package/dist/signature.d.ts +0 -94
  157. package/dist/signature.esm.js +0 -66
  158. package/dist/signatureStateMachine-B5-QVUve.esm.js +0 -132
  159. package/dist/stats-CIfiPzb1.esm.js +0 -16
  160. package/dist/stats.d.ts +0 -16
  161. package/dist/stats.esm.js +0 -4
  162. package/dist/trust-graph.d.ts +0 -54
  163. package/dist/trust-graph.esm.js +0 -56
  164. package/dist/types-B06Ypu2F.d.ts +0 -49
  165. package/dist/types-BP1m8VRw.d.ts +0 -340
  166. package/dist/types-CAD4va6a.d.ts +0 -5
  167. package/dist/types-CFV9G_7j.d.ts +0 -24
  168. package/dist/warmup-CEcppFiS.d.ts +0 -63
  169. package/dist/wasm.d.ts +0 -15
  170. package/dist/wasm.esm.js +0 -12
  171. package/dist/watchlist-for-business.d.ts +0 -79
  172. package/dist/watchlist-for-business.esm.js +0 -148
  173. package/dist/watchlist.d.ts +0 -62
  174. package/dist/watchlist.esm.js +0 -86
  175. package/dist/watchlistServices-DMbUhkBX.esm.js +0 -12
  176. package/dist/workflow.d.ts +0 -907
  177. package/dist/workflow.esm.js +0 -702
  178. package/dist/xstate.esm-B70JrNqo.esm.js +0 -3404
@@ -1,906 +0,0 @@
1
- import { t as Manager } from "./Manager-C8PrhBOx.js";
2
- import "./Actor-CI32dTbG.js";
3
- import { t as CameraStream } from "./camera-DBSxa6ML.js";
4
- import * as xstate84 from "xstate";
5
-
6
- //#region src/modules/document-capture/types.d.ts
7
- type DocumentType = 'addressStatement' | 'otherDocument1' | 'otherDocument2' | 'otherDocument3' | 'v5cMultiPageLogbook' | 'circulationCard' | 'financeSettlement' | 'carInvoice' | 'capture' | 'processPoaOcr' | 'processLoaOcr' | 'processAsylumSeekerVisaZaf' | 'processBankStatementOCR' | 'processBankCheck' | 'processV5CLogbook' | 'processCarInvoice' | 'processCirculationCard' | 'processFinanceSettlement';
8
- declare const DOCUMENT_CAPTURE_ERROR_CODES: {
9
- readonly FILE_TOO_LARGE: "FILE_TOO_LARGE";
10
- readonly UPLOAD_FAILED: "UPLOAD_FAILED";
11
- };
12
- declare const DOCUMENT_CAPTURE_FINALIZE_ERROR_CODES: {
13
- readonly UNEXPECTED_ERROR: "UNEXPECTED_ERROR";
14
- };
15
- type DocumentCaptureErrorCode = (typeof DOCUMENT_CAPTURE_ERROR_CODES)[keyof typeof DOCUMENT_CAPTURE_ERROR_CODES];
16
- type DocumentCaptureFinalizeErrorCode = (typeof DOCUMENT_CAPTURE_FINALIZE_ERROR_CODES)[keyof typeof DOCUMENT_CAPTURE_FINALIZE_ERROR_CODES];
17
- /**
18
- * Configuration for the document capture module.
19
- * Parameterized to support both DOCUMENT_CAPTURE and ADDRESS flows.
20
- */
21
- type DocumentCaptureConfig = {
22
- /** Processing type for API endpoint routing. @default 'addressStatement' */
23
- processingType?: DocumentType;
24
- /** Capture mode. 'camera' shows bottom sheet with camera+file options. 'file' opens file picker directly. @default 'camera' */
25
- captureMode?: 'file' | 'camera';
26
- /** Allow user to skip this step. @default false */
27
- allowSkipDocumentCapture?: boolean;
28
- /** Backend ADDRESS config field. Inverted: `disableSkipPoa: true` → skip disabled. If both are set, `allowSkipDocumentCapture` takes precedence. */
29
- disableSkipPoa?: boolean;
30
- /** Tutorial screen title override */
31
- title?: string;
32
- /** Tutorial screen text override */
33
- text?: string;
34
- /** Title override for the second-page tutorial (multi-page flows). Falls back to `title`. */
35
- step2Title?: string;
36
- /** Text override for the second-page tutorial (multi-page flows). Falls back to `text`. */
37
- step2Text?: string;
38
- /** Number of capture/upload attempts before auto-advancing. @default 3 */
39
- captureAttempts?: number;
40
- /** Send image as base64 instead of raw file. @default false */
41
- sendBase64?: boolean;
42
- /** Maximum file size in bytes. @default 10485760 (10MB) */
43
- maxFileSize?: number;
44
- };
45
- type CapturedDocument = {
46
- imageBase64: string;
47
- file: File;
48
- fileType: string;
49
- };
50
- type DocumentUploadResponse = {
51
- success: boolean;
52
- status?: 'ADD_NEXT_PAGE' | 'OPTIONAL_PAGE_CAPTURE' | 'SUCCESS';
53
- };
54
- type FinalizeDocumentResponse = {
55
- status?: string;
56
- success?: boolean;
57
- };
58
- type DocumentCaptureResolvedConfig = {
59
- processingType: DocumentType;
60
- captureMode: 'file' | 'camera';
61
- allowSkipDocumentCapture: boolean;
62
- captureAttempts: number;
63
- sendBase64: boolean;
64
- maxFileSize: number;
65
- title: string | undefined;
66
- text: string | undefined;
67
- step2Title: string | undefined;
68
- step2Text: string | undefined;
69
- };
70
- type DocumentCaptureNextPageType = 'none' | 'required' | 'optional';
71
- type DocumentCaptureContext = {
72
- config: DocumentCaptureResolvedConfig;
73
- stream: CameraStream | undefined;
74
- capturedDocument: CapturedDocument | undefined;
75
- captureMethod: 'camera' | 'file' | 'gallery' | undefined;
76
- progress: number;
77
- error: DocumentCaptureErrorCode | DocumentCaptureFinalizeErrorCode | undefined;
78
- attemptsRemaining: number;
79
- pageNumber: number;
80
- nextPageType: DocumentCaptureNextPageType;
81
- };
82
- type DocumentCaptureInput = {
83
- config: DocumentCaptureConfig;
84
- };
85
- //#endregion
86
- //#region src/modules/document-capture/documentCaptureStateMachine.d.ts
87
- declare const documentCaptureMachine: xstate84.StateMachine<DocumentCaptureContext, {
88
- type: "CAPTURE";
89
- } | {
90
- type: "FILE_SELECTED";
91
- file: File;
92
- imageBase64: string;
93
- fileType: string;
94
- } | {
95
- type: "ACCEPT";
96
- } | {
97
- type: "RETAKE";
98
- } | {
99
- type: "UPLOAD_PROGRESS";
100
- progress: number;
101
- } | {
102
- type: "RETRY";
103
- } | {
104
- type: "CONTINUE";
105
- } | {
106
- type: "NEXT_PAGE_CAMERA";
107
- } | {
108
- type: "NEXT_PAGE_PHOTO_LIBRARY";
109
- } | {
110
- type: "ALL_PAGES_CAPTURED";
111
- } | {
112
- type: "SKIP";
113
- } | {
114
- type: "CLOSE";
115
- }, {
116
- [x: string]: xstate84.ActorRefFromLogic<xstate84.PromiseActorLogic<DocumentUploadResponse, {
117
- capturedDocument: NonNullable<DocumentCaptureContext["capturedDocument"]>;
118
- processingType: string;
119
- onProgress: (progress: number) => void;
120
- }, xstate84.EventObject>> | xstate84.ActorRefFromLogic<xstate84.PromiseActorLogic<MediaStream, void, xstate84.EventObject>> | xstate84.ActorRefFromLogic<xstate84.PromiseActorLogic<FinalizeDocumentResponse, {
121
- processingType: string;
122
- }, xstate84.EventObject>> | undefined;
123
- }, xstate84.Values<{
124
- uploadDocument: {
125
- src: "uploadDocument";
126
- logic: xstate84.PromiseActorLogic<DocumentUploadResponse, {
127
- capturedDocument: NonNullable<DocumentCaptureContext["capturedDocument"]>;
128
- processingType: string;
129
- onProgress: (progress: number) => void;
130
- }, xstate84.EventObject>;
131
- id: string | undefined;
132
- };
133
- initCamera: {
134
- src: "initCamera";
135
- logic: xstate84.PromiseActorLogic<MediaStream, void, xstate84.EventObject>;
136
- id: string | undefined;
137
- };
138
- finalizeDocumentRequest: {
139
- src: "finalizeDocumentRequest";
140
- logic: xstate84.PromiseActorLogic<FinalizeDocumentResponse, {
141
- processingType: string;
142
- }, xstate84.EventObject>;
143
- id: string | undefined;
144
- };
145
- }>, xstate84.Values<{
146
- clearError: {
147
- type: "clearError";
148
- params: xstate84.NonReducibleUnknown;
149
- };
150
- setStream: {
151
- type: "setStream";
152
- params: xstate84.NonReducibleUnknown;
153
- };
154
- setCapturedDocument: {
155
- type: "setCapturedDocument";
156
- params: xstate84.NonReducibleUnknown;
157
- };
158
- setFileTooLargeError: {
159
- type: "setFileTooLargeError";
160
- params: xstate84.NonReducibleUnknown;
161
- };
162
- setProgress: {
163
- type: "setProgress";
164
- params: xstate84.NonReducibleUnknown;
165
- };
166
- setUploadError: {
167
- type: "setUploadError";
168
- params: xstate84.NonReducibleUnknown;
169
- };
170
- setFinalizeError: {
171
- type: "setFinalizeError";
172
- params: xstate84.NonReducibleUnknown;
173
- };
174
- decrementAttemptsRemaining: {
175
- type: "decrementAttemptsRemaining";
176
- params: xstate84.NonReducibleUnknown;
177
- };
178
- setCaptureMethodFile: {
179
- type: "setCaptureMethodFile";
180
- params: xstate84.NonReducibleUnknown;
181
- };
182
- setCaptureMethodCamera: {
183
- type: "setCaptureMethodCamera";
184
- params: xstate84.NonReducibleUnknown;
185
- };
186
- setCaptureMethodGallery: {
187
- type: "setCaptureMethodGallery";
188
- params: xstate84.NonReducibleUnknown;
189
- };
190
- clearCapturedDocument: {
191
- type: "clearCapturedDocument";
192
- params: xstate84.NonReducibleUnknown;
193
- };
194
- resetPageNumber: {
195
- type: "resetPageNumber";
196
- params: xstate84.NonReducibleUnknown;
197
- };
198
- clearCapturedDocumentGalleryRetake: {
199
- type: "clearCapturedDocumentGalleryRetake";
200
- params: xstate84.NonReducibleUnknown;
201
- };
202
- setNextPageType: {
203
- type: "setNextPageType";
204
- params: xstate84.NonReducibleUnknown;
205
- };
206
- clearForNextPage: {
207
- type: "clearForNextPage";
208
- params: xstate84.NonReducibleUnknown;
209
- };
210
- resetProgress: {
211
- type: "resetProgress";
212
- params: xstate84.NonReducibleUnknown;
213
- };
214
- stopStream: {
215
- type: "stopStream";
216
- params: xstate84.NonReducibleUnknown;
217
- };
218
- }>, xstate84.Values<{
219
- allowSkip: {
220
- type: "allowSkip";
221
- params: unknown;
222
- };
223
- fileSizeOk: {
224
- type: "fileSizeOk";
225
- params: unknown;
226
- };
227
- canRetry: {
228
- type: "canRetry";
229
- params: unknown;
230
- };
231
- attemptsExhausted: {
232
- type: "attemptsExhausted";
233
- params: unknown;
234
- };
235
- isCameraMode: {
236
- type: "isCameraMode";
237
- params: unknown;
238
- };
239
- isCaptureMethodCamera: {
240
- type: "isCaptureMethodCamera";
241
- params: unknown;
242
- };
243
- isCaptureMethodGallery: {
244
- type: "isCaptureMethodGallery";
245
- params: unknown;
246
- };
247
- isCaptureMethodFile: {
248
- type: "isCaptureMethodFile";
249
- params: unknown;
250
- };
251
- isNextPageOptional: {
252
- type: "isNextPageOptional";
253
- params: unknown;
254
- };
255
- isNextPageRequired: {
256
- type: "isNextPageRequired";
257
- params: unknown;
258
- };
259
- canFinalizeOptionalPages: {
260
- type: "canFinalizeOptionalPages";
261
- params: unknown;
262
- };
263
- fileSizeOkForGallery: {
264
- type: "fileSizeOkForGallery";
265
- params: unknown;
266
- };
267
- fileSizeOkForNonGallery: {
268
- type: "fileSizeOkForNonGallery";
269
- params: unknown;
270
- };
271
- }>, never, "uploading" | "closed" | "success" | "finished" | "initCamera" | "tutorial" | "capturing" | "preview" | "failure" | "nextPage" | "finalizing", string, DocumentCaptureInput, xstate84.NonReducibleUnknown, xstate84.EventObject, xstate84.MetaObject, {
272
- readonly id: "documentCapture";
273
- readonly initial: "tutorial";
274
- readonly context: ({
275
- input
276
- }: {
277
- spawn: {
278
- <TSrc extends "uploadDocument" | "initCamera" | "finalizeDocumentRequest">(logic: TSrc, ...[options]: ({
279
- src: "uploadDocument";
280
- logic: xstate84.PromiseActorLogic<DocumentUploadResponse, {
281
- capturedDocument: NonNullable<DocumentCaptureContext["capturedDocument"]>;
282
- processingType: string;
283
- onProgress: (progress: number) => void;
284
- }, xstate84.EventObject>;
285
- id: string | undefined;
286
- } extends infer T ? T extends {
287
- src: "uploadDocument";
288
- logic: xstate84.PromiseActorLogic<DocumentUploadResponse, {
289
- capturedDocument: NonNullable<DocumentCaptureContext["capturedDocument"]>;
290
- processingType: string;
291
- onProgress: (progress: number) => void;
292
- }, xstate84.EventObject>;
293
- id: string | undefined;
294
- } ? T extends {
295
- src: TSrc;
296
- } ? xstate84.ConditionalRequired<[options?: ({
297
- id?: T["id"] | undefined;
298
- systemId?: string;
299
- input?: xstate84.InputFrom<T["logic"]> | undefined;
300
- syncSnapshot?: boolean;
301
- } & { [K in xstate84.RequiredActorOptions<T>]: unknown }) | undefined], xstate84.IsNotNever<xstate84.RequiredActorOptions<T>>> : never : never : never) | ({
302
- src: "initCamera";
303
- logic: xstate84.PromiseActorLogic<MediaStream, void, xstate84.EventObject>;
304
- id: string | undefined;
305
- } extends infer T_1 ? T_1 extends {
306
- src: "initCamera";
307
- logic: xstate84.PromiseActorLogic<MediaStream, void, xstate84.EventObject>;
308
- id: string | undefined;
309
- } ? T_1 extends {
310
- src: TSrc;
311
- } ? xstate84.ConditionalRequired<[options?: ({
312
- id?: T_1["id"] | undefined;
313
- systemId?: string;
314
- input?: xstate84.InputFrom<T_1["logic"]> | undefined;
315
- syncSnapshot?: boolean;
316
- } & { [K_1 in xstate84.RequiredActorOptions<T_1>]: unknown }) | undefined], xstate84.IsNotNever<xstate84.RequiredActorOptions<T_1>>> : never : never : never) | ({
317
- src: "finalizeDocumentRequest";
318
- logic: xstate84.PromiseActorLogic<FinalizeDocumentResponse, {
319
- processingType: string;
320
- }, xstate84.EventObject>;
321
- id: string | undefined;
322
- } extends infer T_2 ? T_2 extends {
323
- src: "finalizeDocumentRequest";
324
- logic: xstate84.PromiseActorLogic<FinalizeDocumentResponse, {
325
- processingType: string;
326
- }, xstate84.EventObject>;
327
- id: string | undefined;
328
- } ? T_2 extends {
329
- src: TSrc;
330
- } ? xstate84.ConditionalRequired<[options?: ({
331
- id?: T_2["id"] | undefined;
332
- systemId?: string;
333
- input?: xstate84.InputFrom<T_2["logic"]> | undefined;
334
- syncSnapshot?: boolean;
335
- } & { [K_2 in xstate84.RequiredActorOptions<T_2>]: unknown }) | undefined], xstate84.IsNotNever<xstate84.RequiredActorOptions<T_2>>> : never : never : never)): xstate84.ActorRefFromLogic<xstate84.GetConcreteByKey<xstate84.Values<{
336
- uploadDocument: {
337
- src: "uploadDocument";
338
- logic: xstate84.PromiseActorLogic<DocumentUploadResponse, {
339
- capturedDocument: NonNullable<DocumentCaptureContext["capturedDocument"]>;
340
- processingType: string;
341
- onProgress: (progress: number) => void;
342
- }, xstate84.EventObject>;
343
- id: string | undefined;
344
- };
345
- initCamera: {
346
- src: "initCamera";
347
- logic: xstate84.PromiseActorLogic<MediaStream, void, xstate84.EventObject>;
348
- id: string | undefined;
349
- };
350
- finalizeDocumentRequest: {
351
- src: "finalizeDocumentRequest";
352
- logic: xstate84.PromiseActorLogic<FinalizeDocumentResponse, {
353
- processingType: string;
354
- }, xstate84.EventObject>;
355
- id: string | undefined;
356
- };
357
- }>, "src", TSrc>["logic"]>;
358
- <TLogic extends xstate84.AnyActorLogic>(src: TLogic, ...[options]: xstate84.ConditionalRequired<[options?: ({
359
- id?: never;
360
- systemId?: string;
361
- input?: xstate84.InputFrom<TLogic> | undefined;
362
- syncSnapshot?: boolean;
363
- } & { [K in xstate84.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate84.IsNotNever<xstate84.RequiredLogicInput<TLogic>>>): xstate84.ActorRefFromLogic<TLogic>;
364
- };
365
- input: DocumentCaptureInput;
366
- self: xstate84.ActorRef<xstate84.MachineSnapshot<DocumentCaptureContext, {
367
- type: "CAPTURE";
368
- } | {
369
- type: "FILE_SELECTED";
370
- file: File;
371
- imageBase64: string;
372
- fileType: string;
373
- } | {
374
- type: "ACCEPT";
375
- } | {
376
- type: "RETAKE";
377
- } | {
378
- type: "UPLOAD_PROGRESS";
379
- progress: number;
380
- } | {
381
- type: "RETRY";
382
- } | {
383
- type: "CONTINUE";
384
- } | {
385
- type: "NEXT_PAGE_CAMERA";
386
- } | {
387
- type: "NEXT_PAGE_PHOTO_LIBRARY";
388
- } | {
389
- type: "ALL_PAGES_CAPTURED";
390
- } | {
391
- type: "SKIP";
392
- } | {
393
- type: "CLOSE";
394
- }, Record<string, xstate84.AnyActorRef | undefined>, xstate84.StateValue, string, unknown, any, any>, {
395
- type: "CAPTURE";
396
- } | {
397
- type: "FILE_SELECTED";
398
- file: File;
399
- imageBase64: string;
400
- fileType: string;
401
- } | {
402
- type: "ACCEPT";
403
- } | {
404
- type: "RETAKE";
405
- } | {
406
- type: "UPLOAD_PROGRESS";
407
- progress: number;
408
- } | {
409
- type: "RETRY";
410
- } | {
411
- type: "CONTINUE";
412
- } | {
413
- type: "NEXT_PAGE_CAMERA";
414
- } | {
415
- type: "NEXT_PAGE_PHOTO_LIBRARY";
416
- } | {
417
- type: "ALL_PAGES_CAPTURED";
418
- } | {
419
- type: "SKIP";
420
- } | {
421
- type: "CLOSE";
422
- }, xstate84.AnyEventObject>;
423
- }) => {
424
- config: {
425
- processingType: DocumentType;
426
- captureMode: "file" | "camera";
427
- allowSkipDocumentCapture: boolean;
428
- captureAttempts: number;
429
- sendBase64: boolean;
430
- maxFileSize: number;
431
- title: string | undefined;
432
- text: string | undefined;
433
- step2Title: string | undefined;
434
- step2Text: string | undefined;
435
- };
436
- stream: undefined;
437
- capturedDocument: undefined;
438
- captureMethod: undefined;
439
- progress: number;
440
- error: undefined;
441
- attemptsRemaining: number;
442
- pageNumber: number;
443
- nextPageType: "none";
444
- };
445
- readonly states: {
446
- readonly tutorial: {
447
- readonly on: {
448
- readonly CAPTURE: readonly [{
449
- readonly target: "initCamera";
450
- readonly guard: "isCameraMode";
451
- }, {
452
- readonly target: "capturing";
453
- }];
454
- readonly FILE_SELECTED: readonly [{
455
- readonly target: "preview";
456
- readonly guard: "fileSizeOk";
457
- readonly actions: readonly ["setCapturedDocument", "setCaptureMethodFile"];
458
- }, {
459
- readonly target: "tutorial";
460
- readonly actions: "setFileTooLargeError";
461
- }];
462
- readonly SKIP: {
463
- readonly target: "finished";
464
- readonly guard: "allowSkip";
465
- };
466
- readonly CLOSE: {
467
- readonly target: "closed";
468
- };
469
- };
470
- };
471
- readonly initCamera: {
472
- readonly invoke: {
473
- readonly id: "initCamera";
474
- readonly src: "initCamera";
475
- readonly input: undefined;
476
- readonly onDone: {
477
- readonly target: "capturing";
478
- readonly actions: "setStream";
479
- };
480
- readonly onError: {
481
- readonly target: "failure";
482
- readonly actions: "setUploadError";
483
- };
484
- };
485
- readonly on: {
486
- readonly CLOSE: {
487
- readonly target: "closed";
488
- };
489
- };
490
- };
491
- readonly capturing: {
492
- readonly on: {
493
- readonly FILE_SELECTED: readonly [{
494
- readonly target: "preview";
495
- readonly guard: "fileSizeOkForGallery";
496
- readonly actions: "setCapturedDocument";
497
- }, {
498
- readonly target: "preview";
499
- readonly guard: "fileSizeOkForNonGallery";
500
- readonly actions: readonly ["setCapturedDocument", "setCaptureMethodCamera"];
501
- }, {
502
- readonly target: "capturing";
503
- readonly actions: "setFileTooLargeError";
504
- }];
505
- readonly CLOSE: {
506
- readonly target: "closed";
507
- readonly actions: "stopStream";
508
- };
509
- };
510
- };
511
- readonly preview: {
512
- readonly on: {
513
- readonly ACCEPT: {
514
- readonly target: "uploading";
515
- readonly actions: "resetProgress";
516
- };
517
- readonly RETAKE: readonly [{
518
- readonly target: "tutorial";
519
- readonly guard: "isCaptureMethodFile";
520
- readonly actions: "clearCapturedDocument";
521
- }, {
522
- readonly target: "capturing";
523
- readonly guard: "isCaptureMethodGallery";
524
- readonly actions: "clearCapturedDocumentGalleryRetake";
525
- }, {
526
- readonly target: "capturing";
527
- readonly actions: "clearCapturedDocument";
528
- }];
529
- readonly CLOSE: {
530
- readonly target: "closed";
531
- readonly actions: "stopStream";
532
- };
533
- };
534
- };
535
- readonly uploading: {
536
- readonly invoke: {
537
- readonly id: "uploadDocument";
538
- readonly src: "uploadDocument";
539
- readonly input: ({
540
- context,
541
- self
542
- }: {
543
- context: DocumentCaptureContext;
544
- event: {
545
- type: "CAPTURE";
546
- } | {
547
- type: "FILE_SELECTED";
548
- file: File;
549
- imageBase64: string;
550
- fileType: string;
551
- } | {
552
- type: "ACCEPT";
553
- } | {
554
- type: "RETAKE";
555
- } | {
556
- type: "UPLOAD_PROGRESS";
557
- progress: number;
558
- } | {
559
- type: "RETRY";
560
- } | {
561
- type: "CONTINUE";
562
- } | {
563
- type: "NEXT_PAGE_CAMERA";
564
- } | {
565
- type: "NEXT_PAGE_PHOTO_LIBRARY";
566
- } | {
567
- type: "ALL_PAGES_CAPTURED";
568
- } | {
569
- type: "SKIP";
570
- } | {
571
- type: "CLOSE";
572
- };
573
- self: xstate84.ActorRef<xstate84.MachineSnapshot<DocumentCaptureContext, {
574
- type: "CAPTURE";
575
- } | {
576
- type: "FILE_SELECTED";
577
- file: File;
578
- imageBase64: string;
579
- fileType: string;
580
- } | {
581
- type: "ACCEPT";
582
- } | {
583
- type: "RETAKE";
584
- } | {
585
- type: "UPLOAD_PROGRESS";
586
- progress: number;
587
- } | {
588
- type: "RETRY";
589
- } | {
590
- type: "CONTINUE";
591
- } | {
592
- type: "NEXT_PAGE_CAMERA";
593
- } | {
594
- type: "NEXT_PAGE_PHOTO_LIBRARY";
595
- } | {
596
- type: "ALL_PAGES_CAPTURED";
597
- } | {
598
- type: "SKIP";
599
- } | {
600
- type: "CLOSE";
601
- }, Record<string, xstate84.AnyActorRef>, xstate84.StateValue, string, unknown, any, any>, {
602
- type: "CAPTURE";
603
- } | {
604
- type: "FILE_SELECTED";
605
- file: File;
606
- imageBase64: string;
607
- fileType: string;
608
- } | {
609
- type: "ACCEPT";
610
- } | {
611
- type: "RETAKE";
612
- } | {
613
- type: "UPLOAD_PROGRESS";
614
- progress: number;
615
- } | {
616
- type: "RETRY";
617
- } | {
618
- type: "CONTINUE";
619
- } | {
620
- type: "NEXT_PAGE_CAMERA";
621
- } | {
622
- type: "NEXT_PAGE_PHOTO_LIBRARY";
623
- } | {
624
- type: "ALL_PAGES_CAPTURED";
625
- } | {
626
- type: "SKIP";
627
- } | {
628
- type: "CLOSE";
629
- }, xstate84.AnyEventObject>;
630
- }) => {
631
- capturedDocument: CapturedDocument;
632
- processingType: DocumentType;
633
- onProgress: (progress: number) => void;
634
- };
635
- readonly onDone: {
636
- readonly target: "success";
637
- readonly actions: readonly ["setNextPageType", "stopStream"];
638
- };
639
- readonly onError: {
640
- readonly target: "failure";
641
- readonly actions: readonly ["setUploadError", "decrementAttemptsRemaining", "stopStream"];
642
- };
643
- };
644
- readonly on: {
645
- readonly UPLOAD_PROGRESS: {
646
- readonly actions: "setProgress";
647
- };
648
- };
649
- };
650
- readonly success: {
651
- readonly on: {
652
- readonly CONTINUE: readonly [{
653
- readonly target: "nextPage";
654
- readonly guard: "isNextPageOptional";
655
- }, {
656
- readonly target: "nextPage";
657
- readonly guard: "isNextPageRequired";
658
- }, {
659
- readonly target: "finished";
660
- }];
661
- readonly CLOSE: {
662
- readonly target: "closed";
663
- };
664
- };
665
- };
666
- readonly nextPage: {
667
- readonly on: {
668
- readonly NEXT_PAGE_CAMERA: {
669
- readonly target: "initCamera";
670
- readonly actions: readonly ["clearForNextPage", "setCaptureMethodCamera"];
671
- };
672
- readonly NEXT_PAGE_PHOTO_LIBRARY: {
673
- readonly target: "capturing";
674
- readonly actions: readonly ["clearForNextPage", "setCaptureMethodGallery"];
675
- };
676
- readonly ALL_PAGES_CAPTURED: readonly [{
677
- readonly target: "finalizing";
678
- readonly guard: "canFinalizeOptionalPages";
679
- }, {
680
- readonly target: "finished";
681
- }];
682
- readonly CLOSE: {
683
- readonly target: "closed";
684
- };
685
- };
686
- };
687
- readonly finalizing: {
688
- readonly invoke: {
689
- readonly id: "finalizeDocument";
690
- readonly src: "finalizeDocumentRequest";
691
- readonly input: ({
692
- context
693
- }: {
694
- context: DocumentCaptureContext;
695
- event: {
696
- type: "CAPTURE";
697
- } | {
698
- type: "FILE_SELECTED";
699
- file: File;
700
- imageBase64: string;
701
- fileType: string;
702
- } | {
703
- type: "ACCEPT";
704
- } | {
705
- type: "RETAKE";
706
- } | {
707
- type: "UPLOAD_PROGRESS";
708
- progress: number;
709
- } | {
710
- type: "RETRY";
711
- } | {
712
- type: "CONTINUE";
713
- } | {
714
- type: "NEXT_PAGE_CAMERA";
715
- } | {
716
- type: "NEXT_PAGE_PHOTO_LIBRARY";
717
- } | {
718
- type: "ALL_PAGES_CAPTURED";
719
- } | {
720
- type: "SKIP";
721
- } | {
722
- type: "CLOSE";
723
- };
724
- self: xstate84.ActorRef<xstate84.MachineSnapshot<DocumentCaptureContext, {
725
- type: "CAPTURE";
726
- } | {
727
- type: "FILE_SELECTED";
728
- file: File;
729
- imageBase64: string;
730
- fileType: string;
731
- } | {
732
- type: "ACCEPT";
733
- } | {
734
- type: "RETAKE";
735
- } | {
736
- type: "UPLOAD_PROGRESS";
737
- progress: number;
738
- } | {
739
- type: "RETRY";
740
- } | {
741
- type: "CONTINUE";
742
- } | {
743
- type: "NEXT_PAGE_CAMERA";
744
- } | {
745
- type: "NEXT_PAGE_PHOTO_LIBRARY";
746
- } | {
747
- type: "ALL_PAGES_CAPTURED";
748
- } | {
749
- type: "SKIP";
750
- } | {
751
- type: "CLOSE";
752
- }, Record<string, xstate84.AnyActorRef>, xstate84.StateValue, string, unknown, any, any>, {
753
- type: "CAPTURE";
754
- } | {
755
- type: "FILE_SELECTED";
756
- file: File;
757
- imageBase64: string;
758
- fileType: string;
759
- } | {
760
- type: "ACCEPT";
761
- } | {
762
- type: "RETAKE";
763
- } | {
764
- type: "UPLOAD_PROGRESS";
765
- progress: number;
766
- } | {
767
- type: "RETRY";
768
- } | {
769
- type: "CONTINUE";
770
- } | {
771
- type: "NEXT_PAGE_CAMERA";
772
- } | {
773
- type: "NEXT_PAGE_PHOTO_LIBRARY";
774
- } | {
775
- type: "ALL_PAGES_CAPTURED";
776
- } | {
777
- type: "SKIP";
778
- } | {
779
- type: "CLOSE";
780
- }, xstate84.AnyEventObject>;
781
- }) => {
782
- processingType: DocumentType;
783
- };
784
- readonly onDone: {
785
- readonly target: "finished";
786
- };
787
- readonly onError: {
788
- readonly target: "failure";
789
- readonly actions: readonly ["setFinalizeError", "decrementAttemptsRemaining"];
790
- };
791
- };
792
- };
793
- readonly failure: {
794
- readonly on: {
795
- readonly RETRY: {
796
- readonly target: "tutorial";
797
- readonly guard: "canRetry";
798
- readonly actions: readonly ["clearError", "clearCapturedDocument", "resetPageNumber"];
799
- };
800
- readonly CLOSE: {
801
- readonly target: "closed";
802
- };
803
- };
804
- readonly after: {
805
- readonly 3000: {
806
- readonly target: "finished";
807
- readonly guard: "attemptsExhausted";
808
- };
809
- };
810
- };
811
- readonly finished: {
812
- readonly type: "final";
813
- };
814
- readonly closed: {
815
- readonly type: "final";
816
- };
817
- };
818
- }>;
819
- //#endregion
820
- //#region src/modules/document-capture/documentCaptureActor.d.ts
821
- type CreateDocumentCaptureActorOptions = {
822
- config: DocumentCaptureConfig;
823
- };
824
- //#endregion
825
- //#region src/modules/document-capture/documentCaptureManager.d.ts
826
- type DocumentCaptureTutorialState = {
827
- status: 'tutorial';
828
- title: string | undefined;
829
- text: string | undefined;
830
- allowSkipDocumentCapture: boolean;
831
- captureMode: 'file' | 'camera';
832
- error: DocumentCaptureErrorCode | undefined;
833
- pageNumber: number;
834
- };
835
- type DocumentCaptureInitializingCameraState = {
836
- status: 'initializingCamera';
837
- };
838
- type DocumentCaptureCapturingState = {
839
- status: 'capturing';
840
- stream: MediaStream | undefined;
841
- captureMode: 'file' | 'camera';
842
- captureMethod: 'camera' | 'file' | 'gallery' | undefined;
843
- error: DocumentCaptureErrorCode | undefined;
844
- pageNumber: number;
845
- };
846
- type DocumentCapturePreviewState = {
847
- status: 'preview';
848
- imageBase64: string;
849
- fileType: string;
850
- fileName: string;
851
- };
852
- type DocumentCaptureUploadingState = {
853
- status: 'uploading';
854
- progress: number;
855
- imageBase64: string;
856
- fileType: string;
857
- fileName: string;
858
- };
859
- type DocumentCaptureSuccessState = {
860
- status: 'success';
861
- imageBase64: string;
862
- fileType: string;
863
- fileName: string;
864
- nextPageType: DocumentCaptureNextPageType;
865
- };
866
- type DocumentCaptureFailureState = {
867
- status: 'failure';
868
- error: DocumentCaptureErrorCode;
869
- attemptsRemaining: number;
870
- };
871
- type DocumentCaptureFinishedState = {
872
- status: 'finished';
873
- };
874
- type DocumentCaptureClosedState = {
875
- status: 'closed';
876
- };
877
- type DocumentCaptureNextPageState = {
878
- status: 'nextPage';
879
- imageBase64: string;
880
- fileType: string;
881
- fileName: string;
882
- pageNumber: number;
883
- nextPageType: Exclude<DocumentCaptureNextPageType, 'none'>;
884
- captureMode: 'file' | 'camera';
885
- };
886
- /** Confirming optional multi-page capture with the backend (short-lived). */
887
- type DocumentCaptureFinalizingState = {
888
- status: 'finalizing';
889
- };
890
- type DocumentCaptureState = DocumentCaptureTutorialState | DocumentCaptureInitializingCameraState | DocumentCaptureCapturingState | DocumentCapturePreviewState | DocumentCaptureUploadingState | DocumentCaptureSuccessState | DocumentCaptureFailureState | DocumentCaptureFinishedState | DocumentCaptureClosedState | DocumentCaptureNextPageState | DocumentCaptureFinalizingState;
891
- declare function createDocumentCaptureManager(options: CreateDocumentCaptureActorOptions): Manager<DocumentCaptureState> & {
892
- capture(): void;
893
- setFile(file: File, imageBase64: string): void;
894
- accept(): void;
895
- retake(): void;
896
- retry(): void;
897
- continue(): void;
898
- skip(): void;
899
- close(): void;
900
- captureNextPageFromCamera(): void;
901
- captureNextPageFromFile(): void;
902
- finishPageCapture(): void;
903
- };
904
- type DocumentCaptureManager = ReturnType<typeof createDocumentCaptureManager>;
905
- //#endregion
906
- export { DOCUMENT_CAPTURE_ERROR_CODES, type DocumentCaptureConfig, type DocumentCaptureErrorCode, type DocumentCaptureManager, type DocumentCaptureNextPageType, type DocumentCaptureState, type DocumentType, createDocumentCaptureManager, documentCaptureMachine };