@sentry/replay 0.5.21 → 0.5.23

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 (70) hide show
  1. package/dist/index.es.js +148 -56
  2. package/dist/index.js +147 -56
  3. package/dist/index.js.map +1 -1
  4. package/dist/{config/types/jest.config.d.ts → jest.config.d.ts} +0 -0
  5. package/dist/{config/types/jest.setup.d.ts → jest.setup.d.ts} +0 -0
  6. package/dist/{config/types/src → src}/api/captureReplayEvent.d.ts +0 -0
  7. package/dist/{config/types/src → src}/coreHandlers/getBreadcrumbHandler.d.ts +0 -0
  8. package/dist/{config/types/src → src}/coreHandlers/getSpanHandler.d.ts +0 -0
  9. package/dist/{config/types/src → src}/coreHandlers/handleDom.d.ts +0 -0
  10. package/dist/{config/types/src → src}/coreHandlers/handleFetch.d.ts +0 -0
  11. package/dist/{config/types/src → src}/coreHandlers/handleFetch.test.d.ts +0 -0
  12. package/dist/{config/types/src → src}/coreHandlers/handleHistory.d.ts +0 -0
  13. package/dist/{config/types/src → src}/coreHandlers/handleScope-unit.test.d.ts +0 -0
  14. package/dist/{config/types/src → src}/coreHandlers/handleScope.d.ts +0 -0
  15. package/dist/{config/types/src → src}/coreHandlers/handleScope.test.d.ts +0 -0
  16. package/dist/{config/types/src → src}/coreHandlers/handleXhr.d.ts +0 -0
  17. package/dist/{config/types/src → src}/createPerformanceEntry.d.ts +0 -0
  18. package/dist/{config/types/src → src}/createPerformanceEntry.test.d.ts +0 -0
  19. package/dist/{config/types/src → src}/eventBuffer.d.ts +0 -0
  20. package/dist/{config/types/src → src}/eventBuffer.test.d.ts +0 -0
  21. package/dist/{config/types/src → src}/flags.d.ts +0 -0
  22. package/dist/{config/types/src → src}/flush.test.d.ts +0 -0
  23. package/dist/{config/types/src → src}/index-captureOnlyOnError.test.d.ts +0 -0
  24. package/dist/{config/types/src → src}/index-noSticky.test.d.ts +0 -0
  25. package/dist/{config/types/src → src}/index-sampling.test.d.ts +0 -0
  26. package/dist/{config/types/src → src}/index.d.ts +2 -14
  27. package/dist/{config/types/src → src}/index.test.d.ts +0 -0
  28. package/dist/{config/types/src → src}/session/Session.d.ts +0 -0
  29. package/dist/{config/types/src → src}/session/Session.test.d.ts +0 -0
  30. package/dist/{config/types/src → src}/session/constants.d.ts +0 -0
  31. package/dist/{config/types/src → src}/session/createSession.d.ts +0 -0
  32. package/dist/{config/types/src → src}/session/createSession.test.d.ts +0 -0
  33. package/dist/{config/types/src → src}/session/deleteSession.d.ts +0 -0
  34. package/dist/{config/types/src → src}/session/deleteSession.test.d.ts +0 -0
  35. package/dist/{config/types/src → src}/session/fetchSession.d.ts +0 -0
  36. package/dist/{config/types/src → src}/session/fetchSession.test.d.ts +0 -0
  37. package/dist/{config/types/src → src}/session/getSession.d.ts +0 -0
  38. package/dist/{config/types/src → src}/session/getSession.test.d.ts +0 -0
  39. package/dist/{config/types/src → src}/session/index.d.ts +0 -0
  40. package/dist/{config/types/src → src}/session/saveSession.d.ts +0 -0
  41. package/dist/{config/types/src → src}/session/saveSession.test.d.ts +0 -0
  42. package/dist/{config/types/src → src}/stop.test.d.ts +0 -0
  43. package/dist/{config/types/src → src}/types.d.ts +3 -0
  44. package/dist/src/util/addInternalBreadcrumb.d.ts +5 -0
  45. package/dist/{config/types/src → src}/util/createBreadcrumb.d.ts +0 -0
  46. package/dist/{config/types/src → src}/util/createPayload.d.ts +0 -0
  47. package/dist/{config/types/src/util/dedupeNavigationEntries.d.ts → src/util/dedupePerformanceEntries.d.ts} +1 -1
  48. package/dist/{config/types/src/util/isExpired.test.d.ts → src/util/dedupePerformanceEntries.test.d.ts} +0 -0
  49. package/dist/{config/types/src → src}/util/isExpired.d.ts +0 -0
  50. package/dist/{config/types/src/util/isSampled.test.d.ts → src/util/isExpired.test.d.ts} +0 -0
  51. package/dist/{config/types/src → src}/util/isIngestHost.d.ts +0 -0
  52. package/dist/src/util/isInternal.d.ts +5 -0
  53. package/dist/{config/types/src → src}/util/isSampled.d.ts +0 -0
  54. package/dist/{config/types/src/util/isSessionExpired.test.d.ts → src/util/isSampled.test.d.ts} +0 -0
  55. package/dist/{config/types/src → src}/util/isSessionExpired.d.ts +0 -0
  56. package/dist/src/util/isSessionExpired.test.d.ts +1 -0
  57. package/dist/{config/types/src → src}/util/logger.d.ts +0 -0
  58. package/dist/test/fixtures/performanceEntry/lcp.d.ts +1 -0
  59. package/dist/test/fixtures/performanceEntry/navigation.d.ts +1 -0
  60. package/dist/test/fixtures/performanceEntry/resource.d.ts +1 -0
  61. package/dist/{config/types/test → test}/index.d.ts +0 -0
  62. package/dist/{config/types/test → test}/mocks/mockRrweb.d.ts +0 -0
  63. package/dist/{config/types/test → test}/mocks/mockSdk.d.ts +0 -0
  64. package/dist/types/src/index.d.ts +2 -14
  65. package/dist/types/src/types.d.ts +3 -0
  66. package/dist/types/src/util/addInternalBreadcrumb.d.ts +5 -0
  67. package/dist/types/src/util/dedupePerformanceEntries.d.ts +10 -0
  68. package/dist/types/src/util/isInternal.d.ts +5 -0
  69. package/package.json +1 -2
  70. package/dist/config/types/src/coreHandlers/handleConsole.d.ts +0 -1
