@sentry/replay 7.24.1 → 7.25.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.
- package/README.md +3 -4
- package/cjs/_virtual/_commonjsHelpers.js +42 -0
- package/cjs/_virtual/_commonjsHelpers.js.map +1 -0
- package/cjs/constants.js +8 -0
- package/cjs/constants.js.map +1 -1
- package/cjs/coreHandlers/breadcrumbHandler.js.map +1 -1
- package/cjs/coreHandlers/handleFetch.js +33 -6
- package/cjs/coreHandlers/handleFetch.js.map +1 -1
- package/cjs/coreHandlers/handleGlobalEvent.js +91 -0
- package/cjs/coreHandlers/handleGlobalEvent.js.map +1 -0
- package/cjs/coreHandlers/handleHistory.js +30 -1
- package/cjs/coreHandlers/handleHistory.js.map +1 -1
- package/cjs/coreHandlers/handleScope.js +4 -12
- package/cjs/coreHandlers/handleScope.js.map +1 -1
- package/cjs/coreHandlers/handleXhr.js +33 -4
- package/cjs/coreHandlers/handleXhr.js.map +1 -1
- package/cjs/coreHandlers/performanceObserver.js +47 -0
- package/cjs/coreHandlers/performanceObserver.js.map +1 -0
- package/cjs/createPerformanceEntry.js +0 -6
- package/cjs/createPerformanceEntry.js.map +1 -1
- package/cjs/eventBuffer.js.map +1 -1
- package/cjs/index.js +2 -185
- package/cjs/index.js.map +1 -1
- package/cjs/integration.js +194 -0
- package/cjs/integration.js.map +1 -0
- package/cjs/node_modules/lodash.debounce/index.js +384 -0
- package/cjs/node_modules/lodash.debounce/index.js.map +1 -0
- package/cjs/replay.js +201 -414
- package/cjs/replay.js.map +1 -1
- package/cjs/session/Session.js.map +1 -1
- package/cjs/session/createSession.js.map +1 -1
- package/cjs/session/fetchSession.js.map +1 -1
- package/cjs/session/getSession.js.map +1 -1
- package/cjs/session/saveSession.js.map +1 -1
- package/cjs/util/addEvent.js +47 -0
- package/cjs/util/addEvent.js.map +1 -0
- package/cjs/util/addMemoryEntry.js +23 -0
- package/cjs/util/addMemoryEntry.js.map +1 -0
- package/cjs/util/createPayload.js.map +1 -1
- package/cjs/util/createPerformanceSpans.js +30 -0
- package/cjs/util/createPerformanceSpans.js.map +1 -0
- package/cjs/util/createReplayEnvelope.js +34 -0
- package/cjs/util/createReplayEnvelope.js.map +1 -0
- package/cjs/util/getReplayEvent.js +32 -0
- package/cjs/util/getReplayEvent.js.map +1 -0
- package/cjs/util/isSessionExpired.js.map +1 -1
- package/cjs/util/monkeyPatchRecordDroppedEvent.js +44 -0
- package/cjs/util/monkeyPatchRecordDroppedEvent.js.map +1 -0
- package/cjs/util/shouldFilterRequest.js +30 -0
- package/cjs/util/shouldFilterRequest.js.map +1 -0
- package/esm/_virtual/_commonjsHelpers.js +35 -0
- package/esm/_virtual/_commonjsHelpers.js.map +1 -0
- package/esm/constants.js +7 -1
- package/esm/constants.js.map +1 -1
- package/esm/coreHandlers/breadcrumbHandler.js.map +1 -1
- package/esm/coreHandlers/handleFetch.js +33 -7
- package/esm/coreHandlers/handleFetch.js.map +1 -1
- package/esm/coreHandlers/handleGlobalEvent.js +86 -0
- package/esm/coreHandlers/handleGlobalEvent.js.map +1 -0
- package/esm/coreHandlers/handleHistory.js +30 -1
- package/esm/coreHandlers/handleHistory.js.map +1 -1
- package/esm/coreHandlers/handleScope.js +4 -9
- package/esm/coreHandlers/handleScope.js.map +1 -1
- package/esm/coreHandlers/handleXhr.js +33 -4
- package/esm/coreHandlers/handleXhr.js.map +1 -1
- package/esm/coreHandlers/performanceObserver.js +45 -0
- package/esm/coreHandlers/performanceObserver.js.map +1 -0
- package/esm/createPerformanceEntry.js +0 -6
- package/esm/createPerformanceEntry.js.map +1 -1
- package/esm/eventBuffer.js.map +1 -1
- package/esm/index.js +1 -188
- package/esm/index.js.map +1 -1
- package/esm/integration.js +192 -0
- package/esm/integration.js.map +1 -0
- package/esm/node_modules/lodash.debounce/index.js +382 -0
- package/esm/node_modules/lodash.debounce/index.js.map +1 -0
- package/esm/replay.js +200 -413
- package/esm/replay.js.map +1 -1
- package/esm/session/Session.js.map +1 -1
- package/esm/session/createSession.js.map +1 -1
- package/esm/session/fetchSession.js.map +1 -1
- package/esm/session/getSession.js.map +1 -1
- package/esm/session/saveSession.js.map +1 -1
- package/esm/util/addEvent.js +42 -0
- package/esm/util/addEvent.js.map +1 -0
- package/esm/util/addMemoryEntry.js +21 -0
- package/esm/util/addMemoryEntry.js.map +1 -0
- package/esm/util/createPayload.js.map +1 -1
- package/esm/util/createPerformanceSpans.js +28 -0
- package/esm/util/createPerformanceSpans.js.map +1 -0
- package/esm/util/createReplayEnvelope.js +32 -0
- package/esm/util/createReplayEnvelope.js.map +1 -0
- package/esm/util/getReplayEvent.js +30 -0
- package/esm/util/getReplayEvent.js.map +1 -0
- package/esm/util/isSessionExpired.js.map +1 -1
- package/esm/util/monkeyPatchRecordDroppedEvent.js +41 -0
- package/esm/util/monkeyPatchRecordDroppedEvent.js.map +1 -0
- package/esm/util/shouldFilterRequest.js +25 -0
- package/esm/util/shouldFilterRequest.js.map +1 -0
- package/package.json +7 -8
- package/types/constants.d.ts +5 -0
- package/types/constants.d.ts.map +1 -1
- package/types/coreHandlers/breadcrumbHandler.d.ts +1 -1
- package/types/coreHandlers/breadcrumbHandler.d.ts.map +1 -1
- package/types/coreHandlers/handleFetch.d.ts +9 -2
- package/types/coreHandlers/handleFetch.d.ts.map +1 -1
- package/types/coreHandlers/handleGlobalEvent.d.ts +7 -0
- package/types/coreHandlers/handleGlobalEvent.d.ts.map +1 -0
- package/types/coreHandlers/handleHistory.d.ts +7 -3
- package/types/coreHandlers/handleHistory.d.ts.map +1 -1
- package/types/coreHandlers/handleScope.d.ts.map +1 -1
- package/types/coreHandlers/handleXhr.d.ts +6 -3
- package/types/coreHandlers/handleXhr.d.ts.map +1 -1
- package/types/coreHandlers/performanceObserver.d.ts +6 -0
- package/types/coreHandlers/performanceObserver.d.ts.map +1 -0
- package/types/createPerformanceEntry.d.ts +1 -1
- package/types/createPerformanceEntry.d.ts.map +1 -1
- package/types/eventBuffer.d.ts +1 -7
- package/types/eventBuffer.d.ts.map +1 -1
- package/types/index.d.ts +1 -47
- package/types/index.d.ts.map +1 -1
- package/types/integration.d.ts +48 -0
- package/types/integration.d.ts.map +1 -0
- package/types/replay.d.ts +30 -59
- package/types/replay.d.ts.map +1 -1
- package/types/session/Session.d.ts +1 -26
- package/types/session/Session.d.ts.map +1 -1
- package/types/session/createSession.d.ts +1 -2
- package/types/session/createSession.d.ts.map +1 -1
- package/types/session/fetchSession.d.ts +1 -1
- package/types/session/fetchSession.d.ts.map +1 -1
- package/types/session/getSession.d.ts +1 -2
- package/types/session/getSession.d.ts.map +1 -1
- package/types/session/saveSession.d.ts +1 -1
- package/types/session/saveSession.d.ts.map +1 -1
- package/types/types/rrweb.d.ts +35 -0
- package/types/types/rrweb.d.ts.map +1 -0
- package/types/types.d.ts +65 -4
- package/types/types.d.ts.map +1 -1
- package/types/util/addEvent.d.ts +6 -0
- package/types/util/addEvent.d.ts.map +1 -0
- package/types/util/addMemoryEntry.d.ts +7 -0
- package/types/util/addMemoryEntry.d.ts.map +1 -0
- package/types/util/createPayload.d.ts +1 -1
- package/types/util/createPayload.d.ts.map +1 -1
- package/types/util/createPerformanceSpans.d.ts +7 -0
- package/types/util/createPerformanceSpans.d.ts.map +1 -0
- package/types/util/createReplayEnvelope.d.ts +3 -0
- package/types/util/createReplayEnvelope.d.ts.map +1 -0
- package/types/util/getReplayEvent.d.ts +9 -0
- package/types/util/getReplayEvent.d.ts.map +1 -0
- package/types/util/isSessionExpired.d.ts +1 -1
- package/types/util/isSessionExpired.d.ts.map +1 -1
- package/types/util/monkeyPatchRecordDroppedEvent.d.ts +3 -0
- package/types/util/monkeyPatchRecordDroppedEvent.d.ts.map +1 -0
- package/types/util/shouldFilterRequest.d.ts +6 -0
- package/types/util/shouldFilterRequest.d.ts.map +1 -0
- package/cjs/coreHandlers/spanHandler.js +0 -20
- package/cjs/coreHandlers/spanHandler.js.map +0 -1
- package/cjs/util/addInternalBreadcrumb.js +0 -25
- package/cjs/util/addInternalBreadcrumb.js.map +0 -1
- package/cjs/util/captureInternalException.js +0 -18
- package/cjs/util/captureInternalException.js.map +0 -1
- package/cjs/util/isIngestHost.js +0 -26
- package/cjs/util/isIngestHost.js.map +0 -1
- package/cjs/util/isInternal.js +0 -15
- package/cjs/util/isInternal.js.map +0 -1
- package/esm/coreHandlers/spanHandler.js +0 -18
- package/esm/coreHandlers/spanHandler.js.map +0 -1
- package/esm/util/addInternalBreadcrumb.js +0 -23
- package/esm/util/addInternalBreadcrumb.js.map +0 -1
- package/esm/util/captureInternalException.js +0 -16
- package/esm/util/captureInternalException.js.map +0 -1
- package/esm/util/isIngestHost.js +0 -21
- package/esm/util/isIngestHost.js.map +0 -1
- package/esm/util/isInternal.js +0 -13
- package/esm/util/isInternal.js.map +0 -1
- package/types/coreHandlers/spanHandler.d.ts +0 -4
- package/types/coreHandlers/spanHandler.d.ts.map +0 -1
- package/types/util/addInternalBreadcrumb.d.ts +0 -6
- package/types/util/addInternalBreadcrumb.d.ts.map +0 -1
- package/types/util/captureInternalException.d.ts +0 -5
- package/types/util/captureInternalException.d.ts.map +0 -1
- package/types/util/isIngestHost.d.ts +0 -5
- package/types/util/isIngestHost.d.ts.map +0 -1
- package/types/util/isInternal.d.ts +0 -6
- package/types/util/isInternal.d.ts.map +0 -1
package/types/index.d.ts
CHANGED
|
@@ -1,48 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import type { RecordingOptions, ReplayConfiguration, ReplayPluginOptions } from './types';
|
|
3
|
-
export declare class Replay implements Integration {
|
|
4
|
-
/**
|
|
5
|
-
* @inheritDoc
|
|
6
|
-
*/
|
|
7
|
-
static id: string;
|
|
8
|
-
/**
|
|
9
|
-
* @inheritDoc
|
|
10
|
-
*/
|
|
11
|
-
name: string;
|
|
12
|
-
/**
|
|
13
|
-
* Options to pass to `rrweb.record()`
|
|
14
|
-
*/
|
|
15
|
-
readonly recordingOptions: RecordingOptions;
|
|
16
|
-
readonly options: ReplayPluginOptions;
|
|
17
|
-
/** In tests, this is only called the first time */
|
|
18
|
-
protected _hasCalledSetupOnce: boolean;
|
|
19
|
-
private _replay?;
|
|
20
|
-
constructor({ flushMinDelay, flushMaxDelay, initialFlushDelay, stickySession, useCompression, sessionSampleRate, errorSampleRate, maskAllText, maskAllInputs, blockAllMedia, blockClass, ignoreClass, maskTextClass, blockSelector, ...recordingOptions }?: ReplayConfiguration);
|
|
21
|
-
/**
|
|
22
|
-
* We previously used to create a transaction in `setupOnce` and it would
|
|
23
|
-
* potentially create a transaction before some native SDK integrations have run
|
|
24
|
-
* and applied their own global event processor. An example is:
|
|
25
|
-
* https://github.com/getsentry/sentry-javascript/blob/b47ceafbdac7f8b99093ce6023726ad4687edc48/packages/browser/src/integrations/useragent.ts
|
|
26
|
-
*
|
|
27
|
-
* So we call `replay.setup` in next event loop as a workaround to wait for other
|
|
28
|
-
* global event processors to finish. This is no longer needed, but keeping it
|
|
29
|
-
* here to avoid any future issues.
|
|
30
|
-
*/
|
|
31
|
-
setupOnce(): void;
|
|
32
|
-
/**
|
|
33
|
-
* Initializes the plugin.
|
|
34
|
-
*
|
|
35
|
-
* Creates or loads a session, attaches listeners to varying events (DOM,
|
|
36
|
-
* PerformanceObserver, Recording, Sentry SDK, etc)
|
|
37
|
-
*/
|
|
38
|
-
start(): void;
|
|
39
|
-
/**
|
|
40
|
-
* Currently, this needs to be manually called (e.g. for tests). Sentry SDK
|
|
41
|
-
* does not support a teardown
|
|
42
|
-
*/
|
|
43
|
-
stop(): void;
|
|
44
|
-
private _setup;
|
|
45
|
-
/** Parse Replay-related options from SDK options */
|
|
46
|
-
private _loadReplayOptionsFromClient;
|
|
47
|
-
}
|
|
1
|
+
export { Replay } from './integration';
|
|
48
2
|
//# sourceMappingURL=index.d.ts.map
|
package/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Integration } from '@sentry/types';
|
|
2
|
+
import type { RecordingOptions, ReplayConfiguration, ReplayPluginOptions } from './types';
|
|
3
|
+
export declare class Replay implements Integration {
|
|
4
|
+
/**
|
|
5
|
+
* @inheritDoc
|
|
6
|
+
*/
|
|
7
|
+
static id: string;
|
|
8
|
+
/**
|
|
9
|
+
* @inheritDoc
|
|
10
|
+
*/
|
|
11
|
+
name: string;
|
|
12
|
+
/**
|
|
13
|
+
* Options to pass to `rrweb.record()`
|
|
14
|
+
*/
|
|
15
|
+
readonly recordingOptions: RecordingOptions;
|
|
16
|
+
readonly options: ReplayPluginOptions;
|
|
17
|
+
protected get _isInitialized(): boolean;
|
|
18
|
+
protected set _isInitialized(value: boolean);
|
|
19
|
+
private _replay?;
|
|
20
|
+
constructor({ flushMinDelay, flushMaxDelay, initialFlushDelay, stickySession, useCompression, sessionSampleRate, errorSampleRate, maskAllText, maskAllInputs, blockAllMedia, _experiments, blockClass, ignoreClass, maskTextClass, blockSelector, ...recordingOptions }?: ReplayConfiguration);
|
|
21
|
+
/**
|
|
22
|
+
* We previously used to create a transaction in `setupOnce` and it would
|
|
23
|
+
* potentially create a transaction before some native SDK integrations have run
|
|
24
|
+
* and applied their own global event processor. An example is:
|
|
25
|
+
* https://github.com/getsentry/sentry-javascript/blob/b47ceafbdac7f8b99093ce6023726ad4687edc48/packages/browser/src/integrations/useragent.ts
|
|
26
|
+
*
|
|
27
|
+
* So we call `replay.setup` in next event loop as a workaround to wait for other
|
|
28
|
+
* global event processors to finish. This is no longer needed, but keeping it
|
|
29
|
+
* here to avoid any future issues.
|
|
30
|
+
*/
|
|
31
|
+
setupOnce(): void;
|
|
32
|
+
/**
|
|
33
|
+
* Initializes the plugin.
|
|
34
|
+
*
|
|
35
|
+
* Creates or loads a session, attaches listeners to varying events (DOM,
|
|
36
|
+
* PerformanceObserver, Recording, Sentry SDK, etc)
|
|
37
|
+
*/
|
|
38
|
+
start(): void;
|
|
39
|
+
/**
|
|
40
|
+
* Currently, this needs to be manually called (e.g. for tests). Sentry SDK
|
|
41
|
+
* does not support a teardown
|
|
42
|
+
*/
|
|
43
|
+
stop(): void;
|
|
44
|
+
private _setup;
|
|
45
|
+
/** Parse Replay-related options from SDK options */
|
|
46
|
+
private _loadReplayOptionsFromClient;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=integration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../../src/integration.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAI5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAO1F,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,SAAS,KAAK,cAAc,IAAI,OAAO,CAEtC;IAED,SAAS,KAAK,cAAc,CAAC,KAAK,EAAE,OAAO,EAE1C;IAED,OAAO,CAAC,OAAO,CAAC,CAAkB;gBAEtB,EACV,aAAoB,EACpB,aAAqB,EACrB,iBAAwB,EACxB,aAAoB,EACpB,cAAqB,EACrB,iBAAiB,EACjB,eAAe,EACf,WAAkB,EAClB,aAAoB,EACpB,aAAoB,EACpB,YAAiB,EACjB,UAA2B,EAC3B,WAA6B,EAC7B,aAA6B,EAC7B,aAAqC,EACrC,GAAG,gBAAgB,EACpB,GAAE,mBAAwB;IAqE3B;;;;;;;;;OASG;IACH,SAAS,IAAI,IAAI;IAWjB;;;;;OAKG;IACH,KAAK,IAAI,IAAI;IAQb;;;OAGG;IACH,IAAI,IAAI,IAAI;IAQZ,OAAO,CAAC,MAAM;IAUd,oDAAoD;IACpD,OAAO,CAAC,4BAA4B;CAYrC"}
|
package/types/replay.d.ts
CHANGED
|
@@ -1,26 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { ReplayPerformanceEntry } from './createPerformanceEntry';
|
|
5
|
-
import { EventBuffer } from './eventBuffer';
|
|
6
|
-
import { Session } from './session/Session';
|
|
7
|
-
import type { AllPerformanceEntry, InstrumentationTypeBreadcrumb, InstrumentationTypeSpan, PopEventContext, RecordingEvent, RecordingOptions, ReplayPluginOptions, SendReplay } from './types';
|
|
8
|
-
/**
|
|
9
|
-
* Returns true to return control to calling function, otherwise continue with normal batching
|
|
10
|
-
*/
|
|
11
|
-
declare type AddUpdateCallback = () => boolean | void;
|
|
12
|
-
export declare class ReplayContainer {
|
|
1
|
+
import { Breadcrumb } from '@sentry/types';
|
|
2
|
+
import type { AddUpdateCallback, AllPerformanceEntry, EventBuffer, InstrumentationTypeBreadcrumb, InternalEventContext, PopEventContext, RecordingEvent, RecordingOptions, ReplayContainer as ReplayContainerInterface, ReplayPluginOptions, ReplayRecordingMode, SendReplay, Session } from './types';
|
|
3
|
+
export declare class ReplayContainer implements ReplayContainerInterface {
|
|
13
4
|
eventBuffer: EventBuffer | null;
|
|
14
5
|
/**
|
|
15
6
|
* List of PerformanceEntry from PerformanceObserver
|
|
16
7
|
*/
|
|
17
8
|
performanceEvents: AllPerformanceEntry[];
|
|
18
9
|
session: Session | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* Recording can happen in one of two modes:
|
|
12
|
+
* * session: Record the whole session, sending it continuously
|
|
13
|
+
* * error: Always keep the last 60s of recording, and when an error occurs, send it immediately
|
|
14
|
+
*/
|
|
15
|
+
recordingMode: ReplayRecordingMode;
|
|
19
16
|
/**
|
|
20
17
|
* Options to pass to `rrweb.record()`
|
|
21
18
|
*/
|
|
22
|
-
readonly
|
|
23
|
-
readonly
|
|
19
|
+
private readonly _recordingOptions;
|
|
20
|
+
private readonly _options;
|
|
24
21
|
private _performanceObserver;
|
|
25
22
|
private _retryCount;
|
|
26
23
|
private _retryInterval;
|
|
@@ -40,11 +37,6 @@ export declare class ReplayContainer {
|
|
|
40
37
|
* - Nothing will be added to event buffer (e.g. core SDK events)
|
|
41
38
|
*/
|
|
42
39
|
private _isPaused;
|
|
43
|
-
/**
|
|
44
|
-
* Integration will wait until an error occurs before creating and sending a
|
|
45
|
-
* replay.
|
|
46
|
-
*/
|
|
47
|
-
private _waitForError;
|
|
48
40
|
/**
|
|
49
41
|
* Have we attached listeners to the core SDK?
|
|
50
42
|
* Note we have to track this as there is no way to remove instrumentation handlers.
|
|
@@ -54,15 +46,19 @@ export declare class ReplayContainer {
|
|
|
54
46
|
* Function to stop recording
|
|
55
47
|
*/
|
|
56
48
|
private _stopRecording;
|
|
57
|
-
/**
|
|
58
|
-
* We overwrite `client.recordDroppedEvent`, but store the original method here so we can restore it.
|
|
59
|
-
*/
|
|
60
|
-
private _originalRecordDroppedEvent?;
|
|
61
49
|
private _context;
|
|
62
50
|
constructor({ options, recordingOptions }: {
|
|
63
51
|
options: ReplayPluginOptions;
|
|
64
52
|
recordingOptions: RecordingOptions;
|
|
65
53
|
});
|
|
54
|
+
/** Get the event context. */
|
|
55
|
+
getContext(): InternalEventContext;
|
|
56
|
+
/** If recording is currently enabled. */
|
|
57
|
+
isEnabled(): boolean;
|
|
58
|
+
/** If recording is currently paused. */
|
|
59
|
+
isPaused(): boolean;
|
|
60
|
+
/** Get the replay integration options. */
|
|
61
|
+
getOptions(): ReplayPluginOptions;
|
|
66
62
|
/**
|
|
67
63
|
* Initializes the plugin.
|
|
68
64
|
*
|
|
@@ -76,6 +72,11 @@ export declare class ReplayContainer {
|
|
|
76
72
|
* Note that this will cause a new DOM checkout
|
|
77
73
|
*/
|
|
78
74
|
startRecording(): void;
|
|
75
|
+
/**
|
|
76
|
+
* Stops the recording, if it was running.
|
|
77
|
+
* Returns true if it was stopped, else false.
|
|
78
|
+
*/
|
|
79
|
+
stopRecording(): boolean;
|
|
79
80
|
/**
|
|
80
81
|
* Currently, this needs to be manually called (e.g. for tests). Sentry SDK
|
|
81
82
|
* does not support a teardown
|
|
@@ -94,6 +95,8 @@ export declare class ReplayContainer {
|
|
|
94
95
|
* new DOM checkout.`
|
|
95
96
|
*/
|
|
96
97
|
resume(): void;
|
|
98
|
+
/** A wrapper to conditionally capture exceptions. */
|
|
99
|
+
handleException(error: unknown): void;
|
|
97
100
|
/** for tests only */
|
|
98
101
|
clearSession(): void;
|
|
99
102
|
/**
|
|
@@ -125,13 +128,7 @@ export declare class ReplayContainer {
|
|
|
125
128
|
* Accepts a callback to perform side-effects and returns true to stop batch
|
|
126
129
|
* processing and hand back control to caller.
|
|
127
130
|
*/
|
|
128
|
-
addUpdate(cb
|
|
129
|
-
/**
|
|
130
|
-
* Core Sentry SDK global event handler. Attaches `replayId` to all [non-replay]
|
|
131
|
-
* events as a tag. Also handles the case where we only want to capture a reply
|
|
132
|
-
* when an error occurs.
|
|
133
|
-
**/
|
|
134
|
-
handleGlobalEvent: (event: Event) => Event;
|
|
131
|
+
addUpdate(cb: AddUpdateCallback): void;
|
|
135
132
|
/**
|
|
136
133
|
* Handler for recording events.
|
|
137
134
|
*
|
|
@@ -153,22 +150,12 @@ export declare class ReplayContainer {
|
|
|
153
150
|
* Handle when page is focused
|
|
154
151
|
*/
|
|
155
152
|
handleWindowFocus: () => void;
|
|
156
|
-
/**
|
|
157
|
-
* Handler for Sentry Core SDK events.
|
|
158
|
-
*
|
|
159
|
-
* These specific events will create span-like objects in the recording.
|
|
160
|
-
*/
|
|
161
|
-
handleCoreSpanListener: (type: InstrumentationTypeSpan) => (handlerData: unknown) => void;
|
|
162
153
|
/**
|
|
163
154
|
* Handler for Sentry Core SDK events.
|
|
164
155
|
*
|
|
165
156
|
* These events will create breadcrumb-like objects in the recording.
|
|
166
157
|
*/
|
|
167
158
|
handleCoreBreadcrumbListener: (type: InstrumentationTypeBreadcrumb) => (handlerData: unknown) => void;
|
|
168
|
-
/**
|
|
169
|
-
* Keep a list of performance entries that will be sent with a replay
|
|
170
|
-
*/
|
|
171
|
-
handle_performanceObserver: (list: PerformanceObserverEntryList) => void;
|
|
172
159
|
/**
|
|
173
160
|
* Tasks to run when we consider a page to be hidden (via blurring and/or visibility)
|
|
174
161
|
*/
|
|
@@ -182,10 +169,6 @@ export declare class ReplayContainer {
|
|
|
182
169
|
* create a new Replay event.
|
|
183
170
|
*/
|
|
184
171
|
triggerFullSnapshot(): void;
|
|
185
|
-
/**
|
|
186
|
-
* Add an event to the event buffer
|
|
187
|
-
*/
|
|
188
|
-
addEvent(event: RecordingEvent, isCheckout?: boolean): void;
|
|
189
172
|
/**
|
|
190
173
|
* Update user activity (across session lifespans)
|
|
191
174
|
*/
|
|
@@ -204,20 +187,11 @@ export declare class ReplayContainer {
|
|
|
204
187
|
* Helper to create (and buffer) a replay breadcrumb from a core SDK breadcrumb
|
|
205
188
|
*/
|
|
206
189
|
createCustomBreadcrumb(breadcrumb: Breadcrumb): void;
|
|
207
|
-
/**
|
|
208
|
-
* Create a "span" for each performance entry. The parent transaction is `this.replayEvent`.
|
|
209
|
-
*/
|
|
210
|
-
createPerformanceSpans(entries: ReplayPerformanceEntry[]): Promise<void[]>;
|
|
211
190
|
/**
|
|
212
191
|
* Observed performance events are added to `this.performanceEvents`. These
|
|
213
192
|
* are included in the replay event before it is finished and sent to Sentry.
|
|
214
193
|
*/
|
|
215
|
-
addPerformanceEntries():
|
|
216
|
-
/**
|
|
217
|
-
* Create a "span" for the total amount of memory being used by JS objects
|
|
218
|
-
* (including v8 internal objects).
|
|
219
|
-
*/
|
|
220
|
-
addMemoryEntry(): Promise<void[]> | undefined;
|
|
194
|
+
addPerformanceEntries(): void;
|
|
221
195
|
/**
|
|
222
196
|
* Checks if recording should be stopped due to user inactivity. Otherwise
|
|
223
197
|
* check if session is expired and create a new session if so. Triggers a new
|
|
@@ -229,7 +203,7 @@ export declare class ReplayContainer {
|
|
|
229
203
|
expiry?: number;
|
|
230
204
|
}): boolean | void;
|
|
231
205
|
/**
|
|
232
|
-
* Only flush if `this.
|
|
206
|
+
* Only flush if `this.recordingMode === 'session'`
|
|
233
207
|
*/
|
|
234
208
|
conditionalFlush(): void;
|
|
235
209
|
/**
|
|
@@ -264,7 +238,7 @@ export declare class ReplayContainer {
|
|
|
264
238
|
/**
|
|
265
239
|
* Send replay attachment using `fetch()`
|
|
266
240
|
*/
|
|
267
|
-
sendReplayRequest({ events, replayId
|
|
241
|
+
sendReplayRequest({ events, replayId, segmentId: segment_id, includeReplayStartTimestamp, eventContext, }: SendReplay): Promise<void | undefined>;
|
|
268
242
|
resetRetries(): void;
|
|
269
243
|
/**
|
|
270
244
|
* Finalize and send the current replay event to Sentry
|
|
@@ -272,8 +246,5 @@ export declare class ReplayContainer {
|
|
|
272
246
|
sendReplay({ replayId, events, segmentId, includeReplayStartTimestamp, eventContext, }: SendReplay): Promise<unknown>;
|
|
273
247
|
/** Save the session, if it is sticky */
|
|
274
248
|
private _maybeSaveSession;
|
|
275
|
-
private _overwriteRecordDroppedEvent;
|
|
276
|
-
private _restoreRecordDroppedEvent;
|
|
277
249
|
}
|
|
278
|
-
export {};
|
|
279
250
|
//# sourceMappingURL=replay.d.ts.map
|
package/types/replay.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replay.d.ts","sourceRoot":"","sources":["../../../src/replay.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"replay.d.ts","sourceRoot":"","sources":["../../../src/replay.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAS,MAAM,eAAe,CAAC;AAwBlD,OAAO,KAAK,EACV,iBAAiB,EACjB,mBAAmB,EACnB,WAAW,EAC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ItE;;OAEG;IACH,qBAAqB,CAAC,aAAa,GAAE,MAA6B,GAAG,IAAI;IAOzE;;;;OAIG;IACH,mBAAmB,IAAI,IAAI;IAqB3B;;OAEG;IACH,sBAAsB,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI;IAapD;;;OAGG;IACH,qBAAqB,IAAI,IAAI;IAQ7B;;;;;;OAMG;IACH,4BAA4B,CAAC,EAAE,MAA8B,EAAE,GAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,OAAO,GAAG,IAAI;IA8B1G;;OAEG;IACH,gBAAgB,IAAI,IAAI;IAQxB;;OAEG;IACH,YAAY,IAAI,IAAI;IAQpB;;OAEG;IACH,eAAe,IAAI,eAAe;IAkBlC;;;;;;;OAOG;IACG,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAuC/B;;;OAGG;IACH,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CA2CxB;IAEF;;;;;OAKG;IACH,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAM/B;;OAEG;IACG,iBAAiB,CAAC,EACtB,MAAM,EACN,QAAQ,EACR,SAAS,EAAE,UAAU,EACrB,2BAA2B,EAC3B,YAAY,GACb,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,GAAG,SAAS,CAAC;IAuFzC,YAAY,IAAI,IAAI;IAKpB;;OAEG;IACG,UAAU,CAAC,EACf,QAAQ,EACR,MAAM,EACN,SAAS,EACT,2BAA2B,EAC3B,YAAY,GACb,EAAE,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC;IAoDhC,wCAAwC;IACxC,OAAO,CAAC,iBAAiB;CAK1B"}
|
|
@@ -1,28 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export interface Session {
|
|
3
|
-
id: string;
|
|
4
|
-
/**
|
|
5
|
-
* Start time of current session
|
|
6
|
-
*/
|
|
7
|
-
started: number;
|
|
8
|
-
/**
|
|
9
|
-
* Last known activity of the session
|
|
10
|
-
*/
|
|
11
|
-
lastActivity: number;
|
|
12
|
-
/**
|
|
13
|
-
* Segment ID for replay events
|
|
14
|
-
*/
|
|
15
|
-
segmentId: number;
|
|
16
|
-
/**
|
|
17
|
-
* The ID of the previous session.
|
|
18
|
-
* If this is empty, there was no previous session.
|
|
19
|
-
*/
|
|
20
|
-
previousSessionId?: string;
|
|
21
|
-
/**
|
|
22
|
-
* Is the session sampled? `false` if not sampled, otherwise, `session` or `error`
|
|
23
|
-
*/
|
|
24
|
-
sampled: Sampled;
|
|
25
|
-
}
|
|
1
|
+
import type { Sampled, Session } from '../types';
|
|
26
2
|
/**
|
|
27
3
|
* Get a session with defaults & applied sampling.
|
|
28
4
|
*/
|
|
@@ -33,5 +9,4 @@ export declare function makeSession(session: Partial<Session> & {
|
|
|
33
9
|
* Get the sampled status for a session based on sample rates & current sampled status.
|
|
34
10
|
*/
|
|
35
11
|
export declare function getSessionSampleType(sessionSampleRate: number, errorSampleRate: number): Sampled;
|
|
36
|
-
export {};
|
|
37
12
|
//# sourceMappingURL=Session.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Session.d.ts","sourceRoot":"","sources":["../../../../src/session/Session.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Session.d.ts","sourceRoot":"","sources":["../../../../src/session/Session.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAGjD;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAgBrF;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,iBAAiB,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,OAAO,CAEhG"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { SessionOptions } from '../types';
|
|
2
|
-
import { Session } from './Session';
|
|
1
|
+
import type { Session, SessionOptions } from '../types';
|
|
3
2
|
/**
|
|
4
3
|
* Create a new session, which in its current implementation is a Sentry event
|
|
5
4
|
* that all replays will be saved to as attachments. Currently, we only expect
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createSession.d.ts","sourceRoot":"","sources":["../../../../src/session/createSession.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"createSession.d.ts","sourceRoot":"","sources":["../../../../src/session/createSession.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAIxD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAAE,iBAAiB,EAAE,eAAe,EAAE,aAAqB,EAAE,EAAE,cAAc,GAAG,OAAO,CAapH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchSession.d.ts","sourceRoot":"","sources":["../../../../src/session/fetchSession.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"fetchSession.d.ts","sourceRoot":"","sources":["../../../../src/session/fetchSession.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAGxC;;GAEG;AACH,wBAAgB,YAAY,IAAI,OAAO,GAAG,IAAI,CAqB7C"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { SessionOptions } from '../types';
|
|
2
|
-
import { Session } from './Session';
|
|
1
|
+
import type { Session, SessionOptions } from '../types';
|
|
3
2
|
interface GetSessionParams extends SessionOptions {
|
|
4
3
|
/**
|
|
5
4
|
* The length of time (in ms) which we will consider the session to be expired.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSession.d.ts","sourceRoot":"","sources":["../../../../src/session/getSession.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"getSession.d.ts","sourceRoot":"","sources":["../../../../src/session/getSession.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAKxD,UAAU,gBAAiB,SAAQ,cAAc;IAC/C;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,EACzB,MAAM,EACN,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,eAAe,GAChB,EAAE,gBAAgB,GAAG;IAAE,IAAI,EAAE,KAAK,GAAG,OAAO,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAyBhE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"saveSession.d.ts","sourceRoot":"","sources":["../../../../src/session/saveSession.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"saveSession.d.ts","sourceRoot":"","sources":["../../../../src/session/saveSession.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAExC,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAWlD"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
declare type blockClass = string | RegExp;
|
|
2
|
+
declare type maskTextClass = string | RegExp;
|
|
3
|
+
declare enum EventType {
|
|
4
|
+
DomContentLoaded = 0,
|
|
5
|
+
Load = 1,
|
|
6
|
+
FullSnapshot = 2,
|
|
7
|
+
IncrementalSnapshot = 3,
|
|
8
|
+
Meta = 4,
|
|
9
|
+
Custom = 5,
|
|
10
|
+
Plugin = 6
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* This is a partial copy of rrweb's eventWithTime type which only contains the properties
|
|
14
|
+
* we specifcally need in the SDK.
|
|
15
|
+
*/
|
|
16
|
+
export declare type eventWithTime = {
|
|
17
|
+
type: EventType;
|
|
18
|
+
data: unknown;
|
|
19
|
+
timestamp: number;
|
|
20
|
+
delay?: number;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* This is a partial copy of rrweb's recording options which only contains the properties
|
|
24
|
+
* we specifically us in the SDK. Users can specify additional properties, hence we add the
|
|
25
|
+
* Record<string, unknown> union type.
|
|
26
|
+
*/
|
|
27
|
+
export declare type recordOptions = {
|
|
28
|
+
maskAllInputs?: boolean;
|
|
29
|
+
blockClass?: blockClass;
|
|
30
|
+
ignoreClass?: string;
|
|
31
|
+
maskTextClass?: maskTextClass;
|
|
32
|
+
blockSelector?: string;
|
|
33
|
+
} & Record<string, unknown>;
|
|
34
|
+
export {};
|
|
35
|
+
//# sourceMappingURL=rrweb.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rrweb.d.ts","sourceRoot":"","sources":["../../../../src/types/rrweb.ts"],"names":[],"mappings":"AAEA,aAAK,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC;AAClC,aAAK,aAAa,GAAG,MAAM,GAAG,MAAM,CAAC;AAErC,aAAK,SAAS;IACZ,gBAAgB,IAAI;IACpB,IAAI,IAAI;IACR,YAAY,IAAI;IAChB,mBAAmB,IAAI;IACvB,IAAI,IAAI;IACR,MAAM,IAAI;IACV,MAAM,IAAI;CACX;AAED;;;GAGG;AACH,oBAAY,aAAa,GAAG;IAC1B,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;;GAIG;AACH,oBAAY,aAAa,GAAG;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC"}
|
package/types/types.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { eventWithTime, recordOptions } from 'rrweb
|
|
1
|
+
import type { eventWithTime, recordOptions } from './types/rrweb';
|
|
2
2
|
export declare type RecordingEvent = eventWithTime;
|
|
3
|
-
export declare type RecordingOptions = recordOptions
|
|
3
|
+
export declare type RecordingOptions = recordOptions;
|
|
4
4
|
export declare type RecordedEvents = Uint8Array | string;
|
|
5
5
|
export declare type AllPerformanceEntry = PerformancePaintTiming | PerformanceResourceTiming | PerformanceNavigationTiming;
|
|
6
|
+
export declare type ReplayRecordingMode = 'session' | 'error';
|
|
6
7
|
export interface SendReplay {
|
|
7
8
|
events: RecordedEvents;
|
|
8
9
|
replayId: string;
|
|
@@ -11,8 +12,6 @@ export interface SendReplay {
|
|
|
11
12
|
eventContext: PopEventContext;
|
|
12
13
|
}
|
|
13
14
|
export declare type InstrumentationTypeBreadcrumb = 'dom' | 'scope';
|
|
14
|
-
export declare type InstrumentationTypeSpan = 'fetch' | 'xhr' | 'history';
|
|
15
|
-
export declare type InstrumentationType = InstrumentationTypeBreadcrumb | InstrumentationTypeSpan | 'console' | 'error' | 'unhandledrejection';
|
|
16
15
|
/**
|
|
17
16
|
* The request payload to worker
|
|
18
17
|
*/
|
|
@@ -88,6 +87,17 @@ export interface ReplayPluginOptions extends SessionOptions {
|
|
|
88
87
|
* Block all media (e.g. images, svg, video) in recordings.
|
|
89
88
|
*/
|
|
90
89
|
blockAllMedia: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* _experiments allows users to enable experimental or internal features.
|
|
92
|
+
* We don't consider such features as part of the public API and hence we don't guarantee semver for them.
|
|
93
|
+
* Experimental features can be added, changed or removed at any time.
|
|
94
|
+
*
|
|
95
|
+
* Default: undefined
|
|
96
|
+
*/
|
|
97
|
+
_experiments?: Partial<{
|
|
98
|
+
captureExceptions: boolean;
|
|
99
|
+
traceInternals: boolean;
|
|
100
|
+
}>;
|
|
91
101
|
}
|
|
92
102
|
declare type OptionalReplayPluginOptions = Partial<ReplayPluginOptions>;
|
|
93
103
|
export interface ReplayConfiguration extends OptionalReplayPluginOptions, RecordingOptions {
|
|
@@ -133,5 +143,56 @@ export interface InternalEventContext extends CommonEventContext {
|
|
|
133
143
|
*/
|
|
134
144
|
earliestEvent: number | null;
|
|
135
145
|
}
|
|
146
|
+
export declare type Sampled = false | 'session' | 'error';
|
|
147
|
+
export interface Session {
|
|
148
|
+
id: string;
|
|
149
|
+
/**
|
|
150
|
+
* Start time of current session
|
|
151
|
+
*/
|
|
152
|
+
started: number;
|
|
153
|
+
/**
|
|
154
|
+
* Last known activity of the session
|
|
155
|
+
*/
|
|
156
|
+
lastActivity: number;
|
|
157
|
+
/**
|
|
158
|
+
* Segment ID for replay events
|
|
159
|
+
*/
|
|
160
|
+
segmentId: number;
|
|
161
|
+
/**
|
|
162
|
+
* The ID of the previous session.
|
|
163
|
+
* If this is empty, there was no previous session.
|
|
164
|
+
*/
|
|
165
|
+
previousSessionId?: string;
|
|
166
|
+
/**
|
|
167
|
+
* Is the session sampled? `false` if not sampled, otherwise, `session` or `error`
|
|
168
|
+
*/
|
|
169
|
+
sampled: Sampled;
|
|
170
|
+
}
|
|
171
|
+
export interface EventBuffer {
|
|
172
|
+
readonly length: number;
|
|
173
|
+
destroy(): void;
|
|
174
|
+
addEvent(event: RecordingEvent, isCheckout?: boolean): void;
|
|
175
|
+
finish(): Promise<string | Uint8Array>;
|
|
176
|
+
}
|
|
177
|
+
export declare type AddUpdateCallback = () => boolean | void;
|
|
178
|
+
export interface ReplayContainer {
|
|
179
|
+
eventBuffer: EventBuffer | null;
|
|
180
|
+
performanceEvents: AllPerformanceEntry[];
|
|
181
|
+
session: Session | undefined;
|
|
182
|
+
recordingMode: ReplayRecordingMode;
|
|
183
|
+
isEnabled(): boolean;
|
|
184
|
+
isPaused(): boolean;
|
|
185
|
+
getContext(): InternalEventContext;
|
|
186
|
+
start(): void;
|
|
187
|
+
stop(): void;
|
|
188
|
+
pause(): void;
|
|
189
|
+
resume(): void;
|
|
190
|
+
startRecording(): void;
|
|
191
|
+
stopRecording(): boolean;
|
|
192
|
+
flushImmediate(): void;
|
|
193
|
+
triggerUserActivity(): void;
|
|
194
|
+
addUpdate(cb: AddUpdateCallback): void;
|
|
195
|
+
getOptions(): ReplayPluginOptions;
|
|
196
|
+
}
|
|
136
197
|
export {};
|
|
137
198
|
//# sourceMappingURL=types.d.ts.map
|
package/types/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAAA,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,oBAAY,mBAAmB,GAAG,SAAS,GAAG,OAAO,CAAC;AAEtD,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,6BAA6B,GAAG,KAAK,GAAG,OAAO,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC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AAG,IAAI,CAAC;AAErD,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;IAChC,iBAAiB,EAAE,mBAAmB,EAAE,CAAC;IACzC,OAAO,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,aAAa,EAAE,mBAAmB,CAAC;IACnC,SAAS,IAAI,OAAO,CAAC;IACrB,QAAQ,IAAI,OAAO,CAAC;IACpB,UAAU,IAAI,oBAAoB,CAAC;IACnC,KAAK,IAAI,IAAI,CAAC;IACd,IAAI,IAAI,IAAI,CAAC;IACb,KAAK,IAAI,IAAI,CAAC;IACd,MAAM,IAAI,IAAI,CAAC;IACf,cAAc,IAAI,IAAI,CAAC;IACvB,aAAa,IAAI,OAAO,CAAC;IACzB,cAAc,IAAI,IAAI,CAAC;IACvB,mBAAmB,IAAI,IAAI,CAAC;IAC5B,SAAS,CAAC,EAAE,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACvC,UAAU,IAAI,mBAAmB,CAAC;CACnC"}
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ReplayContainer } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Create a "span" for the total amount of memory being used by JS objects
|
|
4
|
+
* (including v8 internal objects).
|
|
5
|
+
*/
|
|
6
|
+
export declare function addMemoryEntry(replay: ReplayContainer): void;
|
|
7
|
+
//# sourceMappingURL=addMemoryEntry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addMemoryEntry.d.ts","sourceRoot":"","sources":["../../../../src/util/addMemoryEntry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAGhD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAU5D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createPayload.d.ts","sourceRoot":"","sources":["../../../../src/util/createPayload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"createPayload.d.ts","sourceRoot":"","sources":["../../../../src/util/createPayload.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,OAAO,GACR,EAAE;IACD,MAAM,EAAE,cAAc,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC,GAAG,MAAM,GAAG,UAAU,CAoBtB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReplayPerformanceEntry } from '../createPerformanceEntry';
|
|
2
|
+
import type { ReplayContainer } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Create a "span" for each performance entry. The parent transaction is `this.replayEvent`.
|
|
5
|
+
*/
|
|
6
|
+
export declare function createPerformanceSpans(replay: ReplayContainer, entries: ReplayPerformanceEntry[]): void;
|
|
7
|
+
//# sourceMappingURL=createPerformanceSpans.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createPerformanceSpans.d.ts","sourceRoot":"","sources":["../../../../src/util/createPerformanceSpans.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAGhD;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,sBAAsB,EAAE,GAAG,IAAI,CAiBvG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createReplayEnvelope.d.ts","sourceRoot":"","sources":["../../../../src/util/createReplayEnvelope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAKhD,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,KAAK,EAClB,mBAAmB,EAAE,MAAM,GAAG,UAAU,GACvC,QAAQ,CAqBV"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Scope } from '@sentry/core';
|
|
2
|
+
import { Client, Event } from '@sentry/types';
|
|
3
|
+
export declare function getReplayEvent({ client, scope, replayId: event_id, event, }: {
|
|
4
|
+
client: Client;
|
|
5
|
+
scope: Scope;
|
|
6
|
+
replayId: string;
|
|
7
|
+
event: Event;
|
|
8
|
+
}): Promise<Event>;
|
|
9
|
+
//# sourceMappingURL=getReplayEvent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getReplayEvent.d.ts","sourceRoot":"","sources":["../../../../src/util/getReplayEvent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAI9C,wBAAsB,cAAc,CAAC,EACnC,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,KAAK,CAAC;CACd,GAAG,OAAO,CAAC,KAAK,CAAC,CAiBjB"}
|