@incodetech/core 2.0.1 → 2.1.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (218) hide show
  1. package/dist/{BrowserStorageProvider-CuOW1Er2.esm.js → BrowserStorageProvider-BpJM-gIl.esm.js} +8 -1
  2. package/dist/{IpifyProvider-D7jx52AL.esm.js → IpifyProvider-D4LWD15E.esm.js} +28 -0
  3. package/dist/{MotionSensorProvider-4v7xkqAp.esm.js → MotionSensorProvider-Bx7Mpzt0.esm.js} +63 -13
  4. package/dist/{OpenViduRecordingProvider-CMu6XVdc.esm.js → OpenViduRecordingProvider-O4GjBseO.esm.js} +1 -1
  5. package/dist/StateMachine-BC_nGvrc.d.ts +2 -0
  6. package/dist/StreamCanvasCapture-ImiDQdVA.esm.js +118 -0
  7. package/dist/StreamCanvasCapture-yyl20qd9.d.ts +152 -0
  8. package/dist/{BaseWasmProvider-C_DLEI40.esm.js → WasmUtilProvider-CiEN7Gjn.esm.js} +183 -11
  9. package/dist/{addressSearch-BpTbTWCa.esm.js → addressSearch-DvmWXKZg.esm.js} +63 -57
  10. package/dist/{ae-signature-DDDZmWXj.esm.js → ae-signature-BFZta3TZ.esm.js} +1 -1
  11. package/dist/ae-signature.d.ts +3 -3
  12. package/dist/ae-signature.esm.js +6 -5
  13. package/dist/antifraud.d.ts +5 -46
  14. package/dist/antifraud.esm.js +6 -43
  15. package/dist/antifraudManager-CkV4u-LE.esm.js +55 -0
  16. package/dist/antifraudManager-CznnhyvD.d.ts +63 -0
  17. package/dist/{antifraudStateMachine-O0TMf6yc.esm.js → antifraudStateMachine-Ccrb-Jxc.esm.js} +2 -2
  18. package/dist/apiError-B-j-gyDx.esm.js +51 -0
  19. package/dist/authentication.d.ts +13 -11
  20. package/dist/authentication.esm.js +26 -22
  21. package/dist/{authenticationManager-C83GNIhl.d.ts → authenticationManager-CIVY80H9.d.ts} +4 -4
  22. package/dist/{authenticationManager-5M-fKzXx.esm.js → authenticationManager-ZNotsWnC.esm.js} +6 -6
  23. package/dist/{authenticationStateMachine-BMZqatiF.esm.js → authenticationStateMachine-DksVbF_H.esm.js} +21 -9
  24. package/dist/{backCameraStream-DMdMeGk2.esm.js → backCameraStream-D7Wo4Nbx.esm.js} +95 -7
  25. package/dist/{session-CrkWAs-q.esm.js → browserSimulation-B1dWiXp7.esm.js} +61 -476
  26. package/dist/camera.d.ts +4 -3
  27. package/dist/camera.esm.js +4 -3
  28. package/dist/canvas-SKcRBxsk.esm.js +230 -0
  29. package/dist/consent.d.ts +4 -398
  30. package/dist/consent.esm.js +6 -77
  31. package/dist/consentManager-BLd51QiW.d.ts +419 -0
  32. package/dist/consentManager-BYo9Nu1r.esm.js +90 -0
  33. package/dist/{consentStateMachine-CCT-B60O.esm.js → consentStateMachine-BG3yL8aC.esm.js} +9 -6
  34. package/dist/cpf-ocr.d.ts +4 -199
  35. package/dist/cpf-ocr.esm.js +8 -177
  36. package/dist/cpfOcrManager-BnieFXuG.d.ts +216 -0
  37. package/dist/cpfOcrManager-sSKegxox.esm.js +190 -0
  38. package/dist/cross-document-data-match.d.ts +1 -1
  39. package/dist/cross-document-data-match.esm.js +4 -4
  40. package/dist/curp-validation.d.ts +8 -158
  41. package/dist/curp-validation.esm.js +6 -108
  42. package/dist/curpValidationManager-CFem6zP9.esm.js +122 -0
  43. package/dist/curpValidationManager-RttixpIc.d.ts +184 -0
  44. package/dist/{curpValidationStateMachine-CitWLr2c.esm.js → curpValidationStateMachine-B7V_qp66.esm.js} +20 -13
  45. package/dist/custom-fields.d.ts +2 -2
  46. package/dist/custom-fields.esm.js +4 -4
  47. package/dist/custom-watchlist.d.ts +1 -1
  48. package/dist/custom-watchlist.esm.js +4 -41
  49. package/dist/customWatchlistStateMachine-HmFybXLX.esm.js +50 -0
  50. package/dist/{deepsightLoader-Cm4JIT_z.esm.js → deepsightLoader-65k1Appi.esm.js} +19 -10
  51. package/dist/{deepsightService-CEVxzehb.d.ts → deepsightService-B7ShOkWL.d.ts} +8 -160
  52. package/dist/deepsightService-CrHmvx8X.esm.js +276 -0
  53. package/dist/device.esm.js +4 -3
  54. package/dist/document-capture.d.ts +995 -86
  55. package/dist/document-capture.esm.js +34 -8
  56. package/dist/document-upload.d.ts +47 -47
  57. package/dist/document-upload.esm.js +7 -7
  58. package/dist/{documentCaptureStateMachine-BqzTDy9k.esm.js → documentCaptureStateMachine-WYV1r9le.esm.js} +90 -6
  59. package/dist/dynamic-forms.d.ts +20 -5
  60. package/dist/dynamic-forms.esm.js +150 -61
  61. package/dist/ekyb.d.ts +32 -13
  62. package/dist/ekyb.esm.js +25 -15
  63. package/dist/{ekybStateMachine-CyMx_kg-.esm.js → ekybStateMachine-aYixw2sL.esm.js} +319 -207
  64. package/dist/ekyc.d.ts +10 -78
  65. package/dist/ekyc.esm.js +17 -12
  66. package/dist/{ekycStateMachine-oeO0Iekd.esm.js → ekycStateMachine-CXbpaJJn.esm.js} +201 -113
  67. package/dist/electronic-signature.d.ts +3 -3
  68. package/dist/electronic-signature.esm.js +5 -4
  69. package/dist/{electronicSignatureManager-D9OHzTpG.esm.js → electronicSignatureManager-BaECdJ1u.esm.js} +91 -23
  70. package/dist/email.d.ts +4 -3
  71. package/dist/email.esm.js +6 -5
  72. package/dist/{emailManager-wAV0LE-H.esm.js → emailManager--D5G3ChB.esm.js} +30 -7
  73. package/dist/{emailManager-DIfnS5g1.d.ts → emailManager-lAzDoQOs.d.ts} +66 -8
  74. package/dist/{emailStateMachine-DOf4j58N.esm.js → emailStateMachine-CxTOMAjC.esm.js} +46 -11
  75. package/dist/{endpoints-CnN3SyDa.esm.js → endpoints-BeTK0Mlt.esm.js} +6 -3
  76. package/dist/{events-D6-e4vok.esm.js → events-Dvvriq9l.esm.js} +3 -1
  77. package/dist/events.d.ts +2 -0
  78. package/dist/events.esm.js +1 -1
  79. package/dist/extensibility.d.ts +32 -16
  80. package/dist/extensibility.esm.js +55 -33
  81. package/dist/face-match.d.ts +32 -2
  82. package/dist/face-match.esm.js +5 -5
  83. package/dist/{faceCaptureManagerFactory-yqtpxjnN.d.ts → faceCaptureManagerFactory-C_hRHx8a.d.ts} +35 -11
  84. package/dist/{faceCaptureManagerFactory-Dh2PdGlF.esm.js → faceCaptureManagerFactory-kqbUqtrr.esm.js} +21 -5
  85. package/dist/{faceCaptureSetup-B3faSpYA.esm.js → faceCaptureSetup-CtvHWd3x.esm.js} +68 -183
  86. package/dist/{faceMatchStateMachine-DNFrxTFS.esm.js → faceMatchStateMachine-DdGXUBnx.esm.js} +60 -6
  87. package/dist/field-comparison.d.ts +4 -0
  88. package/dist/field-comparison.esm.js +7 -0
  89. package/dist/fieldComparisonManager-Bu5TaSr3.d.ts +76 -0
  90. package/dist/fieldComparisonManager-COGI2ARD.esm.js +162 -0
  91. package/dist/fiscal-qr.d.ts +59 -0
  92. package/dist/fiscal-qr.esm.js +323 -0
  93. package/dist/flow-events.d.ts +6 -5
  94. package/dist/flow.d.ts +23 -15
  95. package/dist/flow.esm.js +63 -17
  96. package/dist/flowCompletionService-BdR2cGgB.d.ts +19 -0
  97. package/dist/flowCompletionService-DdGojV9K.esm.js +20 -0
  98. package/dist/{flowServices-PiNsxLfK.esm.js → flowServices-BTuHLHVr.esm.js} +10 -5
  99. package/dist/geolocation.d.ts +4 -4
  100. package/dist/geolocation.esm.js +6 -6
  101. package/dist/{geolocationStateMachine-asasuHY2.esm.js → geolocationStateMachine-Dvh7X0wF.esm.js} +5 -5
  102. package/dist/getBrowser-C8DP7oTB.esm.js +8 -0
  103. package/dist/{getBrowser-BSXUTWXw.esm.js → getDeviceClass-C0olyNFS.esm.js} +1 -8
  104. package/dist/{getDeviceClass-BSntT9_j.esm.js → getDeviceClass-C8Do2qYu.esm.js} +1 -1
  105. package/dist/government-validation.d.ts +28 -8
  106. package/dist/government-validation.esm.js +19 -8
  107. package/dist/{governmentValidationStateMachine-BDDYrJTo.esm.js → governmentValidationStateMachine-DcJ-BfsC.esm.js} +35 -77
  108. package/dist/home.d.ts +15 -14
  109. package/dist/home.esm.js +2 -2
  110. package/dist/http-Cai3IoLS.esm.js +0 -0
  111. package/dist/http.esm.js +1 -0
  112. package/dist/id-ocr.d.ts +54 -54
  113. package/dist/id-ocr.esm.js +5 -5
  114. package/dist/id-verification.d.ts +27 -27
  115. package/dist/id-verification.esm.js +4 -4
  116. package/dist/id.d.ts +12 -10
  117. package/dist/id.esm.js +36 -26
  118. package/dist/{idCaptureManager-Fyd0eam-.d.ts → idCaptureManager-D-QYESvF.d.ts} +28 -14
  119. package/dist/{idCaptureManager-D0ktk7Hh.esm.js → idCaptureManager-DGVv5l1_.esm.js} +22 -7
  120. package/dist/{idCaptureStateMachine-dwlBUjbC.esm.js → idCaptureStateMachine-DHi7HydI.esm.js} +172 -123
  121. package/dist/{idOcrStateMachine-YbjjC_Gg.esm.js → idOcrStateMachine-CDQ5d_VM.esm.js} +4 -4
  122. package/dist/{idVerificationStateMachine-xbw9HP1Z.esm.js → idVerificationStateMachine-kRxwImzO.esm.js} +2 -2
  123. package/dist/identity-reuse.d.ts +4 -530
  124. package/dist/identity-reuse.esm.js +8 -274
  125. package/dist/identityReuseManager-C6n_97dw.esm.js +95 -0
  126. package/dist/identityReuseManager-DwLtVzUn.d.ts +428 -0
  127. package/dist/identityReuseStateMachine-BfE5YiEr.esm.js +148 -0
  128. package/dist/{index-BcRG8rtJ.d.ts → index-B5hPA0Bg.d.ts} +2 -2
  129. package/dist/{index-ChHWNH48.d.ts → index-B9NysVDB.d.ts} +469 -195
  130. package/dist/index.d.ts +2 -2
  131. package/dist/index.esm.js +10 -8
  132. package/dist/{invokeOnCaptureCallback-rc6kBHo5.esm.js → invokeOnCaptureCallback-ygByVdnn.esm.js} +1 -1
  133. package/dist/{lib-BB0B_qQX.esm.js → lib-BY67lgbq.esm.js} +1 -1
  134. package/dist/mandatory-consent.d.ts +8 -412
  135. package/dist/mandatory-consent.esm.js +6 -76
  136. package/dist/mandatoryConsentManager-H6D18cZB.esm.js +89 -0
  137. package/dist/mandatoryConsentManager-KfIlURRY.d.ts +429 -0
  138. package/dist/{mandatoryConsentStateMachine-Cnco1jvn.esm.js → mandatoryConsentStateMachine-DtQNW1ji.esm.js} +6 -6
  139. package/dist/openviduLazy-B8L--0oe.esm.js +3 -0
  140. package/dist/{openviduLazy-Cok70ZSg.esm.js → openviduLazy-Dh14JNJc.esm.js} +2 -2
  141. package/dist/otp-CGMdUzBC.esm.js +33 -0
  142. package/dist/otp-DF5A0sFx.d.ts +8 -0
  143. package/dist/permissionGuards-C1ispV96.esm.js +23 -0
  144. package/dist/permissionServices-CG3bMSfG.esm.js +130 -0
  145. package/dist/phone.d.ts +4 -3
  146. package/dist/phone.esm.js +6 -5
  147. package/dist/{phoneManager-DAJbGhlY.esm.js → phoneManager-BmF-0Ez4.esm.js} +30 -7
  148. package/dist/{phoneManager-B6M30hKE.d.ts → phoneManager-fPmIBYQK.d.ts} +65 -7
  149. package/dist/{phoneStateMachine-CuPARRaT.esm.js → phoneStateMachine-BiV0yoEx.esm.js} +46 -11
  150. package/dist/{qe-signature-DFo_Cc-I.esm.js → qe-signature-CUYPcHVo.esm.js} +1 -1
  151. package/dist/qe-signature.d.ts +3 -3
  152. package/dist/qe-signature.esm.js +6 -5
  153. package/dist/{recordingService-Ig2UgbLv.esm.js → recordingService-Bn9EdCmz.esm.js} +197 -179
  154. package/dist/redirect-to-mobile.d.ts +6 -104
  155. package/dist/redirect-to-mobile.esm.js +6 -99
  156. package/dist/redirectToMobileManager-BNe3IzC_.d.ts +178 -0
  157. package/dist/redirectToMobileManager-Dy3t7o0C.esm.js +159 -0
  158. package/dist/{redirectToMobileStateMachine-BOEqe46A.esm.js → redirectToMobileStateMachine-DyAdRxfP.esm.js} +28 -19
  159. package/dist/{runChildModule-CqqwqAkW.esm.js → runChildModule-CuoHZ1cx.esm.js} +35 -3
  160. package/dist/selfie.d.ts +13 -11
  161. package/dist/selfie.esm.js +27 -23
  162. package/dist/{selfieManager-Duisl7qN.esm.js → selfieManager-BjCoKRy0.esm.js} +6 -6
  163. package/dist/{selfieManager-D0lSgd-J.d.ts → selfieManager-dUbKRzOh.d.ts} +4 -4
  164. package/dist/{selfieStateMachine-D76whWEf.esm.js → selfieStateMachine-b4F2q9zw.esm.js} +5 -3
  165. package/dist/session-DoVb-OcB.esm.js +152 -0
  166. package/dist/session.d.ts +37 -5
  167. package/dist/session.esm.js +12 -7
  168. package/dist/sessionInitializer-B8H5MsXM.esm.js +366 -0
  169. package/dist/{setup-C5AITV8m.d.ts → setup-BbkprdVv.d.ts} +57 -6
  170. package/dist/{setup-DPPAxmXf.esm.js → setup-BqEfrdja.esm.js} +162 -24
  171. package/dist/signature.d.ts +2 -2
  172. package/dist/signature.esm.js +4 -4
  173. package/dist/{signatureStateMachine-B5-QVUve.esm.js → signatureStateMachine-C5qqYLRz.esm.js} +3 -3
  174. package/dist/stats-BMNUG1AU.esm.js +41 -0
  175. package/dist/stats.d.ts +13 -2
  176. package/dist/stats.esm.js +3 -2
  177. package/dist/trust-graph.d.ts +33 -4
  178. package/dist/trust-graph.esm.js +21 -15
  179. package/dist/{types-CFV9G_7j.d.ts → types-Bj9hdFjU.d.ts} +1 -1
  180. package/dist/{types-BP1m8VRw.d.ts → types-DOUhndhT.d.ts} +14 -2
  181. package/dist/types-DsnEVMhr.esm.js +34 -0
  182. package/dist/types-DvGZI7BF.d.ts +131 -0
  183. package/dist/{types-B06Ypu2F.d.ts → types-NuT8ftBV.d.ts} +1 -1
  184. package/dist/types-ya0LN_MX.d.ts +5 -0
  185. package/dist/{warmup-CEcppFiS.d.ts → warmup-Dg8Lh-50.d.ts} +8 -0
  186. package/dist/wasm.d.ts +6 -4
  187. package/dist/wasm.esm.js +11 -9
  188. package/dist/watchlist-for-business.d.ts +1 -1
  189. package/dist/watchlist-for-business.esm.js +5 -73
  190. package/dist/watchlist.d.ts +1 -1
  191. package/dist/watchlist.esm.js +4 -41
  192. package/dist/watchlistForBusinessStateMachine-DMl8j2Ov.esm.js +74 -0
  193. package/dist/watchlistStateMachine-DmQlqI6L.esm.js +50 -0
  194. package/dist/workflow.d.ts +150 -97
  195. package/dist/workflow.esm.js +156 -80
  196. package/package.json +19 -1
  197. package/dist/StateMachine-BCQrZJhf.d.ts +0 -2
  198. package/dist/WasmUtilProvider-j98OJf-S.esm.js +0 -114
  199. package/dist/browserSimulation-gxD8cSpM.esm.js +0 -20
  200. package/dist/deepsightService-O74l4Y__.esm.js +0 -489
  201. package/dist/displayErrors-DqJ_IbsG.d.ts +0 -39
  202. package/dist/flowCompletionService-DhkT4SRY.d.ts +0 -10
  203. package/dist/flowCompletionService-P54yzGvA.esm.js +0 -13
  204. package/dist/openviduLazy-Cm0XFh_v.esm.js +0 -3
  205. package/dist/permissionServices-D_i6nzEw.esm.js +0 -50
  206. package/dist/stats-CIfiPzb1.esm.js +0 -16
  207. package/dist/types-CAD4va6a.d.ts +0 -5
  208. package/dist/watchlistServices-DMbUhkBX.esm.js +0 -12
  209. /package/dist/{Actor-CI32dTbG.d.ts → Actor-Y0_Fj-KL.d.ts} +0 -0
  210. /package/dist/{ITimerCapability-C67ZRskg.esm.js → ITimerCapability-CB0I1Uf2.esm.js} +0 -0
  211. /package/dist/{Manager-C8PrhBOx.d.ts → Manager-BHn8wH8K.d.ts} +0 -0
  212. /package/dist/{camera-PA2Ljri3.esm.js → camera-DJWm3V4g.esm.js} +0 -0
  213. /package/dist/{camera-DBSxa6ML.d.ts → camera-SRBpPq2X.d.ts} +0 -0
  214. /package/dist/{chunk-CRF6K_H_.esm.js → chunk-CMUKZ2uL.esm.js} +0 -0
  215. /package/dist/{cpf-PPz2Njto.esm.js → cpf-BRzggV8G.esm.js} +0 -0
  216. /package/dist/{dateUtils-UoN5xswP.esm.js → dateUtils-AksLQmgV.esm.js} +0 -0
  217. /package/dist/{platform-CfrjKhmi.esm.js → platform-SKvEfCBh.esm.js} +0 -0
  218. /package/dist/{xstate.esm-B70JrNqo.esm.js → xstate.esm-C9wncMQa.esm.js} +0 -0
