@incodetech/core 2.4.0-rc.0 → 2.4.0-rc.2

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 (181) hide show
  1. package/dist/{BaseWasmProvider-BL9wIRnN.d.ts → BaseWasmProvider-Bq3OHo7P.d.ts} +2 -2
  2. package/dist/BrowserDiagnosticsEnvelopeProvider-BQca6KPG.esm.js +43 -0
  3. package/dist/{FaceDetectionProvider-BjTer9h3.esm.js → FaceDetectionProvider-DSWxnrS3.esm.js} +10 -11
  4. package/dist/{IIdCaptureCapability-DBsv9-7M.d.ts → IIdCaptureCapability-CGcEt2Cw.d.ts} +2 -2
  5. package/dist/{IWasmUtilCapability-CPX0RGdQ.d.ts → IWasmUtilCapability-GF2n7sfm.d.ts} +2 -2
  6. package/dist/{StreamCanvasCapture-DVmzJux5.d.ts → StreamCanvasCapture-7JRf-2ck.d.ts} +2 -2
  7. package/dist/{WasmUtilProvider-CIdnE7Fx.esm.js → WasmUtilProvider-DtJuBdt-.esm.js} +18 -5
  8. package/dist/{addressSearch-BiYZjvp3.esm.js → addressSearch-DPjIKJrX.esm.js} +1 -2
  9. package/dist/ae-signature.esm.js +1 -1
  10. package/dist/antifraud.esm.js +2 -2
  11. package/dist/{antifraudManager-HL08jeDX.esm.js → antifraudManager-CaweCYnY.esm.js} +2 -2
  12. package/dist/{antifraudStateMachine-DoJVzblM.esm.js → antifraudStateMachine-DRl0UVyA.esm.js} +1 -2
  13. package/dist/{endpoints-DHzlkQNe.esm.js → api-Cz90EHyu.esm.js} +149 -1
  14. package/dist/{apiError-DcSWedC6.esm.js → apiError-u5fRJruc.esm.js} +1 -1
  15. package/dist/authentication.d.ts +3 -3
  16. package/dist/authentication.esm.js +2 -2
  17. package/dist/{authenticationManager-CANv5-W5.d.ts → authenticationManager-BIZC55Bi.d.ts} +1 -1
  18. package/dist/{authenticationManager-SaiAxqvS.esm.js → authenticationManager-CHQ3a8M3.esm.js} +5 -5
  19. package/dist/{authenticationStateMachine-CHSxmV7z.esm.js → authenticationStateMachine-C3poykXk.esm.js} +3 -3
  20. package/dist/avatar.d.ts +1 -1
  21. package/dist/camera.esm.js +1 -1
  22. package/dist/certificate-issuance.esm.js +2 -2
  23. package/dist/{certificateIssuanceManager-CMg4SgL4.esm.js → certificateIssuanceManager-BfeMv2PU.esm.js} +2 -2
  24. package/dist/{certificateIssuanceStateMachine-Cs64QmYH.esm.js → certificateIssuanceStateMachine-Frgjbjw8.esm.js} +1 -2
  25. package/dist/consent.d.ts +1 -1
  26. package/dist/consent.esm.js +2 -2
  27. package/dist/{consentManager-DgzWQpAR.d.ts → consentManager-Ca8FHlC4.d.ts} +1 -1
  28. package/dist/{consentManager-CjrxY737.esm.js → consentManager-CvEu8h_W.esm.js} +2 -2
  29. package/dist/{consentStateMachine-BCj5Jb3g.esm.js → consentStateMachine-DJTgN_-1.esm.js} +1 -2
  30. package/dist/{createCameraCycleOwnership-kdlhkmmY.esm.js → createCameraCycleOwnership-Dj_LHUvN.esm.js} +2 -3
  31. package/dist/{createFaceAvatar-DXgmQmQy.d.ts → createFaceAvatar-lYX0VTYs.d.ts} +1 -1
  32. package/dist/cross-document-data-match.esm.js +1 -1
  33. package/dist/{crossDocumentDataMatchManager-BHnGRsto.esm.js → crossDocumentDataMatchManager-Cu141CE8.esm.js} +2 -3
  34. package/dist/curp-validation.d.ts +1 -1
  35. package/dist/curp-validation.esm.js +2 -2
  36. package/dist/{curpValidationManager-DBNIn8BF.esm.js → curpValidationManager-B-z9q5V3.esm.js} +2 -2
  37. package/dist/{curpValidationManager-B-1EZbP_.d.ts → curpValidationManager-C9sqoh9n.d.ts} +1 -1
  38. package/dist/{curpValidationStateMachine-DAxImy8p.esm.js → curpValidationStateMachine-vDEFLMPw.esm.js} +1 -2
  39. package/dist/custom-fields.esm.js +1 -1
  40. package/dist/custom-watchlist.esm.js +2 -2
  41. package/dist/{customFieldsManager-BV6UyLFV.esm.js → customFieldsManager-D1ex2cFM.esm.js} +2 -3
  42. package/dist/{customWatchlistManager-DML0UPzf.esm.js → customWatchlistManager-CTI-SGk0.esm.js} +2 -2
  43. package/dist/{customWatchlistStateMachine-D9gI5uu7.esm.js → customWatchlistStateMachine-hmRd0f2I.esm.js} +1 -2
  44. package/dist/{deepsightLoader-DvfAYnzg.esm.js → deepsightLoader-BgGxliJ0.esm.js} +6 -6
  45. package/dist/{deepsightService-DLGO9yv1.esm.js → deepsightService-ty5dU0LC.esm.js} +3 -3
  46. package/dist/document-capture.esm.js +2 -2
  47. package/dist/{documentCaptureManager-C9XUnYU6.esm.js → documentCaptureManager-DUJwpKC5.esm.js} +2 -2
  48. package/dist/{documentCaptureStateMachine-BHDsCfhL.esm.js → documentCaptureStateMachine-B8i7GnLh.esm.js} +3 -4
  49. package/dist/dynamic-forms.esm.js +2 -2
  50. package/dist/{dynamicFormsManager-5uIXobxi.esm.js → dynamicFormsManager-jtJpRLz9.esm.js} +2 -2
  51. package/dist/{dynamicFormsStateMachine-DQmok084.esm.js → dynamicFormsStateMachine-D20Fh6BI.esm.js} +2 -3
  52. package/dist/ekyb.d.ts +1 -1
  53. package/dist/ekyb.esm.js +3 -3
  54. package/dist/{ekybManager-CazShiQz.esm.js → ekybManager-CaTOF46q.esm.js} +2 -2
  55. package/dist/{ekybStateMachine-hstiCNmW.esm.js → ekybStateMachine-BcJtiQRv.esm.js} +3 -4
  56. package/dist/ekyc.esm.js +2 -2
  57. package/dist/{ekycManager-BdJRUsz0.esm.js → ekycManager-BO-Lui3t.esm.js} +2 -2
  58. package/dist/{ekycStateMachine-x6Klot8g.esm.js → ekycStateMachine-CDnI_NRq.esm.js} +2 -3
  59. package/dist/electronic-signature.esm.js +1 -1
  60. package/dist/{electronicSignatureManager-Bc8spG8p.esm.js → electronicSignatureManager-CoeuiyX4.esm.js} +3 -4
  61. package/dist/email.esm.js +2 -2
  62. package/dist/{emailManager-CtlKRRaR.esm.js → emailManager-ButFktRm.esm.js} +2 -2
  63. package/dist/{emailStateMachine-5Neq3rE5.esm.js → emailStateMachine-BXtlC0NV.esm.js} +1 -2
  64. package/dist/{events-CAgFE-k3.esm.js → events-Du2A4-Qr.esm.js} +184 -1
  65. package/dist/events.esm.js +1 -1
  66. package/dist/extensibility.d.ts +13 -13
  67. package/dist/extensibility.esm.js +34 -34
  68. package/dist/face-match.esm.js +2 -2
  69. package/dist/{faceCaptureManagerFactory-jKQ2QtY-.d.ts → faceCaptureManagerFactory-1hzeS_rB.d.ts} +7 -7
  70. package/dist/{faceCaptureManagerFactory-uFm1AcaY.esm.js → faceCaptureManagerFactory-D5hz8P8_.esm.js} +4 -4
  71. package/dist/{faceCaptureSetup-Cu2wabzo.esm.js → faceCaptureSetup-aZ7IJflJ.esm.js} +15 -11
  72. package/dist/{faceMatchManager-9Nj9aPci.esm.js → faceMatchManager-DWFUQjMQ.esm.js} +2 -2
  73. package/dist/{faceMatchStateMachine-B9ZUnlyU.esm.js → faceMatchStateMachine-CUCvlydD.esm.js} +1 -2
  74. package/dist/{feature-management-BTbYruNe.esm.js → feature-management-D7SnNua4.esm.js} +1 -1
  75. package/dist/feature-management.esm.js +1 -1
  76. package/dist/field-comparison.esm.js +1 -1
  77. package/dist/{fieldComparisonManager-Dk38hXZP.esm.js → fieldComparisonManager-v3knTYV_.esm.js} +2 -3
  78. package/dist/fiscal-qr.esm.js +1 -1
  79. package/dist/{fiscalQrManager-DmBkQfs0.esm.js → fiscalQrManager-Dt9fHG7h.esm.js} +3 -3
  80. package/dist/flow-events.d.ts +1 -1
  81. package/dist/flow.d.ts +6 -6
  82. package/dist/flow.esm.js +4 -4
  83. package/dist/{flowCompletionService-xnn_SlJU.esm.js → flowCompletionService-D7le3leY.esm.js} +2 -3
  84. package/dist/{flowServices-DA64AEZC.esm.js → flowServices-BnHYS8ez.esm.js} +6 -7
  85. package/dist/geolocation.esm.js +2 -2
  86. package/dist/{geolocationManager-CqNLY45e.esm.js → geolocationManager-CEi7S-bI.esm.js} +2 -2
  87. package/dist/{geolocationStateMachine-D-cQi7ar.esm.js → geolocationStateMachine-BJsZ4RyH.esm.js} +2 -3
  88. package/dist/government-validation.esm.js +2 -2
  89. package/dist/{governmentValidationManager-CP0SiOOe.esm.js → governmentValidationManager-BtXWHICu.esm.js} +2 -2
  90. package/dist/{governmentValidationStateMachine-C3YQ8yCZ.esm.js → governmentValidationStateMachine-COL-Vs48.esm.js} +1 -2
  91. package/dist/home.d.ts +1 -1
  92. package/dist/home.esm.js +1 -1
  93. package/dist/http.esm.js +1 -1
  94. package/dist/id-ocr.d.ts +1 -1
  95. package/dist/id-ocr.esm.js +2 -2
  96. package/dist/id-selfie-flow.d.ts +3 -3
  97. package/dist/id-selfie-flow.esm.js +9 -9
  98. package/dist/id-verification.esm.js +2 -2
  99. package/dist/id.d.ts +3 -3
  100. package/dist/id.esm.js +3 -3
  101. package/dist/{idCaptureDefaults-CBg73RnV.esm.js → idCaptureDefaults-BGsG2OAs.esm.js} +3 -4
  102. package/dist/{idCaptureManager-BY97SRCV.d.ts → idCaptureManager-0M02hSuC.d.ts} +7 -7
  103. package/dist/{idCaptureManager-D4V8vXtY.esm.js → idCaptureManager-Bbt7x3xN.esm.js} +7 -7
  104. package/dist/{idCaptureServices-DJ33k3-p.esm.js → idCaptureServices-t3zj66lr.esm.js} +6 -7
  105. package/dist/{idCaptureStateMachine-PJt0yzom.esm.js → idCaptureStateMachine-e56glzRH.esm.js} +23 -20
  106. package/dist/{idOcrManager-DxoCesYP.esm.js → idOcrManager-D3-HNMXP.esm.js} +2 -2
  107. package/dist/{idOcrManager-BTdHlJ9D.d.ts → idOcrManager-DT3kPIB3.d.ts} +1 -1
  108. package/dist/{idOcrStateMachine-kPn7DB2I.esm.js → idOcrStateMachine-DyENX6Ki.esm.js} +1 -2
  109. package/dist/{idVerificationManager-CDhRUU5n.esm.js → idVerificationManager-iWz7Avkr.esm.js} +2 -2
  110. package/dist/{idVerificationStateMachine-0HTVVxse.esm.js → idVerificationStateMachine-CL1kUdBe.esm.js} +1 -2
  111. package/dist/identity-reuse.esm.js +2 -2
  112. package/dist/{identityReuseManager-BleUi6TK.esm.js → identityReuseManager-CD1ucp1d.esm.js} +2 -2
  113. package/dist/{identityReuseStateMachine-BrBUpfn5.esm.js → identityReuseStateMachine-DfV81wQC.esm.js} +1 -2
  114. package/dist/{index-DfEuu-Ew.d.ts → index-CKQ9QBZP.d.ts} +1 -1
  115. package/dist/index.d.ts +1 -1
  116. package/dist/index.esm.js +1 -1
  117. package/dist/{invokeOnCaptureCallback-BW7V3vub.esm.js → invokeOnCaptureCallback-DYrkOXO6.esm.js} +1 -1
  118. package/dist/mandatory-consent.d.ts +2 -2
  119. package/dist/mandatory-consent.esm.js +2 -2
  120. package/dist/{mandatoryConsentManager-CX_Dyht7.esm.js → mandatoryConsentManager-Cwqx1nK7.esm.js} +2 -2
  121. package/dist/{mandatoryConsentManager-TkX57U6f.d.ts → mandatoryConsentManager-qYojnZYg.d.ts} +2 -2
  122. package/dist/{mandatoryConsentStateMachine-CoaSB7P7.esm.js → mandatoryConsentStateMachine-pXWqAHo_.esm.js} +1 -2
  123. package/dist/{multipartRecordingService-DbeQpXdU.esm.js → multipartRecordingService-CLwrF5wD.esm.js} +1 -2
  124. package/dist/{permissionGuards-Bf4LbHjC.esm.js → permissionGuards-gcy3U0SL.esm.js} +1 -1
  125. package/dist/{permissionServices-d2UW0r_L.esm.js → permissionServices-Ca-tSNhT.esm.js} +1 -1
  126. package/dist/phone.esm.js +2 -2
  127. package/dist/{phoneManager-BGBcpqsk.esm.js → phoneManager-KKUq-Vgo.esm.js} +2 -2
  128. package/dist/{phoneStateMachine-CEm2y7yG.esm.js → phoneStateMachine-D2QWS2cu.esm.js} +1 -2
  129. package/dist/qe-signature.esm.js +1 -1
  130. package/dist/redirect-to-mobile.esm.js +2 -2
  131. package/dist/{redirectToMobileManager-B1yQHFLu.esm.js → redirectToMobileManager-uHW3dyuQ.esm.js} +2 -2
  132. package/dist/{redirectToMobileStateMachine--Sr9NEVT.esm.js → redirectToMobileStateMachine-b-H-ipGM.esm.js} +1 -2
  133. package/dist/{runChildModule-vdxQMCmO.esm.js → runChildModule-BMlIz7Hc.esm.js} +2 -2
  134. package/dist/{sdkVersion-F5YZbjip.esm.js → sdkVersion-DnWdXHbH.esm.js} +1 -1
  135. package/dist/selfie.d.ts +4 -4
  136. package/dist/selfie.esm.js +10 -10
  137. package/dist/{selfieErrorUtils-D-tsgEuX.esm.js → selfieErrorUtils-BmKZD7uF.esm.js} +1 -1
  138. package/dist/{selfieManager-1J0IEyFq.d.ts → selfieManager-BJdNu_nd.d.ts} +1 -1
  139. package/dist/{selfieManager-26pENXxw.esm.js → selfieManager-ByEF2GBP.esm.js} +5 -5
  140. package/dist/{selfieStateMachine-BhfKsl3I.esm.js → selfieStateMachine-51U3Eg7M.esm.js} +3 -3
  141. package/dist/{session-Bu7djCsj.esm.js → session-DeVZisMV.esm.js} +4 -5
  142. package/dist/session.d.ts +1 -1
  143. package/dist/session.esm.js +5 -5
  144. package/dist/{sessionInitializer-jxbfCnE-.esm.js → sessionInitializer-CAkf7oYe.esm.js} +7 -8
  145. package/dist/{setup-C38QkrSP.esm.js → setup-C-4p0WsB.esm.js} +93 -198
  146. package/dist/{setup-lgkQ8dJW.d.ts → setup-YPKTUCY5.d.ts} +23 -5
  147. package/dist/signature.esm.js +2 -2
  148. package/dist/{signatureManager-qqXyH93e.esm.js → signatureManager-f_dPAGXn.esm.js} +2 -2
  149. package/dist/{signatureStateMachine-BkRSrkKp.esm.js → signatureStateMachine-C-nUq_oq.esm.js} +1 -2
  150. package/dist/{stats-DmG_tkGk.esm.js → stats-BEvexnKC.esm.js} +1 -2
  151. package/dist/stats.esm.js +1 -1
  152. package/dist/{trueSightService-BWgRVGIT.esm.js → trueSightService-D-whOVP1.esm.js} +914 -225
  153. package/dist/trust-graph.esm.js +1 -1
  154. package/dist/{types-BGXxRwQM.d.ts → types-B6HsSzpk.d.ts} +1 -1
  155. package/dist/{types-CyPUIpzf.d.ts → types-BAxn7MpY.d.ts} +5 -5
  156. package/dist/{types-DTYr9pCB.d.ts → types-CK8Jbjkp.d.ts} +1 -1
  157. package/dist/{types-BvFmYX5c.d.ts → types-Ckir_BEs.d.ts} +1 -1
  158. package/dist/{types-zpO4fU6a.d.ts → types-yPH8lAH-.d.ts} +3 -3
  159. package/dist/types-zOgZqMni.d.ts +6 -0
  160. package/dist/video-selfie.d.ts +3 -3
  161. package/dist/video-selfie.esm.js +6 -7
  162. package/dist/{videoSelfieCameraWarmer-C366RKqu.esm.js → videoSelfieCameraWarmer-BBQSGW1l.esm.js} +7 -8
  163. package/dist/{videoSelfieStepDetector-C5QHOvWb.d.ts → videoSelfieStepDetector-CGsTltqB.d.ts} +4 -4
  164. package/dist/{warmup-DMtbyb2l.esm.js → warmup-BElYWRh7.esm.js} +322 -3
  165. package/dist/{warmup-BUPPRAA1.d.ts → warmup-BO57syF6.d.ts} +1 -0
  166. package/dist/wasm.d.ts +2 -2
  167. package/dist/wasm.esm.js +3 -4
  168. package/dist/{wasmDsFlagSync-BXCGqP48.esm.js → wasmDsFlagSync-CYj5LL9z.esm.js} +1 -1
  169. package/dist/{wasmWebClient-kbYZ2sxw.esm.js → wasmWebClient-BjZw_7OB.esm.js} +315 -17
  170. package/dist/watchlist-for-business.esm.js +2 -2
  171. package/dist/watchlist.esm.js +2 -2
  172. package/dist/{watchlistForBusinessManager-BvF4jK3S.esm.js → watchlistForBusinessManager-CZZOFkGl.esm.js} +2 -2
  173. package/dist/{watchlistForBusinessStateMachine-121XK-Et.esm.js → watchlistForBusinessStateMachine-B66E7jud.esm.js} +1 -2
  174. package/dist/{watchlistManager-CNWEOYSq.esm.js → watchlistManager-DXtX94SN.esm.js} +2 -2
  175. package/dist/{watchlistStateMachine-Dgfm42w2.esm.js → watchlistStateMachine-McALifag.esm.js} +1 -2
  176. package/dist/workflow.d.ts +1 -1
  177. package/dist/workflow.esm.js +35 -36
  178. package/package.json +2 -2
  179. package/dist/BrowserDiagnosticsCryptoProvider-BuzqvbhN.esm.js +0 -77
  180. package/dist/api-Bx3gKW_y.esm.js +0 -129
  181. package/dist/types-C71Zo6vl.d.ts +0 -6
