@sentry/replay 7.30.0 → 7.31.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 (120) hide show
  1. package/cjs/constants.js +5 -0
  2. package/cjs/constants.js.map +1 -1
  3. package/cjs/coreHandlers/breadcrumbHandler.js.map +1 -1
  4. package/cjs/coreHandlers/handleDom.js.map +1 -1
  5. package/cjs/coreHandlers/handleGlobalEvent.js.map +1 -1
  6. package/cjs/coreHandlers/handleScope.js.map +1 -1
  7. package/cjs/eventBuffer.js +44 -10
  8. package/cjs/eventBuffer.js.map +1 -1
  9. package/cjs/integration.js +19 -19
  10. package/cjs/integration.js.map +1 -1
  11. package/cjs/replay.js +202 -357
  12. package/cjs/replay.js.map +1 -1
  13. package/cjs/util/addEvent.js +9 -5
  14. package/cjs/util/addEvent.js.map +1 -1
  15. package/cjs/util/addMemoryEntry.js +8 -5
  16. package/cjs/util/addMemoryEntry.js.map +1 -1
  17. package/cjs/{createPerformanceEntry.js → util/createPerformanceEntries.js} +14 -8
  18. package/cjs/util/createPerformanceEntries.js.map +1 -0
  19. package/cjs/util/createPerformanceSpans.js +5 -2
  20. package/cjs/util/createPerformanceSpans.js.map +1 -1
  21. package/cjs/util/createReplayEnvelope.js +5 -1
  22. package/cjs/util/createReplayEnvelope.js.map +1 -1
  23. package/cjs/util/isRrwebError.js.map +1 -1
  24. package/cjs/util/monkeyPatchRecordDroppedEvent.js.map +1 -1
  25. package/cjs/util/{createRecordingData.js → prepareRecordingData.js} +9 -9
  26. package/cjs/util/prepareRecordingData.js.map +1 -0
  27. package/cjs/util/prepareReplayEvent.js +1 -1
  28. package/cjs/util/prepareReplayEvent.js.map +1 -1
  29. package/cjs/util/sendReplay.js +64 -0
  30. package/cjs/util/sendReplay.js.map +1 -0
  31. package/cjs/util/sendReplayRequest.js +161 -0
  32. package/cjs/util/sendReplayRequest.js.map +1 -0
  33. package/cjs/worker/worker.js +1 -1
  34. package/cjs/worker/worker.js.map +1 -1
  35. package/esm/constants.js +4 -1
  36. package/esm/constants.js.map +1 -1
  37. package/esm/coreHandlers/breadcrumbHandler.js.map +1 -1
  38. package/esm/coreHandlers/handleDom.js.map +1 -1
  39. package/esm/coreHandlers/handleGlobalEvent.js.map +1 -1
  40. package/esm/coreHandlers/handleScope.js.map +1 -1
  41. package/esm/eventBuffer.js +44 -10
  42. package/esm/eventBuffer.js.map +1 -1
  43. package/esm/integration.js +19 -19
  44. package/esm/integration.js.map +1 -1
  45. package/esm/replay.js +205 -360
  46. package/esm/replay.js.map +1 -1
  47. package/esm/util/addEvent.js +9 -5
  48. package/esm/util/addEvent.js.map +1 -1
  49. package/esm/util/addMemoryEntry.js +8 -5
  50. package/esm/util/addMemoryEntry.js.map +1 -1
  51. package/esm/{createPerformanceEntry.js → util/createPerformanceEntries.js} +14 -8
  52. package/esm/util/createPerformanceEntries.js.map +1 -0
  53. package/esm/util/createPerformanceSpans.js +5 -2
  54. package/esm/util/createPerformanceSpans.js.map +1 -1
  55. package/esm/util/createReplayEnvelope.js +5 -1
  56. package/esm/util/createReplayEnvelope.js.map +1 -1
  57. package/esm/util/isRrwebError.js.map +1 -1
  58. package/esm/util/monkeyPatchRecordDroppedEvent.js.map +1 -1
  59. package/esm/util/{createRecordingData.js → prepareRecordingData.js} +9 -9
  60. package/esm/util/prepareRecordingData.js.map +1 -0
  61. package/esm/util/prepareReplayEvent.js +1 -1
  62. package/esm/util/prepareReplayEvent.js.map +1 -1
  63. package/esm/util/sendReplay.js +62 -0
  64. package/esm/util/sendReplay.js.map +1 -0
  65. package/esm/util/sendReplayRequest.js +154 -0
  66. package/esm/util/sendReplayRequest.js.map +1 -0
  67. package/esm/worker/worker.js +1 -1
  68. package/esm/worker/worker.js.map +1 -1
  69. package/package.json +4 -7
  70. package/types/constants.d.ts +2 -0
  71. package/types/constants.d.ts.map +1 -1
  72. package/types/coreHandlers/breadcrumbHandler.d.ts +1 -1
  73. package/types/coreHandlers/breadcrumbHandler.d.ts.map +1 -1
  74. package/types/coreHandlers/handleDom.d.ts +1 -1
  75. package/types/coreHandlers/handleDom.d.ts.map +1 -1
  76. package/types/coreHandlers/handleGlobalEvent.d.ts +1 -1
  77. package/types/coreHandlers/handleGlobalEvent.d.ts.map +1 -1
  78. package/types/coreHandlers/handleScope.d.ts +1 -1
  79. package/types/coreHandlers/handleScope.d.ts.map +1 -1
  80. package/types/eventBuffer.d.ts +18 -6
  81. package/types/eventBuffer.d.ts.map +1 -1
  82. package/types/integration.d.ts +5 -5
  83. package/types/integration.d.ts.map +1 -1
  84. package/types/replay.d.ts +53 -69
  85. package/types/replay.d.ts.map +1 -1
  86. package/types/types.d.ts +27 -6
  87. package/types/types.d.ts.map +1 -1
  88. package/types/util/addEvent.d.ts +2 -2
  89. package/types/util/addEvent.d.ts.map +1 -1
  90. package/types/util/addMemoryEntry.d.ts +2 -2
  91. package/types/util/addMemoryEntry.d.ts.map +1 -1
  92. package/types/{createPerformanceEntry.d.ts → util/createPerformanceEntries.d.ts} +2 -2
  93. package/types/util/createPerformanceEntries.d.ts.map +1 -0
  94. package/types/util/createPerformanceSpans.d.ts +2 -2
  95. package/types/util/createPerformanceSpans.d.ts.map +1 -1
  96. package/types/util/createReplayEnvelope.d.ts +1 -1
  97. package/types/util/createReplayEnvelope.d.ts.map +1 -1
  98. package/types/util/isRrwebError.d.ts +1 -1
  99. package/types/util/isRrwebError.d.ts.map +1 -1
  100. package/types/util/prepareRecordingData.d.ts +9 -0
  101. package/types/util/prepareRecordingData.d.ts.map +1 -0
  102. package/types/util/prepareReplayEvent.d.ts +2 -2
  103. package/types/util/prepareReplayEvent.d.ts.map +1 -1
  104. package/types/util/sendReplay.d.ts +9 -0
  105. package/types/util/sendReplay.d.ts.map +1 -0
  106. package/types/util/sendReplayRequest.d.ts +21 -0
  107. package/types/util/sendReplayRequest.d.ts.map +1 -0
  108. package/cjs/createPerformanceEntry.js.map +0 -1
  109. package/cjs/session/deleteSession.js +0 -23
  110. package/cjs/session/deleteSession.js.map +0 -1
  111. package/cjs/util/createRecordingData.js.map +0 -1
  112. package/esm/createPerformanceEntry.js.map +0 -1
  113. package/esm/session/deleteSession.js +0 -21
  114. package/esm/session/deleteSession.js.map +0 -1
  115. package/esm/util/createRecordingData.js.map +0 -1
  116. package/types/createPerformanceEntry.d.ts.map +0 -1
  117. package/types/session/deleteSession.d.ts +0 -5
  118. package/types/session/deleteSession.d.ts.map +0 -1
  119. package/types/util/createRecordingData.d.ts +0 -10
  120. package/types/util/createRecordingData.d.ts.map +0 -1
