@sentry/replay 0.6.11-0 → 0.6.11

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 (67) hide show
  1. package/dist/index.es.js +13 -16
  2. package/dist/index.js +12 -15
  3. package/dist/index.js.map +1 -1
  4. package/package.json +1 -1
  5. package/dist/config/types/jest.config.d.ts +0 -3
  6. package/dist/config/types/jest.setup.d.ts +0 -32
  7. package/dist/config/types/src/blockAllMedia.test.d.ts +0 -1
  8. package/dist/config/types/src/coreHandlers/getBreadcrumbHandler.d.ts +0 -3
  9. package/dist/config/types/src/coreHandlers/getSpanHandler.d.ts +0 -5
  10. package/dist/config/types/src/coreHandlers/handleDom.d.ts +0 -1
  11. package/dist/config/types/src/coreHandlers/handleFetch.d.ts +0 -19
  12. package/dist/config/types/src/coreHandlers/handleFetch.test.d.ts +0 -1
  13. package/dist/config/types/src/coreHandlers/handleHistory.d.ts +0 -7
  14. package/dist/config/types/src/coreHandlers/handleScope-unit.test.d.ts +0 -1
  15. package/dist/config/types/src/coreHandlers/handleScope.d.ts +0 -2
  16. package/dist/config/types/src/coreHandlers/handleScope.test.d.ts +0 -1
  17. package/dist/config/types/src/coreHandlers/handleXhr.d.ts +0 -21
  18. package/dist/config/types/src/createPerformanceEntry.d.ts +0 -43
  19. package/dist/config/types/src/createPerformanceEntry.test.d.ts +0 -1
  20. package/dist/config/types/src/eventBuffer.d.ts +0 -45
  21. package/dist/config/types/src/eventBuffer.test.d.ts +0 -1
  22. package/dist/config/types/src/flags.d.ts +0 -2
  23. package/dist/config/types/src/flush.test.d.ts +0 -1
  24. package/dist/config/types/src/index-captureOnlyOnError.test.d.ts +0 -1
  25. package/dist/config/types/src/index-noSticky.test.d.ts +0 -1
  26. package/dist/config/types/src/index-sampling.test.d.ts +0 -1
  27. package/dist/config/types/src/index.d.ts +0 -293
  28. package/dist/config/types/src/index.test.d.ts +0 -1
  29. package/dist/config/types/src/multiple-instances.test.d.ts +0 -1
  30. package/dist/config/types/src/session/Session.d.ts +0 -61
  31. package/dist/config/types/src/session/Session.test.d.ts +0 -1
  32. package/dist/config/types/src/session/constants.d.ts +0 -11
  33. package/dist/config/types/src/session/createSession.d.ts +0 -8
  34. package/dist/config/types/src/session/createSession.test.d.ts +0 -1
  35. package/dist/config/types/src/session/deleteSession.d.ts +0 -4
  36. package/dist/config/types/src/session/deleteSession.test.d.ts +0 -1
  37. package/dist/config/types/src/session/fetchSession.d.ts +0 -6
  38. package/dist/config/types/src/session/fetchSession.test.d.ts +0 -1
  39. package/dist/config/types/src/session/getSession.d.ts +0 -20
  40. package/dist/config/types/src/session/getSession.test.d.ts +0 -1
  41. package/dist/config/types/src/session/index.d.ts +0 -1
  42. package/dist/config/types/src/session/saveSession.d.ts +0 -2
  43. package/dist/config/types/src/session/saveSession.test.d.ts +0 -1
  44. package/dist/config/types/src/stop.test.d.ts +0 -1
  45. package/dist/config/types/src/types.d.ts +0 -131
  46. package/dist/config/types/src/util/addInternalBreadcrumb.d.ts +0 -5
  47. package/dist/config/types/src/util/captureInternalException.d.ts +0 -4
  48. package/dist/config/types/src/util/createBreadcrumb.d.ts +0 -4
  49. package/dist/config/types/src/util/createPayload.d.ts +0 -5
  50. package/dist/config/types/src/util/dedupePerformanceEntries.d.ts +0 -10
  51. package/dist/config/types/src/util/dedupePerformanceEntries.test.d.ts +0 -1
  52. package/dist/config/types/src/util/isExpired.d.ts +0 -5
  53. package/dist/config/types/src/util/isExpired.test.d.ts +0 -1
  54. package/dist/config/types/src/util/isIngestHost.d.ts +0 -4
  55. package/dist/config/types/src/util/isInternal.d.ts +0 -5
  56. package/dist/config/types/src/util/isSampled.d.ts +0 -7
  57. package/dist/config/types/src/util/isSampled.test.d.ts +0 -1
  58. package/dist/config/types/src/util/isSessionExpired.d.ts +0 -5
  59. package/dist/config/types/src/util/isSessionExpired.test.d.ts +0 -1
  60. package/dist/config/types/src/util/logger.d.ts +0 -12
  61. package/dist/config/types/src/util/supportsSendBeacon.d.ts +0 -4
  62. package/dist/config/types/test/fixtures/performanceEntry/lcp.d.ts +0 -1
  63. package/dist/config/types/test/fixtures/performanceEntry/navigation.d.ts +0 -1
  64. package/dist/config/types/test/fixtures/performanceEntry/resource.d.ts +0 -1
  65. package/dist/config/types/test/index.d.ts +0 -3
  66. package/dist/config/types/test/mocks/mockRrweb.d.ts +0 -15
  67. package/dist/config/types/test/mocks/mockSdk.d.ts +0 -10