@@ -1,154 +1,6 @@
1
- import { n as getApi, r as getToken, s as setToken, t as api } from "./api-CESGtpbH.esm.js";
2
- import { g as getAnalyticsBatcher, h as addEvent } from "./events-D6-e4vok.esm.js";
3
- import { t as endpoints } from "./endpoints-CnN3SyDa.esm.js";
4
- import { n as resetIpifyCache, r as BrowserEnvironmentProvider, t as IpifyProvider } from "./IpifyProvider-D7jx52AL.esm.js";
5
- import { t as isBrowserSimulation } from "./browserSimulation-gxD8cSpM.esm.js";
1
+ import { r as isIOS } from "./platform-SKvEfCBh.esm.js";
2
+ import { t as getUserAgent } from "./getBrowser-C8DP7oTB.esm.js";
6
3
 
7
- //#region src/internal/session/sessionService.ts
8
- /**
9
- * HTTP status codes the QR validation endpoint emits, keyed by their semantic
10
- * name. Hosts switch on these to render distinct messaging — `invalidQRuuid`
11
- * for an unknown/expired link, `onboardingUrlAlreadyUsed` for a one-time link
12
- * that has already been consumed.
13
- */
14
- const QR_VALIDATION_ERROR_CODES = {
15
- expiredUUID: 4026,
16
- invalidQRuuid: 4081,
17
- onboardingUrlAlreadyUsed: 4083
18
- };
19
- var QrValidationError = class extends Error {
20
- constructor(status, statusText) {
21
- super(`POST ${endpoints.qrValidateUuid} failed: ${status} ${statusText}`);
22
- this.name = "QrValidationError";
23
- this.status = status;
24
- this.statusText = statusText;
25
- }
26
- };
27
- /**
28
- * Creates a new onboarding session.
29
- *
30
- * @param apiKey - The API key from the Incode dashboard
31
- * @param options - Session creation options
32
- * @param signal - Optional AbortSignal for request cancellation
33
- * @returns The created session with token
34
- *
35
- * @example
36
- * ```ts
37
- * const session = await createSession('your-api-key', {
38
- * configurationId: 'your-flow-id',
39
- * language: 'en-US',
40
- * });
41
- * console.log(session.token); // Use this token for subsequent API calls
42
- * ```
43
- */
44
- async function createSession(apiKey, options, signal) {
45
- const res = await getApi().post(endpoints.createSession, {
46
- configurationId: options.configurationId,
47
- externalId: options.externalId,
48
- externalCustomerId: options.externalCustomerId,
49
- language: options.language ?? "en-US",
50
- customFields: options.customFields,
51
- uuid: options.uuid ?? null,
52
- urlUuid: options.urlUuid ?? null,
53
- interviewId: options.interviewId ?? null,
54
- ...options.loginHint != null && options.loginHint !== "" ? { loginHint: options.loginHint } : {}
55
- }, {
56
- headers: {
57
- "x-api-key": apiKey,
58
- "api-version": "1.0"
59
- },
60
- signal
61
- });
62
- if (!res.ok) throw new Error(`POST ${endpoints.createSession} failed: ${res.status} ${res.statusText}`);
63
- return res.data;
64
- }
65
- /**
66
- * Validates and rotates a QR anti-phishing URL UUID before creating a session.
67
- *
68
- * This call is unauthenticated; the `{ onboardingId, urlUuid }` pair itself
69
- * acts as the credential. The server burns the incoming `urlUuid` and returns
70
- * a freshly minted one that must be used in the subsequent `createSession`
71
- * call.
72
- *
73
- * @param options - `{ onboardingId, urlUuid }` from the incoming URL
74
- * @param signal - Optional AbortSignal for request cancellation
75
- * @returns The refreshed `urlUuid` to use for the session
76
- * @throws {QrValidationError} When the server rejects the validation request.
77
- */
78
- async function validateQrUuid(options, signal) {
79
- try {
80
- return (await getApi().post(endpoints.qrValidateUuid, {
81
- onboardingId: options.onboardingId,
82
- urlUuid: options.urlUuid
83
- }, {
84
- headers: { "api-version": "1.0" },
85
- signal
86
- })).data;
87
- } catch (error) {
88
- const httpError = error;
89
- throw new QrValidationError(httpError.data?.status ?? httpError.status, httpError.statusText);
90
- }
91
- }
92
- /**
93
- * One-shot QR phishing-resistance helper.
94
- *
95
- * When `urlUuid` is a non-empty string, burns the stale value via
96
- * `validateQrUuid`, invokes `onRefreshed` with the fresh value, and returns
97
- * it so callers can forward it into `createSession`. When `urlUuid` is
98
- * absent, returns `undefined` without making any network call.
99
- *
100
- * Consolidates the rotation + callback logic shared by Flow self-loading and
101
- * Workflow token-mode bootstraps.
102
- *
103
- * @throws {QrValidationError} When the server rejects the validation request.
104
- */
105
- async function refreshQrUrlUuid(options, signal) {
106
- if (typeof options.urlUuid !== "string" || options.urlUuid.length === 0) return;
107
- const result = await validateQrUuid({
108
- onboardingId: options.onboardingId ?? null,
109
- urlUuid: options.urlUuid
110
- }, signal);
111
- options.onRefreshed?.(result.urlUuid);
112
- return result.urlUuid;
113
- }
114
- /**
115
- * Validates and rotates a QR anti-phishing `urlUuid` (when present), then
116
- * creates a session bound to the refreshed value. When `urlUuid` is absent,
117
- * behaves identically to {@link createSession}.
118
- *
119
- * Use this when the host owns session creation and wants the SDK to handle
120
- * phishing-resistance rotation in a single call. For raw control, compose
121
- * `refreshQrUrlUuid` and `createSession` directly.
122
- *
123
- * @throws {QrValidationError} When the server rejects the QR validation step.
124
- *
125
- * @example
126
- * ```ts
127
- * const session = await bootstrapSession(apiKey, {
128
- * configurationId,
129
- * urlUuid,
130
- * onUrlUuidRefreshed: (refreshed) => {
131
- * const url = new URL(window.location.href);
132
- * url.searchParams.set('url_uuid', refreshed);
133
- * window.history.replaceState({}, '', url);
134
- * },
135
- * });
136
- * ```
137
- */
138
- async function bootstrapSession(apiKey, options, signal) {
139
- const { onUrlUuidRefreshed, ...createSessionOptions } = options;
140
- const refreshedUrlUuid = await refreshQrUrlUuid({
141
- urlUuid: options.urlUuid,
142
- onboardingId: options.uuid ?? null,
143
- onRefreshed: onUrlUuidRefreshed
144
- }, signal);
145
- return createSession(apiKey, {
146
- ...createSessionOptions,
147
- urlUuid: refreshedUrlUuid
148
- }, signal);
149
- }
150
-
151
- //#endregion
152
4
  //#region ../../node_modules/.pnpm/ua-parser-js@2.0.9/node_modules/ua-parser-js/src/main/ua-parser.mjs
