@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
package/cjs/domain/hooks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","
|
|
1
|
+
{"version":3,"file":"hooks.js","names":["createHook"],"sources":["../../src/domain/hooks.ts"],"sourcesContent":["import type { Duration, RelativeTime } from '@kubesense/kubesense-js-core/time'\nimport type { TelemetryEvent } from '@kubesense/kubesense-browser-core'\nimport { createHook } from '@kubesense/kubesense-js-core/assembly'\nimport type { Hook } from '@kubesense/kubesense-js-core/assembly'\nimport type { RecursivePartial } from '@kubesense/kubesense-js-core/util'\nimport type { RumEvent } from '../rumEvent.types'\nimport type { RawRumEvent } from '../rawRumEvent.types'\nimport type { RumEventDomainContext } from '../domainContext.types'\n\n// Define a partial RUM event type.\n// Ensuring the `type` field is always present improves type checking, especially in conditional logic in hooks (e.g., `if (eventType === 'view')`).\nexport type DefaultRumEventAttributes = RecursivePartial<RumEvent> & { type: RumEvent['type'] }\nexport type DefaultTelemetryEventAttributes = RecursivePartial<TelemetryEvent>\n\ntype DeepReadonly<T> = {\n readonly [K in keyof T]: DeepReadonly<T[K]>\n}\n\n// Use readonly and DeepReadonly to prevents assemble hook callbacks from mutating the inputs.\n// DeepReadonly is only applied to objects rather than the entire AssembleHookParams to avoid casts for primitives.\nexport interface AssembleHookParams {\n readonly eventType: RumEvent['type']\n rawRumEvent: DeepReadonly<RawRumEvent>\n domainContext: DeepReadonly<RumEventDomainContext<RawRumEvent['type']>>\n readonly startTime: RelativeTime\n readonly duration?: Duration | undefined\n}\n\nexport type AssembleHook = Hook<AssembleHookParams, DefaultRumEventAttributes>\nexport type AssembleTelemetryHook = Hook<{ startTime: RelativeTime }, DefaultTelemetryEventAttributes>\n\nexport interface Hooks {\n assembleEventDefaults: AssembleHook\n assembleTelemetry: AssembleTelemetryHook\n assembleEvent: AssembleHook\n}\n\nexport function createHooks(): Hooks {\n return {\n assembleEventDefaults: createHook(),\n assembleTelemetry: createHook(),\n assembleEvent: createHook(),\n }\n}\n"],"mappings":";;AAqCA,SAAgB,cAAqB;CACnC,OAAO;EACL,wBAAA,GAAuBA,sCAAAA,WAAAA,CAAW;EAClC,oBAAA,GAAmBA,sCAAAA,WAAAA,CAAW;EAC9B,gBAAA,GAAeA,sCAAAA,WAAAA,CAAW;CAC5B;AACF"}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ClocksState, Duration } from '@kubesense/kubesense-js-core/time';
|
|
2
|
+
import type { Context, RawError, UrgentFlushReason } from '@kubesense/kubesense-browser-core';
|
|
2
3
|
import { AbstractLifeCycle } from '@kubesense/kubesense-browser-core';
|
|
3
4
|
import type { RumEventDomainContext } from '../domainContext.types';
|
|
4
5
|
import type { RawRumEvent, AssembledRumEvent } from '../rawRumEvent.types';
|
|
5
6
|
import type { RequestCompleteEvent, RequestStartEvent } from './requestCollection';
|
|
7
|
+
import type { WebSocketCompleteEvent } from './resource/webSocketCollection';
|
|
6
8
|
import type { AutoAction } from './action/actionCollection';
|
|
7
9
|
import type { ViewEvent, ViewCreatedEvent, ViewEndedEvent, BeforeViewUpdateEvent } from './view/trackViews';
|
|
10
|
+
import type { DurationVitalStart } from './vital/vitalCollection';
|
|
11
|
+
import type { TrackedEventData } from './eventTracker';
|
|
12
|
+
import type { ActionEventData } from './action/trackManualActions';
|
|
13
|
+
import type { SessionExpiredEvent } from './session/session.types';
|
|
8
14
|
export declare const enum LifeCycleEventType {
|
|
9
15
|
AUTO_ACTION_COMPLETED = 0,
|
|
10
16
|
BEFORE_VIEW_CREATED = 1,
|
|
@@ -15,14 +21,18 @@ export declare const enum LifeCycleEventType {
|
|
|
15
21
|
AFTER_VIEW_ENDED = 6,
|
|
16
22
|
REQUEST_STARTED = 7,
|
|
17
23
|
REQUEST_COMPLETED = 8,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
WEBSOCKET_COMPLETED = 9,
|
|
25
|
+
SESSION_EXPIRED = 10,
|
|
26
|
+
SESSION_RENEWED = 11,
|
|
27
|
+
PREPARE_URGENT_FLUSH = 12,
|
|
28
|
+
RAW_RUM_EVENT_COLLECTED = 13,
|
|
29
|
+
RUM_EVENT_COLLECTED = 14,
|
|
30
|
+
RAW_ERROR_COLLECTED = 15,
|
|
31
|
+
ACTION_STARTED = 16,
|
|
32
|
+
DURATION_VITAL_STARTED = 17
|
|
24
33
|
}
|
|
25
34
|
declare const LifeCycleEventTypeAsConst: {
|
|
35
|
+
ACTION_STARTED: LifeCycleEventType.ACTION_STARTED;
|
|
26
36
|
AUTO_ACTION_COMPLETED: LifeCycleEventType.AUTO_ACTION_COMPLETED;
|
|
27
37
|
BEFORE_VIEW_CREATED: LifeCycleEventType.BEFORE_VIEW_CREATED;
|
|
28
38
|
VIEW_CREATED: LifeCycleEventType.VIEW_CREATED;
|
|
@@ -32,14 +42,17 @@ declare const LifeCycleEventTypeAsConst: {
|
|
|
32
42
|
AFTER_VIEW_ENDED: LifeCycleEventType.AFTER_VIEW_ENDED;
|
|
33
43
|
REQUEST_STARTED: LifeCycleEventType.REQUEST_STARTED;
|
|
34
44
|
REQUEST_COMPLETED: LifeCycleEventType.REQUEST_COMPLETED;
|
|
45
|
+
WEBSOCKET_COMPLETED: LifeCycleEventType.WEBSOCKET_COMPLETED;
|
|
35
46
|
SESSION_EXPIRED: LifeCycleEventType.SESSION_EXPIRED;
|
|
36
47
|
SESSION_RENEWED: LifeCycleEventType.SESSION_RENEWED;
|
|
37
|
-
|
|
48
|
+
PREPARE_URGENT_FLUSH: LifeCycleEventType.PREPARE_URGENT_FLUSH;
|
|
38
49
|
RAW_RUM_EVENT_COLLECTED: LifeCycleEventType.RAW_RUM_EVENT_COLLECTED;
|
|
39
50
|
RUM_EVENT_COLLECTED: LifeCycleEventType.RUM_EVENT_COLLECTED;
|
|
40
51
|
RAW_ERROR_COLLECTED: LifeCycleEventType.RAW_ERROR_COLLECTED;
|
|
52
|
+
DURATION_VITAL_STARTED: LifeCycleEventType.DURATION_VITAL_STARTED;
|
|
41
53
|
};
|
|
42
54
|
export interface LifeCycleEventMap {
|
|
55
|
+
[LifeCycleEventTypeAsConst.ACTION_STARTED]: TrackedEventData<ActionEventData>;
|
|
43
56
|
[LifeCycleEventTypeAsConst.AUTO_ACTION_COMPLETED]: AutoAction;
|
|
44
57
|
[LifeCycleEventTypeAsConst.BEFORE_VIEW_CREATED]: ViewCreatedEvent;
|
|
45
58
|
[LifeCycleEventTypeAsConst.VIEW_CREATED]: ViewCreatedEvent;
|
|
@@ -49,20 +62,21 @@ export interface LifeCycleEventMap {
|
|
|
49
62
|
[LifeCycleEventTypeAsConst.AFTER_VIEW_ENDED]: ViewEndedEvent;
|
|
50
63
|
[LifeCycleEventTypeAsConst.REQUEST_STARTED]: RequestStartEvent;
|
|
51
64
|
[LifeCycleEventTypeAsConst.REQUEST_COMPLETED]: RequestCompleteEvent;
|
|
52
|
-
[LifeCycleEventTypeAsConst.
|
|
65
|
+
[LifeCycleEventTypeAsConst.WEBSOCKET_COMPLETED]: WebSocketCompleteEvent;
|
|
66
|
+
[LifeCycleEventTypeAsConst.SESSION_EXPIRED]: SessionExpiredEvent;
|
|
53
67
|
[LifeCycleEventTypeAsConst.SESSION_RENEWED]: void;
|
|
54
|
-
[LifeCycleEventTypeAsConst.
|
|
68
|
+
[LifeCycleEventTypeAsConst.PREPARE_URGENT_FLUSH]: UrgentFlushReason;
|
|
55
69
|
[LifeCycleEventTypeAsConst.RAW_RUM_EVENT_COLLECTED]: RawRumEventCollectedData;
|
|
56
70
|
[LifeCycleEventTypeAsConst.RUM_EVENT_COLLECTED]: AssembledRumEvent;
|
|
57
71
|
[LifeCycleEventTypeAsConst.RAW_ERROR_COLLECTED]: {
|
|
58
72
|
error: RawError;
|
|
59
73
|
customerContext?: Context;
|
|
60
74
|
};
|
|
75
|
+
[LifeCycleEventTypeAsConst.DURATION_VITAL_STARTED]: DurationVitalStart;
|
|
61
76
|
}
|
|
62
77
|
export interface RawRumEventCollectedData<E extends RawRumEvent = RawRumEvent> {
|
|
63
|
-
|
|
78
|
+
startClocks: ClocksState;
|
|
64
79
|
duration?: Duration;
|
|
65
|
-
customerContext?: Context;
|
|
66
80
|
rawRumEvent: E;
|
|
67
81
|
domainContext: RumEventDomainContext<E['type']>;
|
|
68
82
|
}
|
package/cjs/domain/lifeCycle.js
CHANGED
|
@@ -1,6 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
let _kubesense_kubesense_browser_core = require("@kubesense/kubesense-browser-core");
|
|
2
|
+
//#region src/domain/lifeCycle.ts
|
|
3
|
+
let LifeCycleEventType = /* @__PURE__ */ function(LifeCycleEventType) {
|
|
4
|
+
LifeCycleEventType[LifeCycleEventType["AUTO_ACTION_COMPLETED"] = 0] = "AUTO_ACTION_COMPLETED";
|
|
5
|
+
LifeCycleEventType[LifeCycleEventType["BEFORE_VIEW_CREATED"] = 1] = "BEFORE_VIEW_CREATED";
|
|
6
|
+
LifeCycleEventType[LifeCycleEventType["VIEW_CREATED"] = 2] = "VIEW_CREATED";
|
|
7
|
+
LifeCycleEventType[LifeCycleEventType["BEFORE_VIEW_UPDATED"] = 3] = "BEFORE_VIEW_UPDATED";
|
|
8
|
+
LifeCycleEventType[LifeCycleEventType["VIEW_UPDATED"] = 4] = "VIEW_UPDATED";
|
|
9
|
+
LifeCycleEventType[LifeCycleEventType["VIEW_ENDED"] = 5] = "VIEW_ENDED";
|
|
10
|
+
LifeCycleEventType[LifeCycleEventType["AFTER_VIEW_ENDED"] = 6] = "AFTER_VIEW_ENDED";
|
|
11
|
+
LifeCycleEventType[LifeCycleEventType["REQUEST_STARTED"] = 7] = "REQUEST_STARTED";
|
|
12
|
+
LifeCycleEventType[LifeCycleEventType["REQUEST_COMPLETED"] = 8] = "REQUEST_COMPLETED";
|
|
13
|
+
LifeCycleEventType[LifeCycleEventType["WEBSOCKET_COMPLETED"] = 9] = "WEBSOCKET_COMPLETED";
|
|
14
|
+
LifeCycleEventType[LifeCycleEventType["SESSION_EXPIRED"] = 10] = "SESSION_EXPIRED";
|
|
15
|
+
LifeCycleEventType[LifeCycleEventType["SESSION_RENEWED"] = 11] = "SESSION_RENEWED";
|
|
16
|
+
LifeCycleEventType[LifeCycleEventType["PREPARE_URGENT_FLUSH"] = 12] = "PREPARE_URGENT_FLUSH";
|
|
17
|
+
LifeCycleEventType[LifeCycleEventType["RAW_RUM_EVENT_COLLECTED"] = 13] = "RAW_RUM_EVENT_COLLECTED";
|
|
18
|
+
LifeCycleEventType[LifeCycleEventType["RUM_EVENT_COLLECTED"] = 14] = "RUM_EVENT_COLLECTED";
|
|
19
|
+
LifeCycleEventType[LifeCycleEventType["RAW_ERROR_COLLECTED"] = 15] = "RAW_ERROR_COLLECTED";
|
|
20
|
+
LifeCycleEventType[LifeCycleEventType["ACTION_STARTED"] = 16] = "ACTION_STARTED";
|
|
21
|
+
LifeCycleEventType[LifeCycleEventType["DURATION_VITAL_STARTED"] = 17] = "DURATION_VITAL_STARTED";
|
|
22
|
+
return LifeCycleEventType;
|
|
23
|
+
}({});
|
|
24
|
+
const LifeCycle = _kubesense_kubesense_browser_core.AbstractLifeCycle;
|
|
25
|
+
//#endregion
|
|
26
|
+
exports.LifeCycle = LifeCycle;
|
|
27
|
+
exports.LifeCycleEventType = LifeCycleEventType;
|
|
28
|
+
|
|
6
29
|
//# sourceMappingURL=lifeCycle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lifeCycle.js","
|
|
1
|
+
{"version":3,"file":"lifeCycle.js","names":["AbstractLifeCycle"],"sources":["../../src/domain/lifeCycle.ts"],"sourcesContent":["import type { ClocksState, Duration } from '@kubesense/kubesense-js-core/time'\nimport type { Context, RawError, UrgentFlushReason } from '@kubesense/kubesense-browser-core'\nimport { AbstractLifeCycle } from '@kubesense/kubesense-browser-core'\nimport type { RumEventDomainContext } from '../domainContext.types'\nimport type { RawRumEvent, AssembledRumEvent } from '../rawRumEvent.types'\nimport type { RequestCompleteEvent, RequestStartEvent } from './requestCollection'\nimport type { WebSocketCompleteEvent } from './resource/webSocketCollection'\nimport type { AutoAction } from './action/actionCollection'\nimport type { ViewEvent, ViewCreatedEvent, ViewEndedEvent, BeforeViewUpdateEvent } from './view/trackViews'\nimport type { DurationVitalStart } from './vital/vitalCollection'\nimport type { TrackedEventData } from './eventTracker'\nimport type { ActionEventData } from './action/trackManualActions'\nimport type { SessionExpiredEvent } from './session/session.types'\n\nexport const enum LifeCycleEventType {\n // Contexts (like viewHistory) should be opened using prefixed BEFORE_XXX events and closed using prefixed AFTER_XXX events\n // It ensures the context is available during the non prefixed event callbacks\n AUTO_ACTION_COMPLETED,\n BEFORE_VIEW_CREATED,\n VIEW_CREATED,\n BEFORE_VIEW_UPDATED,\n VIEW_UPDATED,\n VIEW_ENDED,\n AFTER_VIEW_ENDED,\n REQUEST_STARTED,\n REQUEST_COMPLETED,\n WEBSOCKET_COMPLETED,\n\n // The SESSION_EXPIRED lifecycle event has been introduced to represent when a session has expired\n // and trigger cleanup tasks related to this, prior to renewing the session. Its implementation is\n // slightly naive: it is not triggered as soon as the session is expired, but rather just before\n // notifying that the session is renewed. Thus, the session id is already set to the newly renewed\n // session.\n //\n // This implementation is \"good enough\" for our use-cases. Improving this is not trivial,\n // primarily because multiple instances of the SDK may be managing the same session cookie at\n // the same time, for example when using Logs and RUM on the same page, or opening multiple tabs\n // on the same domain.\n SESSION_EXPIRED,\n SESSION_RENEWED,\n PREPARE_URGENT_FLUSH,\n RAW_RUM_EVENT_COLLECTED,\n RUM_EVENT_COLLECTED,\n RAW_ERROR_COLLECTED,\n ACTION_STARTED,\n DURATION_VITAL_STARTED,\n}\n\n// This is a workaround for an issue occurring when the Browser SDK is included in a TypeScript\n// project configured with `isolatedModules: true`. Even if the const enum is declared in this\n// module, we cannot use it directly to define the EventMap interface keys (TS error: \"Cannot access\n// ambient const enums when the '--isolatedModules' flag is provided.\").\n//\n// Using a plain enum would fix the issue, but would also add 2KB to the minified bundle. By using\n// this workaround, we can keep using a const enum without impacting the bundle size (since it is a\n// \"declare\" statement, it will only be used during typecheck and completely ignored when building\n// JavaScript).\n//\n// See issues:\n// * https://github.com/microsoft/TypeScript/issues/54152\ndeclare const LifeCycleEventTypeAsConst: {\n ACTION_STARTED: LifeCycleEventType.ACTION_STARTED\n AUTO_ACTION_COMPLETED: LifeCycleEventType.AUTO_ACTION_COMPLETED\n BEFORE_VIEW_CREATED: LifeCycleEventType.BEFORE_VIEW_CREATED\n VIEW_CREATED: LifeCycleEventType.VIEW_CREATED\n BEFORE_VIEW_UPDATED: LifeCycleEventType.BEFORE_VIEW_UPDATED\n VIEW_UPDATED: LifeCycleEventType.VIEW_UPDATED\n VIEW_ENDED: LifeCycleEventType.VIEW_ENDED\n AFTER_VIEW_ENDED: LifeCycleEventType.AFTER_VIEW_ENDED\n REQUEST_STARTED: LifeCycleEventType.REQUEST_STARTED\n REQUEST_COMPLETED: LifeCycleEventType.REQUEST_COMPLETED\n WEBSOCKET_COMPLETED: LifeCycleEventType.WEBSOCKET_COMPLETED\n SESSION_EXPIRED: LifeCycleEventType.SESSION_EXPIRED\n SESSION_RENEWED: LifeCycleEventType.SESSION_RENEWED\n PREPARE_URGENT_FLUSH: LifeCycleEventType.PREPARE_URGENT_FLUSH\n RAW_RUM_EVENT_COLLECTED: LifeCycleEventType.RAW_RUM_EVENT_COLLECTED\n RUM_EVENT_COLLECTED: LifeCycleEventType.RUM_EVENT_COLLECTED\n RAW_ERROR_COLLECTED: LifeCycleEventType.RAW_ERROR_COLLECTED\n DURATION_VITAL_STARTED: LifeCycleEventType.DURATION_VITAL_STARTED\n}\n\n// Note: this interface needs to be exported even if it is not used outside of this module, else TS\n// fails to build the rum-core package with error TS4058\nexport interface LifeCycleEventMap {\n [LifeCycleEventTypeAsConst.ACTION_STARTED]: TrackedEventData<ActionEventData>\n [LifeCycleEventTypeAsConst.AUTO_ACTION_COMPLETED]: AutoAction\n [LifeCycleEventTypeAsConst.BEFORE_VIEW_CREATED]: ViewCreatedEvent\n [LifeCycleEventTypeAsConst.VIEW_CREATED]: ViewCreatedEvent\n [LifeCycleEventTypeAsConst.BEFORE_VIEW_UPDATED]: BeforeViewUpdateEvent\n [LifeCycleEventTypeAsConst.VIEW_UPDATED]: ViewEvent\n [LifeCycleEventTypeAsConst.VIEW_ENDED]: ViewEndedEvent\n [LifeCycleEventTypeAsConst.AFTER_VIEW_ENDED]: ViewEndedEvent\n [LifeCycleEventTypeAsConst.REQUEST_STARTED]: RequestStartEvent\n [LifeCycleEventTypeAsConst.REQUEST_COMPLETED]: RequestCompleteEvent\n [LifeCycleEventTypeAsConst.WEBSOCKET_COMPLETED]: WebSocketCompleteEvent\n [LifeCycleEventTypeAsConst.SESSION_EXPIRED]: SessionExpiredEvent\n [LifeCycleEventTypeAsConst.SESSION_RENEWED]: void\n [LifeCycleEventTypeAsConst.PREPARE_URGENT_FLUSH]: UrgentFlushReason\n [LifeCycleEventTypeAsConst.RAW_RUM_EVENT_COLLECTED]: RawRumEventCollectedData\n [LifeCycleEventTypeAsConst.RUM_EVENT_COLLECTED]: AssembledRumEvent\n [LifeCycleEventTypeAsConst.RAW_ERROR_COLLECTED]: {\n error: RawError\n customerContext?: Context\n }\n [LifeCycleEventTypeAsConst.DURATION_VITAL_STARTED]: DurationVitalStart\n}\n\nexport interface RawRumEventCollectedData<E extends RawRumEvent = RawRumEvent> {\n startClocks: ClocksState\n duration?: Duration\n rawRumEvent: E\n domainContext: RumEventDomainContext<E['type']>\n}\n\nexport const LifeCycle = AbstractLifeCycle<LifeCycleEventMap>\nexport type LifeCycle = AbstractLifeCycle<LifeCycleEventMap>\n"],"mappings":";;AAcA,IAAkB,qBAAX,yBAAA,oBAAA;CAGL,mBAAA,mBAAA,2BAAA,KAAA;CACA,mBAAA,mBAAA,yBAAA,KAAA;CACA,mBAAA,mBAAA,kBAAA,KAAA;CACA,mBAAA,mBAAA,yBAAA,KAAA;CACA,mBAAA,mBAAA,kBAAA,KAAA;CACA,mBAAA,mBAAA,gBAAA,KAAA;CACA,mBAAA,mBAAA,sBAAA,KAAA;CACA,mBAAA,mBAAA,qBAAA,KAAA;CACA,mBAAA,mBAAA,uBAAA,KAAA;CACA,mBAAA,mBAAA,yBAAA,KAAA;CAYA,mBAAA,mBAAA,qBAAA,MAAA;CACA,mBAAA,mBAAA,qBAAA,MAAA;CACA,mBAAA,mBAAA,0BAAA,MAAA;CACA,mBAAA,mBAAA,6BAAA,MAAA;CACA,mBAAA,mBAAA,yBAAA,MAAA;CACA,mBAAA,mBAAA,yBAAA,MAAA;CACA,mBAAA,mBAAA,oBAAA,MAAA;CACA,mBAAA,mBAAA,4BAAA,MAAA;;AACF,EAAA,CAAA,CAAA;AAoEA,MAAa,YAAYA,kCAAAA"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import type { Context } from '@kubesense/kubesense-browser-core';
|
|
2
|
-
export type ModifiableFieldPaths = Record<string, 'string' | 'object'>;
|
|
2
|
+
export type ModifiableFieldPaths = Record<string, 'string' | 'object' | 'array'>;
|
|
3
3
|
/**
|
|
4
4
|
* Allows declaring and enforcing modifications to specific fields of an object.
|
|
5
5
|
* Only supports modifying properties of an object (even if nested in an array).
|
|
6
6
|
* Does not support array manipulation (adding/removing items).
|
|
7
|
+
*
|
|
8
|
+
* Modifications of the object are sanitized only if the field was actually changed by the modifier function (i.e., value is different).
|
|
9
|
+
* This ensures consistent SDK behavior regardless of whether limitModification is called.
|
|
10
|
+
* Only string fields are handled this way, object fields are sanitized regardless of whether the modifier function was called or not.
|
|
7
11
|
*/
|
|
8
12
|
export declare function limitModification<T extends Context, Result>(object: T, modifiableFieldPaths: ModifiableFieldPaths, modifier: (object: T) => Result): Result | undefined;
|
|
@@ -1,46 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const kubesense_browser_core_1 = require("@kubesense/kubesense-browser-core");
|
|
1
|
+
let _kubesense_kubesense_js_core_util = require("@kubesense/kubesense-js-core/util");
|
|
2
|
+
let _kubesense_kubesense_browser_core = require("@kubesense/kubesense-browser-core");
|
|
3
|
+
//#region src/domain/limitModification.ts
|
|
5
4
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
* Allows declaring and enforcing modifications to specific fields of an object.
|
|
6
|
+
* Only supports modifying properties of an object (even if nested in an array).
|
|
7
|
+
* Does not support array manipulation (adding/removing items).
|
|
8
|
+
*
|
|
9
|
+
* Modifications of the object are sanitized only if the field was actually changed by the modifier function (i.e., value is different).
|
|
10
|
+
* This ensures consistent SDK behavior regardless of whether limitModification is called.
|
|
11
|
+
* Only string fields are handled this way, object fields are sanitized regardless of whether the modifier function was called or not.
|
|
12
|
+
*/
|
|
10
13
|
function limitModification(object, modifiableFieldPaths, modifier) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
setValueAtPath(object, clone, fieldPath.split(/\.|(?=\[\])/), fieldType));
|
|
16
|
-
return result;
|
|
14
|
+
const clone = (0, _kubesense_kubesense_js_core_util.deepClone)(object);
|
|
15
|
+
const result = modifier(clone);
|
|
16
|
+
(0, _kubesense_kubesense_browser_core.objectEntries)(modifiableFieldPaths).forEach(([fieldPath, fieldType]) => setValueAtPath(object, clone, fieldPath.split(/\.|(?=\[\])/), fieldType));
|
|
17
|
+
return result;
|
|
17
18
|
}
|
|
18
19
|
function setValueAtPath(object, clone, pathSegments, fieldType) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
if (restPathSegments.length > 0) {
|
|
30
|
-
return setValueAtPath(object[field], clone[field], restPathSegments, fieldType);
|
|
31
|
-
}
|
|
32
|
-
setNestedValue(object, field, clone[field], fieldType);
|
|
20
|
+
const [field, ...restPathSegments] = pathSegments;
|
|
21
|
+
if (field === "[]") {
|
|
22
|
+
if (Array.isArray(object) && Array.isArray(clone)) object.forEach((item, i) => setValueAtPath(item, clone[i], restPathSegments, fieldType));
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
if (!isValidObject(object) || !isValidObject(clone)) return;
|
|
26
|
+
if (restPathSegments.length > 0) return setValueAtPath(object[field], clone[field], restPathSegments, fieldType);
|
|
27
|
+
setNestedValue(object, field, clone[field], fieldType);
|
|
33
28
|
}
|
|
34
29
|
function setNestedValue(object, field, value, fieldType) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
object[field] = {};
|
|
41
|
-
}
|
|
30
|
+
if (object[field] === value) return;
|
|
31
|
+
const newType = (0, _kubesense_kubesense_js_core_util.getType)(value);
|
|
32
|
+
if (newType === fieldType) object[field] = (0, _kubesense_kubesense_browser_core.sanitize)(value);
|
|
33
|
+
else if (fieldType === "object" && (newType === "undefined" || newType === "null")) object[field] = {};
|
|
34
|
+
else if (fieldType === "array" && (newType === "undefined" || newType === "null")) object[field] = [];
|
|
42
35
|
}
|
|
43
36
|
function isValidObject(object) {
|
|
44
|
-
|
|
37
|
+
return (0, _kubesense_kubesense_js_core_util.getType)(object) === "object";
|
|
45
38
|
}
|
|
39
|
+
//#endregion
|
|
40
|
+
exports.limitModification = limitModification;
|
|
41
|
+
|
|
46
42
|
//# sourceMappingURL=limitModification.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"limitModification.js","
|
|
1
|
+
{"version":3,"file":"limitModification.js","names":["deepClone","getType","sanitize"],"sources":["../../src/domain/limitModification.ts"],"sourcesContent":["import { sanitize, objectEntries } from '@kubesense/kubesense-browser-core'\nimport type { Context } from '@kubesense/kubesense-browser-core'\nimport { deepClone, getType } from '@kubesense/kubesense-js-core/util'\n\nexport type ModifiableFieldPaths = Record<string, 'string' | 'object' | 'array'>\n\n/**\n * Allows declaring and enforcing modifications to specific fields of an object.\n * Only supports modifying properties of an object (even if nested in an array).\n * Does not support array manipulation (adding/removing items).\n *\n * Modifications of the object are sanitized only if the field was actually changed by the modifier function (i.e., value is different).\n * This ensures consistent SDK behavior regardless of whether limitModification is called.\n * Only string fields are handled this way, object fields are sanitized regardless of whether the modifier function was called or not.\n */\nexport function limitModification<T extends Context, Result>(\n object: T,\n modifiableFieldPaths: ModifiableFieldPaths,\n modifier: (object: T) => Result\n): Result | undefined {\n const clone = deepClone(object)\n const result = modifier(clone)\n\n objectEntries(modifiableFieldPaths).forEach(([fieldPath, fieldType]) =>\n // Traverse both object and clone simultaneously up to the path and apply the modification from the clone to the original object when the type is valid\n setValueAtPath(object, clone, fieldPath.split(/\\.|(?=\\[\\])/), fieldType)\n )\n\n return result\n}\n\nfunction setValueAtPath(\n object: unknown,\n clone: unknown,\n pathSegments: string[],\n fieldType: 'string' | 'object' | 'array'\n) {\n const [field, ...restPathSegments] = pathSegments\n\n if (field === '[]') {\n if (Array.isArray(object) && Array.isArray(clone)) {\n object.forEach((item, i) => setValueAtPath(item, clone[i], restPathSegments, fieldType))\n }\n\n return\n }\n\n if (!isValidObject(object) || !isValidObject(clone)) {\n return\n }\n\n if (restPathSegments.length > 0) {\n return setValueAtPath(object[field], clone[field], restPathSegments, fieldType)\n }\n\n setNestedValue(object, field, clone[field], fieldType)\n}\n\nfunction setNestedValue(\n object: Record<string, unknown>,\n field: string,\n value: unknown,\n fieldType: 'string' | 'object' | 'array'\n) {\n if (object[field] === value) {\n return\n }\n\n const newType = getType(value)\n\n if (newType === fieldType) {\n object[field] = sanitize(value)\n } else if (fieldType === 'object' && (newType === 'undefined' || newType === 'null')) {\n object[field] = {}\n } else if (fieldType === 'array' && (newType === 'undefined' || newType === 'null')) {\n object[field] = []\n }\n}\n\nfunction isValidObject(object: unknown): object is Record<string, unknown> {\n return getType(object) === 'object'\n}\n"],"mappings":";;;;;;;;;;;;AAeA,SAAgB,kBACd,QACA,sBACA,UACoB;CACpB,MAAM,SAAA,GAAQA,kCAAAA,UAAAA,CAAU,MAAM;CAC9B,MAAM,SAAS,SAAS,KAAK;CAE7B,CAAA,GAAA,kCAAA,cAAA,CAAc,oBAAoB,CAAC,CAAC,SAAS,CAAC,WAAW,eAEvD,eAAe,QAAQ,OAAO,UAAU,MAAM,aAAa,GAAG,SAAS,CACzE;CAEA,OAAO;AACT;AAEA,SAAS,eACP,QACA,OACA,cACA,WACA;CACA,MAAM,CAAC,OAAO,GAAG,oBAAoB;CAErC,IAAI,UAAU,MAAM;EAClB,IAAI,MAAM,QAAQ,MAAM,KAAK,MAAM,QAAQ,KAAK,GAC9C,OAAO,SAAS,MAAM,MAAM,eAAe,MAAM,MAAM,IAAI,kBAAkB,SAAS,CAAC;EAGzF;CACF;CAEA,IAAI,CAAC,cAAc,MAAM,KAAK,CAAC,cAAc,KAAK,GAChD;CAGF,IAAI,iBAAiB,SAAS,GAC5B,OAAO,eAAe,OAAO,QAAQ,MAAM,QAAQ,kBAAkB,SAAS;CAGhF,eAAe,QAAQ,OAAO,MAAM,QAAQ,SAAS;AACvD;AAEA,SAAS,eACP,QACA,OACA,OACA,WACA;CACA,IAAI,OAAO,WAAW,OACpB;CAGF,MAAM,WAAA,GAAUC,kCAAAA,QAAAA,CAAQ,KAAK;CAE7B,IAAI,YAAY,WACd,OAAO,UAAA,GAASC,kCAAAA,SAAAA,CAAS,KAAK;MACzB,IAAI,cAAc,aAAa,YAAY,eAAe,YAAY,SAC3E,OAAO,SAAS,CAAC;MACZ,IAAI,cAAc,YAAY,YAAY,eAAe,YAAY,SAC1E,OAAO,SAAS,CAAC;AAErB;AAEA,SAAS,cAAc,QAAoD;CACzE,QAAA,GAAOD,kCAAAA,QAAAA,CAAQ,MAAM,MAAM;AAC7B"}
|
|
@@ -1,18 +1,5 @@
|
|
|
1
|
-
import type { RelativeTime, ClocksState, Duration } from '@kubesense/kubesense-browser-core';
|
|
2
1
|
import type { LifeCycle } from '../lifeCycle';
|
|
3
|
-
import { RumPerformanceEntryType } from '../../browser/performanceObservable';
|
|
4
2
|
import type { RumConfiguration } from '../configuration';
|
|
5
|
-
export declare const LONG_TASK_ID_HISTORY_TIME_OUT_DELAY: number;
|
|
6
|
-
export interface LongTaskContext {
|
|
7
|
-
id: string;
|
|
8
|
-
startClocks: ClocksState;
|
|
9
|
-
duration: Duration;
|
|
10
|
-
entryType: RumPerformanceEntryType.LONG_ANIMATION_FRAME | RumPerformanceEntryType.LONG_TASK;
|
|
11
|
-
}
|
|
12
|
-
export interface LongTaskContexts {
|
|
13
|
-
findLongTasks: (startTime: RelativeTime) => LongTaskContext[];
|
|
14
|
-
}
|
|
15
3
|
export declare function startLongTaskCollection(lifeCycle: LifeCycle, configuration: RumConfiguration): {
|
|
16
4
|
stop: () => void;
|
|
17
|
-
longTaskContexts: LongTaskContexts;
|
|
18
5
|
};
|
|
@@ -1,91 +1,79 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const performanceObservable_1 = require("../../browser/performanceObservable");
|
|
8
|
-
exports.LONG_TASK_ID_HISTORY_TIME_OUT_DELAY = kubesense_browser_core_1.SESSION_TIME_OUT_DELAY;
|
|
1
|
+
const require_rawRumEvent_types = require("../../rawRumEvent.types.js");
|
|
2
|
+
require("../lifeCycle.js");
|
|
3
|
+
const require_performanceObservable = require("../../browser/performanceObservable.js");
|
|
4
|
+
let _kubesense_kubesense_js_core_time = require("@kubesense/kubesense-js-core/time");
|
|
5
|
+
let _kubesense_kubesense_browser_core = require("@kubesense/kubesense-browser-core");
|
|
6
|
+
//#region src/domain/longTask/longTaskCollection.ts
|
|
9
7
|
function startLongTaskCollection(lifeCycle, configuration) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
rawRumEvent,
|
|
29
|
-
startTime: startClocks.relative,
|
|
30
|
-
duration: entry.duration,
|
|
31
|
-
domainContext: { performanceEntry: entry },
|
|
32
|
-
});
|
|
33
|
-
history.add({ id: taskId, startClocks, duration: entry.duration, entryType }, startClocks.relative);
|
|
34
|
-
history.closeActive((0, kubesense_browser_core_1.addDuration)(startClocks.relative, entry.duration));
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
const longTaskContexts = {
|
|
38
|
-
findLongTasks: (startTime) => history.findAll(startTime),
|
|
39
|
-
};
|
|
40
|
-
return {
|
|
41
|
-
stop: () => {
|
|
42
|
-
subscription.unsubscribe();
|
|
43
|
-
history.stop();
|
|
44
|
-
},
|
|
45
|
-
longTaskContexts,
|
|
46
|
-
};
|
|
8
|
+
const entryType = require_performanceObservable.supportPerformanceTimingEvent("long-animation-frame") ? "long-animation-frame" : "longtask";
|
|
9
|
+
const subscription = require_performanceObservable.createPerformanceObservable({
|
|
10
|
+
type: entryType,
|
|
11
|
+
buffered: true
|
|
12
|
+
}).subscribe((entries) => {
|
|
13
|
+
for (const entry of entries) {
|
|
14
|
+
if (!configuration.trackLongTasks) break;
|
|
15
|
+
const startClocks = (0, _kubesense_kubesense_js_core_time.relativeToClocks)(entry.startTime);
|
|
16
|
+
const rawRumEvent = processEntry(entry, startClocks);
|
|
17
|
+
lifeCycle.notify(13, {
|
|
18
|
+
rawRumEvent,
|
|
19
|
+
startClocks,
|
|
20
|
+
duration: entry.duration,
|
|
21
|
+
domainContext: { performanceEntry: entry }
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
return { stop: () => subscription.unsubscribe() };
|
|
47
26
|
}
|
|
48
|
-
function processEntry(entry, startClocks
|
|
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
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
27
|
+
function processEntry(entry, startClocks) {
|
|
28
|
+
const id = (0, _kubesense_kubesense_browser_core.generateUUID)();
|
|
29
|
+
const duration = (0, _kubesense_kubesense_js_core_time.toServerDuration)(entry.duration);
|
|
30
|
+
const baseEvent = {
|
|
31
|
+
date: startClocks.timeStamp,
|
|
32
|
+
type: require_rawRumEvent_types.RumEventType.LONG_TASK,
|
|
33
|
+
_kubesense: { discarded: false }
|
|
34
|
+
};
|
|
35
|
+
if (entry.entryType === "longtask") return {
|
|
36
|
+
...baseEvent,
|
|
37
|
+
long_task: {
|
|
38
|
+
id,
|
|
39
|
+
entry_type: require_rawRumEvent_types.RumLongTaskEntryType.LONG_TASK,
|
|
40
|
+
duration
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
const scriptUrls = entry.scripts.map((script) => script.sourceURL).filter((url) => !!url);
|
|
44
|
+
const debugIdByUrl = (0, _kubesense_kubesense_browser_core.buildDebugIdByUrl)(scriptUrls);
|
|
45
|
+
return {
|
|
46
|
+
...baseEvent,
|
|
47
|
+
_kubesense: {
|
|
48
|
+
discarded: false,
|
|
49
|
+
debug_ids: debugIdByUrl
|
|
50
|
+
},
|
|
51
|
+
long_task: {
|
|
52
|
+
id,
|
|
53
|
+
entry_type: require_rawRumEvent_types.RumLongTaskEntryType.LONG_ANIMATION_FRAME,
|
|
54
|
+
duration,
|
|
55
|
+
blocking_duration: (0, _kubesense_kubesense_js_core_time.toServerDuration)(entry.blockingDuration),
|
|
56
|
+
first_ui_event_timestamp: (0, _kubesense_kubesense_js_core_time.toServerDuration)(entry.firstUIEventTimestamp),
|
|
57
|
+
render_start: (0, _kubesense_kubesense_js_core_time.toServerDuration)(entry.renderStart),
|
|
58
|
+
style_and_layout_start: (0, _kubesense_kubesense_js_core_time.toServerDuration)(entry.styleAndLayoutStart),
|
|
59
|
+
start_time: (0, _kubesense_kubesense_js_core_time.toServerDuration)(entry.startTime),
|
|
60
|
+
scripts: entry.scripts.map((script) => ({
|
|
61
|
+
duration: (0, _kubesense_kubesense_js_core_time.toServerDuration)(script.duration),
|
|
62
|
+
pause_duration: (0, _kubesense_kubesense_js_core_time.toServerDuration)(script.pauseDuration),
|
|
63
|
+
forced_style_and_layout_duration: (0, _kubesense_kubesense_js_core_time.toServerDuration)(script.forcedStyleAndLayoutDuration),
|
|
64
|
+
start_time: (0, _kubesense_kubesense_js_core_time.toServerDuration)(script.startTime),
|
|
65
|
+
execution_start: (0, _kubesense_kubesense_js_core_time.toServerDuration)(script.executionStart),
|
|
66
|
+
source_url: script.sourceURL,
|
|
67
|
+
source_function_name: script.sourceFunctionName,
|
|
68
|
+
source_char_position: script.sourceCharPosition,
|
|
69
|
+
invoker: script.invoker,
|
|
70
|
+
invoker_type: script.invokerType,
|
|
71
|
+
window_attribution: script.windowAttribution
|
|
72
|
+
}))
|
|
73
|
+
}
|
|
74
|
+
};
|
|
90
75
|
}
|
|
76
|
+
//#endregion
|
|
77
|
+
exports.startLongTaskCollection = startLongTaskCollection;
|
|
78
|
+
|
|
91
79
|
//# sourceMappingURL=longTaskCollection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"longTaskCollection.js","
|
|
1
|
+
{"version":3,"file":"longTaskCollection.js","names":["supportPerformanceTimingEvent","createPerformanceObservable","relativeToClocks","generateUUID","toServerDuration","RumEventType","RumLongTaskEntryType","buildDebugIdByUrl"],"sources":["../../../src/domain/longTask/longTaskCollection.ts"],"sourcesContent":["import type { ClocksState } from '@kubesense/kubesense-js-core/time'\nimport { toServerDuration, relativeToClocks } from '@kubesense/kubesense-js-core/time'\nimport { generateUUID, buildDebugIdByUrl } from '@kubesense/kubesense-browser-core'\nimport type { RawRumLongTaskEvent, RawRumLongAnimationFrameEvent } from '../../rawRumEvent.types'\nimport { RumEventType, RumLongTaskEntryType } from '../../rawRumEvent.types'\nimport type { LifeCycle } from '../lifeCycle'\nimport { LifeCycleEventType } from '../lifeCycle'\nimport {\n createPerformanceObservable,\n RumPerformanceEntryType,\n supportPerformanceTimingEvent,\n} from '../../browser/performanceObservable'\nimport type {\n RumPerformanceLongAnimationFrameTiming,\n RumPerformanceLongTaskTiming,\n RumPerformanceScriptTiming,\n} from '../../browser/performanceObservable'\nimport type { RumConfiguration } from '../configuration'\n\nexport function startLongTaskCollection(lifeCycle: LifeCycle, configuration: RumConfiguration) {\n const entryType = supportPerformanceTimingEvent(RumPerformanceEntryType.LONG_ANIMATION_FRAME)\n ? RumPerformanceEntryType.LONG_ANIMATION_FRAME\n : RumPerformanceEntryType.LONG_TASK\n\n const subscription = createPerformanceObservable({\n type: entryType,\n buffered: true,\n }).subscribe((entries) => {\n for (const entry of entries) {\n if (!configuration.trackLongTasks) {\n break\n }\n\n const startClocks = relativeToClocks(entry.startTime)\n const rawRumEvent = processEntry(entry, startClocks)\n\n lifeCycle.notify(LifeCycleEventType.RAW_RUM_EVENT_COLLECTED, {\n rawRumEvent,\n startClocks,\n duration: entry.duration,\n domainContext: { performanceEntry: entry },\n })\n }\n })\n\n return {\n stop: () => subscription.unsubscribe(),\n }\n}\n\nfunction processEntry(\n entry: RumPerformanceLongTaskTiming | RumPerformanceLongAnimationFrameTiming,\n startClocks: ClocksState\n): RawRumLongTaskEvent | RawRumLongAnimationFrameEvent {\n const id = generateUUID()\n const duration = toServerDuration(entry.duration)\n\n const baseEvent = {\n date: startClocks.timeStamp,\n type: RumEventType.LONG_TASK,\n _kubesense: { discarded: false },\n }\n\n if (entry.entryType === RumPerformanceEntryType.LONG_TASK) {\n return {\n ...baseEvent,\n long_task: {\n id,\n entry_type: RumLongTaskEntryType.LONG_TASK,\n duration,\n },\n }\n }\n const scriptUrls = entry.scripts.map((script) => script.sourceURL).filter((url): url is string => !!url)\n const debugIdByUrl = buildDebugIdByUrl(scriptUrls)\n\n return {\n ...baseEvent,\n _kubesense: { discarded: false, debug_ids: debugIdByUrl },\n long_task: {\n id,\n entry_type: RumLongTaskEntryType.LONG_ANIMATION_FRAME,\n duration,\n blocking_duration: toServerDuration(entry.blockingDuration),\n first_ui_event_timestamp: toServerDuration(entry.firstUIEventTimestamp),\n render_start: toServerDuration(entry.renderStart),\n style_and_layout_start: toServerDuration(entry.styleAndLayoutStart),\n start_time: toServerDuration(entry.startTime),\n scripts: entry.scripts.map((script: RumPerformanceScriptTiming) => ({\n duration: toServerDuration(script.duration),\n pause_duration: toServerDuration(script.pauseDuration),\n forced_style_and_layout_duration: toServerDuration(script.forcedStyleAndLayoutDuration),\n start_time: toServerDuration(script.startTime),\n execution_start: toServerDuration(script.executionStart),\n source_url: script.sourceURL,\n source_function_name: script.sourceFunctionName,\n source_char_position: script.sourceCharPosition,\n invoker: script.invoker,\n invoker_type: script.invokerType,\n window_attribution: script.windowAttribution,\n })),\n },\n }\n}\n"],"mappings":";;;;;;AAmBA,SAAgB,wBAAwB,WAAsB,eAAiC;CAC7F,MAAM,YAAYA,8BAAAA,8BAAAA,sBAA0E,IAAA,yBAAA;CAI5F,MAAM,eAAeC,8BAAAA,4BAA4B;EAC/C,MAAM;EACN,UAAU;CACZ,CAAC,CAAC,CAAC,WAAW,YAAY;EACxB,KAAK,MAAM,SAAS,SAAS;GAC3B,IAAI,CAAC,cAAc,gBACjB;GAGF,MAAM,eAAA,GAAcC,kCAAAA,iBAAAA,CAAiB,MAAM,SAAS;GACpD,MAAM,cAAc,aAAa,OAAO,WAAW;GAEnD,UAAU,OAAA,IAAmD;IAC3D;IACA;IACA,UAAU,MAAM;IAChB,eAAe,EAAE,kBAAkB,MAAM;GAC3C,CAAC;EACH;CACF,CAAC;CAED,OAAO,EACL,YAAY,aAAa,YAAY,EACvC;AACF;AAEA,SAAS,aACP,OACA,aACqD;CACrD,MAAM,MAAA,GAAKC,kCAAAA,aAAAA,CAAa;CACxB,MAAM,YAAA,GAAWC,kCAAAA,iBAAAA,CAAiB,MAAM,QAAQ;CAEhD,MAAM,YAAY;EAChB,MAAM,YAAY;EAClB,MAAMC,0BAAAA,aAAa;EACnB,YAAY,EAAE,WAAW,MAAM;CACjC;CAEA,IAAI,MAAM,cAAA,YACR,OAAO;EACL,GAAG;EACH,WAAW;GACT;GACA,YAAYC,0BAAAA,qBAAqB;GACjC;EACF;CACF;CAEF,MAAM,aAAa,MAAM,QAAQ,KAAK,WAAW,OAAO,SAAS,CAAC,CAAC,QAAQ,QAAuB,CAAC,CAAC,GAAG;CACvG,MAAM,gBAAA,GAAeC,kCAAAA,kBAAAA,CAAkB,UAAU;CAEjD,OAAO;EACL,GAAG;EACH,YAAY;GAAE,WAAW;GAAO,WAAW;EAAa;EACxD,WAAW;GACT;GACA,YAAYD,0BAAAA,qBAAqB;GACjC;GACA,oBAAA,GAAmBF,kCAAAA,iBAAAA,CAAiB,MAAM,gBAAgB;GAC1D,2BAAA,GAA0BA,kCAAAA,iBAAAA,CAAiB,MAAM,qBAAqB;GACtE,eAAA,GAAcA,kCAAAA,iBAAAA,CAAiB,MAAM,WAAW;GAChD,yBAAA,GAAwBA,kCAAAA,iBAAAA,CAAiB,MAAM,mBAAmB;GAClE,aAAA,GAAYA,kCAAAA,iBAAAA,CAAiB,MAAM,SAAS;GAC5C,SAAS,MAAM,QAAQ,KAAK,YAAwC;IAClE,WAAA,GAAUA,kCAAAA,iBAAAA,CAAiB,OAAO,QAAQ;IAC1C,iBAAA,GAAgBA,kCAAAA,iBAAAA,CAAiB,OAAO,aAAa;IACrD,mCAAA,GAAkCA,kCAAAA,iBAAAA,CAAiB,OAAO,4BAA4B;IACtF,aAAA,GAAYA,kCAAAA,iBAAAA,CAAiB,OAAO,SAAS;IAC7C,kBAAA,GAAiBA,kCAAAA,iBAAAA,CAAiB,OAAO,cAAc;IACvD,YAAY,OAAO;IACnB,sBAAsB,OAAO;IAC7B,sBAAsB,OAAO;IAC7B,SAAS,OAAO;IAChB,cAAc,OAAO;IACrB,oBAAoB,OAAO;GAC7B,EAAE;EACJ;CACF;AACF"}
|
package/cjs/domain/plugins.d.ts
CHANGED
|
@@ -1,40 +1,63 @@
|
|
|
1
|
-
import type { RumPublicApi
|
|
1
|
+
import type { RumPublicApi } from '../boot/rumPublicApi';
|
|
2
2
|
import type { StartRumResult } from '../boot/startRum';
|
|
3
3
|
import type { RumInitConfiguration } from './configuration';
|
|
4
|
+
import type { AssembleHook } from './hooks';
|
|
4
5
|
/**
|
|
5
|
-
*
|
|
6
|
+
* onInit plugin API options.
|
|
6
7
|
*
|
|
7
8
|
* @experimental
|
|
8
9
|
*/
|
|
9
|
-
export interface
|
|
10
|
+
export interface RumPluginOnInitOptions {
|
|
11
|
+
initConfiguration: RumInitConfiguration;
|
|
12
|
+
publicApi: RumPublicApi;
|
|
10
13
|
/**
|
|
11
|
-
*
|
|
14
|
+
* Register a callback invoked when a RUM event is assembled, so plugins can enrich or override
|
|
15
|
+
* event fields before they are sent. Callbacks registered in `onInit` run before any event is
|
|
16
|
+
* assembled, including events buffered during the pre-start phase.
|
|
12
17
|
*/
|
|
13
|
-
|
|
18
|
+
registerAssembleEventHook: AssembleHook['register'];
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* onRumStart plugin API options.
|
|
22
|
+
*
|
|
23
|
+
* @experimental
|
|
24
|
+
*/
|
|
25
|
+
export interface OnRumStartOptions {
|
|
14
26
|
/**
|
|
15
27
|
* Add an event to the RUM browser SDK.
|
|
16
28
|
*/
|
|
17
29
|
addEvent?: StartRumResult['addEvent'];
|
|
30
|
+
/**
|
|
31
|
+
* Add a custom error to the RUM browser SDK.
|
|
32
|
+
*/
|
|
33
|
+
addError?: StartRumResult['addError'];
|
|
18
34
|
}
|
|
19
35
|
/**
|
|
20
36
|
* Plugin interface of the RUM browser SDK.
|
|
21
37
|
*
|
|
22
38
|
* The plugins API is unstable and experimental, and may change without
|
|
23
|
-
* notice. Please use only plugins provided by
|
|
39
|
+
* notice. Please use only plugins provided by KubeSense matching the version of the SDK you are
|
|
24
40
|
* using.
|
|
25
41
|
*
|
|
42
|
+
* `onInit` may abort the SDK initialization by returning (or resolving to) `false`. All plugins'
|
|
43
|
+
* `onInit` are called concurrently and independently; a Promise defers the actual initialization
|
|
44
|
+
* until it resolves, but does not delay any other plugin's `onInit` call.
|
|
45
|
+
*
|
|
26
46
|
* @experimental
|
|
27
47
|
*/
|
|
28
48
|
export interface RumPlugin {
|
|
29
49
|
name: string;
|
|
30
50
|
getConfigurationTelemetry?(): Record<string, unknown>;
|
|
31
|
-
onInit?(options:
|
|
32
|
-
initConfiguration: RumInitConfiguration;
|
|
33
|
-
publicApi: RumPublicApi;
|
|
34
|
-
}): void;
|
|
51
|
+
onInit?(options: RumPluginOnInitOptions): false | void | Promise<false | void>;
|
|
35
52
|
onRumStart?(options: OnRumStartOptions): void;
|
|
36
53
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
54
|
+
/**
|
|
55
|
+
* Calls every plugin's `onInit` method concurrently, without waiting for one to resolve before
|
|
56
|
+
* calling the next. Stays synchronous as long as no plugin returns a thenable.
|
|
57
|
+
* Returns `false` if any plugin returned (or resolved to) `false`, `true` otherwise.
|
|
58
|
+
*/
|
|
59
|
+
export declare function callPluginsOnInit(plugins: RumPlugin[] | undefined, parameter: RumPluginOnInitOptions): boolean | Promise<boolean>;
|
|
60
|
+
/**
|
|
61
|
+
* Calls each plugin's `onRumStart` method in order.
|
|
62
|
+
*/
|
|
63
|
+
export declare function callPluginsOnRumStart(plugins: RumPlugin[] | undefined, options: OnRumStartOptions): void;
|
package/cjs/domain/plugins.js
CHANGED
|
@@ -1,15 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
1
|
+
let _kubesense_kubesense_browser_core = require("@kubesense/kubesense-browser-core");
|
|
2
|
+
//#region src/domain/plugins.ts
|
|
3
|
+
/**
|
|
4
|
+
* Calls every plugin's `onInit` method concurrently, without waiting for one to resolve before
|
|
5
|
+
* calling the next. Stays synchronous as long as no plugin returns a thenable.
|
|
6
|
+
* Returns `false` if any plugin returned (or resolved to) `false`, `true` otherwise.
|
|
7
|
+
*/
|
|
8
|
+
function callPluginsOnInit(plugins, parameter) {
|
|
9
|
+
if (!plugins) return true;
|
|
10
|
+
const results = plugins.map((plugin) => plugin.onInit?.(parameter));
|
|
11
|
+
if (results.some(_kubesense_kubesense_browser_core.isThenable)) return Promise.all(results).then((results) => !results.includes(false));
|
|
12
|
+
return !results.includes(false);
|
|
14
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Calls each plugin's `onRumStart` method in order.
|
|
16
|
+
*/
|
|
17
|
+
function callPluginsOnRumStart(plugins, options) {
|
|
18
|
+
for (const plugin of plugins ?? []) plugin.onRumStart?.(options);
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
exports.callPluginsOnInit = callPluginsOnInit;
|
|
22
|
+
exports.callPluginsOnRumStart = callPluginsOnRumStart;
|
|
23
|
+
|
|
15
24
|
//# sourceMappingURL=plugins.js.map
|