@sentry/replay 0.6.4 → 0.6.6
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 +14 -3
- package/dist/index.js +14 -3
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
- package/dist/config/types/jest.config.d.ts +0 -3
- package/dist/config/types/jest.setup.d.ts +0 -31
- package/dist/config/types/src/blockAllMedia.test.d.ts +0 -1
- package/dist/config/types/src/coreHandlers/getBreadcrumbHandler.d.ts +0 -3
- package/dist/config/types/src/coreHandlers/getSpanHandler.d.ts +0 -5
- package/dist/config/types/src/coreHandlers/handleDom.d.ts +0 -1
- package/dist/config/types/src/coreHandlers/handleFetch.d.ts +0 -19
- package/dist/config/types/src/coreHandlers/handleFetch.test.d.ts +0 -1
- package/dist/config/types/src/coreHandlers/handleHistory.d.ts +0 -7
- package/dist/config/types/src/coreHandlers/handleScope-unit.test.d.ts +0 -1
- package/dist/config/types/src/coreHandlers/handleScope.d.ts +0 -2
- package/dist/config/types/src/coreHandlers/handleScope.test.d.ts +0 -1
- package/dist/config/types/src/coreHandlers/handleXhr.d.ts +0 -21
- package/dist/config/types/src/createPerformanceEntry.d.ts +0 -43
- package/dist/config/types/src/createPerformanceEntry.test.d.ts +0 -1
- package/dist/config/types/src/eventBuffer.d.ts +0 -45
- package/dist/config/types/src/eventBuffer.test.d.ts +0 -1
- package/dist/config/types/src/flags.d.ts +0 -2
- package/dist/config/types/src/flush.test.d.ts +0 -1
- package/dist/config/types/src/index-captureOnlyOnError.test.d.ts +0 -1
- package/dist/config/types/src/index-noSticky.test.d.ts +0 -1
- package/dist/config/types/src/index-sampling.test.d.ts +0 -1
- package/dist/config/types/src/index.d.ts +0 -245
- package/dist/config/types/src/index.test.d.ts +0 -1
- package/dist/config/types/src/multiple-instances.test.d.ts +0 -1
- package/dist/config/types/src/session/Session.d.ts +0 -63
- package/dist/config/types/src/session/Session.test.d.ts +0 -1
- package/dist/config/types/src/session/constants.d.ts +0 -5
- package/dist/config/types/src/session/createSession.d.ts +0 -19
- package/dist/config/types/src/session/createSession.test.d.ts +0 -1
- package/dist/config/types/src/session/deleteSession.d.ts +0 -4
- package/dist/config/types/src/session/deleteSession.test.d.ts +0 -1
- package/dist/config/types/src/session/fetchSession.d.ts +0 -5
- package/dist/config/types/src/session/fetchSession.test.d.ts +0 -1
- package/dist/config/types/src/session/getSession.d.ts +0 -28
- package/dist/config/types/src/session/getSession.test.d.ts +0 -1
- package/dist/config/types/src/session/index.d.ts +0 -1
- package/dist/config/types/src/session/saveSession.d.ts +0 -2
- package/dist/config/types/src/session/saveSession.test.d.ts +0 -1
- package/dist/config/types/src/stop.test.d.ts +0 -1
- package/dist/config/types/src/types.d.ts +0 -105
- package/dist/config/types/src/util/addInternalBreadcrumb.d.ts +0 -5
- package/dist/config/types/src/util/captureInternalException.d.ts +0 -4
- package/dist/config/types/src/util/createBreadcrumb.d.ts +0 -4
- package/dist/config/types/src/util/createPayload.d.ts +0 -5
- package/dist/config/types/src/util/dedupePerformanceEntries.d.ts +0 -10
- package/dist/config/types/src/util/dedupePerformanceEntries.test.d.ts +0 -1
- package/dist/config/types/src/util/isExpired.d.ts +0 -5
- package/dist/config/types/src/util/isExpired.test.d.ts +0 -1
- package/dist/config/types/src/util/isIngestHost.d.ts +0 -4
- package/dist/config/types/src/util/isInternal.d.ts +0 -5
- package/dist/config/types/src/util/isSampled.d.ts +0 -7
- package/dist/config/types/src/util/isSampled.test.d.ts +0 -1
- package/dist/config/types/src/util/isSessionExpired.d.ts +0 -5
- package/dist/config/types/src/util/isSessionExpired.test.d.ts +0 -1
- package/dist/config/types/src/util/logger.d.ts +0 -12
- package/dist/config/types/test/fixtures/performanceEntry/lcp.d.ts +0 -1
- package/dist/config/types/test/fixtures/performanceEntry/navigation.d.ts +0 -1
- package/dist/config/types/test/fixtures/performanceEntry/resource.d.ts +0 -1
- package/dist/config/types/test/index.d.ts +0 -3
- package/dist/config/types/test/mocks/mockRrweb.d.ts +0 -14
- package/dist/config/types/test/mocks/mockSdk.d.ts +0 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/replay",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.6",
|
|
4
4
|
"description": "User replays for Sentry",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.es.js",
|
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
"homepage": "https://github.com/getsentry/sentry-replay#readme",
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@babel/core": "^7.17.5",
|
|
40
|
+
"@jest/globals": "^29.2.1",
|
|
40
41
|
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
41
42
|
"@rollup/plugin-replace": "^4.0.0",
|
|
42
43
|
"@rollup/plugin-typescript": "^8.3.1",
|
|
43
44
|
"@sentry/browser": "^7.7.0",
|
|
44
45
|
"@size-limit/file": "^8.1.0",
|
|
45
46
|
"@size-limit/time": "^8.1.0",
|
|
46
|
-
"@types/jest": "^29.1.2",
|
|
47
47
|
"@types/lodash.debounce": "^4.0.7",
|
|
48
48
|
"@types/lodash.throttle": "^4.1.7",
|
|
49
49
|
"@types/node": "^18.11.0",
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
"eslint-plugin-prettier": "^4.0.0",
|
|
56
56
|
"eslint-plugin-simple-import-sort": "^7.0.0",
|
|
57
57
|
"husky": ">=6",
|
|
58
|
-
"jest": "^29.2.
|
|
59
|
-
"jest-environment-jsdom": "^29.2.
|
|
58
|
+
"jest": "^29.2.1",
|
|
59
|
+
"jest-environment-jsdom": "^29.2.1",
|
|
60
60
|
"jsdom-worker": "^0.2.1",
|
|
61
61
|
"lint-staged": ">=10",
|
|
62
62
|
"prettier": "^2.5.1",
|
|
@@ -65,9 +65,9 @@
|
|
|
65
65
|
"rollup-plugin-terser": "^7.0.2",
|
|
66
66
|
"size-limit": "^8.1.0",
|
|
67
67
|
"ts-jest": "^29.0.3",
|
|
68
|
-
"ts-node": "^10.
|
|
68
|
+
"ts-node": "^10.9.1",
|
|
69
69
|
"tslib": "^2.3.1",
|
|
70
|
-
"typescript": "^4.
|
|
70
|
+
"typescript": "^4.8.4"
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|
|
73
73
|
"@sentry/core": "^7.7.0",
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/// <reference types="jest" />
|
|
2
|
-
import { Session } from './src/session/Session';
|
|
3
|
-
declare type SentReplayExpected = {
|
|
4
|
-
envelopeHeader?: {
|
|
5
|
-
event_id: string;
|
|
6
|
-
sent_at: string;
|
|
7
|
-
sdk: {
|
|
8
|
-
name: string;
|
|
9
|
-
version?: string;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
replayEventHeader?: {
|
|
13
|
-
type: 'replay_event';
|
|
14
|
-
};
|
|
15
|
-
replayEventPayload?: Record<string, any>;
|
|
16
|
-
recordingHeader?: {
|
|
17
|
-
type: 'replay_recording';
|
|
18
|
-
length: number;
|
|
19
|
-
};
|
|
20
|
-
recordingPayloadHeader?: Record<string, any>;
|
|
21
|
-
events?: string | Uint8Array;
|
|
22
|
-
};
|
|
23
|
-
declare global {
|
|
24
|
-
namespace jest {
|
|
25
|
-
interface Matchers<R> {
|
|
26
|
-
toHaveSentReplay(expected?: SentReplayExpected): CustomMatcherResult;
|
|
27
|
-
toHaveSameSession(expected: undefined | Session): CustomMatcherResult;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -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 | null;
|
|
@@ -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): null | ReplayPerformanceEntry;
|
|
19
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ReplayPerformanceEntry } from '../createPerformanceEntry';
|
|
2
|
-
declare type XHRSendInput = null | Blob | BufferSource | FormData | URLSearchParams | string;
|
|
3
|
-
interface SentryWrappedXMLHttpRequest extends XMLHttpRequest {
|
|
4
|
-
[key: string]: unknown;
|
|
5
|
-
__sentry_xhr__?: {
|
|
6
|
-
method?: string;
|
|
7
|
-
url?: string;
|
|
8
|
-
status_code?: number;
|
|
9
|
-
body?: XHRSendInput;
|
|
10
|
-
startTimestamp?: number;
|
|
11
|
-
};
|
|
12
|
-
__sentry_own_request__?: boolean;
|
|
13
|
-
}
|
|
14
|
-
interface XhrHandlerData {
|
|
15
|
-
args: [method: string, url: string];
|
|
16
|
-
xhr: SentryWrappedXMLHttpRequest;
|
|
17
|
-
startTimestamp: number;
|
|
18
|
-
endTimestamp?: number;
|
|
19
|
-
}
|
|
20
|
-
export declare function handleXhr(handlerData: XhrHandlerData): ReplayPerformanceEntry | null;
|
|
21
|
-
export {};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { AllPerformanceEntry } from './types';
|
|
2
|
-
export interface ReplayPerformanceEntry {
|
|
3
|
-
/**
|
|
4
|
-
* One of these types https://developer.mozilla.org/en-US/docs/Web/API/PerformanceEntry/entryType
|
|
5
|
-
*/
|
|
6
|
-
type: string;
|
|
7
|
-
/**
|
|
8
|
-
* A more specific description of the performance entry
|
|
9
|
-
*/
|
|
10
|
-
name: string;
|
|
11
|
-
/**
|
|
12
|
-
* The start timestamp in seconds
|
|
13
|
-
*/
|
|
14
|
-
start: number;
|
|
15
|
-
/**
|
|
16
|
-
* The end timestamp in seconds
|
|
17
|
-
*/
|
|
18
|
-
end: number;
|
|
19
|
-
/**
|
|
20
|
-
* Additional unstructured data to be included
|
|
21
|
-
*/
|
|
22
|
-
data?: Record<string, unknown>;
|
|
23
|
-
}
|
|
24
|
-
interface MemoryInfo {
|
|
25
|
-
jsHeapSizeLimit: number;
|
|
26
|
-
totalJSHeapSize: number;
|
|
27
|
-
usedJSHeapSize: number;
|
|
28
|
-
}
|
|
29
|
-
export declare function createPerformanceEntries(entries: AllPerformanceEntry[]): ReplayPerformanceEntry[];
|
|
30
|
-
export declare function createMemoryEntry(memoryEntry: MemoryInfo): {
|
|
31
|
-
type: string;
|
|
32
|
-
name: string;
|
|
33
|
-
start: number;
|
|
34
|
-
end: number;
|
|
35
|
-
data: {
|
|
36
|
-
memory: {
|
|
37
|
-
jsHeapSizeLimit: number;
|
|
38
|
-
totalJSHeapSize: number;
|
|
39
|
-
usedJSHeapSize: number;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { RecordingEvent, WorkerRequest, WorkerResponse } 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
|
-
/**
|
|
30
|
-
* Post message to worker and wait for response before resolving promise.
|
|
31
|
-
*/
|
|
32
|
-
postMessage({ id, method, args, }: WorkerRequest): Promise<WorkerResponse['response']>;
|
|
33
|
-
init(): void;
|
|
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
|
-
*/
|
|
39
|
-
get length(): number;
|
|
40
|
-
addEvent(event: RecordingEvent, isCheckout?: boolean): Promise<string | Uint8Array>;
|
|
41
|
-
sendEventToWorker: (event: RecordingEvent) => Promise<string | Uint8Array>;
|
|
42
|
-
finishRequest: (id: number) => Promise<Uint8Array>;
|
|
43
|
-
finish(): Promise<Uint8Array>;
|
|
44
|
-
}
|
|
45
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import 'jsdom-worker';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,245 +0,0 @@
|
|
|
1
|
-
import { Breadcrumb, Event, Integration } from '@sentry/types';
|
|
2
|
-
import { Session } from './session/Session';
|
|
3
|
-
import { ReplayPerformanceEntry } from './createPerformanceEntry';
|
|
4
|
-
import { IEventBuffer } from './eventBuffer';
|
|
5
|
-
import type { AllPerformanceEntry, InitialState, InstrumentationTypeBreadcrumb, InstrumentationTypeSpan, RecordedEvents, RecordingEvent, RecordingOptions, ReplayConfiguration, ReplayPluginOptions, SendReplayRequest } from './types';
|
|
6
|
-
/**
|
|
7
|
-
* Returns true to return control to calling function, otherwise continue with normal batching
|
|
8
|
-
*/
|
|
9
|
-
declare type AddUpdateCallback = () => boolean | void;
|
|
10
|
-
export declare class Replay implements Integration {
|
|
11
|
-
/**
|
|
12
|
-
* @inheritDoc
|
|
13
|
-
*/
|
|
14
|
-
static id: string;
|
|
15
|
-
/**
|
|
16
|
-
* @inheritDoc
|
|
17
|
-
*/
|
|
18
|
-
name: string;
|
|
19
|
-
eventBuffer: IEventBuffer | null;
|
|
20
|
-
/**
|
|
21
|
-
* List of PerformanceEntry from PerformanceObserver
|
|
22
|
-
*/
|
|
23
|
-
performanceEvents: AllPerformanceEntry[];
|
|
24
|
-
/**
|
|
25
|
-
* Options to pass to `rrweb.record()`
|
|
26
|
-
*/
|
|
27
|
-
readonly recordingOptions: RecordingOptions;
|
|
28
|
-
readonly options: ReplayPluginOptions;
|
|
29
|
-
private performanceObserver;
|
|
30
|
-
private retryCount;
|
|
31
|
-
private retryInterval;
|
|
32
|
-
private debouncedFlush;
|
|
33
|
-
/**
|
|
34
|
-
* Flag when a new session has been created. Captured replay events behave
|
|
35
|
-
* slightly differently in this case: `replay_start_timestamp` is included.
|
|
36
|
-
*/
|
|
37
|
-
private newSessionCreated;
|
|
38
|
-
private flushLock;
|
|
39
|
-
/**
|
|
40
|
-
* Is the integration currently active?
|
|
41
|
-
*/
|
|
42
|
-
private isEnabled;
|
|
43
|
-
/**
|
|
44
|
-
* Have we attached listeners to the core SDK?
|
|
45
|
-
* Note we have to track this as there is no way to remove instrumentation handlers.
|
|
46
|
-
*/
|
|
47
|
-
private hasInitializedCoreListeners;
|
|
48
|
-
/**
|
|
49
|
-
* Function to stop recording
|
|
50
|
-
*/
|
|
51
|
-
private stopRecording;
|
|
52
|
-
/**
|
|
53
|
-
* Captured state when integration is first initialized
|
|
54
|
-
*/
|
|
55
|
-
private initialState;
|
|
56
|
-
private context;
|
|
57
|
-
session: Session | undefined;
|
|
58
|
-
constructor({ flushMinDelay, flushMaxDelay, initialFlushDelay, stickySession, useCompression, captureOnlyOnError, replaysSamplingRate, maskAllText, maskAllInputs, blockAllMedia, blockClass, ignoreClass, maskTextClass, blockSelector, ...recordingOptions }?: ReplayConfiguration);
|
|
59
|
-
/**
|
|
60
|
-
* Because we create a transaction in `setupOnce`, we can potentially create a
|
|
61
|
-
* transaction before some native SDK integrations have run and applied their
|
|
62
|
-
* own global event processor. An example is:
|
|
63
|
-
* https://github.com/getsentry/sentry-javascript/blob/b47ceafbdac7f8b99093ce6023726ad4687edc48/packages/browser/src/integrations/useragent.ts
|
|
64
|
-
*
|
|
65
|
-
* So we call `this.setup` in next event loop as a workaround to wait for
|
|
66
|
-
* other global event processors to finish
|
|
67
|
-
*/
|
|
68
|
-
setupOnce(): void;
|
|
69
|
-
/**
|
|
70
|
-
* Initializes the plugin.
|
|
71
|
-
*
|
|
72
|
-
* Creates or loads a session, attaches listeners to varying events (DOM, PerformanceObserver, Recording, Sentry SDK, etc)
|
|
73
|
-
*/
|
|
74
|
-
start(): void;
|
|
75
|
-
/**
|
|
76
|
-
* We want to batch uploads of replay events. Save events only if
|
|
77
|
-
* `<flushMinDelay>` milliseconds have elapsed since the last event
|
|
78
|
-
* *OR* if `<flushMaxDelay>` milliseconds have elapsed.
|
|
79
|
-
*
|
|
80
|
-
* Accepts a callback to perform side-effects and returns true to stop batch
|
|
81
|
-
* processing and hand back control to caller.
|
|
82
|
-
*/
|
|
83
|
-
addUpdate(cb?: AddUpdateCallback): void;
|
|
84
|
-
/**
|
|
85
|
-
* Currently, this needs to be manually called (e.g. for tests). Sentry SDK does not support a teardown
|
|
86
|
-
*/
|
|
87
|
-
stop(): void;
|
|
88
|
-
clearSession(): void;
|
|
89
|
-
/**
|
|
90
|
-
* Loads a session from storage, or creates a new one if it does not exist or
|
|
91
|
-
* is expired.
|
|
92
|
-
*/
|
|
93
|
-
loadSession({ expiry }: {
|
|
94
|
-
expiry: number;
|
|
95
|
-
}): void;
|
|
96
|
-
/**
|
|
97
|
-
* Capture some initial state that can change throughout the lifespan of the
|
|
98
|
-
* replay. This is required because otherwise they would be captured at the
|
|
99
|
-
* first flush.
|
|
100
|
-
*/
|
|
101
|
-
setInitialState(): void;
|
|
102
|
-
/**
|
|
103
|
-
* Adds listeners to record events for the replay
|
|
104
|
-
*/
|
|
105
|
-
addListeners(): void;
|
|
106
|
-
/**
|
|
107
|
-
* Cleans up listeners that were created in `addListeners`
|
|
108
|
-
*/
|
|
109
|
-
removeListeners(): void;
|
|
110
|
-
/**
|
|
111
|
-
* Core Sentry SDK global event handler. Attaches `replayId` to all [non-replay]
|
|
112
|
-
* events as a tag. Also handles the case where we only want to capture a reply
|
|
113
|
-
* when an error occurs.
|
|
114
|
-
**/
|
|
115
|
-
handleGlobalEvent: (event: Event) => Event;
|
|
116
|
-
/**
|
|
117
|
-
* Handler for recording events.
|
|
118
|
-
*
|
|
119
|
-
* Adds to event buffer, and has varying flushing behaviors if the event was a checkout.
|
|
120
|
-
*/
|
|
121
|
-
handleRecordingEmit: (event: RecordingEvent, isCheckout?: boolean) => void;
|
|
122
|
-
/**
|
|
123
|
-
* Handle when visibility of the page content changes. Opening a new tab will
|
|
124
|
-
* cause the state to change to hidden because of content of current page will
|
|
125
|
-
* be hidden. Likewise, moving a different window to cover the contents of the
|
|
126
|
-
* page will also trigger a change to a hidden state.
|
|
127
|
-
*/
|
|
128
|
-
handleVisibilityChange: () => void;
|
|
129
|
-
/**
|
|
130
|
-
* Handle when page is blurred
|
|
131
|
-
*/
|
|
132
|
-
handleWindowBlur: () => void;
|
|
133
|
-
/**
|
|
134
|
-
* Handle when page is focused
|
|
135
|
-
*/
|
|
136
|
-
handleWindowFocus: () => void;
|
|
137
|
-
/**
|
|
138
|
-
* Handler for Sentry Core SDK events.
|
|
139
|
-
*
|
|
140
|
-
* These specific events will create span-like objects in the recording.
|
|
141
|
-
*
|
|
142
|
-
*/
|
|
143
|
-
handleCoreSpanListener: (type: InstrumentationTypeSpan) => (handlerData: any) => void;
|
|
144
|
-
/**
|
|
145
|
-
* Handler for Sentry Core SDK events.
|
|
146
|
-
*
|
|
147
|
-
* These events will create breadcrumb-like objects in the recording.
|
|
148
|
-
*/
|
|
149
|
-
handleCoreBreadcrumbListener: (type: InstrumentationTypeBreadcrumb) => (handlerData: any) => void;
|
|
150
|
-
/**
|
|
151
|
-
* Keep a list of performance entries that will be sent with a replay
|
|
152
|
-
*/
|
|
153
|
-
handlePerformanceObserver: (list: PerformanceObserverEntryList) => void;
|
|
154
|
-
/**
|
|
155
|
-
* Tasks to run when we consider a page to be hidden (via blurring and/or visibility)
|
|
156
|
-
*/
|
|
157
|
-
doChangeToBackgroundTasks(breadcrumb?: Breadcrumb): void;
|
|
158
|
-
/**
|
|
159
|
-
* Tasks to run when we consider a page to be visible (via focus and/or visibility)
|
|
160
|
-
*/
|
|
161
|
-
doChangeToForegroundTasks(breadcrumb?: Breadcrumb): void;
|
|
162
|
-
/**
|
|
163
|
-
* Trigger rrweb to take a full snapshot which will cause this plugin to
|
|
164
|
-
* create a new Replay event.
|
|
165
|
-
*/
|
|
166
|
-
triggerFullSnapshot(): void;
|
|
167
|
-
/**
|
|
168
|
-
* Add an event to the event buffer
|
|
169
|
-
*/
|
|
170
|
-
addEvent(event: RecordingEvent, isCheckout?: boolean): void;
|
|
171
|
-
/**
|
|
172
|
-
* Updates the session's last activity timestamp
|
|
173
|
-
*/
|
|
174
|
-
updateLastActivity(lastActivity?: number): void;
|
|
175
|
-
/**
|
|
176
|
-
* Helper to create (and buffer) a replay breadcrumb from a core SDK breadcrumb
|
|
177
|
-
*/
|
|
178
|
-
createCustomBreadcrumb(breadcrumb: Breadcrumb): void;
|
|
179
|
-
/**
|
|
180
|
-
* Create a "span" for each performance entry. The parent transaction is `this.replayEvent`.
|
|
181
|
-
*/
|
|
182
|
-
createPerformanceSpans(entries: ReplayPerformanceEntry[]): Promise<void[]>;
|
|
183
|
-
/**
|
|
184
|
-
* Observed performance events are added to `this.performanceEvents`. These
|
|
185
|
-
* are included in the replay event before it is finished and sent to Sentry.
|
|
186
|
-
*/
|
|
187
|
-
addPerformanceEntries(): Promise<void[]>;
|
|
188
|
-
/**
|
|
189
|
-
* Create a "span" for the total amount of memory being used by JS objects
|
|
190
|
-
* (including v8 internal objects).
|
|
191
|
-
*/
|
|
192
|
-
addMemoryEntry(): Promise<void[]> | undefined;
|
|
193
|
-
/**
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
* Returns true if session is not expired, false otherwise.
|
|
197
|
-
*/
|
|
198
|
-
checkAndHandleExpiredSession(expiry?: number): boolean;
|
|
199
|
-
/**
|
|
200
|
-
* Only flush if `captureOnlyOnError` is false.
|
|
201
|
-
*/
|
|
202
|
-
conditionalFlush(): Promise<void> | undefined;
|
|
203
|
-
/**
|
|
204
|
-
* Clear context
|
|
205
|
-
*/
|
|
206
|
-
clearContext(): void;
|
|
207
|
-
/**
|
|
208
|
-
* Return and clear context
|
|
209
|
-
*/
|
|
210
|
-
popEventContext(): {
|
|
211
|
-
initialState: InitialState;
|
|
212
|
-
errorIds: string[];
|
|
213
|
-
traceIds: string[];
|
|
214
|
-
urls: string[];
|
|
215
|
-
};
|
|
216
|
-
/**
|
|
217
|
-
* Flushes replay event buffer to Sentry.
|
|
218
|
-
*
|
|
219
|
-
* Performance events are only added right before flushing - this is
|
|
220
|
-
* due to the buffered performance observer events.
|
|
221
|
-
*
|
|
222
|
-
* Should never be called directly, only by `flush`
|
|
223
|
-
*/
|
|
224
|
-
runFlush(): Promise<void>;
|
|
225
|
-
/**
|
|
226
|
-
* Flush recording data to Sentry. Creates a lock so that only a single flush
|
|
227
|
-
* can be active at a time.
|
|
228
|
-
*/
|
|
229
|
-
flush: () => Promise<void>;
|
|
230
|
-
/**
|
|
231
|
-
* Send replay attachment using `fetch()`
|
|
232
|
-
*/
|
|
233
|
-
sendReplayRequest({ endpoint, events, replayId: event_id, segmentId: segment_id, includeReplayStartTimestamp, }: SendReplayRequest): Promise<void>;
|
|
234
|
-
resetRetries(): void;
|
|
235
|
-
/**
|
|
236
|
-
* Finalize and send the current replay event to Sentry
|
|
237
|
-
*/
|
|
238
|
-
sendReplay({ replayId, events, segmentId, includeReplayStartTimestamp, }: {
|
|
239
|
-
replayId: string;
|
|
240
|
-
events: RecordedEvents;
|
|
241
|
-
segmentId: number;
|
|
242
|
-
includeReplayStartTimestamp: boolean;
|
|
243
|
-
}): Promise<unknown>;
|
|
244
|
-
}
|
|
245
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
interface SessionObject {
|
|
2
|
-
id: string;
|
|
3
|
-
/**
|
|
4
|
-
* Start time of current session
|
|
5
|
-
*/
|
|
6
|
-
started: number;
|
|
7
|
-
/**
|
|
8
|
-
* Last known activity of the session
|
|
9
|
-
*/
|
|
10
|
-
lastActivity: number;
|
|
11
|
-
/**
|
|
12
|
-
* Segment ID for replay events
|
|
13
|
-
*/
|
|
14
|
-
segmentId: number;
|
|
15
|
-
/**
|
|
16
|
-
* Is the session sampled?
|
|
17
|
-
*/
|
|
18
|
-
sampled: boolean;
|
|
19
|
-
}
|
|
20
|
-
interface SessionOptions {
|
|
21
|
-
stickySession?: boolean;
|
|
22
|
-
samplingRate?: number;
|
|
23
|
-
}
|
|
24
|
-
export declare class Session {
|
|
25
|
-
/**
|
|
26
|
-
* Session ID
|
|
27
|
-
*/
|
|
28
|
-
private _id;
|
|
29
|
-
/**
|
|
30
|
-
* Start time of current session
|
|
31
|
-
*/
|
|
32
|
-
private _started;
|
|
33
|
-
/**
|
|
34
|
-
* Last known activity of the session
|
|
35
|
-
*/
|
|
36
|
-
private _lastActivity;
|
|
37
|
-
/**
|
|
38
|
-
* Sequence ID specific to replay updates
|
|
39
|
-
*/
|
|
40
|
-
private _segmentId;
|
|
41
|
-
/**
|
|
42
|
-
* Previous session ID
|
|
43
|
-
*/
|
|
44
|
-
private _previousSessionId;
|
|
45
|
-
/**
|
|
46
|
-
* Is the Session sampled?
|
|
47
|
-
*/
|
|
48
|
-
private _sampled;
|
|
49
|
-
readonly options: Required<Pick<SessionOptions, 'stickySession'>>;
|
|
50
|
-
constructor(session?: Partial<SessionObject>, { stickySession, samplingRate }?: SessionOptions);
|
|
51
|
-
get id(): string;
|
|
52
|
-
get started(): number;
|
|
53
|
-
get lastActivity(): number;
|
|
54
|
-
set lastActivity(newDate: number);
|
|
55
|
-
get segmentId(): number;
|
|
56
|
-
set segmentId(id: number);
|
|
57
|
-
get previousSessionId(): string | undefined;
|
|
58
|
-
set previousSessionId(id: string | undefined);
|
|
59
|
-
get sampled(): boolean;
|
|
60
|
-
set sampled(_isSampled: boolean);
|
|
61
|
-
toJSON(): SessionObject;
|
|
62
|
-
}
|
|
63
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare const REPLAY_SESSION_KEY = "sentryReplaySession";
|
|
2
|
-
export declare const REPLAY_EVENT_NAME = "replay_event";
|
|
3
|
-
export declare const RECORDING_EVENT_NAME = "replay_recording";
|
|
4
|
-
export declare const SESSION_IDLE_DURATION = 300000;
|
|
5
|
-
export declare const VISIBILITY_CHANGE_TIMEOUT = 300000;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Session } from './Session';
|
|
2
|
-
interface CreateSessionParams {
|
|
3
|
-
/**
|
|
4
|
-
* Should save to sessionStorage?
|
|
5
|
-
*/
|
|
6
|
-
stickySession: boolean;
|
|
7
|
-
/**
|
|
8
|
-
* The sampling rate of the Session. See integration configuration comments
|
|
9
|
-
* for `replaysSamplingRate`.
|
|
10
|
-
*/
|
|
11
|
-
samplingRate?: number;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Create a new session, which in its current implementation is a Sentry event
|
|
15
|
-
* that all replays will be saved to as attachments. Currently, we only expect
|
|
16
|
-
* one of these Sentry events per "replay session".
|
|
17
|
-
*/
|
|
18
|
-
export declare function createSession({ stickySession, samplingRate, }: CreateSessionParams): Session;
|
|
19
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|