@sentry/replay 7.67.0-beta.0 → 7.68.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/cjs/index.js +1112 -2286
  2. package/cjs/index.js.map +1 -1
  3. package/esm/index.js +1112 -2286
  4. package/esm/index.js.map +1 -1
  5. package/package.json +8 -8
  6. package/types/constants.d.ts +2 -3
  7. package/types/constants.d.ts.map +1 -1
  8. package/types/coreHandlers/handleDom.d.ts +2 -1
  9. package/types/coreHandlers/handleDom.d.ts.map +1 -1
  10. package/types/integration.d.ts +1 -1
  11. package/types/integration.d.ts.map +1 -1
  12. package/types/replay.d.ts +1 -7
  13. package/types/replay.d.ts.map +1 -1
  14. package/types/session/Session.d.ts.map +1 -1
  15. package/types/session/loadOrCreateSession.d.ts +4 -4
  16. package/types/session/loadOrCreateSession.d.ts.map +1 -1
  17. package/types/session/maybeRefreshSession.d.ts +12 -0
  18. package/types/session/maybeRefreshSession.d.ts.map +1 -0
  19. package/types/types/replay.d.ts +11 -7
  20. package/types/types/replay.d.ts.map +1 -1
  21. package/types/util/getPrivacyOptions.d.ts +2 -0
  22. package/types/util/getPrivacyOptions.d.ts.map +1 -1
  23. package/types/util/isSessionExpired.d.ts +6 -2
  24. package/types/util/isSessionExpired.d.ts.map +1 -1
  25. package/types-ts3.8/constants.d.ts +25 -0
  26. package/types-ts3.8/coreHandlers/handleAfterSendEvent.d.ts +9 -0
  27. package/types-ts3.8/coreHandlers/handleClick.d.ts +39 -0
  28. package/types-ts3.8/coreHandlers/handleDom.d.ts +13 -0
  29. package/types-ts3.8/coreHandlers/handleFetch.d.ts +9 -0
  30. package/types-ts3.8/coreHandlers/handleGlobalEvent.d.ts +7 -0
  31. package/types-ts3.8/coreHandlers/handleHistory.d.ts +11 -0
  32. package/types-ts3.8/coreHandlers/handleKeyboardEvent.d.ts +7 -0
  33. package/types-ts3.8/coreHandlers/handleNetworkBreadcrumbs.d.ts +17 -0
  34. package/types-ts3.8/coreHandlers/handleScope.d.ts +13 -0
  35. package/types-ts3.8/coreHandlers/handleXhr.d.ts +9 -0
  36. package/types-ts3.8/coreHandlers/performanceObserver.d.ts +6 -0
  37. package/types-ts3.8/coreHandlers/util/addBreadcrumbEvent.d.ts +7 -0
  38. package/types-ts3.8/coreHandlers/util/addNetworkBreadcrumb.d.ts +4 -0
  39. package/types-ts3.8/coreHandlers/util/domUtils.d.ts +19 -0
  40. package/types-ts3.8/coreHandlers/util/fetchUtils.d.ts +23 -0
  41. package/types-ts3.8/coreHandlers/util/getAttributesToRecord.d.ts +5 -0
  42. package/types-ts3.8/coreHandlers/util/networkUtils.d.ts +23 -0
  43. package/types-ts3.8/coreHandlers/util/onWindowOpen.d.ts +8 -0
  44. package/types-ts3.8/coreHandlers/util/shouldSampleForBufferEvent.d.ts +9 -0
  45. package/types-ts3.8/coreHandlers/util/xhrUtils.d.ts +22 -0
  46. package/types-ts3.8/eventBuffer/EventBufferArray.d.ts +28 -0
  47. package/types-ts3.8/eventBuffer/EventBufferCompressionWorker.d.ts +50 -0
  48. package/types-ts3.8/eventBuffer/EventBufferProxy.d.ts +42 -0
  49. package/types-ts3.8/eventBuffer/WorkerHandler.d.ts +27 -0
  50. package/types-ts3.8/eventBuffer/error.d.ts +5 -0
  51. package/types-ts3.8/eventBuffer/index.d.ts +10 -0
  52. package/types-ts3.8/index.d.ts +4 -0
  53. package/types-ts3.8/integration.d.ts +73 -0
  54. package/types-ts3.8/replay.d.ts +308 -0
  55. package/types-ts3.8/session/Session.d.ts +8 -0
  56. package/types-ts3.8/session/clearSession.d.ts +6 -0
  57. package/types-ts3.8/session/createSession.d.ts +14 -0
  58. package/types-ts3.8/session/fetchSession.d.ts +6 -0
  59. package/types-ts3.8/session/index.d.ts +2 -0
  60. package/types-ts3.8/session/loadOrCreateSession.d.ts +11 -0
  61. package/types-ts3.8/session/maybeRefreshSession.d.ts +12 -0
  62. package/types-ts3.8/session/saveSession.d.ts +6 -0
  63. package/types-ts3.8/types/deprecated.d.ts +16 -0
  64. package/types-ts3.8/types/index.d.ts +6 -0
  65. package/types-ts3.8/types/performance.d.ts +124 -0
  66. package/types-ts3.8/types/replay.d.ts +422 -0
  67. package/types-ts3.8/types/replayFrame.d.ts +173 -0
  68. package/types-ts3.8/types/request.d.ts +15 -0
  69. package/types-ts3.8/types/rrweb.d.ts +37 -0
  70. package/types-ts3.8/util/addEvent.d.ts +7 -0
  71. package/types-ts3.8/util/addGlobalListeners.d.ts +6 -0
  72. package/types-ts3.8/util/addMemoryEntry.d.ts +7 -0
  73. package/types-ts3.8/util/createBreadcrumb.d.ts +6 -0
  74. package/types-ts3.8/util/createPerformanceEntries.d.ts +6 -0
  75. package/types-ts3.8/util/createPerformanceSpans.d.ts +6 -0
  76. package/types-ts3.8/util/createReplayEnvelope.d.ts +7 -0
  77. package/types-ts3.8/util/debounce.d.ts +30 -0
  78. package/types-ts3.8/util/dedupePerformanceEntries.d.ts +11 -0
  79. package/types-ts3.8/util/eventUtils.d.ts +8 -0
  80. package/types-ts3.8/util/getPrivacyOptions.d.ts +19 -0
  81. package/types-ts3.8/util/handleRecordingEmit.d.ts +14 -0
  82. package/types-ts3.8/util/hasSessionStorage.d.ts +3 -0
  83. package/types-ts3.8/util/isBrowser.d.ts +5 -0
  84. package/types-ts3.8/util/isExpired.d.ts +6 -0
  85. package/types-ts3.8/util/isRrwebError.d.ts +6 -0
  86. package/types-ts3.8/util/isSampled.d.ts +8 -0
  87. package/types-ts3.8/util/isSessionExpired.d.ts +10 -0
  88. package/types-ts3.8/util/log.d.ts +10 -0
  89. package/types-ts3.8/util/prepareRecordingData.d.ts +9 -0
  90. package/types-ts3.8/util/prepareReplayEvent.d.ts +15 -0
  91. package/types-ts3.8/util/sendReplay.d.ts +9 -0
  92. package/types-ts3.8/util/sendReplayRequest.d.ts +13 -0
  93. package/types-ts3.8/util/shouldFilterRequest.d.ts +7 -0
  94. package/types-ts3.8/util/throttle.d.ts +12 -0
  95. package/types-ts3.8/util/timestamp.d.ts +9 -0
  96. package/types-ts3.8/util/truncateJson/completeJson.d.ts +9 -0
  97. package/types-ts3.8/util/truncateJson/constants.d.ts +12 -0
  98. package/types-ts3.8/util/truncateJson/evaluateJson.d.ts +6 -0
  99. package/types-ts3.8/util/truncateJson/fixJson.d.ts +6 -0
  100. package/types/session/shouldRefreshSession.d.ts +0 -4
  101. package/types/session/shouldRefreshSession.d.ts.map +0 -1
  102. package/types/util/maskAttribute.d.ts +0 -15
  103. package/types/util/maskAttribute.d.ts.map +0 -1
