@kubesense/kubesense-browser-rum-core 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/cjs/boot/preStartRum.d.ts +4 -3
- package/cjs/boot/preStartRum.js +229 -204
- package/cjs/boot/preStartRum.js.map +1 -1
- package/cjs/boot/rumPublicApi.d.ts +190 -51
- package/cjs/boot/rumPublicApi.js +267 -164
- package/cjs/boot/rumPublicApi.js.map +1 -1
- package/cjs/boot/startRum.d.ts +42 -31
- package/cjs/boot/startRum.js +157 -150
- package/cjs/boot/startRum.js.map +1 -1
- package/cjs/browser/cookieObservable.d.ts +1 -5
- package/cjs/browser/cookieObservable.js +30 -34
- package/cjs/browser/cookieObservable.js.map +1 -1
- package/cjs/browser/domMutationObservable.d.ts +3 -3
- package/cjs/browser/domMutationObservable.js +29 -53
- package/cjs/browser/domMutationObservable.js.map +1 -1
- package/cjs/browser/htmlDomUtils.d.ts +5 -0
- package/cjs/browser/htmlDomUtils.js +38 -28
- package/cjs/browser/htmlDomUtils.js.map +1 -1
- package/cjs/browser/locationChangeObservable.d.ts +1 -2
- package/cjs/browser/locationChangeObservable.js +44 -45
- package/cjs/browser/locationChangeObservable.js.map +1 -1
- package/cjs/browser/performanceObservable.d.ts +4 -4
- package/cjs/browser/performanceObservable.js +50 -114
- package/cjs/browser/performanceObservable.js.map +1 -1
- package/cjs/browser/performanceUtils.d.ts +13 -1
- package/cjs/browser/performanceUtils.js +63 -37
- package/cjs/browser/performanceUtils.js.map +1 -1
- package/cjs/browser/scroll.js +17 -28
- package/cjs/browser/scroll.js.map +1 -1
- package/cjs/browser/viewportObservable.d.ts +2 -3
- package/cjs/browser/viewportObservable.js +29 -31
- package/cjs/browser/viewportObservable.js.map +1 -1
- package/cjs/browser/windowOpenObservable.js +11 -7
- package/cjs/browser/windowOpenObservable.js.map +1 -1
- package/cjs/domain/action/actionCollection.d.ts +11 -12
- package/cjs/domain/action/actionCollection.js +82 -89
- package/cjs/domain/action/actionCollection.js.map +1 -1
- package/cjs/domain/action/actionNameConstants.js +10 -9
- package/cjs/domain/action/actionNameConstants.js.map +1 -1
- package/cjs/domain/action/clickChain.js +51 -54
- package/cjs/domain/action/clickChain.js.map +1 -1
- package/cjs/domain/action/computeFrustration.js +30 -62
- package/cjs/domain/action/computeFrustration.js.map +1 -1
- package/cjs/domain/action/frustrationIgnore.d.ts +9 -0
- package/cjs/domain/action/frustrationIgnore.js +32 -0
- package/cjs/domain/action/frustrationIgnore.js.map +1 -0
- package/cjs/domain/action/getActionNameFromElement.js +141 -217
- package/cjs/domain/action/getActionNameFromElement.js.map +1 -1
- package/cjs/domain/action/interactionSelectorCache.d.ts +1 -1
- package/cjs/domain/action/interactionSelectorCache.js +17 -18
- package/cjs/domain/action/interactionSelectorCache.js.map +1 -1
- package/cjs/domain/action/isActionChildEvent.d.ts +2 -0
- package/cjs/domain/action/isActionChildEvent.js +8 -0
- package/cjs/domain/action/isActionChildEvent.js.map +1 -0
- package/cjs/domain/action/listenActionEvents.d.ts +2 -3
- package/cjs/domain/action/listenActionEvents.js +51 -55
- package/cjs/domain/action/listenActionEvents.js.map +1 -1
- package/cjs/domain/action/trackClickActions.d.ts +15 -21
- package/cjs/domain/action/trackClickActions.js +188 -226
- package/cjs/domain/action/trackClickActions.js.map +1 -1
- package/cjs/domain/action/trackManualActions.d.ts +45 -0
- package/cjs/domain/action/trackManualActions.js +48 -0
- package/cjs/domain/action/trackManualActions.js.map +1 -0
- package/cjs/domain/assembly.d.ts +1 -2
- package/cjs/domain/assembly.js +80 -95
- package/cjs/domain/assembly.js.map +1 -1
- package/cjs/domain/configuration/configuration.d.ts +575 -81
- package/cjs/domain/configuration/configuration.js +464 -199
- package/cjs/domain/configuration/configuration.js.map +1 -1
- package/cjs/domain/configuration/index.d.ts +1 -0
- package/cjs/domain/configuration/index.js +27 -21
- package/cjs/domain/configuration/jsonPathParser.js +125 -139
- package/cjs/domain/configuration/jsonPathParser.js.map +1 -1
- package/cjs/domain/configuration/remoteConfiguration.d.ts +18 -5
- package/cjs/domain/configuration/remoteConfiguration.js +268 -226
- package/cjs/domain/configuration/remoteConfiguration.js.map +1 -1
- package/cjs/domain/configuration/remoteConfiguration.types.d.ts +49 -0
- package/cjs/domain/configuration/remoteConfigurationCache.d.ts +42 -0
- package/cjs/domain/configuration/remoteConfigurationCache.js +95 -0
- package/cjs/domain/configuration/remoteConfigurationCache.js.map +1 -0
- package/cjs/domain/configuration/remoteSdkConfiguration.d.ts +11 -2
- package/cjs/domain/configuration/remoteSdkConfiguration.js +185 -117
- package/cjs/domain/configuration/remoteSdkConfiguration.js.map +1 -1
- package/cjs/domain/configuration/sessionReplayRoutes.d.ts +1 -6
- package/cjs/domain/configuration/sessionReplayRoutes.js +20 -63
- package/cjs/domain/configuration/sessionReplayRoutes.js.map +1 -1
- package/cjs/domain/contexts/ciVisibilityContext.d.ts +2 -4
- package/cjs/domain/contexts/ciVisibilityContext.js +36 -32
- package/cjs/domain/contexts/ciVisibilityContext.js.map +1 -1
- package/cjs/domain/contexts/connectivityContext.d.ts +2 -2
- package/cjs/domain/contexts/connectivityContext.js +10 -9
- package/cjs/domain/contexts/connectivityContext.js.map +1 -1
- package/cjs/domain/contexts/defaultContext.d.ts +3 -3
- package/cjs/domain/contexts/defaultContext.js +28 -32
- package/cjs/domain/contexts/defaultContext.js.map +1 -1
- package/cjs/domain/contexts/displayContext.d.ts +2 -3
- package/cjs/domain/contexts/displayContext.js +22 -26
- package/cjs/domain/contexts/displayContext.js.map +1 -1
- package/cjs/domain/contexts/featureFlagContext.d.ts +2 -2
- package/cjs/domain/contexts/featureFlagContext.js +38 -50
- package/cjs/domain/contexts/featureFlagContext.js.map +1 -1
- package/cjs/domain/contexts/internalContext.d.ts +2 -3
- package/cjs/domain/contexts/internalContext.js +26 -22
- package/cjs/domain/contexts/internalContext.js.map +1 -1
- package/cjs/domain/contexts/pageStateHistory.d.ts +3 -4
- package/cjs/domain/contexts/pageStateHistory.js +76 -96
- package/cjs/domain/contexts/pageStateHistory.js.map +1 -1
- package/cjs/domain/contexts/sessionContext.d.ts +9 -3
- package/cjs/domain/contexts/sessionContext.js +31 -45
- package/cjs/domain/contexts/sessionContext.js.map +1 -1
- package/cjs/domain/contexts/sourceCodeMfeContext.d.ts +10 -0
- package/cjs/domain/contexts/sourceCodeMfeContext.js +35 -0
- package/cjs/domain/contexts/sourceCodeMfeContext.js.map +1 -0
- package/cjs/domain/contexts/syntheticsContext.d.ts +2 -2
- package/cjs/domain/contexts/syntheticsContext.js +19 -23
- package/cjs/domain/contexts/syntheticsContext.js.map +1 -1
- package/cjs/domain/contexts/trackingConsentContext.d.ts +2 -2
- package/cjs/domain/contexts/trackingConsentContext.js +10 -12
- package/cjs/domain/contexts/trackingConsentContext.js.map +1 -1
- package/cjs/domain/contexts/urlContexts.d.ts +4 -3
- package/cjs/domain/contexts/urlContexts.js +65 -61
- package/cjs/domain/contexts/urlContexts.js.map +1 -1
- package/cjs/domain/contexts/userAgentDataContext.d.ts +2 -2
- package/cjs/domain/contexts/userAgentDataContext.js +20 -29
- package/cjs/domain/contexts/userAgentDataContext.js.map +1 -1
- package/cjs/domain/contexts/viewHistory.d.ts +5 -2
- package/cjs/domain/contexts/viewHistory.js +41 -45
- package/cjs/domain/contexts/viewHistory.js.map +1 -1
- package/cjs/domain/discardNegativeDuration.d.ts +1 -1
- package/cjs/domain/discardNegativeDuration.js +6 -5
- package/cjs/domain/discardNegativeDuration.js.map +1 -1
- package/cjs/domain/error/errorCollection.d.ts +3 -3
- package/cjs/domain/error/errorCollection.js +67 -68
- package/cjs/domain/error/errorCollection.js.map +1 -1
- package/cjs/domain/error/trackReportError.d.ts +1 -2
- package/cjs/domain/error/trackReportError.js +10 -14
- package/cjs/domain/error/trackReportError.js.map +1 -1
- package/cjs/domain/event/eventCollection.d.ts +2 -1
- package/cjs/domain/event/eventCollection.js +21 -22
- package/cjs/domain/event/eventCollection.js.map +1 -1
- package/cjs/domain/eventTracker.d.ts +37 -0
- package/cjs/domain/eventTracker.js +94 -0
- package/cjs/domain/eventTracker.js.map +1 -0
- package/cjs/domain/extractRegexMatch.d.ts +5 -0
- package/cjs/domain/extractRegexMatch.js +16 -0
- package/cjs/domain/extractRegexMatch.js.map +1 -0
- package/cjs/domain/getComposedPathSelector.d.ts +22 -0
- package/cjs/domain/getComposedPathSelector.js +95 -0
- package/cjs/domain/getComposedPathSelector.js.map +1 -0
- package/cjs/domain/getSelectorFromElement.d.ts +18 -6
- package/cjs/domain/getSelectorFromElement.js +199 -191
- package/cjs/domain/getSelectorFromElement.js.map +1 -1
- package/cjs/domain/getSessionReplayUrl.d.ts +2 -2
- package/cjs/domain/getSessionReplayUrl.js +17 -30
- package/cjs/domain/getSessionReplayUrl.js.map +1 -1
- package/cjs/domain/hooks.d.ts +26 -17
- package/cjs/domain/hooks.js +12 -5
- package/cjs/domain/hooks.js.map +1 -1
- package/cjs/domain/lifeCycle.d.ts +26 -12
- package/cjs/domain/lifeCycle.js +28 -5
- package/cjs/domain/lifeCycle.js.map +1 -1
- package/cjs/domain/limitModification.d.ts +5 -1
- package/cjs/domain/limitModification.js +32 -36
- package/cjs/domain/limitModification.js.map +1 -1
- package/cjs/domain/longTask/longTaskCollection.d.ts +0 -13
- package/cjs/domain/longTask/longTaskCollection.js +75 -87
- package/cjs/domain/longTask/longTaskCollection.js.map +1 -1
- package/cjs/domain/plugins.d.ts +37 -14
- package/cjs/domain/plugins.js +22 -13
- package/cjs/domain/plugins.js.map +1 -1
- package/cjs/domain/privacy.d.ts +6 -1
- package/cjs/domain/privacy.js +143 -286
- package/cjs/domain/privacy.js.map +1 -1
- package/cjs/domain/privacyConstants.js +43 -34
- package/cjs/domain/privacyConstants.js.map +1 -1
- package/cjs/domain/requestCollection.d.ts +6 -5
- package/cjs/domain/requestCollection.js +82 -105
- package/cjs/domain/requestCollection.js.map +1 -1
- package/cjs/domain/resource/graphql.d.ts +1 -1
- package/cjs/domain/resource/graphql.js +85 -86
- package/cjs/domain/resource/graphql.js.map +1 -1
- package/cjs/domain/resource/requestRegistry.js +30 -38
- package/cjs/domain/resource/requestRegistry.js.map +1 -1
- package/cjs/domain/resource/resourceCollection.d.ts +5 -3
- package/cjs/domain/resource/resourceCollection.js +241 -175
- package/cjs/domain/resource/resourceCollection.js.map +1 -1
- package/cjs/domain/resource/resourceUtils.d.ts +13 -13
- package/cjs/domain/resource/resourceUtils.js +323 -221
- package/cjs/domain/resource/resourceUtils.js.map +1 -1
- package/cjs/domain/resource/trackManualResources.d.ts +55 -0
- package/cjs/domain/resource/trackManualResources.js +53 -0
- package/cjs/domain/resource/trackManualResources.js.map +1 -0
- package/cjs/domain/resource/webSocketCollection.d.ts +46 -0
- package/cjs/domain/resource/webSocketCollection.js +163 -0
- package/cjs/domain/resource/webSocketCollection.js.map +1 -0
- package/cjs/domain/session/session.types.d.ts +4 -0
- package/cjs/domain/sessionReplayState.d.ts +8 -0
- package/cjs/domain/sessionReplayState.js +19 -0
- package/cjs/domain/sessionReplayState.js.map +1 -0
- package/cjs/domain/startCustomerDataTelemetry.js +39 -43
- package/cjs/domain/startCustomerDataTelemetry.js.map +1 -1
- package/cjs/domain/tracing/getDocumentTraceId.d.ts +1 -1
- package/cjs/domain/tracing/getDocumentTraceId.js +42 -63
- package/cjs/domain/tracing/getDocumentTraceId.js.map +1 -1
- package/cjs/domain/tracing/identifier.js +13 -46
- package/cjs/domain/tracing/identifier.js.map +1 -1
- package/cjs/domain/tracing/tracer.d.ts +2 -5
- package/cjs/domain/tracing/tracer.js +110 -150
- package/cjs/domain/tracing/tracer.js.map +1 -1
- package/cjs/domain/trackEventCounts.js +43 -48
- package/cjs/domain/trackEventCounts.js.map +1 -1
- package/cjs/domain/view/bfCacheSupport.d.ts +1 -2
- package/cjs/domain/view/bfCacheSupport.js +10 -11
- package/cjs/domain/view/bfCacheSupport.js.map +1 -1
- package/cjs/domain/view/trackViewEventCounts.js +14 -13
- package/cjs/domain/view/trackViewEventCounts.js.map +1 -1
- package/cjs/domain/view/trackViews.d.ts +8 -2
- package/cjs/domain/view/trackViews.js +221 -270
- package/cjs/domain/view/trackViews.js.map +1 -1
- package/cjs/domain/view/viewCollection.d.ts +4 -3
- package/cjs/domain/view/viewCollection.js +124 -148
- package/cjs/domain/view/viewCollection.js.map +1 -1
- package/cjs/domain/view/viewDiff.d.ts +22 -0
- package/cjs/domain/view/viewDiff.js +62 -0
- package/cjs/domain/view/viewDiff.js.map +1 -0
- package/cjs/domain/view/viewMetrics/getClsAttributionImpactedArea.js +20 -22
- package/cjs/domain/view/viewMetrics/getClsAttributionImpactedArea.js.map +1 -1
- package/cjs/domain/view/viewMetrics/interactionCountPolyfill.d.ts +1 -0
- package/cjs/domain/view/viewMetrics/interactionCountPolyfill.js +35 -33
- package/cjs/domain/view/viewMetrics/interactionCountPolyfill.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackBfcacheMetrics.d.ts +1 -1
- package/cjs/domain/view/viewMetrics/trackBfcacheMetrics.js +14 -13
- package/cjs/domain/view/viewMetrics/trackBfcacheMetrics.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackCommonViewMetrics.d.ts +4 -2
- package/cjs/domain/view/viewMetrics/trackCommonViewMetrics.js +51 -34
- package/cjs/domain/view/viewMetrics/trackCommonViewMetrics.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackCumulativeLayoutShift.d.ts +1 -1
- package/cjs/domain/view/viewMetrics/trackCumulativeLayoutShift.js +106 -122
- package/cjs/domain/view/viewMetrics/trackCumulativeLayoutShift.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackFirstContentfulPaint.d.ts +2 -3
- package/cjs/domain/view/viewMetrics/trackFirstContentfulPaint.js +26 -34
- package/cjs/domain/view/viewMetrics/trackFirstContentfulPaint.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackFirstHidden.d.ts +2 -3
- package/cjs/domain/view/viewMetrics/trackFirstHidden.js +31 -31
- package/cjs/domain/view/viewMetrics/trackFirstHidden.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackInitialViewMetrics.d.ts +1 -3
- package/cjs/domain/view/viewMetrics/trackInitialViewMetrics.js +33 -38
- package/cjs/domain/view/viewMetrics/trackInitialViewMetrics.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackInteractionToNextPaint.d.ts +10 -1
- package/cjs/domain/view/viewMetrics/trackInteractionToNextPaint.js +202 -144
- package/cjs/domain/view/viewMetrics/trackInteractionToNextPaint.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackLargestContentfulPaint.d.ts +6 -1
- package/cjs/domain/view/viewMetrics/trackLargestContentfulPaint.js +65 -55
- package/cjs/domain/view/viewMetrics/trackLargestContentfulPaint.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackLoadingTime.d.ts +2 -1
- package/cjs/domain/view/viewMetrics/trackLoadingTime.js +42 -46
- package/cjs/domain/view/viewMetrics/trackLoadingTime.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackNavigationTimings.d.ts +2 -3
- package/cjs/domain/view/viewMetrics/trackNavigationTimings.js +28 -36
- package/cjs/domain/view/viewMetrics/trackNavigationTimings.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackScrollMetrics.d.ts +3 -4
- package/cjs/domain/view/viewMetrics/trackScrollMetrics.js +63 -72
- package/cjs/domain/view/viewMetrics/trackScrollMetrics.js.map +1 -1
- package/cjs/domain/vital/vitalCollection.d.ts +44 -20
- package/cjs/domain/vital/vitalCollection.js +81 -109
- package/cjs/domain/vital/vitalCollection.js.map +1 -1
- package/cjs/domain/waitPageActivityEnd.d.ts +1 -4
- package/cjs/domain/waitPageActivityEnd.js +99 -119
- package/cjs/domain/waitPageActivityEnd.js.map +1 -1
- package/cjs/domainContext.types.d.ts +21 -13
- package/cjs/index.d.ts +11 -10
- package/cjs/index.js +84 -62
- package/cjs/rawRumEvent.types.d.ts +79 -13
- package/cjs/rawRumEvent.types.js +40 -27
- package/cjs/rawRumEvent.types.js.map +1 -1
- package/cjs/rumEvent.types.d.ts +906 -669
- package/cjs/transport/formDataTransport.js +43 -41
- package/cjs/transport/formDataTransport.js.map +1 -1
- package/cjs/transport/startRumBatch.d.ts +27 -3
- package/cjs/transport/startRumBatch.js +132 -31
- package/cjs/transport/startRumBatch.js.map +1 -1
- package/cjs/transport/startRumEventBridge.js +10 -8
- package/cjs/transport/startRumEventBridge.js.map +1 -1
- package/esm/boot/preStartRum.mjs +233 -0
- package/esm/boot/preStartRum.mjs.map +1 -0
- package/esm/boot/rumPublicApi.mjs +271 -0
- package/esm/boot/rumPublicApi.mjs.map +1 -0
- package/esm/boot/startRum.mjs +159 -0
- package/esm/boot/startRum.mjs.map +1 -0
- package/esm/browser/cookieObservable.mjs +34 -0
- package/esm/browser/cookieObservable.mjs.map +1 -0
- package/esm/browser/domMutationObservable.mjs +33 -0
- package/esm/browser/domMutationObservable.mjs.map +1 -0
- package/esm/browser/htmlDomUtils.mjs +48 -0
- package/esm/browser/htmlDomUtils.mjs.map +1 -0
- package/esm/browser/locationChangeObservable.mjs +50 -0
- package/esm/browser/locationChangeObservable.mjs.map +1 -0
- package/esm/browser/performanceObservable.mjs +60 -0
- package/esm/browser/performanceObservable.mjs.map +1 -0
- package/esm/browser/performanceUtils.mjs +64 -0
- package/esm/browser/performanceUtils.mjs.map +1 -0
- package/esm/browser/scroll.mjs +21 -0
- package/esm/browser/scroll.mjs.map +1 -0
- package/esm/browser/viewportObservable.mjs +33 -0
- package/esm/browser/viewportObservable.mjs.map +1 -0
- package/esm/browser/windowOpenObservable.mjs +14 -0
- package/esm/browser/windowOpenObservable.mjs.map +1 -0
- package/esm/domain/action/actionCollection.mjs +89 -0
- package/esm/domain/action/actionCollection.mjs.map +1 -0
- package/esm/domain/action/actionNameConstants.mjs +11 -0
- package/esm/domain/action/actionNameConstants.mjs.map +1 -0
- package/esm/domain/action/clickChain.mjs +57 -0
- package/esm/domain/action/clickChain.mjs.map +1 -0
- package/esm/domain/action/computeFrustration.mjs +36 -0
- package/esm/domain/action/computeFrustration.mjs.map +1 -0
- package/esm/domain/action/frustrationIgnore.mjs +31 -0
- package/esm/domain/action/frustrationIgnore.mjs.map +1 -0
- package/esm/domain/action/getActionNameFromElement.mjs +163 -0
- package/esm/domain/action/getActionNameFromElement.mjs.map +1 -0
- package/esm/domain/action/interactionSelectorCache.mjs +19 -0
- package/esm/domain/action/interactionSelectorCache.mjs.map +1 -0
- package/esm/domain/action/isActionChildEvent.mjs +8 -0
- package/esm/domain/action/isActionChildEvent.mjs.map +1 -0
- package/esm/domain/action/listenActionEvents.mjs +57 -0
- package/esm/domain/action/listenActionEvents.mjs.map +1 -0
- package/esm/domain/action/trackClickActions.mjs +198 -0
- package/esm/domain/action/trackClickActions.mjs.map +1 -0
- package/esm/domain/action/trackManualActions.mjs +48 -0
- package/esm/domain/action/trackManualActions.mjs.map +1 -0
- package/esm/domain/assembly.mjs +87 -0
- package/esm/domain/assembly.mjs.map +1 -0
- package/esm/domain/configuration/configuration.mjs +474 -0
- package/esm/domain/configuration/configuration.mjs.map +1 -0
- package/esm/domain/configuration/index.mjs +6 -0
- package/esm/domain/configuration/jsonPathParser.mjs +145 -0
- package/esm/domain/configuration/jsonPathParser.mjs.map +1 -0
- package/esm/domain/configuration/remoteConfiguration.mjs +279 -0
- package/esm/domain/configuration/remoteConfiguration.mjs.map +1 -0
- package/esm/domain/configuration/remoteConfigurationCache.mjs +92 -0
- package/esm/domain/configuration/remoteConfigurationCache.mjs.map +1 -0
- package/esm/domain/configuration/remoteSdkConfiguration.mjs +208 -0
- package/esm/domain/configuration/remoteSdkConfiguration.mjs.map +1 -0
- package/esm/domain/configuration/sessionReplayRoutes.mjs +26 -0
- package/esm/domain/configuration/sessionReplayRoutes.mjs.map +1 -0
- package/esm/domain/contexts/ciVisibilityContext.mjs +37 -0
- package/esm/domain/contexts/ciVisibilityContext.mjs.map +1 -0
- package/esm/domain/contexts/connectivityContext.mjs +12 -0
- package/esm/domain/contexts/connectivityContext.mjs.map +1 -0
- package/esm/domain/contexts/defaultContext.mjs +30 -0
- package/esm/domain/contexts/defaultContext.mjs.map +1 -0
- package/esm/domain/contexts/displayContext.mjs +24 -0
- package/esm/domain/contexts/displayContext.mjs.map +1 -0
- package/esm/domain/contexts/featureFlagContext.mjs +40 -0
- package/esm/domain/contexts/featureFlagContext.mjs.map +1 -0
- package/esm/domain/contexts/internalContext.mjs +30 -0
- package/esm/domain/contexts/internalContext.mjs.map +1 -0
- package/esm/domain/contexts/pageStateHistory.mjs +82 -0
- package/esm/domain/contexts/pageStateHistory.mjs.map +1 -0
- package/esm/domain/contexts/sessionContext.mjs +33 -0
- package/esm/domain/contexts/sessionContext.mjs.map +1 -0
- package/esm/domain/contexts/sourceCodeMfeContext.mjs +35 -0
- package/esm/domain/contexts/sourceCodeMfeContext.mjs.map +1 -0
- package/esm/domain/contexts/syntheticsContext.mjs +21 -0
- package/esm/domain/contexts/syntheticsContext.mjs.map +1 -0
- package/esm/domain/contexts/trackingConsentContext.mjs +12 -0
- package/esm/domain/contexts/trackingConsentContext.mjs.map +1 -0
- package/esm/domain/contexts/urlContexts.mjs +67 -0
- package/esm/domain/contexts/urlContexts.mjs.map +1 -0
- package/esm/domain/contexts/userAgentDataContext.mjs +22 -0
- package/esm/domain/contexts/userAgentDataContext.mjs.map +1 -0
- package/esm/domain/contexts/viewHistory.mjs +43 -0
- package/esm/domain/contexts/viewHistory.mjs.map +1 -0
- package/esm/domain/discardNegativeDuration.mjs +9 -0
- package/esm/domain/discardNegativeDuration.mjs.map +1 -0
- package/esm/domain/error/errorCollection.mjs +72 -0
- package/esm/domain/error/errorCollection.mjs.map +1 -0
- package/esm/domain/error/trackReportError.mjs +12 -0
- package/esm/domain/error/trackReportError.mjs.map +1 -0
- package/esm/domain/event/eventCollection.mjs +26 -0
- package/esm/domain/event/eventCollection.mjs.map +1 -0
- package/esm/domain/eventTracker.mjs +93 -0
- package/esm/domain/eventTracker.mjs.map +1 -0
- package/esm/domain/extractRegexMatch.mjs +16 -0
- package/esm/domain/extractRegexMatch.mjs.map +1 -0
- package/esm/domain/getComposedPathSelector.mjs +93 -0
- package/esm/domain/getComposedPathSelector.mjs.map +1 -0
- package/esm/domain/getSelectorFromElement.mjs +218 -0
- package/esm/domain/getSelectorFromElement.mjs.map +1 -0
- package/esm/domain/getSessionReplayUrl.mjs +20 -0
- package/esm/domain/getSessionReplayUrl.mjs.map +1 -0
- package/esm/domain/hooks.mjs +13 -0
- package/esm/domain/hooks.mjs.map +1 -0
- package/esm/domain/lifeCycle.mjs +28 -0
- package/esm/domain/lifeCycle.mjs.map +1 -0
- package/esm/domain/limitModification.mjs +42 -0
- package/esm/domain/limitModification.mjs.map +1 -0
- package/esm/domain/longTask/longTaskCollection.mjs +79 -0
- package/esm/domain/longTask/longTaskCollection.mjs.map +1 -0
- package/esm/domain/plugins.mjs +23 -0
- package/esm/domain/plugins.mjs.map +1 -0
- package/esm/domain/privacy.mjs +161 -0
- package/esm/domain/privacy.mjs.map +1 -0
- package/esm/domain/privacyConstants.mjs +36 -0
- package/esm/domain/privacyConstants.mjs.map +1 -0
- package/esm/domain/requestCollection.mjs +86 -0
- package/esm/domain/requestCollection.mjs.map +1 -0
- package/esm/domain/resource/graphql.mjs +93 -0
- package/esm/domain/resource/graphql.mjs.map +1 -0
- package/esm/domain/resource/requestRegistry.mjs +32 -0
- package/esm/domain/resource/requestRegistry.mjs.map +1 -0
- package/esm/domain/resource/resourceCollection.mjs +256 -0
- package/esm/domain/resource/resourceCollection.mjs.map +1 -0
- package/esm/domain/resource/resourceUtils.mjs +349 -0
- package/esm/domain/resource/resourceUtils.mjs.map +1 -0
- package/esm/domain/resource/trackManualResources.mjs +53 -0
- package/esm/domain/resource/trackManualResources.mjs.map +1 -0
- package/esm/domain/resource/webSocketCollection.mjs +160 -0
- package/esm/domain/resource/webSocketCollection.mjs.map +1 -0
- package/esm/domain/sessionReplayState.mjs +18 -0
- package/esm/domain/sessionReplayState.mjs.map +1 -0
- package/esm/domain/startCustomerDataTelemetry.mjs +51 -0
- package/esm/domain/startCustomerDataTelemetry.mjs.map +1 -0
- package/esm/domain/tracing/getDocumentTraceId.mjs +50 -0
- package/esm/domain/tracing/getDocumentTraceId.mjs.map +1 -0
- package/esm/domain/tracing/identifier.mjs +20 -0
- package/esm/domain/tracing/identifier.mjs.map +1 -0
- package/esm/domain/tracing/tracer.mjs +120 -0
- package/esm/domain/tracing/tracer.mjs.map +1 -0
- package/esm/domain/trackEventCounts.mjs +45 -0
- package/esm/domain/trackEventCounts.mjs.map +1 -0
- package/esm/domain/view/bfCacheSupport.mjs +12 -0
- package/esm/domain/view/bfCacheSupport.mjs.map +1 -0
- package/esm/domain/view/trackViewEventCounts.mjs +17 -0
- package/esm/domain/view/trackViewEventCounts.mjs.map +1 -0
- package/esm/domain/view/trackViews.mjs +230 -0
- package/esm/domain/view/trackViews.mjs.map +1 -0
- package/esm/domain/view/viewCollection.mjs +129 -0
- package/esm/domain/view/viewCollection.mjs.map +1 -0
- package/esm/domain/view/viewDiff.mjs +61 -0
- package/esm/domain/view/viewDiff.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/getClsAttributionImpactedArea.mjs +30 -0
- package/esm/domain/view/viewMetrics/getClsAttributionImpactedArea.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/interactionCountPolyfill.mjs +45 -0
- package/esm/domain/view/viewMetrics/interactionCountPolyfill.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackBfcacheMetrics.mjs +18 -0
- package/esm/domain/view/viewMetrics/trackBfcacheMetrics.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackCommonViewMetrics.mjs +54 -0
- package/esm/domain/view/viewMetrics/trackCommonViewMetrics.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackCumulativeLayoutShift.mjs +117 -0
- package/esm/domain/view/viewMetrics/trackCumulativeLayoutShift.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackFirstContentfulPaint.mjs +29 -0
- package/esm/domain/view/viewMetrics/trackFirstContentfulPaint.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackFirstHidden.mjs +33 -0
- package/esm/domain/view/viewMetrics/trackFirstHidden.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackInitialViewMetrics.mjs +36 -0
- package/esm/domain/view/viewMetrics/trackInitialViewMetrics.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackInteractionToNextPaint.mjs +210 -0
- package/esm/domain/view/viewMetrics/trackInteractionToNextPaint.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackLargestContentfulPaint.mjs +70 -0
- package/esm/domain/view/viewMetrics/trackLargestContentfulPaint.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackLoadingTime.mjs +46 -0
- package/esm/domain/view/viewMetrics/trackLoadingTime.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackNavigationTimings.mjs +35 -0
- package/esm/domain/view/viewMetrics/trackNavigationTimings.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackScrollMetrics.mjs +66 -0
- package/esm/domain/view/viewMetrics/trackScrollMetrics.mjs.map +1 -0
- package/esm/domain/vital/vitalCollection.mjs +85 -0
- package/esm/domain/vital/vitalCollection.mjs.map +1 -0
- package/esm/domain/waitPageActivityEnd.mjs +107 -0
- package/esm/domain/waitPageActivityEnd.mjs.map +1 -0
- package/esm/index.mjs +23 -0
- package/esm/rawRumEvent.types.mjs +42 -0
- package/esm/rawRumEvent.types.mjs.map +1 -0
- package/esm/transport/formDataTransport.mjs +48 -0
- package/esm/transport/formDataTransport.mjs.map +1 -0
- package/esm/transport/startRumBatch.mjs +132 -0
- package/esm/transport/startRumBatch.mjs.map +1 -0
- package/esm/transport/startRumEventBridge.mjs +13 -0
- package/esm/transport/startRumEventBridge.mjs.map +1 -0
- package/package.json +19 -11
- package/src/boot/preStartRum.ts +216 -88
- package/src/boot/rumPublicApi.ts +358 -119
- package/src/boot/startRum.ts +88 -84
- package/src/browser/cookieObservable.ts +19 -28
- package/src/browser/domMutationObservable.ts +7 -12
- package/src/browser/htmlDomUtils.ts +15 -0
- package/src/browser/locationChangeObservable.ts +23 -12
- package/src/browser/performanceObservable.ts +23 -73
- package/src/browser/performanceUtils.ts +52 -4
- package/src/browser/viewportObservable.ts +4 -6
- package/src/domain/action/actionCollection.ts +94 -87
- package/src/domain/action/clickChain.ts +11 -10
- package/src/domain/action/computeFrustration.ts +19 -5
- package/src/domain/action/frustrationIgnore.ts +54 -0
- package/src/domain/action/getActionNameFromElement.ts +27 -61
- package/src/domain/action/interactionSelectorCache.ts +2 -2
- package/src/domain/action/isActionChildEvent.ts +6 -0
- package/src/domain/action/listenActionEvents.ts +2 -11
- package/src/domain/action/trackClickActions.ts +92 -82
- package/src/domain/action/trackManualActions.ts +104 -0
- package/src/domain/assembly.ts +57 -70
- package/src/domain/configuration/configuration.ts +587 -208
- package/src/domain/configuration/index.ts +1 -0
- package/src/domain/configuration/remoteConfiguration.ts +152 -29
- package/src/domain/configuration/remoteConfiguration.types.ts +51 -1
- package/src/domain/configuration/remoteConfigurationCache.ts +153 -0
- package/src/domain/configuration/remoteSdkConfiguration.ts +131 -13
- package/src/domain/configuration/sessionReplayRoutes.ts +2 -47
- package/src/domain/contexts/ciVisibilityContext.ts +23 -12
- package/src/domain/contexts/connectivityContext.ts +7 -10
- package/src/domain/contexts/defaultContext.ts +11 -14
- package/src/domain/contexts/displayContext.ts +8 -12
- package/src/domain/contexts/featureFlagContext.ts +5 -4
- package/src/domain/contexts/internalContext.ts +3 -3
- package/src/domain/contexts/pageStateHistory.ts +20 -31
- package/src/domain/contexts/sessionContext.ts +16 -22
- package/src/domain/contexts/sourceCodeMfeContext.ts +53 -0
- package/src/domain/contexts/syntheticsContext.ts +7 -17
- package/src/domain/contexts/trackingConsentContext.ts +7 -4
- package/src/domain/contexts/urlContexts.ts +13 -9
- package/src/domain/contexts/userAgentDataContext.ts +12 -13
- package/src/domain/contexts/viewHistory.ts +4 -3
- package/src/domain/discardNegativeDuration.ts +1 -1
- package/src/domain/error/errorCollection.ts +12 -22
- package/src/domain/error/trackReportError.ts +4 -7
- package/src/domain/event/eventCollection.ts +4 -2
- package/src/domain/eventTracker.ts +169 -0
- package/src/domain/extractRegexMatch.ts +15 -0
- package/src/domain/getComposedPathSelector.ts +130 -0
- package/src/domain/getSelectorFromElement.ts +125 -31
- package/src/domain/getSessionReplayUrl.ts +4 -13
- package/src/domain/hooks.ts +34 -21
- package/src/domain/lifeCycle.ts +21 -8
- package/src/domain/limitModification.ts +20 -4
- package/src/domain/longTask/longTaskCollection.ts +18 -47
- package/src/domain/plugins.ts +54 -25
- package/src/domain/privacy.ts +16 -24
- package/src/domain/requestCollection.ts +108 -97
- package/src/domain/resource/graphql.ts +71 -25
- package/src/domain/resource/requestRegistry.ts +1 -3
- package/src/domain/resource/resourceCollection.ts +319 -137
- package/src/domain/resource/resourceUtils.ts +24 -26
- package/src/domain/resource/trackManualResources.ts +121 -0
- package/src/domain/resource/webSocketCollection.ts +281 -0
- package/src/domain/session/session.types.ts +5 -0
- package/src/domain/sessionReplayState.ts +36 -0
- package/src/domain/startCustomerDataTelemetry.ts +2 -2
- package/src/domain/tracing/getDocumentTraceId.ts +5 -4
- package/src/domain/tracing/identifier.ts +6 -37
- package/src/domain/tracing/tracer.ts +22 -21
- package/src/domain/tracing/tracer.types.ts +3 -3
- package/src/domain/view/bfCacheSupport.ts +1 -6
- package/src/domain/view/trackViews.ts +40 -37
- package/src/domain/view/viewCollection.ts +29 -23
- package/src/domain/view/viewDiff.ts +115 -0
- package/src/domain/view/viewMetrics/interactionCountPolyfill.ts +13 -2
- package/src/domain/view/viewMetrics/trackBfcacheMetrics.ts +1 -1
- package/src/domain/view/viewMetrics/trackCommonViewMetrics.ts +27 -6
- package/src/domain/view/viewMetrics/trackCumulativeLayoutShift.ts +5 -3
- package/src/domain/view/viewMetrics/trackFirstContentfulPaint.ts +4 -9
- package/src/domain/view/viewMetrics/trackFirstHidden.ts +2 -8
- package/src/domain/view/viewMetrics/trackInitialViewMetrics.ts +4 -13
- package/src/domain/view/viewMetrics/trackInteractionToNextPaint.ts +180 -35
- package/src/domain/view/viewMetrics/trackLargestContentfulPaint.ts +47 -6
- package/src/domain/view/viewMetrics/trackLoadingTime.ts +4 -3
- package/src/domain/view/viewMetrics/trackNavigationTimings.ts +10 -18
- package/src/domain/view/viewMetrics/trackScrollMetrics.ts +23 -37
- package/src/domain/vital/vitalCollection.ts +83 -102
- package/src/domain/waitPageActivityEnd.ts +7 -11
- package/src/domainContext.types.ts +23 -15
- package/src/index.ts +17 -11
- package/src/rawRumEvent.types.ts +80 -26
- package/src/rumEvent.types.ts +730 -505
- package/src/transport/formDataTransport.ts +16 -6
- package/src/transport/startRumBatch.ts +181 -24
- package/cjs/browser/firstInputPolyfill.d.ts +0 -8
- package/cjs/browser/firstInputPolyfill.js +0 -68
- package/cjs/browser/firstInputPolyfill.js.map +0 -1
- package/cjs/domain/configuration/index.js.map +0 -1
- package/cjs/domain/configuration/remoteConfiguration.types.js +0 -7
- package/cjs/domain/configuration/remoteConfiguration.types.js.map +0 -1
- package/cjs/domain/error/trackConsoleError.d.ts +0 -4
- package/cjs/domain/error/trackConsoleError.js +0 -13
- package/cjs/domain/error/trackConsoleError.js.map +0 -1
- package/cjs/domain/resource/matchRequestResourceEntry.d.ts +0 -16
- package/cjs/domain/resource/matchRequestResourceEntry.js +0 -49
- package/cjs/domain/resource/matchRequestResourceEntry.js.map +0 -1
- package/cjs/domain/resource/retrieveInitialDocumentResourceTiming.d.ts +0 -4
- package/cjs/domain/resource/retrieveInitialDocumentResourceTiming.js +0 -24
- package/cjs/domain/resource/retrieveInitialDocumentResourceTiming.js.map +0 -1
- package/cjs/domain/rumSessionManager.d.ts +0 -36
- package/cjs/domain/rumSessionManager.js +0 -77
- package/cjs/domain/rumSessionManager.js.map +0 -1
- package/cjs/domain/sampler/sampler.d.ts +0 -10
- package/cjs/domain/sampler/sampler.js +0 -63
- package/cjs/domain/sampler/sampler.js.map +0 -1
- package/cjs/domain/tracing/sampler.d.ts +0 -10
- package/cjs/domain/tracing/sampler.js +0 -69
- package/cjs/domain/tracing/sampler.js.map +0 -1
- package/cjs/domain/tracing/tracer.types.js +0 -3
- package/cjs/domain/tracing/tracer.types.js.map +0 -1
- package/cjs/domain/view/viewMetrics/startInitialViewMetricsTelemetry.d.ts +0 -6
- package/cjs/domain/view/viewMetrics/startInitialViewMetricsTelemetry.js +0 -44
- package/cjs/domain/view/viewMetrics/startInitialViewMetricsTelemetry.js.map +0 -1
- package/cjs/domain/view/viewMetrics/trackFirstInput.d.ts +0 -19
- package/cjs/domain/view/viewMetrics/trackFirstInput.js +0 -43
- package/cjs/domain/view/viewMetrics/trackFirstInput.js.map +0 -1
- package/cjs/domainContext.types.js +0 -6
- package/cjs/domainContext.types.js.map +0 -1
- package/cjs/index.js.map +0 -1
- package/cjs/rumEvent.types.js +0 -7
- package/cjs/rumEvent.types.js.map +0 -1
- package/esm/boot/preStartRum.d.ts +0 -7
- package/esm/boot/preStartRum.js +0 -205
- package/esm/boot/preStartRum.js.map +0 -1
- package/esm/boot/rumPublicApi.d.ts +0 -409
- package/esm/boot/rumPublicApi.js +0 -165
- package/esm/boot/rumPublicApi.js.map +0 -1
- package/esm/boot/startRum.d.ts +0 -109
- package/esm/boot/startRum.js +0 -149
- package/esm/boot/startRum.js.map +0 -1
- package/esm/browser/cookieObservable.d.ts +0 -8
- package/esm/browser/cookieObservable.js +0 -35
- package/esm/browser/cookieObservable.js.map +0 -1
- package/esm/browser/domMutationObservable.d.ts +0 -27
- package/esm/browser/domMutationObservable.js +0 -54
- package/esm/browser/domMutationObservable.js.map +0 -1
- package/esm/browser/firstInputPolyfill.d.ts +0 -8
- package/esm/browser/firstInputPolyfill.js +0 -65
- package/esm/browser/firstInputPolyfill.js.map +0 -1
- package/esm/browser/htmlDomUtils.d.ts +0 -13
- package/esm/browser/htmlDomUtils.js +0 -36
- package/esm/browser/htmlDomUtils.js.map +0 -1
- package/esm/browser/locationChangeObservable.d.ts +0 -7
- package/esm/browser/locationChangeObservable.js +0 -48
- package/esm/browser/locationChangeObservable.js.map +0 -1
- package/esm/browser/performanceObservable.d.ts +0 -174
- package/esm/browser/performanceObservable.js +0 -121
- package/esm/browser/performanceObservable.js.map +0 -1
- package/esm/browser/performanceUtils.d.ts +0 -7
- package/esm/browser/performanceUtils.js +0 -38
- package/esm/browser/performanceUtils.js.map +0 -1
- package/esm/browser/scroll.d.ts +0 -2
- package/esm/browser/scroll.js +0 -29
- package/esm/browser/scroll.js.map +0 -1
- package/esm/browser/viewportObservable.d.ts +0 -10
- package/esm/browser/viewportObservable.js +0 -32
- package/esm/browser/viewportObservable.js.map +0 -1
- package/esm/browser/windowOpenObservable.d.ts +0 -5
- package/esm/browser/windowOpenObservable.js +0 -7
- package/esm/browser/windowOpenObservable.js.map +0 -1
- package/esm/domain/action/actionCollection.d.ts +0 -21
- package/esm/domain/action/actionCollection.js +0 -93
- package/esm/domain/action/actionCollection.js.map +0 -1
- package/esm/domain/action/actionNameConstants.d.ts +0 -18
- package/esm/domain/action/actionNameConstants.js +0 -8
- package/esm/domain/action/actionNameConstants.js.map +0 -1
- package/esm/domain/action/clickChain.d.ts +0 -8
- package/esm/domain/action/clickChain.js +0 -57
- package/esm/domain/action/clickChain.js.map +0 -1
- package/esm/domain/action/computeFrustration.d.ts +0 -6
- package/esm/domain/action/computeFrustration.js +0 -65
- package/esm/domain/action/computeFrustration.js.map +0 -1
- package/esm/domain/action/getActionNameFromElement.d.ts +0 -4
- package/esm/domain/action/getActionNameFromElement.js +0 -236
- package/esm/domain/action/getActionNameFromElement.js.map +0 -1
- package/esm/domain/action/interactionSelectorCache.d.ts +0 -5
- package/esm/domain/action/interactionSelectorCache.js +0 -18
- package/esm/domain/action/interactionSelectorCache.js.map +0 -1
- package/esm/domain/action/listenActionEvents.d.ts +0 -19
- package/esm/domain/action/listenActionEvents.js +0 -58
- package/esm/domain/action/listenActionEvents.js.map +0 -1
- package/esm/domain/action/trackClickActions.d.ts +0 -81
- package/esm/domain/action/trackClickActions.js +0 -232
- package/esm/domain/action/trackClickActions.js.map +0 -1
- package/esm/domain/assembly.d.ts +0 -5
- package/esm/domain/assembly.js +0 -99
- package/esm/domain/assembly.js.map +0 -1
- package/esm/domain/configuration/configuration.d.ts +0 -358
- package/esm/domain/configuration/configuration.js +0 -209
- package/esm/domain/configuration/configuration.js.map +0 -1
- package/esm/domain/configuration/index.d.ts +0 -4
- package/esm/domain/configuration/index.js +0 -5
- package/esm/domain/configuration/index.js.map +0 -1
- package/esm/domain/configuration/jsonPathParser.d.ts +0 -28
- package/esm/domain/configuration/jsonPathParser.js +0 -156
- package/esm/domain/configuration/jsonPathParser.js.map +0 -1
- package/esm/domain/configuration/remoteConfiguration.d.ts +0 -39
- package/esm/domain/configuration/remoteConfiguration.js +0 -236
- package/esm/domain/configuration/remoteConfiguration.js.map +0 -1
- package/esm/domain/configuration/remoteConfiguration.types.d.ts +0 -138
- package/esm/domain/configuration/remoteConfiguration.types.js +0 -6
- package/esm/domain/configuration/remoteConfiguration.types.js.map +0 -1
- package/esm/domain/configuration/remoteSdkConfiguration.d.ts +0 -18
- package/esm/domain/configuration/remoteSdkConfiguration.js +0 -137
- package/esm/domain/configuration/remoteSdkConfiguration.js.map +0 -1
- package/esm/domain/configuration/sessionReplayRoutes.d.ts +0 -35
- package/esm/domain/configuration/sessionReplayRoutes.js +0 -65
- package/esm/domain/configuration/sessionReplayRoutes.js.map +0 -1
- package/esm/domain/contexts/ciVisibilityContext.d.ts +0 -12
- package/esm/domain/contexts/ciVisibilityContext.js +0 -30
- package/esm/domain/contexts/ciVisibilityContext.js.map +0 -1
- package/esm/domain/contexts/connectivityContext.d.ts +0 -2
- package/esm/domain/contexts/connectivityContext.js +0 -8
- package/esm/domain/contexts/connectivityContext.js.map +0 -1
- package/esm/domain/contexts/defaultContext.d.ts +0 -4
- package/esm/domain/contexts/defaultContext.js +0 -31
- package/esm/domain/contexts/defaultContext.js.map +0 -1
- package/esm/domain/contexts/displayContext.d.ts +0 -6
- package/esm/domain/contexts/displayContext.js +0 -25
- package/esm/domain/contexts/displayContext.js.map +0 -1
- package/esm/domain/contexts/featureFlagContext.d.ts +0 -19
- package/esm/domain/contexts/featureFlagContext.js +0 -49
- package/esm/domain/contexts/featureFlagContext.js.map +0 -1
- package/esm/domain/contexts/internalContext.d.ts +0 -12
- package/esm/domain/contexts/internalContext.js +0 -23
- package/esm/domain/contexts/internalContext.js.map +0 -1
- package/esm/domain/contexts/pageStateHistory.d.ts +0 -23
- package/esm/domain/contexts/pageStateHistory.js +0 -100
- package/esm/domain/contexts/pageStateHistory.js.map +0 -1
- package/esm/domain/contexts/sessionContext.d.ts +0 -5
- package/esm/domain/contexts/sessionContext.js +0 -44
- package/esm/domain/contexts/sessionContext.js.map +0 -1
- package/esm/domain/contexts/syntheticsContext.d.ts +0 -2
- package/esm/domain/contexts/syntheticsContext.js +0 -22
- package/esm/domain/contexts/syntheticsContext.js.map +0 -1
- package/esm/domain/contexts/trackingConsentContext.d.ts +0 -3
- package/esm/domain/contexts/trackingConsentContext.js +0 -11
- package/esm/domain/contexts/trackingConsentContext.js.map +0 -1
- package/esm/domain/contexts/urlContexts.d.ts +0 -22
- package/esm/domain/contexts/urlContexts.js +0 -60
- package/esm/domain/contexts/urlContexts.js.map +0 -1
- package/esm/domain/contexts/userAgentDataContext.d.ts +0 -2
- package/esm/domain/contexts/userAgentDataContext.js +0 -28
- package/esm/domain/contexts/userAgentDataContext.js.map +0 -1
- package/esm/domain/contexts/viewHistory.d.ts +0 -17
- package/esm/domain/contexts/viewHistory.js +0 -44
- package/esm/domain/contexts/viewHistory.js.map +0 -1
- package/esm/domain/discardNegativeDuration.d.ts +0 -2
- package/esm/domain/discardNegativeDuration.js +0 -5
- package/esm/domain/discardNegativeDuration.js.map +0 -1
- package/esm/domain/error/errorCollection.d.ts +0 -17
- package/esm/domain/error/errorCollection.js +0 -70
- package/esm/domain/error/errorCollection.js.map +0 -1
- package/esm/domain/error/trackConsoleError.d.ts +0 -4
- package/esm/domain/error/trackConsoleError.js +0 -10
- package/esm/domain/error/trackConsoleError.js.map +0 -1
- package/esm/domain/error/trackReportError.d.ts +0 -5
- package/esm/domain/error/trackReportError.js +0 -13
- package/esm/domain/error/trackReportError.js.map +0 -1
- package/esm/domain/event/eventCollection.d.ts +0 -10
- package/esm/domain/event/eventCollection.js +0 -24
- package/esm/domain/event/eventCollection.js.map +0 -1
- package/esm/domain/getSelectorFromElement.d.ts +0 -64
- package/esm/domain/getSelectorFromElement.js +0 -213
- package/esm/domain/getSelectorFromElement.js.map +0 -1
- package/esm/domain/getSessionReplayUrl.d.ts +0 -9
- package/esm/domain/getSessionReplayUrl.js +0 -30
- package/esm/domain/getSessionReplayUrl.js.map +0 -1
- package/esm/domain/hooks.d.ts +0 -23
- package/esm/domain/hooks.js +0 -3
- package/esm/domain/hooks.js.map +0 -1
- package/esm/domain/lifeCycle.d.ts +0 -73
- package/esm/domain/lifeCycle.js +0 -3
- package/esm/domain/lifeCycle.js.map +0 -1
- package/esm/domain/limitModification.d.ts +0 -8
- package/esm/domain/limitModification.js +0 -43
- package/esm/domain/limitModification.js.map +0 -1
- package/esm/domain/longTask/longTaskCollection.d.ts +0 -18
- package/esm/domain/longTask/longTaskCollection.js +0 -87
- package/esm/domain/longTask/longTaskCollection.js.map +0 -1
- package/esm/domain/plugins.d.ts +0 -40
- package/esm/domain/plugins.js +0 -12
- package/esm/domain/plugins.js.map +0 -1
- package/esm/domain/privacy.d.ts +0 -44
- package/esm/domain/privacy.js +0 -302
- package/esm/domain/privacy.js.map +0 -1
- package/esm/domain/privacyConstants.d.ts +0 -23
- package/esm/domain/privacyConstants.js +0 -35
- package/esm/domain/privacyConstants.js.map +0 -1
- package/esm/domain/requestCollection.d.ts +0 -54
- package/esm/domain/requestCollection.js +0 -106
- package/esm/domain/requestCollection.js.map +0 -1
- package/esm/domain/resource/graphql.d.ts +0 -23
- package/esm/domain/resource/graphql.js +0 -91
- package/esm/domain/resource/graphql.js.map +0 -1
- package/esm/domain/resource/matchRequestResourceEntry.d.ts +0 -16
- package/esm/domain/resource/matchRequestResourceEntry.js +0 -46
- package/esm/domain/resource/matchRequestResourceEntry.js.map +0 -1
- package/esm/domain/resource/requestRegistry.d.ts +0 -9
- package/esm/domain/resource/requestRegistry.js +0 -37
- package/esm/domain/resource/requestRegistry.js.map +0 -1
- package/esm/domain/resource/resourceCollection.d.ts +0 -7
- package/esm/domain/resource/resourceCollection.js +0 -187
- package/esm/domain/resource/resourceCollection.js.map +0 -1
- package/esm/domain/resource/resourceUtils.d.ts +0 -55
- package/esm/domain/resource/resourceUtils.js +0 -244
- package/esm/domain/resource/resourceUtils.js.map +0 -1
- package/esm/domain/resource/retrieveInitialDocumentResourceTiming.d.ts +0 -4
- package/esm/domain/resource/retrieveInitialDocumentResourceTiming.js +0 -21
- package/esm/domain/resource/retrieveInitialDocumentResourceTiming.js.map +0 -1
- package/esm/domain/rumSessionManager.d.ts +0 -36
- package/esm/domain/rumSessionManager.js +0 -72
- package/esm/domain/rumSessionManager.js.map +0 -1
- package/esm/domain/sampler/sampler.d.ts +0 -10
- package/esm/domain/sampler/sampler.js +0 -58
- package/esm/domain/sampler/sampler.js.map +0 -1
- package/esm/domain/startCustomerDataTelemetry.d.ts +0 -4
- package/esm/domain/startCustomerDataTelemetry.js +0 -52
- package/esm/domain/startCustomerDataTelemetry.js.map +0 -1
- package/esm/domain/tracing/getDocumentTraceId.d.ts +0 -12
- package/esm/domain/tracing/getDocumentTraceId.js +0 -68
- package/esm/domain/tracing/getDocumentTraceId.js.map +0 -1
- package/esm/domain/tracing/identifier.d.ts +0 -13
- package/esm/domain/tracing/identifier.js +0 -50
- package/esm/domain/tracing/identifier.js.map +0 -1
- package/esm/domain/tracing/sampler.d.ts +0 -10
- package/esm/domain/tracing/sampler.js +0 -64
- package/esm/domain/tracing/sampler.js.map +0 -1
- package/esm/domain/tracing/tracer.d.ts +0 -30
- package/esm/domain/tracing/tracer.js +0 -156
- package/esm/domain/tracing/tracer.js.map +0 -1
- package/esm/domain/tracing/tracer.types.d.ts +0 -12
- package/esm/domain/tracing/tracer.types.js +0 -2
- package/esm/domain/tracing/tracer.types.js.map +0 -1
- package/esm/domain/trackEventCounts.d.ts +0 -17
- package/esm/domain/trackEventCounts.js +0 -47
- package/esm/domain/trackEventCounts.js.map +0 -1
- package/esm/domain/view/bfCacheSupport.d.ts +0 -2
- package/esm/domain/view/bfCacheSupport.js +0 -10
- package/esm/domain/view/bfCacheSupport.js.map +0 -1
- package/esm/domain/view/trackViewEventCounts.d.ts +0 -5
- package/esm/domain/view/trackViewEventCounts.js +0 -13
- package/esm/domain/view/trackViewEventCounts.js.map +0 -1
- package/esm/domain/view/trackViews.d.ts +0 -65
- package/esm/domain/view/trackViews.js +0 -278
- package/esm/domain/view/trackViews.js.map +0 -1
- package/esm/domain/view/viewCollection.d.ts +0 -18
- package/esm/domain/view/viewCollection.js +0 -150
- package/esm/domain/view/viewCollection.js.map +0 -1
- package/esm/domain/view/viewMetrics/getClsAttributionImpactedArea.d.ts +0 -6
- package/esm/domain/view/viewMetrics/getClsAttributionImpactedArea.js +0 -28
- package/esm/domain/view/viewMetrics/getClsAttributionImpactedArea.js.map +0 -1
- package/esm/domain/view/viewMetrics/interactionCountPolyfill.d.ts +0 -18
- package/esm/domain/view/viewMetrics/interactionCountPolyfill.js +0 -39
- package/esm/domain/view/viewMetrics/interactionCountPolyfill.js.map +0 -1
- package/esm/domain/view/viewMetrics/startInitialViewMetricsTelemetry.d.ts +0 -6
- package/esm/domain/view/viewMetrics/startInitialViewMetricsTelemetry.js +0 -41
- package/esm/domain/view/viewMetrics/startInitialViewMetricsTelemetry.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackBfcacheMetrics.d.ts +0 -8
- package/esm/domain/view/viewMetrics/trackBfcacheMetrics.js +0 -14
- package/esm/domain/view/viewMetrics/trackBfcacheMetrics.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackCommonViewMetrics.d.ts +0 -21
- package/esm/domain/view/viewMetrics/trackCommonViewMetrics.js +0 -34
- package/esm/domain/view/viewMetrics/trackCommonViewMetrics.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackCumulativeLayoutShift.d.ts +0 -37
- package/esm/domain/view/viewMetrics/trackCumulativeLayoutShift.js +0 -130
- package/esm/domain/view/viewMetrics/trackCumulativeLayoutShift.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackFirstContentfulPaint.d.ts +0 -13
- package/esm/domain/view/viewMetrics/trackFirstContentfulPaint.js +0 -34
- package/esm/domain/view/viewMetrics/trackFirstContentfulPaint.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackFirstHidden.d.ts +0 -10
- package/esm/domain/view/viewMetrics/trackFirstHidden.js +0 -30
- package/esm/domain/view/viewMetrics/trackFirstHidden.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackFirstInput.d.ts +0 -19
- package/esm/domain/view/viewMetrics/trackFirstInput.js +0 -40
- package/esm/domain/view/viewMetrics/trackFirstInput.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackInitialViewMetrics.d.ts +0 -15
- package/esm/domain/view/viewMetrics/trackInitialViewMetrics.js +0 -38
- package/esm/domain/view/viewMetrics/trackInitialViewMetrics.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackInteractionToNextPaint.d.ts +0 -25
- package/esm/domain/view/viewMetrics/trackInteractionToNextPaint.js +0 -149
- package/esm/domain/view/viewMetrics/trackInteractionToNextPaint.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackLargestContentfulPaint.d.ts +0 -18
- package/esm/domain/view/viewMetrics/trackLargestContentfulPaint.js +0 -57
- package/esm/domain/view/viewMetrics/trackLargestContentfulPaint.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackLoadingTime.d.ts +0 -14
- package/esm/domain/view/viewMetrics/trackLoadingTime.js +0 -47
- package/esm/domain/view/viewMetrics/trackLoadingTime.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackNavigationTimings.d.ts +0 -14
- package/esm/domain/view/viewMetrics/trackNavigationTimings.js +0 -40
- package/esm/domain/view/viewMetrics/trackNavigationTimings.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackScrollMetrics.d.ts +0 -25
- package/esm/domain/view/viewMetrics/trackScrollMetrics.js +0 -72
- package/esm/domain/view/viewMetrics/trackScrollMetrics.js.map +0 -1
- package/esm/domain/vital/vitalCollection.d.ts +0 -55
- package/esm/domain/vital/vitalCollection.js +0 -107
- package/esm/domain/vital/vitalCollection.js.map +0 -1
- package/esm/domain/waitPageActivityEnd.d.ts +0 -54
- package/esm/domain/waitPageActivityEnd.js +0 -123
- package/esm/domain/waitPageActivityEnd.js.map +0 -1
- package/esm/domainContext.types.d.ts +0 -39
- package/esm/domainContext.types.js +0 -5
- package/esm/domainContext.types.js.map +0 -1
- package/esm/index.d.ts +0 -42
- package/esm/index.js +0 -22
- package/esm/index.js.map +0 -1
- package/esm/rawRumEvent.types.d.ts +0 -326
- package/esm/rawRumEvent.types.js +0 -31
- package/esm/rawRumEvent.types.js.map +0 -1
- package/esm/rumEvent.types.d.ts +0 -2038
- package/esm/rumEvent.types.js +0 -6
- package/esm/rumEvent.types.js.map +0 -1
- package/esm/transport/formDataTransport.d.ts +0 -16
- package/esm/transport/formDataTransport.js +0 -43
- package/esm/transport/formDataTransport.js.map +0 -1
- package/esm/transport/startRumBatch.d.ts +0 -5
- package/esm/transport/startRumBatch.js +0 -30
- package/esm/transport/startRumBatch.js.map +0 -1
- package/esm/transport/startRumEventBridge.d.ts +0 -2
- package/esm/transport/startRumEventBridge.js +0 -8
- package/esm/transport/startRumEventBridge.js.map +0 -1
- package/src/browser/firstInputPolyfill.ts +0 -87
- package/src/domain/error/trackConsoleError.ts +0 -14
- package/src/domain/resource/matchRequestResourceEntry.ts +0 -68
- package/src/domain/resource/retrieveInitialDocumentResourceTiming.ts +0 -27
- package/src/domain/rumSessionManager.ts +0 -134
- package/src/domain/sampler/sampler.ts +0 -63
- package/src/domain/tracing/sampler.ts +0 -69
- package/src/domain/view/viewMetrics/startInitialViewMetricsTelemetry.ts +0 -70
- package/src/domain/view/viewMetrics/trackFirstInput.ts +0 -59
|
@@ -1,282 +1,233 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const
|
|
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
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
if (locationChangeSubscription) {
|
|
87
|
-
locationChangeSubscription.unsubscribe();
|
|
88
|
-
}
|
|
89
|
-
if (stopOnBFCacheRestore) {
|
|
90
|
-
stopOnBFCacheRestore();
|
|
91
|
-
}
|
|
92
|
-
currentView.end();
|
|
93
|
-
activeViews.forEach((view) => view.stop());
|
|
94
|
-
},
|
|
95
|
-
};
|
|
1
|
+
const require_rawRumEvent_types = require("../../rawRumEvent.types.js");
|
|
2
|
+
require("../lifeCycle.js");
|
|
3
|
+
const require_trackViewEventCounts = require("./trackViewEventCounts.js");
|
|
4
|
+
const require_trackInitialViewMetrics = require("./viewMetrics/trackInitialViewMetrics.js");
|
|
5
|
+
const require_trackCommonViewMetrics = require("./viewMetrics/trackCommonViewMetrics.js");
|
|
6
|
+
const require_bfCacheSupport = require("./bfCacheSupport.js");
|
|
7
|
+
const require_trackBfcacheMetrics = require("./viewMetrics/trackBfcacheMetrics.js");
|
|
8
|
+
let _kubesense_kubesense_js_core_time = require("@kubesense/kubesense-js-core/time");
|
|
9
|
+
let _kubesense_kubesense_browser_core = require("@kubesense/kubesense-browser-core");
|
|
10
|
+
//#region src/domain/view/trackViews.ts
|
|
11
|
+
const THROTTLE_VIEW_UPDATE_PERIOD = 3e3;
|
|
12
|
+
const SESSION_KEEP_ALIVE_INTERVAL = 5 * _kubesense_kubesense_js_core_time.ONE_MINUTE;
|
|
13
|
+
const KEEP_TRACKING_AFTER_VIEW_DELAY = 5 * _kubesense_kubesense_js_core_time.ONE_MINUTE;
|
|
14
|
+
function trackViews(lifeCycle, domMutationObservable, windowOpenObservable, configuration, locationChangeObservable, areViewsTrackedAutomatically, initialViewOptions) {
|
|
15
|
+
const activeViews = /* @__PURE__ */ new Set();
|
|
16
|
+
let currentView = startNewView(require_rawRumEvent_types.ViewLoadingType.INITIAL_LOAD, (0, _kubesense_kubesense_js_core_time.clocksOrigin)(), initialViewOptions);
|
|
17
|
+
let stopOnBFCacheRestore;
|
|
18
|
+
startViewLifeCycle();
|
|
19
|
+
let locationChangeSubscription;
|
|
20
|
+
if (areViewsTrackedAutomatically) {
|
|
21
|
+
locationChangeSubscription = renewViewOnLocationChange(locationChangeObservable);
|
|
22
|
+
stopOnBFCacheRestore = require_bfCacheSupport.onBFCacheRestore((pageshowEvent) => {
|
|
23
|
+
currentView.end();
|
|
24
|
+
const startClocks = (0, _kubesense_kubesense_js_core_time.relativeToClocks)(pageshowEvent.timeStamp);
|
|
25
|
+
currentView = startNewView(require_rawRumEvent_types.ViewLoadingType.BF_CACHE, startClocks, void 0);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
function startNewView(loadingType, startClocks, viewOptions) {
|
|
29
|
+
const newlyCreatedView = newView(lifeCycle, domMutationObservable, windowOpenObservable, configuration, loadingType, startClocks, viewOptions);
|
|
30
|
+
activeViews.add(newlyCreatedView);
|
|
31
|
+
newlyCreatedView.stopObservable.subscribe(() => {
|
|
32
|
+
activeViews.delete(newlyCreatedView);
|
|
33
|
+
});
|
|
34
|
+
return newlyCreatedView;
|
|
35
|
+
}
|
|
36
|
+
function startViewLifeCycle() {
|
|
37
|
+
lifeCycle.subscribe(11, () => {
|
|
38
|
+
currentView = startNewView(require_rawRumEvent_types.ViewLoadingType.SESSION_RENEWAL, void 0, {
|
|
39
|
+
name: currentView.name,
|
|
40
|
+
service: currentView.service,
|
|
41
|
+
version: currentView.version,
|
|
42
|
+
context: currentView.contextManager.getContext()
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
lifeCycle.subscribe(10, ({ endClocks }) => {
|
|
46
|
+
currentView.end({
|
|
47
|
+
sessionIsActive: false,
|
|
48
|
+
endClocks
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
function renewViewOnLocationChange(locationChangeObservable) {
|
|
53
|
+
return locationChangeObservable.subscribe(({ oldLocation, newLocation }) => {
|
|
54
|
+
if (areDifferentLocation(oldLocation, newLocation)) {
|
|
55
|
+
currentView.end();
|
|
56
|
+
currentView = startNewView(require_rawRumEvent_types.ViewLoadingType.ROUTE_CHANGE);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
addTiming: (name, time = (0, _kubesense_kubesense_js_core_time.timeStampNow)()) => {
|
|
62
|
+
currentView.addTiming(name, time);
|
|
63
|
+
},
|
|
64
|
+
setLoadingTime: (callTimestamp) => currentView.setLoadingTime(callTimestamp),
|
|
65
|
+
startView: (options, startClocks) => {
|
|
66
|
+
currentView.end({ endClocks: startClocks });
|
|
67
|
+
currentView = startNewView(require_rawRumEvent_types.ViewLoadingType.ROUTE_CHANGE, startClocks, options);
|
|
68
|
+
},
|
|
69
|
+
setViewContext: (context) => {
|
|
70
|
+
currentView.contextManager.setContext(context);
|
|
71
|
+
},
|
|
72
|
+
setViewContextProperty: (key, value) => {
|
|
73
|
+
currentView.contextManager.setContextProperty(key, value);
|
|
74
|
+
},
|
|
75
|
+
setViewName: (name) => {
|
|
76
|
+
currentView.setViewName(name);
|
|
77
|
+
},
|
|
78
|
+
getViewContext: () => currentView.contextManager.getContext(),
|
|
79
|
+
stop: () => {
|
|
80
|
+
if (locationChangeSubscription) locationChangeSubscription.unsubscribe();
|
|
81
|
+
if (stopOnBFCacheRestore) stopOnBFCacheRestore();
|
|
82
|
+
currentView.end();
|
|
83
|
+
activeViews.forEach((view) => view.stop());
|
|
84
|
+
}
|
|
85
|
+
};
|
|
96
86
|
}
|
|
97
|
-
function newView(lifeCycle, domMutationObservable, windowOpenObservable, configuration,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
contextManager,
|
|
218
|
-
stopObservable,
|
|
219
|
-
end(options = {}) {
|
|
220
|
-
var _a, _b;
|
|
221
|
-
if (endClocks) {
|
|
222
|
-
// view already ended
|
|
223
|
-
return;
|
|
224
|
-
}
|
|
225
|
-
endClocks = (_a = options.endClocks) !== null && _a !== void 0 ? _a : (0, kubesense_browser_core_1.clocksNow)();
|
|
226
|
-
sessionIsActive = (_b = options.sessionIsActive) !== null && _b !== void 0 ? _b : true;
|
|
227
|
-
lifeCycle.notify(5 /* LifeCycleEventType.VIEW_ENDED */, { endClocks });
|
|
228
|
-
lifeCycle.notify(6 /* LifeCycleEventType.AFTER_VIEW_ENDED */, { endClocks });
|
|
229
|
-
(0, kubesense_browser_core_1.clearInterval)(keepAliveIntervalId);
|
|
230
|
-
setViewEnd(endClocks.relative);
|
|
231
|
-
stopCommonViewMetricsTracking();
|
|
232
|
-
pageMayExitSubscription.unsubscribe();
|
|
233
|
-
triggerViewUpdate();
|
|
234
|
-
(0, kubesense_browser_core_1.setTimeout)(() => {
|
|
235
|
-
this.stop();
|
|
236
|
-
}, exports.KEEP_TRACKING_AFTER_VIEW_DELAY);
|
|
237
|
-
},
|
|
238
|
-
stop() {
|
|
239
|
-
stopInitialViewMetricsTracking();
|
|
240
|
-
stopEventCountsTracking();
|
|
241
|
-
stopINPTracking();
|
|
242
|
-
stopObservable.notify();
|
|
243
|
-
},
|
|
244
|
-
addTiming(name, time) {
|
|
245
|
-
if (endClocks) {
|
|
246
|
-
return;
|
|
247
|
-
}
|
|
248
|
-
const relativeTime = (0, kubesense_browser_core_1.looksLikeRelativeTime)(time) ? time : (0, kubesense_browser_core_1.elapsed)(startClocks.timeStamp, time);
|
|
249
|
-
customTimings[sanitizeTiming(name)] = relativeTime;
|
|
250
|
-
scheduleViewUpdate();
|
|
251
|
-
},
|
|
252
|
-
setViewName(updatedName) {
|
|
253
|
-
name = updatedName;
|
|
254
|
-
triggerViewUpdate();
|
|
255
|
-
},
|
|
256
|
-
};
|
|
87
|
+
function newView(lifeCycle, domMutationObservable, windowOpenObservable, configuration, loadingType, startClocks = (0, _kubesense_kubesense_js_core_time.clocksNow)(), viewOptions) {
|
|
88
|
+
const id = (0, _kubesense_kubesense_browser_core.generateUUID)();
|
|
89
|
+
const stopObservable = new _kubesense_kubesense_browser_core.Observable();
|
|
90
|
+
const customTimings = {};
|
|
91
|
+
let documentVersion = 0;
|
|
92
|
+
let endClocks;
|
|
93
|
+
const location = (0, _kubesense_kubesense_browser_core.shallowClone)((0, _kubesense_kubesense_browser_core.mockable)(window.location));
|
|
94
|
+
const contextManager = (0, _kubesense_kubesense_browser_core.createContextManager)();
|
|
95
|
+
let sessionIsActive = true;
|
|
96
|
+
let name = viewOptions?.name;
|
|
97
|
+
const service = viewOptions?.service || configuration.service;
|
|
98
|
+
const version = viewOptions?.version || configuration.version;
|
|
99
|
+
const context = viewOptions?.context;
|
|
100
|
+
const handlingStack = viewOptions?.handlingStack;
|
|
101
|
+
if (context) contextManager.setContext(context);
|
|
102
|
+
const viewCreatedEvent = {
|
|
103
|
+
id,
|
|
104
|
+
name,
|
|
105
|
+
startClocks,
|
|
106
|
+
service,
|
|
107
|
+
version,
|
|
108
|
+
context,
|
|
109
|
+
url: viewOptions?.url
|
|
110
|
+
};
|
|
111
|
+
lifeCycle.notify(1, viewCreatedEvent);
|
|
112
|
+
lifeCycle.notify(2, viewCreatedEvent);
|
|
113
|
+
const { throttled, cancel: cancelScheduleViewUpdate } = (0, _kubesense_kubesense_browser_core.throttle)(triggerViewUpdate, THROTTLE_VIEW_UPDATE_PERIOD, { leading: false });
|
|
114
|
+
const { setLoadEvent, setViewEnd, stop: stopCommonViewMetricsTracking, stopINPTracking, getCommonViewMetrics, setLoadingTime } = require_trackCommonViewMetrics.trackCommonViewMetrics(lifeCycle, domMutationObservable, windowOpenObservable, configuration, scheduleViewUpdate, loadingType, startClocks);
|
|
115
|
+
const { stop: stopInitialViewMetricsTracking, initialViewMetrics } = loadingType === require_rawRumEvent_types.ViewLoadingType.INITIAL_LOAD ? require_trackInitialViewMetrics.trackInitialViewMetrics(configuration, startClocks, setLoadEvent, scheduleViewUpdate) : {
|
|
116
|
+
stop: _kubesense_kubesense_browser_core.noop,
|
|
117
|
+
initialViewMetrics: {}
|
|
118
|
+
};
|
|
119
|
+
if (loadingType === require_rawRumEvent_types.ViewLoadingType.BF_CACHE) require_trackBfcacheMetrics.trackBfcacheMetrics(startClocks, initialViewMetrics, scheduleViewUpdate);
|
|
120
|
+
const { stop: stopEventCountsTracking, eventCounts } = require_trackViewEventCounts.trackViewEventCounts(lifeCycle, id, scheduleViewUpdate);
|
|
121
|
+
const keepAliveIntervalId = (0, _kubesense_kubesense_browser_core.setInterval)(triggerViewUpdate, SESSION_KEEP_ALIVE_INTERVAL);
|
|
122
|
+
const pageMayExitSubscription = lifeCycle.subscribe(12, (reason) => {
|
|
123
|
+
if (reason === _kubesense_kubesense_browser_core.PageExitReason.UNLOADING || reason === _kubesense_kubesense_browser_core.PageExitReason.PAGEHIDE) triggerViewUpdate(true);
|
|
124
|
+
});
|
|
125
|
+
triggerViewUpdate();
|
|
126
|
+
contextManager.changeObservable.subscribe(scheduleViewUpdate);
|
|
127
|
+
function triggerBeforeViewUpdate() {
|
|
128
|
+
lifeCycle.notify(3, {
|
|
129
|
+
id,
|
|
130
|
+
name,
|
|
131
|
+
context: contextManager.getContext(),
|
|
132
|
+
startClocks,
|
|
133
|
+
sessionIsActive
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
function scheduleViewUpdate() {
|
|
137
|
+
triggerBeforeViewUpdate();
|
|
138
|
+
throttled();
|
|
139
|
+
}
|
|
140
|
+
function triggerViewUpdate(forceInactive = false) {
|
|
141
|
+
cancelScheduleViewUpdate();
|
|
142
|
+
triggerBeforeViewUpdate();
|
|
143
|
+
documentVersion += 1;
|
|
144
|
+
const currentEnd = endClocks === void 0 ? (0, _kubesense_kubesense_js_core_time.timeStampNow)() : endClocks.timeStamp;
|
|
145
|
+
lifeCycle.notify(4, {
|
|
146
|
+
customTimings,
|
|
147
|
+
documentVersion,
|
|
148
|
+
id,
|
|
149
|
+
name,
|
|
150
|
+
service,
|
|
151
|
+
version,
|
|
152
|
+
context: contextManager.getContext(),
|
|
153
|
+
loadingType,
|
|
154
|
+
location,
|
|
155
|
+
handlingStack,
|
|
156
|
+
startClocks,
|
|
157
|
+
commonViewMetrics: getCommonViewMetrics(),
|
|
158
|
+
initialViewMetrics,
|
|
159
|
+
duration: (0, _kubesense_kubesense_js_core_time.elapsed)(startClocks.timeStamp, currentEnd),
|
|
160
|
+
isActive: !forceInactive && endClocks === void 0,
|
|
161
|
+
sessionIsActive,
|
|
162
|
+
eventCounts
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
return {
|
|
166
|
+
get name() {
|
|
167
|
+
return name;
|
|
168
|
+
},
|
|
169
|
+
service,
|
|
170
|
+
version,
|
|
171
|
+
contextManager,
|
|
172
|
+
stopObservable,
|
|
173
|
+
end(options = {}) {
|
|
174
|
+
if (endClocks) return;
|
|
175
|
+
endClocks = options.endClocks ?? (0, _kubesense_kubesense_js_core_time.clocksNow)();
|
|
176
|
+
if (endClocks.relative < startClocks.relative) endClocks = startClocks;
|
|
177
|
+
sessionIsActive = options.sessionIsActive ?? true;
|
|
178
|
+
lifeCycle.notify(5, { endClocks });
|
|
179
|
+
lifeCycle.notify(6, { endClocks });
|
|
180
|
+
(0, _kubesense_kubesense_browser_core.clearInterval)(keepAliveIntervalId);
|
|
181
|
+
setViewEnd(endClocks.relative);
|
|
182
|
+
stopCommonViewMetricsTracking();
|
|
183
|
+
pageMayExitSubscription.unsubscribe();
|
|
184
|
+
triggerViewUpdate();
|
|
185
|
+
(0, _kubesense_kubesense_browser_core.setTimeout)(() => {
|
|
186
|
+
this.stop();
|
|
187
|
+
}, KEEP_TRACKING_AFTER_VIEW_DELAY);
|
|
188
|
+
},
|
|
189
|
+
stop() {
|
|
190
|
+
stopInitialViewMetricsTracking();
|
|
191
|
+
stopEventCountsTracking();
|
|
192
|
+
stopINPTracking();
|
|
193
|
+
stopObservable.notify();
|
|
194
|
+
},
|
|
195
|
+
addTiming(name, time) {
|
|
196
|
+
if (endClocks) return;
|
|
197
|
+
const relativeTime = (0, _kubesense_kubesense_js_core_time.isRelativeTime)(time) ? time : (0, _kubesense_kubesense_js_core_time.elapsed)(startClocks.timeStamp, time);
|
|
198
|
+
customTimings[sanitizeTiming(name)] = relativeTime;
|
|
199
|
+
scheduleViewUpdate();
|
|
200
|
+
},
|
|
201
|
+
setLoadingTime,
|
|
202
|
+
setViewName(updatedName) {
|
|
203
|
+
name = updatedName;
|
|
204
|
+
triggerViewUpdate();
|
|
205
|
+
}
|
|
206
|
+
};
|
|
257
207
|
}
|
|
258
208
|
/**
|
|
259
|
-
|
|
260
|
-
|
|
209
|
+
* Timing name is used as facet path that must contain only letters, digits, or the characters - _ . @ $
|
|
210
|
+
*/
|
|
261
211
|
function sanitizeTiming(name) {
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
}
|
|
266
|
-
return sanitized;
|
|
212
|
+
const sanitized = name.replace(/[^a-zA-Z0-9-_.@$]/g, "_");
|
|
213
|
+
if (sanitized !== name) _kubesense_kubesense_browser_core.display.warn(`Invalid timing name: ${name}, sanitized to: ${sanitized}`);
|
|
214
|
+
return sanitized;
|
|
267
215
|
}
|
|
268
216
|
function areDifferentLocation(currentLocation, otherLocation) {
|
|
269
|
-
|
|
270
|
-
(!isHashAnAnchor(otherLocation.hash) &&
|
|
271
|
-
getPathFromHash(otherLocation.hash) !== getPathFromHash(currentLocation.hash)));
|
|
217
|
+
return currentLocation.pathname !== otherLocation.pathname || !isHashAnAnchor(otherLocation.hash) && getPathFromHash(otherLocation.hash) !== getPathFromHash(currentLocation.hash);
|
|
272
218
|
}
|
|
273
219
|
function isHashAnAnchor(hash) {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
return correspondingId !== '' && !!document.getElementById(correspondingId);
|
|
220
|
+
const correspondingId = hash.substring(1);
|
|
221
|
+
return correspondingId !== "" && !!document.getElementById(correspondingId);
|
|
277
222
|
}
|
|
278
223
|
function getPathFromHash(hash) {
|
|
279
|
-
|
|
280
|
-
|
|
224
|
+
const index = hash.indexOf("?");
|
|
225
|
+
return index < 0 ? hash : hash.slice(0, index);
|
|
281
226
|
}
|
|
227
|
+
//#endregion
|
|
228
|
+
exports.KEEP_TRACKING_AFTER_VIEW_DELAY = KEEP_TRACKING_AFTER_VIEW_DELAY;
|
|
229
|
+
exports.SESSION_KEEP_ALIVE_INTERVAL = SESSION_KEEP_ALIVE_INTERVAL;
|
|
230
|
+
exports.THROTTLE_VIEW_UPDATE_PERIOD = THROTTLE_VIEW_UPDATE_PERIOD;
|
|
231
|
+
exports.trackViews = trackViews;
|
|
232
|
+
|
|
282
233
|
//# sourceMappingURL=trackViews.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trackViews.js","sourceRoot":"","sources":["../../../src/domain/view/trackViews.ts"],"names":[],"mappings":";;;AAuGA,gCAqGC;AAnMD,8EAmB0C;AAE1C,+DAAyD;AAOzD,iEAA6D;AAC7D,mFAA+E;AAG/E,iFAA6E;AAC7E,qDAAmD;AACnD,2EAAuE;AA0C1D,QAAA,2BAA2B,GAAG,IAAI,CAAA;AAClC,QAAA,2BAA2B,GAAG,CAAC,GAAG,mCAAU,CAAA;AAEzD,4FAA4F;AAC5F,+EAA+E;AAC/E,EAAE;AACF,+FAA+F;AAC/F,+EAA+E;AAC/E,sHAAsH;AACzG,QAAA,8BAA8B,GAAG,CAAC,GAAG,mCAAU,CAAA;AAS5D,SAAgB,UAAU,CACxB,QAAkB,EAClB,SAAoB,EACpB,qBAAsD,EACtD,oBAAsC,EACtC,aAA+B,EAC/B,wBAAoD,EACpD,4BAAqC,EACrC,kBAAgC;IAEhC,MAAM,WAAW,GAAoC,IAAI,GAAG,EAAE,CAAA;IAC9D,IAAI,WAAW,GAAG,YAAY,CAAC,mCAAe,CAAC,YAAY,EAAE,IAAA,qCAAY,GAAE,EAAE,kBAAkB,CAAC,CAAA;IAChG,IAAI,oBAA8C,CAAA;IAElD,kBAAkB,EAAE,CAAA;IAEpB,IAAI,0BAAwC,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ClC,eAAe,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,eAAe,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CACjF,CAAA;AACH,CAAC;AAED,SAAS,cAAc,CAAC,IAAY;IAClC,MAAM,eAAe,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAA;IACzC,8HAA8H;IAC9H,OAAO,eAAe,KAAK,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC,eAAe,CAAC,CAAA;AAC7E,CAAC;AAED,SAAS,eAAe,CAAC,IAAY;IACnC,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;IAC/B,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAA;AAChD,CAAC"}
|
|
1
|
+
{"version":3,"file":"trackViews.js","names":["ONE_MINUTE","ViewLoadingType","clocksOrigin","onBFCacheRestore","relativeToClocks","timeStampNow","clocksNow","generateUUID","Observable","shallowClone","mockable","createContextManager","throttle","trackCommonViewMetrics","trackInitialViewMetrics","noop","trackViewEventCounts","setInterval","PageExitReason","elapsed","isRelativeTime"],"sources":["../../../src/domain/view/trackViews.ts"],"sourcesContent":["import {\n ONE_MINUTE,\n elapsed,\n timeStampNow,\n clocksNow,\n clocksOrigin,\n relativeToClocks,\n isRelativeTime,\n} from '@kubesense/kubesense-js-core/time'\nimport type { Duration, TimeStamp, ClocksState, RelativeTime } from '@kubesense/kubesense-js-core/time'\nimport type { Subscription, Context, ContextValue } from '@kubesense/kubesense-browser-core'\nimport {\n noop,\n PageExitReason,\n shallowClone,\n generateUUID,\n throttle,\n display,\n setInterval,\n clearInterval,\n setTimeout,\n Observable,\n createContextManager,\n mockable,\n} from '@kubesense/kubesense-browser-core'\nimport type { ViewCustomTimings } from '../../rawRumEvent.types'\nimport { ViewLoadingType } from '../../rawRumEvent.types'\nimport type { LifeCycle } from '../lifeCycle'\nimport { LifeCycleEventType } from '../lifeCycle'\nimport type { EventCounts } from '../trackEventCounts'\nimport type { LocationChange } from '../../browser/locationChangeObservable'\nimport type { RumConfiguration, RumInitConfiguration } from '../configuration'\nimport type { RumMutationRecord } from '../../browser/domMutationObservable'\nimport { trackViewEventCounts } from './trackViewEventCounts'\nimport { trackInitialViewMetrics } from './viewMetrics/trackInitialViewMetrics'\nimport type { InitialViewMetrics } from './viewMetrics/trackInitialViewMetrics'\nimport type { CommonViewMetrics } from './viewMetrics/trackCommonViewMetrics'\nimport { trackCommonViewMetrics } from './viewMetrics/trackCommonViewMetrics'\nimport { onBFCacheRestore } from './bfCacheSupport'\nimport { trackBfcacheMetrics } from './viewMetrics/trackBfcacheMetrics'\n\nexport interface ViewEvent {\n id: string\n name?: string\n service?: string\n version?: string\n context?: Context\n location: Readonly<Location>\n handlingStack?: string\n commonViewMetrics: CommonViewMetrics\n initialViewMetrics: InitialViewMetrics\n customTimings: ViewCustomTimings\n eventCounts: EventCounts\n documentVersion: number\n startClocks: ClocksState\n duration: Duration\n isActive: boolean\n sessionIsActive: boolean\n loadingType: ViewLoadingType\n}\n\nexport interface ViewCreatedEvent {\n id: string\n name?: string\n service?: string\n version?: string\n context?: Context\n startClocks: ClocksState\n url?: string\n}\n\nexport interface BeforeViewUpdateEvent {\n id: string\n name?: string\n context?: Context\n startClocks: ClocksState\n sessionIsActive: boolean\n}\n\nexport interface ViewEndedEvent {\n endClocks: ClocksState\n}\n\nexport const THROTTLE_VIEW_UPDATE_PERIOD = 3000\nexport const SESSION_KEEP_ALIVE_INTERVAL = 5 * ONE_MINUTE\n\n// Some events or metrics can be captured after the end of the view. To avoid missing those;\n// an arbitrary delay is added for stopping their tracking after the view ends.\n//\n// Ideally, we would not stop and keep tracking events or metrics until the end of the session.\n// But this might have a small performance impact if there are many many views.\n// So let's have a fairly short delay improving the situation in most cases and avoid impacting performances too much.\nexport const KEEP_TRACKING_AFTER_VIEW_DELAY = 5 * ONE_MINUTE\n\nexport interface ViewOptions {\n name?: string\n service?: RumInitConfiguration['service']\n version?: RumInitConfiguration['version']\n context?: Context\n handlingStack?: string\n url?: string\n}\n\nexport function trackViews(\n lifeCycle: LifeCycle,\n domMutationObservable: Observable<RumMutationRecord[]>,\n windowOpenObservable: Observable<void>,\n configuration: RumConfiguration,\n locationChangeObservable: Observable<LocationChange>,\n areViewsTrackedAutomatically: boolean,\n initialViewOptions?: ViewOptions\n) {\n const activeViews: Set<ReturnType<typeof newView>> = new Set()\n let currentView = startNewView(ViewLoadingType.INITIAL_LOAD, clocksOrigin(), initialViewOptions)\n let stopOnBFCacheRestore: (() => void) | undefined\n\n startViewLifeCycle()\n\n let locationChangeSubscription: Subscription\n if (areViewsTrackedAutomatically) {\n locationChangeSubscription = renewViewOnLocationChange(locationChangeObservable)\n stopOnBFCacheRestore = onBFCacheRestore((pageshowEvent) => {\n currentView.end()\n const startClocks = relativeToClocks(pageshowEvent.timeStamp as RelativeTime)\n currentView = startNewView(ViewLoadingType.BF_CACHE, startClocks, undefined)\n })\n }\n\n function startNewView(loadingType: ViewLoadingType, startClocks?: ClocksState, viewOptions?: ViewOptions) {\n const newlyCreatedView = newView(\n lifeCycle,\n domMutationObservable,\n windowOpenObservable,\n configuration,\n loadingType,\n startClocks,\n viewOptions\n )\n activeViews.add(newlyCreatedView)\n newlyCreatedView.stopObservable.subscribe(() => {\n activeViews.delete(newlyCreatedView)\n })\n return newlyCreatedView\n }\n\n function startViewLifeCycle() {\n lifeCycle.subscribe(LifeCycleEventType.SESSION_RENEWED, () => {\n currentView = startNewView(ViewLoadingType.SESSION_RENEWAL, undefined, {\n // Renew view on session renewal\n name: currentView.name,\n service: currentView.service,\n version: currentView.version,\n context: currentView.contextManager.getContext(),\n })\n })\n\n lifeCycle.subscribe(LifeCycleEventType.SESSION_EXPIRED, ({ endClocks }) => {\n currentView.end({ sessionIsActive: false, endClocks })\n })\n }\n\n function renewViewOnLocationChange(locationChangeObservable: Observable<LocationChange>) {\n return locationChangeObservable.subscribe(({ oldLocation, newLocation }) => {\n if (areDifferentLocation(oldLocation, newLocation)) {\n currentView.end()\n currentView = startNewView(ViewLoadingType.ROUTE_CHANGE)\n }\n })\n }\n\n return {\n addTiming: (name: string, time: RelativeTime | TimeStamp = timeStampNow()) => {\n currentView.addTiming(name, time)\n },\n setLoadingTime: (callTimestamp?: TimeStamp) => currentView.setLoadingTime(callTimestamp),\n startView: (options?: ViewOptions, startClocks?: ClocksState) => {\n currentView.end({ endClocks: startClocks })\n currentView = startNewView(ViewLoadingType.ROUTE_CHANGE, startClocks, options)\n },\n setViewContext: (context: Context) => {\n currentView.contextManager.setContext(context)\n },\n setViewContextProperty: (key: string, value: ContextValue) => {\n currentView.contextManager.setContextProperty(key, value)\n },\n setViewName: (name: string) => {\n currentView.setViewName(name)\n },\n getViewContext: () => currentView.contextManager.getContext(),\n\n stop: () => {\n if (locationChangeSubscription) {\n locationChangeSubscription.unsubscribe()\n }\n if (stopOnBFCacheRestore) {\n stopOnBFCacheRestore()\n }\n currentView.end()\n activeViews.forEach((view) => view.stop())\n },\n }\n}\n\nfunction newView(\n lifeCycle: LifeCycle,\n domMutationObservable: Observable<RumMutationRecord[]>,\n windowOpenObservable: Observable<void>,\n configuration: RumConfiguration,\n loadingType: ViewLoadingType,\n startClocks: ClocksState = clocksNow(),\n viewOptions?: ViewOptions\n) {\n // Setup initial values\n const id = generateUUID()\n const stopObservable = new Observable<void>()\n const customTimings: ViewCustomTimings = {}\n let documentVersion = 0\n let endClocks: ClocksState | undefined\n const location = shallowClone(mockable(window.location))\n const contextManager = createContextManager()\n\n let sessionIsActive = true\n let name = viewOptions?.name\n const service = viewOptions?.service || configuration.service\n const version = viewOptions?.version || configuration.version\n const context = viewOptions?.context\n const handlingStack = viewOptions?.handlingStack\n\n if (context) {\n contextManager.setContext(context)\n }\n\n const viewCreatedEvent = {\n id,\n name,\n startClocks,\n service,\n version,\n context,\n url: viewOptions?.url,\n }\n lifeCycle.notify(LifeCycleEventType.BEFORE_VIEW_CREATED, viewCreatedEvent)\n lifeCycle.notify(LifeCycleEventType.VIEW_CREATED, viewCreatedEvent)\n\n // Update the view every time the measures are changing\n const { throttled, cancel: cancelScheduleViewUpdate } = throttle(triggerViewUpdate, THROTTLE_VIEW_UPDATE_PERIOD, {\n leading: false,\n })\n\n const {\n setLoadEvent,\n setViewEnd,\n stop: stopCommonViewMetricsTracking,\n stopINPTracking,\n getCommonViewMetrics,\n setLoadingTime,\n } = trackCommonViewMetrics(\n lifeCycle,\n domMutationObservable,\n windowOpenObservable,\n configuration,\n scheduleViewUpdate,\n loadingType,\n startClocks\n )\n\n const { stop: stopInitialViewMetricsTracking, initialViewMetrics } =\n loadingType === ViewLoadingType.INITIAL_LOAD\n ? trackInitialViewMetrics(configuration, startClocks, setLoadEvent, scheduleViewUpdate)\n : { stop: noop, initialViewMetrics: {} as InitialViewMetrics }\n\n // Start BFCache-specific metrics when restoring from BFCache\n if (loadingType === ViewLoadingType.BF_CACHE) {\n trackBfcacheMetrics(startClocks, initialViewMetrics, scheduleViewUpdate)\n }\n\n const { stop: stopEventCountsTracking, eventCounts } = trackViewEventCounts(lifeCycle, id, scheduleViewUpdate)\n\n // Session keep alive\n const keepAliveIntervalId = setInterval(triggerViewUpdate, SESSION_KEEP_ALIVE_INTERVAL)\n\n const pageMayExitSubscription = lifeCycle.subscribe(LifeCycleEventType.PREPARE_URGENT_FLUSH, (reason) => {\n // beforeunload is the unreliable half of this: it is skipped on mobile and\n // when a tab is discarded, while pagehide fires on the paths it misses. The\n // replay recorder already flushes on every exit reason, which is how a\n // session ends up with a segment recorded after the last view update the\n // backend ever saw — the view then stays active, and the session's duration\n // is reported without its final and usually longest view.\n if (reason === PageExitReason.UNLOADING || reason === PageExitReason.PAGEHIDE) {\n // Force the final emission's isActive=false without mutating endClocks.\n // Why this matters: the regular triggerViewUpdate computes\n // `isActive: endClocks === undefined`, which is `true` here because we\n // haven't called end(). If we leave the final pre-unload event with\n // isActive=true the view sits in rum_view_raw permanently active —\n // the backend cron only aggregates inactive views, so the view stays\n // invisible to rum_view (and session aggregations) until a 10-minute\n // stale-view fallback force-finalizes it.\n // Why not just set endClocks here: beforeunload is not guaranteed to\n // be followed by an actual unload (the user can cancel navigation in\n // some flows). If we permanently set endClocks, setViewEnd() would\n // also fire — which calls stopViewInteractionCount() and stops INP /\n // interaction tracking for the rest of the page's life, and any later\n // addTiming() calls are silently dropped (see the endClocks guard in\n // addTiming). Forcing the override only on this one emission keeps\n // the view fully recoverable if the page survives.\n triggerViewUpdate(true)\n }\n })\n\n // Initial view update\n triggerViewUpdate()\n\n // View context update should always be throttled\n contextManager.changeObservable.subscribe(scheduleViewUpdate)\n\n function triggerBeforeViewUpdate() {\n lifeCycle.notify(LifeCycleEventType.BEFORE_VIEW_UPDATED, {\n id,\n name,\n context: contextManager.getContext(),\n startClocks,\n sessionIsActive,\n })\n }\n\n function scheduleViewUpdate() {\n triggerBeforeViewUpdate()\n throttled()\n }\n\n function triggerViewUpdate(forceInactive = false) {\n cancelScheduleViewUpdate()\n triggerBeforeViewUpdate()\n\n documentVersion += 1\n const currentEnd = endClocks === undefined ? timeStampNow() : endClocks.timeStamp\n lifeCycle.notify(LifeCycleEventType.VIEW_UPDATED, {\n customTimings,\n documentVersion,\n id,\n name,\n service,\n version,\n context: contextManager.getContext(),\n loadingType,\n location,\n handlingStack,\n startClocks,\n commonViewMetrics: getCommonViewMetrics(),\n initialViewMetrics,\n duration: elapsed(startClocks.timeStamp, currentEnd),\n // forceInactive is set by the page-unload handler so the final emission\n // is marked inactive without permanently ending the view (see comment\n // there). All other call sites use the natural endClocks-based check.\n isActive: !forceInactive && endClocks === undefined,\n sessionIsActive,\n eventCounts,\n })\n }\n\n return {\n get name() {\n return name\n },\n service,\n version,\n contextManager,\n stopObservable,\n end(options: { endClocks?: ClocksState; sessionIsActive?: boolean } = {}) {\n if (endClocks) {\n // view already ended\n return\n }\n endClocks = options.endClocks ?? clocksNow()\n // A session timeout is dated to when it happened (see getSessionEndClocks), which can\n // precede a view a late-running tab started afterwards. A view never ends before it starts.\n if (endClocks.relative < startClocks.relative) {\n endClocks = startClocks\n }\n sessionIsActive = options.sessionIsActive ?? true\n\n lifeCycle.notify(LifeCycleEventType.VIEW_ENDED, { endClocks })\n lifeCycle.notify(LifeCycleEventType.AFTER_VIEW_ENDED, { endClocks })\n clearInterval(keepAliveIntervalId)\n setViewEnd(endClocks.relative)\n stopCommonViewMetricsTracking()\n pageMayExitSubscription.unsubscribe()\n triggerViewUpdate()\n setTimeout(() => {\n this.stop()\n }, KEEP_TRACKING_AFTER_VIEW_DELAY)\n },\n stop() {\n stopInitialViewMetricsTracking()\n stopEventCountsTracking()\n stopINPTracking()\n stopObservable.notify()\n },\n addTiming(name: string, time: RelativeTime | TimeStamp) {\n if (endClocks) {\n return\n }\n const relativeTime = isRelativeTime(time) ? time : elapsed(startClocks.timeStamp, time)\n customTimings[sanitizeTiming(name)] = relativeTime\n scheduleViewUpdate()\n },\n setLoadingTime,\n setViewName(updatedName: string) {\n name = updatedName\n triggerViewUpdate()\n },\n }\n}\n\n/**\n * Timing name is used as facet path that must contain only letters, digits, or the characters - _ . @ $\n */\nfunction sanitizeTiming(name: string) {\n const sanitized = name.replace(/[^a-zA-Z0-9-_.@$]/g, '_')\n if (sanitized !== name) {\n display.warn(`Invalid timing name: ${name}, sanitized to: ${sanitized}`)\n }\n return sanitized\n}\n\nfunction areDifferentLocation(currentLocation: Location, otherLocation: Location) {\n return (\n currentLocation.pathname !== otherLocation.pathname ||\n (!isHashAnAnchor(otherLocation.hash) &&\n getPathFromHash(otherLocation.hash) !== getPathFromHash(currentLocation.hash))\n )\n}\n\nfunction isHashAnAnchor(hash: string) {\n const correspondingId = hash.substring(1)\n // check if the correspondingId is empty because on Firefox an empty string passed to getElementById() prints a consol warning\n return correspondingId !== '' && !!document.getElementById(correspondingId)\n}\n\nfunction getPathFromHash(hash: string) {\n const index = hash.indexOf('?')\n return index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mBAAmB;EACrB;EACA;EACA,YAAY,aAAqB;GAC/B,OAAO;GACP,kBAAkB;EACpB;CACF;AACF;;;;AAKA,SAAS,eAAe,MAAc;CACpC,MAAM,YAAY,KAAK,QAAQ,sBAAsB,GAAG;CACxD,IAAI,cAAc,MAChB,kCAAA,QAAQ,KAAK,wBAAwB,KAAK,kBAAkB,WAAW;CAEzE,OAAO;AACT;AAEA,SAAS,qBAAqB,iBAA2B,eAAyB;CAChF,OACE,gBAAgB,aAAa,cAAc,YAC1C,CAAC,eAAe,cAAc,IAAI,KACjC,gBAAgB,cAAc,IAAI,MAAM,gBAAgB,gBAAgB,IAAI;AAElF;AAEA,SAAS,eAAe,MAAc;CACpC,MAAM,kBAAkB,KAAK,UAAU,CAAC;CAExC,OAAO,oBAAoB,MAAM,CAAC,CAAC,SAAS,eAAe,eAAe;AAC5E;AAEA,SAAS,gBAAgB,MAAc;CACrC,MAAM,QAAQ,KAAK,QAAQ,GAAG;CAC9B,OAAO,QAAQ,IAAI,OAAO,KAAK,MAAM,GAAG,KAAK;AAC/C"}
|
|
@@ -7,9 +7,10 @@ import type { ViewHistory } from '../contexts/viewHistory';
|
|
|
7
7
|
import type { Hooks } from '../hooks';
|
|
8
8
|
import type { RumMutationRecord } from '../../browser/domMutationObservable';
|
|
9
9
|
import type { ViewOptions } from './trackViews';
|
|
10
|
-
export declare function startViewCollection(lifeCycle: LifeCycle, hooks: Hooks, configuration: RumConfiguration,
|
|
11
|
-
addTiming: (name: string, time?: import("@kubesense/kubesense-
|
|
12
|
-
|
|
10
|
+
export declare function startViewCollection(lifeCycle: LifeCycle, hooks: Hooks, configuration: RumConfiguration, domMutationObservable: Observable<RumMutationRecord[]>, pageOpenObservable: Observable<void>, locationChangeObservable: Observable<LocationChange>, recorderApi: RecorderApi, viewHistory: ViewHistory, initialViewOptions?: ViewOptions): {
|
|
11
|
+
addTiming: (name: string, time?: import("@kubesense/kubesense-js-core/time").RelativeTime | import("@kubesense/kubesense-js-core/time").TimeStamp) => void;
|
|
12
|
+
setLoadingTime: (callTimestamp?: import("@kubesense/kubesense-js-core/time").TimeStamp) => void;
|
|
13
|
+
startView: (options?: ViewOptions, startClocks?: import("@kubesense/kubesense-js-core/time").ClocksState) => void;
|
|
13
14
|
setViewContext: (context: import("@kubesense/kubesense-browser-core").Context) => void;
|
|
14
15
|
setViewContextProperty: (key: string, value: import("@kubesense/kubesense-browser-core").ContextValue) => void;
|
|
15
16
|
setViewName: (name: string) => void;
|