@incodetech/core 2.0.1 → 2.1.0-rc.1
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-CuOW1Er2.esm.js → BrowserStorageProvider-BpJM-gIl.esm.js} +8 -1
- package/dist/{IpifyProvider-D7jx52AL.esm.js → IpifyProvider-D4LWD15E.esm.js} +28 -0
- package/dist/{MotionSensorProvider-4v7xkqAp.esm.js → MotionSensorProvider-Bx7Mpzt0.esm.js} +63 -13
- package/dist/{OpenViduRecordingProvider-CMu6XVdc.esm.js → OpenViduRecordingProvider-O4GjBseO.esm.js} +1 -1
- package/dist/StateMachine-BC_nGvrc.d.ts +2 -0
- package/dist/StreamCanvasCapture-ImiDQdVA.esm.js +118 -0
- package/dist/StreamCanvasCapture-yyl20qd9.d.ts +152 -0
- package/dist/{BaseWasmProvider-C_DLEI40.esm.js → WasmUtilProvider-BKWm8rSA.esm.js} +202 -11
- package/dist/{addressSearch-BpTbTWCa.esm.js → addressSearch-DvmWXKZg.esm.js} +63 -57
- package/dist/{ae-signature-DDDZmWXj.esm.js → ae-signature-BFZta3TZ.esm.js} +1 -1
- package/dist/ae-signature.d.ts +3 -3
- package/dist/ae-signature.esm.js +6 -5
- package/dist/antifraud.d.ts +5 -46
- package/dist/antifraud.esm.js +6 -43
- package/dist/antifraudManager-CkV4u-LE.esm.js +55 -0
- package/dist/antifraudManager-CznnhyvD.d.ts +63 -0
- package/dist/{antifraudStateMachine-O0TMf6yc.esm.js → antifraudStateMachine-Ccrb-Jxc.esm.js} +2 -2
- package/dist/apiError-B-j-gyDx.esm.js +51 -0
- package/dist/authentication.d.ts +13 -11
- package/dist/authentication.esm.js +26 -22
- package/dist/{authenticationManager-5M-fKzXx.esm.js → authenticationManager-BlR6mSaG.esm.js} +6 -6
- package/dist/{authenticationManager-C83GNIhl.d.ts → authenticationManager-CaiQbp-q.d.ts} +4 -4
- package/dist/{authenticationStateMachine-BMZqatiF.esm.js → authenticationStateMachine-DkcGUMw5.esm.js} +21 -9
- package/dist/{backCameraStream-DMdMeGk2.esm.js → backCameraStream-D7Wo4Nbx.esm.js} +95 -7
- package/dist/{session-CrkWAs-q.esm.js → browserSimulation-B1dWiXp7.esm.js} +61 -476
- package/dist/camera.d.ts +4 -3
- package/dist/camera.esm.js +4 -3
- package/dist/canvas-SKcRBxsk.esm.js +230 -0
- package/dist/consent.d.ts +4 -398
- package/dist/consent.esm.js +6 -77
- package/dist/consentManager-BYo9Nu1r.esm.js +90 -0
- package/dist/consentManager-Cg5Sk2tv.d.ts +419 -0
- package/dist/{consentStateMachine-CCT-B60O.esm.js → consentStateMachine-BG3yL8aC.esm.js} +9 -6
- package/dist/cpf-ocr.d.ts +4 -199
- package/dist/cpf-ocr.esm.js +8 -177
- package/dist/cpfOcrManager-Dg1s_TY5.d.ts +216 -0
- package/dist/cpfOcrManager-sSKegxox.esm.js +190 -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 +8 -158
- package/dist/curp-validation.esm.js +6 -108
- package/dist/curpValidationManager-CFem6zP9.esm.js +122 -0
- package/dist/curpValidationManager-RttixpIc.d.ts +184 -0
- package/dist/{curpValidationStateMachine-CitWLr2c.esm.js → curpValidationStateMachine-B7V_qp66.esm.js} +20 -13
- package/dist/custom-fields.d.ts +2 -2
- package/dist/custom-fields.esm.js +4 -4
- package/dist/custom-watchlist.d.ts +1 -1
- package/dist/custom-watchlist.esm.js +4 -41
- package/dist/customWatchlistStateMachine-HmFybXLX.esm.js +50 -0
- package/dist/{deepsightLoader-Cm4JIT_z.esm.js → deepsightLoader-8tnddNx-.esm.js} +19 -10
- package/dist/deepsightService-CrHmvx8X.esm.js +276 -0
- package/dist/{deepsightService-CEVxzehb.d.ts → deepsightService-Dh5P-hLf.d.ts} +13 -160
- package/dist/device.esm.js +4 -3
- package/dist/document-capture.d.ts +989 -80
- package/dist/document-capture.esm.js +34 -8
- package/dist/document-upload.d.ts +44 -44
- package/dist/document-upload.esm.js +7 -7
- package/dist/{documentCaptureStateMachine-BqzTDy9k.esm.js → documentCaptureStateMachine-CUTUzUw_.esm.js} +90 -6
- package/dist/dynamic-forms.d.ts +20 -5
- package/dist/dynamic-forms.esm.js +150 -61
- package/dist/ekyb.d.ts +32 -13
- package/dist/ekyb.esm.js +25 -15
- package/dist/{ekybStateMachine-CyMx_kg-.esm.js → ekybStateMachine-klc-AImJ.esm.js} +319 -207
- package/dist/ekyc.d.ts +10 -78
- package/dist/ekyc.esm.js +17 -12
- package/dist/{ekycStateMachine-oeO0Iekd.esm.js → ekycStateMachine-CXbpaJJn.esm.js} +201 -113
- package/dist/electronic-signature.d.ts +3 -3
- package/dist/electronic-signature.esm.js +5 -4
- package/dist/{electronicSignatureManager-D9OHzTpG.esm.js → electronicSignatureManager-BaECdJ1u.esm.js} +91 -23
- package/dist/email.d.ts +4 -3
- package/dist/email.esm.js +6 -5
- package/dist/{emailManager-wAV0LE-H.esm.js → emailManager--D5G3ChB.esm.js} +30 -7
- package/dist/{emailManager-DIfnS5g1.d.ts → emailManager-lAzDoQOs.d.ts} +66 -8
- package/dist/{emailStateMachine-DOf4j58N.esm.js → emailStateMachine-CxTOMAjC.esm.js} +46 -11
- package/dist/{endpoints-CnN3SyDa.esm.js → endpoints-BeTK0Mlt.esm.js} +6 -3
- package/dist/{events-D6-e4vok.esm.js → events-Dvvriq9l.esm.js} +3 -1
- package/dist/events.d.ts +2 -0
- package/dist/events.esm.js +1 -1
- package/dist/extensibility.d.ts +41 -16
- package/dist/extensibility.esm.js +55 -33
- package/dist/face-match.d.ts +21 -2
- package/dist/face-match.esm.js +5 -5
- package/dist/{faceCaptureManagerFactory-yqtpxjnN.d.ts → faceCaptureManagerFactory-CjdBUS6s.d.ts} +48 -17
- package/dist/{faceCaptureManagerFactory-Dh2PdGlF.esm.js → faceCaptureManagerFactory-ej2j1LMr.esm.js} +21 -5
- package/dist/{faceCaptureSetup-B3faSpYA.esm.js → faceCaptureSetup-B9t6bYze.esm.js} +68 -183
- package/dist/{faceMatchStateMachine-DNFrxTFS.esm.js → faceMatchStateMachine-DeXXzSuz.esm.js} +62 -6
- package/dist/field-comparison.d.ts +4 -0
- package/dist/field-comparison.esm.js +7 -0
- package/dist/fieldComparisonManager-Bu5TaSr3.d.ts +76 -0
- package/dist/fieldComparisonManager-COGI2ARD.esm.js +162 -0
- package/dist/fiscal-qr.d.ts +59 -0
- package/dist/fiscal-qr.esm.js +323 -0
- package/dist/flow-events.d.ts +6 -5
- package/dist/flow.d.ts +23 -15
- package/dist/flow.esm.js +56 -17
- package/dist/flowCompletionService-BdR2cGgB.d.ts +19 -0
- package/dist/flowCompletionService-DdGojV9K.esm.js +20 -0
- package/dist/{flowServices-PiNsxLfK.esm.js → flowServices-ChgTNggJ.esm.js} +10 -5
- package/dist/geolocation.d.ts +4 -4
- package/dist/geolocation.esm.js +6 -6
- package/dist/{geolocationStateMachine-asasuHY2.esm.js → geolocationStateMachine-Dvh7X0wF.esm.js} +5 -5
- package/dist/getBrowser-C8DP7oTB.esm.js +8 -0
- package/dist/{getBrowser-BSXUTWXw.esm.js → getDeviceClass-C0olyNFS.esm.js} +1 -8
- package/dist/{getDeviceClass-BSntT9_j.esm.js → getDeviceClass-C8Do2qYu.esm.js} +1 -1
- package/dist/government-validation.d.ts +28 -8
- package/dist/government-validation.esm.js +19 -8
- package/dist/{governmentValidationStateMachine-BDDYrJTo.esm.js → governmentValidationStateMachine-DcJ-BfsC.esm.js} +35 -77
- package/dist/home.d.ts +15 -14
- package/dist/home.esm.js +2 -2
- package/dist/http-Cai3IoLS.esm.js +0 -0
- package/dist/http.esm.js +1 -0
- package/dist/id-ocr.d.ts +54 -54
- package/dist/id-ocr.esm.js +5 -5
- package/dist/id-verification.d.ts +27 -27
- package/dist/id-verification.esm.js +4 -4
- package/dist/id.d.ts +12 -10
- package/dist/id.esm.js +70 -27
- package/dist/{idCaptureManager-Fyd0eam-.d.ts → idCaptureManager-ChCNmgBj.d.ts} +40 -20
- package/dist/{idCaptureManager-D0ktk7Hh.esm.js → idCaptureManager-D3pwWutw.esm.js} +22 -7
- package/dist/{idCaptureStateMachine-dwlBUjbC.esm.js → idCaptureStateMachine-B3AiDIsT.esm.js} +172 -123
- package/dist/{idOcrStateMachine-YbjjC_Gg.esm.js → idOcrStateMachine-CDQ5d_VM.esm.js} +4 -4
- package/dist/{idVerificationStateMachine-xbw9HP1Z.esm.js → idVerificationStateMachine-kRxwImzO.esm.js} +2 -2
- package/dist/identity-reuse.d.ts +4 -530
- package/dist/identity-reuse.esm.js +8 -274
- package/dist/identityReuseManager-C6n_97dw.esm.js +95 -0
- package/dist/identityReuseManager-Cww-NDtd.d.ts +428 -0
- package/dist/identityReuseStateMachine-BfE5YiEr.esm.js +148 -0
- package/dist/{index-BcRG8rtJ.d.ts → index-B5hPA0Bg.d.ts} +2 -2
- package/dist/{index-ChHWNH48.d.ts → index-B9NysVDB.d.ts} +469 -195
- package/dist/index.d.ts +2 -2
- package/dist/index.esm.js +10 -8
- package/dist/{invokeOnCaptureCallback-rc6kBHo5.esm.js → invokeOnCaptureCallback-ygByVdnn.esm.js} +1 -1
- package/dist/{lib-BB0B_qQX.esm.js → lib-BY67lgbq.esm.js} +1 -1
- package/dist/mandatory-consent.d.ts +8 -412
- package/dist/mandatory-consent.esm.js +6 -76
- package/dist/mandatoryConsentManager-Dq6WiOZh.d.ts +429 -0
- package/dist/mandatoryConsentManager-H6D18cZB.esm.js +89 -0
- package/dist/{mandatoryConsentStateMachine-Cnco1jvn.esm.js → mandatoryConsentStateMachine-DtQNW1ji.esm.js} +6 -6
- package/dist/openviduLazy-B8L--0oe.esm.js +3 -0
- package/dist/{openviduLazy-Cok70ZSg.esm.js → openviduLazy-Dh14JNJc.esm.js} +2 -2
- package/dist/otp-CGMdUzBC.esm.js +33 -0
- package/dist/otp-DF5A0sFx.d.ts +8 -0
- package/dist/permissionGuards-D0wGddy7.esm.js +23 -0
- package/dist/permissionServices-Doec4X5L.esm.js +130 -0
- package/dist/phone.d.ts +4 -3
- package/dist/phone.esm.js +6 -5
- package/dist/{phoneManager-DAJbGhlY.esm.js → phoneManager-BmF-0Ez4.esm.js} +30 -7
- package/dist/{phoneManager-B6M30hKE.d.ts → phoneManager-fPmIBYQK.d.ts} +65 -7
- package/dist/{phoneStateMachine-CuPARRaT.esm.js → phoneStateMachine-BiV0yoEx.esm.js} +46 -11
- package/dist/{qe-signature-DFo_Cc-I.esm.js → qe-signature-CUYPcHVo.esm.js} +1 -1
- package/dist/qe-signature.d.ts +3 -3
- package/dist/qe-signature.esm.js +6 -5
- package/dist/{recordingService-Ig2UgbLv.esm.js → recordingService-yRw7hfzU.esm.js} +197 -179
- package/dist/redirect-to-mobile.d.ts +6 -104
- package/dist/redirect-to-mobile.esm.js +6 -99
- package/dist/redirectToMobileManager-BNe3IzC_.d.ts +178 -0
- package/dist/redirectToMobileManager-Dy3t7o0C.esm.js +159 -0
- package/dist/{redirectToMobileStateMachine-BOEqe46A.esm.js → redirectToMobileStateMachine-DyAdRxfP.esm.js} +28 -19
- package/dist/{runChildModule-CqqwqAkW.esm.js → runChildModule-CuoHZ1cx.esm.js} +35 -3
- package/dist/selfie.d.ts +13 -11
- package/dist/selfie.esm.js +53 -24
- package/dist/{selfieManager-Duisl7qN.esm.js → selfieManager-BNuTIGAz.esm.js} +6 -6
- package/dist/{selfieManager-D0lSgd-J.d.ts → selfieManager-C2y_t6DG.d.ts} +4 -4
- package/dist/{selfieStateMachine-D76whWEf.esm.js → selfieStateMachine-Bv99bZJE.esm.js} +5 -3
- package/dist/session-DoVb-OcB.esm.js +152 -0
- package/dist/session.d.ts +37 -5
- package/dist/session.esm.js +12 -7
- package/dist/sessionInitializer-DRB-hgbV.esm.js +366 -0
- package/dist/{setup-C5AITV8m.d.ts → setup-BwCluiw3.d.ts} +86 -6
- package/dist/{setup-DPPAxmXf.esm.js → setup-CUO4mErT.esm.js} +175 -25
- package/dist/signature.d.ts +2 -2
- package/dist/signature.esm.js +4 -4
- package/dist/{signatureStateMachine-B5-QVUve.esm.js → signatureStateMachine-C5qqYLRz.esm.js} +3 -3
- package/dist/stats-BMNUG1AU.esm.js +41 -0
- package/dist/stats.d.ts +13 -2
- package/dist/stats.esm.js +3 -2
- package/dist/trust-graph.d.ts +33 -4
- package/dist/trust-graph.esm.js +21 -15
- package/dist/{types-CFV9G_7j.d.ts → types-Bj9hdFjU.d.ts} +1 -1
- package/dist/{types-BP1m8VRw.d.ts → types-DOUhndhT.d.ts} +14 -2
- package/dist/types-DsnEVMhr.esm.js +34 -0
- package/dist/types-DvGZI7BF.d.ts +131 -0
- package/dist/{types-B06Ypu2F.d.ts → types-NuT8ftBV.d.ts} +1 -1
- package/dist/types-ya0LN_MX.d.ts +5 -0
- package/dist/{warmup-CEcppFiS.d.ts → warmup-Dg8Lh-50.d.ts} +8 -0
- package/dist/wasm.d.ts +6 -4
- package/dist/wasm.esm.js +11 -9
- package/dist/watchlist-for-business.d.ts +1 -1
- package/dist/watchlist-for-business.esm.js +5 -73
- package/dist/watchlist.d.ts +1 -1
- package/dist/watchlist.esm.js +4 -41
- package/dist/watchlistForBusinessStateMachine-DMl8j2Ov.esm.js +74 -0
- package/dist/watchlistStateMachine-DmQlqI6L.esm.js +50 -0
- package/dist/workflow.d.ts +146 -100
- package/dist/workflow.esm.js +116 -66
- package/package.json +19 -1
- package/dist/StateMachine-BCQrZJhf.d.ts +0 -2
- package/dist/WasmUtilProvider-j98OJf-S.esm.js +0 -114
- package/dist/browserSimulation-gxD8cSpM.esm.js +0 -20
- package/dist/deepsightService-O74l4Y__.esm.js +0 -489
- package/dist/displayErrors-DqJ_IbsG.d.ts +0 -39
- package/dist/flowCompletionService-DhkT4SRY.d.ts +0 -10
- package/dist/flowCompletionService-P54yzGvA.esm.js +0 -13
- package/dist/openviduLazy-Cm0XFh_v.esm.js +0 -3
- package/dist/permissionServices-D_i6nzEw.esm.js +0 -50
- package/dist/stats-CIfiPzb1.esm.js +0 -16
- package/dist/types-CAD4va6a.d.ts +0 -5
- package/dist/watchlistServices-DMbUhkBX.esm.js +0 -12
- /package/dist/{Actor-CI32dTbG.d.ts → Actor-Y0_Fj-KL.d.ts} +0 -0
- /package/dist/{ITimerCapability-C67ZRskg.esm.js → ITimerCapability-CB0I1Uf2.esm.js} +0 -0
- /package/dist/{Manager-C8PrhBOx.d.ts → Manager-BHn8wH8K.d.ts} +0 -0
- /package/dist/{camera-PA2Ljri3.esm.js → camera-DJWm3V4g.esm.js} +0 -0
- /package/dist/{camera-DBSxa6ML.d.ts → camera-SRBpPq2X.d.ts} +0 -0
- /package/dist/{chunk-CRF6K_H_.esm.js → chunk-CMUKZ2uL.esm.js} +0 -0
- /package/dist/{cpf-PPz2Njto.esm.js → cpf-BRzggV8G.esm.js} +0 -0
- /package/dist/{dateUtils-UoN5xswP.esm.js → dateUtils-AksLQmgV.esm.js} +0 -0
- /package/dist/{platform-CfrjKhmi.esm.js → platform-SKvEfCBh.esm.js} +0 -0
- /package/dist/{xstate.esm-B70JrNqo.esm.js → xstate.esm-C9wncMQa.esm.js} +0 -0
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
import { r as getToken, s as setToken, t as api } from "./api-CESGtpbH.esm.js";
|
|
2
|
+
import { g as getAnalyticsBatcher, h as addEvent } from "./events-Dvvriq9l.esm.js";
|
|
3
|
+
import { t as endpoints } from "./endpoints-BeTK0Mlt.esm.js";
|
|
4
|
+
import { n as flushDeviceStatsQueue, r as resetDeviceStatsQueue } from "./stats-BMNUG1AU.esm.js";
|
|
5
|
+
import { n as resetIpifyCache, r as BrowserEnvironmentProvider, t as IpifyProvider } from "./IpifyProvider-D4LWD15E.esm.js";
|
|
6
|
+
import { i as UAParser, n as getThumbmarkId, r as getParsedUserAgent, t as isBrowserSimulation } from "./browserSimulation-B1dWiXp7.esm.js";
|
|
7
|
+
|
|
8
|
+
//#region ../infra/src/providers/browser/BrowserInfoProvider.ts
|
|
9
|
+
var BrowserInfoProvider = class {
|
|
10
|
+
checkWebRtcSupport() {
|
|
11
|
+
if (typeof window === "undefined") return false;
|
|
12
|
+
const hasRTCPeerConnection = "RTCPeerConnection" in window || "webkitRTCPeerConnection" in window || "mozRTCPeerConnection" in window;
|
|
13
|
+
const hasGetUserMedia = typeof navigator !== "undefined" && navigator.mediaDevices?.getUserMedia !== void 0;
|
|
14
|
+
return hasRTCPeerConnection && hasGetUserMedia;
|
|
15
|
+
}
|
|
16
|
+
getBrowserInfo() {
|
|
17
|
+
const userAgent = typeof navigator !== "undefined" ? navigator.userAgent : "";
|
|
18
|
+
const result = new UAParser(userAgent).getResult();
|
|
19
|
+
return {
|
|
20
|
+
userAgent,
|
|
21
|
+
isWebRtcSupported: this.checkWebRtcSupport(),
|
|
22
|
+
browser: {
|
|
23
|
+
name: result.browser.name,
|
|
24
|
+
version: result.browser.version
|
|
25
|
+
},
|
|
26
|
+
os: {
|
|
27
|
+
name: result.os.name,
|
|
28
|
+
version: result.os.version
|
|
29
|
+
},
|
|
30
|
+
device: {
|
|
31
|
+
model: result.device.model,
|
|
32
|
+
type: result.device.type,
|
|
33
|
+
vendor: result.device.vendor
|
|
34
|
+
},
|
|
35
|
+
engine: {
|
|
36
|
+
name: result.engine.name,
|
|
37
|
+
version: result.engine.version
|
|
38
|
+
},
|
|
39
|
+
cpu: { architecture: result.cpu.architecture }
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region ../infra/src/device/getDeviceData.ts
|
|
46
|
+
const HIGH_ENTROPY_HINTS = new Set([
|
|
47
|
+
"model",
|
|
48
|
+
"platformVersion",
|
|
49
|
+
"fullVersionList",
|
|
50
|
+
"brands",
|
|
51
|
+
"platform"
|
|
52
|
+
]);
|
|
53
|
+
function getFallbackDeviceInfo() {
|
|
54
|
+
const parsed = getParsedUserAgent();
|
|
55
|
+
return {
|
|
56
|
+
device: { model: parsed.device.model },
|
|
57
|
+
os: {
|
|
58
|
+
name: parsed.os.name,
|
|
59
|
+
version: parsed.os.version
|
|
60
|
+
},
|
|
61
|
+
browser: {
|
|
62
|
+
name: parsed.browser.name,
|
|
63
|
+
version: parsed.browser.version
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
function sanitizeString(value) {
|
|
68
|
+
return value?.trim() || void 0;
|
|
69
|
+
}
|
|
70
|
+
function extractPrimaryBrandInfo(fullVersionList, brands) {
|
|
71
|
+
const primaryBrand = fullVersionList?.[0] || brands?.[0];
|
|
72
|
+
return {
|
|
73
|
+
name: sanitizeString(primaryBrand?.brand),
|
|
74
|
+
version: sanitizeString(primaryBrand?.version)
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
async function getHighEntropyDeviceInfo(userAgentData) {
|
|
78
|
+
const highEntropyValues = await userAgentData.getHighEntropyValues(Array.from(HIGH_ENTROPY_HINTS));
|
|
79
|
+
const { name: browserName, version: browserVersion } = extractPrimaryBrandInfo(highEntropyValues.fullVersionList, userAgentData.brands);
|
|
80
|
+
return {
|
|
81
|
+
device: { model: sanitizeString(highEntropyValues.model) },
|
|
82
|
+
os: {
|
|
83
|
+
name: sanitizeString(highEntropyValues.platform),
|
|
84
|
+
version: sanitizeString(highEntropyValues.platformVersion)
|
|
85
|
+
},
|
|
86
|
+
browser: {
|
|
87
|
+
name: browserName,
|
|
88
|
+
version: browserVersion
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
const checkForUnbrandedBrowser = (browser) => {
|
|
93
|
+
const userAgent = typeof navigator !== "undefined" ? navigator.userAgent : "";
|
|
94
|
+
const fallback = getFallbackDeviceInfo();
|
|
95
|
+
if (!userAgent) return browser;
|
|
96
|
+
try {
|
|
97
|
+
return {
|
|
98
|
+
...browser,
|
|
99
|
+
name: fallback.browser.name,
|
|
100
|
+
version: fallback.browser.version
|
|
101
|
+
};
|
|
102
|
+
} catch {
|
|
103
|
+
return {
|
|
104
|
+
...browser,
|
|
105
|
+
name: "Unknown",
|
|
106
|
+
version: "Unknown"
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
function mergeDeviceInfo(fallback, enhanced) {
|
|
111
|
+
return {
|
|
112
|
+
device: { model: enhanced.device?.model || fallback.device.model },
|
|
113
|
+
os: {
|
|
114
|
+
name: enhanced.os?.name || fallback.os.name,
|
|
115
|
+
version: enhanced.os?.version || fallback.os.version
|
|
116
|
+
},
|
|
117
|
+
browser: checkForUnbrandedBrowser({
|
|
118
|
+
name: enhanced.browser?.name || fallback.browser.name,
|
|
119
|
+
version: enhanced.browser?.version || fallback.browser.version
|
|
120
|
+
})
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
function isUserAgentClientHintsSupported(navigator$1) {
|
|
124
|
+
return Boolean(navigator$1.userAgentData?.getHighEntropyValues && typeof navigator$1.userAgentData.getHighEntropyValues === "function");
|
|
125
|
+
}
|
|
126
|
+
async function getDeviceFingerprintInfo() {
|
|
127
|
+
if (typeof navigator === "undefined") return {
|
|
128
|
+
device: {},
|
|
129
|
+
os: {},
|
|
130
|
+
browser: {}
|
|
131
|
+
};
|
|
132
|
+
const customNavigator = navigator;
|
|
133
|
+
const fallbackInfo = getFallbackDeviceInfo();
|
|
134
|
+
if (!isUserAgentClientHintsSupported(customNavigator)) return fallbackInfo;
|
|
135
|
+
try {
|
|
136
|
+
return mergeDeviceInfo(fallbackInfo, await getHighEntropyDeviceInfo(customNavigator.userAgentData));
|
|
137
|
+
} catch {
|
|
138
|
+
return fallbackInfo;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
//#endregion
|
|
143
|
+
//#region ../infra/src/providers/browser/FingerprintProvider.ts
|
|
144
|
+
var FingerprintProvider = class {
|
|
145
|
+
constructor(ipLookup) {
|
|
146
|
+
this.ipLookup = ipLookup;
|
|
147
|
+
}
|
|
148
|
+
async getFingerprint(disableIpify = false) {
|
|
149
|
+
const visitorId = await getThumbmarkId();
|
|
150
|
+
const [deviceInfo, ip] = await Promise.all([getDeviceFingerprintInfo(), disableIpify ? Promise.resolve("") : this.ipLookup.getIp()]);
|
|
151
|
+
return {
|
|
152
|
+
visitorId,
|
|
153
|
+
ip,
|
|
154
|
+
deviceInfo
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
//#endregion
|
|
160
|
+
//#region src/internal/featureConfig/featureConfigService.ts
|
|
161
|
+
let cachedFeatures$1 = null;
|
|
162
|
+
/**
|
|
163
|
+
* Checks if a feature is enabled in the feature config.
|
|
164
|
+
*/
|
|
165
|
+
function isFeatureEnabled(feature, features) {
|
|
166
|
+
return features?.find((f) => f.feature === feature)?.enabled ?? false;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Fetches feature configuration from the backend.
|
|
170
|
+
* Results are cached for the session lifetime.
|
|
171
|
+
*/
|
|
172
|
+
async function fetchFeatureConfig(signal) {
|
|
173
|
+
if (cachedFeatures$1) return cachedFeatures$1;
|
|
174
|
+
const response = await api.get(endpoints.featureConfig, { signal });
|
|
175
|
+
if (!response.ok) throw new Error(`Failed to fetch feature config: ${response.status} ${response.statusText}`);
|
|
176
|
+
cachedFeatures$1 = response.data;
|
|
177
|
+
return cachedFeatures$1;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Resets the cached feature config (useful for testing).
|
|
181
|
+
*/
|
|
182
|
+
function resetFeatureConfigCache() {
|
|
183
|
+
cachedFeatures$1 = null;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
//#endregion
|
|
187
|
+
//#region src/internal/version/sdkVersion.ts
|
|
188
|
+
const SDK_VERSION = "2.1.0-rc.1";
|
|
189
|
+
|
|
190
|
+
//#endregion
|
|
191
|
+
//#region src/internal/fingerprint/fingerprintService.ts
|
|
192
|
+
function formatOsVersion(os) {
|
|
193
|
+
return `${os.name || "Unknown"} ${os.version || ""}`.trim();
|
|
194
|
+
}
|
|
195
|
+
function formatBrowser(browser) {
|
|
196
|
+
if (!browser.name || !browser.version) return "Unknown";
|
|
197
|
+
return `${browser.name} ${browser.version}`;
|
|
198
|
+
}
|
|
199
|
+
async function submitDeviceFingerprint(options = {}, dependencies) {
|
|
200
|
+
const { disableIpify = false, hostingApp, signal } = options;
|
|
201
|
+
const fingerprint = await dependencies.fingerprintProvider.getFingerprint(disableIpify);
|
|
202
|
+
const hasLiedBrowser = isBrowserSimulation(dependencies.browserEnv);
|
|
203
|
+
const payload = {
|
|
204
|
+
hash: fingerprint.visitorId || "",
|
|
205
|
+
ip: fingerprint.ip || "",
|
|
206
|
+
deviceType: "WEBAPP",
|
|
207
|
+
data: JSON.stringify(fingerprint),
|
|
208
|
+
osVersion: formatOsVersion(fingerprint.deviceInfo.os),
|
|
209
|
+
deviceModel: fingerprint.deviceInfo.device.model || "",
|
|
210
|
+
browser: formatBrowser(fingerprint.deviceInfo.browser),
|
|
211
|
+
hasLiedBrowser,
|
|
212
|
+
sdkVersion: SDK_VERSION,
|
|
213
|
+
hostingApp: hostingApp ?? "Web SDK"
|
|
214
|
+
};
|
|
215
|
+
const response = await api.post(endpoints.deviceFingerprint, payload, { signal });
|
|
216
|
+
if (!response.ok) throw new Error(`Failed to submit fingerprint: ${response.status} ${response.statusText}`);
|
|
217
|
+
return response.data;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
//#endregion
|
|
221
|
+
//#region src/internal/session/sessionInitializer.ts
|
|
222
|
+
let sessionInitialized = false;
|
|
223
|
+
let cachedFeatures = null;
|
|
224
|
+
let cachedDisableIpify = false;
|
|
225
|
+
let clientIpLookupEnabled = true;
|
|
226
|
+
function setClientIpLookupEnabled(enabled) {
|
|
227
|
+
clientIpLookupEnabled = enabled;
|
|
228
|
+
}
|
|
229
|
+
function resolveDisableIpify(serverDisableIpify) {
|
|
230
|
+
return !clientIpLookupEnabled || serverDisableIpify;
|
|
231
|
+
}
|
|
232
|
+
let cachedFingerprintSuccess = false;
|
|
233
|
+
let cachedFingerprintResult;
|
|
234
|
+
let sessionInitPromise = null;
|
|
235
|
+
/**
|
|
236
|
+
* Activates a session by setting the auth token on the HTTP client and
|
|
237
|
+
* preloading session-scoped state.
|
|
238
|
+
*
|
|
239
|
+
* Performs:
|
|
240
|
+
* 1. Sets the token (and clears stale session-init cache if the token changed)
|
|
241
|
+
* 2. Fetches feature configuration from backend
|
|
242
|
+
* 3. Submits device fingerprint
|
|
243
|
+
* 4. Starts the analytics batcher so buffered events are flushed
|
|
244
|
+
*
|
|
245
|
+
* Results are cached per token. Calling again with the same token returns the
|
|
246
|
+
* cached result; calling with a different token re-initializes from scratch.
|
|
247
|
+
*
|
|
248
|
+
* @param options - Session activation options (`token` required)
|
|
249
|
+
* @returns Session initialization result with feature config
|
|
250
|
+
*
|
|
251
|
+
* @example
|
|
252
|
+
* ```ts
|
|
253
|
+
* await setup({ apiURL: 'https://api.incode.com' });
|
|
254
|
+
* const session = await createSession('api-key', options);
|
|
255
|
+
* const { features } = await initializeSession({ token: session.token });
|
|
256
|
+
*
|
|
257
|
+
* // Check feature flags
|
|
258
|
+
* if (isFeatureEnabled('DISABLE_IPIFY', features.features)) {
|
|
259
|
+
* // Handle disabled ipify
|
|
260
|
+
* }
|
|
261
|
+
* ```
|
|
262
|
+
*/
|
|
263
|
+
async function initializeSession(options = {}) {
|
|
264
|
+
const { token, hostingApp, signal } = options;
|
|
265
|
+
if (token !== void 0 && token !== getToken()) {
|
|
266
|
+
setToken(token);
|
|
267
|
+
resetSessionInit();
|
|
268
|
+
}
|
|
269
|
+
if (sessionInitialized && cachedFeatures) return {
|
|
270
|
+
features: cachedFeatures,
|
|
271
|
+
disableIpify: cachedDisableIpify,
|
|
272
|
+
fingerprintSuccess: cachedFingerprintSuccess,
|
|
273
|
+
fingerprintResult: cachedFingerprintResult
|
|
274
|
+
};
|
|
275
|
+
if (sessionInitPromise) return sessionInitPromise;
|
|
276
|
+
sessionInitPromise = (async () => {
|
|
277
|
+
let features;
|
|
278
|
+
let serverDisableIpify = false;
|
|
279
|
+
try {
|
|
280
|
+
features = await fetchFeatureConfig(signal);
|
|
281
|
+
serverDisableIpify = isFeatureEnabled("DISABLE_IPIFY", features.features);
|
|
282
|
+
} catch {
|
|
283
|
+
features = { sessionIdentifier: "" };
|
|
284
|
+
}
|
|
285
|
+
const disableIpify = resolveDisableIpify(serverDisableIpify);
|
|
286
|
+
let fingerprintSuccess = false;
|
|
287
|
+
let fingerprintResult;
|
|
288
|
+
try {
|
|
289
|
+
const fingerprintProvider = new FingerprintProvider(new IpifyProvider());
|
|
290
|
+
const browserEnv = new BrowserEnvironmentProvider();
|
|
291
|
+
fingerprintResult = await submitDeviceFingerprint({
|
|
292
|
+
disableIpify,
|
|
293
|
+
hostingApp,
|
|
294
|
+
signal
|
|
295
|
+
}, {
|
|
296
|
+
fingerprintProvider,
|
|
297
|
+
browserEnv
|
|
298
|
+
});
|
|
299
|
+
fingerprintSuccess = true;
|
|
300
|
+
flushDeviceStatsQueue();
|
|
301
|
+
} catch (error) {
|
|
302
|
+
console.warn("Failed to submit device fingerprint:", error);
|
|
303
|
+
}
|
|
304
|
+
try {
|
|
305
|
+
const browserInfo = new BrowserInfoProvider().getBrowserInfo();
|
|
306
|
+
addEvent({
|
|
307
|
+
code: "browser",
|
|
308
|
+
payload: {
|
|
309
|
+
userAgent: browserInfo.userAgent,
|
|
310
|
+
isWebRtcSupported: browserInfo.isWebRtcSupported,
|
|
311
|
+
browser: browserInfo.browser,
|
|
312
|
+
os: browserInfo.os,
|
|
313
|
+
device: browserInfo.device,
|
|
314
|
+
engine: browserInfo.engine,
|
|
315
|
+
cpu: browserInfo.cpu
|
|
316
|
+
}
|
|
317
|
+
});
|
|
318
|
+
} catch (error) {
|
|
319
|
+
console.warn("Failed to send browser info event:", error);
|
|
320
|
+
}
|
|
321
|
+
sessionInitialized = true;
|
|
322
|
+
cachedFeatures = features;
|
|
323
|
+
cachedDisableIpify = disableIpify;
|
|
324
|
+
cachedFingerprintSuccess = fingerprintSuccess;
|
|
325
|
+
cachedFingerprintResult = fingerprintResult;
|
|
326
|
+
return {
|
|
327
|
+
features,
|
|
328
|
+
disableIpify,
|
|
329
|
+
fingerprintSuccess,
|
|
330
|
+
fingerprintResult
|
|
331
|
+
};
|
|
332
|
+
})().finally(() => {
|
|
333
|
+
sessionInitPromise = null;
|
|
334
|
+
getAnalyticsBatcher()?.start();
|
|
335
|
+
});
|
|
336
|
+
return sessionInitPromise;
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* Gets the cached disableIpify flag.
|
|
340
|
+
* Returns false if session hasn't been initialized.
|
|
341
|
+
*/
|
|
342
|
+
function getDisableIpify() {
|
|
343
|
+
if (!clientIpLookupEnabled) return true;
|
|
344
|
+
return cachedDisableIpify;
|
|
345
|
+
}
|
|
346
|
+
function getSessionFingerprintResult() {
|
|
347
|
+
return cachedFingerprintResult;
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* Resets session initialization state.
|
|
351
|
+
* Useful for testing or when starting a new session.
|
|
352
|
+
*/
|
|
353
|
+
function resetSessionInit() {
|
|
354
|
+
sessionInitialized = false;
|
|
355
|
+
cachedFeatures = null;
|
|
356
|
+
cachedDisableIpify = false;
|
|
357
|
+
cachedFingerprintSuccess = false;
|
|
358
|
+
cachedFingerprintResult = void 0;
|
|
359
|
+
sessionInitPromise = null;
|
|
360
|
+
resetFeatureConfigCache();
|
|
361
|
+
resetIpifyCache();
|
|
362
|
+
resetDeviceStatsQueue();
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
//#endregion
|
|
366
|
+
export { setClientIpLookupEnabled as a, resetSessionInit as i, getSessionFingerprintResult as n, FingerprintProvider as o, initializeSession as r, getDeviceFingerprintInfo as s, getDisableIpify as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as WasmPipeline } from "./warmup-
|
|
1
|
+
import { n as WasmPipeline } from "./warmup-Dg8Lh-50.js";
|
|
2
2
|
|
|
3
3
|
//#region src/setup.d.ts
|
|
4
4
|
|
|
@@ -6,6 +6,17 @@ import { n as WasmPipeline } from "./warmup-CEcppFiS.js";
|
|
|
6
6
|
* WASM warmup configuration. Path fields are optional; omitted values resolve to the Incode CDN defaults.
|
|
7
7
|
*/
|
|
8
8
|
type WasmConfig = {
|
|
9
|
+
/**
|
|
10
|
+
* Self-hosted WASM root directory. Resolves standard ml-wasm-kit filenames
|
|
11
|
+
* under this path (`webLib.wasm`, `webLib.js`, `models/`, etc.). Pin a
|
|
12
|
+
* specific version folder when self-hosting so SDK updates do not change
|
|
13
|
+
* which binaries your app loads until you update this path.
|
|
14
|
+
*
|
|
15
|
+
* Example: `https://my-cdn.example.com/ml-wasm-kit-release/v2.13.21`
|
|
16
|
+
*
|
|
17
|
+
* Individual path fields override values derived from `basePath`.
|
|
18
|
+
*/
|
|
19
|
+
basePath?: string;
|
|
9
20
|
/** Path to the WASM binary */
|
|
10
21
|
wasmPath?: string;
|
|
11
22
|
/** Path to the SIMD-optimized WASM binary (optional) */
|
|
@@ -26,6 +37,14 @@ type WasmConfig = {
|
|
|
26
37
|
* If not provided, models are expected in a 'models' subdirectory relative to the WASM binary.
|
|
27
38
|
*/
|
|
28
39
|
modelsBasePath?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Enables the WASM module's verbose debug logging/console output.
|
|
42
|
+
*
|
|
43
|
+
* Defaults to `false` — the SDK forces WASM into production mode, so the
|
|
44
|
+
* native module stays quiet. Set to `true` only when you need the WASM
|
|
45
|
+
* diagnostics while debugging.
|
|
46
|
+
*/
|
|
47
|
+
showLogs?: boolean;
|
|
29
48
|
};
|
|
30
49
|
/**
|
|
31
50
|
* Object form of the `encryption` option for {@link SetupOptions}. Reach for
|
|
@@ -92,6 +111,18 @@ type SetupOptions = {
|
|
|
92
111
|
* handshake at `setup()`. Coordinate with your Incode account team before
|
|
93
112
|
* flipping this on.
|
|
94
113
|
*
|
|
114
|
+
* **API key transmission.** E2EE requests must identify the tenant in one
|
|
115
|
+
* of two ways:
|
|
116
|
+
* - Append `/0` to the `apiURL` (e.g. `https://<e2ee-host>/0`) — the
|
|
117
|
+
* trailing `/0` instructs the server to derive the API key from the
|
|
118
|
+
* session JWT. Use this whenever a session token is in play.
|
|
119
|
+
* - Pass `customHeaders: { 'x-api-key': '<api key>' }` — required when
|
|
120
|
+
* the `apiURL` does not include `/0` (sessionless setup, or any flow
|
|
121
|
+
* that supplies the API key in the header instead of via JWT).
|
|
122
|
+
*
|
|
123
|
+
* Without one of these the server cannot identify the tenant and
|
|
124
|
+
* post-handshake requests fail.
|
|
125
|
+
*
|
|
95
126
|
* Accepts:
|
|
96
127
|
* - `true` → enabled with the default OAEP MGF1 hash (`'sha1'`).
|
|
97
128
|
* - `false` (or omitted) → disabled.
|
|
@@ -122,6 +153,27 @@ type SetupOptions = {
|
|
|
122
153
|
encryption?: boolean | EncryptionOptions;
|
|
123
154
|
/** Optional hosting app identifier for fingerprint tracking */
|
|
124
155
|
hostingApp?: string;
|
|
156
|
+
/**
|
|
157
|
+
* Disables the third-party public-IP lookup (`api.ipify.org`) used to
|
|
158
|
+
* enrich fingerprint and deepsight payloads. When `false`, the SDK uses
|
|
159
|
+
* an empty IP string and never hits ipify.
|
|
160
|
+
*
|
|
161
|
+
* OR'd with the server-side `DISABLE_IPIFY` feature flag. Default: `true`
|
|
162
|
+
* (lookup enabled).
|
|
163
|
+
*/
|
|
164
|
+
ipLookup?: boolean;
|
|
165
|
+
/**
|
|
166
|
+
* Disables the browser devtools detector for local development. When `true`,
|
|
167
|
+
* the detector is **not** started, so devtools no longer gets repeatedly
|
|
168
|
+
* paused on the detector's `debugger` statements.
|
|
169
|
+
*
|
|
170
|
+
* Leave this `false` (default) in production: the detector feeds an
|
|
171
|
+
* anti-fraud signal and should stay on for real users.
|
|
172
|
+
*
|
|
173
|
+
* Note: WASM console logging is controlled separately via `wasm.showLogs`
|
|
174
|
+
* (off by default).
|
|
175
|
+
*/
|
|
176
|
+
devMode?: boolean;
|
|
125
177
|
};
|
|
126
178
|
/**
|
|
127
179
|
* Initializes the SDK with the provided configuration.
|
|
@@ -165,13 +217,12 @@ type SetupOptions = {
|
|
|
165
217
|
* });
|
|
166
218
|
* ```
|
|
167
219
|
*
|
|
168
|
-
* @example Self-hosted
|
|
220
|
+
* @example Self-hosted WASM (pin a version folder on your CDN)
|
|
169
221
|
* ```ts
|
|
170
222
|
* await setup({
|
|
171
223
|
* apiURL: 'https://api.incode.com',
|
|
172
224
|
* wasm: {
|
|
173
|
-
*
|
|
174
|
-
* glueCodePath: '/my-cdn/webLib.js',
|
|
225
|
+
* basePath: 'https://my-cdn.example.com/ml-wasm-kit-release/v2.13.21',
|
|
175
226
|
* },
|
|
176
227
|
* });
|
|
177
228
|
* ```
|
|
@@ -197,16 +248,45 @@ type SetupOptions = {
|
|
|
197
248
|
*
|
|
198
249
|
* @example Enable end-to-end encryption at boot (defaults to MGF1 = SHA-1)
|
|
199
250
|
* ```ts
|
|
200
|
-
*
|
|
251
|
+
* // `/0` lets the server read the API key from the session JWT.
|
|
252
|
+
* await setup({
|
|
253
|
+
* apiURL: 'https://your-e2ee-api.incodesmile.com/0',
|
|
254
|
+
* encryption: true,
|
|
255
|
+
* });
|
|
201
256
|
* ```
|
|
202
257
|
*
|
|
203
258
|
* @example Enable encryption with the SHA-256 MGF1 padding
|
|
204
259
|
* ```ts
|
|
205
260
|
* await setup({
|
|
206
|
-
* apiURL: 'https://api.
|
|
261
|
+
* apiURL: 'https://your-e2ee-api.incodesmile.com/0',
|
|
207
262
|
* encryption: { mgf1: 'sha256' },
|
|
208
263
|
* });
|
|
209
264
|
* ```
|
|
265
|
+
*
|
|
266
|
+
* @example E2EE without the `/0` suffix — pass the API key explicitly
|
|
267
|
+
* ```ts
|
|
268
|
+
* await setup({
|
|
269
|
+
* apiURL: 'https://your-e2ee-api.incodesmile.com',
|
|
270
|
+
* encryption: true,
|
|
271
|
+
* customHeaders: { 'x-api-key': process.env.INCODE_API_KEY },
|
|
272
|
+
* });
|
|
273
|
+
* ```
|
|
274
|
+
* @example Disable third-party IP lookup
|
|
275
|
+
* ```ts
|
|
276
|
+
* await setup({
|
|
277
|
+
* apiURL: 'https://api.incode.com',
|
|
278
|
+
* ipLookup: false,
|
|
279
|
+
* });
|
|
280
|
+
* ```
|
|
281
|
+
*
|
|
282
|
+
* @example Local development: silence the devtools detector and surface WASM logs
|
|
283
|
+
* ```ts
|
|
284
|
+
* await setup({
|
|
285
|
+
* apiURL: 'https://api.incode.com',
|
|
286
|
+
* wasm: { showLogs: true }, // WASM logs are off by default
|
|
287
|
+
* devMode: true, // skip the devtools detector (don't ship this in prod)
|
|
288
|
+
* });
|
|
289
|
+
* ```
|
|
210
290
|
*/
|
|
211
291
|
declare function setup(options: SetupOptions): Promise<void>;
|
|
212
292
|
/**
|