@@ -0,0 +1,173 @@
1
+ import { Breadcrumb } from '@sentry/types';
2
+ import { HistoryData, LargestContentfulPaintData, MemoryData, NavigationData, NetworkRequestData, PaintData, ResourceData } from './performance';
3
+ import { ReplayEventTypeCustom } from './rrweb';
4
+ type AnyRecord = Record<string, any>;
5
+ interface ReplayBaseBreadcrumbFrame {
6
+ timestamp: number;
7
+ /**
8
+ * For compatibility reasons
9
+ */
10
+ type: string;
11
+ category: string;
12
+ data?: AnyRecord;
13
+ message?: string;
14
+ }
15
+ interface ReplayBaseDomFrameData {
16
+ nodeId?: number;
17
+ node?: {
18
+ id: number;
19
+ tagName: string;
20
+ textContent: string;
21
+ attributes: AnyRecord;
22
+ };
23
+ }
24
+ interface ReplayConsoleFrameData {
25
+ logger: string;
26
+ arguments?: unknown[];
27
+ }
28
+ interface ReplayConsoleFrame extends ReplayBaseBreadcrumbFrame {
29
+ category: 'console';
30
+ level: Breadcrumb['level'];
31
+ message: string;
32
+ data: ReplayConsoleFrameData;
33
+ }
34
+ type ReplayClickFrameData = ReplayBaseDomFrameData;
35
+ interface ReplayClickFrame extends ReplayBaseBreadcrumbFrame {
36
+ category: 'ui.click';
37
+ message: string;
38
+ data: ReplayClickFrameData;
39
+ }
40
+ interface ReplayInputFrame extends ReplayBaseBreadcrumbFrame {
41
+ category: 'ui.input';
42
+ message: string;
43
+ }
44
+ interface ReplayMutationFrameData {
45
+ count: number;
46
+ limit: boolean;
47
+ }
48
+ interface ReplayMutationFrame extends ReplayBaseBreadcrumbFrame {
49
+ category: 'replay.mutations';
50
+ data: ReplayMutationFrameData;
51
+ }
52
+ interface ReplayKeyboardEventFrameData extends ReplayBaseDomFrameData {
53
+ metaKey: boolean;
54
+ shiftKey: boolean;
55
+ ctrlKey: boolean;
56
+ altKey: boolean;
57
+ key: string;
58
+ }
59
+ interface ReplayKeyboardEventFrame extends ReplayBaseBreadcrumbFrame {
60
+ category: 'ui.keyDown';
61
+ data: ReplayKeyboardEventFrameData;
62
+ }
63
+ interface ReplayBlurFrame extends ReplayBaseBreadcrumbFrame {
64
+ category: 'ui.blur';
65
+ }
66
+ interface ReplayFocusFrame extends ReplayBaseBreadcrumbFrame {
67
+ category: 'ui.focus';
68
+ }
69
+ interface ReplaySlowClickFrameData extends ReplayClickFrameData {
70
+ url: string;
71
+ route?: string;
72
+ timeAfterClickMs: number;
73
+ endReason: string;
74
+ clickCount?: number;
75
+ }
76
+ export interface ReplaySlowClickFrame extends ReplayBaseBreadcrumbFrame {
77
+ category: 'ui.slowClickDetected';
78
+ data: ReplaySlowClickFrameData;
79
+ }
80
+ interface ReplayMultiClickFrameData extends ReplayClickFrameData {
81
+ url: string;
82
+ route?: string;
83
+ clickCount: number;
84
+ metric: true;
85
+ }
86
+ export interface ReplayMultiClickFrame extends ReplayBaseBreadcrumbFrame {
87
+ category: 'ui.multiClick';
88
+ data: ReplayMultiClickFrameData;
89
+ }
90
+ interface ReplayOptionFrame {
91
+ blockAllMedia: boolean;
92
+ errorSampleRate: number;
93
+ maskAllInputs: boolean;
94
+ maskAllText: boolean;
95
+ networkCaptureBodies: boolean;
96
+ networkDetailHasUrls: boolean;
97
+ networkRequestHasHeaders: boolean;
98
+ networkResponseHasHeaders: boolean;
99
+ sessionSampleRate: number;
100
+ useCompression: boolean;
101
+ useCompressionOption: boolean;
102
+ }
103
+ export type ReplayBreadcrumbFrame = ReplayConsoleFrame | ReplayClickFrame | ReplayInputFrame | ReplayKeyboardEventFrame | ReplayBlurFrame | ReplayFocusFrame | ReplaySlowClickFrame | ReplayMultiClickFrame | ReplayMutationFrame | ReplayBaseBreadcrumbFrame;
104
+ interface ReplayBaseSpanFrame {
105
+ op: string;
106
+ description: string;
107
+ startTimestamp: number;
108
+ endTimestamp: number;
109
+ data?: undefined | AnyRecord;
110
+ }
111
+ interface ReplayHistoryFrame extends ReplayBaseSpanFrame {
112
+ data: HistoryData;
113
+ op: 'navigation.push';
114
+ }
115
+ interface ReplayLargestContentfulPaintFrame extends ReplayBaseSpanFrame {
116
+ data: LargestContentfulPaintData;
117
+ op: 'largest-contentful-paint';
118
+ }
119
+ interface ReplayMemoryFrame extends ReplayBaseSpanFrame {
120
+ data: MemoryData;
121
+ op: 'memory';
122
+ }
123
+ interface ReplayNavigationFrame extends ReplayBaseSpanFrame {
124
+ data: NavigationData;
125
+ op: 'navigation.navigate' | 'navigation.reload' | 'navigation.back_forward';
126
+ }
127
+ interface ReplayPaintFrame extends ReplayBaseSpanFrame {
128
+ data: PaintData;
129
+ op: 'paint';
130
+ }
131
+ interface ReplayRequestFrame extends ReplayBaseSpanFrame {
132
+ data: NetworkRequestData;
133
+ op: 'resource.fetch' | 'resource.xhr';
134
+ }
135
+ interface ReplayResourceFrame extends ReplayBaseSpanFrame {
136
+ data: ResourceData;
137
+ op: 'resource.css' | 'resource.ReplayiFrame' | 'resource.img' | 'resource.link' | 'resource.other' | 'resource.script';
138
+ }
139
+ export type ReplaySpanFrame = ReplayBaseSpanFrame | ReplayHistoryFrame | ReplayRequestFrame | ReplayLargestContentfulPaintFrame | ReplayMemoryFrame | ReplayNavigationFrame | ReplayPaintFrame | ReplayResourceFrame;
140
+ export type ReplayFrame = ReplayBreadcrumbFrame | ReplaySpanFrame;
141
+ interface RecordingCustomEvent {
142
+ type: typeof ReplayEventTypeCustom;
143
+ timestamp: number;
144
+ data: {
145
+ tag: string;
146
+ payload: unknown;
147
+ };
148
+ }
149
+ export interface ReplayBreadcrumbFrameEvent extends RecordingCustomEvent {
150
+ data: {
151
+ tag: 'breadcrumb';
152
+ payload: ReplayBreadcrumbFrame;
153
+ /**
154
+ * This will indicate to backend to additionally log as a metric
155
+ */
156
+ metric?: boolean;
157
+ };
158
+ }
159
+ export interface ReplaySpanFrameEvent extends RecordingCustomEvent {
160
+ data: {
161
+ tag: 'performanceSpan';
162
+ payload: ReplaySpanFrame;
163
+ };
164
+ }
165
+ export interface ReplayOptionFrameEvent extends RecordingCustomEvent {
166
+ data: {
167
+ tag: 'options';
168
+ payload: ReplayOptionFrame;
169
+ };
170
+ }
171
+ export type ReplayFrameEvent = ReplayBreadcrumbFrameEvent | ReplaySpanFrameEvent | ReplayOptionFrameEvent;
172
+ export {};
173
+ //# sourceMappingURL=replayFrame.d.ts.map
@@ -0,0 +1,15 @@
1
+ type JsonObject = Record<string, unknown>;
2
+ type JsonArray = unknown[];
3
+ export type NetworkBody = JsonObject | JsonArray | string;
4
+ export type NetworkMetaWarning = 'JSON_TRUNCATED' | 'TEXT_TRUNCATED' | 'INVALID_JSON' | 'URL_SKIPPED';
5
+ interface NetworkMeta {
6
+ warnings?: NetworkMetaWarning[];
7
+ }
8
+ export interface ReplayNetworkRequestOrResponse {
9
+ size?: number;
10
+ body?: NetworkBody;
11
+ headers: Record<string, string>;
12
+ _meta?: NetworkMeta;
13
+ }
14
+ export {};
15
+ //# sourceMappingURL=request.d.ts.map
@@ -0,0 +1,37 @@
1
+ type ClassOption = string | RegExp;
2
+ /** Duplicate this from @sentry-internal/rrweb so we can export this as well. */
3
+ export declare const ReplayEventTypeDomContentLoaded = 0;
4
+ export declare const ReplayEventTypeLoad = 1;
5
+ export declare const ReplayEventTypeFullSnapshot = 2;
6
+ export declare const ReplayEventTypeIncrementalSnapshot = 3;
7
+ export declare const ReplayEventTypeMeta = 4;
8
+ export declare const ReplayEventTypeCustom = 5;
9
+ export declare const ReplayEventTypePlugin = 6;
10
+ export type ReplayEventType = typeof ReplayEventTypeDomContentLoaded | typeof ReplayEventTypeLoad | typeof ReplayEventTypeFullSnapshot | typeof ReplayEventTypeIncrementalSnapshot | typeof ReplayEventTypeMeta | typeof ReplayEventTypeCustom | typeof ReplayEventTypePlugin;
11
+ /**
12
+ * This is a partial copy of rrweb's eventWithTime type which only contains the properties
13
+ * we specifcally need in the SDK.
14
+ */
15
+ export type ReplayEventWithTime = {
16
+ type: ReplayEventType;
17
+ data: unknown;
18
+ timestamp: number;
19
+ delay?: number;
20
+ };
21
+ /**
22
+ * This is a partial copy of rrweb's recording options which only contains the properties
23
+ * we specifically us in the SDK. Users can specify additional properties, hence we add the
24
+ * Record<string, unknown> union type.
25
+ */
26
+ export type RrwebRecordOptions = {
27
+ maskAllText?: boolean;
28
+ maskAllInputs?: boolean;
29
+ blockClass?: ClassOption;
30
+ ignoreClass?: string;
31
+ maskTextClass?: ClassOption;
32
+ maskTextSelector?: string;
33
+ blockSelector?: string;
34
+ maskInputOptions?: Record<string, boolean>;
35
+ } & Record<string, unknown>;
36
+ export {};
37
+ //# sourceMappingURL=rrweb.d.ts.map
@@ -0,0 +1,7 @@
1
+ import { AddEventResult, RecordingEvent, ReplayContainer } from '../types';
2
+ /**
3
+ * Add an event to the event buffer.
4
+ * `isCheckout` is true if this is either the very first event, or an event triggered by `checkoutEveryNms`.
5
+ */
6
+ export declare function addEvent(replay: ReplayContainer, event: RecordingEvent, isCheckout?: boolean): Promise<AddEventResult | null>;
7
+ //# sourceMappingURL=addEvent.d.ts.map
@@ -0,0 +1,6 @@
1
+ import { ReplayContainer } from '../types';
2
+ /**
3
+ * Add global listeners that cannot be removed.
4
+ */
5
+ export declare function addGlobalListeners(replay: ReplayContainer): void;
6
+ //# sourceMappingURL=addGlobalListeners.d.ts.map
@@ -0,0 +1,7 @@
1
+ import { AddEventResult, 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): Promise<Array<AddEventResult | null>>;
7
+ //# sourceMappingURL=addMemoryEntry.d.ts.map
@@ -0,0 +1,6 @@
1
+ import { ReplayBreadcrumbFrame } from '../types/replayFrame';
2
+ /**
3
+ * Create a breadcrumb for a replay.
4
+ */
5
+ export declare function createBreadcrumb(breadcrumb: Pick<ReplayBreadcrumbFrame, Exclude<keyof ReplayBreadcrumbFrame, 'timestamp' | 'type'>> & Partial<Pick<ReplayBreadcrumbFrame, 'timestamp'>>): ReplayBreadcrumbFrame;
6
+ //# sourceMappingURL=createBreadcrumb.d.ts.map
@@ -0,0 +1,6 @@
1
+ import { AllPerformanceEntry, AllPerformanceEntryData, ReplayPerformanceEntry } from '../types';
2
+ /**
3
+ * Create replay performance entries from the browser performance entries.
4
+ */
5
+ export declare function createPerformanceEntries(entries: AllPerformanceEntry[]): ReplayPerformanceEntry<AllPerformanceEntryData>[];
6
+ //# sourceMappingURL=createPerformanceEntries.d.ts.map
@@ -0,0 +1,6 @@
1
+ import { AddEventResult, AllEntryData, ReplayContainer, ReplayPerformanceEntry } from '../types';
2
+ /**
3
+ * Create a "span" for each performance entry.
4
+ */
5
+ export declare function createPerformanceSpans(replay: ReplayContainer, entries: ReplayPerformanceEntry<AllEntryData>[]): Promise<AddEventResult | null>[];
6
+ //# sourceMappingURL=createPerformanceSpans.d.ts.map
@@ -0,0 +1,7 @@
1
+ import { DsnComponents, ReplayEnvelope, ReplayEvent, ReplayRecordingData } from '@sentry/types';
2
+ /**
3
+ * Create a replay envelope ready to be sent.
4
+ * This includes both the replay event, as well as the recording data.
5
+ */
6
+ export declare function createReplayEnvelope(replayEvent: ReplayEvent, recordingData: ReplayRecordingData, dsn: DsnComponents, tunnel?: string): ReplayEnvelope;
7
+ //# sourceMappingURL=createReplayEnvelope.d.ts.map
@@ -0,0 +1,30 @@
1
+ type DebouncedCallback = {
2
+ (): void | unknown;
3
+ flush: () => void | unknown;
4
+ cancel: () => void;
5
+ };
6
+ type CallbackFunction = () => unknown;
7
+ type DebounceOptions = {
8
+ maxWait?: number;
9
+ };
10
+ /**
11
+ * Heavily simplified debounce function based on lodash.debounce.
12
+ *
13
+ * This function takes a callback function (@param fun) and delays its invocation
14
+ * by @param wait milliseconds. Optionally, a maxWait can be specified in @param options,
15
+ * which ensures that the callback is invoked at least once after the specified max. wait time.
16
+ *
17
+ * @param func the function whose invocation is to be debounced
18
+ * @param wait the minimum time until the function is invoked after it was called once
19
+ * @param options the options object, which can contain the `maxWait` property
20
+ *
21
+ * @returns the debounced version of the function, which needs to be called at least once to start the
22
+ * debouncing process. Subsequent calls will reset the debouncing timer and, in case @paramfunc
23
+ * was already invoked in the meantime, return @param func's return value.
24
+ * The debounced function has two additional properties:
25
+ * - `flush`: Invokes the debounced function immediately and returns its return value
26
+ * - `cancel`: Cancels the debouncing process and resets the debouncing timer
27
+ */
28
+ export declare function debounce(func: CallbackFunction, wait: number, options?: DebounceOptions): DebouncedCallback;
29
+ export {};
30
+ //# sourceMappingURL=debounce.d.ts.map
@@ -0,0 +1,11 @@
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): PerformanceEntryList;
11
+ //# sourceMappingURL=dedupePerformanceEntries.d.ts.map
@@ -0,0 +1,8 @@
1
+ import { ErrorEvent, Event, ReplayEvent, TransactionEvent } from '@sentry/types';
2
+ /** If the event is an error event */
3
+ export declare function isErrorEvent(event: Event): event is ErrorEvent;
4
+ /** If the event is a transaction event */
5
+ export declare function isTransactionEvent(event: Event): event is TransactionEvent;
6
+ /** If the event is an replay event */
7
+ export declare function isReplayEvent(event: Event): event is ReplayEvent;
8
+ //# sourceMappingURL=eventUtils.d.ts.map
@@ -0,0 +1,19 @@
1
+ import { DeprecatedPrivacyOptions, ReplayIntegrationPrivacyOptions } from '../types';
2
+ type GetPrivacyOptions = Required<Pick<ReplayIntegrationPrivacyOptions, Exclude<keyof ReplayIntegrationPrivacyOptions, 'maskFn'>>> & Pick<DeprecatedPrivacyOptions, Exclude<keyof DeprecatedPrivacyOptions, 'maskInputOptions'>>;
3
+ interface GetPrivacyReturn {
4
+ maskTextSelector: string;
5
+ unmaskTextSelector: string;
6
+ maskInputSelector: string;
7
+ unmaskInputSelector: string;
8
+ blockSelector: string;
9
+ unblockSelector: string;
10
+ ignoreSelector: string;
11
+ blockClass?: RegExp;
12
+ maskTextClass?: RegExp;
13
+ }
14
+ /**
15
+ * Returns privacy related configuration for use in rrweb
16
+ */
17
+ export declare function getPrivacyOptions({ mask, unmask, block, unblock, ignore, blockClass, blockSelector, maskTextClass, maskTextSelector, ignoreClass, }: GetPrivacyOptions): GetPrivacyReturn;
18
+ export {};
19
+ //# sourceMappingURL=getPrivacyOptions.d.ts.map
@@ -0,0 +1,14 @@
1
+ import { RecordingEvent, ReplayContainer, ReplayOptionFrameEvent } from '../types';
2
+ type RecordingEmitCallback = (event: RecordingEvent, isCheckout?: boolean) => void;
3
+ /**
4
+ * Handler for recording events.
5
+ *
6
+ * Adds to event buffer, and has varying flushing behaviors if the event was a checkout.
7
+ */
8
+ export declare function getHandleRecordingEmit(replay: ReplayContainer): RecordingEmitCallback;
9
+ /**
10
+ * Exported for tests
11
+ */
12
+ export declare function createOptionsEvent(replay: ReplayContainer): ReplayOptionFrameEvent;
13
+ export {};
14
+ //# sourceMappingURL=handleRecordingEmit.d.ts.map
@@ -0,0 +1,3 @@
1
+ /** If sessionStorage is available. */
2
+ export declare function hasSessionStorage(): boolean;
3
+ //# sourceMappingURL=hasSessionStorage.d.ts.map
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Returns true if we are in the browser.
3
+ */
4
+ export declare function isBrowser(): boolean;
5
+ //# sourceMappingURL=isBrowser.d.ts.map
@@ -0,0 +1,6 @@
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;
6
+ //# sourceMappingURL=isExpired.d.ts.map
@@ -0,0 +1,6 @@
1
+ import { Event, EventHint } from '@sentry/types';
2
+ /**
3
+ * Returns true if we think the given event is an error originating inside of rrweb.
4
+ */
5
+ export declare function isRrwebError(event: Event, hint: EventHint): boolean;
6
+ //# sourceMappingURL=isRrwebError.d.ts.map
@@ -0,0 +1,8 @@
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;
8
+ //# sourceMappingURL=isSampled.d.ts.map
@@ -0,0 +1,10 @@
1
+ import { Session } from '../types';
2
+ /**
3
+ * Checks to see if session is expired
4
+ */
5
+ export declare function isSessionExpired(session: Session, { maxReplayDuration, sessionIdleExpire, targetTime, }: {
6
+ maxReplayDuration: number;
7
+ sessionIdleExpire: number;
8
+ targetTime?: number;
9
+ }): boolean;
10
+ //# sourceMappingURL=isSessionExpired.d.ts.map
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Log a message in debug mode, and add a breadcrumb when _experiment.traceInternals is enabled.
3
+ */
4
+ export declare function logInfo(message: string, shouldAddBreadcrumb?: boolean): void;
5
+ /**
6
+ * Log a message, and add a breadcrumb in the next tick.
7
+ * This is necessary when the breadcrumb may be added before the replay is initialized.
8
+ */
9
+ export declare function logInfoNextTick(message: string, shouldAddBreadcrumb?: boolean): void;
10
+ //# sourceMappingURL=log.d.ts.map
@@ -0,0 +1,9 @@
1
+ import { ReplayRecordingData } from '@sentry/types';
2
+ /**
3
+ * Prepare the recording data ready to be sent.
4
+ */
5
+ export declare function prepareRecordingData({ recordingData, headers, }: {
6
+ recordingData: ReplayRecordingData;
7
+ headers: Record<string, unknown>;
8
+ }): ReplayRecordingData;
9
+ //# sourceMappingURL=prepareRecordingData.d.ts.map
@@ -0,0 +1,15 @@
1
+ import { Scope } from '@sentry/core';
2
+ import { IntegrationIndex } from '@sentry/core/build/types/integration';
3
+ import { Client, ReplayEvent } from '@sentry/types';
4
+ /**
5
+ * Prepare a replay event & enrich it with the SDK metadata.
6
+ */
7
+ export declare function prepareReplayEvent({ client, scope, replayId: event_id, event, }: {
8
+ client: Client & {
9
+ _integrations?: IntegrationIndex;
10
+ };
11
+ scope: Scope;
12
+ replayId: string;
13
+ event: ReplayEvent;
14
+ }): Promise<ReplayEvent | null>;
15
+ //# sourceMappingURL=prepareReplayEvent.d.ts.map
@@ -0,0 +1,9 @@
1
+ import { SendReplayData } from '../types';
2
+ /**
3
+ * Finalize and send the current replay event to Sentry
4
+ */
5
+ export declare function sendReplay(replayData: SendReplayData, retryConfig?: {
6
+ count: number;
7
+ interval: number;
8
+ }): Promise<unknown>;
9
+ //# sourceMappingURL=sendReplay.d.ts.map
@@ -0,0 +1,13 @@
1
+ import { TransportMakeRequestResponse } from '@sentry/types';
2
+ import { SendReplayData } from '../types';
3
+ /**
4
+ * Send replay attachment using `fetch()`
5
+ */
6
+ export declare function sendReplayRequest({ recordingData, replayId, segmentId: segment_id, eventContext, timestamp, session, }: SendReplayData): Promise<void | TransportMakeRequestResponse>;
7
+ /**
8
+ * This error indicates that the transport returned an invalid status code.
9
+ */
10
+ export declare class TransportStatusCodeError extends Error {
11
+ constructor(statusCode: number);
12
+ }
13
+ //# sourceMappingURL=sendReplayRequest.d.ts.map
@@ -0,0 +1,7 @@
1
+ import { ReplayContainer } from '../types';
2
+ /**
3
+ * Check whether a given request URL should be filtered out. This is so we
4
+ * don't log Sentry ingest requests.
5
+ */
6
+ export declare function shouldFilterRequest(replay: ReplayContainer, url: string): boolean;
7
+ //# sourceMappingURL=shouldFilterRequest.d.ts.map
@@ -0,0 +1,12 @@
1
+ export declare const THROTTLED = "__THROTTLED";
2
+ export declare const SKIPPED = "__SKIPPED";
3
+ /**
4
+ * Create a throttled function off a given function.
5
+ * When calling the throttled function, it will call the original function only
6
+ * if it hasn't been called more than `maxCount` times in the last `durationSeconds`.
7
+ *
8
+ * Returns `THROTTLED` if throttled for the first time, after that `SKIPPED`,
9
+ * or else the return value of the original function.
10
+ */
11
+ export declare function throttle<T extends (...rest: any[]) => any>(fn: T, maxCount: number, durationSeconds: number): (...rest: Parameters<T>) => ReturnType<T> | typeof THROTTLED | typeof SKIPPED;
12
+ //# sourceMappingURL=throttle.d.ts.map
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Converts a timestamp to ms, if it was in s, or keeps it as ms.
3
+ */
4
+ export declare function timestampToMs(timestamp: number): number;
5
+ /**
6
+ * Converts a timestamp to s, if it was in ms, or keeps it as s.
7
+ */
8
+ export declare function timestampToS(timestamp: number): number;
9
+ //# sourceMappingURL=timestamp.d.ts.map
@@ -0,0 +1,9 @@
1
+ import { JsonToken } from './constants';
2
+ /**
3
+ * Complete an incomplete JSON string.
4
+ * This will ensure that the last element always has a `"~~"` to indicate it was truncated.
5
+ * For example, `[1,2,` will be completed to `[1,2,"~~"]`
6
+ * and `{"aa":"b` will be completed to `{"aa":"b~~"}`
7
+ */
8
+ export declare function completeJson(incompleteJson: string, stack: JsonToken[]): string;
9
+ //# sourceMappingURL=completeJson.d.ts.map
@@ -0,0 +1,12 @@
1
+ export declare const OBJ = 10;
2
+ export declare const OBJ_KEY = 11;
3
+ export declare const OBJ_KEY_STR = 12;
4
+ export declare const OBJ_VAL = 13;
5
+ export declare const OBJ_VAL_STR = 14;
6
+ export declare const OBJ_VAL_COMPLETED = 15;
7
+ export declare const ARR = 20;
8
+ export declare const ARR_VAL = 21;
9
+ export declare const ARR_VAL_STR = 22;
10
+ export declare const ARR_VAL_COMPLETED = 23;
11
+ export type JsonToken = typeof OBJ | typeof OBJ_KEY | typeof OBJ_KEY_STR | typeof OBJ_VAL | typeof OBJ_VAL_STR | typeof OBJ_VAL_COMPLETED | typeof ARR | typeof ARR_VAL | typeof ARR_VAL_STR | typeof ARR_VAL_COMPLETED;
12
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1,6 @@
1
+ import { JsonToken } from './constants';
2
+ /**
3
+ * Evaluate an (incomplete) JSON string.
4
+ */
5
+ export declare function evaluateJson(json: string): JsonToken[];
6
+ //# sourceMappingURL=evaluateJson.d.ts.map
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Takes an incomplete JSON string, and returns a hopefully valid JSON string.
3
+ * Note that this _can_ fail, so you should check the return value is valid JSON.
4
+ */
5
+ export declare function fixJson(incompleteJson: string): string;
6
+ //# sourceMappingURL=fixJson.d.ts.map
@@ -1,4 +0,0 @@
1
- import type { Session, Timeouts } from '../types';
2
- /** If the session should be refreshed or not. */
3
- export declare function shouldRefreshSession(session: Session, timeouts: Timeouts): boolean;
4
- //# sourceMappingURL=shouldRefreshSession.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"shouldRefreshSession.d.ts","sourceRoot":"","sources":["../../../../src/session/shouldRefreshSession.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGlD,iDAAiD;AACjD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAYlF"}
@@ -1,15 +0,0 @@
1
- import type { getPrivacyOptions } from './getPrivacyOptions';
2
- interface MaskAttributeParams {
3
- maskAttributes: string[];
4
- maskAllText: boolean;
5
- privacyOptions: ReturnType<typeof getPrivacyOptions>;
6
- key: string;
7
- value: string;
8
- el: HTMLElement;
9
- }
10
- /**
11
- * Masks an attribute if necessary, otherwise return attribute value as-is.
12
- */
13
- export declare function maskAttribute({ el, key, maskAttributes, maskAllText, privacyOptions, value, }: MaskAttributeParams): string;
14
- export {};
15
- //# sourceMappingURL=maskAttribute.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"maskAttribute.d.ts","sourceRoot":"","sources":["../../../../src/util/maskAttribute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,UAAU,mBAAmB;IAC3B,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;IACrD,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,WAAW,CAAC;CACjB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,EAC5B,EAAE,EACF,GAAG,EACH,cAAc,EACd,WAAW,EACX,cAAc,EACd,KAAK,GACN,EAAE,mBAAmB,GAAG,MAAM,CAqB9B"}