@sentry/replay 0.6.2 → 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.
Files changed (29) hide show
  1. package/CHANGELOG.md +0 -0
  2. package/README.md +1 -1
  3. package/dist/config/types/jest.setup.d.ts +23 -2
  4. package/dist/config/types/src/api/captureReplayEvent.d.ts +1 -1
  5. package/dist/config/types/src/coreHandlers/getBreadcrumbHandler.d.ts +1 -1
  6. package/dist/config/types/src/coreHandlers/getSpanHandler.d.ts +1 -1
  7. package/dist/config/types/src/coreHandlers/handleFetch.d.ts +1 -1
  8. package/dist/config/types/src/coreHandlers/handleHistory.d.ts +1 -1
  9. package/dist/config/types/src/coreHandlers/handleXhr.d.ts +1 -1
  10. package/dist/config/types/src/index.d.ts +14 -7
  11. package/dist/config/types/src/types.d.ts +2 -1
  12. package/dist/config/types/src/util/createPayload.d.ts +1 -1
  13. package/dist/config/types/src/util/isSessionExpired.d.ts +1 -1
  14. package/dist/config/types/test/mocks/mockRrweb.d.ts +1 -1
  15. package/dist/config/types/test/mocks/mockSdk.d.ts +4 -5
  16. package/dist/index.es.js +108 -79
  17. package/dist/index.js +107 -78
  18. package/dist/index.js.map +1 -1
  19. package/dist/types/src/coreHandlers/getBreadcrumbHandler.d.ts +1 -1
  20. package/dist/types/src/coreHandlers/getSpanHandler.d.ts +1 -1
  21. package/dist/types/src/coreHandlers/handleFetch.d.ts +1 -1
  22. package/dist/types/src/coreHandlers/handleHistory.d.ts +1 -1
  23. package/dist/types/src/coreHandlers/handleXhr.d.ts +1 -1
  24. package/dist/types/src/index.d.ts +14 -7
  25. package/dist/types/src/types.d.ts +2 -1
  26. package/dist/types/src/util/createPayload.d.ts +1 -1
  27. package/dist/types/src/util/isSessionExpired.d.ts +1 -1
  28. package/package.json +7 -7
  29. package/dist/types/src/api/captureReplayEvent.d.ts +0 -37
@@ -1,3 +1,3 @@
1
- import { InstrumentationTypeBreadcrumb } from '@/types';
1
+ import { InstrumentationTypeBreadcrumb } from '../types';
2
2
  import { handleScope } from './handleScope';
3
3
  export declare function getBreadcrumbHandler(type: InstrumentationTypeBreadcrumb): typeof handleScope;
@@ -1,4 +1,4 @@
1
- import { InstrumentationTypeSpan } from '@/types';
1
+ import { InstrumentationTypeSpan } from '../types';
2
2
  import { handleFetch } from './handleFetch';
3
3
  import { handleHistory } from './handleHistory';
4
4
  import { handleXhr } from './handleXhr';
@@ -1,4 +1,4 @@
1
- import { ReplayPerformanceEntry } from '@/createPerformanceEntry';
1
+ import { ReplayPerformanceEntry } from '../createPerformanceEntry';
2
2
  interface FetchHandlerData {
3
3
  args: Parameters<typeof fetch>;
4
4
  fetchData: {
@@ -1,4 +1,4 @@
1
- import { ReplayPerformanceEntry } from '@/createPerformanceEntry';
1
+ import { ReplayPerformanceEntry } from '../createPerformanceEntry';
2
2
  interface HistoryHandlerData {
3
3
  from: string;
4
4
  to: string;
@@ -1,4 +1,4 @@
1
- import { ReplayPerformanceEntry } from '@/createPerformanceEntry';
1
+ import { ReplayPerformanceEntry } from '../createPerformanceEntry';
2
2
  declare type XHRSendInput = null | Blob | BufferSource | FormData | URLSearchParams | string;
3
3
  interface SentryWrappedXMLHttpRequest extends XMLHttpRequest {
4
4
  [key: string]: unknown;
@@ -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, ReplayRequest } from './types';
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({ timestamp, }: {
212
- timestamp: number;
213
- }): Omit<CaptureReplayEventParams, 'includeReplayStartTimestamp' | 'segmentId' | 'replayId'>;
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, }: ReplayRequest): Promise<void>;
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: string, events: RecordedEvents, segmentId: number): Promise<unknown>;
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 ReplayRequest {
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';
@@ -1,4 +1,4 @@
1
- import { RecordedEvents } from '@/types';
1
+ import { RecordedEvents } from '../types';
2
2
  export declare function createPayload({ events, headers, }: {
3
3
  events: RecordedEvents;
4
4
  headers: Record<string, any>;
@@ -1,4 +1,4 @@
1
- import { Session } from '@/session/Session';
1
+ import { Session } from '../session/Session';
2
2
  /**
3
3
  * Checks to see if session is expired
4
4
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/replay",
3
- "version": "0.6.2",
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": "^28.1.1",
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": "^16.0.0",
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": "^28.1.1",
59
- "jest-environment-jsdom": "^28.1.1",
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": "^28.0.4",
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": "16.15.1",
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;