@kubesense/kubesense-browser-rum-core 1.8.0 → 2.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/cjs/boot/preStartRum.d.ts +4 -3
- package/cjs/boot/preStartRum.js +229 -204
- package/cjs/boot/preStartRum.js.map +1 -1
- package/cjs/boot/rumPublicApi.d.ts +190 -51
- package/cjs/boot/rumPublicApi.js +267 -164
- package/cjs/boot/rumPublicApi.js.map +1 -1
- package/cjs/boot/startRum.d.ts +42 -31
- package/cjs/boot/startRum.js +157 -150
- package/cjs/boot/startRum.js.map +1 -1
- package/cjs/browser/cookieObservable.d.ts +1 -5
- package/cjs/browser/cookieObservable.js +30 -34
- package/cjs/browser/cookieObservable.js.map +1 -1
- package/cjs/browser/domMutationObservable.d.ts +3 -3
- package/cjs/browser/domMutationObservable.js +29 -53
- package/cjs/browser/domMutationObservable.js.map +1 -1
- package/cjs/browser/htmlDomUtils.d.ts +5 -0
- package/cjs/browser/htmlDomUtils.js +38 -28
- package/cjs/browser/htmlDomUtils.js.map +1 -1
- package/cjs/browser/locationChangeObservable.d.ts +1 -2
- package/cjs/browser/locationChangeObservable.js +44 -45
- package/cjs/browser/locationChangeObservable.js.map +1 -1
- package/cjs/browser/performanceObservable.d.ts +4 -4
- package/cjs/browser/performanceObservable.js +50 -114
- package/cjs/browser/performanceObservable.js.map +1 -1
- package/cjs/browser/performanceUtils.d.ts +13 -1
- package/cjs/browser/performanceUtils.js +63 -37
- package/cjs/browser/performanceUtils.js.map +1 -1
- package/cjs/browser/scroll.js +17 -28
- package/cjs/browser/scroll.js.map +1 -1
- package/cjs/browser/viewportObservable.d.ts +2 -3
- package/cjs/browser/viewportObservable.js +29 -31
- package/cjs/browser/viewportObservable.js.map +1 -1
- package/cjs/browser/windowOpenObservable.js +11 -7
- package/cjs/browser/windowOpenObservable.js.map +1 -1
- package/cjs/domain/action/actionCollection.d.ts +11 -12
- package/cjs/domain/action/actionCollection.js +82 -89
- package/cjs/domain/action/actionCollection.js.map +1 -1
- package/cjs/domain/action/actionNameConstants.js +10 -9
- package/cjs/domain/action/actionNameConstants.js.map +1 -1
- package/cjs/domain/action/clickChain.js +51 -54
- package/cjs/domain/action/clickChain.js.map +1 -1
- package/cjs/domain/action/computeFrustration.js +30 -62
- package/cjs/domain/action/computeFrustration.js.map +1 -1
- package/cjs/domain/action/frustrationIgnore.d.ts +9 -0
- package/cjs/domain/action/frustrationIgnore.js +32 -0
- package/cjs/domain/action/frustrationIgnore.js.map +1 -0
- package/cjs/domain/action/getActionNameFromElement.js +141 -217
- package/cjs/domain/action/getActionNameFromElement.js.map +1 -1
- package/cjs/domain/action/interactionSelectorCache.d.ts +1 -1
- package/cjs/domain/action/interactionSelectorCache.js +17 -18
- package/cjs/domain/action/interactionSelectorCache.js.map +1 -1
- package/cjs/domain/action/isActionChildEvent.d.ts +2 -0
- package/cjs/domain/action/isActionChildEvent.js +8 -0
- package/cjs/domain/action/isActionChildEvent.js.map +1 -0
- package/cjs/domain/action/listenActionEvents.d.ts +2 -3
- package/cjs/domain/action/listenActionEvents.js +51 -55
- package/cjs/domain/action/listenActionEvents.js.map +1 -1
- package/cjs/domain/action/trackClickActions.d.ts +15 -21
- package/cjs/domain/action/trackClickActions.js +188 -226
- package/cjs/domain/action/trackClickActions.js.map +1 -1
- package/cjs/domain/action/trackManualActions.d.ts +45 -0
- package/cjs/domain/action/trackManualActions.js +48 -0
- package/cjs/domain/action/trackManualActions.js.map +1 -0
- package/cjs/domain/assembly.d.ts +1 -2
- package/cjs/domain/assembly.js +80 -95
- package/cjs/domain/assembly.js.map +1 -1
- package/cjs/domain/configuration/configuration.d.ts +575 -81
- package/cjs/domain/configuration/configuration.js +464 -199
- package/cjs/domain/configuration/configuration.js.map +1 -1
- package/cjs/domain/configuration/index.d.ts +1 -0
- package/cjs/domain/configuration/index.js +27 -21
- package/cjs/domain/configuration/jsonPathParser.js +125 -139
- package/cjs/domain/configuration/jsonPathParser.js.map +1 -1
- package/cjs/domain/configuration/remoteConfiguration.d.ts +18 -5
- package/cjs/domain/configuration/remoteConfiguration.js +268 -226
- package/cjs/domain/configuration/remoteConfiguration.js.map +1 -1
- package/cjs/domain/configuration/remoteConfiguration.types.d.ts +49 -0
- package/cjs/domain/configuration/remoteConfigurationCache.d.ts +42 -0
- package/cjs/domain/configuration/remoteConfigurationCache.js +95 -0
- package/cjs/domain/configuration/remoteConfigurationCache.js.map +1 -0
- package/cjs/domain/configuration/remoteSdkConfiguration.d.ts +11 -2
- package/cjs/domain/configuration/remoteSdkConfiguration.js +185 -117
- package/cjs/domain/configuration/remoteSdkConfiguration.js.map +1 -1
- package/cjs/domain/configuration/sessionReplayRoutes.d.ts +1 -6
- package/cjs/domain/configuration/sessionReplayRoutes.js +20 -63
- package/cjs/domain/configuration/sessionReplayRoutes.js.map +1 -1
- package/cjs/domain/contexts/ciVisibilityContext.d.ts +2 -4
- package/cjs/domain/contexts/ciVisibilityContext.js +36 -32
- package/cjs/domain/contexts/ciVisibilityContext.js.map +1 -1
- package/cjs/domain/contexts/connectivityContext.d.ts +2 -2
- package/cjs/domain/contexts/connectivityContext.js +10 -9
- package/cjs/domain/contexts/connectivityContext.js.map +1 -1
- package/cjs/domain/contexts/defaultContext.d.ts +3 -3
- package/cjs/domain/contexts/defaultContext.js +28 -32
- package/cjs/domain/contexts/defaultContext.js.map +1 -1
- package/cjs/domain/contexts/displayContext.d.ts +2 -3
- package/cjs/domain/contexts/displayContext.js +22 -26
- package/cjs/domain/contexts/displayContext.js.map +1 -1
- package/cjs/domain/contexts/featureFlagContext.d.ts +2 -2
- package/cjs/domain/contexts/featureFlagContext.js +38 -50
- package/cjs/domain/contexts/featureFlagContext.js.map +1 -1
- package/cjs/domain/contexts/internalContext.d.ts +2 -3
- package/cjs/domain/contexts/internalContext.js +26 -22
- package/cjs/domain/contexts/internalContext.js.map +1 -1
- package/cjs/domain/contexts/pageStateHistory.d.ts +3 -4
- package/cjs/domain/contexts/pageStateHistory.js +76 -96
- package/cjs/domain/contexts/pageStateHistory.js.map +1 -1
- package/cjs/domain/contexts/sessionContext.d.ts +9 -3
- package/cjs/domain/contexts/sessionContext.js +31 -45
- package/cjs/domain/contexts/sessionContext.js.map +1 -1
- package/cjs/domain/contexts/sourceCodeMfeContext.d.ts +10 -0
- package/cjs/domain/contexts/sourceCodeMfeContext.js +35 -0
- package/cjs/domain/contexts/sourceCodeMfeContext.js.map +1 -0
- package/cjs/domain/contexts/syntheticsContext.d.ts +2 -2
- package/cjs/domain/contexts/syntheticsContext.js +19 -23
- package/cjs/domain/contexts/syntheticsContext.js.map +1 -1
- package/cjs/domain/contexts/trackingConsentContext.d.ts +2 -2
- package/cjs/domain/contexts/trackingConsentContext.js +10 -12
- package/cjs/domain/contexts/trackingConsentContext.js.map +1 -1
- package/cjs/domain/contexts/urlContexts.d.ts +4 -3
- package/cjs/domain/contexts/urlContexts.js +65 -61
- package/cjs/domain/contexts/urlContexts.js.map +1 -1
- package/cjs/domain/contexts/userAgentDataContext.d.ts +2 -2
- package/cjs/domain/contexts/userAgentDataContext.js +20 -29
- package/cjs/domain/contexts/userAgentDataContext.js.map +1 -1
- package/cjs/domain/contexts/viewHistory.d.ts +5 -2
- package/cjs/domain/contexts/viewHistory.js +41 -45
- package/cjs/domain/contexts/viewHistory.js.map +1 -1
- package/cjs/domain/discardNegativeDuration.d.ts +1 -1
- package/cjs/domain/discardNegativeDuration.js +6 -5
- package/cjs/domain/discardNegativeDuration.js.map +1 -1
- package/cjs/domain/error/errorCollection.d.ts +3 -3
- package/cjs/domain/error/errorCollection.js +67 -68
- package/cjs/domain/error/errorCollection.js.map +1 -1
- package/cjs/domain/error/trackReportError.d.ts +1 -2
- package/cjs/domain/error/trackReportError.js +10 -14
- package/cjs/domain/error/trackReportError.js.map +1 -1
- package/cjs/domain/event/eventCollection.d.ts +2 -1
- package/cjs/domain/event/eventCollection.js +21 -22
- package/cjs/domain/event/eventCollection.js.map +1 -1
- package/cjs/domain/eventTracker.d.ts +37 -0
- package/cjs/domain/eventTracker.js +94 -0
- package/cjs/domain/eventTracker.js.map +1 -0
- package/cjs/domain/extractRegexMatch.d.ts +5 -0
- package/cjs/domain/extractRegexMatch.js +16 -0
- package/cjs/domain/extractRegexMatch.js.map +1 -0
- package/cjs/domain/getComposedPathSelector.d.ts +22 -0
- package/cjs/domain/getComposedPathSelector.js +95 -0
- package/cjs/domain/getComposedPathSelector.js.map +1 -0
- package/cjs/domain/getSelectorFromElement.d.ts +18 -6
- package/cjs/domain/getSelectorFromElement.js +199 -191
- package/cjs/domain/getSelectorFromElement.js.map +1 -1
- package/cjs/domain/getSessionReplayUrl.d.ts +2 -2
- package/cjs/domain/getSessionReplayUrl.js +17 -30
- package/cjs/domain/getSessionReplayUrl.js.map +1 -1
- package/cjs/domain/hooks.d.ts +26 -17
- package/cjs/domain/hooks.js +12 -5
- package/cjs/domain/hooks.js.map +1 -1
- package/cjs/domain/lifeCycle.d.ts +26 -12
- package/cjs/domain/lifeCycle.js +28 -5
- package/cjs/domain/lifeCycle.js.map +1 -1
- package/cjs/domain/limitModification.d.ts +5 -1
- package/cjs/domain/limitModification.js +32 -36
- package/cjs/domain/limitModification.js.map +1 -1
- package/cjs/domain/longTask/longTaskCollection.d.ts +0 -13
- package/cjs/domain/longTask/longTaskCollection.js +75 -87
- package/cjs/domain/longTask/longTaskCollection.js.map +1 -1
- package/cjs/domain/plugins.d.ts +37 -14
- package/cjs/domain/plugins.js +22 -13
- package/cjs/domain/plugins.js.map +1 -1
- package/cjs/domain/privacy.d.ts +6 -1
- package/cjs/domain/privacy.js +143 -286
- package/cjs/domain/privacy.js.map +1 -1
- package/cjs/domain/privacyConstants.js +43 -34
- package/cjs/domain/privacyConstants.js.map +1 -1
- package/cjs/domain/requestCollection.d.ts +6 -5
- package/cjs/domain/requestCollection.js +82 -105
- package/cjs/domain/requestCollection.js.map +1 -1
- package/cjs/domain/resource/graphql.d.ts +1 -1
- package/cjs/domain/resource/graphql.js +85 -86
- package/cjs/domain/resource/graphql.js.map +1 -1
- package/cjs/domain/resource/requestRegistry.js +30 -38
- package/cjs/domain/resource/requestRegistry.js.map +1 -1
- package/cjs/domain/resource/resourceCollection.d.ts +5 -3
- package/cjs/domain/resource/resourceCollection.js +241 -175
- package/cjs/domain/resource/resourceCollection.js.map +1 -1
- package/cjs/domain/resource/resourceUtils.d.ts +13 -13
- package/cjs/domain/resource/resourceUtils.js +323 -221
- package/cjs/domain/resource/resourceUtils.js.map +1 -1
- package/cjs/domain/resource/trackManualResources.d.ts +55 -0
- package/cjs/domain/resource/trackManualResources.js +53 -0
- package/cjs/domain/resource/trackManualResources.js.map +1 -0
- package/cjs/domain/resource/webSocketCollection.d.ts +46 -0
- package/cjs/domain/resource/webSocketCollection.js +163 -0
- package/cjs/domain/resource/webSocketCollection.js.map +1 -0
- package/cjs/domain/session/session.types.d.ts +4 -0
- package/cjs/domain/sessionReplayState.d.ts +8 -0
- package/cjs/domain/sessionReplayState.js +19 -0
- package/cjs/domain/sessionReplayState.js.map +1 -0
- package/cjs/domain/startCustomerDataTelemetry.js +39 -43
- package/cjs/domain/startCustomerDataTelemetry.js.map +1 -1
- package/cjs/domain/tracing/getDocumentTraceId.d.ts +1 -1
- package/cjs/domain/tracing/getDocumentTraceId.js +42 -63
- package/cjs/domain/tracing/getDocumentTraceId.js.map +1 -1
- package/cjs/domain/tracing/identifier.js +13 -46
- package/cjs/domain/tracing/identifier.js.map +1 -1
- package/cjs/domain/tracing/tracer.d.ts +2 -5
- package/cjs/domain/tracing/tracer.js +110 -150
- package/cjs/domain/tracing/tracer.js.map +1 -1
- package/cjs/domain/trackEventCounts.js +43 -48
- package/cjs/domain/trackEventCounts.js.map +1 -1
- package/cjs/domain/view/bfCacheSupport.d.ts +1 -2
- package/cjs/domain/view/bfCacheSupport.js +10 -11
- package/cjs/domain/view/bfCacheSupport.js.map +1 -1
- package/cjs/domain/view/trackViewEventCounts.js +14 -13
- package/cjs/domain/view/trackViewEventCounts.js.map +1 -1
- package/cjs/domain/view/trackViews.d.ts +8 -2
- package/cjs/domain/view/trackViews.js +221 -270
- package/cjs/domain/view/trackViews.js.map +1 -1
- package/cjs/domain/view/viewCollection.d.ts +4 -3
- package/cjs/domain/view/viewCollection.js +124 -148
- package/cjs/domain/view/viewCollection.js.map +1 -1
- package/cjs/domain/view/viewDiff.d.ts +22 -0
- package/cjs/domain/view/viewDiff.js +62 -0
- package/cjs/domain/view/viewDiff.js.map +1 -0
- package/cjs/domain/view/viewMetrics/getClsAttributionImpactedArea.js +20 -22
- package/cjs/domain/view/viewMetrics/getClsAttributionImpactedArea.js.map +1 -1
- package/cjs/domain/view/viewMetrics/interactionCountPolyfill.d.ts +1 -0
- package/cjs/domain/view/viewMetrics/interactionCountPolyfill.js +35 -33
- package/cjs/domain/view/viewMetrics/interactionCountPolyfill.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackBfcacheMetrics.d.ts +1 -1
- package/cjs/domain/view/viewMetrics/trackBfcacheMetrics.js +14 -13
- package/cjs/domain/view/viewMetrics/trackBfcacheMetrics.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackCommonViewMetrics.d.ts +4 -2
- package/cjs/domain/view/viewMetrics/trackCommonViewMetrics.js +51 -34
- package/cjs/domain/view/viewMetrics/trackCommonViewMetrics.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackCumulativeLayoutShift.d.ts +1 -1
- package/cjs/domain/view/viewMetrics/trackCumulativeLayoutShift.js +106 -122
- package/cjs/domain/view/viewMetrics/trackCumulativeLayoutShift.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackFirstContentfulPaint.d.ts +2 -3
- package/cjs/domain/view/viewMetrics/trackFirstContentfulPaint.js +26 -34
- package/cjs/domain/view/viewMetrics/trackFirstContentfulPaint.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackFirstHidden.d.ts +2 -3
- package/cjs/domain/view/viewMetrics/trackFirstHidden.js +31 -31
- package/cjs/domain/view/viewMetrics/trackFirstHidden.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackInitialViewMetrics.d.ts +1 -3
- package/cjs/domain/view/viewMetrics/trackInitialViewMetrics.js +33 -38
- package/cjs/domain/view/viewMetrics/trackInitialViewMetrics.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackInteractionToNextPaint.d.ts +10 -1
- package/cjs/domain/view/viewMetrics/trackInteractionToNextPaint.js +202 -144
- package/cjs/domain/view/viewMetrics/trackInteractionToNextPaint.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackLargestContentfulPaint.d.ts +6 -1
- package/cjs/domain/view/viewMetrics/trackLargestContentfulPaint.js +65 -55
- package/cjs/domain/view/viewMetrics/trackLargestContentfulPaint.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackLoadingTime.d.ts +2 -1
- package/cjs/domain/view/viewMetrics/trackLoadingTime.js +42 -46
- package/cjs/domain/view/viewMetrics/trackLoadingTime.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackNavigationTimings.d.ts +2 -3
- package/cjs/domain/view/viewMetrics/trackNavigationTimings.js +28 -36
- package/cjs/domain/view/viewMetrics/trackNavigationTimings.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackScrollMetrics.d.ts +3 -4
- package/cjs/domain/view/viewMetrics/trackScrollMetrics.js +63 -72
- package/cjs/domain/view/viewMetrics/trackScrollMetrics.js.map +1 -1
- package/cjs/domain/vital/vitalCollection.d.ts +44 -20
- package/cjs/domain/vital/vitalCollection.js +81 -109
- package/cjs/domain/vital/vitalCollection.js.map +1 -1
- package/cjs/domain/waitPageActivityEnd.d.ts +1 -4
- package/cjs/domain/waitPageActivityEnd.js +99 -119
- package/cjs/domain/waitPageActivityEnd.js.map +1 -1
- package/cjs/domainContext.types.d.ts +21 -13
- package/cjs/index.d.ts +11 -10
- package/cjs/index.js +84 -62
- package/cjs/rawRumEvent.types.d.ts +79 -13
- package/cjs/rawRumEvent.types.js +40 -27
- package/cjs/rawRumEvent.types.js.map +1 -1
- package/cjs/rumEvent.types.d.ts +906 -669
- package/cjs/transport/formDataTransport.js +43 -41
- package/cjs/transport/formDataTransport.js.map +1 -1
- package/cjs/transport/startRumBatch.d.ts +27 -3
- package/cjs/transport/startRumBatch.js +132 -31
- package/cjs/transport/startRumBatch.js.map +1 -1
- package/cjs/transport/startRumEventBridge.js +10 -8
- package/cjs/transport/startRumEventBridge.js.map +1 -1
- package/esm/boot/preStartRum.mjs +233 -0
- package/esm/boot/preStartRum.mjs.map +1 -0
- package/esm/boot/rumPublicApi.mjs +271 -0
- package/esm/boot/rumPublicApi.mjs.map +1 -0
- package/esm/boot/startRum.mjs +159 -0
- package/esm/boot/startRum.mjs.map +1 -0
- package/esm/browser/cookieObservable.mjs +34 -0
- package/esm/browser/cookieObservable.mjs.map +1 -0
- package/esm/browser/domMutationObservable.mjs +33 -0
- package/esm/browser/domMutationObservable.mjs.map +1 -0
- package/esm/browser/htmlDomUtils.mjs +48 -0
- package/esm/browser/htmlDomUtils.mjs.map +1 -0
- package/esm/browser/locationChangeObservable.mjs +50 -0
- package/esm/browser/locationChangeObservable.mjs.map +1 -0
- package/esm/browser/performanceObservable.mjs +60 -0
- package/esm/browser/performanceObservable.mjs.map +1 -0
- package/esm/browser/performanceUtils.mjs +64 -0
- package/esm/browser/performanceUtils.mjs.map +1 -0
- package/esm/browser/scroll.mjs +21 -0
- package/esm/browser/scroll.mjs.map +1 -0
- package/esm/browser/viewportObservable.mjs +33 -0
- package/esm/browser/viewportObservable.mjs.map +1 -0
- package/esm/browser/windowOpenObservable.mjs +14 -0
- package/esm/browser/windowOpenObservable.mjs.map +1 -0
- package/esm/domain/action/actionCollection.mjs +89 -0
- package/esm/domain/action/actionCollection.mjs.map +1 -0
- package/esm/domain/action/actionNameConstants.mjs +11 -0
- package/esm/domain/action/actionNameConstants.mjs.map +1 -0
- package/esm/domain/action/clickChain.mjs +57 -0
- package/esm/domain/action/clickChain.mjs.map +1 -0
- package/esm/domain/action/computeFrustration.mjs +36 -0
- package/esm/domain/action/computeFrustration.mjs.map +1 -0
- package/esm/domain/action/frustrationIgnore.mjs +31 -0
- package/esm/domain/action/frustrationIgnore.mjs.map +1 -0
- package/esm/domain/action/getActionNameFromElement.mjs +163 -0
- package/esm/domain/action/getActionNameFromElement.mjs.map +1 -0
- package/esm/domain/action/interactionSelectorCache.mjs +19 -0
- package/esm/domain/action/interactionSelectorCache.mjs.map +1 -0
- package/esm/domain/action/isActionChildEvent.mjs +8 -0
- package/esm/domain/action/isActionChildEvent.mjs.map +1 -0
- package/esm/domain/action/listenActionEvents.mjs +57 -0
- package/esm/domain/action/listenActionEvents.mjs.map +1 -0
- package/esm/domain/action/trackClickActions.mjs +198 -0
- package/esm/domain/action/trackClickActions.mjs.map +1 -0
- package/esm/domain/action/trackManualActions.mjs +48 -0
- package/esm/domain/action/trackManualActions.mjs.map +1 -0
- package/esm/domain/assembly.mjs +87 -0
- package/esm/domain/assembly.mjs.map +1 -0
- package/esm/domain/configuration/configuration.mjs +474 -0
- package/esm/domain/configuration/configuration.mjs.map +1 -0
- package/esm/domain/configuration/index.mjs +6 -0
- package/esm/domain/configuration/jsonPathParser.mjs +145 -0
- package/esm/domain/configuration/jsonPathParser.mjs.map +1 -0
- package/esm/domain/configuration/remoteConfiguration.mjs +279 -0
- package/esm/domain/configuration/remoteConfiguration.mjs.map +1 -0
- package/esm/domain/configuration/remoteConfigurationCache.mjs +92 -0
- package/esm/domain/configuration/remoteConfigurationCache.mjs.map +1 -0
- package/esm/domain/configuration/remoteSdkConfiguration.mjs +208 -0
- package/esm/domain/configuration/remoteSdkConfiguration.mjs.map +1 -0
- package/esm/domain/configuration/sessionReplayRoutes.mjs +26 -0
- package/esm/domain/configuration/sessionReplayRoutes.mjs.map +1 -0
- package/esm/domain/contexts/ciVisibilityContext.mjs +37 -0
- package/esm/domain/contexts/ciVisibilityContext.mjs.map +1 -0
- package/esm/domain/contexts/connectivityContext.mjs +12 -0
- package/esm/domain/contexts/connectivityContext.mjs.map +1 -0
- package/esm/domain/contexts/defaultContext.mjs +30 -0
- package/esm/domain/contexts/defaultContext.mjs.map +1 -0
- package/esm/domain/contexts/displayContext.mjs +24 -0
- package/esm/domain/contexts/displayContext.mjs.map +1 -0
- package/esm/domain/contexts/featureFlagContext.mjs +40 -0
- package/esm/domain/contexts/featureFlagContext.mjs.map +1 -0
- package/esm/domain/contexts/internalContext.mjs +30 -0
- package/esm/domain/contexts/internalContext.mjs.map +1 -0
- package/esm/domain/contexts/pageStateHistory.mjs +82 -0
- package/esm/domain/contexts/pageStateHistory.mjs.map +1 -0
- package/esm/domain/contexts/sessionContext.mjs +33 -0
- package/esm/domain/contexts/sessionContext.mjs.map +1 -0
- package/esm/domain/contexts/sourceCodeMfeContext.mjs +35 -0
- package/esm/domain/contexts/sourceCodeMfeContext.mjs.map +1 -0
- package/esm/domain/contexts/syntheticsContext.mjs +21 -0
- package/esm/domain/contexts/syntheticsContext.mjs.map +1 -0
- package/esm/domain/contexts/trackingConsentContext.mjs +12 -0
- package/esm/domain/contexts/trackingConsentContext.mjs.map +1 -0
- package/esm/domain/contexts/urlContexts.mjs +67 -0
- package/esm/domain/contexts/urlContexts.mjs.map +1 -0
- package/esm/domain/contexts/userAgentDataContext.mjs +22 -0
- package/esm/domain/contexts/userAgentDataContext.mjs.map +1 -0
- package/esm/domain/contexts/viewHistory.mjs +43 -0
- package/esm/domain/contexts/viewHistory.mjs.map +1 -0
- package/esm/domain/discardNegativeDuration.mjs +9 -0
- package/esm/domain/discardNegativeDuration.mjs.map +1 -0
- package/esm/domain/error/errorCollection.mjs +72 -0
- package/esm/domain/error/errorCollection.mjs.map +1 -0
- package/esm/domain/error/trackReportError.mjs +12 -0
- package/esm/domain/error/trackReportError.mjs.map +1 -0
- package/esm/domain/event/eventCollection.mjs +26 -0
- package/esm/domain/event/eventCollection.mjs.map +1 -0
- package/esm/domain/eventTracker.mjs +93 -0
- package/esm/domain/eventTracker.mjs.map +1 -0
- package/esm/domain/extractRegexMatch.mjs +16 -0
- package/esm/domain/extractRegexMatch.mjs.map +1 -0
- package/esm/domain/getComposedPathSelector.mjs +93 -0
- package/esm/domain/getComposedPathSelector.mjs.map +1 -0
- package/esm/domain/getSelectorFromElement.mjs +218 -0
- package/esm/domain/getSelectorFromElement.mjs.map +1 -0
- package/esm/domain/getSessionReplayUrl.mjs +20 -0
- package/esm/domain/getSessionReplayUrl.mjs.map +1 -0
- package/esm/domain/hooks.mjs +13 -0
- package/esm/domain/hooks.mjs.map +1 -0
- package/esm/domain/lifeCycle.mjs +28 -0
- package/esm/domain/lifeCycle.mjs.map +1 -0
- package/esm/domain/limitModification.mjs +42 -0
- package/esm/domain/limitModification.mjs.map +1 -0
- package/esm/domain/longTask/longTaskCollection.mjs +79 -0
- package/esm/domain/longTask/longTaskCollection.mjs.map +1 -0
- package/esm/domain/plugins.mjs +23 -0
- package/esm/domain/plugins.mjs.map +1 -0
- package/esm/domain/privacy.mjs +161 -0
- package/esm/domain/privacy.mjs.map +1 -0
- package/esm/domain/privacyConstants.mjs +36 -0
- package/esm/domain/privacyConstants.mjs.map +1 -0
- package/esm/domain/requestCollection.mjs +86 -0
- package/esm/domain/requestCollection.mjs.map +1 -0
- package/esm/domain/resource/graphql.mjs +93 -0
- package/esm/domain/resource/graphql.mjs.map +1 -0
- package/esm/domain/resource/requestRegistry.mjs +32 -0
- package/esm/domain/resource/requestRegistry.mjs.map +1 -0
- package/esm/domain/resource/resourceCollection.mjs +256 -0
- package/esm/domain/resource/resourceCollection.mjs.map +1 -0
- package/esm/domain/resource/resourceUtils.mjs +349 -0
- package/esm/domain/resource/resourceUtils.mjs.map +1 -0
- package/esm/domain/resource/trackManualResources.mjs +53 -0
- package/esm/domain/resource/trackManualResources.mjs.map +1 -0
- package/esm/domain/resource/webSocketCollection.mjs +160 -0
- package/esm/domain/resource/webSocketCollection.mjs.map +1 -0
- package/esm/domain/sessionReplayState.mjs +18 -0
- package/esm/domain/sessionReplayState.mjs.map +1 -0
- package/esm/domain/startCustomerDataTelemetry.mjs +51 -0
- package/esm/domain/startCustomerDataTelemetry.mjs.map +1 -0
- package/esm/domain/tracing/getDocumentTraceId.mjs +50 -0
- package/esm/domain/tracing/getDocumentTraceId.mjs.map +1 -0
- package/esm/domain/tracing/identifier.mjs +20 -0
- package/esm/domain/tracing/identifier.mjs.map +1 -0
- package/esm/domain/tracing/tracer.mjs +120 -0
- package/esm/domain/tracing/tracer.mjs.map +1 -0
- package/esm/domain/trackEventCounts.mjs +45 -0
- package/esm/domain/trackEventCounts.mjs.map +1 -0
- package/esm/domain/view/bfCacheSupport.mjs +12 -0
- package/esm/domain/view/bfCacheSupport.mjs.map +1 -0
- package/esm/domain/view/trackViewEventCounts.mjs +17 -0
- package/esm/domain/view/trackViewEventCounts.mjs.map +1 -0
- package/esm/domain/view/trackViews.mjs +230 -0
- package/esm/domain/view/trackViews.mjs.map +1 -0
- package/esm/domain/view/viewCollection.mjs +129 -0
- package/esm/domain/view/viewCollection.mjs.map +1 -0
- package/esm/domain/view/viewDiff.mjs +61 -0
- package/esm/domain/view/viewDiff.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/getClsAttributionImpactedArea.mjs +30 -0
- package/esm/domain/view/viewMetrics/getClsAttributionImpactedArea.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/interactionCountPolyfill.mjs +45 -0
- package/esm/domain/view/viewMetrics/interactionCountPolyfill.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackBfcacheMetrics.mjs +18 -0
- package/esm/domain/view/viewMetrics/trackBfcacheMetrics.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackCommonViewMetrics.mjs +54 -0
- package/esm/domain/view/viewMetrics/trackCommonViewMetrics.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackCumulativeLayoutShift.mjs +117 -0
- package/esm/domain/view/viewMetrics/trackCumulativeLayoutShift.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackFirstContentfulPaint.mjs +29 -0
- package/esm/domain/view/viewMetrics/trackFirstContentfulPaint.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackFirstHidden.mjs +33 -0
- package/esm/domain/view/viewMetrics/trackFirstHidden.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackInitialViewMetrics.mjs +36 -0
- package/esm/domain/view/viewMetrics/trackInitialViewMetrics.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackInteractionToNextPaint.mjs +210 -0
- package/esm/domain/view/viewMetrics/trackInteractionToNextPaint.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackLargestContentfulPaint.mjs +70 -0
- package/esm/domain/view/viewMetrics/trackLargestContentfulPaint.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackLoadingTime.mjs +46 -0
- package/esm/domain/view/viewMetrics/trackLoadingTime.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackNavigationTimings.mjs +35 -0
- package/esm/domain/view/viewMetrics/trackNavigationTimings.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackScrollMetrics.mjs +66 -0
- package/esm/domain/view/viewMetrics/trackScrollMetrics.mjs.map +1 -0
- package/esm/domain/vital/vitalCollection.mjs +85 -0
- package/esm/domain/vital/vitalCollection.mjs.map +1 -0
- package/esm/domain/waitPageActivityEnd.mjs +107 -0
- package/esm/domain/waitPageActivityEnd.mjs.map +1 -0
- package/esm/index.mjs +23 -0
- package/esm/rawRumEvent.types.mjs +42 -0
- package/esm/rawRumEvent.types.mjs.map +1 -0
- package/esm/transport/formDataTransport.mjs +48 -0
- package/esm/transport/formDataTransport.mjs.map +1 -0
- package/esm/transport/startRumBatch.mjs +132 -0
- package/esm/transport/startRumBatch.mjs.map +1 -0
- package/esm/transport/startRumEventBridge.mjs +13 -0
- package/esm/transport/startRumEventBridge.mjs.map +1 -0
- package/package.json +19 -11
- package/src/boot/preStartRum.ts +216 -88
- package/src/boot/rumPublicApi.ts +358 -119
- package/src/boot/startRum.ts +88 -84
- package/src/browser/cookieObservable.ts +19 -28
- package/src/browser/domMutationObservable.ts +7 -12
- package/src/browser/htmlDomUtils.ts +15 -0
- package/src/browser/locationChangeObservable.ts +23 -12
- package/src/browser/performanceObservable.ts +23 -73
- package/src/browser/performanceUtils.ts +52 -4
- package/src/browser/viewportObservable.ts +4 -6
- package/src/domain/action/actionCollection.ts +94 -87
- package/src/domain/action/clickChain.ts +11 -10
- package/src/domain/action/computeFrustration.ts +19 -5
- package/src/domain/action/frustrationIgnore.ts +54 -0
- package/src/domain/action/getActionNameFromElement.ts +27 -61
- package/src/domain/action/interactionSelectorCache.ts +2 -2
- package/src/domain/action/isActionChildEvent.ts +6 -0
- package/src/domain/action/listenActionEvents.ts +2 -11
- package/src/domain/action/trackClickActions.ts +92 -82
- package/src/domain/action/trackManualActions.ts +104 -0
- package/src/domain/assembly.ts +57 -70
- package/src/domain/configuration/configuration.ts +587 -208
- package/src/domain/configuration/index.ts +1 -0
- package/src/domain/configuration/remoteConfiguration.ts +152 -29
- package/src/domain/configuration/remoteConfiguration.types.ts +51 -1
- package/src/domain/configuration/remoteConfigurationCache.ts +153 -0
- package/src/domain/configuration/remoteSdkConfiguration.ts +131 -13
- package/src/domain/configuration/sessionReplayRoutes.ts +2 -47
- package/src/domain/contexts/ciVisibilityContext.ts +23 -12
- package/src/domain/contexts/connectivityContext.ts +7 -10
- package/src/domain/contexts/defaultContext.ts +11 -14
- package/src/domain/contexts/displayContext.ts +8 -12
- package/src/domain/contexts/featureFlagContext.ts +5 -4
- package/src/domain/contexts/internalContext.ts +3 -3
- package/src/domain/contexts/pageStateHistory.ts +20 -31
- package/src/domain/contexts/sessionContext.ts +16 -22
- package/src/domain/contexts/sourceCodeMfeContext.ts +53 -0
- package/src/domain/contexts/syntheticsContext.ts +7 -17
- package/src/domain/contexts/trackingConsentContext.ts +7 -4
- package/src/domain/contexts/urlContexts.ts +13 -9
- package/src/domain/contexts/userAgentDataContext.ts +12 -13
- package/src/domain/contexts/viewHistory.ts +4 -3
- package/src/domain/discardNegativeDuration.ts +1 -1
- package/src/domain/error/errorCollection.ts +12 -22
- package/src/domain/error/trackReportError.ts +4 -7
- package/src/domain/event/eventCollection.ts +4 -2
- package/src/domain/eventTracker.ts +169 -0
- package/src/domain/extractRegexMatch.ts +15 -0
- package/src/domain/getComposedPathSelector.ts +130 -0
- package/src/domain/getSelectorFromElement.ts +125 -31
- package/src/domain/getSessionReplayUrl.ts +4 -13
- package/src/domain/hooks.ts +34 -21
- package/src/domain/lifeCycle.ts +21 -8
- package/src/domain/limitModification.ts +20 -4
- package/src/domain/longTask/longTaskCollection.ts +18 -47
- package/src/domain/plugins.ts +54 -25
- package/src/domain/privacy.ts +16 -24
- package/src/domain/requestCollection.ts +108 -97
- package/src/domain/resource/graphql.ts +71 -25
- package/src/domain/resource/requestRegistry.ts +1 -3
- package/src/domain/resource/resourceCollection.ts +319 -137
- package/src/domain/resource/resourceUtils.ts +24 -26
- package/src/domain/resource/trackManualResources.ts +121 -0
- package/src/domain/resource/webSocketCollection.ts +281 -0
- package/src/domain/session/session.types.ts +5 -0
- package/src/domain/sessionReplayState.ts +36 -0
- package/src/domain/startCustomerDataTelemetry.ts +2 -2
- package/src/domain/tracing/getDocumentTraceId.ts +5 -4
- package/src/domain/tracing/identifier.ts +6 -37
- package/src/domain/tracing/tracer.ts +22 -21
- package/src/domain/tracing/tracer.types.ts +3 -3
- package/src/domain/view/bfCacheSupport.ts +1 -6
- package/src/domain/view/trackViews.ts +40 -37
- package/src/domain/view/viewCollection.ts +29 -23
- package/src/domain/view/viewDiff.ts +115 -0
- package/src/domain/view/viewMetrics/interactionCountPolyfill.ts +13 -2
- package/src/domain/view/viewMetrics/trackBfcacheMetrics.ts +1 -1
- package/src/domain/view/viewMetrics/trackCommonViewMetrics.ts +27 -6
- package/src/domain/view/viewMetrics/trackCumulativeLayoutShift.ts +5 -3
- package/src/domain/view/viewMetrics/trackFirstContentfulPaint.ts +4 -9
- package/src/domain/view/viewMetrics/trackFirstHidden.ts +2 -8
- package/src/domain/view/viewMetrics/trackInitialViewMetrics.ts +4 -13
- package/src/domain/view/viewMetrics/trackInteractionToNextPaint.ts +180 -35
- package/src/domain/view/viewMetrics/trackLargestContentfulPaint.ts +47 -6
- package/src/domain/view/viewMetrics/trackLoadingTime.ts +4 -3
- package/src/domain/view/viewMetrics/trackNavigationTimings.ts +10 -18
- package/src/domain/view/viewMetrics/trackScrollMetrics.ts +23 -37
- package/src/domain/vital/vitalCollection.ts +83 -102
- package/src/domain/waitPageActivityEnd.ts +7 -11
- package/src/domainContext.types.ts +23 -15
- package/src/index.ts +17 -11
- package/src/rawRumEvent.types.ts +80 -26
- package/src/rumEvent.types.ts +730 -505
- package/src/transport/formDataTransport.ts +16 -6
- package/src/transport/startRumBatch.ts +181 -24
- package/cjs/browser/firstInputPolyfill.d.ts +0 -8
- package/cjs/browser/firstInputPolyfill.js +0 -68
- package/cjs/browser/firstInputPolyfill.js.map +0 -1
- package/cjs/domain/configuration/index.js.map +0 -1
- package/cjs/domain/configuration/remoteConfiguration.types.js +0 -7
- package/cjs/domain/configuration/remoteConfiguration.types.js.map +0 -1
- package/cjs/domain/error/trackConsoleError.d.ts +0 -4
- package/cjs/domain/error/trackConsoleError.js +0 -13
- package/cjs/domain/error/trackConsoleError.js.map +0 -1
- package/cjs/domain/resource/matchRequestResourceEntry.d.ts +0 -16
- package/cjs/domain/resource/matchRequestResourceEntry.js +0 -49
- package/cjs/domain/resource/matchRequestResourceEntry.js.map +0 -1
- package/cjs/domain/resource/retrieveInitialDocumentResourceTiming.d.ts +0 -4
- package/cjs/domain/resource/retrieveInitialDocumentResourceTiming.js +0 -24
- package/cjs/domain/resource/retrieveInitialDocumentResourceTiming.js.map +0 -1
- package/cjs/domain/rumSessionManager.d.ts +0 -36
- package/cjs/domain/rumSessionManager.js +0 -77
- package/cjs/domain/rumSessionManager.js.map +0 -1
- package/cjs/domain/sampler/sampler.d.ts +0 -10
- package/cjs/domain/sampler/sampler.js +0 -63
- package/cjs/domain/sampler/sampler.js.map +0 -1
- package/cjs/domain/tracing/sampler.d.ts +0 -10
- package/cjs/domain/tracing/sampler.js +0 -69
- package/cjs/domain/tracing/sampler.js.map +0 -1
- package/cjs/domain/tracing/tracer.types.js +0 -3
- package/cjs/domain/tracing/tracer.types.js.map +0 -1
- package/cjs/domain/view/viewMetrics/startInitialViewMetricsTelemetry.d.ts +0 -6
- package/cjs/domain/view/viewMetrics/startInitialViewMetricsTelemetry.js +0 -44
- package/cjs/domain/view/viewMetrics/startInitialViewMetricsTelemetry.js.map +0 -1
- package/cjs/domain/view/viewMetrics/trackFirstInput.d.ts +0 -19
- package/cjs/domain/view/viewMetrics/trackFirstInput.js +0 -43
- package/cjs/domain/view/viewMetrics/trackFirstInput.js.map +0 -1
- package/cjs/domainContext.types.js +0 -6
- package/cjs/domainContext.types.js.map +0 -1
- package/cjs/index.js.map +0 -1
- package/cjs/rumEvent.types.js +0 -7
- package/cjs/rumEvent.types.js.map +0 -1
- package/esm/boot/preStartRum.d.ts +0 -7
- package/esm/boot/preStartRum.js +0 -205
- package/esm/boot/preStartRum.js.map +0 -1
- package/esm/boot/rumPublicApi.d.ts +0 -409
- package/esm/boot/rumPublicApi.js +0 -165
- package/esm/boot/rumPublicApi.js.map +0 -1
- package/esm/boot/startRum.d.ts +0 -109
- package/esm/boot/startRum.js +0 -149
- package/esm/boot/startRum.js.map +0 -1
- package/esm/browser/cookieObservable.d.ts +0 -8
- package/esm/browser/cookieObservable.js +0 -35
- package/esm/browser/cookieObservable.js.map +0 -1
- package/esm/browser/domMutationObservable.d.ts +0 -27
- package/esm/browser/domMutationObservable.js +0 -54
- package/esm/browser/domMutationObservable.js.map +0 -1
- package/esm/browser/firstInputPolyfill.d.ts +0 -8
- package/esm/browser/firstInputPolyfill.js +0 -65
- package/esm/browser/firstInputPolyfill.js.map +0 -1
- package/esm/browser/htmlDomUtils.d.ts +0 -13
- package/esm/browser/htmlDomUtils.js +0 -36
- package/esm/browser/htmlDomUtils.js.map +0 -1
- package/esm/browser/locationChangeObservable.d.ts +0 -7
- package/esm/browser/locationChangeObservable.js +0 -48
- package/esm/browser/locationChangeObservable.js.map +0 -1
- package/esm/browser/performanceObservable.d.ts +0 -174
- package/esm/browser/performanceObservable.js +0 -121
- package/esm/browser/performanceObservable.js.map +0 -1
- package/esm/browser/performanceUtils.d.ts +0 -7
- package/esm/browser/performanceUtils.js +0 -38
- package/esm/browser/performanceUtils.js.map +0 -1
- package/esm/browser/scroll.d.ts +0 -2
- package/esm/browser/scroll.js +0 -29
- package/esm/browser/scroll.js.map +0 -1
- package/esm/browser/viewportObservable.d.ts +0 -10
- package/esm/browser/viewportObservable.js +0 -32
- package/esm/browser/viewportObservable.js.map +0 -1
- package/esm/browser/windowOpenObservable.d.ts +0 -5
- package/esm/browser/windowOpenObservable.js +0 -7
- package/esm/browser/windowOpenObservable.js.map +0 -1
- package/esm/domain/action/actionCollection.d.ts +0 -21
- package/esm/domain/action/actionCollection.js +0 -93
- package/esm/domain/action/actionCollection.js.map +0 -1
- package/esm/domain/action/actionNameConstants.d.ts +0 -18
- package/esm/domain/action/actionNameConstants.js +0 -8
- package/esm/domain/action/actionNameConstants.js.map +0 -1
- package/esm/domain/action/clickChain.d.ts +0 -8
- package/esm/domain/action/clickChain.js +0 -57
- package/esm/domain/action/clickChain.js.map +0 -1
- package/esm/domain/action/computeFrustration.d.ts +0 -6
- package/esm/domain/action/computeFrustration.js +0 -65
- package/esm/domain/action/computeFrustration.js.map +0 -1
- package/esm/domain/action/getActionNameFromElement.d.ts +0 -4
- package/esm/domain/action/getActionNameFromElement.js +0 -236
- package/esm/domain/action/getActionNameFromElement.js.map +0 -1
- package/esm/domain/action/interactionSelectorCache.d.ts +0 -5
- package/esm/domain/action/interactionSelectorCache.js +0 -18
- package/esm/domain/action/interactionSelectorCache.js.map +0 -1
- package/esm/domain/action/listenActionEvents.d.ts +0 -19
- package/esm/domain/action/listenActionEvents.js +0 -58
- package/esm/domain/action/listenActionEvents.js.map +0 -1
- package/esm/domain/action/trackClickActions.d.ts +0 -81
- package/esm/domain/action/trackClickActions.js +0 -232
- package/esm/domain/action/trackClickActions.js.map +0 -1
- package/esm/domain/assembly.d.ts +0 -5
- package/esm/domain/assembly.js +0 -99
- package/esm/domain/assembly.js.map +0 -1
- package/esm/domain/configuration/configuration.d.ts +0 -358
- package/esm/domain/configuration/configuration.js +0 -209
- package/esm/domain/configuration/configuration.js.map +0 -1
- package/esm/domain/configuration/index.d.ts +0 -4
- package/esm/domain/configuration/index.js +0 -5
- package/esm/domain/configuration/index.js.map +0 -1
- package/esm/domain/configuration/jsonPathParser.d.ts +0 -28
- package/esm/domain/configuration/jsonPathParser.js +0 -156
- package/esm/domain/configuration/jsonPathParser.js.map +0 -1
- package/esm/domain/configuration/remoteConfiguration.d.ts +0 -39
- package/esm/domain/configuration/remoteConfiguration.js +0 -236
- package/esm/domain/configuration/remoteConfiguration.js.map +0 -1
- package/esm/domain/configuration/remoteConfiguration.types.d.ts +0 -138
- package/esm/domain/configuration/remoteConfiguration.types.js +0 -6
- package/esm/domain/configuration/remoteConfiguration.types.js.map +0 -1
- package/esm/domain/configuration/remoteSdkConfiguration.d.ts +0 -18
- package/esm/domain/configuration/remoteSdkConfiguration.js +0 -137
- package/esm/domain/configuration/remoteSdkConfiguration.js.map +0 -1
- package/esm/domain/configuration/sessionReplayRoutes.d.ts +0 -35
- package/esm/domain/configuration/sessionReplayRoutes.js +0 -65
- package/esm/domain/configuration/sessionReplayRoutes.js.map +0 -1
- package/esm/domain/contexts/ciVisibilityContext.d.ts +0 -12
- package/esm/domain/contexts/ciVisibilityContext.js +0 -30
- package/esm/domain/contexts/ciVisibilityContext.js.map +0 -1
- package/esm/domain/contexts/connectivityContext.d.ts +0 -2
- package/esm/domain/contexts/connectivityContext.js +0 -8
- package/esm/domain/contexts/connectivityContext.js.map +0 -1
- package/esm/domain/contexts/defaultContext.d.ts +0 -4
- package/esm/domain/contexts/defaultContext.js +0 -31
- package/esm/domain/contexts/defaultContext.js.map +0 -1
- package/esm/domain/contexts/displayContext.d.ts +0 -6
- package/esm/domain/contexts/displayContext.js +0 -25
- package/esm/domain/contexts/displayContext.js.map +0 -1
- package/esm/domain/contexts/featureFlagContext.d.ts +0 -19
- package/esm/domain/contexts/featureFlagContext.js +0 -49
- package/esm/domain/contexts/featureFlagContext.js.map +0 -1
- package/esm/domain/contexts/internalContext.d.ts +0 -12
- package/esm/domain/contexts/internalContext.js +0 -23
- package/esm/domain/contexts/internalContext.js.map +0 -1
- package/esm/domain/contexts/pageStateHistory.d.ts +0 -23
- package/esm/domain/contexts/pageStateHistory.js +0 -100
- package/esm/domain/contexts/pageStateHistory.js.map +0 -1
- package/esm/domain/contexts/sessionContext.d.ts +0 -5
- package/esm/domain/contexts/sessionContext.js +0 -44
- package/esm/domain/contexts/sessionContext.js.map +0 -1
- package/esm/domain/contexts/syntheticsContext.d.ts +0 -2
- package/esm/domain/contexts/syntheticsContext.js +0 -22
- package/esm/domain/contexts/syntheticsContext.js.map +0 -1
- package/esm/domain/contexts/trackingConsentContext.d.ts +0 -3
- package/esm/domain/contexts/trackingConsentContext.js +0 -11
- package/esm/domain/contexts/trackingConsentContext.js.map +0 -1
- package/esm/domain/contexts/urlContexts.d.ts +0 -22
- package/esm/domain/contexts/urlContexts.js +0 -60
- package/esm/domain/contexts/urlContexts.js.map +0 -1
- package/esm/domain/contexts/userAgentDataContext.d.ts +0 -2
- package/esm/domain/contexts/userAgentDataContext.js +0 -28
- package/esm/domain/contexts/userAgentDataContext.js.map +0 -1
- package/esm/domain/contexts/viewHistory.d.ts +0 -17
- package/esm/domain/contexts/viewHistory.js +0 -44
- package/esm/domain/contexts/viewHistory.js.map +0 -1
- package/esm/domain/discardNegativeDuration.d.ts +0 -2
- package/esm/domain/discardNegativeDuration.js +0 -5
- package/esm/domain/discardNegativeDuration.js.map +0 -1
- package/esm/domain/error/errorCollection.d.ts +0 -17
- package/esm/domain/error/errorCollection.js +0 -70
- package/esm/domain/error/errorCollection.js.map +0 -1
- package/esm/domain/error/trackConsoleError.d.ts +0 -4
- package/esm/domain/error/trackConsoleError.js +0 -10
- package/esm/domain/error/trackConsoleError.js.map +0 -1
- package/esm/domain/error/trackReportError.d.ts +0 -5
- package/esm/domain/error/trackReportError.js +0 -13
- package/esm/domain/error/trackReportError.js.map +0 -1
- package/esm/domain/event/eventCollection.d.ts +0 -10
- package/esm/domain/event/eventCollection.js +0 -24
- package/esm/domain/event/eventCollection.js.map +0 -1
- package/esm/domain/getSelectorFromElement.d.ts +0 -64
- package/esm/domain/getSelectorFromElement.js +0 -213
- package/esm/domain/getSelectorFromElement.js.map +0 -1
- package/esm/domain/getSessionReplayUrl.d.ts +0 -9
- package/esm/domain/getSessionReplayUrl.js +0 -30
- package/esm/domain/getSessionReplayUrl.js.map +0 -1
- package/esm/domain/hooks.d.ts +0 -23
- package/esm/domain/hooks.js +0 -3
- package/esm/domain/hooks.js.map +0 -1
- package/esm/domain/lifeCycle.d.ts +0 -73
- package/esm/domain/lifeCycle.js +0 -3
- package/esm/domain/lifeCycle.js.map +0 -1
- package/esm/domain/limitModification.d.ts +0 -8
- package/esm/domain/limitModification.js +0 -43
- package/esm/domain/limitModification.js.map +0 -1
- package/esm/domain/longTask/longTaskCollection.d.ts +0 -18
- package/esm/domain/longTask/longTaskCollection.js +0 -87
- package/esm/domain/longTask/longTaskCollection.js.map +0 -1
- package/esm/domain/plugins.d.ts +0 -40
- package/esm/domain/plugins.js +0 -12
- package/esm/domain/plugins.js.map +0 -1
- package/esm/domain/privacy.d.ts +0 -44
- package/esm/domain/privacy.js +0 -302
- package/esm/domain/privacy.js.map +0 -1
- package/esm/domain/privacyConstants.d.ts +0 -23
- package/esm/domain/privacyConstants.js +0 -35
- package/esm/domain/privacyConstants.js.map +0 -1
- package/esm/domain/requestCollection.d.ts +0 -54
- package/esm/domain/requestCollection.js +0 -106
- package/esm/domain/requestCollection.js.map +0 -1
- package/esm/domain/resource/graphql.d.ts +0 -23
- package/esm/domain/resource/graphql.js +0 -91
- package/esm/domain/resource/graphql.js.map +0 -1
- package/esm/domain/resource/matchRequestResourceEntry.d.ts +0 -16
- package/esm/domain/resource/matchRequestResourceEntry.js +0 -46
- package/esm/domain/resource/matchRequestResourceEntry.js.map +0 -1
- package/esm/domain/resource/requestRegistry.d.ts +0 -9
- package/esm/domain/resource/requestRegistry.js +0 -37
- package/esm/domain/resource/requestRegistry.js.map +0 -1
- package/esm/domain/resource/resourceCollection.d.ts +0 -7
- package/esm/domain/resource/resourceCollection.js +0 -187
- package/esm/domain/resource/resourceCollection.js.map +0 -1
- package/esm/domain/resource/resourceUtils.d.ts +0 -55
- package/esm/domain/resource/resourceUtils.js +0 -244
- package/esm/domain/resource/resourceUtils.js.map +0 -1
- package/esm/domain/resource/retrieveInitialDocumentResourceTiming.d.ts +0 -4
- package/esm/domain/resource/retrieveInitialDocumentResourceTiming.js +0 -21
- package/esm/domain/resource/retrieveInitialDocumentResourceTiming.js.map +0 -1
- package/esm/domain/rumSessionManager.d.ts +0 -36
- package/esm/domain/rumSessionManager.js +0 -72
- package/esm/domain/rumSessionManager.js.map +0 -1
- package/esm/domain/sampler/sampler.d.ts +0 -10
- package/esm/domain/sampler/sampler.js +0 -58
- package/esm/domain/sampler/sampler.js.map +0 -1
- package/esm/domain/startCustomerDataTelemetry.d.ts +0 -4
- package/esm/domain/startCustomerDataTelemetry.js +0 -52
- package/esm/domain/startCustomerDataTelemetry.js.map +0 -1
- package/esm/domain/tracing/getDocumentTraceId.d.ts +0 -12
- package/esm/domain/tracing/getDocumentTraceId.js +0 -68
- package/esm/domain/tracing/getDocumentTraceId.js.map +0 -1
- package/esm/domain/tracing/identifier.d.ts +0 -13
- package/esm/domain/tracing/identifier.js +0 -50
- package/esm/domain/tracing/identifier.js.map +0 -1
- package/esm/domain/tracing/sampler.d.ts +0 -10
- package/esm/domain/tracing/sampler.js +0 -64
- package/esm/domain/tracing/sampler.js.map +0 -1
- package/esm/domain/tracing/tracer.d.ts +0 -30
- package/esm/domain/tracing/tracer.js +0 -156
- package/esm/domain/tracing/tracer.js.map +0 -1
- package/esm/domain/tracing/tracer.types.d.ts +0 -12
- package/esm/domain/tracing/tracer.types.js +0 -2
- package/esm/domain/tracing/tracer.types.js.map +0 -1
- package/esm/domain/trackEventCounts.d.ts +0 -17
- package/esm/domain/trackEventCounts.js +0 -47
- package/esm/domain/trackEventCounts.js.map +0 -1
- package/esm/domain/view/bfCacheSupport.d.ts +0 -2
- package/esm/domain/view/bfCacheSupport.js +0 -10
- package/esm/domain/view/bfCacheSupport.js.map +0 -1
- package/esm/domain/view/trackViewEventCounts.d.ts +0 -5
- package/esm/domain/view/trackViewEventCounts.js +0 -13
- package/esm/domain/view/trackViewEventCounts.js.map +0 -1
- package/esm/domain/view/trackViews.d.ts +0 -65
- package/esm/domain/view/trackViews.js +0 -278
- package/esm/domain/view/trackViews.js.map +0 -1
- package/esm/domain/view/viewCollection.d.ts +0 -18
- package/esm/domain/view/viewCollection.js +0 -150
- package/esm/domain/view/viewCollection.js.map +0 -1
- package/esm/domain/view/viewMetrics/getClsAttributionImpactedArea.d.ts +0 -6
- package/esm/domain/view/viewMetrics/getClsAttributionImpactedArea.js +0 -28
- package/esm/domain/view/viewMetrics/getClsAttributionImpactedArea.js.map +0 -1
- package/esm/domain/view/viewMetrics/interactionCountPolyfill.d.ts +0 -18
- package/esm/domain/view/viewMetrics/interactionCountPolyfill.js +0 -39
- package/esm/domain/view/viewMetrics/interactionCountPolyfill.js.map +0 -1
- package/esm/domain/view/viewMetrics/startInitialViewMetricsTelemetry.d.ts +0 -6
- package/esm/domain/view/viewMetrics/startInitialViewMetricsTelemetry.js +0 -41
- package/esm/domain/view/viewMetrics/startInitialViewMetricsTelemetry.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackBfcacheMetrics.d.ts +0 -8
- package/esm/domain/view/viewMetrics/trackBfcacheMetrics.js +0 -14
- package/esm/domain/view/viewMetrics/trackBfcacheMetrics.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackCommonViewMetrics.d.ts +0 -21
- package/esm/domain/view/viewMetrics/trackCommonViewMetrics.js +0 -34
- package/esm/domain/view/viewMetrics/trackCommonViewMetrics.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackCumulativeLayoutShift.d.ts +0 -37
- package/esm/domain/view/viewMetrics/trackCumulativeLayoutShift.js +0 -130
- package/esm/domain/view/viewMetrics/trackCumulativeLayoutShift.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackFirstContentfulPaint.d.ts +0 -13
- package/esm/domain/view/viewMetrics/trackFirstContentfulPaint.js +0 -34
- package/esm/domain/view/viewMetrics/trackFirstContentfulPaint.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackFirstHidden.d.ts +0 -10
- package/esm/domain/view/viewMetrics/trackFirstHidden.js +0 -30
- package/esm/domain/view/viewMetrics/trackFirstHidden.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackFirstInput.d.ts +0 -19
- package/esm/domain/view/viewMetrics/trackFirstInput.js +0 -40
- package/esm/domain/view/viewMetrics/trackFirstInput.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackInitialViewMetrics.d.ts +0 -15
- package/esm/domain/view/viewMetrics/trackInitialViewMetrics.js +0 -38
- package/esm/domain/view/viewMetrics/trackInitialViewMetrics.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackInteractionToNextPaint.d.ts +0 -25
- package/esm/domain/view/viewMetrics/trackInteractionToNextPaint.js +0 -149
- package/esm/domain/view/viewMetrics/trackInteractionToNextPaint.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackLargestContentfulPaint.d.ts +0 -18
- package/esm/domain/view/viewMetrics/trackLargestContentfulPaint.js +0 -57
- package/esm/domain/view/viewMetrics/trackLargestContentfulPaint.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackLoadingTime.d.ts +0 -14
- package/esm/domain/view/viewMetrics/trackLoadingTime.js +0 -47
- package/esm/domain/view/viewMetrics/trackLoadingTime.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackNavigationTimings.d.ts +0 -14
- package/esm/domain/view/viewMetrics/trackNavigationTimings.js +0 -40
- package/esm/domain/view/viewMetrics/trackNavigationTimings.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackScrollMetrics.d.ts +0 -25
- package/esm/domain/view/viewMetrics/trackScrollMetrics.js +0 -72
- package/esm/domain/view/viewMetrics/trackScrollMetrics.js.map +0 -1
- package/esm/domain/vital/vitalCollection.d.ts +0 -55
- package/esm/domain/vital/vitalCollection.js +0 -107
- package/esm/domain/vital/vitalCollection.js.map +0 -1
- package/esm/domain/waitPageActivityEnd.d.ts +0 -54
- package/esm/domain/waitPageActivityEnd.js +0 -123
- package/esm/domain/waitPageActivityEnd.js.map +0 -1
- package/esm/domainContext.types.d.ts +0 -39
- package/esm/domainContext.types.js +0 -5
- package/esm/domainContext.types.js.map +0 -1
- package/esm/index.d.ts +0 -42
- package/esm/index.js +0 -22
- package/esm/index.js.map +0 -1
- package/esm/rawRumEvent.types.d.ts +0 -326
- package/esm/rawRumEvent.types.js +0 -31
- package/esm/rawRumEvent.types.js.map +0 -1
- package/esm/rumEvent.types.d.ts +0 -2038
- package/esm/rumEvent.types.js +0 -6
- package/esm/rumEvent.types.js.map +0 -1
- package/esm/transport/formDataTransport.d.ts +0 -16
- package/esm/transport/formDataTransport.js +0 -43
- package/esm/transport/formDataTransport.js.map +0 -1
- package/esm/transport/startRumBatch.d.ts +0 -5
- package/esm/transport/startRumBatch.js +0 -30
- package/esm/transport/startRumBatch.js.map +0 -1
- package/esm/transport/startRumEventBridge.d.ts +0 -2
- package/esm/transport/startRumEventBridge.js +0 -8
- package/esm/transport/startRumEventBridge.js.map +0 -1
- package/src/browser/firstInputPolyfill.ts +0 -87
- package/src/domain/error/trackConsoleError.ts +0 -14
- package/src/domain/resource/matchRequestResourceEntry.ts +0 -68
- package/src/domain/resource/retrieveInitialDocumentResourceTiming.ts +0 -27
- package/src/domain/rumSessionManager.ts +0 -134
- package/src/domain/sampler/sampler.ts +0 -63
- package/src/domain/tracing/sampler.ts +0 -69
- package/src/domain/view/viewMetrics/startInitialViewMetricsTelemetry.ts +0 -70
- package/src/domain/view/viewMetrics/trackFirstInput.ts +0 -59
|
@@ -1,39 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
MASK: kubesense_browser_core_1.DefaultPrivacyLevel.MASK,
|
|
11
|
-
MASK_USER_INPUT: kubesense_browser_core_1.DefaultPrivacyLevel.MASK_USER_INPUT,
|
|
12
|
-
MASK_UNLESS_ALLOWLISTED: kubesense_browser_core_1.DefaultPrivacyLevel.MASK_UNLESS_ALLOWLISTED,
|
|
1
|
+
let _kubesense_kubesense_browser_core = require("@kubesense/kubesense-browser-core");
|
|
2
|
+
//#region src/domain/privacyConstants.ts
|
|
3
|
+
const NodePrivacyLevel = {
|
|
4
|
+
IGNORE: "ignore",
|
|
5
|
+
HIDDEN: "hidden",
|
|
6
|
+
ALLOW: _kubesense_kubesense_browser_core.DefaultPrivacyLevel.ALLOW,
|
|
7
|
+
MASK: _kubesense_kubesense_browser_core.DefaultPrivacyLevel.MASK,
|
|
8
|
+
MASK_USER_INPUT: _kubesense_kubesense_browser_core.DefaultPrivacyLevel.MASK_USER_INPUT,
|
|
9
|
+
MASK_UNLESS_ALLOWLISTED: _kubesense_kubesense_browser_core.DefaultPrivacyLevel.MASK_UNLESS_ALLOWLISTED
|
|
13
10
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
OPTION: true,
|
|
32
|
-
DATALIST: true,
|
|
33
|
-
OPTGROUP: true,
|
|
11
|
+
const PRIVACY_ATTR_NAME = "data-kubesense-privacy";
|
|
12
|
+
const PRIVACY_ATTR_VALUE_ALLOW = "allow";
|
|
13
|
+
const PRIVACY_ATTR_VALUE_MASK = "mask";
|
|
14
|
+
const PRIVACY_ATTR_VALUE_MASK_USER_INPUT = "mask-user-input";
|
|
15
|
+
const PRIVACY_ATTR_VALUE_MASK_UNLESS_ALLOWLISTED = "mask-unless-allowlisted";
|
|
16
|
+
const PRIVACY_ATTR_VALUE_HIDDEN = "hidden";
|
|
17
|
+
const PRIVACY_CLASS_PREFIX = "kubesense-privacy-";
|
|
18
|
+
const CENSORED_STRING_MARK = "***";
|
|
19
|
+
const CENSORED_IMG_MARK = "data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==";
|
|
20
|
+
const FORM_PRIVATE_TAG_NAMES = {
|
|
21
|
+
INPUT: true,
|
|
22
|
+
OUTPUT: true,
|
|
23
|
+
TEXTAREA: true,
|
|
24
|
+
SELECT: true,
|
|
25
|
+
OPTION: true,
|
|
26
|
+
DATALIST: true,
|
|
27
|
+
OPTGROUP: true
|
|
34
28
|
};
|
|
35
|
-
|
|
29
|
+
const TEXT_MASKING_CHAR = "x";
|
|
36
30
|
function getPrivacySelector(privacyLevel) {
|
|
37
|
-
|
|
31
|
+
return `[${PRIVACY_ATTR_NAME}="${privacyLevel}"], .${PRIVACY_CLASS_PREFIX}${privacyLevel}`;
|
|
38
32
|
}
|
|
33
|
+
//#endregion
|
|
34
|
+
exports.CENSORED_IMG_MARK = CENSORED_IMG_MARK;
|
|
35
|
+
exports.CENSORED_STRING_MARK = CENSORED_STRING_MARK;
|
|
36
|
+
exports.FORM_PRIVATE_TAG_NAMES = FORM_PRIVATE_TAG_NAMES;
|
|
37
|
+
exports.NodePrivacyLevel = NodePrivacyLevel;
|
|
38
|
+
exports.PRIVACY_ATTR_NAME = PRIVACY_ATTR_NAME;
|
|
39
|
+
exports.PRIVACY_ATTR_VALUE_ALLOW = PRIVACY_ATTR_VALUE_ALLOW;
|
|
40
|
+
exports.PRIVACY_ATTR_VALUE_HIDDEN = PRIVACY_ATTR_VALUE_HIDDEN;
|
|
41
|
+
exports.PRIVACY_ATTR_VALUE_MASK = PRIVACY_ATTR_VALUE_MASK;
|
|
42
|
+
exports.PRIVACY_ATTR_VALUE_MASK_UNLESS_ALLOWLISTED = PRIVACY_ATTR_VALUE_MASK_UNLESS_ALLOWLISTED;
|
|
43
|
+
exports.PRIVACY_ATTR_VALUE_MASK_USER_INPUT = PRIVACY_ATTR_VALUE_MASK_USER_INPUT;
|
|
44
|
+
exports.PRIVACY_CLASS_PREFIX = PRIVACY_CLASS_PREFIX;
|
|
45
|
+
exports.TEXT_MASKING_CHAR = TEXT_MASKING_CHAR;
|
|
46
|
+
exports.getPrivacySelector = getPrivacySelector;
|
|
47
|
+
|
|
39
48
|
//# sourceMappingURL=privacyConstants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"privacyConstants.js","
|
|
1
|
+
{"version":3,"file":"privacyConstants.js","names":["DefaultPrivacyLevel"],"sources":["../../src/domain/privacyConstants.ts"],"sourcesContent":["import { DefaultPrivacyLevel } from '@kubesense/kubesense-browser-core'\n\nexport const NodePrivacyLevel = {\n IGNORE: 'ignore',\n HIDDEN: 'hidden',\n ALLOW: DefaultPrivacyLevel.ALLOW,\n MASK: DefaultPrivacyLevel.MASK,\n MASK_USER_INPUT: DefaultPrivacyLevel.MASK_USER_INPUT,\n MASK_UNLESS_ALLOWLISTED: DefaultPrivacyLevel.MASK_UNLESS_ALLOWLISTED,\n} as const\nexport type NodePrivacyLevel = (typeof NodePrivacyLevel)[keyof typeof NodePrivacyLevel]\n\nexport const PRIVACY_ATTR_NAME = 'data-kubesense-privacy'\n\n// Privacy Attrs\nexport const PRIVACY_ATTR_VALUE_ALLOW = 'allow'\nexport const PRIVACY_ATTR_VALUE_MASK = 'mask'\nexport const PRIVACY_ATTR_VALUE_MASK_USER_INPUT = 'mask-user-input'\nexport const PRIVACY_ATTR_VALUE_MASK_UNLESS_ALLOWLISTED = 'mask-unless-allowlisted'\nexport const PRIVACY_ATTR_VALUE_HIDDEN = 'hidden'\n\n// Privacy Classes - not all customers can set plain HTML attributes, so support classes too\nexport const PRIVACY_CLASS_PREFIX = 'kubesense-privacy-'\n\n// Private Replacement Templates\nexport const CENSORED_STRING_MARK = '***'\nexport const CENSORED_IMG_MARK = 'data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw=='\n\nexport const FORM_PRIVATE_TAG_NAMES: { [tagName: string]: true } = {\n INPUT: true,\n OUTPUT: true,\n TEXTAREA: true,\n SELECT: true,\n OPTION: true,\n DATALIST: true,\n OPTGROUP: true,\n}\n\nexport const TEXT_MASKING_CHAR = 'x'\n\nexport function getPrivacySelector(privacyLevel: string) {\n return `[${PRIVACY_ATTR_NAME}=\"${privacyLevel}\"], .${PRIVACY_CLASS_PREFIX}${privacyLevel}`\n}\n"],"mappings":";;AAEA,MAAa,mBAAmB;CAC9B,QAAQ;CACR,QAAQ;CACR,OAAOA,kCAAAA,oBAAoB;CAC3B,MAAMA,kCAAAA,oBAAoB;CAC1B,iBAAiBA,kCAAAA,oBAAoB;CACrC,yBAAyBA,kCAAAA,oBAAoB;AAC/C;AAGA,MAAa,oBAAoB;AAGjC,MAAa,2BAA2B;AACxC,MAAa,0BAA0B;AACvC,MAAa,qCAAqC;AAClD,MAAa,6CAA6C;AAC1D,MAAa,4BAA4B;AAGzC,MAAa,uBAAuB;AAGpC,MAAa,uBAAuB;AACpC,MAAa,oBAAoB;AAEjC,MAAa,yBAAsD;CACjE,OAAO;CACP,QAAQ;CACR,UAAU;CACV,QAAQ;CACR,QAAQ;CACR,UAAU;CACV,UAAU;AACZ;AAEA,MAAa,oBAAoB;AAEjC,SAAgB,mBAAmB,cAAsB;CACvD,OAAO,IAAI,kBAAkB,IAAI,aAAa,OAAO,uBAAuB;AAC9E"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Duration,
|
|
1
|
+
import type { Duration, ClocksState } from '@kubesense/kubesense-js-core/time';
|
|
2
|
+
import type { XhrCompleteContext, XhrStartContext, FetchStartContext, FetchResolveContext, ContextManager, SessionManager, Observable, BufferedData } from '@kubesense/kubesense-browser-core';
|
|
2
3
|
import { RequestType } from '@kubesense/kubesense-browser-core';
|
|
3
|
-
import type { RumSessionManager } from '..';
|
|
4
4
|
import type { RumConfiguration } from './configuration';
|
|
5
5
|
import type { LifeCycle } from './lifeCycle';
|
|
6
6
|
import type { Tracer } from './tracing/tracer';
|
|
@@ -41,14 +41,15 @@ export interface RequestCompleteEvent {
|
|
|
41
41
|
init?: RequestInit;
|
|
42
42
|
error?: Error;
|
|
43
43
|
isAborted: boolean;
|
|
44
|
+
isAbortedOnStart: boolean;
|
|
44
45
|
handlingStack?: string;
|
|
45
46
|
requestBody?: unknown;
|
|
46
47
|
responseBody?: string;
|
|
47
48
|
}
|
|
48
|
-
export declare function startRequestCollection(lifeCycle: LifeCycle, configuration: RumConfiguration, sessionManager:
|
|
49
|
-
export declare function trackXhr(lifeCycle: LifeCycle,
|
|
49
|
+
export declare function startRequestCollection(lifeCycle: LifeCycle, configuration: RumConfiguration, sessionManager: SessionManager, userContext: ContextManager, accountContext: ContextManager, bufferedDataObservable: Observable<BufferedData>): void;
|
|
50
|
+
export declare function trackXhr(lifeCycle: LifeCycle, tracer: Tracer, bufferedDataObservable: Observable<BufferedData>): {
|
|
50
51
|
stop: () => void;
|
|
51
52
|
};
|
|
52
|
-
export declare function trackFetch(lifeCycle: LifeCycle, configuration: RumConfiguration, tracer: Tracer): {
|
|
53
|
+
export declare function trackFetch(lifeCycle: LifeCycle, configuration: RumConfiguration, tracer: Tracer, bufferedDataObservable: Observable<BufferedData>): {
|
|
53
54
|
stop: () => void;
|
|
54
55
|
};
|
|
@@ -1,111 +1,88 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const tracer_1 = require("./tracing/tracer");
|
|
9
|
-
const graphql_1 = require("./resource/graphql");
|
|
1
|
+
require("./lifeCycle.js");
|
|
2
|
+
const require_resourceUtils = require("./resource/resourceUtils.js");
|
|
3
|
+
const require_tracer = require("./tracing/tracer.js");
|
|
4
|
+
const require_graphql = require("./resource/graphql.js");
|
|
5
|
+
let _kubesense_kubesense_js_core_time = require("@kubesense/kubesense-js-core/time");
|
|
6
|
+
let _kubesense_kubesense_browser_core = require("@kubesense/kubesense-browser-core");
|
|
7
|
+
//#region src/domain/requestCollection.ts
|
|
10
8
|
let nextRequestIndex = 1;
|
|
11
|
-
function startRequestCollection(lifeCycle, configuration, sessionManager, userContext, accountContext) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
function startRequestCollection(lifeCycle, configuration, sessionManager, userContext, accountContext, bufferedDataObservable) {
|
|
10
|
+
const tracer = require_tracer.startTracer(configuration, sessionManager, userContext, accountContext);
|
|
11
|
+
trackXhr(lifeCycle, tracer, bufferedDataObservable);
|
|
12
|
+
trackFetch(lifeCycle, configuration, tracer, bufferedDataObservable);
|
|
15
13
|
}
|
|
16
|
-
function trackXhr(lifeCycle,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
handlingStack: context.handlingStack,
|
|
47
|
-
requestBody: context.requestBody,
|
|
48
|
-
responseBody: context.responseBody,
|
|
49
|
-
});
|
|
50
|
-
break;
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
return { stop: () => subscription.unsubscribe() };
|
|
14
|
+
function trackXhr(lifeCycle, tracer, bufferedDataObservable) {
|
|
15
|
+
const subscriptions = [];
|
|
16
|
+
subscriptions.push((0, _kubesense_kubesense_browser_core.initXhrObservable)().subscribe((context) => {
|
|
17
|
+
if (context.state === "start" && require_resourceUtils.isAllowedRequestUrl(context.url)) {
|
|
18
|
+
tracer.traceXhr(context, context.xhr);
|
|
19
|
+
assignRequestIndex(context);
|
|
20
|
+
}
|
|
21
|
+
}));
|
|
22
|
+
subscriptions.push(bufferedDataObservable.subscribe(({ data, type }) => {
|
|
23
|
+
if (type !== _kubesense_kubesense_browser_core.BufferedDataType.XHR) return;
|
|
24
|
+
const context = data;
|
|
25
|
+
if (!require_resourceUtils.isAllowedRequestUrl(context.url)) return;
|
|
26
|
+
switch (context.state) {
|
|
27
|
+
case "start":
|
|
28
|
+
assignRequestIndex(context);
|
|
29
|
+
lifeCycle.notify(7, {
|
|
30
|
+
requestIndex: context.requestIndex,
|
|
31
|
+
url: context.url
|
|
32
|
+
});
|
|
33
|
+
break;
|
|
34
|
+
case "complete":
|
|
35
|
+
tracer.clearTracingIfNeeded(context);
|
|
36
|
+
lifeCycle.notify(8, {
|
|
37
|
+
...context,
|
|
38
|
+
type: _kubesense_kubesense_browser_core.RequestType.XHR,
|
|
39
|
+
isAbortedOnStart: false
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}));
|
|
43
|
+
return { stop: () => subscriptions.forEach((subscription) => subscription.unsubscribe()) };
|
|
54
44
|
}
|
|
55
|
-
function trackFetch(lifeCycle, configuration, tracer) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
traceId: context.traceId,
|
|
90
|
-
traceSampled: context.traceSampled,
|
|
91
|
-
type: kubesense_browser_core_1.RequestType.FETCH,
|
|
92
|
-
url: context.url,
|
|
93
|
-
response: context.response,
|
|
94
|
-
init: context.init,
|
|
95
|
-
input: context.input,
|
|
96
|
-
isAborted: context.isAborted,
|
|
97
|
-
handlingStack: context.handlingStack,
|
|
98
|
-
requestBody: (_a = context.init) === null || _a === void 0 ? void 0 : _a.body,
|
|
99
|
-
responseBody: context.responseBody,
|
|
100
|
-
});
|
|
101
|
-
break;
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
return { stop: () => subscription.unsubscribe() };
|
|
45
|
+
function trackFetch(lifeCycle, configuration, tracer, bufferedDataObservable) {
|
|
46
|
+
const subscriptions = [];
|
|
47
|
+
subscriptions.push((0, _kubesense_kubesense_browser_core.initFetchObservable)({ responseBodyAction: (context) => {
|
|
48
|
+
if (require_graphql.findGraphQlConfiguration(context.url, configuration)?.trackResponseErrors) return _kubesense_kubesense_browser_core.ResponseBodyAction.COLLECT;
|
|
49
|
+
return _kubesense_kubesense_browser_core.ResponseBodyAction.IGNORE;
|
|
50
|
+
} }).subscribe((context) => {
|
|
51
|
+
if (context.state === "start" && require_resourceUtils.isAllowedRequestUrl(context.url)) {
|
|
52
|
+
tracer.traceFetch(context);
|
|
53
|
+
assignRequestIndex(context);
|
|
54
|
+
}
|
|
55
|
+
}));
|
|
56
|
+
subscriptions.push(bufferedDataObservable.subscribe(({ data, type }) => {
|
|
57
|
+
if (type !== _kubesense_kubesense_browser_core.BufferedDataType.FETCH) return;
|
|
58
|
+
const context = data;
|
|
59
|
+
if (!require_resourceUtils.isAllowedRequestUrl(context.url)) return;
|
|
60
|
+
switch (context.state) {
|
|
61
|
+
case "start":
|
|
62
|
+
assignRequestIndex(context);
|
|
63
|
+
lifeCycle.notify(7, {
|
|
64
|
+
requestIndex: context.requestIndex,
|
|
65
|
+
url: context.url
|
|
66
|
+
});
|
|
67
|
+
break;
|
|
68
|
+
case "resolve":
|
|
69
|
+
tracer.clearTracingIfNeeded(context);
|
|
70
|
+
lifeCycle.notify(8, {
|
|
71
|
+
...context,
|
|
72
|
+
duration: (0, _kubesense_kubesense_js_core_time.elapsed)(context.startClocks.timeStamp, (0, _kubesense_kubesense_js_core_time.timeStampNow)()),
|
|
73
|
+
type: _kubesense_kubesense_browser_core.RequestType.FETCH,
|
|
74
|
+
requestBody: context.init?.body
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}));
|
|
78
|
+
return { stop: () => subscriptions.forEach((subscription) => subscription.unsubscribe()) };
|
|
105
79
|
}
|
|
106
|
-
function
|
|
107
|
-
|
|
108
|
-
nextRequestIndex += 1;
|
|
109
|
-
return result;
|
|
80
|
+
function assignRequestIndex(context) {
|
|
81
|
+
if (!context.requestIndex) context.requestIndex = nextRequestIndex++;
|
|
110
82
|
}
|
|
83
|
+
//#endregion
|
|
84
|
+
exports.startRequestCollection = startRequestCollection;
|
|
85
|
+
exports.trackFetch = trackFetch;
|
|
86
|
+
exports.trackXhr = trackXhr;
|
|
87
|
+
|
|
111
88
|
//# sourceMappingURL=requestCollection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestCollection.js","
|
|
1
|
+
{"version":3,"file":"requestCollection.js","names":["startTracer","initXhrObservable","isAllowedRequestUrl","BufferedDataType","RequestType","initFetchObservable","findGraphQlConfiguration","ResponseBodyAction","elapsed","timeStampNow"],"sources":["../../src/domain/requestCollection.ts"],"sourcesContent":["import { elapsed, timeStampNow } from '@kubesense/kubesense-js-core/time'\nimport type { Duration, ClocksState } from '@kubesense/kubesense-js-core/time'\nimport type {\n XhrCompleteContext,\n XhrStartContext,\n FetchStartContext,\n FetchResolveContext,\n ContextManager,\n SessionManager,\n Observable,\n BufferedData,\n Subscription,\n} from '@kubesense/kubesense-browser-core'\nimport {\n RequestType,\n ResponseBodyAction,\n BufferedDataType,\n initFetchObservable,\n initXhrObservable,\n} from '@kubesense/kubesense-browser-core'\nimport type { RumConfiguration } from './configuration'\nimport type { LifeCycle } from './lifeCycle'\nimport { LifeCycleEventType } from './lifeCycle'\nimport { isAllowedRequestUrl } from './resource/resourceUtils'\nimport type { Tracer } from './tracing/tracer'\nimport { startTracer } from './tracing/tracer'\nimport type { SpanIdentifier, TraceIdentifier } from './tracing/identifier'\nimport { findGraphQlConfiguration } from './resource/graphql'\n\nexport interface CustomContext {\n requestIndex: number\n spanId?: SpanIdentifier\n traceId?: TraceIdentifier\n traceSampled?: boolean\n}\nexport interface RumFetchStartContext extends FetchStartContext, CustomContext {}\nexport interface RumFetchResolveContext extends FetchResolveContext, CustomContext {}\nexport interface RumXhrStartContext extends XhrStartContext, CustomContext {}\nexport interface RumXhrCompleteContext extends XhrCompleteContext, CustomContext {}\n\nexport interface RequestStartEvent {\n requestIndex: number\n url: string\n}\nexport interface RequestCompleteEvent {\n requestIndex: number\n type: RequestType\n method: string\n url: string\n status: number\n responseType?: string\n startClocks: ClocksState\n duration: Duration\n spanId?: SpanIdentifier\n traceId?: TraceIdentifier\n traceSampled?: boolean\n xhr?: XMLHttpRequest\n response?: Response\n input?: unknown\n init?: RequestInit\n error?: Error\n isAborted: boolean\n isAbortedOnStart: boolean\n handlingStack?: string\n requestBody?: unknown\n responseBody?: string\n}\n\nlet nextRequestIndex = 1\n\nexport function startRequestCollection(\n lifeCycle: LifeCycle,\n configuration: RumConfiguration,\n sessionManager: SessionManager,\n userContext: ContextManager,\n accountContext: ContextManager,\n bufferedDataObservable: Observable<BufferedData>\n) {\n const tracer = startTracer(configuration, sessionManager, userContext, accountContext)\n trackXhr(lifeCycle, tracer, bufferedDataObservable)\n trackFetch(lifeCycle, configuration, tracer, bufferedDataObservable)\n}\n\nexport function trackXhr(lifeCycle: LifeCycle, tracer: Tracer, bufferedDataObservable: Observable<BufferedData>) {\n const subscriptions: Subscription[] = []\n\n subscriptions.push(\n initXhrObservable().subscribe((context) => {\n if (context.state === 'start' && isAllowedRequestUrl(context.url)) {\n tracer.traceXhr(context, context.xhr)\n assignRequestIndex(context as RumXhrStartContext)\n }\n })\n )\n\n subscriptions.push(\n bufferedDataObservable.subscribe(({ data, type }) => {\n if (type !== BufferedDataType.XHR) {\n return\n }\n const context = data as RumXhrStartContext | RumXhrCompleteContext\n if (!isAllowedRequestUrl(context.url)) {\n return\n }\n\n switch (context.state) {\n case 'start':\n assignRequestIndex(context)\n lifeCycle.notify(LifeCycleEventType.REQUEST_STARTED, {\n requestIndex: context.requestIndex,\n url: context.url,\n })\n break\n case 'complete':\n tracer.clearTracingIfNeeded(context)\n lifeCycle.notify(LifeCycleEventType.REQUEST_COMPLETED, {\n ...context,\n type: RequestType.XHR,\n isAbortedOnStart: false,\n })\n break\n }\n })\n )\n\n return { stop: () => subscriptions.forEach((subscription) => subscription.unsubscribe()) }\n}\n\nexport function trackFetch(\n lifeCycle: LifeCycle,\n configuration: RumConfiguration,\n tracer: Tracer,\n bufferedDataObservable: Observable<BufferedData>\n) {\n const subscriptions: Subscription[] = []\n\n subscriptions.push(\n initFetchObservable({\n responseBodyAction: (context) => {\n if (findGraphQlConfiguration(context.url, configuration)?.trackResponseErrors) {\n return ResponseBodyAction.COLLECT\n }\n return ResponseBodyAction.IGNORE\n },\n }).subscribe((context) => {\n if (context.state === 'start' && isAllowedRequestUrl(context.url)) {\n tracer.traceFetch(context)\n assignRequestIndex(context as RumFetchStartContext)\n }\n })\n )\n\n subscriptions.push(\n bufferedDataObservable.subscribe(({ data, type }) => {\n if (type !== BufferedDataType.FETCH) {\n return\n }\n const context = data as RumFetchResolveContext | RumFetchStartContext\n if (!isAllowedRequestUrl(context.url)) {\n return\n }\n\n switch (context.state) {\n case 'start':\n assignRequestIndex(context)\n lifeCycle.notify(LifeCycleEventType.REQUEST_STARTED, {\n requestIndex: context.requestIndex,\n url: context.url,\n })\n break\n case 'resolve':\n tracer.clearTracingIfNeeded(context)\n lifeCycle.notify(LifeCycleEventType.REQUEST_COMPLETED, {\n ...context,\n duration: elapsed(context.startClocks.timeStamp, timeStampNow()),\n type: RequestType.FETCH,\n requestBody: context.init?.body,\n })\n break\n }\n })\n )\n return { stop: () => subscriptions.forEach((subscription) => subscription.unsubscribe()) }\n}\n\nfunction assignRequestIndex(context: CustomContext) {\n if (!context.requestIndex) {\n context.requestIndex = nextRequestIndex++\n }\n}\n"],"mappings":";;;;;;;AAoEA,IAAI,mBAAmB;AAEvB,SAAgB,uBACd,WACA,eACA,gBACA,aACA,gBACA,wBACA;CACA,MAAM,SAASA,eAAAA,YAAY,eAAe,gBAAgB,aAAa,cAAc;CACrF,SAAS,WAAW,QAAQ,sBAAsB;CAClD,WAAW,WAAW,eAAe,QAAQ,sBAAsB;AACrE;AAEA,SAAgB,SAAS,WAAsB,QAAgB,wBAAkD;CAC/G,MAAM,gBAAgC,CAAC;CAEvC,cAAc,MAAA,GACZC,kCAAAA,kBAAAA,CAAkB,CAAC,CAAC,WAAW,YAAY;EACzC,IAAI,QAAQ,UAAU,WAAWC,sBAAAA,oBAAoB,QAAQ,GAAG,GAAG;GACjE,OAAO,SAAS,SAAS,QAAQ,GAAG;GACpC,mBAAmB,OAA6B;EAClD;CACF,CAAC,CACH;CAEA,cAAc,KACZ,uBAAuB,WAAW,EAAE,MAAM,WAAW;EACnD,IAAI,SAASC,kCAAAA,iBAAiB,KAC5B;EAEF,MAAM,UAAU;EAChB,IAAI,CAACD,sBAAAA,oBAAoB,QAAQ,GAAG,GAClC;EAGF,QAAQ,QAAQ,OAAhB;GACE,KAAK;IACH,mBAAmB,OAAO;IAC1B,UAAU,OAAA,GAA2C;KACnD,cAAc,QAAQ;KACtB,KAAK,QAAQ;IACf,CAAC;IACD;GACF,KAAK;IACH,OAAO,qBAAqB,OAAO;IACnC,UAAU,OAAA,GAA6C;KACrD,GAAG;KACH,MAAME,kCAAAA,YAAY;KAClB,kBAAkB;IACpB,CAAC;EAEL;CACF,CAAC,CACH;CAEA,OAAO,EAAE,YAAY,cAAc,SAAS,iBAAiB,aAAa,YAAY,CAAC,EAAE;AAC3F;AAEA,SAAgB,WACd,WACA,eACA,QACA,wBACA;CACA,MAAM,gBAAgC,CAAC;CAEvC,cAAc,MAAA,GACZC,kCAAAA,oBAAAA,CAAoB,EAClB,qBAAqB,YAAY;EAC/B,IAAIC,gBAAAA,yBAAyB,QAAQ,KAAK,aAAa,CAAC,EAAE,qBACxD,OAAOC,kCAAAA,mBAAmB;EAE5B,OAAOA,kCAAAA,mBAAmB;CAC5B,EACF,CAAC,CAAC,CAAC,WAAW,YAAY;EACxB,IAAI,QAAQ,UAAU,WAAWL,sBAAAA,oBAAoB,QAAQ,GAAG,GAAG;GACjE,OAAO,WAAW,OAAO;GACzB,mBAAmB,OAA+B;EACpD;CACF,CAAC,CACH;CAEA,cAAc,KACZ,uBAAuB,WAAW,EAAE,MAAM,WAAW;EACnD,IAAI,SAASC,kCAAAA,iBAAiB,OAC5B;EAEF,MAAM,UAAU;EAChB,IAAI,CAACD,sBAAAA,oBAAoB,QAAQ,GAAG,GAClC;EAGF,QAAQ,QAAQ,OAAhB;GACE,KAAK;IACH,mBAAmB,OAAO;IAC1B,UAAU,OAAA,GAA2C;KACnD,cAAc,QAAQ;KACtB,KAAK,QAAQ;IACf,CAAC;IACD;GACF,KAAK;IACH,OAAO,qBAAqB,OAAO;IACnC,UAAU,OAAA,GAA6C;KACrD,GAAG;KACH,WAAA,GAAUM,kCAAAA,QAAAA,CAAQ,QAAQ,YAAY,YAAA,GAAWC,kCAAAA,aAAAA,CAAa,CAAC;KAC/D,MAAML,kCAAAA,YAAY;KAClB,aAAa,QAAQ,MAAM;IAC7B,CAAC;EAEL;CACF,CAAC,CACH;CACA,OAAO,EAAE,YAAY,cAAc,SAAS,iBAAiB,aAAa,YAAY,CAAC,EAAE;AAC3F;AAEA,SAAS,mBAAmB,SAAwB;CAClD,IAAI,CAAC,QAAQ,cACX,QAAQ,eAAe;AAE3B"}
|
|
@@ -20,4 +20,4 @@ export interface GraphQlMetadata {
|
|
|
20
20
|
export declare function extractGraphQlMetadata(request: RequestCompleteEvent, graphQlConfig: GraphQlUrlOption): GraphQlMetadata | undefined;
|
|
21
21
|
export declare function parseGraphQlResponse(responseText: string): GraphQlError[] | undefined;
|
|
22
22
|
export declare function findGraphQlConfiguration(url: string, configuration: RumConfiguration): GraphQlUrlOption | undefined;
|
|
23
|
-
export declare function extractGraphQlRequestMetadata(
|
|
23
|
+
export declare function extractGraphQlRequestMetadata(request: Pick<RequestCompleteEvent, 'method' | 'url' | 'requestBody'>, trackPayload?: boolean): GraphQlMetadata | undefined;
|
|
@@ -1,97 +1,96 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
exports.parseGraphQlResponse = parseGraphQlResponse;
|
|
5
|
-
exports.findGraphQlConfiguration = findGraphQlConfiguration;
|
|
6
|
-
exports.extractGraphQlRequestMetadata = extractGraphQlRequestMetadata;
|
|
7
|
-
const kubesense_browser_core_1 = require("@kubesense/kubesense-browser-core");
|
|
1
|
+
let _kubesense_kubesense_js_core_util = require("@kubesense/kubesense-js-core/util");
|
|
2
|
+
let _kubesense_kubesense_browser_core = require("@kubesense/kubesense-browser-core");
|
|
3
|
+
//#region src/domain/resource/graphql.ts
|
|
8
4
|
/**
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const GRAPHQL_PAYLOAD_LIMIT = 32 *
|
|
5
|
+
* arbitrary value, byte precision not needed
|
|
6
|
+
*/
|
|
7
|
+
const GRAPHQL_PAYLOAD_LIMIT = 32 * _kubesense_kubesense_browser_core.ONE_KIBI_BYTE;
|
|
12
8
|
function extractGraphQlMetadata(request, graphQlConfig) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
return metadata;
|
|
9
|
+
const metadata = extractGraphQlRequestMetadata(request, graphQlConfig.trackPayload);
|
|
10
|
+
if (!metadata) return;
|
|
11
|
+
if (graphQlConfig.trackResponseErrors && request.responseBody) {
|
|
12
|
+
const responseErrors = parseGraphQlResponse(request.responseBody);
|
|
13
|
+
if (responseErrors) {
|
|
14
|
+
metadata.error_count = responseErrors.length;
|
|
15
|
+
metadata.errors = responseErrors;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return metadata;
|
|
25
19
|
}
|
|
26
20
|
function parseGraphQlResponse(responseText) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if (!(0, kubesense_browser_core_1.isNonEmptyArray)(responseObj.errors)) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
const errors = responseObj.errors.map((error) => {
|
|
43
|
-
var _a;
|
|
44
|
-
const graphqlError = {
|
|
45
|
-
message: error.message,
|
|
46
|
-
path: error.path,
|
|
47
|
-
locations: error.locations,
|
|
48
|
-
code: (_a = error.extensions) === null || _a === void 0 ? void 0 : _a.code,
|
|
49
|
-
};
|
|
50
|
-
return graphqlError;
|
|
51
|
-
});
|
|
52
|
-
return errors;
|
|
21
|
+
const response = (0, _kubesense_kubesense_browser_core.tryJsonParse)(responseText);
|
|
22
|
+
if (!response || typeof response !== "object") return;
|
|
23
|
+
const responseObj = response;
|
|
24
|
+
if (!(0, _kubesense_kubesense_browser_core.isNonEmptyArray)(responseObj.errors)) return;
|
|
25
|
+
return responseObj.errors.map((error) => {
|
|
26
|
+
return {
|
|
27
|
+
message: error.message,
|
|
28
|
+
path: error.path,
|
|
29
|
+
locations: error.locations,
|
|
30
|
+
code: error.extensions?.code
|
|
31
|
+
};
|
|
32
|
+
});
|
|
53
33
|
}
|
|
54
34
|
function findGraphQlConfiguration(url, configuration) {
|
|
55
|
-
|
|
35
|
+
return configuration.allowedGraphQlUrls.find((graphQlOption) => (0, _kubesense_kubesense_browser_core.matchList)([graphQlOption.match], url));
|
|
36
|
+
}
|
|
37
|
+
function extractGraphQlRequestMetadata(request, trackPayload = false) {
|
|
38
|
+
let rawMetadata;
|
|
39
|
+
if (request.method === "POST") rawMetadata = extractFromBody(request.requestBody);
|
|
40
|
+
else if (request.method === "GET") rawMetadata = extractFromUrlQueryParams(request.url);
|
|
41
|
+
if (!rawMetadata) return;
|
|
42
|
+
return sanitizeGraphQlMetadata(rawMetadata, trackPayload);
|
|
43
|
+
}
|
|
44
|
+
function extractFromBody(requestBody) {
|
|
45
|
+
if (!requestBody || typeof requestBody !== "string") return;
|
|
46
|
+
const graphqlBody = (0, _kubesense_kubesense_browser_core.tryJsonParse)(requestBody);
|
|
47
|
+
if (!graphqlBody) return;
|
|
48
|
+
return {
|
|
49
|
+
query: graphqlBody.query,
|
|
50
|
+
operationName: graphqlBody.operationName,
|
|
51
|
+
variables: graphqlBody.variables ? JSON.stringify(graphqlBody.variables) : void 0,
|
|
52
|
+
operationType: graphqlBody.operationType
|
|
53
|
+
};
|
|
56
54
|
}
|
|
57
|
-
function
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
operationName,
|
|
89
|
-
variables,
|
|
90
|
-
payload,
|
|
91
|
-
};
|
|
55
|
+
function extractFromUrlQueryParams(url) {
|
|
56
|
+
const searchParams = (0, _kubesense_kubesense_js_core_util.buildUrl)(url).searchParams;
|
|
57
|
+
const variablesParam = searchParams.get("variables");
|
|
58
|
+
const variables = variablesParam && (0, _kubesense_kubesense_browser_core.tryJsonParse)(variablesParam) !== void 0 ? variablesParam : void 0;
|
|
59
|
+
return {
|
|
60
|
+
query: searchParams.get("query") || void 0,
|
|
61
|
+
operationName: searchParams.get("operationName") || void 0,
|
|
62
|
+
variables,
|
|
63
|
+
operationType: searchParams.get("operationType") || void 0
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
function sanitizeGraphQlMetadata(rawMetadata, trackPayload) {
|
|
67
|
+
let operationType;
|
|
68
|
+
let payload;
|
|
69
|
+
let variables;
|
|
70
|
+
if (rawMetadata.query) {
|
|
71
|
+
const trimmedQuery = rawMetadata.query.trim();
|
|
72
|
+
operationType = getOperationType(trimmedQuery);
|
|
73
|
+
if (trackPayload) payload = (0, _kubesense_kubesense_browser_core.safeTruncate)(trimmedQuery, GRAPHQL_PAYLOAD_LIMIT, "...");
|
|
74
|
+
}
|
|
75
|
+
if (!operationType) {
|
|
76
|
+
const bodyType = rawMetadata.operationType;
|
|
77
|
+
if (bodyType === "query" || bodyType === "mutation" || bodyType === "subscription") operationType = bodyType;
|
|
78
|
+
}
|
|
79
|
+
if (rawMetadata.variables) variables = rawMetadata.variables;
|
|
80
|
+
return {
|
|
81
|
+
operationType,
|
|
82
|
+
operationName: rawMetadata.operationName,
|
|
83
|
+
variables,
|
|
84
|
+
payload
|
|
85
|
+
};
|
|
92
86
|
}
|
|
93
87
|
function getOperationType(query) {
|
|
94
|
-
|
|
95
|
-
return (_a = query.match(/^\s*(query|mutation|subscription)\b/i)) === null || _a === void 0 ? void 0 : _a[1];
|
|
88
|
+
return query.match(/^\s*(query|mutation|subscription)\b/i)?.[1];
|
|
96
89
|
}
|
|
90
|
+
//#endregion
|
|
91
|
+
exports.extractGraphQlMetadata = extractGraphQlMetadata;
|
|
92
|
+
exports.extractGraphQlRequestMetadata = extractGraphQlRequestMetadata;
|
|
93
|
+
exports.findGraphQlConfiguration = findGraphQlConfiguration;
|
|
94
|
+
exports.parseGraphQlResponse = parseGraphQlResponse;
|
|
95
|
+
|
|
97
96
|
//# sourceMappingURL=graphql.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql.js","
|
|
1
|
+
{"version":3,"file":"graphql.js","names":["ONE_KIBI_BYTE","tryJsonParse","isNonEmptyArray","matchList","buildUrl","safeTruncate"],"sources":["../../../src/domain/resource/graphql.ts"],"sourcesContent":["import {\n isNonEmptyArray,\n matchList,\n ONE_KIBI_BYTE,\n safeTruncate,\n tryJsonParse,\n} from '@kubesense/kubesense-browser-core'\nimport { buildUrl } from '@kubesense/kubesense-js-core/util'\nimport type { RumConfiguration, GraphQlUrlOption } from '../configuration'\nimport type { RequestCompleteEvent } from '../requestCollection'\n\n/**\n * arbitrary value, byte precision not needed\n */\nconst GRAPHQL_PAYLOAD_LIMIT = 32 * ONE_KIBI_BYTE\n\ninterface RawGraphQlMetadata {\n query?: string\n operationName?: string\n variables?: string\n operationType?: string\n}\n\nexport interface GraphQlError {\n message: string\n code?: string\n locations?: Array<{ line: number; column: number }>\n path?: Array<string | number>\n}\n\nexport interface GraphQlMetadata {\n operationType?: 'query' | 'mutation' | 'subscription'\n operationName?: string\n variables?: string\n payload?: string\n error_count?: number\n errors?: GraphQlError[]\n}\n\nexport function extractGraphQlMetadata(\n request: RequestCompleteEvent,\n graphQlConfig: GraphQlUrlOption\n): GraphQlMetadata | undefined {\n const metadata = extractGraphQlRequestMetadata(request, graphQlConfig.trackPayload)\n if (!metadata) {\n return\n }\n\n if (graphQlConfig.trackResponseErrors && request.responseBody) {\n const responseErrors = parseGraphQlResponse(request.responseBody)\n if (responseErrors) {\n metadata.error_count = responseErrors.length\n metadata.errors = responseErrors\n }\n }\n\n return metadata\n}\n\nexport function parseGraphQlResponse(responseText: string): GraphQlError[] | undefined {\n const response = tryJsonParse(responseText)\n\n if (!response || typeof response !== 'object') {\n return\n }\n\n const responseObj = response as Record<string, unknown>\n\n if (!isNonEmptyArray(responseObj.errors)) {\n return\n }\n\n const errors = (responseObj.errors as Array<Record<string, unknown>>).map((error) => {\n const graphqlError: GraphQlError = {\n message: error.message as string,\n path: error.path as Array<string | number>,\n locations: error.locations as Array<{ line: number; column: number }>,\n code: (error.extensions as Record<string, unknown> | undefined)?.code as string,\n }\n\n return graphqlError\n })\n\n return errors\n}\n\nexport function findGraphQlConfiguration(url: string, configuration: RumConfiguration): GraphQlUrlOption | undefined {\n return configuration.allowedGraphQlUrls.find((graphQlOption) => matchList([graphQlOption.match], url))\n}\n\nexport function extractGraphQlRequestMetadata(\n request: Pick<RequestCompleteEvent, 'method' | 'url' | 'requestBody'>,\n trackPayload: boolean = false\n): GraphQlMetadata | undefined {\n let rawMetadata: RawGraphQlMetadata | undefined\n\n if (request.method === 'POST') {\n rawMetadata = extractFromBody(request.requestBody)\n } else if (request.method === 'GET') {\n rawMetadata = extractFromUrlQueryParams(request.url)\n }\n\n if (!rawMetadata) {\n return\n }\n\n return sanitizeGraphQlMetadata(rawMetadata, trackPayload)\n}\n\nfunction extractFromBody(requestBody: unknown): RawGraphQlMetadata | undefined {\n if (!requestBody || typeof requestBody !== 'string') {\n return\n }\n\n const graphqlBody = tryJsonParse<{\n query?: string\n operationName?: string\n variables?: unknown\n operationType?: string\n }>(requestBody)\n\n if (!graphqlBody) {\n return\n }\n\n return {\n query: graphqlBody.query,\n operationName: graphqlBody.operationName,\n variables: graphqlBody.variables ? JSON.stringify(graphqlBody.variables) : undefined,\n operationType: graphqlBody.operationType,\n }\n}\n\nfunction extractFromUrlQueryParams(url: string): RawGraphQlMetadata {\n const searchParams = buildUrl(url).searchParams\n const variablesParam = searchParams.get('variables')\n const variables = variablesParam && tryJsonParse(variablesParam) !== undefined ? variablesParam : undefined\n\n return {\n query: searchParams.get('query') || undefined,\n operationName: searchParams.get('operationName') || undefined,\n variables,\n operationType: searchParams.get('operationType') || undefined,\n }\n}\n\nfunction sanitizeGraphQlMetadata(rawMetadata: RawGraphQlMetadata, trackPayload: boolean): GraphQlMetadata {\n let operationType: 'query' | 'mutation' | 'subscription' | undefined\n let payload: string | undefined\n let variables: string | undefined\n\n if (rawMetadata.query) {\n const trimmedQuery = rawMetadata.query.trim()\n operationType = getOperationType(trimmedQuery)\n if (trackPayload) {\n payload = safeTruncate(trimmedQuery, GRAPHQL_PAYLOAD_LIMIT, '...')\n }\n }\n\n if (!operationType) {\n const bodyType = rawMetadata.operationType\n if (bodyType === 'query' || bodyType === 'mutation' || bodyType === 'subscription') {\n operationType = bodyType\n }\n }\n\n if (rawMetadata.variables) {\n variables = rawMetadata.variables\n }\n\n return {\n operationType,\n operationName: rawMetadata.operationName,\n variables,\n payload,\n }\n}\n\nfunction getOperationType(query: string) {\n return query.match(/^\\s*(query|mutation|subscription)\\b/i)?.[1] as 'query' | 'mutation' | 'subscription' | undefined\n}\n"],"mappings":";;;;;;AAcA,MAAM,wBAAwB,KAAKA,kCAAAA;AAyBnC,SAAgB,uBACd,SACA,eAC6B;CAC7B,MAAM,WAAW,8BAA8B,SAAS,cAAc,YAAY;CAClF,IAAI,CAAC,UACH;CAGF,IAAI,cAAc,uBAAuB,QAAQ,cAAc;EAC7D,MAAM,iBAAiB,qBAAqB,QAAQ,YAAY;EAChE,IAAI,gBAAgB;GAClB,SAAS,cAAc,eAAe;GACtC,SAAS,SAAS;EACpB;CACF;CAEA,OAAO;AACT;AAEA,SAAgB,qBAAqB,cAAkD;CACrF,MAAM,YAAA,GAAWC,kCAAAA,aAAAA,CAAa,YAAY;CAE1C,IAAI,CAAC,YAAY,OAAO,aAAa,UACnC;CAGF,MAAM,cAAc;CAEpB,IAAI,EAAA,GAACC,kCAAAA,gBAAAA,CAAgB,YAAY,MAAM,GACrC;CAcF,OAXgB,YAAY,OAA0C,KAAK,UAAU;EAQnF,OAAO;GANL,SAAS,MAAM;GACf,MAAM,MAAM;GACZ,WAAW,MAAM;GACjB,MAAO,MAAM,YAAoD;EAGjD;CACpB,CAEY;AACd;AAEA,SAAgB,yBAAyB,KAAa,eAA+D;CACnH,OAAO,cAAc,mBAAmB,MAAM,mBAAA,GAAkBC,kCAAAA,UAAAA,CAAU,CAAC,cAAc,KAAK,GAAG,GAAG,CAAC;AACvG;AAEA,SAAgB,8BACd,SACA,eAAwB,OACK;CAC7B,IAAI;CAEJ,IAAI,QAAQ,WAAW,QACrB,cAAc,gBAAgB,QAAQ,WAAW;MAC5C,IAAI,QAAQ,WAAW,OAC5B,cAAc,0BAA0B,QAAQ,GAAG;CAGrD,IAAI,CAAC,aACH;CAGF,OAAO,wBAAwB,aAAa,YAAY;AAC1D;AAEA,SAAS,gBAAgB,aAAsD;CAC7E,IAAI,CAAC,eAAe,OAAO,gBAAgB,UACzC;CAGF,MAAM,eAAA,GAAcF,kCAAAA,aAAAA,CAKjB,WAAW;CAEd,IAAI,CAAC,aACH;CAGF,OAAO;EACL,OAAO,YAAY;EACnB,eAAe,YAAY;EAC3B,WAAW,YAAY,YAAY,KAAK,UAAU,YAAY,SAAS,IAAI,KAAA;EAC3E,eAAe,YAAY;CAC7B;AACF;AAEA,SAAS,0BAA0B,KAAiC;CAClE,MAAM,gBAAA,GAAeG,kCAAAA,SAAAA,CAAS,GAAG,CAAC,CAAC;CACnC,MAAM,iBAAiB,aAAa,IAAI,WAAW;CACnD,MAAM,YAAY,mBAAA,GAAkBH,kCAAAA,aAAAA,CAAa,cAAc,MAAM,KAAA,IAAY,iBAAiB,KAAA;CAElG,OAAO;EACL,OAAO,aAAa,IAAI,OAAO,KAAK,KAAA;EACpC,eAAe,aAAa,IAAI,eAAe,KAAK,KAAA;EACpD;EACA,eAAe,aAAa,IAAI,eAAe,KAAK,KAAA;CACtD;AACF;AAEA,SAAS,wBAAwB,aAAiC,cAAwC;CACxG,IAAI;CACJ,IAAI;CACJ,IAAI;CAEJ,IAAI,YAAY,OAAO;EACrB,MAAM,eAAe,YAAY,MAAM,KAAK;EAC5C,gBAAgB,iBAAiB,YAAY;EAC7C,IAAI,cACF,WAAA,GAAUI,kCAAAA,aAAAA,CAAa,cAAc,uBAAuB,KAAK;CAErE;CAEA,IAAI,CAAC,eAAe;EAClB,MAAM,WAAW,YAAY;EAC7B,IAAI,aAAa,WAAW,aAAa,cAAc,aAAa,gBAClE,gBAAgB;CAEpB;CAEA,IAAI,YAAY,WACd,YAAY,YAAY;CAG1B,OAAO;EACL;EACA,eAAe,YAAY;EAC3B;EACA;CACF;AACF;AAEA,SAAS,iBAAiB,OAAe;CACvC,OAAO,MAAM,MAAM,sCAAsC,CAAC,GAAG;AAC/D"}
|