@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,830 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
Context,
|
|
3
|
+
TimeStamp,
|
|
4
|
+
RelativeTime,
|
|
5
|
+
DeflateWorker,
|
|
6
|
+
DeflateEncoderStreamId,
|
|
7
|
+
DeflateEncoder,
|
|
8
|
+
PublicApi,
|
|
9
|
+
Duration,
|
|
10
|
+
ContextManager,
|
|
11
|
+
TrackingConsent,
|
|
12
|
+
User,
|
|
13
|
+
Account,
|
|
14
|
+
RumInternalContext,
|
|
15
|
+
Telemetry,
|
|
16
|
+
Encoder,
|
|
17
|
+
} from '@kubesense/kubesense-browser-core'
|
|
18
|
+
import {
|
|
19
|
+
ContextManagerMethod,
|
|
20
|
+
addTelemetryUsage,
|
|
21
|
+
deepClone,
|
|
22
|
+
makePublicApi,
|
|
23
|
+
monitor,
|
|
24
|
+
clocksNow,
|
|
25
|
+
callMonitored,
|
|
26
|
+
createHandlingStack,
|
|
27
|
+
sanitize,
|
|
28
|
+
createIdentityEncoder,
|
|
29
|
+
displayAlreadyInitializedError,
|
|
30
|
+
createTrackingConsentState,
|
|
31
|
+
timeStampToClocks,
|
|
32
|
+
CustomerContextKey,
|
|
33
|
+
defineContextMethod,
|
|
34
|
+
startBufferingData,
|
|
35
|
+
} from '@kubesense/kubesense-browser-core'
|
|
36
|
+
|
|
37
|
+
import type { LifeCycle } from '../domain/lifeCycle'
|
|
38
|
+
import type { ViewHistory } from '../domain/contexts/viewHistory'
|
|
39
|
+
import type { RumSessionManager } from '../domain/rumSessionManager'
|
|
40
|
+
import type { ReplayStats } from '../rawRumEvent.types'
|
|
41
|
+
import { ActionType, VitalType } from '../rawRumEvent.types'
|
|
42
|
+
import type { RumConfiguration, RumInitConfiguration } from '../domain/configuration'
|
|
43
|
+
import type { ViewOptions } from '../domain/view/trackViews'
|
|
44
|
+
import type {
|
|
45
|
+
AddDurationVitalOptions,
|
|
46
|
+
DurationVitalReference,
|
|
47
|
+
DurationVitalOptions,
|
|
48
|
+
FeatureOperationOptions,
|
|
49
|
+
FailureReason,
|
|
50
|
+
} from '../domain/vital/vitalCollection'
|
|
51
|
+
import { createCustomVitalsState } from '../domain/vital/vitalCollection'
|
|
52
|
+
import { callPluginsMethod } from '../domain/plugins'
|
|
53
|
+
import type { Hooks } from '../domain/hooks'
|
|
54
|
+
import type { SdkName } from '../domain/contexts/defaultContext'
|
|
55
|
+
import type { LongTaskContexts } from '../domain/longTask/longTaskCollection'
|
|
56
|
+
import { createPreStartStrategy } from './preStartRum'
|
|
57
|
+
import type { StartRum, StartRumResult } from './startRum'
|
|
58
|
+
|
|
59
|
+
export interface StartRecordingOptions {
|
|
60
|
+
force: boolean
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Public API for the RUM browser SDK.
|
|
65
|
+
*
|
|
66
|
+
* @category Main
|
|
67
|
+
*/
|
|
68
|
+
export interface RumPublicApi extends PublicApi {
|
|
69
|
+
/**
|
|
70
|
+
* Init the RUM browser SDK.
|
|
71
|
+
*
|
|
72
|
+
* @category Init
|
|
73
|
+
* @param initConfiguration - Configuration options of the SDK
|
|
74
|
+
* @example
|
|
75
|
+
* ```ts
|
|
76
|
+
* kubesenseSdk.init({
|
|
77
|
+
* applicationId: '<KUBESENSE_APPLICATION_ID>',
|
|
78
|
+
* clientToken: '<KUBESENSE_CLIENT_TOKEN>',
|
|
79
|
+
* kubesenseRumEndpoint: '<KUBESENSE_RUM_ENDPOINT>',
|
|
80
|
+
* // ...
|
|
81
|
+
* })
|
|
82
|
+
* ```
|
|
83
|
+
*
|
|
84
|
+
*/
|
|
85
|
+
init: (initConfiguration: RumInitConfiguration) => void
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Set the tracking consent of the current user.
|
|
89
|
+
*
|
|
90
|
+
*
|
|
91
|
+
* Data will be sent only if it is set to "granted". This value won't be stored by the library
|
|
92
|
+
* across page loads: you will need to call this method or set the appropriate `trackingConsent`
|
|
93
|
+
* field in the init() method at each page load.
|
|
94
|
+
*
|
|
95
|
+
* If this method is called before the init() method, the provided value will take precedence
|
|
96
|
+
* over the one provided as initialization parameter.
|
|
97
|
+
*
|
|
98
|
+
* *
|
|
99
|
+
* @category Privacy
|
|
100
|
+
* @param trackingConsent - The user tracking consent
|
|
101
|
+
*/
|
|
102
|
+
setTrackingConsent: (trackingConsent: TrackingConsent) => void
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Set View Name.
|
|
106
|
+
*
|
|
107
|
+
* Enable to manually change the name of the current view.
|
|
108
|
+
* @category Context - View
|
|
109
|
+
* @param name name of the view
|
|
110
|
+
*/
|
|
111
|
+
setViewName: (name: string) => void
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Set View Context.
|
|
115
|
+
*
|
|
116
|
+
* Enable to manually set the context of the current view.
|
|
117
|
+
* @category Context - View
|
|
118
|
+
* @param context context of the view
|
|
119
|
+
*/
|
|
120
|
+
setViewContext: (context: Context) => void
|
|
121
|
+
/**
|
|
122
|
+
* Set View Context Property.
|
|
123
|
+
*
|
|
124
|
+
* Enable to manually set a property of the context of the current view.
|
|
125
|
+
* @category Context - View
|
|
126
|
+
* @param key - key of the property
|
|
127
|
+
* @param value - value of the property
|
|
128
|
+
*/
|
|
129
|
+
setViewContextProperty: (key: string, value: any) => void
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Get View Context.
|
|
133
|
+
* @category Context - View
|
|
134
|
+
*
|
|
135
|
+
*/
|
|
136
|
+
getViewContext(): Context
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Set the global context information to all events, stored in `@context`
|
|
140
|
+
*
|
|
141
|
+
* @category internal - View
|
|
142
|
+
* @param context Global context
|
|
143
|
+
*
|
|
144
|
+
*/
|
|
145
|
+
getInternalContext: (startTime?: number) => RumInternalContext | undefined
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Get the init configuration
|
|
149
|
+
*/
|
|
150
|
+
getInitConfiguration: () => RumInitConfiguration | undefined
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Add a custom action, stored in `@action`
|
|
154
|
+
* @category Data Collection
|
|
155
|
+
* @param name Name of the action
|
|
156
|
+
* @param context Context of the action
|
|
157
|
+
*
|
|
158
|
+
*/
|
|
159
|
+
addAction: (name: string, context?: object) => void
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Add a custom error, stored in `@error`.
|
|
163
|
+
* @category Data Collection
|
|
164
|
+
* @param error Error. Favor sending a [Javascript Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) to have a stack trace attached to the error event.
|
|
165
|
+
* @param context Context of the error
|
|
166
|
+
*
|
|
167
|
+
*/
|
|
168
|
+
addError: (error: unknown, context?: object) => void
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Add a custom timing relative to the start of the current view,
|
|
172
|
+
* stored in `@view.custom_timings.<timing_name>`
|
|
173
|
+
*
|
|
174
|
+
* @category Data Collection
|
|
175
|
+
* @param name Name of the custom timing
|
|
176
|
+
* @param [time] Epoch timestamp of the custom timing (if not set, will use current time)
|
|
177
|
+
*
|
|
178
|
+
* Note: passing a relative time is discouraged since it is actually used as-is but displayed relative to the view start.
|
|
179
|
+
* We currently don't provide a way to retrieve the view start time, so it can be challenging to provide a timing relative to the view start.
|
|
180
|
+
*/
|
|
181
|
+
addTiming: (name: string, time?: number) => void
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Set the global context information to all events, stored in `@context`
|
|
185
|
+
* See [Global context](https://docs.kubesense.ai/real_user_monitoring/browser/advanced_configuration/#global-context) for further information.
|
|
186
|
+
*
|
|
187
|
+
* @category Context - Global Context
|
|
188
|
+
* @param context - Global context
|
|
189
|
+
*/
|
|
190
|
+
setGlobalContext: (context: Context) => void
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Get the global Context
|
|
194
|
+
*
|
|
195
|
+
* See [Global context](https://docs.kubesense.ai/real_user_monitoring/browser/advanced_configuration/#global-context) for further information.
|
|
196
|
+
*
|
|
197
|
+
* @category Context - Global Context
|
|
198
|
+
*/
|
|
199
|
+
getGlobalContext: () => Context
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Set or update a global context property, stored in `@context.<key>`
|
|
203
|
+
*
|
|
204
|
+
* See [Global context](https://docs.kubesense.ai/real_user_monitoring/browser/advanced_configuration/#global-context) for further information.
|
|
205
|
+
*
|
|
206
|
+
* @category Context - Global Context
|
|
207
|
+
* @param key - Key of the property
|
|
208
|
+
* @param value - Value of the property
|
|
209
|
+
*/
|
|
210
|
+
setGlobalContextProperty: (key: any, value: any) => void
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Remove a global context property
|
|
214
|
+
*
|
|
215
|
+
* See [Global context](https://docs.kubesense.ai/real_user_monitoring/browser/advanced_configuration/#global-context) for further information.
|
|
216
|
+
*
|
|
217
|
+
* @category Context - Global Context
|
|
218
|
+
*/
|
|
219
|
+
removeGlobalContextProperty: (key: any) => void
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Clear the global context
|
|
223
|
+
*
|
|
224
|
+
* See [Global context](https://docs.kubesense.ai/real_user_monitoring/browser/advanced_configuration/#global-context) for further information.
|
|
225
|
+
*
|
|
226
|
+
* @category Context - Global Context
|
|
227
|
+
*/
|
|
228
|
+
clearGlobalContext(): void
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Set user information to all events, stored in `@usr`
|
|
232
|
+
*
|
|
233
|
+
* See [User session](https://docs.kubesense.ai/real_user_monitoring/browser/advanced_configuration/#user-session) for further information.
|
|
234
|
+
*
|
|
235
|
+
* @category Context - User
|
|
236
|
+
* @param newUser - User information
|
|
237
|
+
*/
|
|
238
|
+
setUser(newUser: User & { id: string }): void
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Set user information to all events, stored in `@usr`
|
|
242
|
+
*
|
|
243
|
+
* @category Context - User
|
|
244
|
+
* @deprecated You must specify a user id, favor using {@link setUser} instead
|
|
245
|
+
* @param newUser - User information with optional id
|
|
246
|
+
*/
|
|
247
|
+
setUser(newUser: User): void
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Get user information
|
|
251
|
+
*
|
|
252
|
+
* See [User session](https://docs.kubesense.ai/real_user_monitoring/browser/advanced_configuration/#user-session) for further information.
|
|
253
|
+
*
|
|
254
|
+
* @category Context - User
|
|
255
|
+
* @returns User information
|
|
256
|
+
*/
|
|
257
|
+
getUser: () => Context
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Set or update the user property, stored in `@usr.<key>`
|
|
261
|
+
*
|
|
262
|
+
* See [User session](https://docs.kubesense.ai/real_user_monitoring/browser/advanced_configuration/#user-session) for further information.
|
|
263
|
+
*
|
|
264
|
+
* @category Context - User
|
|
265
|
+
* @param key - Key of the property
|
|
266
|
+
* @param property - Value of the property
|
|
267
|
+
*/
|
|
268
|
+
setUserProperty: (key: any, property: any) => void
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Remove a user property
|
|
272
|
+
*
|
|
273
|
+
* @category Context - User
|
|
274
|
+
* @param key - Key of the property to remove
|
|
275
|
+
* @see [User session](https://docs.kubesense.ai/real_user_monitoring/browser/advanced_configuration/#user-session) for further information.
|
|
276
|
+
*/
|
|
277
|
+
removeUserProperty: (key: any) => void
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Clear all user information
|
|
281
|
+
*
|
|
282
|
+
* See [User session](https://docs.kubesense.ai/real_user_monitoring/browser/advanced_configuration/#user-session) for further information.
|
|
283
|
+
*
|
|
284
|
+
* @category Context - User
|
|
285
|
+
*/
|
|
286
|
+
clearUser: () => void
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Set account information to all events, stored in `@account`
|
|
290
|
+
*
|
|
291
|
+
* @category Context - Account
|
|
292
|
+
* @param newAccount - Account information
|
|
293
|
+
*/
|
|
294
|
+
setAccount: (newAccount: Account) => void
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Get account information
|
|
298
|
+
*
|
|
299
|
+
* @category Context - Account
|
|
300
|
+
* @returns Account information
|
|
301
|
+
*/
|
|
302
|
+
getAccount: () => Context
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Set or update the account property, stored in `@account.<key>`
|
|
306
|
+
*
|
|
307
|
+
* @category Context - Account
|
|
308
|
+
* @param key - Key of the property
|
|
309
|
+
* @param property - Value of the property
|
|
310
|
+
*/
|
|
311
|
+
setAccountProperty: (key: string, property: any) => void
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* Remove an account property
|
|
315
|
+
*
|
|
316
|
+
* @category Context - Account
|
|
317
|
+
* @param key - Key of the property to remove
|
|
318
|
+
*/
|
|
319
|
+
removeAccountProperty: (key: string) => void
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* Clear all account information
|
|
323
|
+
*
|
|
324
|
+
* @category Context - Account
|
|
325
|
+
* @returns Clear all account information
|
|
326
|
+
*/
|
|
327
|
+
clearAccount: () => void
|
|
328
|
+
/**
|
|
329
|
+
* Start a view manually.
|
|
330
|
+
* Enable to manual start a view, use `trackViewsManually: true` init parameter and call `startView()` to create RUM views and be aligned with how you’ve defined them in your SPA application routing.
|
|
331
|
+
*
|
|
332
|
+
* See [Override default RUM view names](https://docs.kubesense.ai/real_user_monitoring/browser/advanced_configuration/#override-default-rum-view-names) for further information.
|
|
333
|
+
*
|
|
334
|
+
* Context - @category Data Collection
|
|
335
|
+
*
|
|
336
|
+
* @param nameOrOptions - Name or options (name, service, version) for the view
|
|
337
|
+
*/
|
|
338
|
+
startView(nameOrOptions?: string | ViewOptions): void
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Stop the session. A new session will start at the next user interaction with the page.
|
|
342
|
+
*
|
|
343
|
+
* @category Session
|
|
344
|
+
*/
|
|
345
|
+
stopSession(): void
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* Add a feature flag evaluation,
|
|
349
|
+
* stored in `@feature_flags.<feature_flag_key>`
|
|
350
|
+
*
|
|
351
|
+
* We recommend enabling the intake request compression when using feature flags `compressIntakeRequests: true`.
|
|
352
|
+
*
|
|
353
|
+
* See [Feature Flag Tracking](https://docs.kubesense.ai/real_user_monitoring/feature_flag_tracking/) for further information.
|
|
354
|
+
*
|
|
355
|
+
* @category Data Collection
|
|
356
|
+
* @param key - The key of the feature flag.
|
|
357
|
+
* @param value - The value of the feature flag.
|
|
358
|
+
*/
|
|
359
|
+
addFeatureFlagEvaluation: (key: string, value: any) => void
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* Get the Session Replay Link.
|
|
363
|
+
*
|
|
364
|
+
* See [Connect Session Replay To Your Third-Party Tools](https://docs.kubesense.ai/real_user_monitoring/guide/connect-session-replay-to-your-third-party-tools) for further information.
|
|
365
|
+
*
|
|
366
|
+
* @category Session Replay
|
|
367
|
+
*/
|
|
368
|
+
getSessionReplayLink: () => string | undefined
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* Start Session Replay recording.
|
|
372
|
+
* Enable to conditionally start the recording, use the `startSessionReplayRecordingManually:true` init parameter and call `startSessionReplayRecording()`
|
|
373
|
+
*
|
|
374
|
+
* See [Browser Session Replay](https://docs.kubesense.ai/real_user_monitoring/session_replay/browser) for further information.
|
|
375
|
+
*
|
|
376
|
+
* @category Session Replay
|
|
377
|
+
*/
|
|
378
|
+
startSessionReplayRecording: (options?: StartRecordingOptions) => void
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* Stop Session Replay recording.
|
|
382
|
+
*
|
|
383
|
+
* See [Browser Session Replay](https://docs.kubesense.ai/real_user_monitoring/session_replay/browser) for further information.
|
|
384
|
+
*
|
|
385
|
+
* @category Session Replay
|
|
386
|
+
*/
|
|
387
|
+
stopSessionReplayRecording: () => void
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* Add a custom duration vital
|
|
391
|
+
*
|
|
392
|
+
* @category Vital - Duration
|
|
393
|
+
* @param name - Name of the custom vital
|
|
394
|
+
* @param options - Options for the custom vital (startTime, duration, context, description)
|
|
395
|
+
*/
|
|
396
|
+
addDurationVital: (name: string, options: AddDurationVitalOptions) => void
|
|
397
|
+
|
|
398
|
+
/**
|
|
399
|
+
* Start a custom duration vital.
|
|
400
|
+
*
|
|
401
|
+
* If you plan to have multiple durations for the same vital, you should use the reference returned by this method.
|
|
402
|
+
*
|
|
403
|
+
* @category Vital - Duration
|
|
404
|
+
* @param name - Name of the custom vital
|
|
405
|
+
* @param options - Options for the custom vital (context, description)
|
|
406
|
+
* @returns reference to the custom vital
|
|
407
|
+
*/
|
|
408
|
+
startDurationVital: (name: string, options?: DurationVitalOptions) => DurationVitalReference
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* Stop a custom duration vital
|
|
412
|
+
*
|
|
413
|
+
* @category Vital - Duration
|
|
414
|
+
* @param nameOrRef - Name or reference of the custom vital
|
|
415
|
+
* @param options - Options for the custom vital (operationKey, context, description)
|
|
416
|
+
*/
|
|
417
|
+
stopDurationVital: (nameOrRef: string | DurationVitalReference, options?: DurationVitalOptions) => void
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* start a feature operation
|
|
421
|
+
*
|
|
422
|
+
* @category Vital - Feature Operation
|
|
423
|
+
* @param name - Name of the operation step
|
|
424
|
+
* @param options - Options for the operation step (operationKey, context, description)
|
|
425
|
+
* @hidden // TODO: replace by @since when GA
|
|
426
|
+
*/
|
|
427
|
+
startFeatureOperation: (name: string, options?: FeatureOperationOptions) => void
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* succeed a feature operation
|
|
431
|
+
*
|
|
432
|
+
* @category Vital - Feature Operation
|
|
433
|
+
* @param name - Name of the operation step
|
|
434
|
+
* @param options - Options for the operation step (operationKey, context, description)
|
|
435
|
+
* @hidden // TODO: replace by @since when GA
|
|
436
|
+
*/
|
|
437
|
+
succeedFeatureOperation: (name: string, options?: FeatureOperationOptions) => void
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* fail a feature operation
|
|
441
|
+
*
|
|
442
|
+
* @category Vital - Feature Operation
|
|
443
|
+
* @param name - Name of the operation step
|
|
444
|
+
* @param failureReason
|
|
445
|
+
* @param options - Options for the operation step (operationKey, context, description)
|
|
446
|
+
* @hidden // TODO: replace by @since when GA
|
|
447
|
+
*/
|
|
448
|
+
failFeatureOperation: (name: string, failureReaon: FailureReason, options?: FeatureOperationOptions) => void
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
export interface RecorderApi {
|
|
452
|
+
start: (options?: StartRecordingOptions) => void
|
|
453
|
+
stop: () => void
|
|
454
|
+
onRumStart: (
|
|
455
|
+
lifeCycle: LifeCycle,
|
|
456
|
+
configuration: RumConfiguration,
|
|
457
|
+
sessionManager: RumSessionManager,
|
|
458
|
+
viewHistory: ViewHistory,
|
|
459
|
+
deflateWorker: DeflateWorker | undefined,
|
|
460
|
+
telemetry: Telemetry
|
|
461
|
+
) => void
|
|
462
|
+
isRecording: () => boolean
|
|
463
|
+
getReplayStats: (viewId: string) => ReplayStats | undefined
|
|
464
|
+
getSessionReplayLink: () => string | undefined
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
export interface ProfilerApi {
|
|
468
|
+
stop: () => void
|
|
469
|
+
onRumStart: (
|
|
470
|
+
lifeCycle: LifeCycle,
|
|
471
|
+
hooks: Hooks,
|
|
472
|
+
configuration: RumConfiguration,
|
|
473
|
+
sessionManager: RumSessionManager,
|
|
474
|
+
viewHistory: ViewHistory,
|
|
475
|
+
longTaskContexts: LongTaskContexts,
|
|
476
|
+
createEncoder: (streamId: DeflateEncoderStreamId) => Encoder
|
|
477
|
+
) => void
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
export interface RumPublicApiOptions {
|
|
481
|
+
ignoreInitIfSyntheticsWillInjectRum?: boolean
|
|
482
|
+
startDeflateWorker?: (
|
|
483
|
+
configuration: RumConfiguration,
|
|
484
|
+
source: string,
|
|
485
|
+
onInitializationFailure: () => void
|
|
486
|
+
) => DeflateWorker | undefined
|
|
487
|
+
createDeflateEncoder?: (
|
|
488
|
+
configuration: RumConfiguration,
|
|
489
|
+
worker: DeflateWorker,
|
|
490
|
+
streamId: DeflateEncoderStreamId
|
|
491
|
+
) => DeflateEncoder
|
|
492
|
+
sdkName?: SdkName
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
export interface Strategy {
|
|
496
|
+
init: (initConfiguration: RumInitConfiguration, publicApi: RumPublicApi, errorStack?: string) => void
|
|
497
|
+
initConfiguration: RumInitConfiguration | undefined
|
|
498
|
+
getInternalContext: StartRumResult['getInternalContext']
|
|
499
|
+
stopSession: StartRumResult['stopSession']
|
|
500
|
+
addTiming: StartRumResult['addTiming']
|
|
501
|
+
startView: StartRumResult['startView']
|
|
502
|
+
setViewName: StartRumResult['setViewName']
|
|
503
|
+
|
|
504
|
+
setViewContext: StartRumResult['setViewContext']
|
|
505
|
+
setViewContextProperty: StartRumResult['setViewContextProperty']
|
|
506
|
+
getViewContext: StartRumResult['getViewContext']
|
|
507
|
+
|
|
508
|
+
globalContext: ContextManager
|
|
509
|
+
userContext: ContextManager
|
|
510
|
+
accountContext: ContextManager
|
|
511
|
+
|
|
512
|
+
addAction: StartRumResult['addAction']
|
|
513
|
+
addError: StartRumResult['addError']
|
|
514
|
+
addFeatureFlagEvaluation: StartRumResult['addFeatureFlagEvaluation']
|
|
515
|
+
startDurationVital: StartRumResult['startDurationVital']
|
|
516
|
+
stopDurationVital: StartRumResult['stopDurationVital']
|
|
517
|
+
addDurationVital: StartRumResult['addDurationVital']
|
|
518
|
+
addOperationStepVital: StartRumResult['addOperationStepVital']
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
export function makeRumPublicApi(
|
|
522
|
+
startRumImpl: StartRum,
|
|
523
|
+
recorderApi: RecorderApi,
|
|
524
|
+
profilerApi: ProfilerApi,
|
|
525
|
+
options: RumPublicApiOptions = {}
|
|
526
|
+
): RumPublicApi {
|
|
527
|
+
const trackingConsentState = createTrackingConsentState()
|
|
528
|
+
const customVitalsState = createCustomVitalsState()
|
|
529
|
+
const bufferedDataObservable = startBufferingData().observable
|
|
530
|
+
|
|
531
|
+
let strategy = createPreStartStrategy(
|
|
532
|
+
options,
|
|
533
|
+
trackingConsentState,
|
|
534
|
+
customVitalsState,
|
|
535
|
+
(configuration, deflateWorker, initialViewOptions) => {
|
|
536
|
+
const createEncoder =
|
|
537
|
+
deflateWorker && options.createDeflateEncoder
|
|
538
|
+
? (streamId: DeflateEncoderStreamId) => options.createDeflateEncoder!(configuration, deflateWorker, streamId)
|
|
539
|
+
: createIdentityEncoder
|
|
540
|
+
|
|
541
|
+
const startRumResult = startRumImpl(
|
|
542
|
+
configuration,
|
|
543
|
+
recorderApi,
|
|
544
|
+
profilerApi,
|
|
545
|
+
initialViewOptions,
|
|
546
|
+
createEncoder,
|
|
547
|
+
trackingConsentState,
|
|
548
|
+
customVitalsState,
|
|
549
|
+
bufferedDataObservable,
|
|
550
|
+
options.sdkName
|
|
551
|
+
)
|
|
552
|
+
|
|
553
|
+
recorderApi.onRumStart(
|
|
554
|
+
startRumResult.lifeCycle,
|
|
555
|
+
configuration,
|
|
556
|
+
startRumResult.session,
|
|
557
|
+
startRumResult.viewHistory,
|
|
558
|
+
deflateWorker,
|
|
559
|
+
startRumResult.telemetry
|
|
560
|
+
)
|
|
561
|
+
|
|
562
|
+
profilerApi.onRumStart(
|
|
563
|
+
startRumResult.lifeCycle,
|
|
564
|
+
startRumResult.hooks,
|
|
565
|
+
configuration,
|
|
566
|
+
startRumResult.session,
|
|
567
|
+
startRumResult.viewHistory,
|
|
568
|
+
startRumResult.longTaskContexts,
|
|
569
|
+
createEncoder
|
|
570
|
+
)
|
|
571
|
+
|
|
572
|
+
strategy = createPostStartStrategy(strategy, startRumResult)
|
|
573
|
+
|
|
574
|
+
callPluginsMethod(configuration.plugins, 'onRumStart', {
|
|
575
|
+
strategy, // TODO: remove this in the next major release
|
|
576
|
+
addEvent: startRumResult.addEvent,
|
|
577
|
+
})
|
|
578
|
+
|
|
579
|
+
return startRumResult
|
|
580
|
+
}
|
|
581
|
+
)
|
|
582
|
+
const getStrategy = () => strategy
|
|
583
|
+
|
|
584
|
+
const startView: {
|
|
585
|
+
(name?: string): void
|
|
586
|
+
(options: ViewOptions): void
|
|
587
|
+
} = monitor((options?: string | ViewOptions) => {
|
|
588
|
+
const sanitizedOptions = typeof options === 'object' ? options : { name: options }
|
|
589
|
+
strategy.startView(sanitizedOptions)
|
|
590
|
+
addTelemetryUsage({ feature: 'start-view' })
|
|
591
|
+
})
|
|
592
|
+
|
|
593
|
+
const rumPublicApi: RumPublicApi = makePublicApi<RumPublicApi>({
|
|
594
|
+
init: (initConfiguration) => {
|
|
595
|
+
const errorStack = new Error().stack
|
|
596
|
+
callMonitored(() => strategy.init(initConfiguration, rumPublicApi, errorStack))
|
|
597
|
+
},
|
|
598
|
+
|
|
599
|
+
setTrackingConsent: monitor((trackingConsent) => {
|
|
600
|
+
trackingConsentState.update(trackingConsent)
|
|
601
|
+
addTelemetryUsage({ feature: 'set-tracking-consent', tracking_consent: trackingConsent })
|
|
602
|
+
}),
|
|
603
|
+
|
|
604
|
+
setViewName: monitor((name: string) => {
|
|
605
|
+
strategy.setViewName(name)
|
|
606
|
+
addTelemetryUsage({ feature: 'set-view-name' })
|
|
607
|
+
}),
|
|
608
|
+
|
|
609
|
+
setViewContext: monitor((context: Context) => {
|
|
610
|
+
strategy.setViewContext(context)
|
|
611
|
+
addTelemetryUsage({ feature: 'set-view-context' })
|
|
612
|
+
}),
|
|
613
|
+
|
|
614
|
+
setViewContextProperty: monitor((key: string, value: any) => {
|
|
615
|
+
strategy.setViewContextProperty(key, value)
|
|
616
|
+
addTelemetryUsage({ feature: 'set-view-context-property' })
|
|
617
|
+
}),
|
|
618
|
+
|
|
619
|
+
getViewContext: monitor(() => {
|
|
620
|
+
addTelemetryUsage({ feature: 'set-view-context-property' })
|
|
621
|
+
return strategy.getViewContext()
|
|
622
|
+
}),
|
|
623
|
+
|
|
624
|
+
getInternalContext: monitor((startTime) => strategy.getInternalContext(startTime)),
|
|
625
|
+
|
|
626
|
+
getInitConfiguration: monitor(() => deepClone(strategy.initConfiguration)),
|
|
627
|
+
|
|
628
|
+
addAction: (name, context) => {
|
|
629
|
+
const handlingStack = createHandlingStack('action')
|
|
630
|
+
|
|
631
|
+
callMonitored(() => {
|
|
632
|
+
strategy.addAction({
|
|
633
|
+
name: sanitize(name)!,
|
|
634
|
+
context: sanitize(context) as Context,
|
|
635
|
+
startClocks: clocksNow(),
|
|
636
|
+
type: ActionType.CUSTOM,
|
|
637
|
+
handlingStack,
|
|
638
|
+
})
|
|
639
|
+
addTelemetryUsage({ feature: 'add-action' })
|
|
640
|
+
})
|
|
641
|
+
},
|
|
642
|
+
|
|
643
|
+
addError: (error, context) => {
|
|
644
|
+
const handlingStack = createHandlingStack('error')
|
|
645
|
+
callMonitored(() => {
|
|
646
|
+
strategy.addError({
|
|
647
|
+
error, // Do not sanitize error here, it is needed unserialized by computeRawError()
|
|
648
|
+
handlingStack,
|
|
649
|
+
context: sanitize(context) as Context,
|
|
650
|
+
startClocks: clocksNow(),
|
|
651
|
+
})
|
|
652
|
+
addTelemetryUsage({ feature: 'add-error' })
|
|
653
|
+
})
|
|
654
|
+
},
|
|
655
|
+
|
|
656
|
+
addTiming: monitor((name, time) => {
|
|
657
|
+
// TODO: next major decide to drop relative time support or update its behaviour
|
|
658
|
+
strategy.addTiming(sanitize(name)!, time as RelativeTime | TimeStamp | undefined)
|
|
659
|
+
}),
|
|
660
|
+
|
|
661
|
+
setGlobalContext: defineContextMethod(
|
|
662
|
+
getStrategy,
|
|
663
|
+
CustomerContextKey.globalContext,
|
|
664
|
+
ContextManagerMethod.setContext,
|
|
665
|
+
'set-global-context'
|
|
666
|
+
),
|
|
667
|
+
getGlobalContext: defineContextMethod(
|
|
668
|
+
getStrategy,
|
|
669
|
+
CustomerContextKey.globalContext,
|
|
670
|
+
ContextManagerMethod.getContext,
|
|
671
|
+
'get-global-context'
|
|
672
|
+
),
|
|
673
|
+
setGlobalContextProperty: defineContextMethod(
|
|
674
|
+
getStrategy,
|
|
675
|
+
CustomerContextKey.globalContext,
|
|
676
|
+
ContextManagerMethod.setContextProperty,
|
|
677
|
+
'set-global-context-property'
|
|
678
|
+
),
|
|
679
|
+
removeGlobalContextProperty: defineContextMethod(
|
|
680
|
+
getStrategy,
|
|
681
|
+
CustomerContextKey.globalContext,
|
|
682
|
+
ContextManagerMethod.removeContextProperty,
|
|
683
|
+
'remove-global-context-property'
|
|
684
|
+
),
|
|
685
|
+
clearGlobalContext: defineContextMethod(
|
|
686
|
+
getStrategy,
|
|
687
|
+
CustomerContextKey.globalContext,
|
|
688
|
+
ContextManagerMethod.clearContext,
|
|
689
|
+
'clear-global-context'
|
|
690
|
+
),
|
|
691
|
+
|
|
692
|
+
setUser: defineContextMethod(
|
|
693
|
+
getStrategy,
|
|
694
|
+
CustomerContextKey.userContext,
|
|
695
|
+
ContextManagerMethod.setContext,
|
|
696
|
+
'set-user'
|
|
697
|
+
),
|
|
698
|
+
getUser: defineContextMethod(
|
|
699
|
+
getStrategy,
|
|
700
|
+
CustomerContextKey.userContext,
|
|
701
|
+
ContextManagerMethod.getContext,
|
|
702
|
+
'get-user'
|
|
703
|
+
),
|
|
704
|
+
setUserProperty: defineContextMethod(
|
|
705
|
+
getStrategy,
|
|
706
|
+
CustomerContextKey.userContext,
|
|
707
|
+
ContextManagerMethod.setContextProperty,
|
|
708
|
+
'set-user-property'
|
|
709
|
+
),
|
|
710
|
+
removeUserProperty: defineContextMethod(
|
|
711
|
+
getStrategy,
|
|
712
|
+
CustomerContextKey.userContext,
|
|
713
|
+
ContextManagerMethod.removeContextProperty,
|
|
714
|
+
'remove-user-property'
|
|
715
|
+
),
|
|
716
|
+
clearUser: defineContextMethod(
|
|
717
|
+
getStrategy,
|
|
718
|
+
CustomerContextKey.userContext,
|
|
719
|
+
ContextManagerMethod.clearContext,
|
|
720
|
+
'clear-user'
|
|
721
|
+
),
|
|
722
|
+
|
|
723
|
+
setAccount: defineContextMethod(
|
|
724
|
+
getStrategy,
|
|
725
|
+
CustomerContextKey.accountContext,
|
|
726
|
+
ContextManagerMethod.setContext,
|
|
727
|
+
'set-account'
|
|
728
|
+
),
|
|
729
|
+
getAccount: defineContextMethod(
|
|
730
|
+
getStrategy,
|
|
731
|
+
CustomerContextKey.accountContext,
|
|
732
|
+
ContextManagerMethod.getContext,
|
|
733
|
+
'get-account'
|
|
734
|
+
),
|
|
735
|
+
setAccountProperty: defineContextMethod(
|
|
736
|
+
getStrategy,
|
|
737
|
+
CustomerContextKey.accountContext,
|
|
738
|
+
ContextManagerMethod.setContextProperty,
|
|
739
|
+
'set-account-property'
|
|
740
|
+
),
|
|
741
|
+
removeAccountProperty: defineContextMethod(
|
|
742
|
+
getStrategy,
|
|
743
|
+
CustomerContextKey.accountContext,
|
|
744
|
+
ContextManagerMethod.removeContextProperty,
|
|
745
|
+
'remove-account-property'
|
|
746
|
+
),
|
|
747
|
+
clearAccount: defineContextMethod(
|
|
748
|
+
getStrategy,
|
|
749
|
+
CustomerContextKey.accountContext,
|
|
750
|
+
ContextManagerMethod.clearContext,
|
|
751
|
+
'clear-account'
|
|
752
|
+
),
|
|
753
|
+
|
|
754
|
+
startView,
|
|
755
|
+
|
|
756
|
+
stopSession: monitor(() => {
|
|
757
|
+
strategy.stopSession()
|
|
758
|
+
addTelemetryUsage({ feature: 'stop-session' })
|
|
759
|
+
}),
|
|
760
|
+
|
|
761
|
+
addFeatureFlagEvaluation: monitor((key, value) => {
|
|
762
|
+
strategy.addFeatureFlagEvaluation(sanitize(key)!, sanitize(value))
|
|
763
|
+
addTelemetryUsage({ feature: 'add-feature-flag-evaluation' })
|
|
764
|
+
}),
|
|
765
|
+
|
|
766
|
+
getSessionReplayLink: monitor(() => recorderApi.getSessionReplayLink()),
|
|
767
|
+
|
|
768
|
+
startSessionReplayRecording: monitor((options?: StartRecordingOptions) => {
|
|
769
|
+
recorderApi.start(options)
|
|
770
|
+
addTelemetryUsage({ feature: 'start-session-replay-recording', force: options && options.force })
|
|
771
|
+
}),
|
|
772
|
+
|
|
773
|
+
stopSessionReplayRecording: monitor(() => recorderApi.stop()),
|
|
774
|
+
|
|
775
|
+
addDurationVital: monitor((name, options) => {
|
|
776
|
+
addTelemetryUsage({ feature: 'add-duration-vital' })
|
|
777
|
+
strategy.addDurationVital({
|
|
778
|
+
name: sanitize(name)!,
|
|
779
|
+
type: VitalType.DURATION,
|
|
780
|
+
startClocks: timeStampToClocks(options.startTime as TimeStamp),
|
|
781
|
+
duration: options.duration as Duration,
|
|
782
|
+
context: sanitize(options && options.context) as Context,
|
|
783
|
+
description: sanitize(options && options.description) as string | undefined,
|
|
784
|
+
})
|
|
785
|
+
}),
|
|
786
|
+
|
|
787
|
+
startDurationVital: monitor((name, options) => {
|
|
788
|
+
addTelemetryUsage({ feature: 'start-duration-vital' })
|
|
789
|
+
return strategy.startDurationVital(sanitize(name)!, {
|
|
790
|
+
context: sanitize(options && options.context) as Context,
|
|
791
|
+
description: sanitize(options && options.description) as string | undefined,
|
|
792
|
+
})
|
|
793
|
+
}),
|
|
794
|
+
|
|
795
|
+
stopDurationVital: monitor((nameOrRef, options) => {
|
|
796
|
+
addTelemetryUsage({ feature: 'stop-duration-vital' })
|
|
797
|
+
strategy.stopDurationVital(typeof nameOrRef === 'string' ? sanitize(nameOrRef)! : nameOrRef, {
|
|
798
|
+
context: sanitize(options && options.context) as Context,
|
|
799
|
+
description: sanitize(options && options.description) as string | undefined,
|
|
800
|
+
})
|
|
801
|
+
}),
|
|
802
|
+
|
|
803
|
+
startFeatureOperation: monitor((name, options) => {
|
|
804
|
+
addTelemetryUsage({ feature: 'add-operation-step-vital', action_type: 'start' })
|
|
805
|
+
strategy.addOperationStepVital(name, 'start', options)
|
|
806
|
+
}),
|
|
807
|
+
|
|
808
|
+
succeedFeatureOperation: monitor((name, options) => {
|
|
809
|
+
addTelemetryUsage({ feature: 'add-operation-step-vital', action_type: 'succeed' })
|
|
810
|
+
strategy.addOperationStepVital(name, 'end', options)
|
|
811
|
+
}),
|
|
812
|
+
|
|
813
|
+
failFeatureOperation: monitor((name, failureReason, options) => {
|
|
814
|
+
addTelemetryUsage({ feature: 'add-operation-step-vital', action_type: 'fail' })
|
|
815
|
+
strategy.addOperationStepVital(name, 'end', options, failureReason)
|
|
816
|
+
}),
|
|
817
|
+
})
|
|
818
|
+
|
|
819
|
+
return rumPublicApi
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
function createPostStartStrategy(preStartStrategy: Strategy, startRumResult: StartRumResult): Strategy {
|
|
823
|
+
return {
|
|
824
|
+
init: (initConfiguration: RumInitConfiguration) => {
|
|
825
|
+
displayAlreadyInitializedError('KUBESENSE_SDK', initConfiguration)
|
|
826
|
+
},
|
|
827
|
+
initConfiguration: preStartStrategy.initConfiguration,
|
|
828
|
+
...startRumResult,
|
|
829
|
+
}
|
|
830
|
+
}
|