File without changes
File without changes
File without changes
@@ -1,4 +1,3 @@
1
- /// <reference types="lodash" />
2
1
  import { Breadcrumb, Event, Integration } from '@sentry/types';
3
2
  import { CaptureReplayEventParams } from './api/captureReplayEvent';
4
3
  import { Session } from './session/Session';
@@ -28,12 +27,6 @@ export declare class SentryReplay implements Integration {
28
27
  */
29
28
  readonly recordingOptions: RecordingConfig;
30
29
  readonly options: SentryReplayPluginOptions;
31
- /**
32
- * The timestamp of the first event since the last flush. This is used to
33
- * determine if the maximum allowed time has passed before events should be
34
- * flushed again.
35
- */
36
- private initialEventTimestampSinceFlush;
37
30
  private performanceObserver;
38
31
  private retryCount;
39
32
  private retryInterval;
@@ -223,6 +216,8 @@ export declare class SentryReplay implements Integration {
223
216
  *
224
217
  * Performance events are only added right before flushing - this is
225
218
  * due to the buffered performance observer events.
219
+ *
220
+ * Should never be called directly, only by `flush`
226
221
  */
227
222
  runFlush(): Promise<void>;
228
223
  /**
@@ -230,13 +225,6 @@ export declare class SentryReplay implements Integration {
230
225
  * can be active at a time.
231
226
  */
232
227
  flush: () => Promise<void>;
233
- /**
234
- * A throttled `flush()` that is called after a flush is completed and there
235
- * are other queued flushes.
236
- *
237
- * Instead of calling a flush for every <n> queued flush, condense it to a single call
238
- */
239
- throttledFlush: import("lodash").DebouncedFunc<() => Promise<void>>;
240
228
  /**
241
229
  * Send replay attachment using `fetch()`
242
230
  */
File without changes
File without changes
@@ -21,6 +21,9 @@ export interface WorkerRequest {
21
21
  method: string;
22
22
  args: any[];
23
23
  }
24
+ declare global {
25
+ const __SENTRY_REPLAY_VERSION__: string;
26
+ }
24
27
  /**
25
28
  * The response from the worker
26
29
  */
@@ -0,0 +1,5 @@
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;
@@ -7,4 +7,4 @@
7
7
  *
8
8
  * Compare the values of several keys to determine if the entries are duplicates or not.
9
9
  */
10
- export declare function dedupeNavigationEntries(currentList: PerformanceEntryList, newList: PerformanceNavigationTiming[]): PerformanceNavigationTiming[];
10
+ export declare function dedupePerformanceEntries(currentList: PerformanceEntryList, newList: PerformanceEntryList): PerformancePaintTiming[];
@@ -0,0 +1,5 @@
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;
@@ -0,0 +1 @@
1
+ export {};
File without changes
@@ -0,0 +1 @@
1
+ export declare function PerformanceEntryLcp(obj?: Partial<PerformancePaintTiming>): PerformancePaintTiming;
@@ -0,0 +1 @@
1
+ export declare function PerformanceEntryNavigation(obj?: Partial<PerformanceNavigationTiming>): PerformanceNavigationTiming;
@@ -0,0 +1 @@
1
+ export declare function PerformanceEntryResource(obj?: Partial<PerformanceResourceTiming>): PerformanceResourceTiming;
File without changes
@@ -1,4 +1,3 @@
1
- /// <reference types="lodash" />
2
1
  import { Breadcrumb, Event, Integration } from '@sentry/types';
3
2
  import { CaptureReplayEventParams } from './api/captureReplayEvent';
4
3
  import { Session } from './session/Session';
@@ -28,12 +27,6 @@ export declare class SentryReplay implements Integration {
28
27
  */
29
28
  readonly recordingOptions: RecordingConfig;
30
29
  readonly options: SentryReplayPluginOptions;
31
- /**
32
- * The timestamp of the first event since the last flush. This is used to
33
- * determine if the maximum allowed time has passed before events should be
34
- * flushed again.
35
- */
36
- private initialEventTimestampSinceFlush;
37
30
  private performanceObserver;
38
31
  private retryCount;
39
32
  private retryInterval;
@@ -223,6 +216,8 @@ export declare class SentryReplay implements Integration {
223
216
  *
224
217
  * Performance events are only added right before flushing - this is
225
218
  * due to the buffered performance observer events.
219
+ *
220
+ * Should never be called directly, only by `flush`
226
221
  */
227
222
  runFlush(): Promise<void>;
228
223
  /**
@@ -230,13 +225,6 @@ export declare class SentryReplay implements Integration {
230
225
  * can be active at a time.
231
226
  */
232
227
  flush: () => Promise<void>;
233
- /**
234
- * A throttled `flush()` that is called after a flush is completed and there
235
- * are other queued flushes.
236
- *
237
- * Instead of calling a flush for every <n> queued flush, condense it to a single call
238
- */
239
- throttledFlush: import("lodash").DebouncedFunc<() => Promise<void>>;
240
228
  /**
241
229
  * Send replay attachment using `fetch()`
242
230
  */
@@ -21,6 +21,9 @@ export interface WorkerRequest {
21
21
  method: string;
22
22
  args: any[];
23
23
  }
24
+ declare global {
25
+ const __SENTRY_REPLAY_VERSION__: string;
26
+ }
24
27
  /**
25
28
  * The response from the worker
26
29
  */
@@ -0,0 +1,5 @@
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;
@@ -0,0 +1,10 @@
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[];
@@ -0,0 +1,5 @@
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/replay",
3
- "version": "0.5.21",
3
+ "version": "0.5.23",
4
4
  "description": "User replays for Sentry",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",
@@ -74,7 +74,6 @@
74
74
  "@sentry/types": "^7.7.0",
75
75
  "@sentry/utils": "^7.7.0",
76
76
  "lodash.debounce": "^4.0.8",
77
- "lodash.throttle": "^4.1.1",
78
77
  "pako": "^2.0.4",
79
78
  "rrweb": "^1.1.3"
80
79
  },
@@ -1 +0,0 @@
1
- export declare function handleConsole(handlerData: any): void;