@kubesense/kubesense-browser-rum 1.8.0 → 2.0.0-beta.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/LICENSE +1 -1
- package/README.md +23 -0
- package/bundle/chunks/kubesenseProfiler-4b8cfd8f889074788478-kubesense-rum.js +1 -0
- package/bundle/chunks/kubesenseRecorder-db948e96649585a2b3e9-kubesense-rum.js +1 -0
- package/bundle/kubesense-rum.js +1 -1
- package/cjs/boot/kubesenseRecorder.d.ts +6 -0
- package/cjs/boot/kubesenseRecorder.js +75 -0
- package/cjs/boot/kubesenseRecorder.js.map +1 -0
- package/cjs/boot/lazyLoadProfiler.d.ts +3 -4
- package/cjs/boot/lazyLoadProfiler.js +18 -50
- package/cjs/boot/lazyLoadProfiler.js.map +1 -1
- package/cjs/boot/lazyLoadRecorder.d.ts +3 -4
- package/cjs/boot/lazyLoadRecorder.js +18 -50
- package/cjs/boot/lazyLoadRecorder.js.map +1 -1
- package/cjs/boot/postStartStrategy.d.ts +4 -4
- package/cjs/boot/postStartStrategy.js +89 -110
- package/cjs/boot/postStartStrategy.js.map +1 -1
- package/cjs/boot/preStartStrategy.js +21 -21
- package/cjs/boot/preStartStrategy.js.map +1 -1
- package/cjs/boot/profilerApi.js +44 -50
- package/cjs/boot/profilerApi.js.map +1 -1
- package/cjs/boot/recorderApi.d.ts +1 -3
- package/cjs/boot/recorderApi.js +41 -71
- package/cjs/boot/recorderApi.js.map +1 -1
- package/cjs/domain/deflate/deflateEncoder.d.ts +1 -2
- package/cjs/domain/deflate/deflateEncoder.js +94 -108
- package/cjs/domain/deflate/deflateEncoder.js.map +1 -1
- package/cjs/domain/deflate/deflateWorker.d.ts +3 -4
- package/cjs/domain/deflate/deflateWorker.js +79 -90
- package/cjs/domain/deflate/deflateWorker.js.map +1 -1
- package/cjs/domain/deflate/index.d.ts +1 -1
- package/cjs/domain/deflate/index.js +5 -10
- package/cjs/domain/getSessionReplayLink.d.ts +3 -2
- package/cjs/domain/getSessionReplayLink.js +17 -31
- package/cjs/domain/getSessionReplayLink.js.map +1 -1
- package/cjs/domain/profiling/actionHistory.d.ts +10 -0
- package/cjs/domain/profiling/actionHistory.js +37 -0
- package/cjs/domain/profiling/actionHistory.js.map +1 -0
- package/cjs/domain/profiling/kubesenseProfiler.d.ts +6 -0
- package/cjs/domain/profiling/kubesenseProfiler.js +243 -0
- package/cjs/domain/profiling/kubesenseProfiler.js.map +1 -0
- package/cjs/domain/profiling/longTaskHistory.d.ts +11 -0
- package/cjs/domain/profiling/longTaskHistory.js +22 -0
- package/cjs/domain/profiling/longTaskHistory.js.map +1 -0
- package/cjs/domain/profiling/profilerDebugIds.d.ts +2 -0
- package/cjs/domain/profiling/profilerDebugIds.js +18 -0
- package/cjs/domain/profiling/profilerDebugIds.js.map +1 -0
- package/cjs/domain/profiling/profilingContext.js +20 -25
- package/cjs/domain/profiling/profilingContext.js.map +1 -1
- package/cjs/domain/profiling/profilingSupported.js +6 -8
- package/cjs/domain/profiling/profilingSupported.js.map +1 -1
- package/cjs/domain/profiling/quotaCheck.d.ts +9 -0
- package/cjs/domain/profiling/quotaCheck.js +66 -0
- package/cjs/domain/profiling/quotaCheck.js.map +1 -0
- package/cjs/domain/profiling/test-utils/mockedTrace.d.ts +1 -1
- package/cjs/domain/profiling/transport/buildProfileEvent.d.ts +38 -0
- package/cjs/domain/profiling/transport/buildProfileEvent.js +91 -0
- package/cjs/domain/profiling/transport/buildProfileEvent.js.map +1 -0
- package/cjs/domain/profiling/transport/formDataEmitter.d.ts +5 -0
- package/cjs/domain/profiling/transport/formDataEmitter.js +17 -0
- package/cjs/domain/profiling/transport/formDataEmitter.js.map +1 -0
- package/cjs/domain/profiling/transport/profilingBridge.d.ts +2 -0
- package/cjs/domain/profiling/transport/profilingBridge.js +12 -0
- package/cjs/domain/profiling/transport/profilingBridge.js.map +1 -0
- package/cjs/domain/profiling/{types/rumProfiler.types.d.ts → types.d.ts} +13 -24
- package/cjs/domain/profiling/utils/getCustomOrDefaultViewName.js +5 -5
- package/cjs/domain/profiling/utils/getCustomOrDefaultViewName.js.map +1 -1
- package/cjs/domain/profiling/utils/getDefaultViewName.js +6 -10
- package/cjs/domain/profiling/utils/getDefaultViewName.js.map +1 -1
- package/cjs/domain/profiling/vitalHistory.d.ts +13 -0
- package/cjs/domain/profiling/vitalHistory.js +56 -0
- package/cjs/domain/profiling/vitalHistory.js.map +1 -0
- package/cjs/domain/record/assembly.d.ts +2 -1
- package/cjs/domain/record/assembly.js +15 -14
- package/cjs/domain/record/assembly.js.map +1 -1
- package/cjs/domain/record/canvas/canvasHash.d.ts +2 -0
- package/cjs/domain/record/canvas/canvasHash.js +33 -0
- package/cjs/domain/record/canvas/canvasHash.js.map +1 -0
- package/cjs/domain/record/canvas/canvasManager.d.ts +42 -0
- package/cjs/domain/record/canvas/canvasManager.js +99 -0
- package/cjs/domain/record/canvas/canvasManager.js.map +1 -0
- package/cjs/domain/record/canvas/canvasSnapshot.d.ts +8 -0
- package/cjs/domain/record/canvas/canvasSnapshot.js +40 -0
- package/cjs/domain/record/canvas/canvasSnapshot.js.map +1 -0
- package/cjs/domain/record/canvas/canvasUtils.d.ts +2 -0
- package/cjs/domain/record/canvas/canvasUtils.js +14 -0
- package/cjs/domain/record/canvas/canvasUtils.js.map +1 -0
- package/cjs/domain/record/elementsScrollPositions.js +17 -20
- package/cjs/domain/record/elementsScrollPositions.js.map +1 -1
- package/cjs/domain/record/encoding/changeDecoder.d.ts +39 -0
- package/cjs/domain/record/encoding/changeDecoder.js +152 -0
- package/cjs/domain/record/encoding/changeDecoder.js.map +1 -0
- package/cjs/domain/record/encoding/changeEncoder.d.ts +39 -0
- package/cjs/domain/record/encoding/changeEncoder.js +146 -0
- package/cjs/domain/record/encoding/changeEncoder.js.map +1 -0
- package/cjs/domain/record/encoding/index.d.ts +10 -0
- package/cjs/domain/record/encoding/itemIds.d.ts +32 -0
- package/cjs/domain/record/encoding/itemIds.js +49 -0
- package/cjs/domain/record/encoding/itemIds.js.map +1 -0
- package/cjs/domain/record/encoding/roles.d.ts +52 -0
- package/cjs/domain/record/encoding/roles.js +66 -0
- package/cjs/domain/record/encoding/roles.js.map +1 -0
- package/cjs/domain/record/encoding/stringIds.d.ts +15 -0
- package/cjs/domain/record/encoding/stringIds.js +47 -0
- package/cjs/domain/record/encoding/stringIds.js.map +1 -0
- package/cjs/domain/record/encoding/stringTable.d.ts +15 -0
- package/cjs/domain/record/encoding/stringTable.js +38 -0
- package/cjs/domain/record/encoding/stringTable.js.map +1 -0
- package/cjs/domain/record/eventsUtils.js +9 -10
- package/cjs/domain/record/eventsUtils.js.map +1 -1
- package/cjs/domain/record/index.d.ts +5 -2
- package/cjs/domain/record/index.js +13 -17
- package/cjs/domain/record/internalApi.d.ts +6 -6
- package/cjs/domain/record/internalApi.js +55 -49
- package/cjs/domain/record/internalApi.js.map +1 -1
- package/cjs/domain/record/mutationBatch.d.ts +1 -0
- package/cjs/domain/record/mutationBatch.js +38 -39
- package/cjs/domain/record/mutationBatch.js.map +1 -1
- package/cjs/domain/record/record.d.ts +7 -1
- package/cjs/domain/record/record.js +76 -87
- package/cjs/domain/record/record.js.map +1 -1
- package/cjs/domain/record/record.types.d.ts +1 -0
- package/cjs/domain/record/recordingScope.d.ts +7 -3
- package/cjs/domain/record/recordingScope.js +25 -11
- package/cjs/domain/record/recordingScope.js.map +1 -1
- package/cjs/domain/record/serialization/index.d.ts +4 -2
- package/cjs/domain/record/serialization/index.js +16 -18
- package/cjs/domain/record/serialization/insertionCursor.d.ts +57 -0
- package/cjs/domain/record/serialization/insertionCursor.js +55 -0
- package/cjs/domain/record/serialization/insertionCursor.js.map +1 -0
- package/cjs/domain/record/serialization/serialization.types.d.ts +0 -6
- package/cjs/domain/record/serialization/serializationStats.js +26 -25
- package/cjs/domain/record/serialization/serializationStats.js.map +1 -1
- package/cjs/domain/record/serialization/serializationTransaction.d.ts +44 -22
- package/cjs/domain/record/serialization/serializationTransaction.js +90 -36
- package/cjs/domain/record/serialization/serializationTransaction.js.map +1 -1
- package/cjs/domain/record/serialization/serializationUtils.d.ts +0 -1
- package/cjs/domain/record/serialization/serializationUtils.js +46 -75
- package/cjs/domain/record/serialization/serializationUtils.js.map +1 -1
- package/cjs/domain/record/serialization/serializeAttribute.js +24 -39
- package/cjs/domain/record/serialization/serializeAttribute.js.map +1 -1
- package/cjs/domain/record/serialization/serializeAttributes.d.ts +2 -2
- package/cjs/domain/record/serialization/serializeAttributes.js +100 -152
- package/cjs/domain/record/serialization/serializeAttributes.js.map +1 -1
- package/cjs/domain/record/serialization/serializeFullSnapshot.d.ts +5 -0
- package/cjs/domain/record/serialization/serializeFullSnapshot.js +14 -0
- package/cjs/domain/record/serialization/serializeFullSnapshot.js.map +1 -0
- package/cjs/domain/record/serialization/serializeMutations.d.ts +5 -0
- package/cjs/domain/record/serialization/serializeMutations.js +152 -0
- package/cjs/domain/record/serialization/serializeMutations.js.map +1 -0
- package/cjs/domain/record/serialization/serializeNode.d.ts +3 -6
- package/cjs/domain/record/serialization/serializeNode.js +116 -144
- package/cjs/domain/record/serialization/serializeNode.js.map +1 -1
- package/cjs/domain/record/shadowRootsController.d.ts +2 -2
- package/cjs/domain/record/shadowRootsController.js +37 -42
- package/cjs/domain/record/shadowRootsController.js.map +1 -1
- package/cjs/domain/record/startFullSnapshots.d.ts +1 -1
- package/cjs/domain/record/startFullSnapshots.js +38 -54
- package/cjs/domain/record/startFullSnapshots.js.map +1 -1
- package/cjs/domain/record/trackers/index.d.ts +2 -1
- package/cjs/domain/record/trackers/index.js +25 -27
- package/cjs/domain/record/trackers/trackCanvasCapture.d.ts +3 -0
- package/cjs/domain/record/trackers/trackCanvasCapture.js +102 -0
- package/cjs/domain/record/trackers/trackCanvasCapture.js.map +1 -0
- package/cjs/domain/record/trackers/trackCanvasContent.d.ts +3 -0
- package/cjs/domain/record/trackers/trackCanvasContent.js +31 -0
- package/cjs/domain/record/trackers/trackCanvasContent.js.map +1 -0
- package/cjs/domain/record/trackers/trackFocus.d.ts +1 -2
- package/cjs/domain/record/trackers/trackFocus.js +15 -13
- package/cjs/domain/record/trackers/trackFocus.js.map +1 -1
- package/cjs/domain/record/trackers/trackInput.d.ts +2 -2
- package/cjs/domain/record/trackers/trackInput.js +129 -102
- package/cjs/domain/record/trackers/trackInput.js.map +1 -1
- package/cjs/domain/record/trackers/trackMediaInteraction.js +22 -26
- package/cjs/domain/record/trackers/trackMediaInteraction.js.map +1 -1
- package/cjs/domain/record/trackers/trackMouseInteraction.js +47 -54
- package/cjs/domain/record/trackers/trackMouseInteraction.js.map +1 -1
- package/cjs/domain/record/trackers/trackMove.js +43 -49
- package/cjs/domain/record/trackers/trackMove.js.map +1 -1
- package/cjs/domain/record/trackers/trackMutation.d.ts +3 -3
- package/cjs/domain/record/trackers/trackMutation.js +42 -267
- package/cjs/domain/record/trackers/trackMutation.js.map +1 -1
- package/cjs/domain/record/trackers/trackScroll.js +36 -44
- package/cjs/domain/record/trackers/trackScroll.js.map +1 -1
- package/cjs/domain/record/trackers/trackStyleSheet.js +75 -84
- package/cjs/domain/record/trackers/trackStyleSheet.js.map +1 -1
- package/cjs/domain/record/trackers/trackViewEnd.js +17 -17
- package/cjs/domain/record/trackers/trackViewEnd.js.map +1 -1
- package/cjs/domain/record/trackers/trackViewportResize.d.ts +2 -3
- package/cjs/domain/record/trackers/trackViewportResize.js +36 -42
- package/cjs/domain/record/trackers/trackViewportResize.js.map +1 -1
- package/cjs/domain/record/viewports.js +32 -50
- package/cjs/domain/record/viewports.js.map +1 -1
- package/cjs/domain/replayStats.d.ts +1 -0
- package/cjs/domain/replayStats.js +36 -44
- package/cjs/domain/replayStats.js.map +1 -1
- package/cjs/domain/scriptLoadingError.js +15 -22
- package/cjs/domain/scriptLoadingError.js.map +1 -1
- package/cjs/domain/segmentCollection/buildReplayPayload.js +22 -23
- package/cjs/domain/segmentCollection/buildReplayPayload.js.map +1 -1
- package/cjs/domain/segmentCollection/buildResourcePayload.d.ts +5 -0
- package/cjs/domain/segmentCollection/buildResourcePayload.js +19 -0
- package/cjs/domain/segmentCollection/buildResourcePayload.js.map +1 -0
- package/cjs/domain/segmentCollection/index.d.ts +3 -0
- package/cjs/domain/segmentCollection/index.js +14 -11
- package/cjs/domain/segmentCollection/replayResourceCollection.d.ts +10 -0
- package/cjs/domain/segmentCollection/replayResourceCollection.js +52 -0
- package/cjs/domain/segmentCollection/replayResourceCollection.js.map +1 -0
- package/cjs/domain/segmentCollection/segment.js +50 -80
- package/cjs/domain/segmentCollection/segment.js.map +1 -1
- package/cjs/domain/segmentCollection/segmentCollection.d.ts +4 -4
- package/cjs/domain/segmentCollection/segmentCollection.js +87 -105
- package/cjs/domain/segmentCollection/segmentCollection.js.map +1 -1
- package/cjs/domain/segmentCollection/startDroppedSegmentRecovery.d.ts +16 -0
- package/cjs/domain/segmentCollection/startDroppedSegmentRecovery.js +29 -0
- package/cjs/domain/segmentCollection/startDroppedSegmentRecovery.js.map +1 -0
- package/cjs/domain/segmentCollection/startSegmentTelemetry.js +40 -42
- package/cjs/domain/segmentCollection/startSegmentTelemetry.js.map +1 -1
- package/cjs/domain/startRecordBridge.js +10 -14
- package/cjs/domain/startRecordBridge.js.map +1 -1
- package/cjs/domain/startRecorderInitTelemetry.js +42 -50
- package/cjs/domain/startRecorderInitTelemetry.js.map +1 -1
- package/cjs/entries/internal.d.ts +11 -2
- package/cjs/entries/internal.js +47 -28
- package/cjs/entries/internalSynthetics.js +26 -24
- package/cjs/entries/internalSynthetics.js.map +1 -1
- package/cjs/entries/main.d.ts +5 -3
- package/cjs/entries/main.js +50 -31
- package/cjs/entries/main.js.map +1 -1
- package/cjs/types/index.d.ts +1 -0
- package/cjs/types/profiling.d.ts +313 -0
- package/cjs/types/sessionReplay.d.ts +381 -3
- package/cjs/types/sessionReplayConstants.d.ts +57 -0
- package/cjs/types/sessionReplayConstants.js +104 -47
- package/cjs/types/sessionReplayConstants.js.map +1 -1
- package/esm/boot/kubesenseRecorder.mjs +75 -0
- package/esm/boot/kubesenseRecorder.mjs.map +1 -0
- package/esm/boot/lazyLoadProfiler.mjs +24 -0
- package/esm/boot/lazyLoadProfiler.mjs.map +1 -0
- package/esm/boot/lazyLoadRecorder.mjs +24 -0
- package/esm/boot/lazyLoadRecorder.mjs.map +1 -0
- package/esm/boot/postStartStrategy.mjs +97 -0
- package/esm/boot/postStartStrategy.mjs.map +1 -0
- package/esm/boot/preStartStrategy.mjs +24 -0
- package/esm/boot/preStartStrategy.mjs.map +1 -0
- package/esm/boot/profilerApi.mjs +47 -0
- package/esm/boot/profilerApi.mjs.map +1 -0
- package/esm/boot/recorderApi.mjs +43 -0
- package/esm/boot/recorderApi.mjs.map +1 -0
- package/esm/domain/deflate/deflateEncoder.mjs +96 -0
- package/esm/domain/deflate/deflateEncoder.mjs.map +1 -0
- package/esm/domain/deflate/deflateWorker.mjs +90 -0
- package/esm/domain/deflate/deflateWorker.mjs.map +1 -0
- package/esm/domain/deflate/index.mjs +3 -0
- package/esm/domain/getSessionReplayLink.mjs +21 -0
- package/esm/domain/getSessionReplayLink.mjs.map +1 -0
- package/esm/domain/profiling/actionHistory.mjs +36 -0
- package/esm/domain/profiling/actionHistory.mjs.map +1 -0
- package/esm/domain/profiling/kubesenseProfiler.mjs +242 -0
- package/esm/domain/profiling/kubesenseProfiler.mjs.map +1 -0
- package/esm/domain/profiling/longTaskHistory.mjs +21 -0
- package/esm/domain/profiling/longTaskHistory.mjs.map +1 -0
- package/esm/domain/profiling/profilerDebugIds.mjs +18 -0
- package/esm/domain/profiling/profilerDebugIds.mjs.map +1 -0
- package/esm/domain/profiling/profilingContext.mjs +23 -0
- package/esm/domain/profiling/profilingContext.mjs.map +1 -0
- package/esm/domain/profiling/profilingSupported.mjs +9 -0
- package/esm/domain/profiling/profilingSupported.mjs.map +1 -0
- package/esm/domain/profiling/quotaCheck.mjs +66 -0
- package/esm/domain/profiling/quotaCheck.mjs.map +1 -0
- package/esm/domain/profiling/transport/buildProfileEvent.mjs +90 -0
- package/esm/domain/profiling/transport/buildProfileEvent.mjs.map +1 -0
- package/esm/domain/profiling/transport/formDataEmitter.mjs +17 -0
- package/esm/domain/profiling/transport/formDataEmitter.mjs.map +1 -0
- package/esm/domain/profiling/transport/profilingBridge.mjs +12 -0
- package/esm/domain/profiling/transport/profilingBridge.mjs.map +1 -0
- package/esm/domain/profiling/utils/getCustomOrDefaultViewName.mjs +7 -0
- package/esm/domain/profiling/utils/getCustomOrDefaultViewName.mjs.map +1 -0
- package/esm/domain/profiling/utils/getDefaultViewName.mjs +10 -0
- package/esm/domain/profiling/utils/getDefaultViewName.mjs.map +1 -0
- package/esm/domain/profiling/vitalHistory.mjs +55 -0
- package/esm/domain/profiling/vitalHistory.mjs.map +1 -0
- package/esm/domain/record/assembly.mjs +17 -0
- package/esm/domain/record/assembly.mjs.map +1 -0
- package/esm/domain/record/canvas/canvasHash.mjs +33 -0
- package/esm/domain/record/canvas/canvasHash.mjs.map +1 -0
- package/esm/domain/record/canvas/canvasManager.mjs +99 -0
- package/esm/domain/record/canvas/canvasManager.mjs.map +1 -0
- package/esm/domain/record/canvas/canvasSnapshot.mjs +38 -0
- package/esm/domain/record/canvas/canvasSnapshot.mjs.map +1 -0
- package/esm/domain/record/canvas/canvasUtils.mjs +13 -0
- package/esm/domain/record/canvas/canvasUtils.mjs.map +1 -0
- package/esm/domain/record/elementsScrollPositions.mjs +20 -0
- package/esm/domain/record/elementsScrollPositions.mjs.map +1 -0
- package/esm/domain/record/encoding/changeDecoder.mjs +152 -0
- package/esm/domain/record/encoding/changeDecoder.mjs.map +1 -0
- package/esm/domain/record/encoding/changeEncoder.mjs +146 -0
- package/esm/domain/record/encoding/changeEncoder.mjs.map +1 -0
- package/esm/domain/record/encoding/itemIds.mjs +47 -0
- package/esm/domain/record/encoding/itemIds.mjs.map +1 -0
- package/esm/domain/record/encoding/roles.mjs +64 -0
- package/esm/domain/record/encoding/roles.mjs.map +1 -0
- package/esm/domain/record/encoding/stringIds.mjs +47 -0
- package/esm/domain/record/encoding/stringIds.mjs.map +1 -0
- package/esm/domain/record/encoding/stringTable.mjs +38 -0
- package/esm/domain/record/encoding/stringTable.mjs.map +1 -0
- package/esm/domain/record/eventsUtils.mjs +13 -0
- package/esm/domain/record/eventsUtils.mjs.map +1 -0
- package/esm/domain/record/index.mjs +8 -0
- package/esm/domain/record/internalApi.mjs +62 -0
- package/esm/domain/record/internalApi.mjs.map +1 -0
- package/esm/domain/record/mutationBatch.mjs +43 -0
- package/esm/domain/record/mutationBatch.mjs.map +1 -0
- package/esm/domain/record/record.mjs +79 -0
- package/esm/domain/record/record.mjs.map +1 -0
- package/esm/domain/record/recordingScope.mjs +27 -0
- package/esm/domain/record/recordingScope.mjs.map +1 -0
- package/esm/domain/record/serialization/index.mjs +9 -0
- package/esm/domain/record/serialization/insertionCursor.mjs +54 -0
- package/esm/domain/record/serialization/insertionCursor.mjs.map +1 -0
- package/esm/domain/record/serialization/serializationStats.mjs +31 -0
- package/esm/domain/record/serialization/serializationStats.mjs.map +1 -0
- package/esm/domain/record/serialization/serializationTransaction.mjs +92 -0
- package/esm/domain/record/serialization/serializationTransaction.mjs.map +1 -0
- package/esm/domain/record/serialization/serializationUtils.mjs +53 -0
- package/esm/domain/record/serialization/serializationUtils.mjs.map +1 -0
- package/esm/domain/record/serialization/serializeAttribute.mjs +26 -0
- package/esm/domain/record/serialization/serializeAttribute.mjs.map +1 -0
- package/esm/domain/record/serialization/serializeAttributes.mjs +113 -0
- package/esm/domain/record/serialization/serializeAttributes.mjs.map +1 -0
- package/esm/domain/record/serialization/serializeFullSnapshot.mjs +14 -0
- package/esm/domain/record/serialization/serializeFullSnapshot.mjs.map +1 -0
- package/esm/domain/record/serialization/serializeMutations.mjs +152 -0
- package/esm/domain/record/serialization/serializeMutations.mjs.map +1 -0
- package/esm/domain/record/serialization/serializeNode.mjs +126 -0
- package/esm/domain/record/serialization/serializeNode.mjs.map +1 -0
- package/esm/domain/record/shadowRootsController.mjs +40 -0
- package/esm/domain/record/shadowRootsController.mjs.map +1 -0
- package/esm/domain/record/startFullSnapshots.mjs +42 -0
- package/esm/domain/record/startFullSnapshots.mjs.map +1 -0
- package/esm/domain/record/trackers/index.mjs +13 -0
- package/esm/domain/record/trackers/trackCanvasCapture.mjs +102 -0
- package/esm/domain/record/trackers/trackCanvasCapture.mjs.map +1 -0
- package/esm/domain/record/trackers/trackCanvasContent.mjs +31 -0
- package/esm/domain/record/trackers/trackCanvasContent.mjs.map +1 -0
- package/esm/domain/record/trackers/trackFocus.mjs +17 -0
- package/esm/domain/record/trackers/trackFocus.mjs.map +1 -0
- package/esm/domain/record/trackers/trackInput.mjs +131 -0
- package/esm/domain/record/trackers/trackInput.mjs.map +1 -0
- package/esm/domain/record/trackers/trackMediaInteraction.mjs +25 -0
- package/esm/domain/record/trackers/trackMediaInteraction.mjs.map +1 -0
- package/esm/domain/record/trackers/trackMouseInteraction.mjs +52 -0
- package/esm/domain/record/trackers/trackMouseInteraction.mjs.map +1 -0
- package/esm/domain/record/trackers/trackMove.mjs +48 -0
- package/esm/domain/record/trackers/trackMove.mjs.map +1 -0
- package/esm/domain/record/trackers/trackMutation.mjs +45 -0
- package/esm/domain/record/trackers/trackMutation.mjs.map +1 -0
- package/esm/domain/record/trackers/trackScroll.mjs +40 -0
- package/esm/domain/record/trackers/trackScroll.mjs.map +1 -0
- package/esm/domain/record/trackers/trackStyleSheet.mjs +79 -0
- package/esm/domain/record/trackers/trackStyleSheet.mjs.map +1 -0
- package/esm/domain/record/trackers/trackViewEnd.mjs +20 -0
- package/esm/domain/record/trackers/trackViewEnd.mjs.map +1 -0
- package/esm/domain/record/trackers/trackViewportResize.mjs +39 -0
- package/esm/domain/record/trackers/trackViewportResize.mjs.map +1 -0
- package/esm/domain/record/viewports.mjs +41 -0
- package/esm/domain/record/viewports.mjs.map +1 -0
- package/esm/domain/replayStats.mjs +46 -0
- package/esm/domain/replayStats.mjs.map +1 -0
- package/esm/domain/scriptLoadingError.mjs +19 -0
- package/esm/domain/scriptLoadingError.mjs.map +1 -0
- package/esm/domain/segmentCollection/buildReplayPayload.mjs +25 -0
- package/esm/domain/segmentCollection/buildReplayPayload.mjs.map +1 -0
- package/esm/domain/segmentCollection/buildResourcePayload.mjs +19 -0
- package/esm/domain/segmentCollection/buildResourcePayload.mjs.map +1 -0
- package/esm/domain/segmentCollection/index.mjs +5 -0
- package/esm/domain/segmentCollection/replayResourceCollection.mjs +52 -0
- package/esm/domain/segmentCollection/replayResourceCollection.mjs.map +1 -0
- package/esm/domain/segmentCollection/segment.mjs +52 -0
- package/esm/domain/segmentCollection/segment.mjs.map +1 -0
- package/esm/domain/segmentCollection/segmentCollection.mjs +87 -0
- package/esm/domain/segmentCollection/segmentCollection.mjs.map +1 -0
- package/esm/domain/segmentCollection/startDroppedSegmentRecovery.mjs +28 -0
- package/esm/domain/segmentCollection/startDroppedSegmentRecovery.mjs.map +1 -0
- package/esm/domain/segmentCollection/startSegmentTelemetry.mjs +45 -0
- package/esm/domain/segmentCollection/startSegmentTelemetry.mjs.map +1 -0
- package/esm/domain/startRecordBridge.mjs +13 -0
- package/esm/domain/startRecordBridge.mjs.map +1 -0
- package/esm/domain/startRecorderInitTelemetry.mjs +47 -0
- package/esm/domain/startRecorderInitTelemetry.mjs.map +1 -0
- package/esm/entries/internal.mjs +8 -0
- package/esm/entries/internalSynthetics.mjs +22 -0
- package/esm/entries/internalSynthetics.mjs.map +1 -0
- package/esm/entries/main.mjs +35 -0
- package/esm/entries/main.mjs.map +1 -0
- package/esm/types/sessionReplayConstants.mjs +97 -0
- package/esm/types/sessionReplayConstants.mjs.map +1 -0
- package/internal/package.json +1 -1
- package/internal-synthetics/package.json +1 -1
- package/package.json +26 -15
- package/src/boot/kubesenseRecorder.ts +134 -0
- package/src/boot/lazyLoadProfiler.ts +6 -7
- package/src/boot/lazyLoadRecorder.ts +6 -7
- package/src/boot/postStartStrategy.ts +18 -16
- package/src/boot/profilerApi.ts +29 -19
- package/src/boot/recorderApi.ts +6 -21
- package/src/domain/deflate/deflateEncoder.ts +3 -8
- package/src/domain/deflate/deflateWorker.ts +8 -13
- package/src/domain/deflate/index.ts +1 -0
- package/src/domain/getSessionReplayLink.ts +15 -11
- package/src/domain/profiling/actionHistory.ts +66 -0
- package/src/domain/profiling/{profiler.ts → kubesenseProfiler.ts} +166 -79
- package/src/domain/profiling/longTaskHistory.ts +45 -0
- package/src/domain/profiling/profilerDebugIds.ts +17 -0
- package/src/domain/profiling/profilingContext.ts +8 -3
- package/src/domain/profiling/profilingSupported.ts +2 -7
- package/src/domain/profiling/quotaCheck.ts +89 -0
- package/src/domain/profiling/test-utils/mockedTrace.ts +1 -2
- package/src/domain/profiling/transport/buildProfileEvent.ts +143 -0
- package/src/domain/profiling/transport/formDataEmitter.ts +17 -0
- package/src/domain/profiling/transport/profilingBridge.ts +9 -0
- package/src/domain/profiling/{types/rumProfiler.types.ts → types.ts} +14 -26
- package/src/domain/profiling/vitalHistory.ts +106 -0
- package/src/domain/record/assembly.ts +5 -3
- package/src/domain/record/canvas/canvasHash.ts +54 -0
- package/src/domain/record/canvas/canvasManager.ts +175 -0
- package/src/domain/record/canvas/canvasSnapshot.ts +52 -0
- package/src/domain/record/canvas/canvasUtils.ts +11 -0
- package/src/domain/record/encoding/changeDecoder.ts +287 -0
- package/src/domain/record/encoding/changeEncoder.ts +327 -0
- package/src/domain/record/encoding/index.ts +19 -0
- package/src/domain/record/encoding/itemIds.ts +84 -0
- package/src/domain/record/encoding/roles.ts +136 -0
- package/src/domain/record/encoding/stringIds.ts +70 -0
- package/src/domain/record/encoding/stringTable.ts +68 -0
- package/src/domain/record/index.ts +5 -2
- package/src/domain/record/internalApi.ts +21 -18
- package/src/domain/record/mutationBatch.ts +14 -3
- package/src/domain/record/record.ts +35 -16
- package/src/domain/record/record.types.ts +1 -0
- package/src/domain/record/recordingScope.ts +28 -5
- package/src/domain/record/serialization/index.ts +4 -2
- package/src/domain/record/serialization/insertionCursor.ts +131 -0
- package/src/domain/record/serialization/serialization.types.ts +0 -16
- package/src/domain/record/serialization/serializationTransaction.ts +191 -37
- package/src/domain/record/serialization/serializationUtils.ts +1 -15
- package/src/domain/record/serialization/serializeAttributes.ts +36 -32
- package/src/domain/record/serialization/serializeFullSnapshot.ts +26 -0
- package/src/domain/record/serialization/serializeMutations.ts +357 -0
- package/src/domain/record/serialization/serializeNode.ts +200 -164
- package/src/domain/record/shadowRootsController.ts +4 -3
- package/src/domain/record/startFullSnapshots.ts +28 -41
- package/src/domain/record/trackers/index.ts +2 -1
- package/src/domain/record/trackers/trackCanvasCapture.ts +137 -0
- package/src/domain/record/trackers/trackCanvasContent.ts +46 -0
- package/src/domain/record/trackers/trackFocus.ts +4 -4
- package/src/domain/record/trackers/trackInput.ts +146 -41
- package/src/domain/record/trackers/trackMediaInteraction.ts +0 -1
- package/src/domain/record/trackers/trackMouseInteraction.ts +1 -2
- package/src/domain/record/trackers/trackMove.ts +0 -1
- package/src/domain/record/trackers/trackMutation.ts +17 -355
- package/src/domain/record/trackers/trackScroll.ts +1 -1
- package/src/domain/record/trackers/trackStyleSheet.ts +1 -1
- package/src/domain/record/trackers/trackViewEnd.ts +1 -1
- package/src/domain/record/trackers/trackViewportResize.ts +7 -16
- package/src/domain/record/trackers/tracker.types.ts +1 -1
- package/src/domain/replayStats.ts +5 -0
- package/src/domain/scriptLoadingError.ts +2 -1
- package/src/domain/segmentCollection/buildResourcePayload.ts +20 -0
- package/src/domain/segmentCollection/index.ts +3 -0
- package/src/domain/segmentCollection/replayResourceCollection.ts +79 -0
- package/src/domain/segmentCollection/segment.ts +2 -1
- package/src/domain/segmentCollection/segmentCollection.ts +14 -13
- package/src/domain/segmentCollection/startDroppedSegmentRecovery.ts +37 -0
- package/src/domain/segmentCollection/startSegmentTelemetry.ts +16 -2
- package/src/domain/startRecorderInitTelemetry.ts +5 -3
- package/src/entries/internal.ts +13 -2
- package/src/entries/internalSynthetics.ts +3 -4
- package/src/entries/main.ts +23 -14
- package/src/types/index.ts +1 -0
- package/src/types/profiling.ts +315 -0
- package/src/types/sessionReplay.ts +395 -3
- package/src/types/sessionReplayConstants.ts +109 -0
- package/bundle/chunks/profiler-6f621c66a29d9f39a9bd-kubesense-rum.js +0 -1
- package/bundle/chunks/recorder-c73b8d42b98d4a01f120-kubesense-rum.js +0 -1
- package/cjs/boot/isBrowserSupported.d.ts +0 -4
- package/cjs/boot/isBrowserSupported.js +0 -17
- package/cjs/boot/isBrowserSupported.js.map +0 -1
- package/cjs/boot/startRecording.d.ts +0 -6
- package/cjs/boot/startRecording.js +0 -45
- package/cjs/boot/startRecording.js.map +0 -1
- package/cjs/domain/deflate/index.js.map +0 -1
- package/cjs/domain/profiling/profiler.d.ts +0 -7
- package/cjs/domain/profiling/profiler.js +0 -244
- package/cjs/domain/profiling/profiler.js.map +0 -1
- package/cjs/domain/profiling/test-utils/mockedTrace.js +0 -57
- package/cjs/domain/profiling/test-utils/mockedTrace.js.map +0 -1
- package/cjs/domain/profiling/transport/assembly.d.ts +0 -21
- package/cjs/domain/profiling/transport/assembly.js +0 -45
- package/cjs/domain/profiling/transport/assembly.js.map +0 -1
- package/cjs/domain/profiling/transport/buildProfileEventAttributes.d.ts +0 -25
- package/cjs/domain/profiling/transport/buildProfileEventAttributes.js +0 -50
- package/cjs/domain/profiling/transport/buildProfileEventAttributes.js.map +0 -1
- package/cjs/domain/profiling/types/index.d.ts +0 -2
- package/cjs/domain/profiling/types/index.js +0 -3
- package/cjs/domain/profiling/types/index.js.map +0 -1
- package/cjs/domain/profiling/types/profilerApi.types.d.ts +0 -58
- package/cjs/domain/profiling/types/profilerApi.types.js +0 -5
- package/cjs/domain/profiling/types/profilerApi.types.js.map +0 -1
- package/cjs/domain/profiling/types/rumProfiler.types.js +0 -3
- package/cjs/domain/profiling/types/rumProfiler.types.js.map +0 -1
- package/cjs/domain/profiling/utils/getNumberOfSamples.d.ts +0 -7
- package/cjs/domain/profiling/utils/getNumberOfSamples.js +0 -18
- package/cjs/domain/profiling/utils/getNumberOfSamples.js.map +0 -1
- package/cjs/domain/record/eventIds.d.ts +0 -4
- package/cjs/domain/record/eventIds.js +0 -16
- package/cjs/domain/record/eventIds.js.map +0 -1
- package/cjs/domain/record/index.js.map +0 -1
- package/cjs/domain/record/nodeIds.d.ts +0 -15
- package/cjs/domain/record/nodeIds.js +0 -32
- package/cjs/domain/record/nodeIds.js.map +0 -1
- package/cjs/domain/record/record.types.js +0 -3
- package/cjs/domain/record/record.types.js.map +0 -1
- package/cjs/domain/record/serialization/index.js.map +0 -1
- package/cjs/domain/record/serialization/serialization.types.js +0 -3
- package/cjs/domain/record/serialization/serialization.types.js.map +0 -1
- package/cjs/domain/record/serialization/serializeDocument.d.ts +0 -3
- package/cjs/domain/record/serialization/serializeDocument.js +0 -11
- package/cjs/domain/record/serialization/serializeDocument.js.map +0 -1
- package/cjs/domain/record/serialization/serializeStyleSheets.d.ts +0 -2
- package/cjs/domain/record/serialization/serializeStyleSheets.js +0 -19
- package/cjs/domain/record/serialization/serializeStyleSheets.js.map +0 -1
- package/cjs/domain/record/trackers/index.js.map +0 -1
- package/cjs/domain/record/trackers/trackFrustration.d.ts +0 -7
- package/cjs/domain/record/trackers/trackFrustration.js +0 -31
- package/cjs/domain/record/trackers/trackFrustration.js.map +0 -1
- package/cjs/domain/record/trackers/tracker.types.js +0 -3
- package/cjs/domain/record/trackers/tracker.types.js.map +0 -1
- package/cjs/domain/segmentCollection/index.js.map +0 -1
- package/cjs/entries/internal.js.map +0 -1
- package/cjs/types/index.js +0 -18
- package/cjs/types/index.js.map +0 -1
- package/cjs/types/sessionReplay.js +0 -7
- package/cjs/types/sessionReplay.js.map +0 -1
- package/esm/boot/isBrowserSupported.d.ts +0 -4
- package/esm/boot/isBrowserSupported.js +0 -14
- package/esm/boot/isBrowserSupported.js.map +0 -1
- package/esm/boot/lazyLoadProfiler.d.ts +0 -4
- package/esm/boot/lazyLoadProfiler.js +0 -18
- package/esm/boot/lazyLoadProfiler.js.map +0 -1
- package/esm/boot/lazyLoadRecorder.d.ts +0 -4
- package/esm/boot/lazyLoadRecorder.js +0 -18
- package/esm/boot/lazyLoadRecorder.js.map +0 -1
- package/esm/boot/postStartStrategy.d.ts +0 -33
- package/esm/boot/postStartStrategy.js +0 -115
- package/esm/boot/postStartStrategy.js.map +0 -1
- package/esm/boot/preStartStrategy.d.ts +0 -6
- package/esm/boot/preStartStrategy.js +0 -21
- package/esm/boot/preStartStrategy.js.map +0 -1
- package/esm/boot/profilerApi.d.ts +0 -2
- package/esm/boot/profilerApi.js +0 -50
- package/esm/boot/profilerApi.js.map +0 -1
- package/esm/boot/recorderApi.d.ts +0 -4
- package/esm/boot/recorderApi.js +0 -70
- package/esm/boot/recorderApi.js.map +0 -1
- package/esm/boot/startRecording.d.ts +0 -6
- package/esm/boot/startRecording.js +0 -42
- package/esm/boot/startRecording.js.map +0 -1
- package/esm/domain/deflate/deflateEncoder.d.ts +0 -3
- package/esm/domain/deflate/deflateEncoder.js +0 -107
- package/esm/domain/deflate/deflateEncoder.js.map +0 -1
- package/esm/domain/deflate/deflateWorker.d.ts +0 -30
- package/esm/domain/deflate/deflateWorker.js +0 -97
- package/esm/domain/deflate/deflateWorker.js.map +0 -1
- package/esm/domain/deflate/index.d.ts +0 -3
- package/esm/domain/deflate/index.js +0 -3
- package/esm/domain/deflate/index.js.map +0 -1
- package/esm/domain/getSessionReplayLink.d.ts +0 -2
- package/esm/domain/getSessionReplayLink.js +0 -32
- package/esm/domain/getSessionReplayLink.js.map +0 -1
- package/esm/domain/profiling/profiler.d.ts +0 -7
- package/esm/domain/profiling/profiler.js +0 -240
- package/esm/domain/profiling/profiler.js.map +0 -1
- package/esm/domain/profiling/profilingContext.d.ts +0 -6
- package/esm/domain/profiling/profilingContext.js +0 -25
- package/esm/domain/profiling/profilingContext.js.map +0 -1
- package/esm/domain/profiling/profilingSupported.d.ts +0 -1
- package/esm/domain/profiling/profilingSupported.js +0 -8
- package/esm/domain/profiling/profilingSupported.js.map +0 -1
- package/esm/domain/profiling/test-utils/mockedTrace.d.ts +0 -3
- package/esm/domain/profiling/test-utils/mockedTrace.js +0 -54
- package/esm/domain/profiling/test-utils/mockedTrace.js.map +0 -1
- package/esm/domain/profiling/transport/assembly.d.ts +0 -21
- package/esm/domain/profiling/transport/assembly.js +0 -42
- package/esm/domain/profiling/transport/assembly.js.map +0 -1
- package/esm/domain/profiling/transport/buildProfileEventAttributes.d.ts +0 -25
- package/esm/domain/profiling/transport/buildProfileEventAttributes.js +0 -47
- package/esm/domain/profiling/transport/buildProfileEventAttributes.js.map +0 -1
- package/esm/domain/profiling/types/index.d.ts +0 -2
- package/esm/domain/profiling/types/index.js +0 -2
- package/esm/domain/profiling/types/index.js.map +0 -1
- package/esm/domain/profiling/types/profilerApi.types.d.ts +0 -58
- package/esm/domain/profiling/types/profilerApi.types.js +0 -4
- package/esm/domain/profiling/types/profilerApi.types.js.map +0 -1
- package/esm/domain/profiling/types/rumProfiler.types.d.ts +0 -72
- package/esm/domain/profiling/types/rumProfiler.types.js +0 -2
- package/esm/domain/profiling/types/rumProfiler.types.js.map +0 -1
- package/esm/domain/profiling/utils/getCustomOrDefaultViewName.d.ts +0 -1
- package/esm/domain/profiling/utils/getCustomOrDefaultViewName.js +0 -3
- package/esm/domain/profiling/utils/getCustomOrDefaultViewName.js.map +0 -1
- package/esm/domain/profiling/utils/getDefaultViewName.d.ts +0 -1
- package/esm/domain/profiling/utils/getDefaultViewName.js +0 -11
- package/esm/domain/profiling/utils/getDefaultViewName.js.map +0 -1
- package/esm/domain/profiling/utils/getNumberOfSamples.d.ts +0 -7
- package/esm/domain/profiling/utils/getNumberOfSamples.js +0 -15
- package/esm/domain/profiling/utils/getNumberOfSamples.js.map +0 -1
- package/esm/domain/record/assembly.d.ts +0 -2
- package/esm/domain/record/assembly.js +0 -13
- package/esm/domain/record/assembly.js.map +0 -1
- package/esm/domain/record/elementsScrollPositions.d.ts +0 -10
- package/esm/domain/record/elementsScrollPositions.js +0 -20
- package/esm/domain/record/elementsScrollPositions.js.map +0 -1
- package/esm/domain/record/eventIds.d.ts +0 -4
- package/esm/domain/record/eventIds.js +0 -13
- package/esm/domain/record/eventIds.js.map +0 -1
- package/esm/domain/record/eventsUtils.d.ts +0 -2
- package/esm/domain/record/eventsUtils.js +0 -11
- package/esm/domain/record/eventsUtils.js.map +0 -1
- package/esm/domain/record/index.d.ts +0 -7
- package/esm/domain/record/index.js +0 -6
- package/esm/domain/record/index.js.map +0 -1
- package/esm/domain/record/internalApi.d.ts +0 -22
- package/esm/domain/record/internalApi.js +0 -53
- package/esm/domain/record/internalApi.js.map +0 -1
- package/esm/domain/record/mutationBatch.d.ts +0 -12
- package/esm/domain/record/mutationBatch.js +0 -40
- package/esm/domain/record/mutationBatch.js.map +0 -1
- package/esm/domain/record/nodeIds.d.ts +0 -15
- package/esm/domain/record/nodeIds.js +0 -29
- package/esm/domain/record/nodeIds.js.map +0 -1
- package/esm/domain/record/record.d.ts +0 -16
- package/esm/domain/record/record.js +0 -54
- package/esm/domain/record/record.js.map +0 -1
- package/esm/domain/record/record.types.d.ts +0 -4
- package/esm/domain/record/record.types.js +0 -2
- package/esm/domain/record/record.types.js.map +0 -1
- package/esm/domain/record/recordingScope.d.ts +0 -19
- package/esm/domain/record/recordingScope.js +0 -10
- package/esm/domain/record/recordingScope.js.map +0 -1
- package/esm/domain/record/serialization/index.d.ts +0 -8
- package/esm/domain/record/serialization/index.js +0 -7
- package/esm/domain/record/serialization/index.js.map +0 -1
- package/esm/domain/record/serialization/serialization.types.d.ts +0 -28
- package/esm/domain/record/serialization/serialization.types.js +0 -2
- package/esm/domain/record/serialization/serialization.types.js.map +0 -1
- package/esm/domain/record/serialization/serializationStats.d.ts +0 -12
- package/esm/domain/record/serialization/serializationStats.js +0 -27
- package/esm/domain/record/serialization/serializationStats.js.map +0 -1
- package/esm/domain/record/serialization/serializationTransaction.d.ts +0 -45
- package/esm/domain/record/serialization/serializationTransaction.js +0 -35
- package/esm/domain/record/serialization/serializationTransaction.js.map +0 -1
- package/esm/domain/record/serialization/serializationUtils.d.ts +0 -18
- package/esm/domain/record/serialization/serializationUtils.js +0 -80
- package/esm/domain/record/serialization/serializationUtils.js.map +0 -1
- package/esm/domain/record/serialization/serializeAttribute.d.ts +0 -4
- package/esm/domain/record/serialization/serializeAttribute.js +0 -38
- package/esm/domain/record/serialization/serializeAttribute.js.map +0 -1
- package/esm/domain/record/serialization/serializeAttributes.d.ts +0 -7
- package/esm/domain/record/serialization/serializeAttributes.js +0 -161
- package/esm/domain/record/serialization/serializeAttributes.js.map +0 -1
- package/esm/domain/record/serialization/serializeDocument.d.ts +0 -3
- package/esm/domain/record/serialization/serializeDocument.js +0 -8
- package/esm/domain/record/serialization/serializeDocument.js.map +0 -1
- package/esm/domain/record/serialization/serializeNode.d.ts +0 -7
- package/esm/domain/record/serialization/serializeNode.js +0 -149
- package/esm/domain/record/serialization/serializeNode.js.map +0 -1
- package/esm/domain/record/serialization/serializeStyleSheets.d.ts +0 -2
- package/esm/domain/record/serialization/serializeStyleSheets.js +0 -16
- package/esm/domain/record/serialization/serializeStyleSheets.js.map +0 -1
- package/esm/domain/record/shadowRootsController.d.ts +0 -11
- package/esm/domain/record/shadowRootsController.js +0 -41
- package/esm/domain/record/shadowRootsController.js.map +0 -1
- package/esm/domain/record/startFullSnapshots.d.ts +0 -9
- package/esm/domain/record/startFullSnapshots.js +0 -55
- package/esm/domain/record/startFullSnapshots.js.map +0 -1
- package/esm/domain/record/trackers/index.d.ts +0 -12
- package/esm/domain/record/trackers/index.js +0 -12
- package/esm/domain/record/trackers/index.js.map +0 -1
- package/esm/domain/record/trackers/trackFocus.d.ts +0 -5
- package/esm/domain/record/trackers/trackFocus.js +0 -12
- package/esm/domain/record/trackers/trackFocus.js.map +0 -1
- package/esm/domain/record/trackers/trackFrustration.d.ts +0 -7
- package/esm/domain/record/trackers/trackFrustration.js +0 -28
- package/esm/domain/record/trackers/trackFrustration.js.map +0 -1
- package/esm/domain/record/trackers/trackInput.d.ts +0 -4
- package/esm/domain/record/trackers/trackInput.js +0 -101
- package/esm/domain/record/trackers/trackInput.js.map +0 -1
- package/esm/domain/record/trackers/trackMediaInteraction.d.ts +0 -5
- package/esm/domain/record/trackers/trackMediaInteraction.js +0 -26
- package/esm/domain/record/trackers/trackMediaInteraction.js.map +0 -1
- package/esm/domain/record/trackers/trackMouseInteraction.d.ts +0 -5
- package/esm/domain/record/trackers/trackMouseInteraction.js +0 -56
- package/esm/domain/record/trackers/trackMouseInteraction.js.map +0 -1
- package/esm/domain/record/trackers/trackMove.d.ts +0 -9
- package/esm/domain/record/trackers/trackMove.js +0 -51
- package/esm/domain/record/trackers/trackMove.js.map +0 -1
- package/esm/domain/record/trackers/trackMutation.d.ts +0 -11
- package/esm/domain/record/trackers/trackMutation.js +0 -266
- package/esm/domain/record/trackers/trackMutation.js.map +0 -1
- package/esm/domain/record/trackers/trackScroll.d.ts +0 -5
- package/esm/domain/record/trackers/trackScroll.js +0 -45
- package/esm/domain/record/trackers/trackScroll.js.map +0 -1
- package/esm/domain/record/trackers/trackStyleSheet.d.ts +0 -6
- package/esm/domain/record/trackers/trackStyleSheet.js +0 -85
- package/esm/domain/record/trackers/trackStyleSheet.js.map +0 -1
- package/esm/domain/record/trackers/trackViewEnd.d.ts +0 -5
- package/esm/domain/record/trackers/trackViewEnd.js +0 -17
- package/esm/domain/record/trackers/trackViewEnd.js.map +0 -1
- package/esm/domain/record/trackers/trackViewportResize.d.ts +0 -6
- package/esm/domain/record/trackers/trackViewportResize.js +0 -42
- package/esm/domain/record/trackers/trackViewportResize.js.map +0 -1
- package/esm/domain/record/trackers/tracker.types.d.ts +0 -3
- package/esm/domain/record/trackers/tracker.types.js +0 -2
- package/esm/domain/record/trackers/tracker.types.js.map +0 -1
- package/esm/domain/record/viewports.d.ts +0 -20
- package/esm/domain/record/viewports.js +0 -55
- package/esm/domain/record/viewports.js.map +0 -1
- package/esm/domain/replayStats.d.ts +0 -8
- package/esm/domain/replayStats.js +0 -51
- package/esm/domain/replayStats.js.map +0 -1
- package/esm/domain/scriptLoadingError.d.ts +0 -6
- package/esm/domain/scriptLoadingError.js +0 -23
- package/esm/domain/scriptLoadingError.js.map +0 -1
- package/esm/domain/segmentCollection/buildReplayPayload.d.ts +0 -15
- package/esm/domain/segmentCollection/buildReplayPayload.js +0 -23
- package/esm/domain/segmentCollection/buildReplayPayload.js.map +0 -1
- package/esm/domain/segmentCollection/index.d.ts +0 -4
- package/esm/domain/segmentCollection/index.js +0 -4
- package/esm/domain/segmentCollection/index.js.map +0 -1
- package/esm/domain/segmentCollection/segment.d.ts +0 -16
- package/esm/domain/segmentCollection/segment.js +0 -46
- package/esm/domain/segmentCollection/segment.js.map +0 -1
- package/esm/domain/segmentCollection/segmentCollection.d.ts +0 -31
- package/esm/domain/segmentCollection/segmentCollection.js +0 -106
- package/esm/domain/segmentCollection/segmentCollection.js.map +0 -1
- package/esm/domain/segmentCollection/startSegmentTelemetry.d.ts +0 -6
- package/esm/domain/segmentCollection/startSegmentTelemetry.js +0 -44
- package/esm/domain/segmentCollection/startSegmentTelemetry.js.map +0 -1
- package/esm/domain/startRecordBridge.d.ts +0 -5
- package/esm/domain/startRecordBridge.js +0 -14
- package/esm/domain/startRecordBridge.js.map +0 -1
- package/esm/domain/startRecorderInitTelemetry.d.ts +0 -15
- package/esm/domain/startRecorderInitTelemetry.js +0 -52
- package/esm/domain/startRecorderInitTelemetry.js.map +0 -1
- package/esm/entries/internal.d.ts +0 -11
- package/esm/entries/internal.js +0 -4
- package/esm/entries/internal.js.map +0 -1
- package/esm/entries/internalSynthetics.d.ts +0 -2
- package/esm/entries/internalSynthetics.js +0 -23
- package/esm/entries/internalSynthetics.js.map +0 -1
- package/esm/entries/main.d.ts +0 -23
- package/esm/entries/main.js +0 -31
- package/esm/entries/main.js.map +0 -1
- package/esm/types/index.d.ts +0 -2
- package/esm/types/index.js +0 -2
- package/esm/types/index.js.map +0 -1
- package/esm/types/sessionReplay.d.ts +0 -703
- package/esm/types/sessionReplay.js +0 -6
- package/esm/types/sessionReplay.js.map +0 -1
- package/esm/types/sessionReplayConstants.d.ts +0 -49
- package/esm/types/sessionReplayConstants.js +0 -46
- package/esm/types/sessionReplayConstants.js.map +0 -1
- package/src/boot/isBrowserSupported.ts +0 -14
- package/src/boot/startRecording.ts +0 -70
- package/src/domain/profiling/transport/assembly.ts +0 -78
- package/src/domain/profiling/transport/buildProfileEventAttributes.ts +0 -66
- package/src/domain/profiling/types/index.ts +0 -2
- package/src/domain/profiling/types/profilerApi.types.ts +0 -87
- package/src/domain/profiling/utils/getNumberOfSamples.ts +0 -16
- package/src/domain/record/eventIds.ts +0 -17
- package/src/domain/record/nodeIds.ts +0 -46
- package/src/domain/record/serialization/serializeDocument.ts +0 -13
- package/src/domain/record/serialization/serializeStyleSheets.ts +0 -18
- package/src/domain/record/trackers/trackFrustration.ts +0 -41
|
@@ -1,32 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createSerializationStats = createSerializationStats;
|
|
4
|
-
exports.updateSerializationStats = updateSerializationStats;
|
|
5
|
-
exports.aggregateSerializationStats = aggregateSerializationStats;
|
|
1
|
+
//#region src/domain/record/serialization/serializationStats.ts
|
|
6
2
|
function createSerializationStats() {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
3
|
+
return {
|
|
4
|
+
cssText: {
|
|
5
|
+
count: 0,
|
|
6
|
+
max: 0,
|
|
7
|
+
sum: 0
|
|
8
|
+
},
|
|
9
|
+
serializationDuration: {
|
|
10
|
+
count: 0,
|
|
11
|
+
max: 0,
|
|
12
|
+
sum: 0
|
|
13
|
+
}
|
|
14
|
+
};
|
|
19
15
|
}
|
|
20
16
|
function updateSerializationStats(stats, metric, value) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
stats[metric].count += 1;
|
|
18
|
+
stats[metric].max = Math.max(stats[metric].max, value);
|
|
19
|
+
stats[metric].sum += value;
|
|
24
20
|
}
|
|
25
21
|
function aggregateSerializationStats(aggregateStats, stats) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
22
|
+
for (const metric of ["cssText", "serializationDuration"]) {
|
|
23
|
+
aggregateStats[metric].count += stats[metric].count;
|
|
24
|
+
aggregateStats[metric].max = Math.max(aggregateStats[metric].max, stats[metric].max);
|
|
25
|
+
aggregateStats[metric].sum += stats[metric].sum;
|
|
26
|
+
}
|
|
31
27
|
}
|
|
28
|
+
//#endregion
|
|
29
|
+
exports.aggregateSerializationStats = aggregateSerializationStats;
|
|
30
|
+
exports.createSerializationStats = createSerializationStats;
|
|
31
|
+
exports.updateSerializationStats = updateSerializationStats;
|
|
32
|
+
|
|
32
33
|
//# sourceMappingURL=serializationStats.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializationStats.js","
|
|
1
|
+
{"version":3,"file":"serializationStats.js","names":[],"sources":["../../../../src/domain/record/serialization/serializationStats.ts"],"sourcesContent":["export interface SerializationMetric {\n count: number\n max: number\n sum: number\n}\n\nexport interface SerializationStats {\n cssText: SerializationMetric\n serializationDuration: SerializationMetric\n}\n\nexport function createSerializationStats(): SerializationStats {\n return {\n cssText: {\n count: 0,\n max: 0,\n sum: 0,\n },\n serializationDuration: {\n count: 0,\n max: 0,\n sum: 0,\n },\n }\n}\n\nexport function updateSerializationStats(\n stats: SerializationStats,\n metric: keyof SerializationStats,\n value: number\n): void {\n stats[metric].count += 1\n stats[metric].max = Math.max(stats[metric].max, value)\n stats[metric].sum += value\n}\n\nexport function aggregateSerializationStats(aggregateStats: SerializationStats, stats: SerializationStats) {\n for (const metric of ['cssText', 'serializationDuration'] as const) {\n aggregateStats[metric].count += stats[metric].count\n aggregateStats[metric].max = Math.max(aggregateStats[metric].max, stats[metric].max)\n aggregateStats[metric].sum += stats[metric].sum\n }\n}\n"],"mappings":";AAWA,SAAgB,2BAA+C;CAC7D,OAAO;EACL,SAAS;GACP,OAAO;GACP,KAAK;GACL,KAAK;EACP;EACA,uBAAuB;GACrB,OAAO;GACP,KAAK;GACL,KAAK;EACP;CACF;AACF;AAEA,SAAgB,yBACd,OACA,QACA,OACM;CACN,MAAM,OAAO,CAAC,SAAS;CACvB,MAAM,OAAO,CAAC,MAAM,KAAK,IAAI,MAAM,OAAO,CAAC,KAAK,KAAK;CACrD,MAAM,OAAO,CAAC,OAAO;AACvB;AAEA,SAAgB,4BAA4B,gBAAoC,OAA2B;CACzG,KAAK,MAAM,UAAU,CAAC,WAAW,uBAAuB,GAAY;EAClE,eAAe,OAAO,CAAC,SAAS,MAAM,OAAO,CAAC;EAC9C,eAAe,OAAO,CAAC,MAAM,KAAK,IAAI,eAAe,OAAO,CAAC,KAAK,MAAM,OAAO,CAAC,GAAG;EACnF,eAAe,OAAO,CAAC,OAAO,MAAM,OAAO,CAAC;CAC9C;AACF"}
|
|
@@ -1,45 +1,67 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { TimeStamp } from '@kubesense/kubesense-js-core/time';
|
|
2
|
+
import type { AddCDataSectionNodeChange, AddDocTypeNodeChange, AddDocumentFragmentNodeChange, AddDocumentNodeChange, AddElementNodeChange, AddShadowRootNodeChange, AddTextNodeChange, InputSelectionState, InsertionPoint, MediaInteractionType, RoleAnnotatedStringLiteral } from '../../../types';
|
|
3
|
+
import type { NodeId, RoleAnnotatedAddNodeName, RoleAnnotatedAddNodeParams, RoleAnnotatedAttributeChange, RoleAnnotatedStringLiteralValue, RoleAnnotatedStyleSheetMediaList, RoleAnnotatedStyleSheetRules, StyleSheetId } from '../encoding';
|
|
3
4
|
import type { EmitRecordCallback, EmitStatsCallback } from '../record.types';
|
|
4
5
|
import type { RecordingScope } from '../recordingScope';
|
|
5
6
|
import type { SerializationStats } from './serializationStats';
|
|
6
|
-
export type SerializationTransactionCallback = (transaction: SerializationTransaction) => void;
|
|
7
7
|
export declare const enum SerializationKind {
|
|
8
8
|
INITIAL_FULL_SNAPSHOT = 0,
|
|
9
9
|
SUBSEQUENT_FULL_SNAPSHOT = 1,
|
|
10
10
|
INCREMENTAL_SNAPSHOT = 2
|
|
11
11
|
}
|
|
12
|
+
export type SerializationTransactionCallback = (transaction: SerializationTransaction) => void;
|
|
12
13
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
14
|
+
* SerializationTransaction is used to build and emit a `BrowserChangeRecord` containing a
|
|
15
|
+
* serialized snapshot of the DOM. The term "transaction" is used because all the changes
|
|
16
|
+
* in a serialization transaction are applied together, atomically. A serialization
|
|
17
|
+
* transaction is thus always associated with a single timestamp.
|
|
18
|
+
*
|
|
19
|
+
* To use `SerializationTransaction`, call the builder methods it exposes to add changes
|
|
20
|
+
* to the transaction. At the end of the transaction, the changes will be combined into a
|
|
21
|
+
* single `BrowserChangeRecord` and emitted.
|
|
15
22
|
*/
|
|
16
23
|
export interface SerializationTransaction {
|
|
17
|
-
/** Add a record to the transaction. It will be emitted when the transaction ends. */
|
|
18
|
-
add(record: BrowserRecord): void;
|
|
19
24
|
/**
|
|
20
25
|
* Add a metric to the transaction's statistics. The aggregated statistics will be
|
|
21
26
|
* emitted when the transaction ends.
|
|
22
27
|
*/
|
|
23
28
|
addMetric(metric: keyof SerializationStats, value: number): void;
|
|
29
|
+
/** Add a node to the document at the given insertion point. */
|
|
30
|
+
addNode(pos: InsertionPoint, nodeName: RoleAnnotatedAddNodeName<AddCDataSectionNodeChange>, ...params: RoleAnnotatedAddNodeParams<AddCDataSectionNodeChange>): void;
|
|
31
|
+
addNode(pos: InsertionPoint, nodeName: RoleAnnotatedAddNodeName<AddDocTypeNodeChange>, ...params: RoleAnnotatedAddNodeParams<AddDocTypeNodeChange>): void;
|
|
32
|
+
addNode(pos: InsertionPoint, nodeName: RoleAnnotatedAddNodeName<AddDocumentNodeChange>, ...params: RoleAnnotatedAddNodeParams<AddDocumentNodeChange>): void;
|
|
33
|
+
addNode(pos: InsertionPoint, nodeName: RoleAnnotatedAddNodeName<AddDocumentFragmentNodeChange>, ...params: RoleAnnotatedAddNodeParams<AddDocumentFragmentNodeChange>): void;
|
|
34
|
+
addNode(pos: InsertionPoint, nodeName: RoleAnnotatedAddNodeName<AddShadowRootNodeChange>, ...params: RoleAnnotatedAddNodeParams<AddShadowRootNodeChange>): void;
|
|
35
|
+
addNode(pos: InsertionPoint, nodeName: RoleAnnotatedAddNodeName<AddTextNodeChange>, ...params: RoleAnnotatedAddNodeParams<AddTextNodeChange>): void;
|
|
36
|
+
addNode<Name extends RoleAnnotatedAddNodeName<AddElementNodeChange>>(pos: InsertionPoint, nodeName: Name, ...params: RoleAnnotatedStringLiteralValue<Name> extends `#${string}` ? [never] : RoleAnnotatedAddNodeParams<AddElementNodeChange>): void;
|
|
37
|
+
/** Add a stylesheet to the document. */
|
|
38
|
+
addStyleSheet(rules: RoleAnnotatedStyleSheetRules, mediaList?: RoleAnnotatedStyleSheetMediaList, disabled?: boolean): void;
|
|
24
39
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
40
|
+
* Attach one or more stylesheets to a <link>, <style>, #document, #document-fragment,
|
|
41
|
+
* or #shadow-root node.
|
|
27
42
|
*/
|
|
28
|
-
|
|
43
|
+
attachStyleSheets(nodeId: NodeId, sheetIds: StyleSheetId[]): void;
|
|
44
|
+
/** Remove a node from the document. */
|
|
45
|
+
removeNode(nodeId: NodeId): void;
|
|
46
|
+
/** Set a node's attributes to the given values. */
|
|
47
|
+
setAttributes(change: RoleAnnotatedAttributeChange): void;
|
|
48
|
+
/** Set the content of a canvas node to the given resource ID. */
|
|
49
|
+
setImageContent(nodeId: NodeId, resourceId: RoleAnnotatedStringLiteral): void;
|
|
50
|
+
/** Set the selection state of one or more checkboxes, radio buttons, or <option> elements. */
|
|
51
|
+
setInputSelection(state: InputSelectionState, nodeIds: NodeId[]): void;
|
|
52
|
+
/** Set the value of a form element. */
|
|
53
|
+
setInputValue(nodeId: NodeId, value: RoleAnnotatedStringLiteral): void;
|
|
54
|
+
/** Set the media playback state of an <audio> or <video> element. */
|
|
55
|
+
setMediaPlaybackState(nodeId: NodeId, state: MediaInteractionType): void;
|
|
56
|
+
/** Set the given node's scroll position in CSS pixels. */
|
|
57
|
+
setScrollPosition(nodeId: NodeId, x: number, y: number): void;
|
|
58
|
+
/** Set the given node's size in CSS pixels. */
|
|
59
|
+
setSize(nodeId: NodeId, width: number, height: number): void;
|
|
60
|
+
/** Set the given node's text content. */
|
|
61
|
+
setText(nodeId: NodeId, content: RoleAnnotatedStringLiteral): void;
|
|
29
62
|
/** The kind of serialization being performed in this transaction. */
|
|
30
63
|
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
64
|
/** The recording scope in which this transaction is occurring. */
|
|
39
65
|
scope: RecordingScope;
|
|
40
66
|
}
|
|
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;
|
|
67
|
+
export declare function serializeInTransaction(kind: SerializationKind, emitRecord: EmitRecordCallback, emitStats: EmitStatsCallback, scope: RecordingScope, timestamp: TimeStamp, serialize: SerializationTransactionCallback): void;
|
|
@@ -1,38 +1,92 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
1
|
+
const require_sessionReplayConstants = require("../../../types/sessionReplayConstants.js");
|
|
2
|
+
const require_changeEncoder = require("../encoding/changeEncoder.js");
|
|
3
|
+
const require_serializationStats = require("./serializationStats.js");
|
|
4
|
+
let _kubesense_kubesense_js_core_time = require("@kubesense/kubesense-js-core/time");
|
|
5
|
+
//#region src/domain/record/serialization/serializationTransaction.ts
|
|
6
|
+
function serializeInTransaction(kind, emitRecord, emitStats, scope, timestamp, serialize) {
|
|
7
|
+
const encoder = require_changeEncoder.createChangeEncoder(scope.stringIds);
|
|
8
|
+
const stats = require_serializationStats.createSerializationStats();
|
|
9
|
+
const transaction = {
|
|
10
|
+
addMetric(metric, value) {
|
|
11
|
+
require_serializationStats.updateSerializationStats(stats, metric, value);
|
|
12
|
+
},
|
|
13
|
+
addNode(...change) {
|
|
14
|
+
encoder.add(require_sessionReplayConstants.ChangeType.AddNode, change);
|
|
15
|
+
},
|
|
16
|
+
addStyleSheet(rules, mediaList, disabled) {
|
|
17
|
+
if (disabled) encoder.add(require_sessionReplayConstants.ChangeType.AddStyleSheet, [
|
|
18
|
+
rules,
|
|
19
|
+
mediaList || [],
|
|
20
|
+
disabled
|
|
21
|
+
]);
|
|
22
|
+
else if (mediaList) encoder.add(require_sessionReplayConstants.ChangeType.AddStyleSheet, [rules, mediaList]);
|
|
23
|
+
else encoder.add(require_sessionReplayConstants.ChangeType.AddStyleSheet, [rules]);
|
|
24
|
+
},
|
|
25
|
+
attachStyleSheets(nodeId, sheetIds) {
|
|
26
|
+
const change = [nodeId];
|
|
27
|
+
for (const sheetId of sheetIds) change.push(sheetId);
|
|
28
|
+
encoder.add(require_sessionReplayConstants.ChangeType.AttachedStyleSheets, change);
|
|
29
|
+
},
|
|
30
|
+
removeNode(nodeId) {
|
|
31
|
+
encoder.add(require_sessionReplayConstants.ChangeType.RemoveNode, nodeId);
|
|
32
|
+
},
|
|
33
|
+
setAttributes(change) {
|
|
34
|
+
encoder.add(require_sessionReplayConstants.ChangeType.Attribute, change);
|
|
35
|
+
},
|
|
36
|
+
setInputSelection(state, nodeIds) {
|
|
37
|
+
const change = [state];
|
|
38
|
+
for (const nodeId of nodeIds) change.push(nodeId);
|
|
39
|
+
encoder.add(require_sessionReplayConstants.ChangeType.InputSelection, change);
|
|
40
|
+
},
|
|
41
|
+
setInputValue(nodeId, value) {
|
|
42
|
+
encoder.add(require_sessionReplayConstants.ChangeType.InputValue, [nodeId, value]);
|
|
43
|
+
},
|
|
44
|
+
setMediaPlaybackState(nodeId, state) {
|
|
45
|
+
encoder.add(require_sessionReplayConstants.ChangeType.MediaPlaybackState, [nodeId, state]);
|
|
46
|
+
},
|
|
47
|
+
setScrollPosition(nodeId, x, y) {
|
|
48
|
+
encoder.add(require_sessionReplayConstants.ChangeType.ScrollPosition, [
|
|
49
|
+
nodeId,
|
|
50
|
+
x,
|
|
51
|
+
y
|
|
52
|
+
]);
|
|
53
|
+
},
|
|
54
|
+
setSize(nodeId, width, height) {
|
|
55
|
+
encoder.add(require_sessionReplayConstants.ChangeType.Size, [
|
|
56
|
+
nodeId,
|
|
57
|
+
width,
|
|
58
|
+
height
|
|
59
|
+
]);
|
|
60
|
+
},
|
|
61
|
+
setText(nodeId, content) {
|
|
62
|
+
encoder.add(require_sessionReplayConstants.ChangeType.Text, [nodeId, content]);
|
|
63
|
+
},
|
|
64
|
+
setImageContent(nodeId, resourceId) {
|
|
65
|
+
encoder.add(require_sessionReplayConstants.ChangeType.ImageContent, [nodeId, resourceId]);
|
|
66
|
+
},
|
|
67
|
+
kind,
|
|
68
|
+
scope
|
|
69
|
+
};
|
|
70
|
+
const start = (0, _kubesense_kubesense_js_core_time.timeStampNow)();
|
|
71
|
+
serialize(transaction);
|
|
72
|
+
require_serializationStats.updateSerializationStats(stats, "serializationDuration", (0, _kubesense_kubesense_js_core_time.elapsed)(start, (0, _kubesense_kubesense_js_core_time.timeStampNow)()));
|
|
73
|
+
const changes = encoder.flush();
|
|
74
|
+
if (changes.length > 0) {
|
|
75
|
+
if (kind === 0 || kind === 1) emitRecord({
|
|
76
|
+
data: changes,
|
|
77
|
+
format: require_sessionReplayConstants.SnapshotFormat.Change,
|
|
78
|
+
type: require_sessionReplayConstants.RecordType.FullSnapshot,
|
|
79
|
+
timestamp
|
|
80
|
+
});
|
|
81
|
+
else emitRecord({
|
|
82
|
+
data: changes,
|
|
83
|
+
type: require_sessionReplayConstants.RecordType.Change,
|
|
84
|
+
timestamp
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
emitStats(stats);
|
|
37
88
|
}
|
|
89
|
+
//#endregion
|
|
90
|
+
exports.serializeInTransaction = serializeInTransaction;
|
|
91
|
+
|
|
38
92
|
//# sourceMappingURL=serializationTransaction.js.map
|
|
@@ -1 +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"}
|
|
1
|
+
{"version":3,"file":"serializationTransaction.js","names":["createChangeEncoder","createSerializationStats","ChangeType","timeStampNow","elapsed","SnapshotFormat","RecordType"],"sources":["../../../../src/domain/record/serialization/serializationTransaction.ts"],"sourcesContent":["import { elapsed, timeStampNow } from '@kubesense/kubesense-js-core/time'\nimport type { TimeStamp } from '@kubesense/kubesense-js-core/time'\nimport { ChangeType, RecordType, SnapshotFormat } from '../../../types'\nimport type {\n AddCDataSectionNodeChange,\n AddDocTypeNodeChange,\n AddDocumentFragmentNodeChange,\n AddDocumentNodeChange,\n AddElementNodeChange,\n AddNodeChange,\n AddShadowRootNodeChange,\n AddTextNodeChange,\n AttachedStyleSheetsChange,\n InputSelectionChange,\n InputSelectionState,\n InsertionPoint,\n MediaInteractionType,\n RoleAnnotatedStringLiteral,\n} from '../../../types'\nimport type {\n NodeId,\n RoleAnnotatedAddNodeName,\n RoleAnnotatedAddNodeParams,\n RoleAnnotatedAttributeChange,\n RoleAnnotatedStringLiteralValue,\n RoleAnnotatedStyleSheetMediaList,\n RoleAnnotatedStyleSheetRules,\n StyleSheetId,\n} from '../encoding'\nimport { createChangeEncoder } from '../encoding'\nimport type { EmitRecordCallback, EmitStatsCallback } from '../record.types'\nimport type { RecordingScope } from '../recordingScope'\nimport type { SerializationStats } from './serializationStats'\nimport { createSerializationStats, updateSerializationStats } from './serializationStats'\n\nexport const enum SerializationKind {\n INITIAL_FULL_SNAPSHOT,\n SUBSEQUENT_FULL_SNAPSHOT,\n INCREMENTAL_SNAPSHOT,\n}\n\nexport type SerializationTransactionCallback = (transaction: SerializationTransaction) => void\n\n/**\n * SerializationTransaction is used to build and emit a `BrowserChangeRecord` containing a\n * serialized snapshot of the DOM. The term \"transaction\" is used because all the changes\n * in a serialization transaction are applied together, atomically. A serialization\n * transaction is thus always associated with a single timestamp.\n *\n * To use `SerializationTransaction`, call the builder methods it exposes to add changes\n * to the transaction. At the end of the transaction, the changes will be combined into a\n * single `BrowserChangeRecord` and emitted.\n */\nexport interface SerializationTransaction {\n /**\n * Add a metric to the transaction's statistics. The aggregated statistics will be\n * emitted when the transaction ends.\n */\n addMetric(metric: keyof SerializationStats, value: number): void\n\n /** Add a node to the document at the given insertion point. */\n addNode(\n pos: InsertionPoint,\n nodeName: RoleAnnotatedAddNodeName<AddCDataSectionNodeChange>,\n ...params: RoleAnnotatedAddNodeParams<AddCDataSectionNodeChange>\n ): void\n addNode(\n pos: InsertionPoint,\n nodeName: RoleAnnotatedAddNodeName<AddDocTypeNodeChange>,\n ...params: RoleAnnotatedAddNodeParams<AddDocTypeNodeChange>\n ): void\n addNode(\n pos: InsertionPoint,\n nodeName: RoleAnnotatedAddNodeName<AddDocumentNodeChange>,\n ...params: RoleAnnotatedAddNodeParams<AddDocumentNodeChange>\n ): void\n addNode(\n pos: InsertionPoint,\n nodeName: RoleAnnotatedAddNodeName<AddDocumentFragmentNodeChange>,\n ...params: RoleAnnotatedAddNodeParams<AddDocumentFragmentNodeChange>\n ): void\n addNode(\n pos: InsertionPoint,\n nodeName: RoleAnnotatedAddNodeName<AddShadowRootNodeChange>,\n ...params: RoleAnnotatedAddNodeParams<AddShadowRootNodeChange>\n ): void\n addNode(\n pos: InsertionPoint,\n nodeName: RoleAnnotatedAddNodeName<AddTextNodeChange>,\n ...params: RoleAnnotatedAddNodeParams<AddTextNodeChange>\n ): void\n addNode<Name extends RoleAnnotatedAddNodeName<AddElementNodeChange>>(\n pos: InsertionPoint,\n nodeName: Name,\n // This overload is deliberately unsatisfiable; a '#'-prefixed name belongs to one of\n // the node kinds above, so we should never reach it unless the caller provided\n // invalid parameters.\n ...params: RoleAnnotatedStringLiteralValue<Name> extends `#${string}`\n ? [never]\n : RoleAnnotatedAddNodeParams<AddElementNodeChange>\n ): void\n\n /** Add a stylesheet to the document. */\n addStyleSheet(\n rules: RoleAnnotatedStyleSheetRules,\n mediaList?: RoleAnnotatedStyleSheetMediaList,\n disabled?: boolean\n ): void\n\n /**\n * Attach one or more stylesheets to a <link>, <style>, #document, #document-fragment,\n * or #shadow-root node.\n */\n attachStyleSheets(nodeId: NodeId, sheetIds: StyleSheetId[]): void\n\n /** Remove a node from the document. */\n removeNode(nodeId: NodeId): void\n\n /** Set a node's attributes to the given values. */\n setAttributes(change: RoleAnnotatedAttributeChange): void\n\n /** Set the content of a canvas node to the given resource ID. */\n setImageContent(nodeId: NodeId, resourceId: RoleAnnotatedStringLiteral): void\n\n /** Set the selection state of one or more checkboxes, radio buttons, or <option> elements. */\n setInputSelection(state: InputSelectionState, nodeIds: NodeId[]): void\n\n /** Set the value of a form element. */\n setInputValue(nodeId: NodeId, value: RoleAnnotatedStringLiteral): void\n\n /** Set the media playback state of an <audio> or <video> element. */\n setMediaPlaybackState(nodeId: NodeId, state: MediaInteractionType): void\n\n /** Set the given node's scroll position in CSS pixels. */\n setScrollPosition(nodeId: NodeId, x: number, y: number): void\n\n /** Set the given node's size in CSS pixels. */\n setSize(nodeId: NodeId, width: number, height: number): void\n\n /** Set the given node's text content. */\n setText(nodeId: NodeId, content: RoleAnnotatedStringLiteral): void\n\n /** The kind of serialization being performed in this transaction. */\n kind: SerializationKind\n\n /** The recording scope in which this transaction is occurring. */\n scope: RecordingScope\n}\n\nexport function serializeInTransaction(\n kind: SerializationKind,\n emitRecord: EmitRecordCallback,\n emitStats: EmitStatsCallback,\n scope: RecordingScope,\n timestamp: TimeStamp,\n serialize: SerializationTransactionCallback\n): void {\n const encoder = createChangeEncoder(scope.stringIds)\n const stats = createSerializationStats()\n\n const transaction: SerializationTransaction = {\n addMetric(metric: keyof SerializationStats, value: number): void {\n updateSerializationStats(stats, metric, value)\n },\n // The overloads declared above are what callers are checked against; this implementation\n // takes the parameters of any of them.\n addNode(...change: unknown[]): void {\n encoder.add(ChangeType.AddNode, change as AddNodeChange)\n },\n addStyleSheet(\n rules: RoleAnnotatedStyleSheetRules,\n mediaList?: RoleAnnotatedStyleSheetMediaList,\n disabled?: boolean\n ): void {\n if (disabled) {\n encoder.add(ChangeType.AddStyleSheet, [rules, mediaList || [], disabled])\n } else if (mediaList) {\n encoder.add(ChangeType.AddStyleSheet, [rules, mediaList])\n } else {\n encoder.add(ChangeType.AddStyleSheet, [rules])\n }\n },\n attachStyleSheets(nodeId: NodeId, sheetIds: StyleSheetId[]): void {\n const change: AttachedStyleSheetsChange = [nodeId]\n for (const sheetId of sheetIds) {\n change.push(sheetId)\n }\n encoder.add(ChangeType.AttachedStyleSheets, change)\n },\n removeNode(nodeId: NodeId): void {\n encoder.add(ChangeType.RemoveNode, nodeId)\n },\n setAttributes(change: RoleAnnotatedAttributeChange): void {\n encoder.add(ChangeType.Attribute, change)\n },\n setInputSelection(state: InputSelectionState, nodeIds: NodeId[]): void {\n const change: InputSelectionChange = [state]\n for (const nodeId of nodeIds) {\n change.push(nodeId)\n }\n encoder.add(ChangeType.InputSelection, change)\n },\n setInputValue(nodeId: NodeId, value: RoleAnnotatedStringLiteral): void {\n encoder.add(ChangeType.InputValue, [nodeId, value])\n },\n setMediaPlaybackState(nodeId: NodeId, state: MediaInteractionType): void {\n encoder.add(ChangeType.MediaPlaybackState, [nodeId, state])\n },\n setScrollPosition(nodeId: NodeId, x: number, y: number): void {\n encoder.add(ChangeType.ScrollPosition, [nodeId, x, y])\n },\n setSize(nodeId: NodeId, width: number, height: number): void {\n encoder.add(ChangeType.Size, [nodeId, width, height])\n },\n setText(nodeId: NodeId, content: RoleAnnotatedStringLiteral): void {\n encoder.add(ChangeType.Text, [nodeId, content])\n },\n setImageContent(nodeId: NodeId, resourceId: RoleAnnotatedStringLiteral): void {\n encoder.add(ChangeType.ImageContent, [nodeId, resourceId])\n },\n kind,\n scope,\n }\n\n const start = timeStampNow()\n serialize(transaction)\n updateSerializationStats(stats, 'serializationDuration', elapsed(start, timeStampNow()))\n\n const changes = encoder.flush()\n if (changes.length > 0) {\n if (kind === SerializationKind.INITIAL_FULL_SNAPSHOT || kind === SerializationKind.SUBSEQUENT_FULL_SNAPSHOT) {\n emitRecord({\n data: changes,\n format: SnapshotFormat.Change,\n type: RecordType.FullSnapshot,\n timestamp,\n })\n } else {\n emitRecord({\n data: changes,\n type: RecordType.Change,\n timestamp,\n })\n }\n }\n\n emitStats(stats)\n}\n"],"mappings":";;;;;AAqJA,SAAgB,uBACd,MACA,YACA,WACA,OACA,WACA,WACM;CACN,MAAM,UAAUA,sBAAAA,oBAAoB,MAAM,SAAS;CACnD,MAAM,QAAQC,2BAAAA,yBAAyB;CAEvC,MAAM,cAAwC;EAC5C,UAAU,QAAkC,OAAqB;GAC/D,2BAAA,yBAAyB,OAAO,QAAQ,KAAK;EAC/C;EAGA,QAAQ,GAAG,QAAyB;GAClC,QAAQ,IAAIC,+BAAAA,WAAW,SAAS,MAAuB;EACzD;EACA,cACE,OACA,WACA,UACM;GACN,IAAI,UACF,QAAQ,IAAIA,+BAAAA,WAAW,eAAe;IAAC;IAAO,aAAa,CAAC;IAAG;GAAQ,CAAC;QACnE,IAAI,WACT,QAAQ,IAAIA,+BAAAA,WAAW,eAAe,CAAC,OAAO,SAAS,CAAC;QAExD,QAAQ,IAAIA,+BAAAA,WAAW,eAAe,CAAC,KAAK,CAAC;EAEjD;EACA,kBAAkB,QAAgB,UAAgC;GAChE,MAAM,SAAoC,CAAC,MAAM;GACjD,KAAK,MAAM,WAAW,UACpB,OAAO,KAAK,OAAO;GAErB,QAAQ,IAAIA,+BAAAA,WAAW,qBAAqB,MAAM;EACpD;EACA,WAAW,QAAsB;GAC/B,QAAQ,IAAIA,+BAAAA,WAAW,YAAY,MAAM;EAC3C;EACA,cAAc,QAA4C;GACxD,QAAQ,IAAIA,+BAAAA,WAAW,WAAW,MAAM;EAC1C;EACA,kBAAkB,OAA4B,SAAyB;GACrE,MAAM,SAA+B,CAAC,KAAK;GAC3C,KAAK,MAAM,UAAU,SACnB,OAAO,KAAK,MAAM;GAEpB,QAAQ,IAAIA,+BAAAA,WAAW,gBAAgB,MAAM;EAC/C;EACA,cAAc,QAAgB,OAAyC;GACrE,QAAQ,IAAIA,+BAAAA,WAAW,YAAY,CAAC,QAAQ,KAAK,CAAC;EACpD;EACA,sBAAsB,QAAgB,OAAmC;GACvE,QAAQ,IAAIA,+BAAAA,WAAW,oBAAoB,CAAC,QAAQ,KAAK,CAAC;EAC5D;EACA,kBAAkB,QAAgB,GAAW,GAAiB;GAC5D,QAAQ,IAAIA,+BAAAA,WAAW,gBAAgB;IAAC;IAAQ;IAAG;GAAC,CAAC;EACvD;EACA,QAAQ,QAAgB,OAAe,QAAsB;GAC3D,QAAQ,IAAIA,+BAAAA,WAAW,MAAM;IAAC;IAAQ;IAAO;GAAM,CAAC;EACtD;EACA,QAAQ,QAAgB,SAA2C;GACjE,QAAQ,IAAIA,+BAAAA,WAAW,MAAM,CAAC,QAAQ,OAAO,CAAC;EAChD;EACA,gBAAgB,QAAgB,YAA8C;GAC5E,QAAQ,IAAIA,+BAAAA,WAAW,cAAc,CAAC,QAAQ,UAAU,CAAC;EAC3D;EACA;EACA;CACF;CAEA,MAAM,SAAA,GAAQC,kCAAAA,aAAAA,CAAa;CAC3B,UAAU,WAAW;CACrB,2BAAA,yBAAyB,OAAO,0BAAA,GAAyBC,kCAAAA,QAAAA,CAAQ,QAAA,GAAOD,kCAAAA,aAAAA,CAAa,CAAC,CAAC;CAEvF,MAAM,UAAU,QAAQ,MAAM;CAC9B,IAAI,QAAQ,SAAS,GAAG;EACtB,IAAI,SAAA,KAAoD,SAAA,GACtD,WAAW;GACT,MAAM;GACN,QAAQE,+BAAAA,eAAe;GACvB,MAAMC,+BAAAA,WAAW;GACjB;EACF,CAAC;OAED,WAAW;GACT,MAAM;GACN,MAAMA,+BAAAA,WAAW;GACjB;EACF,CAAC;CAEL;CAEA,UAAU,KAAK;AACjB"}
|
|
@@ -9,7 +9,6 @@ export declare const URL_IN_CSS_REF: RegExp;
|
|
|
9
9
|
export declare const ABSOLUTE_URL: RegExp;
|
|
10
10
|
export declare const DATA_URI: RegExp;
|
|
11
11
|
export declare function switchToAbsoluteUrl(cssText: string, cssHref: string | null): string;
|
|
12
|
-
export declare function getValidTagName(tagName: string): string;
|
|
13
12
|
/**
|
|
14
13
|
* Returns the tag name of the given element, normalized to ensure a consistent lowercase
|
|
15
14
|
* representation regardless of whether the element is HTML, XHTML, or SVG.
|
|
@@ -1,88 +1,59 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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");
|
|
1
|
+
let _kubesense_kubesense_browser_rum_core = require("@kubesense/kubesense-browser-rum-core");
|
|
2
|
+
let _kubesense_kubesense_js_core_util = require("@kubesense/kubesense-js-core/util");
|
|
3
|
+
//#region src/domain/record/serialization/serializationUtils.ts
|
|
11
4
|
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
* Get the element "value" to be serialized as an attribute or an input update record. It respects
|
|
6
|
+
* the input privacy mode of the element.
|
|
7
|
+
* PERFROMANCE OPTIMIZATION: Assumes that privacy level `HIDDEN` is never encountered because of earlier checks.
|
|
8
|
+
*/
|
|
16
9
|
function getElementInputValue(element, nodePrivacyLevel) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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;
|
|
10
|
+
const tagName = element.tagName;
|
|
11
|
+
const value = element.value;
|
|
12
|
+
if ((0, _kubesense_kubesense_browser_rum_core.shouldMaskNode)(element, nodePrivacyLevel)) {
|
|
13
|
+
const type = element.type;
|
|
14
|
+
if (tagName === "INPUT" && (type === "button" || type === "submit" || type === "reset")) return value;
|
|
15
|
+
else if (!value || tagName === "OPTION") return;
|
|
16
|
+
return _kubesense_kubesense_browser_rum_core.CENSORED_STRING_MARK;
|
|
17
|
+
}
|
|
18
|
+
if (tagName === "OPTION" || tagName === "SELECT") return element.value;
|
|
19
|
+
if (tagName !== "INPUT" && tagName !== "TEXTAREA") return;
|
|
20
|
+
return value;
|
|
45
21
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
22
|
+
const URL_IN_CSS_REF = /url\((?:(')([^']*)'|(")([^"]*)"|([^)]*))\)/gm;
|
|
23
|
+
const ABSOLUTE_URL = /^[A-Za-z]+:|^\/\//;
|
|
24
|
+
const DATA_URI = /^["']?data:.*,/i;
|
|
49
25
|
function switchToAbsoluteUrl(cssText, cssHref) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
return `url(${quote}${makeUrlAbsolute(url, cssHref)}${quote})`;
|
|
57
|
-
});
|
|
26
|
+
return cssText.replace(URL_IN_CSS_REF, (matchingSubstring, singleQuote, urlWrappedInSingleQuotes, doubleQuote, urlWrappedInDoubleQuotes, urlNotWrappedInQuotes) => {
|
|
27
|
+
const url = urlWrappedInSingleQuotes || urlWrappedInDoubleQuotes || urlNotWrappedInQuotes;
|
|
28
|
+
if (!cssHref || !url || ABSOLUTE_URL.test(url) || DATA_URI.test(url)) return matchingSubstring;
|
|
29
|
+
const quote = singleQuote || doubleQuote || "";
|
|
30
|
+
return `url(${quote}${makeUrlAbsolute(url, cssHref)}${quote})`;
|
|
31
|
+
});
|
|
58
32
|
}
|
|
59
33
|
function makeUrlAbsolute(url, baseUrl) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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;
|
|
34
|
+
try {
|
|
35
|
+
return (0, _kubesense_kubesense_js_core_util.buildUrl)(url, baseUrl).href;
|
|
36
|
+
} catch {
|
|
37
|
+
return url;
|
|
38
|
+
}
|
|
77
39
|
}
|
|
78
40
|
/**
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
41
|
+
* Returns the tag name of the given element, normalized to ensure a consistent lowercase
|
|
42
|
+
* representation regardless of whether the element is HTML, XHTML, or SVG.
|
|
43
|
+
*/
|
|
82
44
|
function normalizedTagName(element) {
|
|
83
|
-
|
|
45
|
+
return element.tagName.toLowerCase();
|
|
84
46
|
}
|
|
85
47
|
function censoredImageForSize(width, height) {
|
|
86
|
-
|
|
48
|
+
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
49
|
}
|
|
50
|
+
//#endregion
|
|
51
|
+
exports.ABSOLUTE_URL = ABSOLUTE_URL;
|
|
52
|
+
exports.DATA_URI = DATA_URI;
|
|
53
|
+
exports.URL_IN_CSS_REF = URL_IN_CSS_REF;
|
|
54
|
+
exports.censoredImageForSize = censoredImageForSize;
|
|
55
|
+
exports.getElementInputValue = getElementInputValue;
|
|
56
|
+
exports.normalizedTagName = normalizedTagName;
|
|
57
|
+
exports.switchToAbsoluteUrl = switchToAbsoluteUrl;
|
|
58
|
+
|
|
88
59
|
//# sourceMappingURL=serializationUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializationUtils.js","
|
|
1
|
+
{"version":3,"file":"serializationUtils.js","names":["shouldMaskNode","CENSORED_STRING_MARK","buildUrl"],"sources":["../../../../src/domain/record/serialization/serializationUtils.ts"],"sourcesContent":["import { buildUrl } from '@kubesense/kubesense-js-core/util'\nimport { CENSORED_STRING_MARK, shouldMaskNode } from '@kubesense/kubesense-browser-rum-core'\nimport type { NodePrivacyLevel } from '@kubesense/kubesense-browser-rum-core'\n\n/**\n * Get the element \"value\" to be serialized as an attribute or an input update record. It respects\n * the input privacy mode of the element.\n * PERFROMANCE OPTIMIZATION: Assumes that privacy level `HIDDEN` is never encountered because of earlier checks.\n */\nexport function getElementInputValue(element: Element, nodePrivacyLevel: NodePrivacyLevel) {\n /*\n BROWSER SPEC NOTE: <input>, <select>\n For some <input> elements, the `value` is an exceptional property/attribute that has the\n value synced between el.value and el.getAttribute()\n input[type=button,checkbox,hidden,image,radio,reset,submit]\n */\n const tagName = element.tagName\n const value = (element as HTMLInputElement | HTMLTextAreaElement).value\n\n if (shouldMaskNode(element, nodePrivacyLevel)) {\n const type = (element as HTMLInputElement | HTMLTextAreaElement).type\n if (tagName === 'INPUT' && (type === 'button' || type === 'submit' || type === 'reset')) {\n // Overrule `MASK` privacy level for button-like element values, as they are used during replay\n // to display their label. They can still be hidden via the \"hidden\" privacy attribute or class name.\n return value\n } else if (!value || tagName === 'OPTION') {\n // <Option> value provides no benefit\n return\n }\n return CENSORED_STRING_MARK\n }\n\n if (tagName === 'OPTION' || tagName === 'SELECT') {\n return (element as HTMLOptionElement | HTMLSelectElement).value\n }\n\n if (tagName !== 'INPUT' && tagName !== 'TEXTAREA') {\n return\n }\n\n return value\n}\n\nexport const URL_IN_CSS_REF = /url\\((?:(')([^']*)'|(\")([^\"]*)\"|([^)]*))\\)/gm\nexport const ABSOLUTE_URL = /^[A-Za-z]+:|^\\/\\//\nexport const DATA_URI = /^[\"']?data:.*,/i\n\nexport function switchToAbsoluteUrl(cssText: string, cssHref: string | null): string {\n return cssText.replace(\n URL_IN_CSS_REF,\n (\n matchingSubstring: string,\n singleQuote: string | undefined,\n urlWrappedInSingleQuotes: string | undefined,\n doubleQuote: string | undefined,\n urlWrappedInDoubleQuotes: string | undefined,\n urlNotWrappedInQuotes: string | undefined\n ) => {\n const url = urlWrappedInSingleQuotes || urlWrappedInDoubleQuotes || urlNotWrappedInQuotes\n\n if (!cssHref || !url || ABSOLUTE_URL.test(url) || DATA_URI.test(url)) {\n return matchingSubstring\n }\n\n const quote = singleQuote || doubleQuote || ''\n return `url(${quote}${makeUrlAbsolute(url, cssHref)}${quote})`\n }\n )\n}\n\nfunction makeUrlAbsolute(url: string, baseUrl: string): string {\n try {\n return buildUrl(url, baseUrl).href\n } catch {\n return url\n }\n}\n\n/**\n * Returns the tag name of the given element, normalized to ensure a consistent lowercase\n * representation regardless of whether the element is HTML, XHTML, or SVG.\n */\nexport function normalizedTagName(element: Element): string {\n return element.tagName.toLowerCase()\n}\n\nexport function censoredImageForSize(width: number, height: number) {\n 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`\n}\n"],"mappings":";;;;;;;;AASA,SAAgB,qBAAqB,SAAkB,kBAAoC;CAOzF,MAAM,UAAU,QAAQ;CACxB,MAAM,QAAS,QAAmD;CAElE,KAAA,GAAIA,sCAAAA,eAAAA,CAAe,SAAS,gBAAgB,GAAG;EAC7C,MAAM,OAAQ,QAAmD;EACjE,IAAI,YAAY,YAAY,SAAS,YAAY,SAAS,YAAY,SAAS,UAG7E,OAAO;OACF,IAAI,CAAC,SAAS,YAAY,UAE/B;EAEF,OAAOC,sCAAAA;CACT;CAEA,IAAI,YAAY,YAAY,YAAY,UACtC,OAAQ,QAAkD;CAG5D,IAAI,YAAY,WAAW,YAAY,YACrC;CAGF,OAAO;AACT;AAEA,MAAa,iBAAiB;AAC9B,MAAa,eAAe;AAC5B,MAAa,WAAW;AAExB,SAAgB,oBAAoB,SAAiB,SAAgC;CACnF,OAAO,QAAQ,QACb,iBAEE,mBACA,aACA,0BACA,aACA,0BACA,0BACG;EACH,MAAM,MAAM,4BAA4B,4BAA4B;EAEpE,IAAI,CAAC,WAAW,CAAC,OAAO,aAAa,KAAK,GAAG,KAAK,SAAS,KAAK,GAAG,GACjE,OAAO;EAGT,MAAM,QAAQ,eAAe,eAAe;EAC5C,OAAO,OAAO,QAAQ,gBAAgB,KAAK,OAAO,IAAI,MAAM;CAC9D,CACF;AACF;AAEA,SAAS,gBAAgB,KAAa,SAAyB;CAC7D,IAAI;EACF,QAAA,GAAOC,kCAAAA,SAAAA,CAAS,KAAK,OAAO,CAAC,CAAC;CAChC,QAAQ;EACN,OAAO;CACT;AACF;;;;;AAMA,SAAgB,kBAAkB,SAA0B;CAC1D,OAAO,QAAQ,QAAQ,YAAY;AACrC;AAEA,SAAgB,qBAAqB,OAAe,QAAgB;CAClE,OAAO,uEAAuE,MAAM,YAAY,OAAO;AACzG"}
|
|
@@ -1,42 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const kubesense_browser_rum_core_1 = require("@kubesense/kubesense-browser-rum-core");
|
|
6
|
-
const serializationUtils_1 = require("./serializationUtils");
|
|
7
|
-
// TODO: temporarily bump the Session Replay limit to 1Mb for dataUrls
|
|
8
|
-
// This limit should be removed after [PANA-2843] is implemented
|
|
9
|
-
exports.MAX_ATTRIBUTE_VALUE_CHAR_LENGTH = 1000000;
|
|
1
|
+
const require_serializationUtils = require("./serializationUtils.js");
|
|
2
|
+
let _kubesense_kubesense_browser_rum_core = require("@kubesense/kubesense-browser-rum-core");
|
|
3
|
+
//#region src/domain/record/serialization/serializeAttribute.ts
|
|
4
|
+
const MAX_ATTRIBUTE_VALUE_CHAR_LENGTH = 1e6;
|
|
10
5
|
function serializeAttribute(element, nodePrivacyLevel, attributeName, configuration) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return (0, serializationUtils_1.censoredImageForSize)(width, height);
|
|
28
|
-
}
|
|
29
|
-
// if we can't get the image size, fallback to the censored image
|
|
30
|
-
return kubesense_browser_rum_core_1.CENSORED_IMG_MARK;
|
|
31
|
-
}
|
|
32
|
-
if (tagName === 'SOURCE') {
|
|
33
|
-
return kubesense_browser_rum_core_1.CENSORED_IMG_MARK;
|
|
34
|
-
}
|
|
35
|
-
return kubesense_browser_rum_core_1.CENSORED_STRING_MARK;
|
|
36
|
-
}
|
|
37
|
-
if (!attributeValue) {
|
|
38
|
-
return attributeValue;
|
|
39
|
-
}
|
|
40
|
-
return (0, kubesense_browser_rum_core_1.sanitizeIfLongDataUrl)(attributeValue, exports.MAX_ATTRIBUTE_VALUE_CHAR_LENGTH);
|
|
6
|
+
if (nodePrivacyLevel === _kubesense_kubesense_browser_rum_core.NodePrivacyLevel.HIDDEN) return null;
|
|
7
|
+
const attributeValue = element.getAttribute(attributeName);
|
|
8
|
+
const tagName = element.tagName;
|
|
9
|
+
if ((0, _kubesense_kubesense_browser_rum_core.shouldMaskAttribute)(tagName, attributeName, attributeValue, nodePrivacyLevel, configuration)) {
|
|
10
|
+
if (tagName === "IMG") {
|
|
11
|
+
const image = element;
|
|
12
|
+
if (image.naturalWidth > 0) return require_serializationUtils.censoredImageForSize(image.naturalWidth, image.naturalHeight);
|
|
13
|
+
const { width, height } = element.getBoundingClientRect();
|
|
14
|
+
if (width > 0 || height > 0) return require_serializationUtils.censoredImageForSize(width, height);
|
|
15
|
+
return _kubesense_kubesense_browser_rum_core.CENSORED_IMG_MARK;
|
|
16
|
+
}
|
|
17
|
+
if (tagName === "SOURCE") return _kubesense_kubesense_browser_rum_core.CENSORED_IMG_MARK;
|
|
18
|
+
return _kubesense_kubesense_browser_rum_core.CENSORED_STRING_MARK;
|
|
19
|
+
}
|
|
20
|
+
if (!attributeValue) return attributeValue;
|
|
21
|
+
return (0, _kubesense_kubesense_browser_rum_core.sanitizeIfLongDataUrl)(attributeValue, MAX_ATTRIBUTE_VALUE_CHAR_LENGTH);
|
|
41
22
|
}
|
|
23
|
+
//#endregion
|
|
24
|
+
exports.MAX_ATTRIBUTE_VALUE_CHAR_LENGTH = MAX_ATTRIBUTE_VALUE_CHAR_LENGTH;
|
|
25
|
+
exports.serializeAttribute = serializeAttribute;
|
|
26
|
+
|
|
42
27
|
//# sourceMappingURL=serializeAttribute.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializeAttribute.js","
|
|
1
|
+
{"version":3,"file":"serializeAttribute.js","names":["NodePrivacyLevel","shouldMaskAttribute","censoredImageForSize","CENSORED_IMG_MARK","CENSORED_STRING_MARK","sanitizeIfLongDataUrl"],"sources":["../../../../src/domain/record/serialization/serializeAttribute.ts"],"sourcesContent":["import {\n NodePrivacyLevel,\n CENSORED_STRING_MARK,\n CENSORED_IMG_MARK,\n sanitizeIfLongDataUrl,\n shouldMaskAttribute,\n} from '@kubesense/kubesense-browser-rum-core'\nimport type { RumConfiguration } from '@kubesense/kubesense-browser-rum-core'\nimport { censoredImageForSize } from './serializationUtils'\n\n// TODO: temporarily bump the Session Replay limit to 1Mb for dataUrls\n// This limit should be removed after [PANA-2843] is implemented\nexport const MAX_ATTRIBUTE_VALUE_CHAR_LENGTH = 1_000_000\n\nexport function serializeAttribute(\n element: Element,\n nodePrivacyLevel: NodePrivacyLevel,\n attributeName: string,\n configuration: RumConfiguration\n): string | null {\n if (nodePrivacyLevel === NodePrivacyLevel.HIDDEN) {\n // dup condition for direct access case\n return null\n }\n\n const attributeValue = element.getAttribute(attributeName)\n const tagName = element.tagName\n if (shouldMaskAttribute(tagName, attributeName, attributeValue, nodePrivacyLevel, configuration)) {\n // mask image URLs\n if (tagName === 'IMG') {\n // generate image with similar dimension than the original to have the same rendering behaviour\n const image = element as HTMLImageElement\n if (image.naturalWidth > 0) {\n return censoredImageForSize(image.naturalWidth, image.naturalHeight)\n }\n const { width, height } = element.getBoundingClientRect()\n if (width > 0 || height > 0) {\n return censoredImageForSize(width, height)\n }\n // if we can't get the image size, fallback to the censored image\n return CENSORED_IMG_MARK\n }\n if (tagName === 'SOURCE') {\n return CENSORED_IMG_MARK\n }\n\n return CENSORED_STRING_MARK\n }\n\n if (!attributeValue) {\n return attributeValue\n }\n\n return sanitizeIfLongDataUrl(attributeValue, MAX_ATTRIBUTE_VALUE_CHAR_LENGTH)\n}\n"],"mappings":";;;AAYA,MAAa,kCAAkC;AAE/C,SAAgB,mBACd,SACA,kBACA,eACA,eACe;CACf,IAAI,qBAAqBA,sCAAAA,iBAAiB,QAExC,OAAO;CAGT,MAAM,iBAAiB,QAAQ,aAAa,aAAa;CACzD,MAAM,UAAU,QAAQ;CACxB,KAAA,GAAIC,sCAAAA,oBAAAA,CAAoB,SAAS,eAAe,gBAAgB,kBAAkB,aAAa,GAAG;EAEhG,IAAI,YAAY,OAAO;GAErB,MAAM,QAAQ;GACd,IAAI,MAAM,eAAe,GACvB,OAAOC,2BAAAA,qBAAqB,MAAM,cAAc,MAAM,aAAa;GAErE,MAAM,EAAE,OAAO,WAAW,QAAQ,sBAAsB;GACxD,IAAI,QAAQ,KAAK,SAAS,GACxB,OAAOA,2BAAAA,qBAAqB,OAAO,MAAM;GAG3C,OAAOC,sCAAAA;EACT;EACA,IAAI,YAAY,UACd,OAAOA,sCAAAA;EAGT,OAAOC,sCAAAA;CACT;CAEA,IAAI,CAAC,gBACH,OAAO;CAGT,QAAA,GAAOC,sCAAAA,sBAAAA,CAAsB,gBAAgB,+BAA+B;AAC9E"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NodePrivacyLevel } from '@kubesense/kubesense-browser-rum-core';
|
|
2
|
+
import type { RoleAnnotatedAttributeAssignment } from '../encoding';
|
|
2
3
|
import type { SerializationTransaction } from './serializationTransaction';
|
|
3
4
|
import type { VirtualAttributes } from './serialization.types';
|
|
4
|
-
export declare function
|
|
5
|
-
export declare function serializeDOMAttributes(element: Element, nodePrivacyLevel: NodePrivacyLevel, transaction: SerializationTransaction): Record<string, string>;
|
|
5
|
+
export declare function serializeDOMAttributes(element: Element, nodePrivacyLevel: NodePrivacyLevel, transaction: SerializationTransaction): RoleAnnotatedAttributeAssignment[];
|
|
6
6
|
export declare function serializeVirtualAttributes(element: Element, nodePrivacyLevel: NodePrivacyLevel, transaction: SerializationTransaction): VirtualAttributes;
|
|
7
7
|
export declare function getCssRulesString(cssStyleSheet: CSSStyleSheet | undefined | null): string | null;
|