@incodetech/core 0.0.0-dev-20260409-a38d5e8 → 0.0.0-dev-20260409-09dfd52
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/BrowserStorageProvider-CXaS5Ooj.esm.js +55 -0
- package/dist/{OpenViduRecordingProvider-Bn2meybK.esm.js → OpenViduRecordingProvider-D_cVAwYQ.esm.js} +1 -1
- package/dist/{WasmUtilProvider-BpZSvZbg.esm.js → WasmUtilProvider-mWSXzp7b.esm.js} +1 -1
- package/dist/{addressSearch-DOFI7lwy.esm.js → addressSearch-C26OZIx0.esm.js} +4 -4
- package/dist/antifraud.d.ts +1 -1
- package/dist/antifraud.esm.js +4 -37
- package/dist/antifraudStateMachine-B74mO8vr.esm.js +39 -0
- package/dist/authentication.d.ts +11 -11
- package/dist/authentication.esm.js +22 -19
- package/dist/authenticationManager-BBQHippG.esm.js +67 -0
- package/dist/{authenticationManager-C2mk36yK.d.ts → authenticationManager-DOTo1EYF.d.ts} +2 -2
- package/dist/{authenticationManager-C7dL_avf.esm.js → authenticationStateMachine-DCJ0ArAt.esm.js} +7 -67
- package/dist/{backCameraStream-tabTmwDS.esm.js → backCameraStream-D9g2wyil.esm.js} +3 -3
- package/dist/camera.d.ts +1 -1
- package/dist/camera.esm.js +3 -3
- package/dist/consent.d.ts +55 -55
- package/dist/consent.esm.js +4 -149
- package/dist/consentStateMachine-DIdJXJW0.esm.js +151 -0
- package/dist/cross-document-data-match.d.ts +1 -1
- package/dist/cross-document-data-match.esm.js +4 -4
- package/dist/curp-validation.d.ts +5 -5
- package/dist/curp-validation.esm.js +4 -417
- package/dist/curpValidationStateMachine-Dp5WB6__.esm.js +419 -0
- package/dist/{deepsightLoader-Cj6SyUQ-.esm.js → deepsightLoader-CaULV07H.esm.js} +10 -10
- package/dist/{deepsightService-ByD6uIs7.d.ts → deepsightService-S-tU77m-.d.ts} +2 -2
- package/dist/{deepsightService-BjgXl5hs.esm.js → deepsightService-rPGLH8Xp.esm.js} +5 -5
- package/dist/device.esm.js +3 -3
- package/dist/document-capture.d.ts +80 -78
- package/dist/document-capture.esm.js +8 -403
- package/dist/document-upload.d.ts +53 -53
- package/dist/document-upload.esm.js +7 -7
- package/dist/documentCaptureStateMachine-ByYOCKz5.esm.js +403 -0
- package/dist/ekyb.d.ts +3 -3
- package/dist/ekyb.esm.js +10 -655
- package/dist/ekybStateMachine-DRku_YmR.esm.js +653 -0
- package/dist/ekyc.d.ts +3 -3
- package/dist/ekyc.esm.js +6 -10614
- package/dist/ekycStateMachine-CSWaaWVl.esm.js +10615 -0
- package/dist/email.d.ts +3 -3
- package/dist/email.esm.js +6 -5
- package/dist/{emailManager-CU_hzrsl.d.ts → emailManager-D6CHM2QO.d.ts} +4 -3
- package/dist/emailManager-DByjyeY8.esm.js +238 -0
- package/dist/{emailManager-_9R4vm6g.esm.js → emailStateMachine-BoIkeCw5.esm.js} +6 -239
- package/dist/{events-DlHrOIRc.esm.js → events-W91zLpx4.esm.js} +5 -1
- package/dist/events.esm.js +2 -2
- package/dist/extensibility.d.ts +15 -15
- package/dist/extensibility.esm.js +33 -26
- package/dist/face-match.d.ts +7 -6
- package/dist/face-match.esm.js +8 -129
- package/dist/faceCaptureManagerFactory-Bspg2Tyf.esm.js +117 -0
- package/dist/{faceCaptureManagerFactory-Da_-ohdg.d.ts → faceCaptureManagerFactory-P2yy30KU.d.ts} +8 -8
- package/dist/{faceCaptureSetup-CaVWkjvE.esm.js → faceCaptureSetup-CQevz86q.esm.js} +5 -119
- package/dist/faceMatchStateMachine-CLterVEC.esm.js +127 -0
- package/dist/flow.d.ts +8 -13
- package/dist/flow.esm.js +10 -29
- package/dist/{flowCompletionService-B5JemmC6.esm.js → flowCompletionService-DZSDUXus.esm.js} +2 -2
- package/dist/{flowServices-p22wrYPf.esm.js → flowServices-YATk0fgY.esm.js} +3 -3
- package/dist/geolocation.d.ts +7 -6
- package/dist/geolocation.esm.js +7 -105
- package/dist/geolocationStateMachine-CRRUCl9K.esm.js +105 -0
- package/dist/{getDeviceClass-DEzz4cmY.esm.js → getDeviceClass-DBF-ExLR.esm.js} +1 -1
- package/dist/government-validation.d.ts +2 -2
- package/dist/government-validation.esm.js +5 -269
- package/dist/governmentValidationStateMachine-C_iPX9VE.esm.js +271 -0
- package/dist/http.esm.js +1 -1
- package/dist/id.d.ts +10 -10
- package/dist/id.esm.js +22 -20
- package/dist/idCaptureManager-CJfatzuY.esm.js +335 -0
- package/dist/{idCaptureManager-CV08v1e3.d.ts → idCaptureManager-CbZvdr9y.d.ts} +7 -7
- package/dist/{idCaptureManager-dyZzKv8L.esm.js → idCaptureStateMachine-gf-Q9piu.esm.js} +17 -346
- package/dist/index.d.ts +2 -2
- package/dist/index.esm.js +8 -8
- package/dist/{lib-Bavz2qmt.esm.js → lib-BzVJ-zxG.esm.js} +1 -1
- package/dist/mandatory-consent.d.ts +55 -55
- package/dist/mandatory-consent.esm.js +4 -124
- package/dist/mandatoryConsentStateMachine-BZNBJ1fK.esm.js +126 -0
- package/dist/{openviduLazy-vhrVZCr_.esm.js → openviduLazy-CLg_-u0m.esm.js} +2 -2
- package/dist/openviduLazy-rFXBtZVZ.esm.js +3 -0
- package/dist/{permissionServices-Cskq32Yd.esm.js → permissionServices-Cisv73eQ.esm.js} +2 -2
- package/dist/phone.d.ts +3 -3
- package/dist/phone.esm.js +6 -5
- package/dist/phoneManager-DhC4obPF.esm.js +258 -0
- package/dist/{phoneManager-ulJuGvJ8.d.ts → phoneManager-Zwr-qCnC.d.ts} +2 -2
- package/dist/{phoneManager-DerdUfd4.esm.js → phoneStateMachine-Cc_w4tC0.esm.js} +5 -258
- package/dist/{recordingService-483wQ6kR.esm.js → recordingService-CCfxUY7-.esm.js} +14 -68
- package/dist/redirect-to-mobile.d.ts +2 -2
- package/dist/redirect-to-mobile.esm.js +5 -247
- package/dist/redirectToMobileStateMachine-vOe27Ufw.esm.js +249 -0
- package/dist/runChildModule-DVC4JEjp.esm.js +27 -0
- package/dist/selfie.d.ts +11 -11
- package/dist/selfie.esm.js +22 -19
- package/dist/selfieManager-CorEST5h.esm.js +60 -0
- package/dist/{selfieManager-DCRP7X75.d.ts → selfieManager-DNwfxieF.d.ts} +2 -2
- package/dist/selfieStateMachine-3b19ON1z.esm.js +56 -0
- package/dist/{session-CUh77zj3.esm.js → session-B_rKSRql.esm.js} +4 -4
- package/dist/session.d.ts +1 -1
- package/dist/session.esm.js +6 -6
- package/dist/{setup-DpHakxsC.d.ts → setup-BYqwVLiv.d.ts} +1 -1
- package/dist/{setup-XpxfZgKn.esm.js → setup-DLvhsDol.esm.js} +6 -5
- package/dist/signature.d.ts +4 -3
- package/dist/signature.esm.js +6 -189
- package/dist/signatureStateMachine-CU92zCXU.esm.js +189 -0
- package/dist/{stats-DHDoqSBV.esm.js → stats-gFD2351t.esm.js} +1 -1
- package/dist/stats.esm.js +2 -2
- package/dist/{types-2OPf1pyv.d.ts → types-CYJ0Ish6.d.ts} +1 -1
- package/dist/types-CjsEZRcz.d.ts +35 -0
- package/dist/{types-CVJVQ7fp.d.ts → types-DU8HmI5U.d.ts} +1 -1
- package/dist/wasm.d.ts +2 -2
- package/dist/wasm.esm.js +8 -8
- package/dist/workflow.d.ts +813 -0
- package/dist/workflow.esm.js +600 -0
- package/package.json +7 -3
- package/dist/openviduLazy-BIPHozOu.esm.js +0 -3
- package/dist/selfieManager-DeOcNel4.esm.js +0 -110
- /package/dist/{Actor-Ba71-_30.d.ts → Actor-DbWH1K6E.d.ts} +0 -0
- /package/dist/{BaseWasmProvider-D-s_6M5H.esm.js → BaseWasmProvider-DoYDYH1z.esm.js} +0 -0
- /package/dist/{BrowserEnvironmentProvider-DaHeLJQw.esm.js → BrowserEnvironmentProvider-BtKLxTx4.esm.js} +0 -0
- /package/dist/{BrowserTimerProvider-BhD2MlHg.esm.js → BrowserTimerProvider-v7bpbrAk.esm.js} +0 -0
- /package/dist/{ITimerCapability-oixwa6nj.esm.js → ITimerCapability-BZO_FsCo.esm.js} +0 -0
- /package/dist/{Manager-BN2g_I8W.d.ts → Manager-DcPMRgTm.d.ts} +0 -0
- /package/dist/{MotionSensorProvider-CodM3e0E.esm.js → MotionSensorProvider-D90R4qwV.esm.js} +0 -0
- /package/dist/{StateMachine-BoJsfMvg.d.ts → StateMachine-BBuIgsHT.d.ts} +0 -0
- /package/dist/{api-DzpnV6O7.esm.js → api-aa9Mx20l.esm.js} +0 -0
- /package/dist/{browserSimulation-B4ubb2OL.esm.js → browserSimulation-DFqGKQAD.esm.js} +0 -0
- /package/dist/{camera-1eeGnAaL.d.ts → camera-DATT31my.d.ts} +0 -0
- /package/dist/{camera-DmkFpf5N.esm.js → camera-DpPQS_-5.esm.js} +0 -0
- /package/dist/{chunk-DsxENsBR.esm.js → chunk-YGHKo4MY.esm.js} +0 -0
- /package/dist/{displayErrors-BZLX7idb.d.ts → displayErrors-xrg0ejaS.d.ts} +0 -0
- /package/dist/{flowCompletionService-D-3YCHyO.d.ts → flowCompletionService-gxt5reFV.d.ts} +0 -0
- /package/dist/{getBrowser-Dtyt9J_h.esm.js → getBrowser-DCcD7H-M.esm.js} +0 -0
- /package/dist/{platform-Dv7a2fv-.esm.js → platform-DctkySJU.esm.js} +0 -0
- /package/dist/{types-D_QfFKxT.d.ts → types-CIjb0FKu.d.ts} +0 -0
- /package/dist/{warmup-CIj_wEV_.d.ts → warmup-Ckb1hN85.d.ts} +0 -0
- /package/dist/{xstate.esm-Bv55-lJ4.esm.js → xstate.esm-B7FPE6br.esm.js} +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { t as Manager } from "./Manager-
|
|
2
|
-
import { t as ActorRefFrom } from "./Actor-
|
|
3
|
-
import { n as StateMachine, t as AnyStateMachine } from "./StateMachine-
|
|
4
|
-
import { t as CameraStream } from "./camera-
|
|
5
|
-
import { a as TutorialIdConfig, i as RegulationTypes, t as Flow } from "./types-
|
|
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-
|
|
7
|
-
import { n as PermissionStatus, t as PermissionResult } from "./types-
|
|
1
|
+
import { t as Manager } from "./Manager-DcPMRgTm.js";
|
|
2
|
+
import { t as ActorRefFrom } from "./Actor-DbWH1K6E.js";
|
|
3
|
+
import { n as StateMachine, t as AnyStateMachine } from "./StateMachine-BBuIgsHT.js";
|
|
4
|
+
import { t as CameraStream } from "./camera-DATT31my.js";
|
|
5
|
+
import { a as TutorialIdConfig, i as RegulationTypes, t as Flow } from "./types-DU8HmI5U.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-S-tU77m-.js";
|
|
7
|
+
import { n as PermissionStatus, t as PermissionResult } from "./types-CIjb0FKu.js";
|
|
8
8
|
|
|
9
9
|
//#region ../infra/src/capabilities/IIdCaptureCapability.d.ts
|
|
10
10
|
/**
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { a as IdCaptureModelType, i as WasmPipelineType, r as mlWasmJSApi_default, t as BaseWasmProvider } from "./BaseWasmProvider-
|
|
2
|
-
import { r as getToken, t as api } from "./api-
|
|
3
|
-
import { _ as endpoints,
|
|
4
|
-
import { t as getDisableIpify } from "./session-
|
|
5
|
-
import {
|
|
6
|
-
import { _ as StreamCanvasCapture, d as createRecordingSession, f as startRecording, g as flagIdManualReview, m as StreamCanvasProcessingSession, n as preloadOpenViduProvider, p as stopRecording$1
|
|
7
|
-
import { n as IncodeCanvas } from "./deepsightService-
|
|
8
|
-
import { r as getWindowDimensions } from "./getBrowser-
|
|
9
|
-
import { t as addDeviceStats } from "./stats-
|
|
10
|
-
import { n as requestPermission, t as checkPermission } from "./permissionServices-
|
|
11
|
-
import { n as isDesktop } from "./platform-
|
|
12
|
-
import { t as getBackCameraStream } from "./backCameraStream-
|
|
13
|
-
import { t as getDeviceClass } from "./getDeviceClass-
|
|
14
|
-
import { t as BrowserTimerProvider } from "./BrowserTimerProvider-
|
|
1
|
+
import { a as IdCaptureModelType, i as WasmPipelineType, r as mlWasmJSApi_default, t as BaseWasmProvider } from "./BaseWasmProvider-DoYDYH1z.esm.js";
|
|
2
|
+
import { r as getToken, t as api } from "./api-aa9Mx20l.esm.js";
|
|
3
|
+
import { _ as endpoints, v as revokeObjectURL } from "./events-W91zLpx4.esm.js";
|
|
4
|
+
import { t as getDisableIpify } from "./session-B_rKSRql.esm.js";
|
|
5
|
+
import { i as fromPromise, n as assign, r as fromCallback, t as setup } from "./xstate.esm-B7FPE6br.esm.js";
|
|
6
|
+
import { _ as StreamCanvasCapture, d as createRecordingSession, f as startRecording, g as flagIdManualReview, m as StreamCanvasProcessingSession, n as preloadOpenViduProvider, p as stopRecording$1 } from "./recordingService-CCfxUY7-.esm.js";
|
|
7
|
+
import { n as IncodeCanvas } from "./deepsightService-rPGLH8Xp.esm.js";
|
|
8
|
+
import { r as getWindowDimensions } from "./getBrowser-DCcD7H-M.esm.js";
|
|
9
|
+
import { t as addDeviceStats } from "./stats-gFD2351t.esm.js";
|
|
10
|
+
import { n as requestPermission, t as checkPermission } from "./permissionServices-Cisv73eQ.esm.js";
|
|
11
|
+
import { n as isDesktop } from "./platform-DctkySJU.esm.js";
|
|
12
|
+
import { t as getBackCameraStream } from "./backCameraStream-D9g2wyil.esm.js";
|
|
13
|
+
import { t as getDeviceClass } from "./getDeviceClass-DBF-ExLR.esm.js";
|
|
14
|
+
import { t as BrowserTimerProvider } from "./BrowserTimerProvider-v7bpbrAk.esm.js";
|
|
15
15
|
|
|
16
16
|
//#region src/modules/id/idCaptureHelpers.ts
|
|
17
17
|
/**
|
|
@@ -426,7 +426,7 @@ function preloadIdRecordingProvider(config) {
|
|
|
426
426
|
preloadOpenViduProvider();
|
|
427
427
|
}
|
|
428
428
|
async function createOpenViduRecordingProvider() {
|
|
429
|
-
const { OpenViduRecordingProvider } = await import("./OpenViduRecordingProvider-
|
|
429
|
+
const { OpenViduRecordingProvider } = await import("./OpenViduRecordingProvider-D_cVAwYQ.esm.js");
|
|
430
430
|
return new OpenViduRecordingProvider();
|
|
431
431
|
}
|
|
432
432
|
async function startRecordingSession(params) {
|
|
@@ -799,7 +799,7 @@ const checkMotionSensorActor = fromCallback(({ input, sendBack }) => {
|
|
|
799
799
|
});
|
|
800
800
|
const initializeDeepsightSessionActor = fromPromise(async ({ input }) => {
|
|
801
801
|
if (!input.dependencies) return;
|
|
802
|
-
const { loadDeepsightSession } = await import("./deepsightLoader-
|
|
802
|
+
const { loadDeepsightSession } = await import("./deepsightLoader-CaULV07H.esm.js");
|
|
803
803
|
return loadDeepsightSession({
|
|
804
804
|
ds: input.ds,
|
|
805
805
|
storage: input.dependencies.storage,
|
|
@@ -1982,333 +1982,4 @@ const _idCaptureMachine = setup({
|
|
|
1982
1982
|
const idCaptureMachine = _idCaptureMachine;
|
|
1983
1983
|
|
|
1984
1984
|
//#endregion
|
|
1985
|
-
|
|
1986
|
-
function createIdCaptureActor(options) {
|
|
1987
|
-
const dependencies = options.dependencies ?? { storage: new BrowserStorageProvider() };
|
|
1988
|
-
return createActor(idCaptureMachine, { input: {
|
|
1989
|
-
config: options.config,
|
|
1990
|
-
dependencies
|
|
1991
|
-
} }).start();
|
|
1992
|
-
}
|
|
1993
|
-
|
|
1994
|
-
//#endregion
|
|
1995
|
-
//#region src/modules/id/idCaptureManager.ts
|
|
1996
|
-
function getPermissionStatus(snapshot) {
|
|
1997
|
-
if (!snapshot.matches("permissions")) return;
|
|
1998
|
-
if (snapshot.matches({ permissions: "idle" })) return "idle";
|
|
1999
|
-
if (snapshot.matches({ permissions: "waitingForUser" })) return "idle";
|
|
2000
|
-
if (snapshot.matches({ permissions: "learnMore" })) return "learnMore";
|
|
2001
|
-
if (snapshot.matches({ permissions: "requesting" })) return "requesting";
|
|
2002
|
-
if (snapshot.matches({ permissions: "denied" })) return "denied";
|
|
2003
|
-
}
|
|
2004
|
-
function getCaptureStatus(snapshot) {
|
|
2005
|
-
const matches = {
|
|
2006
|
-
initializing: snapshot.matches({ capture: "initializing" }),
|
|
2007
|
-
detecting: snapshot.matches({ capture: "detecting" }),
|
|
2008
|
-
manualCaptureWaiting: snapshot.matches({ capture: "manualCaptureWaiting" }),
|
|
2009
|
-
capturing: snapshot.matches({ capture: "capturing" }),
|
|
2010
|
-
capturingManual: snapshot.matches({ capture: "capturingManual" }),
|
|
2011
|
-
uploading: snapshot.matches({ capture: "uploading" }),
|
|
2012
|
-
uploadError: snapshot.matches({ capture: "uploadError" }),
|
|
2013
|
-
success: snapshot.matches({ capture: "success" })
|
|
2014
|
-
};
|
|
2015
|
-
if (matches.initializing) return "initializing";
|
|
2016
|
-
if (matches.detecting || matches.manualCaptureWaiting) return "detecting";
|
|
2017
|
-
if (matches.capturing || matches.capturingManual) return "capturing";
|
|
2018
|
-
if (matches.uploading) return "uploading";
|
|
2019
|
-
if (matches.uploadError) return "uploadError";
|
|
2020
|
-
if (matches.success) return "success";
|
|
2021
|
-
}
|
|
2022
|
-
function getErrorMessage(errorCode) {
|
|
2023
|
-
if (!errorCode) return void 0;
|
|
2024
|
-
return {
|
|
2025
|
-
UPLOAD_ERROR: "Upload failed",
|
|
2026
|
-
CLASSIFICATION_FAILED: "ID classification failed",
|
|
2027
|
-
LOW_SHARPNESS: "Image is not sharp enough",
|
|
2028
|
-
GLARE_DETECTED: "Glare detected on ID",
|
|
2029
|
-
WRONG_DOCUMENT_SIDE: "Wrong side of document",
|
|
2030
|
-
ID_TYPE_UNACCEPTABLE: "ID type is not acceptable",
|
|
2031
|
-
READABILITY_ISSUE: "ID readability issue",
|
|
2032
|
-
RETRY_EXHAUSTED_CONTINUE_TO_BACK: "Retry exhausted",
|
|
2033
|
-
RETRY_EXHAUSTED_SKIP_BACK: "Retry exhausted",
|
|
2034
|
-
NO_MORE_TRIES: "No more tries remaining",
|
|
2035
|
-
UNEXPECTED_ERROR: "An unexpected error occurred",
|
|
2036
|
-
NO_TOKEN: "No token available",
|
|
2037
|
-
PERMISSION_DENIED: "Permission denied",
|
|
2038
|
-
USER_CANCELLED: "User cancelled",
|
|
2039
|
-
SERVER_ERROR: "Server error"
|
|
2040
|
-
}[errorCode];
|
|
2041
|
-
}
|
|
2042
|
-
function getErrorDescription(errorCode, uploadResponse) {
|
|
2043
|
-
if (!errorCode) return void 0;
|
|
2044
|
-
return {
|
|
2045
|
-
UPLOAD_ERROR: "Please try again",
|
|
2046
|
-
CLASSIFICATION_FAILED: "Please ensure your ID is clearly visible",
|
|
2047
|
-
LOW_SHARPNESS: "Please ensure the image is clear and well-focused",
|
|
2048
|
-
GLARE_DETECTED: "Please avoid bright reflections on your ID",
|
|
2049
|
-
WRONG_DOCUMENT_SIDE: uploadResponse?.side === "back" ? "Please show the back side of your ID" : "Please show the front side of your ID",
|
|
2050
|
-
ID_TYPE_UNACCEPTABLE: "Please use a valid ID type",
|
|
2051
|
-
READABILITY_ISSUE: "Please ensure all text is clearly visible",
|
|
2052
|
-
RETRY_EXHAUSTED_CONTINUE_TO_BACK: "Continuing to back side capture",
|
|
2053
|
-
RETRY_EXHAUSTED_SKIP_BACK: "Skipping back side capture",
|
|
2054
|
-
NO_MORE_TRIES: "Maximum attempts reached",
|
|
2055
|
-
UNEXPECTED_ERROR: "Please try again later",
|
|
2056
|
-
NO_TOKEN: "Session expired",
|
|
2057
|
-
PERMISSION_DENIED: "Camera permission is required",
|
|
2058
|
-
USER_CANCELLED: "Capture was cancelled",
|
|
2059
|
-
SERVER_ERROR: "Please try again later"
|
|
2060
|
-
}[errorCode];
|
|
2061
|
-
}
|
|
2062
|
-
function mapState(snapshot) {
|
|
2063
|
-
const { context } = snapshot;
|
|
2064
|
-
if (snapshot.matches("idle")) return { status: "idle" };
|
|
2065
|
-
if (snapshot.matches("chooser")) return {
|
|
2066
|
-
status: "chooser",
|
|
2067
|
-
availableDocumentTypes: context.availableDocumentTypes
|
|
2068
|
-
};
|
|
2069
|
-
if (snapshot.matches("loading")) return { status: "loading" };
|
|
2070
|
-
if (snapshot.matches("tutorial")) return {
|
|
2071
|
-
status: "tutorial",
|
|
2072
|
-
selectedDocumentType: context.selectedDocumentType,
|
|
2073
|
-
currentMode: context.currentMode
|
|
2074
|
-
};
|
|
2075
|
-
if (snapshot.matches("closed")) return { status: "closed" };
|
|
2076
|
-
if (snapshot.matches("permissions")) {
|
|
2077
|
-
const permissionStatus = getPermissionStatus(snapshot);
|
|
2078
|
-
if (permissionStatus === void 0) return {
|
|
2079
|
-
status: "permissions",
|
|
2080
|
-
permissionStatus: "idle"
|
|
2081
|
-
};
|
|
2082
|
-
return {
|
|
2083
|
-
status: "permissions",
|
|
2084
|
-
permissionStatus
|
|
2085
|
-
};
|
|
2086
|
-
}
|
|
2087
|
-
if (snapshot.matches("capture")) {
|
|
2088
|
-
const captureStatus = getCaptureStatus(snapshot);
|
|
2089
|
-
const needsBackCapture = (context.currentMode === "front" || context.currentMode === "passport") && !context.config.onlyFront && !context.config.onlyBack && !context.uploadResponse?.skipBackIdCapture && !(context.config.usSmartCapture && context.currentMode === "front");
|
|
2090
|
-
const needsFrontCapture = context.config.usSmartCapture === true && context.currentMode === "back" && context.uploadResponse?.forceFrontIdCapture === true;
|
|
2091
|
-
return {
|
|
2092
|
-
status: "capture",
|
|
2093
|
-
captureStatus: captureStatus ?? "initializing",
|
|
2094
|
-
stream: context.stream,
|
|
2095
|
-
detectionStatus: context.detectionStatus,
|
|
2096
|
-
debugFrame: void 0,
|
|
2097
|
-
attemptsRemaining: context.attemptsRemaining,
|
|
2098
|
-
uploadError: context.uploadError,
|
|
2099
|
-
currentMode: context.currentMode,
|
|
2100
|
-
counterValue: context.counterValue,
|
|
2101
|
-
orientation: context.orientation,
|
|
2102
|
-
idType: context.idType,
|
|
2103
|
-
previewImageUrl: context.previewImageUrl,
|
|
2104
|
-
uploadProgress: context.uploadProgress ?? 0,
|
|
2105
|
-
uploadErrorMessage: context.uploadError ? getErrorMessage(context.uploadError) : void 0,
|
|
2106
|
-
uploadErrorDescription: context.uploadError ? getErrorDescription(context.uploadError, context.uploadResponse) : void 0,
|
|
2107
|
-
needsBackCapture,
|
|
2108
|
-
needsFrontCapture,
|
|
2109
|
-
showCaptureButtonInAuto: context.config.showCaptureButtonInAuto ?? false,
|
|
2110
|
-
canRetry: context.attemptsRemaining > 0
|
|
2111
|
-
};
|
|
2112
|
-
}
|
|
2113
|
-
if (snapshot.matches("mandatoryConsent")) return {
|
|
2114
|
-
status: "mandatoryConsent",
|
|
2115
|
-
regulationType: context.uploadResponse?.regulationType ?? "Other"
|
|
2116
|
-
};
|
|
2117
|
-
if (snapshot.matches("frontFinished")) return { status: "frontFinished" };
|
|
2118
|
-
if (snapshot.matches("backFinished")) return { status: "backFinished" };
|
|
2119
|
-
if (snapshot.matches("processing")) return { status: "processing" };
|
|
2120
|
-
if (snapshot.matches("expired")) return { status: "expired" };
|
|
2121
|
-
if (snapshot.matches("finished")) return { status: "finished" };
|
|
2122
|
-
if (snapshot.matches("error")) return {
|
|
2123
|
-
status: "error",
|
|
2124
|
-
error: context.error ?? "Unknown error"
|
|
2125
|
-
};
|
|
2126
|
-
return { status: "idle" };
|
|
2127
|
-
}
|
|
2128
|
-
function createApi({ actor, trackElementClicked, trackCaptureAttemptFinished }) {
|
|
2129
|
-
const snapshot = actor.getSnapshot();
|
|
2130
|
-
if (snapshot.context.dependencies) snapshot.context.dependencies.trackCaptureAttemptFinished = trackCaptureAttemptFinished;
|
|
2131
|
-
return {
|
|
2132
|
-
load() {
|
|
2133
|
-
actor.send({ type: "LOAD" });
|
|
2134
|
-
},
|
|
2135
|
-
selectDocument(documentType) {
|
|
2136
|
-
trackElementClicked?.(`selectDocument.${documentType}`);
|
|
2137
|
-
actor.send({
|
|
2138
|
-
type: "SELECT_DOCUMENT",
|
|
2139
|
-
documentType
|
|
2140
|
-
});
|
|
2141
|
-
},
|
|
2142
|
-
nextStep() {
|
|
2143
|
-
trackElementClicked?.("nextStep");
|
|
2144
|
-
actor.send({ type: "NEXT_STEP" });
|
|
2145
|
-
},
|
|
2146
|
-
requestPermission() {
|
|
2147
|
-
trackElementClicked?.("requestPermission");
|
|
2148
|
-
actor.send({ type: "REQUEST_PERMISSION" });
|
|
2149
|
-
},
|
|
2150
|
-
goToLearnMore() {
|
|
2151
|
-
trackElementClicked?.("goToLearnMore");
|
|
2152
|
-
actor.send({ type: "GO_TO_LEARN_MORE" });
|
|
2153
|
-
},
|
|
2154
|
-
back() {
|
|
2155
|
-
trackElementClicked?.("back");
|
|
2156
|
-
actor.send({ type: "BACK" });
|
|
2157
|
-
},
|
|
2158
|
-
close() {
|
|
2159
|
-
trackElementClicked?.("close");
|
|
2160
|
-
actor.send({ type: "QUIT" });
|
|
2161
|
-
},
|
|
2162
|
-
reset() {
|
|
2163
|
-
actor.send({ type: "RESET" });
|
|
2164
|
-
},
|
|
2165
|
-
retryCapture() {
|
|
2166
|
-
trackElementClicked?.("retryCapture");
|
|
2167
|
-
actor.send({ type: "RETRY_CAPTURE" });
|
|
2168
|
-
},
|
|
2169
|
-
continueFromError() {
|
|
2170
|
-
trackElementClicked?.("continueFromError");
|
|
2171
|
-
actor.send({ type: "CONTINUE_FROM_ERROR" });
|
|
2172
|
-
},
|
|
2173
|
-
capture() {
|
|
2174
|
-
trackElementClicked?.("capture");
|
|
2175
|
-
actor.send({ type: "MANUAL_CAPTURE" });
|
|
2176
|
-
},
|
|
2177
|
-
switchToManualCapture() {
|
|
2178
|
-
trackElementClicked?.("switchToManualCapture");
|
|
2179
|
-
actor.send({ type: "SWITCH_TO_MANUAL_CAPTURE" });
|
|
2180
|
-
},
|
|
2181
|
-
continueToBack() {
|
|
2182
|
-
trackElementClicked?.("continueToBack");
|
|
2183
|
-
actor.send({ type: "CONTINUE_TO_BACK" });
|
|
2184
|
-
},
|
|
2185
|
-
continueToFront() {
|
|
2186
|
-
trackElementClicked?.("continueToFront");
|
|
2187
|
-
actor.send({ type: "CONTINUE_TO_FRONT" });
|
|
2188
|
-
},
|
|
2189
|
-
skipBack() {
|
|
2190
|
-
trackElementClicked?.("skipBack");
|
|
2191
|
-
actor.send({ type: "SKIP_BACK" });
|
|
2192
|
-
},
|
|
2193
|
-
acceptMandatoryConsent() {
|
|
2194
|
-
trackElementClicked?.("acceptMandatoryConsent");
|
|
2195
|
-
actor.send({ type: "CONSENT_ACCEPT" });
|
|
2196
|
-
},
|
|
2197
|
-
cancelMandatoryConsent() {
|
|
2198
|
-
trackElementClicked?.("cancelMandatoryConsent");
|
|
2199
|
-
actor.send({ type: "CONSENT_CANCEL" });
|
|
2200
|
-
},
|
|
2201
|
-
updateDetectionArea(detectionArea) {
|
|
2202
|
-
actor.send({
|
|
2203
|
-
type: "UPDATE_DETECTION_AREA",
|
|
2204
|
-
detectionArea
|
|
2205
|
-
});
|
|
2206
|
-
}
|
|
2207
|
-
};
|
|
2208
|
-
}
|
|
2209
|
-
const FRONT_SCREENS = {
|
|
2210
|
-
tutorial: eventScreenNames.frontTutorial,
|
|
2211
|
-
cameraCapture: eventScreenNames.frontCameraCapture,
|
|
2212
|
-
uploadProgress: eventScreenNames.frontUploadProgress,
|
|
2213
|
-
attemptFailed: eventScreenNames.frontAttemptFailed,
|
|
2214
|
-
uploadSuccess: eventScreenNames.frontUploadSuccess,
|
|
2215
|
-
help: eventScreenNames.frontHelp
|
|
2216
|
-
};
|
|
2217
|
-
const BACK_SCREENS = {
|
|
2218
|
-
tutorial: eventScreenNames.backTutorial,
|
|
2219
|
-
cameraCapture: eventScreenNames.backCameraCapture,
|
|
2220
|
-
uploadProgress: eventScreenNames.backUploadProgress,
|
|
2221
|
-
attemptFailed: eventScreenNames.backAttemptFailed,
|
|
2222
|
-
uploadSuccess: eventScreenNames.backUploadSuccess,
|
|
2223
|
-
help: eventScreenNames.backHelp
|
|
2224
|
-
};
|
|
2225
|
-
const PASSPORT_SCREENS = { tutorial: eventScreenNames.passportTutorial };
|
|
2226
|
-
function getSideScreens(mode) {
|
|
2227
|
-
if (mode === "back") return BACK_SCREENS;
|
|
2228
|
-
if (mode === "passport") return {
|
|
2229
|
-
...FRONT_SCREENS,
|
|
2230
|
-
...PASSPORT_SCREENS
|
|
2231
|
-
};
|
|
2232
|
-
return FRONT_SCREENS;
|
|
2233
|
-
}
|
|
2234
|
-
function getCaptureSubstateScreen(value, screens) {
|
|
2235
|
-
if (typeof value !== "object" || value === null) return void 0;
|
|
2236
|
-
const captureValue = value.capture;
|
|
2237
|
-
if (captureValue === void 0) return void 0;
|
|
2238
|
-
if (typeof captureValue === "string") switch (captureValue) {
|
|
2239
|
-
case "detecting":
|
|
2240
|
-
case "manualCaptureWaiting":
|
|
2241
|
-
case "capturing":
|
|
2242
|
-
case "capturingManual": return screens.cameraCapture;
|
|
2243
|
-
case "uploading":
|
|
2244
|
-
case "validatingUpload": return screens.uploadProgress;
|
|
2245
|
-
case "uploadError": return screens.attemptFailed;
|
|
2246
|
-
case "success": return screens.uploadSuccess;
|
|
2247
|
-
}
|
|
2248
|
-
if (typeof captureValue === "object" && captureValue !== null) {
|
|
2249
|
-
const substates = Object.keys(captureValue);
|
|
2250
|
-
if (substates.includes("detecting") || substates.includes("capturing")) return screens.cameraCapture;
|
|
2251
|
-
if (substates.includes("uploading")) return screens.uploadProgress;
|
|
2252
|
-
if (substates.includes("uploadError")) return screens.attemptFailed;
|
|
2253
|
-
if (substates.includes("success")) return screens.uploadSuccess;
|
|
2254
|
-
}
|
|
2255
|
-
return screens.cameraCapture;
|
|
2256
|
-
}
|
|
2257
|
-
function getIdCaptureScreenName(snapshot) {
|
|
2258
|
-
const { value, context } = snapshot;
|
|
2259
|
-
if (value === void 0 || value === null) return void 0;
|
|
2260
|
-
const topLevel = typeof value === "string" ? value : typeof value === "object" ? Object.keys(value)[0] : void 0;
|
|
2261
|
-
if (topLevel === void 0) return void 0;
|
|
2262
|
-
const side = context.currentMode;
|
|
2263
|
-
const screens = getSideScreens(side);
|
|
2264
|
-
switch (topLevel) {
|
|
2265
|
-
case "idle": return "IDLE";
|
|
2266
|
-
case "chooser": return "DOCUMENT_CHOOSER";
|
|
2267
|
-
case "loading": return "LOADING";
|
|
2268
|
-
case "tutorial": return screens.tutorial;
|
|
2269
|
-
case "permissions": return "PERMISSIONS";
|
|
2270
|
-
case "capture": return getCaptureSubstateScreen(value, screens);
|
|
2271
|
-
case "mandatoryConsent": return "MANDATORY_CONSENT";
|
|
2272
|
-
case "frontFinished": return screens.uploadSuccess;
|
|
2273
|
-
case "backFinished": return screens.uploadSuccess;
|
|
2274
|
-
case "processing": return "PROCESSING";
|
|
2275
|
-
case "expired": return "EXPIRED";
|
|
2276
|
-
case "finished": return "FINISHED";
|
|
2277
|
-
case "closed": return "CLOSED";
|
|
2278
|
-
case "error": return "ERROR";
|
|
2279
|
-
default: return topLevel;
|
|
2280
|
-
}
|
|
2281
|
-
}
|
|
2282
|
-
function mapIdCaptureScreenName(snapshot) {
|
|
2283
|
-
return getIdCaptureScreenName(snapshot);
|
|
2284
|
-
}
|
|
2285
|
-
function getIdCaptureErrorPayload(snapshot) {
|
|
2286
|
-
const errorCode = snapshot.context.uploadError;
|
|
2287
|
-
if (errorCode === void 0) return;
|
|
2288
|
-
return { errorCode };
|
|
2289
|
-
}
|
|
2290
|
-
function createIdCaptureManager(options) {
|
|
2291
|
-
return createManager({
|
|
2292
|
-
actor: createIdCaptureActor(options),
|
|
2293
|
-
mapState,
|
|
2294
|
-
createApi,
|
|
2295
|
-
instrumentation: createManagerInstrumentation(eventModuleNames.id, {
|
|
2296
|
-
getScreenName: mapIdCaptureScreenName,
|
|
2297
|
-
getErrorPayload: getIdCaptureErrorPayload
|
|
2298
|
-
})
|
|
2299
|
-
});
|
|
2300
|
-
}
|
|
2301
|
-
function createIdCaptureManagerFromActor(actor) {
|
|
2302
|
-
return createManager({
|
|
2303
|
-
actor,
|
|
2304
|
-
mapState,
|
|
2305
|
-
createApi,
|
|
2306
|
-
instrumentation: createManagerInstrumentation(eventModuleNames.id, {
|
|
2307
|
-
getScreenName: mapIdCaptureScreenName,
|
|
2308
|
-
getErrorPayload: getIdCaptureErrorPayload
|
|
2309
|
-
})
|
|
2310
|
-
});
|
|
2311
|
-
}
|
|
2312
|
-
|
|
2313
|
-
//#endregion
|
|
2314
|
-
export { initializeIdCapture as a, startRecordingSession as c, uploadIdImage as d, validateUploadResponse as f, idCaptureMachine as i, stopRecording as l, createIdCaptureManagerFromActor as n, preloadIdRecordingProvider as o, ID_ERROR_CODES as p, createIdCaptureActor as r, processId as s, createIdCaptureManager as t, stopStream as u };
|
|
1985
|
+
export { startRecordingSession as a, uploadIdImage as c, processId as i, validateUploadResponse as l, initializeIdCapture as n, stopRecording as o, preloadIdRecordingProvider as r, stopStream as s, idCaptureMachine as t, ID_ERROR_CODES as u };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "./warmup-
|
|
2
|
-
import { a as reset, i as isConfigured, s as setup, t as SetupOptions } from "./setup-
|
|
1
|
+
import "./warmup-Ckb1hN85.js";
|
|
2
|
+
import { a as reset, i as isConfigured, s as setup, t as SetupOptions } from "./setup-BYqwVLiv.js";
|
|
3
3
|
export { type SetupOptions, isConfigured, reset, setup };
|
package/dist/index.esm.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { a as setup, n as isConfigured, r as reset } from "./setup-
|
|
2
|
-
import "./BaseWasmProvider-
|
|
3
|
-
import "./WasmUtilProvider-
|
|
4
|
-
import "./api-
|
|
5
|
-
import "./events-
|
|
6
|
-
import "./session-
|
|
7
|
-
import "./BrowserEnvironmentProvider-
|
|
8
|
-
import "./browserSimulation-
|
|
1
|
+
import { a as setup, n as isConfigured, r as reset } from "./setup-DLvhsDol.esm.js";
|
|
2
|
+
import "./BaseWasmProvider-DoYDYH1z.esm.js";
|
|
3
|
+
import "./WasmUtilProvider-mWSXzp7b.esm.js";
|
|
4
|
+
import "./api-aa9Mx20l.esm.js";
|
|
5
|
+
import "./events-W91zLpx4.esm.js";
|
|
6
|
+
import "./session-B_rKSRql.esm.js";
|
|
7
|
+
import "./BrowserEnvironmentProvider-BtKLxTx4.esm.js";
|
|
8
|
+
import "./browserSimulation-DFqGKQAD.esm.js";
|
|
9
9
|
|
|
10
10
|
export { isConfigured, reset, setup };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as __toCommonJS, n as __esm, r as __export, t as __commonJS } from "./chunk-
|
|
1
|
+
import { i as __toCommonJS, n as __esm, r as __export, t as __commonJS } from "./chunk-YGHKo4MY.esm.js";
|
|
2
2
|
|
|
3
3
|
//#region ../../node_modules/.pnpm/jsnlog@2.30.0/node_modules/jsnlog/jsnlog.js
|
|
4
4
|
var require_jsnlog = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/jsnlog@2.30.0/node_modules/jsnlog/jsnlog.js": ((exports) => {
|