@incodetech/tri-sdk 0.1.1 → 0.1.2-dev-20260528
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/bundle-analysis.html +4950 -0
- package/dist/chunks/index-BAwek9Id.cjs +489 -0
- package/dist/chunks/index-BAwek9Id.cjs.map +1 -0
- package/dist/chunks/index-BBnHO5vA.js +477 -0
- package/dist/chunks/index-BBnHO5vA.js.map +1 -0
- package/dist/chunks/index-BMVAKptw.cjs +432 -0
- package/dist/chunks/index-BMVAKptw.cjs.map +1 -0
- package/dist/chunks/index-B_sPgtA6.cjs +489 -0
- package/dist/chunks/index-B_sPgtA6.cjs.map +1 -0
- package/dist/chunks/index-BlclLEsV.js +420 -0
- package/dist/chunks/index-BlclLEsV.js.map +1 -0
- package/dist/chunks/index-CECrIW-A.js +420 -0
- package/dist/chunks/index-CECrIW-A.js.map +1 -0
- package/dist/chunks/index-DUZ-lBzx.js +477 -0
- package/dist/chunks/index-DUZ-lBzx.js.map +1 -0
- package/dist/chunks/index-SQXEe_Yi.cjs +432 -0
- package/dist/chunks/index-SQXEe_Yi.cjs.map +1 -0
- package/dist/chunks/index-kx-dpbK_.cjs +432 -0
- package/dist/chunks/index-kx-dpbK_.cjs.map +1 -0
- package/dist/chunks/index-uSwsY9-F.js +420 -0
- package/dist/chunks/index-uSwsY9-F.js.map +1 -0
- package/dist/chunks/start-BnvikGDT.cjs +5059 -0
- package/dist/chunks/start-BnvikGDT.cjs.map +1 -0
- package/dist/chunks/start-CMqC8j2A.cjs +5561 -0
- package/dist/chunks/start-CMqC8j2A.cjs.map +1 -0
- package/dist/chunks/start-CkLlbFOM.cjs +5554 -0
- package/dist/chunks/start-CkLlbFOM.cjs.map +1 -0
- package/dist/chunks/start-CwAEBqvW.js +5057 -0
- package/dist/chunks/start-CwAEBqvW.js.map +1 -0
- package/dist/chunks/start-CymdUpX5.js +5060 -0
- package/dist/chunks/start-CymdUpX5.js.map +1 -0
- package/dist/chunks/start-DTFRIfeO.js +5552 -0
- package/dist/chunks/start-DTFRIfeO.js.map +1 -0
- package/dist/chunks/start-Dpgr8IbP.js +5559 -0
- package/dist/chunks/start-Dpgr8IbP.js.map +1 -0
- package/dist/chunks/start-Dtnxf7k4.cjs +5554 -0
- package/dist/chunks/start-Dtnxf7k4.cjs.map +1 -0
- package/dist/chunks/start-DwQtOigF.cjs +5062 -0
- package/dist/chunks/start-DwQtOigF.cjs.map +1 -0
- package/dist/chunks/start-MKWGpbIO.js +5552 -0
- package/dist/chunks/start-MKWGpbIO.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/tri.cjs.js +1 -1
- package/dist/tri.esm.js +1 -1
- package/dist/tri.umd.js +156 -591
- package/dist/tri.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,477 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module lib/logger
|
|
3
|
+
*
|
|
4
|
+
* @description
|
|
5
|
+
* Singleton logger for the TRI SDK. This is the **only** sanctioned site for
|
|
6
|
+
* `console.*` calls inside `packages/core`. All other modules must import and
|
|
7
|
+
* use the exported `logger` instance rather than calling `console` directly.
|
|
8
|
+
*
|
|
9
|
+
* ### Debug gating
|
|
10
|
+
* Non-fatal methods (`warn`, `error`, `info`) are no-ops when `DEBUG` is
|
|
11
|
+
* `false`. Set `logger.DEBUG = true` — typically driven by the `debug` field
|
|
12
|
+
* in `TRIConfig` — to activate them. No string concatenation happens in the
|
|
13
|
+
* fast path (early return before any allocation).
|
|
14
|
+
*
|
|
15
|
+
* `fatal` always emits regardless of `DEBUG`; use it only for messages that
|
|
16
|
+
* must surface in production (hard misconfigurations, blocked environments).
|
|
17
|
+
*
|
|
18
|
+
* ### Message format
|
|
19
|
+
* `[prefix] message` — prefix is wrapped in square brackets and prepended to
|
|
20
|
+
* the message with a single space. Extra `args` are forwarded to the underlying
|
|
21
|
+
* `console.*` method unchanged so error objects and context values render with
|
|
22
|
+
* full browser-console expansion.
|
|
23
|
+
*/
|
|
24
|
+
const SDK_PREFIX = 'TRI';
|
|
25
|
+
class Logger {
|
|
26
|
+
constructor() {
|
|
27
|
+
this.debugValue = false;
|
|
28
|
+
}
|
|
29
|
+
/** Returns the singleton Logger instance. */
|
|
30
|
+
static get instance() {
|
|
31
|
+
if (!Logger.singleton) {
|
|
32
|
+
Logger.singleton = new Logger();
|
|
33
|
+
}
|
|
34
|
+
return Logger.singleton;
|
|
35
|
+
}
|
|
36
|
+
/** Exposed read-only view of the current debug state. */
|
|
37
|
+
get _DEBUG() {
|
|
38
|
+
return this.debugValue;
|
|
39
|
+
}
|
|
40
|
+
get DEBUG() {
|
|
41
|
+
return this.debugValue;
|
|
42
|
+
}
|
|
43
|
+
set DEBUG(value) {
|
|
44
|
+
this.debugValue = value;
|
|
45
|
+
}
|
|
46
|
+
/** @inheritdoc LoggerInterface.warn */
|
|
47
|
+
warn(prefix, message, ...args) {
|
|
48
|
+
if (!this.debugValue)
|
|
49
|
+
return;
|
|
50
|
+
this._log('warn', prefix, message, ...args);
|
|
51
|
+
}
|
|
52
|
+
/** @inheritdoc LoggerInterface.error */
|
|
53
|
+
error(prefix, message, ...args) {
|
|
54
|
+
if (!this.debugValue)
|
|
55
|
+
return;
|
|
56
|
+
this._log('error', prefix, message, ...args);
|
|
57
|
+
}
|
|
58
|
+
/** @inheritdoc LoggerInterface.info */
|
|
59
|
+
info(prefix, message, ...args) {
|
|
60
|
+
if (!this.debugValue)
|
|
61
|
+
return;
|
|
62
|
+
this._log('info', prefix, message, ...args);
|
|
63
|
+
}
|
|
64
|
+
/** @inheritdoc LoggerInterface.fatal */
|
|
65
|
+
fatal(level, prefix, message, ...args) {
|
|
66
|
+
this._log(level, prefix, message, ...args);
|
|
67
|
+
}
|
|
68
|
+
_log(level, prefix, message, ...args) {
|
|
69
|
+
const modulePrefix = prefix ? `[${prefix}]` : '';
|
|
70
|
+
console[level](`[${SDK_PREFIX}]${modulePrefix} ${message}`, ...args);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
/** Singleton logger instance. Import and use this throughout `packages/core`. */
|
|
74
|
+
const logger = Logger.instance;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* @module sdk/internal/env
|
|
78
|
+
*
|
|
79
|
+
* @description
|
|
80
|
+
* Environment constants and URL resolver for the SDK preflight. This module
|
|
81
|
+
* is part of the **static bundle** — it imports only primitive types and the
|
|
82
|
+
* logger singleton, so it carries no collector-factory cost.
|
|
83
|
+
*
|
|
84
|
+
* Anything that must run before the lazy chunk loads (e.g. `sdk.ts` deciding
|
|
85
|
+
* whether to even fetch the bundle) should import from here rather than from
|
|
86
|
+
* the full `sdk/constants` module.
|
|
87
|
+
*
|
|
88
|
+
* @internal
|
|
89
|
+
*/
|
|
90
|
+
/** How long (ms) to wait for a dynamic `import()` before giving up. */
|
|
91
|
+
const DYNAMIC_IMPORT_TIMEOUT_MS = 10000;
|
|
92
|
+
/** Default value for the `debug` flag when the host omits it. */
|
|
93
|
+
const DEFAULT_DEBUG = false;
|
|
94
|
+
/** Default `apiVersion` string when the host omits it. */
|
|
95
|
+
const DEFAULT_API_VERSION = '1.0';
|
|
96
|
+
/**
|
|
97
|
+
* Lookup from a `TriEnv` value to its corresponding base API URL.
|
|
98
|
+
* Entries with an empty string are **not yet provisioned**; hosts attempting
|
|
99
|
+
* to use them will receive a fatal error at SDK start.
|
|
100
|
+
*/
|
|
101
|
+
const ENV_TO_BASE_API_URL_LOOKUP = {
|
|
102
|
+
STAGE_K8S: 'https://falcon-ingest-k8s.stage.incodetest.com',
|
|
103
|
+
SAAS: '',
|
|
104
|
+
STAGE: '',
|
|
105
|
+
DEMO: '',
|
|
106
|
+
DEMO_K8S: ''
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* All known `TriEnv` keys (including those not yet provisioned with a URL).
|
|
110
|
+
* Used to distinguish a typo/unsupported env from a known-but-unprovisioned one.
|
|
111
|
+
*/
|
|
112
|
+
const SUPPORTED_ENVS = Object.keys(ENV_TO_BASE_API_URL_LOOKUP);
|
|
113
|
+
/**
|
|
114
|
+
* Base API URLs that are fully provisioned and accepted at SDK start.
|
|
115
|
+
* Derived from `ENV_TO_BASE_API_URL_LOOKUP` by filtering empty strings.
|
|
116
|
+
*/
|
|
117
|
+
const SUPPORTED_API_URLS = Object.values(ENV_TO_BASE_API_URL_LOOKUP).filter(Boolean);
|
|
118
|
+
/**
|
|
119
|
+
* Resolves a `TriEnv` value to its base API URL.
|
|
120
|
+
*
|
|
121
|
+
* Returns `undefined` (and logs a fatal) when:
|
|
122
|
+
* - the env is not a known `TriEnv` key, or
|
|
123
|
+
* - the env is known but not yet provisioned (empty URL).
|
|
124
|
+
*/
|
|
125
|
+
function resolveBaseApiURLFromEnv(env) {
|
|
126
|
+
if (!SUPPORTED_ENVS.includes(env)) {
|
|
127
|
+
logger.fatal('error', 'SDK', 'Provided environment is not supported:', env, 'Supported environments are:', SUPPORTED_ENVS.join(', '));
|
|
128
|
+
return undefined;
|
|
129
|
+
}
|
|
130
|
+
const url = ENV_TO_BASE_API_URL_LOOKUP[env];
|
|
131
|
+
if (!url) {
|
|
132
|
+
logger.fatal('error', 'SDK', `env "${env}" is not yet provisioned with a base URL.`);
|
|
133
|
+
return undefined;
|
|
134
|
+
}
|
|
135
|
+
return url;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* @module sdk/internal/preflight-config
|
|
140
|
+
*
|
|
141
|
+
* @description
|
|
142
|
+
* Lightweight config validator that runs in the **static bundle** before the
|
|
143
|
+
* lazy chunk is ever fetched. Its only job is to extract the three values
|
|
144
|
+
* needed for the collection-status preflight check (`apiKey`, `baseApiURL`,
|
|
145
|
+
* `debug`) and return them — or log a fatal and return `null` when the host
|
|
146
|
+
* config is unusable.
|
|
147
|
+
*
|
|
148
|
+
* The full `resolveTRIConfig` function (in `sdk/helpers.ts`) performs a
|
|
149
|
+
* superset of this validation and lives in the lazy chunk. This module exists
|
|
150
|
+
* solely to keep the static bundle free of `COLLECTORS_CONFIG` and every
|
|
151
|
+
* transitively-imported collector factory.
|
|
152
|
+
*
|
|
153
|
+
* @internal
|
|
154
|
+
*/
|
|
155
|
+
/**
|
|
156
|
+
* Extracts and validates the preflight-critical fields from the host-supplied
|
|
157
|
+
* config. Returns `null` (with a fatal log) when any required field is missing
|
|
158
|
+
* or the resolved URL is not provisioned.
|
|
159
|
+
*/
|
|
160
|
+
function resolvePreflightConfig(config) {
|
|
161
|
+
if (!config?.apiKey) {
|
|
162
|
+
logger.fatal('error', 'SDK', 'apiKey is required.');
|
|
163
|
+
return null;
|
|
164
|
+
}
|
|
165
|
+
let baseApiURL;
|
|
166
|
+
if (config.apiURL) {
|
|
167
|
+
if (!SUPPORTED_API_URLS.includes(config.apiURL)) {
|
|
168
|
+
logger.fatal('error', 'SDK', 'Provided apiURL is not supported:', config.apiURL, 'Supported API URLs are:', SUPPORTED_API_URLS.join(', '));
|
|
169
|
+
return null;
|
|
170
|
+
}
|
|
171
|
+
baseApiURL = config.apiURL;
|
|
172
|
+
}
|
|
173
|
+
else if (config.env) {
|
|
174
|
+
baseApiURL = resolveBaseApiURLFromEnv(config.env);
|
|
175
|
+
}
|
|
176
|
+
if (!baseApiURL) {
|
|
177
|
+
logger.fatal('error', 'SDK', "Couldn't initialise SDK — neither apiURL nor env were provided, or the provided value has no provisioned URL.");
|
|
178
|
+
return null;
|
|
179
|
+
}
|
|
180
|
+
return {
|
|
181
|
+
apiKey: config.apiKey,
|
|
182
|
+
baseApiURL,
|
|
183
|
+
debug: config.debug ?? DEFAULT_DEBUG,
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// Pin timer globals at module evaluation time — same hazard model as `_fetch` in
|
|
188
|
+
// lib/http/http.ts. Host APM SDKs and instrumentation libraries routinely wrap
|
|
189
|
+
// setTimeout; capturing the originals ensures our HTTP timeout and retry timers
|
|
190
|
+
// are immune to those patches.
|
|
191
|
+
const _setTimeout = globalThis.setTimeout.bind(globalThis);
|
|
192
|
+
const _clearTimeout = globalThis.clearTimeout.bind(globalThis);
|
|
193
|
+
function safeSync(fn, finallyFn) {
|
|
194
|
+
try {
|
|
195
|
+
return fn();
|
|
196
|
+
}
|
|
197
|
+
catch (error) {
|
|
198
|
+
logger.warn('utils', 'safeSync swallowed error:', error);
|
|
199
|
+
}
|
|
200
|
+
finally {
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
async function safeAsync(fn) {
|
|
204
|
+
try {
|
|
205
|
+
return await fn();
|
|
206
|
+
}
|
|
207
|
+
catch (error) {
|
|
208
|
+
logger.warn('utils', 'safeAsync swallowed error:', error);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
function safeListener(fn) {
|
|
212
|
+
return (event) => safeSync(() => fn(event));
|
|
213
|
+
}
|
|
214
|
+
function safeTimer(fn) {
|
|
215
|
+
return (...args) => {
|
|
216
|
+
try {
|
|
217
|
+
fn(...args);
|
|
218
|
+
}
|
|
219
|
+
catch (error) {
|
|
220
|
+
logger.warn('utils', 'safeTimer swallowed error:', error);
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
function safeSetTimeout(fn, delay) {
|
|
225
|
+
return _setTimeout(safeTimer(fn), delay);
|
|
226
|
+
}
|
|
227
|
+
function safeClearTimeout(id) {
|
|
228
|
+
if (id === null)
|
|
229
|
+
return;
|
|
230
|
+
try {
|
|
231
|
+
_clearTimeout(id);
|
|
232
|
+
}
|
|
233
|
+
catch (error) {
|
|
234
|
+
logger.warn('utils', 'safeClearTimeout swallowed error:', error);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* @module sdk/internal/collection-status
|
|
240
|
+
*
|
|
241
|
+
* @description
|
|
242
|
+
* Preflight check — queries the backend to decide whether the SDK should load
|
|
243
|
+
* its full manager bundle for this session.
|
|
244
|
+
*
|
|
245
|
+
* ### Sanctioned `fetch` exception
|
|
246
|
+
* CLAUDE.md prohibits calling `fetch` outside `src/transport/`. This module is
|
|
247
|
+
* the **only** approved exception outside transport, analogous to the History
|
|
248
|
+
* API wrap in the navigation collector. The preflight runs before the transport
|
|
249
|
+
* layer exists (the lazy chunk hasn't loaded yet), so it must call fetch
|
|
250
|
+
* directly. `_fetch` is captured at module-evaluation time to survive host-side
|
|
251
|
+
* patching of `globalThis.fetch` (same hazard model as `lib/http/http.ts`).
|
|
252
|
+
*
|
|
253
|
+
* @internal
|
|
254
|
+
*/
|
|
255
|
+
const _fetch = globalThis.fetch.bind(globalThis);
|
|
256
|
+
const TIMEOUT_MS = 10000;
|
|
257
|
+
/**
|
|
258
|
+
* Queries `GET {apiURL}/api/v1/events/collection-status` and returns whether the backend has
|
|
259
|
+
* collection enabled for this API key.
|
|
260
|
+
*
|
|
261
|
+
* Returns `false` on any network error, non-OK response, or timeout so that a
|
|
262
|
+
* hung or unreachable backend silently disables the SDK rather than blocking the
|
|
263
|
+
* host application.
|
|
264
|
+
*/
|
|
265
|
+
async function getCollectionStatus(apiURL, apiKey) {
|
|
266
|
+
const controller = new AbortController();
|
|
267
|
+
const timer = setTimeout(() => controller.abort(), TIMEOUT_MS);
|
|
268
|
+
try {
|
|
269
|
+
const base = apiURL.replace(/\/$/, '');
|
|
270
|
+
const response = await _fetch(`${base}/api/v1/events/collection-status`, {
|
|
271
|
+
method: 'GET',
|
|
272
|
+
headers: { 'Content-Type': 'application/json', 'x-api-key': apiKey },
|
|
273
|
+
signal: controller.signal
|
|
274
|
+
});
|
|
275
|
+
if (!response.ok) {
|
|
276
|
+
return false;
|
|
277
|
+
}
|
|
278
|
+
const data = (await response.json());
|
|
279
|
+
return Boolean(data.eventsCollectionEnabled);
|
|
280
|
+
}
|
|
281
|
+
catch (error) {
|
|
282
|
+
logger.warn('CollectionStatus', 'failed to load collection status', error);
|
|
283
|
+
return false;
|
|
284
|
+
}
|
|
285
|
+
finally {
|
|
286
|
+
clearTimeout(timer);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Singleton entry-point for the TRI SDK.
|
|
292
|
+
*
|
|
293
|
+
* Obtain the instance via `TRI.instance`; the constructor is private.
|
|
294
|
+
*
|
|
295
|
+
* ### Life-cycle states
|
|
296
|
+
* The instance moves through three states:
|
|
297
|
+
* - `'idle'` — not started, or fully stopped.
|
|
298
|
+
* - `'starting'` — `start()` has been called; preflight and lazy bundle load in progress.
|
|
299
|
+
* - `'started'` — all managers are running and `reportEvent()` is active.
|
|
300
|
+
*
|
|
301
|
+
* ### Never throws
|
|
302
|
+
* All public methods are fire-and-forget. Errors are logged via `logger` and
|
|
303
|
+
* swallowed so the host application is never disrupted.
|
|
304
|
+
*
|
|
305
|
+
* ### Bundle split
|
|
306
|
+
* Only the preflight config validator and collection-status check live in the
|
|
307
|
+
* static bundle. The full manager wiring (`internal/start.ts`) is dynamically
|
|
308
|
+
* imported only when the backend confirms collection is enabled, keeping the
|
|
309
|
+
* initial page-load cost minimal.
|
|
310
|
+
*/
|
|
311
|
+
let TRI$1 = class TRI {
|
|
312
|
+
constructor() {
|
|
313
|
+
/**
|
|
314
|
+
* Monotonically-increasing counter incremented by every `start()` and
|
|
315
|
+
* `stop()` call. Each in-flight `runStart` captures its own generation value
|
|
316
|
+
* and bails out after every `await` if the counter has moved on, preventing
|
|
317
|
+
* orphaned manager instances from being installed after a concurrent stop.
|
|
318
|
+
*/
|
|
319
|
+
this.startGeneration = 0;
|
|
320
|
+
this.startState = 'idle';
|
|
321
|
+
// All manager fields are set after the lazy chunk loads successfully.
|
|
322
|
+
this.falconServiceManager = null;
|
|
323
|
+
this.activityManager = null;
|
|
324
|
+
this.transportManager = null;
|
|
325
|
+
this.tabManager = null;
|
|
326
|
+
this.lifecycleManager = null;
|
|
327
|
+
this.collectorManager = null;
|
|
328
|
+
this.eventReportManager = null;
|
|
329
|
+
}
|
|
330
|
+
static get instance() {
|
|
331
|
+
if (!TRI._instance) {
|
|
332
|
+
TRI._instance = new TRI();
|
|
333
|
+
}
|
|
334
|
+
return TRI._instance;
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* @description Starts the TRI SDK. Fire-and-forget and idempotent — a second
|
|
338
|
+
* call while the SDK is starting or already started is a no-op. Checks the
|
|
339
|
+
* backend `/collection-status` endpoint and only loads the full manager bundle
|
|
340
|
+
* when collection is enabled. Safe to call in SSR environments; if `document`
|
|
341
|
+
* is unavailable the function logs a fatal and returns without throwing.
|
|
342
|
+
*/
|
|
343
|
+
start(config) {
|
|
344
|
+
if (this.startState !== 'idle') {
|
|
345
|
+
logger.warn('Start', 'start() called more than once — ignoring.');
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
this.startState = 'starting';
|
|
349
|
+
const generation = ++this.startGeneration;
|
|
350
|
+
void this._start(config, generation);
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* @description Stops all collectors, flushes pending events, and tears down
|
|
354
|
+
* every manager. Safe to call more than once. After `stop()`, `start()` may be
|
|
355
|
+
* called again with a fresh config. Any in-flight `start()` is cancelled at
|
|
356
|
+
* the next async checkpoint.
|
|
357
|
+
*/
|
|
358
|
+
stop() {
|
|
359
|
+
++this.startGeneration;
|
|
360
|
+
this.startState = 'idle';
|
|
361
|
+
this.lifecycleManager?.stop();
|
|
362
|
+
this.lifecycleManager = null;
|
|
363
|
+
this.activityManager?.stop();
|
|
364
|
+
this.activityManager = null;
|
|
365
|
+
this.transportManager?.stop();
|
|
366
|
+
this.transportManager = null;
|
|
367
|
+
this.tabManager?.stop();
|
|
368
|
+
this.tabManager = null;
|
|
369
|
+
this.collectorManager?.stop();
|
|
370
|
+
this.collectorManager = null;
|
|
371
|
+
this.eventReportManager?.stop();
|
|
372
|
+
this.eventReportManager = null;
|
|
373
|
+
this.falconServiceManager = null;
|
|
374
|
+
logger.DEBUG = DEFAULT_DEBUG;
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* @description Reports a host-defined event to the TRI backend. Fire-and-forget —
|
|
378
|
+
* never throws and never returns a promise the host must handle. Drops the
|
|
379
|
+
* event silently (with a dev warning) if called before `start` completes.
|
|
380
|
+
*/
|
|
381
|
+
reportEvent(name, metadata) {
|
|
382
|
+
if (this._shouldEarlyEscapeReport()) {
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
385
|
+
void safeAsync(() => this.eventReportManager.report(name, metadata));
|
|
386
|
+
}
|
|
387
|
+
async _start(config, generation) {
|
|
388
|
+
if (typeof document === 'undefined') {
|
|
389
|
+
logger.fatal('error', 'Start', 'start() called in a non-browser environment. The SDK will not start.');
|
|
390
|
+
this.startState = 'idle';
|
|
391
|
+
return;
|
|
392
|
+
}
|
|
393
|
+
// resolvePreflightConfig runs entirely in the static bundle — no collector
|
|
394
|
+
// factories are loaded at this point.
|
|
395
|
+
const preflight = resolvePreflightConfig(config);
|
|
396
|
+
if (!preflight) {
|
|
397
|
+
this.startState = 'idle';
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
400
|
+
const enabled = await getCollectionStatus(preflight.baseApiURL, preflight.apiKey);
|
|
401
|
+
// Bail if stop() or a concurrent start() invalidated this run.
|
|
402
|
+
if (this.startGeneration !== generation) {
|
|
403
|
+
return;
|
|
404
|
+
}
|
|
405
|
+
if (!enabled) {
|
|
406
|
+
this.startState = 'idle';
|
|
407
|
+
return;
|
|
408
|
+
}
|
|
409
|
+
// Flip DEBUG only after the SDK is confirmed to start.
|
|
410
|
+
logger.DEBUG = preflight.debug;
|
|
411
|
+
// Dynamically import the lazy chunk with a hard timeout so a slow/dead
|
|
412
|
+
// CDN does not hang the host application indefinitely.
|
|
413
|
+
let startModule;
|
|
414
|
+
try {
|
|
415
|
+
startModule = await Promise.race([
|
|
416
|
+
import('./start-CwAEBqvW.js'),
|
|
417
|
+
new Promise((_, reject) => setTimeout(() => reject(new Error('dynamic import timed out')), DYNAMIC_IMPORT_TIMEOUT_MS))
|
|
418
|
+
]);
|
|
419
|
+
}
|
|
420
|
+
catch (error) {
|
|
421
|
+
logger.error('Start', 'Failed to load manager bundle:', error);
|
|
422
|
+
if (this.startGeneration === generation) {
|
|
423
|
+
this.startState = 'idle';
|
|
424
|
+
}
|
|
425
|
+
return;
|
|
426
|
+
}
|
|
427
|
+
if (this.startGeneration !== generation) {
|
|
428
|
+
return;
|
|
429
|
+
}
|
|
430
|
+
// The lazy chunk receives the raw config and runs the full resolver internally.
|
|
431
|
+
const managers = await startModule.start(config);
|
|
432
|
+
if (this.startGeneration !== generation) {
|
|
433
|
+
// A concurrent stop() (or new start()) raced us — discard what we built.
|
|
434
|
+
if (managers) {
|
|
435
|
+
managers.lifecycleManager?.stop();
|
|
436
|
+
managers.tabManager?.stop();
|
|
437
|
+
managers.transportManager?.stop();
|
|
438
|
+
void managers.activityManager?.stop();
|
|
439
|
+
}
|
|
440
|
+
return;
|
|
441
|
+
}
|
|
442
|
+
if (!managers) {
|
|
443
|
+
// internal/start.ts already logged the reason.
|
|
444
|
+
this.startState = 'idle';
|
|
445
|
+
return;
|
|
446
|
+
}
|
|
447
|
+
this.falconServiceManager = managers.falconServiceManager;
|
|
448
|
+
this.activityManager = managers.activityManager;
|
|
449
|
+
this.transportManager = managers.transportManager;
|
|
450
|
+
this.tabManager = managers.tabManager;
|
|
451
|
+
this.lifecycleManager = managers.lifecycleManager;
|
|
452
|
+
this.collectorManager = managers.collectorManager;
|
|
453
|
+
this.eventReportManager = managers.eventReportManager;
|
|
454
|
+
this.startState = 'started';
|
|
455
|
+
}
|
|
456
|
+
/**
|
|
457
|
+
* Returns `true` (and logs a dev warning) when `reportEvent()` should be a
|
|
458
|
+
* no-op. Guards against calling before the SDK is fully started, or when
|
|
459
|
+
* the `eventReportManager` is unexpectedly absent.
|
|
460
|
+
*/
|
|
461
|
+
_shouldEarlyEscapeReport() {
|
|
462
|
+
if (this.startState !== 'started') {
|
|
463
|
+
logger.warn('ReportEvent', 'reportEvent() called before start() completed.');
|
|
464
|
+
return true;
|
|
465
|
+
}
|
|
466
|
+
if (!this.eventReportManager) {
|
|
467
|
+
logger.warn('ReportEvent', 'eventReportManager not available.');
|
|
468
|
+
return true;
|
|
469
|
+
}
|
|
470
|
+
return false;
|
|
471
|
+
}
|
|
472
|
+
};
|
|
473
|
+
|
|
474
|
+
const TRI = TRI$1.instance;
|
|
475
|
+
|
|
476
|
+
export { DEFAULT_API_VERSION as D, SUPPORTED_API_URLS as S, TRI as T, DEFAULT_DEBUG as a, safeClearTimeout as b, safeListener as c, safeSetTimeout as d, safeSync as e, logger as l, resolveBaseApiURLFromEnv as r, safeAsync as s };
|
|
477
|
+
//# sourceMappingURL=index-DUZ-lBzx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-DUZ-lBzx.js","sources":["../../src/lib/logger/logger.ts","../../src/sdk/internal/env.ts","../../src/sdk/internal/preflight-config.ts","../../src/utils/fire-and-forget.ts","../../src/sdk/internal/collection-status.ts","../../src/sdk/sdk.ts","../../src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null],"names":["TRIClass"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;AAsBG;AAKH,MAAM,UAAU,GAAG,KAAK;MAEX,MAAM,CAAA;AAKjB,IAAA,WAAA,GAAA;QAFQ,IAAA,CAAA,UAAU,GAAY,KAAK;IAEZ;;AAGhB,IAAA,WAAW,QAAQ,GAAA;AACxB,QAAA,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE;AACrB,YAAA,MAAM,CAAC,SAAS,GAAG,IAAI,MAAM,EAAE;QACjC;QACA,OAAO,MAAM,CAAC,SAAS;IACzB;;AAGA,IAAA,IAAI,MAAM,GAAA;QACR,OAAO,IAAI,CAAC,UAAU;IACxB;AAEA,IAAA,IAAI,KAAK,GAAA;QACP,OAAO,IAAI,CAAC,UAAU;IACxB;IAEA,IAAI,KAAK,CAAC,KAAc,EAAA;AACtB,QAAA,IAAI,CAAC,UAAU,GAAG,KAAK;IACzB;;AAGA,IAAA,IAAI,CAAC,MAA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