@sentry/replay 0.5.15 → 0.5.16
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/config/types/src/api/captureReplayEvent.d.ts +22 -0
- package/dist/config/types/src/createPerformanceEntry.d.ts +2 -1
- package/dist/config/types/src/index.d.ts +14 -6
- package/dist/config/types/src/session/deleteSession.test.d.ts +1 -0
- package/dist/config/types/src/stop.test.d.ts +1 -0
- package/dist/config/types/src/types.d.ts +1 -0
- package/dist/index.es.js +100 -47
- package/dist/index.js +104 -47
- package/dist/index.js.map +1 -1
- package/dist/types/src/api/captureReplayEvent.d.ts +22 -0
- package/dist/types/src/createPerformanceEntry.d.ts +2 -1
- package/dist/types/src/index.d.ts +14 -6
- package/dist/types/src/types.d.ts +1 -0
- package/package.json +3 -1
- package/dist/config/types/src/api/captureReplay.d.ts +0 -10
- package/dist/config/types/src/api/captureReplayUpdate.d.ts +0 -12
|
@@ -1,15 +1,37 @@
|
|
|
1
1
|
import { InitialState } from '@/types';
|
|
2
2
|
export interface CaptureReplayEventParams {
|
|
3
|
+
/**
|
|
4
|
+
* Initial state of the replay
|
|
5
|
+
*/
|
|
3
6
|
initialState: InitialState;
|
|
7
|
+
/**
|
|
8
|
+
* Include a timestamp that should be deemed as the "starting" timestamp of the
|
|
9
|
+
* replay. This usually comes from a `window.performance` entry.
|
|
10
|
+
*/
|
|
4
11
|
includeReplayStartTimestamp: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* List of error ids contained in current recording segment
|
|
14
|
+
*/
|
|
5
15
|
errorIds: string[];
|
|
16
|
+
/**
|
|
17
|
+
* The current replay id
|
|
18
|
+
*/
|
|
6
19
|
replayId: string;
|
|
20
|
+
/**
|
|
21
|
+
* The current recording segment id
|
|
22
|
+
*/
|
|
7
23
|
segmentId: number;
|
|
8
24
|
/**
|
|
9
25
|
* Timestamp of the event in milliseconds
|
|
10
26
|
*/
|
|
11
27
|
timestamp: number;
|
|
28
|
+
/**
|
|
29
|
+
* List of trace ids contained in current recording segment
|
|
30
|
+
*/
|
|
12
31
|
traceIds: string[];
|
|
32
|
+
/**
|
|
33
|
+
* List of URLs visisted in current recording segment
|
|
34
|
+
*/
|
|
13
35
|
urls: string[];
|
|
14
36
|
}
|
|
15
37
|
export declare function captureReplayEvent({ initialState, includeReplayStartTimestamp, errorIds, replayId: replay_id, segmentId: segment_id, timestamp, traceIds, urls, }: CaptureReplayEventParams): void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AllPerformanceEntry } from './types';
|
|
1
2
|
export interface ReplayPerformanceEntry {
|
|
2
3
|
/**
|
|
3
4
|
* One of these types https://developer.mozilla.org/en-US/docs/Web/API/PerformanceEntry/entryType
|
|
@@ -25,7 +26,7 @@ interface MemoryInfo {
|
|
|
25
26
|
totalJSHeapSize: number;
|
|
26
27
|
usedJSHeapSize: number;
|
|
27
28
|
}
|
|
28
|
-
export declare function createPerformanceEntries(entries:
|
|
29
|
+
export declare function createPerformanceEntries(entries: AllPerformanceEntry[]): ReplayPerformanceEntry[];
|
|
29
30
|
export declare function createMemoryEntry(memoryEntry: MemoryInfo): {
|
|
30
31
|
type: string;
|
|
31
32
|
name: string;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
/// <reference types="lodash" />
|
|
1
2
|
import { Breadcrumb, Event, Integration } from '@sentry/types';
|
|
2
3
|
import { CaptureReplayEventParams } from './api/captureReplayEvent';
|
|
3
4
|
import { Session } from './session/Session';
|
|
4
5
|
import { ReplayPerformanceEntry } from './createPerformanceEntry';
|
|
5
6
|
import { IEventBuffer } from './eventBuffer';
|
|
6
|
-
import type { InstrumentationTypeBreadcrumb, InstrumentationTypeSpan, RecordedEvents, RecordingConfig, RecordingEvent, ReplayRequest, SentryReplayConfiguration, SentryReplayPluginOptions } from './types';
|
|
7
|
+
import type { AllPerformanceEntry, InstrumentationTypeBreadcrumb, InstrumentationTypeSpan, RecordedEvents, RecordingConfig, RecordingEvent, ReplayRequest, SentryReplayConfiguration, SentryReplayPluginOptions } from './types';
|
|
7
8
|
/**
|
|
8
9
|
* Returns true to return control to calling function, otherwise continue with normal batching
|
|
9
10
|
*/
|
|
@@ -21,7 +22,7 @@ export declare class SentryReplay implements Integration {
|
|
|
21
22
|
/**
|
|
22
23
|
* List of PerformanceEntry from PerformanceObserver
|
|
23
24
|
*/
|
|
24
|
-
performanceEvents:
|
|
25
|
+
performanceEvents: AllPerformanceEntry[];
|
|
25
26
|
/**
|
|
26
27
|
* Options to pass to `rrweb.record()`
|
|
27
28
|
*/
|
|
@@ -45,6 +46,7 @@ export declare class SentryReplay implements Integration {
|
|
|
45
46
|
* slightly differently in this case: `replay_start_timestamp` is included.
|
|
46
47
|
*/
|
|
47
48
|
private newSessionCreated;
|
|
49
|
+
private flushLock;
|
|
48
50
|
/**
|
|
49
51
|
* Is the integration currently active?
|
|
50
52
|
*/
|
|
@@ -209,19 +211,25 @@ export declare class SentryReplay implements Integration {
|
|
|
209
211
|
* Only flush if `captureOnlyOnError` is false.
|
|
210
212
|
*/
|
|
211
213
|
conditionalFlush(): Promise<void> | undefined;
|
|
214
|
+
/**
|
|
215
|
+
* Clear context
|
|
216
|
+
*/
|
|
217
|
+
clearContext(): void;
|
|
212
218
|
/**
|
|
213
219
|
* Return and clear context
|
|
214
220
|
*/
|
|
215
|
-
popEventContext({ timestamp, }
|
|
216
|
-
timestamp
|
|
217
|
-
}): CaptureReplayEventParams
|
|
221
|
+
popEventContext({ timestamp, }: {
|
|
222
|
+
timestamp: number;
|
|
223
|
+
}): Omit<CaptureReplayEventParams, 'includeReplayStartTimestamp' | 'segmentId' | 'replayId'>;
|
|
224
|
+
runFlush(): Promise<void>;
|
|
218
225
|
/**
|
|
219
226
|
* Flushes replay event buffer to Sentry.
|
|
220
227
|
*
|
|
221
228
|
* Performance events are only added right before flushing - this is probably
|
|
222
229
|
* due to the buffered performance observer events.
|
|
223
230
|
*/
|
|
224
|
-
flushUpdate()
|
|
231
|
+
flushUpdate: () => Promise<void>;
|
|
232
|
+
throttledFlushUpdate: import("lodash").DebouncedFunc<() => Promise<void>>;
|
|
225
233
|
/**
|
|
226
234
|
* Send replay attachment using `fetch()`
|
|
227
235
|
*/
|
|
@@ -3,6 +3,7 @@ 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
5
|
export declare type RecordedEvents = Uint8Array | string;
|
|
6
|
+
export declare type AllPerformanceEntry = PerformancePaintTiming | PerformanceResourceTiming | PerformanceNavigationTiming;
|
|
6
7
|
export interface ReplayRequest {
|
|
7
8
|
endpoint: string;
|
|
8
9
|
events: RecordedEvents;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/replay",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.16",
|
|
4
4
|
"description": "User replays for Sentry",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.es.js",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"@sentry/browser": "^7.7.0",
|
|
45
45
|
"@size-limit/preset-big-lib": "^7.0.8",
|
|
46
46
|
"@types/jest": "^28.1.1",
|
|
47
|
+
"@types/lodash.throttle": "^4.1.7",
|
|
47
48
|
"@types/node": "^16.0.0",
|
|
48
49
|
"@types/pako": "^2.0.0",
|
|
49
50
|
"@typescript-eslint/eslint-plugin": "^5.31.0",
|
|
@@ -71,6 +72,7 @@
|
|
|
71
72
|
"@sentry/core": "^7.7.0",
|
|
72
73
|
"@sentry/types": "^7.7.0",
|
|
73
74
|
"@sentry/utils": "^7.7.0",
|
|
75
|
+
"lodash.throttle": "^4.1.1",
|
|
74
76
|
"pako": "^2.0.4",
|
|
75
77
|
"rrweb": "^1.1.3"
|
|
76
78
|
},
|
|
@@ -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;
|