@sentry/replay 7.67.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 (76) hide show
  1. package/package.json +6 -6
  2. package/types-ts3.8/constants.d.ts +25 -0
  3. package/types-ts3.8/coreHandlers/handleAfterSendEvent.d.ts +9 -0
  4. package/types-ts3.8/coreHandlers/handleClick.d.ts +39 -0
  5. package/types-ts3.8/coreHandlers/handleDom.d.ts +13 -0
  6. package/types-ts3.8/coreHandlers/handleFetch.d.ts +9 -0
  7. package/types-ts3.8/coreHandlers/handleGlobalEvent.d.ts +7 -0
  8. package/types-ts3.8/coreHandlers/handleHistory.d.ts +11 -0
  9. package/types-ts3.8/coreHandlers/handleKeyboardEvent.d.ts +7 -0
  10. package/types-ts3.8/coreHandlers/handleNetworkBreadcrumbs.d.ts +17 -0
  11. package/types-ts3.8/coreHandlers/handleScope.d.ts +13 -0
  12. package/types-ts3.8/coreHandlers/handleXhr.d.ts +9 -0
  13. package/types-ts3.8/coreHandlers/performanceObserver.d.ts +6 -0
  14. package/types-ts3.8/coreHandlers/util/addBreadcrumbEvent.d.ts +7 -0
  15. package/types-ts3.8/coreHandlers/util/addNetworkBreadcrumb.d.ts +4 -0
  16. package/types-ts3.8/coreHandlers/util/domUtils.d.ts +19 -0
  17. package/types-ts3.8/coreHandlers/util/fetchUtils.d.ts +23 -0
  18. package/types-ts3.8/coreHandlers/util/getAttributesToRecord.d.ts +5 -0
  19. package/types-ts3.8/coreHandlers/util/networkUtils.d.ts +23 -0
  20. package/types-ts3.8/coreHandlers/util/onWindowOpen.d.ts +8 -0
  21. package/types-ts3.8/coreHandlers/util/shouldSampleForBufferEvent.d.ts +9 -0
  22. package/types-ts3.8/coreHandlers/util/xhrUtils.d.ts +22 -0
  23. package/types-ts3.8/eventBuffer/EventBufferArray.d.ts +28 -0
  24. package/types-ts3.8/eventBuffer/EventBufferCompressionWorker.d.ts +50 -0
  25. package/types-ts3.8/eventBuffer/EventBufferProxy.d.ts +42 -0
  26. package/types-ts3.8/eventBuffer/WorkerHandler.d.ts +27 -0
  27. package/types-ts3.8/eventBuffer/error.d.ts +5 -0
  28. package/types-ts3.8/eventBuffer/index.d.ts +10 -0
  29. package/types-ts3.8/index.d.ts +4 -0
  30. package/types-ts3.8/integration.d.ts +73 -0
  31. package/types-ts3.8/replay.d.ts +308 -0
  32. package/types-ts3.8/session/Session.d.ts +8 -0
  33. package/types-ts3.8/session/clearSession.d.ts +6 -0
  34. package/types-ts3.8/session/createSession.d.ts +14 -0
  35. package/types-ts3.8/session/fetchSession.d.ts +6 -0
  36. package/types-ts3.8/session/index.d.ts +2 -0
  37. package/types-ts3.8/session/loadOrCreateSession.d.ts +11 -0
  38. package/types-ts3.8/session/maybeRefreshSession.d.ts +12 -0
  39. package/types-ts3.8/session/saveSession.d.ts +6 -0
  40. package/types-ts3.8/types/deprecated.d.ts +16 -0
  41. package/types-ts3.8/types/index.d.ts +6 -0
  42. package/types-ts3.8/types/performance.d.ts +124 -0
  43. package/types-ts3.8/types/replay.d.ts +422 -0
  44. package/types-ts3.8/types/replayFrame.d.ts +173 -0
  45. package/types-ts3.8/types/request.d.ts +15 -0
  46. package/types-ts3.8/types/rrweb.d.ts +37 -0
  47. package/types-ts3.8/util/addEvent.d.ts +7 -0
  48. package/types-ts3.8/util/addGlobalListeners.d.ts +6 -0
  49. package/types-ts3.8/util/addMemoryEntry.d.ts +7 -0
  50. package/types-ts3.8/util/createBreadcrumb.d.ts +6 -0
  51. package/types-ts3.8/util/createPerformanceEntries.d.ts +6 -0
  52. package/types-ts3.8/util/createPerformanceSpans.d.ts +6 -0
  53. package/types-ts3.8/util/createReplayEnvelope.d.ts +7 -0
  54. package/types-ts3.8/util/debounce.d.ts +30 -0
  55. package/types-ts3.8/util/dedupePerformanceEntries.d.ts +11 -0
  56. package/types-ts3.8/util/eventUtils.d.ts +8 -0
  57. package/types-ts3.8/util/getPrivacyOptions.d.ts +19 -0
  58. package/types-ts3.8/util/handleRecordingEmit.d.ts +14 -0
  59. package/types-ts3.8/util/hasSessionStorage.d.ts +3 -0
  60. package/types-ts3.8/util/isBrowser.d.ts +5 -0
  61. package/types-ts3.8/util/isExpired.d.ts +6 -0
  62. package/types-ts3.8/util/isRrwebError.d.ts +6 -0
  63. package/types-ts3.8/util/isSampled.d.ts +8 -0
  64. package/types-ts3.8/util/isSessionExpired.d.ts +10 -0
  65. package/types-ts3.8/util/log.d.ts +10 -0
  66. package/types-ts3.8/util/prepareRecordingData.d.ts +9 -0
  67. package/types-ts3.8/util/prepareReplayEvent.d.ts +15 -0
  68. package/types-ts3.8/util/sendReplay.d.ts +9 -0
  69. package/types-ts3.8/util/sendReplayRequest.d.ts +13 -0
  70. package/types-ts3.8/util/shouldFilterRequest.d.ts +7 -0
  71. package/types-ts3.8/util/throttle.d.ts +12 -0
  72. package/types-ts3.8/util/timestamp.d.ts +9 -0
  73. package/types-ts3.8/util/truncateJson/completeJson.d.ts +9 -0
  74. package/types-ts3.8/util/truncateJson/constants.d.ts +12 -0
  75. package/types-ts3.8/util/truncateJson/evaluateJson.d.ts +6 -0
  76. package/types-ts3.8/util/truncateJson/fixJson.d.ts +6 -0
@@ -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