@@ -1,77 +0,0 @@
1
- //#region ../infra/src/crypto/truesightKey.ts
2
- /**
3
- * Legacy TrueSight key helpers. ENG-57951 disconnects the shared-key path;
4
- * ENG-58122 tracks secure encryption and restoration.
5
- */
6
- /** Interim P1 key id — the BE looks up the AES key by this label. */
7
- const TRUESIGHT_KID = "truesight-v1";
8
- /** No distributed shared key while TrueSight is disconnected (ENG-57951). */
9
- function getTruesightKey() {
10
- return null;
11
- }
12
- //#endregion
13
- //#region ../infra/src/providers/browser/BrowserDiagnosticsCryptoProvider.ts
14
- /**
15
- * Browser sealer for TrueSight diagnostics (ENG-48677 plan §1.5): JSON string →
16
- * gzip via native CompressionStream → AES-256-GCM via WebCrypto → contract
17
- * envelope. Designed to be loaded as a LAZY chunk — zero bytes on the host
18
- * page's critical path.
19
- *
20
- * The CryptoKey is imported once (non-extractable) and the raw bytes are zeroed
21
- * immediately after import; `getKeyBytes` must therefore return a fresh copy.
22
- */
23
- var BrowserDiagnosticsCryptoProvider = class {
24
- constructor(getKeyBytes = getTruesightKey, kid = TRUESIGHT_KID) {
25
- this.getKeyBytes = getKeyBytes;
26
- this.kid = kid;
27
- this.keyPromise = null;
28
- }
29
- isSupported() {
30
- return typeof crypto !== "undefined" && typeof crypto.subtle !== "undefined" && typeof crypto.getRandomValues === "function" && typeof CompressionStream !== "undefined";
31
- }
32
- async seal(plaintext) {
33
- const [gz, key] = await Promise.all([gzipUtf8(plaintext), this.importKeyOnce()]);
34
- const iv = crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(12));
35
- const additionalData = new TextEncoder().encode(`v1|A256GCM|gzip|${this.kid}`);
36
- const sealed = new Uint8Array(await crypto.subtle.encrypt({
37
- name: "AES-GCM",
38
- iv,
39
- additionalData
40
- }, key, gz));
41
- const tagStart = sealed.length - 16;
42
- return {
43
- version: 1,
44
- alg: "A256GCM",
45
- compression: "gzip",
46
- kid: this.kid,
47
- iv: toBase64Url(iv),
48
- ciphertext: toBase64Url(sealed.subarray(0, tagStart)),
49
- tag: toBase64Url(sealed.subarray(tagStart))
50
- };
51
- }
52
- importKeyOnce() {
53
- this.keyPromise ??= (async () => {
54
- const bytes = this.getKeyBytes();
55
- if (!bytes || bytes.length !== 32) throw new Error("TrueSight diagnostics key unavailable in this build");
56
- const copy = new Uint8Array(bytes);
57
- try {
58
- return await crypto.subtle.importKey("raw", copy, { name: "AES-GCM" }, false, ["encrypt"]);
59
- } finally {
60
- copy.fill(0);
61
- bytes.fill(0);
62
- }
63
- })();
64
- return this.keyPromise;
65
- }
66
- };
67
- async function gzipUtf8(text) {
68
- const stream = new Blob([text]).stream().pipeThrough(new CompressionStream("gzip"));
69
- return new Uint8Array(await new Response(stream).arrayBuffer());
70
- }
71
- function toBase64Url(bytes) {
72
- let binary = "";
73
- for (let i = 0; i < bytes.length; i += 1) binary += String.fromCharCode(bytes[i]);
74
- return btoa(binary).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/u, "");
75
- }
76
- //#endregion
77
- export { BrowserDiagnosticsCryptoProvider };
@@ -1,129 +0,0 @@
1
- import { t as getTimestamp } from "./IBrowserEnvironmentCapability-DEaRRk-R.esm.js";
2
- //#region src/internal/http/api.ts
3
- let client = null;
4
- let currentToken = null;
5
- function setClient(httpClient) {
6
- client = httpClient;
7
- }
8
- function setToken(token) {
9
- currentToken = token;
10
- }
11
- function getToken() {
12
- return currentToken;
13
- }
14
- function getApi() {
15
- if (!client) throw new Error("SDK not configured. Call setup({ apiURL: \"...\" }) first.");
16
- return client;
17
- }
18
- function isApiConfigured() {
19
- return client !== null;
20
- }
21
- function resetApi() {
22
- client = null;
23
- currentToken = null;
24
- requestObserver = null;
25
- }
26
- let requestObserver = null;
27
- /**
28
- * Observer fired around every `api.*` call (ENG-48677 event map row 23b —
29
- * Android-dashboard parity: every request gets a timing line, not just
30
- * failures). Deliberately a plain setter, not a direct `trueSightLog` import:
31
- * `trueSightService` already imports from this module, so importing it back
32
- * here would create a cycle. `setup.ts` wires the real observer.
33
- */
34
- function setHttpRequestObserver(observer) {
35
- requestObserver = observer;
36
- }
37
- function notifyRequestObserver(entry) {
38
- if (!requestObserver) return;
39
- try {
40
- requestObserver(entry);
41
- } catch {}
42
- }
43
- /** Strips a query string so `?communicationchannel=SMS`-style call sites don't fragment the endpoint label. */
44
- function normalizeEndpoint(url) {
45
- const queryIndex = url.indexOf("?");
46
- return queryIndex === -1 ? url : url.slice(0, queryIndex);
47
- }
48
- function httpStatusOf(error) {
49
- if (typeof error === "object" && error !== null && "status" in error && typeof error.status === "number") return error.status;
50
- return null;
51
- }
52
- async function withTiming(method, url, call) {
53
- const endpoint = normalizeEndpoint(url);
54
- const startedAt = getTimestamp();
55
- let response;
56
- try {
57
- response = await call();
58
- } catch (error) {
59
- notifyRequestObserver({
60
- method,
61
- endpoint,
62
- httpStatus: httpStatusOf(error),
63
- durationMs: getTimestamp() - startedAt,
64
- outcome: "failure"
65
- });
66
- throw error;
67
- }
68
- notifyRequestObserver({
69
- method,
70
- endpoint,
71
- httpStatus: response.status,
72
- durationMs: getTimestamp() - startedAt,
73
- outcome: "success"
74
- });
75
- return response;
76
- }
77
- /**
78
- * Header-precedence contract: when a caller passes
79
- * `X-Incode-Hardware-Id` in `config.headers`, their value wins over
80
- * `currentToken`. Spreading `config?.headers` LAST achieves that
81
- * (later keys overwrite earlier ones in object spread).
82
- *
83
- * Existing call sites that already pass an explicit
84
- * `X-Incode-Hardware-Id` header (`recordingsRepository.uploadDeepsightVideo`,
85
- * `internal/virtualCameraCheck.logFrame`) now use the value they
86
- * passed in unconditionally — previously the auto-injection silently
87
- * clobbered them. Both call sites pass tokens that are already
88
- * supposed to be the active session token, so behaviour is
89
- * unchanged in practice; the change unblocks personhood (which
90
- * needs to attach its own slot's token) without bypassing the
91
- * shared `api` wrapper.
92
- *
93
- * Regression coverage lives in `api.test.ts → "should let explicit
94
- * X-Incode-Hardware-Id override the auto-injected token"`.
95
- */
96
- function addTokenHeader(config) {
97
- if (!currentToken) return config ?? {};
98
- return {
99
- ...config,
100
- headers: {
101
- "X-Incode-Hardware-Id": currentToken,
102
- ...config?.headers
103
- }
104
- };
105
- }
106
- const api = {
107
- get(url, config) {
108
- const client = getApi();
109
- return withTiming("GET", url, () => client.get(url, addTokenHeader(config)));
110
- },
111
- post(url, data, config) {
112
- const client = getApi();
113
- return withTiming("POST", url, () => client.post(url, data, addTokenHeader(config)));
114
- },
115
- put(url, data, config) {
116
- const client = getApi();
117
- return withTiming("PUT", url, () => client.put(url, data, addTokenHeader(config)));
118
- },
119
- patch(url, data, config) {
120
- const client = getApi();
121
- return withTiming("PATCH", url, () => client.patch(url, data, addTokenHeader(config)));
122
- },
123
- delete(url, config) {
124
- const client = getApi();
125
- return withTiming("DELETE", url, () => client.delete(url, addTokenHeader(config)));
126
- }
127
- };
128
- //#endregion
129
- export { resetApi as a, setToken as c, isApiConfigured as i, getApi as n, setClient as o, getToken as r, setHttpRequestObserver as s, api as t };
@@ -1,6 +0,0 @@
1
- import { i as FlowModuleConfig } from "./types-BGXxRwQM.js";
2
- import { t as BaseFaceCaptureConfig } from "./types-zpO4fU6a.js";
3
- //#region src/modules/authentication/types.d.ts
4
- type AuthenticationConfig = FlowModuleConfig['AUTHENTICATION'] & BaseFaceCaptureConfig;
5
- //#endregion
6
- export { AuthenticationConfig as t };