@sentry/replay 0.5.23 → 0.6.1

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 (68) hide show
  1. package/README.md +59 -35
  2. package/dist/{jest.config.d.ts → config/types/jest.config.d.ts} +0 -0
  3. package/dist/{jest.setup.d.ts → config/types/jest.setup.d.ts} +0 -0
  4. package/dist/{src → config/types/src}/api/captureReplayEvent.d.ts +0 -0
  5. package/dist/{src/coreHandlers/handleFetch.test.d.ts → config/types/src/blockAllMedia.test.d.ts} +0 -0
  6. package/dist/{src → config/types/src}/coreHandlers/getBreadcrumbHandler.d.ts +0 -0
  7. package/dist/{src → config/types/src}/coreHandlers/getSpanHandler.d.ts +0 -0
  8. package/dist/{src → config/types/src}/coreHandlers/handleDom.d.ts +0 -0
  9. package/dist/{src → config/types/src}/coreHandlers/handleFetch.d.ts +0 -0
  10. package/dist/{src/coreHandlers/handleScope-unit.test.d.ts → config/types/src/coreHandlers/handleFetch.test.d.ts} +0 -0
  11. package/dist/{src → config/types/src}/coreHandlers/handleHistory.d.ts +0 -0
  12. package/dist/{src/coreHandlers/handleScope.test.d.ts → config/types/src/coreHandlers/handleScope-unit.test.d.ts} +0 -0
  13. package/dist/{src → config/types/src}/coreHandlers/handleScope.d.ts +0 -0
  14. package/dist/{src/createPerformanceEntry.test.d.ts → config/types/src/coreHandlers/handleScope.test.d.ts} +0 -0
  15. package/dist/{src → config/types/src}/coreHandlers/handleXhr.d.ts +0 -0
  16. package/dist/{src → config/types/src}/createPerformanceEntry.d.ts +0 -0
  17. package/dist/{src/flush.test.d.ts → config/types/src/createPerformanceEntry.test.d.ts} +0 -0
  18. package/dist/{src → config/types/src}/eventBuffer.d.ts +0 -0
  19. package/dist/{src → config/types/src}/eventBuffer.test.d.ts +0 -0
  20. package/dist/{src → config/types/src}/flags.d.ts +0 -0
  21. package/dist/{src/index-captureOnlyOnError.test.d.ts → config/types/src/flush.test.d.ts} +0 -0
  22. package/dist/{src/index-noSticky.test.d.ts → config/types/src/index-captureOnlyOnError.test.d.ts} +0 -0
  23. package/dist/{src/index-sampling.test.d.ts → config/types/src/index-noSticky.test.d.ts} +0 -0
  24. package/dist/{src/index.test.d.ts → config/types/src/index-sampling.test.d.ts} +0 -0
  25. package/dist/{src → config/types/src}/index.d.ts +5 -5
  26. package/dist/{src/session/Session.test.d.ts → config/types/src/index.test.d.ts} +0 -0
  27. package/dist/{src → config/types/src}/session/Session.d.ts +0 -0
  28. package/dist/{src/session/createSession.test.d.ts → config/types/src/session/Session.test.d.ts} +0 -0
  29. package/dist/{src → config/types/src}/session/constants.d.ts +0 -0
  30. package/dist/{src → config/types/src}/session/createSession.d.ts +0 -0
  31. package/dist/{src/session/deleteSession.test.d.ts → config/types/src/session/createSession.test.d.ts} +0 -0
  32. package/dist/{src → config/types/src}/session/deleteSession.d.ts +0 -0
  33. package/dist/{src/session/fetchSession.test.d.ts → config/types/src/session/deleteSession.test.d.ts} +0 -0
  34. package/dist/{src → config/types/src}/session/fetchSession.d.ts +0 -0
  35. package/dist/{src/session/getSession.test.d.ts → config/types/src/session/fetchSession.test.d.ts} +0 -0
  36. package/dist/{src → config/types/src}/session/getSession.d.ts +0 -0
  37. package/dist/{src/session/saveSession.test.d.ts → config/types/src/session/getSession.test.d.ts} +0 -0
  38. package/dist/{src → config/types/src}/session/index.d.ts +0 -0
  39. package/dist/{src → config/types/src}/session/saveSession.d.ts +0 -0
  40. package/dist/{src/stop.test.d.ts → config/types/src/session/saveSession.test.d.ts} +0 -0
  41. package/dist/{src/util/dedupePerformanceEntries.test.d.ts → config/types/src/stop.test.d.ts} +0 -0
  42. package/dist/{src → config/types/src}/types.d.ts +7 -8
  43. package/dist/{src → config/types/src}/util/addInternalBreadcrumb.d.ts +0 -0
  44. package/dist/{src → config/types/src}/util/createBreadcrumb.d.ts +0 -0
  45. package/dist/{src → config/types/src}/util/createPayload.d.ts +0 -0
  46. package/dist/{src → config/types/src}/util/dedupePerformanceEntries.d.ts +0 -0
  47. package/dist/{src/util/isExpired.test.d.ts → config/types/src/util/dedupePerformanceEntries.test.d.ts} +0 -0
  48. package/dist/{src → config/types/src}/util/isExpired.d.ts +0 -0
  49. package/dist/{src/util/isSampled.test.d.ts → config/types/src/util/isExpired.test.d.ts} +0 -0
  50. package/dist/{src → config/types/src}/util/isIngestHost.d.ts +0 -0
  51. package/dist/{src → config/types/src}/util/isInternal.d.ts +0 -0
  52. package/dist/{src → config/types/src}/util/isSampled.d.ts +0 -0
  53. package/dist/{src/util/isSessionExpired.test.d.ts → config/types/src/util/isSampled.test.d.ts} +0 -0
  54. package/dist/{src → config/types/src}/util/isSessionExpired.d.ts +0 -0
  55. package/dist/config/types/src/util/isSessionExpired.test.d.ts +1 -0
  56. package/dist/{src → config/types/src}/util/logger.d.ts +1 -1
  57. package/dist/{test → config/types/test}/fixtures/performanceEntry/lcp.d.ts +0 -0
  58. package/dist/{test → config/types/test}/fixtures/performanceEntry/navigation.d.ts +0 -0
  59. package/dist/{test → config/types/test}/fixtures/performanceEntry/resource.d.ts +0 -0
  60. package/dist/{test → config/types/test}/index.d.ts +0 -0
  61. package/dist/{test → config/types/test}/mocks/mockRrweb.d.ts +0 -0
  62. package/dist/{test → config/types/test}/mocks/mockSdk.d.ts +4 -4
  63. package/dist/index.es.js +52 -40
  64. package/dist/index.js +51 -39
  65. package/dist/index.js.map +1 -1
  66. package/dist/types/src/index.d.ts +5 -5
  67. package/dist/types/src/types.d.ts +7 -8
  68. package/package.json +5 -5
