@coralogix/browser 3.23.6 → 4.0.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.
@@ -4,7 +4,8 @@ export declare const CORALOGIX_LOGS_URL_SUFFIX = "/browser/v1beta/logs";
4
4
  export declare const CORALOGIX_RECORDING_URL_SUFFIX = "/sessionrecording";
5
5
  export declare const MFE_METADATA_FILE = "cx-metadata.json";
6
6
  export declare const MFE_METADATA_URL_PATTERN: RegExp;
7
- export declare const MAX_INTERACTION_ELEMENT_SIZE = 1024;
7
+ export declare const MAX_INTERACTION_ELEMENT_SIZE = 100;
8
+ export declare const INTERACTION_TEXT_TRUNCATION_MARKER = " [...]";
8
9
  export declare const MAX_CHARACTERS = 1024;
9
10
  export declare const REQUIRED_CONFIG_KEYS: Array<keyof CoralogixBrowserSdkConfig>;
10
11
  export { SDK_CONFIG_KEY, USER_AGENT_KEY } from './tools/global-keys';
@@ -18,6 +19,8 @@ export declare const MASKED_TEXT = "***";
18
19
  export declare const MASK_CLASS_DEFAULT = "cx-mask";
19
20
  export declare const CX_PREFIX = "cx";
20
21
  export declare const ARIA_LABEL_ATTRIBUTE = "aria-label";
22
+ export declare const TITLE_ATTRIBUTE = "title";
23
+ export declare const ALT_ATTRIBUTE = "alt";
21
24
  export declare const PASSWORD_INPUT_TYPE: InputType;
22
25
  export declare const MASK_INPUT_TYPES_DEFAULT: InputType[];
23
26
  export declare const FINGER_PRINT_KEY = "cx-fingerprint";
@@ -1,6 +1,5 @@
1
1
  import { CustomTracerIgnoredInstruments, GlobalSpan } from './custom-spans.types';
2
- import { Tracer } from '@opentelemetry/sdk-trace-base';
3
- import { Span } from '@opentelemetry/api';
2
+ import { Span, Tracer } from '@opentelemetry/api';
4
3
  export declare function addGlobalSpanByTraceId(traceId: string, globalSpan: GlobalSpan): void;
5
4
  export declare function getGlobalSpanByTraceId(traceId: string): GlobalSpan | undefined;
6
5
  export declare function clearGlobalSpanMap(): void;
package/src/helpers.d.ts CHANGED
@@ -4,10 +4,12 @@ import { CoralogixBrowserSdkConfig, UserAgentData } from './types';
4
4
  import { SnapshotManager } from './snapshot/snapshotManager';
5
5
  import { WebTracerProvider } from '@opentelemetry/sdk-trace-web';
6
6
  import type { ClickScreenshotManager } from './instrumentations/screenshot/click-screenshot-manager';
7
+ import type { DomChangeScreenshotTrigger } from './instrumentations/screenshot/dom-change-screenshot-trigger';
7
8
  export declare function getSnapshotManager(): SnapshotManager;
8
9
  export declare function getSessionManager(): SessionManager;
9
10
  export declare function getSessionRecorder(): SessionRecorder | undefined;
10
11
  export declare function getClickScreenshotManager(): ClickScreenshotManager | undefined;
12
+ export declare function getDomChangeScreenshotTrigger(): DomChangeScreenshotTrigger | undefined;
11
13
  export declare function getSdkConfig(): CoralogixBrowserSdkConfig;
12
14
  export declare function getUserAgentData(): UserAgentData;
13
15
  export declare function clearMemoryFrom(keys: string[]): void;
@@ -3,7 +3,12 @@ export declare const NetworkInstrumentationAttributes: {
3
3
  RESPONSE_HEADERS: string;
4
4
  RESPONSE_PAYLOAD: string;
5
5
  REQUEST_PAYLOAD: string;
6
+ RESPONSE_CONTENT_LENGTH: string;
7
+ STATUS_TEXT: string;
8
+ STATUS_CODE: string;
6
9
  };
10
+ export declare const UNKNOWN_STATUS_TEXT = "Unknown";
11
+ export declare const HTTP_STATUS_TEXT: Record<number, string>;
7
12
  export declare enum FetchSource {
8
13
  FETCH = "fetch"
9
14
  }
@@ -1,2 +1,5 @@
1
1
  import { Span } from '@opentelemetry/api';
