@incodetech/core 2.0.0 → 2.0.1-rc.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.
- package/dist/Actor-CI32dTbG.d.ts +2 -0
- package/dist/BaseWasmProvider-C_DLEI40.esm.js +1118 -0
- package/dist/BrowserStorageProvider-CuOW1Er2.esm.js +55 -0
- package/dist/BrowserTimerProvider-DhNc_x02.esm.js +22 -0
- package/dist/ITimerCapability-C67ZRskg.esm.js +7 -0
- package/dist/IpifyProvider-D7jx52AL.esm.js +139 -0
- package/dist/Manager-C8PrhBOx.d.ts +19 -0
- package/dist/MotionSensorProvider-4v7xkqAp.esm.js +254 -0
- package/dist/OpenViduRecordingProvider-CMu6XVdc.esm.js +87 -0
- package/dist/StateMachine-BCQrZJhf.d.ts +2 -0
- package/dist/WasmUtilProvider-j98OJf-S.esm.js +114 -0
- package/dist/addressSearch-BpTbTWCa.esm.js +430 -0
- package/dist/ae-signature-DDDZmWXj.esm.js +12 -0
- package/dist/ae-signature.d.ts +25 -0
- package/dist/ae-signature.esm.js +8 -0
- package/dist/antifraud.d.ts +57 -0
- package/dist/antifraud.esm.js +45 -0
- package/dist/antifraudStateMachine-O0TMf6yc.esm.js +39 -0
- package/dist/api-CESGtpbH.esm.js +53 -0
- package/dist/authentication.d.ts +12 -0
- package/dist/authentication.esm.js +25 -0
- package/dist/authenticationManager-5M-fKzXx.esm.js +67 -0
- package/dist/authenticationManager-C83GNIhl.d.ts +66 -0
- package/dist/authenticationStateMachine-BMZqatiF.esm.js +139 -0
- package/dist/backCameraStream-DMdMeGk2.esm.js +346 -0
- package/dist/browserSimulation-gxD8cSpM.esm.js +20 -0
- package/dist/camera-DBSxa6ML.d.ts +4 -0
- package/dist/camera-PA2Ljri3.esm.js +22 -0
- package/dist/camera.d.ts +15 -0
- package/dist/camera.esm.js +5 -0
- package/dist/chunk-CRF6K_H_.esm.js +49 -0
- package/dist/consent.d.ts +398 -0
- package/dist/consent.esm.js +79 -0
- package/dist/consentStateMachine-CCT-B60O.esm.js +151 -0
- package/dist/cpf-PPz2Njto.esm.js +38 -0
- package/dist/cpf-ocr.d.ts +204 -0
- package/dist/cpf-ocr.esm.js +177 -0
- package/dist/cross-document-data-match.d.ts +34 -0
- package/dist/cross-document-data-match.esm.js +71 -0
- package/dist/curp-validation.d.ts +188 -0
- package/dist/curp-validation.esm.js +110 -0
- package/dist/curpValidationStateMachine-CitWLr2c.esm.js +595 -0
- package/dist/custom-fields.d.ts +115 -0
- package/dist/custom-fields.esm.js +177 -0
- package/dist/custom-watchlist.d.ts +66 -0
- package/dist/custom-watchlist.esm.js +86 -0
- package/dist/dateUtils-UoN5xswP.esm.js +23 -0
- package/dist/deepsightLoader-Cm4JIT_z.esm.js +52 -0
- package/dist/deepsightService-CEVxzehb.d.ts +412 -0
- package/dist/deepsightService-O74l4Y__.esm.js +489 -0
- package/dist/device.d.ts +46 -0
- package/dist/device.esm.js +106 -0
- package/dist/displayErrors-DqJ_IbsG.d.ts +39 -0
- package/dist/document-capture.d.ts +906 -0
- package/dist/document-capture.esm.js +156 -0
- package/dist/document-upload.d.ts +331 -0
- package/dist/document-upload.esm.js +203 -0
- package/dist/documentCaptureStateMachine-BqzTDy9k.esm.js +394 -0
- package/dist/dynamic-forms.d.ts +178 -0
- package/dist/dynamic-forms.esm.js +323 -0
- package/dist/ekyb.d.ts +148 -0
- package/dist/ekyb.esm.js +127 -0
- package/dist/ekybStateMachine-BR2let5f.esm.js +674 -0
- package/dist/ekyc.d.ts +164 -0
- package/dist/ekyc.esm.js +104 -0
- package/dist/ekycStateMachine-oeO0Iekd.esm.js +10626 -0
- package/dist/electronic-signature.d.ts +4 -0
- package/dist/electronic-signature.esm.js +7 -0
- package/dist/electronicSignatureManager-D9OHzTpG.esm.js +428 -0
- package/dist/email.d.ts +4 -0
- package/dist/email.esm.js +9 -0
- package/dist/emailManager-DIfnS5g1.d.ts +352 -0
- package/dist/emailManager-wAV0LE-H.esm.js +238 -0
- package/dist/emailStateMachine-DOf4j58N.esm.js +292 -0
- package/dist/endpoints-CnN3SyDa.esm.js +87 -0
- package/dist/events-D6-e4vok.esm.js +596 -0
- package/dist/events.d.ts +265 -0
- package/dist/events.esm.js +4 -0
- package/dist/extensibility.d.ts +122 -0
- package/dist/extensibility.esm.js +43 -0
- package/dist/face-match.d.ts +228 -0
- package/dist/face-match.esm.js +173 -0
- package/dist/faceCaptureManagerFactory-Dh2PdGlF.esm.js +290 -0
- package/dist/faceCaptureManagerFactory-yqtpxjnN.d.ts +690 -0
- package/dist/faceCaptureSetup-B3faSpYA.esm.js +873 -0
- package/dist/faceMatchStateMachine-DNFrxTFS.esm.js +127 -0
- package/dist/flow-events.d.ts +6 -0
- package/dist/flow-events.esm.js +0 -0
- package/dist/flow.d.ts +358 -0
- package/dist/flow.esm.js +825 -0
- package/dist/flowCompletionService-DhkT4SRY.d.ts +10 -0
- package/dist/flowCompletionService-P54yzGvA.esm.js +13 -0
- package/dist/flowServices-DG3IdWw6.esm.js +188 -0
- package/dist/geolocation.d.ts +127 -0
- package/dist/geolocation.esm.js +89 -0
- package/dist/geolocationStateMachine-asasuHY2.esm.js +105 -0
- package/dist/getBrowser-BSXUTWXw.esm.js +41 -0
- package/dist/getDeviceClass-BSntT9_j.esm.js +14 -0
- package/dist/government-validation.d.ts +67 -0
- package/dist/government-validation.esm.js +81 -0
- package/dist/governmentValidationStateMachine-BDDYrJTo.esm.js +271 -0
- package/dist/home.d.ts +99 -0
- package/dist/home.esm.js +61 -0
- package/dist/http.d.ts +68 -0
- package/dist/http.esm.js +3 -0
- package/dist/id-ocr.d.ts +635 -0
- package/dist/id-ocr.esm.js +86 -0
- package/dist/id-verification.d.ts +190 -0
- package/dist/id-verification.esm.js +43 -0
- package/dist/id.d.ts +24 -0
- package/dist/id.esm.js +164 -0
- package/dist/idCaptureManager-Fyd0eam-.d.ts +958 -0
- package/dist/idCaptureManager-ZPkD7Gjk.esm.js +581 -0
- package/dist/idCaptureStateMachine-BK0bPHoc.esm.js +2963 -0
- package/dist/idOcrStateMachine-YbjjC_Gg.esm.js +388 -0
- package/dist/idVerificationStateMachine-xbw9HP1Z.esm.js +71 -0
- package/dist/identity-reuse.d.ts +530 -0
- package/dist/identity-reuse.esm.js +274 -0
- package/dist/index-BcRG8rtJ.d.ts +97 -0
- package/dist/index-DZoqeAo9.d.ts +1177 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.esm.js +12 -0
- package/dist/invokeOnCaptureCallback-rc6kBHo5.esm.js +30 -0
- package/dist/lib-BB0B_qQX.esm.js +12499 -0
- package/dist/mandatory-consent.d.ts +412 -0
- package/dist/mandatory-consent.esm.js +78 -0
- package/dist/mandatoryConsentStateMachine-Cnco1jvn.esm.js +126 -0
- package/dist/openviduLazy-Cm0XFh_v.esm.js +3 -0
- package/dist/openviduLazy-Cok70ZSg.esm.js +12 -0
- package/dist/permissionServices-D_i6nzEw.esm.js +50 -0
- package/dist/phone.d.ts +4 -0
- package/dist/phone.esm.js +9 -0
- package/dist/phoneManager-B6M30hKE.d.ts +397 -0
- package/dist/phoneManager-DAJbGhlY.esm.js +256 -0
- package/dist/phoneStateMachine-CuPARRaT.esm.js +351 -0
- package/dist/platform-CfrjKhmi.esm.js +83 -0
- package/dist/qe-signature-DFo_Cc-I.esm.js +12 -0
- package/dist/qe-signature.d.ts +25 -0
- package/dist/qe-signature.esm.js +8 -0
- package/dist/recordingService-Ig2UgbLv.esm.js +1003 -0
- package/dist/redirect-to-mobile.d.ts +107 -0
- package/dist/redirect-to-mobile.esm.js +102 -0
- package/dist/redirectToMobileStateMachine-BOEqe46A.esm.js +249 -0
- package/dist/runChildModule-CqqwqAkW.esm.js +219 -0
- package/dist/selfie.d.ts +26 -0
- package/dist/selfie.esm.js +146 -0
- package/dist/selfieManager-D0lSgd-J.d.ts +68 -0
- package/dist/selfieManager-Duisl7qN.esm.js +60 -0
- package/dist/selfieStateMachine-D76whWEf.esm.js +68 -0
- package/dist/session-CGtQJJzB.esm.js +3206 -0
- package/dist/session.d.ts +217 -0
- package/dist/session.esm.js +9 -0
- package/dist/setup-C5AITV8m.d.ts +254 -0
- package/dist/setup-DsM8IG7k.esm.js +887 -0
- package/dist/signature.d.ts +94 -0
- package/dist/signature.esm.js +66 -0
- package/dist/signatureStateMachine-B5-QVUve.esm.js +132 -0
- package/dist/stats-CIfiPzb1.esm.js +16 -0
- package/dist/stats.d.ts +16 -0
- package/dist/stats.esm.js +4 -0
- package/dist/trust-graph.d.ts +54 -0
- package/dist/trust-graph.esm.js +56 -0
- package/dist/types-B06Ypu2F.d.ts +49 -0
- package/dist/types-BP1m8VRw.d.ts +340 -0
- package/dist/types-CAD4va6a.d.ts +5 -0
- package/dist/types-CFV9G_7j.d.ts +24 -0
- package/dist/warmup-CEcppFiS.d.ts +63 -0
- package/dist/wasm.d.ts +15 -0
- package/dist/wasm.esm.js +12 -0
- package/dist/watchlist-for-business.d.ts +79 -0
- package/dist/watchlist-for-business.esm.js +148 -0
- package/dist/watchlist.d.ts +62 -0
- package/dist/watchlist.esm.js +86 -0
- package/dist/watchlistServices-DMbUhkBX.esm.js +12 -0
- package/dist/workflow.d.ts +907 -0
- package/dist/workflow.esm.js +702 -0
- package/dist/xstate.esm-B70JrNqo.esm.js +3404 -0
- package/package.json +1 -1
|
@@ -0,0 +1,906 @@
|
|
|
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 xstate151 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: xstate151.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]: xstate151.ActorRefFromLogic<xstate151.PromiseActorLogic<DocumentUploadResponse, {
|
|
117
|
+
capturedDocument: NonNullable<DocumentCaptureContext["capturedDocument"]>;
|
|
118
|
+
processingType: string;
|
|
119
|
+
onProgress: (progress: number) => void;
|
|
120
|
+
}, xstate151.EventObject>> | xstate151.ActorRefFromLogic<xstate151.PromiseActorLogic<MediaStream, void, xstate151.EventObject>> | xstate151.ActorRefFromLogic<xstate151.PromiseActorLogic<FinalizeDocumentResponse, {
|
|
121
|
+
processingType: string;
|
|
122
|
+
}, xstate151.EventObject>> | undefined;
|
|
123
|
+
}, xstate151.Values<{
|
|
124
|
+
uploadDocument: {
|
|
125
|
+
src: "uploadDocument";
|
|
126
|
+
logic: xstate151.PromiseActorLogic<DocumentUploadResponse, {
|
|
127
|
+
capturedDocument: NonNullable<DocumentCaptureContext["capturedDocument"]>;
|
|
128
|
+
processingType: string;
|
|
129
|
+
onProgress: (progress: number) => void;
|
|
130
|
+
}, xstate151.EventObject>;
|
|
131
|
+
id: string | undefined;
|
|
132
|
+
};
|
|
133
|
+
initCamera: {
|
|
134
|
+
src: "initCamera";
|
|
135
|
+
logic: xstate151.PromiseActorLogic<MediaStream, void, xstate151.EventObject>;
|
|
136
|
+
id: string | undefined;
|
|
137
|
+
};
|
|
138
|
+
finalizeDocumentRequest: {
|
|
139
|
+
src: "finalizeDocumentRequest";
|
|
140
|
+
logic: xstate151.PromiseActorLogic<FinalizeDocumentResponse, {
|
|
141
|
+
processingType: string;
|
|
142
|
+
}, xstate151.EventObject>;
|
|
143
|
+
id: string | undefined;
|
|
144
|
+
};
|
|
145
|
+
}>, xstate151.Values<{
|
|
146
|
+
setStream: {
|
|
147
|
+
type: "setStream";
|
|
148
|
+
params: xstate151.NonReducibleUnknown;
|
|
149
|
+
};
|
|
150
|
+
setCapturedDocument: {
|
|
151
|
+
type: "setCapturedDocument";
|
|
152
|
+
params: xstate151.NonReducibleUnknown;
|
|
153
|
+
};
|
|
154
|
+
setFileTooLargeError: {
|
|
155
|
+
type: "setFileTooLargeError";
|
|
156
|
+
params: xstate151.NonReducibleUnknown;
|
|
157
|
+
};
|
|
158
|
+
setProgress: {
|
|
159
|
+
type: "setProgress";
|
|
160
|
+
params: xstate151.NonReducibleUnknown;
|
|
161
|
+
};
|
|
162
|
+
setUploadError: {
|
|
163
|
+
type: "setUploadError";
|
|
164
|
+
params: xstate151.NonReducibleUnknown;
|
|
165
|
+
};
|
|
166
|
+
setFinalizeError: {
|
|
167
|
+
type: "setFinalizeError";
|
|
168
|
+
params: xstate151.NonReducibleUnknown;
|
|
169
|
+
};
|
|
170
|
+
decrementAttemptsRemaining: {
|
|
171
|
+
type: "decrementAttemptsRemaining";
|
|
172
|
+
params: xstate151.NonReducibleUnknown;
|
|
173
|
+
};
|
|
174
|
+
setCaptureMethodFile: {
|
|
175
|
+
type: "setCaptureMethodFile";
|
|
176
|
+
params: xstate151.NonReducibleUnknown;
|
|
177
|
+
};
|
|
178
|
+
setCaptureMethodCamera: {
|
|
179
|
+
type: "setCaptureMethodCamera";
|
|
180
|
+
params: xstate151.NonReducibleUnknown;
|
|
181
|
+
};
|
|
182
|
+
setCaptureMethodGallery: {
|
|
183
|
+
type: "setCaptureMethodGallery";
|
|
184
|
+
params: xstate151.NonReducibleUnknown;
|
|
185
|
+
};
|
|
186
|
+
clearCapturedDocument: {
|
|
187
|
+
type: "clearCapturedDocument";
|
|
188
|
+
params: xstate151.NonReducibleUnknown;
|
|
189
|
+
};
|
|
190
|
+
resetPageNumber: {
|
|
191
|
+
type: "resetPageNumber";
|
|
192
|
+
params: xstate151.NonReducibleUnknown;
|
|
193
|
+
};
|
|
194
|
+
clearCapturedDocumentGalleryRetake: {
|
|
195
|
+
type: "clearCapturedDocumentGalleryRetake";
|
|
196
|
+
params: xstate151.NonReducibleUnknown;
|
|
197
|
+
};
|
|
198
|
+
setNextPageType: {
|
|
199
|
+
type: "setNextPageType";
|
|
200
|
+
params: xstate151.NonReducibleUnknown;
|
|
201
|
+
};
|
|
202
|
+
clearForNextPage: {
|
|
203
|
+
type: "clearForNextPage";
|
|
204
|
+
params: xstate151.NonReducibleUnknown;
|
|
205
|
+
};
|
|
206
|
+
clearError: {
|
|
207
|
+
type: "clearError";
|
|
208
|
+
params: xstate151.NonReducibleUnknown;
|
|
209
|
+
};
|
|
210
|
+
resetProgress: {
|
|
211
|
+
type: "resetProgress";
|
|
212
|
+
params: xstate151.NonReducibleUnknown;
|
|
213
|
+
};
|
|
214
|
+
stopStream: {
|
|
215
|
+
type: "stopStream";
|
|
216
|
+
params: xstate151.NonReducibleUnknown;
|
|
217
|
+
};
|
|
218
|
+
}>, xstate151.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, xstate151.NonReducibleUnknown, xstate151.EventObject, xstate151.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: xstate151.PromiseActorLogic<DocumentUploadResponse, {
|
|
281
|
+
capturedDocument: NonNullable<DocumentCaptureContext["capturedDocument"]>;
|
|
282
|
+
processingType: string;
|
|
283
|
+
onProgress: (progress: number) => void;
|
|
284
|
+
}, xstate151.EventObject>;
|
|
285
|
+
id: string | undefined;
|
|
286
|
+
} extends infer T ? T extends {
|
|
287
|
+
src: "uploadDocument";
|
|
288
|
+
logic: xstate151.PromiseActorLogic<DocumentUploadResponse, {
|
|
289
|
+
capturedDocument: NonNullable<DocumentCaptureContext["capturedDocument"]>;
|
|
290
|
+
processingType: string;
|
|
291
|
+
onProgress: (progress: number) => void;
|
|
292
|
+
}, xstate151.EventObject>;
|
|
293
|
+
id: string | undefined;
|
|
294
|
+
} ? T extends {
|
|
295
|
+
src: TSrc;
|
|
296
|
+
} ? xstate151.ConditionalRequired<[options?: ({
|
|
297
|
+
id?: T["id"] | undefined;
|
|
298
|
+
systemId?: string;
|
|
299
|
+
input?: xstate151.InputFrom<T["logic"]> | undefined;
|
|
300
|
+
syncSnapshot?: boolean;
|
|
301
|
+
} & { [K in xstate151.RequiredActorOptions<T>]: unknown }) | undefined], xstate151.IsNotNever<xstate151.RequiredActorOptions<T>>> : never : never : never) | ({
|
|
302
|
+
src: "initCamera";
|
|
303
|
+
logic: xstate151.PromiseActorLogic<MediaStream, void, xstate151.EventObject>;
|
|
304
|
+
id: string | undefined;
|
|
305
|
+
} extends infer T_1 ? T_1 extends {
|
|
306
|
+
src: "initCamera";
|
|
307
|
+
logic: xstate151.PromiseActorLogic<MediaStream, void, xstate151.EventObject>;
|
|
308
|
+
id: string | undefined;
|
|
309
|
+
} ? T_1 extends {
|
|
310
|
+
src: TSrc;
|
|
311
|
+
} ? xstate151.ConditionalRequired<[options?: ({
|
|
312
|
+
id?: T_1["id"] | undefined;
|
|
313
|
+
systemId?: string;
|
|
314
|
+
input?: xstate151.InputFrom<T_1["logic"]> | undefined;
|
|
315
|
+
syncSnapshot?: boolean;
|
|
316
|
+
} & { [K_1 in xstate151.RequiredActorOptions<T_1>]: unknown }) | undefined], xstate151.IsNotNever<xstate151.RequiredActorOptions<T_1>>> : never : never : never) | ({
|
|
317
|
+
src: "finalizeDocumentRequest";
|
|
318
|
+
logic: xstate151.PromiseActorLogic<FinalizeDocumentResponse, {
|
|
319
|
+
processingType: string;
|
|
320
|
+
}, xstate151.EventObject>;
|
|
321
|
+
id: string | undefined;
|
|
322
|
+
} extends infer T_2 ? T_2 extends {
|
|
323
|
+
src: "finalizeDocumentRequest";
|
|
324
|
+
logic: xstate151.PromiseActorLogic<FinalizeDocumentResponse, {
|
|
325
|
+
processingType: string;
|
|
326
|
+
}, xstate151.EventObject>;
|
|
327
|
+
id: string | undefined;
|
|
328
|
+
} ? T_2 extends {
|
|
329
|
+
src: TSrc;
|
|
330
|
+
} ? xstate151.ConditionalRequired<[options?: ({
|
|
331
|
+
id?: T_2["id"] | undefined;
|
|
332
|
+
systemId?: string;
|
|
333
|
+
input?: xstate151.InputFrom<T_2["logic"]> | undefined;
|
|
334
|
+
syncSnapshot?: boolean;
|
|
335
|
+
} & { [K_2 in xstate151.RequiredActorOptions<T_2>]: unknown }) | undefined], xstate151.IsNotNever<xstate151.RequiredActorOptions<T_2>>> : never : never : never)): xstate151.ActorRefFromLogic<xstate151.GetConcreteByKey<xstate151.Values<{
|
|
336
|
+
uploadDocument: {
|
|
337
|
+
src: "uploadDocument";
|
|
338
|
+
logic: xstate151.PromiseActorLogic<DocumentUploadResponse, {
|
|
339
|
+
capturedDocument: NonNullable<DocumentCaptureContext["capturedDocument"]>;
|
|
340
|
+
processingType: string;
|
|
341
|
+
onProgress: (progress: number) => void;
|
|
342
|
+
}, xstate151.EventObject>;
|
|
343
|
+
id: string | undefined;
|
|
344
|
+
};
|
|
345
|
+
initCamera: {
|
|
346
|
+
src: "initCamera";
|
|
347
|
+
logic: xstate151.PromiseActorLogic<MediaStream, void, xstate151.EventObject>;
|
|
348
|
+
id: string | undefined;
|
|
349
|
+
};
|
|
350
|
+
finalizeDocumentRequest: {
|
|
351
|
+
src: "finalizeDocumentRequest";
|
|
352
|
+
logic: xstate151.PromiseActorLogic<FinalizeDocumentResponse, {
|
|
353
|
+
processingType: string;
|
|
354
|
+
}, xstate151.EventObject>;
|
|
355
|
+
id: string | undefined;
|
|
356
|
+
};
|
|
357
|
+
}>, "src", TSrc>["logic"]>;
|
|
358
|
+
<TLogic extends xstate151.AnyActorLogic>(src: TLogic, ...[options]: xstate151.ConditionalRequired<[options?: ({
|
|
359
|
+
id?: never;
|
|
360
|
+
systemId?: string;
|
|
361
|
+
input?: xstate151.InputFrom<TLogic> | undefined;
|
|
362
|
+
syncSnapshot?: boolean;
|
|
363
|
+
} & { [K in xstate151.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate151.IsNotNever<xstate151.RequiredLogicInput<TLogic>>>): xstate151.ActorRefFromLogic<TLogic>;
|
|
364
|
+
};
|
|
365
|
+
input: DocumentCaptureInput;
|
|
366
|
+
self: xstate151.ActorRef<xstate151.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, xstate151.AnyActorRef | undefined>, xstate151.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
|
+
}, xstate151.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: xstate151.ActorRef<xstate151.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, xstate151.AnyActorRef>, xstate151.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
|
+
}, xstate151.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: xstate151.ActorRef<xstate151.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, xstate151.AnyActorRef>, xstate151.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
|
+
}, xstate151.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 };
|