@@ -3,12 +3,12 @@ import { CaptureReplayEventParams } from './api/captureReplayEvent';
3
3
  import { Session } from './session/Session';
4
4
  import { ReplayPerformanceEntry } from './createPerformanceEntry';
5
5
  import { IEventBuffer } from './eventBuffer';
6
- import type { AllPerformanceEntry, InstrumentationTypeBreadcrumb, InstrumentationTypeSpan, RecordedEvents, RecordingConfig, RecordingEvent, ReplayRequest, SentryReplayConfiguration, SentryReplayPluginOptions } from './types';
6
+ import type { AllPerformanceEntry, InstrumentationTypeBreadcrumb, InstrumentationTypeSpan, RecordedEvents, RecordingEvent, RecordingOptions, ReplayConfiguration, ReplayPluginOptions, ReplayRequest } from './types';
7
7
  /**
8
8
  * Returns true to return control to calling function, otherwise continue with normal batching
9
9
  */
10
10
  declare type AddUpdateCallback = () => boolean | void;
11
- export declare class SentryReplay implements Integration {
11
+ export declare class Replay implements Integration {
12
12
  /**
13
13
  * @inheritDoc
14
14
  */
@@ -25,8 +25,8 @@ export declare class SentryReplay implements Integration {
25
25
  /**
26
26
  * Options to pass to `rrweb.record()`
27
27
  */
28
- readonly recordingOptions: RecordingConfig;
29
- readonly options: SentryReplayPluginOptions;
28
+ readonly recordingOptions: RecordingOptions;
29
+ readonly options: ReplayPluginOptions;
30
30
  private performanceObserver;
31
31
  private retryCount;
32
32
  private retryInterval;
@@ -56,7 +56,7 @@ export declare class SentryReplay implements Integration {
56
56
  private initialState;
57
57
  private context;
58
58
  session: Session | undefined;
59
- constructor({ flushMinDelay, flushMaxDelay, initialFlushDelay, stickySession, useCompression, captureOnlyOnError, replaysSamplingRate, maskAllText, recordingConfig: { maskAllInputs, blockClass, ignoreClass, maskTextClass, ...recordingOptions }, }?: SentryReplayConfiguration);
59
+ constructor({ flushMinDelay, flushMaxDelay, initialFlushDelay, stickySession, useCompression, captureOnlyOnError, replaysSamplingRate, maskAllText, maskAllInputs, blockAllMedia, blockClass, ignoreClass, maskTextClass, blockSelector, ...recordingOptions }?: ReplayConfiguration);
60
60
  /**
61
61
  * Because we create a transaction in `setupOnce`, we can potentially create a
62
62
  * transaction before some native SDK integrations have run and applied their
@@ -1,7 +1,6 @@
1
- import { record } from 'rrweb';
2
- import type { eventWithTime } from 'rrweb/typings/types';
1
+ import type { eventWithTime, recordOptions } from 'rrweb/typings/types';
3
2
  export declare type RecordingEvent = eventWithTime;
4
- export declare type RecordingConfig = Parameters<typeof record>[0];
3
+ export declare type RecordingOptions = recordOptions<eventWithTime>;
5
4
  export declare type RecordedEvents = Uint8Array | string;
6
5
  export declare type AllPerformanceEntry = PerformancePaintTiming | PerformanceResourceTiming | PerformanceNavigationTiming;
7
6
  export interface ReplayRequest {
@@ -33,7 +32,7 @@ export interface WorkerResponse {
33
32
  success: boolean;
34
33
  response: string | Uint8Array;
35
34
  }
36
- export interface SentryReplayPluginOptions {
35
+ export interface ReplayPluginOptions {
37
36
  /**
38
37
  * The amount of time to wait before sending a replay
39
38
  */
@@ -68,12 +67,12 @@ export interface SentryReplayPluginOptions {
68
67
  * Mask all text in recordings. All text will be replaced with asterisks by default.
69
68
  */
70
69
  maskAllText?: boolean;
71
- }
72
- export interface SentryReplayConfiguration extends SentryReplayPluginOptions {
73
70
  /**
74
- * Options for `rrweb.record()`
71
+ * Block all media (e.g. images, svg, video) in recordings.
75
72
  */
76
- recordingConfig?: RecordingConfig;
73
+ blockAllMedia?: boolean;
74
+ }
75
+ export interface ReplayConfiguration extends ReplayPluginOptions, RecordingOptions {
77
76
  }
78
77
  /**
79
78
  * Some initial state captured before creating a root replay event
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@sentry/replay",
3
- "version": "0.5.23",
3
+ "version": "0.6.1",
4
4
  "description": "User replays for Sentry",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",
7
7
  "types": "dist/types/src/index.d.ts",
8
+ "sideEffects": false,
8
9
  "scripts": {
9
10
  "bootstrap": "yarn && cd demo && yarn",
10
11
  "build": "yarn rollup --configPlugin @rollup/plugin-typescript",
@@ -18,8 +19,6 @@
18
19
  "lint": "yarn eslint . --ext .js,.jsx,.ts,.tsx",
19
20
  "prepare": "husky install",
20
21
  "prepack": "yarn build:prod",
21
- "size": "yarn build:prod && size-limit",
22
- "size-limit-build": "yarn pack",
23
22
  "start:demo": "yarn build:dev && cd demo && yarn start",
24
23
  "test": "yarn jest"
25
24
  },
@@ -42,7 +41,8 @@
42
41
  "@rollup/plugin-replace": "^4.0.0",
43
42
  "@rollup/plugin-typescript": "^8.3.1",
44
43
  "@sentry/browser": "^7.7.0",
45
- "@size-limit/preset-big-lib": "^7.0.8",
44
+ "@size-limit/file": "^8.1.0",
45
+ "@size-limit/time": "^8.1.0",
46
46
  "@types/jest": "^28.1.1",
47
47
  "@types/lodash.debounce": "^4.0.7",
48
48
  "@types/lodash.throttle": "^4.1.7",
@@ -63,7 +63,7 @@
63
63
  "rimraf": "^3.0.2",
64
64
  "rollup": "^2.70.0",
65
65
  "rollup-plugin-terser": "^7.0.2",
66
- "size-limit": "^7.0.8",
66
+ "size-limit": "^8.1.0",
67
67
  "ts-jest": "^28.0.4",
68
68
  "ts-node": "^10.7.0",
69
69
  "tslib": "^2.3.1",