2
2
  export declare function checkAttachingNetworkSpanToGlobalSpan(span: Span): void;
3
+ export declare function setResponseContentLength(span: Span, contentLength: string | null | undefined): void;
4
+ export declare function setResponseStatusText(span: Span, statusText: string | null | undefined): void;
5
+ export declare function setResponseStatusCode(span: Span, status: number | undefined): void;
@@ -0,0 +1,28 @@
1
+ import { eventWithTime } from '../../cx-rrweb/rrweb-types';
2
+ import { MirrorNodeResolver } from './dom-change-screenshot.consts';
3
+ export declare class DomChangeScreenshotTrigger {
4
+ private settled;
5
+ private quietTimer;
6
+ private debounceTimer;
7
+ private lastInteractionAt;
8
+ private pendingReason;
9
+ private cachedElementCount;
10
+ private elementCountRefreshedAt;
11
+ private lastCaptureAt;
12
+ private capturesThisView;
13
+ static unregister(): void;
14
+ constructor();
15
+ reset: () => void;
16
+ onNavigation: () => void;
17
+ handleRecordEvent: (event: eventWithTime, resolveNode?: MirrorNodeResolver) => void;
18
+ private isUserInteraction;
19
+ private handleMutation;
20
+ private classify;
21
+ private capture;
22
+ private getElementCount;
23
+ private armSettleTimer;
24
+ private markSettled;
25
+ private clearTimers;
26
+ private clearSettleTimer;
27
+ private clearDebounceTimer;
28
+ }
@@ -0,0 +1,23 @@
1
+ export declare const DOM_CHANGE_SCREENSHOT_TRIGGER_KEY = "rumDomChangeScreenshotTrigger";
2
+ export declare const SETTLE_QUIET_MS = 500;
3
+ export declare const CONTENT_ELEMENT_FLOOR = 50;
4
+ export declare const CHANGE_DEBOUNCE_MS = 400;
5
+ export declare const INTERACTION_TIGHT_MS = 150;
6
+ export declare const INTERACTION_TIGHT_MIN_ELEMENTS = 1;
7
+ export declare const INTERACTION_LOOSE_MS = 1500;
8
+ export declare const INTERACTION_LOOSE_MIN_ELEMENTS = 3;
9
+ export declare const OVERLAY_MAX_DEPTH = 3;
10
+ export declare const MAX_DEPTH_WALK = 40;
11
+ export declare const OVERLAY_MAX_REMOVES_ABSOLUTE = 2;
12
+ export declare const OVERLAY_MAX_REMOVES_FRACTION = 0.1;
13
+ export declare const VIEW_CHANGE_FRACTION = 0.02;
14
+ export declare const VIEW_CHANGE_MIN_WEIGHT = 25;
15
+ export declare const NODE_COUNT_REFRESH_MS = 2000;
16
+ export declare const MIN_CAPTURE_INTERVAL_MS = 2000;
17
+ export declare const MAX_CAPTURES_PER_VIEW = 10;
18
+ export declare const MAX_NODES_FOR_CAPTURE = 20000;
19
+ export type MirrorNodeResolver = (id: number) => Node | null;
20
+ export declare const enum DomChangeReason {
21
+ Overlay = "dom-overlay",
22
+ ViewChange = "dom-view-change"
23
+ }
@@ -0,0 +1 @@
1
+ export declare function canCaptureAutomaticScreenshot(): boolean;
@@ -1,2 +1,4 @@
1
1
  export declare const SCREENSHOT_INSTRUMENTATION_NAME = "screenshot";
2
2
  export declare const SCREENSHOT_INSTRUMENTATION_VERSION = "1.0.0";
3
+ export declare const MAX_SCREENSHOT_ACTIONS = 100;
4
+ export declare function collectDomActionNames(limit?: number): string[];
@@ -1,13 +1,13 @@
1
1
  import { CoralogixBrowserSdkConfig } from '../../types';
2
+ export declare const CLICKABLE_SELECTOR: string;
2
3
  export declare function extractActionName(el: Element | HTMLElement | null): string;
3
4
  export declare function extractAriaLabel(el: Element | HTMLElement | null): string;
4
5
  export declare function extractTestId(el: Element | HTMLElement | null): string;
