@sentry/replay 0.4.8-1 → 0.4.8-2
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 +1 -1
- package/dist/esm/index.js +0 -1454
- package/dist/esm/worker-aa3eb59a.js +0 -4
- package/dist/jest.config.d.ts +0 -3
- package/dist/jest.setup.d.ts +0 -10
- package/dist/src/api/captureReplay.d.ts +0 -3
- package/dist/src/api/captureReplayUpdate.d.ts +0 -2
- package/dist/src/coreHandlers/handleDom.d.ts +0 -1
- package/dist/src/coreHandlers/handleFetch.d.ts +0 -2
- package/dist/src/coreHandlers/handleFetch.test.d.ts +0 -1
- package/dist/src/coreHandlers/handleScope-unit.test.d.ts +0 -1
- package/dist/src/coreHandlers/handleScope.d.ts +0 -2
- package/dist/src/coreHandlers/handleScope.test.d.ts +0 -1
- package/dist/src/coreHandlers/handleXhr.d.ts +0 -2
- package/dist/src/coreHandlers/index.d.ts +0 -4
- package/dist/src/createPerformanceEntry.d.ts +0 -42
- package/dist/src/createPerformanceEntry.test.d.ts +0 -1
- package/dist/src/eventBuffer.d.ts +0 -31
- package/dist/src/eventBuffer.test.d.ts +0 -1
- package/dist/src/flags.d.ts +0 -2
- package/dist/src/index-captureOnlyOnError.test.d.ts +0 -1
- package/dist/src/index-noSticky.test.d.ts +0 -1
- package/dist/src/index-sampling.test.d.ts +0 -1
- package/dist/src/index.d.ts +0 -213
- package/dist/src/index.test.d.ts +0 -1
- package/dist/src/session/Session.d.ts +0 -63
- package/dist/src/session/Session.test.d.ts +0 -1
- package/dist/src/session/constants.d.ts +0 -5
- package/dist/src/session/createSession.d.ts +0 -19
- package/dist/src/session/createSession.test.d.ts +0 -1
- package/dist/src/session/fetchSession.d.ts +0 -5
- package/dist/src/session/fetchSession.test.d.ts +0 -1
- package/dist/src/session/getSession.d.ts +0 -28
- package/dist/src/session/getSession.test.d.ts +0 -1
- package/dist/src/session/index.d.ts +0 -1
- package/dist/src/session/saveSession.d.ts +0 -2
- package/dist/src/session/saveSession.test.d.ts +0 -1
- package/dist/src/types.d.ts +0 -76
- package/dist/src/util/createBreadcrumb.d.ts +0 -4
- package/dist/src/util/isExpired.d.ts +0 -5
- package/dist/src/util/isExpired.test.d.ts +0 -1
- package/dist/src/util/isIngestHost.d.ts +0 -4
- package/dist/src/util/isSampled.d.ts +0 -7
- package/dist/src/util/isSampled.test.d.ts +0 -1
- package/dist/src/util/isSessionExpired.d.ts +0 -5
- package/dist/src/util/isSessionExpired.test.d.ts +0 -1
- package/dist/src/util/logger.d.ts +0 -12
- package/dist/src/util/supportsSendBeacon.d.ts +0 -4
- package/dist/test/index.d.ts +0 -3
- package/dist/test/mocks/mockRrweb.d.ts +0 -15
- package/dist/test/mocks/mockSdk.d.ts +0 -11
- package/dist/types/jest.config.d.ts +0 -3
- package/dist/types/jest.setup.d.ts +0 -10
- package/dist/types/src/api/captureReplay.d.ts +0 -3
- package/dist/types/src/api/captureReplayUpdate.d.ts +0 -2
- package/dist/types/src/coreHandlers/handleDom.d.ts +0 -1
- package/dist/types/src/coreHandlers/handleFetch.d.ts +0 -2
- package/dist/types/src/coreHandlers/handleFetch.test.d.ts +0 -1
- package/dist/types/src/coreHandlers/handleScope-unit.test.d.ts +0 -1
- package/dist/types/src/coreHandlers/handleScope.d.ts +0 -2
- package/dist/types/src/coreHandlers/handleScope.test.d.ts +0 -1
- package/dist/types/src/coreHandlers/handleXhr.d.ts +0 -2
- package/dist/types/src/coreHandlers/index.d.ts +0 -4
- package/dist/types/src/createPerformanceEntry.d.ts +0 -42
- package/dist/types/src/createPerformanceEntry.test.d.ts +0 -1
- package/dist/types/src/eventBuffer.d.ts +0 -31
- package/dist/types/src/eventBuffer.test.d.ts +0 -1
- package/dist/types/src/flags.d.ts +0 -2
- package/dist/types/src/index-captureOnlyOnError.test.d.ts +0 -1
- package/dist/types/src/index-noSticky.test.d.ts +0 -1
- package/dist/types/src/index-sampling.test.d.ts +0 -1
- package/dist/types/src/index.d.ts +0 -209
- package/dist/types/src/index.test.d.ts +0 -1
- package/dist/types/src/session/Session.d.ts +0 -63
- package/dist/types/src/session/Session.test.d.ts +0 -1
- package/dist/types/src/session/constants.d.ts +0 -5
- package/dist/types/src/session/createSession.d.ts +0 -19
- package/dist/types/src/session/createSession.test.d.ts +0 -1
- package/dist/types/src/session/fetchSession.d.ts +0 -5
- package/dist/types/src/session/fetchSession.test.d.ts +0 -1
- package/dist/types/src/session/getSession.d.ts +0 -28
- package/dist/types/src/session/getSession.test.d.ts +0 -1
- package/dist/types/src/session/index.d.ts +0 -1
- package/dist/types/src/session/saveSession.d.ts +0 -2
- package/dist/types/src/session/saveSession.test.d.ts +0 -1
- package/dist/types/src/session/types.d.ts +0 -0
- package/dist/types/src/types.d.ts +0 -76
- package/dist/types/src/util/createBreadcrumb.d.ts +0 -4
- package/dist/types/src/util/isExpired.d.ts +0 -5
- package/dist/types/src/util/isExpired.test.d.ts +0 -1
- package/dist/types/src/util/isIngestHost.d.ts +0 -4
- package/dist/types/src/util/isSampled.d.ts +0 -7
- package/dist/types/src/util/isSampled.test.d.ts +0 -1
- package/dist/types/src/util/isSessionExpired.d.ts +0 -5
- package/dist/types/src/util/isSessionExpired.test.d.ts +0 -1
- package/dist/types/src/util/logger.d.ts +0 -12
- package/dist/types/src/util/supportsSendBeacon.d.ts +0 -4
- package/dist/types/test/index.d.ts +0 -3
- package/dist/types/test/mocks/mockRrweb.d.ts +0 -15
- package/dist/types/test/mocks/mockSdk.d.ts +0 -11
- package/dist/types/worker/src/Compressor.d.ts +0 -15
- package/dist/types/worker/src/handleMessage.d.ts +0 -2
- package/dist/worker-aa3eb59a.js +0 -4
- package/dist/worker-f4750cfb.js +0 -7
- package/dist/worker-f4750cfb.js.map +0 -1
package/dist/src/types.d.ts
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { record } from 'rrweb';
|
|
2
|
-
import type { eventWithTime } from 'rrweb/typings/types';
|
|
3
|
-
export declare type RecordingEvent = eventWithTime;
|
|
4
|
-
export declare type RecordingConfig = Parameters<typeof record>[0];
|
|
5
|
-
export interface ReplaySpan {
|
|
6
|
-
description: string;
|
|
7
|
-
op: string;
|
|
8
|
-
startTimestamp: number;
|
|
9
|
-
endTimestamp: number;
|
|
10
|
-
data?: Record<string, unknown>;
|
|
11
|
-
}
|
|
12
|
-
export interface ReplayRequest {
|
|
13
|
-
endpoint: string;
|
|
14
|
-
events: Uint8Array | string;
|
|
15
|
-
}
|
|
16
|
-
export declare type InstrumentationType = 'scope' | 'dom' | 'fetch' | 'xhr';
|
|
17
|
-
/**
|
|
18
|
-
* The request payload to worker
|
|
19
|
-
*/
|
|
20
|
-
export interface WorkerRequest {
|
|
21
|
-
method: string;
|
|
22
|
-
args: any[];
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* The response from the worker
|
|
26
|
-
*/
|
|
27
|
-
export interface WorkerResponse {
|
|
28
|
-
method: string;
|
|
29
|
-
success: boolean;
|
|
30
|
-
response: string | Uint8Array;
|
|
31
|
-
}
|
|
32
|
-
export interface SentryReplayPluginOptions {
|
|
33
|
-
/**
|
|
34
|
-
* The amount of time to wait before sending a replay
|
|
35
|
-
*/
|
|
36
|
-
flushMinDelay?: number;
|
|
37
|
-
/**
|
|
38
|
-
* The max amount of time to wait before sending a replay
|
|
39
|
-
*/
|
|
40
|
-
flushMaxDelay?: number;
|
|
41
|
-
/**
|
|
42
|
-
* The amount of time to buffer the initial snapshot
|
|
43
|
-
*/
|
|
44
|
-
initialFlushDelay?: number;
|
|
45
|
-
/**
|
|
46
|
-
* If false, will create a new session per pageload
|
|
47
|
-
*/
|
|
48
|
-
stickySession?: boolean;
|
|
49
|
-
/**
|
|
50
|
-
* Attempt to use compression when web workers are available
|
|
51
|
-
*
|
|
52
|
-
* (default is true)
|
|
53
|
-
*/
|
|
54
|
-
useCompression?: boolean;
|
|
55
|
-
/**
|
|
56
|
-
* Only capture replays when an error happens
|
|
57
|
-
*/
|
|
58
|
-
captureOnlyOnError?: boolean;
|
|
59
|
-
/**
|
|
60
|
-
* The sampling rate for replays. 1.0 will record all replays, 0 will record none.
|
|
61
|
-
*/
|
|
62
|
-
replaysSamplingRate?: number;
|
|
63
|
-
}
|
|
64
|
-
export interface SentryReplayConfiguration extends SentryReplayPluginOptions {
|
|
65
|
-
/**
|
|
66
|
-
* Options for `rrweb.record()`
|
|
67
|
-
*/
|
|
68
|
-
recordingConfig?: RecordingConfig;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Some initial state captured before creating a root replay event
|
|
72
|
-
*/
|
|
73
|
-
export interface InitialState {
|
|
74
|
-
timestamp: number;
|
|
75
|
-
url: string;
|
|
76
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { Breadcrumb } from '@sentry/types';
|
|
2
|
-
declare type RequiredProperties = 'category' | 'message';
|
|
3
|
-
export default function createBreadcrumb(breadcrumb: Pick<Breadcrumb, RequiredProperties> & Partial<Omit<Breadcrumb, RequiredProperties>>): Breadcrumb;
|
|
4
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
declare const logger: {
|
|
2
|
-
error: (...args: any[]) => any;
|
|
3
|
-
warn: (...args: any[]) => any;
|
|
4
|
-
log: (...args: any[]) => any;
|
|
5
|
-
disable(): void;
|
|
6
|
-
enable(): void;
|
|
7
|
-
debug: (...args: unknown[]) => void;
|
|
8
|
-
info: (...args: unknown[]) => void;
|
|
9
|
-
assert: (...args: unknown[]) => void;
|
|
10
|
-
trace: (...args: unknown[]) => void;
|
|
11
|
-
};
|
|
12
|
-
export { logger };
|
package/dist/test/index.d.ts
DELETED
|
@@ -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
|
-
/// <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 declare function handleDom(handlerData: any): Promise<import("@sentry/types").Breadcrumb>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
export interface ReplayPerformanceEntry {
|
|
2
|
-
/**
|
|
3
|
-
* One of these types https://developer.mozilla.org/en-US/docs/Web/API/PerformanceEntry/entryType
|
|
4
|
-
*/
|
|
5
|
-
type: string;
|
|
6
|
-
/**
|
|
7
|
-
* A more specific description of the performance entry
|
|
8
|
-
*/
|
|
9
|
-
name: string;
|
|
10
|
-
/**
|
|
11
|
-
* The start timestamp in seconds
|
|
12
|
-
*/
|
|
13
|
-
start: number;
|
|
14
|
-
/**
|
|
15
|
-
* The end timestamp in seconds
|
|
16
|
-
*/
|
|
17
|
-
end: number;
|
|
18
|
-
/**
|
|
19
|
-
* Additional unstructured data to be included
|
|
20
|
-
*/
|
|
21
|
-
data?: Record<string, unknown>;
|
|
22
|
-
}
|
|
23
|
-
interface MemoryInfo {
|
|
24
|
-
jsHeapSizeLimit: number;
|
|
25
|
-
totalJSHeapSize: number;
|
|
26
|
-
usedJSHeapSize: number;
|
|
27
|
-
}
|
|
28
|
-
export declare function createPerformanceEntries(entries: PerformanceEntry[]): Promise<ReplayPerformanceEntry[]>;
|
|
29
|
-
export declare function createMemoryEntry(memoryEntry: MemoryInfo): {
|
|
30
|
-
type: string;
|
|
31
|
-
name: string;
|
|
32
|
-
start: number;
|
|
33
|
-
end: number;
|
|
34
|
-
data: {
|
|
35
|
-
memory: {
|
|
36
|
-
jsHeapSizeLimit: number;
|
|
37
|
-
totalJSHeapSize: number;
|
|
38
|
-
usedJSHeapSize: number;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { RecordingEvent } from './types';
|
|
2
|
-
interface CreateEventBufferParams {
|
|
3
|
-
useCompression: boolean;
|
|
4
|
-
}
|
|
5
|
-
export declare function createEventBuffer({ useCompression, }: CreateEventBufferParams): Promise<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
|
-
constructor(worker: Worker);
|
|
24
|
-
init(): void;
|
|
25
|
-
destroy(): void;
|
|
26
|
-
get length(): number;
|
|
27
|
-
addEvent(event: RecordingEvent, isCheckout?: boolean): void;
|
|
28
|
-
sendEventToWorker(event: RecordingEvent): void;
|
|
29
|
-
finish(): Promise<Uint8Array>;
|
|
30
|
-
}
|
|
31
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
import { Breadcrumb, DsnComponents, Event, Integration } from '@sentry/types';
|
|
2
|
-
import { Session } from './session/Session';
|
|
3
|
-
import { ReplayPerformanceEntry } from './createPerformanceEntry';
|
|
4
|
-
import { IEventBuffer } from './eventBuffer';
|
|
5
|
-
import type { InstrumentationType, RecordingConfig, RecordingEvent, ReplayRequest, ReplaySpan, SentryReplayConfiguration, SentryReplayPluginOptions } 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 SentryReplay implements Integration {
|
|
11
|
-
/**
|
|
12
|
-
* @inheritDoc
|
|
13
|
-
*/
|
|
14
|
-
static id: string;
|
|
15
|
-
/**
|
|
16
|
-
* @inheritDoc
|
|
17
|
-
*/
|
|
18
|
-
name: string;
|
|
19
|
-
eventBuffer: IEventBuffer;
|
|
20
|
-
/**
|
|
21
|
-
* Buffer of breadcrumbs to be uploaded
|
|
22
|
-
*/
|
|
23
|
-
breadcrumbs: Breadcrumb[];
|
|
24
|
-
/**
|
|
25
|
-
* Buffer of replay spans to be uploaded
|
|
26
|
-
*/
|
|
27
|
-
replaySpans: ReplaySpan[];
|
|
28
|
-
/**
|
|
29
|
-
* List of PerformanceEntry from PerformanceObserver
|
|
30
|
-
*/
|
|
31
|
-
performanceEvents: PerformanceEntry[];
|
|
32
|
-
/**
|
|
33
|
-
* Options to pass to `rrweb.record()`
|
|
34
|
-
*/
|
|
35
|
-
readonly recordingOptions: RecordingConfig;
|
|
36
|
-
readonly options: SentryReplayPluginOptions;
|
|
37
|
-
/**
|
|
38
|
-
* setTimeout id used for debouncing sending rrweb attachments
|
|
39
|
-
*/
|
|
40
|
-
private timeout;
|
|
41
|
-
/**
|
|
42
|
-
* The timestamp of the first event since the last flush. This is used to
|
|
43
|
-
* determine if the maximum allowed time has passed before events should be
|
|
44
|
-
* flushed again.
|
|
45
|
-
*/
|
|
46
|
-
private initialEventTimestampSinceFlush;
|
|
47
|
-
private performanceObserver;
|
|
48
|
-
private retryCount;
|
|
49
|
-
private retryInterval;
|
|
50
|
-
/**
|
|
51
|
-
* Flag to make sure we only create a replay event when
|
|
52
|
-
* necessary (i.e. we only want to have a single replay
|
|
53
|
-
* event per session and it should only be created
|
|
54
|
-
* immediately before sending recording)
|
|
55
|
-
*/
|
|
56
|
-
private needsCaptureReplay;
|
|
57
|
-
/**
|
|
58
|
-
* Captured state when integration is first initialized
|
|
59
|
-
*/
|
|
60
|
-
private initialState;
|
|
61
|
-
session: Session | undefined;
|
|
62
|
-
static attachmentUrlFromDsn(dsn: DsnComponents, eventId: string): string;
|
|
63
|
-
constructor({ flushMinDelay, flushMaxDelay, initialFlushDelay, stickySession, // TBD: Making this opt-in for now
|
|
64
|
-
useCompression, captureOnlyOnError, replaysSamplingRate, recordingConfig: { maskAllInputs, blockClass, ignoreClass, maskTextClass, ...recordingOptions }, }?: SentryReplayConfiguration);
|
|
65
|
-
/**
|
|
66
|
-
* Because we create a transaction in `setupOnce`, we can potentially create a
|
|
67
|
-
* transaction before some native SDK integrations have run and applied their
|
|
68
|
-
* own global event processor. An example is:
|
|
69
|
-
* https://github.com/getsentry/sentry-javascript/blob/b47ceafbdac7f8b99093ce6023726ad4687edc48/packages/browser/src/integrations/useragent.ts
|
|
70
|
-
*
|
|
71
|
-
* So we call `this.setup` in next event loop as a workaround to wait for
|
|
72
|
-
* other global event processors to finish
|
|
73
|
-
*/
|
|
74
|
-
setupOnce(): void;
|
|
75
|
-
/**
|
|
76
|
-
* Initializes the plugin.
|
|
77
|
-
*
|
|
78
|
-
* Creates or loads a session, attaches listeners to varying events (DOM, PerformanceObserver, Recording, Sentry SDK, etc)
|
|
79
|
-
*/
|
|
80
|
-
setup(): Promise<void>;
|
|
81
|
-
/**
|
|
82
|
-
* We want to batch uploads of replay events. Save events only if
|
|
83
|
-
* `<flushMinDelay>` milliseconds have elapsed since the last event
|
|
84
|
-
* *OR* if `<flushMaxDelay>` milliseconds have elapsed.
|
|
85
|
-
*
|
|
86
|
-
* Accepts a callback to perform side-effects and returns true to stop batch
|
|
87
|
-
* processing and hand back control to caller.
|
|
88
|
-
*/
|
|
89
|
-
addUpdate(cb?: AddUpdateCallback): void;
|
|
90
|
-
/**
|
|
91
|
-
* Currently, this needs to be manually called (e.g. for tests). Sentry SDK does not support a teardown
|
|
92
|
-
*/
|
|
93
|
-
destroy(): void;
|
|
94
|
-
clearSession(): void;
|
|
95
|
-
/**
|
|
96
|
-
* Loads a session from storage, or creates a new one if it does not exist or
|
|
97
|
-
* is expired.
|
|
98
|
-
*/
|
|
99
|
-
loadSession({ expiry }: {
|
|
100
|
-
expiry: number;
|
|
101
|
-
}): 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
|
-
* Handle when page is closed
|
|
139
|
-
*/
|
|
140
|
-
handleWindowUnload: () => void;
|
|
141
|
-
/**
|
|
142
|
-
* Handler for Sentry Core SDK events.
|
|
143
|
-
*
|
|
144
|
-
* Transforms core SDK events into replay events.
|
|
145
|
-
*
|
|
146
|
-
*/
|
|
147
|
-
handleCoreListener: (type: InstrumentationType) => (handlerData: any) => Promise<void>;
|
|
148
|
-
/**
|
|
149
|
-
* Keep a list of performance entries that will be sent with a replay
|
|
150
|
-
*/
|
|
151
|
-
handlePerformanceObserver: (list: PerformanceObserverEntryList) => void;
|
|
152
|
-
/**
|
|
153
|
-
* Tasks to run when we consider a page to be hidden (via blurring and/or visibility)
|
|
154
|
-
*/
|
|
155
|
-
doChangeToBackgroundTasks(breadcrumb?: Breadcrumb): void;
|
|
156
|
-
/**
|
|
157
|
-
* Tasks to run when we consider a page to be visible (via focus and/or visibility)
|
|
158
|
-
*/
|
|
159
|
-
doChangeToForegroundTasks(breadcrumb?: Breadcrumb): void;
|
|
160
|
-
/**
|
|
161
|
-
* Trigger rrweb to take a full snapshot which will cause this plugin to
|
|
162
|
-
* create a new Replay event.
|
|
163
|
-
*/
|
|
164
|
-
triggerFullSnapshot(): Promise<void>;
|
|
165
|
-
/**
|
|
166
|
-
* Updates the session's last activity timestamp
|
|
167
|
-
*/
|
|
168
|
-
updateLastActivity(lastActivity?: number): void;
|
|
169
|
-
/**
|
|
170
|
-
* Helper to create (and buffer) a replay breadcrumb from a core SDK breadcrumb
|
|
171
|
-
*/
|
|
172
|
-
createCustomBreadcrumb(breadcrumb: Breadcrumb): void;
|
|
173
|
-
/**
|
|
174
|
-
* Create a span for each performance entry. The parent transaction is `this.replayEvent`.
|
|
175
|
-
*/
|
|
176
|
-
createPerformanceSpans(entries: ReplayPerformanceEntry[]): void;
|
|
177
|
-
/**
|
|
178
|
-
* Observed performance events are added to `this.performanceEvents`. These
|
|
179
|
-
* are included in the replay event before it is finished and sent to Sentry.
|
|
180
|
-
*/
|
|
181
|
-
addPerformanceEntries(): Promise<void>;
|
|
182
|
-
/**
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
* Returns true if session is not expired, false otherwise.
|
|
186
|
-
*/
|
|
187
|
-
checkAndHandleExpiredSession(expiry?: number): boolean;
|
|
188
|
-
/**
|
|
189
|
-
* Only flush if `captureOnlyOnError` is false.
|
|
190
|
-
*/
|
|
191
|
-
conditionalFlush(lastActivity?: number): Promise<void>;
|
|
192
|
-
/**
|
|
193
|
-
* Flushes replay event buffer to Sentry.
|
|
194
|
-
*
|
|
195
|
-
* Performance events are only added right before flushing - this is probably
|
|
196
|
-
* due to the buffered performance observer events.
|
|
197
|
-
*/
|
|
198
|
-
flushUpdate(lastActivity?: number): Promise<void>;
|
|
199
|
-
/**
|
|
200
|
-
* Send replay attachment using either `sendBeacon()` or `fetch()`
|
|
201
|
-
*/
|
|
202
|
-
sendReplayRequest({ endpoint, events }: ReplayRequest): Promise<void>;
|
|
203
|
-
resetRetries(): void;
|
|
204
|
-
/**
|
|
205
|
-
* Finalize and send the current replay event to Sentry
|
|
206
|
-
*/
|
|
207
|
-
sendReplay(eventId: string, events: Uint8Array | string): Promise<boolean>;
|
|
208
|
-
}
|
|
209
|
-
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;
|
|
58
|
-
set previousSessionId(id: string);
|
|
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 ROOT_REPLAY_NAME = "sentry-replay";
|
|
3
|
-
export declare const REPLAY_EVENT_NAME = "sentry-replay-event";
|
|
4
|
-
export declare const SESSION_IDLE_DURATION = 900000;
|
|
5
|
-
export declare const VISIBILITY_CHANGE_TIMEOUT = 900000;
|
|
@@ -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 {};
|