@sentry/replay 0.4.8 → 0.5.1
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/index.es.js +168 -108
- package/dist/index.js +166 -106
- package/dist/index.js.map +1 -1
- package/dist/{config/dist → types}/src/api/captureReplay.d.ts +0 -0
- package/dist/{config/dist → types}/src/api/captureReplayUpdate.d.ts +0 -0
- package/dist/{config/dist → types}/src/coreHandlers/getBreadcrumbHandler.d.ts +0 -0
- package/dist/{config/dist → types}/src/coreHandlers/getSpanHandler.d.ts +0 -0
- package/dist/{config/dist → types}/src/coreHandlers/handleDom.d.ts +0 -0
- package/dist/{config/dist → types}/src/coreHandlers/handleFetch.d.ts +0 -0
- package/dist/{config/dist → types}/src/coreHandlers/handleHistory.d.ts +0 -0
- package/dist/{config/dist → types}/src/coreHandlers/handleScope.d.ts +0 -0
- package/dist/{config/dist → types}/src/coreHandlers/handleXhr.d.ts +0 -0
- package/dist/{config/dist → types}/src/createPerformanceEntry.d.ts +0 -0
- package/dist/{dist → types/src}/eventBuffer.d.ts +11 -4
- package/dist/{config/dist → types}/src/flags.d.ts +0 -0
- package/dist/{dist → types/src}/index.d.ts +11 -7
- package/dist/{config/dist → types}/src/session/Session.d.ts +0 -0
- package/dist/{config/dist → types}/src/session/constants.d.ts +2 -2
- package/dist/{config/dist → types}/src/session/createSession.d.ts +0 -0
- package/dist/{config/dist → types}/src/session/fetchSession.d.ts +0 -0
- package/dist/{config/dist → types}/src/session/getSession.d.ts +0 -0
- package/dist/{config/dist → types}/src/session/index.d.ts +0 -0
- package/dist/{config/dist → types}/src/session/saveSession.d.ts +0 -0
- package/dist/{config/dist → types}/src/types.d.ts +2 -1
- package/dist/{config/dist → types}/src/util/createBreadcrumb.d.ts +0 -0
- package/dist/{config/dist → types}/src/util/createPayload.d.ts +0 -0
- package/dist/{config/dist → types}/src/util/isExpired.d.ts +0 -0
- package/dist/{config/dist → types}/src/util/isIngestHost.d.ts +0 -0
- package/dist/{config/dist → types}/src/util/isSampled.d.ts +0 -0
- package/dist/{config/dist → types}/src/util/isSessionExpired.d.ts +0 -0
- package/dist/{config/dist → types}/src/util/logger.d.ts +0 -0
- package/dist/{config/dist → types}/src/util/supportsSendBeacon.d.ts +0 -0
- package/package.json +2 -2
- package/dist/config/dist/jest.config.d.ts +0 -3
- package/dist/config/dist/jest.setup.d.ts +0 -10
- package/dist/config/dist/src/coreHandlers/handleFetch.test.d.ts +0 -1
- package/dist/config/dist/src/coreHandlers/handleScope-unit.test.d.ts +0 -1
- package/dist/config/dist/src/coreHandlers/handleScope.test.d.ts +0 -1
- package/dist/config/dist/src/coreHandlers/index.d.ts +0 -4
- package/dist/config/dist/src/createPerformanceEntry.test.d.ts +0 -1
- package/dist/config/dist/src/eventBuffer.d.ts +0 -38
- package/dist/config/dist/src/eventBuffer.test.d.ts +0 -1
- package/dist/config/dist/src/index-captureOnlyOnError.test.d.ts +0 -1
- package/dist/config/dist/src/index-noSticky.test.d.ts +0 -1
- package/dist/config/dist/src/index-sampling.test.d.ts +0 -1
- package/dist/config/dist/src/index.d.ts +0 -220
- package/dist/config/dist/src/index.test.d.ts +0 -1
- package/dist/config/dist/src/session/Session.test.d.ts +0 -1
- package/dist/config/dist/src/session/createSession.test.d.ts +0 -1
- package/dist/config/dist/src/session/fetchSession.test.d.ts +0 -1
- package/dist/config/dist/src/session/getSession.test.d.ts +0 -1
- package/dist/config/dist/src/session/saveSession.test.d.ts +0 -1
- package/dist/config/dist/src/util/isExpired.test.d.ts +0 -1
- package/dist/config/dist/src/util/isSampled.test.d.ts +0 -1
- package/dist/config/dist/src/util/isSessionExpired.test.d.ts +0 -1
- package/dist/config/dist/test/index.d.ts +0 -3
- package/dist/config/dist/test/mocks/mockRrweb.d.ts +0 -15
- package/dist/config/dist/test/mocks/mockSdk.d.ts +0 -11
- package/dist/dist/api/captureReplay.d.ts +0 -10
- package/dist/dist/api/captureReplayUpdate.d.ts +0 -12
- package/dist/dist/coreHandlers/getBreadcrumbHandler.d.ts +0 -3
- package/dist/dist/coreHandlers/getSpanHandler.d.ts +0 -5
- package/dist/dist/coreHandlers/handleDom.d.ts +0 -1
- package/dist/dist/coreHandlers/handleFetch.d.ts +0 -19
- package/dist/dist/coreHandlers/handleHistory.d.ts +0 -7
- package/dist/dist/coreHandlers/handleScope.d.ts +0 -2
- package/dist/dist/coreHandlers/handleXhr.d.ts +0 -21
- package/dist/dist/createPerformanceEntry.d.ts +0 -42
- package/dist/dist/flags.d.ts +0 -2
- package/dist/dist/session/Session.d.ts +0 -63
- package/dist/dist/session/constants.d.ts +0 -5
- package/dist/dist/session/createSession.d.ts +0 -19
- package/dist/dist/session/fetchSession.d.ts +0 -5
- package/dist/dist/session/getSession.d.ts +0 -28
- package/dist/dist/session/index.d.ts +0 -1
- package/dist/dist/session/saveSession.d.ts +0 -2
- package/dist/dist/types.d.ts +0 -90
- package/dist/dist/util/createBreadcrumb.d.ts +0 -4
- package/dist/dist/util/isExpired.d.ts +0 -5
- package/dist/dist/util/isIngestHost.d.ts +0 -4
- package/dist/dist/util/isSampled.d.ts +0 -7
- package/dist/dist/util/isSessionExpired.d.ts +0 -5
- package/dist/dist/util/logger.d.ts +0 -12
- package/dist/dist/util/supportsSendBeacon.d.ts +0 -4
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RecordingEvent, WorkerRequest } from './types';
|
|
1
|
+
import { RecordingEvent, WorkerRequest, WorkerResponse } from './types';
|
|
2
2
|
interface CreateEventBufferParams {
|
|
3
3
|
useCompression: boolean;
|
|
4
4
|
}
|
|
@@ -26,12 +26,19 @@ export declare class EventBufferCompressionWorker implements IEventBuffer {
|
|
|
26
26
|
* Read-only incrementing counter
|
|
27
27
|
*/
|
|
28
28
|
get id(): number;
|
|
29
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Post message to worker and wait for response before resolving promise.
|
|
31
|
+
*/
|
|
32
|
+
postMessage({ id, method, args, }: WorkerRequest): Promise<WorkerResponse['response']>;
|
|
30
33
|
init(): void;
|
|
31
34
|
destroy(): void;
|
|
35
|
+
/**
|
|
36
|
+
* Note that this may not reflect what is actually in the event buffer. This
|
|
37
|
+
* is only a local count of the buffer size since `addEvent` is async.
|
|
38
|
+
*/
|
|
32
39
|
get length(): number;
|
|
33
|
-
addEvent(event: RecordingEvent, isCheckout?: boolean):
|
|
34
|
-
sendEventToWorker: (event: RecordingEvent) =>
|
|
40
|
+
addEvent(event: RecordingEvent, isCheckout?: boolean): Promise<string | Uint8Array>;
|
|
41
|
+
sendEventToWorker: (event: RecordingEvent) => Promise<string | Uint8Array>;
|
|
35
42
|
finishRequest: (id: number) => Promise<Uint8Array>;
|
|
36
43
|
finish(): Promise<Uint8Array>;
|
|
37
44
|
}
|
|
File without changes
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Breadcrumb,
|
|
1
|
+
import { Breadcrumb, Event, Integration } from '@sentry/types';
|
|
2
2
|
import { CaptureReplayParams } from './api/captureReplay';
|
|
3
3
|
import { CaptureReplayUpdateParams } from './api/captureReplayUpdate';
|
|
4
4
|
import { Session } from './session/Session';
|
|
5
5
|
import { ReplayPerformanceEntry } from './createPerformanceEntry';
|
|
6
6
|
import { IEventBuffer } from './eventBuffer';
|
|
7
|
-
import type { InstrumentationTypeBreadcrumb, InstrumentationTypeSpan, RecordingConfig, RecordingEvent, ReplayRequest, SentryReplayConfiguration, SentryReplayPluginOptions } from './types';
|
|
7
|
+
import type { InstrumentationTypeBreadcrumb, InstrumentationTypeSpan, RecordedEvents, RecordingConfig, RecordingEvent, ReplayRequest, SentryReplayConfiguration, SentryReplayPluginOptions } from './types';
|
|
8
8
|
/**
|
|
9
9
|
* Returns true to return control to calling function, otherwise continue with normal batching
|
|
10
10
|
*/
|
|
@@ -58,7 +58,6 @@ export declare class SentryReplay implements Integration {
|
|
|
58
58
|
private initialState;
|
|
59
59
|
private context;
|
|
60
60
|
session: Session | undefined;
|
|
61
|
-
static attachmentUrlFromDsn(dsn: DsnComponents, eventId: string): string;
|
|
62
61
|
constructor({ flushMinDelay, flushMaxDelay, initialFlushDelay, stickySession, // TBD: Making this opt-in for now
|
|
63
62
|
useCompression, captureOnlyOnError, replaysSamplingRate, recordingConfig: { maskAllInputs, blockClass, ignoreClass, maskTextClass, ...recordingOptions }, }?: SentryReplayConfiguration);
|
|
64
63
|
/**
|
|
@@ -176,14 +175,19 @@ export declare class SentryReplay implements Integration {
|
|
|
176
175
|
*/
|
|
177
176
|
createCustomBreadcrumb(breadcrumb: Breadcrumb): void;
|
|
178
177
|
/**
|
|
179
|
-
* Create a span for each performance entry. The parent transaction is `this.replayEvent`.
|
|
178
|
+
* Create a "span" for each performance entry. The parent transaction is `this.replayEvent`.
|
|
180
179
|
*/
|
|
181
|
-
createPerformanceSpans(entries: ReplayPerformanceEntry[]): void
|
|
180
|
+
createPerformanceSpans(entries: ReplayPerformanceEntry[]): Promise<void[]>;
|
|
182
181
|
/**
|
|
183
182
|
* Observed performance events are added to `this.performanceEvents`. These
|
|
184
183
|
* are included in the replay event before it is finished and sent to Sentry.
|
|
185
184
|
*/
|
|
186
|
-
addPerformanceEntries(): void
|
|
185
|
+
addPerformanceEntries(): Promise<void[]>;
|
|
186
|
+
/**
|
|
187
|
+
* Create a "span" for the total amount of memory being used by JS objects
|
|
188
|
+
* (including v8 internal objects).
|
|
189
|
+
*/
|
|
190
|
+
addMemoryEntry(): Promise<void[]>;
|
|
187
191
|
/**
|
|
188
192
|
*
|
|
189
193
|
*
|
|
@@ -215,6 +219,6 @@ export declare class SentryReplay implements Integration {
|
|
|
215
219
|
/**
|
|
216
220
|
* Finalize and send the current replay event to Sentry
|
|
217
221
|
*/
|
|
218
|
-
sendReplay(eventId: string, events:
|
|
222
|
+
sendReplay(eventId: string, events: RecordedEvents): Promise<boolean>;
|
|
219
223
|
}
|
|
220
224
|
export {};
|
|
File without changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const REPLAY_SESSION_KEY = "sentryReplaySession";
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const
|
|
2
|
+
export declare const REPLAY_EVENT_NAME = "replay_event";
|
|
3
|
+
export declare const RECORDING_EVENT_NAME = "replay_recording";
|
|
4
4
|
export declare const SESSION_IDLE_DURATION = 900000;
|
|
5
5
|
export declare const VISIBILITY_CHANGE_TIMEOUT = 900000;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -2,9 +2,10 @@ import { record } from 'rrweb';
|
|
|
2
2
|
import type { eventWithTime } from 'rrweb/typings/types';
|
|
3
3
|
export declare type RecordingEvent = eventWithTime;
|
|
4
4
|
export declare type RecordingConfig = Parameters<typeof record>[0];
|
|
5
|
+
export declare type RecordedEvents = Uint8Array | string;
|
|
5
6
|
export interface ReplayRequest {
|
|
6
7
|
endpoint: string;
|
|
7
|
-
events:
|
|
8
|
+
events: RecordedEvents;
|
|
8
9
|
}
|
|
9
10
|
export declare type InstrumentationTypeBreadcrumb = 'dom' | 'scope';
|
|
10
11
|
export declare type InstrumentationTypeSpan = 'fetch' | 'xhr' | 'history';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/replay",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "User replays for Sentry",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.es.js",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"bootstrap": "yarn && cd demo && yarn",
|
|
9
9
|
"build": "yarn rollup --configPlugin @rollup/plugin-typescript",
|
|
10
|
-
"build:all": "yarn
|
|
10
|
+
"build:all": "yarn clean && yarn build:worker && yarn build:core",
|
|
11
11
|
"build:dev": "NODE_ENV=development yarn build:all",
|
|
12
12
|
"build:prod": "NODE_ENV=production yarn build:all",
|
|
13
13
|
"build:core": "yarn build --config config/rollup.config.core.ts",
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="jest" />
|
|
2
|
-
import { Session } from '@/session/Session';
|
|
3
|
-
declare global {
|
|
4
|
-
namespace jest {
|
|
5
|
-
interface Matchers<R> {
|
|
6
|
-
toHaveSentReplay(expected?: string | Uint8Array): CustomMatcherResult;
|
|
7
|
-
toHaveSameSession(expected: Session): CustomMatcherResult;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { RecordingEvent, WorkerRequest } from './types';
|
|
2
|
-
interface CreateEventBufferParams {
|
|
3
|
-
useCompression: boolean;
|
|
4
|
-
}
|
|
5
|
-
export declare function createEventBuffer({ useCompression }: CreateEventBufferParams): EventBufferCompressionWorker | EventBufferArray;
|
|
6
|
-
export interface IEventBuffer {
|
|
7
|
-
get length(): number;
|
|
8
|
-
destroy(): void;
|
|
9
|
-
addEvent(event: RecordingEvent, isCheckout?: boolean): void;
|
|
10
|
-
finish(): Promise<string | Uint8Array>;
|
|
11
|
-
}
|
|
12
|
-
declare class EventBufferArray implements IEventBuffer {
|
|
13
|
-
events: RecordingEvent[];
|
|
14
|
-
constructor();
|
|
15
|
-
destroy(): void;
|
|
16
|
-
get length(): number;
|
|
17
|
-
addEvent(event: RecordingEvent, isCheckout?: boolean): void;
|
|
18
|
-
finish(): Promise<string>;
|
|
19
|
-
}
|
|
20
|
-
export declare class EventBufferCompressionWorker implements IEventBuffer {
|
|
21
|
-
private worker;
|
|
22
|
-
private eventBufferItemLength;
|
|
23
|
-
private _id;
|
|
24
|
-
constructor(worker: Worker);
|
|
25
|
-
/**
|
|
26
|
-
* Read-only incrementing counter
|
|
27
|
-
*/
|
|
28
|
-
get id(): number;
|
|
29
|
-
postMessage(args: WorkerRequest): void;
|
|
30
|
-
init(): void;
|
|
31
|
-
destroy(): void;
|
|
32
|
-
get length(): number;
|
|
33
|
-
addEvent(event: RecordingEvent, isCheckout?: boolean): void;
|
|
34
|
-
sendEventToWorker: (event: RecordingEvent) => void;
|
|
35
|
-
finishRequest: (id: number) => Promise<Uint8Array>;
|
|
36
|
-
finish(): Promise<Uint8Array>;
|
|
37
|
-
}
|
|
38
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import 'jsdom-worker';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
import { Breadcrumb, DsnComponents, Event, Integration } from '@sentry/types';
|
|
2
|
-
import { CaptureReplayParams } from './api/captureReplay';
|
|
3
|
-
import { CaptureReplayUpdateParams } from './api/captureReplayUpdate';
|
|
4
|
-
import { Session } from './session/Session';
|
|
5
|
-
import { ReplayPerformanceEntry } from './createPerformanceEntry';
|
|
6
|
-
import { IEventBuffer } from './eventBuffer';
|
|
7
|
-
import type { InstrumentationTypeBreadcrumb, InstrumentationTypeSpan, RecordingConfig, RecordingEvent, ReplayRequest, SentryReplayConfiguration, SentryReplayPluginOptions } from './types';
|
|
8
|
-
/**
|
|
9
|
-
* Returns true to return control to calling function, otherwise continue with normal batching
|
|
10
|
-
*/
|
|
11
|
-
declare type AddUpdateCallback = () => boolean | void;
|
|
12
|
-
export declare class SentryReplay implements Integration {
|
|
13
|
-
/**
|
|
14
|
-
* @inheritDoc
|
|
15
|
-
*/
|
|
16
|
-
static id: string;
|
|
17
|
-
/**
|
|
18
|
-
* @inheritDoc
|
|
19
|
-
*/
|
|
20
|
-
name: string;
|
|
21
|
-
eventBuffer: IEventBuffer;
|
|
22
|
-
/**
|
|
23
|
-
* Buffer of breadcrumbs to be uploaded
|
|
24
|
-
*/
|
|
25
|
-
breadcrumbs: Breadcrumb[];
|
|
26
|
-
/**
|
|
27
|
-
* List of PerformanceEntry from PerformanceObserver
|
|
28
|
-
*/
|
|
29
|
-
performanceEvents: PerformanceEntry[];
|
|
30
|
-
/**
|
|
31
|
-
* Options to pass to `rrweb.record()`
|
|
32
|
-
*/
|
|
33
|
-
readonly recordingOptions: RecordingConfig;
|
|
34
|
-
readonly options: SentryReplayPluginOptions;
|
|
35
|
-
/**
|
|
36
|
-
* setTimeout id used for debouncing sending rrweb attachments
|
|
37
|
-
*/
|
|
38
|
-
private timeout;
|
|
39
|
-
/**
|
|
40
|
-
* The timestamp of the first event since the last flush. This is used to
|
|
41
|
-
* determine if the maximum allowed time has passed before events should be
|
|
42
|
-
* flushed again.
|
|
43
|
-
*/
|
|
44
|
-
private initialEventTimestampSinceFlush;
|
|
45
|
-
private performanceObserver;
|
|
46
|
-
private retryCount;
|
|
47
|
-
private retryInterval;
|
|
48
|
-
/**
|
|
49
|
-
* Flag to make sure we only create a replay event when
|
|
50
|
-
* necessary (i.e. we only want to have a single replay
|
|
51
|
-
* event per session and it should only be created
|
|
52
|
-
* immediately before sending recording)
|
|
53
|
-
*/
|
|
54
|
-
private needsCaptureReplay;
|
|
55
|
-
/**
|
|
56
|
-
* Captured state when integration is first initialized
|
|
57
|
-
*/
|
|
58
|
-
private initialState;
|
|
59
|
-
private context;
|
|
60
|
-
session: Session | undefined;
|
|
61
|
-
static attachmentUrlFromDsn(dsn: DsnComponents, eventId: string): string;
|
|
62
|
-
constructor({ flushMinDelay, flushMaxDelay, initialFlushDelay, stickySession, // TBD: Making this opt-in for now
|
|
63
|
-
useCompression, captureOnlyOnError, replaysSamplingRate, recordingConfig: { maskAllInputs, blockClass, ignoreClass, maskTextClass, ...recordingOptions }, }?: SentryReplayConfiguration);
|
|
64
|
-
/**
|
|
65
|
-
* Because we create a transaction in `setupOnce`, we can potentially create a
|
|
66
|
-
* transaction before some native SDK integrations have run and applied their
|
|
67
|
-
* own global event processor. An example is:
|
|
68
|
-
* https://github.com/getsentry/sentry-javascript/blob/b47ceafbdac7f8b99093ce6023726ad4687edc48/packages/browser/src/integrations/useragent.ts
|
|
69
|
-
*
|
|
70
|
-
* So we call `this.setup` in next event loop as a workaround to wait for
|
|
71
|
-
* other global event processors to finish
|
|
72
|
-
*/
|
|
73
|
-
setupOnce(): void;
|
|
74
|
-
/**
|
|
75
|
-
* Initializes the plugin.
|
|
76
|
-
*
|
|
77
|
-
* Creates or loads a session, attaches listeners to varying events (DOM, PerformanceObserver, Recording, Sentry SDK, etc)
|
|
78
|
-
*/
|
|
79
|
-
setup(): void;
|
|
80
|
-
/**
|
|
81
|
-
* We want to batch uploads of replay events. Save events only if
|
|
82
|
-
* `<flushMinDelay>` milliseconds have elapsed since the last event
|
|
83
|
-
* *OR* if `<flushMaxDelay>` milliseconds have elapsed.
|
|
84
|
-
*
|
|
85
|
-
* Accepts a callback to perform side-effects and returns true to stop batch
|
|
86
|
-
* processing and hand back control to caller.
|
|
87
|
-
*/
|
|
88
|
-
addUpdate(cb?: AddUpdateCallback): void;
|
|
89
|
-
/**
|
|
90
|
-
* Currently, this needs to be manually called (e.g. for tests). Sentry SDK does not support a teardown
|
|
91
|
-
*/
|
|
92
|
-
destroy(): void;
|
|
93
|
-
clearSession(): void;
|
|
94
|
-
/**
|
|
95
|
-
* Loads a session from storage, or creates a new one if it does not exist or
|
|
96
|
-
* is expired.
|
|
97
|
-
*/
|
|
98
|
-
loadSession({ expiry }: {
|
|
99
|
-
expiry: number;
|
|
100
|
-
}): void;
|
|
101
|
-
/**
|
|
102
|
-
* Adds listeners to record events for the replay
|
|
103
|
-
*/
|
|
104
|
-
addListeners(): void;
|
|
105
|
-
/**
|
|
106
|
-
* Cleans up listeners that were created in `addListeners`
|
|
107
|
-
*/
|
|
108
|
-
removeListeners(): void;
|
|
109
|
-
/**
|
|
110
|
-
* Core Sentry SDK global event handler. Attaches `replayId` to all [non-replay]
|
|
111
|
-
* events as a tag. Also handles the case where we only want to capture a reply
|
|
112
|
-
* when an error occurs.
|
|
113
|
-
**/
|
|
114
|
-
handleGlobalEvent: (event: Event) => Event;
|
|
115
|
-
/**
|
|
116
|
-
* Handler for recording events.
|
|
117
|
-
*
|
|
118
|
-
* Adds to event buffer, and has varying flushing behaviors if the event was a checkout.
|
|
119
|
-
*/
|
|
120
|
-
handleRecordingEmit: (event: RecordingEvent, isCheckout?: boolean) => void;
|
|
121
|
-
/**
|
|
122
|
-
* Handle when visibility of the page content changes. Opening a new tab will
|
|
123
|
-
* cause the state to change to hidden because of content of current page will
|
|
124
|
-
* be hidden. Likewise, moving a different window to cover the contents of the
|
|
125
|
-
* page will also trigger a change to a hidden state.
|
|
126
|
-
*/
|
|
127
|
-
handleVisibilityChange: () => void;
|
|
128
|
-
/**
|
|
129
|
-
* Handle when page is blurred
|
|
130
|
-
*/
|
|
131
|
-
handleWindowBlur: () => void;
|
|
132
|
-
/**
|
|
133
|
-
* Handle when page is focused
|
|
134
|
-
*/
|
|
135
|
-
handleWindowFocus: () => void;
|
|
136
|
-
/**
|
|
137
|
-
* Handle when page is closed
|
|
138
|
-
*/
|
|
139
|
-
handleWindowUnload: () => void;
|
|
140
|
-
/**
|
|
141
|
-
* Handler for Sentry Core SDK events.
|
|
142
|
-
*
|
|
143
|
-
* These specific events will create span-like objects in the recording.
|
|
144
|
-
*
|
|
145
|
-
*/
|
|
146
|
-
handleCoreSpanListener: (type: InstrumentationTypeSpan) => (handlerData: any) => void;
|
|
147
|
-
/**
|
|
148
|
-
* Handler for Sentry Core SDK events.
|
|
149
|
-
*
|
|
150
|
-
* These events will create breadcrumb-like objects in the recording.
|
|
151
|
-
*/
|
|
152
|
-
handleCoreBreadcrumbListener: (type: InstrumentationTypeBreadcrumb) => (handlerData: any) => void;
|
|
153
|
-
/**
|
|
154
|
-
* Keep a list of performance entries that will be sent with a replay
|
|
155
|
-
*/
|
|
156
|
-
handlePerformanceObserver: (list: PerformanceObserverEntryList) => void;
|
|
157
|
-
/**
|
|
158
|
-
* Tasks to run when we consider a page to be hidden (via blurring and/or visibility)
|
|
159
|
-
*/
|
|
160
|
-
doChangeToBackgroundTasks(breadcrumb?: Breadcrumb): void;
|
|
161
|
-
/**
|
|
162
|
-
* Tasks to run when we consider a page to be visible (via focus and/or visibility)
|
|
163
|
-
*/
|
|
164
|
-
doChangeToForegroundTasks(breadcrumb?: Breadcrumb): void;
|
|
165
|
-
/**
|
|
166
|
-
* Trigger rrweb to take a full snapshot which will cause this plugin to
|
|
167
|
-
* create a new Replay event.
|
|
168
|
-
*/
|
|
169
|
-
triggerFullSnapshot(): void;
|
|
170
|
-
/**
|
|
171
|
-
* Updates the session's last activity timestamp
|
|
172
|
-
*/
|
|
173
|
-
updateLastActivity(lastActivity?: number): void;
|
|
174
|
-
/**
|
|
175
|
-
* Helper to create (and buffer) a replay breadcrumb from a core SDK breadcrumb
|
|
176
|
-
*/
|
|
177
|
-
createCustomBreadcrumb(breadcrumb: Breadcrumb): void;
|
|
178
|
-
/**
|
|
179
|
-
* Create a span for each performance entry. The parent transaction is `this.replayEvent`.
|
|
180
|
-
*/
|
|
181
|
-
createPerformanceSpans(entries: ReplayPerformanceEntry[]): void;
|
|
182
|
-
/**
|
|
183
|
-
* Observed performance events are added to `this.performanceEvents`. These
|
|
184
|
-
* are included in the replay event before it is finished and sent to Sentry.
|
|
185
|
-
*/
|
|
186
|
-
addPerformanceEntries(): void;
|
|
187
|
-
/**
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
* Returns true if session is not expired, false otherwise.
|
|
191
|
-
*/
|
|
192
|
-
checkAndHandleExpiredSession(expiry?: number): boolean;
|
|
193
|
-
/**
|
|
194
|
-
* Only flush if `captureOnlyOnError` is false.
|
|
195
|
-
*/
|
|
196
|
-
conditionalFlush(lastActivity?: number): Promise<void>;
|
|
197
|
-
/**
|
|
198
|
-
* Return and clear context
|
|
199
|
-
*/
|
|
200
|
-
popEventContext({ timestamp, }: {
|
|
201
|
-
timestamp: number;
|
|
202
|
-
}): CaptureReplayParams & CaptureReplayUpdateParams;
|
|
203
|
-
/**
|
|
204
|
-
* Flushes replay event buffer to Sentry.
|
|
205
|
-
*
|
|
206
|
-
* Performance events are only added right before flushing - this is probably
|
|
207
|
-
* due to the buffered performance observer events.
|
|
208
|
-
*/
|
|
209
|
-
flushUpdate(lastActivity?: number): Promise<void>;
|
|
210
|
-
/**
|
|
211
|
-
* Send replay attachment using either `sendBeacon()` or `fetch()`
|
|
212
|
-
*/
|
|
213
|
-
sendReplayRequest({ endpoint, events }: ReplayRequest): Promise<void>;
|
|
214
|
-
resetRetries(): void;
|
|
215
|
-
/**
|
|
216
|
-
* Finalize and send the current replay event to Sentry
|
|
217
|
-
*/
|
|
218
|
-
sendReplay(eventId: string, events: Uint8Array | string): Promise<boolean>;
|
|
219
|
-
}
|
|
220
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/// <reference types="jest" />
|
|
2
|
-
import { RecordingEvent } from '@/types';
|
|
3
|
-
declare type RecordAdditionalProperties = {
|
|
4
|
-
takeFullSnapshot: jest.Mock;
|
|
5
|
-
addCustomEvent: () => void;
|
|
6
|
-
freezePage: () => void;
|
|
7
|
-
mirror: unknown;
|
|
8
|
-
_emitter: (event: RecordingEvent, ...args: any[]) => void;
|
|
9
|
-
};
|
|
10
|
-
export declare type RecordMock = jest.MockedFunction<typeof rrweb.record> & RecordAdditionalProperties;
|
|
11
|
-
import * as rrweb from 'rrweb';
|
|
12
|
-
export declare function mockRrweb(): {
|
|
13
|
-
record: RecordMock;
|
|
14
|
-
};
|
|
15
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { BrowserOptions } from '@sentry/browser';
|
|
2
|
-
import { SentryReplay } from '@';
|
|
3
|
-
import { SentryReplayConfiguration } from '@/types';
|
|
4
|
-
interface MockSdkParams {
|
|
5
|
-
replayOptions?: SentryReplayConfiguration;
|
|
6
|
-
sentryOptions?: BrowserOptions;
|
|
7
|
-
}
|
|
8
|
-
export declare function mockSdk({ replayOptions, sentryOptions, }?: MockSdkParams): {
|
|
9
|
-
replay: SentryReplay;
|
|
10
|
-
};
|
|
11
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Session } from '@/session/Session';
|
|
2
|
-
import { InitialState } from '@/types';
|
|
3
|
-
export interface CaptureReplayParams {
|
|
4
|
-
session: Session;
|
|
5
|
-
initialState: InitialState;
|
|
6
|
-
errorIds: string[];
|
|
7
|
-
traceIds: string[];
|
|
8
|
-
urls: string[];
|
|
9
|
-
}
|
|
10
|
-
export declare function captureReplay({ session, initialState, errorIds, traceIds, urls, }: CaptureReplayParams): void;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { Session } from '@/session/Session';
|
|
2
|
-
export interface CaptureReplayUpdateParams {
|
|
3
|
-
session: Session;
|
|
4
|
-
/**
|
|
5
|
-
* Timestamp of the event in milliseconds
|
|
6
|
-
*/
|
|
7
|
-
timestamp: number;
|
|
8
|
-
errorIds: string[];
|
|
9
|
-
traceIds: string[];
|
|
10
|
-
urls: string[];
|
|
11
|
-
}
|
|
12
|
-
export declare function captureReplayUpdate({ session, timestamp, errorIds, traceIds, urls, }: CaptureReplayUpdateParams): void;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { InstrumentationTypeSpan } from '@/types';
|
|
2
|
-
import { handleFetch } from './handleFetch';
|
|
3
|
-
import { handleHistory } from './handleHistory';
|
|
4
|
-
import { handleXhr } from './handleXhr';
|
|
5
|
-
export declare function getSpanHandler(type: InstrumentationTypeSpan): typeof handleFetch | typeof handleXhr | typeof handleHistory;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function handleDom(handlerData: any): import("@sentry/types").Breadcrumb;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ReplayPerformanceEntry } from '@/createPerformanceEntry';
|
|
2
|
-
interface FetchHandlerData {
|
|
3
|
-
args: Parameters<typeof fetch>;
|
|
4
|
-
fetchData: {
|
|
5
|
-
method: string;
|
|
6
|
-
url: string;
|
|
7
|
-
};
|
|
8
|
-
response: {
|
|
9
|
-
type: string;
|
|
10
|
-
url: string;
|
|
11
|
-
redirected: boolean;
|
|
12
|
-
status: number;
|
|
13
|
-
ok: boolean;
|
|
14
|
-
};
|
|
15
|
-
startTimestamp: number;
|
|
16
|
-
endTimestamp?: number;
|
|
17
|
-
}
|
|
18
|
-
export declare function handleFetch(handlerData: FetchHandlerData): ReplayPerformanceEntry;
|
|
19
|
-
export {};
|