5
- export declare function extractResolvedName({ isDeadClick, element, config, actionName, ariaLabel, }: {
6
+ export declare function extractResolvedName({ isDeadClick, element, config, actionName, }: {
6
7
  isDeadClick: boolean;
7
8
  element: Element | HTMLElement | null;
8
9
  config: CoralogixBrowserSdkConfig;
9
10
  actionName: string;
10
- ariaLabel: string;
11
11
  }): string;
12
12
  export declare function extractMaskedOrTextContent(clickableElement: Element | HTMLElement | null, config: CoralogixBrowserSdkConfig): string;
13
13
  export declare function getClassName(element: Element | HTMLElement): string;
@@ -30,6 +30,7 @@ export interface CxRumSpanAttributes extends Attributes {
30
30
  'cx_rum.network_request_context.url'?: string;
31
31
  'cx_rum.network_request_context.status_code'?: number;
32
32
  'cx_rum.network_request_context.method'?: string;
33
+ 'cx_rum.network_request_context.response_content_length'?: number;
33
34
  }
34
35
  export declare function buildCxRumSpanAttributes(attrs: CxRumSpanAttributes): Attributes;
35
36
  export declare function buildRumContextAttributes(cxRumEvent: CxRumEvent, resolvedLabels: CoralogixRumLabels): Attributes;
@@ -12,6 +12,7 @@ export interface SessionRecordingConfig extends Omit<recordOptions<eventWithTime
12
12
  sessionRecordingSampleRate?: number;
13
13
  workerUrl?: string;
14
14
  immediateFlush?: boolean;
15
+ captureScreenshotOnDomChange?: boolean;
15
16
  }
16
17
  export interface SessionWithErrorConfig {
17
18
  enable: boolean;
@@ -29,6 +29,7 @@ export declare class SessionRecorder {
29
29
  getSegmentIndexCounter(): Record<string, number>;
30
30
  private restoreSegmentIndexCounter;
31
31
  getIsAutoStartRecording(): boolean;
32
+ isRecordingActive(): boolean;
32
33
  isConsoleRecordingActive(): boolean;
33
34
  set recordingStopDueToTimeout(value: boolean);
34
35
  get recordingStopDueToTimeout(): boolean;
@@ -0,0 +1,2 @@
1
+ export declare const wrap: <Nodule extends object, FieldName extends keyof Nodule>(nodule: Nodule, name: FieldName, wrapper: (original: Nodule[FieldName], name: FieldName) => Nodule[FieldName]) => Nodule[FieldName] | undefined;
2
+ export declare const unwrap: <Nodule extends object>(nodule: Nodule, name: keyof Nodule) => void;
package/src/types.d.ts CHANGED
@@ -73,6 +73,7 @@ export interface CustomTargetElement extends HTMLElement {
73
73
  export interface ScreenshotContext {
74
74
  id: string;
75
75
  description?: string;
76
+ actions?: string[];
76
77
  }
77
78
  export interface DomContext {
78
79
  visibility_state: DocumentVisibilityState;
@@ -234,7 +235,7 @@ export interface NetworkRequestContext {
234
235
  subdomain?: string;
235
236
  domain?: string;
236
237
  status_text: string;
237
- response_content_length: string;
238
+ response_content_length?: number;
238
239
  duration: number;
239
240
  source: EventSource;
240
241
  request_headers?: Map<string, string>;
@@ -430,13 +431,10 @@ export interface PrevSession extends Session {
430
431
  hasScreenshot: boolean;
431
432
  }
432
433
  export declare enum OtelNetworkAttrs {
433
- METHOD = "http.method",
434
- URL = "http.url",
435
- STATUS_CODE = "http.status_code",
436
- HOST = "http.host",
437
- SCHEME = "http.scheme",
438
- STATUS_TEXT = "http.status_text",
439
- RESPONSE_CONTENT_LENGTH = "http.response_content_length"
434
+ METHOD = "http.request.method",
435
+ URL = "url.full",
436
+ STATUS_CODE = "http.response.status_code",
437
+ HOST = "server.address"
440
438
  }
441
439
  export type Browser = 'Chrome' | 'Edge' | 'Firefox' | 'Safari' | 'Opera' | 'IE' | 'Unknown';
442
440
  export type OS = 'Windows' | 'MacOS' | 'Linux' | 'iOS' | 'Android' | 'Tizen' | 'webOS' | 'Unknown';
package/src/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "3.23.6";
1
+ export declare const SDK_VERSION = "4.0.0";