@sentry/replay 0.2.0-9 → 0.4.1
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/README.md +2 -3
- package/dist/{jest.config.d.ts → config/dist/jest.config.d.ts} +0 -0
- package/dist/config/dist/jest.setup.d.ts +10 -0
- package/dist/config/dist/src/api/captureReplay.d.ts +2 -0
- package/dist/config/dist/src/api/captureReplayUpdate.d.ts +2 -0
- package/dist/config/dist/src/coreHandlers/handleDom.d.ts +1 -0
- package/dist/config/dist/src/coreHandlers/handleFetch.d.ts +2 -0
- package/dist/{src/session/createSession.test.d.ts → config/dist/src/coreHandlers/handleFetch.test.d.ts} +0 -0
- package/dist/{src/session/fetchSession.test.d.ts → config/dist/src/coreHandlers/handleScope-unit.test.d.ts} +0 -0
- package/dist/config/dist/src/coreHandlers/handleScope.d.ts +2 -0
- package/dist/{src/session/getSession.test.d.ts → config/dist/src/coreHandlers/handleScope.test.d.ts} +0 -0
- package/dist/config/dist/src/coreHandlers/handleXhr.d.ts +2 -0
- package/dist/config/dist/src/coreHandlers/index.d.ts +4 -0
- package/dist/{src → config/dist/src}/createPerformanceEntry.d.ts +20 -1
- package/dist/{src/session/saveSession.test.d.ts → config/dist/src/createPerformanceEntry.test.d.ts} +0 -0
- package/dist/config/dist/src/eventBuffer.d.ts +31 -0
- package/dist/{src/session/updateSessionActivity.test.d.ts → config/dist/src/eventBuffer.test.d.ts} +0 -0
- package/dist/{src → config/dist/src}/flags.d.ts +0 -0
- package/dist/{src/util/isExpired.test.d.ts → config/dist/src/index-captureOnlyOnError.test.d.ts} +0 -0
- package/dist/{src/util/isSessionExpired.test.d.ts → config/dist/src/index-noSticky.test.d.ts} +0 -0
- package/dist/config/dist/src/index.d.ts +151 -0
- package/dist/{tests/index.spec.d.ts → config/dist/src/index.test.d.ts} +0 -0
- package/dist/config/dist/src/session/Session.d.ts +46 -0
- package/dist/config/dist/src/session/Session.test.d.ts +1 -0
- package/dist/config/dist/src/session/constants.d.ts +5 -0
- package/dist/{src → config/dist/src}/session/createSession.d.ts +2 -2
- package/dist/config/dist/src/session/createSession.test.d.ts +1 -0
- package/dist/config/dist/src/session/fetchSession.d.ts +5 -0
- package/dist/config/dist/src/session/fetchSession.test.d.ts +1 -0
- package/dist/{src → config/dist/src}/session/getSession.d.ts +9 -1
- package/dist/config/dist/src/session/getSession.test.d.ts +1 -0
- package/dist/{src → config/dist/src}/session/index.d.ts +0 -1
- package/dist/config/dist/src/session/saveSession.d.ts +2 -0
- package/dist/config/dist/src/session/saveSession.test.d.ts +1 -0
- package/dist/config/dist/src/types.d.ts +57 -0
- package/dist/config/dist/src/util/createBreadcrumb.d.ts +4 -0
- package/dist/config/dist/src/util/createPayload.d.ts +5 -0
- package/dist/{src → config/dist/src}/util/isExpired.d.ts +0 -0
- package/dist/config/dist/src/util/isExpired.test.d.ts +1 -0
- package/dist/config/dist/src/util/isIngestHost.d.ts +4 -0
- package/dist/config/dist/src/util/isSessionExpired.d.ts +5 -0
- package/dist/config/dist/src/util/isSessionExpired.test.d.ts +1 -0
- package/dist/config/dist/src/util/logger.d.ts +12 -0
- package/dist/config/dist/test/index.d.ts +3 -0
- package/dist/config/dist/test/mocks/mockRrweb.d.ts +15 -0
- package/dist/config/dist/test/mocks/mockSdk.d.ts +11 -0
- package/dist/dist/api/captureReplay.d.ts +2 -0
- package/dist/dist/coreHandlers/handleDom.d.ts +1 -0
- package/dist/dist/coreHandlers/handleFetch.d.ts +2 -0
- package/dist/dist/coreHandlers/handleScope.d.ts +2 -0
- package/dist/dist/coreHandlers/handleXhr.d.ts +2 -0
- package/dist/dist/coreHandlers/index.d.ts +4 -0
- package/dist/dist/createPerformanceEntry.d.ts +42 -0
- package/dist/dist/eventBuffer.d.ts +31 -0
- package/dist/dist/flags.d.ts +2 -0
- package/dist/dist/index.d.ts +152 -0
- package/dist/dist/session/Session.d.ts +52 -0
- package/dist/dist/session/constants.d.ts +5 -0
- package/dist/dist/session/createSession.d.ts +14 -0
- package/dist/dist/session/fetchSession.d.ts +5 -0
- package/dist/dist/session/getSession.d.ts +23 -0
- package/dist/dist/session/index.d.ts +1 -0
- package/dist/dist/session/saveSession.d.ts +2 -0
- package/dist/dist/types.d.ts +61 -0
- package/dist/dist/util/createBreadcrumb.d.ts +4 -0
- package/dist/dist/util/isExpired.d.ts +5 -0
- package/dist/dist/util/isIngestHost.d.ts +4 -0
- package/dist/dist/util/isSessionExpired.d.ts +5 -0
- package/dist/dist/util/logger.d.ts +12 -0
- package/dist/index.es.js +732 -227
- package/dist/index.js +731 -246
- package/dist/index.js.map +1 -1
- package/package.json +25 -20
- package/dist/rollup.config.d.ts +0 -3
- package/dist/src/index.d.ts +0 -120
- package/dist/src/session/constants.d.ts +0 -1
- package/dist/src/session/fetchSession.d.ts +0 -2
- package/dist/src/session/saveSession.d.ts +0 -2
- package/dist/src/session/types.d.ts +0 -7
- package/dist/src/session/updateSessionActivity.d.ts +0 -3
- package/dist/src/util/isSessionExpired.d.ts +0 -5
- package/dist/src/util/logger.d.ts +0 -6
package/dist/src/index.d.ts
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { Transaction } from '@sentry/types';
|
|
2
|
-
import { record } from 'rrweb';
|
|
3
|
-
import type { eventWithTime } from 'rrweb/typings/types';
|
|
4
|
-
import { ReplayPerformanceEntry } from './createPerformanceEntry';
|
|
5
|
-
declare type RRWebEvent = eventWithTime;
|
|
6
|
-
declare type RRWebOptions = Parameters<typeof record>[0];
|
|
7
|
-
interface PluginOptions {
|
|
8
|
-
/**
|
|
9
|
-
* The amount of time to wait before sending a replay
|
|
10
|
-
*/
|
|
11
|
-
uploadMinDelay?: number;
|
|
12
|
-
/**
|
|
13
|
-
* The max amount of time to wait before sending a replay
|
|
14
|
-
*/
|
|
15
|
-
uploadMaxDelay?: number;
|
|
16
|
-
/**
|
|
17
|
-
* If false, will create a new session per pageload
|
|
18
|
-
*/
|
|
19
|
-
stickySession?: boolean;
|
|
20
|
-
}
|
|
21
|
-
interface SentryReplayConfiguration extends PluginOptions {
|
|
22
|
-
/**
|
|
23
|
-
* Options for `rrweb.record`
|
|
24
|
-
*/
|
|
25
|
-
rrwebConfig?: RRWebOptions;
|
|
26
|
-
}
|
|
27
|
-
export declare class SentryReplay {
|
|
28
|
-
/**
|
|
29
|
-
* @inheritDoc
|
|
30
|
-
*/
|
|
31
|
-
static id: string;
|
|
32
|
-
/**
|
|
33
|
-
* @inheritDoc
|
|
34
|
-
*/
|
|
35
|
-
name: string;
|
|
36
|
-
/**
|
|
37
|
-
* Buffer of rrweb events that will be serialized as JSON and saved as an attachment to a Sentry event
|
|
38
|
-
*/
|
|
39
|
-
events: RRWebEvent[];
|
|
40
|
-
performanceEvents: PerformanceEntry[];
|
|
41
|
-
/**
|
|
42
|
-
* A Sentry Transaction that should capture every incremental rrweb update,
|
|
43
|
-
* but *not* the attachments themselves. This is currently used to capture
|
|
44
|
-
* breadcrumbs and maybe other spans (e.g. network requests)
|
|
45
|
-
*/
|
|
46
|
-
private replayEvent;
|
|
47
|
-
/**
|
|
48
|
-
* Options to pass to `rrweb.record()`
|
|
49
|
-
*/
|
|
50
|
-
private readonly rrwebRecordOptions;
|
|
51
|
-
private readonly options;
|
|
52
|
-
/**
|
|
53
|
-
* setTimeout id used for debouncing sending rrweb attachments
|
|
54
|
-
*/
|
|
55
|
-
private timeout;
|
|
56
|
-
/**
|
|
57
|
-
* The timestamp of the first event since the last flush.
|
|
58
|
-
* This is used to determine if the maximum allowed time has passed before we should flush events again.
|
|
59
|
-
*/
|
|
60
|
-
private initialEventTimestampSinceFlush;
|
|
61
|
-
private performanceObserver;
|
|
62
|
-
private session;
|
|
63
|
-
private static attachmentUrlFromDsn;
|
|
64
|
-
/**
|
|
65
|
-
* Get integration's instance on the current hub
|
|
66
|
-
*/
|
|
67
|
-
private get instance();
|
|
68
|
-
constructor({ uploadMinDelay, uploadMaxDelay, stickySession, // TBD: Making this opt-in for now
|
|
69
|
-
rrwebConfig: { maskAllInputs, ...rrwebRecordOptions }, }?: SentryReplayConfiguration);
|
|
70
|
-
setupOnce(): void;
|
|
71
|
-
/**
|
|
72
|
-
* Loads a session from storage, or creates a new one
|
|
73
|
-
*/
|
|
74
|
-
loadSession({ expiry }: {
|
|
75
|
-
expiry: number;
|
|
76
|
-
}): void;
|
|
77
|
-
addListeners(): void;
|
|
78
|
-
/**
|
|
79
|
-
* Keep a list of performance entries that will be sent with a replay
|
|
80
|
-
*/
|
|
81
|
-
handlePerformanceObserver: (list: PerformanceObserverEntryList) => void;
|
|
82
|
-
/**
|
|
83
|
-
* Handle when visibility of the page changes. (e.g. new tab is opened)
|
|
84
|
-
*/
|
|
85
|
-
handleVisibilityChange: () => void;
|
|
86
|
-
/**
|
|
87
|
-
* Trigger rrweb to take a full snapshot which will cause this plugin to
|
|
88
|
-
* create a new Replay event.
|
|
89
|
-
*/
|
|
90
|
-
triggerFullSnapshot(): void;
|
|
91
|
-
/**
|
|
92
|
-
* This is our pseudo replay event disguised as a transaction. It will be
|
|
93
|
-
* used to store performance entries and breadcrumbs for every incremental
|
|
94
|
-
* replay event.
|
|
95
|
-
**/
|
|
96
|
-
createReplayEvent(): Transaction;
|
|
97
|
-
/**
|
|
98
|
-
* Create a span for each performance entry. The parent transaction is `this.replayEvent`.
|
|
99
|
-
*/
|
|
100
|
-
createPerformanceSpans(entries: ReplayPerformanceEntry[]): void;
|
|
101
|
-
/**
|
|
102
|
-
* Observed performance events are added to `this.performanceEvents`. These
|
|
103
|
-
* are included in the replay event before it is finished and sent to Sentry.
|
|
104
|
-
*/
|
|
105
|
-
addPerformanceEntries(): void;
|
|
106
|
-
finishReplayEvent(): void;
|
|
107
|
-
/**
|
|
108
|
-
* Determine if there is browser support for `navigator.sendBeacon`
|
|
109
|
-
*/
|
|
110
|
-
hasSendBeacon(): boolean;
|
|
111
|
-
/**
|
|
112
|
-
* Send replay attachment using either `sendBeacon()` or `fetch()`
|
|
113
|
-
*/
|
|
114
|
-
sendReplayRequest(endpoint: string, events: RRWebEvent[]): Promise<void>;
|
|
115
|
-
/**
|
|
116
|
-
* Finalize and send the current replay event to Sentry
|
|
117
|
-
*/
|
|
118
|
-
sendReplay(eventId: string): Promise<boolean>;
|
|
119
|
-
}
|
|
120
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const REPLAY_SESSION_KEY = "sentryReplaySession";
|