@sentry/replay 0.5.12 → 0.5.13

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.
@@ -0,0 +1,15 @@
1
+ import { InitialState } from '@/types';
2
+ export interface CaptureReplayEventParams {
3
+ initialState: InitialState;
4
+ includeReplayStartTimestamp: boolean;
5
+ errorIds: string[];
6
+ replayId: string;
7
+ segmentId: number;
8
+ /**
9
+ * Timestamp of the event in milliseconds
10
+ */
11
+ timestamp: number;
12
+ traceIds: string[];
13
+ urls: string[];
14
+ }
15
+ export declare function captureReplayEvent({ initialState, includeReplayStartTimestamp, errorIds, replayId: replay_id, segmentId: segment_id, timestamp, traceIds, urls, }: CaptureReplayEventParams): void;
@@ -1,6 +1,5 @@
1
1
  import { Breadcrumb, Event, Integration } from '@sentry/types';
2
- import { CaptureReplayParams } from './api/captureReplay';
3
- import { CaptureReplayUpdateParams } from './api/captureReplayUpdate';
2
+ import { CaptureReplayEventParams } from './api/captureReplayEvent';
4
3
  import { Session } from './session/Session';
5
4
  import { ReplayPerformanceEntry } from './createPerformanceEntry';
6
5
  import { IEventBuffer } from './eventBuffer';
@@ -42,12 +41,10 @@ export declare class SentryReplay implements Integration {
42
41
  private retryCount;
43
42
  private retryInterval;
44
43
  /**
45
- * Flag to make sure we only create a replay event when
46
- * necessary (i.e. we only want to have a single replay
47
- * event per session and it should only be created
48
- * immediately before sending recording)
44
+ * Flag when a new session has been created. Captured replay events behave
45
+ * slightly differently in this case: `replay_start_timestamp` is included.
49
46
  */
50
- private needsCaptureReplay;
47
+ private newSessionCreated;
51
48
  /**
52
49
  * Is the integration currently active?
53
50
  */
@@ -217,7 +214,7 @@ export declare class SentryReplay implements Integration {
217
214
  */
218
215
  popEventContext({ timestamp, }?: {
219
216
  timestamp?: number;
220
- }): CaptureReplayParams & CaptureReplayUpdateParams;
217
+ }): CaptureReplayEventParams;
221
218
  /**
222
219
  * Flushes replay event buffer to Sentry.
223
220
  *
@@ -228,11 +225,11 @@ export declare class SentryReplay implements Integration {
228
225
  /**
229
226
  * Send replay attachment using `fetch()`
230
227
  */
231
- sendReplayRequest({ endpoint, events }: ReplayRequest): Promise<void>;
228
+ sendReplayRequest({ endpoint, events, replayId: event_id, segmentId: segment_id, }: ReplayRequest): Promise<void>;
232
229
  resetRetries(): void;
233
230
  /**
234
231
  * Finalize and send the current replay event to Sentry
235
232
  */
236
- sendReplay(eventId: string, events: RecordedEvents): Promise<boolean | undefined>;
233
+ sendReplay(replayId: string, events: RecordedEvents, segmentId: number): Promise<true | undefined>;
237
234
  }
238
235
  export {};
@@ -6,6 +6,8 @@ export declare type RecordedEvents = Uint8Array | string;
6
6
  export interface ReplayRequest {
7
7
  endpoint: string;
8
8
  events: RecordedEvents;
9
+ replayId: string;
10
+ segmentId: number;
9
11
  }
10
12
  export declare type InstrumentationTypeBreadcrumb = 'dom' | 'scope';
11
13
  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.5.12",
3
+ "version": "0.5.13",
4
4
  "description": "User replays for Sentry",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",
@@ -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;