o11y 266.16.0 → 266.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/modules/o11y/client/shared/Utility.d.ts +3 -1
- package/dist/modules/o11y/collectors/shared/Utility.d.ts +3 -1
- package/dist/modules/o11y/core_envelope/shared/Utility.d.ts +3 -1
- package/dist/modules/o11y/monitors/shared/Utility.d.ts +3 -1
- package/dist/modules/o11y/orchestrator/orchestrator.js +22 -9
- package/dist/modules/o11y/orchestrator/orchestrator.js.map +1 -1
- package/dist/modules/o11y/orchestrator/shared/Utility.d.ts +3 -1
- package/dist/modules/o11y/queue/shared/Utility.d.ts +3 -1
- package/dist/modules/o11y/shared/shared/Utility.d.ts +3 -1
- package/dist/modules/o11y/shared/shared.js +22 -9
- package/dist/modules/o11y/shared/shared.js.map +1 -1
- package/dist/modules/o11y/simple_collector/shared/Utility.d.ts +3 -1
- package/dist/modules/o11y/telemetry_uploader/shared/Utility.d.ts +3 -1
- package/dist/modules/o11y/telemetry_uploader/telemetry_uploader.js +22 -9
- package/dist/modules/o11y/telemetry_uploader/telemetry_uploader.js.map +1 -1
- package/dist/modules/o11y/tenant_class_channel/shared/Utility.d.ts +3 -1
- package/dist/modules/o11y/web_vitals/shared/Utility.d.ts +3 -1
- package/package.json +1 -1
|
@@ -21,7 +21,9 @@ declare class Utility {
|
|
|
21
21
|
generateUniqueId(length?: number): string;
|
|
22
22
|
getXpath(_element: HTMLElement): string;
|
|
23
23
|
getAge(timestamp: number): number;
|
|
24
|
-
|
|
24
|
+
private _getNavigatorSafe;
|
|
25
|
+
private _hasEffectiveConnectionType;
|
|
26
|
+
getConnectionType(): string | undefined;
|
|
25
27
|
clone<T>(value: T): T;
|
|
26
28
|
definedValueOrDefault<T>(value: T, defaultValue: T): T;
|
|
27
29
|
getGlobal(): typeof globalThis;
|
|
@@ -21,7 +21,9 @@ declare class Utility {
|
|
|
21
21
|
generateUniqueId(length?: number): string;
|
|
22
22
|
getXpath(_element: HTMLElement): string;
|
|
23
23
|
getAge(timestamp: number): number;
|
|
24
|
-
|
|
24
|
+
private _getNavigatorSafe;
|
|
25
|
+
private _hasEffectiveConnectionType;
|
|
26
|
+
getConnectionType(): string | undefined;
|
|
25
27
|
clone<T>(value: T): T;
|
|
26
28
|
definedValueOrDefault<T>(value: T, defaultValue: T): T;
|
|
27
29
|
getGlobal(): typeof globalThis;
|
|
@@ -21,7 +21,9 @@ declare class Utility {
|
|
|
21
21
|
generateUniqueId(length?: number): string;
|
|
22
22
|
getXpath(_element: HTMLElement): string;
|
|
23
23
|
getAge(timestamp: number): number;
|
|
24
|
-
|
|
24
|
+
private _getNavigatorSafe;
|
|
25
|
+
private _hasEffectiveConnectionType;
|
|
26
|
+
getConnectionType(): string | undefined;
|
|
25
27
|
clone<T>(value: T): T;
|
|
26
28
|
definedValueOrDefault<T>(value: T, defaultValue: T): T;
|
|
27
29
|
getGlobal(): typeof globalThis;
|
|
@@ -21,7 +21,9 @@ declare class Utility {
|
|
|
21
21
|
generateUniqueId(length?: number): string;
|
|
22
22
|
getXpath(_element: HTMLElement): string;
|
|
23
23
|
getAge(timestamp: number): number;
|
|
24
|
-
|
|
24
|
+
private _getNavigatorSafe;
|
|
25
|
+
private _hasEffectiveConnectionType;
|
|
26
|
+
getConnectionType(): string | undefined;
|
|
25
27
|
clone<T>(value: T): T;
|
|
26
28
|
definedValueOrDefault<T>(value: T, defaultValue: T): T;
|
|
27
29
|
getGlobal(): typeof globalThis;
|
|
@@ -273,14 +273,27 @@ class Utility {
|
|
|
273
273
|
getAge(timestamp) {
|
|
274
274
|
return timestamp - this._timeOrigin;
|
|
275
275
|
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
276
|
+
_getNavigatorSafe() {
|
|
277
|
+
try {
|
|
278
|
+
return typeof navigator !== 'undefined' ? navigator : undefined;
|
|
279
|
+
}
|
|
280
|
+
catch (_a) {
|
|
281
|
+
return undefined;
|
|
282
282
|
}
|
|
283
|
-
|
|
283
|
+
}
|
|
284
|
+
_hasEffectiveConnectionType(value) {
|
|
285
|
+
if (typeof value !== 'object' || value === null || !('connection' in value)) {
|
|
286
|
+
return false;
|
|
287
|
+
}
|
|
288
|
+
const connection = value.connection;
|
|
289
|
+
return (typeof connection === 'object' &&
|
|
290
|
+
connection !== null &&
|
|
291
|
+
'effectiveType' in connection &&
|
|
292
|
+
typeof connection.effectiveType === 'string');
|
|
293
|
+
}
|
|
294
|
+
getConnectionType() {
|
|
295
|
+
const nav = this._getNavigatorSafe();
|
|
296
|
+
return this._hasEffectiveConnectionType(nav) ? nav.connection.effectiveType : undefined;
|
|
284
297
|
}
|
|
285
298
|
clone(value) {
|
|
286
299
|
return JSON.parse(JSON.stringify(value));
|
|
@@ -298,9 +311,9 @@ class Utility {
|
|
|
298
311
|
throw new Error('Unable to locate globalThis or self');
|
|
299
312
|
}
|
|
300
313
|
getIsBeaconSupported() {
|
|
301
|
-
var _a;
|
|
302
314
|
const g = this.getGlobal();
|
|
303
|
-
|
|
315
|
+
const nav = this._getNavigatorSafe();
|
|
316
|
+
return typeof (nav === null || nav === void 0 ? void 0 : nav.sendBeacon) === 'function' && typeof g.Blob === 'function';
|
|
304
317
|
}
|
|
305
318
|
estimateObjectSize(object) {
|
|
306
319
|
const objectSet = new Set();
|