@kubesense/kubesense-browser-rum 1.0.0
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/LICENSE +201 -0
- package/README.md +34 -0
- package/bundle/chunks/profiler-b64730a2109c3ddbc539-kubesense-rum.js +1 -0
- package/bundle/chunks/recorder-9ae532a18bac5f4280da-kubesense-rum.js +1 -0
- package/bundle/kubesense-rum.js +1 -0
- package/cjs/boot/isBrowserSupported.d.ts +4 -0
- package/cjs/boot/isBrowserSupported.js +17 -0
- package/cjs/boot/isBrowserSupported.js.map +1 -0
- package/cjs/boot/lazyLoadProfiler.d.ts +4 -0
- package/cjs/boot/lazyLoadProfiler.js +54 -0
- package/cjs/boot/lazyLoadProfiler.js.map +1 -0
- package/cjs/boot/lazyLoadRecorder.d.ts +4 -0
- package/cjs/boot/lazyLoadRecorder.js +54 -0
- package/cjs/boot/lazyLoadRecorder.js.map +1 -0
- package/cjs/boot/postStartStrategy.d.ts +33 -0
- package/cjs/boot/postStartStrategy.js +98 -0
- package/cjs/boot/postStartStrategy.js.map +1 -0
- package/cjs/boot/preStartStrategy.d.ts +6 -0
- package/cjs/boot/preStartStrategy.js +24 -0
- package/cjs/boot/preStartStrategy.js.map +1 -0
- package/cjs/boot/profilerApi.d.ts +2 -0
- package/cjs/boot/profilerApi.js +53 -0
- package/cjs/boot/profilerApi.js.map +1 -0
- package/cjs/boot/recorderApi.d.ts +4 -0
- package/cjs/boot/recorderApi.js +73 -0
- package/cjs/boot/recorderApi.js.map +1 -0
- package/cjs/boot/startRecording.d.ts +6 -0
- package/cjs/boot/startRecording.js +45 -0
- package/cjs/boot/startRecording.js.map +1 -0
- package/cjs/domain/deflate/deflateEncoder.d.ts +3 -0
- package/cjs/domain/deflate/deflateEncoder.js +110 -0
- package/cjs/domain/deflate/deflateEncoder.js.map +1 -0
- package/cjs/domain/deflate/deflateWorker.d.ts +30 -0
- package/cjs/domain/deflate/deflateWorker.js +104 -0
- package/cjs/domain/deflate/deflateWorker.js.map +1 -0
- package/cjs/domain/deflate/index.d.ts +3 -0
- package/cjs/domain/deflate/index.js +10 -0
- package/cjs/domain/deflate/index.js.map +1 -0
- package/cjs/domain/getSessionReplayLink.d.ts +2 -0
- package/cjs/domain/getSessionReplayLink.js +35 -0
- package/cjs/domain/getSessionReplayLink.js.map +1 -0
- package/cjs/domain/profiling/profiler.d.ts +7 -0
- package/cjs/domain/profiling/profiler.js +244 -0
- package/cjs/domain/profiling/profiler.js.map +1 -0
- package/cjs/domain/profiling/profilingContext.d.ts +6 -0
- package/cjs/domain/profiling/profilingContext.js +28 -0
- package/cjs/domain/profiling/profilingContext.js.map +1 -0
- package/cjs/domain/profiling/profilingSupported.d.ts +1 -0
- package/cjs/domain/profiling/profilingSupported.js +11 -0
- package/cjs/domain/profiling/profilingSupported.js.map +1 -0
- package/cjs/domain/profiling/test-utils/mockedTrace.d.ts +3 -0
- package/cjs/domain/profiling/test-utils/mockedTrace.js +57 -0
- package/cjs/domain/profiling/test-utils/mockedTrace.js.map +1 -0
- package/cjs/domain/profiling/transport/assembly.d.ts +21 -0
- package/cjs/domain/profiling/transport/assembly.js +45 -0
- package/cjs/domain/profiling/transport/assembly.js.map +1 -0
- package/cjs/domain/profiling/transport/buildProfileEventAttributes.d.ts +25 -0
- package/cjs/domain/profiling/transport/buildProfileEventAttributes.js +50 -0
- package/cjs/domain/profiling/transport/buildProfileEventAttributes.js.map +1 -0
- package/cjs/domain/profiling/types/index.d.ts +2 -0
- package/cjs/domain/profiling/types/index.js +3 -0
- package/cjs/domain/profiling/types/index.js.map +1 -0
- package/cjs/domain/profiling/types/profilerApi.types.d.ts +58 -0
- package/cjs/domain/profiling/types/profilerApi.types.js +5 -0
- package/cjs/domain/profiling/types/profilerApi.types.js.map +1 -0
- package/cjs/domain/profiling/types/rumProfiler.types.d.ts +72 -0
- package/cjs/domain/profiling/types/rumProfiler.types.js +3 -0
- package/cjs/domain/profiling/types/rumProfiler.types.js.map +1 -0
- package/cjs/domain/profiling/utils/getCustomOrDefaultViewName.d.ts +1 -0
- package/cjs/domain/profiling/utils/getCustomOrDefaultViewName.js +7 -0
- package/cjs/domain/profiling/utils/getCustomOrDefaultViewName.js.map +1 -0
- package/cjs/domain/profiling/utils/getDefaultViewName.d.ts +1 -0
- package/cjs/domain/profiling/utils/getDefaultViewName.js +14 -0
- package/cjs/domain/profiling/utils/getDefaultViewName.js.map +1 -0
- package/cjs/domain/profiling/utils/getNumberOfSamples.d.ts +7 -0
- package/cjs/domain/profiling/utils/getNumberOfSamples.js +18 -0
- package/cjs/domain/profiling/utils/getNumberOfSamples.js.map +1 -0
- package/cjs/domain/record/assembly.d.ts +2 -0
- package/cjs/domain/record/assembly.js +16 -0
- package/cjs/domain/record/assembly.js.map +1 -0
- package/cjs/domain/record/elementsScrollPositions.d.ts +10 -0
- package/cjs/domain/record/elementsScrollPositions.js +23 -0
- package/cjs/domain/record/elementsScrollPositions.js.map +1 -0
- package/cjs/domain/record/eventIds.d.ts +4 -0
- package/cjs/domain/record/eventIds.js +16 -0
- package/cjs/domain/record/eventIds.js.map +1 -0
- package/cjs/domain/record/eventsUtils.d.ts +2 -0
- package/cjs/domain/record/eventsUtils.js +15 -0
- package/cjs/domain/record/eventsUtils.js.map +1 -0
- package/cjs/domain/record/index.d.ts +7 -0
- package/cjs/domain/record/index.js +17 -0
- package/cjs/domain/record/index.js.map +1 -0
- package/cjs/domain/record/internalApi.d.ts +22 -0
- package/cjs/domain/record/internalApi.js +57 -0
- package/cjs/domain/record/internalApi.js.map +1 -0
- package/cjs/domain/record/mutationBatch.d.ts +12 -0
- package/cjs/domain/record/mutationBatch.js +44 -0
- package/cjs/domain/record/mutationBatch.js.map +1 -0
- package/cjs/domain/record/nodeIds.d.ts +15 -0
- package/cjs/domain/record/nodeIds.js +32 -0
- package/cjs/domain/record/nodeIds.js.map +1 -0
- package/cjs/domain/record/record.d.ts +16 -0
- package/cjs/domain/record/record.js +90 -0
- package/cjs/domain/record/record.js.map +1 -0
- package/cjs/domain/record/record.types.d.ts +4 -0
- package/cjs/domain/record/record.types.js +3 -0
- package/cjs/domain/record/record.types.js.map +1 -0
- package/cjs/domain/record/recordingScope.d.ts +19 -0
- package/cjs/domain/record/recordingScope.js +13 -0
- package/cjs/domain/record/recordingScope.js.map +1 -0
- package/cjs/domain/record/serialization/index.d.ts +8 -0
- package/cjs/domain/record/serialization/index.js +18 -0
- package/cjs/domain/record/serialization/index.js.map +1 -0
- package/cjs/domain/record/serialization/serialization.types.d.ts +28 -0
- package/cjs/domain/record/serialization/serialization.types.js +3 -0
- package/cjs/domain/record/serialization/serialization.types.js.map +1 -0
- package/cjs/domain/record/serialization/serializationStats.d.ts +12 -0
- package/cjs/domain/record/serialization/serializationStats.js +32 -0
- package/cjs/domain/record/serialization/serializationStats.js.map +1 -0
- package/cjs/domain/record/serialization/serializationTransaction.d.ts +45 -0
- package/cjs/domain/record/serialization/serializationTransaction.js +38 -0
- package/cjs/domain/record/serialization/serializationTransaction.js.map +1 -0
- package/cjs/domain/record/serialization/serializationUtils.d.ts +18 -0
- package/cjs/domain/record/serialization/serializationUtils.js +88 -0
- package/cjs/domain/record/serialization/serializationUtils.js.map +1 -0
- package/cjs/domain/record/serialization/serializeAttribute.d.ts +4 -0
- package/cjs/domain/record/serialization/serializeAttribute.js +42 -0
- package/cjs/domain/record/serialization/serializeAttribute.js.map +1 -0
- package/cjs/domain/record/serialization/serializeAttributes.d.ts +7 -0
- package/cjs/domain/record/serialization/serializeAttributes.js +167 -0
- package/cjs/domain/record/serialization/serializeAttributes.js.map +1 -0
- package/cjs/domain/record/serialization/serializeDocument.d.ts +3 -0
- package/cjs/domain/record/serialization/serializeDocument.js +11 -0
- package/cjs/domain/record/serialization/serializeDocument.js.map +1 -0
- package/cjs/domain/record/serialization/serializeNode.d.ts +7 -0
- package/cjs/domain/record/serialization/serializeNode.js +154 -0
- package/cjs/domain/record/serialization/serializeNode.js.map +1 -0
- package/cjs/domain/record/serialization/serializeStyleSheets.d.ts +2 -0
- package/cjs/domain/record/serialization/serializeStyleSheets.js +19 -0
- package/cjs/domain/record/serialization/serializeStyleSheets.js.map +1 -0
- package/cjs/domain/record/shadowRootsController.d.ts +11 -0
- package/cjs/domain/record/shadowRootsController.js +45 -0
- package/cjs/domain/record/shadowRootsController.js.map +1 -0
- package/cjs/domain/record/startFullSnapshots.d.ts +9 -0
- package/cjs/domain/record/startFullSnapshots.js +59 -0
- package/cjs/domain/record/startFullSnapshots.js.map +1 -0
- package/cjs/domain/record/trackers/index.d.ts +12 -0
- package/cjs/domain/record/trackers/index.js +27 -0
- package/cjs/domain/record/trackers/index.js.map +1 -0
- package/cjs/domain/record/trackers/trackFocus.d.ts +5 -0
- package/cjs/domain/record/trackers/trackFocus.js +15 -0
- package/cjs/domain/record/trackers/trackFocus.js.map +1 -0
- package/cjs/domain/record/trackers/trackFrustration.d.ts +7 -0
- package/cjs/domain/record/trackers/trackFrustration.js +31 -0
- package/cjs/domain/record/trackers/trackFrustration.js.map +1 -0
- package/cjs/domain/record/trackers/trackInput.d.ts +4 -0
- package/cjs/domain/record/trackers/trackInput.js +104 -0
- package/cjs/domain/record/trackers/trackInput.js.map +1 -0
- package/cjs/domain/record/trackers/trackMediaInteraction.d.ts +5 -0
- package/cjs/domain/record/trackers/trackMediaInteraction.js +29 -0
- package/cjs/domain/record/trackers/trackMediaInteraction.js.map +1 -0
- package/cjs/domain/record/trackers/trackMouseInteraction.d.ts +5 -0
- package/cjs/domain/record/trackers/trackMouseInteraction.js +59 -0
- package/cjs/domain/record/trackers/trackMouseInteraction.js.map +1 -0
- package/cjs/domain/record/trackers/trackMove.d.ts +9 -0
- package/cjs/domain/record/trackers/trackMove.js +55 -0
- package/cjs/domain/record/trackers/trackMove.js.map +1 -0
- package/cjs/domain/record/trackers/trackMutation.d.ts +11 -0
- package/cjs/domain/record/trackers/trackMutation.js +270 -0
- package/cjs/domain/record/trackers/trackMutation.js.map +1 -0
- package/cjs/domain/record/trackers/trackScroll.d.ts +5 -0
- package/cjs/domain/record/trackers/trackScroll.js +48 -0
- package/cjs/domain/record/trackers/trackScroll.js.map +1 -0
- package/cjs/domain/record/trackers/trackStyleSheet.d.ts +6 -0
- package/cjs/domain/record/trackers/trackStyleSheet.js +89 -0
- package/cjs/domain/record/trackers/trackStyleSheet.js.map +1 -0
- package/cjs/domain/record/trackers/trackViewEnd.d.ts +5 -0
- package/cjs/domain/record/trackers/trackViewEnd.js +20 -0
- package/cjs/domain/record/trackers/trackViewEnd.js.map +1 -0
- package/cjs/domain/record/trackers/trackViewportResize.d.ts +6 -0
- package/cjs/domain/record/trackers/trackViewportResize.js +46 -0
- package/cjs/domain/record/trackers/trackViewportResize.js.map +1 -0
- package/cjs/domain/record/trackers/tracker.types.d.ts +3 -0
- package/cjs/domain/record/trackers/tracker.types.js +3 -0
- package/cjs/domain/record/trackers/tracker.types.js.map +1 -0
- package/cjs/domain/record/viewports.d.ts +20 -0
- package/cjs/domain/record/viewports.js +60 -0
- package/cjs/domain/record/viewports.js.map +1 -0
- package/cjs/domain/replayStats.d.ts +8 -0
- package/cjs/domain/replayStats.js +60 -0
- package/cjs/domain/replayStats.js.map +1 -0
- package/cjs/domain/scriptLoadingError.d.ts +6 -0
- package/cjs/domain/scriptLoadingError.js +26 -0
- package/cjs/domain/scriptLoadingError.js.map +1 -0
- package/cjs/domain/segmentCollection/buildReplayPayload.d.ts +15 -0
- package/cjs/domain/segmentCollection/buildReplayPayload.js +26 -0
- package/cjs/domain/segmentCollection/buildReplayPayload.js.map +1 -0
- package/cjs/domain/segmentCollection/index.d.ts +4 -0
- package/cjs/domain/segmentCollection/index.js +11 -0
- package/cjs/domain/segmentCollection/index.js.map +1 -0
- package/cjs/domain/segmentCollection/segment.d.ts +16 -0
- package/cjs/domain/segmentCollection/segment.js +82 -0
- package/cjs/domain/segmentCollection/segment.js.map +1 -0
- package/cjs/domain/segmentCollection/segmentCollection.d.ts +31 -0
- package/cjs/domain/segmentCollection/segmentCollection.js +113 -0
- package/cjs/domain/segmentCollection/segmentCollection.js.map +1 -0
- package/cjs/domain/segmentCollection/startSegmentTelemetry.d.ts +6 -0
- package/cjs/domain/segmentCollection/startSegmentTelemetry.js +47 -0
- package/cjs/domain/segmentCollection/startSegmentTelemetry.js.map +1 -0
- package/cjs/domain/startRecordBridge.d.ts +5 -0
- package/cjs/domain/startRecordBridge.js +17 -0
- package/cjs/domain/startRecordBridge.js.map +1 -0
- package/cjs/domain/startRecorderInitTelemetry.d.ts +15 -0
- package/cjs/domain/startRecorderInitTelemetry.js +55 -0
- package/cjs/domain/startRecorderInitTelemetry.js.map +1 -0
- package/cjs/entries/internal.d.ts +11 -0
- package/cjs/entries/internal.js +28 -0
- package/cjs/entries/internal.js.map +1 -0
- package/cjs/entries/internalSynthetics.d.ts +2 -0
- package/cjs/entries/internalSynthetics.js +27 -0
- package/cjs/entries/internalSynthetics.js.map +1 -0
- package/cjs/entries/main.d.ts +23 -0
- package/cjs/entries/main.js +35 -0
- package/cjs/entries/main.js.map +1 -0
- package/cjs/types/index.d.ts +2 -0
- package/cjs/types/index.js +18 -0
- package/cjs/types/index.js.map +1 -0
- package/cjs/types/sessionReplay.d.ts +703 -0
- package/cjs/types/sessionReplay.js +7 -0
- package/cjs/types/sessionReplay.js.map +1 -0
- package/cjs/types/sessionReplayConstants.d.ts +49 -0
- package/cjs/types/sessionReplayConstants.js +49 -0
- package/cjs/types/sessionReplayConstants.js.map +1 -0
- package/esm/boot/isBrowserSupported.d.ts +4 -0
- package/esm/boot/isBrowserSupported.js +14 -0
- package/esm/boot/isBrowserSupported.js.map +1 -0
- package/esm/boot/lazyLoadProfiler.d.ts +4 -0
- package/esm/boot/lazyLoadProfiler.js +18 -0
- package/esm/boot/lazyLoadProfiler.js.map +1 -0
- package/esm/boot/lazyLoadRecorder.d.ts +4 -0
- package/esm/boot/lazyLoadRecorder.js +18 -0
- package/esm/boot/lazyLoadRecorder.js.map +1 -0
- package/esm/boot/postStartStrategy.d.ts +33 -0
- package/esm/boot/postStartStrategy.js +95 -0
- package/esm/boot/postStartStrategy.js.map +1 -0
- package/esm/boot/preStartStrategy.d.ts +6 -0
- package/esm/boot/preStartStrategy.js +21 -0
- package/esm/boot/preStartStrategy.js.map +1 -0
- package/esm/boot/profilerApi.d.ts +2 -0
- package/esm/boot/profilerApi.js +50 -0
- package/esm/boot/profilerApi.js.map +1 -0
- package/esm/boot/recorderApi.d.ts +4 -0
- package/esm/boot/recorderApi.js +70 -0
- package/esm/boot/recorderApi.js.map +1 -0
- package/esm/boot/startRecording.d.ts +6 -0
- package/esm/boot/startRecording.js +42 -0
- package/esm/boot/startRecording.js.map +1 -0
- package/esm/domain/deflate/deflateEncoder.d.ts +3 -0
- package/esm/domain/deflate/deflateEncoder.js +107 -0
- package/esm/domain/deflate/deflateEncoder.js.map +1 -0
- package/esm/domain/deflate/deflateWorker.d.ts +30 -0
- package/esm/domain/deflate/deflateWorker.js +97 -0
- package/esm/domain/deflate/deflateWorker.js.map +1 -0
- package/esm/domain/deflate/index.d.ts +3 -0
- package/esm/domain/deflate/index.js +3 -0
- package/esm/domain/deflate/index.js.map +1 -0
- package/esm/domain/getSessionReplayLink.d.ts +2 -0
- package/esm/domain/getSessionReplayLink.js +32 -0
- package/esm/domain/getSessionReplayLink.js.map +1 -0
- package/esm/domain/profiling/profiler.d.ts +7 -0
- package/esm/domain/profiling/profiler.js +240 -0
- package/esm/domain/profiling/profiler.js.map +1 -0
- package/esm/domain/profiling/profilingContext.d.ts +6 -0
- package/esm/domain/profiling/profilingContext.js +25 -0
- package/esm/domain/profiling/profilingContext.js.map +1 -0
- package/esm/domain/profiling/profilingSupported.d.ts +1 -0
- package/esm/domain/profiling/profilingSupported.js +8 -0
- package/esm/domain/profiling/profilingSupported.js.map +1 -0
- package/esm/domain/profiling/test-utils/mockedTrace.d.ts +3 -0
- package/esm/domain/profiling/test-utils/mockedTrace.js +54 -0
- package/esm/domain/profiling/test-utils/mockedTrace.js.map +1 -0
- package/esm/domain/profiling/transport/assembly.d.ts +21 -0
- package/esm/domain/profiling/transport/assembly.js +42 -0
- package/esm/domain/profiling/transport/assembly.js.map +1 -0
- package/esm/domain/profiling/transport/buildProfileEventAttributes.d.ts +25 -0
- package/esm/domain/profiling/transport/buildProfileEventAttributes.js +47 -0
- package/esm/domain/profiling/transport/buildProfileEventAttributes.js.map +1 -0
- package/esm/domain/profiling/types/index.d.ts +2 -0
- package/esm/domain/profiling/types/index.js +2 -0
- package/esm/domain/profiling/types/index.js.map +1 -0
- package/esm/domain/profiling/types/profilerApi.types.d.ts +58 -0
- package/esm/domain/profiling/types/profilerApi.types.js +4 -0
- package/esm/domain/profiling/types/profilerApi.types.js.map +1 -0
- package/esm/domain/profiling/types/rumProfiler.types.d.ts +72 -0
- package/esm/domain/profiling/types/rumProfiler.types.js +2 -0
- package/esm/domain/profiling/types/rumProfiler.types.js.map +1 -0
- package/esm/domain/profiling/utils/getCustomOrDefaultViewName.d.ts +1 -0
- package/esm/domain/profiling/utils/getCustomOrDefaultViewName.js +3 -0
- package/esm/domain/profiling/utils/getCustomOrDefaultViewName.js.map +1 -0
- package/esm/domain/profiling/utils/getDefaultViewName.d.ts +1 -0
- package/esm/domain/profiling/utils/getDefaultViewName.js +11 -0
- package/esm/domain/profiling/utils/getDefaultViewName.js.map +1 -0
- package/esm/domain/profiling/utils/getNumberOfSamples.d.ts +7 -0
- package/esm/domain/profiling/utils/getNumberOfSamples.js +15 -0
- package/esm/domain/profiling/utils/getNumberOfSamples.js.map +1 -0
- package/esm/domain/record/assembly.d.ts +2 -0
- package/esm/domain/record/assembly.js +13 -0
- package/esm/domain/record/assembly.js.map +1 -0
- package/esm/domain/record/elementsScrollPositions.d.ts +10 -0
- package/esm/domain/record/elementsScrollPositions.js +20 -0
- package/esm/domain/record/elementsScrollPositions.js.map +1 -0
- package/esm/domain/record/eventIds.d.ts +4 -0
- package/esm/domain/record/eventIds.js +13 -0
- package/esm/domain/record/eventIds.js.map +1 -0
- package/esm/domain/record/eventsUtils.d.ts +2 -0
- package/esm/domain/record/eventsUtils.js +11 -0
- package/esm/domain/record/eventsUtils.js.map +1 -0
- package/esm/domain/record/index.d.ts +7 -0
- package/esm/domain/record/index.js +6 -0
- package/esm/domain/record/index.js.map +1 -0
- package/esm/domain/record/internalApi.d.ts +22 -0
- package/esm/domain/record/internalApi.js +53 -0
- package/esm/domain/record/internalApi.js.map +1 -0
- package/esm/domain/record/mutationBatch.d.ts +12 -0
- package/esm/domain/record/mutationBatch.js +40 -0
- package/esm/domain/record/mutationBatch.js.map +1 -0
- package/esm/domain/record/nodeIds.d.ts +15 -0
- package/esm/domain/record/nodeIds.js +29 -0
- package/esm/domain/record/nodeIds.js.map +1 -0
- package/esm/domain/record/record.d.ts +16 -0
- package/esm/domain/record/record.js +54 -0
- package/esm/domain/record/record.js.map +1 -0
- package/esm/domain/record/record.types.d.ts +4 -0
- package/esm/domain/record/record.types.js +2 -0
- package/esm/domain/record/record.types.js.map +1 -0
- package/esm/domain/record/recordingScope.d.ts +19 -0
- package/esm/domain/record/recordingScope.js +10 -0
- package/esm/domain/record/recordingScope.js.map +1 -0
- package/esm/domain/record/serialization/index.d.ts +8 -0
- package/esm/domain/record/serialization/index.js +7 -0
- package/esm/domain/record/serialization/index.js.map +1 -0
- package/esm/domain/record/serialization/serialization.types.d.ts +28 -0
- package/esm/domain/record/serialization/serialization.types.js +2 -0
- package/esm/domain/record/serialization/serialization.types.js.map +1 -0
- package/esm/domain/record/serialization/serializationStats.d.ts +12 -0
- package/esm/domain/record/serialization/serializationStats.js +27 -0
- package/esm/domain/record/serialization/serializationStats.js.map +1 -0
- package/esm/domain/record/serialization/serializationTransaction.d.ts +45 -0
- package/esm/domain/record/serialization/serializationTransaction.js +35 -0
- package/esm/domain/record/serialization/serializationTransaction.js.map +1 -0
- package/esm/domain/record/serialization/serializationUtils.d.ts +18 -0
- package/esm/domain/record/serialization/serializationUtils.js +80 -0
- package/esm/domain/record/serialization/serializationUtils.js.map +1 -0
- package/esm/domain/record/serialization/serializeAttribute.d.ts +4 -0
- package/esm/domain/record/serialization/serializeAttribute.js +38 -0
- package/esm/domain/record/serialization/serializeAttribute.js.map +1 -0
- package/esm/domain/record/serialization/serializeAttributes.d.ts +7 -0
- package/esm/domain/record/serialization/serializeAttributes.js +161 -0
- package/esm/domain/record/serialization/serializeAttributes.js.map +1 -0
- package/esm/domain/record/serialization/serializeDocument.d.ts +3 -0
- package/esm/domain/record/serialization/serializeDocument.js +8 -0
- package/esm/domain/record/serialization/serializeDocument.js.map +1 -0
- package/esm/domain/record/serialization/serializeNode.d.ts +7 -0
- package/esm/domain/record/serialization/serializeNode.js +149 -0
- package/esm/domain/record/serialization/serializeNode.js.map +1 -0
- package/esm/domain/record/serialization/serializeStyleSheets.d.ts +2 -0
- package/esm/domain/record/serialization/serializeStyleSheets.js +16 -0
- package/esm/domain/record/serialization/serializeStyleSheets.js.map +1 -0
- package/esm/domain/record/shadowRootsController.d.ts +11 -0
- package/esm/domain/record/shadowRootsController.js +41 -0
- package/esm/domain/record/shadowRootsController.js.map +1 -0
- package/esm/domain/record/startFullSnapshots.d.ts +9 -0
- package/esm/domain/record/startFullSnapshots.js +55 -0
- package/esm/domain/record/startFullSnapshots.js.map +1 -0
- package/esm/domain/record/trackers/index.d.ts +12 -0
- package/esm/domain/record/trackers/index.js +12 -0
- package/esm/domain/record/trackers/index.js.map +1 -0
- package/esm/domain/record/trackers/trackFocus.d.ts +5 -0
- package/esm/domain/record/trackers/trackFocus.js +12 -0
- package/esm/domain/record/trackers/trackFocus.js.map +1 -0
- package/esm/domain/record/trackers/trackFrustration.d.ts +7 -0
- package/esm/domain/record/trackers/trackFrustration.js +28 -0
- package/esm/domain/record/trackers/trackFrustration.js.map +1 -0
- package/esm/domain/record/trackers/trackInput.d.ts +4 -0
- package/esm/domain/record/trackers/trackInput.js +101 -0
- package/esm/domain/record/trackers/trackInput.js.map +1 -0
- package/esm/domain/record/trackers/trackMediaInteraction.d.ts +5 -0
- package/esm/domain/record/trackers/trackMediaInteraction.js +26 -0
- package/esm/domain/record/trackers/trackMediaInteraction.js.map +1 -0
- package/esm/domain/record/trackers/trackMouseInteraction.d.ts +5 -0
- package/esm/domain/record/trackers/trackMouseInteraction.js +56 -0
- package/esm/domain/record/trackers/trackMouseInteraction.js.map +1 -0
- package/esm/domain/record/trackers/trackMove.d.ts +9 -0
- package/esm/domain/record/trackers/trackMove.js +51 -0
- package/esm/domain/record/trackers/trackMove.js.map +1 -0
- package/esm/domain/record/trackers/trackMutation.d.ts +11 -0
- package/esm/domain/record/trackers/trackMutation.js +266 -0
- package/esm/domain/record/trackers/trackMutation.js.map +1 -0
- package/esm/domain/record/trackers/trackScroll.d.ts +5 -0
- package/esm/domain/record/trackers/trackScroll.js +45 -0
- package/esm/domain/record/trackers/trackScroll.js.map +1 -0
- package/esm/domain/record/trackers/trackStyleSheet.d.ts +6 -0
- package/esm/domain/record/trackers/trackStyleSheet.js +85 -0
- package/esm/domain/record/trackers/trackStyleSheet.js.map +1 -0
- package/esm/domain/record/trackers/trackViewEnd.d.ts +5 -0
- package/esm/domain/record/trackers/trackViewEnd.js +17 -0
- package/esm/domain/record/trackers/trackViewEnd.js.map +1 -0
- package/esm/domain/record/trackers/trackViewportResize.d.ts +6 -0
- package/esm/domain/record/trackers/trackViewportResize.js +42 -0
- package/esm/domain/record/trackers/trackViewportResize.js.map +1 -0
- package/esm/domain/record/trackers/tracker.types.d.ts +3 -0
- package/esm/domain/record/trackers/tracker.types.js +2 -0
- package/esm/domain/record/trackers/tracker.types.js.map +1 -0
- package/esm/domain/record/viewports.d.ts +20 -0
- package/esm/domain/record/viewports.js +55 -0
- package/esm/domain/record/viewports.js.map +1 -0
- package/esm/domain/replayStats.d.ts +8 -0
- package/esm/domain/replayStats.js +51 -0
- package/esm/domain/replayStats.js.map +1 -0
- package/esm/domain/scriptLoadingError.d.ts +6 -0
- package/esm/domain/scriptLoadingError.js +23 -0
- package/esm/domain/scriptLoadingError.js.map +1 -0
- package/esm/domain/segmentCollection/buildReplayPayload.d.ts +15 -0
- package/esm/domain/segmentCollection/buildReplayPayload.js +23 -0
- package/esm/domain/segmentCollection/buildReplayPayload.js.map +1 -0
- package/esm/domain/segmentCollection/index.d.ts +4 -0
- package/esm/domain/segmentCollection/index.js +4 -0
- package/esm/domain/segmentCollection/index.js.map +1 -0
- package/esm/domain/segmentCollection/segment.d.ts +16 -0
- package/esm/domain/segmentCollection/segment.js +46 -0
- package/esm/domain/segmentCollection/segment.js.map +1 -0
- package/esm/domain/segmentCollection/segmentCollection.d.ts +31 -0
- package/esm/domain/segmentCollection/segmentCollection.js +106 -0
- package/esm/domain/segmentCollection/segmentCollection.js.map +1 -0
- package/esm/domain/segmentCollection/startSegmentTelemetry.d.ts +6 -0
- package/esm/domain/segmentCollection/startSegmentTelemetry.js +44 -0
- package/esm/domain/segmentCollection/startSegmentTelemetry.js.map +1 -0
- package/esm/domain/startRecordBridge.d.ts +5 -0
- package/esm/domain/startRecordBridge.js +14 -0
- package/esm/domain/startRecordBridge.js.map +1 -0
- package/esm/domain/startRecorderInitTelemetry.d.ts +15 -0
- package/esm/domain/startRecorderInitTelemetry.js +52 -0
- package/esm/domain/startRecorderInitTelemetry.js.map +1 -0
- package/esm/entries/internal.d.ts +11 -0
- package/esm/entries/internal.js +4 -0
- package/esm/entries/internal.js.map +1 -0
- package/esm/entries/internalSynthetics.d.ts +2 -0
- package/esm/entries/internalSynthetics.js +23 -0
- package/esm/entries/internalSynthetics.js.map +1 -0
- package/esm/entries/main.d.ts +23 -0
- package/esm/entries/main.js +31 -0
- package/esm/entries/main.js.map +1 -0
- package/esm/types/index.d.ts +2 -0
- package/esm/types/index.js +2 -0
- package/esm/types/index.js.map +1 -0
- package/esm/types/sessionReplay.d.ts +703 -0
- package/esm/types/sessionReplay.js +6 -0
- package/esm/types/sessionReplay.js.map +1 -0
- package/esm/types/sessionReplayConstants.d.ts +49 -0
- package/esm/types/sessionReplayConstants.js +46 -0
- package/esm/types/sessionReplayConstants.js.map +1 -0
- package/internal/package.json +6 -0
- package/internal-synthetics/package.json +6 -0
- package/package.json +40 -0
- package/src/boot/isBrowserSupported.ts +14 -0
- package/src/boot/lazyLoadProfiler.ts +21 -0
- package/src/boot/lazyLoadRecorder.ts +21 -0
- package/src/boot/postStartStrategy.ts +176 -0
- package/src/boot/preStartStrategy.ts +34 -0
- package/src/boot/profilerApi.ts +86 -0
- package/src/boot/recorderApi.ts +124 -0
- package/src/boot/startRecording.ts +70 -0
- package/src/domain/deflate/deflateEncoder.ts +144 -0
- package/src/domain/deflate/deflateWorker.ts +157 -0
- package/src/domain/deflate/index.ts +8 -0
- package/src/domain/getSessionReplayLink.ts +40 -0
- package/src/domain/profiling/profiler.ts +338 -0
- package/src/domain/profiling/profilingContext.ts +34 -0
- package/src/domain/profiling/profilingSupported.ts +10 -0
- package/src/domain/profiling/test-utils/mockedTrace.ts +58 -0
- package/src/domain/profiling/transport/assembly.ts +78 -0
- package/src/domain/profiling/transport/buildProfileEventAttributes.ts +66 -0
- package/src/domain/profiling/types/index.ts +2 -0
- package/src/domain/profiling/types/profilerApi.types.ts +87 -0
- package/src/domain/profiling/types/rumProfiler.types.ts +81 -0
- package/src/domain/profiling/utils/getCustomOrDefaultViewName.ts +4 -0
- package/src/domain/profiling/utils/getDefaultViewName.ts +12 -0
- package/src/domain/profiling/utils/getNumberOfSamples.ts +16 -0
- package/src/domain/record/assembly.ts +17 -0
- package/src/domain/record/elementsScrollPositions.ts +28 -0
- package/src/domain/record/eventIds.ts +17 -0
- package/src/domain/record/eventsUtils.ts +12 -0
- package/src/domain/record/index.ts +7 -0
- package/src/domain/record/internalApi.ts +88 -0
- package/src/domain/record/mutationBatch.ts +47 -0
- package/src/domain/record/nodeIds.ts +46 -0
- package/src/domain/record/record.ts +98 -0
- package/src/domain/record/record.types.ts +5 -0
- package/src/domain/record/recordingScope.ts +36 -0
- package/src/domain/record/serialization/index.ts +8 -0
- package/src/domain/record/serialization/serialization.types.ts +43 -0
- package/src/domain/record/serialization/serializationStats.ts +43 -0
- package/src/domain/record/serialization/serializationTransaction.ts +94 -0
- package/src/domain/record/serialization/serializationUtils.ts +103 -0
- package/src/domain/record/serialization/serializeAttribute.ts +55 -0
- package/src/domain/record/serialization/serializeAttributes.ts +194 -0
- package/src/domain/record/serialization/serializeDocument.ts +13 -0
- package/src/domain/record/serialization/serializeNode.ts +229 -0
- package/src/domain/record/serialization/serializeStyleSheets.ts +18 -0
- package/src/domain/record/shadowRootsController.ts +62 -0
- package/src/domain/record/startFullSnapshots.ts +84 -0
- package/src/domain/record/trackers/index.ts +12 -0
- package/src/domain/record/trackers/trackFocus.ts +16 -0
- package/src/domain/record/trackers/trackFrustration.ts +41 -0
- package/src/domain/record/trackers/trackInput.ts +128 -0
- package/src/domain/record/trackers/trackMediaInteraction.ts +43 -0
- package/src/domain/record/trackers/trackMouseInteraction.ts +74 -0
- package/src/domain/record/trackers/trackMove.ts +78 -0
- package/src/domain/record/trackers/trackMutation.ts +399 -0
- package/src/domain/record/trackers/trackScroll.ts +61 -0
- package/src/domain/record/trackers/trackStyleSheet.ts +117 -0
- package/src/domain/record/trackers/trackViewEnd.ts +27 -0
- package/src/domain/record/trackers/trackViewportResize.ts +69 -0
- package/src/domain/record/trackers/tracker.types.ts +3 -0
- package/src/domain/record/viewports.ts +68 -0
- package/src/domain/replayStats.ts +61 -0
- package/src/domain/scriptLoadingError.ts +36 -0
- package/src/domain/segmentCollection/buildReplayPayload.ts +52 -0
- package/src/domain/segmentCollection/index.ts +4 -0
- package/src/domain/segmentCollection/segment.ts +78 -0
- package/src/domain/segmentCollection/segmentCollection.ts +200 -0
- package/src/domain/segmentCollection/startSegmentTelemetry.ts +82 -0
- package/src/domain/startRecordBridge.ts +17 -0
- package/src/domain/startRecorderInitTelemetry.ts +90 -0
- package/src/entries/internal.ts +18 -0
- package/src/entries/internalSynthetics.ts +24 -0
- package/src/entries/main.ts +95 -0
- package/src/types/index.ts +2 -0
- package/src/types/sessionReplay.ts +734 -0
- package/src/types/sessionReplayConstants.ts +86 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { RumMutationRecord } from '@kubesense/kubesense-browser-rum-core';
|
|
2
|
+
/**
|
|
3
|
+
* Minimum duration to wait before processing mutations. This is used to batch mutations together
|
|
4
|
+
* and be able to deduplicate them to save processing time and bandwidth.
|
|
5
|
+
* 16ms is the duration of a frame at 60fps that ensure fluid UI.
|
|
6
|
+
*/
|
|
7
|
+
export declare const MUTATION_PROCESS_MIN_DELAY = 16;
|
|
8
|
+
export declare function createMutationBatch(processMutationBatch: (mutations: RumMutationRecord[]) => void): {
|
|
9
|
+
addMutations: (mutations: RumMutationRecord[]) => void;
|
|
10
|
+
flush: () => void;
|
|
11
|
+
stop: () => void;
|
|
12
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MUTATION_PROCESS_MIN_DELAY = void 0;
|
|
4
|
+
exports.createMutationBatch = createMutationBatch;
|
|
5
|
+
const kubesense_browser_core_1 = require("@kubesense/kubesense-browser-core");
|
|
6
|
+
/**
|
|
7
|
+
* Maximum duration to wait before processing mutations. If the browser is idle, mutations will be
|
|
8
|
+
* processed more quickly. If the browser is busy executing small tasks (ex: rendering frames), the
|
|
9
|
+
* mutations will wait MUTATION_PROCESS_MAX_DELAY milliseconds before being processed. If the
|
|
10
|
+
* browser is busy executing a longer task, mutations will be processed after this task.
|
|
11
|
+
*/
|
|
12
|
+
const MUTATION_PROCESS_MAX_DELAY = 100;
|
|
13
|
+
/**
|
|
14
|
+
* Minimum duration to wait before processing mutations. This is used to batch mutations together
|
|
15
|
+
* and be able to deduplicate them to save processing time and bandwidth.
|
|
16
|
+
* 16ms is the duration of a frame at 60fps that ensure fluid UI.
|
|
17
|
+
*/
|
|
18
|
+
exports.MUTATION_PROCESS_MIN_DELAY = 16;
|
|
19
|
+
function createMutationBatch(processMutationBatch) {
|
|
20
|
+
let cancelScheduledFlush = kubesense_browser_core_1.noop;
|
|
21
|
+
let pendingMutations = [];
|
|
22
|
+
function flush() {
|
|
23
|
+
cancelScheduledFlush();
|
|
24
|
+
processMutationBatch(pendingMutations);
|
|
25
|
+
pendingMutations = [];
|
|
26
|
+
}
|
|
27
|
+
const { throttled: throttledFlush, cancel: cancelThrottle } = (0, kubesense_browser_core_1.throttle)(flush, exports.MUTATION_PROCESS_MIN_DELAY, {
|
|
28
|
+
leading: false,
|
|
29
|
+
});
|
|
30
|
+
return {
|
|
31
|
+
addMutations: (mutations) => {
|
|
32
|
+
if (pendingMutations.length === 0) {
|
|
33
|
+
cancelScheduledFlush = (0, kubesense_browser_core_1.requestIdleCallback)(throttledFlush, { timeout: MUTATION_PROCESS_MAX_DELAY });
|
|
34
|
+
}
|
|
35
|
+
pendingMutations.push(...mutations);
|
|
36
|
+
},
|
|
37
|
+
flush,
|
|
38
|
+
stop: () => {
|
|
39
|
+
cancelScheduledFlush();
|
|
40
|
+
cancelThrottle();
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=mutationBatch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutationBatch.js","sourceRoot":"","sources":["../../../src/domain/record/mutationBatch.ts"],"names":[],"mappings":";;;AAiBA,kDA6BC;AA9CD,8EAAuF;AAGvF;;;;;GAKG;AACH,MAAM,0BAA0B,GAAG,GAAG,CAAA;AACtC;;;;GAIG;AACU,QAAA,0BAA0B,GAAG,EAAE,CAAA;AAE5C,SAAgB,mBAAmB,CAAC,oBAA8D;IAChG,IAAI,oBAAoB,GAAG,6BAAI,CAAA;IAC/B,IAAI,gBAAgB,GAAwB,EAAE,CAAA;IAE9C,SAAS,KAAK;QACZ,oBAAoB,EAAE,CAAA;QACtB,oBAAoB,CAAC,gBAAgB,CAAC,CAAA;QACtC,gBAAgB,GAAG,EAAE,CAAA;IACvB,CAAC;IAED,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,IAAA,iCAAQ,EAAC,KAAK,EAAE,kCAA0B,EAAE;QACxG,OAAO,EAAE,KAAK;KACf,CAAC,CAAA;IAEF,OAAO;QACL,YAAY,EAAE,CAAC,SAA8B,EAAE,EAAE;YAC/C,IAAI,gBAAgB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAClC,oBAAoB,GAAG,IAAA,4CAAmB,EAAC,cAAc,EAAE,EAAE,OAAO,EAAE,0BAA0B,EAAE,CAAC,CAAA;YACrG,CAAC;YACD,gBAAgB,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,CAAA;QACrC,CAAC;QAED,KAAK;QAEL,IAAI,EAAE,GAAG,EAAE;YACT,oBAAoB,EAAE,CAAA;YACtB,cAAc,EAAE,CAAA;QAClB,CAAC;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type NodeWithSerializedNode = Node & {
|
|
2
|
+
__brand: 'NodeWithSerializedNode';
|
|
3
|
+
};
|
|
4
|
+
export type NodeId = number & {
|
|
5
|
+
__brand: 'NodeId';
|
|
6
|
+
};
|
|
7
|
+
export declare const enum NodeIdConstants {
|
|
8
|
+
FIRST_ID = 0
|
|
9
|
+
}
|
|
10
|
+
export interface NodeIds {
|
|
11
|
+
assign(node: Node): NodeId;
|
|
12
|
+
get(node: Node): NodeId | undefined;
|
|
13
|
+
areAssignedForNodeAndAncestors(node: Node): node is NodeWithSerializedNode;
|
|
14
|
+
}
|
|
15
|
+
export declare function createNodeIds(): NodeIds;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createNodeIds = createNodeIds;
|
|
4
|
+
const kubesense_browser_rum_core_1 = require("@kubesense/kubesense-browser-rum-core");
|
|
5
|
+
function createNodeIds() {
|
|
6
|
+
const nodeIds = new WeakMap();
|
|
7
|
+
let nextNodeId = 0 /* NodeIdConstants.FIRST_ID */;
|
|
8
|
+
const get = (node) => nodeIds.get(node);
|
|
9
|
+
return {
|
|
10
|
+
assign: (node) => {
|
|
11
|
+
// Try to reuse any existing id.
|
|
12
|
+
let nodeId = get(node);
|
|
13
|
+
if (nodeId === undefined) {
|
|
14
|
+
nodeId = nextNodeId++;
|
|
15
|
+
nodeIds.set(node, nodeId);
|
|
16
|
+
}
|
|
17
|
+
return nodeId;
|
|
18
|
+
},
|
|
19
|
+
get,
|
|
20
|
+
areAssignedForNodeAndAncestors: (node) => {
|
|
21
|
+
let current = node;
|
|
22
|
+
while (current) {
|
|
23
|
+
if (get(current) === undefined && !(0, kubesense_browser_rum_core_1.isNodeShadowRoot)(current)) {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
current = (0, kubesense_browser_rum_core_1.getParentNode)(current);
|
|
27
|
+
}
|
|
28
|
+
return true;
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=nodeIds.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodeIds.js","sourceRoot":"","sources":["../../../src/domain/record/nodeIds.ts"],"names":[],"mappings":";;AAeA,sCA8BC;AA7CD,sFAAuF;AAevF,SAAgB,aAAa;IAC3B,MAAM,OAAO,GAAG,IAAI,OAAO,EAAgB,CAAA;IAC3C,IAAI,UAAU,mCAA2B,CAAA;IAEzC,MAAM,GAAG,GAAG,CAAC,IAAU,EAAsB,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;IAEjE,OAAO;QACL,MAAM,EAAE,CAAC,IAAU,EAAU,EAAE;YAC7B,gCAAgC;YAChC,IAAI,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,CAAA;YACtB,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;gBACzB,MAAM,GAAG,UAAU,EAAY,CAAA;gBAC/B,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;YAC3B,CAAC;YACD,OAAO,MAAM,CAAA;QACf,CAAC;QAED,GAAG;QAEH,8BAA8B,EAAE,CAAC,IAAU,EAAkC,EAAE;YAC7E,IAAI,OAAO,GAAgB,IAAI,CAAA;YAC/B,OAAO,OAAO,EAAE,CAAC;gBACf,IAAI,GAAG,CAAC,OAAO,CAAC,KAAK,SAAS,IAAI,CAAC,IAAA,6CAAgB,EAAC,OAAO,CAAC,EAAE,CAAC;oBAC7D,OAAO,KAAK,CAAA;gBACd,CAAC;gBACD,OAAO,GAAG,IAAA,0CAAa,EAAC,OAAO,CAAC,CAAA;YAClC,CAAC;YACD,OAAO,IAAI,CAAA;QACb,CAAC;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { LifeCycle, RumConfiguration, ViewHistory } from '@kubesense/kubesense-browser-rum-core';
|
|
2
|
+
import type { ShadowRootsController } from './shadowRootsController';
|
|
3
|
+
import type { EmitRecordCallback, EmitStatsCallback } from './record.types';
|
|
4
|
+
export interface RecordOptions {
|
|
5
|
+
emitRecord: EmitRecordCallback;
|
|
6
|
+
emitStats: EmitStatsCallback;
|
|
7
|
+
configuration: RumConfiguration;
|
|
8
|
+
lifeCycle: LifeCycle;
|
|
9
|
+
viewHistory: ViewHistory;
|
|
10
|
+
}
|
|
11
|
+
export interface RecordAPI {
|
|
12
|
+
stop: () => void;
|
|
13
|
+
flushMutations: () => void;
|
|
14
|
+
shadowRootsController: ShadowRootsController;
|
|
15
|
+
}
|
|
16
|
+
export declare function record(options: RecordOptions): RecordAPI;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.record = record;
|
|
37
|
+
const kubesense_browser_core_1 = require("@kubesense/kubesense-browser-core");
|
|
38
|
+
const replayStats = __importStar(require("../replayStats"));
|
|
39
|
+
const trackers_1 = require("./trackers");
|
|
40
|
+
const elementsScrollPositions_1 = require("./elementsScrollPositions");
|
|
41
|
+
const shadowRootsController_1 = require("./shadowRootsController");
|
|
42
|
+
const startFullSnapshots_1 = require("./startFullSnapshots");
|
|
43
|
+
const eventIds_1 = require("./eventIds");
|
|
44
|
+
const nodeIds_1 = require("./nodeIds");
|
|
45
|
+
const recordingScope_1 = require("./recordingScope");
|
|
46
|
+
function record(options) {
|
|
47
|
+
const { emitRecord, emitStats, configuration, lifeCycle } = options;
|
|
48
|
+
// runtime checks for user options
|
|
49
|
+
if (!emitRecord || !emitStats) {
|
|
50
|
+
throw new Error('emit functions are required');
|
|
51
|
+
}
|
|
52
|
+
const processRecord = (record) => {
|
|
53
|
+
emitRecord(record);
|
|
54
|
+
(0, kubesense_browser_core_1.sendToExtension)('record', { record });
|
|
55
|
+
const view = options.viewHistory.findView();
|
|
56
|
+
replayStats.addRecord(view.id);
|
|
57
|
+
};
|
|
58
|
+
const shadowRootsController = (0, shadowRootsController_1.initShadowRootsController)(processRecord, emitStats);
|
|
59
|
+
const scope = (0, recordingScope_1.createRecordingScope)(configuration, (0, elementsScrollPositions_1.createElementsScrollPositions)(), (0, eventIds_1.createEventIds)(), (0, nodeIds_1.createNodeIds)(), shadowRootsController);
|
|
60
|
+
const { stop: stopFullSnapshots } = (0, startFullSnapshots_1.startFullSnapshots)(lifeCycle, processRecord, emitStats, flushMutations, scope);
|
|
61
|
+
function flushMutations() {
|
|
62
|
+
shadowRootsController.flush();
|
|
63
|
+
mutationTracker.flush();
|
|
64
|
+
}
|
|
65
|
+
const mutationTracker = (0, trackers_1.trackMutation)(document, processRecord, emitStats, scope);
|
|
66
|
+
const trackers = [
|
|
67
|
+
mutationTracker,
|
|
68
|
+
(0, trackers_1.trackMove)(processRecord, scope),
|
|
69
|
+
(0, trackers_1.trackMouseInteraction)(processRecord, scope),
|
|
70
|
+
(0, trackers_1.trackScroll)(document, processRecord, scope),
|
|
71
|
+
(0, trackers_1.trackViewportResize)(processRecord, scope),
|
|
72
|
+
(0, trackers_1.trackInput)(document, processRecord, scope),
|
|
73
|
+
(0, trackers_1.trackMediaInteraction)(processRecord, scope),
|
|
74
|
+
(0, trackers_1.trackStyleSheet)(processRecord, scope),
|
|
75
|
+
(0, trackers_1.trackFocus)(processRecord, scope),
|
|
76
|
+
(0, trackers_1.trackVisualViewportResize)(processRecord, scope),
|
|
77
|
+
(0, trackers_1.trackFrustration)(lifeCycle, processRecord, scope),
|
|
78
|
+
(0, trackers_1.trackViewEnd)(lifeCycle, processRecord, flushMutations),
|
|
79
|
+
];
|
|
80
|
+
return {
|
|
81
|
+
stop: () => {
|
|
82
|
+
shadowRootsController.stop();
|
|
83
|
+
trackers.forEach((tracker) => tracker.stop());
|
|
84
|
+
stopFullSnapshots();
|
|
85
|
+
},
|
|
86
|
+
flushMutations,
|
|
87
|
+
shadowRootsController,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=record.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record.js","sourceRoot":"","sources":["../../../src/domain/record/record.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA,wBAuDC;AAjGD,8EAAmE;AAEnE,4DAA6C;AAG7C,yCAamB;AACnB,uEAAyE;AAEzE,mEAAmE;AACnE,6DAAyD;AACzD,yCAA2C;AAC3C,uCAAyC;AAEzC,qDAAuD;AAgBvD,SAAgB,MAAM,CAAC,OAAsB;IAC3C,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,OAAO,CAAA;IACnE,kCAAkC;IAClC,IAAI,CAAC,UAAU,IAAI,CAAC,SAAS,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAA;IAChD,CAAC;IAED,MAAM,aAAa,GAAuB,CAAC,MAAqB,EAAE,EAAE;QAClE,UAAU,CAAC,MAAM,CAAC,CAAA;QAClB,IAAA,wCAAe,EAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,CAAC,CAAA;QACrC,MAAM,IAAI,GAAG,OAAO,CAAC,WAAW,CAAC,QAAQ,EAAG,CAAA;QAC5C,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAChC,CAAC,CAAA;IAED,MAAM,qBAAqB,GAAG,IAAA,iDAAyB,EAAC,aAAa,EAAE,SAAS,CAAC,CAAA;IACjF,MAAM,KAAK,GAAG,IAAA,qCAAoB,EAChC,aAAa,EACb,IAAA,uDAA6B,GAAE,EAC/B,IAAA,yBAAc,GAAE,EAChB,IAAA,uBAAa,GAAE,EACf,qBAAqB,CACtB,CAAA;IAED,MAAM,EAAE,IAAI,EAAE,iBAAiB,EAAE,GAAG,IAAA,uCAAkB,EAAC,SAAS,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,EAAE,KAAK,CAAC,CAAA;IAElH,SAAS,cAAc;QACrB,qBAAqB,CAAC,KAAK,EAAE,CAAA;QAC7B,eAAe,CAAC,KAAK,EAAE,CAAA;IACzB,CAAC;IAED,MAAM,eAAe,GAAG,IAAA,wBAAa,EAAC,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,KAAK,CAAC,CAAA;IAChF,MAAM,QAAQ,GAAc;QAC1B,eAAe;QACf,IAAA,oBAAS,EAAC,aAAa,EAAE,KAAK,CAAC;QAC/B,IAAA,gCAAqB,EAAC,aAAa,EAAE,KAAK,CAAC;QAC3C,IAAA,sBAAW,EAAC,QAAQ,EAAE,aAAa,EAAE,KAAK,CAAC;QAC3C,IAAA,8BAAmB,EAAC,aAAa,EAAE,KAAK,CAAC;QACzC,IAAA,qBAAU,EAAC,QAAQ,EAAE,aAAa,EAAE,KAAK,CAAC;QAC1C,IAAA,gCAAqB,EAAC,aAAa,EAAE,KAAK,CAAC;QAC3C,IAAA,0BAAe,EAAC,aAAa,EAAE,KAAK,CAAC;QACrC,IAAA,qBAAU,EAAC,aAAa,EAAE,KAAK,CAAC;QAChC,IAAA,oCAAyB,EAAC,aAAa,EAAE,KAAK,CAAC;QAC/C,IAAA,2BAAgB,EAAC,SAAS,EAAE,aAAa,EAAE,KAAK,CAAC;QACjD,IAAA,uBAAY,EAAC,SAAS,EAAE,aAAa,EAAE,cAAc,CAAC;KACvD,CAAA;IAED,OAAO;QACL,IAAI,EAAE,GAAG,EAAE;YACT,qBAAqB,CAAC,IAAI,EAAE,CAAA;YAC5B,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAA;YAC7C,iBAAiB,EAAE,CAAA;QACrB,CAAC;QACD,cAAc;QACd,qBAAqB;KACtB,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { BrowserRecord } from '../../types';
|
|
2
|
+
import type { SerializationStats } from './serialization';
|
|
3
|
+
export type EmitRecordCallback<Record extends BrowserRecord = BrowserRecord> = (record: Record) => void;
|
|
4
|
+
export type EmitStatsCallback = (stats: SerializationStats) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record.types.js","sourceRoot":"","sources":["../../../src/domain/record/record.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { RumConfiguration } from '@kubesense/kubesense-browser-rum-core';
|
|
2
|
+
import type { ElementsScrollPositions } from './elementsScrollPositions';
|
|
3
|
+
import type { EventIds } from './eventIds';
|
|
4
|
+
import type { NodeIds } from './nodeIds';
|
|
5
|
+
import type { ShadowRootsController } from './shadowRootsController';
|
|
6
|
+
/**
|
|
7
|
+
* State associated with a stream of session replay records. When a new stream of records
|
|
8
|
+
* starts (e.g. because recording has shut down and restarted), a new RecordingScope
|
|
9
|
+
* object must be created; this ensures that we don't generate records that reference ids
|
|
10
|
+
* or data which aren't present in the current stream.
|
|
11
|
+
*/
|
|
12
|
+
export interface RecordingScope {
|
|
13
|
+
configuration: RumConfiguration;
|
|
14
|
+
elementsScrollPositions: ElementsScrollPositions;
|
|
15
|
+
eventIds: EventIds;
|
|
16
|
+
nodeIds: NodeIds;
|
|
17
|
+
shadowRootsController: ShadowRootsController;
|
|
18
|
+
}
|
|
19
|
+
export declare function createRecordingScope(configuration: RumConfiguration, elementsScrollPositions: ElementsScrollPositions, eventIds: EventIds, nodeIds: NodeIds, shadowRootsController: ShadowRootsController): RecordingScope;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createRecordingScope = createRecordingScope;
|
|
4
|
+
function createRecordingScope(configuration, elementsScrollPositions, eventIds, nodeIds, shadowRootsController) {
|
|
5
|
+
return {
|
|
6
|
+
configuration,
|
|
7
|
+
elementsScrollPositions,
|
|
8
|
+
eventIds,
|
|
9
|
+
nodeIds,
|
|
10
|
+
shadowRootsController,
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=recordingScope.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recordingScope.js","sourceRoot":"","sources":["../../../src/domain/record/recordingScope.ts"],"names":[],"mappings":";;AAqBA,oDAcC;AAdD,SAAgB,oBAAoB,CAClC,aAA+B,EAC/B,uBAAgD,EAChD,QAAkB,EAClB,OAAgB,EAChB,qBAA4C;IAE5C,OAAO;QACL,aAAa;QACb,uBAAuB;QACvB,QAAQ;QACR,OAAO;QACP,qBAAqB;KACtB,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { getElementInputValue } from './serializationUtils';
|
|
2
|
+
export { serializeDocument } from './serializeDocument';
|
|
3
|
+
export { serializeNode } from './serializeNode';
|
|
4
|
+
export { serializeAttribute } from './serializeAttribute';
|
|
5
|
+
export { createSerializationStats, updateSerializationStats, aggregateSerializationStats } from './serializationStats';
|
|
6
|
+
export type { SerializationMetric, SerializationStats } from './serializationStats';
|
|
7
|
+
export { serializeInTransaction, SerializationKind } from './serializationTransaction';
|
|
8
|
+
export type { SerializationTransaction, SerializationTransactionCallback } from './serializationTransaction';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.serializeInTransaction = exports.aggregateSerializationStats = exports.updateSerializationStats = exports.createSerializationStats = exports.serializeAttribute = exports.serializeNode = exports.serializeDocument = exports.getElementInputValue = void 0;
|
|
4
|
+
var serializationUtils_1 = require("./serializationUtils");
|
|
5
|
+
Object.defineProperty(exports, "getElementInputValue", { enumerable: true, get: function () { return serializationUtils_1.getElementInputValue; } });
|
|
6
|
+
var serializeDocument_1 = require("./serializeDocument");
|
|
7
|
+
Object.defineProperty(exports, "serializeDocument", { enumerable: true, get: function () { return serializeDocument_1.serializeDocument; } });
|
|
8
|
+
var serializeNode_1 = require("./serializeNode");
|
|
9
|
+
Object.defineProperty(exports, "serializeNode", { enumerable: true, get: function () { return serializeNode_1.serializeNode; } });
|
|
10
|
+
var serializeAttribute_1 = require("./serializeAttribute");
|
|
11
|
+
Object.defineProperty(exports, "serializeAttribute", { enumerable: true, get: function () { return serializeAttribute_1.serializeAttribute; } });
|
|
12
|
+
var serializationStats_1 = require("./serializationStats");
|
|
13
|
+
Object.defineProperty(exports, "createSerializationStats", { enumerable: true, get: function () { return serializationStats_1.createSerializationStats; } });
|
|
14
|
+
Object.defineProperty(exports, "updateSerializationStats", { enumerable: true, get: function () { return serializationStats_1.updateSerializationStats; } });
|
|
15
|
+
Object.defineProperty(exports, "aggregateSerializationStats", { enumerable: true, get: function () { return serializationStats_1.aggregateSerializationStats; } });
|
|
16
|
+
var serializationTransaction_1 = require("./serializationTransaction");
|
|
17
|
+
Object.defineProperty(exports, "serializeInTransaction", { enumerable: true, get: function () { return serializationTransaction_1.serializeInTransaction; } });
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/domain/record/serialization/index.ts"],"names":[],"mappings":";;;AAAA,2DAA2D;AAAlD,0HAAA,oBAAoB,OAAA;AAC7B,yDAAuD;AAA9C,sHAAA,iBAAiB,OAAA;AAC1B,iDAA+C;AAAtC,8GAAA,aAAa,OAAA;AACtB,2DAAyD;AAAhD,wHAAA,kBAAkB,OAAA;AAC3B,2DAAsH;AAA7G,8HAAA,wBAAwB,OAAA;AAAE,8HAAA,wBAAwB,OAAA;AAAE,iIAAA,2BAA2B,OAAA;AAExF,uEAAsF;AAA7E,kIAAA,sBAAsB,OAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { NodePrivacyLevel } from '@kubesense/kubesense-browser-rum-core';
|
|
2
|
+
export type ParentNodePrivacyLevel = typeof NodePrivacyLevel.ALLOW | typeof NodePrivacyLevel.MASK | typeof NodePrivacyLevel.MASK_USER_INPUT | typeof NodePrivacyLevel.MASK_UNLESS_ALLOWLISTED;
|
|
3
|
+
/**
|
|
4
|
+
* Virtual attributes. These attributes appear in the serialized attribute map of
|
|
5
|
+
* elements, but they're not actually derived from the DOM; they're used to represent
|
|
6
|
+
* metadata about the element they're attached to.
|
|
7
|
+
*/
|
|
8
|
+
export interface VirtualAttributes {
|
|
9
|
+
/**
|
|
10
|
+
* For <style> and <link> elements, the rules in the element's stylesheet, extracted
|
|
11
|
+
* from the CSSOM.
|
|
12
|
+
*/
|
|
13
|
+
_cssText?: string;
|
|
14
|
+
/** For <audio> and <video> elements, the playback state of the element's media. */
|
|
15
|
+
rr_mediaState?: 'paused' | 'played';
|
|
16
|
+
/** For elements which are scroll containers, the element's X scroll position, if non-zero. */
|
|
17
|
+
rr_scrollLeft?: number;
|
|
18
|
+
/** For elements which are scroll containers, the element's Y scroll position, if non-zero. */
|
|
19
|
+
rr_scrollTop?: number;
|
|
20
|
+
/** For HIDDEN elements, the width of the element's bounding client rect. */
|
|
21
|
+
rr_width?: string;
|
|
22
|
+
/** For HIDDEN elements, the height of the element's bounding client rect. */
|
|
23
|
+
rr_height?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface SerializeOptions {
|
|
26
|
+
/** For HIDDEN elements, the height of the element's bounding client rect. */
|
|
27
|
+
rr_height?: string;
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialization.types.js","sourceRoot":"","sources":["../../../../src/domain/record/serialization/serialization.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface SerializationMetric {
|
|
2
|
+
count: number;
|
|
3
|
+
max: number;
|
|
4
|
+
sum: number;
|
|
5
|
+
}
|
|
6
|
+
export interface SerializationStats {
|
|
7
|
+
cssText: SerializationMetric;
|
|
8
|
+
serializationDuration: SerializationMetric;
|
|
9
|
+
}
|
|
10
|
+
export declare function createSerializationStats(): SerializationStats;
|
|
11
|
+
export declare function updateSerializationStats(stats: SerializationStats, metric: keyof SerializationStats, value: number): void;
|
|
12
|
+
export declare function aggregateSerializationStats(aggregateStats: SerializationStats, stats: SerializationStats): void;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createSerializationStats = createSerializationStats;
|
|
4
|
+
exports.updateSerializationStats = updateSerializationStats;
|
|
5
|
+
exports.aggregateSerializationStats = aggregateSerializationStats;
|
|
6
|
+
function createSerializationStats() {
|
|
7
|
+
return {
|
|
8
|
+
cssText: {
|
|
9
|
+
count: 0,
|
|
10
|
+
max: 0,
|
|
11
|
+
sum: 0,
|
|
12
|
+
},
|
|
13
|
+
serializationDuration: {
|
|
14
|
+
count: 0,
|
|
15
|
+
max: 0,
|
|
16
|
+
sum: 0,
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function updateSerializationStats(stats, metric, value) {
|
|
21
|
+
stats[metric].count += 1;
|
|
22
|
+
stats[metric].max = Math.max(stats[metric].max, value);
|
|
23
|
+
stats[metric].sum += value;
|
|
24
|
+
}
|
|
25
|
+
function aggregateSerializationStats(aggregateStats, stats) {
|
|
26
|
+
for (const metric of ['cssText', 'serializationDuration']) {
|
|
27
|
+
aggregateStats[metric].count += stats[metric].count;
|
|
28
|
+
aggregateStats[metric].max = Math.max(aggregateStats[metric].max, stats[metric].max);
|
|
29
|
+
aggregateStats[metric].sum += stats[metric].sum;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=serializationStats.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serializationStats.js","sourceRoot":"","sources":["../../../../src/domain/record/serialization/serializationStats.ts"],"names":[],"mappings":";;AAWA,4DAaC;AAED,4DAQC;AAED,kEAMC;AA/BD,SAAgB,wBAAwB;IACtC,OAAO;QACL,OAAO,EAAE;YACP,KAAK,EAAE,CAAC;YACR,GAAG,EAAE,CAAC;YACN,GAAG,EAAE,CAAC;SACP;QACD,qBAAqB,EAAE;YACrB,KAAK,EAAE,CAAC;YACR,GAAG,EAAE,CAAC;YACN,GAAG,EAAE,CAAC;SACP;KACF,CAAA;AACH,CAAC;AAED,SAAgB,wBAAwB,CACtC,KAAyB,EACzB,MAAgC,EAChC,KAAa;IAEb,KAAK,CAAC,MAAM,CAAC,CAAC,KAAK,IAAI,CAAC,CAAA;IACxB,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;IACtD,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,KAAK,CAAA;AAC5B,CAAC;AAED,SAAgB,2BAA2B,CAAC,cAAkC,EAAE,KAAyB;IACvG,KAAK,MAAM,MAAM,IAAI,CAAC,SAAS,EAAE,uBAAuB,CAAU,EAAE,CAAC;QACnE,cAAc,CAAC,MAAM,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,KAAK,CAAA;QACnD,cAAc,CAAC,MAAM,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAA;QACpF,cAAc,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,CAAA;IACjD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { BrowserRecord } from '../../../types';
|
|
2
|
+
import type { NodeId } from '../nodeIds';
|
|
3
|
+
import type { EmitRecordCallback, EmitStatsCallback } from '../record.types';
|
|
4
|
+
import type { RecordingScope } from '../recordingScope';
|
|
5
|
+
import type { SerializationStats } from './serializationStats';
|
|
6
|
+
export type SerializationTransactionCallback = (transaction: SerializationTransaction) => void;
|
|
7
|
+
export declare const enum SerializationKind {
|
|
8
|
+
INITIAL_FULL_SNAPSHOT = 0,
|
|
9
|
+
SUBSEQUENT_FULL_SNAPSHOT = 1,
|
|
10
|
+
INCREMENTAL_SNAPSHOT = 2
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A serialization transaction is used to build and emit a sequence of session replay
|
|
14
|
+
* records containing a serialized snapshot of the DOM.
|
|
15
|
+
*/
|
|
16
|
+
export interface SerializationTransaction {
|
|
17
|
+
/** Add a record to the transaction. It will be emitted when the transaction ends. */
|
|
18
|
+
add(record: BrowserRecord): void;
|
|
19
|
+
/**
|
|
20
|
+
* Add a metric to the transaction's statistics. The aggregated statistics will be
|
|
21
|
+
* emitted when the transaction ends.
|
|
22
|
+
*/
|
|
23
|
+
addMetric(metric: keyof SerializationStats, value: number): void;
|
|
24
|
+
/**
|
|
25
|
+
* Assign and return an id to the given node. If the node has previously been assigned
|
|
26
|
+
* an id, the existing id will be reused.
|
|
27
|
+
*/
|
|
28
|
+
assignId(node: Node): NodeId;
|
|
29
|
+
/** The kind of serialization being performed in this transaction. */
|
|
30
|
+
kind: SerializationKind;
|
|
31
|
+
/**
|
|
32
|
+
* A set used to track nodes which have been serialized in the current transaction. If
|
|
33
|
+
* undefined, this feature is disabled; this is the default state in new transactions
|
|
34
|
+
* for performance reasons. Set the property to a non-undefined value if you need this
|
|
35
|
+
* capability.
|
|
36
|
+
*/
|
|
37
|
+
serializedNodeIds?: Set<NodeId>;
|
|
38
|
+
/** The recording scope in which this transaction is occurring. */
|
|
39
|
+
scope: RecordingScope;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Perform serialization within a transaction. At the end of the transaction, the
|
|
43
|
+
* generated records and statistics will be emitted.
|
|
44
|
+
*/
|
|
45
|
+
export declare function serializeInTransaction(kind: SerializationKind, emitRecord: EmitRecordCallback, emitStats: EmitStatsCallback, scope: RecordingScope, serialize: SerializationTransactionCallback): void;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.serializeInTransaction = serializeInTransaction;
|
|
4
|
+
const kubesense_browser_core_1 = require("@kubesense/kubesense-browser-core");
|
|
5
|
+
const serializationStats_1 = require("./serializationStats");
|
|
6
|
+
/**
|
|
7
|
+
* Perform serialization within a transaction. At the end of the transaction, the
|
|
8
|
+
* generated records and statistics will be emitted.
|
|
9
|
+
*/
|
|
10
|
+
function serializeInTransaction(kind, emitRecord, emitStats, scope, serialize) {
|
|
11
|
+
const records = [];
|
|
12
|
+
const stats = (0, serializationStats_1.createSerializationStats)();
|
|
13
|
+
const transaction = {
|
|
14
|
+
add(record) {
|
|
15
|
+
records.push(record);
|
|
16
|
+
},
|
|
17
|
+
addMetric(metric, value) {
|
|
18
|
+
(0, serializationStats_1.updateSerializationStats)(stats, metric, value);
|
|
19
|
+
},
|
|
20
|
+
assignId(node) {
|
|
21
|
+
const id = scope.nodeIds.assign(node);
|
|
22
|
+
if (transaction.serializedNodeIds) {
|
|
23
|
+
transaction.serializedNodeIds.add(id);
|
|
24
|
+
}
|
|
25
|
+
return id;
|
|
26
|
+
},
|
|
27
|
+
kind,
|
|
28
|
+
scope,
|
|
29
|
+
};
|
|
30
|
+
const start = (0, kubesense_browser_core_1.timeStampNow)();
|
|
31
|
+
serialize(transaction);
|
|
32
|
+
(0, serializationStats_1.updateSerializationStats)(stats, 'serializationDuration', (0, kubesense_browser_core_1.elapsed)(start, (0, kubesense_browser_core_1.timeStampNow)()));
|
|
33
|
+
for (const record of records) {
|
|
34
|
+
emitRecord(record);
|
|
35
|
+
}
|
|
36
|
+
emitStats(stats);
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=serializationTransaction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serializationTransaction.js","sourceRoot":"","sources":["../../../../src/domain/record/serialization/serializationTransaction.ts"],"names":[],"mappings":";;AAwDA,wDAqCC;AA7FD,8EAAyE;AAOzE,6DAAyF;AA6CzF;;;GAGG;AACH,SAAgB,sBAAsB,CACpC,IAAuB,EACvB,UAA8B,EAC9B,SAA4B,EAC5B,KAAqB,EACrB,SAA2C;IAE3C,MAAM,OAAO,GAAoB,EAAE,CAAA;IACnC,MAAM,KAAK,GAAG,IAAA,6CAAwB,GAAE,CAAA;IAExC,MAAM,WAAW,GAA6B;QAC5C,GAAG,CAAC,MAAqB;YACvB,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACtB,CAAC;QACD,SAAS,CAAC,MAAgC,EAAE,KAAa;YACvD,IAAA,6CAAwB,EAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,CAAA;QAChD,CAAC;QACD,QAAQ,CAAC,IAAU;YACjB,MAAM,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;YACrC,IAAI,WAAW,CAAC,iBAAiB,EAAE,CAAC;gBAClC,WAAW,CAAC,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;YACvC,CAAC;YACD,OAAO,EAAE,CAAA;QACX,CAAC;QACD,IAAI;QACJ,KAAK;KACN,CAAA;IAED,MAAM,KAAK,GAAG,IAAA,qCAAY,GAAE,CAAA;IAC5B,SAAS,CAAC,WAAW,CAAC,CAAA;IACtB,IAAA,6CAAwB,EAAC,KAAK,EAAE,uBAAuB,EAAE,IAAA,gCAAO,EAAC,KAAK,EAAE,IAAA,qCAAY,GAAE,CAAC,CAAC,CAAA;IAExF,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,UAAU,CAAC,MAAM,CAAC,CAAA;IACpB,CAAC;IAED,SAAS,CAAC,KAAK,CAAC,CAAA;AAClB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { NodePrivacyLevel } from '@kubesense/kubesense-browser-rum-core';
|
|
2
|
+
/**
|
|
3
|
+
* Get the element "value" to be serialized as an attribute or an input update record. It respects
|
|
4
|
+
* the input privacy mode of the element.
|
|
5
|
+
* PERFROMANCE OPTIMIZATION: Assumes that privacy level `HIDDEN` is never encountered because of earlier checks.
|
|
6
|
+
*/
|
|
7
|
+
export declare function getElementInputValue(element: Element, nodePrivacyLevel: NodePrivacyLevel): string | undefined;
|
|
8
|
+
export declare const URL_IN_CSS_REF: RegExp;
|
|
9
|
+
export declare const ABSOLUTE_URL: RegExp;
|
|
10
|
+
export declare const DATA_URI: RegExp;
|
|
11
|
+
export declare function switchToAbsoluteUrl(cssText: string, cssHref: string | null): string;
|
|
12
|
+
export declare function getValidTagName(tagName: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* Returns the tag name of the given element, normalized to ensure a consistent lowercase
|
|
15
|
+
* representation regardless of whether the element is HTML, XHTML, or SVG.
|
|
16
|
+
*/
|
|
17
|
+
export declare function normalizedTagName(element: Element): string;
|
|
18
|
+
export declare function censoredImageForSize(width: number, height: number): string;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DATA_URI = exports.ABSOLUTE_URL = exports.URL_IN_CSS_REF = void 0;
|
|
4
|
+
exports.getElementInputValue = getElementInputValue;
|
|
5
|
+
exports.switchToAbsoluteUrl = switchToAbsoluteUrl;
|
|
6
|
+
exports.getValidTagName = getValidTagName;
|
|
7
|
+
exports.normalizedTagName = normalizedTagName;
|
|
8
|
+
exports.censoredImageForSize = censoredImageForSize;
|
|
9
|
+
const kubesense_browser_core_1 = require("@kubesense/kubesense-browser-core");
|
|
10
|
+
const kubesense_browser_rum_core_1 = require("@kubesense/kubesense-browser-rum-core");
|
|
11
|
+
/**
|
|
12
|
+
* Get the element "value" to be serialized as an attribute or an input update record. It respects
|
|
13
|
+
* the input privacy mode of the element.
|
|
14
|
+
* PERFROMANCE OPTIMIZATION: Assumes that privacy level `HIDDEN` is never encountered because of earlier checks.
|
|
15
|
+
*/
|
|
16
|
+
function getElementInputValue(element, nodePrivacyLevel) {
|
|
17
|
+
/*
|
|
18
|
+
BROWSER SPEC NOTE: <input>, <select>
|
|
19
|
+
For some <input> elements, the `value` is an exceptional property/attribute that has the
|
|
20
|
+
value synced between el.value and el.getAttribute()
|
|
21
|
+
input[type=button,checkbox,hidden,image,radio,reset,submit]
|
|
22
|
+
*/
|
|
23
|
+
const tagName = element.tagName;
|
|
24
|
+
const value = element.value;
|
|
25
|
+
if ((0, kubesense_browser_rum_core_1.shouldMaskNode)(element, nodePrivacyLevel)) {
|
|
26
|
+
const type = element.type;
|
|
27
|
+
if (tagName === 'INPUT' && (type === 'button' || type === 'submit' || type === 'reset')) {
|
|
28
|
+
// Overrule `MASK` privacy level for button-like element values, as they are used during replay
|
|
29
|
+
// to display their label. They can still be hidden via the "hidden" privacy attribute or class name.
|
|
30
|
+
return value;
|
|
31
|
+
}
|
|
32
|
+
else if (!value || tagName === 'OPTION') {
|
|
33
|
+
// <Option> value provides no benefit
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
return kubesense_browser_rum_core_1.CENSORED_STRING_MARK;
|
|
37
|
+
}
|
|
38
|
+
if (tagName === 'OPTION' || tagName === 'SELECT') {
|
|
39
|
+
return element.value;
|
|
40
|
+
}
|
|
41
|
+
if (tagName !== 'INPUT' && tagName !== 'TEXTAREA') {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
return value;
|
|
45
|
+
}
|
|
46
|
+
exports.URL_IN_CSS_REF = /url\((?:(')([^']*)'|(")([^"]*)"|([^)]*))\)/gm;
|
|
47
|
+
exports.ABSOLUTE_URL = /^[A-Za-z]+:|^\/\//;
|
|
48
|
+
exports.DATA_URI = /^["']?data:.*,/i;
|
|
49
|
+
function switchToAbsoluteUrl(cssText, cssHref) {
|
|
50
|
+
return cssText.replace(exports.URL_IN_CSS_REF, (matchingSubstring, singleQuote, urlWrappedInSingleQuotes, doubleQuote, urlWrappedInDoubleQuotes, urlNotWrappedInQuotes) => {
|
|
51
|
+
const url = urlWrappedInSingleQuotes || urlWrappedInDoubleQuotes || urlNotWrappedInQuotes;
|
|
52
|
+
if (!cssHref || !url || exports.ABSOLUTE_URL.test(url) || exports.DATA_URI.test(url)) {
|
|
53
|
+
return matchingSubstring;
|
|
54
|
+
}
|
|
55
|
+
const quote = singleQuote || doubleQuote || '';
|
|
56
|
+
return `url(${quote}${makeUrlAbsolute(url, cssHref)}${quote})`;
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function makeUrlAbsolute(url, baseUrl) {
|
|
60
|
+
try {
|
|
61
|
+
return (0, kubesense_browser_core_1.buildUrl)(url, baseUrl).href;
|
|
62
|
+
}
|
|
63
|
+
catch (_a) {
|
|
64
|
+
return url;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
const TAG_NAME_REGEX = /[^a-z1-6-_]/;
|
|
68
|
+
function getValidTagName(tagName) {
|
|
69
|
+
const processedTagName = tagName.toLowerCase().trim();
|
|
70
|
+
if (TAG_NAME_REGEX.test(processedTagName)) {
|
|
71
|
+
// if the tag name is odd and we cannot extract
|
|
72
|
+
// anything from the string, then we return a
|
|
73
|
+
// generic div
|
|
74
|
+
return 'div';
|
|
75
|
+
}
|
|
76
|
+
return processedTagName;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Returns the tag name of the given element, normalized to ensure a consistent lowercase
|
|
80
|
+
* representation regardless of whether the element is HTML, XHTML, or SVG.
|
|
81
|
+
*/
|
|
82
|
+
function normalizedTagName(element) {
|
|
83
|
+
return element.tagName.toLowerCase();
|
|
84
|
+
}
|
|
85
|
+
function censoredImageForSize(width, height) {
|
|
86
|
+
return `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${width}' height='${height}' style='background-color:silver'%3E%3C/svg%3E`;
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=serializationUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serializationUtils.js","sourceRoot":"","sources":["../../../../src/domain/record/serialization/serializationUtils.ts"],"names":[],"mappings":";;;AASA,oDAgCC;AAMD,kDAqBC;AAWD,0CAWC;AAMD,8CAEC;AAED,oDAEC;AAtGD,8EAA4D;AAC5D,sFAA4F;AAG5F;;;;GAIG;AACH,SAAgB,oBAAoB,CAAC,OAAgB,EAAE,gBAAkC;IACvF;;;;;OAKG;IACH,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAA;IAC/B,MAAM,KAAK,GAAI,OAAkD,CAAC,KAAK,CAAA;IAEvE,IAAI,IAAA,2CAAc,EAAC,OAAO,EAAE,gBAAgB,CAAC,EAAE,CAAC;QAC9C,MAAM,IAAI,GAAI,OAAkD,CAAC,IAAI,CAAA;QACrE,IAAI,OAAO,KAAK,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,OAAO,CAAC,EAAE,CAAC;YACxF,+FAA+F;YAC/F,qGAAqG;YACrG,OAAO,KAAK,CAAA;QACd,CAAC;aAAM,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,QAAQ,EAAE,CAAC;YAC1C,qCAAqC;YACrC,OAAM;QACR,CAAC;QACD,OAAO,iDAAoB,CAAA;IAC7B,CAAC;IAED,IAAI,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,QAAQ,EAAE,CAAC;QACjD,OAAQ,OAAiD,CAAC,KAAK,CAAA;IACjE,CAAC;IAED,IAAI,OAAO,KAAK,OAAO,IAAI,OAAO,KAAK,UAAU,EAAE,CAAC;QAClD,OAAM;IACR,CAAC;IAED,OAAO,KAAK,CAAA;AACd,CAAC;AAEY,QAAA,cAAc,GAAG,8CAA8C,CAAA;AAC/D,QAAA,YAAY,GAAG,mBAAmB,CAAA;AAClC,QAAA,QAAQ,GAAG,iBAAiB,CAAA;AAEzC,SAAgB,mBAAmB,CAAC,OAAe,EAAE,OAAsB;IACzE,OAAO,OAAO,CAAC,OAAO,CACpB,sBAAc,EACd,CACE,iBAAyB,EACzB,WAA+B,EAC/B,wBAA4C,EAC5C,WAA+B,EAC/B,wBAA4C,EAC5C,qBAAyC,EACzC,EAAE;QACF,MAAM,GAAG,GAAG,wBAAwB,IAAI,wBAAwB,IAAI,qBAAqB,CAAA;QAEzF,IAAI,CAAC,OAAO,IAAI,CAAC,GAAG,IAAI,oBAAY,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,gBAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;YACrE,OAAO,iBAAiB,CAAA;QAC1B,CAAC;QAED,MAAM,KAAK,GAAG,WAAW,IAAI,WAAW,IAAI,EAAE,CAAA;QAC9C,OAAO,OAAO,KAAK,GAAG,eAAe,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,KAAK,GAAG,CAAA;IAChE,CAAC,CACF,CAAA;AACH,CAAC;AAED,SAAS,eAAe,CAAC,GAAW,EAAE,OAAe;IACnD,IAAI,CAAC;QACH,OAAO,IAAA,iCAAQ,EAAC,GAAG,EAAE,OAAO,CAAC,CAAC,IAAI,CAAA;IACpC,CAAC;IAAC,WAAM,CAAC;QACP,OAAO,GAAG,CAAA;IACZ,CAAC;AACH,CAAC;AAED,MAAM,cAAc,GAAG,aAAa,CAAA;AACpC,SAAgB,eAAe,CAAC,OAAe;IAC7C,MAAM,gBAAgB,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAA;IAErD,IAAI,cAAc,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE,CAAC;QAC1C,+CAA+C;QAC/C,6CAA6C;QAC7C,cAAc;QACd,OAAO,KAAK,CAAA;IACd,CAAC;IAED,OAAO,gBAAgB,CAAA;AACzB,CAAC;AAED;;;GAGG;AACH,SAAgB,iBAAiB,CAAC,OAAgB;IAChD,OAAO,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,CAAA;AACtC,CAAC;AAED,SAAgB,oBAAoB,CAAC,KAAa,EAAE,MAAc;IAChE,OAAO,uEAAuE,KAAK,aAAa,MAAM,gDAAgD,CAAA;AACxJ,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { NodePrivacyLevel } from '@kubesense/kubesense-browser-rum-core';
|
|
2
|
+
import type { RumConfiguration } from '@kubesense/kubesense-browser-rum-core';
|
|
3
|
+
export declare const MAX_ATTRIBUTE_VALUE_CHAR_LENGTH = 1000000;
|
|
4
|
+
export declare function serializeAttribute(element: Element, nodePrivacyLevel: NodePrivacyLevel, attributeName: string, configuration: RumConfiguration): string | null;
|