@sentry/replay 0.6.3 → 0.6.4-0
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/jest.setup.d.ts +22 -1
- package/dist/config/types/src/index.d.ts +14 -7
- package/dist/config/types/src/types.d.ts +2 -1
- package/dist/config/types/src/util/logger.d.ts +1 -1
- package/dist/config/types/test/mocks/mockSdk.d.ts +3 -4
- package/dist/index.es.js +108 -79
- package/dist/index.js +107 -78
- package/dist/index.js.map +1 -1
- package/dist/types/src/index.d.ts +14 -7
- package/dist/types/src/types.d.ts +2 -1
- package/package.json +7 -7
- package/dist/types/src/api/captureReplayEvent.d.ts +0 -37
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { Breadcrumb, Event, Integration } from '@sentry/types';
|
|
2
|
-
import { CaptureReplayEventParams } from './api/captureReplayEvent';
|
|
3
2
|
import { Session } from './session/Session';
|
|
4
3
|
import { ReplayPerformanceEntry } from './createPerformanceEntry';
|
|
5
4
|
import { IEventBuffer } from './eventBuffer';
|
|
6
|
-
import type { AllPerformanceEntry, InstrumentationTypeBreadcrumb, InstrumentationTypeSpan, RecordedEvents, RecordingEvent, RecordingOptions, ReplayConfiguration, ReplayPluginOptions,
|
|
5
|
+
import type { AllPerformanceEntry, InitialState, InstrumentationTypeBreadcrumb, InstrumentationTypeSpan, RecordedEvents, RecordingEvent, RecordingOptions, ReplayConfiguration, ReplayPluginOptions, SendReplayRequest } from './types';
|
|
7
6
|
/**
|
|
8
7
|
* Returns true to return control to calling function, otherwise continue with normal batching
|
|
9
8
|
*/
|
|
@@ -208,9 +207,12 @@ export declare class Replay implements Integration {
|
|
|
208
207
|
/**
|
|
209
208
|
* Return and clear context
|
|
210
209
|
*/
|
|
211
|
-
popEventContext(
|
|
212
|
-
|
|
213
|
-
|
|
210
|
+
popEventContext(): {
|
|
211
|
+
initialState: InitialState;
|
|
212
|
+
errorIds: string[];
|
|
213
|
+
traceIds: string[];
|
|
214
|
+
urls: string[];
|
|
215
|
+
};
|
|
214
216
|
/**
|
|
215
217
|
* Flushes replay event buffer to Sentry.
|
|
216
218
|
*
|
|
@@ -228,11 +230,16 @@ export declare class Replay implements Integration {
|
|
|
228
230
|
/**
|
|
229
231
|
* Send replay attachment using `fetch()`
|
|
230
232
|
*/
|
|
231
|
-
sendReplayRequest({ endpoint, events, replayId: event_id, segmentId: segment_id, }:
|
|
233
|
+
sendReplayRequest({ endpoint, events, replayId: event_id, segmentId: segment_id, includeReplayStartTimestamp, }: SendReplayRequest): Promise<void>;
|
|
232
234
|
resetRetries(): void;
|
|
233
235
|
/**
|
|
234
236
|
* Finalize and send the current replay event to Sentry
|
|
235
237
|
*/
|
|
236
|
-
sendReplay(replayId
|
|
238
|
+
sendReplay({ replayId, events, segmentId, includeReplayStartTimestamp, }: {
|
|
239
|
+
replayId: string;
|
|
240
|
+
events: RecordedEvents;
|
|
241
|
+
segmentId: number;
|
|
242
|
+
includeReplayStartTimestamp: boolean;
|
|
243
|
+
}): Promise<unknown>;
|
|
237
244
|
}
|
|
238
245
|
export {};
|
|
@@ -3,11 +3,12 @@ export declare type RecordingEvent = eventWithTime;
|
|
|
3
3
|
export declare type RecordingOptions = recordOptions<eventWithTime>;
|
|
4
4
|
export declare type RecordedEvents = Uint8Array | string;
|
|
5
5
|
export declare type AllPerformanceEntry = PerformancePaintTiming | PerformanceResourceTiming | PerformanceNavigationTiming;
|
|
6
|
-
export interface
|
|
6
|
+
export interface SendReplayRequest {
|
|
7
7
|
endpoint: string;
|
|
8
8
|
events: RecordedEvents;
|
|
9
9
|
replayId: string;
|
|
10
10
|
segmentId: number;
|
|
11
|
+
includeReplayStartTimestamp: boolean;
|
|
11
12
|
}
|
|
12
13
|
export declare type InstrumentationTypeBreadcrumb = 'dom' | 'scope';
|
|
13
14
|
export declare type InstrumentationTypeSpan = 'fetch' | 'xhr' | 'history';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/replay",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.4-0",
|
|
4
4
|
"description": "User replays for Sentry",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.es.js",
|
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
"@sentry/browser": "^7.7.0",
|
|
44
44
|
"@size-limit/file": "^8.1.0",
|
|
45
45
|
"@size-limit/time": "^8.1.0",
|
|
46
|
-
"@types/jest": "^
|
|
46
|
+
"@types/jest": "^29.1.2",
|
|
47
47
|
"@types/lodash.debounce": "^4.0.7",
|
|
48
48
|
"@types/lodash.throttle": "^4.1.7",
|
|
49
|
-
"@types/node": "^
|
|
49
|
+
"@types/node": "^18.11.0",
|
|
50
50
|
"@types/pako": "^2.0.0",
|
|
51
51
|
"@typescript-eslint/eslint-plugin": "^5.31.0",
|
|
52
52
|
"@typescript-eslint/parser": "^5.31.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": "^
|
|
59
|
-
"jest-environment-jsdom": "^
|
|
58
|
+
"jest": "^29.2.0",
|
|
59
|
+
"jest-environment-jsdom": "^29.2.0",
|
|
60
60
|
"jsdom-worker": "^0.2.1",
|
|
61
61
|
"lint-staged": ">=10",
|
|
62
62
|
"prettier": "^2.5.1",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"rollup": "^2.70.0",
|
|
65
65
|
"rollup-plugin-terser": "^7.0.2",
|
|
66
66
|
"size-limit": "^8.1.0",
|
|
67
|
-
"ts-jest": "^
|
|
67
|
+
"ts-jest": "^29.0.3",
|
|
68
68
|
"ts-node": "^10.7.0",
|
|
69
69
|
"tslib": "^2.3.1",
|
|
70
70
|
"typescript": "^4.6.2"
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
}
|
|
91
91
|
],
|
|
92
92
|
"volta": {
|
|
93
|
-
"node": "
|
|
93
|
+
"node": "18.11.0",
|
|
94
94
|
"yarn": "1.22.19"
|
|
95
95
|
}
|
|
96
96
|
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { InitialState } from '../types';
|
|
2
|
-
export interface CaptureReplayEventParams {
|
|
3
|
-
/**
|
|
4
|
-
* Initial state of the replay
|
|
5
|
-
*/
|
|
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
|
-
*/
|
|
11
|
-
includeReplayStartTimestamp: boolean;
|
|
12
|
-
/**
|
|
13
|
-
* List of error ids contained in current recording segment
|
|
14
|
-
*/
|
|
15
|
-
errorIds: string[];
|
|
16
|
-
/**
|
|
17
|
-
* The current replay id
|
|
18
|
-
*/
|
|
19
|
-
replayId: string;
|
|
20
|
-
/**
|
|
21
|
-
* The current recording segment id
|
|
22
|
-
*/
|
|
23
|
-
segmentId: number;
|
|
24
|
-
/**
|
|
25
|
-
* Timestamp of the event in milliseconds
|
|
26
|
-
*/
|
|
27
|
-
timestamp: number;
|
|
28
|
-
/**
|
|
29
|
-
* List of trace ids contained in current recording segment
|
|
30
|
-
*/
|
|
31
|
-
traceIds: string[];
|
|
32
|
-
/**
|
|
33
|
-
* List of URLs visisted in current recording segment
|
|
34
|
-
*/
|
|
35
|
-
urls: string[];
|
|
36
|
-
}
|
|
37
|
-
export declare function captureReplayEvent({ initialState, includeReplayStartTimestamp, errorIds, replayId: replay_id, segmentId: segment_id, timestamp, traceIds, urls, }: CaptureReplayEventParams): void;
|