@coralogix/browser 2.5.0 → 2.7.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/CHANGELOG.md +11 -0
- package/README.md +47 -0
- package/index.esm2.js +690 -605
- package/package.json +1 -1
- package/sessionRecorder.esm.js +666 -582
- package/src/constants.d.ts +6 -1
- package/src/coralogix-rum.d.ts +4 -0
- package/src/instrumentations/CoralogixErrorInstrumentation.d.ts +2 -1
- package/src/instrumentations/instrumentation.consts.d.ts +6 -0
- package/src/instrumentations/web-worker/CoralogixWorkerInstrumentation.d.ts +14 -0
- package/src/instrumentations/web-worker/web-worker.consts.d.ts +12 -0
- package/src/types.d.ts +10 -0
- package/src/utils/compatibility.d.ts +1 -0
- package/src/version.d.ts +1 -1
package/src/constants.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ import { CoralogixScreenshotInstrumentation } from './instrumentations/screensho
|
|
|
12
12
|
import { CoralogixCustomMeasurementInstrumentation } from './instrumentations/custom-measurements';
|
|
13
13
|
import { CoralogixInternalInstrumentation } from './instrumentations/CoralogixInternalInstrumentation';
|
|
14
14
|
import { CoralogixDOMInstrumentation } from './instrumentations/CoralogixDOMInstrumentation';
|
|
15
|
+
import { CoralogixWorkerInstrumentation } from './instrumentations/web-worker/CoralogixWorkerInstrumentation';
|
|
15
16
|
export declare const CORALOGIX_LOGS_URL_SUFFIX = "/browser/v1beta/logs";
|
|
16
17
|
export declare const CORALOGIX_RECORDING_URL_SUFFIX = "/sessionrecording";
|
|
17
18
|
export declare const MAX_EXPORT_BATCH_SIZE = 50;
|
|
@@ -48,7 +49,7 @@ export declare const INSTRUMENTATIONS: readonly [{
|
|
|
48
49
|
readonly disable: false;
|
|
49
50
|
}, {
|
|
50
51
|
readonly Instrument: typeof CoralogixUserInteractionInstrumentation;
|
|
51
|
-
readonly confKey: "
|
|
52
|
+
readonly confKey: "user-interaction";
|
|
52
53
|
readonly disable: false;
|
|
53
54
|
}, {
|
|
54
55
|
readonly Instrument: typeof CoralogixWebVitalsInstrumentation;
|
|
@@ -82,6 +83,10 @@ export declare const INSTRUMENTATIONS: readonly [{
|
|
|
82
83
|
readonly Instrument: typeof CoralogixScreenshotInstrumentation;
|
|
83
84
|
readonly confKey: "screenshot";
|
|
84
85
|
readonly disable: false;
|
|
86
|
+
}, {
|
|
87
|
+
readonly Instrument: typeof CoralogixWorkerInstrumentation;
|
|
88
|
+
readonly confKey: "web_worker";
|
|
89
|
+
readonly disable: false;
|
|
85
90
|
}];
|
|
86
91
|
export declare const CoralogixAttributes: {
|
|
87
92
|
USER_AGENT: string;
|
package/src/coralogix-rum.d.ts
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { CoralogixOtelWebType, CoralogixWindow, CxSpan } from './types';
|
|
2
2
|
import { MemoryUsageContext } from './instrumentations/memory-usage';
|
|
3
3
|
declare global {
|
|
4
|
+
interface Worker {
|
|
5
|
+
CoralogixRum: CoralogixOtelWebType;
|
|
6
|
+
}
|
|
4
7
|
interface Object {
|
|
5
8
|
__cx_global__: unknown;
|
|
6
9
|
}
|
|
7
10
|
interface Window extends CoralogixWindow {
|
|
8
11
|
cachedLogs: CxSpan[];
|
|
12
|
+
Worker: typeof Worker;
|
|
9
13
|
}
|
|
10
14
|
interface Performance {
|
|
11
15
|
measureUserAgentSpecificMemory(): Promise<MemoryUsageContext>;
|
|
@@ -12,7 +12,8 @@ export declare enum ErrorSource {
|
|
|
12
12
|
WINDOW = "window",
|
|
13
13
|
UNHANDLED_REJECTION = "unhandledrejection",
|
|
14
14
|
DOCUMENT = "document",
|
|
15
|
-
CAPTURED = "captured"
|
|
15
|
+
CAPTURED = "captured",
|
|
16
|
+
WEB_WORKER = "web_worker"
|
|
16
17
|
}
|
|
17
18
|
interface CoralogixErrorInstrumentationConfig extends InstrumentationConfig {
|
|
18
19
|
ignoreErrors?: Array<string | RegExp>;
|
|
@@ -9,6 +9,12 @@ export declare const DOM_INSTRUMENTATION_NAME = "dom";
|
|
|
9
9
|
export declare const DOM_INSTRUMENTATION_VERSION = "1.0.0";
|
|
10
10
|
export declare const CUSTOM_MEASUREMENT_INSTRUMENTATION_NAME = "custom_measurement";
|
|
11
11
|
export declare const CUSTOM_MEASUREMENT_INSTRUMENTATION_VERSION = "1.0.0";
|
|
12
|
+
export declare const WORKER_INSTRUMENTATION = "web_worker";
|
|
13
|
+
export declare const WORKER_INSTRUMENTATION_VERSION = "1.0.0";
|
|
14
|
+
export declare const XHR_INSTRUMENTATION_NAME = "xhr";
|
|
15
|
+
export declare const FETCH_INSTRUMENTATION_NAME = "fetch";
|
|
16
|
+
export declare const CUSTOM_INSTRUMENTATION_NAME = "custom";
|
|
17
|
+
export declare const SESSION_RECORDING_INSTRUMENTATION_NAME = "session_recording";
|
|
12
18
|
export declare const ALL_WEB_VITALS_METRICS: CoralogixWebVitalsMetrics;
|
|
13
19
|
export declare const LONGTASK_DURATION = 50;
|
|
14
20
|
export declare const INTERNAL_INSTRUMENTATION_NAME = "internal";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CoralogixOtelWebType } from '../../types';
|
|
2
|
+
import { InstrumentationBase, InstrumentationConfig } from '@opentelemetry/instrumentation';
|
|
3
|
+
import { CoralogixErrorInstrumentation } from '../CoralogixErrorInstrumentation';
|
|
4
|
+
export declare class CoralogixWorkerInstrumentation extends InstrumentationBase {
|
|
5
|
+
private errorInstrumentation;
|
|
6
|
+
coralogixRum: CoralogixOtelWebType;
|
|
7
|
+
constructor(config: InstrumentationConfig, errorInstrumentation: CoralogixErrorInstrumentation | undefined, coralogixRum: CoralogixOtelWebType);
|
|
8
|
+
disable(): void;
|
|
9
|
+
enable(): void;
|
|
10
|
+
init(): void;
|
|
11
|
+
private createCxWorker;
|
|
12
|
+
private attachWorkerErrorHandlers;
|
|
13
|
+
private reportWorkerError;
|
|
14
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const ERROR_TYPES: {
|
|
2
|
+
RUNTIME: string;
|
|
3
|
+
MESSAGE_ERROR: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const ERROR_MESSAGES: {
|
|
6
|
+
readonly UNKNOWN_RUNTIME: "Unknown worker runtime error";
|
|
7
|
+
readonly DESERIALIZATION_FAILED: "Failed to deserialize message from worker";
|
|
8
|
+
};
|
|
9
|
+
export declare const WORKER_EVENTS: {
|
|
10
|
+
readonly ERROR: "error";
|
|
11
|
+
readonly MESSAGE_ERROR: "messageerror";
|
|
12
|
+
};
|
package/src/types.d.ts
CHANGED
|
@@ -198,6 +198,8 @@ export interface CoralogixBrowserSdkConfig {
|
|
|
198
198
|
networkExtraConfig?: NetworkExtraConfig[];
|
|
199
199
|
/** Enable MFE support. Defaults to false */
|
|
200
200
|
supportMfe?: boolean;
|
|
201
|
+
/** Enable Web Worker support. Defaults to false */
|
|
202
|
+
workerSupport?: boolean;
|
|
201
203
|
}
|
|
202
204
|
export interface CoralogixOtelWebType extends SendLog {
|
|
203
205
|
/**
|
|
@@ -461,4 +463,12 @@ export type InputType = 'button' | 'checkbox' | 'color' | 'date' | 'datetime-loc
|
|
|
461
463
|
export interface EditableCxRumEvent extends Omit<CxRumEvent, 'session_context' | 'browser_sdk' | 'timestamp'> {
|
|
462
464
|
session_context: Pick<SessionContext, keyof UserMetadata>;
|
|
463
465
|
}
|
|
466
|
+
interface BrowserCompatibility {
|
|
467
|
+
name: Browser;
|
|
468
|
+
minVersion: number;
|
|
469
|
+
}
|
|
470
|
+
export interface InstrumentationCompatibility {
|
|
471
|
+
browsers: BrowserCompatibility[];
|
|
472
|
+
warningText: string;
|
|
473
|
+
}
|
|
464
474
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isInstrumentationCompatible(confKey: string): boolean;
|
package/src/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.
|
|
1
|
+
export declare const SDK_VERSION = "2.7.0";
|