@@ -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,2 +0,0 @@
1
- import { Session } from './Session';
2
- export declare function saveSession(session: Session): void;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,131 +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 SendReplayRequest {
7
- endpoint: string;
8
- events: RecordedEvents;
9
- replayId: string;
10
- segmentId: number;
11
- includeReplayStartTimestamp: boolean;
12
- }
13
- 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
- /**
17
- * The request payload to worker
18
- */
19
- export interface WorkerRequest {
20
- id: number;
21
- method: string;
22
- args: any[];
23
- }
24
- declare global {
25
- const __SENTRY_REPLAY_VERSION__: string;
26
- }
27
- /**
28
- * The response from the worker
29
- */
30
- export interface WorkerResponse {
31
- id: number;
32
- method: string;
33
- success: boolean;
34
- response: string | Uint8Array;
35
- }
36
- export interface SampleRates {
37
- /**
38
- * The sample rate for session-long replays. 1.0 will record all sessions and
39
- * 0 will record none.
40
- */
41
- sessionSampleRate: number;
42
- /**
43
- * The sample rate for sessions that has had an error occur. This is
44
- * independent of `sessionSampleRate`.
45
- */
46
- errorSampleRate: number;
47
- }
48
- /**
49
- * Session options that are configurable by the integration configuration
50
- */
51
- export interface SessionOptions extends SampleRates {
52
- /**
53
- * If false, will create a new session per pageload. Otherwise, saves session
54
- * to Session Storage.
55
- */
56
- stickySession: boolean;
57
- }
58
- export interface ReplayPluginOptions extends SessionOptions {
59
- /**
60
- * The amount of time to wait before sending a replay
61
- */
62
- flushMinDelay: number;
63
- /**
64
- * The max amount of time to wait before sending a replay
65
- */
66
- flushMaxDelay: number;
67
- /**
68
- * The amount of time to buffer the initial snapshot
69
- */
70
- initialFlushDelay: number;
71
- /**
72
- * Attempt to use compression when web workers are available
73
- *
74
- * (default is true)
75
- */
76
- useCompression: boolean;
77
- /**
78
- * Only capture replays when an error happens
79
- *
80
- * @deprecated
81
- * @see errorSampleRate
82
- */
83
- captureOnlyOnError?: boolean;
84
- /**
85
- * The sample rate for replays. 1.0 will record all replays, 0 will record none.
86
- *
87
- * @deprecated
88
- * @see sessionSampleRate
89
- */
90
- replaysSamplingRate?: number;
91
- /**
92
- * Mask all text in recordings. All text will be replaced with asterisks by default.
93
- */
94
- maskAllText: boolean;
95
- /**
96
- * Block all media (e.g. images, svg, video) in recordings.
97
- */
98
- blockAllMedia: boolean;
99
- }
100
- declare type OptionalReplayPluginOptions = Partial<ReplayPluginOptions>;
101
- export interface ReplayConfiguration extends OptionalReplayPluginOptions, RecordingOptions {
102
- }
103
- /**
104
- * Some initial state captured before creating a root replay event
105
- */
106
- export interface InitialState {
107
- timestamp: number;
108
- url: string;
109
- }
110
- /**
111
- * Additional context that will be sent w/ `replay_event`
112
- */
113
- export interface ReplayEventContext {
114
- /**
115
- * Set of Sentry error ids that have occurred during a replay segment
116
- */
117
- errorIds: Set<string>;
118
- /**
119
- * Set of Sentry trace ids that have occurred during a replay segment
120
- */
121
- traceIds: Set<string>;
122
- /**
123
- * Ordered list of URLs that have been visited during a replay segment
124
- */
125
- urls: string[];
126
- /**
127
- * The timestamp of the earliest event that has been added to event buffer. This can happen due to the Performance Observer which buffers events.
128
- */
129
- earliestEvent: number | null;
130
- }
131
- export {};
@@ -1,5 +0,0 @@
1
- import { addBreadcrumb } from '@sentry/core';
2
- /**
3
- * Wrapper for core SDK's `addBreadcrumb` only when used on `sentry.io`
4
- */
5
- export declare function addInternalBreadcrumb(arg: Parameters<typeof addBreadcrumb>[0]): void;
@@ -1,4 +0,0 @@
1
- /**
2
- * Captures exceptions to Sentry only when it occurs on sentry.io
3
- */
4
- export declare function captureInternalException(err: Error): void;
@@ -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,5 +0,0 @@
1
- import { RecordedEvents } from '../types';
2
- export declare function createPayload({ events, headers, }: {
3
- events: RecordedEvents;
4
- headers: Record<string, any>;
5
- }): string | Uint8Array;
@@ -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,5 +0,0 @@
1
- /**
2
- * Given an initial timestamp and an expiry duration, checks to see if current
3
- * time should be considered as expired.
4
- */
5
- export declare function isExpired(initialTime: null | number, expiry: undefined | number, targetTime?: number): boolean;
@@ -1 +0,0 @@
1
- export {};
@@ -1,4 +0,0 @@
1
- /**
2
- * Checks is `targetHost` is a Sentry ingestion host
3
- */
4
- export declare function isIngestHost(targetHost: string): boolean;
@@ -1,5 +0,0 @@
1
- /**
2
- * Returns true if we are currently recording an internal to Sentry replay
3
- * (e.g. on https://sentry.io )
4
- */
5
- export declare function isInternal(): boolean;
@@ -1,7 +0,0 @@
1
- /**
2
- * Given a sample rate, returns true if replay should be sampled.
3
- *
4
- * 1.0 = 100% sampling
5
- * 0.0 = 0% sampling
6
- */
7
- export declare function isSampled(sampleRate?: number): boolean;
@@ -1 +0,0 @@
1
- export {};
@@ -1,5 +0,0 @@
1
- import { Session } from '../session/Session';
2
- /**
3
- * Checks to see if session is expired
4
- */
5
- export declare function isSessionExpired(session: Session, idleTimeout: number, targetTime?: number): boolean;
@@ -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 };
@@ -1,4 +0,0 @@
1
- /**
2
- * Determine if there is browser support for `navigator.sendBeacon`
3
- */
4
- export declare function supportsSendBeacon(): boolean;
@@ -1 +0,0 @@
1
- export declare function PerformanceEntryLcp(obj?: Partial<PerformancePaintTiming>): PerformancePaintTiming;
@@ -1 +0,0 @@
1
- export declare function PerformanceEntryNavigation(obj?: Partial<PerformanceNavigationTiming>): PerformanceNavigationTiming;
@@ -1 +0,0 @@
1
- export declare function PerformanceEntryResource(obj?: Partial<PerformanceResourceTiming>): PerformanceResourceTiming;
@@ -1,3 +0,0 @@
1
- export * from './mocks/mockRrweb';
2
- export * from './mocks/mockSdk';
3
- export declare const BASE_TIMESTAMP: number;
@@ -1,15 +0,0 @@
1
- import { jest } from '@jest/globals';
2
- import { RecordingEvent } from '../../src/types';
3
- declare type RecordAdditionalProperties = {
4
- takeFullSnapshot: jest.Mock;
5
- addCustomEvent: () => void;
6
- freezePage: () => void;
7
- mirror: unknown;
8
- _emitter: (event: RecordingEvent, ...args: any[]) => void;
9
- };
10
- export declare type RecordMock = jest.MockedFunction<typeof rrweb.record> & RecordAdditionalProperties;
11
- import * as rrweb from 'rrweb';
12
- export declare function mockRrweb(): {
13
- record: RecordMock;
14
- };
15
- export {};
@@ -1,10 +0,0 @@
1
- import { BrowserOptions } from '@sentry/browser';
2
- import { ReplayConfiguration } from '../../src/types';
3
- interface MockSdkParams {
4
- replayOptions?: ReplayConfiguration;
5
- sentryOptions?: BrowserOptions;
6
- }
7
- export declare function mockSdk({ replayOptions, sentryOptions, }?: MockSdkParams): Promise<{
8
- replay: import("../../src").Replay;
9
- }>;
10
- export {};