@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.
- package/README.md +59 -35
- package/dist/{jest.config.d.ts → config/types/jest.config.d.ts} +0 -0
- package/dist/{jest.setup.d.ts → config/types/jest.setup.d.ts} +0 -0
- package/dist/{src → config/types/src}/api/captureReplayEvent.d.ts +0 -0
- package/dist/{src/coreHandlers/handleFetch.test.d.ts → config/types/src/blockAllMedia.test.d.ts} +0 -0
- package/dist/{src → config/types/src}/coreHandlers/getBreadcrumbHandler.d.ts +0 -0
- package/dist/{src → config/types/src}/coreHandlers/getSpanHandler.d.ts +0 -0
- package/dist/{src → config/types/src}/coreHandlers/handleDom.d.ts +0 -0
- package/dist/{src → config/types/src}/coreHandlers/handleFetch.d.ts +0 -0
- package/dist/{src/coreHandlers/handleScope-unit.test.d.ts → config/types/src/coreHandlers/handleFetch.test.d.ts} +0 -0
- package/dist/{src → config/types/src}/coreHandlers/handleHistory.d.ts +0 -0
- package/dist/{src/coreHandlers/handleScope.test.d.ts → config/types/src/coreHandlers/handleScope-unit.test.d.ts} +0 -0
- package/dist/{src → config/types/src}/coreHandlers/handleScope.d.ts +0 -0
- package/dist/{src/createPerformanceEntry.test.d.ts → config/types/src/coreHandlers/handleScope.test.d.ts} +0 -0
- package/dist/{src → config/types/src}/coreHandlers/handleXhr.d.ts +0 -0
- package/dist/{src → config/types/src}/createPerformanceEntry.d.ts +0 -0
- package/dist/{src/flush.test.d.ts → config/types/src/createPerformanceEntry.test.d.ts} +0 -0
- package/dist/{src → config/types/src}/eventBuffer.d.ts +0 -0
- package/dist/{src → config/types/src}/eventBuffer.test.d.ts +0 -0
- package/dist/{src → config/types/src}/flags.d.ts +0 -0
- package/dist/{src/index-captureOnlyOnError.test.d.ts → config/types/src/flush.test.d.ts} +0 -0
- package/dist/{src/index-noSticky.test.d.ts → config/types/src/index-captureOnlyOnError.test.d.ts} +0 -0
- package/dist/{src/index-sampling.test.d.ts → config/types/src/index-noSticky.test.d.ts} +0 -0
- package/dist/{src/index.test.d.ts → config/types/src/index-sampling.test.d.ts} +0 -0
- package/dist/{src → config/types/src}/index.d.ts +5 -5
- package/dist/{src/session/Session.test.d.ts → config/types/src/index.test.d.ts} +0 -0
- package/dist/{src → config/types/src}/session/Session.d.ts +0 -0
- package/dist/{src/session/createSession.test.d.ts → config/types/src/session/Session.test.d.ts} +0 -0
- package/dist/{src → config/types/src}/session/constants.d.ts +0 -0
- package/dist/{src → config/types/src}/session/createSession.d.ts +0 -0
- package/dist/{src/session/deleteSession.test.d.ts → config/types/src/session/createSession.test.d.ts} +0 -0
- package/dist/{src → config/types/src}/session/deleteSession.d.ts +0 -0
- package/dist/{src/session/fetchSession.test.d.ts → config/types/src/session/deleteSession.test.d.ts} +0 -0
- package/dist/{src → config/types/src}/session/fetchSession.d.ts +0 -0
- package/dist/{src/session/getSession.test.d.ts → config/types/src/session/fetchSession.test.d.ts} +0 -0
- package/dist/{src → config/types/src}/session/getSession.d.ts +0 -0
- package/dist/{src/session/saveSession.test.d.ts → config/types/src/session/getSession.test.d.ts} +0 -0
- package/dist/{src → config/types/src}/session/index.d.ts +0 -0
- package/dist/{src → config/types/src}/session/saveSession.d.ts +0 -0
- package/dist/{src/stop.test.d.ts → config/types/src/session/saveSession.test.d.ts} +0 -0
- package/dist/{src/util/dedupePerformanceEntries.test.d.ts → config/types/src/stop.test.d.ts} +0 -0
- package/dist/{src → config/types/src}/types.d.ts +7 -8
- package/dist/{src → config/types/src}/util/addInternalBreadcrumb.d.ts +0 -0
- package/dist/{src → config/types/src}/util/createBreadcrumb.d.ts +0 -0
- package/dist/{src → config/types/src}/util/createPayload.d.ts +0 -0
- package/dist/{src → config/types/src}/util/dedupePerformanceEntries.d.ts +0 -0
- package/dist/{src/util/isExpired.test.d.ts → config/types/src/util/dedupePerformanceEntries.test.d.ts} +0 -0
- package/dist/{src → config/types/src}/util/isExpired.d.ts +0 -0
- package/dist/{src/util/isSampled.test.d.ts → config/types/src/util/isExpired.test.d.ts} +0 -0
- package/dist/{src → config/types/src}/util/isIngestHost.d.ts +0 -0
- package/dist/{src → config/types/src}/util/isInternal.d.ts +0 -0
- package/dist/{src → config/types/src}/util/isSampled.d.ts +0 -0
- package/dist/{src/util/isSessionExpired.test.d.ts → config/types/src/util/isSampled.test.d.ts} +0 -0
- package/dist/{src → config/types/src}/util/isSessionExpired.d.ts +0 -0
- package/dist/config/types/src/util/isSessionExpired.test.d.ts +1 -0
- package/dist/{src → config/types/src}/util/logger.d.ts +1 -1
- package/dist/{test → config/types/test}/fixtures/performanceEntry/lcp.d.ts +0 -0
- package/dist/{test → config/types/test}/fixtures/performanceEntry/navigation.d.ts +0 -0
- package/dist/{test → config/types/test}/fixtures/performanceEntry/resource.d.ts +0 -0
- package/dist/{test → config/types/test}/index.d.ts +0 -0
- package/dist/{test → config/types/test}/mocks/mockRrweb.d.ts +0 -0
- package/dist/{test → config/types/test}/mocks/mockSdk.d.ts +4 -4
- package/dist/index.es.js +52 -40
- package/dist/index.js +51 -39
- package/dist/index.js.map +1 -1
- package/dist/types/src/index.d.ts +5 -5
- package/dist/types/src/types.d.ts +7 -8
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -131,7 +131,7 @@ function captureReplayEvent(_a) {
|
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
133
|
core.withScope(function (scope) {
|
|
134
|
-
scope.setTag('replay_sdk_version', "0.
|
|
134
|
+
scope.setTag('replay_sdk_version', "0.6.1");
|
|
135
135
|
core.captureEvent(__assign(__assign({
|
|
136
136
|
// @ts-expect-error replay_event is a new event type
|
|
137
137
|
type: REPLAY_EVENT_NAME }, (includeReplayStartTimestamp
|
|
@@ -617,7 +617,10 @@ function createPerformanceEntry(entry) {
|
|
|
617
617
|
return ENTRY_TYPES[entry.entryType](entry);
|
|
618
618
|
}
|
|
619
619
|
function getAbsoluteTime(time) {
|
|
620
|
-
|
|
620
|
+
// browserPerformanceTimeOrigin can be undefined if `performance` or
|
|
621
|
+
// `performance.now` doesn't exist, but this is already checked by this integration
|
|
622
|
+
return (((utils.browserPerformanceTimeOrigin || window.performance.timeOrigin) + time) /
|
|
623
|
+
1000);
|
|
621
624
|
}
|
|
622
625
|
function createPaintEntry(entry) {
|
|
623
626
|
var duration = entry.duration, entryType = entry.entryType, name = entry.name, startTime = entry.startTime;
|
|
@@ -686,8 +689,8 @@ function createLargestContentfulPaint(entry) {
|
|
|
686
689
|
}
|
|
687
690
|
function createMemoryEntry(memoryEntry) {
|
|
688
691
|
var jsHeapSizeLimit = memoryEntry.jsHeapSizeLimit, totalJSHeapSize = memoryEntry.totalJSHeapSize, usedJSHeapSize = memoryEntry.usedJSHeapSize;
|
|
689
|
-
// we
|
|
690
|
-
//
|
|
692
|
+
// we don't want to use `getAbsoluteTime` because it adds the event time to the
|
|
693
|
+
// time origin, so we get the current timestamp instead
|
|
691
694
|
var time = new Date().getTime() / 1000;
|
|
692
695
|
return {
|
|
693
696
|
type: 'memory',
|
|
@@ -897,15 +900,16 @@ var EventBufferCompressionWorker = /** @class */ (function () {
|
|
|
897
900
|
var BASE_RETRY_INTERVAL = 5000;
|
|
898
901
|
var MAX_RETRY_COUNT = 3;
|
|
899
902
|
var UNABLE_TO_SEND_REPLAY = 'Unable to send Replay';
|
|
900
|
-
var
|
|
901
|
-
|
|
903
|
+
var MEDIA_SELECTORS = 'img,image,svg,path,rect,area,video,object,picture,embed,map,audio';
|
|
904
|
+
var Replay = /** @class */ (function () {
|
|
905
|
+
function Replay(_a) {
|
|
902
906
|
if (_a === void 0) { _a = {}; }
|
|
903
907
|
var _this = this;
|
|
904
|
-
var _b = _a.flushMinDelay, flushMinDelay = _b === void 0 ? 5000 : _b, _c = _a.flushMaxDelay, flushMaxDelay = _c === void 0 ? 15000 : _c, _d = _a.initialFlushDelay, initialFlushDelay = _d === void 0 ? 5000 : _d, _e = _a.stickySession, stickySession = _e === void 0 ? true : _e, _f = _a.useCompression, useCompression = _f === void 0 ? true : _f, _g = _a.captureOnlyOnError, captureOnlyOnError = _g === void 0 ? false : _g, _h = _a.replaysSamplingRate, replaysSamplingRate = _h === void 0 ? 1.0 : _h, _j = _a.maskAllText, maskAllText = _j === void 0 ?
|
|
908
|
+
var _b = _a.flushMinDelay, flushMinDelay = _b === void 0 ? 5000 : _b, _c = _a.flushMaxDelay, flushMaxDelay = _c === void 0 ? 15000 : _c, _d = _a.initialFlushDelay, initialFlushDelay = _d === void 0 ? 5000 : _d, _e = _a.stickySession, stickySession = _e === void 0 ? true : _e, _f = _a.useCompression, useCompression = _f === void 0 ? true : _f, _g = _a.captureOnlyOnError, captureOnlyOnError = _g === void 0 ? false : _g, _h = _a.replaysSamplingRate, replaysSamplingRate = _h === void 0 ? 1.0 : _h, _j = _a.maskAllText, maskAllText = _j === void 0 ? true : _j, _k = _a.maskAllInputs, maskAllInputs = _k === void 0 ? true : _k, _l = _a.blockAllMedia, blockAllMedia = _l === void 0 ? true : _l, _m = _a.blockClass, blockClass = _m === void 0 ? 'sentry-block' : _m, _o = _a.ignoreClass, ignoreClass = _o === void 0 ? 'sentry-ignore' : _o, _p = _a.maskTextClass, maskTextClass = _p === void 0 ? 'sentry-mask' : _p, _q = _a.blockSelector, blockSelector = _q === void 0 ? '[data-sentry-block]' : _q, recordingOptions = __rest(_a, ["flushMinDelay", "flushMaxDelay", "initialFlushDelay", "stickySession", "useCompression", "captureOnlyOnError", "replaysSamplingRate", "maskAllText", "maskAllInputs", "blockAllMedia", "blockClass", "ignoreClass", "maskTextClass", "blockSelector"]);
|
|
905
909
|
/**
|
|
906
910
|
* @inheritDoc
|
|
907
911
|
*/
|
|
908
|
-
this.name =
|
|
912
|
+
this.name = Replay.id;
|
|
909
913
|
/**
|
|
910
914
|
* List of PerformanceEntry from PerformanceObserver
|
|
911
915
|
*/
|
|
@@ -1183,7 +1187,7 @@ var SentryReplay = /** @class */ (function () {
|
|
|
1183
1187
|
}
|
|
1184
1188
|
});
|
|
1185
1189
|
}); };
|
|
1186
|
-
this.recordingOptions = __assign({ maskAllInputs: maskAllInputs, blockClass: blockClass, ignoreClass: ignoreClass, maskTextClass: maskTextClass }, recordingOptions);
|
|
1190
|
+
this.recordingOptions = __assign({ maskAllInputs: maskAllInputs, blockClass: blockClass, ignoreClass: ignoreClass, maskTextClass: maskTextClass, blockSelector: blockSelector }, recordingOptions);
|
|
1187
1191
|
this.options = {
|
|
1188
1192
|
flushMinDelay: flushMinDelay,
|
|
1189
1193
|
flushMaxDelay: flushMaxDelay,
|
|
@@ -1193,6 +1197,7 @@ var SentryReplay = /** @class */ (function () {
|
|
|
1193
1197
|
replaysSamplingRate: replaysSamplingRate,
|
|
1194
1198
|
useCompression: useCompression,
|
|
1195
1199
|
maskAllText: maskAllText,
|
|
1200
|
+
blockAllMedia: blockAllMedia,
|
|
1196
1201
|
};
|
|
1197
1202
|
// Modify rrweb options to checkoutEveryNthSecond if this is defined, as we don't know when an error occurs, so we want to try to minimize the number of events captured.
|
|
1198
1203
|
if (this.options.captureOnlyOnError) {
|
|
@@ -1205,6 +1210,13 @@ var SentryReplay = /** @class */ (function () {
|
|
|
1205
1210
|
// content masked.
|
|
1206
1211
|
this.recordingOptions.maskTextSelector = '*';
|
|
1207
1212
|
}
|
|
1213
|
+
if (this.options.blockAllMedia) {
|
|
1214
|
+
// `blockAllMedia` is a more user friendly option to configure blocking
|
|
1215
|
+
// embedded media elements
|
|
1216
|
+
this.recordingOptions.blockSelector = !this.recordingOptions.blockSelector
|
|
1217
|
+
? MEDIA_SELECTORS
|
|
1218
|
+
: "".concat(this.recordingOptions.blockSelector, ",").concat(MEDIA_SELECTORS);
|
|
1219
|
+
}
|
|
1208
1220
|
this.debouncedFlush = debounce__default["default"](function () { return _this.flush(); }, this.options.flushMinDelay, {
|
|
1209
1221
|
maxWait: this.options.flushMaxDelay,
|
|
1210
1222
|
});
|
|
@@ -1218,7 +1230,7 @@ var SentryReplay = /** @class */ (function () {
|
|
|
1218
1230
|
* So we call `this.setup` in next event loop as a workaround to wait for
|
|
1219
1231
|
* other global event processors to finish
|
|
1220
1232
|
*/
|
|
1221
|
-
|
|
1233
|
+
Replay.prototype.setupOnce = function () {
|
|
1222
1234
|
var _this = this;
|
|
1223
1235
|
// XXX: See method comments above
|
|
1224
1236
|
window.setTimeout(function () { return _this.start(); });
|
|
@@ -1228,7 +1240,7 @@ var SentryReplay = /** @class */ (function () {
|
|
|
1228
1240
|
*
|
|
1229
1241
|
* Creates or loads a session, attaches listeners to varying events (DOM, PerformanceObserver, Recording, Sentry SDK, etc)
|
|
1230
1242
|
*/
|
|
1231
|
-
|
|
1243
|
+
Replay.prototype.start = function () {
|
|
1232
1244
|
this.loadSession({ expiry: SESSION_IDLE_DURATION });
|
|
1233
1245
|
// If there is no session, then something bad has happened - can't continue
|
|
1234
1246
|
if (!this.session) {
|
|
@@ -1259,7 +1271,7 @@ var SentryReplay = /** @class */ (function () {
|
|
|
1259
1271
|
* Accepts a callback to perform side-effects and returns true to stop batch
|
|
1260
1272
|
* processing and hand back control to caller.
|
|
1261
1273
|
*/
|
|
1262
|
-
|
|
1274
|
+
Replay.prototype.addUpdate = function (cb) {
|
|
1263
1275
|
// We need to always run `cb` (e.g. in the case of captureOnlyOnError == true)
|
|
1264
1276
|
var cbResult = cb === null || cb === void 0 ? void 0 : cb();
|
|
1265
1277
|
// If this option is turned on then we will only want to call `flush`
|
|
@@ -1279,7 +1291,7 @@ var SentryReplay = /** @class */ (function () {
|
|
|
1279
1291
|
/**
|
|
1280
1292
|
* Currently, this needs to be manually called (e.g. for tests). Sentry SDK does not support a teardown
|
|
1281
1293
|
*/
|
|
1282
|
-
|
|
1294
|
+
Replay.prototype.stop = function () {
|
|
1283
1295
|
var _a, _b;
|
|
1284
1296
|
logger.log('Stopping Replays');
|
|
1285
1297
|
this.isEnabled = false;
|
|
@@ -1288,7 +1300,7 @@ var SentryReplay = /** @class */ (function () {
|
|
|
1288
1300
|
(_b = this.eventBuffer) === null || _b === void 0 ? void 0 : _b.destroy();
|
|
1289
1301
|
this.eventBuffer = null;
|
|
1290
1302
|
};
|
|
1291
|
-
|
|
1303
|
+
Replay.prototype.clearSession = function () {
|
|
1292
1304
|
deleteSession();
|
|
1293
1305
|
this.session = undefined;
|
|
1294
1306
|
};
|
|
@@ -1296,7 +1308,7 @@ var SentryReplay = /** @class */ (function () {
|
|
|
1296
1308
|
* Loads a session from storage, or creates a new one if it does not exist or
|
|
1297
1309
|
* is expired.
|
|
1298
1310
|
*/
|
|
1299
|
-
|
|
1311
|
+
Replay.prototype.loadSession = function (_a) {
|
|
1300
1312
|
var _b, _c;
|
|
1301
1313
|
var expiry = _a.expiry;
|
|
1302
1314
|
var _d = getSession({
|
|
@@ -1321,7 +1333,7 @@ var SentryReplay = /** @class */ (function () {
|
|
|
1321
1333
|
* replay. This is required because otherwise they would be captured at the
|
|
1322
1334
|
* first flush.
|
|
1323
1335
|
*/
|
|
1324
|
-
|
|
1336
|
+
Replay.prototype.setInitialState = function () {
|
|
1325
1337
|
var urlPath = "".concat(window.location.pathname).concat(window.location.hash).concat(window.location.search);
|
|
1326
1338
|
var url = "".concat(window.location.origin).concat(urlPath);
|
|
1327
1339
|
this.performanceEvents = [];
|
|
@@ -1336,7 +1348,7 @@ var SentryReplay = /** @class */ (function () {
|
|
|
1336
1348
|
/**
|
|
1337
1349
|
* Adds listeners to record events for the replay
|
|
1338
1350
|
*/
|
|
1339
|
-
|
|
1351
|
+
Replay.prototype.addListeners = function () {
|
|
1340
1352
|
var _this = this;
|
|
1341
1353
|
document.addEventListener('visibilitychange', this.handleVisibilityChange);
|
|
1342
1354
|
window.addEventListener('blur', this.handleWindowBlur);
|
|
@@ -1385,7 +1397,7 @@ var SentryReplay = /** @class */ (function () {
|
|
|
1385
1397
|
/**
|
|
1386
1398
|
* Cleans up listeners that were created in `addListeners`
|
|
1387
1399
|
*/
|
|
1388
|
-
|
|
1400
|
+
Replay.prototype.removeListeners = function () {
|
|
1389
1401
|
document.removeEventListener('visibilitychange', this.handleVisibilityChange);
|
|
1390
1402
|
window.removeEventListener('blur', this.handleWindowBlur);
|
|
1391
1403
|
window.removeEventListener('focus', this.handleWindowFocus);
|
|
@@ -1397,7 +1409,7 @@ var SentryReplay = /** @class */ (function () {
|
|
|
1397
1409
|
/**
|
|
1398
1410
|
* Tasks to run when we consider a page to be hidden (via blurring and/or visibility)
|
|
1399
1411
|
*/
|
|
1400
|
-
|
|
1412
|
+
Replay.prototype.doChangeToBackgroundTasks = function (breadcrumb) {
|
|
1401
1413
|
if (!this.session) {
|
|
1402
1414
|
return;
|
|
1403
1415
|
}
|
|
@@ -1413,7 +1425,7 @@ var SentryReplay = /** @class */ (function () {
|
|
|
1413
1425
|
/**
|
|
1414
1426
|
* Tasks to run when we consider a page to be visible (via focus and/or visibility)
|
|
1415
1427
|
*/
|
|
1416
|
-
|
|
1428
|
+
Replay.prototype.doChangeToForegroundTasks = function (breadcrumb) {
|
|
1417
1429
|
if (!this.session) {
|
|
1418
1430
|
return;
|
|
1419
1431
|
}
|
|
@@ -1440,14 +1452,14 @@ var SentryReplay = /** @class */ (function () {
|
|
|
1440
1452
|
* Trigger rrweb to take a full snapshot which will cause this plugin to
|
|
1441
1453
|
* create a new Replay event.
|
|
1442
1454
|
*/
|
|
1443
|
-
|
|
1455
|
+
Replay.prototype.triggerFullSnapshot = function () {
|
|
1444
1456
|
logger.log('Taking full rrweb snapshot');
|
|
1445
1457
|
rrweb.record.takeFullSnapshot(true);
|
|
1446
1458
|
};
|
|
1447
1459
|
/**
|
|
1448
1460
|
* Add an event to the event buffer
|
|
1449
1461
|
*/
|
|
1450
|
-
|
|
1462
|
+
Replay.prototype.addEvent = function (event, isCheckout) {
|
|
1451
1463
|
if (!this.eventBuffer) {
|
|
1452
1464
|
// This implies that `isEnabled` is false
|
|
1453
1465
|
return;
|
|
@@ -1468,7 +1480,7 @@ var SentryReplay = /** @class */ (function () {
|
|
|
1468
1480
|
/**
|
|
1469
1481
|
* Updates the session's last activity timestamp
|
|
1470
1482
|
*/
|
|
1471
|
-
|
|
1483
|
+
Replay.prototype.updateLastActivity = function (lastActivity) {
|
|
1472
1484
|
if (lastActivity === void 0) { lastActivity = new Date().getTime(); }
|
|
1473
1485
|
if (this.session) {
|
|
1474
1486
|
this.session.lastActivity = lastActivity;
|
|
@@ -1477,7 +1489,7 @@ var SentryReplay = /** @class */ (function () {
|
|
|
1477
1489
|
/**
|
|
1478
1490
|
* Helper to create (and buffer) a replay breadcrumb from a core SDK breadcrumb
|
|
1479
1491
|
*/
|
|
1480
|
-
|
|
1492
|
+
Replay.prototype.createCustomBreadcrumb = function (breadcrumb) {
|
|
1481
1493
|
var _this = this;
|
|
1482
1494
|
this.addUpdate(function () {
|
|
1483
1495
|
_this.addEvent({
|
|
@@ -1493,7 +1505,7 @@ var SentryReplay = /** @class */ (function () {
|
|
|
1493
1505
|
/**
|
|
1494
1506
|
* Create a "span" for each performance entry. The parent transaction is `this.replayEvent`.
|
|
1495
1507
|
*/
|
|
1496
|
-
|
|
1508
|
+
Replay.prototype.createPerformanceSpans = function (entries) {
|
|
1497
1509
|
var _this = this;
|
|
1498
1510
|
return Promise.all(entries.map(function (_a) {
|
|
1499
1511
|
var type = _a.type, start = _a.start, end = _a.end, name = _a.name, data = _a.data;
|
|
@@ -1517,7 +1529,7 @@ var SentryReplay = /** @class */ (function () {
|
|
|
1517
1529
|
* Observed performance events are added to `this.performanceEvents`. These
|
|
1518
1530
|
* are included in the replay event before it is finished and sent to Sentry.
|
|
1519
1531
|
*/
|
|
1520
|
-
|
|
1532
|
+
Replay.prototype.addPerformanceEntries = function () {
|
|
1521
1533
|
// Copy and reset entries before processing
|
|
1522
1534
|
var entries = __spreadArray([], this.performanceEvents, true);
|
|
1523
1535
|
this.performanceEvents = [];
|
|
@@ -1527,7 +1539,7 @@ var SentryReplay = /** @class */ (function () {
|
|
|
1527
1539
|
* Create a "span" for the total amount of memory being used by JS objects
|
|
1528
1540
|
* (including v8 internal objects).
|
|
1529
1541
|
*/
|
|
1530
|
-
|
|
1542
|
+
Replay.prototype.addMemoryEntry = function () {
|
|
1531
1543
|
// window.performance.memory is a non-standard API and doesn't work on all browsers
|
|
1532
1544
|
// so we check before creating the event.
|
|
1533
1545
|
if (!('memory' in window.performance)) {
|
|
@@ -1543,7 +1555,7 @@ var SentryReplay = /** @class */ (function () {
|
|
|
1543
1555
|
*
|
|
1544
1556
|
* Returns true if session is not expired, false otherwise.
|
|
1545
1557
|
*/
|
|
1546
|
-
|
|
1558
|
+
Replay.prototype.checkAndHandleExpiredSession = function (expiry) {
|
|
1547
1559
|
var _a, _b;
|
|
1548
1560
|
if (expiry === void 0) { expiry = SESSION_IDLE_DURATION; }
|
|
1549
1561
|
var oldSessionId = (_a = this.session) === null || _a === void 0 ? void 0 : _a.id;
|
|
@@ -1565,7 +1577,7 @@ var SentryReplay = /** @class */ (function () {
|
|
|
1565
1577
|
/**
|
|
1566
1578
|
* Only flush if `captureOnlyOnError` is false.
|
|
1567
1579
|
*/
|
|
1568
|
-
|
|
1580
|
+
Replay.prototype.conditionalFlush = function () {
|
|
1569
1581
|
if (this.options.captureOnlyOnError) {
|
|
1570
1582
|
return;
|
|
1571
1583
|
}
|
|
@@ -1574,7 +1586,7 @@ var SentryReplay = /** @class */ (function () {
|
|
|
1574
1586
|
/**
|
|
1575
1587
|
* Clear context
|
|
1576
1588
|
*/
|
|
1577
|
-
|
|
1589
|
+
Replay.prototype.clearContext = function () {
|
|
1578
1590
|
this.context.errorIds.clear();
|
|
1579
1591
|
this.context.traceIds.clear();
|
|
1580
1592
|
this.context.urls = [];
|
|
@@ -1583,7 +1595,7 @@ var SentryReplay = /** @class */ (function () {
|
|
|
1583
1595
|
/**
|
|
1584
1596
|
* Return and clear context
|
|
1585
1597
|
*/
|
|
1586
|
-
|
|
1598
|
+
Replay.prototype.popEventContext = function (_a) {
|
|
1587
1599
|
var timestamp = _a.timestamp;
|
|
1588
1600
|
var initialState = this.initialState;
|
|
1589
1601
|
if (this.initialState &&
|
|
@@ -1609,7 +1621,7 @@ var SentryReplay = /** @class */ (function () {
|
|
|
1609
1621
|
*
|
|
1610
1622
|
* Should never be called directly, only by `flush`
|
|
1611
1623
|
*/
|
|
1612
|
-
|
|
1624
|
+
Replay.prototype.runFlush = function () {
|
|
1613
1625
|
var _a, _b, _c;
|
|
1614
1626
|
return __awaiter(this, void 0, void 0, function () {
|
|
1615
1627
|
var stack, replayId, newSessionCreated, segmentId, recordingData, err_2;
|
|
@@ -1664,7 +1676,7 @@ var SentryReplay = /** @class */ (function () {
|
|
|
1664
1676
|
/**
|
|
1665
1677
|
* Send replay attachment using `fetch()`
|
|
1666
1678
|
*/
|
|
1667
|
-
|
|
1679
|
+
Replay.prototype.sendReplayRequest = function (_a) {
|
|
1668
1680
|
var endpoint = _a.endpoint, events = _a.events, event_id = _a.replayId, segment_id = _a.segmentId;
|
|
1669
1681
|
return __awaiter(this, void 0, void 0, function () {
|
|
1670
1682
|
var payloadWithSequence, envelope, response, _b, _c;
|
|
@@ -1683,7 +1695,7 @@ var SentryReplay = /** @class */ (function () {
|
|
|
1683
1695
|
sent_at: new Date().toISOString(),
|
|
1684
1696
|
sdk: {
|
|
1685
1697
|
name: 'sentry.javascript.integration.replay',
|
|
1686
|
-
version: "0.
|
|
1698
|
+
version: "0.6.1",
|
|
1687
1699
|
},
|
|
1688
1700
|
}, [
|
|
1689
1701
|
[
|
|
@@ -1720,14 +1732,14 @@ var SentryReplay = /** @class */ (function () {
|
|
|
1720
1732
|
});
|
|
1721
1733
|
});
|
|
1722
1734
|
};
|
|
1723
|
-
|
|
1735
|
+
Replay.prototype.resetRetries = function () {
|
|
1724
1736
|
this.retryCount = 0;
|
|
1725
1737
|
this.retryInterval = BASE_RETRY_INTERVAL;
|
|
1726
1738
|
};
|
|
1727
1739
|
/**
|
|
1728
1740
|
* Finalize and send the current replay event to Sentry
|
|
1729
1741
|
*/
|
|
1730
|
-
|
|
1742
|
+
Replay.prototype.sendReplay = function (replayId, events, segmentId) {
|
|
1731
1743
|
return __awaiter(this, void 0, void 0, function () {
|
|
1732
1744
|
var client, endpoint, ex_1;
|
|
1733
1745
|
var _this = this;
|
|
@@ -1800,9 +1812,9 @@ var SentryReplay = /** @class */ (function () {
|
|
|
1800
1812
|
/**
|
|
1801
1813
|
* @inheritDoc
|
|
1802
1814
|
*/
|
|
1803
|
-
|
|
1804
|
-
return
|
|
1815
|
+
Replay.id = 'Replay';
|
|
1816
|
+
return Replay;
|
|
1805
1817
|
}());
|
|
1806
1818
|
|
|
1807
|
-
exports.
|
|
1819
|
+
exports.Replay = Replay;
|
|
1808
1820
|
//# sourceMappingURL=index.js.map
|