@@ -1,5 +1,4 @@
1
- import { ReplayRecordingData } from '@sentry/types';
2
- import type { EventBuffer, RecordingEvent } from './types';
1
+ import type { AddEventResult, EventBuffer, RecordingEvent } from './types';
3
2
  interface CreateEventBufferParams {
4
3
  useCompression: boolean;
5
4
  }
@@ -12,23 +11,36 @@ export declare function createEventBuffer({ useCompression }: CreateEventBufferP
12
11
  * Exported only for testing.
13
12
  */
14
13
  export declare class EventBufferCompressionWorker implements EventBuffer {
14
+ /**
15
+ * Keeps track of the list of events since the last flush that have not been compressed.
16
+ * For example, page is reloaded and a flush attempt is made, but
17
+ * `finish()` (and thus the flush), does not complete.
18
+ */
19
+ _pendingEvents: RecordingEvent[];
15
20
  private _worker;
16
21
  private _eventBufferItemLength;
17
22
  private _id;
18
23
  constructor(worker: Worker);
19
24
  /**
20
- * Note that this may not reflect what is actually in the event buffer. This
21
- * is only a local count of the buffer size since `addEvent` is async.
25
+ * The number of raw events that are buffered. This may not be the same as
26
+ * the number of events that have been compresed in the worker because
27
+ * `addEvent` is async.
28
+ */
29
+ get pendingLength(): number;
30
+ /**
31
+ * Returns a list of the raw recording events that are being compressed.
22
32
  */
23
- get length(): number;
33
+ get pendingEvents(): RecordingEvent[];
24
34
  /**
25
35
  * Destroy the event buffer.
26
36
  */
27
37
  destroy(): void;
28
38
  /**
29
39
  * Add an event to the event buffer.
40
+ *
41
+ * Returns true if event was successfuly received and processed by worker.
30
42
  */
31
- addEvent(event: RecordingEvent, isCheckout?: boolean): Promise<ReplayRecordingData>;
43
+ addEvent(event: RecordingEvent, isCheckout?: boolean): Promise<AddEventResult>;
32
44
  /**
33
45
  * Finish the event buffer and return the compressed data.
34
46
  */
@@ -1 +1 @@
1
- {"version":3,"file":"eventBuffer.d.ts","sourceRoot":"","sources":["../../../src/eventBuffer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAGpD,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAiC,MAAM,SAAS,CAAC;AAG1F,UAAU,uBAAuB;IAC/B,cAAc,EAAE,OAAO,CAAC;CACzB;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,cAAc,EAAE,EAAE,uBAAuB,GAAG,WAAW,CAsB1F;AAsCD;;;GAGG;AACH,qBAAa,4BAA6B,YAAW,WAAW;IAC9D,OAAO,CAAC,OAAO,CAAgB;IAC/B,OAAO,CAAC,sBAAsB,CAAa;IAC3C,OAAO,CAAC,GAAG,CAAa;gBAEL,MAAM,EAAE,MAAM;IAIjC;;;OAGG;IACH,IAAW,MAAM,IAAI,MAAM,CAE1B;IAED;;OAEG;IACI,OAAO,IAAI,IAAI;IAMtB;;OAEG;IACU,QAAQ,CAAC,KAAK,EAAE,cAAc,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAchG;;OAEG;IACI,MAAM,IAAI,OAAO,CAAC,UAAU,CAAC;IAIpC;;OAEG;IACH,OAAO,CAAC,YAAY;IA2CpB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAa1B;;OAEG;YACW,cAAc;IAS5B,6DAA6D;IAC7D,OAAO,CAAC,kBAAkB;CAG3B"}
1
+ {"version":3,"file":"eventBuffer.d.ts","sourceRoot":"","sources":["../../../src/eventBuffer.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,cAAc,EAAiB,MAAM,SAAS,CAAC;AAG1F,UAAU,uBAAuB;IAC/B,cAAc,EAAE,OAAO,CAAC;CACzB;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,cAAc,EAAE,EAAE,uBAAuB,GAAG,WAAW,CAsB1F;AA+CD;;;GAGG;AACH,qBAAa,4BAA6B,YAAW,WAAW;IAC9D;;;;OAIG;IACI,cAAc,EAAE,cAAc,EAAE,CAAM;IAE7C,OAAO,CAAC,OAAO,CAAgB;IAC/B,OAAO,CAAC,sBAAsB,CAAa;IAC3C,OAAO,CAAC,GAAG,CAAa;gBAEL,MAAM,EAAE,MAAM;IAIjC;;;;OAIG;IACH,IAAW,aAAa,IAAI,MAAM,CAEjC;IAED;;OAEG;IACH,IAAW,aAAa,IAAI,cAAc,EAAE,CAE3C;IAED;;OAEG;IACI,OAAO,IAAI,IAAI;IAMtB;;;;OAIG;IACU,QAAQ,CAAC,KAAK,EAAE,cAAc,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,cAAc,CAAC;IAmB3F;;OAEG;IACI,MAAM,IAAI,OAAO,CAAC,UAAU,CAAC;IAIpC;;OAEG;IACH,OAAO,CAAC,YAAY;IA2CpB;;OAEG;YACW,kBAAkB;IAahC;;OAEG;YACW,cAAc;IAa5B,6DAA6D;IAC7D,OAAO,CAAC,kBAAkB;CAG3B"}
@@ -1,5 +1,5 @@
1
- import { Integration } from '@sentry/types';
2
- import type { RecordingOptions, ReplayConfiguration, ReplayPluginOptions } from './types';
1
+ import type { Integration } from '@sentry/types';
2
+ import type { ReplayConfiguration } from './types';
3
3
  /**
4
4
  * The main replay integration class, to be passed to `init({ integrations: [] })`.
5
5
  */
@@ -15,10 +15,10 @@ export declare class Replay implements Integration {
15
15
  /**
16
16
  * Options to pass to `rrweb.record()`
17
17
  */
18
- readonly recordingOptions: RecordingOptions;
19
- readonly options: ReplayPluginOptions;
18
+ private readonly _recordingOptions;
19
+ private readonly _options;
20
20
  private _replay?;
21
- constructor({ flushMinDelay, flushMaxDelay, initialFlushDelay, stickySession, useCompression, sessionSampleRate, errorSampleRate, maskAllText, maskTextSelector, maskAllInputs, blockAllMedia, _experiments, blockClass, ignoreClass, maskTextClass, blockSelector, ...recordingOptions }?: ReplayConfiguration);
21
+ constructor({ flushMinDelay, flushMaxDelay, initialFlushDelay, stickySession, useCompression, sessionSampleRate, errorSampleRate, maskAllText, maskTextSelector, maskAllInputs, blockAllMedia, _experiments, blockClass, ignoreClass, maskTextClass, blockSelector, ..._recordingOptions }?: ReplayConfiguration);
22
22
  /** If replay has already been initialized */
23
23
  protected get _isInitialized(): boolean;
24
24
  /** Update _isInitialized */
@@ -1 +1 @@
1
- {"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../../src/integration.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAW5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAO1F;;GAEG;AACH,qBAAa,MAAO,YAAW,WAAW;IACxC;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAY;IAEpC;;OAEG;IACI,IAAI,EAAE,MAAM,CAAa;IAEhC;;OAEG;IACH,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAE5C,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAC;IAEtC,OAAO,CAAC,OAAO,CAAC,CAAkB;gBAEtB,EACV,aAAuC,EACvC,aAAuC,EACvC,iBAAuC,EACvC,aAAoB,EACpB,cAAqB,EACrB,iBAAiB,EACjB,eAAe,EACf,WAAW,EACX,gBAAgB,EAChB,aAAoB,EACpB,aAAoB,EACpB,YAAiB,EACjB,UAA2B,EAC3B,WAA6B,EAC7B,aAA6B,EAC7B,aAAqC,EACrC,GAAG,gBAAgB,EACpB,GAAE,mBAAwB;IAsE3B,6CAA6C;IAC7C,SAAS,KAAK,cAAc,IAAI,OAAO,CAEtC;IAED,4BAA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,IAAI,IAAI,IAAI;IAQnB,6BAA6B;IAC7B,OAAO,CAAC,MAAM;IAUd,oDAAoD;IACpD,OAAO,CAAC,4BAA4B;CAYrC"}
package/types/replay.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import type { Breadcrumb, ReplayRecordingMode, TransportMakeRequestResponse } from '@sentry/types';
2
- import type { AddUpdateCallback, AllPerformanceEntry, EventBuffer, InstrumentationTypeBreadcrumb, InternalEventContext, PopEventContext, RecordingEvent, RecordingOptions, ReplayContainer as ReplayContainerInterface, ReplayPluginOptions, SendReplay, Session } from './types';
1
+ import type { ReplayRecordingMode } from '@sentry/types';
2
+ import type { AddUpdateCallback, AllPerformanceEntry, EventBuffer, InternalEventContext, RecordingOptions, ReplayContainer as ReplayContainerInterface, ReplayPluginOptions, Session } from './types';
3
3
  /**
4
4
  * The main replay container class, which holds all the state and methods for recording and sending replays.
5
5
  */
@@ -22,8 +22,6 @@ export declare class ReplayContainer implements ReplayContainerInterface {
22
22
  private readonly _recordingOptions;
23
23
  private readonly _options;
24
24
  private _performanceObserver;
25
- private _retryCount;
26
- private _retryInterval;
27
25
  private _debouncedFlush;
28
26
  private _flushLock;
29
27
  /**
@@ -50,7 +48,7 @@ export declare class ReplayContainer implements ReplayContainerInterface {
50
48
  */
51
49
  private _stopRecording;
52
50
  private _context;
53
- constructor({ options, recordingOptions }: {
51
+ constructor({ options, recordingOptions, }: {
54
52
  options: ReplayPluginOptions;
55
53
  recordingOptions: RecordingOptions;
56
54
  });
@@ -98,103 +96,106 @@ export declare class ReplayContainer implements ReplayContainerInterface {
98
96
  * new DOM checkout.`
99
97
  */
100
98
  resume(): void;
99
+ /**
100
+ * We want to batch uploads of replay events. Save events only if
101
+ * `<flushMinDelay>` milliseconds have elapsed since the last event
102
+ * *OR* if `<flushMaxDelay>` milliseconds have elapsed.
103
+ *
104
+ * Accepts a callback to perform side-effects and returns true to stop batch
105
+ * processing and hand back control to caller.
106
+ */
107
+ addUpdate(cb: AddUpdateCallback): void;
108
+ /**
109
+ * Updates the user activity timestamp and resumes recording. This should be
110
+ * called in an event handler for a user action that we consider as the user
111
+ * being "active" (e.g. a mouse click).
112
+ */
113
+ triggerUserActivity(): void;
114
+ /**
115
+ *
116
+ * Always flush via `_debouncedFlush` so that we do not have flushes triggered
117
+ * from calling both `flush` and `_debouncedFlush`. Otherwise, there could be
118
+ * cases of mulitple flushes happening closely together.
119
+ */
120
+ flushImmediate(): Promise<void>;
101
121
  /** A wrapper to conditionally capture exceptions. */
102
- handleException(error: unknown): void;
103
- /** for tests only */
104
- clearSession(): void;
122
+ private _handleException;
105
123
  /**
106
124
  * Loads a session from storage, or creates a new one if it does not exist or
107
125
  * is expired.
108
126
  */
109
- loadSession({ expiry }: {
110
- expiry: number;
111
- }): void;
127
+ private _loadSession;
112
128
  /**
113
129
  * Capture some initial state that can change throughout the lifespan of the
114
130
  * replay. This is required because otherwise they would be captured at the
115
131
  * first flush.
116
132
  */
117
- setInitialState(): void;
133
+ private _setInitialState;
118
134
  /**
119
135
  * Adds listeners to record events for the replay
120
136
  */
121
- addListeners(): void;
122
- /**
123
- * Cleans up listeners that were created in `addListeners`
124
- */
125
- removeListeners(): void;
137
+ private _addListeners;
126
138
  /**
127
- * We want to batch uploads of replay events. Save events only if
128
- * `<flushMinDelay>` milliseconds have elapsed since the last event
129
- * *OR* if `<flushMaxDelay>` milliseconds have elapsed.
130
- *
131
- * Accepts a callback to perform side-effects and returns true to stop batch
132
- * processing and hand back control to caller.
139
+ * Cleans up listeners that were created in `_addListeners`
133
140
  */
134
- addUpdate(cb: AddUpdateCallback): void;
141
+ private _removeListeners;
135
142
  /**
136
143
  * Handler for recording events.
137
144
  *
138
145
  * Adds to event buffer, and has varying flushing behaviors if the event was a checkout.
139
146
  */
140
- handleRecordingEmit: (event: RecordingEvent, isCheckout?: boolean) => void;
147
+ private _handleRecordingEmit;
141
148
  /**
142
149
  * Handle when visibility of the page content changes. Opening a new tab will
143
150
  * cause the state to change to hidden because of content of current page will
144
151
  * be hidden. Likewise, moving a different window to cover the contents of the
145
152
  * page will also trigger a change to a hidden state.
146
153
  */
147
- handleVisibilityChange: () => void;
154
+ private _handleVisibilityChange;
148
155
  /**
149
156
  * Handle when page is blurred
150
157
  */
151
- handleWindowBlur: () => void;
158
+ private _handleWindowBlur;
152
159
  /**
153
160
  * Handle when page is focused
154
161
  */
155
- handleWindowFocus: () => void;
162
+ private _handleWindowFocus;
156
163
  /**
157
164
  * Handler for Sentry Core SDK events.
158
165
  *
159
166
  * These events will create breadcrumb-like objects in the recording.
160
167
  */
161
- handleCoreBreadcrumbListener: (type: InstrumentationTypeBreadcrumb) => (handlerData: unknown) => void;
168
+ private _handleCoreBreadcrumbListener;
162
169
  /**
163
170
  * Tasks to run when we consider a page to be hidden (via blurring and/or visibility)
164
171
  */
165
- doChangeToBackgroundTasks(breadcrumb?: Breadcrumb): void;
172
+ private _doChangeToBackgroundTasks;
166
173
  /**
167
174
  * Tasks to run when we consider a page to be visible (via focus and/or visibility)
168
175
  */
169
- doChangeToForegroundTasks(breadcrumb?: Breadcrumb): void;
176
+ private _doChangeToForegroundTasks;
170
177
  /**
171
178
  * Trigger rrweb to take a full snapshot which will cause this plugin to
172
179
  * create a new Replay event.
173
180
  */
174
- triggerFullSnapshot(): void;
181
+ private _triggerFullSnapshot;
175
182
  /**
176
183
  * Update user activity (across session lifespans)
177
184
  */
178
- updateUserActivity(_lastActivity?: number): void;
185
+ private _updateUserActivity;
179
186
  /**
180
187
  * Updates the session's last activity timestamp
181
188
  */
182
- updateSessionActivity(_lastActivity?: number): void;
183
- /**
184
- * Updates the user activity timestamp and resumes recording. This should be
185
- * called in an event handler for a user action that we consider as the user
186
- * being "active" (e.g. a mouse click).
187
- */
188
- triggerUserActivity(): void;
189
+ private _updateSessionActivity;
189
190
  /**
190
191
  * Helper to create (and buffer) a replay breadcrumb from a core SDK breadcrumb
191
192
  */
192
- createCustomBreadcrumb(breadcrumb: Breadcrumb): void;
193
+ private _createCustomBreadcrumb;
193
194
  /**
194
195
  * Observed performance events are added to `this.performanceEvents`. These
195
196
  * are included in the replay event before it is finished and sent to Sentry.
196
197
  */
197
- addPerformanceEntries(): void;
198
+ private _addPerformanceEntries;
198
199
  /**
199
200
  * Checks if recording should be stopped due to user inactivity. Otherwise
200
201
  * check if session is expired and create a new session if so. Triggers a new
@@ -202,21 +203,19 @@ export declare class ReplayContainer implements ReplayContainerInterface {
202
203
  *
203
204
  * Returns true if session is not expired, false otherwise.
204
205
  */
205
- checkAndHandleExpiredSession({ expiry }?: {
206
- expiry?: number;
207
- }): boolean | void;
206
+ private _checkAndHandleExpiredSession;
208
207
  /**
209
208
  * Only flush if `this.recordingMode === 'session'`
210
209
  */
211
- conditionalFlush(): void;
210
+ private _conditionalFlush;
212
211
  /**
213
212
  * Clear _context
214
213
  */
215
- clearContext(): void;
214
+ private _clearContext;
216
215
  /**
217
216
  * Return and clear _context
218
217
  */
219
- popEventContext(): PopEventContext;
218
+ private _popEventContext;
220
219
  /**
221
220
  * Flushes replay event buffer to Sentry.
222
221
  *
@@ -225,32 +224,17 @@ export declare class ReplayContainer implements ReplayContainerInterface {
225
224
  *
226
225
  * Should never be called directly, only by `flush`
227
226
  */
228
- runFlush(): Promise<void>;
227
+ private _runFlush;
229
228
  /**
230
229
  * Flush recording data to Sentry. Creates a lock so that only a single flush
231
230
  * can be active at a time. Do not call this directly.
232
231
  */
233
- flush: () => Promise<void>;
234
- /**
235
- *
236
- * Always flush via `_debouncedFlush` so that we do not have flushes triggered
237
- * from calling both `flush` and `_debouncedFlush`. Otherwise, there could be
238
- * cases of mulitple flushes happening closely together.
239
- */
240
- flushImmediate(): Promise<void>;
241
- /**
242
- * Send replay attachment using `fetch()`
243
- */
244
- sendReplayRequest({ events, replayId, segmentId: segment_id, includeReplayStartTimestamp, eventContext, }: SendReplay): Promise<void | TransportMakeRequestResponse>;
245
- /**
246
- * Reset the counter of retries for sending replays.
247
- */
248
- resetRetries(): void;
249
- /**
250
- * Finalize and send the current replay event to Sentry
251
- */
252
- sendReplay({ replayId, events, segmentId, includeReplayStartTimestamp, eventContext, }: SendReplay): Promise<unknown>;
232
+ private _flush;
253
233
  /** Save the session, if it is sticky */
254
234
  private _maybeSaveSession;
235
+ /**
236
+ * Pauses the replay and resumes it after the rate-limit duration is over.
237
+ */
238
+ private _handleRateLimit;
255
239
  }
256
240
  //# sourceMappingURL=replay.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"replay.d.ts","sourceRoot":"","sources":["../../../src/replay.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAe,mBAAmB,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAuBhH,OAAO,KAAK,EACV,iBAAiB,EACjB,mBAAmB,EACnB,WAAW,EACX,6BAA6B,EAC7B,oBAAoB,EACpB,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,eAAe,IAAI,wBAAwB,EAC3C,mBAAmB,EACnB,UAAU,EACV,OAAO,EACR,MAAM,SAAS,CAAC;AAoBjB;;GAEG;AACH,qBAAa,eAAgB,YAAW,wBAAwB;IACvD,WAAW,EAAE,WAAW,GAAG,IAAI,CAAQ;IAE9C;;OAEG;IACI,iBAAiB,EAAE,mBAAmB,EAAE,CAAM;IAE9C,OAAO,EAAE,OAAO,GAAG,SAAS,CAAC;IAEpC;;;;OAIG;IACI,aAAa,EAAE,mBAAmB,CAAa;IAEtD;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAmB;IAErD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAsB;IAE/C,OAAO,CAAC,oBAAoB,CAAoC;IAEhE,OAAO,CAAC,WAAW,CAAa;IAChC,OAAO,CAAC,cAAc,CAA+B;IAErD,OAAO,CAAC,eAAe,CAA8B;IACrD,OAAO,CAAC,UAAU,CAAiC;IAEnD;;OAEG;IACH,OAAO,CAAC,aAAa,CAAgC;IAErD;;OAEG;IACH,OAAO,CAAC,UAAU,CAAkB;IAEpC;;;;O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AiBlC;;OAEG;IACH,OAAO,CAAC,0BAA0B;IAsBlC;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IAK5B;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAI3B;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAO9B;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAa/B;;;OAGG;IACH,OAAO,CAAC,sBAAsB;IAQ9B;;;;;;OAMG;IACH,OAAO,CAAC,6BAA6B;IA8BrC;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAQzB;;OAEG;IACH,OAAO,CAAC,aAAa;IAQrB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAkBxB;;;;;;;OAOG;YACW,SAAS;IAmDvB;;;OAGG;IACH,OAAO,CAAC,MAAM,CAyCZ;IAEF,wCAAwC;IACxC,OAAO,CAAC,iBAAiB;IAMzB;;OAEG;IACH,OAAO,CAAC,gBAAgB;CAqBzB"}
package/types/types.d.ts CHANGED
@@ -2,14 +2,16 @@ import type { ReplayRecordingData, ReplayRecordingMode } from '@sentry/types';
2
2
  import type { eventWithTime, recordOptions } from './types/rrweb';
3
3
  export declare type RecordingEvent = eventWithTime;
4
4
  export declare type RecordingOptions = recordOptions;
5
- export declare type RecordedEvents = Uint8Array | string;
6
5
  export declare type AllPerformanceEntry = PerformancePaintTiming | PerformanceResourceTiming | PerformanceNavigationTiming;
7
- export interface SendReplay {
8
- events: RecordedEvents;
6
+ export interface SendReplayData {
7
+ recordingData: ReplayRecordingData;
9
8
  replayId: string;
10
9
  segmentId: number;
11
10
  includeReplayStartTimestamp: boolean;
12
11
  eventContext: PopEventContext;
12
+ timestamp: number;
13
+ session: Session;
14
+ options: ReplayPluginOptions;
13
15
  }
14
16
  export declare type InstrumentationTypeBreadcrumb = 'dom' | 'scope';
15
17
  /**
@@ -36,8 +38,9 @@ export interface WorkerResponse {
36
38
  id: number;
37
39
  method: string;
38
40
  success: boolean;
39
- response: ReplayRecordingData;
41
+ response: unknown;
40
42
  }
43
+ export declare type AddEventResult = void;
41
44
  export interface SampleRates {
42
45
  /**
43
46
  * The sample rate for session-long replays. 1.0 will record all sessions and
@@ -169,9 +172,27 @@ export interface Session {
169
172
  sampled: Sampled;
170
173
  }
171
174
  export interface EventBuffer {
172
- readonly length: number;
175
+ /**
176
+ * The number of raw events that are buffered
177
+ */
178
+ readonly pendingLength: number;
179
+ /**
180
+ * The raw events that are buffered.
181
+ */
182
+ readonly pendingEvents: RecordingEvent[];
183
+ /**
184
+ * Destroy the event buffer.
185
+ */
173
186
  destroy(): void;
174
- addEvent(event: RecordingEvent, isCheckout?: boolean): void;
187
+ /**
188
+ * Add an event to the event buffer.
189
+ *
190
+ * Returns true if event was successfully added.
191
+ */
192
+ addEvent(event: RecordingEvent, isCheckout?: boolean): Promise<AddEventResult>;
193
+ /**
194
+ * Clears and returns the contents of the buffer.
195
+ */
175
196
  finish(): Promise<ReplayRecordingData>;
176
197
  }
177
198
  export declare type AddUpdateCallback = () => boolean | void;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAE9E,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAElE,oBAAY,cAAc,GAAG,aAAa,CAAC;AAC3C,oBAAY,gBAAgB,GAAG,aAAa,CAAC;AAE7C,oBAAY,cAAc,GAAG,UAAU,GAAG,MAAM,CAAC;AAEjD,oBAAY,mBAAmB,GAAG,sBAAsB,GAAG,yBAAyB,GAAG,2BAA2B,CAAC;AAEnH,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,cAAc,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,2BAA2B,EAAE,OAAO,CAAC;IACrC,YAAY,EAAE,eAAe,CAAC;CAC/B;AAED,oBAAY,6BA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mBAAmB,IAAI,IAAI,CAAC;IAC5B,SAAS,CAAC,EAAE,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACvC,UAAU,IAAI,mBAAmB,CAAC;CACnC;AAED,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC"}
@@ -1,6 +1,6 @@
1
- import type { RecordingEvent, ReplayContainer } from '../types';
1
+ import type { AddEventResult, RecordingEvent, ReplayContainer } from '../types';
2
2
  /**
3
3
  * Add an event to the event buffer
4
4
  */
5
- export declare function addEvent(replay: ReplayContainer, event: RecordingEvent, isCheckout?: boolean): void;
5
+ export declare function addEvent(replay: ReplayContainer, event: RecordingEvent, isCheckout?: boolean): Promise<AddEventResult | null>;
6
6
  //# sourceMappingURL=addEvent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"addEvent.d.ts","sourceRoot":"","sources":["../../../../src/util/addEvent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhE;;GAEG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,cAAc,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,IAAI,CAgCnG"}
1
+ {"version":3,"file":"addEvent.d.ts","sourceRoot":"","sources":["../../../../src/util/addEvent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhF;;GAEG;AACH,wBAAsB,QAAQ,CAC5B,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,cAAc,EACrB,UAAU,CAAC,EAAE,OAAO,GACnB,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAgChC"}
@@ -1,7 +1,7 @@
1
- import type { ReplayContainer } from '../types';
1
+ import type { AddEventResult, ReplayContainer } from '../types';
2
2
  /**
3
3
  * Create a "span" for the total amount of memory being used by JS objects
4
4
  * (including v8 internal objects).
5
5
  */
6
- export declare function addMemoryEntry(replay: ReplayContainer): void;
6
+ export declare function addMemoryEntry(replay: ReplayContainer): Promise<Array<AddEventResult | null>>;
7
7
  //# sourceMappingURL=addMemoryEntry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"addMemoryEntry.d.ts","sourceRoot":"","sources":["../../../../src/util/addMemoryEntry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAA0B,MAAM,UAAU,CAAC;AAWxE;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAU5D"}
1
+ {"version":3,"file":"addMemoryEntry.d.ts","sourceRoot":"","sources":["../../../../src/util/addMemoryEntry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAA0B,MAAM,UAAU,CAAC;AAWxF;;;GAGG;AACH,wBAAsB,cAAc,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,KAAK,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC,CAanG"}
@@ -1,6 +1,6 @@
1
- import type { AllPerformanceEntry, ReplayPerformanceEntry } from './types';
1
+ import type { AllPerformanceEntry, ReplayPerformanceEntry } from '../types';
2
2
  /**
3
3
  * Create replay performance entries from the browser performance entries.
4
4
  */
5
5
  export declare function createPerformanceEntries(entries: AllPerformanceEntry[]): ReplayPerformanceEntry[];
6
- //# sourceMappingURL=createPerformanceEntry.d.ts.map
6
+ //# sourceMappingURL=createPerformanceEntries.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createPerformanceEntries.d.ts","sourceRoot":"","sources":["../../../../src/util/createPerformanceEntries.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,mBAAmB,EAGnB,sBAAsB,EACvB,MAAM,UAAU,CAAC;AAclB;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,mBAAmB,EAAE,GAAG,sBAAsB,EAAE,CAEjG"}
@@ -1,6 +1,6 @@
1
- import type { ReplayContainer, ReplayPerformanceEntry } from '../types';
1
+ import type { AddEventResult, ReplayContainer, ReplayPerformanceEntry } from '../types';
2
2
  /**
3
3
  * Create a "span" for each performance entry. The parent transaction is `this.replayEvent`.
4
4
  */
5
- export declare function createPerformanceSpans(replay: ReplayContainer, entries: ReplayPerformanceEntry[]): void;
5
+ export declare function createPerformanceSpans(replay: ReplayContainer, entries: ReplayPerformanceEntry[]): Promise<AddEventResult | null>[];
6
6
  //# sourceMappingURL=createPerformanceSpans.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createPerformanceSpans.d.ts","sourceRoot":"","sources":["../../../../src/util/createPerformanceSpans.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAGxE;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,sBAAsB,EAAE,GAAG,IAAI,CAiBvG"}
1
+ {"version":3,"file":"createPerformanceSpans.d.ts","sourceRoot":"","sources":["../../../../src/util/createPerformanceSpans.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAGxF;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,eAAe,EACvB,OAAO,EAAE,sBAAsB,EAAE,GAChC,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,EAAE,CAiBlC"}
@@ -1,4 +1,4 @@
1
- import { DsnComponents, ReplayEnvelope, ReplayEvent, ReplayRecordingData } from '@sentry/types';
1
+ import type { DsnComponents, ReplayEnvelope, ReplayEvent, ReplayRecordingData } from '@sentry/types';
2
2
  /**
3
3
  * Create a replay envelope ready to be sent.
4
4
  * This includes both the replay event, as well as the recording data.
@@ -1 +1 @@
1
- {"version":3,"file":"createReplayEnvelope.d.ts","sourceRoot":"","sources":["../../../../src/util/createReplayEnvelope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAGhG;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,mBAAmB,EAClC,GAAG,EAAE,aAAa,EAClB,MAAM,CAAC,EAAE,MAAM,GACd,cAAc,CAchB"}
1
+ {"version":3,"file":"createReplayEnvelope.d.ts","sourceRoot":"","sources":["../../../../src/util/createReplayEnvelope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAGrG;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,mBAAmB,EAClC,GAAG,EAAE,aAAa,EAClB,MAAM,CAAC,EAAE,MAAM,GACd,cAAc,CAkBhB"}
@@ -1,4 +1,4 @@
1
- import { Event } from '@sentry/types';
1
+ import type { Event } from '@sentry/types';
2
2
  /**
3
3
  * Returns true if we think the given event is an error originating inside of rrweb.
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"isRrwebError.d.ts","sourceRoot":"","sources":["../../../../src/util/isRrwebError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAalD"}
1
+ {"version":3,"file":"isRrwebError.d.ts","sourceRoot":"","sources":["../../../../src/util/isRrwebError.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE3C;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAalD"}
@@ -0,0 +1,9 @@
1
+ import type { ReplayRecordingData } from '@sentry/types';
2
+ /**
3
+ * Prepare the recording data ready to be sent.
4
+ */
5
+ export declare function prepareRecordingData({ recordingData, headers, }: {
6
+ recordingData: ReplayRecordingData;
7
+ headers: Record<string, unknown>;
8
+ }): ReplayRecordingData;
9
+ //# sourceMappingURL=prepareRecordingData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prepareRecordingData.d.ts","sourceRoot":"","sources":["../../../../src/util/prepareRecordingData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEzD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,aAAa,EACb,OAAO,GACR,EAAE;IACD,aAAa,EAAE,mBAAmB,CAAC;IACnC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC,GAAG,mBAAmB,CAoBtB"}
@@ -1,5 +1,5 @@
1
- import { Scope } from '@sentry/core';
2
- import { Client, ReplayEvent } from '@sentry/types';
1
+ import type { Scope } from '@sentry/core';
2
+ import type { Client, ReplayEvent } from '@sentry/types';
3
3
  /**
4
4
  * Prepare a replay event & enrich it with the SDK metadata.
5
5
  */
@@ -1 +1 @@
1
- {"version":3,"file":"prepareReplayEvent.d.ts","sourceRoot":"","sources":["../../../../src/util/prepareReplayEvent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEpD;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,EACvC,MAAM,EACN,KAAK,EACL,QAAQ,EAAE,QAAQ,EAClB,KAAK,GACN,EAAE;IACD,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,WAAW,CAAC;CACpB,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAwB9B"}
1
+ {"version":3,"file":"prepareReplayEvent.d.ts","sourceRoot":"","sources":["../../../../src/util/prepareReplayEvent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEzD;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,EACvC,MAAM,EACN,KAAK,EACL,QAAQ,EAAE,QAAQ,EAClB,KAAK,GACN,EAAE;IACD,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,WAAW,CAAC;CACpB,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAwB9B"}
@@ -0,0 +1,9 @@
1
+ import type { SendReplayData } from '../types';
2
+ /**
3
+ * Finalize and send the current replay event to Sentry
4
+ */
5
+ export declare function sendReplay(replayData: SendReplayData, retryConfig?: {
6
+ count: number;
7
+ interval: number;
8
+ }): Promise<unknown>;
9
+ //# sourceMappingURL=sendReplay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sendReplay.d.ts","sourceRoot":"","sources":["../../../../src/util/sendReplay.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAG/C;;GAEG;AACH,wBAAsB,UAAU,CAC9B,UAAU,EAAE,cAAc,EAC1B,WAAW;;;CAGV,GACA,OAAO,CAAC,OAAO,CAAC,CA6ClB"}
@@ -0,0 +1,21 @@
1
+ import type { TransportMakeRequestResponse } from '@sentry/types';
2
+ import type { RateLimits } from '@sentry/utils';
3
+ import type { SendReplayData } from '../types';
4
+ /**
5
+ * Send replay attachment using `fetch()`
6
+ */
7
+ export declare function sendReplayRequest({ recordingData, replayId, segmentId: segment_id, includeReplayStartTimestamp, eventContext, timestamp, session, options, }: SendReplayData): Promise<void | TransportMakeRequestResponse>;
8
+ /**
9
+ * This error indicates that we hit a rate limit API error.
10
+ */
11
+ export declare class RateLimitError extends Error {
12
+ rateLimits: RateLimits;
13
+ constructor(rateLimits: RateLimits);
14
+ }
15
+ /**
16
+ * This error indicates that the transport returned an invalid status code.
17
+ */
18
+ export declare class TransportStatusCodeError extends Error {
19
+ constructor(statusCode: number);
20
+ }
21
+ //# sourceMappingURL=sendReplayRequest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sendReplayRequest.d.ts","sourceRoot":"","sources":["../../../../src/util/sendReplayRequest.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAe,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAIhD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAK/C;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,EACtC,aAAa,EACb,QAAQ,EACR,SAAS,EAAE,UAAU,EACrB,2BAA2B,EAC3B,YAAY,EACZ,SAAS,EACT,OAAO,EACP,OAAO,GACR,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,GAAG,4BAA4B,CAAC,CA8G/D;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,KAAK;IAChC,UAAU,EAAE,UAAU,CAAC;gBAEX,UAAU,EAAE,UAAU;CAI1C;AAED;;GAEG;AACH,qBAAa,wBAAyB,SAAQ,KAAK;gBAC9B,UAAU,EAAE,MAAM;CAGtC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"createPerformanceEntry.js","sources":["../../../src/createPerformanceEntry.ts"],"sourcesContent":["import { browserPerformanceTimeOrigin } from '@sentry/utils';\nimport { record } from 'rrweb';\n\nimport { WINDOW } from './constants';\nimport type {\n AllPerformanceEntry,\n PerformanceNavigationTiming,\n PerformancePaintTiming,\n ReplayPerformanceEntry,\n} from './types';\n\n// Map entryType -> function to normalize data for event\n// @ts-ignore TODO: entry type does not fit the create* functions entry type\nconst ENTRY_TYPES: Record<string, (entry: AllPerformanceEntry) => null | ReplayPerformanceEntry> = {\n // @ts-ignore TODO: entry type does not fit the create* functions entry type\n resource: createResourceEntry,\n paint: createPaintEntry,\n // @ts-ignore TODO: entry type does not fit the create* functions entry type\n navigation: createNavigationEntry,\n // @ts-ignore TODO: entry type does not fit the create* functions entry type\n 'largest-contentful-paint': createLargestContentfulPaint,\n};\n\n/**\n * Create replay performance entries from the browser performance entries.\n */\nexport function createPerformanceEntries(entries: AllPerformanceEntry[]): ReplayPerformanceEntry[] {\n return entries.map(createPerformanceEntry).filter(Boolean) as ReplayPerformanceEntry[];\n}\n\nfunction createPerformanceEntry(entry: AllPerformanceEntry): ReplayPerformanceEntry | null {\n if (ENTRY_TYPES[entry.entryType] === undefined) {\n return null;\n }\n\n return ENTRY_TYPES[entry.entryType](entry);\n}\n\nfunction getAbsoluteTime(time: number): number {\n // browserPerformanceTimeOrigin can be undefined if `performance` or\n // `performance.now` doesn't exist, but this is already checked by this integration\n return ((browserPerformanceTimeOrigin || WINDOW.performance.timeOrigin) + time) / 1000;\n}\n\nfunction createPaintEntry(entry: PerformancePaintTiming): ReplayPerformanceEntry {\n const { duration, entryType, name, startTime } = entry;\n\n const start = getAbsoluteTime(startTime);\n return {\n type: entryType,\n name,\n start,\n end: start + duration,\n };\n}\n\nfunction createNavigationEntry(entry: PerformanceNavigationTiming): ReplayPerformanceEntry | null {\n // TODO: There looks to be some more interesting bits in here (domComplete, domContentLoaded)\n const { entryType, name, duration, domComplete, startTime, transferSize, type } = entry;\n\n // Ignore entries with no duration, they do not seem to be useful and cause dupes\n if (duration === 0) {\n return null;\n }\n\n return {\n type: `${entryType}.${type}`,\n start: getAbsoluteTime(startTime),\n end: getAbsoluteTime(domComplete),\n name,\n data: {\n size: transferSize,\n duration,\n },\n };\n}\n\nfunction createResourceEntry(entry: PerformanceResourceTiming): ReplayPerformanceEntry | null {\n const { entryType, initiatorType, name, responseEnd, startTime, encodedBodySize, transferSize } = entry;\n\n // Core SDK handles these\n if (['fetch', 'xmlhttprequest'].includes(initiatorType)) {\n return null;\n }\n\n return {\n type: `${entryType}.${initiatorType}`,\n start: getAbsoluteTime(startTime),\n end: getAbsoluteTime(responseEnd),\n name,\n data: {\n size: transferSize,\n encodedBodySize,\n },\n };\n}\n\nfunction createLargestContentfulPaint(\n entry: PerformanceEntry & { size: number; element: Node },\n): ReplayPerformanceEntry {\n const { duration, entryType, startTime, size } = entry;\n\n const start = getAbsoluteTime(startTime);\n\n return {\n type: entryType,\n name: entryType,\n start,\n end: start + duration,\n data: {\n duration,\n size,\n // Not sure why this errors, Node should be correct (Argument of type 'Node' is not assignable to parameter of type 'INode')\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n nodeId: record.mirror.getId(entry.element as any),\n },\n };\n}\n"],"names":["browserPerformanceTimeOrigin","WINDOW","record"],"mappings":";;;;;;;AAWA;AACA;AACA,MAAA,WAAA,GAAA;AACA;AACA,EAAA,QAAA,EAAA,mBAAA;AACA,EAAA,KAAA,EAAA,gBAAA;AACA;AACA,EAAA,UAAA,EAAA,qBAAA;AACA;AACA,EAAA,0BAAA,EAAA,4BAAA;AACA,CAAA,CAAA;AACA;AACA;AACA;AACA;AACA,SAAA,wBAAA,CAAA,OAAA,EAAA;AACA,EAAA,OAAA,OAAA,CAAA,GAAA,CAAA,sBAAA,CAAA,CAAA,MAAA,CAAA,OAAA,CAAA,EAAA;AACA,CAAA;AACA;AACA,SAAA,sBAAA,CAAA,KAAA,EAAA;AACA,EAAA,IAAA,WAAA,CAAA,KAAA,CAAA,SAAA,CAAA,KAAA,SAAA,EAAA;AACA,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AA,CAAA,KAAA,EAAA;AACA,EAAA,MAAA,EAAA,SAAA,EAAA,aAAA,EAAA,IAAA,EAAA,WAAA,EAAA,SAAA,EAAA,eAAA,EAAA,YAAA,EAAA,GAAA,KAAA,CAAA;AACA;AACA;AACA,EAAA,IAAA,CAAA,OAAA,EAAA,gBAAA,CAAA,CAAA,QAAA,CAAA,aAAA,CAAA,EAAA;AACA,IAAA,OAAA,IAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA;AACA,IAAA,IAAA,EAAA,CAAA,EAAA,SAAA,CAAA,CAAA,EAAA,aAAA,CAAA,CAAA;AACA,IAAA,KAAA,EAAA,eAAA,CAAA,SAAA,CAAA;AACA,IAAA,GAAA,EAAA,eAAA,CAAA,WAAA,CAAA;AACA,IAAA,IAAA;AACA,IAAA,IAAA,EAAA;AACA,MAAA,IAAA,EAAA,YAAA;AACA,MAAA,eAAA;AACA,KAAA;AACA,GAAA,CAAA;AACA,CAAA;AACA;AACA,SAAA,4BAAA;AACA,EAAA,KAAA;AACA,EAAA;AACA,EAAA,MAAA,EAAA,QAAA,EAAA,SAAA,EAAA,SAAA,EAAA,IAAA,EAAA,GAAA,KAAA,CAAA;AACA;AACA,EAAA,MAAA,KAAA,GAAA,eAAA,CAAA,SAAA,CAAA,CAAA;AACA;AACA,EAAA,OAAA;AACA,IAAA,IAAA,EAAA,SAAA;AACA,IAAA,IAAA,EAAA,SAAA;AACA,IAAA,KAAA;AACA,IAAA,GAAA,EAAA,KAAA,GAAA,QAAA;AACA,IAAA,IAAA,EAAA;AACA,MAAA,QAAA;AACA,MAAA,IAAA;AACA;AACA;AACA,MAAA,MAAA,EAAAC,aAAA,CAAA,MAAA,CAAA,KAAA,CAAA,KAAA,CAAA,OAAA,EAAA;AACA,KAAA;AACA,GAAA,CAAA;AACA;;;;"}
@@ -1,23 +0,0 @@
1
- Object.defineProperty(exports, '__esModule', { value: true });
2
-
3
- const constants = require('../constants.js');
4
-
5
- /**
6
- * Deletes a session from storage
7
- */
8
- function deleteSession() {
9
- const hasSessionStorage = 'sessionStorage' in constants.WINDOW;
10
-
11
- if (!hasSessionStorage) {
12
- return;
13
- }
14
-
15
- try {
16
- constants.WINDOW.sessionStorage.removeItem(constants.REPLAY_SESSION_KEY);
17
- } catch (e) {
18
- // Ignore potential SecurityError exceptions
19
- }
20
- }
21
-
22
- exports.deleteSession = deleteSession;
23
- //# sourceMappingURL=deleteSession.js.map