@kubesense/kubesense-browser-rum-core 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +3 -0
- package/cjs/boot/preStartRum.d.ts +7 -0
- package/cjs/boot/preStartRum.js +190 -0
- package/cjs/boot/preStartRum.js.map +1 -0
- package/cjs/boot/rumPublicApi.d.ts +409 -0
- package/cjs/boot/rumPublicApi.js +168 -0
- package/cjs/boot/rumPublicApi.js.map +1 -0
- package/cjs/boot/startRum.d.ts +109 -0
- package/cjs/boot/startRum.js +153 -0
- package/cjs/boot/startRum.js.map +1 -0
- package/cjs/browser/cookieObservable.d.ts +8 -0
- package/cjs/browser/cookieObservable.js +39 -0
- package/cjs/browser/cookieObservable.js.map +1 -0
- package/cjs/browser/domMutationObservable.d.ts +27 -0
- package/cjs/browser/domMutationObservable.js +58 -0
- package/cjs/browser/domMutationObservable.js.map +1 -0
- package/cjs/browser/firstInputPolyfill.d.ts +8 -0
- package/cjs/browser/firstInputPolyfill.js +68 -0
- package/cjs/browser/firstInputPolyfill.js.map +1 -0
- package/cjs/browser/htmlDomUtils.d.ts +13 -0
- package/cjs/browser/htmlDomUtils.js +46 -0
- package/cjs/browser/htmlDomUtils.js.map +1 -0
- package/cjs/browser/locationChangeObservable.d.ts +7 -0
- package/cjs/browser/locationChangeObservable.js +51 -0
- package/cjs/browser/locationChangeObservable.js.map +1 -0
- package/cjs/browser/performanceObservable.d.ts +174 -0
- package/cjs/browser/performanceObservable.js +126 -0
- package/cjs/browser/performanceObservable.js.map +1 -0
- package/cjs/browser/performanceUtils.d.ts +7 -0
- package/cjs/browser/performanceUtils.js +42 -0
- package/cjs/browser/performanceUtils.js.map +1 -0
- package/cjs/browser/scroll.d.ts +2 -0
- package/cjs/browser/scroll.js +33 -0
- package/cjs/browser/scroll.js.map +1 -0
- package/cjs/browser/viewportObservable.d.ts +10 -0
- package/cjs/browser/viewportObservable.js +37 -0
- package/cjs/browser/viewportObservable.js.map +1 -0
- package/cjs/browser/windowOpenObservable.d.ts +5 -0
- package/cjs/browser/windowOpenObservable.js +10 -0
- package/cjs/browser/windowOpenObservable.js.map +1 -0
- package/cjs/domain/action/actionCollection.d.ts +21 -0
- package/cjs/domain/action/actionCollection.js +96 -0
- package/cjs/domain/action/actionCollection.js.map +1 -0
- package/cjs/domain/action/actionNameConstants.d.ts +18 -0
- package/cjs/domain/action/actionNameConstants.js +11 -0
- package/cjs/domain/action/actionNameConstants.js.map +1 -0
- package/cjs/domain/action/clickChain.d.ts +8 -0
- package/cjs/domain/action/clickChain.js +61 -0
- package/cjs/domain/action/clickChain.js.map +1 -0
- package/cjs/domain/action/computeFrustration.d.ts +6 -0
- package/cjs/domain/action/computeFrustration.js +70 -0
- package/cjs/domain/action/computeFrustration.js.map +1 -0
- package/cjs/domain/action/getActionNameFromElement.d.ts +4 -0
- package/cjs/domain/action/getActionNameFromElement.js +239 -0
- package/cjs/domain/action/getActionNameFromElement.js.map +1 -0
- package/cjs/domain/action/interactionSelectorCache.d.ts +5 -0
- package/cjs/domain/action/interactionSelectorCache.js +23 -0
- package/cjs/domain/action/interactionSelectorCache.js.map +1 -0
- package/cjs/domain/action/listenActionEvents.d.ts +19 -0
- package/cjs/domain/action/listenActionEvents.js +61 -0
- package/cjs/domain/action/listenActionEvents.js.map +1 -0
- package/cjs/domain/action/trackClickActions.d.ts +81 -0
- package/cjs/domain/action/trackClickActions.js +237 -0
- package/cjs/domain/action/trackClickActions.js.map +1 -0
- package/cjs/domain/assembly.d.ts +5 -0
- package/cjs/domain/assembly.js +102 -0
- package/cjs/domain/assembly.js.map +1 -0
- package/cjs/domain/configuration/configuration.d.ts +325 -0
- package/cjs/domain/configuration/configuration.js +205 -0
- package/cjs/domain/configuration/configuration.js.map +1 -0
- package/cjs/domain/configuration/index.d.ts +2 -0
- package/cjs/domain/configuration/index.js +19 -0
- package/cjs/domain/configuration/index.js.map +1 -0
- package/cjs/domain/configuration/jsonPathParser.d.ts +28 -0
- package/cjs/domain/configuration/jsonPathParser.js +159 -0
- package/cjs/domain/configuration/jsonPathParser.js.map +1 -0
- package/cjs/domain/configuration/remoteConfiguration.d.ts +39 -0
- package/cjs/domain/configuration/remoteConfiguration.js +243 -0
- package/cjs/domain/configuration/remoteConfiguration.js.map +1 -0
- package/cjs/domain/configuration/remoteConfiguration.types.d.ts +138 -0
- package/cjs/domain/configuration/remoteConfiguration.types.js +7 -0
- package/cjs/domain/configuration/remoteConfiguration.types.js.map +1 -0
- package/cjs/domain/contexts/ciVisibilityContext.d.ts +12 -0
- package/cjs/domain/contexts/ciVisibilityContext.js +34 -0
- package/cjs/domain/contexts/ciVisibilityContext.js.map +1 -0
- package/cjs/domain/contexts/connectivityContext.d.ts +2 -0
- package/cjs/domain/contexts/connectivityContext.js +11 -0
- package/cjs/domain/contexts/connectivityContext.js.map +1 -0
- package/cjs/domain/contexts/defaultContext.d.ts +4 -0
- package/cjs/domain/contexts/defaultContext.js +34 -0
- package/cjs/domain/contexts/defaultContext.js.map +1 -0
- package/cjs/domain/contexts/displayContext.d.ts +6 -0
- package/cjs/domain/contexts/displayContext.js +28 -0
- package/cjs/domain/contexts/displayContext.js.map +1 -0
- package/cjs/domain/contexts/featureFlagContext.d.ts +19 -0
- package/cjs/domain/contexts/featureFlagContext.js +53 -0
- package/cjs/domain/contexts/featureFlagContext.js.map +1 -0
- package/cjs/domain/contexts/internalContext.d.ts +12 -0
- package/cjs/domain/contexts/internalContext.js +26 -0
- package/cjs/domain/contexts/internalContext.js.map +1 -0
- package/cjs/domain/contexts/pageStateHistory.d.ts +23 -0
- package/cjs/domain/contexts/pageStateHistory.js +104 -0
- package/cjs/domain/contexts/pageStateHistory.js.map +1 -0
- package/cjs/domain/contexts/sessionContext.d.ts +5 -0
- package/cjs/domain/contexts/sessionContext.js +47 -0
- package/cjs/domain/contexts/sessionContext.js.map +1 -0
- package/cjs/domain/contexts/syntheticsContext.d.ts +2 -0
- package/cjs/domain/contexts/syntheticsContext.js +25 -0
- package/cjs/domain/contexts/syntheticsContext.js.map +1 -0
- package/cjs/domain/contexts/trackingConsentContext.d.ts +3 -0
- package/cjs/domain/contexts/trackingConsentContext.js +14 -0
- package/cjs/domain/contexts/trackingConsentContext.js.map +1 -0
- package/cjs/domain/contexts/urlContexts.d.ts +22 -0
- package/cjs/domain/contexts/urlContexts.js +64 -0
- package/cjs/domain/contexts/urlContexts.js.map +1 -0
- package/cjs/domain/contexts/userAgentDataContext.d.ts +2 -0
- package/cjs/domain/contexts/userAgentDataContext.js +31 -0
- package/cjs/domain/contexts/userAgentDataContext.js.map +1 -0
- package/cjs/domain/contexts/viewHistory.d.ts +17 -0
- package/cjs/domain/contexts/viewHistory.js +48 -0
- package/cjs/domain/contexts/viewHistory.js.map +1 -0
- package/cjs/domain/discardNegativeDuration.d.ts +2 -0
- package/cjs/domain/discardNegativeDuration.js +8 -0
- package/cjs/domain/discardNegativeDuration.js.map +1 -0
- package/cjs/domain/error/errorCollection.d.ts +17 -0
- package/cjs/domain/error/errorCollection.js +74 -0
- package/cjs/domain/error/errorCollection.js.map +1 -0
- package/cjs/domain/error/trackConsoleError.d.ts +4 -0
- package/cjs/domain/error/trackConsoleError.js +13 -0
- package/cjs/domain/error/trackConsoleError.js.map +1 -0
- package/cjs/domain/error/trackReportError.d.ts +5 -0
- package/cjs/domain/error/trackReportError.js +16 -0
- package/cjs/domain/error/trackReportError.js.map +1 -0
- package/cjs/domain/event/eventCollection.d.ts +10 -0
- package/cjs/domain/event/eventCollection.js +27 -0
- package/cjs/domain/event/eventCollection.js.map +1 -0
- package/cjs/domain/getSelectorFromElement.d.ts +64 -0
- package/cjs/domain/getSelectorFromElement.js +218 -0
- package/cjs/domain/getSelectorFromElement.js.map +1 -0
- package/cjs/domain/getSessionReplayUrl.d.ts +9 -0
- package/cjs/domain/getSessionReplayUrl.js +34 -0
- package/cjs/domain/getSessionReplayUrl.js.map +1 -0
- package/cjs/domain/hooks.d.ts +23 -0
- package/cjs/domain/hooks.js +6 -0
- package/cjs/domain/hooks.js.map +1 -0
- package/cjs/domain/lifeCycle.d.ts +73 -0
- package/cjs/domain/lifeCycle.js +6 -0
- package/cjs/domain/lifeCycle.js.map +1 -0
- package/cjs/domain/limitModification.d.ts +8 -0
- package/cjs/domain/limitModification.js +46 -0
- package/cjs/domain/limitModification.js.map +1 -0
- package/cjs/domain/longTask/longTaskCollection.d.ts +18 -0
- package/cjs/domain/longTask/longTaskCollection.js +91 -0
- package/cjs/domain/longTask/longTaskCollection.js.map +1 -0
- package/cjs/domain/plugins.d.ts +40 -0
- package/cjs/domain/plugins.js +15 -0
- package/cjs/domain/plugins.js.map +1 -0
- package/cjs/domain/privacy.d.ts +44 -0
- package/cjs/domain/privacy.js +313 -0
- package/cjs/domain/privacy.js.map +1 -0
- package/cjs/domain/privacyConstants.d.ts +23 -0
- package/cjs/domain/privacyConstants.js +39 -0
- package/cjs/domain/privacyConstants.js.map +1 -0
- package/cjs/domain/requestCollection.d.ts +54 -0
- package/cjs/domain/requestCollection.js +111 -0
- package/cjs/domain/requestCollection.js.map +1 -0
- package/cjs/domain/resource/graphql.d.ts +23 -0
- package/cjs/domain/resource/graphql.js +97 -0
- package/cjs/domain/resource/graphql.js.map +1 -0
- package/cjs/domain/resource/matchRequestResourceEntry.d.ts +16 -0
- package/cjs/domain/resource/matchRequestResourceEntry.js +49 -0
- package/cjs/domain/resource/matchRequestResourceEntry.js.map +1 -0
- package/cjs/domain/resource/requestRegistry.d.ts +9 -0
- package/cjs/domain/resource/requestRegistry.js +41 -0
- package/cjs/domain/resource/requestRegistry.js.map +1 -0
- package/cjs/domain/resource/resourceCollection.d.ts +7 -0
- package/cjs/domain/resource/resourceCollection.js +190 -0
- package/cjs/domain/resource/resourceCollection.js.map +1 -0
- package/cjs/domain/resource/resourceUtils.d.ts +55 -0
- package/cjs/domain/resource/resourceUtils.js +259 -0
- package/cjs/domain/resource/resourceUtils.js.map +1 -0
- package/cjs/domain/resource/retrieveInitialDocumentResourceTiming.d.ts +4 -0
- package/cjs/domain/resource/retrieveInitialDocumentResourceTiming.js +24 -0
- package/cjs/domain/resource/retrieveInitialDocumentResourceTiming.js.map +1 -0
- package/cjs/domain/rumSessionManager.d.ts +36 -0
- package/cjs/domain/rumSessionManager.js +77 -0
- package/cjs/domain/rumSessionManager.js.map +1 -0
- package/cjs/domain/sampler/sampler.d.ts +10 -0
- package/cjs/domain/sampler/sampler.js +63 -0
- package/cjs/domain/sampler/sampler.js.map +1 -0
- package/cjs/domain/startCustomerDataTelemetry.d.ts +4 -0
- package/cjs/domain/startCustomerDataTelemetry.js +56 -0
- package/cjs/domain/startCustomerDataTelemetry.js.map +1 -0
- package/cjs/domain/tracing/getDocumentTraceId.d.ts +12 -0
- package/cjs/domain/tracing/getDocumentTraceId.js +76 -0
- package/cjs/domain/tracing/getDocumentTraceId.js.map +1 -0
- package/cjs/domain/tracing/identifier.d.ts +13 -0
- package/cjs/domain/tracing/identifier.js +55 -0
- package/cjs/domain/tracing/identifier.js.map +1 -0
- package/cjs/domain/tracing/sampler.d.ts +10 -0
- package/cjs/domain/tracing/sampler.js +69 -0
- package/cjs/domain/tracing/sampler.js.map +1 -0
- package/cjs/domain/tracing/tracer.d.ts +30 -0
- package/cjs/domain/tracing/tracer.js +161 -0
- package/cjs/domain/tracing/tracer.js.map +1 -0
- package/cjs/domain/tracing/tracer.types.d.ts +12 -0
- package/cjs/domain/tracing/tracer.types.js +3 -0
- package/cjs/domain/tracing/tracer.types.js.map +1 -0
- package/cjs/domain/trackEventCounts.d.ts +17 -0
- package/cjs/domain/trackEventCounts.js +50 -0
- package/cjs/domain/trackEventCounts.js.map +1 -0
- package/cjs/domain/view/bfCacheSupport.d.ts +2 -0
- package/cjs/domain/view/bfCacheSupport.js +13 -0
- package/cjs/domain/view/bfCacheSupport.js.map +1 -0
- package/cjs/domain/view/trackViewEventCounts.d.ts +5 -0
- package/cjs/domain/view/trackViewEventCounts.js +16 -0
- package/cjs/domain/view/trackViewEventCounts.js.map +1 -0
- package/cjs/domain/view/trackViews.d.ts +65 -0
- package/cjs/domain/view/trackViews.js +275 -0
- package/cjs/domain/view/trackViews.js.map +1 -0
- package/cjs/domain/view/viewCollection.d.ts +18 -0
- package/cjs/domain/view/viewCollection.js +153 -0
- package/cjs/domain/view/viewCollection.js.map +1 -0
- package/cjs/domain/view/viewMetrics/getClsAttributionImpactedArea.d.ts +6 -0
- package/cjs/domain/view/viewMetrics/getClsAttributionImpactedArea.js +32 -0
- package/cjs/domain/view/viewMetrics/getClsAttributionImpactedArea.js.map +1 -0
- package/cjs/domain/view/viewMetrics/interactionCountPolyfill.d.ts +18 -0
- package/cjs/domain/view/viewMetrics/interactionCountPolyfill.js +44 -0
- package/cjs/domain/view/viewMetrics/interactionCountPolyfill.js.map +1 -0
- package/cjs/domain/view/viewMetrics/startInitialViewMetricsTelemetry.d.ts +6 -0
- package/cjs/domain/view/viewMetrics/startInitialViewMetricsTelemetry.js +44 -0
- package/cjs/domain/view/viewMetrics/startInitialViewMetricsTelemetry.js.map +1 -0
- package/cjs/domain/view/viewMetrics/trackBfcacheMetrics.d.ts +8 -0
- package/cjs/domain/view/viewMetrics/trackBfcacheMetrics.js +17 -0
- package/cjs/domain/view/viewMetrics/trackBfcacheMetrics.js.map +1 -0
- package/cjs/domain/view/viewMetrics/trackCommonViewMetrics.d.ts +21 -0
- package/cjs/domain/view/viewMetrics/trackCommonViewMetrics.js +37 -0
- package/cjs/domain/view/viewMetrics/trackCommonViewMetrics.js.map +1 -0
- package/cjs/domain/view/viewMetrics/trackCumulativeLayoutShift.d.ts +37 -0
- package/cjs/domain/view/viewMetrics/trackCumulativeLayoutShift.js +135 -0
- package/cjs/domain/view/viewMetrics/trackCumulativeLayoutShift.js.map +1 -0
- package/cjs/domain/view/viewMetrics/trackFirstContentfulPaint.d.ts +13 -0
- package/cjs/domain/view/viewMetrics/trackFirstContentfulPaint.js +39 -0
- package/cjs/domain/view/viewMetrics/trackFirstContentfulPaint.js.map +1 -0
- package/cjs/domain/view/viewMetrics/trackFirstHidden.d.ts +10 -0
- package/cjs/domain/view/viewMetrics/trackFirstHidden.js +33 -0
- package/cjs/domain/view/viewMetrics/trackFirstHidden.js.map +1 -0
- package/cjs/domain/view/viewMetrics/trackFirstInput.d.ts +19 -0
- package/cjs/domain/view/viewMetrics/trackFirstInput.js +43 -0
- package/cjs/domain/view/viewMetrics/trackFirstInput.js.map +1 -0
- package/cjs/domain/view/viewMetrics/trackInitialViewMetrics.d.ts +15 -0
- package/cjs/domain/view/viewMetrics/trackInitialViewMetrics.js +41 -0
- package/cjs/domain/view/viewMetrics/trackInitialViewMetrics.js.map +1 -0
- package/cjs/domain/view/viewMetrics/trackInteractionToNextPaint.d.ts +25 -0
- package/cjs/domain/view/viewMetrics/trackInteractionToNextPaint.js +155 -0
- package/cjs/domain/view/viewMetrics/trackInteractionToNextPaint.js.map +1 -0
- package/cjs/domain/view/viewMetrics/trackLargestContentfulPaint.d.ts +18 -0
- package/cjs/domain/view/viewMetrics/trackLargestContentfulPaint.js +61 -0
- package/cjs/domain/view/viewMetrics/trackLargestContentfulPaint.js.map +1 -0
- package/cjs/domain/view/viewMetrics/trackLoadingTime.d.ts +14 -0
- package/cjs/domain/view/viewMetrics/trackLoadingTime.js +50 -0
- package/cjs/domain/view/viewMetrics/trackLoadingTime.js.map +1 -0
- package/cjs/domain/view/viewMetrics/trackNavigationTimings.d.ts +14 -0
- package/cjs/domain/view/viewMetrics/trackNavigationTimings.js +43 -0
- package/cjs/domain/view/viewMetrics/trackNavigationTimings.js.map +1 -0
- package/cjs/domain/view/viewMetrics/trackScrollMetrics.d.ts +25 -0
- package/cjs/domain/view/viewMetrics/trackScrollMetrics.js +78 -0
- package/cjs/domain/view/viewMetrics/trackScrollMetrics.js.map +1 -0
- package/cjs/domain/vital/vitalCollection.d.ts +55 -0
- package/cjs/domain/vital/vitalCollection.js +113 -0
- package/cjs/domain/vital/vitalCollection.js.map +1 -0
- package/cjs/domain/waitPageActivityEnd.d.ts +54 -0
- package/cjs/domain/waitPageActivityEnd.js +129 -0
- package/cjs/domain/waitPageActivityEnd.js.map +1 -0
- package/cjs/domainContext.types.d.ts +39 -0
- package/cjs/domainContext.types.js +6 -0
- package/cjs/domainContext.types.js.map +1 -0
- package/cjs/index.d.ts +41 -0
- package/cjs/index.js +59 -0
- package/cjs/index.js.map +1 -0
- package/cjs/rawRumEvent.types.d.ts +326 -0
- package/cjs/rawRumEvent.types.js +34 -0
- package/cjs/rawRumEvent.types.js.map +1 -0
- package/cjs/rumEvent.types.d.ts +2026 -0
- package/cjs/rumEvent.types.js +7 -0
- package/cjs/rumEvent.types.js.map +1 -0
- package/cjs/transport/formDataTransport.d.ts +16 -0
- package/cjs/transport/formDataTransport.js +46 -0
- package/cjs/transport/formDataTransport.js.map +1 -0
- package/cjs/transport/startRumBatch.d.ts +5 -0
- package/cjs/transport/startRumBatch.js +33 -0
- package/cjs/transport/startRumBatch.js.map +1 -0
- package/cjs/transport/startRumEventBridge.d.ts +2 -0
- package/cjs/transport/startRumEventBridge.js +11 -0
- package/cjs/transport/startRumEventBridge.js.map +1 -0
- package/esm/boot/preStartRum.d.ts +7 -0
- package/esm/boot/preStartRum.js +187 -0
- package/esm/boot/preStartRum.js.map +1 -0
- package/esm/boot/rumPublicApi.d.ts +409 -0
- package/esm/boot/rumPublicApi.js +165 -0
- package/esm/boot/rumPublicApi.js.map +1 -0
- package/esm/boot/startRum.d.ts +109 -0
- package/esm/boot/startRum.js +149 -0
- package/esm/boot/startRum.js.map +1 -0
- package/esm/browser/cookieObservable.d.ts +8 -0
- package/esm/browser/cookieObservable.js +35 -0
- package/esm/browser/cookieObservable.js.map +1 -0
- package/esm/browser/domMutationObservable.d.ts +27 -0
- package/esm/browser/domMutationObservable.js +54 -0
- package/esm/browser/domMutationObservable.js.map +1 -0
- package/esm/browser/firstInputPolyfill.d.ts +8 -0
- package/esm/browser/firstInputPolyfill.js +65 -0
- package/esm/browser/firstInputPolyfill.js.map +1 -0
- package/esm/browser/htmlDomUtils.d.ts +13 -0
- package/esm/browser/htmlDomUtils.js +36 -0
- package/esm/browser/htmlDomUtils.js.map +1 -0
- package/esm/browser/locationChangeObservable.d.ts +7 -0
- package/esm/browser/locationChangeObservable.js +48 -0
- package/esm/browser/locationChangeObservable.js.map +1 -0
- package/esm/browser/performanceObservable.d.ts +174 -0
- package/esm/browser/performanceObservable.js +121 -0
- package/esm/browser/performanceObservable.js.map +1 -0
- package/esm/browser/performanceUtils.d.ts +7 -0
- package/esm/browser/performanceUtils.js +38 -0
- package/esm/browser/performanceUtils.js.map +1 -0
- package/esm/browser/scroll.d.ts +2 -0
- package/esm/browser/scroll.js +29 -0
- package/esm/browser/scroll.js.map +1 -0
- package/esm/browser/viewportObservable.d.ts +10 -0
- package/esm/browser/viewportObservable.js +32 -0
- package/esm/browser/viewportObservable.js.map +1 -0
- package/esm/browser/windowOpenObservable.d.ts +5 -0
- package/esm/browser/windowOpenObservable.js +7 -0
- package/esm/browser/windowOpenObservable.js.map +1 -0
- package/esm/domain/action/actionCollection.d.ts +21 -0
- package/esm/domain/action/actionCollection.js +93 -0
- package/esm/domain/action/actionCollection.js.map +1 -0
- package/esm/domain/action/actionNameConstants.d.ts +18 -0
- package/esm/domain/action/actionNameConstants.js +8 -0
- package/esm/domain/action/actionNameConstants.js.map +1 -0
- package/esm/domain/action/clickChain.d.ts +8 -0
- package/esm/domain/action/clickChain.js +57 -0
- package/esm/domain/action/clickChain.js.map +1 -0
- package/esm/domain/action/computeFrustration.d.ts +6 -0
- package/esm/domain/action/computeFrustration.js +65 -0
- package/esm/domain/action/computeFrustration.js.map +1 -0
- package/esm/domain/action/getActionNameFromElement.d.ts +4 -0
- package/esm/domain/action/getActionNameFromElement.js +236 -0
- package/esm/domain/action/getActionNameFromElement.js.map +1 -0
- package/esm/domain/action/interactionSelectorCache.d.ts +5 -0
- package/esm/domain/action/interactionSelectorCache.js +18 -0
- package/esm/domain/action/interactionSelectorCache.js.map +1 -0
- package/esm/domain/action/listenActionEvents.d.ts +19 -0
- package/esm/domain/action/listenActionEvents.js +58 -0
- package/esm/domain/action/listenActionEvents.js.map +1 -0
- package/esm/domain/action/trackClickActions.d.ts +81 -0
- package/esm/domain/action/trackClickActions.js +232 -0
- package/esm/domain/action/trackClickActions.js.map +1 -0
- package/esm/domain/assembly.d.ts +5 -0
- package/esm/domain/assembly.js +99 -0
- package/esm/domain/assembly.js.map +1 -0
- package/esm/domain/configuration/configuration.d.ts +325 -0
- package/esm/domain/configuration/configuration.js +200 -0
- package/esm/domain/configuration/configuration.js.map +1 -0
- package/esm/domain/configuration/index.d.ts +2 -0
- package/esm/domain/configuration/index.js +3 -0
- package/esm/domain/configuration/index.js.map +1 -0
- package/esm/domain/configuration/jsonPathParser.d.ts +28 -0
- package/esm/domain/configuration/jsonPathParser.js +156 -0
- package/esm/domain/configuration/jsonPathParser.js.map +1 -0
- package/esm/domain/configuration/remoteConfiguration.d.ts +39 -0
- package/esm/domain/configuration/remoteConfiguration.js +236 -0
- package/esm/domain/configuration/remoteConfiguration.js.map +1 -0
- package/esm/domain/configuration/remoteConfiguration.types.d.ts +138 -0
- package/esm/domain/configuration/remoteConfiguration.types.js +6 -0
- package/esm/domain/configuration/remoteConfiguration.types.js.map +1 -0
- package/esm/domain/contexts/ciVisibilityContext.d.ts +12 -0
- package/esm/domain/contexts/ciVisibilityContext.js +30 -0
- package/esm/domain/contexts/ciVisibilityContext.js.map +1 -0
- package/esm/domain/contexts/connectivityContext.d.ts +2 -0
- package/esm/domain/contexts/connectivityContext.js +8 -0
- package/esm/domain/contexts/connectivityContext.js.map +1 -0
- package/esm/domain/contexts/defaultContext.d.ts +4 -0
- package/esm/domain/contexts/defaultContext.js +31 -0
- package/esm/domain/contexts/defaultContext.js.map +1 -0
- package/esm/domain/contexts/displayContext.d.ts +6 -0
- package/esm/domain/contexts/displayContext.js +25 -0
- package/esm/domain/contexts/displayContext.js.map +1 -0
- package/esm/domain/contexts/featureFlagContext.d.ts +19 -0
- package/esm/domain/contexts/featureFlagContext.js +49 -0
- package/esm/domain/contexts/featureFlagContext.js.map +1 -0
- package/esm/domain/contexts/internalContext.d.ts +12 -0
- package/esm/domain/contexts/internalContext.js +23 -0
- package/esm/domain/contexts/internalContext.js.map +1 -0
- package/esm/domain/contexts/pageStateHistory.d.ts +23 -0
- package/esm/domain/contexts/pageStateHistory.js +100 -0
- package/esm/domain/contexts/pageStateHistory.js.map +1 -0
- package/esm/domain/contexts/sessionContext.d.ts +5 -0
- package/esm/domain/contexts/sessionContext.js +44 -0
- package/esm/domain/contexts/sessionContext.js.map +1 -0
- package/esm/domain/contexts/syntheticsContext.d.ts +2 -0
- package/esm/domain/contexts/syntheticsContext.js +22 -0
- package/esm/domain/contexts/syntheticsContext.js.map +1 -0
- package/esm/domain/contexts/trackingConsentContext.d.ts +3 -0
- package/esm/domain/contexts/trackingConsentContext.js +11 -0
- package/esm/domain/contexts/trackingConsentContext.js.map +1 -0
- package/esm/domain/contexts/urlContexts.d.ts +22 -0
- package/esm/domain/contexts/urlContexts.js +60 -0
- package/esm/domain/contexts/urlContexts.js.map +1 -0
- package/esm/domain/contexts/userAgentDataContext.d.ts +2 -0
- package/esm/domain/contexts/userAgentDataContext.js +28 -0
- package/esm/domain/contexts/userAgentDataContext.js.map +1 -0
- package/esm/domain/contexts/viewHistory.d.ts +17 -0
- package/esm/domain/contexts/viewHistory.js +44 -0
- package/esm/domain/contexts/viewHistory.js.map +1 -0
- package/esm/domain/discardNegativeDuration.d.ts +2 -0
- package/esm/domain/discardNegativeDuration.js +5 -0
- package/esm/domain/discardNegativeDuration.js.map +1 -0
- package/esm/domain/error/errorCollection.d.ts +17 -0
- package/esm/domain/error/errorCollection.js +70 -0
- package/esm/domain/error/errorCollection.js.map +1 -0
- package/esm/domain/error/trackConsoleError.d.ts +4 -0
- package/esm/domain/error/trackConsoleError.js +10 -0
- package/esm/domain/error/trackConsoleError.js.map +1 -0
- package/esm/domain/error/trackReportError.d.ts +5 -0
- package/esm/domain/error/trackReportError.js +13 -0
- package/esm/domain/error/trackReportError.js.map +1 -0
- package/esm/domain/event/eventCollection.d.ts +10 -0
- package/esm/domain/event/eventCollection.js +24 -0
- package/esm/domain/event/eventCollection.js.map +1 -0
- package/esm/domain/getSelectorFromElement.d.ts +64 -0
- package/esm/domain/getSelectorFromElement.js +213 -0
- package/esm/domain/getSelectorFromElement.js.map +1 -0
- package/esm/domain/getSessionReplayUrl.d.ts +9 -0
- package/esm/domain/getSessionReplayUrl.js +30 -0
- package/esm/domain/getSessionReplayUrl.js.map +1 -0
- package/esm/domain/hooks.d.ts +23 -0
- package/esm/domain/hooks.js +3 -0
- package/esm/domain/hooks.js.map +1 -0
- package/esm/domain/lifeCycle.d.ts +73 -0
- package/esm/domain/lifeCycle.js +3 -0
- package/esm/domain/lifeCycle.js.map +1 -0
- package/esm/domain/limitModification.d.ts +8 -0
- package/esm/domain/limitModification.js +43 -0
- package/esm/domain/limitModification.js.map +1 -0
- package/esm/domain/longTask/longTaskCollection.d.ts +18 -0
- package/esm/domain/longTask/longTaskCollection.js +87 -0
- package/esm/domain/longTask/longTaskCollection.js.map +1 -0
- package/esm/domain/plugins.d.ts +40 -0
- package/esm/domain/plugins.js +12 -0
- package/esm/domain/plugins.js.map +1 -0
- package/esm/domain/privacy.d.ts +44 -0
- package/esm/domain/privacy.js +302 -0
- package/esm/domain/privacy.js.map +1 -0
- package/esm/domain/privacyConstants.d.ts +23 -0
- package/esm/domain/privacyConstants.js +35 -0
- package/esm/domain/privacyConstants.js.map +1 -0
- package/esm/domain/requestCollection.d.ts +54 -0
- package/esm/domain/requestCollection.js +106 -0
- package/esm/domain/requestCollection.js.map +1 -0
- package/esm/domain/resource/graphql.d.ts +23 -0
- package/esm/domain/resource/graphql.js +91 -0
- package/esm/domain/resource/graphql.js.map +1 -0
- package/esm/domain/resource/matchRequestResourceEntry.d.ts +16 -0
- package/esm/domain/resource/matchRequestResourceEntry.js +46 -0
- package/esm/domain/resource/matchRequestResourceEntry.js.map +1 -0
- package/esm/domain/resource/requestRegistry.d.ts +9 -0
- package/esm/domain/resource/requestRegistry.js +37 -0
- package/esm/domain/resource/requestRegistry.js.map +1 -0
- package/esm/domain/resource/resourceCollection.d.ts +7 -0
- package/esm/domain/resource/resourceCollection.js +187 -0
- package/esm/domain/resource/resourceCollection.js.map +1 -0
- package/esm/domain/resource/resourceUtils.d.ts +55 -0
- package/esm/domain/resource/resourceUtils.js +244 -0
- package/esm/domain/resource/resourceUtils.js.map +1 -0
- package/esm/domain/resource/retrieveInitialDocumentResourceTiming.d.ts +4 -0
- package/esm/domain/resource/retrieveInitialDocumentResourceTiming.js +21 -0
- package/esm/domain/resource/retrieveInitialDocumentResourceTiming.js.map +1 -0
- package/esm/domain/rumSessionManager.d.ts +36 -0
- package/esm/domain/rumSessionManager.js +72 -0
- package/esm/domain/rumSessionManager.js.map +1 -0
- package/esm/domain/sampler/sampler.d.ts +10 -0
- package/esm/domain/sampler/sampler.js +58 -0
- package/esm/domain/sampler/sampler.js.map +1 -0
- package/esm/domain/startCustomerDataTelemetry.d.ts +4 -0
- package/esm/domain/startCustomerDataTelemetry.js +52 -0
- package/esm/domain/startCustomerDataTelemetry.js.map +1 -0
- package/esm/domain/tracing/getDocumentTraceId.d.ts +12 -0
- package/esm/domain/tracing/getDocumentTraceId.js +68 -0
- package/esm/domain/tracing/getDocumentTraceId.js.map +1 -0
- package/esm/domain/tracing/identifier.d.ts +13 -0
- package/esm/domain/tracing/identifier.js +50 -0
- package/esm/domain/tracing/identifier.js.map +1 -0
- package/esm/domain/tracing/sampler.d.ts +10 -0
- package/esm/domain/tracing/sampler.js +64 -0
- package/esm/domain/tracing/sampler.js.map +1 -0
- package/esm/domain/tracing/tracer.d.ts +30 -0
- package/esm/domain/tracing/tracer.js +156 -0
- package/esm/domain/tracing/tracer.js.map +1 -0
- package/esm/domain/tracing/tracer.types.d.ts +12 -0
- package/esm/domain/tracing/tracer.types.js +2 -0
- package/esm/domain/tracing/tracer.types.js.map +1 -0
- package/esm/domain/trackEventCounts.d.ts +17 -0
- package/esm/domain/trackEventCounts.js +47 -0
- package/esm/domain/trackEventCounts.js.map +1 -0
- package/esm/domain/view/bfCacheSupport.d.ts +2 -0
- package/esm/domain/view/bfCacheSupport.js +10 -0
- package/esm/domain/view/bfCacheSupport.js.map +1 -0
- package/esm/domain/view/trackViewEventCounts.d.ts +5 -0
- package/esm/domain/view/trackViewEventCounts.js +13 -0
- package/esm/domain/view/trackViewEventCounts.js.map +1 -0
- package/esm/domain/view/trackViews.d.ts +65 -0
- package/esm/domain/view/trackViews.js +271 -0
- package/esm/domain/view/trackViews.js.map +1 -0
- package/esm/domain/view/viewCollection.d.ts +18 -0
- package/esm/domain/view/viewCollection.js +150 -0
- package/esm/domain/view/viewCollection.js.map +1 -0
- package/esm/domain/view/viewMetrics/getClsAttributionImpactedArea.d.ts +6 -0
- package/esm/domain/view/viewMetrics/getClsAttributionImpactedArea.js +28 -0
- package/esm/domain/view/viewMetrics/getClsAttributionImpactedArea.js.map +1 -0
- package/esm/domain/view/viewMetrics/interactionCountPolyfill.d.ts +18 -0
- package/esm/domain/view/viewMetrics/interactionCountPolyfill.js +39 -0
- package/esm/domain/view/viewMetrics/interactionCountPolyfill.js.map +1 -0
- package/esm/domain/view/viewMetrics/startInitialViewMetricsTelemetry.d.ts +6 -0
- package/esm/domain/view/viewMetrics/startInitialViewMetricsTelemetry.js +41 -0
- package/esm/domain/view/viewMetrics/startInitialViewMetricsTelemetry.js.map +1 -0
- package/esm/domain/view/viewMetrics/trackBfcacheMetrics.d.ts +8 -0
- package/esm/domain/view/viewMetrics/trackBfcacheMetrics.js +14 -0
- package/esm/domain/view/viewMetrics/trackBfcacheMetrics.js.map +1 -0
- package/esm/domain/view/viewMetrics/trackCommonViewMetrics.d.ts +21 -0
- package/esm/domain/view/viewMetrics/trackCommonViewMetrics.js +34 -0
- package/esm/domain/view/viewMetrics/trackCommonViewMetrics.js.map +1 -0
- package/esm/domain/view/viewMetrics/trackCumulativeLayoutShift.d.ts +37 -0
- package/esm/domain/view/viewMetrics/trackCumulativeLayoutShift.js +130 -0
- package/esm/domain/view/viewMetrics/trackCumulativeLayoutShift.js.map +1 -0
- package/esm/domain/view/viewMetrics/trackFirstContentfulPaint.d.ts +13 -0
- package/esm/domain/view/viewMetrics/trackFirstContentfulPaint.js +34 -0
- package/esm/domain/view/viewMetrics/trackFirstContentfulPaint.js.map +1 -0
- package/esm/domain/view/viewMetrics/trackFirstHidden.d.ts +10 -0
- package/esm/domain/view/viewMetrics/trackFirstHidden.js +30 -0
- package/esm/domain/view/viewMetrics/trackFirstHidden.js.map +1 -0
- package/esm/domain/view/viewMetrics/trackFirstInput.d.ts +19 -0
- package/esm/domain/view/viewMetrics/trackFirstInput.js +40 -0
- package/esm/domain/view/viewMetrics/trackFirstInput.js.map +1 -0
- package/esm/domain/view/viewMetrics/trackInitialViewMetrics.d.ts +15 -0
- package/esm/domain/view/viewMetrics/trackInitialViewMetrics.js +38 -0
- package/esm/domain/view/viewMetrics/trackInitialViewMetrics.js.map +1 -0
- package/esm/domain/view/viewMetrics/trackInteractionToNextPaint.d.ts +25 -0
- package/esm/domain/view/viewMetrics/trackInteractionToNextPaint.js +149 -0
- package/esm/domain/view/viewMetrics/trackInteractionToNextPaint.js.map +1 -0
- package/esm/domain/view/viewMetrics/trackLargestContentfulPaint.d.ts +18 -0
- package/esm/domain/view/viewMetrics/trackLargestContentfulPaint.js +57 -0
- package/esm/domain/view/viewMetrics/trackLargestContentfulPaint.js.map +1 -0
- package/esm/domain/view/viewMetrics/trackLoadingTime.d.ts +14 -0
- package/esm/domain/view/viewMetrics/trackLoadingTime.js +47 -0
- package/esm/domain/view/viewMetrics/trackLoadingTime.js.map +1 -0
- package/esm/domain/view/viewMetrics/trackNavigationTimings.d.ts +14 -0
- package/esm/domain/view/viewMetrics/trackNavigationTimings.js +40 -0
- package/esm/domain/view/viewMetrics/trackNavigationTimings.js.map +1 -0
- package/esm/domain/view/viewMetrics/trackScrollMetrics.d.ts +25 -0
- package/esm/domain/view/viewMetrics/trackScrollMetrics.js +72 -0
- package/esm/domain/view/viewMetrics/trackScrollMetrics.js.map +1 -0
- package/esm/domain/vital/vitalCollection.d.ts +55 -0
- package/esm/domain/vital/vitalCollection.js +107 -0
- package/esm/domain/vital/vitalCollection.js.map +1 -0
- package/esm/domain/waitPageActivityEnd.d.ts +54 -0
- package/esm/domain/waitPageActivityEnd.js +123 -0
- package/esm/domain/waitPageActivityEnd.js.map +1 -0
- package/esm/domainContext.types.d.ts +39 -0
- package/esm/domainContext.types.js +5 -0
- package/esm/domainContext.types.js.map +1 -0
- package/esm/index.d.ts +41 -0
- package/esm/index.js +21 -0
- package/esm/index.js.map +1 -0
- package/esm/rawRumEvent.types.d.ts +326 -0
- package/esm/rawRumEvent.types.js +31 -0
- package/esm/rawRumEvent.types.js.map +1 -0
- package/esm/rumEvent.types.d.ts +2026 -0
- package/esm/rumEvent.types.js +6 -0
- package/esm/rumEvent.types.js.map +1 -0
- package/esm/transport/formDataTransport.d.ts +16 -0
- package/esm/transport/formDataTransport.js +43 -0
- package/esm/transport/formDataTransport.js.map +1 -0
- package/esm/transport/startRumBatch.d.ts +5 -0
- package/esm/transport/startRumBatch.js +30 -0
- package/esm/transport/startRumBatch.js.map +1 -0
- package/esm/transport/startRumEventBridge.d.ts +2 -0
- package/esm/transport/startRumEventBridge.js +8 -0
- package/esm/transport/startRumEventBridge.js.map +1 -0
- package/package.json +29 -0
- package/src/boot/preStartRum.ts +298 -0
- package/src/boot/rumPublicApi.ts +830 -0
- package/src/boot/startRum.ts +280 -0
- package/src/browser/cookieObservable.ts +63 -0
- package/src/browser/domMutationObservable.ts +98 -0
- package/src/browser/firstInputPolyfill.ts +87 -0
- package/src/browser/htmlDomUtils.ts +45 -0
- package/src/browser/locationChangeObservable.ts +69 -0
- package/src/browser/performanceObservable.ts +324 -0
- package/src/browser/performanceUtils.ts +50 -0
- package/src/browser/scroll.ts +25 -0
- package/src/browser/viewportObservable.ts +44 -0
- package/src/browser/windowOpenObservable.ts +7 -0
- package/src/domain/action/actionCollection.ts +146 -0
- package/src/domain/action/actionNameConstants.ts +20 -0
- package/src/domain/action/clickChain.ts +83 -0
- package/src/domain/action/computeFrustration.ts +77 -0
- package/src/domain/action/getActionNameFromElement.ts +337 -0
- package/src/domain/action/interactionSelectorCache.ts +21 -0
- package/src/domain/action/listenActionEvents.ts +119 -0
- package/src/domain/action/trackClickActions.ts +388 -0
- package/src/domain/assembly.ts +141 -0
- package/src/domain/configuration/configuration.ts +548 -0
- package/src/domain/configuration/index.ts +2 -0
- package/src/domain/configuration/jsonPathParser.ts +214 -0
- package/src/domain/configuration/remoteConfiguration.ts +304 -0
- package/src/domain/configuration/remoteConfiguration.types.ts +147 -0
- package/src/domain/contexts/ciVisibilityContext.ts +50 -0
- package/src/domain/contexts/connectivityContext.ts +12 -0
- package/src/domain/contexts/defaultContext.ts +43 -0
- package/src/domain/contexts/displayContext.ts +38 -0
- package/src/domain/contexts/featureFlagContext.ts +71 -0
- package/src/domain/contexts/internalContext.ts +34 -0
- package/src/domain/contexts/pageStateHistory.ts +171 -0
- package/src/domain/contexts/sessionContext.ts +59 -0
- package/src/domain/contexts/syntheticsContext.ts +33 -0
- package/src/domain/contexts/trackingConsentContext.ts +15 -0
- package/src/domain/contexts/urlContexts.ts +97 -0
- package/src/domain/contexts/userAgentDataContext.ts +36 -0
- package/src/domain/contexts/viewHistory.ts +70 -0
- package/src/domain/discardNegativeDuration.ts +6 -0
- package/src/domain/error/errorCollection.ts +107 -0
- package/src/domain/error/trackConsoleError.ts +14 -0
- package/src/domain/error/trackReportError.ts +16 -0
- package/src/domain/event/eventCollection.ts +53 -0
- package/src/domain/getSelectorFromElement.ts +268 -0
- package/src/domain/getSessionReplayUrl.ts +47 -0
- package/src/domain/hooks.ts +31 -0
- package/src/domain/lifeCycle.ts +103 -0
- package/src/domain/limitModification.ts +66 -0
- package/src/domain/longTask/longTaskCollection.ts +133 -0
- package/src/domain/plugins.ts +59 -0
- package/src/domain/privacy.ts +355 -0
- package/src/domain/privacyConstants.ts +43 -0
- package/src/domain/requestCollection.ts +179 -0
- package/src/domain/resource/graphql.ts +135 -0
- package/src/domain/resource/matchRequestResourceEntry.ts +68 -0
- package/src/domain/resource/requestRegistry.ts +52 -0
- package/src/domain/resource/resourceCollection.ts +273 -0
- package/src/domain/resource/resourceUtils.ts +355 -0
- package/src/domain/resource/retrieveInitialDocumentResourceTiming.ts +27 -0
- package/src/domain/rumSessionManager.ts +134 -0
- package/src/domain/sampler/sampler.ts +63 -0
- package/src/domain/startCustomerDataTelemetry.ts +83 -0
- package/src/domain/tracing/getDocumentTraceId.ts +90 -0
- package/src/domain/tracing/identifier.ts +69 -0
- package/src/domain/tracing/sampler.ts +69 -0
- package/src/domain/tracing/tracer.ts +248 -0
- package/src/domain/tracing/tracer.types.ts +13 -0
- package/src/domain/trackEventCounts.ts +67 -0
- package/src/domain/view/bfCacheSupport.ts +20 -0
- package/src/domain/view/trackViewEventCounts.ts +15 -0
- package/src/domain/view/trackViews.ts +431 -0
- package/src/domain/view/viewCollection.ts +203 -0
- package/src/domain/view/viewMetrics/getClsAttributionImpactedArea.ts +34 -0
- package/src/domain/view/viewMetrics/interactionCountPolyfill.ts +55 -0
- package/src/domain/view/viewMetrics/startInitialViewMetricsTelemetry.ts +70 -0
- package/src/domain/view/viewMetrics/trackBfcacheMetrics.ts +20 -0
- package/src/domain/view/viewMetrics/trackCommonViewMetrics.ts +78 -0
- package/src/domain/view/viewMetrics/trackCumulativeLayoutShift.ts +180 -0
- package/src/domain/view/viewMetrics/trackFirstContentfulPaint.ts +47 -0
- package/src/domain/view/viewMetrics/trackFirstHidden.ts +53 -0
- package/src/domain/view/viewMetrics/trackFirstInput.ts +59 -0
- package/src/domain/view/viewMetrics/trackInitialViewMetrics.ts +66 -0
- package/src/domain/view/viewMetrics/trackInteractionToNextPaint.ts +193 -0
- package/src/domain/view/viewMetrics/trackLargestContentfulPaint.ts +87 -0
- package/src/domain/view/viewMetrics/trackLoadingTime.ts +69 -0
- package/src/domain/view/viewMetrics/trackNavigationTimings.ts +66 -0
- package/src/domain/view/viewMetrics/trackScrollMetrics.ts +119 -0
- package/src/domain/vital/vitalCollection.ts +207 -0
- package/src/domain/waitPageActivityEnd.ts +189 -0
- package/src/domainContext.types.ts +61 -0
- package/src/index.ts +76 -0
- package/src/rawRumEvent.types.ts +409 -0
- package/src/rumEvent.types.ts +2151 -0
- package/src/transport/formDataTransport.ts +85 -0
- package/src/transport/startRumBatch.ts +46 -0
- package/src/transport/startRumEventBridge.ts +12 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { RelativeTime, ClocksState, Context } from '@kubesense/kubesense-browser-core';
|
|
2
|
+
import type { LifeCycle } from '../lifeCycle';
|
|
3
|
+
export declare const VIEW_CONTEXT_TIME_OUT_DELAY: number;
|
|
4
|
+
export interface ViewHistoryEntry {
|
|
5
|
+
service?: string;
|
|
6
|
+
version?: string;
|
|
7
|
+
context?: Context | undefined;
|
|
8
|
+
id: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
startClocks: ClocksState;
|
|
11
|
+
sessionIsActive?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface ViewHistory {
|
|
14
|
+
findView: (startTime?: RelativeTime) => ViewHistoryEntry | undefined;
|
|
15
|
+
stop: () => void;
|
|
16
|
+
}
|
|
17
|
+
export declare function startViewHistory(lifeCycle: LifeCycle): ViewHistory;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VIEW_CONTEXT_TIME_OUT_DELAY = void 0;
|
|
4
|
+
exports.startViewHistory = startViewHistory;
|
|
5
|
+
const kubesense_browser_core_1 = require("@kubesense/kubesense-browser-core");
|
|
6
|
+
exports.VIEW_CONTEXT_TIME_OUT_DELAY = kubesense_browser_core_1.SESSION_TIME_OUT_DELAY;
|
|
7
|
+
function startViewHistory(lifeCycle) {
|
|
8
|
+
const viewValueHistory = (0, kubesense_browser_core_1.createValueHistory)({ expireDelay: exports.VIEW_CONTEXT_TIME_OUT_DELAY });
|
|
9
|
+
lifeCycle.subscribe(1 /* LifeCycleEventType.BEFORE_VIEW_CREATED */, (view) => {
|
|
10
|
+
viewValueHistory.add(buildViewHistoryEntry(view), view.startClocks.relative);
|
|
11
|
+
});
|
|
12
|
+
lifeCycle.subscribe(6 /* LifeCycleEventType.AFTER_VIEW_ENDED */, ({ endClocks }) => {
|
|
13
|
+
viewValueHistory.closeActive(endClocks.relative);
|
|
14
|
+
});
|
|
15
|
+
lifeCycle.subscribe(3 /* LifeCycleEventType.BEFORE_VIEW_UPDATED */, (viewUpdate) => {
|
|
16
|
+
const currentView = viewValueHistory.find(viewUpdate.startClocks.relative);
|
|
17
|
+
if (!currentView) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
if (viewUpdate.name) {
|
|
21
|
+
currentView.name = viewUpdate.name;
|
|
22
|
+
}
|
|
23
|
+
if (viewUpdate.context) {
|
|
24
|
+
currentView.context = viewUpdate.context;
|
|
25
|
+
}
|
|
26
|
+
currentView.sessionIsActive = viewUpdate.sessionIsActive;
|
|
27
|
+
});
|
|
28
|
+
lifeCycle.subscribe(10 /* LifeCycleEventType.SESSION_RENEWED */, () => {
|
|
29
|
+
viewValueHistory.reset();
|
|
30
|
+
});
|
|
31
|
+
function buildViewHistoryEntry(view) {
|
|
32
|
+
return {
|
|
33
|
+
service: view.service,
|
|
34
|
+
version: view.version,
|
|
35
|
+
context: view.context,
|
|
36
|
+
id: view.id,
|
|
37
|
+
name: view.name,
|
|
38
|
+
startClocks: view.startClocks,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
findView: (startTime) => viewValueHistory.find(startTime),
|
|
43
|
+
stop: () => {
|
|
44
|
+
viewValueHistory.stop();
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=viewHistory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewHistory.js","sourceRoot":"","sources":["../../../src/domain/contexts/viewHistory.ts"],"names":[],"mappings":";;;AAuBA,4CA8CC;AApED,8EAA8F;AAKjF,QAAA,2BAA2B,GAAG,+CAAsB,CAAA;AAiBjE,SAAgB,gBAAgB,CAAC,SAAoB;IACnD,MAAM,gBAAgB,GAAG,IAAA,2CAAkB,EAAmB,EAAE,WAAW,EAAE,mCAA2B,EAAE,CAAC,CAAA;IAE3G,SAAS,CAAC,SAAS,iDAAyC,CAAC,IAAI,EAAE,EAAE;QACnE,gBAAgB,CAAC,GAAG,CAAC,qBAAqB,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAA;IAC9E,CAAC,CAAC,CAAA;IAEF,SAAS,CAAC,SAAS,8CAAsC,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE;QACzE,gBAAgB,CAAC,WAAW,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAA;IAClD,CAAC,CAAC,CAAA;IAEF,SAAS,CAAC,SAAS,iDAAyC,CAAC,UAAiC,EAAE,EAAE;QAChG,MAAM,WAAW,GAAG,gBAAgB,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAA;QAC1E,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,OAAM;QACR,CAAC;QACD,IAAI,UAAU,CAAC,IAAI,EAAE,CAAC;YACpB,WAAW,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,CAAA;QACpC,CAAC;QACD,IAAI,UAAU,CAAC,OAAO,EAAE,CAAC;YACvB,WAAW,CAAC,OAAO,GAAG,UAAU,CAAC,OAAO,CAAA;QAC1C,CAAC;QACD,WAAW,CAAC,eAAe,GAAG,UAAU,CAAC,eAAe,CAAA;IAC1D,CAAC,CAAC,CAAA;IAEF,SAAS,CAAC,SAAS,8CAAqC,GAAG,EAAE;QAC3D,gBAAgB,CAAC,KAAK,EAAE,CAAA;IAC1B,CAAC,CAAC,CAAA;IAEF,SAAS,qBAAqB,CAAC,IAAsB;QACnD,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,WAAW,EAAE,IAAI,CAAC,WAAW;SAC9B,CAAA;IACH,CAAC;IAED,OAAO;QACL,QAAQ,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC;QACzD,IAAI,EAAE,GAAG,EAAE;YACT,gBAAgB,CAAC,IAAI,EAAE,CAAA;QACzB,CAAC;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.discardNegativeDuration = discardNegativeDuration;
|
|
4
|
+
const kubesense_browser_core_1 = require("@kubesense/kubesense-browser-core");
|
|
5
|
+
function discardNegativeDuration(duration) {
|
|
6
|
+
return (0, kubesense_browser_core_1.isNumber)(duration) && duration < 0 ? undefined : duration;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=discardNegativeDuration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discardNegativeDuration.js","sourceRoot":"","sources":["../../src/domain/discardNegativeDuration.ts"],"names":[],"mappings":";;AAGA,0DAEC;AAJD,8EAA4D;AAE5D,SAAgB,uBAAuB,CAAC,QAAoC;IAC1E,OAAO,IAAA,iCAAQ,EAAC,QAAQ,CAAC,IAAI,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAA;AAClE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Context, ClocksState, BufferedData } from '@kubesense/kubesense-browser-core';
|
|
2
|
+
import { Observable } from '@kubesense/kubesense-browser-core';
|
|
3
|
+
import type { RumConfiguration } from '../configuration';
|
|
4
|
+
import type { LifeCycle } from '../lifeCycle';
|
|
5
|
+
export interface ProvidedError {
|
|
6
|
+
startClocks: ClocksState;
|
|
7
|
+
error: unknown;
|
|
8
|
+
context?: Context;
|
|
9
|
+
handlingStack: string;
|
|
10
|
+
componentStack?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function startErrorCollection(lifeCycle: LifeCycle, configuration: RumConfiguration, bufferedDataObservable: Observable<BufferedData>): {
|
|
13
|
+
addError: ({ error, handlingStack, componentStack, startClocks, context }: ProvidedError) => void;
|
|
14
|
+
};
|
|
15
|
+
export declare function doStartErrorCollection(lifeCycle: LifeCycle): {
|
|
16
|
+
addError: ({ error, handlingStack, componentStack, startClocks, context }: ProvidedError) => void;
|
|
17
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.startErrorCollection = startErrorCollection;
|
|
4
|
+
exports.doStartErrorCollection = doStartErrorCollection;
|
|
5
|
+
const kubesense_browser_core_1 = require("@kubesense/kubesense-browser-core");
|
|
6
|
+
const rawRumEvent_types_1 = require("../../rawRumEvent.types");
|
|
7
|
+
const trackConsoleError_1 = require("./trackConsoleError");
|
|
8
|
+
const trackReportError_1 = require("./trackReportError");
|
|
9
|
+
function startErrorCollection(lifeCycle, configuration, bufferedDataObservable) {
|
|
10
|
+
const errorObservable = new kubesense_browser_core_1.Observable();
|
|
11
|
+
bufferedDataObservable.subscribe((bufferedData) => {
|
|
12
|
+
if (bufferedData.type === 0 /* BufferedDataType.RUNTIME_ERROR */) {
|
|
13
|
+
errorObservable.notify(bufferedData.error);
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
(0, trackConsoleError_1.trackConsoleError)(errorObservable);
|
|
17
|
+
(0, trackReportError_1.trackReportError)(configuration, errorObservable);
|
|
18
|
+
errorObservable.subscribe((error) => lifeCycle.notify(14 /* LifeCycleEventType.RAW_ERROR_COLLECTED */, { error }));
|
|
19
|
+
return doStartErrorCollection(lifeCycle);
|
|
20
|
+
}
|
|
21
|
+
function doStartErrorCollection(lifeCycle) {
|
|
22
|
+
lifeCycle.subscribe(14 /* LifeCycleEventType.RAW_ERROR_COLLECTED */, ({ error }) => {
|
|
23
|
+
lifeCycle.notify(12 /* LifeCycleEventType.RAW_RUM_EVENT_COLLECTED */, processError(error));
|
|
24
|
+
});
|
|
25
|
+
return {
|
|
26
|
+
addError: ({ error, handlingStack, componentStack, startClocks, context }) => {
|
|
27
|
+
const rawError = (0, kubesense_browser_core_1.computeRawError)({
|
|
28
|
+
originalError: error,
|
|
29
|
+
handlingStack,
|
|
30
|
+
componentStack,
|
|
31
|
+
startClocks,
|
|
32
|
+
nonErrorPrefix: "Provided" /* NonErrorPrefix.PROVIDED */,
|
|
33
|
+
source: kubesense_browser_core_1.ErrorSource.CUSTOM,
|
|
34
|
+
handling: "handled" /* ErrorHandling.HANDLED */,
|
|
35
|
+
});
|
|
36
|
+
rawError.context = (0, kubesense_browser_core_1.combine)(rawError.context, context);
|
|
37
|
+
lifeCycle.notify(14 /* LifeCycleEventType.RAW_ERROR_COLLECTED */, { error: rawError });
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
function processError(error) {
|
|
42
|
+
const rawRumEvent = {
|
|
43
|
+
date: error.startClocks.timeStamp,
|
|
44
|
+
error: {
|
|
45
|
+
id: (0, kubesense_browser_core_1.generateUUID)(),
|
|
46
|
+
message: error.message,
|
|
47
|
+
source: error.source,
|
|
48
|
+
stack: error.stack,
|
|
49
|
+
handling_stack: error.handlingStack,
|
|
50
|
+
component_stack: error.componentStack,
|
|
51
|
+
type: error.type,
|
|
52
|
+
handling: error.handling,
|
|
53
|
+
causes: error.causes,
|
|
54
|
+
source_type: 'browser',
|
|
55
|
+
fingerprint: error.fingerprint,
|
|
56
|
+
csp: error.csp,
|
|
57
|
+
},
|
|
58
|
+
_kubesense: {
|
|
59
|
+
discarded: false,
|
|
60
|
+
},
|
|
61
|
+
type: rawRumEvent_types_1.RumEventType.ERROR,
|
|
62
|
+
context: error.context,
|
|
63
|
+
};
|
|
64
|
+
const domainContext = {
|
|
65
|
+
error: error.originalError,
|
|
66
|
+
handlingStack: error.handlingStack,
|
|
67
|
+
};
|
|
68
|
+
return {
|
|
69
|
+
rawRumEvent,
|
|
70
|
+
startTime: error.startClocks.relative,
|
|
71
|
+
domainContext,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=errorCollection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errorCollection.js","sourceRoot":"","sources":["../../../src/domain/error/errorCollection.ts"],"names":[],"mappings":";;AA4BA,oDAmBC;AAED,wDAqBC;AArED,8EAS0C;AAG1C,+DAAsD;AAItD,2DAAuD;AACvD,yDAAqD;AAUrD,SAAgB,oBAAoB,CAClC,SAAoB,EACpB,aAA+B,EAC/B,sBAAgD;IAEhD,MAAM,eAAe,GAAG,IAAI,mCAAU,EAAY,CAAA;IAElD,sBAAsB,CAAC,SAAS,CAAC,CAAC,YAAY,EAAE,EAAE;QAChD,IAAI,YAAY,CAAC,IAAI,2CAAmC,EAAE,CAAC;YACzD,eAAe,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CAAA;QAC5C,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,IAAA,qCAAiB,EAAC,eAAe,CAAC,CAAA;IAClC,IAAA,mCAAgB,EAAC,aAAa,EAAE,eAAe,CAAC,CAAA;IAEhD,eAAe,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,kDAAyC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAA;IAEzG,OAA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EAAE,SAAS;YACtB,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,GAAG,EAAE,KAAK,CAAC,GAAG;SACf;QACD,UAAU,EAAE;YACV,SAAS,EAAE,KAAK;SACjB;QACD,IAAI,EAAE,gCAAY,CAAC,KAAK;QACxB,OAAO,EAAE,KAAK,CAAC,OAAO;KACvB,CAAA;IAED,MAAM,aAAa,GAA+B;QAChD,KAAK,EAAE,KAAK,CAAC,aAAa;QAC1B,aAAa,EAAE,KAAK,CAAC,aAAa;KACnC,CAAA;IAED,OAAO;QACL,WAAW;QACX,SAAS,EAAE,KAAK,CAAC,WAAW,CAAC,QAAQ;QACrC,aAAa;KACd,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.trackConsoleError = trackConsoleError;
|
|
4
|
+
const kubesense_browser_core_1 = require("@kubesense/kubesense-browser-core");
|
|
5
|
+
function trackConsoleError(errorObservable) {
|
|
6
|
+
const subscription = (0, kubesense_browser_core_1.initConsoleObservable)([kubesense_browser_core_1.ConsoleApiName.error]).subscribe((consoleLog) => errorObservable.notify(consoleLog.error));
|
|
7
|
+
return {
|
|
8
|
+
stop: () => {
|
|
9
|
+
subscription.unsubscribe();
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=trackConsoleError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trackConsoleError.js","sourceRoot":"","sources":["../../../src/domain/error/trackConsoleError.ts"],"names":[],"mappings":";;AAGA,8CAUC;AAZD,8EAAyF;AAEzF,SAAgB,iBAAiB,CAAC,eAAqC;IACrE,MAAM,YAAY,GAAG,IAAA,8CAAqB,EAAC,CAAC,uCAAc,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,EAAE,CAC1F,eAAe,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CACzC,CAAA;IAED,OAAO;QACL,IAAI,EAAE,GAAG,EAAE;YACT,YAAY,CAAC,WAAW,EAAE,CAAA;QAC5B,CAAC;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Observable, RawError } from '@kubesense/kubesense-browser-core';
|
|
2
|
+
import type { RumConfiguration } from '../configuration';
|
|
3
|
+
export declare function trackReportError(configuration: RumConfiguration, errorObservable: Observable<RawError>): {
|
|
4
|
+
stop: () => void;
|
|
5
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.trackReportError = trackReportError;
|
|
4
|
+
const kubesense_browser_core_1 = require("@kubesense/kubesense-browser-core");
|
|
5
|
+
function trackReportError(configuration, errorObservable) {
|
|
6
|
+
const subscription = (0, kubesense_browser_core_1.initReportObservable)(configuration, [
|
|
7
|
+
kubesense_browser_core_1.RawReportType.cspViolation,
|
|
8
|
+
kubesense_browser_core_1.RawReportType.intervention,
|
|
9
|
+
]).subscribe((rawError) => errorObservable.notify(rawError));
|
|
10
|
+
return {
|
|
11
|
+
stop: () => {
|
|
12
|
+
subscription.unsubscribe();
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=trackReportError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trackReportError.js","sourceRoot":"","sources":["../../../src/domain/error/trackReportError.ts"],"names":[],"mappings":";;AAIA,4CAWC;AAdD,8EAAuF;AAGvF,SAAgB,gBAAgB,CAAC,aAA+B,EAAE,eAAqC;IACrG,MAAM,YAAY,GAAG,IAAA,6CAAoB,EAAC,aAAa,EAAE;QACvD,sCAAa,CAAC,YAAY;QAC1B,sCAAa,CAAC,YAAY;KAC3B,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAA;IAE5D,OAAO;QACL,IAAI,EAAE,GAAG,EAAE;YACT,YAAY,CAAC,WAAW,EAAE,CAAA;QAC5B,CAAC;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Context, Duration, RelativeTime } from '@kubesense/kubesense-browser-core';
|
|
2
|
+
import type { RumEventDomainContext } from '../../domainContext.types';
|
|
3
|
+
import type { LifeCycle } from '../lifeCycle';
|
|
4
|
+
import type { RawRumActionEvent, RawRumErrorEvent, RawRumLongAnimationFrameEvent, RawRumLongTaskEvent, RawRumResourceEvent, RawRumVitalEvent } from '../../rawRumEvent.types';
|
|
5
|
+
export type AllowedRawRumEvent = (RawRumErrorEvent | RawRumResourceEvent | RawRumLongTaskEvent | RawRumLongAnimationFrameEvent | RawRumActionEvent | RawRumVitalEvent) & {
|
|
6
|
+
context?: Context;
|
|
7
|
+
};
|
|
8
|
+
export declare function startEventCollection(lifeCycle: LifeCycle): {
|
|
9
|
+
addEvent: (startTime: RelativeTime, event: AllowedRawRumEvent, domainContext: RumEventDomainContext, duration?: Duration) => void;
|
|
10
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.startEventCollection = startEventCollection;
|
|
4
|
+
const rawRumEvent_types_1 = require("../../rawRumEvent.types");
|
|
5
|
+
const allowedEventTypes = [
|
|
6
|
+
rawRumEvent_types_1.RumEventType.ACTION,
|
|
7
|
+
rawRumEvent_types_1.RumEventType.ERROR,
|
|
8
|
+
rawRumEvent_types_1.RumEventType.LONG_TASK,
|
|
9
|
+
rawRumEvent_types_1.RumEventType.RESOURCE,
|
|
10
|
+
rawRumEvent_types_1.RumEventType.VITAL,
|
|
11
|
+
];
|
|
12
|
+
function startEventCollection(lifeCycle) {
|
|
13
|
+
return {
|
|
14
|
+
addEvent: (startTime, event, domainContext, duration) => {
|
|
15
|
+
if (!allowedEventTypes.includes(event.type)) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
lifeCycle.notify(12 /* LifeCycleEventType.RAW_RUM_EVENT_COLLECTED */, {
|
|
19
|
+
startTime,
|
|
20
|
+
rawRumEvent: event,
|
|
21
|
+
domainContext,
|
|
22
|
+
duration,
|
|
23
|
+
});
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=eventCollection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eventCollection.js","sourceRoot":"","sources":["../../../src/domain/event/eventCollection.ts"],"names":[],"mappings":";;AAgCA,oDAoBC;AAvCD,+DAAsD;AAEtD,MAAM,iBAAiB,GAAG;IACxB,gCAAY,CAAC,MAAM;IACnB,gCAAY,CAAC,KAAK;IAClB,gCAAY,CAAC,SAAS;IACtB,gCAAY,CAAC,QAAQ;IACrB,gCAAY,CAAC,KAAK;CACV,CAAA;AAWV,SAAgB,oBAAoB,CAAC,SAAoB;IACvD,OAAO;QACL,QAAQ,EAAE,CACR,SAAuB,EACvB,KAAyB,EACzB,aAAoC,EACpC,QAAmB,EACnB,EAAE;YACF,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC5C,OAAM;YACR,CAAC;YAED,SAAS,CAAC,MAAM,sDAA6C;gBAC3D,SAAS;gBACT,WAAW,EAAE,KAAK;gBAClB,aAAa;gBACb,QAAQ;aACT,CAAC,CAAA;QACJ,CAAC;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stable attributes are attributes that are commonly used to identify parts of a UI (ex:
|
|
3
|
+
* component). Those attribute values should not be generated randomly (hardcoded most of the time)
|
|
4
|
+
* and stay the same across deploys. They are not necessarily unique across the document.
|
|
5
|
+
*/
|
|
6
|
+
export declare const STABLE_ATTRIBUTES: string[];
|
|
7
|
+
export declare function getSelectorFromElement(targetElement: Element, actionNameAttribute: string | undefined): string | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* Check whether the selector is unique among the element siblings. In other words, it returns true
|
|
10
|
+
* if "ELEMENT_PARENT > CHILD_SELECTOR" returns a single element.
|
|
11
|
+
*
|
|
12
|
+
* @param {Element} currentElement - the element being considered while iterating over the target
|
|
13
|
+
* element ancestors.
|
|
14
|
+
*
|
|
15
|
+
* @param {string} currentElementSelector - a selector that matches the current element. That
|
|
16
|
+
* selector is not a composed selector (i.e. it might be a single tag name, class name...).
|
|
17
|
+
*
|
|
18
|
+
* @param {string|undefined} childSelector - child selector is a selector that targets a descendant
|
|
19
|
+
* of the current element. When undefined, the current element is the target element.
|
|
20
|
+
*
|
|
21
|
+
* # Scope selector usage
|
|
22
|
+
*
|
|
23
|
+
* When composed together, the final selector will be joined with `>` operators to make sure we
|
|
24
|
+
* target direct descendants at each level. In this function, we'll use `querySelector` to check if
|
|
25
|
+
* a selector matches descendants of the current element. But by default, the query selector match
|
|
26
|
+
* elements at any level. Example:
|
|
27
|
+
*
|
|
28
|
+
* ```html
|
|
29
|
+
* <main>
|
|
30
|
+
* <div>
|
|
31
|
+
* <span></span>
|
|
32
|
+
* </div>
|
|
33
|
+
* <marquee>
|
|
34
|
+
* <div>
|
|
35
|
+
* <span></span>
|
|
36
|
+
* </div>
|
|
37
|
+
* </marquee>
|
|
38
|
+
* </main>
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* `sibling.querySelector('DIV > SPAN')` will match both span elements, so we would consider the
|
|
42
|
+
* selector to be not unique, even if it is unique when we'll compose it with the parent with a `>`
|
|
43
|
+
* operator (`MAIN > DIV > SPAN`).
|
|
44
|
+
*
|
|
45
|
+
* To avoid this, we can use the `:scope` selector to make sure the selector starts from the current
|
|
46
|
+
* sibling (i.e. `sibling.querySelector('DIV:scope > SPAN')` will only match the first span).
|
|
47
|
+
*
|
|
48
|
+
* [1]: https://developer.mozilla.org/fr/docs/Web/CSS/:scope
|
|
49
|
+
*
|
|
50
|
+
* # Performance considerations
|
|
51
|
+
*
|
|
52
|
+
* We compute selectors in performance-critical operations (ex: during a click), so we need to make
|
|
53
|
+
* sure the function is as fast as possible. We observed that naively using `querySelectorAll` to
|
|
54
|
+
* check if the selector matches more than 1 element is quite expensive, so we want to avoid it.
|
|
55
|
+
*
|
|
56
|
+
* Because we are iterating the DOM upward and we use that function at every level, we know the
|
|
57
|
+
* child selector is already unique among the current element children, so we don't need to check
|
|
58
|
+
* for the current element subtree.
|
|
59
|
+
*
|
|
60
|
+
* Instead, we can focus on the current element siblings. If we find a single element matching the
|
|
61
|
+
* selector within a sibling, we know that it's not unique. This allows us to use `querySelector`
|
|
62
|
+
* (or `matches`, when the current element is the target element) instead of `querySelectorAll`.
|
|
63
|
+
*/
|
|
64
|
+
export declare function isSelectorUniqueAmongSiblings(currentElement: Element, currentElementSelector: string, childSelector: string | undefined): boolean;
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.STABLE_ATTRIBUTES = void 0;
|
|
4
|
+
exports.getSelectorFromElement = getSelectorFromElement;
|
|
5
|
+
exports.isSelectorUniqueAmongSiblings = isSelectorUniqueAmongSiblings;
|
|
6
|
+
const actionNameConstants_1 = require("./action/actionNameConstants");
|
|
7
|
+
/**
|
|
8
|
+
* Stable attributes are attributes that are commonly used to identify parts of a UI (ex:
|
|
9
|
+
* component). Those attribute values should not be generated randomly (hardcoded most of the time)
|
|
10
|
+
* and stay the same across deploys. They are not necessarily unique across the document.
|
|
11
|
+
*/
|
|
12
|
+
exports.STABLE_ATTRIBUTES = [
|
|
13
|
+
actionNameConstants_1.DEFAULT_PROGRAMMATIC_ACTION_NAME_ATTRIBUTE,
|
|
14
|
+
// Common test attributes (list provided by google recorder)
|
|
15
|
+
'data-testid',
|
|
16
|
+
'data-test',
|
|
17
|
+
'data-qa',
|
|
18
|
+
'data-cy',
|
|
19
|
+
'data-test-id',
|
|
20
|
+
'data-qa-id',
|
|
21
|
+
'data-testing',
|
|
22
|
+
// FullStory decorator attributes:
|
|
23
|
+
'data-component',
|
|
24
|
+
'data-element',
|
|
25
|
+
'data-source-file',
|
|
26
|
+
];
|
|
27
|
+
// Selectors to use if they target a single element on the whole document. Those selectors are
|
|
28
|
+
// considered as "stable" and uniquely identify an element regardless of the page state. If we find
|
|
29
|
+
// one, we should consider the selector "complete" and stop iterating over ancestors.
|
|
30
|
+
const GLOBALLY_UNIQUE_SELECTOR_GETTERS = [getStableAttributeSelector, getIDSelector];
|
|
31
|
+
// Selectors to use if they target a single element among an element descendants. Those selectors
|
|
32
|
+
// are more brittle than "globally unique" selectors and should be combined with ancestor selectors
|
|
33
|
+
// to improve specificity.
|
|
34
|
+
const UNIQUE_AMONG_CHILDREN_SELECTOR_GETTERS = [
|
|
35
|
+
getStableAttributeSelector,
|
|
36
|
+
getClassSelector,
|
|
37
|
+
getTagNameSelector,
|
|
38
|
+
];
|
|
39
|
+
function getSelectorFromElement(targetElement, actionNameAttribute) {
|
|
40
|
+
if (!targetElement.isConnected) {
|
|
41
|
+
// We cannot compute a selector for a detached element, as we don't have access to all of its
|
|
42
|
+
// parents, and we cannot determine if it's unique in the document.
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
let targetElementSelector;
|
|
46
|
+
let currentElement = targetElement;
|
|
47
|
+
while (currentElement && currentElement.nodeName !== 'HTML') {
|
|
48
|
+
const globallyUniqueSelector = findSelector(currentElement, GLOBALLY_UNIQUE_SELECTOR_GETTERS, isSelectorUniqueGlobally, actionNameAttribute, targetElementSelector);
|
|
49
|
+
if (globallyUniqueSelector) {
|
|
50
|
+
return globallyUniqueSelector;
|
|
51
|
+
}
|
|
52
|
+
const uniqueSelectorAmongChildren = findSelector(currentElement, UNIQUE_AMONG_CHILDREN_SELECTOR_GETTERS, isSelectorUniqueAmongSiblings, actionNameAttribute, targetElementSelector);
|
|
53
|
+
targetElementSelector =
|
|
54
|
+
uniqueSelectorAmongChildren || combineSelector(getPositionSelector(currentElement), targetElementSelector);
|
|
55
|
+
currentElement = currentElement.parentElement;
|
|
56
|
+
}
|
|
57
|
+
return targetElementSelector;
|
|
58
|
+
}
|
|
59
|
+
function isGeneratedValue(value) {
|
|
60
|
+
// To compute the "URL path group", the backend replaces every URL path parts as a question mark
|
|
61
|
+
// if it thinks the part is an identifier. The condition it uses is to checks whether a digit is
|
|
62
|
+
// present.
|
|
63
|
+
//
|
|
64
|
+
// Here, we use the same strategy: if the value contains a digit, we consider it generated. This
|
|
65
|
+
// strategy might be a bit naive and fail in some cases, but there are many fallbacks to generate
|
|
66
|
+
// CSS selectors so it should be fine most of the time.
|
|
67
|
+
return /[0-9]/.test(value);
|
|
68
|
+
}
|
|
69
|
+
function getIDSelector(element) {
|
|
70
|
+
if (element.id && !isGeneratedValue(element.id)) {
|
|
71
|
+
return `#${CSS.escape(element.id)}`;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
function getClassSelector(element) {
|
|
75
|
+
if (element.tagName === 'BODY') {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const classList = element.classList;
|
|
79
|
+
for (let i = 0; i < classList.length; i += 1) {
|
|
80
|
+
const className = classList[i];
|
|
81
|
+
if (isGeneratedValue(className)) {
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
return `${CSS.escape(element.tagName)}.${CSS.escape(className)}`;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
function getTagNameSelector(element) {
|
|
88
|
+
return CSS.escape(element.tagName);
|
|
89
|
+
}
|
|
90
|
+
function getStableAttributeSelector(element, actionNameAttribute) {
|
|
91
|
+
if (actionNameAttribute) {
|
|
92
|
+
const selector = getAttributeSelector(actionNameAttribute);
|
|
93
|
+
if (selector) {
|
|
94
|
+
return selector;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
for (const attributeName of exports.STABLE_ATTRIBUTES) {
|
|
98
|
+
const selector = getAttributeSelector(attributeName);
|
|
99
|
+
if (selector) {
|
|
100
|
+
return selector;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
function getAttributeSelector(attributeName) {
|
|
104
|
+
if (element.hasAttribute(attributeName)) {
|
|
105
|
+
return `${CSS.escape(element.tagName)}[${attributeName}="${CSS.escape(element.getAttribute(attributeName))}"]`;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
function getPositionSelector(element) {
|
|
110
|
+
let sibling = element.parentElement.firstElementChild;
|
|
111
|
+
let elementIndex = 1;
|
|
112
|
+
while (sibling && sibling !== element) {
|
|
113
|
+
if (sibling.tagName === element.tagName) {
|
|
114
|
+
elementIndex += 1;
|
|
115
|
+
}
|
|
116
|
+
sibling = sibling.nextElementSibling;
|
|
117
|
+
}
|
|
118
|
+
return `${CSS.escape(element.tagName)}:nth-of-type(${elementIndex})`;
|
|
119
|
+
}
|
|
120
|
+
function findSelector(element, selectorGetters, predicate, actionNameAttribute, childSelector) {
|
|
121
|
+
for (const selectorGetter of selectorGetters) {
|
|
122
|
+
const elementSelector = selectorGetter(element, actionNameAttribute);
|
|
123
|
+
if (!elementSelector) {
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
if (predicate(element, elementSelector, childSelector)) {
|
|
127
|
+
return combineSelector(elementSelector, childSelector);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Check whether the selector is unique among the whole document.
|
|
133
|
+
*/
|
|
134
|
+
function isSelectorUniqueGlobally(element, elementSelector, childSelector) {
|
|
135
|
+
return element.ownerDocument.querySelectorAll(combineSelector(elementSelector, childSelector)).length === 1;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Check whether the selector is unique among the element siblings. In other words, it returns true
|
|
139
|
+
* if "ELEMENT_PARENT > CHILD_SELECTOR" returns a single element.
|
|
140
|
+
*
|
|
141
|
+
* @param {Element} currentElement - the element being considered while iterating over the target
|
|
142
|
+
* element ancestors.
|
|
143
|
+
*
|
|
144
|
+
* @param {string} currentElementSelector - a selector that matches the current element. That
|
|
145
|
+
* selector is not a composed selector (i.e. it might be a single tag name, class name...).
|
|
146
|
+
*
|
|
147
|
+
* @param {string|undefined} childSelector - child selector is a selector that targets a descendant
|
|
148
|
+
* of the current element. When undefined, the current element is the target element.
|
|
149
|
+
*
|
|
150
|
+
* # Scope selector usage
|
|
151
|
+
*
|
|
152
|
+
* When composed together, the final selector will be joined with `>` operators to make sure we
|
|
153
|
+
* target direct descendants at each level. In this function, we'll use `querySelector` to check if
|
|
154
|
+
* a selector matches descendants of the current element. But by default, the query selector match
|
|
155
|
+
* elements at any level. Example:
|
|
156
|
+
*
|
|
157
|
+
* ```html
|
|
158
|
+
* <main>
|
|
159
|
+
* <div>
|
|
160
|
+
* <span></span>
|
|
161
|
+
* </div>
|
|
162
|
+
* <marquee>
|
|
163
|
+
* <div>
|
|
164
|
+
* <span></span>
|
|
165
|
+
* </div>
|
|
166
|
+
* </marquee>
|
|
167
|
+
* </main>
|
|
168
|
+
* ```
|
|
169
|
+
*
|
|
170
|
+
* `sibling.querySelector('DIV > SPAN')` will match both span elements, so we would consider the
|
|
171
|
+
* selector to be not unique, even if it is unique when we'll compose it with the parent with a `>`
|
|
172
|
+
* operator (`MAIN > DIV > SPAN`).
|
|
173
|
+
*
|
|
174
|
+
* To avoid this, we can use the `:scope` selector to make sure the selector starts from the current
|
|
175
|
+
* sibling (i.e. `sibling.querySelector('DIV:scope > SPAN')` will only match the first span).
|
|
176
|
+
*
|
|
177
|
+
* [1]: https://developer.mozilla.org/fr/docs/Web/CSS/:scope
|
|
178
|
+
*
|
|
179
|
+
* # Performance considerations
|
|
180
|
+
*
|
|
181
|
+
* We compute selectors in performance-critical operations (ex: during a click), so we need to make
|
|
182
|
+
* sure the function is as fast as possible. We observed that naively using `querySelectorAll` to
|
|
183
|
+
* check if the selector matches more than 1 element is quite expensive, so we want to avoid it.
|
|
184
|
+
*
|
|
185
|
+
* Because we are iterating the DOM upward and we use that function at every level, we know the
|
|
186
|
+
* child selector is already unique among the current element children, so we don't need to check
|
|
187
|
+
* for the current element subtree.
|
|
188
|
+
*
|
|
189
|
+
* Instead, we can focus on the current element siblings. If we find a single element matching the
|
|
190
|
+
* selector within a sibling, we know that it's not unique. This allows us to use `querySelector`
|
|
191
|
+
* (or `matches`, when the current element is the target element) instead of `querySelectorAll`.
|
|
192
|
+
*/
|
|
193
|
+
function isSelectorUniqueAmongSiblings(currentElement, currentElementSelector, childSelector) {
|
|
194
|
+
let isSiblingMatching;
|
|
195
|
+
if (childSelector === undefined) {
|
|
196
|
+
// If the child selector is undefined (meaning `currentElement` is the target element, not one
|
|
197
|
+
// of its ancestor), we need to use `matches` to check if the sibling is matching the selector,
|
|
198
|
+
// as `querySelector` only returns a descendant of the element.
|
|
199
|
+
isSiblingMatching = (sibling) => sibling.matches(currentElementSelector);
|
|
200
|
+
}
|
|
201
|
+
else {
|
|
202
|
+
const scopedSelector = combineSelector(`${currentElementSelector}:scope`, childSelector);
|
|
203
|
+
isSiblingMatching = (sibling) => sibling.querySelector(scopedSelector) !== null;
|
|
204
|
+
}
|
|
205
|
+
const parent = currentElement.parentElement;
|
|
206
|
+
let sibling = parent.firstElementChild;
|
|
207
|
+
while (sibling) {
|
|
208
|
+
if (sibling !== currentElement && isSiblingMatching(sibling)) {
|
|
209
|
+
return false;
|
|
210
|
+
}
|
|
211
|
+
sibling = sibling.nextElementSibling;
|
|
212
|
+
}
|
|
213
|
+
return true;
|
|
214
|
+
}
|
|
215
|
+
function combineSelector(parent, child) {
|
|
216
|
+
return child ? `${parent}>${child}` : parent;
|
|
217
|
+
}
|
|
218
|
+
//# sourceMappingURL=getSelectorFromElement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSelectorFromElement.js","sour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AAiB,CAAC,OAAO,CAAC,EAAE,CAAC;YAC7D,OAAO,KAAK,CAAA;QACd,CAAC;QACD,OAAO,GAAG,OAAO,CAAC,kBAAkB,CAAA;IACtC,CAAC;IAED,OAAO,IAAI,CAAA;AACb,CAAC;AAED,SAAS,eAAe,CAAC,MAAc,EAAE,KAAyB;IAChE,OAAO,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,MAAM,CAAA;AAC9C,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { RumConfiguration } from './configuration';
|
|
2
|
+
import type { ViewHistoryEntry } from './contexts/viewHistory';
|
|
3
|
+
import type { RumSession } from './rumSessionManager';
|
|
4
|
+
export declare function getSessionReplayUrl(configuration: RumConfiguration, { session, viewContext, errorType, }: {
|
|
5
|
+
session?: RumSession;
|
|
6
|
+
viewContext?: ViewHistoryEntry;
|
|
7
|
+
errorType?: string;
|
|
8
|
+
}): string;
|
|
9
|
+
export declare function getKubsesenseSiteUrl(rumConfiguration: RumConfiguration): string;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSessionReplayUrl = getSessionReplayUrl;
|
|
4
|
+
exports.getKubsesenseSiteUrl = getKubsesenseSiteUrl;
|
|
5
|
+
const kubesense_browser_core_1 = require("@kubesense/kubesense-browser-core");
|
|
6
|
+
function getSessionReplayUrl(configuration, { session, viewContext, errorType, }) {
|
|
7
|
+
const sessionId = session ? session.id : 'no-session-id';
|
|
8
|
+
const parameters = [];
|
|
9
|
+
if (errorType !== undefined) {
|
|
10
|
+
parameters.push(`error-type=${errorType}`);
|
|
11
|
+
}
|
|
12
|
+
if (viewContext) {
|
|
13
|
+
parameters.push(`seed=${viewContext.id}`);
|
|
14
|
+
parameters.push(`from=${viewContext.startClocks.timeStamp}`);
|
|
15
|
+
}
|
|
16
|
+
const origin = getKubsesenseSiteUrl(configuration);
|
|
17
|
+
const path = `/rum/replay/sessions/${sessionId}`;
|
|
18
|
+
return `${origin}${path}?${parameters.join('&')}`;
|
|
19
|
+
}
|
|
20
|
+
function getKubsesenseSiteUrl(rumConfiguration) {
|
|
21
|
+
const site = rumConfiguration.kubesenseRumEndpoint;
|
|
22
|
+
const subdomain = rumConfiguration.subdomain;
|
|
23
|
+
return `https://${subdomain ? `${subdomain}.` : ''}${site}`;
|
|
24
|
+
}
|
|
25
|
+
function getSiteDefaultSubdomain(configuration) {
|
|
26
|
+
switch (configuration.kubesenseRumEndpoint) {
|
|
27
|
+
case kubesense_browser_core_1.INTAKE_SITE_PROD:
|
|
28
|
+
case kubesense_browser_core_1.INTAKE_SITE_STAGING:
|
|
29
|
+
return 'staging';
|
|
30
|
+
default:
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=getSessionReplayUrl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSessionReplayUrl.js","sourceRoot":"","sources":["../../src/domain/getSessionReplayUrl.ts"],"names":[],"mappings":";;AAKA,kDAyBC;AAED,oDAIC;AApCD,8EAAyF;AAKzF,SAAgB,mBAAmB,CACjC,aAA+B,EAC/B,EACE,OAAO,EACP,WAAW,EACX,SAAS,GAKV;IAED,MAAM,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,eAAe,CAAA;IACxD,MAAM,UAAU,GAAa,EAAE,CAAA;IAC/B,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QAC5B,UAAU,CAAC,IAAI,CAAC,cAAc,SAAS,EAAE,CAAC,CAAA;IAC5C,CAAC;IACD,IAAI,WAAW,EAAE,CAAC;QAChB,UAAU,CAAC,IAAI,CAAC,QAAQ,WAAW,CAAC,EAAE,EAAE,CAAC,CAAA;QACzC,UAAU,CAAC,IAAI,CAAC,QAAQ,WAAW,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