@incodetech/core 0.0.0-dev-20260226-d2d561c → 0.0.0-dev-20260226-4cb58f5
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/authentication.d.ts +8 -7
- package/dist/authentication.esm.js +9 -8
- package/dist/{backCameraStream-CCvHeGHQ.esm.js → backCameraStream-Ly-xbK9L.esm.js} +2 -103
- package/dist/curp-validation.d.ts +3 -2
- package/dist/curp-validation.esm.js +4 -4
- package/dist/{deepsightLoader-UBRWJ3MQ.esm.js → deepsightLoader-nGQDTgVU.esm.js} +4 -4
- package/dist/{deepsightService-Bn05rSAa.esm.js → deepsightService-CpmpXOnj.esm.js} +3 -3
- package/dist/{deepsightService-Un1ZwAHH.d.ts → deepsightService-p7oLftiG.d.ts} +1 -1
- package/dist/document-upload.d.ts +329 -0
- package/dist/document-upload.esm.js +194 -0
- package/dist/email.d.ts +1 -1
- package/dist/email.esm.js +4 -4
- package/dist/{endpoints-DXp63GM6.esm.js → endpoints-BK1EjE1H.esm.js} +2 -1
- package/dist/{events-h8K9H3OM.esm.js → events-DuBPhaxY.esm.js} +2 -2
- package/dist/face-match.d.ts +1 -1
- package/dist/face-match.esm.js +4 -4
- package/dist/{faceCaptureManagerFactory-CWGzTGlG.d.ts → faceCaptureManagerFactory-5Blo_gz0.d.ts} +5 -4
- package/dist/{faceCaptureSetup-BflAHwmc.esm.js → faceCaptureSetup-JLWm8_vt.esm.js} +8 -7
- package/dist/flow.d.ts +6 -5
- package/dist/flow.esm.js +6 -10
- package/dist/geolocation.d.ts +1 -1
- package/dist/geolocation.esm.js +4 -4
- package/dist/government-validation.d.ts +1 -1
- package/dist/government-validation.esm.js +3 -3
- package/dist/{id-CDh0aJOJ.esm.js → id-Dc5SneKA.esm.js} +9 -8
- package/dist/id.d.ts +8 -7
- package/dist/id.esm.js +9 -8
- package/dist/{index-O5gB82Up.d.ts → index-B_VIYINf.d.ts} +7 -6
- package/dist/index.d.ts +9 -8
- package/dist/index.esm.js +9 -8
- package/dist/{lib-DtNtprlI.esm.js → lib-EkjqkOuB.esm.js} +1 -1
- package/dist/phone.d.ts +1 -1
- package/dist/phone.esm.js +4 -4
- package/dist/selfie.d.ts +8 -7
- package/dist/selfie.esm.js +9 -8
- package/dist/{src-t0pt3B2r.esm.js → src-Bjg2C1oP.esm.js} +2 -2
- package/dist/{stats-GJMiTm5k.esm.js → stats-Baxc8J0w.esm.js} +1 -1
- package/dist/stats.esm.js +2 -2
- package/dist/streamingEvents-BrVlVGe7.esm.js +104 -0
- package/dist/types-B3jgq_IJ.d.ts +24 -0
- package/dist/{types-ee3LkWku.d.ts → types-CLuw51tO.d.ts} +1 -4
- package/dist/{types-c0XgGLsM.d.ts → types-Skrj9_8y.d.ts} +3 -1
- package/package.json +7 -3
- /package/dist/{Actor-Chvt8rE9.d.ts → Actor-DYtyiYF1.d.ts} +0 -0
- /package/dist/{Manager-DM1NlCX4.d.ts → Manager-C647XkuZ.d.ts} +0 -0
- /package/dist/{StateMachine-B7tKroZs.d.ts → StateMachine-B3u4LjaP.d.ts} +0 -0
- /package/dist/{api-DlSxxyGw.esm.js → api-J0YE3G-C.esm.js} +0 -0
- /package/dist/{chunk-BcpNb8MJ.esm.js → chunk-3k-zyWo_.esm.js} +0 -0
- /package/dist/{warmup-BUv67ifS.d.ts → warmup-BIZ_8rAa.d.ts} +0 -0
package/dist/authentication.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import "./types-
|
|
2
|
-
import "./warmup-
|
|
3
|
-
import { a as FaceCaptureDependencies, n as FaceCaptureManagerState, r as BaseFaceCaptureConfig, t as FaceCaptureManager } from "./faceCaptureManagerFactory-
|
|
4
|
-
import { t as Manager } from "./Manager-
|
|
5
|
-
import
|
|
6
|
-
import { t as
|
|
7
|
-
import {
|
|
1
|
+
import "./types-CLuw51tO.js";
|
|
2
|
+
import "./warmup-BIZ_8rAa.js";
|
|
3
|
+
import { a as FaceCaptureDependencies, n as FaceCaptureManagerState, r as BaseFaceCaptureConfig, t as FaceCaptureManager } from "./faceCaptureManagerFactory-5Blo_gz0.js";
|
|
4
|
+
import { t as Manager } from "./Manager-C647XkuZ.js";
|
|
5
|
+
import "./types-B3jgq_IJ.js";
|
|
6
|
+
import { t as ActorRefFrom } from "./Actor-DYtyiYF1.js";
|
|
7
|
+
import { t as AnyStateMachine } from "./StateMachine-B3u4LjaP.js";
|
|
8
|
+
import { r as FlowModuleConfig } from "./types-Skrj9_8y.js";
|
|
8
9
|
|
|
9
10
|
//#region src/modules/authentication/authenticationStateMachine.d.ts
|
|
10
11
|
declare const _authenticationMachine: AnyStateMachine;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { d as addEvent, n as eventModuleNames } from "./events-
|
|
2
|
-
import
|
|
3
|
-
import { m as BrowserStorageProvider, r as WasmUtilProvider } from "./src-
|
|
4
|
-
import { a as fromPromise, o as createActor, r as assign, t as endpoints } from "./endpoints-
|
|
5
|
-
import "./
|
|
6
|
-
import
|
|
7
|
-
import "./
|
|
8
|
-
import
|
|
1
|
+
import { d as addEvent, n as eventModuleNames } from "./events-DuBPhaxY.esm.js";
|
|
2
|
+
import "./backCameraStream-Ly-xbK9L.esm.js";
|
|
3
|
+
import { m as BrowserStorageProvider, r as WasmUtilProvider } from "./src-Bjg2C1oP.esm.js";
|
|
4
|
+
import { a as fromPromise, o as createActor, r as assign, t as endpoints } from "./endpoints-BK1EjE1H.esm.js";
|
|
5
|
+
import { c as getDeviceClass } from "./streamingEvents-BrVlVGe7.esm.js";
|
|
6
|
+
import "./deepsightService-CpmpXOnj.esm.js";
|
|
7
|
+
import { t as api } from "./api-J0YE3G-C.esm.js";
|
|
8
|
+
import "./stats-Baxc8J0w.esm.js";
|
|
9
|
+
import { a as FACE_ERROR_CODES, n as faceCaptureMachine, o as createFaceCaptureManager, t as FACE_CAPTURE_EVENT_CODES } from "./faceCaptureSetup-JLWm8_vt.esm.js";
|
|
9
10
|
|
|
10
11
|
//#region src/modules/authentication/authenticationErrorUtils.ts
|
|
11
12
|
const AUTH_ERROR_MAP = {
|
|
@@ -1,111 +1,10 @@
|
|
|
1
|
-
import { C as applyTrackConstraints, E as stopCameraStream, F as isIPhone14OrHigher, I as isSafari, M as isAndroid, P as isIOS, T as requestCameraAccess,
|
|
2
|
-
import { t as endpoints } from "./endpoints-DXp63GM6.esm.js";
|
|
3
|
-
import { t as api } from "./api-DlSxxyGw.esm.js";
|
|
1
|
+
import { C as applyTrackConstraints, E as stopCameraStream, F as isIPhone14OrHigher, I as isSafari, M as isAndroid, P as isIOS, T as requestCameraAccess, w as enumerateVideoDevices } from "./src-Bjg2C1oP.esm.js";
|
|
4
2
|
|
|
5
3
|
//#region ../infra/src/capabilities/ITimerCapability.ts
|
|
6
4
|
function sleep(ms) {
|
|
7
5
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
8
6
|
}
|
|
9
7
|
|
|
10
|
-
//#endregion
|
|
11
|
-
//#region src/internal/device/getBrowser.ts
|
|
12
|
-
function getBrowser() {
|
|
13
|
-
const userAgent = getUserAgent();
|
|
14
|
-
if (!userAgent) return "other";
|
|
15
|
-
const ua = userAgent.toLowerCase();
|
|
16
|
-
if (ua.includes("edg/")) return "edge";
|
|
17
|
-
if (ua.includes("opr/") || ua.includes("opera")) return "opera";
|
|
18
|
-
if (ua.includes("chrome") && !ua.includes("edg/")) return "chrome";
|
|
19
|
-
if (ua.includes("firefox")) return "firefox";
|
|
20
|
-
if (ua.includes("safari") && !ua.includes("chrome")) return "safari";
|
|
21
|
-
return "other";
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
//#endregion
|
|
25
|
-
//#region src/internal/device/getDeviceClass.ts
|
|
26
|
-
function getDeviceClass() {
|
|
27
|
-
const { userAgent, platform, maxTouchPoints } = getDeviceInfo();
|
|
28
|
-
if (!userAgent) return "desktop";
|
|
29
|
-
const ua = userAgent.toLowerCase();
|
|
30
|
-
if (/iphone|ipad|ipod/.test(ua) || platform === "MacIntel" && maxTouchPoints > 1) return "ios";
|
|
31
|
-
if (/android/.test(ua)) return "android";
|
|
32
|
-
return "desktop";
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
//#endregion
|
|
36
|
-
//#region src/internal/permissions/permissionServices.ts
|
|
37
|
-
/**
|
|
38
|
-
* Checks the current camera permission state without prompting the user.
|
|
39
|
-
*/
|
|
40
|
-
async function checkPermission() {
|
|
41
|
-
return queryCameraPermission();
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Requests motion sensor permission. Must be called during a user gesture on iOS.
|
|
45
|
-
* Returns the permission result.
|
|
46
|
-
*/
|
|
47
|
-
async function requestMotionPermission() {
|
|
48
|
-
return new MotionSensorProvider().requestPermission();
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Requests camera permission by attempting to access the camera, then immediately
|
|
52
|
-
* stops the obtained stream. Also requests motion sensor permission (required on iOS
|
|
53
|
-
* to be called during a user gesture). This function does not keep or return the stream.
|
|
54
|
-
*/
|
|
55
|
-
async function requestPermission() {
|
|
56
|
-
try {
|
|
57
|
-
await requestMotionPermission();
|
|
58
|
-
stopCameraStream(await requestCameraAccess({ video: true }));
|
|
59
|
-
return "granted";
|
|
60
|
-
} catch (error) {
|
|
61
|
-
const name = error instanceof Error ? error.name : void 0;
|
|
62
|
-
if (name === "NotAllowedError" || name === "PermissionDeniedError") return "denied";
|
|
63
|
-
return "prompt";
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
//#endregion
|
|
68
|
-
//#region src/internal/recordings/recordingsRepository.ts
|
|
69
|
-
async function createRecordingSession(type) {
|
|
70
|
-
return (await api.post(endpoints.recordingCreateSessionV2, { type })).data;
|
|
71
|
-
}
|
|
72
|
-
async function startRecording(params) {
|
|
73
|
-
return (await api.post(endpoints.recordingStartV2, {
|
|
74
|
-
videoRecordingId: params.videoRecordingId,
|
|
75
|
-
frameRate: 30,
|
|
76
|
-
outputMode: "COMPOSED",
|
|
77
|
-
resolution: params.resolution,
|
|
78
|
-
type: params.type,
|
|
79
|
-
hasAudio: params.hasAudio ?? false
|
|
80
|
-
})).data;
|
|
81
|
-
}
|
|
82
|
-
async function stopRecording(videoRecordingId) {
|
|
83
|
-
return (await api.post(endpoints.recordingStopV2, { videoRecordingId })).data;
|
|
84
|
-
}
|
|
85
|
-
async function uploadDeepsightVideo(encryptedVideo, token) {
|
|
86
|
-
try {
|
|
87
|
-
return (await api.post(endpoints.deepsightVideoImport, {
|
|
88
|
-
video: encryptedVideo,
|
|
89
|
-
type: "selfie"
|
|
90
|
-
}, { headers: { "X-Incode-Hardware-Id": token } })).data.recordingId ?? "";
|
|
91
|
-
} catch {
|
|
92
|
-
return "";
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
//#endregion
|
|
97
|
-
//#region src/internal/recordings/streamingEvents.ts
|
|
98
|
-
const streamingEvents = {
|
|
99
|
-
strSessionDidConnect: "strSessionDidConnect",
|
|
100
|
-
strSessionDidDisconnect: "strSessionDidDisconnect",
|
|
101
|
-
strSessionDidFailWithError: "strSessionDidFailWithError",
|
|
102
|
-
strStreamVideoCaptureStart: "strStreamVideoCaptureStart",
|
|
103
|
-
strStreamVideoCaptureStop: "strStreamVideoCaptureStop",
|
|
104
|
-
strStreamPublisherCreated: "strStreamPublisherCreated",
|
|
105
|
-
strStreamPublisherDestroyed: "strStreamPublisherDestroyed",
|
|
106
|
-
strStreamPublisherDidFailWithError: "strStreamPublisherDidFailWithError"
|
|
107
|
-
};
|
|
108
|
-
|
|
109
8
|
//#endregion
|
|
110
9
|
//#region src/internal/camera/backCameraStream.ts
|
|
111
10
|
const BACK_CAMERA_KEYWORDS = [
|
|
@@ -333,4 +232,4 @@ async function getBackCameraStream(deviceId) {
|
|
|
333
232
|
}
|
|
334
233
|
|
|
335
234
|
//#endregion
|
|
336
|
-
export {
|
|
235
|
+
export { getBackCameraStream as t };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { t as Manager } from "./Manager-
|
|
2
|
-
import
|
|
1
|
+
import { t as Manager } from "./Manager-C647XkuZ.js";
|
|
2
|
+
import "./types-B3jgq_IJ.js";
|
|
3
|
+
import { r as FlowModuleConfig } from "./types-Skrj9_8y.js";
|
|
3
4
|
|
|
4
5
|
//#region src/modules/curp-validation/types.d.ts
|
|
5
6
|
type CurpValidationConfig = FlowModuleConfig['CURP_VALIDATION'] & {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as eventModuleNames, r as eventScreenNames, u as screenOpened } from "./events-
|
|
2
|
-
import { D as createManager } from "./src-
|
|
3
|
-
import { a as fromPromise, n as setup, o as createActor, r as assign, t as endpoints } from "./endpoints-
|
|
4
|
-
import { t as api } from "./api-
|
|
1
|
+
import { n as eventModuleNames, r as eventScreenNames, u as screenOpened } from "./events-DuBPhaxY.esm.js";
|
|
2
|
+
import { D as createManager } from "./src-Bjg2C1oP.esm.js";
|
|
3
|
+
import { a as fromPromise, n as setup, o as createActor, r as assign, t as endpoints } from "./endpoints-BK1EjE1H.esm.js";
|
|
4
|
+
import { t as api } from "./api-J0YE3G-C.esm.js";
|
|
5
5
|
|
|
6
6
|
//#region src/modules/curp-validation/curpValidationUtils.ts
|
|
7
7
|
const CURP_PATTERN = /^([A-Z][AEIOUX][A-Z]{2}\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])[HMX](?:AS|B[CS]|C[CLMSH]|D[FG]|G[TR]|HG|JC|M[CNS]|N[ETL]|OC|PL|Q[TR]|S[PLR]|T[CSL]|VZ|YN|ZS)[B-DF-HJ-NP-TV-Z]{3}[A-Z\d])(\d)$/;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { g as BrowserEnvironmentProvider, l as MotionSensorProvider, r as WasmUtilProvider, s as VisibilityProvider } from "./src-
|
|
2
|
-
import { t as createDeepsightService } from "./deepsightService-
|
|
3
|
-
import "./api-
|
|
4
|
-
import "./stats-
|
|
1
|
+
import { g as BrowserEnvironmentProvider, l as MotionSensorProvider, r as WasmUtilProvider, s as VisibilityProvider } from "./src-Bjg2C1oP.esm.js";
|
|
2
|
+
import { t as createDeepsightService } from "./deepsightService-CpmpXOnj.esm.js";
|
|
3
|
+
import "./api-J0YE3G-C.esm.js";
|
|
4
|
+
import "./stats-Baxc8J0w.esm.js";
|
|
5
5
|
|
|
6
6
|
//#region src/internal/deepsight/deepsightLoader.ts
|
|
7
7
|
const SDK_VERSION = "2.0.0";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { E as stopCameraStream, S as IncodeCanvas, T as requestCameraAccess, j as getUserAgent, k as getDeviceInfo, x as createHiddenVideoElement } from "./src-
|
|
2
|
-
import { t as api } from "./api-
|
|
3
|
-
import { t as addDeviceStats } from "./stats-
|
|
1
|
+
import { E as stopCameraStream, S as IncodeCanvas, T as requestCameraAccess, j as getUserAgent, k as getDeviceInfo, x as createHiddenVideoElement } from "./src-Bjg2C1oP.esm.js";
|
|
2
|
+
import { t as api } from "./api-J0YE3G-C.esm.js";
|
|
3
|
+
import { t as addDeviceStats } from "./stats-Baxc8J0w.esm.js";
|
|
4
4
|
|
|
5
5
|
//#region src/internal/device/browserSimulation.ts
|
|
6
6
|
const AUTOMATION_MARKERS = {
|
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
import { t as Manager } from "./Manager-C647XkuZ.js";
|
|
2
|
+
import { n as DocumentUploadContext, r as DocumentUploadInput, t as DocumentUploadConfig } from "./types-B3jgq_IJ.js";
|
|
3
|
+
import * as xstate212 from "xstate";
|
|
4
|
+
|
|
5
|
+
//#region src/modules/document-upload/documentUploadStateMachine.d.ts
|
|
6
|
+
declare const documentUploadMachine: xstate212.StateMachine<DocumentUploadContext, {
|
|
7
|
+
type: "START";
|
|
8
|
+
} | {
|
|
9
|
+
type: "CAPTURE";
|
|
10
|
+
imageBase64: string;
|
|
11
|
+
} | {
|
|
12
|
+
type: "UPLOAD_PROGRESS";
|
|
13
|
+
progress: number;
|
|
14
|
+
} | {
|
|
15
|
+
type: "RETRY";
|
|
16
|
+
} | {
|
|
17
|
+
type: "CLOSE";
|
|
18
|
+
}, {
|
|
19
|
+
[x: string]: xstate212.ActorRefFromLogic<xstate212.PromiseActorLogic<MediaStream, void, xstate212.EventObject>> | xstate212.ActorRefFromLogic<xstate212.PromiseActorLogic<void, {
|
|
20
|
+
imageBase64: string;
|
|
21
|
+
documentType: string;
|
|
22
|
+
onProgress: (progress: number) => void;
|
|
23
|
+
}, xstate212.EventObject>> | undefined;
|
|
24
|
+
}, xstate212.Values<{
|
|
25
|
+
initCamera: {
|
|
26
|
+
src: "initCamera";
|
|
27
|
+
logic: xstate212.PromiseActorLogic<MediaStream, void, xstate212.EventObject>;
|
|
28
|
+
id: string | undefined;
|
|
29
|
+
};
|
|
30
|
+
uploadDocument: {
|
|
31
|
+
src: "uploadDocument";
|
|
32
|
+
logic: xstate212.PromiseActorLogic<void, {
|
|
33
|
+
imageBase64: string;
|
|
34
|
+
documentType: string;
|
|
35
|
+
onProgress: (progress: number) => void;
|
|
36
|
+
}, xstate212.EventObject>;
|
|
37
|
+
id: string | undefined;
|
|
38
|
+
};
|
|
39
|
+
}>, xstate212.Values<{
|
|
40
|
+
setError: {
|
|
41
|
+
type: "setError";
|
|
42
|
+
params: xstate212.NonReducibleUnknown;
|
|
43
|
+
};
|
|
44
|
+
setStream: {
|
|
45
|
+
type: "setStream";
|
|
46
|
+
params: xstate212.NonReducibleUnknown;
|
|
47
|
+
};
|
|
48
|
+
setImageAndClearError: {
|
|
49
|
+
type: "setImageAndClearError";
|
|
50
|
+
params: xstate212.NonReducibleUnknown;
|
|
51
|
+
};
|
|
52
|
+
setProgress: {
|
|
53
|
+
type: "setProgress";
|
|
54
|
+
params: xstate212.NonReducibleUnknown;
|
|
55
|
+
};
|
|
56
|
+
clearError: {
|
|
57
|
+
type: "clearError";
|
|
58
|
+
params: xstate212.NonReducibleUnknown;
|
|
59
|
+
};
|
|
60
|
+
stopStream: {
|
|
61
|
+
type: "stopStream";
|
|
62
|
+
params: xstate212.NonReducibleUnknown;
|
|
63
|
+
};
|
|
64
|
+
}>, never, never, "error" | "idle" | "finished" | "initCamera" | "capturing" | "closed" | "uploading", string, DocumentUploadInput, xstate212.NonReducibleUnknown, xstate212.EventObject, xstate212.MetaObject, {
|
|
65
|
+
readonly id: "documentUpload";
|
|
66
|
+
readonly initial: "idle";
|
|
67
|
+
readonly context: ({
|
|
68
|
+
input
|
|
69
|
+
}: {
|
|
70
|
+
spawn: {
|
|
71
|
+
<TSrc extends "initCamera" | "uploadDocument">(logic: TSrc, ...[options]: ({
|
|
72
|
+
src: "initCamera";
|
|
73
|
+
logic: xstate212.PromiseActorLogic<MediaStream, void, xstate212.EventObject>;
|
|
74
|
+
id: string | undefined;
|
|
75
|
+
} extends infer T ? T extends {
|
|
76
|
+
src: "initCamera";
|
|
77
|
+
logic: xstate212.PromiseActorLogic<MediaStream, void, xstate212.EventObject>;
|
|
78
|
+
id: string | undefined;
|
|
79
|
+
} ? T extends {
|
|
80
|
+
src: TSrc;
|
|
81
|
+
} ? xstate212.ConditionalRequired<[options?: ({
|
|
82
|
+
id?: T["id"] | undefined;
|
|
83
|
+
systemId?: string;
|
|
84
|
+
input?: xstate212.InputFrom<T["logic"]> | undefined;
|
|
85
|
+
syncSnapshot?: boolean;
|
|
86
|
+
} & { [K in xstate212.RequiredActorOptions<T>]: unknown }) | undefined], xstate212.IsNotNever<xstate212.RequiredActorOptions<T>>> : never : never : never) | ({
|
|
87
|
+
src: "uploadDocument";
|
|
88
|
+
logic: xstate212.PromiseActorLogic<void, {
|
|
89
|
+
imageBase64: string;
|
|
90
|
+
documentType: string;
|
|
91
|
+
onProgress: (progress: number) => void;
|
|
92
|
+
}, xstate212.EventObject>;
|
|
93
|
+
id: string | undefined;
|
|
94
|
+
} extends infer T_1 ? T_1 extends {
|
|
95
|
+
src: "uploadDocument";
|
|
96
|
+
logic: xstate212.PromiseActorLogic<void, {
|
|
97
|
+
imageBase64: string;
|
|
98
|
+
documentType: string;
|
|
99
|
+
onProgress: (progress: number) => void;
|
|
100
|
+
}, xstate212.EventObject>;
|
|
101
|
+
id: string | undefined;
|
|
102
|
+
} ? T_1 extends {
|
|
103
|
+
src: TSrc;
|
|
104
|
+
} ? xstate212.ConditionalRequired<[options?: ({
|
|
105
|
+
id?: T_1["id"] | undefined;
|
|
106
|
+
systemId?: string;
|
|
107
|
+
input?: xstate212.InputFrom<T_1["logic"]> | undefined;
|
|
108
|
+
syncSnapshot?: boolean;
|
|
109
|
+
} & { [K_1 in xstate212.RequiredActorOptions<T_1>]: unknown }) | undefined], xstate212.IsNotNever<xstate212.RequiredActorOptions<T_1>>> : never : never : never)): xstate212.ActorRefFromLogic<xstate212.GetConcreteByKey<xstate212.Values<{
|
|
110
|
+
initCamera: {
|
|
111
|
+
src: "initCamera";
|
|
112
|
+
logic: xstate212.PromiseActorLogic<MediaStream, void, xstate212.EventObject>;
|
|
113
|
+
id: string | undefined;
|
|
114
|
+
};
|
|
115
|
+
uploadDocument: {
|
|
116
|
+
src: "uploadDocument";
|
|
117
|
+
logic: xstate212.PromiseActorLogic<void, {
|
|
118
|
+
imageBase64: string;
|
|
119
|
+
documentType: string;
|
|
120
|
+
onProgress: (progress: number) => void;
|
|
121
|
+
}, xstate212.EventObject>;
|
|
122
|
+
id: string | undefined;
|
|
123
|
+
};
|
|
124
|
+
}>, "src", TSrc>["logic"]>;
|
|
125
|
+
<TLogic extends xstate212.AnyActorLogic>(src: TLogic, ...[options]: xstate212.ConditionalRequired<[options?: ({
|
|
126
|
+
id?: never;
|
|
127
|
+
systemId?: string;
|
|
128
|
+
input?: xstate212.InputFrom<TLogic> | undefined;
|
|
129
|
+
syncSnapshot?: boolean;
|
|
130
|
+
} & { [K in xstate212.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate212.IsNotNever<xstate212.RequiredLogicInput<TLogic>>>): xstate212.ActorRefFromLogic<TLogic>;
|
|
131
|
+
};
|
|
132
|
+
input: DocumentUploadInput;
|
|
133
|
+
self: xstate212.ActorRef<xstate212.MachineSnapshot<DocumentUploadContext, {
|
|
134
|
+
type: "START";
|
|
135
|
+
} | {
|
|
136
|
+
type: "CAPTURE";
|
|
137
|
+
imageBase64: string;
|
|
138
|
+
} | {
|
|
139
|
+
type: "UPLOAD_PROGRESS";
|
|
140
|
+
progress: number;
|
|
141
|
+
} | {
|
|
142
|
+
type: "RETRY";
|
|
143
|
+
} | {
|
|
144
|
+
type: "CLOSE";
|
|
145
|
+
}, Record<string, xstate212.AnyActorRef | undefined>, xstate212.StateValue, string, unknown, any, any>, {
|
|
146
|
+
type: "START";
|
|
147
|
+
} | {
|
|
148
|
+
type: "CAPTURE";
|
|
149
|
+
imageBase64: string;
|
|
150
|
+
} | {
|
|
151
|
+
type: "UPLOAD_PROGRESS";
|
|
152
|
+
progress: number;
|
|
153
|
+
} | {
|
|
154
|
+
type: "RETRY";
|
|
155
|
+
} | {
|
|
156
|
+
type: "CLOSE";
|
|
157
|
+
}, xstate212.AnyEventObject>;
|
|
158
|
+
}) => {
|
|
159
|
+
config: DocumentUploadConfig;
|
|
160
|
+
stream: undefined;
|
|
161
|
+
imageBase64: undefined;
|
|
162
|
+
progress: number;
|
|
163
|
+
error: undefined;
|
|
164
|
+
};
|
|
165
|
+
readonly states: {
|
|
166
|
+
readonly idle: {
|
|
167
|
+
readonly on: {
|
|
168
|
+
readonly START: {
|
|
169
|
+
readonly target: "initCamera";
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
readonly initCamera: {
|
|
174
|
+
readonly invoke: {
|
|
175
|
+
readonly id: "initCamera";
|
|
176
|
+
readonly src: "initCamera";
|
|
177
|
+
readonly input: undefined;
|
|
178
|
+
readonly onDone: {
|
|
179
|
+
readonly target: "capturing";
|
|
180
|
+
readonly actions: "setStream";
|
|
181
|
+
};
|
|
182
|
+
readonly onError: {
|
|
183
|
+
readonly target: "error";
|
|
184
|
+
readonly actions: "setError";
|
|
185
|
+
};
|
|
186
|
+
};
|
|
187
|
+
readonly on: {
|
|
188
|
+
readonly CLOSE: {
|
|
189
|
+
readonly target: "closed";
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
readonly capturing: {
|
|
194
|
+
readonly on: {
|
|
195
|
+
readonly CAPTURE: {
|
|
196
|
+
readonly target: "uploading";
|
|
197
|
+
readonly actions: "setImageAndClearError";
|
|
198
|
+
};
|
|
199
|
+
readonly CLOSE: {
|
|
200
|
+
readonly target: "closed";
|
|
201
|
+
readonly actions: "stopStream";
|
|
202
|
+
};
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
readonly uploading: {
|
|
206
|
+
readonly invoke: {
|
|
207
|
+
readonly id: "uploadDocument";
|
|
208
|
+
readonly src: "uploadDocument";
|
|
209
|
+
readonly input: ({
|
|
210
|
+
context,
|
|
211
|
+
self
|
|
212
|
+
}: {
|
|
213
|
+
context: DocumentUploadContext;
|
|
214
|
+
event: {
|
|
215
|
+
type: "START";
|
|
216
|
+
} | {
|
|
217
|
+
type: "CAPTURE";
|
|
218
|
+
imageBase64: string;
|
|
219
|
+
} | {
|
|
220
|
+
type: "UPLOAD_PROGRESS";
|
|
221
|
+
progress: number;
|
|
222
|
+
} | {
|
|
223
|
+
type: "RETRY";
|
|
224
|
+
} | {
|
|
225
|
+
type: "CLOSE";
|
|
226
|
+
};
|
|
227
|
+
self: xstate212.ActorRef<xstate212.MachineSnapshot<DocumentUploadContext, {
|
|
228
|
+
type: "START";
|
|
229
|
+
} | {
|
|
230
|
+
type: "CAPTURE";
|
|
231
|
+
imageBase64: string;
|
|
232
|
+
} | {
|
|
233
|
+
type: "UPLOAD_PROGRESS";
|
|
234
|
+
progress: number;
|
|
235
|
+
} | {
|
|
236
|
+
type: "RETRY";
|
|
237
|
+
} | {
|
|
238
|
+
type: "CLOSE";
|
|
239
|
+
}, Record<string, xstate212.AnyActorRef>, xstate212.StateValue, string, unknown, any, any>, {
|
|
240
|
+
type: "START";
|
|
241
|
+
} | {
|
|
242
|
+
type: "CAPTURE";
|
|
243
|
+
imageBase64: string;
|
|
244
|
+
} | {
|
|
245
|
+
type: "UPLOAD_PROGRESS";
|
|
246
|
+
progress: number;
|
|
247
|
+
} | {
|
|
248
|
+
type: "RETRY";
|
|
249
|
+
} | {
|
|
250
|
+
type: "CLOSE";
|
|
251
|
+
}, xstate212.AnyEventObject>;
|
|
252
|
+
}) => {
|
|
253
|
+
imageBase64: string;
|
|
254
|
+
documentType: string;
|
|
255
|
+
onProgress: (progress: number) => void;
|
|
256
|
+
};
|
|
257
|
+
readonly onDone: {
|
|
258
|
+
readonly target: "finished";
|
|
259
|
+
readonly actions: "stopStream";
|
|
260
|
+
};
|
|
261
|
+
readonly onError: {
|
|
262
|
+
readonly target: "error";
|
|
263
|
+
readonly actions: readonly ["setError", "stopStream"];
|
|
264
|
+
};
|
|
265
|
+
};
|
|
266
|
+
readonly on: {
|
|
267
|
+
readonly UPLOAD_PROGRESS: {
|
|
268
|
+
readonly actions: "setProgress";
|
|
269
|
+
};
|
|
270
|
+
};
|
|
271
|
+
};
|
|
272
|
+
readonly error: {
|
|
273
|
+
readonly on: {
|
|
274
|
+
readonly RETRY: {
|
|
275
|
+
readonly target: "initCamera";
|
|
276
|
+
readonly actions: "clearError";
|
|
277
|
+
};
|
|
278
|
+
readonly CLOSE: {
|
|
279
|
+
readonly target: "closed";
|
|
280
|
+
readonly actions: "stopStream";
|
|
281
|
+
};
|
|
282
|
+
};
|
|
283
|
+
};
|
|
284
|
+
readonly finished: {
|
|
285
|
+
readonly type: "final";
|
|
286
|
+
};
|
|
287
|
+
readonly closed: {
|
|
288
|
+
readonly type: "final";
|
|
289
|
+
};
|
|
290
|
+
};
|
|
291
|
+
}>;
|
|
292
|
+
//#endregion
|
|
293
|
+
//#region src/modules/document-upload/documentUploadActor.d.ts
|
|
294
|
+
type CreateDocumentUploadActorOptions = {
|
|
295
|
+
config: DocumentUploadConfig;
|
|
296
|
+
};
|
|
297
|
+
//#endregion
|
|
298
|
+
//#region src/modules/document-upload/documentUploadManager.d.ts
|
|
299
|
+
type DocumentUploadInitializingState = {
|
|
300
|
+
status: 'initializing';
|
|
301
|
+
};
|
|
302
|
+
type DocumentUploadCapturingState = {
|
|
303
|
+
status: 'capturing';
|
|
304
|
+
stream: MediaStream;
|
|
305
|
+
};
|
|
306
|
+
type DocumentUploadUploadingState = {
|
|
307
|
+
status: 'uploading';
|
|
308
|
+
progress: number;
|
|
309
|
+
};
|
|
310
|
+
type DocumentUploadErrorState = {
|
|
311
|
+
status: 'error';
|
|
312
|
+
error: string;
|
|
313
|
+
};
|
|
314
|
+
type DocumentUploadFinishedState = {
|
|
315
|
+
status: 'finished';
|
|
316
|
+
};
|
|
317
|
+
type DocumentUploadClosedState = {
|
|
318
|
+
status: 'closed';
|
|
319
|
+
};
|
|
320
|
+
type DocumentUploadState = DocumentUploadInitializingState | DocumentUploadCapturingState | DocumentUploadUploadingState | DocumentUploadErrorState | DocumentUploadFinishedState | DocumentUploadClosedState;
|
|
321
|
+
declare function createDocumentUploadManager(options: CreateDocumentUploadActorOptions): Manager<DocumentUploadState> & {
|
|
322
|
+
load(): void;
|
|
323
|
+
capture(imageBase64: string): void;
|
|
324
|
+
retry(): void;
|
|
325
|
+
close(): void;
|
|
326
|
+
};
|
|
327
|
+
type DocumentUploadManager = ReturnType<typeof createDocumentUploadManager>;
|
|
328
|
+
//#endregion
|
|
329
|
+
export { type DocumentUploadConfig, type DocumentUploadManager, type DocumentUploadState, createDocumentUploadManager, documentUploadMachine };
|