153
5
  var LIBVERSION = "2.0.9", UA_MAX_LENGTH = 500, USER_AGENT = "user-agent", EMPTY = "", UNKNOWN = "?", TYPEOF = {
154
6
  FUNCTION: "function",
@@ -1663,55 +1515,15 @@ UAParser.DEVICE = enumerize([
1663
1515
  UAParser.ENGINE = UAParser.OS = enumerize([NAME, VERSION]);
1664
1516
 
1665
1517
  //#endregion
1666
- //#region ../infra/src/providers/browser/BrowserInfoProvider.ts
1667
- var BrowserInfoProvider = class {
1668
- checkWebRtcSupport() {
1669
- if (typeof window === "undefined") return false;
1670
- const hasRTCPeerConnection = "RTCPeerConnection" in window || "webkitRTCPeerConnection" in window || "mozRTCPeerConnection" in window;
1671
- const hasGetUserMedia = typeof navigator !== "undefined" && navigator.mediaDevices?.getUserMedia !== void 0;
1672
- return hasRTCPeerConnection && hasGetUserMedia;
1673
- }
1674
- getBrowserInfo() {
1675
- const userAgent = typeof navigator !== "undefined" ? navigator.userAgent : "";
1676
- const result = new UAParser(userAgent).getResult();
1677
- return {
1678
- userAgent,
1679
- isWebRtcSupported: this.checkWebRtcSupport(),
1680
- browser: {
1681
- name: result.browser.name,
1682
- version: result.browser.version
1683
- },
1684
- os: {
1685
- name: result.os.name,
1686
- version: result.os.version
1687
- },
1688
- device: {
1689
- model: result.device.model,
1690
- type: result.device.type,
1691
- vendor: result.device.vendor
1692
- },
1693
- engine: {
1694
- name: result.engine.name,
1695
- version: result.engine.version
1696
- },
1697
- cpu: { architecture: result.cpu.architecture }
1698
- };
1699
- }
1700
- };
1701
-
1702
- //#endregion
1703
- //#region ../infra/src/device/getDeviceData.ts
1704
- const HIGH_ENTROPY_HINTS = new Set([
1705
- "model",
1706
- "platformVersion",
1707
- "fullVersionList",
1708
- "brands",
1709
- "platform"
1710
- ]);
1711
- function getFallbackDeviceInfo() {
1712
- const result = new UAParser().getResult();
1518
+ //#region ../infra/src/device/getParsedUserAgent.ts
1519
+ function getParsedUserAgent(userAgent) {
1520
+ const result = (userAgent ? new UAParser(userAgent) : new UAParser()).getResult();
1713
1521
  return {
1714
- device: { model: result.device.model },
1522
+ device: {
1523
+ model: result.device.model,
1524
+ vendor: result.device.vendor,
1525
+ type: result.device.type
1526
+ },
1715
1527
  os: {
1716
1528
  name: result.os.name,
1717
1529
  version: result.os.version
@@ -1722,80 +1534,6 @@ function getFallbackDeviceInfo() {
1722
1534
  }
1723
1535
  };
1724
1536
  }
1725
- function sanitizeString(value) {
1726
- return value?.trim() || void 0;
1727
- }
1728
- function extractPrimaryBrandInfo(fullVersionList, brands) {
1729
- const primaryBrand = fullVersionList?.[0] || brands?.[0];
1730
- return {
1731
- name: sanitizeString(primaryBrand?.brand),
1732
- version: sanitizeString(primaryBrand?.version)
1733
- };
1734
- }
1735
- async function getHighEntropyDeviceInfo(userAgentData) {
1736
- const highEntropyValues = await userAgentData.getHighEntropyValues(Array.from(HIGH_ENTROPY_HINTS));
1737
- const { name: browserName, version: browserVersion } = extractPrimaryBrandInfo(highEntropyValues.fullVersionList, userAgentData.brands);
1738
- return {
1739
- device: { model: sanitizeString(highEntropyValues.model) },
1740
- os: {
1741
- name: sanitizeString(highEntropyValues.platform),
1742
- version: sanitizeString(highEntropyValues.platformVersion)
1743
- },
1744
- browser: {
1745
- name: browserName,
1746
- version: browserVersion
1747
- }
1748
- };
1749
- }
1750
- const checkForUnbrandedBrowser = (browser) => {
1751
- const userAgent = typeof navigator !== "undefined" ? navigator.userAgent : "";
1752
- const fallback = getFallbackDeviceInfo();
1753
- if (!userAgent) return browser;
1754
- try {
1755
- return {
1756
- ...browser,
1757
- name: fallback.browser.name,
1758
- version: fallback.browser.version
1759
- };
1760
- } catch {
1761
- return {
1762
- ...browser,
1763
- name: "Unknown",
1764
- version: "Unknown"
1765
- };
1766
- }
1767
- };
1768
- function mergeDeviceInfo(fallback, enhanced) {
1769
- return {
1770
- device: { model: enhanced.device?.model || fallback.device.model },
1771
- os: {
1772
- name: enhanced.os?.name || fallback.os.name,
1773
- version: enhanced.os?.version || fallback.os.version
1774
- },
1775
- browser: checkForUnbrandedBrowser({
1776
- name: enhanced.browser?.name || fallback.browser.name,
1777
- version: enhanced.browser?.version || fallback.browser.version
1778
- })
1779
- };
1780
- }
1781
- function isUserAgentClientHintsSupported(navigator$1) {
1782
- return Boolean(navigator$1.userAgentData?.getHighEntropyValues && typeof navigator$1.userAgentData.getHighEntropyValues === "function");
1783
- }
1784
- async function getDeviceFingerprintInfo() {
1785
- if (typeof navigator === "undefined") return {
1786
- device: {},
1787
- os: {},
1788
- browser: {}
1789
- };
1790
- const customNavigator = navigator;
1791
- const fallbackInfo = getFallbackDeviceInfo();
1792
- if (!isUserAgentClientHintsSupported(customNavigator)) return fallbackInfo;
1793
- try {
1794
- return mergeDeviceInfo(fallbackInfo, await getHighEntropyDeviceInfo(customNavigator.userAgentData));
1795
- } catch {
1796
- return fallbackInfo;
1797
- }
1798
- }
1799
1537
 
1800
1538
  //#endregion
1801
1539
  //#region ../../node_modules/.pnpm/@thumbmarkjs+thumbmarkjs@1.6.4/node_modules/@thumbmarkjs/thumbmarkjs/dist/thumbmark.esm.js
@@ -2991,216 +2729,63 @@ async function getThumbmarkId() {
2991
2729
  }
2992
2730
 
2993
2731
  //#endregion
2994
- //#region ../infra/src/providers/browser/FingerprintProvider.ts
2995
- var FingerprintProvider = class {
2996
- constructor(ipLookup) {
2997
- this.ipLookup = ipLookup;
2732
+ //#region src/internal/device/hasLiedBrowser.ts
2733
+ function detectBrowserFromUserAgent(userAgent) {
2734
+ if (userAgent.indexOf("edge/") >= 0 || userAgent.indexOf("iemobile/") >= 0) return "Other";
2735
+ if (userAgent.indexOf("opera mini") >= 0) return "Other";
2736
+ if (userAgent.indexOf("firefox/") >= 0) return "Firefox";
2737
+ if (userAgent.indexOf("opera/") >= 0 || userAgent.indexOf(" opr/") >= 0) return "Opera";
2738
+ if (userAgent.indexOf("chrome/") >= 0) return "Chrome";
2739
+ if (userAgent.indexOf("safari/") >= 0) {
2740
+ if (userAgent.indexOf("android 1.") >= 0 || userAgent.indexOf("android 2.") >= 0 || userAgent.indexOf("android 3.") >= 0 || userAgent.indexOf("android 4.") >= 0) return "AOSP";
2741
+ return "Safari";
2998
2742
  }
2999
- async getFingerprint(disableIpify = false) {
3000
- const visitorId = await getThumbmarkId();
3001
- const [deviceInfo, ip] = await Promise.all([getDeviceFingerprintInfo(), disableIpify ? Promise.resolve("") : this.ipLookup.getIp()]);
3002
- return {
3003
- visitorId,
3004
- ip,
3005
- deviceInfo
3006
- };
3007
- }
3008
- };
3009
-
3010
- //#endregion
3011
- //#region src/internal/featureConfig/featureConfigService.ts
3012
- let cachedFeatures$1 = null;
3013
- /**
3014
- * Checks if a feature is enabled in the feature config.
3015
- */
3016
- function isFeatureEnabled(feature, features) {
3017
- return features?.find((f$1) => f$1.feature === feature)?.enabled ?? false;
3018
- }
3019
- /**
3020
- * Fetches feature configuration from the backend.
3021
- * Results are cached for the session lifetime.
3022
- */
3023
- async function fetchFeatureConfig(signal) {
3024
- if (cachedFeatures$1) return cachedFeatures$1;
3025
- const response = await api.get(endpoints.featureConfig, { signal });
3026
- if (!response.ok) throw new Error(`Failed to fetch feature config: ${response.status} ${response.statusText}`);
3027
- cachedFeatures$1 = response.data;
3028
- return cachedFeatures$1;
2743
+ if (userAgent.indexOf("trident/") >= 0) return "Internet Explorer";
2744
+ return "Other";
3029
2745
  }
3030
- /**
3031
- * Resets the cached feature config (useful for testing).
3032
- */
3033
- function resetFeatureConfigCache() {
3034
- cachedFeatures$1 = null;
2746
+ function hasLiedBrowser(browserEnv) {
2747
+ const userAgent = getUserAgent().toLowerCase();
2748
+ if (userAgent.indexOf("edge/") >= 0 || userAgent.indexOf("iemobile/") >= 0) return false;
2749
+ if (userAgent.indexOf("opera mini") >= 0) return false;
2750
+ const browser = detectBrowserFromUserAgent(userAgent);
2751
+ const productSub = browserEnv.getNavigatorProductSub();
2752
+ if ((browser === "Chrome" || browser === "Safari" || browser === "Opera") && productSub !== "20030107") return true;
2753
+ const evalLength = browserEnv.getEvalToStringLength();
2754
+ if (evalLength === 37 && browser !== "Safari" && browser !== "Firefox" && browser !== "Other") return true;
2755
+ if (evalLength === 39 && browser !== "Internet Explorer" && browser !== "Other") return true;
2756
+ if (evalLength === 33 && browser !== "Chrome" && browser !== "AOSP" && browser !== "Opera" && browser !== "Other") return true;
2757
+ return browserEnv.tryFirefoxToSource() && browser !== "Firefox" && browser !== "Other";
3035
2758
  }
3036
2759
 
3037
2760
  //#endregion
3038
- //#region src/internal/version/sdkVersion.ts
3039
- const SDK_VERSION = "2.0.1";
3040
-
3041
- //#endregion
3042
- //#region src/internal/fingerprint/fingerprintService.ts
3043
- function formatOsVersion(os) {
3044
- return `${os.name || "Unknown"} ${os.version || ""}`.trim();
3045
- }
3046
- function formatBrowser(browser) {
3047
- if (!browser.name || !browser.version) return "Unknown";
3048
- return `${browser.name} ${browser.version}`;
3049
- }
3050
- async function submitDeviceFingerprint(options = {}, dependencies) {
3051
- const { disableIpify = false, hostingApp, signal } = options;
3052
- const fingerprint = await dependencies.fingerprintProvider.getFingerprint(disableIpify);
3053
- const hasLiedBrowser = isBrowserSimulation(dependencies.browserEnv);
3054
- const payload = {
3055
- hash: fingerprint.visitorId || "",
3056
- ip: fingerprint.ip || "",
3057
- deviceType: "WEBAPP",
3058
- data: JSON.stringify(fingerprint),
3059
- osVersion: formatOsVersion(fingerprint.deviceInfo.os),
3060
- deviceModel: fingerprint.deviceInfo.device.model || "",
3061
- browser: formatBrowser(fingerprint.deviceInfo.browser),
3062
- hasLiedBrowser,
3063
- sdkVersion: SDK_VERSION,
3064
- hostingApp: hostingApp ?? "Web SDK"
3065
- };
3066
- const response = await api.post(endpoints.deviceFingerprint, payload, { signal });
3067
- if (!response.ok) throw new Error(`Failed to submit fingerprint: ${response.status} ${response.statusText}`);
3068
- return response.data;
3069
- }
3070
-
3071
- //#endregion
3072
- //#region src/internal/session/sessionInitializer.ts
3073
- let sessionInitialized = false;
3074
- let cachedFeatures = null;
3075
- let cachedDisableIpify = false;
3076
- let cachedFingerprintSuccess = false;
3077
- let cachedFingerprintResult;
3078
- let sessionInitPromise = null;
3079
- /**
3080
- * Activates a session by setting the auth token on the HTTP client and
3081
- * preloading session-scoped state.
3082
- *
3083
- * Performs:
3084
- * 1. Sets the token (and clears stale session-init cache if the token changed)
3085
- * 2. Fetches feature configuration from backend
3086
- * 3. Submits device fingerprint
3087
- * 4. Starts the analytics batcher so buffered events are flushed
3088
- *
3089
- * Results are cached per token. Calling again with the same token returns the
3090
- * cached result; calling with a different token re-initializes from scratch.
3091
- *
3092
- * @param options - Session activation options (`token` required)
3093
- * @returns Session initialization result with feature config
3094
- *
3095
- * @example
3096
- * ```ts
3097
- * await setup({ apiURL: 'https://api.incode.com' });
3098
- * const session = await createSession('api-key', options);
3099
- * const { features } = await initializeSession({ token: session.token });
3100
- *
3101
- * // Check feature flags
3102
- * if (isFeatureEnabled('DISABLE_IPIFY', features.features)) {
3103
- * // Handle disabled ipify
3104
- * }
3105
- * ```
3106
- */
3107
- async function initializeSession(options = {}) {
3108
- const { token, hostingApp, signal } = options;
3109
- if (token !== void 0 && token !== getToken()) {
3110
- setToken(token);
3111
- resetSessionInit();
3112
- }
3113
- if (sessionInitialized && cachedFeatures) return {
3114
- features: cachedFeatures,
3115
- disableIpify: cachedDisableIpify,
3116
- fingerprintSuccess: cachedFingerprintSuccess,
3117
- fingerprintResult: cachedFingerprintResult
3118
- };
3119
- if (sessionInitPromise) return sessionInitPromise;
3120
- sessionInitPromise = (async () => {
3121
- let features;
3122
- let disableIpify = false;
3123
- try {
3124
- features = await fetchFeatureConfig(signal);
3125
- disableIpify = isFeatureEnabled("DISABLE_IPIFY", features.features);
3126
- } catch {
3127
- features = { sessionIdentifier: "" };
3128
- }
3129
- let fingerprintSuccess = false;
3130
- let fingerprintResult;
3131
- try {
3132
- const fingerprintProvider = new FingerprintProvider(new IpifyProvider());
3133
- const browserEnv = new BrowserEnvironmentProvider();
3134
- fingerprintResult = await submitDeviceFingerprint({
3135
- disableIpify,
3136
- hostingApp,
3137
- signal
3138
- }, {
3139
- fingerprintProvider,
3140
- browserEnv
3141
- });
3142
- fingerprintSuccess = true;
3143
- } catch (error) {
3144
- console.warn("Failed to submit device fingerprint:", error);
3145
- }
3146
- try {
3147
- const browserInfo = new BrowserInfoProvider().getBrowserInfo();
3148
- addEvent({
3149
- code: "browser",
3150
- payload: {
3151
- userAgent: browserInfo.userAgent,
3152
- isWebRtcSupported: browserInfo.isWebRtcSupported,
3153
- browser: browserInfo.browser,
3154
- os: browserInfo.os,
3155
- device: browserInfo.device,
3156
- engine: browserInfo.engine,
3157
- cpu: browserInfo.cpu
3158
- }
3159
- });
3160
- } catch (error) {
3161
- console.warn("Failed to send browser info event:", error);
3162
- }
3163
- sessionInitialized = true;
3164
- cachedFeatures = features;
3165
- cachedDisableIpify = disableIpify;
3166
- cachedFingerprintSuccess = fingerprintSuccess;
3167
- cachedFingerprintResult = fingerprintResult;
3168
- return {
3169
- features,
3170
- disableIpify,
3171
- fingerprintSuccess,
3172
- fingerprintResult
3173
- };
3174
- })().finally(() => {
3175
- sessionInitPromise = null;
3176
- getAnalyticsBatcher()?.start();
3177
- });
3178
- return sessionInitPromise;
3179
- }
3180
- /**
3181
- * Gets the cached disableIpify flag.
3182
- * Returns false if session hasn't been initialized.
3183
- */
3184
- function getDisableIpify() {
3185
- return cachedDisableIpify;
3186
- }
3187
- function getSessionFingerprintResult() {
3188
- return cachedFingerprintResult;
2761
+ //#region src/internal/device/browserSimulation.ts
2762
+ const AUTOMATION_MARKERS = {
2763
+ window: [
2764
+ "callPhantom",
2765
+ "_phantom",
2766
+ "phantom",
2767
+ "__nightmare",
2768
+ "domAutomation",
2769
+ "domAutomationController"
2770
+ ],
2771
+ navigator: ["webdriver"]
2772
+ };
2773
+ function hasAutomationMarker(browserEnv) {
2774
+ for (const prop of AUTOMATION_MARKERS.window) if (browserEnv.getWindowProperty(prop)) return true;
2775
+ for (const prop of AUTOMATION_MARKERS.navigator) if (browserEnv.getNavigatorProperty(prop)) return true;
2776
+ return false;
3189
2777
  }
3190
- /**
3191
- * Resets session initialization state.
3192
- * Useful for testing or when starting a new session.
3193
- */
3194
- function resetSessionInit() {
3195
- sessionInitialized = false;
3196
- cachedFeatures = null;
3197
- cachedDisableIpify = false;
3198
- cachedFingerprintSuccess = false;
3199
- cachedFingerprintResult = void 0;
3200
- sessionInitPromise = null;
3201
- resetFeatureConfigCache();
3202
- resetIpifyCache();
2778
+ function isBrowserSimulation(browserEnv) {
2779
+ if (hasAutomationMarker(browserEnv)) return true;
2780
+ if (!getParsedUserAgent().browser.name) return true;
2781
+ const touchPoints = browserEnv.getMaxTouchPoints();
2782
+ const isTouch = touchPoints > 0 || browserEnv.hasOnTouchStart();
2783
+ if (isTouch && touchPoints !== 1) return false;
2784
+ const ua = getUserAgent();
2785
+ if (isTouch && (hasLiedBrowser(browserEnv) || ua.includes("Mobile"))) return true;
2786
+ if (isIOS(ua) && !browserEnv.hasOnTouchStart()) return true;
2787
+ return false;
3203
2788
  }
3204
2789
 
3205
2790
  //#endregion
3206
- export { FingerprintProvider as a, QrValidationError as c, refreshQrUrlUuid as d, validateQrUuid as f, resetSessionInit as i, bootstrapSession as l, getSessionFingerprintResult as n, getDeviceFingerprintInfo as o, initializeSession as r, QR_VALIDATION_ERROR_CODES as s, getDisableIpify as t, createSession as u };
2791
+ export { UAParser as i, getThumbmarkId as n, getParsedUserAgent as r, isBrowserSimulation as t };
package/dist/camera.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { n as PermissionStatus, t as PermissionResult } from "./types-CAD4va6a.js";
1
+ import { n as PermissionStatus, t as PermissionResult } from "./types-ya0LN_MX.js";
2
2
 
3
3
  //#region src/internal/permissions/permissionServices.d.ts
4
4
  type RequestPermissionOptions = {
@@ -7,8 +7,9 @@ type RequestPermissionOptions = {
7
7
  declare function checkPermission(): Promise<PermissionResult>;
8
8
  /**
9
9
  * Requests camera permission by attempting to access the camera, then immediately
10
- * stops the obtained stream. Also requests motion sensor permission (required on iOS
11
- * to be called during a user gesture). This function does not keep or return the stream.
10
+ * stops the obtained stream. When `requestMotion` is true (deepsight), requests
11
+ * motion OS permission, primes WASM sensors, then camera all in one user gesture
12
+ * chain, matching SDK v1.
12
13
  */
13
14
  declare function requestPermission(options?: RequestPermissionOptions): Promise<PermissionResult>;
14
15
  //#endregion
@@ -1,5 +1,6 @@
1
- import "./camera-PA2Ljri3.esm.js";
2
- import "./MotionSensorProvider-4v7xkqAp.esm.js";
3
- import { n as requestPermission, t as checkPermission } from "./permissionServices-D_i6nzEw.esm.js";
1
+ import "./WasmUtilProvider-CiEN7Gjn.esm.js";
2
+ import "./MotionSensorProvider-Bx7Mpzt0.esm.js";
3
+ import { i as requestPermission, t as checkPermission } from "./permissionServices-CG3bMSfG.esm.js";
4
+ import "./camera-DJWm3V4g.esm.js";
4
5
 
5
6
  export { checkPermission as checkCameraPermission, requestPermission as requestCameraPermission };