rollbar 3.0.0-beta.2 → 3.0.0-beta.3
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/dist/rollbar.cjs +35 -34
- package/dist/rollbar.js +89 -113
- package/dist/rollbar.js.map +1 -1
- package/dist/rollbar.min.cjs +1 -1
- package/dist/rollbar.min.js +1 -1
- package/dist/rollbar.min.js.map +1 -1
- package/dist/rollbar.named-amd.js +89 -113
- package/dist/rollbar.named-amd.js.map +1 -1
- package/dist/rollbar.named-amd.min.js +1 -1
- package/dist/rollbar.named-amd.min.js.map +1 -1
- package/dist/rollbar.noconflict.umd.js +89 -113
- package/dist/rollbar.noconflict.umd.js.map +1 -1
- package/dist/rollbar.noconflict.umd.min.js +1 -1
- package/dist/rollbar.noconflict.umd.min.js.map +1 -1
- package/dist/rollbar.snippet.js +1 -1
- package/dist/rollbar.umd.js +89 -113
- package/dist/rollbar.umd.js.map +1 -1
- package/dist/rollbar.umd.min.js +1 -1
- package/dist/rollbar.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/browser/replay/recorder.js +19 -19
- package/src/browser/replay/replayManager.js +25 -25
- package/src/defaults.js +1 -1
- package/src/telemetry.js +10 -10
- package/src/tracing/session.js +4 -4
package/dist/rollbar.cjs
CHANGED
|
@@ -2146,7 +2146,7 @@ var logger = {
|
|
|
2146
2146
|
/**
|
|
2147
2147
|
* Default options shared across platforms
|
|
2148
2148
|
*/
|
|
2149
|
-
var version = '3.0.0-beta.
|
|
2149
|
+
var version = '3.0.0-beta.3';
|
|
2150
2150
|
var endpoint = 'api.rollbar.com/api/1/item/';
|
|
2151
2151
|
var logLevel = 'debug';
|
|
2152
2152
|
var reportLevel = 'debug';
|
|
@@ -2510,8 +2510,8 @@ function _currentTime() {
|
|
|
2510
2510
|
;// external "url"
|
|
2511
2511
|
const external_url_namespaceObject = require("url");
|
|
2512
2512
|
;// ./src/telemetry.js
|
|
2513
|
-
function telemetry_typeof(o) { "@babel/helpers - typeof"; return telemetry_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, telemetry_typeof(o); }
|
|
2514
2513
|
var _excluded = ["otelAttributes"];
|
|
2514
|
+
function telemetry_typeof(o) { "@babel/helpers - typeof"; return telemetry_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, telemetry_typeof(o); }
|
|
2515
2515
|
function telemetry_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2516
2516
|
function telemetry_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? telemetry_ownKeys(Object(t), !0).forEach(function (r) { telemetry_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : telemetry_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2517
2517
|
function telemetry_defineProperty(e, r, t) { return (r = telemetry_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -2522,9 +2522,6 @@ function telemetry_defineProperties(e, r) { for (var t = 0; t < r.length; t++) {
|
|
|
2522
2522
|
function telemetry_createClass(e, r, t) { return r && telemetry_defineProperties(e.prototype, r), t && telemetry_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
2523
2523
|
function telemetry_toPropertyKey(t) { var i = telemetry_toPrimitive(t, "string"); return "symbol" == telemetry_typeof(i) ? i : i + ""; }
|
|
2524
2524
|
function telemetry_toPrimitive(t, r) { if ("object" != telemetry_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != telemetry_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
2525
|
-
function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
|
|
2526
|
-
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
2527
|
-
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
|
2528
2525
|
|
|
2529
2526
|
var MAX_EVENTS = 100;
|
|
2530
2527
|
|
|
@@ -2532,12 +2529,10 @@ var MAX_EVENTS = 100;
|
|
|
2532
2529
|
function fromMillis(millis) {
|
|
2533
2530
|
return [Math.trunc(millis / 1000), Math.round(millis % 1000 * 1e6)];
|
|
2534
2531
|
}
|
|
2535
|
-
var _Telemeter_brand = /*#__PURE__*/new WeakSet();
|
|
2536
2532
|
var Telemeter = /*#__PURE__*/function () {
|
|
2537
2533
|
function Telemeter(options, tracing) {
|
|
2538
2534
|
var _this$tracing;
|
|
2539
2535
|
telemetry_classCallCheck(this, Telemeter);
|
|
2540
|
-
_classPrivateMethodInitSpec(this, _Telemeter_brand);
|
|
2541
2536
|
this.queue = [];
|
|
2542
2537
|
this.options = src_merge(options);
|
|
2543
2538
|
var maxTelemetryEvents = this.options.maxTelemetryEvents || MAX_EVENTS;
|
|
@@ -2749,9 +2744,9 @@ var Telemeter = /*#__PURE__*/function () {
|
|
|
2749
2744
|
value: value,
|
|
2750
2745
|
endTimeUnixNano: fromMillis(timestamp)
|
|
2751
2746
|
};
|
|
2752
|
-
var event =
|
|
2747
|
+
var event = this._getRepeatedEvent(name, otelAttributes);
|
|
2753
2748
|
if (event) {
|
|
2754
|
-
return
|
|
2749
|
+
return this._updateRepeatedEvent(event, otelAttributes, timestamp);
|
|
2755
2750
|
}
|
|
2756
2751
|
(_this$telemetrySpan5 = this.telemetrySpan) === null || _this$telemetrySpan5 === void 0 || _this$telemetrySpan5.addEvent(name, otelAttributes, fromMillis(timestamp));
|
|
2757
2752
|
return this.capture('dom', metadata, 'info', null, timestamp, otelAttributes);
|
|
@@ -2776,13 +2771,40 @@ var Telemeter = /*#__PURE__*/function () {
|
|
|
2776
2771
|
element: element,
|
|
2777
2772
|
endTimeUnixNano: fromMillis(timestamp)
|
|
2778
2773
|
};
|
|
2779
|
-
var event =
|
|
2774
|
+
var event = this._getRepeatedEvent(name, otelAttributes);
|
|
2780
2775
|
if (event) {
|
|
2781
|
-
return
|
|
2776
|
+
return this._updateRepeatedEvent(event, otelAttributes, timestamp);
|
|
2782
2777
|
}
|
|
2783
2778
|
(_this$telemetrySpan6 = this.telemetrySpan) === null || _this$telemetrySpan6 === void 0 || _this$telemetrySpan6.addEvent(name, otelAttributes, fromMillis(timestamp));
|
|
2784
2779
|
return this.capture('dom', metadata, 'info', null, timestamp, otelAttributes);
|
|
2785
2780
|
}
|
|
2781
|
+
}, {
|
|
2782
|
+
key: "_getRepeatedEvent",
|
|
2783
|
+
value: function _getRepeatedEvent(name, attributes) {
|
|
2784
|
+
var lastEvent = this._lastEvent(this.queue);
|
|
2785
|
+
if (lastEvent && lastEvent.body.type === name && lastEvent.otelAttributes.target === attributes.target) {
|
|
2786
|
+
return lastEvent;
|
|
2787
|
+
}
|
|
2788
|
+
}
|
|
2789
|
+
}, {
|
|
2790
|
+
key: "_updateRepeatedEvent",
|
|
2791
|
+
value: function _updateRepeatedEvent(event, attributes, timestamp) {
|
|
2792
|
+
var duration = Math.max(timestamp - event.timestamp_ms, 1);
|
|
2793
|
+
event.body.value = attributes.value;
|
|
2794
|
+
event.otelAttributes.value = attributes.value;
|
|
2795
|
+
event.otelAttributes.height = attributes.height;
|
|
2796
|
+
event.otelAttributes.width = attributes.width;
|
|
2797
|
+
event.otelAttributes.textZoomRatio = attributes.textZoomRatio;
|
|
2798
|
+
event.otelAttributes['endTimeUnixNano'] = fromMillis(timestamp);
|
|
2799
|
+
event.otelAttributes['durationUnixNano'] = fromMillis(duration);
|
|
2800
|
+
event.otelAttributes.count = (event.otelAttributes.count || 1) + 1;
|
|
2801
|
+
event.otelAttributes.ratio = event.otelAttributes.count / (duration / 1000);
|
|
2802
|
+
}
|
|
2803
|
+
}, {
|
|
2804
|
+
key: "_lastEvent",
|
|
2805
|
+
value: function _lastEvent(list) {
|
|
2806
|
+
return list.length > 0 ? list[list.length - 1] : null;
|
|
2807
|
+
}
|
|
2786
2808
|
}, {
|
|
2787
2809
|
key: "captureFocus",
|
|
2788
2810
|
value: function captureFocus(_ref4) {
|
|
@@ -2830,9 +2852,9 @@ var Telemeter = /*#__PURE__*/function () {
|
|
|
2830
2852
|
height: height,
|
|
2831
2853
|
textZoomRatio: textZoomRatio
|
|
2832
2854
|
};
|
|
2833
|
-
var event =
|
|
2855
|
+
var event = this._getRepeatedEvent(name, otelAttributes);
|
|
2834
2856
|
if (event) {
|
|
2835
|
-
return
|
|
2857
|
+
return this._updateRepeatedEvent(event, otelAttributes, timestamp);
|
|
2836
2858
|
}
|
|
2837
2859
|
(_this$telemetrySpan8 = this.telemetrySpan) === null || _this$telemetrySpan8 === void 0 || _this$telemetrySpan8.addEvent(name, otelAttributes, fromMillis(timestamp));
|
|
2838
2860
|
return this.capture('dom', metadata, 'info', null, timestamp, otelAttributes);
|
|
@@ -2972,27 +2994,6 @@ var Telemeter = /*#__PURE__*/function () {
|
|
|
2972
2994
|
}
|
|
2973
2995
|
}]);
|
|
2974
2996
|
}();
|
|
2975
|
-
function _getRepeatedEvent(name, attributes) {
|
|
2976
|
-
var lastEvent = _assertClassBrand(_Telemeter_brand, this, _lastEvent).call(this, this.queue);
|
|
2977
|
-
if (lastEvent && lastEvent.body.type === name && lastEvent.otelAttributes.target === attributes.target) {
|
|
2978
|
-
return lastEvent;
|
|
2979
|
-
}
|
|
2980
|
-
}
|
|
2981
|
-
function _updateRepeatedEvent(event, attributes, timestamp) {
|
|
2982
|
-
var duration = Math.max(timestamp - event.timestamp_ms, 1);
|
|
2983
|
-
event.body.value = attributes.value;
|
|
2984
|
-
event.otelAttributes.value = attributes.value;
|
|
2985
|
-
event.otelAttributes.height = attributes.height;
|
|
2986
|
-
event.otelAttributes.width = attributes.width;
|
|
2987
|
-
event.otelAttributes.textZoomRatio = attributes.textZoomRatio;
|
|
2988
|
-
event.otelAttributes['endTimeUnixNano'] = fromMillis(timestamp);
|
|
2989
|
-
event.otelAttributes['durationUnixNano'] = fromMillis(duration);
|
|
2990
|
-
event.otelAttributes.count = (event.otelAttributes.count || 1) + 1;
|
|
2991
|
-
event.otelAttributes.ratio = event.otelAttributes.count / (duration / 1000);
|
|
2992
|
-
}
|
|
2993
|
-
function _lastEvent(list) {
|
|
2994
|
-
return list.length > 0 ? list[list.length - 1] : null;
|
|
2995
|
-
}
|
|
2996
2997
|
function getLevel(type, level) {
|
|
2997
2998
|
if (level) {
|
|
2998
2999
|
return level;
|
package/dist/rollbar.js
CHANGED
|
@@ -3786,13 +3786,9 @@ function replayManager_asyncToGenerator(n) { return function () { var t = this,
|
|
|
3786
3786
|
function replayManager_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
3787
3787
|
function replayManager_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, replayManager_toPropertyKey(o.key), o); } }
|
|
3788
3788
|
function replayManager_createClass(e, r, t) { return r && replayManager_defineProperties(e.prototype, r), t && replayManager_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
3789
|
+
function replayManager_defineProperty(e, r, t) { return (r = replayManager_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
3789
3790
|
function replayManager_toPropertyKey(t) { var i = replayManager_toPrimitive(t, "string"); return "symbol" == replayManager_typeof(i) ? i : i + ""; }
|
|
3790
3791
|
function replayManager_toPrimitive(t, r) { if ("object" != replayManager_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != replayManager_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
3791
|
-
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
|
3792
|
-
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
3793
|
-
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
|
3794
|
-
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
|
3795
|
-
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
|
3796
3792
|
|
|
3797
3793
|
|
|
3798
3794
|
|
|
@@ -3801,11 +3797,6 @@ function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.h
|
|
|
3801
3797
|
* session recordings. This class handles the coordination between when recordings
|
|
3802
3798
|
* are dumped and when they are eventually sent to the backend.
|
|
3803
3799
|
*/
|
|
3804
|
-
var _map = /*#__PURE__*/new WeakMap();
|
|
3805
|
-
var _recorder = /*#__PURE__*/new WeakMap();
|
|
3806
|
-
var _api = /*#__PURE__*/new WeakMap();
|
|
3807
|
-
var _tracing = /*#__PURE__*/new WeakMap();
|
|
3808
|
-
var _telemeter = /*#__PURE__*/new WeakMap();
|
|
3809
3800
|
var ReplayManager = /*#__PURE__*/function () {
|
|
3810
3801
|
/**
|
|
3811
3802
|
* Creates a new ReplayManager instance
|
|
@@ -3821,11 +3812,11 @@ var ReplayManager = /*#__PURE__*/function () {
|
|
|
3821
3812
|
tracing = _ref.tracing,
|
|
3822
3813
|
telemeter = _ref.telemeter;
|
|
3823
3814
|
replayManager_classCallCheck(this, ReplayManager);
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3815
|
+
replayManager_defineProperty(this, "_map", void 0);
|
|
3816
|
+
replayManager_defineProperty(this, "_recorder", void 0);
|
|
3817
|
+
replayManager_defineProperty(this, "_api", void 0);
|
|
3818
|
+
replayManager_defineProperty(this, "_tracing", void 0);
|
|
3819
|
+
replayManager_defineProperty(this, "_telemeter", void 0);
|
|
3829
3820
|
if (!recorder) {
|
|
3830
3821
|
throw new TypeError("Expected 'recorder' to be provided");
|
|
3831
3822
|
}
|
|
@@ -3835,11 +3826,11 @@ var ReplayManager = /*#__PURE__*/function () {
|
|
|
3835
3826
|
if (!tracing) {
|
|
3836
3827
|
throw new TypeError("Expected 'tracing' to be provided");
|
|
3837
3828
|
}
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
|
|
3829
|
+
this._map = new Map();
|
|
3830
|
+
this._recorder = recorder;
|
|
3831
|
+
this._api = api;
|
|
3832
|
+
this._tracing = tracing;
|
|
3833
|
+
this._telemeter = telemeter;
|
|
3843
3834
|
}
|
|
3844
3835
|
|
|
3845
3836
|
/**
|
|
@@ -3856,19 +3847,19 @@ var ReplayManager = /*#__PURE__*/function () {
|
|
|
3856
3847
|
key: "_processReplay",
|
|
3857
3848
|
value: (function () {
|
|
3858
3849
|
var _processReplay2 = replayManager_asyncToGenerator(/*#__PURE__*/replayManager_regeneratorRuntime().mark(function _callee(replayId, occurrenceUuid) {
|
|
3859
|
-
var
|
|
3850
|
+
var _this$_telemeter, payload;
|
|
3860
3851
|
return replayManager_regeneratorRuntime().wrap(function _callee$(_context) {
|
|
3861
3852
|
while (1) switch (_context.prev = _context.next) {
|
|
3862
3853
|
case 0:
|
|
3863
3854
|
try {
|
|
3864
|
-
(
|
|
3855
|
+
(_this$_telemeter = this._telemeter) === null || _this$_telemeter === void 0 || _this$_telemeter.exportTelemetrySpan({
|
|
3865
3856
|
'rollbar.replay.id': replayId
|
|
3866
3857
|
});
|
|
3867
|
-
payload =
|
|
3868
|
-
|
|
3858
|
+
payload = this._recorder.dump(this._tracing, replayId, occurrenceUuid);
|
|
3859
|
+
this._map.set(replayId, payload);
|
|
3869
3860
|
} catch (transformError) {
|
|
3870
3861
|
logger.error('Error transforming spans:', transformError);
|
|
3871
|
-
|
|
3862
|
+
this._map.set(replayId, null); // TODO(matux): Error span?
|
|
3872
3863
|
}
|
|
3873
3864
|
return _context.abrupt("return", replayId);
|
|
3874
3865
|
case 2:
|
|
@@ -3928,15 +3919,15 @@ var ReplayManager = /*#__PURE__*/function () {
|
|
|
3928
3919
|
logger.error('ReplayManager.send: No replayId provided');
|
|
3929
3920
|
return _context2.abrupt("return", false);
|
|
3930
3921
|
case 3:
|
|
3931
|
-
if (
|
|
3922
|
+
if (this._map.has(replayId)) {
|
|
3932
3923
|
_context2.next = 6;
|
|
3933
3924
|
break;
|
|
3934
3925
|
}
|
|
3935
3926
|
logger.error("ReplayManager.send: No replay found for replayId: ".concat(replayId));
|
|
3936
3927
|
return _context2.abrupt("return", false);
|
|
3937
3928
|
case 6:
|
|
3938
|
-
payload =
|
|
3939
|
-
|
|
3929
|
+
payload = this._map.get(replayId);
|
|
3930
|
+
this._map.delete(replayId);
|
|
3940
3931
|
|
|
3941
3932
|
// Check if payload is empty (could be raw spans array or OTLP payload)
|
|
3942
3933
|
isEmpty = !payload || Array.isArray(payload) && payload.length === 0 || payload.resourceSpans && payload.resourceSpans.length === 0;
|
|
@@ -3949,7 +3940,7 @@ var ReplayManager = /*#__PURE__*/function () {
|
|
|
3949
3940
|
case 12:
|
|
3950
3941
|
_context2.prev = 12;
|
|
3951
3942
|
_context2.next = 15;
|
|
3952
|
-
return
|
|
3943
|
+
return this._api.postSpans(payload, {
|
|
3953
3944
|
'X-Rollbar-Replay-Id': replayId
|
|
3954
3945
|
});
|
|
3955
3946
|
case 15:
|
|
@@ -3985,11 +3976,11 @@ var ReplayManager = /*#__PURE__*/function () {
|
|
|
3985
3976
|
logger.error('ReplayManager.discard: No replayId provided');
|
|
3986
3977
|
return false;
|
|
3987
3978
|
}
|
|
3988
|
-
if (!
|
|
3979
|
+
if (!this._map.has(replayId)) {
|
|
3989
3980
|
logger.error("ReplayManager.discard: No replay found for replayId: ".concat(replayId));
|
|
3990
3981
|
return false;
|
|
3991
3982
|
}
|
|
3992
|
-
|
|
3983
|
+
this._map.delete(replayId);
|
|
3993
3984
|
return true;
|
|
3994
3985
|
}
|
|
3995
3986
|
|
|
@@ -4002,8 +3993,8 @@ var ReplayManager = /*#__PURE__*/function () {
|
|
|
4002
3993
|
}, {
|
|
4003
3994
|
key: "getSpans",
|
|
4004
3995
|
value: function getSpans(replayId) {
|
|
4005
|
-
var
|
|
4006
|
-
return (
|
|
3996
|
+
var _this$_map$get;
|
|
3997
|
+
return (_this$_map$get = this._map.get(replayId)) !== null && _this$_map$get !== void 0 ? _this$_map$get : null;
|
|
4007
3998
|
}
|
|
4008
3999
|
|
|
4009
4000
|
/**
|
|
@@ -4015,7 +4006,7 @@ var ReplayManager = /*#__PURE__*/function () {
|
|
|
4015
4006
|
}, {
|
|
4016
4007
|
key: "setSpans",
|
|
4017
4008
|
value: function setSpans(replayId, spans) {
|
|
4018
|
-
|
|
4009
|
+
this._map.set(replayId, spans);
|
|
4019
4010
|
}
|
|
4020
4011
|
|
|
4021
4012
|
/**
|
|
@@ -4026,7 +4017,7 @@ var ReplayManager = /*#__PURE__*/function () {
|
|
|
4026
4017
|
}, {
|
|
4027
4018
|
key: "size",
|
|
4028
4019
|
get: function get() {
|
|
4029
|
-
return
|
|
4020
|
+
return this._map.size;
|
|
4030
4021
|
}
|
|
4031
4022
|
|
|
4032
4023
|
/**
|
|
@@ -4035,7 +4026,7 @@ var ReplayManager = /*#__PURE__*/function () {
|
|
|
4035
4026
|
}, {
|
|
4036
4027
|
key: "clear",
|
|
4037
4028
|
value: function clear() {
|
|
4038
|
-
|
|
4029
|
+
this._map.clear();
|
|
4039
4030
|
}
|
|
4040
4031
|
}]);
|
|
4041
4032
|
}();
|
|
@@ -4044,7 +4035,7 @@ var ReplayManager = /*#__PURE__*/function () {
|
|
|
4044
4035
|
/**
|
|
4045
4036
|
* Default options shared across platforms
|
|
4046
4037
|
*/
|
|
4047
|
-
var version = '3.0.0-beta.
|
|
4038
|
+
var version = '3.0.0-beta.3';
|
|
4048
4039
|
var endpoint = 'api.rollbar.com/api/1/item/';
|
|
4049
4040
|
var logLevel = 'debug';
|
|
4050
4041
|
var reportLevel = 'debug';
|
|
@@ -4607,8 +4598,8 @@ var core_defaultOptions = {
|
|
|
4607
4598
|
};
|
|
4608
4599
|
/* harmony default export */ var core = (core_Rollbar);
|
|
4609
4600
|
;// ./src/telemetry.js
|
|
4610
|
-
function telemetry_typeof(o) { "@babel/helpers - typeof"; return telemetry_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, telemetry_typeof(o); }
|
|
4611
4601
|
var _excluded = ["otelAttributes"];
|
|
4602
|
+
function telemetry_typeof(o) { "@babel/helpers - typeof"; return telemetry_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, telemetry_typeof(o); }
|
|
4612
4603
|
function telemetry_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4613
4604
|
function telemetry_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? telemetry_ownKeys(Object(t), !0).forEach(function (r) { telemetry_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : telemetry_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4614
4605
|
function telemetry_defineProperty(e, r, t) { return (r = telemetry_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -4619,9 +4610,6 @@ function telemetry_defineProperties(e, r) { for (var t = 0; t < r.length; t++) {
|
|
|
4619
4610
|
function telemetry_createClass(e, r, t) { return r && telemetry_defineProperties(e.prototype, r), t && telemetry_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
4620
4611
|
function telemetry_toPropertyKey(t) { var i = telemetry_toPrimitive(t, "string"); return "symbol" == telemetry_typeof(i) ? i : i + ""; }
|
|
4621
4612
|
function telemetry_toPrimitive(t, r) { if ("object" != telemetry_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != telemetry_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
4622
|
-
function _classPrivateMethodInitSpec(e, a) { telemetry_checkPrivateRedeclaration(e, a), a.add(e); }
|
|
4623
|
-
function telemetry_checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
4624
|
-
function telemetry_assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
|
4625
4613
|
|
|
4626
4614
|
var MAX_EVENTS = 100;
|
|
4627
4615
|
|
|
@@ -4629,12 +4617,10 @@ var MAX_EVENTS = 100;
|
|
|
4629
4617
|
function fromMillis(millis) {
|
|
4630
4618
|
return [Math.trunc(millis / 1000), Math.round(millis % 1000 * 1e6)];
|
|
4631
4619
|
}
|
|
4632
|
-
var _Telemeter_brand = /*#__PURE__*/new WeakSet();
|
|
4633
4620
|
var Telemeter = /*#__PURE__*/function () {
|
|
4634
4621
|
function Telemeter(options, tracing) {
|
|
4635
4622
|
var _this$tracing;
|
|
4636
4623
|
telemetry_classCallCheck(this, Telemeter);
|
|
4637
|
-
_classPrivateMethodInitSpec(this, _Telemeter_brand);
|
|
4638
4624
|
this.queue = [];
|
|
4639
4625
|
this.options = src_merge(options);
|
|
4640
4626
|
var maxTelemetryEvents = this.options.maxTelemetryEvents || MAX_EVENTS;
|
|
@@ -4846,9 +4832,9 @@ var Telemeter = /*#__PURE__*/function () {
|
|
|
4846
4832
|
value: value,
|
|
4847
4833
|
endTimeUnixNano: fromMillis(timestamp)
|
|
4848
4834
|
};
|
|
4849
|
-
var event =
|
|
4835
|
+
var event = this._getRepeatedEvent(name, otelAttributes);
|
|
4850
4836
|
if (event) {
|
|
4851
|
-
return
|
|
4837
|
+
return this._updateRepeatedEvent(event, otelAttributes, timestamp);
|
|
4852
4838
|
}
|
|
4853
4839
|
(_this$telemetrySpan5 = this.telemetrySpan) === null || _this$telemetrySpan5 === void 0 || _this$telemetrySpan5.addEvent(name, otelAttributes, fromMillis(timestamp));
|
|
4854
4840
|
return this.capture('dom', metadata, 'info', null, timestamp, otelAttributes);
|
|
@@ -4873,13 +4859,40 @@ var Telemeter = /*#__PURE__*/function () {
|
|
|
4873
4859
|
element: element,
|
|
4874
4860
|
endTimeUnixNano: fromMillis(timestamp)
|
|
4875
4861
|
};
|
|
4876
|
-
var event =
|
|
4862
|
+
var event = this._getRepeatedEvent(name, otelAttributes);
|
|
4877
4863
|
if (event) {
|
|
4878
|
-
return
|
|
4864
|
+
return this._updateRepeatedEvent(event, otelAttributes, timestamp);
|
|
4879
4865
|
}
|
|
4880
4866
|
(_this$telemetrySpan6 = this.telemetrySpan) === null || _this$telemetrySpan6 === void 0 || _this$telemetrySpan6.addEvent(name, otelAttributes, fromMillis(timestamp));
|
|
4881
4867
|
return this.capture('dom', metadata, 'info', null, timestamp, otelAttributes);
|
|
4882
4868
|
}
|
|
4869
|
+
}, {
|
|
4870
|
+
key: "_getRepeatedEvent",
|
|
4871
|
+
value: function _getRepeatedEvent(name, attributes) {
|
|
4872
|
+
var lastEvent = this._lastEvent(this.queue);
|
|
4873
|
+
if (lastEvent && lastEvent.body.type === name && lastEvent.otelAttributes.target === attributes.target) {
|
|
4874
|
+
return lastEvent;
|
|
4875
|
+
}
|
|
4876
|
+
}
|
|
4877
|
+
}, {
|
|
4878
|
+
key: "_updateRepeatedEvent",
|
|
4879
|
+
value: function _updateRepeatedEvent(event, attributes, timestamp) {
|
|
4880
|
+
var duration = Math.max(timestamp - event.timestamp_ms, 1);
|
|
4881
|
+
event.body.value = attributes.value;
|
|
4882
|
+
event.otelAttributes.value = attributes.value;
|
|
4883
|
+
event.otelAttributes.height = attributes.height;
|
|
4884
|
+
event.otelAttributes.width = attributes.width;
|
|
4885
|
+
event.otelAttributes.textZoomRatio = attributes.textZoomRatio;
|
|
4886
|
+
event.otelAttributes['endTimeUnixNano'] = fromMillis(timestamp);
|
|
4887
|
+
event.otelAttributes['durationUnixNano'] = fromMillis(duration);
|
|
4888
|
+
event.otelAttributes.count = (event.otelAttributes.count || 1) + 1;
|
|
4889
|
+
event.otelAttributes.ratio = event.otelAttributes.count / (duration / 1000);
|
|
4890
|
+
}
|
|
4891
|
+
}, {
|
|
4892
|
+
key: "_lastEvent",
|
|
4893
|
+
value: function _lastEvent(list) {
|
|
4894
|
+
return list.length > 0 ? list[list.length - 1] : null;
|
|
4895
|
+
}
|
|
4883
4896
|
}, {
|
|
4884
4897
|
key: "captureFocus",
|
|
4885
4898
|
value: function captureFocus(_ref4) {
|
|
@@ -4927,9 +4940,9 @@ var Telemeter = /*#__PURE__*/function () {
|
|
|
4927
4940
|
height: height,
|
|
4928
4941
|
textZoomRatio: textZoomRatio
|
|
4929
4942
|
};
|
|
4930
|
-
var event =
|
|
4943
|
+
var event = this._getRepeatedEvent(name, otelAttributes);
|
|
4931
4944
|
if (event) {
|
|
4932
|
-
return
|
|
4945
|
+
return this._updateRepeatedEvent(event, otelAttributes, timestamp);
|
|
4933
4946
|
}
|
|
4934
4947
|
(_this$telemetrySpan8 = this.telemetrySpan) === null || _this$telemetrySpan8 === void 0 || _this$telemetrySpan8.addEvent(name, otelAttributes, fromMillis(timestamp));
|
|
4935
4948
|
return this.capture('dom', metadata, 'info', null, timestamp, otelAttributes);
|
|
@@ -5069,27 +5082,6 @@ var Telemeter = /*#__PURE__*/function () {
|
|
|
5069
5082
|
}
|
|
5070
5083
|
}]);
|
|
5071
5084
|
}();
|
|
5072
|
-
function _getRepeatedEvent(name, attributes) {
|
|
5073
|
-
var lastEvent = telemetry_assertClassBrand(_Telemeter_brand, this, _lastEvent).call(this, this.queue);
|
|
5074
|
-
if (lastEvent && lastEvent.body.type === name && lastEvent.otelAttributes.target === attributes.target) {
|
|
5075
|
-
return lastEvent;
|
|
5076
|
-
}
|
|
5077
|
-
}
|
|
5078
|
-
function _updateRepeatedEvent(event, attributes, timestamp) {
|
|
5079
|
-
var duration = Math.max(timestamp - event.timestamp_ms, 1);
|
|
5080
|
-
event.body.value = attributes.value;
|
|
5081
|
-
event.otelAttributes.value = attributes.value;
|
|
5082
|
-
event.otelAttributes.height = attributes.height;
|
|
5083
|
-
event.otelAttributes.width = attributes.width;
|
|
5084
|
-
event.otelAttributes.textZoomRatio = attributes.textZoomRatio;
|
|
5085
|
-
event.otelAttributes['endTimeUnixNano'] = fromMillis(timestamp);
|
|
5086
|
-
event.otelAttributes['durationUnixNano'] = fromMillis(duration);
|
|
5087
|
-
event.otelAttributes.count = (event.otelAttributes.count || 1) + 1;
|
|
5088
|
-
event.otelAttributes.ratio = event.otelAttributes.count / (duration / 1000);
|
|
5089
|
-
}
|
|
5090
|
-
function _lastEvent(list) {
|
|
5091
|
-
return list.length > 0 ? list[list.length - 1] : null;
|
|
5092
|
-
}
|
|
5093
5085
|
function getLevel(type, level) {
|
|
5094
5086
|
if (level) {
|
|
5095
5087
|
return level;
|
|
@@ -6598,29 +6590,23 @@ function createContextKey(key) {
|
|
|
6598
6590
|
function session_typeof(o) { "@babel/helpers - typeof"; return session_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, session_typeof(o); }
|
|
6599
6591
|
function session_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6600
6592
|
function session_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? session_ownKeys(Object(t), !0).forEach(function (r) { session_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : session_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6601
|
-
function session_defineProperty(e, r, t) { return (r = session_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
6602
6593
|
function session_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
6603
6594
|
function session_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, session_toPropertyKey(o.key), o); } }
|
|
6604
6595
|
function session_createClass(e, r, t) { return r && session_defineProperties(e.prototype, r), t && session_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
6596
|
+
function session_defineProperty(e, r, t) { return (r = session_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
6605
6597
|
function session_toPropertyKey(t) { var i = session_toPrimitive(t, "string"); return "symbol" == session_typeof(i) ? i : i + ""; }
|
|
6606
6598
|
function session_toPrimitive(t, r) { if ("object" != session_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != session_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
6607
|
-
function session_classPrivateFieldInitSpec(e, t, a) { session_checkPrivateRedeclaration(e, t), t.set(e, a); }
|
|
6608
|
-
function session_checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
6609
|
-
function session_classPrivateFieldGet(s, a) { return s.get(session_assertClassBrand(s, a)); }
|
|
6610
|
-
function session_classPrivateFieldSet(s, a, r) { return s.set(session_assertClassBrand(s, a), r), r; }
|
|
6611
|
-
function session_assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
|
6612
6599
|
|
|
6613
6600
|
var SESSION_KEY = 'RollbarSession';
|
|
6614
|
-
var _attributes = /*#__PURE__*/new WeakMap();
|
|
6615
6601
|
var Session = /*#__PURE__*/function () {
|
|
6616
6602
|
function Session(tracing, options) {
|
|
6617
6603
|
session_classCallCheck(this, Session);
|
|
6618
|
-
|
|
6604
|
+
session_defineProperty(this, "_attributes", void 0);
|
|
6619
6605
|
this.options = options;
|
|
6620
6606
|
this.tracing = tracing;
|
|
6621
6607
|
this.window = tracing.window;
|
|
6622
6608
|
this.session = null;
|
|
6623
|
-
|
|
6609
|
+
this._attributes = {};
|
|
6624
6610
|
}
|
|
6625
6611
|
return session_createClass(Session, [{
|
|
6626
6612
|
key: "init",
|
|
@@ -6667,12 +6653,12 @@ var Session = /*#__PURE__*/function () {
|
|
|
6667
6653
|
}, {
|
|
6668
6654
|
key: "attributes",
|
|
6669
6655
|
get: function get() {
|
|
6670
|
-
return
|
|
6656
|
+
return this._attributes;
|
|
6671
6657
|
}
|
|
6672
6658
|
}, {
|
|
6673
6659
|
key: "setAttributes",
|
|
6674
6660
|
value: function setAttributes(attributes) {
|
|
6675
|
-
|
|
6661
|
+
this._attributes = session_objectSpread(session_objectSpread({}, this._attributes), attributes);
|
|
6676
6662
|
return this;
|
|
6677
6663
|
}
|
|
6678
6664
|
}]);
|
|
@@ -21580,28 +21566,18 @@ function recorder_unsupportedIterableToArray(r, a) { if (r) { if ("string" == ty
|
|
|
21580
21566
|
function recorder_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
21581
21567
|
function recorder_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
21582
21568
|
function recorder_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? recorder_ownKeys(Object(t), !0).forEach(function (r) { recorder_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : recorder_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
21583
|
-
function recorder_defineProperty(e, r, t) { return (r = recorder_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
21584
21569
|
function recorder_objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = recorder_objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
21585
21570
|
function recorder_objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
21586
21571
|
function recorder_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
21587
21572
|
function recorder_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, recorder_toPropertyKey(o.key), o); } }
|
|
21588
21573
|
function recorder_createClass(e, r, t) { return r && recorder_defineProperties(e.prototype, r), t && recorder_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
21574
|
+
function recorder_defineProperty(e, r, t) { return (r = recorder_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
21589
21575
|
function recorder_toPropertyKey(t) { var i = recorder_toPrimitive(t, "string"); return "symbol" == recorder_typeof(i) ? i : i + ""; }
|
|
21590
21576
|
function recorder_toPrimitive(t, r) { if ("object" != recorder_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != recorder_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
21591
|
-
function recorder_classPrivateFieldInitSpec(e, t, a) { recorder_checkPrivateRedeclaration(e, t), t.set(e, a); }
|
|
21592
|
-
function recorder_checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
21593
|
-
function recorder_classPrivateFieldGet(s, a) { return s.get(recorder_assertClassBrand(s, a)); }
|
|
21594
|
-
function recorder_classPrivateFieldSet(s, a, r) { return s.set(recorder_assertClassBrand(s, a), r), r; }
|
|
21595
|
-
function recorder_assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
|
21596
21577
|
|
|
21597
21578
|
|
|
21598
21579
|
|
|
21599
21580
|
|
|
21600
|
-
var _options = /*#__PURE__*/new WeakMap();
|
|
21601
|
-
var _rrwebOptions = /*#__PURE__*/new WeakMap();
|
|
21602
|
-
var _stopFn = /*#__PURE__*/new WeakMap();
|
|
21603
|
-
var _recordFn = /*#__PURE__*/new WeakMap();
|
|
21604
|
-
var _events = /*#__PURE__*/new WeakMap();
|
|
21605
21581
|
var Recorder = /*#__PURE__*/function () {
|
|
21606
21582
|
/**
|
|
21607
21583
|
* Creates a new Recorder instance for capturing DOM events
|
|
@@ -21612,11 +21588,11 @@ var Recorder = /*#__PURE__*/function () {
|
|
|
21612
21588
|
function Recorder(options) {
|
|
21613
21589
|
var recordFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : record;
|
|
21614
21590
|
recorder_classCallCheck(this, Recorder);
|
|
21615
|
-
|
|
21616
|
-
|
|
21617
|
-
|
|
21618
|
-
|
|
21619
|
-
|
|
21591
|
+
recorder_defineProperty(this, "_options", void 0);
|
|
21592
|
+
recorder_defineProperty(this, "_rrwebOptions", void 0);
|
|
21593
|
+
recorder_defineProperty(this, "_stopFn", null);
|
|
21594
|
+
recorder_defineProperty(this, "_recordFn", void 0);
|
|
21595
|
+
recorder_defineProperty(this, "_events", {
|
|
21620
21596
|
previous: [],
|
|
21621
21597
|
current: []
|
|
21622
21598
|
});
|
|
@@ -21624,17 +21600,17 @@ var Recorder = /*#__PURE__*/function () {
|
|
|
21624
21600
|
throw new TypeError("Expected 'recordFn' to be provided");
|
|
21625
21601
|
}
|
|
21626
21602
|
this.options = options;
|
|
21627
|
-
|
|
21603
|
+
this._recordFn = recordFn;
|
|
21628
21604
|
}
|
|
21629
21605
|
return recorder_createClass(Recorder, [{
|
|
21630
21606
|
key: "isRecording",
|
|
21631
21607
|
get: function get() {
|
|
21632
|
-
return
|
|
21608
|
+
return this._stopFn !== null;
|
|
21633
21609
|
}
|
|
21634
21610
|
}, {
|
|
21635
21611
|
key: "options",
|
|
21636
21612
|
get: function get() {
|
|
21637
|
-
return
|
|
21613
|
+
return this._options;
|
|
21638
21614
|
},
|
|
21639
21615
|
set: function set(newOptions) {
|
|
21640
21616
|
this.configure(newOptions);
|
|
@@ -21650,14 +21626,14 @@ var Recorder = /*#__PURE__*/function () {
|
|
|
21650
21626
|
emit = newOptions.emit,
|
|
21651
21627
|
checkoutEveryNms = newOptions.checkoutEveryNms,
|
|
21652
21628
|
rrwebOptions = recorder_objectWithoutProperties(newOptions, recorder_excluded);
|
|
21653
|
-
|
|
21629
|
+
this._options = {
|
|
21654
21630
|
enabled: enabled,
|
|
21655
21631
|
autoStart: autoStart,
|
|
21656
21632
|
maxSeconds: maxSeconds,
|
|
21657
21633
|
triggers: triggers,
|
|
21658
21634
|
debug: debug
|
|
21659
|
-
}
|
|
21660
|
-
|
|
21635
|
+
};
|
|
21636
|
+
this._rrwebOptions = rrwebOptions;
|
|
21661
21637
|
if (this.isRecording && newOptions.enabled === false) {
|
|
21662
21638
|
this.stop();
|
|
21663
21639
|
}
|
|
@@ -21685,7 +21661,7 @@ var Recorder = /*#__PURE__*/function () {
|
|
|
21685
21661
|
key: "dump",
|
|
21686
21662
|
value: function dump(tracing, replayId, occurrenceUuid) {
|
|
21687
21663
|
var _tracing$session$attr, _tracing$session;
|
|
21688
|
-
var events =
|
|
21664
|
+
var events = this._events.previous.concat(this._events.current);
|
|
21689
21665
|
if (events.length < 2) {
|
|
21690
21666
|
logger.error('Replay recording cannot have less than 2 events');
|
|
21691
21667
|
return null;
|
|
@@ -21728,17 +21704,17 @@ var Recorder = /*#__PURE__*/function () {
|
|
|
21728
21704
|
return;
|
|
21729
21705
|
}
|
|
21730
21706
|
this.clear();
|
|
21731
|
-
|
|
21707
|
+
this._stopFn = this._recordFn(recorder_objectSpread({
|
|
21732
21708
|
emit: function emit(event, isCheckout) {
|
|
21733
21709
|
var _this$options$debug;
|
|
21734
21710
|
if ((_this$options$debug = _this.options.debug) !== null && _this$options$debug !== void 0 && _this$options$debug.logEmits) {
|
|
21735
21711
|
_this._logEvent(event, isCheckout);
|
|
21736
21712
|
}
|
|
21737
21713
|
if (isCheckout && event.type === types_EventType.Meta) {
|
|
21738
|
-
|
|
21739
|
-
|
|
21714
|
+
_this._events.previous = _this._events.current;
|
|
21715
|
+
_this._events.current = [];
|
|
21740
21716
|
}
|
|
21741
|
-
|
|
21717
|
+
_this._events.current.push(event);
|
|
21742
21718
|
},
|
|
21743
21719
|
checkoutEveryNms: this.checkoutEveryNms(),
|
|
21744
21720
|
errorHandler: function errorHandler(error) {
|
|
@@ -21748,7 +21724,7 @@ var Recorder = /*#__PURE__*/function () {
|
|
|
21748
21724
|
}
|
|
21749
21725
|
return true; // swallow the error instead of throwing it to the window
|
|
21750
21726
|
}
|
|
21751
|
-
},
|
|
21727
|
+
}, this._rrwebOptions));
|
|
21752
21728
|
return this;
|
|
21753
21729
|
}
|
|
21754
21730
|
}, {
|
|
@@ -21757,17 +21733,17 @@ var Recorder = /*#__PURE__*/function () {
|
|
|
21757
21733
|
if (!this.isRecording) {
|
|
21758
21734
|
return;
|
|
21759
21735
|
}
|
|
21760
|
-
|
|
21761
|
-
|
|
21736
|
+
this._stopFn();
|
|
21737
|
+
this._stopFn = null;
|
|
21762
21738
|
return this;
|
|
21763
21739
|
}
|
|
21764
21740
|
}, {
|
|
21765
21741
|
key: "clear",
|
|
21766
21742
|
value: function clear() {
|
|
21767
|
-
|
|
21743
|
+
this._events = {
|
|
21768
21744
|
previous: [],
|
|
21769
21745
|
current: []
|
|
21770
|
-
}
|
|
21746
|
+
};
|
|
21771
21747
|
}
|
|
21772
21748
|
}, {
|
|
21773
21749
|
key: "_logEvent",
|