@sentry/replay 0.6.14-2 → 0.6.14-4
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/LICENSE +11 -198
- package/README.md +1 -1
- package/dist/index.es.js +46 -43
- package/dist/index.js +46 -43
- package/dist/index.js.map +1 -1
- package/dist/types/src/index.d.ts +17 -23
- package/dist/types/src/types.d.ts +25 -11
- package/package.json +3 -3
- package/dist/config/types/jest.config.d.ts +0 -3
- package/dist/config/types/jest.setup.d.ts +0 -32
- package/dist/config/types/src/blockAllMedia.test.d.ts +0 -1
- package/dist/config/types/src/coreHandlers/getBreadcrumbHandler.d.ts +0 -3
- package/dist/config/types/src/coreHandlers/getSpanHandler.d.ts +0 -5
- package/dist/config/types/src/coreHandlers/handleDom.d.ts +0 -1
- package/dist/config/types/src/coreHandlers/handleFetch.d.ts +0 -19
- package/dist/config/types/src/coreHandlers/handleFetch.test.d.ts +0 -1
- package/dist/config/types/src/coreHandlers/handleHistory.d.ts +0 -7
- package/dist/config/types/src/coreHandlers/handleScope-unit.test.d.ts +0 -1
- package/dist/config/types/src/coreHandlers/handleScope.d.ts +0 -2
- package/dist/config/types/src/coreHandlers/handleScope.test.d.ts +0 -1
- package/dist/config/types/src/coreHandlers/handleXhr.d.ts +0 -21
- package/dist/config/types/src/createPerformanceEntry.d.ts +0 -43
- package/dist/config/types/src/createPerformanceEntry.test.d.ts +0 -1
- package/dist/config/types/src/eventBuffer.d.ts +0 -45
- package/dist/config/types/src/eventBuffer.test.d.ts +0 -1
- package/dist/config/types/src/flags.d.ts +0 -2
- package/dist/config/types/src/flush.test.d.ts +0 -1
- package/dist/config/types/src/index-errorSampleRate.test.d.ts +0 -1
- package/dist/config/types/src/index-noSticky.test.d.ts +0 -1
- package/dist/config/types/src/index-sampling.test.d.ts +0 -1
- package/dist/config/types/src/index.d.ts +0 -288
- package/dist/config/types/src/index.test.d.ts +0 -1
- package/dist/config/types/src/multiple-instances.test.d.ts +0 -1
- package/dist/config/types/src/session/Session.d.ts +0 -63
- package/dist/config/types/src/session/Session.test.d.ts +0 -1
- package/dist/config/types/src/session/constants.d.ts +0 -11
- package/dist/config/types/src/session/createSession.d.ts +0 -8
- package/dist/config/types/src/session/createSession.test.d.ts +0 -1
- package/dist/config/types/src/session/deleteSession.d.ts +0 -4
- package/dist/config/types/src/session/deleteSession.test.d.ts +0 -1
- package/dist/config/types/src/session/fetchSession.d.ts +0 -6
- package/dist/config/types/src/session/fetchSession.test.d.ts +0 -1
- package/dist/config/types/src/session/getSession.d.ts +0 -20
- package/dist/config/types/src/session/getSession.test.d.ts +0 -1
- package/dist/config/types/src/session/index.d.ts +0 -1
- package/dist/config/types/src/session/saveSession.d.ts +0 -2
- package/dist/config/types/src/session/saveSession.test.d.ts +0 -1
- package/dist/config/types/src/stop.test.d.ts +0 -1
- package/dist/config/types/src/types.d.ts +0 -130
- package/dist/config/types/src/util/addInternalBreadcrumb.d.ts +0 -5
- package/dist/config/types/src/util/captureInternalException.d.ts +0 -4
- package/dist/config/types/src/util/createBreadcrumb.d.ts +0 -4
- package/dist/config/types/src/util/createPayload.d.ts +0 -5
- package/dist/config/types/src/util/dedupePerformanceEntries.d.ts +0 -10
- package/dist/config/types/src/util/dedupePerformanceEntries.test.d.ts +0 -1
- package/dist/config/types/src/util/isExpired.d.ts +0 -5
- package/dist/config/types/src/util/isExpired.test.d.ts +0 -1
- package/dist/config/types/src/util/isIngestHost.d.ts +0 -4
- package/dist/config/types/src/util/isInternal.d.ts +0 -5
- package/dist/config/types/src/util/isSampled.d.ts +0 -7
- package/dist/config/types/src/util/isSampled.test.d.ts +0 -1
- package/dist/config/types/src/util/isSessionExpired.d.ts +0 -5
- package/dist/config/types/src/util/isSessionExpired.test.d.ts +0 -1
- package/dist/config/types/src/util/logger.d.ts +0 -12
- package/dist/config/types/test/fixtures/performanceEntry/lcp.d.ts +0 -1
- package/dist/config/types/test/fixtures/performanceEntry/navigation.d.ts +0 -1
- package/dist/config/types/test/fixtures/performanceEntry/resource.d.ts +0 -1
- package/dist/config/types/test/index.d.ts +0 -3
- package/dist/config/types/test/mocks/mockRrweb.d.ts +0 -15
- package/dist/config/types/test/mocks/mockSdk.d.ts +0 -10
|
@@ -1,288 +0,0 @@
|
|
|
1
|
-
import { Breadcrumb, Event, Integration } from '@sentry/types';
|
|
2
|
-
import { Session } from './session/Session';
|
|
3
|
-
import { ReplayPerformanceEntry } from './createPerformanceEntry';
|
|
4
|
-
import { IEventBuffer } from './eventBuffer';
|
|
5
|
-
import type { AllPerformanceEntry, InitialState, InstrumentationTypeBreadcrumb, InstrumentationTypeSpan, RecordingEvent, RecordingOptions, ReplayConfiguration, ReplayPluginOptions, SendReplay } from './types';
|
|
6
|
-
/**
|
|
7
|
-
* Returns true to return control to calling function, otherwise continue with normal batching
|
|
8
|
-
*/
|
|
9
|
-
declare type AddUpdateCallback = () => boolean | void;
|
|
10
|
-
export declare class Replay implements Integration {
|
|
11
|
-
/**
|
|
12
|
-
* @inheritDoc
|
|
13
|
-
*/
|
|
14
|
-
static id: string;
|
|
15
|
-
/**
|
|
16
|
-
* @inheritDoc
|
|
17
|
-
*/
|
|
18
|
-
name: string;
|
|
19
|
-
eventBuffer: IEventBuffer | null;
|
|
20
|
-
/**
|
|
21
|
-
* List of PerformanceEntry from PerformanceObserver
|
|
22
|
-
*/
|
|
23
|
-
performanceEvents: AllPerformanceEntry[];
|
|
24
|
-
/**
|
|
25
|
-
* Options to pass to `rrweb.record()`
|
|
26
|
-
*/
|
|
27
|
-
readonly recordingOptions: RecordingOptions;
|
|
28
|
-
readonly options: ReplayPluginOptions;
|
|
29
|
-
private performanceObserver;
|
|
30
|
-
private retryCount;
|
|
31
|
-
private retryInterval;
|
|
32
|
-
private debouncedFlush;
|
|
33
|
-
private flushLock;
|
|
34
|
-
/**
|
|
35
|
-
* Timestamp of the last user activity. This lives across sessions.
|
|
36
|
-
*/
|
|
37
|
-
private lastActivity;
|
|
38
|
-
/**
|
|
39
|
-
* Is the integration currently active?
|
|
40
|
-
*/
|
|
41
|
-
private isEnabled;
|
|
42
|
-
/**
|
|
43
|
-
* Paused is a state where:
|
|
44
|
-
* - DOM Recording is not listening at all
|
|
45
|
-
* - Nothing will be added to event buffer (e.g. core SDK events)
|
|
46
|
-
*/
|
|
47
|
-
private isPaused;
|
|
48
|
-
/**
|
|
49
|
-
* Integration will wait until an error occurs before creating and sending a
|
|
50
|
-
* replay.
|
|
51
|
-
*/
|
|
52
|
-
private waitForError;
|
|
53
|
-
/**
|
|
54
|
-
* Have we attached listeners to the core SDK?
|
|
55
|
-
* Note we have to track this as there is no way to remove instrumentation handlers.
|
|
56
|
-
*/
|
|
57
|
-
private hasInitializedCoreListeners;
|
|
58
|
-
/**
|
|
59
|
-
* Function to stop recording
|
|
60
|
-
*/
|
|
61
|
-
private stopRecording;
|
|
62
|
-
/**
|
|
63
|
-
* Captured state when integration is first initialized
|
|
64
|
-
*/
|
|
65
|
-
private initialState;
|
|
66
|
-
private context;
|
|
67
|
-
session: Session | undefined;
|
|
68
|
-
constructor({ flushMinDelay, flushMaxDelay, initialFlushDelay, stickySession, useCompression, sessionSampleRate, errorSampleRate, maskAllText, maskAllInputs, blockAllMedia, blockClass, ignoreClass, maskTextClass, blockSelector, replaysSamplingRate, captureOnlyOnError, ...recordingOptions }?: ReplayConfiguration);
|
|
69
|
-
/**
|
|
70
|
-
* Because we create a transaction in `setupOnce`, we can potentially create a
|
|
71
|
-
* transaction before some native SDK integrations have run and applied their
|
|
72
|
-
* own global event processor. An example is:
|
|
73
|
-
* https://github.com/getsentry/sentry-javascript/blob/b47ceafbdac7f8b99093ce6023726ad4687edc48/packages/browser/src/integrations/useragent.ts
|
|
74
|
-
*
|
|
75
|
-
* So we call `this.setup` in next event loop as a workaround to wait for
|
|
76
|
-
* other global event processors to finish
|
|
77
|
-
*/
|
|
78
|
-
setupOnce(): void;
|
|
79
|
-
/**
|
|
80
|
-
* Initializes the plugin.
|
|
81
|
-
*
|
|
82
|
-
* Creates or loads a session, attaches listeners to varying events (DOM, PerformanceObserver, Recording, Sentry SDK, etc)
|
|
83
|
-
*/
|
|
84
|
-
start(): void;
|
|
85
|
-
/**
|
|
86
|
-
* Start recording.
|
|
87
|
-
*
|
|
88
|
-
* Note that this will cause a new DOM checkout
|
|
89
|
-
*/
|
|
90
|
-
startRecording(): void;
|
|
91
|
-
/**
|
|
92
|
-
* Currently, this needs to be manually called (e.g. for tests). Sentry SDK does not support a teardown
|
|
93
|
-
*/
|
|
94
|
-
stop(): void;
|
|
95
|
-
/**
|
|
96
|
-
* Pause some replay functionality. See comments for `isPaused`.
|
|
97
|
-
* This differs from stop as this only stops DOM recording, it is
|
|
98
|
-
* not as thorough of a shutdown as `stop()`. */
|
|
99
|
-
pause(): void;
|
|
100
|
-
/**
|
|
101
|
-
* Resumes recording, see notes for `pause().
|
|
102
|
-
*
|
|
103
|
-
* Note that calling `startRecording()` here will cause a
|
|
104
|
-
* new DOM checkout.`
|
|
105
|
-
*/
|
|
106
|
-
resume(): void;
|
|
107
|
-
clearSession(): void;
|
|
108
|
-
/**
|
|
109
|
-
* Loads a session from storage, or creates a new one if it does not exist or
|
|
110
|
-
* is expired.
|
|
111
|
-
*/
|
|
112
|
-
loadSession({ expiry }: {
|
|
113
|
-
expiry: number;
|
|
114
|
-
}): void;
|
|
115
|
-
/**
|
|
116
|
-
* Capture some initial state that can change throughout the lifespan of the
|
|
117
|
-
* replay. This is required because otherwise they would be captured at the
|
|
118
|
-
* first flush.
|
|
119
|
-
*/
|
|
120
|
-
setInitialState(): void;
|
|
121
|
-
/**
|
|
122
|
-
* Adds listeners to record events for the replay
|
|
123
|
-
*/
|
|
124
|
-
addListeners(): void;
|
|
125
|
-
/**
|
|
126
|
-
* Cleans up listeners that were created in `addListeners`
|
|
127
|
-
*/
|
|
128
|
-
removeListeners(): void;
|
|
129
|
-
/**
|
|
130
|
-
* We want to batch uploads of replay events. Save events only if
|
|
131
|
-
* `<flushMinDelay>` milliseconds have elapsed since the last event
|
|
132
|
-
* *OR* if `<flushMaxDelay>` milliseconds have elapsed.
|
|
133
|
-
*
|
|
134
|
-
* Accepts a callback to perform side-effects and returns true to stop batch
|
|
135
|
-
* processing and hand back control to caller.
|
|
136
|
-
*/
|
|
137
|
-
addUpdate(cb?: AddUpdateCallback): void;
|
|
138
|
-
/**
|
|
139
|
-
* Core Sentry SDK global event handler. Attaches `replayId` to all [non-replay]
|
|
140
|
-
* events as a tag. Also handles the case where we only want to capture a reply
|
|
141
|
-
* when an error occurs.
|
|
142
|
-
**/
|
|
143
|
-
handleGlobalEvent: (event: Event) => Event;
|
|
144
|
-
/**
|
|
145
|
-
* Handler for recording events.
|
|
146
|
-
*
|
|
147
|
-
* Adds to event buffer, and has varying flushing behaviors if the event was a checkout.
|
|
148
|
-
*/
|
|
149
|
-
handleRecordingEmit: (event: RecordingEvent, isCheckout?: boolean) => void;
|
|
150
|
-
/**
|
|
151
|
-
* Handle when visibility of the page content changes. Opening a new tab will
|
|
152
|
-
* cause the state to change to hidden because of content of current page will
|
|
153
|
-
* be hidden. Likewise, moving a different window to cover the contents of the
|
|
154
|
-
* page will also trigger a change to a hidden state.
|
|
155
|
-
*/
|
|
156
|
-
handleVisibilityChange: () => void;
|
|
157
|
-
/**
|
|
158
|
-
* Handle when page is blurred
|
|
159
|
-
*/
|
|
160
|
-
handleWindowBlur: () => void;
|
|
161
|
-
/**
|
|
162
|
-
* Handle when page is focused
|
|
163
|
-
*/
|
|
164
|
-
handleWindowFocus: () => void;
|
|
165
|
-
/**
|
|
166
|
-
* Handler for Sentry Core SDK events.
|
|
167
|
-
*
|
|
168
|
-
* These specific events will create span-like objects in the recording.
|
|
169
|
-
*
|
|
170
|
-
*/
|
|
171
|
-
handleCoreSpanListener: (type: InstrumentationTypeSpan) => (handlerData: any) => void;
|
|
172
|
-
/**
|
|
173
|
-
* Handler for Sentry Core SDK events.
|
|
174
|
-
*
|
|
175
|
-
* These events will create breadcrumb-like objects in the recording.
|
|
176
|
-
*/
|
|
177
|
-
handleCoreBreadcrumbListener: (type: InstrumentationTypeBreadcrumb) => (handlerData: any) => void;
|
|
178
|
-
/**
|
|
179
|
-
* Keep a list of performance entries that will be sent with a replay
|
|
180
|
-
*/
|
|
181
|
-
handlePerformanceObserver: (list: PerformanceObserverEntryList) => void;
|
|
182
|
-
/**
|
|
183
|
-
* Tasks to run when we consider a page to be hidden (via blurring and/or visibility)
|
|
184
|
-
*/
|
|
185
|
-
doChangeToBackgroundTasks(breadcrumb?: Breadcrumb): void;
|
|
186
|
-
/**
|
|
187
|
-
* Tasks to run when we consider a page to be visible (via focus and/or visibility)
|
|
188
|
-
*/
|
|
189
|
-
doChangeToForegroundTasks(breadcrumb?: Breadcrumb): void;
|
|
190
|
-
/**
|
|
191
|
-
* Trigger rrweb to take a full snapshot which will cause this plugin to
|
|
192
|
-
* create a new Replay event.
|
|
193
|
-
*/
|
|
194
|
-
triggerFullSnapshot(): void;
|
|
195
|
-
/**
|
|
196
|
-
* Add an event to the event buffer
|
|
197
|
-
*/
|
|
198
|
-
addEvent(event: RecordingEvent, isCheckout?: boolean): void;
|
|
199
|
-
/**
|
|
200
|
-
* Update user activity (across session lifespans)
|
|
201
|
-
*/
|
|
202
|
-
updateUserActivity(lastActivity?: number): void;
|
|
203
|
-
/**
|
|
204
|
-
* Updates the session's last activity timestamp
|
|
205
|
-
*/
|
|
206
|
-
updateSessionActivity(lastActivity?: number): void;
|
|
207
|
-
/**
|
|
208
|
-
* Updates the user activity timestamp and resumes recording. This should be called in an event handler for a user action that we consider as the user being "active" (e.g. a mouse click).
|
|
209
|
-
*
|
|
210
|
-
*/
|
|
211
|
-
triggerUserActivity(): Promise<void>;
|
|
212
|
-
/**
|
|
213
|
-
* Helper to create (and buffer) a replay breadcrumb from a core SDK breadcrumb
|
|
214
|
-
*/
|
|
215
|
-
createCustomBreadcrumb(breadcrumb: Breadcrumb): void;
|
|
216
|
-
/**
|
|
217
|
-
* Create a "span" for each performance entry. The parent transaction is `this.replayEvent`.
|
|
218
|
-
*/
|
|
219
|
-
createPerformanceSpans(entries: ReplayPerformanceEntry[]): Promise<void[]>;
|
|
220
|
-
/**
|
|
221
|
-
* Observed performance events are added to `this.performanceEvents`. These
|
|
222
|
-
* are included in the replay event before it is finished and sent to Sentry.
|
|
223
|
-
*/
|
|
224
|
-
addPerformanceEntries(): Promise<void[]>;
|
|
225
|
-
/**
|
|
226
|
-
* Create a "span" for the total amount of memory being used by JS objects
|
|
227
|
-
* (including v8 internal objects).
|
|
228
|
-
*/
|
|
229
|
-
addMemoryEntry(): Promise<void[]> | undefined;
|
|
230
|
-
/**
|
|
231
|
-
* Checks if recording should be stopped due to user inactivity. Otherwise
|
|
232
|
-
* check if session is expired and create a new session if so. Triggers a new
|
|
233
|
-
* full snapshot on new session.
|
|
234
|
-
*
|
|
235
|
-
* Returns true if session is not expired, false otherwise.
|
|
236
|
-
*/
|
|
237
|
-
checkAndHandleExpiredSession({ expiry, }?: {
|
|
238
|
-
expiry?: number;
|
|
239
|
-
}): boolean | undefined;
|
|
240
|
-
/**
|
|
241
|
-
* Only flush if `this.waitForError` is false.
|
|
242
|
-
*/
|
|
243
|
-
conditionalFlush(): void;
|
|
244
|
-
/**
|
|
245
|
-
* Clear context
|
|
246
|
-
*/
|
|
247
|
-
clearContext(): void;
|
|
248
|
-
/**
|
|
249
|
-
* Return and clear context
|
|
250
|
-
*/
|
|
251
|
-
popEventContext(): {
|
|
252
|
-
initialState: InitialState;
|
|
253
|
-
errorIds: string[];
|
|
254
|
-
traceIds: string[];
|
|
255
|
-
urls: string[];
|
|
256
|
-
};
|
|
257
|
-
/**
|
|
258
|
-
* Flushes replay event buffer to Sentry.
|
|
259
|
-
*
|
|
260
|
-
* Performance events are only added right before flushing - this is
|
|
261
|
-
* due to the buffered performance observer events.
|
|
262
|
-
*
|
|
263
|
-
* Should never be called directly, only by `flush`
|
|
264
|
-
*/
|
|
265
|
-
runFlush(): Promise<void>;
|
|
266
|
-
/**
|
|
267
|
-
* Flush recording data to Sentry. Creates a lock so that only a single flush
|
|
268
|
-
* can be active at a time. Do not call this directly.
|
|
269
|
-
*/
|
|
270
|
-
flush: () => Promise<void>;
|
|
271
|
-
/**
|
|
272
|
-
*
|
|
273
|
-
* Always flush via `debouncedFlush` so that we do not have flushes triggered
|
|
274
|
-
* from calling both `flush` and `debouncedFlush`. Otherwise, there could be
|
|
275
|
-
* cases of mulitple flushes happening closely together.
|
|
276
|
-
*/
|
|
277
|
-
flushImmediate(): any;
|
|
278
|
-
/**
|
|
279
|
-
* Send replay attachment using `fetch()`
|
|
280
|
-
*/
|
|
281
|
-
sendReplayRequest({ events, replayId: event_id, segmentId: segment_id, includeReplayStartTimestamp, }: SendReplay): Promise<void | undefined>;
|
|
282
|
-
resetRetries(): void;
|
|
283
|
-
/**
|
|
284
|
-
* Finalize and send the current replay event to Sentry
|
|
285
|
-
*/
|
|
286
|
-
sendReplay({ replayId, events, segmentId, includeReplayStartTimestamp, }: SendReplay): Promise<unknown>;
|
|
287
|
-
}
|
|
288
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { SampleRates, SessionOptions } from '../types';
|
|
2
|
-
declare type StickyOption = Required<Pick<SessionOptions, 'stickySession'>>;
|
|
3
|
-
declare type Sampled = false | 'session' | 'error';
|
|
4
|
-
interface SessionObject {
|
|
5
|
-
id: string;
|
|
6
|
-
/**
|
|
7
|
-
* Start time of current session
|
|
8
|
-
*/
|
|
9
|
-
started: number;
|
|
10
|
-
/**
|
|
11
|
-
* Last known activity of the session
|
|
12
|
-
*/
|
|
13
|
-
lastActivity: number;
|
|
14
|
-
/**
|
|
15
|
-
* Segment ID for replay events
|
|
16
|
-
*/
|
|
17
|
-
segmentId: number;
|
|
18
|
-
/**
|
|
19
|
-
* Is the session sampled? `null` if the sampled, otherwise, `session` or `error`
|
|
20
|
-
*/
|
|
21
|
-
sampled: Sampled;
|
|
22
|
-
}
|
|
23
|
-
export declare class Session {
|
|
24
|
-
/**
|
|
25
|
-
* Session ID
|
|
26
|
-
*/
|
|
27
|
-
private _id;
|
|
28
|
-
/**
|
|
29
|
-
* Start time of current session
|
|
30
|
-
*/
|
|
31
|
-
private _started;
|
|
32
|
-
/**
|
|
33
|
-
* Last known activity of the session
|
|
34
|
-
*/
|
|
35
|
-
private _lastActivity;
|
|
36
|
-
/**
|
|
37
|
-
* Sequence ID specific to replay updates
|
|
38
|
-
*/
|
|
39
|
-
private _segmentId;
|
|
40
|
-
/**
|
|
41
|
-
* Previous session ID
|
|
42
|
-
*/
|
|
43
|
-
private _previousSessionId;
|
|
44
|
-
/**
|
|
45
|
-
* Is the Session sampled?
|
|
46
|
-
*/
|
|
47
|
-
private _sampled;
|
|
48
|
-
readonly options: StickyOption;
|
|
49
|
-
constructor(session: Partial<SessionObject> | undefined, { stickySession, sessionSampleRate, errorSampleRate, }: StickyOption & SampleRates);
|
|
50
|
-
get id(): string;
|
|
51
|
-
get started(): number;
|
|
52
|
-
set started(newDate: number);
|
|
53
|
-
get lastActivity(): number;
|
|
54
|
-
set lastActivity(newDate: number);
|
|
55
|
-
get segmentId(): number;
|
|
56
|
-
set segmentId(id: number);
|
|
57
|
-
get previousSessionId(): string | undefined;
|
|
58
|
-
set previousSessionId(id: string | undefined);
|
|
59
|
-
get sampled(): Sampled;
|
|
60
|
-
set sampled(_isSampled: Sampled);
|
|
61
|
-
toJSON(): SessionObject;
|
|
62
|
-
}
|
|
63
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare const REPLAY_SESSION_KEY = "sentryReplaySession";
|
|
2
|
-
export declare const REPLAY_EVENT_NAME = "replay_event";
|
|
3
|
-
export declare const RECORDING_EVENT_NAME = "replay_recording";
|
|
4
|
-
export declare const SESSION_IDLE_DURATION = 300000;
|
|
5
|
-
export declare const VISIBILITY_CHANGE_TIMEOUT = 300000;
|
|
6
|
-
export declare const MAX_SESSION_LIFE = 1800000;
|
|
7
|
-
/**
|
|
8
|
-
* Defaults for sampling rates
|
|
9
|
-
*/
|
|
10
|
-
export declare const DEFAULT_SESSION_SAMPLE_RATE = 0.1;
|
|
11
|
-
export declare const DEFAULT_ERROR_SAMPLE_RATE = 1;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { SessionOptions } from '../types';
|
|
2
|
-
import { Session } from './Session';
|
|
3
|
-
/**
|
|
4
|
-
* Create a new session, which in its current implementation is a Sentry event
|
|
5
|
-
* that all replays will be saved to as attachments. Currently, we only expect
|
|
6
|
-
* one of these Sentry events per "replay session".
|
|
7
|
-
*/
|
|
8
|
-
export declare function createSession({ sessionSampleRate, errorSampleRate, stickySession, }: SessionOptions): Session;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { SessionOptions } from '../types';
|
|
2
|
-
import { Session } from './Session';
|
|
3
|
-
interface GetSessionParams extends SessionOptions {
|
|
4
|
-
/**
|
|
5
|
-
* The length of time (in ms) which we will consider the session to be expired.
|
|
6
|
-
*/
|
|
7
|
-
expiry: number;
|
|
8
|
-
/**
|
|
9
|
-
* The current session (e.g. if stickySession is off)
|
|
10
|
-
*/
|
|
11
|
-
currentSession?: Session;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Get or create a session
|
|
15
|
-
*/
|
|
16
|
-
export declare function getSession({ expiry, currentSession, stickySession, sessionSampleRate, errorSampleRate, }: GetSessionParams): {
|
|
17
|
-
type: string;
|
|
18
|
-
session: Session;
|
|
19
|
-
};
|
|
20
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './createSession';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import type { eventWithTime, recordOptions } from 'rrweb/typings/types';
|
|
2
|
-
export declare type RecordingEvent = eventWithTime;
|
|
3
|
-
export declare type RecordingOptions = recordOptions<eventWithTime>;
|
|
4
|
-
export declare type RecordedEvents = Uint8Array | string;
|
|
5
|
-
export declare type AllPerformanceEntry = PerformancePaintTiming | PerformanceResourceTiming | PerformanceNavigationTiming;
|
|
6
|
-
export interface SendReplay {
|
|
7
|
-
events: RecordedEvents;
|
|
8
|
-
replayId: string;
|
|
9
|
-
segmentId: number;
|
|
10
|
-
includeReplayStartTimestamp: boolean;
|
|
11
|
-
}
|
|
12
|
-
export declare type InstrumentationTypeBreadcrumb = 'dom' | 'scope';
|
|
13
|
-
export declare type InstrumentationTypeSpan = 'fetch' | 'xhr' | 'history';
|
|
14
|
-
export declare type InstrumentationType = InstrumentationTypeBreadcrumb | InstrumentationTypeSpan | 'console' | 'error' | 'unhandledrejection';
|
|
15
|
-
/**
|
|
16
|
-
* The request payload to worker
|
|
17
|
-
*/
|
|
18
|
-
export interface WorkerRequest {
|
|
19
|
-
id: number;
|
|
20
|
-
method: string;
|
|
21
|
-
args: any[];
|
|
22
|
-
}
|
|
23
|
-
declare global {
|
|
24
|
-
const __SENTRY_REPLAY_VERSION__: string;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* The response from the worker
|
|
28
|
-
*/
|
|
29
|
-
export interface WorkerResponse {
|
|
30
|
-
id: number;
|
|
31
|
-
method: string;
|
|
32
|
-
success: boolean;
|
|
33
|
-
response: string | Uint8Array;
|
|
34
|
-
}
|
|
35
|
-
export interface SampleRates {
|
|
36
|
-
/**
|
|
37
|
-
* The sample rate for session-long replays. 1.0 will record all sessions and
|
|
38
|
-
* 0 will record none.
|
|
39
|
-
*/
|
|
40
|
-
sessionSampleRate: number;
|
|
41
|
-
/**
|
|
42
|
-
* The sample rate for sessions that has had an error occur. This is
|
|
43
|
-
* independent of `sessionSampleRate`.
|
|
44
|
-
*/
|
|
45
|
-
errorSampleRate: number;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Session options that are configurable by the integration configuration
|
|
49
|
-
*/
|
|
50
|
-
export interface SessionOptions extends SampleRates {
|
|
51
|
-
/**
|
|
52
|
-
* If false, will create a new session per pageload. Otherwise, saves session
|
|
53
|
-
* to Session Storage.
|
|
54
|
-
*/
|
|
55
|
-
stickySession: boolean;
|
|
56
|
-
}
|
|
57
|
-
export interface ReplayPluginOptions extends SessionOptions {
|
|
58
|
-
/**
|
|
59
|
-
* The amount of time to wait before sending a replay
|
|
60
|
-
*/
|
|
61
|
-
flushMinDelay: number;
|
|
62
|
-
/**
|
|
63
|
-
* The max amount of time to wait before sending a replay
|
|
64
|
-
*/
|
|
65
|
-
flushMaxDelay: number;
|
|
66
|
-
/**
|
|
67
|
-
* The amount of time to buffer the initial snapshot
|
|
68
|
-
*/
|
|
69
|
-
initialFlushDelay: number;
|
|
70
|
-
/**
|
|
71
|
-
* Attempt to use compression when web workers are available
|
|
72
|
-
*
|
|
73
|
-
* (default is true)
|
|
74
|
-
*/
|
|
75
|
-
useCompression: boolean;
|
|
76
|
-
/**
|
|
77
|
-
* Only capture replays when an error happens
|
|
78
|
-
*
|
|
79
|
-
* @deprecated
|
|
80
|
-
* @see errorSampleRate
|
|
81
|
-
*/
|
|
82
|
-
captureOnlyOnError?: boolean;
|
|
83
|
-
/**
|
|
84
|
-
* The sample rate for replays. 1.0 will record all replays, 0 will record none.
|
|
85
|
-
*
|
|
86
|
-
* @deprecated
|
|
87
|
-
* @see sessionSampleRate
|
|
88
|
-
*/
|
|
89
|
-
replaysSamplingRate?: number;
|
|
90
|
-
/**
|
|
91
|
-
* Mask all text in recordings. All text will be replaced with asterisks by default.
|
|
92
|
-
*/
|
|
93
|
-
maskAllText: boolean;
|
|
94
|
-
/**
|
|
95
|
-
* Block all media (e.g. images, svg, video) in recordings.
|
|
96
|
-
*/
|
|
97
|
-
blockAllMedia: boolean;
|
|
98
|
-
}
|
|
99
|
-
declare type OptionalReplayPluginOptions = Partial<ReplayPluginOptions>;
|
|
100
|
-
export interface ReplayConfiguration extends OptionalReplayPluginOptions, RecordingOptions {
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Some initial state captured before creating a root replay event
|
|
104
|
-
*/
|
|
105
|
-
export interface InitialState {
|
|
106
|
-
timestamp: number;
|
|
107
|
-
url: string;
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Additional context that will be sent w/ `replay_event`
|
|
111
|
-
*/
|
|
112
|
-
export interface ReplayEventContext {
|
|
113
|
-
/**
|
|
114
|
-
* Set of Sentry error ids that have occurred during a replay segment
|
|
115
|
-
*/
|
|
116
|
-
errorIds: Set<string>;
|
|
117
|
-
/**
|
|
118
|
-
* Set of Sentry trace ids that have occurred during a replay segment
|
|
119
|
-
*/
|
|
120
|
-
traceIds: Set<string>;
|
|
121
|
-
/**
|
|
122
|
-
* Ordered list of URLs that have been visited during a replay segment
|
|
123
|
-
*/
|
|
124
|
-
urls: string[];
|
|
125
|
-
/**
|
|
126
|
-
* The timestamp of the earliest event that has been added to event buffer. This can happen due to the Performance Observer which buffers events.
|
|
127
|
-
*/
|
|
128
|
-
earliestEvent: number | null;
|
|
129
|
-
}
|
|
130
|
-
export {};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { Breadcrumb } from '@sentry/types';
|
|
2
|
-
declare type RequiredProperties = 'category' | 'message';
|
|
3
|
-
export declare function createBreadcrumb(breadcrumb: Pick<Breadcrumb, RequiredProperties> & Partial<Omit<Breadcrumb, RequiredProperties>>): Breadcrumb;
|
|
4
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* There are some difficulties diagnosing why there are duplicate navigation
|
|
3
|
-
* entries. We've witnessed several intermittent results:
|
|
4
|
-
* - duplicate entries have duration = 0
|
|
5
|
-
* - duplicate entries are the same object reference
|
|
6
|
-
* - none of the above
|
|
7
|
-
*
|
|
8
|
-
* Compare the values of several keys to determine if the entries are duplicates or not.
|
|
9
|
-
*/
|
|
10
|
-
export declare function dedupePerformanceEntries(currentList: PerformanceEntryList, newList: PerformanceEntryList): PerformancePaintTiming[];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
declare const logger: {
|
|
2
|
-
error: (...args: any[]) => any;
|
|
3
|
-
warn: (...args: any[]) => any;
|
|
4
|
-
log: (...args: any[]) => any;
|
|
5
|
-
disable(): void;
|
|
6
|
-
enable(): void;
|
|
7
|
-
info: (...args: unknown[]) => void;
|
|
8
|
-
debug: (...args: unknown[]) => void;
|
|
9
|
-
assert: (...args: unknown[]) => void;
|
|
10
|
-
trace: (...args: unknown[]) => void;
|
|
11
|
-
};
|
|
12
|
-
export { logger };
|