@incodetech/core 2.5.0-agentic.1 → 2.5.0-agentic.3
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/{FaceDetectionProvider-Cy2EAL0i.esm.js → FaceDetectionProvider-CAPKXGuF.esm.js} +4 -4
- package/dist/ae-signature.esm.js +1 -1
- package/dist/{apiError-B9-B3cMq.esm.js → apiError-CmvdtW2M.esm.js} +1 -1
- package/dist/authentication.d.ts +3 -3
- package/dist/authentication.esm.js +2 -2
- package/dist/{authenticationManager-DNWtc0eq.esm.js → authenticationManager-CsioEjTk.esm.js} +3 -3
- package/dist/{authenticationManager-CkD0JR7Q.d.ts → authenticationManager-D_dz2zK4.d.ts} +1 -1
- package/dist/{authenticationStateMachine-CJ9i4Al-.esm.js → authenticationStateMachine-BoGEvdpR.esm.js} +3 -3
- package/dist/{browser-pQZA35G2-B4Dwja1e.esm.js → browser-pQZA35G2-DveVe0Ui.esm.js} +1 -1
- package/dist/consent.d.ts +1 -1
- package/dist/{consentManager-B0YKqYtZ.d.ts → consentManager-CMed_O5F.d.ts} +8 -8
- package/dist/curp-validation.d.ts +1 -1
- package/dist/{curpValidationManager-HOidAKvT.d.ts → curpValidationManager-tNhzv7vZ.d.ts} +1 -1
- package/dist/{deepsightCaptureConfig-BxD3mSac.esm.js → deepsightCaptureConfig-tYJhVK_Z.esm.js} +2 -2
- package/dist/{deepsightLoader-KYZP8_x-.esm.js → deepsightLoader-VASYET0q.esm.js} +4 -4
- package/dist/{desktopCameraElection-BGQRIA2u.esm.js → desktopCameraElection-Bx8PyF2-.esm.js} +4 -4
- package/dist/document-capture.d.ts +1 -1
- package/dist/document-signature.esm.js +1 -1
- package/dist/{documentCaptureManager-sJWgqtUy.d.ts → documentCaptureManager-Bul0b4KJ.d.ts} +5 -5
- package/dist/{documentSignatureStateMachine-CLljjltG.esm.js → documentSignatureStateMachine-BeA6fc5n.esm.js} +1 -1
- package/dist/dynamic-forms.esm.js +2 -2
- package/dist/{dynamicFormsManager-CnU2hRvl.esm.js → dynamicFormsManager-f5Uyu4UK.esm.js} +1 -1
- package/dist/{dynamicFormsStateMachine-huYmjamB.esm.js → dynamicFormsStateMachine-Dkug_fKn.esm.js} +1 -1
- package/dist/ekyb.d.ts +1 -1
- package/dist/ekyb.esm.js +2 -2
- package/dist/{ekybManager-CaEErq39.esm.js → ekybManager-KiG_tDCV.esm.js} +1 -1
- package/dist/{ekybStateMachine-BIU8KIMv.esm.js → ekybStateMachine-dDlZntM8.esm.js} +1 -1
- package/dist/ekyc-prefill.d.ts +1 -1
- package/dist/ekyc-prefill.esm.js +2 -2
- package/dist/ekyc.d.ts +2 -2
- package/dist/ekyc.esm.js +3 -3
- package/dist/{ekycManager-D2K8AaMV.esm.js → ekycManager-SUIAHlrm.esm.js} +1 -1
- package/dist/{ekycManager-DusmB-4j.d.ts → ekycManager-mv2rWxc4.d.ts} +1 -1
- package/dist/{ekycPrefillManager-CENQjdNq.esm.js → ekycPrefillManager-BsFZnV2a.esm.js} +1 -1
- package/dist/{ekycPrefillManager-BwmPXfhY.d.ts → ekycPrefillManager-QKqXYPH_.d.ts} +5 -5
- package/dist/{ekycPrefillStateMachine-jT3hIt2X.esm.js → ekycPrefillStateMachine-B6ZTcy7R.esm.js} +21 -4
- package/dist/{ekycStateMachine-6EKndBd7.esm.js → ekycStateMachine-Czn2CaTV.esm.js} +134 -3
- package/dist/{ekycUtils-C6HZB46m.esm.js → ekycUtils-BnTyeA-_.esm.js} +12 -0
- package/dist/electronic-signature.esm.js +1 -1
- package/dist/{electronicSignatureManager-wM8WTgzP.esm.js → electronicSignatureManager-BIjhPcO0.esm.js} +1 -1
- package/dist/extensibility.d.ts +15 -15
- package/dist/extensibility.esm.js +13 -13
- package/dist/{faceCaptureManagerFactory-DbEARG3h.esm.js → faceCaptureManagerFactory-6Hk2GxNz.esm.js} +2 -2
- package/dist/{faceCaptureManagerFactory-D1EJw36F.d.ts → faceCaptureManagerFactory-B1WfKaGJ.d.ts} +3 -3
- package/dist/{faceCaptureSetup-VaAjMpWX.esm.js → faceCaptureSetup-BM0mj2GE.esm.js} +7 -7
- package/dist/{feature-management-D7oLtULO.esm.js → feature-management-DG39VwqE.esm.js} +1 -1
- package/dist/feature-management.esm.js +1 -1
- package/dist/flow-events.d.ts +1 -1
- package/dist/flow.d.ts +6 -6
- package/dist/flow.esm.js +3 -3
- package/dist/{flowCompletionService-CIjaIpMH.esm.js → flowCompletionService-QycHxT5Z.esm.js} +1 -1
- package/dist/{flowServices-Dqt75TXx.esm.js → flowServices-5d7en_Aq.esm.js} +5 -5
- package/dist/geolocation.d.ts +1 -1
- package/dist/geolocation.esm.js +2 -2
- package/dist/{geolocationManager-CENrvxpK.d.ts → geolocationManager-Del2ddmt.d.ts} +1 -1
- package/dist/{geolocationManager-DHfgXhEs.esm.js → geolocationManager-_DJwOuei.esm.js} +1 -1
- package/dist/{geolocationStateMachine-CrEspaN-.esm.js → geolocationStateMachine-CyjGgKJ7.esm.js} +1 -1
- package/dist/home.d.ts +1 -1
- package/dist/id-ocr.d.ts +1 -1
- package/dist/id-selfie-flow.d.ts +1 -1
- package/dist/id-selfie-flow.esm.js +6 -6
- package/dist/id.d.ts +2 -2
- package/dist/id.esm.js +3 -3
- package/dist/{idCaptureManager-BPDCAV04.esm.js → idCaptureManager-BjTr4lOA.esm.js} +4 -4
- package/dist/{idCaptureManager-CNFBeYgV.d.ts → idCaptureManager-DXqvtLr9.d.ts} +2 -2
- package/dist/{idCaptureServices-CWZFmS7l.esm.js → idCaptureServices-D6sRW-qd.esm.js} +2 -2
- package/dist/{idCaptureStateMachine-Cyt2BvPB.esm.js → idCaptureStateMachine-BBlWr1aL.esm.js} +45 -25
- package/dist/{idOcrManager-DflRx-_u.d.ts → idOcrManager-voLpv_jJ.d.ts} +1 -1
- package/dist/identity-reuse.d.ts +1 -1
- package/dist/{identityReuseManager-CZ-qJ_Aa.d.ts → identityReuseManager-D_jiHp1n.d.ts} +4 -4
- package/dist/{index-BMr3MZEI.d.ts → index-B3BI8mVu.d.ts} +32 -4
- package/dist/{index-BoGlwLGK.d.ts → index-BnKhmWhM.d.ts} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/kyb-checks.esm.js +2 -2
- package/dist/{kybChecksManager-BF2vf0Q2.esm.js → kybChecksManager-Cpm2waJh.esm.js} +1 -1
- package/dist/{kybChecksStateMachine-oBQfgdka.esm.js → kybChecksStateMachine-Cg96E65N.esm.js} +1 -1
- package/dist/mandatory-consent.d.ts +2 -2
- package/dist/{mandatoryConsentManager-BcxCesP5.d.ts → mandatoryConsentManager-D2LkPii6.d.ts} +9 -9
- package/dist/qe-signature.esm.js +1 -1
- package/dist/{recordingService-DK3kjUby.esm.js → recordingService-wGNpJV_s.esm.js} +1 -1
- package/dist/{runChildModule-x1rrxjYY.esm.js → runChildModule-DCXy_h7V.esm.js} +1 -1
- package/dist/{numericRange-2e1vw1W0.esm.js → scriptCharacters-D7swUycV.esm.js} +13 -1
- package/dist/{sdkVersion-kRh5h82H.esm.js → sdkVersion-CzRrIbvf.esm.js} +1 -1
- package/dist/selfie.d.ts +3 -3
- package/dist/selfie.esm.js +7 -7
- package/dist/{selfieErrorUtils-B9GfiS9f.esm.js → selfieErrorUtils-DFJC36jx.esm.js} +1 -1
- package/dist/{selfieManager-CqDlUy6B.d.ts → selfieManager-B2j448t4.d.ts} +1 -1
- package/dist/{selfieManager-CivYjnF5.esm.js → selfieManager-KXkwfGvO.esm.js} +3 -3
- package/dist/{selfieStateMachine-dLwrXWll.esm.js → selfieStateMachine-CqHL6qf_.esm.js} +3 -3
- package/dist/{session-DeJ-rd9u.esm.js → session-DhNeT_WW.esm.js} +4 -4
- package/dist/session.d.ts +1 -1
- package/dist/session.esm.js +4 -4
- package/dist/{sessionInitializer-uZgyxsrL.esm.js → sessionInitializer-CfF_kFfS.esm.js} +6 -6
- package/dist/{setup-D0QZHkS8.esm.js → setup-BoCn7daH.esm.js} +8 -7
- package/dist/{setup-Cr2KCwau.d.ts → setup-DprzbOsJ.d.ts} +1 -1
- package/dist/tri-D5hWs0qJ.esm.js +559 -0
- package/dist/tri.d.ts +1 -1
- package/dist/{tri.esm-CftnGf9w.esm.js → tri.esm-DnXGKdlE.esm.js} +1296 -1057
- package/dist/tri.esm.js +1 -1
- package/dist/trueSight-CXzqdA0V.esm.js +1 -0
- package/dist/{trueSightService-BMp8g65B.esm.js → trueSightService-BYsRo-fK.esm.js} +1 -1
- package/dist/{types-BZsmNYom.d.ts → types-BFoC3IpR.d.ts} +2 -2
- package/dist/{types-PnJXvTkV.d.ts → types-BkxI3PHf.d.ts} +1 -1
- package/dist/{types-D-FEM1rT.d.ts → types-BxJWsAHc.d.ts} +4 -4
- package/dist/{types-HHgsFhZn.d.ts → types-CAzi8tyi.d.ts} +1 -1
- package/dist/types-CEdI4tfR.d.ts +6 -0
- package/dist/{types-tOSLpcSa.d.ts → types-CkzE2gPZ.d.ts} +5 -0
- package/dist/{types-LbccjQYX.d.ts → types-DuARPzVa.d.ts} +1 -1
- package/dist/video-selfie.d.ts +1 -1
- package/dist/video-selfie.esm.js +3 -3
- package/dist/{videoSelfieCameraWarmer-BpP0_lDr.esm.js → videoSelfieCameraWarmer-Co4dAC64.esm.js} +3 -3
- package/dist/{videoSelfieStepDetector-CxOc3kSI.d.ts → videoSelfieStepDetector-CrlbZ-rN.d.ts} +2 -2
- package/dist/wasm.d.ts +1 -1
- package/dist/wasm.esm.js +1 -1
- package/dist/workflow.d.ts +1 -1
- package/dist/workflow.esm.js +19 -19
- package/package.json +4 -3
- package/dist/tri-D_gHPWrq.esm.js +0 -402
- package/dist/trueSight-CbrZUzLx.esm.js +0 -1
- package/dist/types-BinnzVrL.d.ts +0 -6
package/dist/tri-D_gHPWrq.esm.js
DELETED
|
@@ -1,402 +0,0 @@
|
|
|
1
|
-
import { t as SDK_VERSION } from "./sdkVersion-kRh5h82H.esm.js";
|
|
2
|
-
import { t as BrowserTimerProvider } from "./BrowserTimerProvider-BXhgNxLt.esm.js";
|
|
3
|
-
import { t as BrowserLazyImportProvider } from "./BrowserLazyImportProvider-BhoA957O.esm.js";
|
|
4
|
-
//#region ../infra/src/providers/browser/TransactionalRiskIntelligenceProvider.ts
|
|
5
|
-
const LAZY_IMPORT_OPTIONS = {
|
|
6
|
-
label: "TRI",
|
|
7
|
-
moduleName: "@incodetech/tri-sdk",
|
|
8
|
-
timeoutMs: 1e4,
|
|
9
|
-
disabledMessage: "TRI will be disabled for this session."
|
|
10
|
-
};
|
|
11
|
-
const importSdk = () => import("./tri.esm-CftnGf9w.esm.js");
|
|
12
|
-
/**
|
|
13
|
-
* Concrete implementation of {@link ITransactionalRiskIntelligenceCapability}.
|
|
14
|
-
*
|
|
15
|
-
* This is the **only** file in the repo that references `@incodetech/tri-sdk`.
|
|
16
|
-
* The third-party module is loaded via a dynamic `import()` the first time
|
|
17
|
-
* {@link setup} is called, so consumers that never opt into TRI (i.e. never
|
|
18
|
-
* pass `tri` to `setup()`) do not pay the bundle cost.
|
|
19
|
-
*
|
|
20
|
-
* `start()`, `stop()`, `reset()`, and `linkInterview()` require a prior
|
|
21
|
-
* successful `setup()` call. The SDK cannot start without the foundation,
|
|
22
|
-
* collection-status check, and managers that `setup()` establishes. Calling
|
|
23
|
-
* these methods before `setup()` is a no-op that returns `'init-failed'` or
|
|
24
|
-
* `false` respectively.
|
|
25
|
-
*
|
|
26
|
-
* The dynamic `import('@incodetech/tri-sdk')` is managed by
|
|
27
|
-
* {@link BrowserLazyImportProvider}, which races the import against a
|
|
28
|
-
* {@link LOAD_TIMEOUT_MS}-ms timeout. On timeout the provider warns, clears
|
|
29
|
-
* the cached promise (so a subsequent `setup()` can retry), and resolves
|
|
30
|
-
* `undefined`, gracefully disabling TRI for the session.
|
|
31
|
-
*/
|
|
32
|
-
var TransactionalRiskIntelligenceProvider = class TransactionalRiskIntelligenceProvider {
|
|
33
|
-
constructor() {
|
|
34
|
-
this._isStarted = false;
|
|
35
|
-
this._isSetUp = false;
|
|
36
|
-
this._lazySdk = BrowserLazyImportProvider.getInstance().create(importSdk, LAZY_IMPORT_OPTIONS);
|
|
37
|
-
}
|
|
38
|
-
static getInstance() {
|
|
39
|
-
return this._instance ??= new TransactionalRiskIntelligenceProvider();
|
|
40
|
-
}
|
|
41
|
-
static resetInstance() {
|
|
42
|
-
this._instance = void 0;
|
|
43
|
-
}
|
|
44
|
-
get isStarted() {
|
|
45
|
-
return this._isStarted;
|
|
46
|
-
}
|
|
47
|
-
get isSetUp() {
|
|
48
|
-
return this._isSetUp;
|
|
49
|
-
}
|
|
50
|
-
get pendingSetup() {
|
|
51
|
-
return this._pendingSetup;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Lazy-loads `@incodetech/tri-sdk` (shared lazy handle) and exchanges the
|
|
55
|
-
* organization API key for a short-lived SDK token via the module's
|
|
56
|
-
* `createSession`. On a load timeout/failure returns an error-shaped session
|
|
57
|
-
* rather than throwing, so the boot path is never blocked.
|
|
58
|
-
*/
|
|
59
|
-
async createSession(apiKey, options) {
|
|
60
|
-
const module = await this._lazySdk.load();
|
|
61
|
-
if (!module) return {
|
|
62
|
-
token: null,
|
|
63
|
-
expiresAt: null,
|
|
64
|
-
tokenType: null,
|
|
65
|
-
eventsCollectionEnabled: false,
|
|
66
|
-
error: {
|
|
67
|
-
status: 0,
|
|
68
|
-
message: "TRI SDK failed to load"
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
return module.createSession(apiKey, {
|
|
72
|
-
...options,
|
|
73
|
-
apiURL: options?.apiURL ?? ""
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Lazy-loads `@incodetech/tri-sdk` on first call (with a {@link LOAD_TIMEOUT_MS}-ms
|
|
78
|
-
* timeout), then delegates to its `setup()`. Returns a promise that resolves
|
|
79
|
-
* once the SDK module has been fetched and the backend collection-status
|
|
80
|
-
* check has completed.
|
|
81
|
-
*
|
|
82
|
-
* When `config.autostart` is `true` (the default), the underlying `setup()`
|
|
83
|
-
* also calls `start()` and returns `'started'` on success. `_isStarted` is
|
|
84
|
-
* updated to reflect the resulting state so that `isTRIStarted()` is
|
|
85
|
-
* accurate immediately after `setup()` returns.
|
|
86
|
-
*
|
|
87
|
-
* The call is {@link pendingSetup} until it settles.
|
|
88
|
-
*/
|
|
89
|
-
setup(config) {
|
|
90
|
-
const setup = this._setup(config).finally(() => {
|
|
91
|
-
if (this._pendingSetup === setup) this._pendingSetup = void 0;
|
|
92
|
-
});
|
|
93
|
-
this._pendingSetup = setup;
|
|
94
|
-
return setup;
|
|
95
|
-
}
|
|
96
|
-
async _setup(config) {
|
|
97
|
-
try {
|
|
98
|
-
const module = await this._lazySdk.load();
|
|
99
|
-
if (!module) return "init-failed";
|
|
100
|
-
const state = await module.default.setup(config);
|
|
101
|
-
this._isSetUp = true;
|
|
102
|
-
if (state === "started") this._isStarted = true;
|
|
103
|
-
return state;
|
|
104
|
-
} catch {
|
|
105
|
-
return "init-failed";
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Begins behavioral data collection. Requires a prior successful `setup()`.
|
|
110
|
-
* Returns `'init-failed'` without starting if called before `setup()`.
|
|
111
|
-
*/
|
|
112
|
-
async start() {
|
|
113
|
-
const state = await (this._getSdk()?.start() ?? Promise.resolve("init-failed"));
|
|
114
|
-
this._isStarted = state === "started";
|
|
115
|
-
return state;
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* Stops all collectors and managers. No-op when called before `setup()`.
|
|
119
|
-
*/
|
|
120
|
-
async stop() {
|
|
121
|
-
const state = await (this._getSdk()?.stop() ?? Promise.resolve("init-failed"));
|
|
122
|
-
this._isStarted = false;
|
|
123
|
-
return state;
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* Resets the TRI SDK to its initial state. No-op when called before `setup()`.
|
|
127
|
-
*/
|
|
128
|
-
async reset() {
|
|
129
|
-
const state = await (this._getSdk()?.reset() ?? Promise.resolve("init-failed"));
|
|
130
|
-
this._isStarted = false;
|
|
131
|
-
this._isSetUp = false;
|
|
132
|
-
return state;
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Links an interview to the current TRI activity. Returns `false` when
|
|
136
|
-
* called before `setup()` or when the backend request fails. Never throws,
|
|
137
|
-
* so the boot/flow path is never blocked by a failed link.
|
|
138
|
-
*
|
|
139
|
-
* @param sessionToken - The Incode session token to link.
|
|
140
|
-
*/
|
|
141
|
-
async linkInterview(sessionToken) {
|
|
142
|
-
try {
|
|
143
|
-
return await this._getSdk()?.linkInterview(sessionToken) ?? false;
|
|
144
|
-
} catch {
|
|
145
|
-
return false;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* TRI's fpSignals PID and DEVICE results. Resolves `null` before `setup()`
|
|
150
|
-
* and on any failure, so a caller can always fall back to its own runtime.
|
|
151
|
-
*/
|
|
152
|
-
async getFpSignals() {
|
|
153
|
-
try {
|
|
154
|
-
return await this._getSdk()?.getFpSignals() ?? null;
|
|
155
|
-
} catch {
|
|
156
|
-
return null;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
/**
|
|
160
|
-
* Passes one signed result of the host's runtime to TRI, unchanged. Returns
|
|
161
|
-
* `false` before `setup()` and on any failure.
|
|
162
|
-
*/
|
|
163
|
-
addFpSignals(signals) {
|
|
164
|
-
try {
|
|
165
|
-
return this._getSdk()?.addFpSignals(signals) ?? false;
|
|
166
|
-
} catch {
|
|
167
|
-
return false;
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
/**
|
|
171
|
-
* The current activity id, or `null` when TRI is not loaded or not set up,
|
|
172
|
-
* has no active activity, or fails. Reads only an already loaded TRI.
|
|
173
|
-
*/
|
|
174
|
-
getActivityId() {
|
|
175
|
-
try {
|
|
176
|
-
return this._getSdk()?.getActivityId() ?? null;
|
|
177
|
-
} catch {
|
|
178
|
-
return null;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
_getSdk() {
|
|
182
|
-
return this._lazySdk.get()?.default ?? null;
|
|
183
|
-
}
|
|
184
|
-
};
|
|
185
|
-
//#endregion
|
|
186
|
-
//#region src/integrations/tri/tri.ts
|
|
187
|
-
const SDK_HOST = {
|
|
188
|
-
platform: "sdk2",
|
|
189
|
-
version: SDK_VERSION
|
|
190
|
-
};
|
|
191
|
-
const FP_SIGNALS_WAIT_MS = 5e3;
|
|
192
|
-
let sdkOwnsTRI = false;
|
|
193
|
-
/**
|
|
194
|
-
* Returns the active TRI capability implementation.
|
|
195
|
-
*
|
|
196
|
-
* Core functions depend on {@link ITransactionalRiskIntelligenceCapability}
|
|
197
|
-
* (the interface) rather than the concrete provider class. The provider is
|
|
198
|
-
* referenced here only to supply the default singleton. This integration
|
|
199
|
-
* module is the single owner of the concrete provider reference — the rest of
|
|
200
|
-
* core goes through these functions ({@link isTRIStarted},
|
|
201
|
-
* {@link resetTRIProviderInstance}, etc.) instead of importing the provider.
|
|
202
|
-
*/
|
|
203
|
-
function getProvider() {
|
|
204
|
-
return TransactionalRiskIntelligenceProvider.getInstance();
|
|
205
|
-
}
|
|
206
|
-
/**
|
|
207
|
-
* Returns `true` when TRI collectors are currently running (a successful
|
|
208
|
-
* `setupTRI()` autostart or explicit `startTRI()`, with no subsequent
|
|
209
|
-
* `stopTRI()`/`resetTRI()`). Returns `false` before setup or after teardown.
|
|
210
|
-
*/
|
|
211
|
-
function isTRIStarted() {
|
|
212
|
-
return getProvider().isStarted;
|
|
213
|
-
}
|
|
214
|
-
/**
|
|
215
|
-
* Discards the cached TRI provider singleton so the next access constructs a
|
|
216
|
-
* fresh instance. Call from the SDK's `reset()` after `resetTRI()` to clear
|
|
217
|
-
* the `isStarted` flag and lazy-import state.
|
|
218
|
-
*/
|
|
219
|
-
function resetTRIProviderInstance() {
|
|
220
|
-
TransactionalRiskIntelligenceProvider.resetInstance();
|
|
221
|
-
}
|
|
222
|
-
/**
|
|
223
|
-
* Exchanges an organization API key for a short-lived TRI SDK token. This is
|
|
224
|
-
* the entry point that triggers the lazy-load of `@incodetech/tri-sdk` (via the
|
|
225
|
-
* provider's dynamic `import()`); the cached lazy handle is reused by a
|
|
226
|
-
* subsequent `setupTRI()`.
|
|
227
|
-
*
|
|
228
|
-
* In production the exchange should happen server-side. On a load timeout or
|
|
229
|
-
* failure the returned session carries `token: null` and an `error`, rather
|
|
230
|
-
* than throwing.
|
|
231
|
-
*
|
|
232
|
-
* @param apiKey - Organization API key.
|
|
233
|
-
* @param options - Optional `apiURL`, `signal`, and `timeout` overrides.
|
|
234
|
-
*/
|
|
235
|
-
async function createTRISession(apiKey, options) {
|
|
236
|
-
return getProvider().createSession(apiKey, options);
|
|
237
|
-
}
|
|
238
|
-
/**
|
|
239
|
-
* Initializes TRI in a single step: resolves the config, calls `setupTRI`
|
|
240
|
-
* (which autostarts unless `config.autostart` is `false`), and optionally
|
|
241
|
-
* links the current Incode session.
|
|
242
|
-
*
|
|
243
|
-
* Returns the resolved {@link TransactionalRiskIntelligenceState}. If the
|
|
244
|
-
* config cannot be resolved (e.g. missing `token` or `apiURL`), returns
|
|
245
|
-
* `'init-failed'` after emitting a `[TRI]` warning.
|
|
246
|
-
*
|
|
247
|
-
* When `config.autostart` is `false`, the underlying `setupTRI` returns
|
|
248
|
-
* `'ready'` without starting collection — call `startTRI()` explicitly when
|
|
249
|
-
* ready (e.g. after a consent gate). Linking is skipped in that case since
|
|
250
|
-
* TRI has not started.
|
|
251
|
-
*
|
|
252
|
-
* A TRI that is already set up, typically by the host through
|
|
253
|
-
* `@incodetech/core/tri`, is reused instead, after any setup still in flight
|
|
254
|
-
* finishes: `config` is ignored (with a `[TRI]` warning), the session is linked
|
|
255
|
-
* to the running activity, and the result is `'started'`, or `'ready'` when it
|
|
256
|
-
* is not running. The host keeps owning it, so `reset()` leaves it running.
|
|
257
|
-
*
|
|
258
|
-
* @param config - TRI setup config (must include `token` and `apiURL`).
|
|
259
|
-
* @param options - Optional session-linking hints (`sessionToken`).
|
|
260
|
-
*/
|
|
261
|
-
async function initializeTRI(config, options = {}) {
|
|
262
|
-
const resolvedTriConfig = resolveTRIConfig(config);
|
|
263
|
-
if (!resolvedTriConfig) return "init-failed";
|
|
264
|
-
const provider = getProvider();
|
|
265
|
-
while (provider.pendingSetup) await provider.pendingSetup;
|
|
266
|
-
if (provider.isSetUp) {
|
|
267
|
-
console.warn("[TRI] Already set up: reusing the running TRI. This tri config is ignored.");
|
|
268
|
-
if (isTRIStarted() && options.sessionToken) await linkSessionWithTRI(options.sessionToken);
|
|
269
|
-
return isTRIStarted() ? "started" : "ready";
|
|
270
|
-
}
|
|
271
|
-
sdkOwnsTRI = true;
|
|
272
|
-
const state = await setupTRI(resolvedTriConfig);
|
|
273
|
-
if (isTRIStarted() && options.sessionToken) await linkSessionWithTRI(options.sessionToken);
|
|
274
|
-
return state;
|
|
275
|
-
}
|
|
276
|
-
/**
|
|
277
|
-
* TRI's fpSignals PID and DEVICE results, waiting at most
|
|
278
|
-
* {@link FP_SIGNALS_WAIT_MS} for the module to finish. Resolves `null` when
|
|
279
|
-
* TRI is not started, its `fpsignals` collector is off or failed (CSP, load
|
|
280
|
-
* error), or the wait ran out. The strings are signed: pass them on unchanged.
|
|
281
|
-
*/
|
|
282
|
-
async function readTRIFpSignals() {
|
|
283
|
-
if (!isTRIStarted()) return null;
|
|
284
|
-
const timer = BrowserTimerProvider.getInstance();
|
|
285
|
-
let timeout;
|
|
286
|
-
const timedOut = new Promise((resolve) => {
|
|
287
|
-
timeout = timer.setTimeout(() => resolve(null), FP_SIGNALS_WAIT_MS);
|
|
288
|
-
});
|
|
289
|
-
try {
|
|
290
|
-
return await Promise.race([getProvider().getFpSignals(), timedOut]);
|
|
291
|
-
} finally {
|
|
292
|
-
if (timeout !== void 0) timer.clearTimeout(timeout);
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
/**
|
|
296
|
-
* Passes one signed result of the SDK's runtime to TRI as an `fp_signals`
|
|
297
|
-
* event, unchanged. Returns `false` when TRI is not started or runs its own
|
|
298
|
-
* `fpsignals` collector.
|
|
299
|
-
*/
|
|
300
|
-
function addTRIFpSignals(signals) {
|
|
301
|
-
return getProvider().addFpSignals(signals);
|
|
302
|
-
}
|
|
303
|
-
/**
|
|
304
|
-
* The id of TRI's current activity, for the host's server to send to the
|
|
305
|
-
* Decision API. Read it right before each request and never keep it: the
|
|
306
|
-
* activity can change while the page is open (after 60 minutes, or on a
|
|
307
|
-
* back-forward cache restore). Returns `null` when TRI is not started or no
|
|
308
|
-
* activity is active. Synchronous; never throws and never loads TRI.
|
|
309
|
-
*/
|
|
310
|
-
function getTRIActivityId() {
|
|
311
|
-
return getProvider().getActivityId();
|
|
312
|
-
}
|
|
313
|
-
/**
|
|
314
|
-
* Calls the provider's `setup()` with the given config. This is the step that
|
|
315
|
-
* lazy-loads `@incodetech/tri-sdk`, validates the config, and checks the
|
|
316
|
-
* backend collection-status endpoint. When `config.autostart` is `true` (the
|
|
317
|
-
* default), also calls `start()` internally and returns `'started'` on
|
|
318
|
-
* success. Pass `autostart: false` to receive `'ready'` and start explicitly.
|
|
319
|
-
*
|
|
320
|
-
* TRI reports the SDK as its host: `{ platform: 'sdk2', version }`.
|
|
321
|
-
*
|
|
322
|
-
* @param config - Resolved TRI config (`token` and `apiURL` required).
|
|
323
|
-
* @returns The resulting {@link TransactionalRiskIntelligenceState}.
|
|
324
|
-
*/
|
|
325
|
-
async function setupTRI(config) {
|
|
326
|
-
return getProvider().setup({
|
|
327
|
-
...config,
|
|
328
|
-
host: SDK_HOST
|
|
329
|
-
});
|
|
330
|
-
}
|
|
331
|
-
/**
|
|
332
|
-
* Begins behavioral data collection. Requires a prior successful `setupTRI()`
|
|
333
|
-
* call with `autostart: false`. Returns `'init-failed'` without starting if
|
|
334
|
-
* called before setup, or is a no-op if already started.
|
|
335
|
-
*
|
|
336
|
-
* @returns The resulting {@link TransactionalRiskIntelligenceState}.
|
|
337
|
-
*/
|
|
338
|
-
async function startTRI() {
|
|
339
|
-
return getProvider().start();
|
|
340
|
-
}
|
|
341
|
-
/**
|
|
342
|
-
* Stops all TRI collectors and managers. Idempotent. No-op if TRI was never
|
|
343
|
-
* set up.
|
|
344
|
-
*/
|
|
345
|
-
async function stopTRI() {
|
|
346
|
-
return getProvider().stop();
|
|
347
|
-
}
|
|
348
|
-
/**
|
|
349
|
-
* Resets the TRI SDK to its initial state. Call this from the SDK's `reset()`
|
|
350
|
-
* so that a subsequent `setupTRI` / `startTRI` can begin fresh.
|
|
351
|
-
*/
|
|
352
|
-
async function resetTRI() {
|
|
353
|
-
return getProvider().reset();
|
|
354
|
-
}
|
|
355
|
-
/**
|
|
356
|
-
* The SDK's `reset()` step for TRI: resets TRI and discards the provider only
|
|
357
|
-
* when `setup({ tri })` set TRI up. A TRI the host set up through
|
|
358
|
-
* `@incodetech/core/tri` keeps its activity, and the next session still links
|
|
359
|
-
* to it.
|
|
360
|
-
*/
|
|
361
|
-
function resetSdkOwnedTRI() {
|
|
362
|
-
if (!sdkOwnsTRI) return;
|
|
363
|
-
sdkOwnsTRI = false;
|
|
364
|
-
resetTRI();
|
|
365
|
-
resetTRIProviderInstance();
|
|
366
|
-
}
|
|
367
|
-
/**
|
|
368
|
-
* Links the current Incode interview session to the active TRI activity.
|
|
369
|
-
*
|
|
370
|
-
* Returns `false` when the session token is missing or TRI has not been set up.
|
|
371
|
-
*
|
|
372
|
-
* @param sessionToken - Incode session JWT.
|
|
373
|
-
*/
|
|
374
|
-
async function linkSessionWithTRI(sessionToken) {
|
|
375
|
-
if (!sessionToken) return false;
|
|
376
|
-
return getProvider().linkInterview(sessionToken);
|
|
377
|
-
}
|
|
378
|
-
/**
|
|
379
|
-
* @private This function is not used outside of this file.
|
|
380
|
-
*
|
|
381
|
-
* Validates a {@link TransactionalRiskIntelligenceSetupConfig} before it is
|
|
382
|
-
* passed to {@link setupTRI}.
|
|
383
|
-
*
|
|
384
|
-
* Returns `null` (with a `[TRI]` warning) when a required field is missing.
|
|
385
|
-
* Returns `null` silently when `config` is `undefined` (intentional opt-out).
|
|
386
|
-
*
|
|
387
|
-
* @param config - Raw setup-time config from `SetupOptions.tri`.
|
|
388
|
-
*/
|
|
389
|
-
function resolveTRIConfig(config) {
|
|
390
|
-
if (!config) return null;
|
|
391
|
-
if (!config.token) {
|
|
392
|
-
console.warn("[TRI] Not initialized: token is required.");
|
|
393
|
-
return null;
|
|
394
|
-
}
|
|
395
|
-
if (!config.apiURL) {
|
|
396
|
-
console.warn("[TRI] Not initialized: apiURL is required.");
|
|
397
|
-
return null;
|
|
398
|
-
}
|
|
399
|
-
return config;
|
|
400
|
-
}
|
|
401
|
-
//#endregion
|
|
402
|
-
export { isTRIStarted as a, resetSdkOwnedTRI as c, startTRI as d, stopTRI as f, initializeTRI as i, resetTRI as l, createTRISession as n, linkSessionWithTRI as o, getTRIActivityId as r, readTRIFpSignals as s, addTRIFpSignals as t, setupTRI as u };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "./trueSightService-BMp8g65B.esm.js";
|
package/dist/types-BinnzVrL.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { i as FlowModuleConfig } from "./types-BZsmNYom.js";
|
|
2
|
-
import { t as BaseFaceCaptureConfig } from "./types-HHgsFhZn.js";
|
|
3
|
-
//#region src/modules/authentication/types.d.ts
|
|
4
|
-
type AuthenticationConfig = FlowModuleConfig['AUTHENTICATION'] & BaseFaceCaptureConfig;
|
|
5
|
-
//#endregion
|
|
6
|
-
export { AuthenticationConfig as t };
|