@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
|
@@ -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]: any;
|
|
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;
|
|
21
|
-
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[]): 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 {};
|
package/dist/dist/flags.d.ts
DELETED
|
@@ -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,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,28 +0,0 @@
|
|
|
1
|
-
import { Session } from './Session';
|
|
2
|
-
interface GetSessionParams {
|
|
3
|
-
/**
|
|
4
|
-
* The length of time (in ms) which we will consider the session to be expired.
|
|
5
|
-
*/
|
|
6
|
-
expiry: number;
|
|
7
|
-
/**
|
|
8
|
-
* Should save session to sessionStorage?
|
|
9
|
-
*/
|
|
10
|
-
stickySession: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* The current session (e.g. if stickySession is off)
|
|
13
|
-
*/
|
|
14
|
-
currentSession?: Session;
|
|
15
|
-
/**
|
|
16
|
-
* The sampling rate of the Session. See integration configuration comments
|
|
17
|
-
* for `replaysSamplingRate`.
|
|
18
|
-
*/
|
|
19
|
-
samplingRate?: number;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Get or create a session
|
|
23
|
-
*/
|
|
24
|
-
export declare function getSession({ expiry, currentSession, stickySession, samplingRate, }: GetSessionParams): {
|
|
25
|
-
type: string;
|
|
26
|
-
session: Session;
|
|
27
|
-
};
|
|
28
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './createSession';
|
package/dist/dist/types.d.ts
DELETED
|
@@ -1,90 +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 ReplayRequest {
|
|
6
|
-
endpoint: string;
|
|
7
|
-
events: Uint8Array | string;
|
|
8
|
-
}
|
|
9
|
-
export declare type InstrumentationTypeBreadcrumb = 'dom' | 'scope';
|
|
10
|
-
export declare type InstrumentationTypeSpan = 'fetch' | 'xhr' | 'history';
|
|
11
|
-
export declare type InstrumentationType = InstrumentationTypeBreadcrumb | InstrumentationTypeSpan | 'console' | 'error' | 'unhandledrejection';
|
|
12
|
-
/**
|
|
13
|
-
* The request payload to worker
|
|
14
|
-
*/
|
|
15
|
-
export interface WorkerRequest {
|
|
16
|
-
id: number;
|
|
17
|
-
method: string;
|
|
18
|
-
args: any[];
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* The response from the worker
|
|
22
|
-
*/
|
|
23
|
-
export interface WorkerResponse {
|
|
24
|
-
id: number;
|
|
25
|
-
method: string;
|
|
26
|
-
success: boolean;
|
|
27
|
-
response: string | Uint8Array;
|
|
28
|
-
}
|
|
29
|
-
export interface SentryReplayPluginOptions {
|
|
30
|
-
/**
|
|
31
|
-
* The amount of time to wait before sending a replay
|
|
32
|
-
*/
|
|
33
|
-
flushMinDelay?: number;
|
|
34
|
-
/**
|
|
35
|
-
* The max amount of time to wait before sending a replay
|
|
36
|
-
*/
|
|
37
|
-
flushMaxDelay?: number;
|
|
38
|
-
/**
|
|
39
|
-
* The amount of time to buffer the initial snapshot
|
|
40
|
-
*/
|
|
41
|
-
initialFlushDelay?: number;
|
|
42
|
-
/**
|
|
43
|
-
* If false, will create a new session per pageload
|
|
44
|
-
*/
|
|
45
|
-
stickySession?: boolean;
|
|
46
|
-
/**
|
|
47
|
-
* Attempt to use compression when web workers are available
|
|
48
|
-
*
|
|
49
|
-
* (default is true)
|
|
50
|
-
*/
|
|
51
|
-
useCompression?: boolean;
|
|
52
|
-
/**
|
|
53
|
-
* Only capture replays when an error happens
|
|
54
|
-
*/
|
|
55
|
-
captureOnlyOnError?: boolean;
|
|
56
|
-
/**
|
|
57
|
-
* The sampling rate for replays. 1.0 will record all replays, 0 will record none.
|
|
58
|
-
*/
|
|
59
|
-
replaysSamplingRate?: number;
|
|
60
|
-
}
|
|
61
|
-
export interface SentryReplayConfiguration extends SentryReplayPluginOptions {
|
|
62
|
-
/**
|
|
63
|
-
* Options for `rrweb.record()`
|
|
64
|
-
*/
|
|
65
|
-
recordingConfig?: RecordingConfig;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Some initial state captured before creating a root replay event
|
|
69
|
-
*/
|
|
70
|
-
export interface InitialState {
|
|
71
|
-
timestamp: number;
|
|
72
|
-
url: string;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Additional context that will be sent w/ `replay_event`
|
|
76
|
-
*/
|
|
77
|
-
export interface ReplayEventContext {
|
|
78
|
-
/**
|
|
79
|
-
* Set of Sentry error ids that have occurred during a replay segment
|
|
80
|
-
*/
|
|
81
|
-
errorIds: Set<string>;
|
|
82
|
-
/**
|
|
83
|
-
* Set of Sentry trace ids that have occurred during a replay segment
|
|
84
|
-
*/
|
|
85
|
-
traceIds: Set<string>;
|
|
86
|
-
/**
|
|
87
|
-
* Ordered list of URLs that have been visited during a replay segment
|
|
88
|
-
*/
|
|
89
|
-
urls: string[];
|
|
90
|
-
}
|
|
@@ -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,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 };
|