@incodetech/core 2.0.0-alpha.8 → 2.0.0-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/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/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-B59rQjgj.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 +3 -263
- package/dist/email.esm.js +7 -477
- 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 +101 -321
- package/dist/flow.esm.js +370 -173
- package/dist/flowCompletionService-DhkT4SRY.d.ts +10 -0
- package/dist/flowCompletionService-P54yzGvA.esm.js +13 -0
- package/dist/flowServices-DTsm-Vf1.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-B9TGA5dq.d.ts +956 -0
- package/dist/idCaptureManager-DMK0GIt3.esm.js +581 -0
- package/dist/idCaptureStateMachine-Bq0fVZXl.esm.js +2954 -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-BLKtMA0g.d.ts +1177 -0
- package/dist/index-BcRG8rtJ.d.ts +97 -0
- package/dist/index.d.ts +3 -226
- package/dist/index.esm.js +11 -154
- package/dist/invokeOnCaptureCallback-rc6kBHo5.esm.js +30 -0
- package/dist/{lib-Bu9XGMBW.esm.js → lib-BB0B_qQX.esm.js} +801 -2
- 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 +3 -291
- package/dist/phone.esm.js +7 -548
- 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 +21 -754
- package/dist/selfie.esm.js +113 -962
- 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-BS-d_vuE.esm.js +3206 -0
- package/dist/session.d.ts +217 -0
- package/dist/session.esm.js +9 -0
- package/dist/setup-Buy-hyj4.esm.js +887 -0
- package/dist/setup-C5AITV8m.d.ts +254 -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-CFV9G_7j.d.ts +24 -0
- package/dist/{warmup-CEJTfxQr.d.ts → warmup-CEcppFiS.d.ts} +11 -3
- 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-B_rda9yU.esm.js → xstate.esm-B70JrNqo.esm.js} +144 -1
- package/package.json +203 -6
- package/dist/OpenViduLogger-BdPfiZO6.esm.js +0 -3
- package/dist/OpenViduLogger-CQyDxBvM.esm.js +0 -803
- package/dist/StateMachine-DRE1oH2B.d.ts +0 -2
- package/dist/addEvent-W0ORK0jT.esm.js +0 -16
- package/dist/endpoints-BSTFaHYo.esm.js +0 -1706
- package/dist/permissionServices-I6vX6DBy.esm.js +0 -72
- /package/dist/{Manager-BGfxEmyv.d.ts → Manager-C8PrhBOx.d.ts} +0 -0
- /package/dist/{chunk-C_Yo44FK.esm.js → chunk-CRF6K_H_.esm.js} +0 -0
- /package/dist/{types-iZi2rawo.d.ts → types-CAD4va6a.d.ts} +0 -0
|
@@ -0,0 +1,956 @@
|
|
|
1
|
+
import { t as Manager } from "./Manager-C8PrhBOx.js";
|
|
2
|
+
import { t as ActorRefFrom } from "./Actor-CI32dTbG.js";
|
|
3
|
+
import { n as StateMachine, t as AnyStateMachine } from "./StateMachine-BCQrZJhf.js";
|
|
4
|
+
import { t as CameraStream } from "./camera-DBSxa6ML.js";
|
|
5
|
+
import { a as RegulationTypes, n as Flow, o as TutorialIdConfig } from "./types-BP1m8VRw.js";
|
|
6
|
+
import { c as IMLProviderCapability, d as IRecordingCapability, f as RecordingConnection, i as IncodeCanvas, l as MLProviderConfig, n as IMotionSensorCapability, r as StreamCanvasCapture, t as DeepsightService, u as IStorageCapability } from "./deepsightService-CEVxzehb.js";
|
|
7
|
+
import { n as PermissionStatus, t as PermissionResult } from "./types-CAD4va6a.js";
|
|
8
|
+
|
|
9
|
+
//#region ../infra/src/capabilities/IIdCaptureCapability.d.ts
|
|
10
|
+
/**
|
|
11
|
+
* Configuration for ID capture provider.
|
|
12
|
+
* Extends base ML provider config with ID-capture specific options.
|
|
13
|
+
*/
|
|
14
|
+
type IdCaptureConfig$1 = MLProviderConfig;
|
|
15
|
+
interface IdCaptureThresholds$1 {
|
|
16
|
+
blurThreshold: number;
|
|
17
|
+
blurChangeThreshold: number;
|
|
18
|
+
glareThreshold: number;
|
|
19
|
+
clsThreshold: number;
|
|
20
|
+
sideThreshold: number;
|
|
21
|
+
iouThreshold: number;
|
|
22
|
+
idDetectedTimeout: number;
|
|
23
|
+
autocaptureTimeout: number;
|
|
24
|
+
framesAggregationInterval: number;
|
|
25
|
+
}
|
|
26
|
+
interface IdCaptureGeometry$1 {
|
|
27
|
+
areaDown: number;
|
|
28
|
+
areaUp: number;
|
|
29
|
+
areaIOSPassportUp: number;
|
|
30
|
+
areaIOSPassportDown: number;
|
|
31
|
+
widthIOSUp: number;
|
|
32
|
+
widthIOSDown: number;
|
|
33
|
+
widthDown: number;
|
|
34
|
+
widthUp: number;
|
|
35
|
+
windowOuterWidth: number;
|
|
36
|
+
windowOuterHeight: number;
|
|
37
|
+
windowInnerWidth: number;
|
|
38
|
+
windowInnerHeight: number;
|
|
39
|
+
}
|
|
40
|
+
interface IdCaptureSettings {
|
|
41
|
+
isFixedMask: boolean;
|
|
42
|
+
isIPhone14OrHigher: boolean;
|
|
43
|
+
idType: string;
|
|
44
|
+
blurCheckEnabled: boolean;
|
|
45
|
+
glareCheckEnabled: boolean;
|
|
46
|
+
faceQualityCheckEnabled: boolean;
|
|
47
|
+
iouCheckEnabled: boolean;
|
|
48
|
+
fpsLimitEnabled: boolean;
|
|
49
|
+
}
|
|
50
|
+
type IdCaptureModelType = 'v1' | 'v2' | 'v3';
|
|
51
|
+
type DetectionOrientation = 'horizontal' | 'vertical';
|
|
52
|
+
interface IdCaptureCallbacks {
|
|
53
|
+
onFarAway?: () => void;
|
|
54
|
+
onDetectionStarted?: () => void;
|
|
55
|
+
onMaskChange?: (show: boolean, mask: boolean, top: number, orientation: DetectionOrientation) => void;
|
|
56
|
+
onBlur?: () => void;
|
|
57
|
+
onGlare?: () => void;
|
|
58
|
+
onCapturing?: () => void;
|
|
59
|
+
onCapture?: () => void;
|
|
60
|
+
onBestFrame?: (blur: number, glare: number, orientation: string) => void;
|
|
61
|
+
onIdNotDetected?: () => void;
|
|
62
|
+
onSwitchToManualCapture?: () => void;
|
|
63
|
+
onIdTypeChange?: (idType: string) => void;
|
|
64
|
+
onIdSideChange?: (side: string) => void;
|
|
65
|
+
onCapturingCounterValueChange?: (value: number) => void;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* WASM array type for quad coordinates.
|
|
69
|
+
* Use .get(index) instead of [index] to access elements.
|
|
70
|
+
*/
|
|
71
|
+
interface QuadArray {
|
|
72
|
+
get(index: number): {
|
|
73
|
+
x: number;
|
|
74
|
+
y: number;
|
|
75
|
+
};
|
|
76
|
+
size?(): number;
|
|
77
|
+
length?: number;
|
|
78
|
+
}
|
|
79
|
+
interface IdCaptureProcessResult {
|
|
80
|
+
cls: number;
|
|
81
|
+
blur: number;
|
|
82
|
+
glare: number;
|
|
83
|
+
quad: QuadArray;
|
|
84
|
+
barQuad: QuadArray;
|
|
85
|
+
side: string;
|
|
86
|
+
size: number;
|
|
87
|
+
idType: string;
|
|
88
|
+
networkInferenceTime: number;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Capability interface for ID document capture.
|
|
92
|
+
* Extends the base ML provider capability with ID-capture specific methods.
|
|
93
|
+
*/
|
|
94
|
+
interface IIdCaptureCapability extends IMLProviderCapability<IdCaptureConfig$1> {
|
|
95
|
+
/**
|
|
96
|
+
* Sets callbacks for ID capture events.
|
|
97
|
+
* @param callbacks - Object containing callback functions for various capture events
|
|
98
|
+
*/
|
|
99
|
+
setCallbacks(callbacks: IdCaptureCallbacks): void;
|
|
100
|
+
/**
|
|
101
|
+
* Sets detection thresholds for quality checks.
|
|
102
|
+
* @param thresholds - Threshold values for blur, glare, and other quality metrics
|
|
103
|
+
*/
|
|
104
|
+
setThresholds(thresholds: IdCaptureThresholds$1): void;
|
|
105
|
+
/**
|
|
106
|
+
* Sets geometry constraints for ID detection.
|
|
107
|
+
* @param geometry - Geometry parameters for ID positioning
|
|
108
|
+
*/
|
|
109
|
+
setGeometry(geometry: IdCaptureGeometry$1): void;
|
|
110
|
+
/**
|
|
111
|
+
* Sets capture settings.
|
|
112
|
+
* @param settings - Configuration for capture behavior
|
|
113
|
+
*/
|
|
114
|
+
setSettings(settings: IdCaptureSettings): void;
|
|
115
|
+
/**
|
|
116
|
+
* Sets the ML model type to use for ID detection.
|
|
117
|
+
* @param modelType - Model version ('v1', 'v2', or 'v3')
|
|
118
|
+
*/
|
|
119
|
+
setModelType(modelType: IdCaptureModelType): void;
|
|
120
|
+
/**
|
|
121
|
+
* Gets the last process result from the most recent frame processing.
|
|
122
|
+
* Returns null if no frame has been processed yet.
|
|
123
|
+
* @returns The last process result with quad coordinates, or null if not available
|
|
124
|
+
*/
|
|
125
|
+
getLastProcessResult(): IdCaptureProcessResult | null;
|
|
126
|
+
/**
|
|
127
|
+
* Transforms the canvas using perspective correction based on frame coordinates.
|
|
128
|
+
* @param canvas - The canvas to transform
|
|
129
|
+
* @param frameRect - Frame rectangle in canvas coordinates (x, y, w, h)
|
|
130
|
+
* @returns The transformed canvas
|
|
131
|
+
*/
|
|
132
|
+
transformPerspective(canvas: IncodeCanvas, frameRect: {
|
|
133
|
+
x: number;
|
|
134
|
+
y: number;
|
|
135
|
+
w: number;
|
|
136
|
+
h: number;
|
|
137
|
+
}): IncodeCanvas;
|
|
138
|
+
/**
|
|
139
|
+
* Gets the captured canvas (transformed for preview).
|
|
140
|
+
* @returns The captured canvas, or null if not available
|
|
141
|
+
*/
|
|
142
|
+
getCapturedCanvas(): IncodeCanvas | null;
|
|
143
|
+
/**
|
|
144
|
+
* Gets the original captured canvas (full frame for upload).
|
|
145
|
+
* @returns The original captured canvas, or null if not available
|
|
146
|
+
*/
|
|
147
|
+
getOriginalCapturedCanvas(): IncodeCanvas | null;
|
|
148
|
+
/**
|
|
149
|
+
* Sets the captured canvases (original and transformed).
|
|
150
|
+
* Called by the state machine after capture and transformation.
|
|
151
|
+
* @param original - The original full-frame canvas (for upload)
|
|
152
|
+
* @param transformed - The transformed canvas (for preview)
|
|
153
|
+
*/
|
|
154
|
+
setCapturedCanvases(original: IncodeCanvas, transformed: IncodeCanvas): void;
|
|
155
|
+
}
|
|
156
|
+
//#endregion
|
|
157
|
+
//#region src/modules/id/manualUpload/types.d.ts
|
|
158
|
+
type ManualUploadTab = 'id' | 'passport';
|
|
159
|
+
type ManualUploadSide = 'front' | 'back' | 'passport';
|
|
160
|
+
type ManualUploadContext = {
|
|
161
|
+
/** Passed from parent machine input — used by guards and actor inputs. */
|
|
162
|
+
onlyFront: boolean;
|
|
163
|
+
isSecondId: boolean;
|
|
164
|
+
/** Retry budget for this manual upload (sourced from `config.captureAttempts`). */
|
|
165
|
+
captureAttempts: number;
|
|
166
|
+
frontFile: File | null;
|
|
167
|
+
backFile: File | null;
|
|
168
|
+
passportFile: File | null;
|
|
169
|
+
activeTab: ManualUploadTab;
|
|
170
|
+
retriesLeft: number;
|
|
171
|
+
errorMessage: string | null;
|
|
172
|
+
/** Set from the front upload response; when true the back slot is auto-completed */
|
|
173
|
+
skipBackFromServer: boolean;
|
|
174
|
+
/** Whether each side has been successfully uploaded (for Continue gating) */
|
|
175
|
+
frontUploaded: boolean;
|
|
176
|
+
backUploaded: boolean;
|
|
177
|
+
passportUploaded: boolean;
|
|
178
|
+
};
|
|
179
|
+
declare const MANUAL_UPLOAD_MAX_RETRIES = 3;
|
|
180
|
+
declare const MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES: number;
|
|
181
|
+
declare const MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS = 5000;
|
|
182
|
+
//#endregion
|
|
183
|
+
//#region ../infra/src/capabilities/IAnalyticsCapability.d.ts
|
|
184
|
+
interface IAnalyticsCapability {
|
|
185
|
+
analyzeFrame(image: ImageData): Promise<void>;
|
|
186
|
+
update(): void;
|
|
187
|
+
getAnalysisStatus(): string;
|
|
188
|
+
getMotionStatus(): string;
|
|
189
|
+
getMetadata(): string;
|
|
190
|
+
}
|
|
191
|
+
//#endregion
|
|
192
|
+
//#region src/modules/id/types.d.ts
|
|
193
|
+
type IdCaptureMode = 'front' | 'back' | 'passport';
|
|
194
|
+
/**
|
|
195
|
+
* Document type options for the ID capture chooser (ID, passport, manual ID upload, digital ID upload, digital ID from device wallet).
|
|
196
|
+
* Used for selection and for the list of available options derived from config.
|
|
197
|
+
*/
|
|
198
|
+
type IdDocumentType = 'id' | 'passport' | 'manualIdUpload' | 'digitalIdUpload' | 'digitalId';
|
|
199
|
+
type IdFlowStep = 'chooser' | 'ageVerification' | 'tutorial' | 'permissions' | 'capture' | 'mandatoryConsent' | 'frontFinished' | 'backFinished' | 'success' | 'processing' | 'expired' | 'finished' | 'error' | 'closed' | 'manualIdUpload' | 'digitalIdUpload';
|
|
200
|
+
type DetectionStatus = 'idle' | 'detecting' | 'farAway' | 'blur' | 'glare' | 'wrongSide' | 'capturing' | 'manualCapture' | 'idNotDetected' | 'offline';
|
|
201
|
+
/**
|
|
202
|
+
* Represents the detection area dimensions in pixels.
|
|
203
|
+
* Used by UI to communicate the expected ID position and size to the WASM detection.
|
|
204
|
+
*/
|
|
205
|
+
type DetectionArea = {
|
|
206
|
+
x: number;
|
|
207
|
+
y: number;
|
|
208
|
+
width: number;
|
|
209
|
+
height: number;
|
|
210
|
+
};
|
|
211
|
+
type IdCaptureGeometry = {
|
|
212
|
+
areaDown: number;
|
|
213
|
+
areaUp: number;
|
|
214
|
+
areaIOSPassportUp: number;
|
|
215
|
+
areaIOSPassportDown: number;
|
|
216
|
+
widthIOSUp: number;
|
|
217
|
+
widthIOSDown: number;
|
|
218
|
+
widthDown: number;
|
|
219
|
+
widthUp: number;
|
|
220
|
+
windowOuterWidth: number;
|
|
221
|
+
windowOuterHeight: number;
|
|
222
|
+
windowInnerWidth: number;
|
|
223
|
+
windowInnerHeight: number;
|
|
224
|
+
};
|
|
225
|
+
type IdCaptureThresholds = {
|
|
226
|
+
blurThreshold: number;
|
|
227
|
+
blurChangeThreshold: number;
|
|
228
|
+
glareThreshold: number;
|
|
229
|
+
clsThreshold: number;
|
|
230
|
+
sideThreshold: number;
|
|
231
|
+
iouThreshold: number;
|
|
232
|
+
framesAggregationInterval: number;
|
|
233
|
+
idDetectedTimeout: number;
|
|
234
|
+
autocaptureTimeout: number;
|
|
235
|
+
};
|
|
236
|
+
type IdCaptureConfig = TutorialIdConfig & {
|
|
237
|
+
recording?: {
|
|
238
|
+
capability?: IRecordingCapability;
|
|
239
|
+
};
|
|
240
|
+
ageAssurance?: boolean;
|
|
241
|
+
mergeSessionRecordings?: boolean;
|
|
242
|
+
isDeepsightEnabled?: boolean;
|
|
243
|
+
isSecondId?: boolean;
|
|
244
|
+
geometry?: IdCaptureGeometry;
|
|
245
|
+
detectionArea?: DetectionArea;
|
|
246
|
+
thresholds?: Partial<IdCaptureThresholds>;
|
|
247
|
+
settings?: Partial<IdCaptureSettings>;
|
|
248
|
+
modelVersion?: 'v1' | 'v2' | 'v3';
|
|
249
|
+
ds?: Flow['ds'];
|
|
250
|
+
/**
|
|
251
|
+
* When true, the capture machine reaches `finished` immediately after
|
|
252
|
+
* back-side / manual-upload completion instead of invoking `/process/id`.
|
|
253
|
+
* Used by engines where verification is owned by a downstream node — the
|
|
254
|
+
* Workflow engine's `ID` node (handled by `idVerificationMachine`). Flow and
|
|
255
|
+
* any other single-step caller leave this `false` so the inline verification
|
|
256
|
+
* + recapture-on-expired UX continues to work.
|
|
257
|
+
*/
|
|
258
|
+
skipProcessId?: boolean;
|
|
259
|
+
};
|
|
260
|
+
/**
|
|
261
|
+
* Public ID capture configuration for the captureOnly flow.
|
|
262
|
+
*
|
|
263
|
+
* Differs from {@link IdCaptureConfig} by requiring an `onCapture` callback —
|
|
264
|
+
* captureOnly bypasses the Incode upload pipeline and delivers the rich
|
|
265
|
+
* capture payload locally instead. Compile-time enforcement (vs. a runtime
|
|
266
|
+
* check) prevents shipping a captureOnly flow with no destination for the
|
|
267
|
+
* payload.
|
|
268
|
+
*/
|
|
269
|
+
type IdCaptureOnlyConfig = IdCaptureConfig & {
|
|
270
|
+
onCapture: (response: CaptureOnlyResponse) => void | Promise<void>;
|
|
271
|
+
};
|
|
272
|
+
type IdErrorCode = 'UPLOAD_ERROR' | 'CLASSIFICATION_FAILED' | 'LOW_SHARPNESS' | 'GLARE_DETECTED' | 'WRONG_DOCUMENT_SIDE' | 'ID_TYPE_UNACCEPTABLE' | 'READABILITY_ISSUE' | 'RETRY_EXHAUSTED_CONTINUE_TO_BACK' | 'RETRY_EXHAUSTED_SKIP_BACK' | 'NO_MORE_TRIES' | 'UNEXPECTED_ERROR' | 'NO_TOKEN' | 'PERMISSION_DENIED' | 'USER_CANCELLED' | 'SERVER_ERROR';
|
|
273
|
+
type IdError = {
|
|
274
|
+
code: IdErrorCode;
|
|
275
|
+
message: string;
|
|
276
|
+
messageDescription?: string;
|
|
277
|
+
};
|
|
278
|
+
type UploadIdResponse = {
|
|
279
|
+
sharpness: number;
|
|
280
|
+
correctSharpness: boolean;
|
|
281
|
+
glare: number;
|
|
282
|
+
correctGlare: boolean;
|
|
283
|
+
horizontalResolution: number;
|
|
284
|
+
classification: boolean;
|
|
285
|
+
readability: boolean;
|
|
286
|
+
typeOfId: string;
|
|
287
|
+
issueYear: number;
|
|
288
|
+
issueName: string;
|
|
289
|
+
curpCheck?: boolean;
|
|
290
|
+
sessionStatus: string;
|
|
291
|
+
countryCode: string;
|
|
292
|
+
state?: string;
|
|
293
|
+
skipBackIdCapture?: boolean;
|
|
294
|
+
skipGlareFront?: boolean;
|
|
295
|
+
skipGlareBack?: boolean;
|
|
296
|
+
documentIsOnTheEdge?: boolean;
|
|
297
|
+
acceptedDocuments?: Array<{
|
|
298
|
+
type: string;
|
|
299
|
+
name: string;
|
|
300
|
+
}>;
|
|
301
|
+
forceFrontIdCapture?: boolean;
|
|
302
|
+
showMandatoryConsent?: boolean;
|
|
303
|
+
regulationType?: RegulationTypes;
|
|
304
|
+
failReason?: string;
|
|
305
|
+
side?: 'front' | 'back';
|
|
306
|
+
idQualityAttemptApproved?: boolean;
|
|
307
|
+
isDocumentExpired?: boolean;
|
|
308
|
+
};
|
|
309
|
+
type CaptureIdResponse = UploadIdResponse & {
|
|
310
|
+
croppedIDFace?: string;
|
|
311
|
+
croppedFrontID?: string;
|
|
312
|
+
croppedBackID?: string;
|
|
313
|
+
originalImage?: string;
|
|
314
|
+
frontIdImage?: string;
|
|
315
|
+
backIdImage?: string;
|
|
316
|
+
};
|
|
317
|
+
type CapturedImage = {
|
|
318
|
+
imageBase64: string;
|
|
319
|
+
};
|
|
320
|
+
/**
|
|
321
|
+
* Rich captured image shape used by the captureOnly flow.
|
|
322
|
+
*
|
|
323
|
+
* `imageBase64`/`blob`/`url` reference the unprocessed full frame — always
|
|
324
|
+
* present and the safest input for integrator-side processing.
|
|
325
|
+
*
|
|
326
|
+
* `croppedImage` is a best-effort approximate document crop produced by a
|
|
327
|
+
* bilinear quad map (not a true perspective/homography warp). It is
|
|
328
|
+
* populated only when on-device quad detection succeeds, and will visibly
|
|
329
|
+
* diverge from the correct projective result for strongly tilted captures.
|
|
330
|
+
* Prefer `imageBase64` when fidelity matters.
|
|
331
|
+
*/
|
|
332
|
+
type IdCapturedImageData = {
|
|
333
|
+
imageBase64: string;
|
|
334
|
+
blob: Blob;
|
|
335
|
+
url: string;
|
|
336
|
+
metadata: string;
|
|
337
|
+
croppedImage?: {
|
|
338
|
+
imageBase64: string;
|
|
339
|
+
blob: Blob;
|
|
340
|
+
url: string;
|
|
341
|
+
};
|
|
342
|
+
};
|
|
343
|
+
/**
|
|
344
|
+
* Payload delivered to `IdCaptureConfig.onCapture` when `captureOnly` is enabled.
|
|
345
|
+
*/
|
|
346
|
+
type CaptureOnlyResponse = {
|
|
347
|
+
frontImage: IdCapturedImageData;
|
|
348
|
+
backImage: IdCapturedImageData | undefined;
|
|
349
|
+
};
|
|
350
|
+
type RecordingSession = {
|
|
351
|
+
token: string;
|
|
352
|
+
sessionId: string;
|
|
353
|
+
videoRecordingId: string;
|
|
354
|
+
connection: RecordingConnection;
|
|
355
|
+
resolution?: string;
|
|
356
|
+
hasAudio: boolean;
|
|
357
|
+
};
|
|
358
|
+
declare const ID_ERROR_CODES: {
|
|
359
|
+
readonly UPLOAD_ERROR: "UPLOAD_ERROR";
|
|
360
|
+
readonly CLASSIFICATION_FAILED: "CLASSIFICATION_FAILED";
|
|
361
|
+
readonly LOW_SHARPNESS: "LOW_SHARPNESS";
|
|
362
|
+
readonly GLARE_DETECTED: "GLARE_DETECTED";
|
|
363
|
+
readonly WRONG_DOCUMENT_SIDE: "WRONG_DOCUMENT_SIDE";
|
|
364
|
+
readonly ID_TYPE_UNACCEPTABLE: "ID_TYPE_UNACCEPTABLE";
|
|
365
|
+
readonly READABILITY_ISSUE: "READABILITY_ISSUE";
|
|
366
|
+
readonly RETRY_EXHAUSTED_CONTINUE_TO_BACK: "RETRY_EXHAUSTED_CONTINUE_TO_BACK";
|
|
367
|
+
readonly RETRY_EXHAUSTED_SKIP_BACK: "RETRY_EXHAUSTED_SKIP_BACK";
|
|
368
|
+
readonly NO_MORE_TRIES: "NO_MORE_TRIES";
|
|
369
|
+
readonly UNEXPECTED_ERROR: "UNEXPECTED_ERROR";
|
|
370
|
+
readonly NO_TOKEN: "NO_TOKEN";
|
|
371
|
+
readonly PERMISSION_DENIED: "PERMISSION_DENIED";
|
|
372
|
+
readonly USER_CANCELLED: "USER_CANCELLED";
|
|
373
|
+
readonly SERVER: "SERVER_ERROR";
|
|
374
|
+
};
|
|
375
|
+
type IdCaptureContext = {
|
|
376
|
+
config: IdCaptureConfig;
|
|
377
|
+
currentMode: IdCaptureMode;
|
|
378
|
+
selectedDocumentType: IdDocumentType | undefined;
|
|
379
|
+
stream: CameraStream | undefined;
|
|
380
|
+
provider: IIdCaptureCapability | undefined;
|
|
381
|
+
frameCapturer: StreamCanvasCapture | undefined;
|
|
382
|
+
error: string | undefined;
|
|
383
|
+
detectionStatus: DetectionStatus;
|
|
384
|
+
counterValue: number;
|
|
385
|
+
orientation: DetectionOrientation | undefined;
|
|
386
|
+
capturedImages: {
|
|
387
|
+
front?: CapturedImage;
|
|
388
|
+
back?: CapturedImage;
|
|
389
|
+
};
|
|
390
|
+
/**
|
|
391
|
+
* Rich capture payload used only by the captureOnly flow.
|
|
392
|
+
* Populated by `finalizeIdCaptureOnly` actor; consumed by `finished.entry`
|
|
393
|
+
* when firing `config.onCapture`. Remains empty in the regular upload flow.
|
|
394
|
+
*/
|
|
395
|
+
captureOnlyImages: {
|
|
396
|
+
front?: IdCapturedImageData;
|
|
397
|
+
back?: IdCapturedImageData;
|
|
398
|
+
};
|
|
399
|
+
uploadResponse: CaptureIdResponse | undefined;
|
|
400
|
+
recordingSession: RecordingSession | undefined;
|
|
401
|
+
attemptsRemaining: number;
|
|
402
|
+
/**
|
|
403
|
+
* Number of consecutive `isDocumentExpired === true` upload responses for
|
|
404
|
+
* the current side. Reset on side change; preserved across the soft-retry
|
|
405
|
+
* cycle (`expired → capture`). Compared against `config.captureAttempts`.
|
|
406
|
+
*/
|
|
407
|
+
expiredAttempts: number;
|
|
408
|
+
/**
|
|
409
|
+
* Number of times `processId` (end-of-flow expired detection) has returned
|
|
410
|
+
* `isDocumentExpired === true` in this session. Persists across the full
|
|
411
|
+
* `resetContext`-driven retry loop (Figma Story #2.2, 2-cap on the
|
|
412
|
+
* digital-upload / multi-side path).
|
|
413
|
+
*/
|
|
414
|
+
processingExpiredAttempts: number;
|
|
415
|
+
/**
|
|
416
|
+
* Set when the user has reached `expiredExhausted` and clicks Continue.
|
|
417
|
+
* Tells the `processing` state to bypass `processId` (V1 parity: no
|
|
418
|
+
* `/omni/process-id` call after force-back).
|
|
419
|
+
*/
|
|
420
|
+
skipProcessId: boolean;
|
|
421
|
+
/**
|
|
422
|
+
* Distinguishes the two entry paths into the `expired` screen:
|
|
423
|
+
* `true` for per-upload (camera) expired, `false` for `processing.onDone`
|
|
424
|
+
* (digital-upload / end-of-flow expired). Drives the soft-retry branch.
|
|
425
|
+
*/
|
|
426
|
+
expiredFromUpload: boolean;
|
|
427
|
+
/**
|
|
428
|
+
* `true` once a Digital ID upload has succeeded for this session. Digital
|
|
429
|
+
* IDs are single-side documents (semantically like a passport), so back
|
|
430
|
+
* capture must be skipped regardless of `alwaysCaptureBackOfId`. Used by
|
|
431
|
+
* the manager mapper's `shouldCaptureBack` to suppress `needsBackCapture`
|
|
432
|
+
* for the workflow orchestrator.
|
|
433
|
+
*/
|
|
434
|
+
isDigitalUpload: boolean;
|
|
435
|
+
/**
|
|
436
|
+
* Set when `expiredExhausted` was reached via the per-upload (camera)
|
|
437
|
+
* exhaustion path. Used by `CONTINUE_EXHAUSTED` to decide whether to run
|
|
438
|
+
* `processId` once before finishing — required so the backend processes
|
|
439
|
+
* whatever sides were uploaded (e.g. valid front + expired back).
|
|
440
|
+
*/
|
|
441
|
+
exhaustedFromUpload: boolean;
|
|
442
|
+
/**
|
|
443
|
+
* Tells the `processing` state to skip the per-upload-expired retry/exhaustion
|
|
444
|
+
* branches and go straight to `finished` after `processId.onDone`. Set
|
|
445
|
+
* when entering `processing` from the `expiredExhausted → Continue` path
|
|
446
|
+
* so we don't loop back to the Expired screen after we've already shown
|
|
447
|
+
* the terminal "No attempts remaining" view.
|
|
448
|
+
*/
|
|
449
|
+
forceFinishAfterProcessing: boolean;
|
|
450
|
+
uploadError: IdErrorCode | undefined;
|
|
451
|
+
permissionResult: PermissionResult | 'refresh' | undefined;
|
|
452
|
+
resetDetection: (() => void) | undefined;
|
|
453
|
+
idType: string | undefined;
|
|
454
|
+
qualityElements: {
|
|
455
|
+
glare?: number;
|
|
456
|
+
sharpness?: number;
|
|
457
|
+
} | undefined;
|
|
458
|
+
debugFrame: ImageData | undefined;
|
|
459
|
+
frameRect: {
|
|
460
|
+
x: number;
|
|
461
|
+
y: number;
|
|
462
|
+
w: number;
|
|
463
|
+
h: number;
|
|
464
|
+
} | undefined;
|
|
465
|
+
detectionArea: DetectionArea | undefined;
|
|
466
|
+
previewImageUrl?: string;
|
|
467
|
+
uploadProgress?: number;
|
|
468
|
+
motionStatus?: 'PASS' | 'FAIL' | 'UNCLEAR';
|
|
469
|
+
manualCaptureTriggered: boolean;
|
|
470
|
+
deepsightService: DeepsightService | undefined;
|
|
471
|
+
analyticsProvider: IAnalyticsCapability | undefined;
|
|
472
|
+
dependencies: IdCaptureDependencies | undefined;
|
|
473
|
+
disableIpify: boolean;
|
|
474
|
+
deepsightInitAttempted: boolean;
|
|
475
|
+
availableDocumentTypes: IdDocumentType[];
|
|
476
|
+
/** Negotiated camera resolution (e.g. "1920x1080") for telemetry */
|
|
477
|
+
captureResolution?: string;
|
|
478
|
+
/** Android camera access fallback level that succeeded */
|
|
479
|
+
cameraFallbackLevel?: number;
|
|
480
|
+
};
|
|
481
|
+
type IdCaptureEvent = {
|
|
482
|
+
type: 'LOAD';
|
|
483
|
+
} | {
|
|
484
|
+
type: 'SELECT_DOCUMENT';
|
|
485
|
+
documentType: IdDocumentType;
|
|
486
|
+
} | {
|
|
487
|
+
type: 'NEXT_STEP';
|
|
488
|
+
} | {
|
|
489
|
+
type: 'REQUEST_PERMISSION';
|
|
490
|
+
} | {
|
|
491
|
+
type: 'GO_TO_LEARN_MORE';
|
|
492
|
+
} | {
|
|
493
|
+
type: 'BACK';
|
|
494
|
+
} | {
|
|
495
|
+
type: 'QUIT';
|
|
496
|
+
} | {
|
|
497
|
+
type: 'RESET';
|
|
498
|
+
} | {
|
|
499
|
+
type: 'MANUAL_CAPTURE';
|
|
500
|
+
} | {
|
|
501
|
+
type: 'SWITCH_TO_MANUAL_CAPTURE';
|
|
502
|
+
} | {
|
|
503
|
+
type: 'DETECTION_UPDATE';
|
|
504
|
+
status: DetectionStatus;
|
|
505
|
+
} | {
|
|
506
|
+
type: 'DETECTION_FRAME';
|
|
507
|
+
frame: ImageData;
|
|
508
|
+
} | {
|
|
509
|
+
type: 'DETECTION_SUCCESS';
|
|
510
|
+
canvas: IncodeCanvas;
|
|
511
|
+
qualityElements?: {
|
|
512
|
+
glare?: number;
|
|
513
|
+
sharpness?: number;
|
|
514
|
+
};
|
|
515
|
+
} | {
|
|
516
|
+
type: 'DETECTION_RESET_READY';
|
|
517
|
+
reset: () => void;
|
|
518
|
+
} | {
|
|
519
|
+
type: 'COUNTER_VALUE_CHANGE';
|
|
520
|
+
value: number;
|
|
521
|
+
} | {
|
|
522
|
+
type: 'ID_TYPE_CHANGE';
|
|
523
|
+
idType: string;
|
|
524
|
+
} | {
|
|
525
|
+
type: 'ID_SIDE_CHANGE';
|
|
526
|
+
side: string;
|
|
527
|
+
} | {
|
|
528
|
+
type: 'ORIENTATION_CHANGE';
|
|
529
|
+
orientation: DetectionOrientation;
|
|
530
|
+
} | {
|
|
531
|
+
type: 'RETRY_CAPTURE';
|
|
532
|
+
} | {
|
|
533
|
+
type: 'CONTINUE_EXHAUSTED';
|
|
534
|
+
} | {
|
|
535
|
+
type: 'CONTINUE_FROM_ERROR';
|
|
536
|
+
} | {
|
|
537
|
+
type: 'FRONT_COMPLETE';
|
|
538
|
+
} | {
|
|
539
|
+
type: 'CONTINUE_TO_BACK';
|
|
540
|
+
} | {
|
|
541
|
+
type: 'CONTINUE_TO_FRONT';
|
|
542
|
+
} | {
|
|
543
|
+
type: 'PROCESS_COMPLETE';
|
|
544
|
+
} | {
|
|
545
|
+
type: 'PROCESS_EXPIRED';
|
|
546
|
+
} | {
|
|
547
|
+
type: 'CONSENT_ACCEPT';
|
|
548
|
+
} | {
|
|
549
|
+
type: 'CONSENT_CANCEL';
|
|
550
|
+
} | {
|
|
551
|
+
type: 'SKIP_BACK';
|
|
552
|
+
} | {
|
|
553
|
+
type: 'UPLOAD_PROGRESS';
|
|
554
|
+
progress: number;
|
|
555
|
+
} | {
|
|
556
|
+
type: 'SET_FRAME_RECT';
|
|
557
|
+
frameRect: {
|
|
558
|
+
x: number;
|
|
559
|
+
y: number;
|
|
560
|
+
w: number;
|
|
561
|
+
h: number;
|
|
562
|
+
};
|
|
563
|
+
} | {
|
|
564
|
+
type: 'UPDATE_DETECTION_AREA';
|
|
565
|
+
detectionArea: {
|
|
566
|
+
x: number;
|
|
567
|
+
y: number;
|
|
568
|
+
width: number;
|
|
569
|
+
height: number;
|
|
570
|
+
};
|
|
571
|
+
} | {
|
|
572
|
+
type: 'MOTION_STATUS';
|
|
573
|
+
status: 'PASS' | 'FAIL' | 'UNCLEAR';
|
|
574
|
+
} | {
|
|
575
|
+
type: 'MANUAL_UPLOAD_TAB_CHANGED';
|
|
576
|
+
tab: ManualUploadTab;
|
|
577
|
+
} | {
|
|
578
|
+
type: 'MANUAL_UPLOAD_FILE_SELECTED';
|
|
579
|
+
side: ManualUploadSide;
|
|
580
|
+
file: File;
|
|
581
|
+
} | {
|
|
582
|
+
type: 'MANUAL_UPLOAD_CONTINUE';
|
|
583
|
+
} | {
|
|
584
|
+
type: 'MANUAL_UPLOAD_RESET';
|
|
585
|
+
} | {
|
|
586
|
+
type: 'DIGITAL_UPLOAD_NEXT_STEP';
|
|
587
|
+
} | {
|
|
588
|
+
type: 'DIGITAL_UPLOAD_FILE_PICKED';
|
|
589
|
+
file: File;
|
|
590
|
+
} | {
|
|
591
|
+
type: 'DIGITAL_UPLOAD_CONFIRM';
|
|
592
|
+
} | {
|
|
593
|
+
type: 'DIGITAL_UPLOAD_REPLACE';
|
|
594
|
+
} | {
|
|
595
|
+
type: 'DIGITAL_UPLOAD_RETRY';
|
|
596
|
+
} | {
|
|
597
|
+
type: 'DIGITAL_UPLOAD_SCAN_INSTEAD';
|
|
598
|
+
} | {
|
|
599
|
+
type: 'DIGITAL_UPLOAD_CHOOSE_ANOTHER';
|
|
600
|
+
};
|
|
601
|
+
type IdCaptureDependencies = {
|
|
602
|
+
storage: IStorageCapability;
|
|
603
|
+
trackCaptureAttemptFinished?: (payload: {
|
|
604
|
+
logs: string;
|
|
605
|
+
resolution?: string;
|
|
606
|
+
fallbackLevel?: number;
|
|
607
|
+
}) => void;
|
|
608
|
+
};
|
|
609
|
+
type IdCaptureInput = {
|
|
610
|
+
config: IdCaptureConfig;
|
|
611
|
+
motionProvider?: IMotionSensorCapability;
|
|
612
|
+
analyticsProvider?: IAnalyticsCapability;
|
|
613
|
+
dependencies?: IdCaptureDependencies;
|
|
614
|
+
};
|
|
615
|
+
//#endregion
|
|
616
|
+
//#region src/modules/id/idCaptureStateMachine.d.ts
|
|
617
|
+
declare const idCaptureMachine: AnyStateMachine;
|
|
618
|
+
type IdCaptureMachine = StateMachine<IdCaptureContext, IdCaptureEvent, any, any, any, any, any, any, any, IdCaptureInput, any, any, any, any>;
|
|
619
|
+
//#endregion
|
|
620
|
+
//#region src/modules/id/idCaptureActor.d.ts
|
|
621
|
+
type CreateIdCaptureActorOptions = {
|
|
622
|
+
config: IdCaptureConfig;
|
|
623
|
+
dependencies?: IdCaptureDependencies;
|
|
624
|
+
};
|
|
625
|
+
type IdCaptureActor = ActorRefFrom<IdCaptureMachine>;
|
|
626
|
+
declare function createIdCaptureActor(options: CreateIdCaptureActorOptions): IdCaptureActor;
|
|
627
|
+
//#endregion
|
|
628
|
+
//#region src/modules/id/idCaptureOnlyStateMachine.d.ts
|
|
629
|
+
type IdCaptureOnlyContext = IdCaptureContext;
|
|
630
|
+
type IdCaptureOnlyEvent = IdCaptureEvent;
|
|
631
|
+
type IdCaptureOnlyInput = IdCaptureInput;
|
|
632
|
+
/**
|
|
633
|
+
* ID capture state machine variant for the captureOnly flow. Shares the full
|
|
634
|
+
* base ID-capture state tree (chooser, tutorial, permissions, capture,
|
|
635
|
+
* front/back finished, processing, finished); only the upload, process, and
|
|
636
|
+
* recording steps are local instead of remote.
|
|
637
|
+
*/
|
|
638
|
+
declare const idCaptureOnlyMachine: AnyStateMachine;
|
|
639
|
+
type IdCaptureOnlyMachine = StateMachine<IdCaptureOnlyContext, IdCaptureOnlyEvent, any, any, any, any, any, any, any, IdCaptureOnlyInput, any, any, any, any>;
|
|
640
|
+
//#endregion
|
|
641
|
+
//#region src/modules/id/idCaptureOnlyActor.d.ts
|
|
642
|
+
type CreateIdCaptureOnlyActorOptions = {
|
|
643
|
+
config: IdCaptureOnlyConfig;
|
|
644
|
+
dependencies?: IdCaptureDependencies;
|
|
645
|
+
};
|
|
646
|
+
type IdCaptureOnlyActor = ActorRefFrom<IdCaptureOnlyMachine>;
|
|
647
|
+
declare function createIdCaptureOnlyActor(options: CreateIdCaptureOnlyActorOptions): IdCaptureOnlyActor;
|
|
648
|
+
//#endregion
|
|
649
|
+
//#region src/modules/id/idCaptureServices.d.ts
|
|
650
|
+
type IdCaptureInitResult = {
|
|
651
|
+
stream: CameraStream;
|
|
652
|
+
provider: IIdCaptureCapability;
|
|
653
|
+
captureResolution?: string;
|
|
654
|
+
cameraFallbackLevel?: number;
|
|
655
|
+
};
|
|
656
|
+
type InitializeIdCaptureParams = {
|
|
657
|
+
config: IdCaptureConfig;
|
|
658
|
+
deepsightService?: DeepsightService;
|
|
659
|
+
};
|
|
660
|
+
declare function initializeIdCapture(params: InitializeIdCaptureParams): Promise<IdCaptureInitResult>;
|
|
661
|
+
declare function stopStream(stream: CameraStream): void;
|
|
662
|
+
type UploadIdImageParams = {
|
|
663
|
+
image: string;
|
|
664
|
+
type: 'front' | 'back';
|
|
665
|
+
sendBase64?: boolean;
|
|
666
|
+
isSecondId?: boolean;
|
|
667
|
+
onlyFront?: boolean;
|
|
668
|
+
glare?: number;
|
|
669
|
+
sharpness?: number;
|
|
670
|
+
shouldSkipGlareBack?: boolean;
|
|
671
|
+
shouldSkipGlareFront?: boolean;
|
|
672
|
+
captureType?: string;
|
|
673
|
+
ageAssurance?: boolean;
|
|
674
|
+
onProgress?: (progress: number) => void;
|
|
675
|
+
metadata?: string;
|
|
676
|
+
signal?: AbortSignal;
|
|
677
|
+
analyticsProvider?: IAnalyticsCapability;
|
|
678
|
+
imageData?: ImageData;
|
|
679
|
+
};
|
|
680
|
+
type ValidationError = {
|
|
681
|
+
error: boolean;
|
|
682
|
+
message: string;
|
|
683
|
+
messageDescription?: string;
|
|
684
|
+
errorKey: IdErrorCode;
|
|
685
|
+
};
|
|
686
|
+
declare function validateUploadResponse(response: UploadIdResponse & {
|
|
687
|
+
failReason?: string;
|
|
688
|
+
side?: 'front' | 'back';
|
|
689
|
+
}, sessionState?: {
|
|
690
|
+
skipGlareFront?: boolean;
|
|
691
|
+
skipGlareBack?: boolean;
|
|
692
|
+
}): ValidationError | undefined;
|
|
693
|
+
declare function uploadIdImage(params: UploadIdImageParams): Promise<CaptureIdResponse>;
|
|
694
|
+
type StartRecordingParams = {
|
|
695
|
+
config: IdCaptureConfig;
|
|
696
|
+
stream: CameraStream;
|
|
697
|
+
existing?: RecordingSession;
|
|
698
|
+
type: 'frontId' | 'backId';
|
|
699
|
+
};
|
|
700
|
+
declare function preloadIdRecordingProvider(config: IdCaptureConfig): void;
|
|
701
|
+
declare function startRecordingSession(params: StartRecordingParams): Promise<RecordingSession | undefined>;
|
|
702
|
+
declare function stopRecording(session: RecordingSession): void;
|
|
703
|
+
declare function processId(isSecondId?: boolean, queueName?: string, signal?: AbortSignal): Promise<{
|
|
704
|
+
isDocumentExpired: boolean;
|
|
705
|
+
}>;
|
|
706
|
+
type UploadManualIdFileParams = {
|
|
707
|
+
side: 'front' | 'back' | 'passport';
|
|
708
|
+
/**
|
|
709
|
+
* Raw base64 payload (no `data:<mime>;base64,` prefix). Callers must strip
|
|
710
|
+
* the data-URL prefix — the v2 backend rejects data URLs with
|
|
711
|
+
* `IllegalArgumentException: Illegal base64 character 3a`.
|
|
712
|
+
*/
|
|
713
|
+
base64Image: string;
|
|
714
|
+
retry?: boolean;
|
|
715
|
+
onlyFront?: boolean;
|
|
716
|
+
signal?: AbortSignal;
|
|
717
|
+
isSecondId?: boolean;
|
|
718
|
+
};
|
|
719
|
+
/**
|
|
720
|
+
* Upload a user-selected image as front / back / passport ID.
|
|
721
|
+
*
|
|
722
|
+
* Uses the same request shape as the live-camera path (`uploadIdImage`):
|
|
723
|
+
* JSON body `{ base64Image }` with default application/json Content-Type,
|
|
724
|
+
* `captureType=UPLOAD` query param, `retry=true` when retrying.
|
|
725
|
+
* Back is POSTed to `/omni/add/back-id/v2` (or `/omni/add/back-second-id/v2`
|
|
726
|
+
* when `isSecondId`); front and passport go to `/omni/add/front-id/v2` (or
|
|
727
|
+
* `/omni/add/front-second-id/v2` when `isSecondId`).
|
|
728
|
+
*
|
|
729
|
+
* The v2 endpoints reject raw `image/jpeg` bodies with 415, so the caller
|
|
730
|
+
* must convert the File to base64 before calling this service.
|
|
731
|
+
*/
|
|
732
|
+
declare function uploadManualIdFile(params: UploadManualIdFileParams): Promise<UploadIdResponse>;
|
|
733
|
+
//#endregion
|
|
734
|
+
//#region src/modules/id/digitalUpload/types.d.ts
|
|
735
|
+
type DigitalUploadFailReason = 'DIGITAL_ID_REQUESTED_BUT_OTHER_PROVIDED' | 'ID_TYPE_UNACCEPTABLE' | 'FILE_CHANGED_ERROR' | 'INVALID_FILE_TYPE' | 'NETWORK_ERROR' | 'GENERIC';
|
|
736
|
+
//#endregion
|
|
737
|
+
//#region src/internal/idCapture/idCaptureManagerFactory.d.ts
|
|
738
|
+
type CaptureStatus = 'initializing' | 'detecting' | 'capturing' | 'uploading' | 'uploadError' | 'success';
|
|
739
|
+
type IdCaptureIdleState = {
|
|
740
|
+
status: 'idle';
|
|
741
|
+
};
|
|
742
|
+
type IdCaptureChooserState = {
|
|
743
|
+
status: 'chooser';
|
|
744
|
+
availableDocumentTypes: IdDocumentType[];
|
|
745
|
+
};
|
|
746
|
+
type IdCaptureLoadingState = {
|
|
747
|
+
status: 'loading';
|
|
748
|
+
};
|
|
749
|
+
type IdCaptureTutorialState = {
|
|
750
|
+
status: 'tutorial';
|
|
751
|
+
selectedDocumentType: IdDocumentType | undefined;
|
|
752
|
+
currentMode: IdCaptureMode;
|
|
753
|
+
};
|
|
754
|
+
type IdCaptureAgeVerificationState = {
|
|
755
|
+
status: 'ageVerification';
|
|
756
|
+
};
|
|
757
|
+
type IdCapturePermissionsState = {
|
|
758
|
+
status: 'permissions';
|
|
759
|
+
permissionStatus: PermissionStatus;
|
|
760
|
+
};
|
|
761
|
+
type IdCaptureCaptureState = {
|
|
762
|
+
status: 'capture';
|
|
763
|
+
captureStatus: CaptureStatus;
|
|
764
|
+
stream: CameraStream | undefined;
|
|
765
|
+
detectionStatus: DetectionStatus;
|
|
766
|
+
debugFrame: ImageData | undefined;
|
|
767
|
+
attemptsRemaining: number;
|
|
768
|
+
uploadError: IdErrorCode | undefined;
|
|
769
|
+
currentMode: IdCaptureMode;
|
|
770
|
+
counterValue: number;
|
|
771
|
+
orientation: DetectionOrientation | undefined;
|
|
772
|
+
idType: string | undefined;
|
|
773
|
+
previewImageUrl?: string;
|
|
774
|
+
uploadProgress?: number;
|
|
775
|
+
ageAssurance: boolean;
|
|
776
|
+
uploadErrorMessage?: string;
|
|
777
|
+
uploadErrorDescription?: string;
|
|
778
|
+
/** Whether back capture is needed after front capture completes */
|
|
779
|
+
needsBackCapture: boolean;
|
|
780
|
+
/** Whether front capture is needed after back capture (usSmartCapture + forceFrontIdCapture) */
|
|
781
|
+
needsFrontCapture: boolean;
|
|
782
|
+
showCaptureButtonInAuto: boolean;
|
|
783
|
+
/** Whether retry is available (attemptsRemaining > 0) */
|
|
784
|
+
canRetry: boolean;
|
|
785
|
+
};
|
|
786
|
+
type IdCaptureMandatoryConsentState = {
|
|
787
|
+
status: 'mandatoryConsent';
|
|
788
|
+
regulationType: RegulationTypes;
|
|
789
|
+
};
|
|
790
|
+
type IdCaptureFrontFinishedState = {
|
|
791
|
+
status: 'frontFinished';
|
|
792
|
+
};
|
|
793
|
+
type IdCaptureBackFinishedState = {
|
|
794
|
+
status: 'backFinished';
|
|
795
|
+
};
|
|
796
|
+
type IdCaptureProcessingState = {
|
|
797
|
+
status: 'processing';
|
|
798
|
+
};
|
|
799
|
+
type IdCaptureExpiredState = {
|
|
800
|
+
status: 'expired';
|
|
801
|
+
/**
|
|
802
|
+
* Remaining attempts after this expired result. Mirrors V1's
|
|
803
|
+
* `idv2.capture.processing.attemptsRemainingLabel` counter and Figma's
|
|
804
|
+
* "X attempts remaining" line on `1-9-11-id-documenterror`.
|
|
805
|
+
*/
|
|
806
|
+
attemptsRemaining: number;
|
|
807
|
+
};
|
|
808
|
+
type IdCaptureExpiredExhaustedState = {
|
|
809
|
+
status: 'expiredExhausted';
|
|
810
|
+
};
|
|
811
|
+
type IdCaptureFinishedState = {
|
|
812
|
+
status: 'finished';
|
|
813
|
+
};
|
|
814
|
+
type IdCaptureClosedState = {
|
|
815
|
+
status: 'closed';
|
|
816
|
+
};
|
|
817
|
+
type IdCaptureErrorState = {
|
|
818
|
+
status: 'error';
|
|
819
|
+
error: string;
|
|
820
|
+
};
|
|
821
|
+
type ManualUploadUploadingSide = ManualUploadSide;
|
|
822
|
+
type IdCaptureManualUploadState = {
|
|
823
|
+
status: 'manualUpload';
|
|
824
|
+
phase: 'selecting' | 'uploading' | 'exhausted';
|
|
825
|
+
/** Which side is currently uploading (undefined in `selecting`/`exhausted`). */
|
|
826
|
+
uploadingSide: ManualUploadUploadingSide | undefined;
|
|
827
|
+
activeTab: ManualUploadTab;
|
|
828
|
+
showIdTab: boolean;
|
|
829
|
+
showPassportTab: boolean;
|
|
830
|
+
/** Whether the ID tab should render a back-of-ID slot. */
|
|
831
|
+
showBackSlot: boolean;
|
|
832
|
+
frontFileName: string | undefined;
|
|
833
|
+
backFileName: string | undefined;
|
|
834
|
+
passportFileName: string | undefined;
|
|
835
|
+
frontUploaded: boolean;
|
|
836
|
+
backUploaded: boolean;
|
|
837
|
+
passportUploaded: boolean;
|
|
838
|
+
canContinue: boolean;
|
|
839
|
+
retriesLeft: number;
|
|
840
|
+
/** i18n key for the current error message, if any. */
|
|
841
|
+
errorKey: string | null;
|
|
842
|
+
};
|
|
843
|
+
type IdCaptureDigitalUploadState = {
|
|
844
|
+
status: 'digitalIdUpload';
|
|
845
|
+
phase: 'tutorial' | 'selecting' | 'reviewing' | 'uploading' | 'holding' | 'success' | 'error' | 'fileTooLarge' | 'exhausted';
|
|
846
|
+
file: File | null;
|
|
847
|
+
fileName: string | undefined;
|
|
848
|
+
failReason: DigitalUploadFailReason | null;
|
|
849
|
+
attemptsRemaining: number;
|
|
850
|
+
uploadProgress: number;
|
|
851
|
+
pickerRequestId: number;
|
|
852
|
+
};
|
|
853
|
+
type IdCaptureState = IdCaptureIdleState | IdCaptureChooserState | IdCaptureLoadingState | IdCaptureTutorialState | IdCaptureAgeVerificationState | IdCapturePermissionsState | IdCaptureCaptureState | IdCaptureMandatoryConsentState | IdCaptureFrontFinishedState | IdCaptureBackFinishedState | IdCaptureProcessingState | IdCaptureExpiredState | IdCaptureExpiredExhaustedState | IdCaptureFinishedState | IdCaptureClosedState | IdCaptureErrorState | IdCaptureManualUploadState | IdCaptureDigitalUploadState;
|
|
854
|
+
/**
|
|
855
|
+
* Union of all `idCaptureMachine` variants' actor types. Variants share the
|
|
856
|
+
* same state tree and context shape, so the manager helpers
|
|
857
|
+
* (`mapState`, `createApi`) work uniformly for either flavor at runtime.
|
|
858
|
+
*/
|
|
859
|
+
type AnyIdCaptureActor = IdCaptureActor | IdCaptureOnlyActor;
|
|
860
|
+
/**
|
|
861
|
+
* Builds the public ID capture manager from an already-created actor.
|
|
862
|
+
* Used by both `createIdCaptureManager` and `createIdCaptureOnlyManager`.
|
|
863
|
+
*
|
|
864
|
+
* The internal cast to `IdCaptureActor` narrows the union for `createManager`,
|
|
865
|
+
* which is typed against the regular machine. Variants produced via
|
|
866
|
+
* `idCaptureMachine.provide({...})` share the same context and event types,
|
|
867
|
+
* so the cast is sound at runtime — only the actor implementation differs.
|
|
868
|
+
*/
|
|
869
|
+
declare function createIdCaptureManagerFromActor(actor: AnyIdCaptureActor): Manager<IdCaptureState> & {
|
|
870
|
+
load(): void;
|
|
871
|
+
selectDocument(documentType: IdDocumentType): void;
|
|
872
|
+
nextStep(): void;
|
|
873
|
+
requestPermission(): void;
|
|
874
|
+
goToLearnMore(): void;
|
|
875
|
+
back(): void;
|
|
876
|
+
close(): void;
|
|
877
|
+
reset(): void;
|
|
878
|
+
retryCapture(): void;
|
|
879
|
+
continueExhausted(): void;
|
|
880
|
+
continueFromError(): void;
|
|
881
|
+
capture(): void;
|
|
882
|
+
switchToManualCapture(): void;
|
|
883
|
+
continueToBack(): void;
|
|
884
|
+
continueToFront(): void;
|
|
885
|
+
skipBack(): void;
|
|
886
|
+
acceptMandatoryConsent(): void;
|
|
887
|
+
cancelMandatoryConsent(): void;
|
|
888
|
+
/**
|
|
889
|
+
* Updates the detection area used for WASM geometry calculation.
|
|
890
|
+
* Call this when the UI detection area dimensions change (e.g., on resize or orientation change).
|
|
891
|
+
*/
|
|
892
|
+
updateDetectionArea(detectionArea: DetectionArea): void;
|
|
893
|
+
/**
|
|
894
|
+
* Manual upload: tab change (ID / Passport). Resets per-tab file selections.
|
|
895
|
+
* Note: there is intentionally no `switchToManualUpload` method — entry to
|
|
896
|
+
* the manual-upload flow is gated by config + Chooser to prevent a
|
|
897
|
+
* dev-console bypass of live camera capture.
|
|
898
|
+
*/
|
|
899
|
+
manualUploadChangeTab(tab: ManualUploadTab): void;
|
|
900
|
+
manualUploadSelectFile(side: ManualUploadSide, file: File): void;
|
|
901
|
+
manualUploadContinue(): void;
|
|
902
|
+
manualUploadReset(): void;
|
|
903
|
+
digitalUploadNextStep(): void;
|
|
904
|
+
digitalUploadPickFile(file: File): void;
|
|
905
|
+
digitalUploadConfirm(): void;
|
|
906
|
+
digitalUploadReplace(): void;
|
|
907
|
+
digitalUploadRetry(): void;
|
|
908
|
+
digitalUploadScanInstead(): void;
|
|
909
|
+
digitalUploadChooseAnother(): void;
|
|
910
|
+
};
|
|
911
|
+
type IdCaptureManager = ReturnType<typeof createIdCaptureManagerFromActor>;
|
|
912
|
+
//#endregion
|
|
913
|
+
//#region src/modules/id/idCaptureManager.d.ts
|
|
914
|
+
/**
|
|
915
|
+
* Creates a manager for the regular ID capture flow. The shared
|
|
916
|
+
* `mapState`/`createApi`/state-types live in
|
|
917
|
+
* `internal/idCapture/idCaptureManagerFactory.ts`; this file is a thin
|
|
918
|
+
* wrapper that creates the actor and delegates to the factory.
|
|
919
|
+
*
|
|
920
|
+
* For the captureOnly flow (rich payload delivered locally via `onCapture`),
|
|
921
|
+
* use `createIdCaptureOnlyManager`.
|
|
922
|
+
*/
|
|
923
|
+
declare function createIdCaptureManager(options: CreateIdCaptureActorOptions): Manager<IdCaptureState> & {
|
|
924
|
+
load(): void;
|
|
925
|
+
selectDocument(documentType: IdDocumentType): void;
|
|
926
|
+
nextStep(): void;
|
|
927
|
+
requestPermission(): void;
|
|
928
|
+
goToLearnMore(): void;
|
|
929
|
+
back(): void;
|
|
930
|
+
close(): void;
|
|
931
|
+
reset(): void;
|
|
932
|
+
retryCapture(): void;
|
|
933
|
+
continueExhausted(): void;
|
|
934
|
+
continueFromError(): void;
|
|
935
|
+
capture(): void;
|
|
936
|
+
switchToManualCapture(): void;
|
|
937
|
+
continueToBack(): void;
|
|
938
|
+
continueToFront(): void;
|
|
939
|
+
skipBack(): void;
|
|
940
|
+
acceptMandatoryConsent(): void;
|
|
941
|
+
cancelMandatoryConsent(): void;
|
|
942
|
+
updateDetectionArea(detectionArea: DetectionArea): void;
|
|
943
|
+
manualUploadChangeTab(tab: ManualUploadTab): void;
|
|
944
|
+
manualUploadSelectFile(side: ManualUploadSide, file: File): void;
|
|
945
|
+
manualUploadContinue(): void;
|
|
946
|
+
manualUploadReset(): void;
|
|
947
|
+
digitalUploadNextStep(): void;
|
|
948
|
+
digitalUploadPickFile(file: File): void;
|
|
949
|
+
digitalUploadConfirm(): void;
|
|
950
|
+
digitalUploadReplace(): void;
|
|
951
|
+
digitalUploadRetry(): void;
|
|
952
|
+
digitalUploadScanInstead(): void;
|
|
953
|
+
digitalUploadChooseAnother(): void;
|
|
954
|
+
};
|
|
955
|
+
//#endregion
|
|
956
|
+
export { MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES as $, CaptureIdResponse as A, IdCaptureGeometry as B, IdCaptureOnlyMachine as C, createIdCaptureActor as D, IdCaptureActor as E, ID_ERROR_CODES as F, IdCapturedImageData as G, IdCaptureMode as H, IdCaptureConfig as I, IdErrorCode as J, IdDocumentType as K, IdCaptureContext as L, CapturedImage as M, DetectionArea as N, IdCaptureMachine as O, DetectionStatus as P, MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS as Q, IdCaptureDependencies as R, createIdCaptureOnlyActor as S, CreateIdCaptureActorOptions as T, IdCaptureOnlyConfig as U, IdCaptureInput as V, IdCaptureThresholds as W, RecordingSession as X, IdFlowStep as Y, UploadIdResponse as Z, uploadIdImage as _, IdCaptureInitResult as a, IdCaptureSettings as at, CreateIdCaptureOnlyActorOptions as b, UploadIdImageParams as c, initializeIdCapture as d, MANUAL_UPLOAD_MAX_RETRIES as et, preloadIdRecordingProvider as f, stopStream as g, stopRecording as h, createIdCaptureManagerFromActor as i, DetectionOrientation as it, CaptureOnlyResponse as j, idCaptureMachine as k, UploadManualIdFileParams as l, startRecordingSession as m, IdCaptureManager as n, ManualUploadSide as nt, InitializeIdCaptureParams as o, processId as p, IdError as q, IdCaptureState as r, ManualUploadTab as rt, StartRecordingParams as s, createIdCaptureManager as t, ManualUploadContext as tt, ValidationError as u, uploadManualIdFile as v, idCaptureOnlyMachine as w, IdCaptureOnlyActor as x, validateUploadResponse as y, IdCaptureEvent as z };
|