@cloudcare/browser-rum 3.2.51 → 3.3.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 +89 -1
- package/README.zh.md +105 -0
- package/bundle/dataflux-rum.js +1 -1
- package/cjs/boot/buildEnv.js +1 -1
- package/cjs/boot/perStartRum.js +16 -0
- package/cjs/boot/perStartRum.js.map +1 -1
- package/cjs/boot/recorderApi.js +197 -1
- package/cjs/boot/recorderApi.js.map +1 -1
- package/cjs/boot/rum.js +17 -2
- package/cjs/boot/rum.js.map +1 -1
- package/cjs/boot/rumPublicApi.js +63 -3
- package/cjs/boot/rumPublicApi.js.map +1 -1
- package/cjs/boot/startRecording.js +74 -4
- package/cjs/boot/startRecording.js.map +1 -1
- package/cjs/domain/configuration.js +99 -1
- package/cjs/domain/configuration.js.map +1 -1
- package/cjs/domain/deflate/deflateWorker.js +1 -1
- package/cjs/domain/replay/record/canvasAutoSnapshot.js +15 -0
- package/cjs/domain/replay/record/canvasAutoSnapshot.js.map +1 -0
- package/cjs/domain/replay/record/canvasCommandCapture.js +480 -0
- package/cjs/domain/replay/record/canvasCommandCapture.js.map +1 -0
- package/cjs/domain/replay/record/canvasCommandObserver.js +274 -0
- package/cjs/domain/replay/record/canvasCommandObserver.js.map +1 -0
- package/cjs/domain/replay/record/canvasCommandSerializeArgs.js +94 -0
- package/cjs/domain/replay/record/canvasCommandSerializeArgs.js.map +1 -0
- package/cjs/domain/replay/record/canvasContinuousScheduler.js +255 -0
- package/cjs/domain/replay/record/canvasContinuousScheduler.js.map +1 -0
- package/cjs/domain/replay/record/canvasEncodeBridge.js +247 -0
- package/cjs/domain/replay/record/canvasEncodeBridge.js.map +1 -0
- package/cjs/domain/replay/record/canvasEncodeWorker.js +154 -0
- package/cjs/domain/replay/record/canvasEncodeWorker.js.map +1 -0
- package/cjs/domain/replay/record/canvasFrameSignature.js +50 -0
- package/cjs/domain/replay/record/canvasFrameSignature.js.map +1 -0
- package/cjs/domain/replay/record/canvasMutationRecord.js +33 -0
- package/cjs/domain/replay/record/canvasMutationRecord.js.map +1 -0
- package/cjs/domain/replay/record/canvasObserver.js +190 -0
- package/cjs/domain/replay/record/canvasObserver.js.map +1 -0
- package/cjs/domain/replay/record/canvasReplayFixtures.js +105 -0
- package/cjs/domain/replay/record/canvasReplayFixtures.js.map +1 -0
- package/cjs/domain/replay/record/canvasSerializeArgs.js +110 -0
- package/cjs/domain/replay/record/canvasSerializeArgs.js.map +1 -0
- package/cjs/domain/replay/record/mutationBatch.js +7 -2
- package/cjs/domain/replay/record/mutationBatch.js.map +1 -1
- package/cjs/domain/replay/record/mutationObserver.js +382 -55
- package/cjs/domain/replay/record/mutationObserver.js.map +1 -1
- package/cjs/domain/replay/record/observers.js +8 -3
- package/cjs/domain/replay/record/observers.js.map +1 -1
- package/cjs/domain/replay/record/record.js +517 -1
- package/cjs/domain/replay/record/record.js.map +1 -1
- package/cjs/domain/replay/record/serializationUtils.js +60 -4
- package/cjs/domain/replay/record/serializationUtils.js.map +1 -1
- package/cjs/domain/replay/record/serialize.js +169 -46
- package/cjs/domain/replay/record/serialize.js.map +1 -1
- package/cjs/domain/replay/segmentCollection/segment.js +58 -1
- package/cjs/domain/replay/segmentCollection/segment.js.map +1 -1
- package/cjs/domain/replay/segmentCollection/segmentCollection.js +29 -3
- package/cjs/domain/replay/segmentCollection/segmentCollection.js.map +1 -1
- package/cjs/domain/requestCollection.js +1 -1
- package/cjs/domain/requestCollection.js.map +1 -1
- package/cjs/domain/rumEventsCollection/actions/clickChain.js +1 -1
- package/cjs/domain/rumEventsCollection/actions/clickChain.js.map +1 -1
- package/cjs/domain/rumEventsCollection/actions/interactionSelectorCache.js +2 -1
- package/cjs/domain/rumEventsCollection/actions/interactionSelectorCache.js.map +1 -1
- package/cjs/domain/rumEventsCollection/error/trackReportError.js +2 -2
- package/cjs/domain/rumEventsCollection/error/trackReportError.js.map +1 -1
- package/cjs/domain/rumEventsCollection/resource/matchRequestResourceEntry.js +43 -39
- package/cjs/domain/rumEventsCollection/resource/matchRequestResourceEntry.js.map +1 -1
- package/cjs/domain/rumEventsCollection/resource/resourceCollection.js +48 -8
- package/cjs/domain/rumEventsCollection/resource/resourceCollection.js.map +1 -1
- package/cjs/domain/rumEventsCollection/resource/resourceTrackerManager.js +237 -0
- package/cjs/domain/rumEventsCollection/resource/resourceTrackerManager.js.map +1 -0
- package/cjs/domain/rumEventsCollection/view/trackCumulativeLayoutShift.js.map +1 -1
- package/cjs/domain/rumSessionManager.js +2 -0
- package/cjs/domain/rumSessionManager.js.map +1 -1
- package/cjs/domain/tracing/jaegerTracer.js +6 -6
- package/cjs/domain/tracing/jaegerTracer.js.map +1 -1
- package/cjs/domain/tracing/skywalkingTracer.js +1 -1
- package/cjs/domain/tracing/skywalkingTracer.js.map +1 -1
- package/cjs/domain/tracing/traceIdentifier.js +22 -0
- package/cjs/domain/tracing/traceIdentifier.js.map +1 -1
- package/cjs/domain/tracing/zipkinMultiTracer.js +6 -6
- package/cjs/domain/tracing/zipkinMultiTracer.js.map +1 -1
- package/cjs/domain/tracing/zipkinSingleTracer.js +6 -6
- package/cjs/domain/tracing/zipkinSingleTracer.js.map +1 -1
- package/cjs/types/sessionReplayConstants.js +2 -2
- package/cjs/types/sessionReplayConstants.js.map +1 -1
- package/esm/boot/buildEnv.js +1 -1
- package/esm/boot/perStartRum.js +16 -0
- package/esm/boot/perStartRum.js.map +1 -1
- package/esm/boot/recorderApi.js +197 -1
- package/esm/boot/recorderApi.js.map +1 -1
- package/esm/boot/rum.js +17 -2
- package/esm/boot/rum.js.map +1 -1
- package/esm/boot/rumPublicApi.js +63 -3
- package/esm/boot/rumPublicApi.js.map +1 -1
- package/esm/boot/startRecording.js +75 -5
- package/esm/boot/startRecording.js.map +1 -1
- package/esm/domain/configuration.js +100 -2
- package/esm/domain/configuration.js.map +1 -1
- package/esm/domain/deflate/deflateWorker.js +1 -1
- package/esm/domain/replay/record/canvasAutoSnapshot.js +9 -0
- package/esm/domain/replay/record/canvasAutoSnapshot.js.map +1 -0
- package/esm/domain/replay/record/canvasCommandCapture.js +474 -0
- package/esm/domain/replay/record/canvasCommandCapture.js.map +1 -0
- package/esm/domain/replay/record/canvasCommandObserver.js +268 -0
- package/esm/domain/replay/record/canvasCommandObserver.js.map +1 -0
- package/esm/domain/replay/record/canvasCommandSerializeArgs.js +87 -0
- package/esm/domain/replay/record/canvasCommandSerializeArgs.js.map +1 -0
- package/esm/domain/replay/record/canvasContinuousScheduler.js +249 -0
- package/esm/domain/replay/record/canvasContinuousScheduler.js.map +1 -0
- package/esm/domain/replay/record/canvasEncodeBridge.js +240 -0
- package/esm/domain/replay/record/canvasEncodeBridge.js.map +1 -0
- package/esm/domain/replay/record/canvasEncodeWorker.js +146 -0
- package/esm/domain/replay/record/canvasEncodeWorker.js.map +1 -0
- package/esm/domain/replay/record/canvasFrameSignature.js +42 -0
- package/esm/domain/replay/record/canvasFrameSignature.js.map +1 -0
- package/esm/domain/replay/record/canvasMutationRecord.js +26 -0
- package/esm/domain/replay/record/canvasMutationRecord.js.map +1 -0
- package/esm/domain/replay/record/canvasObserver.js +184 -0
- package/esm/domain/replay/record/canvasObserver.js.map +1 -0
- package/esm/domain/replay/record/canvasReplayFixtures.js +96 -0
- package/esm/domain/replay/record/canvasReplayFixtures.js.map +1 -0
- package/esm/domain/replay/record/canvasSerializeArgs.js +101 -0
- package/esm/domain/replay/record/canvasSerializeArgs.js.map +1 -0
- package/esm/domain/replay/record/mutationBatch.js +7 -2
- package/esm/domain/replay/record/mutationBatch.js.map +1 -1
- package/esm/domain/replay/record/mutationObserver.js +382 -56
- package/esm/domain/replay/record/mutationObserver.js.map +1 -1
- package/esm/domain/replay/record/observers.js +8 -3
- package/esm/domain/replay/record/observers.js.map +1 -1
- package/esm/domain/replay/record/record.js +518 -2
- package/esm/domain/replay/record/record.js.map +1 -1
- package/esm/domain/replay/record/serializationUtils.js +58 -4
- package/esm/domain/replay/record/serializationUtils.js.map +1 -1
- package/esm/domain/replay/record/serialize.js +168 -47
- package/esm/domain/replay/record/serialize.js.map +1 -1
- package/esm/domain/replay/segmentCollection/segment.js +59 -2
- package/esm/domain/replay/segmentCollection/segment.js.map +1 -1
- package/esm/domain/replay/segmentCollection/segmentCollection.js +30 -4
- package/esm/domain/replay/segmentCollection/segmentCollection.js.map +1 -1
- package/esm/domain/requestCollection.js +1 -1
- package/esm/domain/requestCollection.js.map +1 -1
- package/esm/domain/rumEventsCollection/actions/clickChain.js +1 -1
- package/esm/domain/rumEventsCollection/actions/clickChain.js.map +1 -1
- package/esm/domain/rumEventsCollection/actions/interactionSelectorCache.js +2 -1
- package/esm/domain/rumEventsCollection/actions/interactionSelectorCache.js.map +1 -1
- package/esm/domain/rumEventsCollection/error/trackReportError.js +2 -2
- package/esm/domain/rumEventsCollection/error/trackReportError.js.map +1 -1
- package/esm/domain/rumEventsCollection/resource/matchRequestResourceEntry.js +43 -38
- package/esm/domain/rumEventsCollection/resource/matchRequestResourceEntry.js.map +1 -1
- package/esm/domain/rumEventsCollection/resource/resourceCollection.js +50 -10
- package/esm/domain/rumEventsCollection/resource/resourceCollection.js.map +1 -1
- package/esm/domain/rumEventsCollection/resource/resourceTrackerManager.js +231 -0
- package/esm/domain/rumEventsCollection/resource/resourceTrackerManager.js.map +1 -0
- package/esm/domain/rumEventsCollection/view/trackCumulativeLayoutShift.js.map +1 -1
- package/esm/domain/rumSessionManager.js +2 -0
- package/esm/domain/rumSessionManager.js.map +1 -1
- package/esm/domain/tracing/jaegerTracer.js +7 -7
- package/esm/domain/tracing/jaegerTracer.js.map +1 -1
- package/esm/domain/tracing/skywalkingTracer.js +1 -1
- package/esm/domain/tracing/skywalkingTracer.js.map +1 -1
- package/esm/domain/tracing/traceIdentifier.js +20 -0
- package/esm/domain/tracing/traceIdentifier.js.map +1 -1
- package/esm/domain/tracing/zipkinMultiTracer.js +7 -7
- package/esm/domain/tracing/zipkinMultiTracer.js.map +1 -1
- package/esm/domain/tracing/zipkinSingleTracer.js +7 -7
- package/esm/domain/tracing/zipkinSingleTracer.js.map +1 -1
- package/esm/types/sessionReplayConstants.js +2 -2
- package/esm/types/sessionReplayConstants.js.map +1 -1
- package/package.json +5 -5
- package/src/boot/perStartRum.js +16 -0
- package/src/boot/recorderApi.js +208 -1
- package/src/boot/rum.js +21 -2
- package/src/boot/rumPublicApi.js +70 -3
- package/src/boot/startRecording.js +99 -5
- package/src/domain/configuration.js +229 -1
- package/src/domain/replay/record/canvasAutoSnapshot.js +8 -0
- package/src/domain/replay/record/canvasCommandCapture.js +621 -0
- package/src/domain/replay/record/canvasCommandObserver.js +355 -0
- package/src/domain/replay/record/canvasCommandSerializeArgs.js +124 -0
- package/src/domain/replay/record/canvasContinuousScheduler.js +295 -0
- package/src/domain/replay/record/canvasEncodeBridge.js +299 -0
- package/src/domain/replay/record/canvasEncodeWorker.js +211 -0
- package/src/domain/replay/record/canvasFrameSignature.js +83 -0
- package/src/domain/replay/record/canvasMutationRecord.js +29 -0
- package/src/domain/replay/record/canvasObserver.js +279 -0
- package/src/domain/replay/record/canvasReplayFixtures.js +113 -0
- package/src/domain/replay/record/canvasSerializeArgs.js +129 -0
- package/src/domain/replay/record/mutationBatch.js +8 -2
- package/src/domain/replay/record/mutationObserver.js +462 -66
- package/src/domain/replay/record/observers.js +15 -3
- package/src/domain/replay/record/record.js +704 -2
- package/src/domain/replay/record/serializationUtils.js +75 -4
- package/src/domain/replay/record/serialize.js +217 -49
- package/src/domain/replay/segmentCollection/segment.js +65 -2
- package/src/domain/replay/segmentCollection/segmentCollection.js +46 -4
- package/src/domain/requestCollection.js +5 -1
- package/src/domain/rumEventsCollection/actions/clickChain.js +1 -1
- package/src/domain/rumEventsCollection/actions/interactionSelectorCache.js +2 -1
- package/src/domain/rumEventsCollection/error/trackReportError.js +3 -2
- package/src/domain/rumEventsCollection/resource/matchRequestResourceEntry.js +51 -46
- package/src/domain/rumEventsCollection/resource/resourceCollection.js +69 -10
- package/src/domain/rumEventsCollection/resource/resourceTrackerManager.js +264 -0
- package/src/domain/rumEventsCollection/view/trackCumulativeLayoutShift.js +0 -1
- package/src/domain/rumSessionManager.js +2 -0
- package/src/domain/tracing/jaegerTracer.js +16 -9
- package/src/domain/tracing/skywalkingTracer.js +1 -1
- package/src/domain/tracing/traceIdentifier.js +24 -0
- package/src/domain/tracing/zipkinMultiTracer.js +16 -9
- package/src/domain/tracing/zipkinSingleTracer.js +14 -7
- package/src/types/sessionReplayConstants.js +2 -2
- package/types/index.d.ts +148 -1
package/cjs/boot/rumPublicApi.js
CHANGED
|
@@ -7,6 +7,7 @@ exports.makeRumPublicApi = makeRumPublicApi;
|
|
|
7
7
|
var _browserCore = require("@cloudcare/browser-core");
|
|
8
8
|
var _commonContext = require("../domain/contexts/commonContext");
|
|
9
9
|
var _perStartRum = require("./perStartRum");
|
|
10
|
+
var _resourceTrackerManager = require("../domain/rumEventsCollection/resource/resourceTrackerManager");
|
|
10
11
|
function _typeof(o) { "@babel/helpers - typeof"; return _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; }, _typeof(o); }
|
|
11
12
|
var RUM_STORAGE_KEY = 'rum';
|
|
12
13
|
function makeRumPublicApi(startRumImpl, recorderApi, options) {
|
|
@@ -14,6 +15,7 @@ function makeRumPublicApi(startRumImpl, recorderApi, options) {
|
|
|
14
15
|
options = {};
|
|
15
16
|
}
|
|
16
17
|
var customerDataTrackerManager = (0, _browserCore.createCustomerDataTrackerManager)(_browserCore.CustomerDataCompressionStatus.Unknown);
|
|
18
|
+
var resourceTrackerManager = (0, _resourceTrackerManager.createResourceTrackerManager)();
|
|
17
19
|
var globalContextManager = (0, _browserCore.createContextManager)('global', {
|
|
18
20
|
customerDataTracker: customerDataTrackerManager.getOrCreateTracker(_browserCore.CustomerDataType.GlobalContext)
|
|
19
21
|
});
|
|
@@ -34,7 +36,9 @@ function makeRumPublicApi(startRumImpl, recorderApi, options) {
|
|
|
34
36
|
function getCommonContext() {
|
|
35
37
|
return (0, _commonContext.buildCommonContext)(globalContextManager, userContextManager, recorderApi);
|
|
36
38
|
}
|
|
37
|
-
var strategy = (0, _perStartRum.createPreStartStrategy)(
|
|
39
|
+
var strategy = (0, _perStartRum.createPreStartStrategy)((0, _browserCore.assign)({}, options, {
|
|
40
|
+
resourceTrackerManager: resourceTrackerManager
|
|
41
|
+
}), getCommonContext, function (configuration, deflateWorker, initialViewOptions) {
|
|
38
42
|
if (configuration.storeContextsToLocal) {
|
|
39
43
|
(0, _browserCore.storeContextManager)(configuration, globalContextManager, RUM_STORAGE_KEY, _browserCore.CustomerDataType.GlobalContext);
|
|
40
44
|
(0, _browserCore.storeContextManager)(configuration, userContextManager, RUM_STORAGE_KEY, _browserCore.CustomerDataType.User);
|
|
@@ -42,7 +46,7 @@ function makeRumPublicApi(startRumImpl, recorderApi, options) {
|
|
|
42
46
|
customerDataTrackerManager.setCompressionStatus(deflateWorker ? _browserCore.CustomerDataCompressionStatus.Enabled : _browserCore.CustomerDataCompressionStatus.Disabled);
|
|
43
47
|
var startRumResult = startRumImpl(configuration, recorderApi, customerDataTrackerManager, getCommonContext, initialViewOptions, deflateWorker && options.createDeflateEncoder ? function (streamId) {
|
|
44
48
|
return options.createDeflateEncoder(deflateWorker, streamId);
|
|
45
|
-
} : _browserCore.createIdentityEncoder);
|
|
49
|
+
} : _browserCore.createIdentityEncoder, resourceTrackerManager);
|
|
46
50
|
recorderApi.onRumStart(startRumResult.lifeCycle, configuration, startRumResult.session, startRumResult.viewContexts, deflateWorker);
|
|
47
51
|
strategy = createPostStartStrategy(strategy, startRumResult);
|
|
48
52
|
return startRumResult;
|
|
@@ -255,8 +259,64 @@ function makeRumPublicApi(startRumImpl, recorderApi, options) {
|
|
|
255
259
|
force: options && options.force
|
|
256
260
|
});
|
|
257
261
|
}),
|
|
262
|
+
isRecording: (0, _browserCore.monitor)(function () {
|
|
263
|
+
return recorderApi.isRecording();
|
|
264
|
+
}),
|
|
258
265
|
stopSessionReplayRecording: (0, _browserCore.monitor)(recorderApi.stop),
|
|
259
|
-
takeSubsequentFullSnapshot: (0, _browserCore.monitor)(recorderApi.takeSubsequentFullSnapshot)
|
|
266
|
+
takeSubsequentFullSnapshot: (0, _browserCore.monitor)(recorderApi.takeSubsequentFullSnapshot),
|
|
267
|
+
snapshotCanvas: (0, _browserCore.monitor)(function (canvas, options) {
|
|
268
|
+
return recorderApi.snapshotCanvas(canvas, options);
|
|
269
|
+
}),
|
|
270
|
+
getSerializedNodeIdForDebug: (0, _browserCore.monitor)(function (node) {
|
|
271
|
+
return recorderApi.getSerializedNodeIdForDebug(node);
|
|
272
|
+
}),
|
|
273
|
+
getLastAutoCanvasSnapshotResultForDebug: (0, _browserCore.monitor)(function () {
|
|
274
|
+
return recorderApi.getLastAutoCanvasSnapshotResultForDebug();
|
|
275
|
+
}),
|
|
276
|
+
getAutoCanvasSnapshotDebugHistoryForDebug: (0, _browserCore.monitor)(function () {
|
|
277
|
+
return recorderApi.getAutoCanvasSnapshotDebugHistoryForDebug();
|
|
278
|
+
}),
|
|
279
|
+
getLastCanvasMutationForDebug: (0, _browserCore.monitor)(function () {
|
|
280
|
+
return recorderApi.getLastCanvasMutationForDebug();
|
|
281
|
+
}),
|
|
282
|
+
getCanvasMutationHistoryForDebug: (0, _browserCore.monitor)(function () {
|
|
283
|
+
return recorderApi.getCanvasMutationHistoryForDebug();
|
|
284
|
+
}),
|
|
285
|
+
getLastDomMutationForDebug: (0, _browserCore.monitor)(function () {
|
|
286
|
+
return recorderApi.getLastDomMutationForDebug();
|
|
287
|
+
}),
|
|
288
|
+
getDomMutationHistoryForDebug: (0, _browserCore.monitor)(function () {
|
|
289
|
+
return recorderApi.getDomMutationHistoryForDebug();
|
|
290
|
+
}),
|
|
291
|
+
getLastReplaySegmentFlushForDebug: (0, _browserCore.monitor)(function () {
|
|
292
|
+
return recorderApi.getLastReplaySegmentFlushForDebug();
|
|
293
|
+
}),
|
|
294
|
+
getReplaySegmentFlushHistoryForDebug: (0, _browserCore.monitor)(function () {
|
|
295
|
+
return recorderApi.getReplaySegmentFlushHistoryForDebug();
|
|
296
|
+
}),
|
|
297
|
+
getReplayPerformanceForDebug: (0, _browserCore.monitor)(function () {
|
|
298
|
+
return recorderApi.getReplayPerformanceForDebug();
|
|
299
|
+
}),
|
|
300
|
+
flushReplayMutationsForDebug: (0, _browserCore.monitor)(function () {
|
|
301
|
+
if (recorderApi.flushReplayMutationsForDebug) {
|
|
302
|
+
recorderApi.flushReplayMutationsForDebug();
|
|
303
|
+
}
|
|
304
|
+
}),
|
|
305
|
+
createResourceTrackerId: (0, _browserCore.monitor)(function () {
|
|
306
|
+
return resourceTrackerManager.createTrackerId();
|
|
307
|
+
}),
|
|
308
|
+
setResourceContext: (0, _browserCore.monitor)(function (trackerId, context) {
|
|
309
|
+
return resourceTrackerManager.setResourceContext(trackerId, (0, _browserCore.sanitize)(context));
|
|
310
|
+
}),
|
|
311
|
+
appendResourceContext: (0, _browserCore.monitor)(function (trackerId, context) {
|
|
312
|
+
return resourceTrackerManager.appendResourceContext(trackerId, (0, _browserCore.sanitize)(context));
|
|
313
|
+
}),
|
|
314
|
+
finishResource: (0, _browserCore.monitor)(function (trackerId) {
|
|
315
|
+
return resourceTrackerManager.finishResource(trackerId);
|
|
316
|
+
}),
|
|
317
|
+
getResource: (0, _browserCore.monitor)(function (trackerId) {
|
|
318
|
+
return resourceTrackerManager.getResource(trackerId);
|
|
319
|
+
})
|
|
260
320
|
});
|
|
261
321
|
return rumPublicApi;
|
|
262
322
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rumPublicApi.js","names":["_browserCore","require","_commonContext","_perStartRum","_typeof","o","Symbol","iterator","constructor","prototype","RUM_STORAGE_KEY","makeRumPublicApi","startRumImpl","recorderApi","options","undefined","customerDataTrackerManager","createCustomerDataTrackerManager","CustomerDataCompressionStatus","Unknown","globalContextManager","createContextManager","customerDataTracker","getOrCreateTracker","CustomerDataType","GlobalContext","userContextManager","User","propertiesConfig","id","type","name","email","getCommonContext","buildCommonContext","strategy","createPreStartStrategy","configuration","deflateWorker","initialViewOptions","storeContextsToLocal","storeContextManager","setCompressionStatus","Enabled","Disabled","startRumResult","createDeflateEncoder","streamId","createIdentityEncoder","onRumStart","lifeCycle","session","viewContexts","createPostStartStrategy","startView","monitor","sanitizedOptions","context","View","updateCustomerData","addTelemetryUsage","feature","rumPublicApi","makePublicApi","init","initConfiguration","setViewName","setViewContext","setViewContextProperty","key","value","getViewContext","addRumGlobalContext","setContextProperty","setGlobalContextProperty","removeRumGlobalContext","removeContextProperty","removeGlobalContextProperty","getRumGlobalContext","getContext","getGlobalContext","setRumGlobalContext","setContext","setGlobalContext","clearGlobalContext","clearContext","getInitConfiguration","deepClone","getRemoteConfiguration","callback","getInternalContext","startTime","addDebugSession","clearDebugSession","getDebugSession","addResource","handlingStack","createHandlingStack","callMonitored","sanitize","startClocks","clocksNow","ResourceType","CUSTOM","addTypeAction","sourceType","addAction","getType","ActionType","addError","error","addTiming","time","setUser","newUser","checkUser","sanitizeUser","getUser","setUserProperty","property","sanitizedProperty","removeUserProperty","removeUser","clearUser","stopSession","setForcedSession","startSessionReplayRecording","start","force","stopSessionReplayRecording","stop","takeSubsequentFullSnapshot","preStartStrategy","assign","displayAlreadyInitializedError"],"sources":["../../src/boot/rumPublicApi.js"],"sourcesContent":["import {\n makePublicApi,\n createContextManager,\n CustomerDataType,\n clocksNow,\n ActionType,\n ResourceType,\n deepClone,\n createHandlingStack,\n sanitizeUser,\n checkUser,\n callMonitored,\n assign,\n monitor,\n storeContextManager,\n createIdentityEncoder,\n addTelemetryUsage,\n sanitize,\n createCustomerDataTrackerManager,\n CustomerDataCompressionStatus,\n displayAlreadyInitializedError,\n getType\n} from '@cloudcare/browser-core'\nimport { buildCommonContext } from '../domain/contexts/commonContext'\nimport { createPreStartStrategy } from './perStartRum'\nvar RUM_STORAGE_KEY = 'rum'\nexport function makeRumPublicApi(startRumImpl, recorderApi, options) {\n if (options === undefined) {\n options = {}\n }\n const customerDataTrackerManager = createCustomerDataTrackerManager(\n CustomerDataCompressionStatus.Unknown\n )\n const globalContextManager = createContextManager('global', {\n customerDataTracker: customerDataTrackerManager.getOrCreateTracker(\n CustomerDataType.GlobalContext\n )\n })\n const userContextManager = createContextManager('user', {\n customerDataTracker: customerDataTrackerManager.getOrCreateTracker(\n CustomerDataType.User\n ),\n propertiesConfig: {\n id: { type: 'string' },\n name: { type: 'string' },\n email: { type: 'string' }\n }\n })\n function getCommonContext() {\n return buildCommonContext(\n globalContextManager,\n userContextManager,\n recorderApi\n )\n }\n let strategy = createPreStartStrategy(\n options,\n getCommonContext,\n function (configuration, deflateWorker, initialViewOptions) {\n if (configuration.storeContextsToLocal) {\n storeContextManager(\n configuration,\n globalContextManager,\n RUM_STORAGE_KEY,\n CustomerDataType.GlobalContext\n )\n storeContextManager(\n configuration,\n userContextManager,\n RUM_STORAGE_KEY,\n CustomerDataType.User\n )\n }\n customerDataTrackerManager.setCompressionStatus(\n deflateWorker\n ? CustomerDataCompressionStatus.Enabled\n : CustomerDataCompressionStatus.Disabled\n )\n var startRumResult = startRumImpl(\n configuration,\n recorderApi,\n customerDataTrackerManager,\n getCommonContext,\n initialViewOptions,\n deflateWorker && options.createDeflateEncoder\n ? function (streamId) {\n return options.createDeflateEncoder(deflateWorker, streamId)\n }\n : createIdentityEncoder\n )\n recorderApi.onRumStart(\n startRumResult.lifeCycle,\n configuration,\n startRumResult.session,\n startRumResult.viewContexts,\n deflateWorker\n )\n\n strategy = createPostStartStrategy(strategy, startRumResult)\n\n return startRumResult\n }\n )\n\n const startView = monitor(function (options) {\n const sanitizedOptions =\n typeof options === 'object' ? options : { name: options }\n strategy.startView(sanitizedOptions)\n if (sanitizedOptions.context) {\n customerDataTrackerManager\n .getOrCreateTracker(CustomerDataType.View)\n .updateCustomerData(sanitizedOptions.context)\n }\n addTelemetryUsage({ feature: 'start-view' })\n })\n\n var rumPublicApi = makePublicApi({\n init: monitor(function (initConfiguration) {\n strategy.init(initConfiguration)\n }),\n setViewName: monitor((name) => {\n strategy.setViewName(name)\n addTelemetryUsage({ feature: 'set-view-name' })\n }),\n\n setViewContext: monitor((context) => {\n strategy.setViewContext(context)\n addTelemetryUsage({ feature: 'set-view-context' })\n }),\n\n setViewContextProperty: monitor((key, value) => {\n strategy.setViewContextProperty(key, value)\n addTelemetryUsage({ feature: 'set-view-context-property' })\n }),\n\n getViewContext: monitor(() => {\n addTelemetryUsage({ feature: 'set-view-context-property' })\n return strategy.getViewContext()\n }),\n /** @deprecated: use setGlobalContextProperty instead */\n addRumGlobalContext: monitor(function (key, value) {\n globalContextManager.setContextProperty(key, value)\n addTelemetryUsage({ feature: 'set-global-context' })\n }),\n setGlobalContextProperty: monitor(function (key, value) {\n globalContextManager.setContextProperty(key, value)\n addTelemetryUsage({ feature: 'set-global-context' })\n }),\n\n /** @deprecated: use removeGlobalContextProperty instead */\n removeRumGlobalContext: monitor(function (key) {\n return globalContextManager.removeContextProperty(key)\n }),\n removeGlobalContextProperty: monitor(function (key) {\n return globalContextManager.removeContextProperty(key)\n }),\n\n /** @deprecated: use getGlobalContext instead */\n getRumGlobalContext: monitor(function () {\n return globalContextManager.getContext()\n }),\n getGlobalContext: monitor(function () {\n return globalContextManager.getContext()\n }),\n\n /** @deprecated: use setGlobalContext instead */\n setRumGlobalContext: monitor(function (context) {\n globalContextManager.setContext(context)\n addTelemetryUsage({ feature: 'set-global-context' })\n }),\n setGlobalContext: monitor(function (context) {\n globalContextManager.setContext(context)\n addTelemetryUsage({ feature: 'set-global-context' })\n }),\n\n clearGlobalContext: monitor(function () {\n return globalContextManager.clearContext()\n }),\n\n getInitConfiguration: monitor(function () {\n return deepClone(strategy.initConfiguration)\n }),\n getRemoteConfiguration: monitor(function (callback) {\n return strategy.getRemoteConfiguration(callback)\n }),\n getInternalContext: monitor(function (startTime) {\n return strategy.getInternalContext(startTime)\n }),\n addDebugSession: monitor(function (id) {}),\n clearDebugSession: monitor(function () {}),\n getDebugSession: monitor(function () {}),\n addResource: monitor(function (context) {\n const handlingStack = createHandlingStack()\n callMonitored(function () {\n strategy.addResource({\n context: sanitize(context),\n startClocks: clocksNow(),\n type: ResourceType.CUSTOM,\n handlingStack: handlingStack\n })\n addTelemetryUsage({ feature: 'add-resource' })\n })\n }),\n addTypeAction: monitor(function (name, type, context) {\n const handlingStack = createHandlingStack()\n\n callMonitored(function () {\n const sourceType = sanitize(type)\n strategy.addAction({\n name: sanitize(name),\n context: sanitize(context),\n startClocks: clocksNow(),\n type:\n getType(sourceType) === 'string' ? sourceType : ActionType.CUSTOM,\n handlingStack: handlingStack\n })\n addTelemetryUsage({ feature: 'add-type-action' })\n })\n }),\n addAction: monitor(function (name, context) {\n const handlingStack = createHandlingStack()\n callMonitored(function () {\n strategy.addAction({\n name: sanitize(name),\n context: sanitize(context),\n startClocks: clocksNow(),\n type: ActionType.CUSTOM,\n handlingStack: handlingStack\n })\n addTelemetryUsage({ feature: 'add-action' })\n })\n }),\n addError: monitor(function (error, context) {\n var handlingStack = createHandlingStack()\n callMonitored(function () {\n strategy.addError({\n error, // Do not sanitize error here, it is needed unserialized by computeRawError()\n handlingStack,\n context: sanitize(context),\n startClocks: clocksNow()\n })\n addTelemetryUsage({ feature: 'add-error' })\n })\n }),\n addTiming: monitor(function (name, time) {\n strategy.addTiming(sanitize(name), time)\n }),\n setUser: monitor(function (newUser) {\n if (checkUser(newUser)) {\n userContextManager.setContext(sanitizeUser(newUser))\n }\n addTelemetryUsage({ feature: 'set-user' })\n }),\n getUser: monitor(function () {\n return userContextManager.getContext()\n }),\n setUserProperty: monitor(function (key, property) {\n var newUser = {}\n newUser[key] = property\n var sanitizedProperty = sanitizeUser(newUser)[key]\n userContextManager.setContextProperty(key, sanitizedProperty)\n addTelemetryUsage({ feature: 'set-user' })\n }),\n removeUserProperty: monitor(function (key) {\n return userContextManager.removeContextProperty(key)\n }),\n\n /** @deprecated: renamed to clearUser */\n removeUser: monitor(function () {\n return userContextManager.clearContext()\n }),\n clearUser: monitor(function () {\n return userContextManager.clearContext()\n }),\n startView: startView,\n stopSession: monitor(function () {\n strategy.stopSession()\n addTelemetryUsage({ feature: 'stop-session' })\n }),\n setForcedSession: monitor(function () {\n strategy.setForcedSession()\n addTelemetryUsage({ feature: 'set-forced-session' })\n }),\n startSessionReplayRecording: monitor(function (options) {\n recorderApi.start(options)\n addTelemetryUsage({\n feature: 'start-session-replay-recording',\n force: options && options.force\n })\n }),\n stopSessionReplayRecording: monitor(recorderApi.stop),\n takeSubsequentFullSnapshot: monitor(recorderApi.takeSubsequentFullSnapshot)\n })\n return rumPublicApi\n}\nfunction createPostStartStrategy(preStartStrategy, startRumResult) {\n return assign(\n {\n init: function (initConfiguration) {\n displayAlreadyInitializedError('DATAFLUX_RUM', initConfiguration)\n },\n initConfiguration: preStartStrategy.getInitConfiguration(),\n getRemoteConfiguration: function (callback) {\n preStartStrategy.getRemoteConfiguration(callback)\n }\n },\n startRumResult\n )\n}\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAuBA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAAsD,SAAAG,QAAAC,CAAA,sCAAAD,OAAA,wBAAAE,MAAA,uBAAAA,MAAA,CAAAC,QAAA,aAAAF,CAAA,kBAAAA,CAAA,gBAAAA,CAAA,WAAAA,CAAA,yBAAAC,MAAA,IAAAD,CAAA,CAAAG,WAAA,KAAAF,MAAA,IAAAD,CAAA,KAAAC,MAAA,CAAAG,SAAA,qBAAAJ,CAAA,KAAAD,OAAA,CAAAC,CAAA;AACtD,IAAIK,eAAe,GAAG,KAAK;AACpB,SAASC,gBAAgBA,CAACC,YAAY,EAAEC,WAAW,EAAEC,OAAO,EAAE;EACnE,IAAIA,OAAO,KAAKC,SAAS,EAAE;IACzBD,OAAO,GAAG,CAAC,CAAC;EACd;EACA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AE,SAAxBA,sBAAsBA,CAAYC,QAAQ,EAAE;MAC1C2C,gBAAgB,CAAC5C,sBAAsB,CAACC,QAAQ,CAAC;IACnD;EACF,CAAC,EACD5C,cACF,CAAC;AACH","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"rumPublicApi.js","names":["_browserCore","require","_commonContext","_perStartRum","_resourceTrackerManager","_typeof","o","Symbol","iterator","constructor","prototype","RUM_STORAGE_KEY","makeRumPublicApi","startRumImpl","recorderApi","options","undefined","customerDataTrackerManager","createCustomerDataTrackerManager","CustomerDataCompressionStatus","Unknown","resourceTrackerManager","createResourceTrackerManager","globalContextManager","createContextManager","customerDataTracker","getOrCreateTracker","CustomerDataType","GlobalContext","userContextManager","User","propertiesConfig","id","type","name","email","getCommonContext","buildCommonContext","strategy","createPreStartStrategy","assign","configuration","deflateWorker","initialViewOptions","storeContextsToLocal","storeContextManager","setCompressionStatus","Enabled","Disabled","startRumResult","createDeflateEncoder","streamId","createIdentityEncoder","onRumStart","lifeCycle","session","viewContexts","createPostStartStrategy","startView","monitor","sanitizedOptions","context","View","updateCustomerData","addTelemetryUsage","feature","rumPublicApi","makePublicApi","init","initConfiguration","setViewName","setViewContext","setViewContextProperty","key","value","getViewContext","addRumGlobalContext","setContextProperty","setGlobalContextProperty","removeRumGlobalContext","removeContextProperty","removeGlobalContextProperty","getRumGlobalContext","getContext","getGlobalContext","setRumGlobalContext","setContext","setGlobalContext","clearGlobalContext","clearContext","getInitConfiguration","deepClone","getRemoteConfiguration","callback","getInternalContext","startTime","addDebugSession","clearDebugSession","getDebugSession","addResource","handlingStack","createHandlingStack","callMonitored","sanitize","startClocks","clocksNow","ResourceType","CUSTOM","addTypeAction","sourceType","addAction","getType","ActionType","addError","error","addTiming","time","setUser","newUser","checkUser","sanitizeUser","getUser","setUserProperty","property","sanitizedProperty","removeUserProperty","removeUser","clearUser","stopSession","setForcedSession","startSessionReplayRecording","start","force","isRecording","stopSessionReplayRecording","stop","takeSubsequentFullSnapshot","snapshotCanvas","canvas","getSerializedNodeIdForDebug","node","getLastAutoCanvasSnapshotResultForDebug","getAutoCanvasSnapshotDebugHistoryForDebug","getLastCanvasMutationForDebug","getCanvasMutationHistoryForDebug","getLastDomMutationForDebug","getDomMutationHistoryForDebug","getLastReplaySegmentFlushForDebug","getReplaySegmentFlushHistoryForDebug","getReplayPerformanceForDebug","flushReplayMutationsForDebug","createResourceTrackerId","createTrackerId","setResourceContext","trackerId","appendResourceContext","finishResource","getResource","preStartStrategy","displayAlreadyInitializedError"],"sources":["../../src/boot/rumPublicApi.js"],"sourcesContent":["import {\n makePublicApi,\n createContextManager,\n CustomerDataType,\n clocksNow,\n ActionType,\n ResourceType,\n deepClone,\n createHandlingStack,\n sanitizeUser,\n checkUser,\n callMonitored,\n assign,\n monitor,\n storeContextManager,\n createIdentityEncoder,\n addTelemetryUsage,\n sanitize,\n createCustomerDataTrackerManager,\n CustomerDataCompressionStatus,\n displayAlreadyInitializedError,\n getType\n} from '@cloudcare/browser-core'\nimport { buildCommonContext } from '../domain/contexts/commonContext'\nimport { createPreStartStrategy } from './perStartRum'\nimport { createResourceTrackerManager } from '../domain/rumEventsCollection/resource/resourceTrackerManager'\nvar RUM_STORAGE_KEY = 'rum'\nexport function makeRumPublicApi(startRumImpl, recorderApi, options) {\n if (options === undefined) {\n options = {}\n }\n const customerDataTrackerManager = createCustomerDataTrackerManager(\n CustomerDataCompressionStatus.Unknown\n )\n const resourceTrackerManager = createResourceTrackerManager()\n const globalContextManager = createContextManager('global', {\n customerDataTracker: customerDataTrackerManager.getOrCreateTracker(\n CustomerDataType.GlobalContext\n )\n })\n const userContextManager = createContextManager('user', {\n customerDataTracker: customerDataTrackerManager.getOrCreateTracker(\n CustomerDataType.User\n ),\n propertiesConfig: {\n id: { type: 'string' },\n name: { type: 'string' },\n email: { type: 'string' }\n }\n })\n function getCommonContext() {\n return buildCommonContext(\n globalContextManager,\n userContextManager,\n recorderApi\n )\n }\n let strategy = createPreStartStrategy(\n assign({}, options, {\n resourceTrackerManager: resourceTrackerManager\n }),\n getCommonContext,\n function (configuration, deflateWorker, initialViewOptions) {\n if (configuration.storeContextsToLocal) {\n storeContextManager(\n configuration,\n globalContextManager,\n RUM_STORAGE_KEY,\n CustomerDataType.GlobalContext\n )\n storeContextManager(\n configuration,\n userContextManager,\n RUM_STORAGE_KEY,\n CustomerDataType.User\n )\n }\n customerDataTrackerManager.setCompressionStatus(\n deflateWorker\n ? CustomerDataCompressionStatus.Enabled\n : CustomerDataCompressionStatus.Disabled\n )\n var startRumResult = startRumImpl(\n configuration,\n recorderApi,\n customerDataTrackerManager,\n getCommonContext,\n initialViewOptions,\n deflateWorker && options.createDeflateEncoder\n ? function (streamId) {\n return options.createDeflateEncoder(deflateWorker, streamId)\n }\n : createIdentityEncoder,\n resourceTrackerManager\n )\n recorderApi.onRumStart(\n startRumResult.lifeCycle,\n configuration,\n startRumResult.session,\n startRumResult.viewContexts,\n deflateWorker\n )\n\n strategy = createPostStartStrategy(strategy, startRumResult)\n\n return startRumResult\n }\n )\n\n const startView = monitor(function (options) {\n const sanitizedOptions =\n typeof options === 'object' ? options : { name: options }\n strategy.startView(sanitizedOptions)\n if (sanitizedOptions.context) {\n customerDataTrackerManager\n .getOrCreateTracker(CustomerDataType.View)\n .updateCustomerData(sanitizedOptions.context)\n }\n addTelemetryUsage({ feature: 'start-view' })\n })\n\n var rumPublicApi = makePublicApi({\n init: monitor(function (initConfiguration) {\n strategy.init(initConfiguration)\n }),\n setViewName: monitor((name) => {\n strategy.setViewName(name)\n addTelemetryUsage({ feature: 'set-view-name' })\n }),\n\n setViewContext: monitor((context) => {\n strategy.setViewContext(context)\n addTelemetryUsage({ feature: 'set-view-context' })\n }),\n\n setViewContextProperty: monitor((key, value) => {\n strategy.setViewContextProperty(key, value)\n addTelemetryUsage({ feature: 'set-view-context-property' })\n }),\n\n getViewContext: monitor(() => {\n addTelemetryUsage({ feature: 'set-view-context-property' })\n return strategy.getViewContext()\n }),\n /** @deprecated: use setGlobalContextProperty instead */\n addRumGlobalContext: monitor(function (key, value) {\n globalContextManager.setContextProperty(key, value)\n addTelemetryUsage({ feature: 'set-global-context' })\n }),\n setGlobalContextProperty: monitor(function (key, value) {\n globalContextManager.setContextProperty(key, value)\n addTelemetryUsage({ feature: 'set-global-context' })\n }),\n\n /** @deprecated: use removeGlobalContextProperty instead */\n removeRumGlobalContext: monitor(function (key) {\n return globalContextManager.removeContextProperty(key)\n }),\n removeGlobalContextProperty: monitor(function (key) {\n return globalContextManager.removeContextProperty(key)\n }),\n\n /** @deprecated: use getGlobalContext instead */\n getRumGlobalContext: monitor(function () {\n return globalContextManager.getContext()\n }),\n getGlobalContext: monitor(function () {\n return globalContextManager.getContext()\n }),\n\n /** @deprecated: use setGlobalContext instead */\n setRumGlobalContext: monitor(function (context) {\n globalContextManager.setContext(context)\n addTelemetryUsage({ feature: 'set-global-context' })\n }),\n setGlobalContext: monitor(function (context) {\n globalContextManager.setContext(context)\n addTelemetryUsage({ feature: 'set-global-context' })\n }),\n\n clearGlobalContext: monitor(function () {\n return globalContextManager.clearContext()\n }),\n\n getInitConfiguration: monitor(function () {\n return deepClone(strategy.initConfiguration)\n }),\n getRemoteConfiguration: monitor(function (callback) {\n return strategy.getRemoteConfiguration(callback)\n }),\n getInternalContext: monitor(function (startTime) {\n return strategy.getInternalContext(startTime)\n }),\n addDebugSession: monitor(function (id) {}),\n clearDebugSession: monitor(function () {}),\n getDebugSession: monitor(function () {}),\n addResource: monitor(function (context) {\n const handlingStack = createHandlingStack()\n callMonitored(function () {\n strategy.addResource({\n context: sanitize(context),\n startClocks: clocksNow(),\n type: ResourceType.CUSTOM,\n handlingStack: handlingStack\n })\n addTelemetryUsage({ feature: 'add-resource' })\n })\n }),\n addTypeAction: monitor(function (name, type, context) {\n const handlingStack = createHandlingStack()\n\n callMonitored(function () {\n const sourceType = sanitize(type)\n strategy.addAction({\n name: sanitize(name),\n context: sanitize(context),\n startClocks: clocksNow(),\n type:\n getType(sourceType) === 'string' ? sourceType : ActionType.CUSTOM,\n handlingStack: handlingStack\n })\n addTelemetryUsage({ feature: 'add-type-action' })\n })\n }),\n addAction: monitor(function (name, context) {\n const handlingStack = createHandlingStack()\n callMonitored(function () {\n strategy.addAction({\n name: sanitize(name),\n context: sanitize(context),\n startClocks: clocksNow(),\n type: ActionType.CUSTOM,\n handlingStack: handlingStack\n })\n addTelemetryUsage({ feature: 'add-action' })\n })\n }),\n addError: monitor(function (error, context) {\n var handlingStack = createHandlingStack()\n callMonitored(function () {\n strategy.addError({\n error, // Do not sanitize error here, it is needed unserialized by computeRawError()\n handlingStack,\n context: sanitize(context),\n startClocks: clocksNow()\n })\n addTelemetryUsage({ feature: 'add-error' })\n })\n }),\n addTiming: monitor(function (name, time) {\n strategy.addTiming(sanitize(name), time)\n }),\n setUser: monitor(function (newUser) {\n if (checkUser(newUser)) {\n userContextManager.setContext(sanitizeUser(newUser))\n }\n addTelemetryUsage({ feature: 'set-user' })\n }),\n getUser: monitor(function () {\n return userContextManager.getContext()\n }),\n setUserProperty: monitor(function (key, property) {\n var newUser = {}\n newUser[key] = property\n var sanitizedProperty = sanitizeUser(newUser)[key]\n userContextManager.setContextProperty(key, sanitizedProperty)\n addTelemetryUsage({ feature: 'set-user' })\n }),\n removeUserProperty: monitor(function (key) {\n return userContextManager.removeContextProperty(key)\n }),\n\n /** @deprecated: renamed to clearUser */\n removeUser: monitor(function () {\n return userContextManager.clearContext()\n }),\n clearUser: monitor(function () {\n return userContextManager.clearContext()\n }),\n startView: startView,\n stopSession: monitor(function () {\n strategy.stopSession()\n addTelemetryUsage({ feature: 'stop-session' })\n }),\n setForcedSession: monitor(function () {\n strategy.setForcedSession()\n addTelemetryUsage({ feature: 'set-forced-session' })\n }),\n startSessionReplayRecording: monitor(function (options) {\n recorderApi.start(options)\n addTelemetryUsage({\n feature: 'start-session-replay-recording',\n force: options && options.force\n })\n }),\n isRecording: monitor(function () {\n return recorderApi.isRecording()\n }),\n stopSessionReplayRecording: monitor(recorderApi.stop),\n takeSubsequentFullSnapshot: monitor(recorderApi.takeSubsequentFullSnapshot),\n snapshotCanvas: monitor(function (canvas, options) {\n return recorderApi.snapshotCanvas(canvas, options)\n }),\n getSerializedNodeIdForDebug: monitor(function (node) {\n return recorderApi.getSerializedNodeIdForDebug(node)\n }),\n getLastAutoCanvasSnapshotResultForDebug: monitor(function () {\n return recorderApi.getLastAutoCanvasSnapshotResultForDebug()\n }),\n getAutoCanvasSnapshotDebugHistoryForDebug: monitor(function () {\n return recorderApi.getAutoCanvasSnapshotDebugHistoryForDebug()\n }),\n getLastCanvasMutationForDebug: monitor(function () {\n return recorderApi.getLastCanvasMutationForDebug()\n }),\n getCanvasMutationHistoryForDebug: monitor(function () {\n return recorderApi.getCanvasMutationHistoryForDebug()\n }),\n getLastDomMutationForDebug: monitor(function () {\n return recorderApi.getLastDomMutationForDebug()\n }),\n getDomMutationHistoryForDebug: monitor(function () {\n return recorderApi.getDomMutationHistoryForDebug()\n }),\n getLastReplaySegmentFlushForDebug: monitor(function () {\n return recorderApi.getLastReplaySegmentFlushForDebug()\n }),\n getReplaySegmentFlushHistoryForDebug: monitor(function () {\n return recorderApi.getReplaySegmentFlushHistoryForDebug()\n }),\n getReplayPerformanceForDebug: monitor(function () {\n return recorderApi.getReplayPerformanceForDebug()\n }),\n flushReplayMutationsForDebug: monitor(function () {\n if (recorderApi.flushReplayMutationsForDebug) {\n recorderApi.flushReplayMutationsForDebug()\n }\n }),\n createResourceTrackerId: monitor(function () {\n return resourceTrackerManager.createTrackerId()\n }),\n setResourceContext: monitor(function (trackerId, context) {\n return resourceTrackerManager.setResourceContext(\n trackerId,\n sanitize(context)\n )\n }),\n appendResourceContext: monitor(function (trackerId, context) {\n return resourceTrackerManager.appendResourceContext(\n trackerId,\n sanitize(context)\n )\n }),\n finishResource: monitor(function (trackerId) {\n return resourceTrackerManager.finishResource(trackerId)\n }),\n getResource: monitor(function (trackerId) {\n return resourceTrackerManager.getResource(trackerId)\n })\n })\n return rumPublicApi\n}\nfunction createPostStartStrategy(preStartStrategy, startRumResult) {\n return assign(\n {\n init: function (initConfiguration) {\n displayAlreadyInitializedError('DATAFLUX_RUM', initConfiguration)\n },\n initConfiguration: preStartStrategy.getInitConfiguration(),\n getRemoteConfiguration: function (callback) {\n preStartStrategy.getRemoteConfiguration(callback)\n }\n },\n startRumResult\n )\n}\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAuBA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,uBAAA,GAAAH,OAAA;AAA4G,SAAAI,QAAAC,CAAA,sCAAAD,OAAA,wBAAAE,MAAA,uBAAAA,MAAA,CAAAC,QAAA,aAAAF,CAAA,kBAAAA,CAAA,gBAAAA,CAAA,WAAAA,CAAA,yBAAAC,MAAA,IAAAD,CAAA,CAAAG,WAAA,KAAAF,MAAA,IAAAD,CAAA,KAAAC,MAAA,CAAAG,SAAA,qBAAAJ,CAAA,KAAAD,OAAA,CAAAC,CAAA;AAC5G,IAAIK,eAAe,GAAG,KAAK;AACpB,SAASC,gBAAgBA,CAACC,YAAY,EAAEC,WAAW,EAAEC,OAAO,EAAE;EACnE,IAAIA,OAAO,KAAKC,SAAS,EAAE;IACzBD,OAAO,GAAG,CAAC,CAAC;EACd;EACA,IAAME,0BAA0B,GAAG,IAAAC,6CAAgC,EACjEC,0CAA6B,CAACC,OAChC,CAAC;EACD,IAAMC,sBAAsB,GAAG,IAAAC,oDAA4B,EAAC,CAAC;EAC7D,IAAMC,oBAAoB,GAAG,IAAAC,iCAAoB,EAAC,QAAQ,EAAE;IAC1DC,mBAAmB,EAAER,0BAA0B,CAACS,kBAAkB,CAChEC,6BAAgB,CAACC,aACnB;EACF,CAAC,CAAC;EACF,IAAMC,kBAAkB,GAAG,IAAAL,iCAAoB,EAAC,MAAM,EAAE;IACtDC,mBAAmB,EAAER,0BAA0B,CAACS,kBAAkB,CAChEC,6BAAgB,CAACG,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,sBAAsB,CAACoI,kBAAkB,CAC9CC,SAAS,EACT,IAAAnD,qBAAQ,EAAC1C,OAAO,CAClB,CAAC;IACH,CAAC,CAAC;IACF8F,qBAAqB,EAAE,IAAAhG,oBAAO,EAAC,UAAU+F,SAAS,EAAE7F,OAAO,EAAE;MAC3D,OAAOxC,sBAAsB,CAACsI,qBAAqB,CACjDD,SAAS,EACT,IAAAnD,qBAAQ,EAAC1C,OAAO,CAClB,CAAC;IACH,CAAC,CAAC;IACF+F,cAAc,EAAE,IAAAjG,oBAAO,EAAC,UAAU+F,SAAS,EAAE;MAC3C,OAAOrI,sBAAsB,CAACuI,cAAc,CAACF,SAAS,CAAC;IACzD,CAAC,CAAC;IACFG,WAAW,EAAE,IAAAlG,oBAAO,EAAC,UAAU+F,SAAS,EAAE;MACxC,OAAOrI,sBAAsB,CAACwI,WAAW,CAACH,SAAS,CAAC;IACtD,CAAC;EACH,CAAC,CAAC;EACF,OAAOxF,YAAY;AACrB;AACA,SAAST,uBAAuBA,CAACqG,gBAAgB,EAAE7G,cAAc,EAAE;EACjE,OAAO,IAAAT,mBAAM,EACX;IACE4B,IAAI,EAAE,SAANA,IAAIA,CAAYC,iBAAiB,EAAE;MACjC,IAAA0F,2CAA8B,EAAC,cAAc,EAAE1F,iBAAiB,CAAC;IACnE,CAAC;IACDA,iBAAiB,EAAEyF,gBAAgB,CAACpE,oBAAoB,CAAC,CAAC;IAC1DE,sBAAsB,EAAE,SAAxBA,sBAAsBA,CAAYC,QAAQ,EAAE;MAC1CiE,gBAAgB,CAAClE,sBAAsB,CAACC,QAAQ,CAAC;IACnD;EACF,CAAC,EACD5C,cACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -13,8 +13,12 @@ var _types = require("../types");
|
|
|
13
13
|
var _replayStats = require("../domain/replay/replayStats");
|
|
14
14
|
/* How long to wait for error checkouts */
|
|
15
15
|
var BUFFER_CHECKOUT_TIME = exports.BUFFER_CHECKOUT_TIME = 60 * _browserCore.ONE_SECOND;
|
|
16
|
+
var REPLAY_SEGMENT_FLUSH_HISTORY_LIMIT = 10;
|
|
16
17
|
function startRecording(lifeCycle, configuration, sessionManager, viewContexts, encoder, httpRequest) {
|
|
17
18
|
var cleanupTasks = [];
|
|
19
|
+
var lastReplaySegmentFlushForDebug;
|
|
20
|
+
var replaySegmentFlushHistoryForDebug = [];
|
|
21
|
+
var replaySegmentFlushCount = 0;
|
|
18
22
|
var reportError = function reportError(error) {
|
|
19
23
|
lifeCycle.notify(_browserCore.LifeCycleEventType.RAW_ERROR_COLLECTED, {
|
|
20
24
|
error: error
|
|
@@ -28,7 +32,16 @@ function startRecording(lifeCycle, configuration, sessionManager, viewContexts,
|
|
|
28
32
|
if (!(0, _browserCore.canUseEventBridge)()) {
|
|
29
33
|
var session = sessionManager.findTrackedSession();
|
|
30
34
|
var isRecordErrorSessionReplay = session && session.errorSessionReplayAllowed && !session.sessionHasError;
|
|
31
|
-
var segmentCollection = (0, _segmentCollection.startSegmentCollection)(lifeCycle, configuration, sessionManager, viewContexts, replayRequest, encoder, isRecordErrorSessionReplay
|
|
35
|
+
var segmentCollection = (0, _segmentCollection.startSegmentCollection)(lifeCycle, configuration, sessionManager, viewContexts, replayRequest, encoder, isRecordErrorSessionReplay, {
|
|
36
|
+
onSegmentFlushed: function onSegmentFlushed(segmentFlush) {
|
|
37
|
+
replaySegmentFlushCount += 1;
|
|
38
|
+
lastReplaySegmentFlushForDebug = cloneReplaySegmentFlushForDebug(segmentFlush, replaySegmentFlushCount);
|
|
39
|
+
replaySegmentFlushHistoryForDebug.push(lastReplaySegmentFlushForDebug);
|
|
40
|
+
if (replaySegmentFlushHistoryForDebug.length > REPLAY_SEGMENT_FLUSH_HISTORY_LIMIT) {
|
|
41
|
+
replaySegmentFlushHistoryForDebug.shift();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
});
|
|
32
45
|
addRecord = segmentCollection.addRecord;
|
|
33
46
|
var flushBufferSegment = segmentCollection.flushBufferSegment;
|
|
34
47
|
var unlockSegment = segmentCollection.unlockSegment;
|
|
@@ -64,7 +77,8 @@ function startRecording(lifeCycle, configuration, sessionManager, viewContexts,
|
|
|
64
77
|
_record = (0, _record2.record)({
|
|
65
78
|
emit: wrappedEmit,
|
|
66
79
|
configuration: configuration,
|
|
67
|
-
lifeCycle: lifeCycle
|
|
80
|
+
lifeCycle: lifeCycle,
|
|
81
|
+
sessionManager: sessionManager
|
|
68
82
|
});
|
|
69
83
|
} else {
|
|
70
84
|
;
|
|
@@ -73,11 +87,31 @@ function startRecording(lifeCycle, configuration, sessionManager, viewContexts,
|
|
|
73
87
|
_record = (0, _record2.record)({
|
|
74
88
|
emit: addRecord,
|
|
75
89
|
configuration: configuration,
|
|
76
|
-
lifeCycle: lifeCycle
|
|
90
|
+
lifeCycle: lifeCycle,
|
|
91
|
+
sessionManager: sessionManager
|
|
77
92
|
});
|
|
78
93
|
}
|
|
79
94
|
cleanupTasks.push(_record.stop);
|
|
80
95
|
var takeSubsequentFullSnapshot = _record.takeSubsequentFullSnapshot;
|
|
96
|
+
var snapshotCanvas = _record.snapshotCanvas;
|
|
97
|
+
var getSerializedNodeIdForDebug = _record.getSerializedNodeIdForDebug;
|
|
98
|
+
var getLastAutoCanvasSnapshotResultForDebug = _record.getLastAutoCanvasSnapshotResultForDebug;
|
|
99
|
+
var getAutoCanvasSnapshotDebugHistoryForDebug = _record.getAutoCanvasSnapshotDebugHistoryForDebug;
|
|
100
|
+
var getLastCanvasMutationForDebug = _record.getLastCanvasMutationForDebug;
|
|
101
|
+
var getCanvasMutationHistoryForDebug = _record.getCanvasMutationHistoryForDebug;
|
|
102
|
+
var getLastDomMutationForDebug = _record.getLastDomMutationForDebug;
|
|
103
|
+
var getDomMutationHistoryForDebug = _record.getDomMutationHistoryForDebug;
|
|
104
|
+
var getReplayPerformanceForDebug = function getReplayPerformanceForDebug() {
|
|
105
|
+
return cloneReplayPerformanceForDebug(_record.getReplayPerformanceForDebug ? _record.getReplayPerformanceForDebug() : undefined, replaySegmentFlushCount);
|
|
106
|
+
};
|
|
107
|
+
var getLastReplaySegmentFlushForDebug = function getLastReplaySegmentFlushForDebug() {
|
|
108
|
+
return cloneReplaySegmentFlushForDebug(lastReplaySegmentFlushForDebug);
|
|
109
|
+
};
|
|
110
|
+
var getReplaySegmentFlushHistoryForDebug = function getReplaySegmentFlushHistoryForDebug() {
|
|
111
|
+
return replaySegmentFlushHistoryForDebug.map(function (segmentFlush) {
|
|
112
|
+
return cloneReplaySegmentFlushForDebug(segmentFlush);
|
|
113
|
+
});
|
|
114
|
+
};
|
|
81
115
|
var flushMutations = _record.flushMutations;
|
|
82
116
|
var subscribeViewEnded = lifeCycle.subscribe(_browserCore.LifeCycleEventType.VIEW_ENDED, function () {
|
|
83
117
|
flushMutations();
|
|
@@ -97,7 +131,43 @@ function startRecording(lifeCycle, configuration, sessionManager, viewContexts,
|
|
|
97
131
|
task();
|
|
98
132
|
});
|
|
99
133
|
},
|
|
100
|
-
takeSubsequentFullSnapshot: takeSubsequentFullSnapshot
|
|
134
|
+
takeSubsequentFullSnapshot: takeSubsequentFullSnapshot,
|
|
135
|
+
snapshotCanvas: snapshotCanvas,
|
|
136
|
+
getSerializedNodeIdForDebug: getSerializedNodeIdForDebug,
|
|
137
|
+
getLastAutoCanvasSnapshotResultForDebug: getLastAutoCanvasSnapshotResultForDebug,
|
|
138
|
+
getAutoCanvasSnapshotDebugHistoryForDebug: getAutoCanvasSnapshotDebugHistoryForDebug,
|
|
139
|
+
getLastCanvasMutationForDebug: getLastCanvasMutationForDebug,
|
|
140
|
+
getCanvasMutationHistoryForDebug: getCanvasMutationHistoryForDebug,
|
|
141
|
+
getLastDomMutationForDebug: getLastDomMutationForDebug,
|
|
142
|
+
getDomMutationHistoryForDebug: getDomMutationHistoryForDebug,
|
|
143
|
+
getLastReplaySegmentFlushForDebug: getLastReplaySegmentFlushForDebug,
|
|
144
|
+
getReplaySegmentFlushHistoryForDebug: getReplaySegmentFlushHistoryForDebug,
|
|
145
|
+
getReplayPerformanceForDebug: getReplayPerformanceForDebug,
|
|
146
|
+
flushReplayMutationsForDebug: flushMutations
|
|
101
147
|
};
|
|
102
148
|
}
|
|
149
|
+
function cloneReplaySegmentFlushForDebug(segmentFlush, sequence) {
|
|
150
|
+
if (!segmentFlush) {
|
|
151
|
+
return segmentFlush;
|
|
152
|
+
}
|
|
153
|
+
return {
|
|
154
|
+
sequence: typeof sequence === 'number' ? sequence : segmentFlush.sequence,
|
|
155
|
+
creationReason: segmentFlush.creationReason,
|
|
156
|
+
flushReason: segmentFlush.flushReason,
|
|
157
|
+
recordsCount: segmentFlush.recordsCount,
|
|
158
|
+
recordCountsByType: (0, _browserCore.assign)({}, segmentFlush.recordCountsByType),
|
|
159
|
+
start: segmentFlush.start,
|
|
160
|
+
end: segmentFlush.end,
|
|
161
|
+
indexInView: segmentFlush.indexInView,
|
|
162
|
+
rawBytesCount: segmentFlush.rawBytesCount
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
function cloneReplayPerformanceForDebug(stats, replaySegmentFlushCount) {
|
|
166
|
+
if (!stats && typeof replaySegmentFlushCount === 'undefined') {
|
|
167
|
+
return undefined;
|
|
168
|
+
}
|
|
169
|
+
return (0, _browserCore.assign)({}, stats || {}, {
|
|
170
|
+
replaySegmentFlushCount: replaySegmentFlushCount || 0
|
|
171
|
+
});
|
|
172
|
+
}
|
|
103
173
|
//# sourceMappingURL=startRecording.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startRecording.js","names":["_browserCore","require","_record2","_startRecordBridge2","_segmentCollection","_types","_replayStats","BUFFER_CHECKOUT_TIME","exports","ONE_SECOND","startRecording","lifeCycle","configuration","sessionManager","viewContexts","encoder","httpRequest","cleanupTasks","reportError","error","notify","LifeCycleEventType","RAW_ERROR_COLLECTED","addTelemetryDebug","message","replayRequest","createHttpRequest","sessionReplayEndPoint","SEGMENT_BYTES_LIMIT","retryMaxSize","addRecord","_record","canUseEventBridge","session","findTrackedSession","isRecordErrorSessionReplay","errorSessionReplayAllowed","sessionHasError","segmentCollection","startSegmentCollection","flushBufferSegment","unlockSegment","push","stop","sessionStateUpdateObservable","subscribe","_ref","previousState","newState","hasError","lastFullSnapshotEvent","wrappedEmit","recordData","type","RecordType","FullSnapshot","IncrementalSnapshot","exceedTime","timestamp","deleteOldestStats","takeSubsequentFullSnapshot","record","emit","_startRecordBridge","startRecordBridge","flushMutations","subscribeViewEnded","VIEW_ENDED","timeStampNow","ViewEnd","unsubscribe","scribeViewCreated","VIEW_CREATED","view","startClocks","timeStamp","forEach","task"],"sources":["../../src/boot/startRecording.js"],"sourcesContent":["import {\n timeStampNow,\n createHttpRequest,\n LifeCycleEventType,\n addTelemetryDebug,\n ONE_SECOND,\n canUseEventBridge\n} from '@cloudcare/browser-core'\nimport { record } from '../domain/replay/record'\nimport { startRecordBridge } from '../domain/replay/startRecordBridge'\nimport {\n startSegmentCollection,\n SEGMENT_BYTES_LIMIT\n} from '../domain/replay/segmentCollection'\nimport { RecordType } from '../types'\nimport { deleteOldestStats } from '../domain/replay/replayStats'\n/* How long to wait for error checkouts */\nexport const BUFFER_CHECKOUT_TIME = 60 * ONE_SECOND\nexport function startRecording(\n lifeCycle,\n configuration,\n sessionManager,\n viewContexts,\n encoder,\n httpRequest\n) {\n var cleanupTasks = []\n var reportError = function (error) {\n lifeCycle.notify(LifeCycleEventType.RAW_ERROR_COLLECTED, { error: error })\n addTelemetryDebug('Error reported to customer', {\n 'error.message': error.message\n })\n }\n\n var replayRequest =\n httpRequest ||\n createHttpRequest(\n configuration.sessionReplayEndPoint,\n SEGMENT_BYTES_LIMIT,\n configuration.retryMaxSize,\n reportError\n )\n\n let addRecord, _record\n if (!canUseEventBridge()) {\n const session = sessionManager.findTrackedSession()\n let isRecordErrorSessionReplay =\n session && session.errorSessionReplayAllowed && !session.sessionHasError\n var segmentCollection = startSegmentCollection(\n lifeCycle,\n configuration,\n sessionManager,\n viewContexts,\n replayRequest,\n encoder,\n isRecordErrorSessionReplay\n )\n addRecord = segmentCollection.addRecord\n let flushBufferSegment = segmentCollection.flushBufferSegment\n let unlockSegment = segmentCollection.unlockSegment\n cleanupTasks.push(segmentCollection.stop)\n if (isRecordErrorSessionReplay) {\n sessionManager.sessionStateUpdateObservable.subscribe(\n ({ previousState, newState }) => {\n if (!previousState.hasError && newState.hasError) {\n isRecordErrorSessionReplay = false\n unlockSegment()\n }\n }\n )\n }\n let lastFullSnapshotEvent = null\n const wrappedEmit = (recordData) => {\n addRecord(recordData)\n if (isRecordErrorSessionReplay) {\n if (recordData.type === RecordType.FullSnapshot) {\n lastFullSnapshotEvent = recordData\n } else if (recordData.type === RecordType.IncrementalSnapshot) {\n const exceedTime =\n recordData.timestamp - lastFullSnapshotEvent.timestamp >\n BUFFER_CHECKOUT_TIME\n // If the time between the last full snapshot and the incremental snapshot is greater than the buffer time, we need to take a new full snapshot\n if (exceedTime) {\n flushBufferSegment(() => {\n deleteOldestStats()\n takeSubsequentFullSnapshot()\n })\n }\n }\n }\n }\n _record = record({\n emit: wrappedEmit,\n configuration: configuration,\n lifeCycle: lifeCycle\n })\n } else {\n ;({ addRecord } = startRecordBridge(viewContexts))\n _record = record({\n emit: addRecord,\n configuration: configuration,\n lifeCycle: lifeCycle\n })\n }\n cleanupTasks.push(_record.stop)\n var takeSubsequentFullSnapshot = _record.takeSubsequentFullSnapshot\n var flushMutations = _record.flushMutations\n var subscribeViewEnded = lifeCycle.subscribe(\n LifeCycleEventType.VIEW_ENDED,\n function () {\n flushMutations()\n addRecord({\n timestamp: timeStampNow(),\n type: RecordType.ViewEnd\n })\n }\n )\n cleanupTasks.push(subscribeViewEnded.unsubscribe)\n var scribeViewCreated = lifeCycle.subscribe(\n LifeCycleEventType.VIEW_CREATED,\n function (view) {\n takeSubsequentFullSnapshot(view.startClocks.timeStamp)\n }\n )\n cleanupTasks.push(scribeViewCreated.unsubscribe)\n\n return {\n stop: function () {\n cleanupTasks.forEach(function (task) {\n task()\n })\n },\n takeSubs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|
|
1
|
+
{"version":3,"file":"startRecording.js","names":["_browserCore","require","_record2","_startRecordBridge2","_segmentCollection","_types","_replayStats","BUFFER_CHECKOUT_TIME","exports","ONE_SECOND","REPLAY_SEGMENT_FLUSH_HISTORY_LIMIT","startRecording","lifeCycle","configuration","sessionManager","viewContexts","encoder","httpRequest","cleanupTasks","lastReplaySegmentFlushForDebug","replaySegmentFlushHistoryForDebug","replaySegmentFlushCount","reportError","error","notify","LifeCycleEventType","RAW_ERROR_COLLECTED","addTelemetryDebug","message","replayRequest","createHttpRequest","sessionReplayEndPoint","SEGMENT_BYTES_LIMIT","retryMaxSize","addRecord","_record","canUseEventBridge","session","findTrackedSession","isRecordErrorSessionReplay","errorSessionReplayAllowed","sessionHasError","segmentCollection","startSegmentCollection","onSegmentFlushed","segmentFlush","cloneReplaySegmentFlushForDebug","push","length","shift","flushBufferSegment","unlockSegment","stop","sessionStateUpdateObservable","subscribe","_ref","previousState","newState","hasError","lastFullSnapshotEvent","wrappedEmit","recordData","type","RecordType","FullSnapshot","IncrementalSnapshot","exceedTime","timestamp","deleteOldestStats","takeSubsequentFullSnapshot","record","emit","_startRecordBridge","startRecordBridge","snapshotCanvas","getSerializedNodeIdForDebug","getLastAutoCanvasSnapshotResultForDebug","getAutoCanvasSnapshotDebugHistoryForDebug","getLastCanvasMutationForDebug","getCanvasMutationHistoryForDebug","getLastDomMutationForDebug","getDomMutationHistoryForDebug","getReplayPerformanceForDebug","cloneReplayPerformanceForDebug","undefined","getLastReplaySegmentFlushForDebug","getReplaySegmentFlushHistoryForDebug","map","flushMutations","subscribeViewEnded","VIEW_ENDED","timeStampNow","ViewEnd","unsubscribe","scribeViewCreated","VIEW_CREATED","view","startClocks","timeStamp","forEach","task","flushReplayMutationsForDebug","sequence","creationReason","flushReason","recordsCount","recordCountsByType","assign","start","end","indexInView","rawBytesCount","stats"],"sources":["../../src/boot/startRecording.js"],"sourcesContent":["import {\n timeStampNow,\n createHttpRequest,\n LifeCycleEventType,\n addTelemetryDebug,\n ONE_SECOND,\n canUseEventBridge,\n assign\n} from '@cloudcare/browser-core'\nimport { record } from '../domain/replay/record'\nimport { startRecordBridge } from '../domain/replay/startRecordBridge'\nimport {\n startSegmentCollection,\n SEGMENT_BYTES_LIMIT\n} from '../domain/replay/segmentCollection'\nimport { RecordType } from '../types'\nimport { deleteOldestStats } from '../domain/replay/replayStats'\n/* How long to wait for error checkouts */\nexport const BUFFER_CHECKOUT_TIME = 60 * ONE_SECOND\nvar REPLAY_SEGMENT_FLUSH_HISTORY_LIMIT = 10\nexport function startRecording(\n lifeCycle,\n configuration,\n sessionManager,\n viewContexts,\n encoder,\n httpRequest\n) {\n var cleanupTasks = []\n var lastReplaySegmentFlushForDebug\n var replaySegmentFlushHistoryForDebug = []\n var replaySegmentFlushCount = 0\n var reportError = function (error) {\n lifeCycle.notify(LifeCycleEventType.RAW_ERROR_COLLECTED, { error: error })\n addTelemetryDebug('Error reported to customer', {\n 'error.message': error.message\n })\n }\n\n var replayRequest =\n httpRequest ||\n createHttpRequest(\n configuration.sessionReplayEndPoint,\n SEGMENT_BYTES_LIMIT,\n configuration.retryMaxSize,\n reportError\n )\n\n let addRecord, _record\n if (!canUseEventBridge()) {\n const session = sessionManager.findTrackedSession()\n let isRecordErrorSessionReplay =\n session && session.errorSessionReplayAllowed && !session.sessionHasError\n var segmentCollection = startSegmentCollection(\n lifeCycle,\n configuration,\n sessionManager,\n viewContexts,\n replayRequest,\n encoder,\n isRecordErrorSessionReplay,\n {\n onSegmentFlushed: function (segmentFlush) {\n replaySegmentFlushCount += 1\n lastReplaySegmentFlushForDebug =\n cloneReplaySegmentFlushForDebug(\n segmentFlush,\n replaySegmentFlushCount\n )\n replaySegmentFlushHistoryForDebug.push(lastReplaySegmentFlushForDebug)\n if (\n replaySegmentFlushHistoryForDebug.length >\n REPLAY_SEGMENT_FLUSH_HISTORY_LIMIT\n ) {\n replaySegmentFlushHistoryForDebug.shift()\n }\n }\n }\n )\n addRecord = segmentCollection.addRecord\n let flushBufferSegment = segmentCollection.flushBufferSegment\n let unlockSegment = segmentCollection.unlockSegment\n cleanupTasks.push(segmentCollection.stop)\n if (isRecordErrorSessionReplay) {\n sessionManager.sessionStateUpdateObservable.subscribe(\n ({ previousState, newState }) => {\n if (!previousState.hasError && newState.hasError) {\n isRecordErrorSessionReplay = false\n unlockSegment()\n }\n }\n )\n }\n let lastFullSnapshotEvent = null\n const wrappedEmit = (recordData) => {\n addRecord(recordData)\n if (isRecordErrorSessionReplay) {\n if (recordData.type === RecordType.FullSnapshot) {\n lastFullSnapshotEvent = recordData\n } else if (recordData.type === RecordType.IncrementalSnapshot) {\n const exceedTime =\n recordData.timestamp - lastFullSnapshotEvent.timestamp >\n BUFFER_CHECKOUT_TIME\n // If the time between the last full snapshot and the incremental snapshot is greater than the buffer time, we need to take a new full snapshot\n if (exceedTime) {\n flushBufferSegment(() => {\n deleteOldestStats()\n takeSubsequentFullSnapshot()\n })\n }\n }\n }\n }\n _record = record({\n emit: wrappedEmit,\n configuration: configuration,\n lifeCycle: lifeCycle,\n sessionManager: sessionManager\n })\n } else {\n ;({ addRecord } = startRecordBridge(viewContexts))\n _record = record({\n emit: addRecord,\n configuration: configuration,\n lifeCycle: lifeCycle,\n sessionManager: sessionManager\n })\n }\n cleanupTasks.push(_record.stop)\n var takeSubsequentFullSnapshot = _record.takeSubsequentFullSnapshot\n var snapshotCanvas = _record.snapshotCanvas\n var getSerializedNodeIdForDebug = _record.getSerializedNodeIdForDebug\n var getLastAutoCanvasSnapshotResultForDebug =\n _record.getLastAutoCanvasSnapshotResultForDebug\n var getAutoCanvasSnapshotDebugHistoryForDebug =\n _record.getAutoCanvasSnapshotDebugHistoryForDebug\n var getLastCanvasMutationForDebug = _record.getLastCanvasMutationForDebug\n var getCanvasMutationHistoryForDebug =\n _record.getCanvasMutationHistoryForDebug\n var getLastDomMutationForDebug = _record.getLastDomMutationForDebug\n var getDomMutationHistoryForDebug = _record.getDomMutationHistoryForDebug\n var getReplayPerformanceForDebug = function () {\n return cloneReplayPerformanceForDebug(\n _record.getReplayPerformanceForDebug\n ? _record.getReplayPerformanceForDebug()\n : undefined,\n replaySegmentFlushCount\n )\n }\n var getLastReplaySegmentFlushForDebug = function () {\n return cloneReplaySegmentFlushForDebug(lastReplaySegmentFlushForDebug)\n }\n var getReplaySegmentFlushHistoryForDebug = function () {\n return replaySegmentFlushHistoryForDebug.map(function (segmentFlush) {\n return cloneReplaySegmentFlushForDebug(segmentFlush)\n })\n }\n var flushMutations = _record.flushMutations\n var subscribeViewEnded = lifeCycle.subscribe(\n LifeCycleEventType.VIEW_ENDED,\n function () {\n flushMutations()\n addRecord({\n timestamp: timeStampNow(),\n type: RecordType.ViewEnd\n })\n }\n )\n cleanupTasks.push(subscribeViewEnded.unsubscribe)\n var scribeViewCreated = lifeCycle.subscribe(\n LifeCycleEventType.VIEW_CREATED,\n function (view) {\n takeSubsequentFullSnapshot(view.startClocks.timeStamp)\n }\n )\n cleanupTasks.push(scribeViewCreated.unsubscribe)\n\n return {\n stop: function () {\n cleanupTasks.forEach(function (task) {\n task()\n })\n },\n takeSubsequentFullSnapshot: takeSubsequentFullSnapshot,\n snapshotCanvas: snapshotCanvas,\n getSerializedNodeIdForDebug: getSerializedNodeIdForDebug,\n getLastAutoCanvasSnapshotResultForDebug:\n getLastAutoCanvasSnapshotResultForDebug,\n getAutoCanvasSnapshotDebugHistoryForDebug:\n getAutoCanvasSnapshotDebugHistoryForDebug,\n getLastCanvasMutationForDebug: getLastCanvasMutationForDebug,\n getCanvasMutationHistoryForDebug: getCanvasMutationHistoryForDebug,\n getLastDomMutationForDebug: getLastDomMutationForDebug,\n getDomMutationHistoryForDebug: getDomMutationHistoryForDebug,\n getLastReplaySegmentFlushForDebug: getLastReplaySegmentFlushForDebug,\n getReplaySegmentFlushHistoryForDebug:\n getReplaySegmentFlushHistoryForDebug,\n getReplayPerformanceForDebug: getReplayPerformanceForDebug,\n flushReplayMutationsForDebug: flushMutations\n }\n}\n\nfunction cloneReplaySegmentFlushForDebug(segmentFlush, sequence) {\n if (!segmentFlush) {\n return segmentFlush\n }\n\n return {\n sequence: typeof sequence === 'number' ? sequence : segmentFlush.sequence,\n creationReason: segmentFlush.creationReason,\n flushReason: segmentFlush.flushReason,\n recordsCount: segmentFlush.recordsCount,\n recordCountsByType: assign({}, segmentFlush.recordCountsByType),\n start: segmentFlush.start,\n end: segmentFlush.end,\n indexInView: segmentFlush.indexInView,\n rawBytesCount: segmentFlush.rawBytesCount\n }\n}\n\nfunction cloneReplayPerformanceForDebug(stats, replaySegmentFlushCount) {\n if (!stats && typeof replaySegmentFlushCount === 'undefined') {\n return undefined\n }\n\n return assign({}, stats || {}, {\n replaySegmentFlushCount: replaySegmentFlushCount || 0\n })\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AASA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,mBAAA,GAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAH,OAAA;AAIA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA;AACO,IAAMM,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAAG,EAAE,GAAGE,uBAAU;AACnD,IAAIC,kCAAkC,GAAG,EAAE;AACpC,SAASC,cAAcA,CAC5BC,SAAS,EACTC,aAAa,EACbC,cAAc,EACdC,YAAY,EACZC,OAAO,EACPC,WAAW,EACX;EACA,IAAIC,YAAY,GAAG,EAAE;EACrB,IAAIC,8BAA8B;EAClC,IAAIC,iCAAiC,GAAG,EAAE;EAC1C,IAAIC,uBAAuB,GAAG,CAAC;EAC/B,IAAIC,WAAW,GAAG,SAAdA,WAAWA,CAAaC,KAAK,EAAE;IACjCX,SAAS,CAACY,MAAM,CAACC,+BAAkB,CAACC,mBAAmB,EAAE;MAAEH,KAAK,EAAEA;IAAM,CAAC,CAAC;IAC1E,IAAAI,8BAAiB,EAAC,4BAA4B,EAAE;MAC9C,eAAe,EAAE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,QAAQ;IACzEC,cAAc,EAAE1D,YAAY,CAAC0D,cAAc;IAC3CC,WAAW,EAAE3D,YAAY,CAAC2D,WAAW;IACrCC,YAAY,EAAE5D,YAAY,CAAC4D,YAAY;IACvCC,kBAAkB,EAAE,IAAAC,mBAAM,EAAC,CAAC,CAAC,EAAE9D,YAAY,CAAC6D,kBAAkB,CAAC;IAC/DE,KAAK,EAAE/D,YAAY,CAAC+D,KAAK;IACzBC,GAAG,EAAEhE,YAAY,CAACgE,GAAG;IACrBC,WAAW,EAAEjE,YAAY,CAACiE,WAAW;IACrCC,aAAa,EAAElE,YAAY,CAACkE;EAC9B,CAAC;AACH;AAEA,SAAS5B,8BAA8BA,CAAC6B,KAAK,EAAE3F,uBAAuB,EAAE;EACtE,IAAI,CAAC2F,KAAK,IAAI,OAAO3F,uBAAuB,KAAK,WAAW,EAAE;IAC5D,OAAO+D,SAAS;EAClB;EAEA,OAAO,IAAAuB,mBAAM,EAAC,CAAC,CAAC,EAAEK,KAAK,IAAI,CAAC,CAAC,EAAE;IAC7B3F,uBAAuB,EAAEA,uBAAuB,IAAI;EACtD,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
@@ -7,6 +7,38 @@ exports.validateAndBuildRumConfiguration = validateAndBuildRumConfiguration;
|
|
|
7
7
|
var _browserCore = require("@cloudcare/browser-core");
|
|
8
8
|
var _buildEnv = require("../boot/buildEnv");
|
|
9
9
|
var _tracer = require("../domain/tracing/tracer");
|
|
10
|
+
var REPLAY_CANVAS_QUALITY_PRESETS = {
|
|
11
|
+
low: {
|
|
12
|
+
quality: 0.25,
|
|
13
|
+
sampling: 1,
|
|
14
|
+
autoInterval: 1500,
|
|
15
|
+
autoCooldown: 3000,
|
|
16
|
+
autoUnchangedBackoff: 5000,
|
|
17
|
+
autoFailureBackoff: 7000,
|
|
18
|
+
autoMaxPerRun: 1
|
|
19
|
+
},
|
|
20
|
+
medium: {
|
|
21
|
+
quality: 0.4,
|
|
22
|
+
sampling: 2,
|
|
23
|
+
autoInterval: 1000,
|
|
24
|
+
autoCooldown: 2000,
|
|
25
|
+
autoUnchangedBackoff: 3000,
|
|
26
|
+
autoFailureBackoff: 5000,
|
|
27
|
+
autoMaxPerRun: 2
|
|
28
|
+
},
|
|
29
|
+
high: {
|
|
30
|
+
quality: 0.5,
|
|
31
|
+
sampling: 4,
|
|
32
|
+
autoInterval: 700,
|
|
33
|
+
autoCooldown: 1400,
|
|
34
|
+
autoUnchangedBackoff: 2000,
|
|
35
|
+
autoFailureBackoff: 4000,
|
|
36
|
+
autoMaxPerRun: 4
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
function getReplayCanvasQualityPreset(value) {
|
|
40
|
+
return typeof value === 'string' ? REPLAY_CANVAS_QUALITY_PRESETS[value] : undefined;
|
|
41
|
+
}
|
|
10
42
|
function validateAndBuildRumConfiguration(initConfiguration) {
|
|
11
43
|
if (!initConfiguration.applicationId) {
|
|
12
44
|
_browserCore.display.error('Application ID is not configured, no RUM data will be collected.');
|
|
@@ -50,11 +82,61 @@ function validateAndBuildRumConfiguration(initConfiguration) {
|
|
|
50
82
|
_browserCore.display.error('Excluded Activity Urls should be an array');
|
|
51
83
|
return;
|
|
52
84
|
}
|
|
85
|
+
if (initConfiguration.replayCanvasMode !== undefined && initConfiguration.replayCanvasMode !== 'manual' && initConfiguration.replayCanvasMode !== 'auto') {
|
|
86
|
+
_browserCore.display.error("Replay Canvas Mode should be 'manual' or 'auto'");
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
if (initConfiguration.replayCanvasQuality !== undefined && !(getReplayCanvasQualityPreset(initConfiguration.replayCanvasQuality) || typeof initConfiguration.replayCanvasQuality === 'number' && initConfiguration.replayCanvasQuality >= 0 && initConfiguration.replayCanvasQuality <= 1)) {
|
|
90
|
+
_browserCore.display.error("Replay Canvas Quality should be 'low', 'medium', 'high', or a number between 0 and 1");
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
if (initConfiguration.replayCanvasSampling !== undefined && !(initConfiguration.replayCanvasSampling === 'all' || (0, _browserCore.isNumber)(initConfiguration.replayCanvasSampling) && initConfiguration.replayCanvasSampling > 0)) {
|
|
94
|
+
_browserCore.display.error("Replay Canvas Sampling should be 'all' or a positive number");
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
if (initConfiguration.replayCanvasMaxCanvasSize !== undefined && (!(0, _browserCore.isNumber)(initConfiguration.replayCanvasMaxCanvasSize) || initConfiguration.replayCanvasMaxCanvasSize <= 0)) {
|
|
98
|
+
_browserCore.display.error('Replay Canvas Max Canvas Size should be a positive number');
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
if (initConfiguration.replayCanvasMaxEncodedBytes !== undefined && (!(0, _browserCore.isNumber)(initConfiguration.replayCanvasMaxEncodedBytes) || initConfiguration.replayCanvasMaxEncodedBytes <= 0)) {
|
|
102
|
+
_browserCore.display.error('Replay Canvas Max Encoded Bytes should be a positive number');
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
if (initConfiguration.replayCanvasMaxConcurrentEncodes !== undefined && (!(0, _browserCore.isNumber)(initConfiguration.replayCanvasMaxConcurrentEncodes) || initConfiguration.replayCanvasMaxConcurrentEncodes <= 0)) {
|
|
106
|
+
_browserCore.display.error('Replay Canvas Max Concurrent Encodes should be a positive number');
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
if (initConfiguration.replayCanvasAutoInterval !== undefined && (!(0, _browserCore.isNumber)(initConfiguration.replayCanvasAutoInterval) || initConfiguration.replayCanvasAutoInterval <= 0)) {
|
|
110
|
+
_browserCore.display.error('Replay Canvas Auto Interval should be a positive number');
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
if (initConfiguration.replayCanvasAutoCooldown !== undefined && (!(0, _browserCore.isNumber)(initConfiguration.replayCanvasAutoCooldown) || initConfiguration.replayCanvasAutoCooldown <= 0)) {
|
|
114
|
+
_browserCore.display.error('Replay Canvas Auto Cooldown should be a positive number');
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
if (initConfiguration.replayCanvasAutoUnchangedBackoff !== undefined && (!(0, _browserCore.isNumber)(initConfiguration.replayCanvasAutoUnchangedBackoff) || initConfiguration.replayCanvasAutoUnchangedBackoff <= 0)) {
|
|
118
|
+
_browserCore.display.error('Replay Canvas Auto Unchanged Backoff should be a positive number');
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
if (initConfiguration.replayCanvasAutoFailureBackoff !== undefined && (!(0, _browserCore.isNumber)(initConfiguration.replayCanvasAutoFailureBackoff) || initConfiguration.replayCanvasAutoFailureBackoff <= 0)) {
|
|
122
|
+
_browserCore.display.error('Replay Canvas Auto Failure Backoff should be a positive number');
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
if (initConfiguration.replayCanvasAutoMaxPerRun !== undefined && (!(0, _browserCore.isNumber)(initConfiguration.replayCanvasAutoMaxPerRun) || initConfiguration.replayCanvasAutoMaxPerRun <= 0)) {
|
|
126
|
+
_browserCore.display.error('Replay Canvas Auto Max Per Run should be a positive number');
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
53
129
|
var baseConfiguration = (0, _browserCore.validateAndBuildConfiguration)(initConfiguration);
|
|
54
130
|
if (!baseConfiguration) {
|
|
55
131
|
return;
|
|
56
132
|
}
|
|
57
133
|
var trackUserInteractions = !!(0, _browserCore.isNullUndefinedDefaultValue)(initConfiguration.trackUserInteractions, initConfiguration.trackInteractions);
|
|
134
|
+
var replayCanvasMode = (0, _browserCore.isNullUndefinedDefaultValue)(initConfiguration.replayCanvasMode, 'auto');
|
|
135
|
+
var replayCanvasQualityPreset = getReplayCanvasQualityPreset(initConfiguration.replayCanvasQuality);
|
|
136
|
+
var replayCanvasSampling = initConfiguration.replayCanvasSampling;
|
|
137
|
+
if (replayCanvasSampling === undefined || replayCanvasSampling === null) {
|
|
138
|
+
replayCanvasSampling = replayCanvasQualityPreset ? replayCanvasQualityPreset.sampling : 2;
|
|
139
|
+
}
|
|
58
140
|
return (0, _browserCore.assign)({
|
|
59
141
|
applicationId: initConfiguration.applicationId,
|
|
60
142
|
actionNameAttribute: initConfiguration.actionNameAttribute,
|
|
@@ -67,14 +149,30 @@ function validateAndBuildRumConfiguration(initConfiguration) {
|
|
|
67
149
|
generateTraceId: initConfiguration.generateTraceId && (0, _browserCore.catchUserErrors)(initConfiguration.generateTraceId, 'generateTraceId threw an error:'),
|
|
68
150
|
excludedActivityUrls: (0, _browserCore.isNullUndefinedDefaultValue)(initConfiguration.excludedActivityUrls, []),
|
|
69
151
|
workerUrl: initConfiguration.workerUrl,
|
|
152
|
+
replayCanvasWorkerUrl: initConfiguration.replayCanvasWorkerUrl,
|
|
70
153
|
compressIntakeRequests: !!initConfiguration.compressIntakeRequests,
|
|
71
154
|
trackUserInteractions: trackUserInteractions,
|
|
72
155
|
enableLongAnimationFrame: !!initConfiguration.enableLongAnimationFrame,
|
|
73
156
|
trackViewsManually: !!initConfiguration.trackViewsManually,
|
|
157
|
+
replayCanvasEnabled: !!initConfiguration.replayCanvasEnabled,
|
|
158
|
+
replayCanvasMode: replayCanvasMode,
|
|
159
|
+
replayCanvasSampling: replayCanvasSampling,
|
|
160
|
+
replayCanvasQuality: (0, _browserCore.isNullUndefinedDefaultValue)(replayCanvasQualityPreset ? replayCanvasQualityPreset.quality : initConfiguration.replayCanvasQuality, 0.4),
|
|
161
|
+
replayCanvasMimeType: (0, _browserCore.isNullUndefinedDefaultValue)(initConfiguration.replayCanvasMimeType, 'image/webp'),
|
|
162
|
+
replayCanvasMaxCanvasSize: (0, _browserCore.isNullUndefinedDefaultValue)(initConfiguration.replayCanvasMaxCanvasSize, 1280),
|
|
163
|
+
replayCanvasMaxEncodedBytes: (0, _browserCore.isNullUndefinedDefaultValue)(initConfiguration.replayCanvasMaxEncodedBytes, 40000),
|
|
164
|
+
replayCanvasMaxConcurrentEncodes: (0, _browserCore.isNullUndefinedDefaultValue)(initConfiguration.replayCanvasMaxConcurrentEncodes, 1),
|
|
165
|
+
replayCanvasAutoInterval: (0, _browserCore.isNullUndefinedDefaultValue)(initConfiguration.replayCanvasAutoInterval, replayCanvasQualityPreset ? replayCanvasQualityPreset.autoInterval : undefined, 1000),
|
|
166
|
+
replayCanvasAutoCooldown: (0, _browserCore.isNullUndefinedDefaultValue)(initConfiguration.replayCanvasAutoCooldown, replayCanvasQualityPreset ? replayCanvasQualityPreset.autoCooldown : undefined, 1000),
|
|
167
|
+
replayCanvasAutoUnchangedBackoff: (0, _browserCore.isNullUndefinedDefaultValue)(initConfiguration.replayCanvasAutoUnchangedBackoff, replayCanvasQualityPreset ? replayCanvasQualityPreset.autoUnchangedBackoff : undefined, 3000),
|
|
168
|
+
replayCanvasAutoFailureBackoff: (0, _browserCore.isNullUndefinedDefaultValue)(initConfiguration.replayCanvasAutoFailureBackoff, replayCanvasQualityPreset ? replayCanvasQualityPreset.autoFailureBackoff : undefined, 5000),
|
|
169
|
+
replayCanvasAutoMaxPerRun: (0, _browserCore.isNullUndefinedDefaultValue)(initConfiguration.replayCanvasAutoMaxPerRun, replayCanvasQualityPreset ? replayCanvasQualityPreset.autoMaxPerRun : undefined, 2),
|
|
170
|
+
replayCanvasFlushImmediately: (0, _browserCore.isNullUndefinedDefaultValue)(initConfiguration.replayCanvasFlushImmediately, replayCanvasMode === 'manual'),
|
|
74
171
|
traceType: (0, _browserCore.isNullUndefinedDefaultValue)(initConfiguration.traceType, _browserCore.TraceType.DDTRACE),
|
|
75
172
|
traceId128Bit: !!initConfiguration.traceId128Bit,
|
|
76
173
|
defaultPrivacyLevel: (0, _browserCore.objectHasValue)(_browserCore.DefaultPrivacyLevel, initConfiguration.defaultPrivacyLevel) ? initConfiguration.defaultPrivacyLevel : _browserCore.DefaultPrivacyLevel.MASK_USER_INPUT,
|
|
77
|
-
shouldMaskNode: initConfiguration.shouldMaskNode && (0, _browserCore.catchUserErrors)(initConfiguration.shouldMaskNode, 'shouldMaskNode threw an error:')
|
|
174
|
+
shouldMaskNode: initConfiguration.shouldMaskNode && (0, _browserCore.catchUserErrors)(initConfiguration.shouldMaskNode, 'shouldMaskNode threw an error:'),
|
|
175
|
+
shouldRecordCanvas: initConfiguration.shouldRecordCanvas && (0, _browserCore.catchUserErrors)(initConfiguration.shouldRecordCanvas, 'shouldRecordCanvas threw an error:')
|
|
78
176
|
}, baseConfiguration, _buildEnv.buildEnv);
|
|
79
177
|
}
|
|
80
178
|
/**
|