@sentry/replay
Advanced tools
Comparing version 0.2.0-5 to 0.2.0-6
@@ -313,3 +313,3 @@ import * as Sentry from '@sentry/browser'; | ||
_e = _a.rrwebConfig, // TBD: Making this opt-in for now | ||
_f = _e === void 0 ? {} : _e, _g = _f.maskAllInputs, maskAllInputs = _g === void 0 ? true : _g, rrwebRecordOptions = __rest(_f, ["maskAllInputs"]); | ||
_f = _e === void 0 ? {} : _e, _g = _f.maskAllInputs, maskAllInputs = _g === void 0 ? true : _g, _h = _f.blockClass, blockClass = _h === void 0 ? 'sr-block' : _h, _j = _f.ignoreClass, ignoreClass = _j === void 0 ? 'sr-ignore' : _j, _k = _f.maskTextClass, maskTextClass = _k === void 0 ? 'sr-mask' : _k, rrwebRecordOptions = __rest(_f, ["maskAllInputs", "blockClass", "ignoreClass", "maskTextClass"]); | ||
/** | ||
@@ -373,3 +373,3 @@ * @inheritDoc | ||
}; | ||
this.rrwebRecordOptions = __assign({ maskAllInputs: maskAllInputs }, rrwebRecordOptions); | ||
this.rrwebRecordOptions = __assign({ maskAllInputs: maskAllInputs, blockClass: blockClass, ignoreClass: ignoreClass, maskTextClass: maskTextClass }, rrwebRecordOptions); | ||
this.options = { uploadMinDelay: uploadMinDelay, uploadMaxDelay: uploadMaxDelay, stickySession: stickySession }; | ||
@@ -382,12 +382,2 @@ this.events = []; | ||
}; | ||
Object.defineProperty(SentryReplay.prototype, "instance", { | ||
/** | ||
* Get integration's instance on the current hub | ||
*/ | ||
get: function () { | ||
return Sentry.getCurrentHub().getIntegration(SentryReplay); | ||
}, | ||
enumerable: false, | ||
configurable: true | ||
}); | ||
SentryReplay.prototype.setupOnce = function () { | ||
@@ -548,3 +538,2 @@ var _this = this; | ||
SentryReplay.prototype.finishReplayEvent = function () { | ||
// if (!this.instance) return; | ||
var _a; | ||
@@ -584,3 +573,3 @@ // Ensure that our existing session has not expired | ||
return __awaiter(this, void 0, void 0, function () { | ||
var stringifiedPayload, formData, ex_1; | ||
var stringifiedPayload, formData; | ||
return __generator(this, function (_a) { | ||
@@ -600,7 +589,4 @@ switch (_a.label) { | ||
} | ||
_a.label = 1; | ||
case 1: | ||
_a.trys.push([1, 3, , 4]); | ||
// Otherwise use `fetch`, which *WILL* get cancelled on page reloads/unloads | ||
logger.log("uploading attachment via fetch()"); | ||
// Otherwise use `fetch`, which *WILL* get cancelled on page reloads/unloads | ||
return [4 /*yield*/, fetch(endpoint, { | ||
@@ -610,12 +596,5 @@ method: 'POST', | ||
})]; | ||
case 2: | ||
// Otherwise use `fetch`, which *WILL* get cancelled on page reloads/unloads | ||
case 1: | ||
_a.sent(); | ||
return [3 /*break*/, 4]; | ||
case 3: | ||
ex_1 = _a.sent(); | ||
// we have to catch this otherwise it throws an infinite loop in Sentry | ||
console.error(ex_1); | ||
return [3 /*break*/, 4]; | ||
case 4: return [2 /*return*/]; | ||
return [2 /*return*/]; | ||
} | ||
@@ -630,22 +609,28 @@ }); | ||
return __awaiter(this, void 0, void 0, function () { | ||
var client, endpoint, ex_2; | ||
var events, client, endpoint, ex_1; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
_a.trys.push([0, 2, , 3]); | ||
// short circuit if theres no events to replay | ||
if (!this.events.length) | ||
return [2 /*return*/]; | ||
events = this.events; | ||
this.events = []; | ||
_a.label = 1; | ||
case 1: | ||
_a.trys.push([1, 3, , 4]); | ||
client = Sentry.getCurrentHub().getClient(); | ||
endpoint = SentryReplay.attachmentUrlFromDsn(client.getDsn(), eventId); | ||
return [4 /*yield*/, this.sendReplayRequest(endpoint, this.events)]; | ||
case 1: | ||
return [4 /*yield*/, this.sendReplayRequest(endpoint, events)]; | ||
case 2: | ||
_a.sent(); | ||
this.events = []; | ||
return [2 /*return*/, true]; | ||
case 2: | ||
ex_2 = _a.sent(); | ||
console.error(ex_2); | ||
case 3: | ||
ex_1 = _a.sent(); | ||
// we have to catch this otherwise it throws an infinite loop in Sentry | ||
console.error(ex_1); | ||
// If an error happened here, it's likely that uploading the attachment failed, we'll want to restore the events that failed to upload | ||
this.events = __spreadArray(__spreadArray([], events, true), this.events, true); | ||
return [2 /*return*/, false]; | ||
case 3: return [2 /*return*/]; | ||
case 4: return [2 /*return*/]; | ||
} | ||
@@ -652,0 +637,0 @@ }); |
@@ -337,3 +337,3 @@ 'use strict'; | ||
_e = _a.rrwebConfig, // TBD: Making this opt-in for now | ||
_f = _e === void 0 ? {} : _e, _g = _f.maskAllInputs, maskAllInputs = _g === void 0 ? true : _g, rrwebRecordOptions = __rest(_f, ["maskAllInputs"]); | ||
_f = _e === void 0 ? {} : _e, _g = _f.maskAllInputs, maskAllInputs = _g === void 0 ? true : _g, _h = _f.blockClass, blockClass = _h === void 0 ? 'sr-block' : _h, _j = _f.ignoreClass, ignoreClass = _j === void 0 ? 'sr-ignore' : _j, _k = _f.maskTextClass, maskTextClass = _k === void 0 ? 'sr-mask' : _k, rrwebRecordOptions = __rest(_f, ["maskAllInputs", "blockClass", "ignoreClass", "maskTextClass"]); | ||
/** | ||
@@ -397,3 +397,3 @@ * @inheritDoc | ||
}; | ||
this.rrwebRecordOptions = __assign({ maskAllInputs: maskAllInputs }, rrwebRecordOptions); | ||
this.rrwebRecordOptions = __assign({ maskAllInputs: maskAllInputs, blockClass: blockClass, ignoreClass: ignoreClass, maskTextClass: maskTextClass }, rrwebRecordOptions); | ||
this.options = { uploadMinDelay: uploadMinDelay, uploadMaxDelay: uploadMaxDelay, stickySession: stickySession }; | ||
@@ -406,12 +406,2 @@ this.events = []; | ||
}; | ||
Object.defineProperty(SentryReplay.prototype, "instance", { | ||
/** | ||
* Get integration's instance on the current hub | ||
*/ | ||
get: function () { | ||
return Sentry__namespace.getCurrentHub().getIntegration(SentryReplay); | ||
}, | ||
enumerable: false, | ||
configurable: true | ||
}); | ||
SentryReplay.prototype.setupOnce = function () { | ||
@@ -572,3 +562,2 @@ var _this = this; | ||
SentryReplay.prototype.finishReplayEvent = function () { | ||
// if (!this.instance) return; | ||
var _a; | ||
@@ -608,3 +597,3 @@ // Ensure that our existing session has not expired | ||
return __awaiter(this, void 0, void 0, function () { | ||
var stringifiedPayload, formData, ex_1; | ||
var stringifiedPayload, formData; | ||
return __generator(this, function (_a) { | ||
@@ -624,7 +613,4 @@ switch (_a.label) { | ||
} | ||
_a.label = 1; | ||
case 1: | ||
_a.trys.push([1, 3, , 4]); | ||
// Otherwise use `fetch`, which *WILL* get cancelled on page reloads/unloads | ||
logger.log("uploading attachment via fetch()"); | ||
// Otherwise use `fetch`, which *WILL* get cancelled on page reloads/unloads | ||
return [4 /*yield*/, fetch(endpoint, { | ||
@@ -634,12 +620,5 @@ method: 'POST', | ||
})]; | ||
case 2: | ||
// Otherwise use `fetch`, which *WILL* get cancelled on page reloads/unloads | ||
case 1: | ||
_a.sent(); | ||
return [3 /*break*/, 4]; | ||
case 3: | ||
ex_1 = _a.sent(); | ||
// we have to catch this otherwise it throws an infinite loop in Sentry | ||
console.error(ex_1); | ||
return [3 /*break*/, 4]; | ||
case 4: return [2 /*return*/]; | ||
return [2 /*return*/]; | ||
} | ||
@@ -654,22 +633,28 @@ }); | ||
return __awaiter(this, void 0, void 0, function () { | ||
var client, endpoint, ex_2; | ||
var events, client, endpoint, ex_1; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
_a.trys.push([0, 2, , 3]); | ||
// short circuit if theres no events to replay | ||
if (!this.events.length) | ||
return [2 /*return*/]; | ||
events = this.events; | ||
this.events = []; | ||
_a.label = 1; | ||
case 1: | ||
_a.trys.push([1, 3, , 4]); | ||
client = Sentry__namespace.getCurrentHub().getClient(); | ||
endpoint = SentryReplay.attachmentUrlFromDsn(client.getDsn(), eventId); | ||
return [4 /*yield*/, this.sendReplayRequest(endpoint, this.events)]; | ||
case 1: | ||
return [4 /*yield*/, this.sendReplayRequest(endpoint, events)]; | ||
case 2: | ||
_a.sent(); | ||
this.events = []; | ||
return [2 /*return*/, true]; | ||
case 2: | ||
ex_2 = _a.sent(); | ||
console.error(ex_2); | ||
case 3: | ||
ex_1 = _a.sent(); | ||
// we have to catch this otherwise it throws an infinite loop in Sentry | ||
console.error(ex_1); | ||
// If an error happened here, it's likely that uploading the attachment failed, we'll want to restore the events that failed to upload | ||
this.events = __spreadArray(__spreadArray([], events, true), this.events, true); | ||
return [2 /*return*/, false]; | ||
case 3: return [2 /*return*/]; | ||
case 4: return [2 /*return*/]; | ||
} | ||
@@ -676,0 +661,0 @@ }); |
{ | ||
"name": "@sentry/replay", | ||
"version": "0.2.0-5", | ||
"version": "0.2.0-6", | ||
"description": "User replays for Sentry", | ||
@@ -13,2 +13,3 @@ "main": "dist/index.js", | ||
"prepare": "husky install", | ||
"prepublishOnly": "yarn build", | ||
"start:demo": "yarn build && cd demo && yarn start", | ||
@@ -34,4 +35,3 @@ "test": "yarn jest", | ||
"@sentry/tracing": ">=6.0.0", | ||
"@sentry/utils": ">=6.0.0", | ||
"rrweb": ">=0.7.0" | ||
"@sentry/utils": ">=6.0.0" | ||
}, | ||
@@ -59,3 +59,2 @@ "devDependencies": { | ||
"rollup": "^2.70.0", | ||
"rrweb": "^1.1.2", | ||
"ts-jest": "^27.1.3", | ||
@@ -66,3 +65,5 @@ "ts-node": "^10.7.0", | ||
}, | ||
"dependencies": {}, | ||
"dependencies": { | ||
"rrweb": "^1.1.3" | ||
}, | ||
"prettier": { | ||
@@ -69,0 +70,0 @@ "singleQuote": true |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
138272
24
1482
+ Addedrrweb@^1.1.3