@sentry/replay 7.67.0 → 7.68.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/package.json +6 -6
- package/types-ts3.8/constants.d.ts +25 -0
- package/types-ts3.8/coreHandlers/handleAfterSendEvent.d.ts +9 -0
- package/types-ts3.8/coreHandlers/handleClick.d.ts +39 -0
- package/types-ts3.8/coreHandlers/handleDom.d.ts +13 -0
- package/types-ts3.8/coreHandlers/handleFetch.d.ts +9 -0
- package/types-ts3.8/coreHandlers/handleGlobalEvent.d.ts +7 -0
- package/types-ts3.8/coreHandlers/handleHistory.d.ts +11 -0
- package/types-ts3.8/coreHandlers/handleKeyboardEvent.d.ts +7 -0
- package/types-ts3.8/coreHandlers/handleNetworkBreadcrumbs.d.ts +17 -0
- package/types-ts3.8/coreHandlers/handleScope.d.ts +13 -0
- package/types-ts3.8/coreHandlers/handleXhr.d.ts +9 -0
- package/types-ts3.8/coreHandlers/performanceObserver.d.ts +6 -0
- package/types-ts3.8/coreHandlers/util/addBreadcrumbEvent.d.ts +7 -0
- package/types-ts3.8/coreHandlers/util/addNetworkBreadcrumb.d.ts +4 -0
- package/types-ts3.8/coreHandlers/util/domUtils.d.ts +19 -0
- package/types-ts3.8/coreHandlers/util/fetchUtils.d.ts +23 -0
- package/types-ts3.8/coreHandlers/util/getAttributesToRecord.d.ts +5 -0
- package/types-ts3.8/coreHandlers/util/networkUtils.d.ts +23 -0
- package/types-ts3.8/coreHandlers/util/onWindowOpen.d.ts +8 -0
- package/types-ts3.8/coreHandlers/util/shouldSampleForBufferEvent.d.ts +9 -0
- package/types-ts3.8/coreHandlers/util/xhrUtils.d.ts +22 -0
- package/types-ts3.8/eventBuffer/EventBufferArray.d.ts +28 -0
- package/types-ts3.8/eventBuffer/EventBufferCompressionWorker.d.ts +50 -0
- package/types-ts3.8/eventBuffer/EventBufferProxy.d.ts +42 -0
- package/types-ts3.8/eventBuffer/WorkerHandler.d.ts +27 -0
- package/types-ts3.8/eventBuffer/error.d.ts +5 -0
- package/types-ts3.8/eventBuffer/index.d.ts +10 -0
- package/types-ts3.8/index.d.ts +4 -0
- package/types-ts3.8/integration.d.ts +73 -0
- package/types-ts3.8/replay.d.ts +308 -0
- package/types-ts3.8/session/Session.d.ts +8 -0
- package/types-ts3.8/session/clearSession.d.ts +6 -0
- package/types-ts3.8/session/createSession.d.ts +14 -0
- package/types-ts3.8/session/fetchSession.d.ts +6 -0
- package/types-ts3.8/session/index.d.ts +2 -0
- package/types-ts3.8/session/loadOrCreateSession.d.ts +11 -0
- package/types-ts3.8/session/maybeRefreshSession.d.ts +12 -0
- package/types-ts3.8/session/saveSession.d.ts +6 -0
- package/types-ts3.8/types/deprecated.d.ts +16 -0
- package/types-ts3.8/types/index.d.ts +6 -0
- package/types-ts3.8/types/performance.d.ts +124 -0
- package/types-ts3.8/types/replay.d.ts +422 -0
- package/types-ts3.8/types/replayFrame.d.ts +173 -0
- package/types-ts3.8/types/request.d.ts +15 -0
- package/types-ts3.8/types/rrweb.d.ts +37 -0
- package/types-ts3.8/util/addEvent.d.ts +7 -0
- package/types-ts3.8/util/addGlobalListeners.d.ts +6 -0
- package/types-ts3.8/util/addMemoryEntry.d.ts +7 -0
- package/types-ts3.8/util/createBreadcrumb.d.ts +6 -0
- package/types-ts3.8/util/createPerformanceEntries.d.ts +6 -0
- package/types-ts3.8/util/createPerformanceSpans.d.ts +6 -0
- package/types-ts3.8/util/createReplayEnvelope.d.ts +7 -0
- package/types-ts3.8/util/debounce.d.ts +30 -0
- package/types-ts3.8/util/dedupePerformanceEntries.d.ts +11 -0
- package/types-ts3.8/util/eventUtils.d.ts +8 -0
- package/types-ts3.8/util/getPrivacyOptions.d.ts +19 -0
- package/types-ts3.8/util/handleRecordingEmit.d.ts +14 -0
- package/types-ts3.8/util/hasSessionStorage.d.ts +3 -0
- package/types-ts3.8/util/isBrowser.d.ts +5 -0
- package/types-ts3.8/util/isExpired.d.ts +6 -0
- package/types-ts3.8/util/isRrwebError.d.ts +6 -0
- package/types-ts3.8/util/isSampled.d.ts +8 -0
- package/types-ts3.8/util/isSessionExpired.d.ts +10 -0
- package/types-ts3.8/util/log.d.ts +10 -0
- package/types-ts3.8/util/prepareRecordingData.d.ts +9 -0
- package/types-ts3.8/util/prepareReplayEvent.d.ts +15 -0
- package/types-ts3.8/util/sendReplay.d.ts +9 -0
- package/types-ts3.8/util/sendReplayRequest.d.ts +13 -0
- package/types-ts3.8/util/shouldFilterRequest.d.ts +7 -0
- package/types-ts3.8/util/throttle.d.ts +12 -0
- package/types-ts3.8/util/timestamp.d.ts +9 -0
- package/types-ts3.8/util/truncateJson/completeJson.d.ts +9 -0
- package/types-ts3.8/util/truncateJson/constants.d.ts +12 -0
- package/types-ts3.8/util/truncateJson/evaluateJson.d.ts +6 -0
- package/types-ts3.8/util/truncateJson/fixJson.d.ts +6 -0
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/replay",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.68.0",
|
|
4
4
|
"description": "User replays for Sentry",
|
|
5
5
|
"main": "cjs/index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
7
7
|
"types": "types/index.d.ts",
|
|
8
8
|
"typesVersions": {
|
|
9
9
|
"<4.9": {
|
|
10
|
-
"
|
|
10
|
+
"types/index.d.ts": [
|
|
11
11
|
"types-ts3.8/index.d.ts"
|
|
12
12
|
]
|
|
13
13
|
}
|
|
@@ -25,16 +25,16 @@
|
|
|
25
25
|
"homepage": "https://docs.sentry.io/platforms/javascript/session-replay/",
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@babel/core": "^7.17.5",
|
|
28
|
-
"@sentry-internal/replay-worker": "7.
|
|
28
|
+
"@sentry-internal/replay-worker": "7.68.0",
|
|
29
29
|
"@sentry-internal/rrweb": "1.108.0",
|
|
30
30
|
"@sentry-internal/rrweb-snapshot": "1.108.0",
|
|
31
31
|
"jsdom-worker": "^0.2.1",
|
|
32
32
|
"tslib": "^2.4.1 || ^1.9.3"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@sentry/core": "7.
|
|
36
|
-
"@sentry/types": "7.
|
|
37
|
-
"@sentry/utils": "7.
|
|
35
|
+
"@sentry/core": "7.68.0",
|
|
36
|
+
"@sentry/types": "7.68.0",
|
|
37
|
+
"@sentry/utils": "7.68.0"
|
|
38
38
|
},
|
|
39
39
|
"engines": {
|
|
40
40
|
"node": ">=12"
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare const WINDOW: import("@sentry/utils").InternalGlobal & Window;
|
|
2
|
+
export declare const REPLAY_SESSION_KEY = "sentryReplaySession";
|
|
3
|
+
export declare const REPLAY_EVENT_NAME = "replay_event";
|
|
4
|
+
export declare const RECORDING_EVENT_NAME = "replay_recording";
|
|
5
|
+
export declare const UNABLE_TO_SEND_REPLAY = "Unable to send Replay";
|
|
6
|
+
export declare const SESSION_IDLE_PAUSE_DURATION = 300000;
|
|
7
|
+
export declare const SESSION_IDLE_EXPIRE_DURATION = 900000;
|
|
8
|
+
/** Default flush delays */
|
|
9
|
+
export declare const DEFAULT_FLUSH_MIN_DELAY = 5000;
|
|
10
|
+
export declare const DEFAULT_FLUSH_MAX_DELAY = 5500;
|
|
11
|
+
export declare const BUFFER_CHECKOUT_TIME = 60000;
|
|
12
|
+
export declare const RETRY_BASE_INTERVAL = 5000;
|
|
13
|
+
export declare const RETRY_MAX_COUNT = 3;
|
|
14
|
+
export declare const NETWORK_BODY_MAX_SIZE = 150000;
|
|
15
|
+
export declare const CONSOLE_ARG_MAX_SIZE = 5000;
|
|
16
|
+
export declare const SLOW_CLICK_THRESHOLD = 3000;
|
|
17
|
+
export declare const SLOW_CLICK_SCROLL_TIMEOUT = 300;
|
|
18
|
+
/** When encountering a total segment size exceeding this size, stop the replay (as we cannot properly ingest it). */
|
|
19
|
+
export declare const REPLAY_MAX_EVENT_BUFFER_SIZE = 20000000;
|
|
20
|
+
/** Replays must be min. 5s long before we send them. */
|
|
21
|
+
export declare const MIN_REPLAY_DURATION = 4999;
|
|
22
|
+
export declare const MIN_REPLAY_DURATION_LIMIT = 15000;
|
|
23
|
+
/** The max. length of a replay. */
|
|
24
|
+
export declare const MAX_REPLAY_DURATION = 3600000;
|
|
25
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Event, TransportMakeRequestResponse } from '@sentry/types';
|
|
2
|
+
import { ReplayContainer } from '../types';
|
|
3
|
+
type AfterSendEventCallback = (event: Event, sendResponse: TransportMakeRequestResponse | void) => void;
|
|
4
|
+
/**
|
|
5
|
+
* Returns a listener to be added to `client.on('afterSendErrorEvent, listener)`.
|
|
6
|
+
*/
|
|
7
|
+
export declare function handleAfterSendEvent(replay: ReplayContainer): AfterSendEventCallback;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=handleAfterSendEvent.d.ts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Breadcrumb } from '@sentry/types';
|
|
2
|
+
import { ReplayClickDetector, ReplayContainer, SlowClickConfig } from '../types';
|
|
3
|
+
import { addBreadcrumbEvent } from './util/addBreadcrumbEvent';
|
|
4
|
+
/** Handle a click. */
|
|
5
|
+
export declare function handleClick(clickDetector: ReplayClickDetector, clickBreadcrumb: Breadcrumb, node: HTMLElement): void;
|
|
6
|
+
/** A click detector class that can be used to detect slow or rage clicks on elements. */
|
|
7
|
+
export declare class ClickDetector implements ReplayClickDetector {
|
|
8
|
+
protected _lastMutation: number;
|
|
9
|
+
protected _lastScroll: number;
|
|
10
|
+
private _clicks;
|
|
11
|
+
private _teardown;
|
|
12
|
+
private _threshold;
|
|
13
|
+
private _scollTimeout;
|
|
14
|
+
private _timeout;
|
|
15
|
+
private _ignoreSelector;
|
|
16
|
+
private _replay;
|
|
17
|
+
private _checkClickTimeout?;
|
|
18
|
+
private _addBreadcrumbEvent;
|
|
19
|
+
constructor(replay: ReplayContainer, slowClickConfig: SlowClickConfig, _addBreadcrumbEvent?: typeof addBreadcrumbEvent);
|
|
20
|
+
/** Register click detection handlers on mutation or scroll. */
|
|
21
|
+
addListeners(): void;
|
|
22
|
+
/** Clean up listeners. */
|
|
23
|
+
removeListeners(): void;
|
|
24
|
+
/** Handle a click */
|
|
25
|
+
handleClick(breadcrumb: Breadcrumb, node: HTMLElement): void;
|
|
26
|
+
/** Count multiple clicks on elements. */
|
|
27
|
+
private _handleMultiClick;
|
|
28
|
+
/** Get all pending clicks for a given node. */
|
|
29
|
+
private _getClicks;
|
|
30
|
+
/** Check the clicks that happened. */
|
|
31
|
+
private _checkClicks;
|
|
32
|
+
/** Generate matching breadcrumb(s) for the click. */
|
|
33
|
+
private _generateBreadcrumbs;
|
|
34
|
+
/** Schedule to check current clicks. */
|
|
35
|
+
private _scheduleCheckClicks;
|
|
36
|
+
}
|
|
37
|
+
/** exported for tests only */
|
|
38
|
+
export declare function ignoreElement(node: HTMLElement, ignoreSelector: string): boolean;
|
|
39
|
+
//# sourceMappingURL=handleClick.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { INode } from '@sentry-internal/rrweb-snapshot';
|
|
2
|
+
import { Breadcrumb } from '@sentry/types';
|
|
3
|
+
import { ReplayContainer } from '../types';
|
|
4
|
+
import { DomHandlerData } from './util/domUtils';
|
|
5
|
+
export declare const handleDomListener: (replay: ReplayContainer) => (handlerData: DomHandlerData) => void;
|
|
6
|
+
/** Get the base DOM breadcrumb. */
|
|
7
|
+
export declare function getBaseDomBreadcrumb(target: Node | INode | null, message: string): Breadcrumb;
|
|
8
|
+
/**
|
|
9
|
+
* An event handler to react to DOM events.
|
|
10
|
+
* Exported for tests.
|
|
11
|
+
*/
|
|
12
|
+
export declare function handleDom(handlerData: DomHandlerData): Breadcrumb | null;
|
|
13
|
+
//# sourceMappingURL=handleDom.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { HandlerDataFetch } from '@sentry/types';
|
|
2
|
+
import { NetworkRequestData, ReplayContainer, ReplayPerformanceEntry } from '../types';
|
|
3
|
+
/** only exported for tests */
|
|
4
|
+
export declare function handleFetch(handlerData: HandlerDataFetch): null | ReplayPerformanceEntry<NetworkRequestData>;
|
|
5
|
+
/**
|
|
6
|
+
* Returns a listener to be added to `addInstrumentationHandler('fetch', listener)`.
|
|
7
|
+
*/
|
|
8
|
+
export declare function handleFetchSpanListener(replay: ReplayContainer): (handlerData: HandlerDataFetch) => void;
|
|
9
|
+
//# sourceMappingURL=handleFetch.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Event, EventHint } from '@sentry/types';
|
|
2
|
+
import { ReplayContainer } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Returns a listener to be added to `addGlobalEventProcessor(listener)`.
|
|
5
|
+
*/
|
|
6
|
+
export declare function handleGlobalEventListener(replay: ReplayContainer, includeAfterSendEventHandling?: boolean): (event: Event, hint: EventHint) => Event | null;
|
|
7
|
+
//# sourceMappingURL=handleGlobalEvent.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReplayContainer } from '../types';
|
|
2
|
+
interface HistoryHandlerData {
|
|
3
|
+
from: string;
|
|
4
|
+
to: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Returns a listener to be added to `addInstrumentationHandler('history', listener)`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function handleHistorySpanListener(replay: ReplayContainer): (handlerData: HistoryHandlerData) => void;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=handleHistory.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Breadcrumb } from '@sentry/types';
|
|
2
|
+
import { ReplayContainer } from '../types';
|
|
3
|
+
/** Handle keyboard events & create breadcrumbs. */
|
|
4
|
+
export declare function handleKeyboardEvent(replay: ReplayContainer, event: KeyboardEvent): void;
|
|
5
|
+
/** exported only for tests */
|
|
6
|
+
export declare function getKeyboardBreadcrumb(event: KeyboardEvent): Breadcrumb | null;
|
|
7
|
+
//# sourceMappingURL=handleKeyboardEvent.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Breadcrumb, BreadcrumbHint, TextEncoderInternal } from '@sentry/types';
|
|
2
|
+
import { ReplayContainer, ReplayNetworkOptions } from '../types';
|
|
3
|
+
interface ExtendedNetworkBreadcrumbsOptions extends ReplayNetworkOptions {
|
|
4
|
+
replay: ReplayContainer;
|
|
5
|
+
textEncoder: TextEncoderInternal;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* This method does two things:
|
|
9
|
+
* - It enriches the regular XHR/fetch breadcrumbs with request/response size data
|
|
10
|
+
* - It captures the XHR/fetch breadcrumbs to the replay
|
|
11
|
+
* (enriching it with further data that is _not_ added to the regular breadcrumbs)
|
|
12
|
+
*/
|
|
13
|
+
export declare function handleNetworkBreadcrumbs(replay: ReplayContainer): void;
|
|
14
|
+
/** just exported for tests */
|
|
15
|
+
export declare function beforeAddNetworkBreadcrumb(options: ExtendedNetworkBreadcrumbsOptions, breadcrumb: Breadcrumb, hint?: BreadcrumbHint): void;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=handleNetworkBreadcrumbs.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Breadcrumb, Scope } from '@sentry/types';
|
|
2
|
+
import { ReplayContainer } from '../types';
|
|
3
|
+
import { ReplayFrame } from '../types/replayFrame';
|
|
4
|
+
type BreadcrumbWithCategory = Required<Pick<Breadcrumb, 'category'>>;
|
|
5
|
+
export declare const handleScopeListener: (replay: ReplayContainer) => (scope: Scope) => void;
|
|
6
|
+
/**
|
|
7
|
+
* An event handler to handle scope changes.
|
|
8
|
+
*/
|
|
9
|
+
export declare function handleScope(scope: Scope): Breadcrumb | null;
|
|
10
|
+
/** exported for tests only */
|
|
11
|
+
export declare function normalizeConsoleBreadcrumb(breadcrumb: Pick<Breadcrumb, Exclude<keyof Breadcrumb, 'category'>> & BreadcrumbWithCategory): ReplayFrame;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=handleScope.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { HandlerDataXhr } from '@sentry/types';
|
|
2
|
+
import { NetworkRequestData, ReplayContainer, ReplayPerformanceEntry } from '../types';
|
|
3
|
+
/** only exported for tests */
|
|
4
|
+
export declare function handleXhr(handlerData: HandlerDataXhr): ReplayPerformanceEntry<NetworkRequestData> | null;
|
|
5
|
+
/**
|
|
6
|
+
* Returns a listener to be added to `addInstrumentationHandler('xhr', listener)`.
|
|
7
|
+
*/
|
|
8
|
+
export declare function handleXhrSpanListener(replay: ReplayContainer): (handlerData: HandlerDataXhr) => void;
|
|
9
|
+
//# sourceMappingURL=handleXhr.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ReplayContainer } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Sets up a PerformanceObserver to listen to all performance entry types.
|
|
4
|
+
*/
|
|
5
|
+
export declare function setupPerformanceObserver(replay: ReplayContainer): PerformanceObserver;
|
|
6
|
+
//# sourceMappingURL=performanceObserver.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Breadcrumb } from '@sentry/types';
|
|
2
|
+
import { ReplayContainer } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Add a breadcrumb event to replay.
|
|
5
|
+
*/
|
|
6
|
+
export declare function addBreadcrumbEvent(replay: ReplayContainer, breadcrumb: Breadcrumb): void;
|
|
7
|
+
//# sourceMappingURL=addBreadcrumbEvent.d.ts.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { NetworkRequestData, ReplayContainer, ReplayPerformanceEntry } from '../../types';
|
|
2
|
+
/** Add a performance entry breadcrumb */
|
|
3
|
+
export declare function addNetworkBreadcrumb(replay: ReplayContainer, result: ReplayPerformanceEntry<NetworkRequestData> | null): void;
|
|
4
|
+
//# sourceMappingURL=addNetworkBreadcrumb.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { INode } from '@sentry-internal/rrweb-snapshot';
|
|
2
|
+
export interface DomHandlerData {
|
|
3
|
+
name: string;
|
|
4
|
+
event: Node | {
|
|
5
|
+
target: EventTarget;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* For clicks, we check if the target is inside of a button or link
|
|
10
|
+
* If so, we use this as the target instead
|
|
11
|
+
* This is useful because if you click on the image in <button><img></button>,
|
|
12
|
+
* The target will be the image, not the button, which we don't want here
|
|
13
|
+
*/
|
|
14
|
+
export declare function getClickTargetNode(event: DomHandlerData['event'] | MouseEvent): Node | INode | null;
|
|
15
|
+
/** Get the event target node. */
|
|
16
|
+
export declare function getTargetNode(event: Node | {
|
|
17
|
+
target: EventTarget | null;
|
|
18
|
+
}): Node | INode | null;
|
|
19
|
+
//# sourceMappingURL=domUtils.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Breadcrumb, FetchBreadcrumbData, TextEncoderInternal } from '@sentry/types';
|
|
2
|
+
import { FetchHint, ReplayContainer, ReplayNetworkOptions } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Capture a fetch breadcrumb to a replay.
|
|
5
|
+
* This adds additional data (where approriate).
|
|
6
|
+
*/
|
|
7
|
+
export declare function captureFetchBreadcrumbToReplay(breadcrumb: Breadcrumb & {
|
|
8
|
+
data: FetchBreadcrumbData;
|
|
9
|
+
}, hint: FetchHint, options: ReplayNetworkOptions & {
|
|
10
|
+
textEncoder: TextEncoderInternal;
|
|
11
|
+
replay: ReplayContainer;
|
|
12
|
+
}): Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Enrich a breadcrumb with additional data.
|
|
15
|
+
* This has to be sync & mutate the given breadcrumb,
|
|
16
|
+
* as the breadcrumb is afterwards consumed by other handlers.
|
|
17
|
+
*/
|
|
18
|
+
export declare function enrichFetchBreadcrumb(breadcrumb: Breadcrumb & {
|
|
19
|
+
data: FetchBreadcrumbData;
|
|
20
|
+
}, hint: FetchHint, options: {
|
|
21
|
+
textEncoder: TextEncoderInternal;
|
|
22
|
+
}): void;
|
|
23
|
+
//# sourceMappingURL=fetchUtils.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { TextEncoderInternal } from '@sentry/types';
|
|
2
|
+
import { NetworkBody, NetworkRequestData, ReplayNetworkRequestData, ReplayNetworkRequestOrResponse, ReplayPerformanceEntry } from '../../types';
|
|
3
|
+
/** Get the size of a body. */
|
|
4
|
+
export declare function getBodySize(body: RequestInit['body'], textEncoder: TextEncoder | TextEncoderInternal): number | undefined;
|
|
5
|
+
/** Convert a Content-Length header to number/undefined. */
|
|
6
|
+
export declare function parseContentLengthHeader(header: string | null | undefined): number | undefined;
|
|
7
|
+
/** Get the string representation of a body. */
|
|
8
|
+
export declare function getBodyString(body: unknown): string | undefined;
|
|
9
|
+
/** Convert ReplayNetworkRequestData to a PerformanceEntry. */
|
|
10
|
+
export declare function makeNetworkReplayBreadcrumb(type: string, data: ReplayNetworkRequestData | null): ReplayPerformanceEntry<NetworkRequestData> | null;
|
|
11
|
+
/** Get either a JSON network body, or a text representation. */
|
|
12
|
+
export declare function getNetworkBody(bodyText: string | undefined): NetworkBody | undefined;
|
|
13
|
+
/** Build the request or response part of a replay network breadcrumb that was skipped. */
|
|
14
|
+
export declare function buildSkippedNetworkRequestOrResponse(bodySize: number | undefined): ReplayNetworkRequestOrResponse;
|
|
15
|
+
/** Build the request or response part of a replay network breadcrumb. */
|
|
16
|
+
export declare function buildNetworkRequestOrResponse(headers: Record<string, string>, bodySize: number | undefined, body: string | undefined): ReplayNetworkRequestOrResponse | undefined;
|
|
17
|
+
/** Filter a set of headers */
|
|
18
|
+
export declare function getAllowedHeaders(headers: Record<string, string>, allowedHeaders: string[]): Record<string, string>;
|
|
19
|
+
/** Match an URL against a list of strings/Regex. */
|
|
20
|
+
export declare function urlMatches(url: string, urls: (string | RegExp)[]): boolean;
|
|
21
|
+
/** exported for tests */
|
|
22
|
+
export declare function getFullUrl(url: string, baseURI?: string): string;
|
|
23
|
+
//# sourceMappingURL=networkUtils.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type WindowOpenHandler = () => void;
|
|
2
|
+
/**
|
|
3
|
+
* Register a handler to be called when `window.open()` is called.
|
|
4
|
+
* Returns a cleanup function.
|
|
5
|
+
*/
|
|
6
|
+
export declare function onWindowOpen(cb: WindowOpenHandler): () => void;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=onWindowOpen.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Event } from '@sentry/types';
|
|
2
|
+
import { ReplayContainer } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Determine if event should be sampled (only applies in buffer mode).
|
|
5
|
+
* When an event is captured by `hanldleGlobalEvent`, when in buffer mode
|
|
6
|
+
* we determine if we want to sample the error or not.
|
|
7
|
+
*/
|
|
8
|
+
export declare function shouldSampleForBufferEvent(replay: ReplayContainer, event: Event): boolean;
|
|
9
|
+
//# sourceMappingURL=shouldSampleForBufferEvent.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Breadcrumb, TextEncoderInternal, XhrBreadcrumbData } from '@sentry/types';
|
|
2
|
+
import { ReplayContainer, ReplayNetworkOptions, XhrHint } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Capture an XHR breadcrumb to a replay.
|
|
5
|
+
* This adds additional data (where approriate).
|
|
6
|
+
*/
|
|
7
|
+
export declare function captureXhrBreadcrumbToReplay(breadcrumb: Breadcrumb & {
|
|
8
|
+
data: XhrBreadcrumbData;
|
|
9
|
+
}, hint: XhrHint, options: ReplayNetworkOptions & {
|
|
10
|
+
replay: ReplayContainer;
|
|
11
|
+
}): Promise<void>;
|
|
12
|
+
/**
|
|
13
|
+
* Enrich a breadcrumb with additional data.
|
|
14
|
+
* This has to be sync & mutate the given breadcrumb,
|
|
15
|
+
* as the breadcrumb is afterwards consumed by other handlers.
|
|
16
|
+
*/
|
|
17
|
+
export declare function enrichXhrBreadcrumb(breadcrumb: Breadcrumb & {
|
|
18
|
+
data: XhrBreadcrumbData;
|
|
19
|
+
}, hint: XhrHint, options: {
|
|
20
|
+
textEncoder: TextEncoderInternal;
|
|
21
|
+
}): void;
|
|
22
|
+
//# sourceMappingURL=xhrUtils.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { AddEventResult, EventBuffer, EventBufferType, RecordingEvent } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* A basic event buffer that does not do any compression.
|
|
4
|
+
* Used as fallback if the compression worker cannot be loaded or is disabled.
|
|
5
|
+
*/
|
|
6
|
+
export declare class EventBufferArray implements EventBuffer {
|
|
7
|
+
/** All the events that are buffered to be sent. */
|
|
8
|
+
events: RecordingEvent[];
|
|
9
|
+
/** @inheritdoc */
|
|
10
|
+
hasCheckout: boolean;
|
|
11
|
+
private _totalSize;
|
|
12
|
+
constructor();
|
|
13
|
+
/*@inheritdoc */
|
|
14
|
+
readonly hasEvents: boolean;
|
|
15
|
+
/*@inheritdoc */
|
|
16
|
+
readonly type: EventBufferType;
|
|
17
|
+
/** @inheritdoc */
|
|
18
|
+
destroy(): void;
|
|
19
|
+
/** @inheritdoc */
|
|
20
|
+
addEvent(event: RecordingEvent): Promise<AddEventResult>;
|
|
21
|
+
/** @inheritdoc */
|
|
22
|
+
finish(): Promise<string>;
|
|
23
|
+
/** @inheritdoc */
|
|
24
|
+
clear(): void;
|
|
25
|
+
/** @inheritdoc */
|
|
26
|
+
getEarliestTimestamp(): number | null;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=EventBufferArray.d.ts.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ReplayRecordingData } from '@sentry/types';
|
|
2
|
+
import { AddEventResult, EventBuffer, EventBufferType, RecordingEvent } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Event buffer that uses a web worker to compress events.
|
|
5
|
+
* Exported only for testing.
|
|
6
|
+
*/
|
|
7
|
+
export declare class EventBufferCompressionWorker implements EventBuffer {
|
|
8
|
+
/** @inheritdoc */
|
|
9
|
+
hasCheckout: boolean;
|
|
10
|
+
private _worker;
|
|
11
|
+
private _earliestTimestamp;
|
|
12
|
+
private _totalSize;
|
|
13
|
+
constructor(worker: Worker);
|
|
14
|
+
/*@inheritdoc */
|
|
15
|
+
readonly hasEvents: boolean;
|
|
16
|
+
/*@inheritdoc */
|
|
17
|
+
readonly type: EventBufferType;
|
|
18
|
+
/**
|
|
19
|
+
* Ensure the worker is ready (or not).
|
|
20
|
+
* This will either resolve when the worker is ready, or reject if an error occured.
|
|
21
|
+
*/
|
|
22
|
+
ensureReady(): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* Destroy the event buffer.
|
|
25
|
+
*/
|
|
26
|
+
destroy(): void;
|
|
27
|
+
/**
|
|
28
|
+
* Add an event to the event buffer.
|
|
29
|
+
*
|
|
30
|
+
* Returns true if event was successfuly received and processed by worker.
|
|
31
|
+
*/
|
|
32
|
+
addEvent(event: RecordingEvent): Promise<AddEventResult>;
|
|
33
|
+
/**
|
|
34
|
+
* Finish the event buffer and return the compressed data.
|
|
35
|
+
*/
|
|
36
|
+
finish(): Promise<ReplayRecordingData>;
|
|
37
|
+
/** @inheritdoc */
|
|
38
|
+
clear(): void;
|
|
39
|
+
/** @inheritdoc */
|
|
40
|
+
getEarliestTimestamp(): number | null;
|
|
41
|
+
/**
|
|
42
|
+
* Send the event to the worker.
|
|
43
|
+
*/
|
|
44
|
+
private _sendEventToWorker;
|
|
45
|
+
/**
|
|
46
|
+
* Finish the request and return the compressed data from the worker.
|
|
47
|
+
*/
|
|
48
|
+
private _finishRequest;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=EventBufferCompressionWorker.d.ts.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ReplayRecordingData } from '@sentry/types';
|
|
2
|
+
import { AddEventResult, EventBuffer, EventBufferType, RecordingEvent } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* This proxy will try to use the compression worker, and fall back to use the simple buffer if an error occurs there.
|
|
5
|
+
* This can happen e.g. if the worker cannot be loaded.
|
|
6
|
+
* Exported only for testing.
|
|
7
|
+
*/
|
|
8
|
+
export declare class EventBufferProxy implements EventBuffer {
|
|
9
|
+
private _fallback;
|
|
10
|
+
private _compression;
|
|
11
|
+
private _used;
|
|
12
|
+
private _ensureWorkerIsLoadedPromise;
|
|
13
|
+
constructor(worker: Worker);
|
|
14
|
+
/*@inheritdoc */
|
|
15
|
+
readonly type: EventBufferType;
|
|
16
|
+
/*@inheritDoc */
|
|
17
|
+
readonly hasEvents: boolean;
|
|
18
|
+
/*@inheritdoc
|
|
19
|
+
@inheritdoc */
|
|
20
|
+
hasCheckout: boolean;
|
|
21
|
+
/** @inheritDoc */
|
|
22
|
+
destroy(): void;
|
|
23
|
+
/** @inheritdoc */
|
|
24
|
+
clear(): void;
|
|
25
|
+
/** @inheritdoc */
|
|
26
|
+
getEarliestTimestamp(): number | null;
|
|
27
|
+
/**
|
|
28
|
+
* Add an event to the event buffer.
|
|
29
|
+
*
|
|
30
|
+
* Returns true if event was successfully added.
|
|
31
|
+
*/
|
|
32
|
+
addEvent(event: RecordingEvent): Promise<AddEventResult>;
|
|
33
|
+
/** @inheritDoc */
|
|
34
|
+
finish(): Promise<ReplayRecordingData>;
|
|
35
|
+
/** Ensure the worker has loaded. */
|
|
36
|
+
ensureWorkerIsLoaded(): Promise<void>;
|
|
37
|
+
/** Actually check if the worker has been loaded. */
|
|
38
|
+
private _ensureWorkerIsLoaded;
|
|
39
|
+
/** Switch the used buffer to the compression worker. */
|
|
40
|
+
private _switchToCompressionWorker;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=EventBufferProxy.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { WorkerRequest } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Event buffer that uses a web worker to compress events.
|
|
4
|
+
* Exported only for testing.
|
|
5
|
+
*/
|
|
6
|
+
export declare class WorkerHandler {
|
|
7
|
+
private _worker;
|
|
8
|
+
private _id;
|
|
9
|
+
private _ensureReadyPromise?;
|
|
10
|
+
constructor(worker: Worker);
|
|
11
|
+
/**
|
|
12
|
+
* Ensure the worker is ready (or not).
|
|
13
|
+
* This will either resolve when the worker is ready, or reject if an error occured.
|
|
14
|
+
*/
|
|
15
|
+
ensureReady(): Promise<void>;
|
|
16
|
+
/**
|
|
17
|
+
* Destroy the worker.
|
|
18
|
+
*/
|
|
19
|
+
destroy(): void;
|
|
20
|
+
/**
|
|
21
|
+
* Post message to worker and wait for response before resolving promise.
|
|
22
|
+
*/
|
|
23
|
+
postMessage<T>(method: WorkerRequest['method'], arg?: WorkerRequest['arg']): Promise<T>;
|
|
24
|
+
/** Get the current ID and increment it for the next call. */
|
|
25
|
+
private _getAndIncrementId;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=WorkerHandler.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { EventBuffer } from '../types';
|
|
2
|
+
interface CreateEventBufferParams {
|
|
3
|
+
useCompression: boolean;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Create an event buffer for replays.
|
|
7
|
+
*/
|
|
8
|
+
export declare function createEventBuffer({ useCompression }: CreateEventBufferParams): EventBuffer;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { Replay } from './integration';
|
|
2
|
+
export { ReplayEventType, ReplayEventWithTime, ReplayBreadcrumbFrame, ReplayBreadcrumbFrameEvent, ReplayOptionFrameEvent, ReplayFrame, ReplayFrameEvent, ReplaySpanFrame, ReplaySpanFrameEvent, } from './types';
|
|
3
|
+
export * from './types/deprecated';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Integration } from '@sentry/types';
|
|
2
|
+
import { ReplayConfiguration, SendBufferedReplayOptions } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* The main replay integration class, to be passed to `init({ integrations: [] })`.
|
|
5
|
+
*/
|
|
6
|
+
export declare class Replay implements Integration {
|
|
7
|
+
/**
|
|
8
|
+
* @inheritDoc
|
|
9
|
+
*/
|
|
10
|
+
static id: string;
|
|
11
|
+
/**
|
|
12
|
+
* @inheritDoc
|
|
13
|
+
*/
|
|
14
|
+
name: string;
|
|
15
|
+
/**
|
|
16
|
+
* Options to pass to `rrweb.record()`
|
|
17
|
+
*/
|
|
18
|
+
private readonly _recordingOptions;
|
|
19
|
+
/**
|
|
20
|
+
* Initial options passed to the replay integration, merged with default values.
|
|
21
|
+
* Note: `sessionSampleRate` and `errorSampleRate` are not required here, as they
|
|
22
|
+
* can only be finally set when setupOnce() is called.
|
|
23
|
+
*
|
|
24
|
+
* @private
|
|
25
|
+
*/
|
|
26
|
+
private readonly _initialOptions;
|
|
27
|
+
private _replay?;
|
|
28
|
+
constructor({ flushMinDelay, flushMaxDelay, minReplayDuration, maxReplayDuration, stickySession, useCompression, _experiments, sessionSampleRate, errorSampleRate, maskAllText, maskAllInputs, blockAllMedia, mutationBreadcrumbLimit, mutationLimit, slowClickTimeout, slowClickIgnoreSelectors, networkDetailAllowUrls, networkDetailDenyUrls, networkCaptureBodies, networkRequestHeaders, networkResponseHeaders, mask, unmask, block, unblock, ignore, maskFn, beforeAddRecordingEvent, blockClass, blockSelector, maskInputOptions, maskTextClass, maskTextSelector, ignoreClass, }?: ReplayConfiguration);
|
|
29
|
+
/*If replay has already been initialized
|
|
30
|
+
Update _isInitialized */
|
|
31
|
+
protected _isInitialized: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Setup and initialize replay container
|
|
34
|
+
*/
|
|
35
|
+
setupOnce(): void;
|
|
36
|
+
/**
|
|
37
|
+
* Start a replay regardless of sampling rate. Calling this will always
|
|
38
|
+
* create a new session. Will throw an error if replay is already in progress.
|
|
39
|
+
*
|
|
40
|
+
* Creates or loads a session, attaches listeners to varying events (DOM,
|
|
41
|
+
* PerformanceObserver, Recording, Sentry SDK, etc)
|
|
42
|
+
*/
|
|
43
|
+
start(): void;
|
|
44
|
+
/**
|
|
45
|
+
* Start replay buffering. Buffers until `flush()` is called or, if
|
|
46
|
+
* `replaysOnErrorSampleRate` > 0, until an error occurs.
|
|
47
|
+
*/
|
|
48
|
+
startBuffering(): void;
|
|
49
|
+
/**
|
|
50
|
+
* Currently, this needs to be manually called (e.g. for tests). Sentry SDK
|
|
51
|
+
* does not support a teardown
|
|
52
|
+
*/
|
|
53
|
+
stop(): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* If not in "session" recording mode, flush event buffer which will create a new replay.
|
|
56
|
+
* Unless `continueRecording` is false, the replay will continue to record and
|
|
57
|
+
* behave as a "session"-based replay.
|
|
58
|
+
*
|
|
59
|
+
* Otherwise, queue up a flush.
|
|
60
|
+
*/
|
|
61
|
+
flush(options?: SendBufferedReplayOptions): Promise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* Get the current session ID.
|
|
64
|
+
*/
|
|
65
|
+
getReplayId(): string | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Initializes replay.
|
|
68
|
+
*/
|
|
69
|
+
protected _initialize(): void;
|
|
70
|
+
/** Setup the integration. */
|
|
71
|
+
private _setup;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=integration.d.ts.map
|