@incodetech/core 2.4.0-rc.0 → 2.4.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/{BaseWasmProvider-BL9wIRnN.d.ts → BaseWasmProvider-Bq3OHo7P.d.ts} +2 -2
- package/dist/BrowserDiagnosticsEnvelopeProvider-BQca6KPG.esm.js +43 -0
- package/dist/{FaceDetectionProvider-BjTer9h3.esm.js → FaceDetectionProvider-BIImDZrc.esm.js} +10 -11
- package/dist/{IIdCaptureCapability-DBsv9-7M.d.ts → IIdCaptureCapability-CGcEt2Cw.d.ts} +2 -2
- package/dist/{IWasmUtilCapability-CPX0RGdQ.d.ts → IWasmUtilCapability-GF2n7sfm.d.ts} +2 -2
- package/dist/{StreamCanvasCapture-DVmzJux5.d.ts → StreamCanvasCapture-7JRf-2ck.d.ts} +2 -2
- package/dist/{WasmUtilProvider-CIdnE7Fx.esm.js → WasmUtilProvider-DtJuBdt-.esm.js} +18 -5
- package/dist/{addressSearch-BiYZjvp3.esm.js → addressSearch-DPjIKJrX.esm.js} +1 -2
- package/dist/ae-signature.esm.js +1 -1
- package/dist/antifraud.esm.js +2 -2
- package/dist/{antifraudManager-HL08jeDX.esm.js → antifraudManager-CaweCYnY.esm.js} +2 -2
- package/dist/{antifraudStateMachine-DoJVzblM.esm.js → antifraudStateMachine-DRl0UVyA.esm.js} +1 -2
- package/dist/{endpoints-DHzlkQNe.esm.js → api-Cz90EHyu.esm.js} +149 -1
- package/dist/{apiError-DcSWedC6.esm.js → apiError-D5u6HIDG.esm.js} +1 -1
- package/dist/authentication.d.ts +3 -3
- package/dist/authentication.esm.js +2 -2
- package/dist/{authenticationManager-CANv5-W5.d.ts → authenticationManager-BIZC55Bi.d.ts} +1 -1
- package/dist/{authenticationManager-SaiAxqvS.esm.js → authenticationManager-CB3YW6EK.esm.js} +5 -5
- package/dist/{authenticationStateMachine-CHSxmV7z.esm.js → authenticationStateMachine-BJJhLmdH.esm.js} +3 -3
- package/dist/avatar.d.ts +1 -1
- package/dist/camera.esm.js +1 -1
- package/dist/certificate-issuance.esm.js +2 -2
- package/dist/{certificateIssuanceManager-CMg4SgL4.esm.js → certificateIssuanceManager-BfeMv2PU.esm.js} +2 -2
- package/dist/{certificateIssuanceStateMachine-Cs64QmYH.esm.js → certificateIssuanceStateMachine-Frgjbjw8.esm.js} +1 -2
- package/dist/consent.d.ts +1 -1
- package/dist/consent.esm.js +2 -2
- package/dist/{consentManager-CjrxY737.esm.js → consentManager-CvEu8h_W.esm.js} +2 -2
- package/dist/{consentManager-DgzWQpAR.d.ts → consentManager-Cv_0QKLD.d.ts} +9 -9
- package/dist/{consentStateMachine-BCj5Jb3g.esm.js → consentStateMachine-DJTgN_-1.esm.js} +1 -2
- package/dist/{createCameraCycleOwnership-kdlhkmmY.esm.js → createCameraCycleOwnership-Dj_LHUvN.esm.js} +2 -3
- package/dist/{createFaceAvatar-DXgmQmQy.d.ts → createFaceAvatar-lYX0VTYs.d.ts} +1 -1
- package/dist/cross-document-data-match.esm.js +1 -1
- package/dist/{crossDocumentDataMatchManager-BHnGRsto.esm.js → crossDocumentDataMatchManager-Cu141CE8.esm.js} +2 -3
- package/dist/curp-validation.d.ts +1 -1
- package/dist/curp-validation.esm.js +2 -2
- package/dist/{curpValidationManager-DBNIn8BF.esm.js → curpValidationManager-B-z9q5V3.esm.js} +2 -2
- package/dist/{curpValidationManager-B-1EZbP_.d.ts → curpValidationManager-C9sqoh9n.d.ts} +1 -1
- package/dist/{curpValidationStateMachine-DAxImy8p.esm.js → curpValidationStateMachine-vDEFLMPw.esm.js} +1 -2
- package/dist/custom-fields.esm.js +1 -1
- package/dist/custom-watchlist.esm.js +2 -2
- package/dist/{customFieldsManager-BV6UyLFV.esm.js → customFieldsManager-D1ex2cFM.esm.js} +2 -3
- package/dist/{customWatchlistManager-DML0UPzf.esm.js → customWatchlistManager-CTI-SGk0.esm.js} +2 -2
- package/dist/{customWatchlistStateMachine-D9gI5uu7.esm.js → customWatchlistStateMachine-hmRd0f2I.esm.js} +1 -2
- package/dist/{deepsightLoader-DvfAYnzg.esm.js → deepsightLoader-DZMdYSl-.esm.js} +6 -6
- package/dist/{deepsightService-DLGO9yv1.esm.js → deepsightService-tGP53cSS.esm.js} +3 -3
- package/dist/document-capture.esm.js +2 -2
- package/dist/{documentCaptureManager-C9XUnYU6.esm.js → documentCaptureManager-DUJwpKC5.esm.js} +2 -2
- package/dist/{documentCaptureStateMachine-BHDsCfhL.esm.js → documentCaptureStateMachine-B8i7GnLh.esm.js} +3 -4
- package/dist/dynamic-forms.esm.js +2 -2
- package/dist/{dynamicFormsManager-5uIXobxi.esm.js → dynamicFormsManager-Bxmv_9PB.esm.js} +2 -2
- package/dist/{dynamicFormsStateMachine-DQmok084.esm.js → dynamicFormsStateMachine-CoOWTzyM.esm.js} +2 -3
- package/dist/ekyb.d.ts +1 -1
- package/dist/ekyb.esm.js +3 -3
- package/dist/{ekybManager-CazShiQz.esm.js → ekybManager-BBkdPxUY.esm.js} +2 -2
- package/dist/{ekybStateMachine-hstiCNmW.esm.js → ekybStateMachine-n4Iz9iLc.esm.js} +3 -4
- package/dist/ekyc.esm.js +2 -2
- package/dist/{ekycManager-BdJRUsz0.esm.js → ekycManager-BO-Lui3t.esm.js} +2 -2
- package/dist/{ekycStateMachine-x6Klot8g.esm.js → ekycStateMachine-CDnI_NRq.esm.js} +2 -3
- package/dist/electronic-signature.esm.js +1 -1
- package/dist/{electronicSignatureManager-Bc8spG8p.esm.js → electronicSignatureManager-BtWCrz5_.esm.js} +3 -4
- package/dist/email.esm.js +2 -2
- package/dist/{emailManager-CtlKRRaR.esm.js → emailManager-ButFktRm.esm.js} +2 -2
- package/dist/{emailStateMachine-5Neq3rE5.esm.js → emailStateMachine-BXtlC0NV.esm.js} +1 -2
- package/dist/{events-CAgFE-k3.esm.js → events-Du2A4-Qr.esm.js} +184 -1
- package/dist/events.esm.js +1 -1
- package/dist/extensibility.d.ts +14 -14
- package/dist/extensibility.esm.js +34 -34
- package/dist/face-match.esm.js +2 -2
- package/dist/{faceCaptureManagerFactory-jKQ2QtY-.d.ts → faceCaptureManagerFactory-1hzeS_rB.d.ts} +7 -7
- package/dist/{faceCaptureManagerFactory-uFm1AcaY.esm.js → faceCaptureManagerFactory-CwZUeYfq.esm.js} +4 -4
- package/dist/{faceCaptureSetup-Cu2wabzo.esm.js → faceCaptureSetup-CYbdKNlI.esm.js} +14 -10
- package/dist/{faceMatchManager-9Nj9aPci.esm.js → faceMatchManager-DWFUQjMQ.esm.js} +2 -2
- package/dist/{faceMatchStateMachine-B9ZUnlyU.esm.js → faceMatchStateMachine-CUCvlydD.esm.js} +1 -2
- package/dist/{feature-management-BTbYruNe.esm.js → feature-management-rTfjzdDa.esm.js} +1 -1
- package/dist/feature-management.esm.js +1 -1
- package/dist/field-comparison.esm.js +1 -1
- package/dist/{fieldComparisonManager-Dk38hXZP.esm.js → fieldComparisonManager-v3knTYV_.esm.js} +2 -3
- package/dist/fiscal-qr.esm.js +1 -1
- package/dist/{fiscalQrManager-DmBkQfs0.esm.js → fiscalQrManager-Dt9fHG7h.esm.js} +3 -3
- package/dist/flow-events.d.ts +1 -1
- package/dist/flow.d.ts +6 -6
- package/dist/flow.esm.js +4 -4
- package/dist/{flowCompletionService-xnn_SlJU.esm.js → flowCompletionService-oiK1PjPr.esm.js} +2 -3
- package/dist/{flowServices-DA64AEZC.esm.js → flowServices-CTc-zqfN.esm.js} +6 -7
- package/dist/geolocation.esm.js +2 -2
- package/dist/{geolocationManager-CqNLY45e.esm.js → geolocationManager-BOdtVuR8.esm.js} +2 -2
- package/dist/{geolocationStateMachine-D-cQi7ar.esm.js → geolocationStateMachine-BnGuZ3hn.esm.js} +2 -3
- package/dist/government-validation.esm.js +2 -2
- package/dist/{governmentValidationManager-CP0SiOOe.esm.js → governmentValidationManager-BtXWHICu.esm.js} +2 -2
- package/dist/{governmentValidationStateMachine-C3YQ8yCZ.esm.js → governmentValidationStateMachine-COL-Vs48.esm.js} +1 -2
- package/dist/home.d.ts +1 -1
- package/dist/home.esm.js +1 -1
- package/dist/http.esm.js +1 -1
- package/dist/id-ocr.d.ts +1 -1
- package/dist/id-ocr.esm.js +2 -2
- package/dist/id-selfie-flow.d.ts +3 -3
- package/dist/id-selfie-flow.esm.js +9 -9
- package/dist/id-verification.esm.js +2 -2
- package/dist/id.d.ts +3 -3
- package/dist/id.esm.js +3 -3
- package/dist/{idCaptureDefaults-CBg73RnV.esm.js → idCaptureDefaults-BGsG2OAs.esm.js} +3 -4
- package/dist/{idCaptureManager-BY97SRCV.d.ts → idCaptureManager-0M02hSuC.d.ts} +7 -7
- package/dist/{idCaptureManager-D4V8vXtY.esm.js → idCaptureManager-BKedt48Y.esm.js} +7 -7
- package/dist/{idCaptureServices-DJ33k3-p.esm.js → idCaptureServices-D0p_RFqk.esm.js} +6 -7
- package/dist/{idCaptureStateMachine-PJt0yzom.esm.js → idCaptureStateMachine-CxwoN5ff.esm.js} +22 -19
- package/dist/{idOcrManager-DxoCesYP.esm.js → idOcrManager-D3-HNMXP.esm.js} +2 -2
- package/dist/{idOcrManager-BTdHlJ9D.d.ts → idOcrManager-DT3kPIB3.d.ts} +1 -1
- package/dist/{idOcrStateMachine-kPn7DB2I.esm.js → idOcrStateMachine-DyENX6Ki.esm.js} +1 -2
- package/dist/{idVerificationManager-CDhRUU5n.esm.js → idVerificationManager-iWz7Avkr.esm.js} +2 -2
- package/dist/{idVerificationStateMachine-0HTVVxse.esm.js → idVerificationStateMachine-CL1kUdBe.esm.js} +1 -2
- package/dist/identity-reuse.d.ts +1 -1
- package/dist/identity-reuse.esm.js +2 -2
- package/dist/{identityReuseManager-ooAbp6Kc.d.ts → identityReuseManager-B1birg5X.d.ts} +4 -4
- package/dist/{identityReuseManager-BleUi6TK.esm.js → identityReuseManager-CD1ucp1d.esm.js} +2 -2
- package/dist/{identityReuseStateMachine-BrBUpfn5.esm.js → identityReuseStateMachine-DfV81wQC.esm.js} +1 -2
- package/dist/{index-DfEuu-Ew.d.ts → index-CKQ9QBZP.d.ts} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/{invokeOnCaptureCallback-BW7V3vub.esm.js → invokeOnCaptureCallback-DYrkOXO6.esm.js} +1 -1
- package/dist/mandatory-consent.d.ts +2 -2
- package/dist/mandatory-consent.esm.js +2 -2
- package/dist/{mandatoryConsentManager-CX_Dyht7.esm.js → mandatoryConsentManager-Cwqx1nK7.esm.js} +2 -2
- package/dist/{mandatoryConsentManager-TkX57U6f.d.ts → mandatoryConsentManager-okPILEru.d.ts} +6 -6
- package/dist/{mandatoryConsentStateMachine-CoaSB7P7.esm.js → mandatoryConsentStateMachine-pXWqAHo_.esm.js} +1 -2
- package/dist/{multipartRecordingService-DbeQpXdU.esm.js → multipartRecordingService-CLwrF5wD.esm.js} +1 -2
- package/dist/{permissionGuards-Bf4LbHjC.esm.js → permissionGuards-gcy3U0SL.esm.js} +1 -1
- package/dist/{permissionServices-d2UW0r_L.esm.js → permissionServices-Ca-tSNhT.esm.js} +1 -1
- package/dist/phone.esm.js +2 -2
- package/dist/{phoneManager-BGBcpqsk.esm.js → phoneManager-KKUq-Vgo.esm.js} +2 -2
- package/dist/{phoneStateMachine-CEm2y7yG.esm.js → phoneStateMachine-D2QWS2cu.esm.js} +1 -2
- package/dist/qe-signature.esm.js +1 -1
- package/dist/redirect-to-mobile.esm.js +2 -2
- package/dist/{redirectToMobileManager-B1yQHFLu.esm.js → redirectToMobileManager-uHW3dyuQ.esm.js} +2 -2
- package/dist/{redirectToMobileStateMachine--Sr9NEVT.esm.js → redirectToMobileStateMachine-b-H-ipGM.esm.js} +1 -2
- package/dist/{runChildModule-vdxQMCmO.esm.js → runChildModule-CPa0i2_C.esm.js} +2 -2
- package/dist/{sdkVersion-F5YZbjip.esm.js → sdkVersion-BtROs6OA.esm.js} +1 -1
- package/dist/selfie.d.ts +4 -4
- package/dist/selfie.esm.js +10 -10
- package/dist/{selfieErrorUtils-D-tsgEuX.esm.js → selfieErrorUtils-sMc0MaNh.esm.js} +1 -1
- package/dist/{selfieManager-1J0IEyFq.d.ts → selfieManager-BJdNu_nd.d.ts} +1 -1
- package/dist/{selfieManager-26pENXxw.esm.js → selfieManager-Ch9xJbWJ.esm.js} +5 -5
- package/dist/{selfieStateMachine-BhfKsl3I.esm.js → selfieStateMachine-DT8QCfKR.esm.js} +3 -3
- package/dist/{session-Bu7djCsj.esm.js → session-CNNTckUS.esm.js} +4 -5
- package/dist/session.d.ts +1 -1
- package/dist/session.esm.js +5 -5
- package/dist/{sessionInitializer-jxbfCnE-.esm.js → sessionInitializer-DVWMJh25.esm.js} +7 -8
- package/dist/{setup-C38QkrSP.esm.js → setup-B7ehQ-lf.esm.js} +93 -198
- package/dist/{setup-lgkQ8dJW.d.ts → setup-YPKTUCY5.d.ts} +23 -5
- package/dist/signature.esm.js +2 -2
- package/dist/{signatureManager-qqXyH93e.esm.js → signatureManager-f_dPAGXn.esm.js} +2 -2
- package/dist/{signatureStateMachine-BkRSrkKp.esm.js → signatureStateMachine-C-nUq_oq.esm.js} +1 -2
- package/dist/{stats-DmG_tkGk.esm.js → stats-BEvexnKC.esm.js} +1 -2
- package/dist/stats.esm.js +1 -1
- package/dist/{trueSightService-BWgRVGIT.esm.js → trueSightService-BzLdXpmJ.esm.js} +914 -225
- package/dist/trust-graph.esm.js +1 -1
- package/dist/{types-BGXxRwQM.d.ts → types-B6HsSzpk.d.ts} +1 -1
- package/dist/{types-CyPUIpzf.d.ts → types-BAxn7MpY.d.ts} +5 -5
- package/dist/{types-DTYr9pCB.d.ts → types-CK8Jbjkp.d.ts} +1 -1
- package/dist/{types-BvFmYX5c.d.ts → types-Ckir_BEs.d.ts} +1 -1
- package/dist/{types-zpO4fU6a.d.ts → types-yPH8lAH-.d.ts} +3 -3
- package/dist/types-zOgZqMni.d.ts +6 -0
- package/dist/video-selfie.d.ts +3 -3
- package/dist/video-selfie.esm.js +6 -7
- package/dist/{videoSelfieCameraWarmer-C366RKqu.esm.js → videoSelfieCameraWarmer-DWoFBJAn.esm.js} +7 -8
- package/dist/{videoSelfieStepDetector-C5QHOvWb.d.ts → videoSelfieStepDetector-CGsTltqB.d.ts} +4 -4
- package/dist/{warmup-DMtbyb2l.esm.js → warmup-BElYWRh7.esm.js} +322 -3
- package/dist/{warmup-BUPPRAA1.d.ts → warmup-BO57syF6.d.ts} +1 -0
- package/dist/wasm.d.ts +2 -2
- package/dist/wasm.esm.js +3 -4
- package/dist/{wasmDsFlagSync-BXCGqP48.esm.js → wasmDsFlagSync-CYj5LL9z.esm.js} +1 -1
- package/dist/{wasmWebClient-kbYZ2sxw.esm.js → wasmWebClient-BjZw_7OB.esm.js} +315 -17
- package/dist/watchlist-for-business.esm.js +2 -2
- package/dist/watchlist.esm.js +2 -2
- package/dist/{watchlistForBusinessManager-BvF4jK3S.esm.js → watchlistForBusinessManager-CZZOFkGl.esm.js} +2 -2
- package/dist/{watchlistForBusinessStateMachine-121XK-Et.esm.js → watchlistForBusinessStateMachine-B66E7jud.esm.js} +1 -2
- package/dist/{watchlistManager-CNWEOYSq.esm.js → watchlistManager-DXtX94SN.esm.js} +2 -2
- package/dist/{watchlistStateMachine-Dgfm42w2.esm.js → watchlistStateMachine-McALifag.esm.js} +1 -2
- package/dist/workflow.d.ts +1 -1
- package/dist/workflow.esm.js +35 -36
- package/package.json +2 -2
- package/dist/BrowserDiagnosticsCryptoProvider-BuzqvbhN.esm.js +0 -77
- package/dist/api-Bx3gKW_y.esm.js +0 -129
- 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 };
|
package/dist/api-Bx3gKW_y.esm.js
DELETED
|
@@ -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 };
|
package/dist/types-C71Zo6vl.d.ts
DELETED
|
@@ -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 };
|