@elenjical-ai/browser 0.0.0-stage → 10.76.2
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 +21 -0
- package/README.md +57 -2
- package/build/npm/cjs/dev/client.js +77 -0
- package/build/npm/cjs/dev/client.js.map +1 -0
- package/build/npm/cjs/dev/debug-build.js +6 -0
- package/build/npm/cjs/dev/debug-build.js.map +1 -0
- package/build/npm/cjs/dev/diagnose-sdk.js +34 -0
- package/build/npm/cjs/dev/diagnose-sdk.js.map +1 -0
- package/build/npm/cjs/dev/eventbuilder.js +231 -0
- package/build/npm/cjs/dev/eventbuilder.js.map +1 -0
- package/build/npm/cjs/dev/feedbackAsync.js +11 -0
- package/build/npm/cjs/dev/feedbackAsync.js.map +1 -0
- package/build/npm/cjs/dev/feedbackSync.js +11 -0
- package/build/npm/cjs/dev/feedbackSync.js.map +1 -0
- package/build/npm/cjs/dev/helpers.js +108 -0
- package/build/npm/cjs/dev/helpers.js.map +1 -0
- package/build/npm/cjs/dev/index.js +208 -0
- package/build/npm/cjs/dev/index.js.map +1 -0
- package/build/npm/cjs/dev/integrations/breadcrumbs.js +249 -0
- package/build/npm/cjs/dev/integrations/breadcrumbs.js.map +1 -0
- package/build/npm/cjs/dev/integrations/browserapierrors.js +167 -0
- package/build/npm/cjs/dev/integrations/browserapierrors.js.map +1 -0
- package/build/npm/cjs/dev/integrations/browsersession.js +50 -0
- package/build/npm/cjs/dev/integrations/browsersession.js.map +1 -0
- package/build/npm/cjs/dev/integrations/contextlines.js +53 -0
- package/build/npm/cjs/dev/integrations/contextlines.js.map +1 -0
- package/build/npm/cjs/dev/integrations/culturecontext.js +50 -0
- package/build/npm/cjs/dev/integrations/culturecontext.js.map +1 -0
- package/build/npm/cjs/dev/integrations/featureFlags/growthbook/integration.js +8 -0
- package/build/npm/cjs/dev/integrations/featureFlags/growthbook/integration.js.map +1 -0
- package/build/npm/cjs/dev/integrations/featureFlags/launchdarkly/integration.js +30 -0
- package/build/npm/cjs/dev/integrations/featureFlags/launchdarkly/integration.js.map +1 -0
- package/build/npm/cjs/dev/integrations/featureFlags/openfeature/integration.js +32 -0
- package/build/npm/cjs/dev/integrations/featureFlags/openfeature/integration.js.map +1 -0
- package/build/npm/cjs/dev/integrations/featureFlags/statsig/integration.js +23 -0
- package/build/npm/cjs/dev/integrations/featureFlags/statsig/integration.js.map +1 -0
- package/build/npm/cjs/dev/integrations/featureFlags/unleash/integration.js +37 -0
- package/build/npm/cjs/dev/integrations/featureFlags/unleash/integration.js.map +1 -0
- package/build/npm/cjs/dev/integrations/fetchStreamPerformance.js +60 -0
- package/build/npm/cjs/dev/integrations/fetchStreamPerformance.js.map +1 -0
- package/build/npm/cjs/dev/integrations/globalhandlers.js +143 -0
- package/build/npm/cjs/dev/integrations/globalhandlers.js.map +1 -0
- package/build/npm/cjs/dev/integrations/graphqlClient.js +148 -0
- package/build/npm/cjs/dev/integrations/graphqlClient.js.map +1 -0
- package/build/npm/cjs/dev/integrations/httpclient.js +250 -0
- package/build/npm/cjs/dev/integrations/httpclient.js.map +1 -0
- package/build/npm/cjs/dev/integrations/httpcontext.js +47 -0
- package/build/npm/cjs/dev/integrations/httpcontext.js.map +1 -0
- package/build/npm/cjs/dev/integrations/linkederrors.js +31 -0
- package/build/npm/cjs/dev/integrations/linkederrors.js.map +1 -0
- package/build/npm/cjs/dev/integrations/reportingobserver.js +60 -0
- package/build/npm/cjs/dev/integrations/reportingobserver.js.map +1 -0
- package/build/npm/cjs/dev/integrations/spanstreaming.js +49 -0
- package/build/npm/cjs/dev/integrations/spanstreaming.js.map +1 -0
- package/build/npm/cjs/dev/integrations/spotlight.js +61 -0
- package/build/npm/cjs/dev/integrations/spotlight.js.map +1 -0
- package/build/npm/cjs/dev/integrations/view-hierarchy.js +74 -0
- package/build/npm/cjs/dev/integrations/view-hierarchy.js.map +1 -0
- package/build/npm/cjs/dev/integrations/webVitals.js +62 -0
- package/build/npm/cjs/dev/integrations/webVitals.js.map +1 -0
- package/build/npm/cjs/dev/integrations/webWorker.js +133 -0
- package/build/npm/cjs/dev/integrations/webWorker.js.map +1 -0
- package/build/npm/cjs/dev/normalizeStringifyValue.js +27 -0
- package/build/npm/cjs/dev/normalizeStringifyValue.js.map +1 -0
- package/build/npm/cjs/dev/profiling/UIProfiler.js +306 -0
- package/build/npm/cjs/dev/profiling/UIProfiler.js.map +1 -0
- package/build/npm/cjs/dev/profiling/index.js +38 -0
- package/build/npm/cjs/dev/profiling/index.js.map +1 -0
- package/build/npm/cjs/dev/profiling/integration.js +120 -0
- package/build/npm/cjs/dev/profiling/integration.js.map +1 -0
- package/build/npm/cjs/dev/profiling/startProfileForSpan.js +91 -0
- package/build/npm/cjs/dev/profiling/startProfileForSpan.js.map +1 -0
- package/build/npm/cjs/dev/profiling/utils.js +498 -0
- package/build/npm/cjs/dev/profiling/utils.js.map +1 -0
- package/build/npm/cjs/dev/report-dialog.js +53 -0
- package/build/npm/cjs/dev/report-dialog.js.map +1 -0
- package/build/npm/cjs/dev/sdk.js +70 -0
- package/build/npm/cjs/dev/sdk.js.map +1 -0
- package/build/npm/cjs/dev/stack-parsers.js +118 -0
- package/build/npm/cjs/dev/stack-parsers.js.map +1 -0
- package/build/npm/cjs/dev/tracing/backgroundtab.js +34 -0
- package/build/npm/cjs/dev/tracing/backgroundtab.js.map +1 -0
- package/build/npm/cjs/dev/tracing/browserTracingIntegration.js +437 -0
- package/build/npm/cjs/dev/tracing/browserTracingIntegration.js.map +1 -0
- package/build/npm/cjs/dev/tracing/linkedTraces.js +140 -0
- package/build/npm/cjs/dev/tracing/linkedTraces.js.map +1 -0
- package/build/npm/cjs/dev/tracing/reportPageLoaded.js +10 -0
- package/build/npm/cjs/dev/tracing/reportPageLoaded.js.map +1 -0
- package/build/npm/cjs/dev/tracing/request.js +236 -0
- package/build/npm/cjs/dev/tracing/request.js.map +1 -0
- package/build/npm/cjs/dev/tracing/setActiveSpan.js +21 -0
- package/build/npm/cjs/dev/tracing/setActiveSpan.js.map +1 -0
- package/build/npm/cjs/dev/tracing/utils.js +31 -0
- package/build/npm/cjs/dev/tracing/utils.js.map +1 -0
- package/build/npm/cjs/dev/transports/fetch.js +58 -0
- package/build/npm/cjs/dev/transports/fetch.js.map +1 -0
- package/build/npm/cjs/dev/transports/offline.js +111 -0
- package/build/npm/cjs/dev/transports/offline.js.map +1 -0
- package/build/npm/cjs/dev/userfeedback.js +32 -0
- package/build/npm/cjs/dev/userfeedback.js.map +1 -0
- package/build/npm/cjs/dev/utils/detectBrowserExtension.js +38 -0
- package/build/npm/cjs/dev/utils/detectBrowserExtension.js.map +1 -0
- package/build/npm/cjs/dev/utils/lazyLoadIntegration.js +92 -0
- package/build/npm/cjs/dev/utils/lazyLoadIntegration.js.map +1 -0
- package/build/npm/cjs/prod/client.js +77 -0
- package/build/npm/cjs/prod/client.js.map +1 -0
- package/build/npm/cjs/prod/debug-build.js +6 -0
- package/build/npm/cjs/prod/debug-build.js.map +1 -0
- package/build/npm/cjs/prod/diagnose-sdk.js +34 -0
- package/build/npm/cjs/prod/diagnose-sdk.js.map +1 -0
- package/build/npm/cjs/prod/eventbuilder.js +231 -0
- package/build/npm/cjs/prod/eventbuilder.js.map +1 -0
- package/build/npm/cjs/prod/feedbackAsync.js +11 -0
- package/build/npm/cjs/prod/feedbackAsync.js.map +1 -0
- package/build/npm/cjs/prod/feedbackSync.js +11 -0
- package/build/npm/cjs/prod/feedbackSync.js.map +1 -0
- package/build/npm/cjs/prod/helpers.js +108 -0
- package/build/npm/cjs/prod/helpers.js.map +1 -0
- package/build/npm/cjs/prod/index.js +208 -0
- package/build/npm/cjs/prod/index.js.map +1 -0
- package/build/npm/cjs/prod/integrations/breadcrumbs.js +249 -0
- package/build/npm/cjs/prod/integrations/breadcrumbs.js.map +1 -0
- package/build/npm/cjs/prod/integrations/browserapierrors.js +167 -0
- package/build/npm/cjs/prod/integrations/browserapierrors.js.map +1 -0
- package/build/npm/cjs/prod/integrations/browsersession.js +50 -0
- package/build/npm/cjs/prod/integrations/browsersession.js.map +1 -0
- package/build/npm/cjs/prod/integrations/contextlines.js +53 -0
- package/build/npm/cjs/prod/integrations/contextlines.js.map +1 -0
- package/build/npm/cjs/prod/integrations/culturecontext.js +50 -0
- package/build/npm/cjs/prod/integrations/culturecontext.js.map +1 -0
- package/build/npm/cjs/prod/integrations/featureFlags/growthbook/integration.js +8 -0
- package/build/npm/cjs/prod/integrations/featureFlags/growthbook/integration.js.map +1 -0
- package/build/npm/cjs/prod/integrations/featureFlags/launchdarkly/integration.js +30 -0
- package/build/npm/cjs/prod/integrations/featureFlags/launchdarkly/integration.js.map +1 -0
- package/build/npm/cjs/prod/integrations/featureFlags/openfeature/integration.js +32 -0
- package/build/npm/cjs/prod/integrations/featureFlags/openfeature/integration.js.map +1 -0
- package/build/npm/cjs/prod/integrations/featureFlags/statsig/integration.js +23 -0
- package/build/npm/cjs/prod/integrations/featureFlags/statsig/integration.js.map +1 -0
- package/build/npm/cjs/prod/integrations/featureFlags/unleash/integration.js +37 -0
- package/build/npm/cjs/prod/integrations/featureFlags/unleash/integration.js.map +1 -0
- package/build/npm/cjs/prod/integrations/fetchStreamPerformance.js +60 -0
- package/build/npm/cjs/prod/integrations/fetchStreamPerformance.js.map +1 -0
- package/build/npm/cjs/prod/integrations/globalhandlers.js +143 -0
- package/build/npm/cjs/prod/integrations/globalhandlers.js.map +1 -0
- package/build/npm/cjs/prod/integrations/graphqlClient.js +148 -0
- package/build/npm/cjs/prod/integrations/graphqlClient.js.map +1 -0
- package/build/npm/cjs/prod/integrations/httpclient.js +250 -0
- package/build/npm/cjs/prod/integrations/httpclient.js.map +1 -0
- package/build/npm/cjs/prod/integrations/httpcontext.js +47 -0
- package/build/npm/cjs/prod/integrations/httpcontext.js.map +1 -0
- package/build/npm/cjs/prod/integrations/linkederrors.js +31 -0
- package/build/npm/cjs/prod/integrations/linkederrors.js.map +1 -0
- package/build/npm/cjs/prod/integrations/reportingobserver.js +60 -0
- package/build/npm/cjs/prod/integrations/reportingobserver.js.map +1 -0
- package/build/npm/cjs/prod/integrations/spanstreaming.js +49 -0
- package/build/npm/cjs/prod/integrations/spanstreaming.js.map +1 -0
- package/build/npm/cjs/prod/integrations/spotlight.js +61 -0
- package/build/npm/cjs/prod/integrations/spotlight.js.map +1 -0
- package/build/npm/cjs/prod/integrations/view-hierarchy.js +74 -0
- package/build/npm/cjs/prod/integrations/view-hierarchy.js.map +1 -0
- package/build/npm/cjs/prod/integrations/webVitals.js +62 -0
- package/build/npm/cjs/prod/integrations/webVitals.js.map +1 -0
- package/build/npm/cjs/prod/integrations/webWorker.js +133 -0
- package/build/npm/cjs/prod/integrations/webWorker.js.map +1 -0
- package/build/npm/cjs/prod/normalizeStringifyValue.js +27 -0
- package/build/npm/cjs/prod/normalizeStringifyValue.js.map +1 -0
- package/build/npm/cjs/prod/profiling/UIProfiler.js +306 -0
- package/build/npm/cjs/prod/profiling/UIProfiler.js.map +1 -0
- package/build/npm/cjs/prod/profiling/index.js +38 -0
- package/build/npm/cjs/prod/profiling/index.js.map +1 -0
- package/build/npm/cjs/prod/profiling/integration.js +120 -0
- package/build/npm/cjs/prod/profiling/integration.js.map +1 -0
- package/build/npm/cjs/prod/profiling/startProfileForSpan.js +91 -0
- package/build/npm/cjs/prod/profiling/startProfileForSpan.js.map +1 -0
- package/build/npm/cjs/prod/profiling/utils.js +498 -0
- package/build/npm/cjs/prod/profiling/utils.js.map +1 -0
- package/build/npm/cjs/prod/report-dialog.js +53 -0
- package/build/npm/cjs/prod/report-dialog.js.map +1 -0
- package/build/npm/cjs/prod/sdk.js +60 -0
- package/build/npm/cjs/prod/sdk.js.map +1 -0
- package/build/npm/cjs/prod/stack-parsers.js +118 -0
- package/build/npm/cjs/prod/stack-parsers.js.map +1 -0
- package/build/npm/cjs/prod/tracing/backgroundtab.js +34 -0
- package/build/npm/cjs/prod/tracing/backgroundtab.js.map +1 -0
- package/build/npm/cjs/prod/tracing/browserTracingIntegration.js +437 -0
- package/build/npm/cjs/prod/tracing/browserTracingIntegration.js.map +1 -0
- package/build/npm/cjs/prod/tracing/linkedTraces.js +139 -0
- package/build/npm/cjs/prod/tracing/linkedTraces.js.map +1 -0
- package/build/npm/cjs/prod/tracing/reportPageLoaded.js +10 -0
- package/build/npm/cjs/prod/tracing/reportPageLoaded.js.map +1 -0
- package/build/npm/cjs/prod/tracing/request.js +236 -0
- package/build/npm/cjs/prod/tracing/request.js.map +1 -0
- package/build/npm/cjs/prod/tracing/setActiveSpan.js +21 -0
- package/build/npm/cjs/prod/tracing/setActiveSpan.js.map +1 -0
- package/build/npm/cjs/prod/tracing/utils.js +31 -0
- package/build/npm/cjs/prod/tracing/utils.js.map +1 -0
- package/build/npm/cjs/prod/transports/fetch.js +58 -0
- package/build/npm/cjs/prod/transports/fetch.js.map +1 -0
- package/build/npm/cjs/prod/transports/offline.js +111 -0
- package/build/npm/cjs/prod/transports/offline.js.map +1 -0
- package/build/npm/cjs/prod/userfeedback.js +32 -0
- package/build/npm/cjs/prod/userfeedback.js.map +1 -0
- package/build/npm/cjs/prod/utils/detectBrowserExtension.js +38 -0
- package/build/npm/cjs/prod/utils/detectBrowserExtension.js.map +1 -0
- package/build/npm/cjs/prod/utils/lazyLoadIntegration.js +92 -0
- package/build/npm/cjs/prod/utils/lazyLoadIntegration.js.map +1 -0
- package/build/npm/esm/dev/client.js +74 -0
- package/build/npm/esm/dev/client.js.map +1 -0
- package/build/npm/esm/dev/debug-build.js +4 -0
- package/build/npm/esm/dev/debug-build.js.map +1 -0
- package/build/npm/esm/dev/diagnose-sdk.js +32 -0
- package/build/npm/esm/dev/diagnose-sdk.js.map +1 -0
- package/build/npm/esm/dev/eventbuilder.js +224 -0
- package/build/npm/esm/dev/eventbuilder.js.map +1 -0
- package/build/npm/esm/dev/feedbackAsync.js +9 -0
- package/build/npm/esm/dev/feedbackAsync.js.map +1 -0
- package/build/npm/esm/dev/feedbackSync.js +9 -0
- package/build/npm/esm/dev/feedbackSync.js.map +1 -0
- package/build/npm/esm/dev/helpers.js +102 -0
- package/build/npm/esm/dev/helpers.js.map +1 -0
- package/build/npm/esm/dev/index.js +48 -0
- package/build/npm/esm/dev/index.js.map +1 -0
- package/build/npm/esm/dev/integrations/breadcrumbs.js +247 -0
- package/build/npm/esm/dev/integrations/breadcrumbs.js.map +1 -0
- package/build/npm/esm/dev/integrations/browserapierrors.js +165 -0
- package/build/npm/esm/dev/integrations/browserapierrors.js.map +1 -0
- package/build/npm/esm/dev/integrations/browsersession.js +48 -0
- package/build/npm/esm/dev/integrations/browsersession.js.map +1 -0
- package/build/npm/esm/dev/integrations/contextlines.js +50 -0
- package/build/npm/esm/dev/integrations/contextlines.js.map +1 -0
- package/build/npm/esm/dev/integrations/culturecontext.js +48 -0
- package/build/npm/esm/dev/integrations/culturecontext.js.map +1 -0
- package/build/npm/esm/dev/integrations/featureFlags/growthbook/integration.js +6 -0
- package/build/npm/esm/dev/integrations/featureFlags/growthbook/integration.js.map +1 -0
- package/build/npm/esm/dev/integrations/featureFlags/launchdarkly/integration.js +27 -0
- package/build/npm/esm/dev/integrations/featureFlags/launchdarkly/integration.js.map +1 -0
- package/build/npm/esm/dev/integrations/featureFlags/openfeature/integration.js +29 -0
- package/build/npm/esm/dev/integrations/featureFlags/openfeature/integration.js.map +1 -0
- package/build/npm/esm/dev/integrations/featureFlags/statsig/integration.js +21 -0
- package/build/npm/esm/dev/integrations/featureFlags/statsig/integration.js.map +1 -0
- package/build/npm/esm/dev/integrations/featureFlags/unleash/integration.js +35 -0
- package/build/npm/esm/dev/integrations/featureFlags/unleash/integration.js.map +1 -0
- package/build/npm/esm/dev/integrations/fetchStreamPerformance.js +58 -0
- package/build/npm/esm/dev/integrations/fetchStreamPerformance.js.map +1 -0
- package/build/npm/esm/dev/integrations/globalhandlers.js +139 -0
- package/build/npm/esm/dev/integrations/globalhandlers.js.map +1 -0
- package/build/npm/esm/dev/integrations/graphqlClient.js +142 -0
- package/build/npm/esm/dev/integrations/graphqlClient.js.map +1 -0
- package/build/npm/esm/dev/integrations/httpclient.js +248 -0
- package/build/npm/esm/dev/integrations/httpclient.js.map +1 -0
- package/build/npm/esm/dev/integrations/httpcontext.js +45 -0
- package/build/npm/esm/dev/integrations/httpcontext.js.map +1 -0
- package/build/npm/esm/dev/integrations/linkederrors.js +29 -0
- package/build/npm/esm/dev/integrations/linkederrors.js.map +1 -0
- package/build/npm/esm/dev/integrations/reportingobserver.js +58 -0
- package/build/npm/esm/dev/integrations/reportingobserver.js.map +1 -0
- package/build/npm/esm/dev/integrations/spanstreaming.js +47 -0
- package/build/npm/esm/dev/integrations/spanstreaming.js.map +1 -0
- package/build/npm/esm/dev/integrations/spotlight.js +57 -0
- package/build/npm/esm/dev/integrations/spotlight.js.map +1 -0
- package/build/npm/esm/dev/integrations/view-hierarchy.js +72 -0
- package/build/npm/esm/dev/integrations/view-hierarchy.js.map +1 -0
- package/build/npm/esm/dev/integrations/webVitals.js +59 -0
- package/build/npm/esm/dev/integrations/webVitals.js.map +1 -0
- package/build/npm/esm/dev/integrations/webWorker.js +129 -0
- package/build/npm/esm/dev/integrations/webWorker.js.map +1 -0
- package/build/npm/esm/dev/normalizeStringifyValue.js +25 -0
- package/build/npm/esm/dev/normalizeStringifyValue.js.map +1 -0
- package/build/npm/esm/dev/package.json +1 -0
- package/build/npm/esm/dev/profiling/UIProfiler.js +304 -0
- package/build/npm/esm/dev/profiling/UIProfiler.js.map +1 -0
- package/build/npm/esm/dev/profiling/index.js +36 -0
- package/build/npm/esm/dev/profiling/index.js.map +1 -0
- package/build/npm/esm/dev/profiling/integration.js +118 -0
- package/build/npm/esm/dev/profiling/integration.js.map +1 -0
- package/build/npm/esm/dev/profiling/startProfileForSpan.js +89 -0
- package/build/npm/esm/dev/profiling/startProfileForSpan.js.map +1 -0
- package/build/npm/esm/dev/profiling/utils.js +474 -0
- package/build/npm/esm/dev/profiling/utils.js.map +1 -0
- package/build/npm/esm/dev/report-dialog.js +51 -0
- package/build/npm/esm/dev/report-dialog.js.map +1 -0
- package/build/npm/esm/dev/sdk.js +65 -0
- package/build/npm/esm/dev/sdk.js.map +1 -0
- package/build/npm/esm/dev/stack-parsers.js +110 -0
- package/build/npm/esm/dev/stack-parsers.js.map +1 -0
- package/build/npm/esm/dev/tracing/backgroundtab.js +32 -0
- package/build/npm/esm/dev/tracing/backgroundtab.js.map +1 -0
- package/build/npm/esm/dev/tracing/browserTracingIntegration.js +429 -0
- package/build/npm/esm/dev/tracing/browserTracingIntegration.js.map +1 -0
- package/build/npm/esm/dev/tracing/linkedTraces.js +131 -0
- package/build/npm/esm/dev/tracing/linkedTraces.js.map +1 -0
- package/build/npm/esm/dev/tracing/reportPageLoaded.js +8 -0
- package/build/npm/esm/dev/tracing/reportPageLoaded.js.map +1 -0
- package/build/npm/esm/dev/tracing/request.js +232 -0
- package/build/npm/esm/dev/tracing/request.js.map +1 -0
- package/build/npm/esm/dev/tracing/setActiveSpan.js +19 -0
- package/build/npm/esm/dev/tracing/setActiveSpan.js.map +1 -0
- package/build/npm/esm/dev/tracing/utils.js +26 -0
- package/build/npm/esm/dev/tracing/utils.js.map +1 -0
- package/build/npm/esm/dev/transports/fetch.js +56 -0
- package/build/npm/esm/dev/transports/fetch.js.map +1 -0
- package/build/npm/esm/dev/transports/offline.js +105 -0
- package/build/npm/esm/dev/transports/offline.js.map +1 -0
- package/build/npm/esm/dev/userfeedback.js +30 -0
- package/build/npm/esm/dev/userfeedback.js.map +1 -0
- package/build/npm/esm/dev/utils/detectBrowserExtension.js +36 -0
- package/build/npm/esm/dev/utils/detectBrowserExtension.js.map +1 -0
- package/build/npm/esm/dev/utils/lazyLoadIntegration.js +89 -0
- package/build/npm/esm/dev/utils/lazyLoadIntegration.js.map +1 -0
- package/build/npm/esm/prod/client.js +74 -0
- package/build/npm/esm/prod/client.js.map +1 -0
- package/build/npm/esm/prod/debug-build.js +4 -0
- package/build/npm/esm/prod/debug-build.js.map +1 -0
- package/build/npm/esm/prod/diagnose-sdk.js +32 -0
- package/build/npm/esm/prod/diagnose-sdk.js.map +1 -0
- package/build/npm/esm/prod/eventbuilder.js +224 -0
- package/build/npm/esm/prod/eventbuilder.js.map +1 -0
- package/build/npm/esm/prod/feedbackAsync.js +9 -0
- package/build/npm/esm/prod/feedbackAsync.js.map +1 -0
- package/build/npm/esm/prod/feedbackSync.js +9 -0
- package/build/npm/esm/prod/feedbackSync.js.map +1 -0
- package/build/npm/esm/prod/helpers.js +102 -0
- package/build/npm/esm/prod/helpers.js.map +1 -0
- package/build/npm/esm/prod/index.js +48 -0
- package/build/npm/esm/prod/index.js.map +1 -0
- package/build/npm/esm/prod/integrations/breadcrumbs.js +247 -0
- package/build/npm/esm/prod/integrations/breadcrumbs.js.map +1 -0
- package/build/npm/esm/prod/integrations/browserapierrors.js +165 -0
- package/build/npm/esm/prod/integrations/browserapierrors.js.map +1 -0
- package/build/npm/esm/prod/integrations/browsersession.js +48 -0
- package/build/npm/esm/prod/integrations/browsersession.js.map +1 -0
- package/build/npm/esm/prod/integrations/contextlines.js +50 -0
- package/build/npm/esm/prod/integrations/contextlines.js.map +1 -0
- package/build/npm/esm/prod/integrations/culturecontext.js +48 -0
- package/build/npm/esm/prod/integrations/culturecontext.js.map +1 -0
- package/build/npm/esm/prod/integrations/featureFlags/growthbook/integration.js +6 -0
- package/build/npm/esm/prod/integrations/featureFlags/growthbook/integration.js.map +1 -0
- package/build/npm/esm/prod/integrations/featureFlags/launchdarkly/integration.js +27 -0
- package/build/npm/esm/prod/integrations/featureFlags/launchdarkly/integration.js.map +1 -0
- package/build/npm/esm/prod/integrations/featureFlags/openfeature/integration.js +29 -0
- package/build/npm/esm/prod/integrations/featureFlags/openfeature/integration.js.map +1 -0
- package/build/npm/esm/prod/integrations/featureFlags/statsig/integration.js +21 -0
- package/build/npm/esm/prod/integrations/featureFlags/statsig/integration.js.map +1 -0
- package/build/npm/esm/prod/integrations/featureFlags/unleash/integration.js +35 -0
- package/build/npm/esm/prod/integrations/featureFlags/unleash/integration.js.map +1 -0
- package/build/npm/esm/prod/integrations/fetchStreamPerformance.js +58 -0
- package/build/npm/esm/prod/integrations/fetchStreamPerformance.js.map +1 -0
- package/build/npm/esm/prod/integrations/globalhandlers.js +139 -0
- package/build/npm/esm/prod/integrations/globalhandlers.js.map +1 -0
- package/build/npm/esm/prod/integrations/graphqlClient.js +142 -0
- package/build/npm/esm/prod/integrations/graphqlClient.js.map +1 -0
- package/build/npm/esm/prod/integrations/httpclient.js +248 -0
- package/build/npm/esm/prod/integrations/httpclient.js.map +1 -0
- package/build/npm/esm/prod/integrations/httpcontext.js +45 -0
- package/build/npm/esm/prod/integrations/httpcontext.js.map +1 -0
- package/build/npm/esm/prod/integrations/linkederrors.js +29 -0
- package/build/npm/esm/prod/integrations/linkederrors.js.map +1 -0
- package/build/npm/esm/prod/integrations/reportingobserver.js +58 -0
- package/build/npm/esm/prod/integrations/reportingobserver.js.map +1 -0
- package/build/npm/esm/prod/integrations/spanstreaming.js +47 -0
- package/build/npm/esm/prod/integrations/spanstreaming.js.map +1 -0
- package/build/npm/esm/prod/integrations/spotlight.js +57 -0
- package/build/npm/esm/prod/integrations/spotlight.js.map +1 -0
- package/build/npm/esm/prod/integrations/view-hierarchy.js +72 -0
- package/build/npm/esm/prod/integrations/view-hierarchy.js.map +1 -0
- package/build/npm/esm/prod/integrations/webVitals.js +59 -0
- package/build/npm/esm/prod/integrations/webVitals.js.map +1 -0
- package/build/npm/esm/prod/integrations/webWorker.js +129 -0
- package/build/npm/esm/prod/integrations/webWorker.js.map +1 -0
- package/build/npm/esm/prod/normalizeStringifyValue.js +25 -0
- package/build/npm/esm/prod/normalizeStringifyValue.js.map +1 -0
- package/build/npm/esm/prod/package.json +1 -0
- package/build/npm/esm/prod/profiling/UIProfiler.js +304 -0
- package/build/npm/esm/prod/profiling/UIProfiler.js.map +1 -0
- package/build/npm/esm/prod/profiling/index.js +36 -0
- package/build/npm/esm/prod/profiling/index.js.map +1 -0
- package/build/npm/esm/prod/profiling/integration.js +118 -0
- package/build/npm/esm/prod/profiling/integration.js.map +1 -0
- package/build/npm/esm/prod/profiling/startProfileForSpan.js +89 -0
- package/build/npm/esm/prod/profiling/startProfileForSpan.js.map +1 -0
- package/build/npm/esm/prod/profiling/utils.js +474 -0
- package/build/npm/esm/prod/profiling/utils.js.map +1 -0
- package/build/npm/esm/prod/report-dialog.js +51 -0
- package/build/npm/esm/prod/report-dialog.js.map +1 -0
- package/build/npm/esm/prod/sdk.js +55 -0
- package/build/npm/esm/prod/sdk.js.map +1 -0
- package/build/npm/esm/prod/stack-parsers.js +110 -0
- package/build/npm/esm/prod/stack-parsers.js.map +1 -0
- package/build/npm/esm/prod/tracing/backgroundtab.js +32 -0
- package/build/npm/esm/prod/tracing/backgroundtab.js.map +1 -0
- package/build/npm/esm/prod/tracing/browserTracingIntegration.js +429 -0
- package/build/npm/esm/prod/tracing/browserTracingIntegration.js.map +1 -0
- package/build/npm/esm/prod/tracing/linkedTraces.js +130 -0
- package/build/npm/esm/prod/tracing/linkedTraces.js.map +1 -0
- package/build/npm/esm/prod/tracing/reportPageLoaded.js +8 -0
- package/build/npm/esm/prod/tracing/reportPageLoaded.js.map +1 -0
- package/build/npm/esm/prod/tracing/request.js +232 -0
- package/build/npm/esm/prod/tracing/request.js.map +1 -0
- package/build/npm/esm/prod/tracing/setActiveSpan.js +19 -0
- package/build/npm/esm/prod/tracing/setActiveSpan.js.map +1 -0
- package/build/npm/esm/prod/tracing/utils.js +26 -0
- package/build/npm/esm/prod/tracing/utils.js.map +1 -0
- package/build/npm/esm/prod/transports/fetch.js +56 -0
- package/build/npm/esm/prod/transports/fetch.js.map +1 -0
- package/build/npm/esm/prod/transports/offline.js +105 -0
- package/build/npm/esm/prod/transports/offline.js.map +1 -0
- package/build/npm/esm/prod/userfeedback.js +30 -0
- package/build/npm/esm/prod/userfeedback.js.map +1 -0
- package/build/npm/esm/prod/utils/detectBrowserExtension.js +36 -0
- package/build/npm/esm/prod/utils/detectBrowserExtension.js.map +1 -0
- package/build/npm/esm/prod/utils/lazyLoadIntegration.js +89 -0
- package/build/npm/esm/prod/utils/lazyLoadIntegration.js.map +1 -0
- package/build/npm/types/client.d.ts +79 -0
- package/build/npm/types/client.d.ts.map +1 -0
- package/build/npm/types/debug-build.d.ts +7 -0
- package/build/npm/types/debug-build.d.ts.map +1 -0
- package/build/npm/types/diagnose-sdk.d.ts +11 -0
- package/build/npm/types/diagnose-sdk.d.ts.map +1 -0
- package/build/npm/types/eventbuilder.d.ts +40 -0
- package/build/npm/types/eventbuilder.d.ts.map +1 -0
- package/build/npm/types/exports.d.ts +21 -0
- package/build/npm/types/exports.d.ts.map +1 -0
- package/build/npm/types/feedbackAsync.d.ts +7 -0
- package/build/npm/types/feedbackAsync.d.ts.map +1 -0
- package/build/npm/types/feedbackSync.d.ts +4 -0
- package/build/npm/types/feedbackSync.d.ts.map +1 -0
- package/build/npm/types/helpers.d.ts +27 -0
- package/build/npm/types/helpers.d.ts.map +1 -0
- package/build/npm/types/index.bundle.base.d.ts +2 -0
- package/build/npm/types/index.bundle.base.d.ts.map +1 -0
- package/build/npm/types/index.bundle.d.ts +5 -0
- package/build/npm/types/index.bundle.d.ts.map +1 -0
- package/build/npm/types/index.bundle.feedback.d.ts +7 -0
- package/build/npm/types/index.bundle.feedback.d.ts.map +1 -0
- package/build/npm/types/index.bundle.logs.metrics.d.ts +6 -0
- package/build/npm/types/index.bundle.logs.metrics.d.ts.map +1 -0
- package/build/npm/types/index.bundle.replay.d.ts +6 -0
- package/build/npm/types/index.bundle.replay.d.ts.map +1 -0
- package/build/npm/types/index.bundle.replay.feedback.d.ts +8 -0
- package/build/npm/types/index.bundle.replay.feedback.d.ts.map +1 -0
- package/build/npm/types/index.bundle.replay.logs.metrics.d.ts +7 -0
- package/build/npm/types/index.bundle.replay.logs.metrics.d.ts.map +1 -0
- package/build/npm/types/index.bundle.tracing.d.ts +13 -0
- package/build/npm/types/index.bundle.tracing.d.ts.map +1 -0
- package/build/npm/types/index.bundle.tracing.logs.metrics.d.ts +13 -0
- package/build/npm/types/index.bundle.tracing.logs.metrics.d.ts.map +1 -0
- package/build/npm/types/index.bundle.tracing.replay.d.ts +14 -0
- package/build/npm/types/index.bundle.tracing.replay.d.ts.map +1 -0
- package/build/npm/types/index.bundle.tracing.replay.feedback.d.ts +16 -0
- package/build/npm/types/index.bundle.tracing.replay.feedback.d.ts.map +1 -0
- package/build/npm/types/index.bundle.tracing.replay.feedback.logs.metrics.d.ts +14 -0
- package/build/npm/types/index.bundle.tracing.replay.feedback.logs.metrics.d.ts.map +1 -0
- package/build/npm/types/index.bundle.tracing.replay.logs.metrics.d.ts +14 -0
- package/build/npm/types/index.bundle.tracing.replay.logs.metrics.d.ts.map +1 -0
- package/build/npm/types/index.d.ts +38 -0
- package/build/npm/types/index.d.ts.map +1 -0
- package/build/npm/types/integrations/breadcrumbs.d.ts +16 -0
- package/build/npm/types/integrations/breadcrumbs.d.ts.map +1 -0
- package/build/npm/types/integrations/browserapierrors.d.ts +23 -0
- package/build/npm/types/integrations/browserapierrors.d.ts.map +1 -0
- package/build/npm/types/integrations/browserprofiling.d.ts +2 -0
- package/build/npm/types/integrations/browserprofiling.d.ts.map +1 -0
- package/build/npm/types/integrations/browsersession.d.ts +25 -0
- package/build/npm/types/integrations/browsersession.d.ts.map +1 -0
- package/build/npm/types/integrations/contextlines.d.ts +32 -0
- package/build/npm/types/integrations/contextlines.d.ts.map +1 -0
- package/build/npm/types/integrations/culturecontext.d.ts +18 -0
- package/build/npm/types/integrations/culturecontext.d.ts.map +1 -0
- package/build/npm/types/integrations/featureFlags/growthbook/index.d.ts +2 -0
- package/build/npm/types/integrations/featureFlags/growthbook/index.d.ts.map +1 -0
- package/build/npm/types/integrations/featureFlags/growthbook/integration.d.ts +25 -0
- package/build/npm/types/integrations/featureFlags/growthbook/integration.d.ts.map +1 -0
- package/build/npm/types/integrations/featureFlags/growthbook/types.d.ts +6 -0
- package/build/npm/types/integrations/featureFlags/growthbook/types.d.ts.map +1 -0
- package/build/npm/types/integrations/featureFlags/launchdarkly/index.d.ts +2 -0
- package/build/npm/types/integrations/featureFlags/launchdarkly/index.d.ts.map +1 -0
- package/build/npm/types/integrations/featureFlags/launchdarkly/integration.d.ts +27 -0
- package/build/npm/types/integrations/featureFlags/launchdarkly/integration.d.ts.map +1 -0
- package/build/npm/types/integrations/featureFlags/launchdarkly/types.d.ts +44 -0
- package/build/npm/types/integrations/featureFlags/launchdarkly/types.d.ts.map +1 -0
- package/build/npm/types/integrations/featureFlags/openfeature/index.d.ts +2 -0
- package/build/npm/types/integrations/featureFlags/openfeature/index.d.ts.map +1 -0
- package/build/npm/types/integrations/featureFlags/openfeature/integration.d.ts +18 -0
- package/build/npm/types/integrations/featureFlags/openfeature/integration.d.ts.map +1 -0
- package/build/npm/types/integrations/featureFlags/openfeature/types.d.ts +78 -0
- package/build/npm/types/integrations/featureFlags/openfeature/types.d.ts.map +1 -0
- package/build/npm/types/integrations/featureFlags/statsig/index.d.ts +2 -0
- package/build/npm/types/integrations/featureFlags/statsig/index.d.ts.map +1 -0
- package/build/npm/types/integrations/featureFlags/statsig/integration.d.ts +30 -0
- package/build/npm/types/integrations/featureFlags/statsig/integration.d.ts.map +1 -0
- package/build/npm/types/integrations/featureFlags/statsig/types.d.ts +14 -0
- package/build/npm/types/integrations/featureFlags/statsig/types.d.ts.map +1 -0
- package/build/npm/types/integrations/featureFlags/unleash/index.d.ts +2 -0
- package/build/npm/types/integrations/featureFlags/unleash/index.d.ts.map +1 -0
- package/build/npm/types/integrations/featureFlags/unleash/integration.d.ts +31 -0
- package/build/npm/types/integrations/featureFlags/unleash/integration.d.ts.map +1 -0
- package/build/npm/types/integrations/featureFlags/unleash/types.d.ts +21 -0
- package/build/npm/types/integrations/featureFlags/unleash/types.d.ts.map +1 -0
- package/build/npm/types/integrations/fetchStreamPerformance.d.ts +16 -0
- package/build/npm/types/integrations/fetchStreamPerformance.d.ts.map +1 -0
- package/build/npm/types/integrations/globalhandlers.d.ts +19 -0
- package/build/npm/types/integrations/globalhandlers.d.ts.map +1 -0
- package/build/npm/types/integrations/graphqlClient.d.ts +60 -0
- package/build/npm/types/integrations/graphqlClient.d.ts.map +1 -0
- package/build/npm/types/integrations/httpclient.d.ts +29 -0
- package/build/npm/types/integrations/httpclient.d.ts.map +1 -0
- package/build/npm/types/integrations/httpcontext.d.ts +8 -0
- package/build/npm/types/integrations/httpcontext.d.ts.map +1 -0
- package/build/npm/types/integrations/linkederrors.d.ts +12 -0
- package/build/npm/types/integrations/linkederrors.d.ts.map +1 -0
- package/build/npm/types/integrations/reportingobserver.d.ts +12 -0
- package/build/npm/types/integrations/reportingobserver.d.ts.map +1 -0
- package/build/npm/types/integrations/spanstreaming.d.ts +4 -0
- package/build/npm/types/integrations/spanstreaming.d.ts.map +1 -0
- package/build/npm/types/integrations/spotlight.d.ts +21 -0
- package/build/npm/types/integrations/spotlight.d.ts.map +1 -0
- package/build/npm/types/integrations/view-hierarchy.d.ts +51 -0
- package/build/npm/types/integrations/view-hierarchy.d.ts.map +1 -0
- package/build/npm/types/integrations/webVitals.d.ts +26 -0
- package/build/npm/types/integrations/webVitals.d.ts.map +1 -0
- package/build/npm/types/integrations/webWorker.d.ts +129 -0
- package/build/npm/types/integrations/webWorker.d.ts.map +1 -0
- package/build/npm/types/integrations-bundle/index.captureconsole.d.ts +2 -0
- package/build/npm/types/integrations-bundle/index.captureconsole.d.ts.map +1 -0
- package/build/npm/types/integrations-bundle/index.createlangchaincallbackhandler.d.ts +2 -0
- package/build/npm/types/integrations-bundle/index.createlangchaincallbackhandler.d.ts.map +1 -0
- package/build/npm/types/integrations-bundle/index.dedupe.d.ts +2 -0
- package/build/npm/types/integrations-bundle/index.dedupe.d.ts.map +1 -0
- package/build/npm/types/integrations-bundle/index.extraerrordata.d.ts +2 -0
- package/build/npm/types/integrations-bundle/index.extraerrordata.d.ts.map +1 -0
- package/build/npm/types/integrations-bundle/index.feedback.d.ts +5 -0
- package/build/npm/types/integrations-bundle/index.feedback.d.ts.map +1 -0
- package/build/npm/types/integrations-bundle/index.graphqlclient.d.ts +2 -0
- package/build/npm/types/integrations-bundle/index.graphqlclient.d.ts.map +1 -0
- package/build/npm/types/integrations-bundle/index.instrumentanthropicaiclient.d.ts +2 -0
- package/build/npm/types/integrations-bundle/index.instrumentanthropicaiclient.d.ts.map +1 -0
- package/build/npm/types/integrations-bundle/index.instrumentgooglegenaiclient.d.ts +2 -0
- package/build/npm/types/integrations-bundle/index.instrumentgooglegenaiclient.d.ts.map +1 -0
- package/build/npm/types/integrations-bundle/index.instrumentlangchainembeddings.d.ts +2 -0
- package/build/npm/types/integrations-bundle/index.instrumentlangchainembeddings.d.ts.map +1 -0
- package/build/npm/types/integrations-bundle/index.instrumentlanggraph.d.ts +2 -0
- package/build/npm/types/integrations-bundle/index.instrumentlanggraph.d.ts.map +1 -0
- package/build/npm/types/integrations-bundle/index.instrumentopenaiclient.d.ts +2 -0
- package/build/npm/types/integrations-bundle/index.instrumentopenaiclient.d.ts.map +1 -0
- package/build/npm/types/integrations-bundle/index.instrumentstategraph.d.ts +2 -0
- package/build/npm/types/integrations-bundle/index.instrumentstategraph.d.ts.map +1 -0
- package/build/npm/types/integrations-bundle/index.modulemetadata.d.ts +2 -0
- package/build/npm/types/integrations-bundle/index.modulemetadata.d.ts.map +1 -0
- package/build/npm/types/integrations-bundle/index.rewriteframes.d.ts +2 -0
- package/build/npm/types/integrations-bundle/index.rewriteframes.d.ts.map +1 -0
- package/build/npm/types/integrations-bundle/index.spotlight.d.ts +2 -0
- package/build/npm/types/integrations-bundle/index.spotlight.d.ts.map +1 -0
- package/build/npm/types/normalizeStringifyValue.d.ts +15 -0
- package/build/npm/types/normalizeStringifyValue.d.ts.map +1 -0
- package/build/npm/types/pluggable-exports-bundle/index.multiplexedtransport.d.ts +2 -0
- package/build/npm/types/pluggable-exports-bundle/index.multiplexedtransport.d.ts.map +1 -0
- package/build/npm/types/profiling/UIProfiler.d.ts +75 -0
- package/build/npm/types/profiling/UIProfiler.d.ts.map +1 -0
- package/build/npm/types/profiling/index.d.ts +8 -0
- package/build/npm/types/profiling/index.d.ts.map +1 -0
- package/build/npm/types/profiling/integration.d.ts +4 -0
- package/build/npm/types/profiling/integration.d.ts.map +1 -0
- package/build/npm/types/profiling/jsSelfProfiling.d.ts +41 -0
- package/build/npm/types/profiling/jsSelfProfiling.d.ts.map +1 -0
- package/build/npm/types/profiling/startProfileForSpan.d.ts +8 -0
- package/build/npm/types/profiling/startProfileForSpan.d.ts.map +1 -0
- package/build/npm/types/profiling/utils.d.ts +112 -0
- package/build/npm/types/profiling/utils.d.ts.map +1 -0
- package/build/npm/types/report-dialog.d.ts +8 -0
- package/build/npm/types/report-dialog.d.ts.map +1 -0
- package/build/npm/types/sdk.d.ts +62 -0
- package/build/npm/types/sdk.d.ts.map +1 -0
- package/build/npm/types/stack-parsers.d.ts +9 -0
- package/build/npm/types/stack-parsers.d.ts.map +1 -0
- package/build/npm/types/tracing/backgroundtab.d.ts +6 -0
- package/build/npm/types/tracing/backgroundtab.d.ts.map +1 -0
- package/build/npm/types/tracing/browserTracingIntegration.d.ts +271 -0
- package/build/npm/types/tracing/browserTracingIntegration.d.ts.map +1 -0
- package/build/npm/types/tracing/linkedTraces.d.ts +52 -0
- package/build/npm/types/tracing/linkedTraces.d.ts.map +1 -0
- package/build/npm/types/tracing/reportPageLoaded.d.ts +11 -0
- package/build/npm/types/tracing/reportPageLoaded.d.ts.map +1 -0
- package/build/npm/types/tracing/request.d.ts +87 -0
- package/build/npm/types/tracing/request.d.ts.map +1 -0
- package/build/npm/types/tracing/setActiveSpan.d.ts +39 -0
- package/build/npm/types/tracing/setActiveSpan.d.ts.map +1 -0
- package/build/npm/types/tracing/utils.d.ts +17 -0
- package/build/npm/types/tracing/utils.d.ts.map +1 -0
- package/build/npm/types/transports/fetch.d.ts +8 -0
- package/build/npm/types/transports/fetch.d.ts.map +1 -0
- package/build/npm/types/transports/offline.d.ts +33 -0
- package/build/npm/types/transports/offline.d.ts.map +1 -0
- package/build/npm/types/transports/types.d.ts +6 -0
- package/build/npm/types/transports/types.d.ts.map +1 -0
- package/build/npm/types/userfeedback.d.ts +10 -0
- package/build/npm/types/userfeedback.d.ts.map +1 -0
- package/build/npm/types/utils/detectBrowserExtension.d.ts +6 -0
- package/build/npm/types/utils/detectBrowserExtension.d.ts.map +1 -0
- package/build/npm/types/utils/lazyLoadIntegration.d.ts +13 -0
- package/build/npm/types/utils/lazyLoadIntegration.d.ts.map +1 -0
- package/build/npm/types-ts3.8/client.d.ts +79 -0
- package/build/npm/types-ts3.8/debug-build.d.ts +7 -0
- package/build/npm/types-ts3.8/diagnose-sdk.d.ts +11 -0
- package/build/npm/types-ts3.8/eventbuilder.d.ts +40 -0
- package/build/npm/types-ts3.8/exports.d.ts +21 -0
- package/build/npm/types-ts3.8/feedbackAsync.d.ts +7 -0
- package/build/npm/types-ts3.8/feedbackSync.d.ts +4 -0
- package/build/npm/types-ts3.8/helpers.d.ts +27 -0
- package/build/npm/types-ts3.8/index.bundle.base.d.ts +2 -0
- package/build/npm/types-ts3.8/index.bundle.d.ts +5 -0
- package/build/npm/types-ts3.8/index.bundle.feedback.d.ts +7 -0
- package/build/npm/types-ts3.8/index.bundle.logs.metrics.d.ts +6 -0
- package/build/npm/types-ts3.8/index.bundle.replay.d.ts +6 -0
- package/build/npm/types-ts3.8/index.bundle.replay.feedback.d.ts +8 -0
- package/build/npm/types-ts3.8/index.bundle.replay.logs.metrics.d.ts +7 -0
- package/build/npm/types-ts3.8/index.bundle.tracing.d.ts +13 -0
- package/build/npm/types-ts3.8/index.bundle.tracing.logs.metrics.d.ts +13 -0
- package/build/npm/types-ts3.8/index.bundle.tracing.replay.d.ts +14 -0
- package/build/npm/types-ts3.8/index.bundle.tracing.replay.feedback.d.ts +16 -0
- package/build/npm/types-ts3.8/index.bundle.tracing.replay.feedback.logs.metrics.d.ts +14 -0
- package/build/npm/types-ts3.8/index.bundle.tracing.replay.logs.metrics.d.ts +14 -0
- package/build/npm/types-ts3.8/index.d.ts +38 -0
- package/build/npm/types-ts3.8/integrations/breadcrumbs.d.ts +16 -0
- package/build/npm/types-ts3.8/integrations/browserapierrors.d.ts +23 -0
- package/build/npm/types-ts3.8/integrations/browserprofiling.d.ts +2 -0
- package/build/npm/types-ts3.8/integrations/browsersession.d.ts +25 -0
- package/build/npm/types-ts3.8/integrations/contextlines.d.ts +32 -0
- package/build/npm/types-ts3.8/integrations/culturecontext.d.ts +18 -0
- package/build/npm/types-ts3.8/integrations/featureFlags/growthbook/index.d.ts +2 -0
- package/build/npm/types-ts3.8/integrations/featureFlags/growthbook/integration.d.ts +25 -0
- package/build/npm/types-ts3.8/integrations/featureFlags/growthbook/types.d.ts +6 -0
- package/build/npm/types-ts3.8/integrations/featureFlags/launchdarkly/index.d.ts +2 -0
- package/build/npm/types-ts3.8/integrations/featureFlags/launchdarkly/integration.d.ts +27 -0
- package/build/npm/types-ts3.8/integrations/featureFlags/launchdarkly/types.d.ts +44 -0
- package/build/npm/types-ts3.8/integrations/featureFlags/openfeature/index.d.ts +2 -0
- package/build/npm/types-ts3.8/integrations/featureFlags/openfeature/integration.d.ts +18 -0
- package/build/npm/types-ts3.8/integrations/featureFlags/openfeature/types.d.ts +78 -0
- package/build/npm/types-ts3.8/integrations/featureFlags/statsig/index.d.ts +2 -0
- package/build/npm/types-ts3.8/integrations/featureFlags/statsig/integration.d.ts +30 -0
- package/build/npm/types-ts3.8/integrations/featureFlags/statsig/types.d.ts +14 -0
- package/build/npm/types-ts3.8/integrations/featureFlags/unleash/index.d.ts +2 -0
- package/build/npm/types-ts3.8/integrations/featureFlags/unleash/integration.d.ts +31 -0
- package/build/npm/types-ts3.8/integrations/featureFlags/unleash/types.d.ts +21 -0
- package/build/npm/types-ts3.8/integrations/fetchStreamPerformance.d.ts +16 -0
- package/build/npm/types-ts3.8/integrations/globalhandlers.d.ts +19 -0
- package/build/npm/types-ts3.8/integrations/graphqlClient.d.ts +60 -0
- package/build/npm/types-ts3.8/integrations/httpclient.d.ts +32 -0
- package/build/npm/types-ts3.8/integrations/httpcontext.d.ts +8 -0
- package/build/npm/types-ts3.8/integrations/linkederrors.d.ts +12 -0
- package/build/npm/types-ts3.8/integrations/reportingobserver.d.ts +12 -0
- package/build/npm/types-ts3.8/integrations/spanstreaming.d.ts +4 -0
- package/build/npm/types-ts3.8/integrations/spotlight.d.ts +21 -0
- package/build/npm/types-ts3.8/integrations/view-hierarchy.d.ts +51 -0
- package/build/npm/types-ts3.8/integrations/webVitals.d.ts +26 -0
- package/build/npm/types-ts3.8/integrations/webWorker.d.ts +129 -0
- package/build/npm/types-ts3.8/integrations-bundle/index.captureconsole.d.ts +2 -0
- package/build/npm/types-ts3.8/integrations-bundle/index.createlangchaincallbackhandler.d.ts +2 -0
- package/build/npm/types-ts3.8/integrations-bundle/index.dedupe.d.ts +2 -0
- package/build/npm/types-ts3.8/integrations-bundle/index.extraerrordata.d.ts +2 -0
- package/build/npm/types-ts3.8/integrations-bundle/index.feedback.d.ts +5 -0
- package/build/npm/types-ts3.8/integrations-bundle/index.graphqlclient.d.ts +2 -0
- package/build/npm/types-ts3.8/integrations-bundle/index.instrumentanthropicaiclient.d.ts +2 -0
- package/build/npm/types-ts3.8/integrations-bundle/index.instrumentgooglegenaiclient.d.ts +2 -0
- package/build/npm/types-ts3.8/integrations-bundle/index.instrumentlangchainembeddings.d.ts +2 -0
- package/build/npm/types-ts3.8/integrations-bundle/index.instrumentlanggraph.d.ts +2 -0
- package/build/npm/types-ts3.8/integrations-bundle/index.instrumentopenaiclient.d.ts +2 -0
- package/build/npm/types-ts3.8/integrations-bundle/index.instrumentstategraph.d.ts +2 -0
- package/build/npm/types-ts3.8/integrations-bundle/index.modulemetadata.d.ts +2 -0
- package/build/npm/types-ts3.8/integrations-bundle/index.rewriteframes.d.ts +2 -0
- package/build/npm/types-ts3.8/integrations-bundle/index.spotlight.d.ts +2 -0
- package/build/npm/types-ts3.8/normalizeStringifyValue.d.ts +15 -0
- package/build/npm/types-ts3.8/pluggable-exports-bundle/index.multiplexedtransport.d.ts +2 -0
- package/build/npm/types-ts3.8/profiling/UIProfiler.d.ts +75 -0
- package/build/npm/types-ts3.8/profiling/index.d.ts +8 -0
- package/build/npm/types-ts3.8/profiling/integration.d.ts +4 -0
- package/build/npm/types-ts3.8/profiling/jsSelfProfiling.d.ts +41 -0
- package/build/npm/types-ts3.8/profiling/startProfileForSpan.d.ts +8 -0
- package/build/npm/types-ts3.8/profiling/utils.d.ts +112 -0
- package/build/npm/types-ts3.8/report-dialog.d.ts +8 -0
- package/build/npm/types-ts3.8/sdk.d.ts +62 -0
- package/build/npm/types-ts3.8/stack-parsers.d.ts +9 -0
- package/build/npm/types-ts3.8/tracing/backgroundtab.d.ts +6 -0
- package/build/npm/types-ts3.8/tracing/browserTracingIntegration.d.ts +271 -0
- package/build/npm/types-ts3.8/tracing/linkedTraces.d.ts +52 -0
- package/build/npm/types-ts3.8/tracing/reportPageLoaded.d.ts +11 -0
- package/build/npm/types-ts3.8/tracing/request.d.ts +87 -0
- package/build/npm/types-ts3.8/tracing/setActiveSpan.d.ts +39 -0
- package/build/npm/types-ts3.8/tracing/utils.d.ts +17 -0
- package/build/npm/types-ts3.8/transports/fetch.d.ts +8 -0
- package/build/npm/types-ts3.8/transports/offline.d.ts +33 -0
- package/build/npm/types-ts3.8/transports/types.d.ts +6 -0
- package/build/npm/types-ts3.8/userfeedback.d.ts +10 -0
- package/build/npm/types-ts3.8/utils/detectBrowserExtension.d.ts +6 -0
- package/build/npm/types-ts3.8/utils/lazyLoadIntegration.d.ts +37 -0
- package/package.json +85 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"httpclient.js","sources":["../../../../../src/integrations/httpclient.ts"],"sourcesContent":["import type {\n Client,\n Event as ElenjicalEvent,\n IntegrationFn,\n ElenjicalWrappedXMLHttpRequest,\n} from '@elenjical/core/browser';\nimport {\n _INTERNAL_filterCookies,\n _INTERNAL_filterKeyValueData,\n addExceptionMechanism,\n addFetchInstrumentationHandler,\n captureEvent,\n debug,\n defineIntegration,\n getClient,\n GLOBAL_OBJ,\n isElenjicalRequestUrl,\n supportsNativeFetch,\n} from '@elenjical/core/browser';\nimport { addXhrInstrumentationHandler, ELENJICAL_XHR_DATA_KEY } from '@elenjical/browser-utils';\nimport { DEBUG_BUILD } from '../debug-build';\n\nexport type HttpStatusCodeRange = [number, number] | number;\nexport type HttpRequestTarget = string | RegExp;\n\nconst INTEGRATION_NAME = 'HttpClient' as const;\n\ninterface HttpClientOptions {\n /**\n * HTTP status codes that should be considered failed.\n * This array can contain tuples of `[begin, end]` (both inclusive),\n * single status codes, or a combinations of both\n *\n * Example: [[500, 505], 507]\n * Default: [[500, 599]]\n */\n failedRequestStatusCodes: HttpStatusCodeRange[];\n\n /**\n * Targets to track for failed requests.\n * This array can contain strings or regular expressions.\n *\n * Example: ['http://localhost', /api\\/.*\\/]\n * Default: [/.*\\/]\n */\n failedRequestTargets: HttpRequestTarget[];\n}\n\nconst _httpClientIntegration = ((options: Partial<HttpClientOptions> = {}) => {\n const _options: HttpClientOptions = {\n failedRequestStatusCodes: [[500, 599]],\n failedRequestTargets: [/.*/],\n ...options,\n };\n\n return {\n name: INTEGRATION_NAME,\n setup(client): void {\n _wrapFetch(client, _options);\n _wrapXHR(client, _options);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Create events for failed client side HTTP requests.\n */\nexport const httpClientIntegration = defineIntegration(_httpClientIntegration);\n\n/**\n * Interceptor function for fetch requests\n *\n * @param requestInfo The Fetch API request info\n * @param response The Fetch API response\n * @param requestInit The request init object\n */\nfunction _fetchResponseHandler(\n options: HttpClientOptions,\n requestInfo: RequestInfo,\n response: Response,\n requestInit?: RequestInit,\n error?: unknown,\n): void {\n if (_shouldCaptureResponse(options, response.status, response.url)) {\n const request = _getRequest(requestInfo, requestInit);\n\n let requestHeaders, responseHeaders, requestCookies, responseCookies;\n\n const dc = _getDataCollectionSettings();\n\n if (dc.requestHeaders !== false) {\n requestHeaders = _INTERNAL_filterKeyValueData(_extractFetchHeaders(request.headers), dc.requestHeaders);\n }\n if (dc.responseHeaders !== false) {\n responseHeaders = _INTERNAL_filterKeyValueData(_extractFetchHeaders(response.headers), dc.responseHeaders);\n }\n if (dc.cookies !== false) {\n const reqCookieStr = request.headers.get('Cookie') || undefined;\n if (reqCookieStr) {\n const filtered = _INTERNAL_filterCookies(reqCookieStr, dc.cookies);\n if (typeof filtered === 'object') {\n requestCookies = filtered;\n }\n }\n const resCookieStr = response.headers.get('Set-Cookie') || undefined;\n if (resCookieStr) {\n const filtered = _INTERNAL_filterCookies(resCookieStr, dc.cookies);\n if (typeof filtered === 'object') {\n responseCookies = filtered;\n }\n }\n }\n\n const event = _createEvent({\n url: request.url,\n method: request.method,\n status: response.status,\n requestHeaders,\n responseHeaders,\n requestCookies,\n responseCookies,\n error,\n type: 'fetch',\n });\n\n captureEvent(event);\n }\n}\n\n/**\n * Interceptor function for XHR requests\n *\n * @param xhr The XHR request\n * @param method The HTTP method\n * @param headers The HTTP headers\n */\nfunction _xhrResponseHandler(\n options: HttpClientOptions,\n xhr: XMLHttpRequest,\n method: string,\n headers: Record<string, string>,\n error?: unknown,\n): void {\n if (_shouldCaptureResponse(options, xhr.status, xhr.responseURL)) {\n let requestHeaders, responseCookies, responseHeaders;\n\n const dc = _getDataCollectionSettings();\n\n if (dc.cookies !== false) {\n try {\n const cookieString = xhr.getResponseHeader('Set-Cookie') || xhr.getResponseHeader('set-cookie') || undefined;\n if (cookieString) {\n const filtered = _INTERNAL_filterCookies(cookieString, dc.cookies);\n if (typeof filtered === 'object') {\n responseCookies = filtered;\n }\n }\n } catch {\n // ignore it if parsing fails\n }\n }\n\n if (dc.responseHeaders !== false) {\n try {\n responseHeaders = _INTERNAL_filterKeyValueData(_getXHRResponseHeaders(xhr), dc.responseHeaders);\n } catch {\n // ignore it if parsing fails\n }\n }\n\n if (dc.requestHeaders !== false) {\n requestHeaders = _INTERNAL_filterKeyValueData(headers, dc.requestHeaders);\n }\n\n const event = _createEvent({\n url: xhr.responseURL,\n method,\n status: xhr.status,\n requestHeaders,\n // Can't access request cookies from XHR\n responseHeaders,\n responseCookies,\n error,\n type: 'xhr',\n });\n\n captureEvent(event);\n }\n}\n\n/**\n * Extracts response size from `Content-Length` header when possible\n *\n * @param headers\n * @returns The response size in bytes or undefined\n */\nfunction _getResponseSizeFromHeaders(headers?: Record<string, string>): number | undefined {\n if (headers) {\n const contentLength = headers['Content-Length'] || headers['content-length'];\n\n if (contentLength) {\n return parseInt(contentLength, 10);\n }\n }\n\n return undefined;\n}\n\n/**\n * Extracts the headers as an object from the given Fetch API request or response object\n *\n * @param headers The headers to extract\n * @returns The extracted headers as an object\n */\nfunction _extractFetchHeaders(headers: Headers): Record<string, string> {\n const result: Record<string, string> = {};\n\n headers.forEach((value, key) => {\n result[key] = value;\n });\n\n return result;\n}\n\n/**\n * Extracts the response headers as an object from the given XHR object\n *\n * @param xhr The XHR object to extract the response headers from\n * @returns The response headers as an object\n */\nfunction _getXHRResponseHeaders(xhr: XMLHttpRequest): Record<string, string> {\n const headers = xhr.getAllResponseHeaders();\n\n if (!headers) {\n return {};\n }\n\n return headers.split('\\r\\n').reduce((acc: Record<string, string>, line: string) => {\n const [key, value] = line.split(': ');\n if (key && value) {\n acc[key] = value;\n }\n return acc;\n }, {});\n}\n\n/**\n * Checks if the given target url is in the given list of targets\n *\n * @param target The target url to check\n * @returns true if the target url is in the given list of targets, false otherwise\n */\nfunction _isInGivenRequestTargets(\n failedRequestTargets: HttpClientOptions['failedRequestTargets'],\n target: string,\n): boolean {\n return failedRequestTargets.some((givenRequestTarget: HttpRequestTarget) => {\n if (typeof givenRequestTarget === 'string') {\n return target.includes(givenRequestTarget);\n }\n\n return givenRequestTarget.test(target);\n });\n}\n\n/**\n * Checks if the given status code is in the given range\n *\n * @param status The status code to check\n * @returns true if the status code is in the given range, false otherwise\n */\nfunction _isInGivenStatusRanges(\n failedRequestStatusCodes: HttpClientOptions['failedRequestStatusCodes'],\n status: number,\n): boolean {\n return failedRequestStatusCodes.some((range: HttpStatusCodeRange) => {\n if (typeof range === 'number') {\n return range === status;\n }\n\n return status >= range[0] && status <= range[1];\n });\n}\n\n/**\n * Wraps `fetch` function to capture request and response data\n */\nfunction _wrapFetch(client: Client, options: HttpClientOptions): void {\n if (!supportsNativeFetch()) {\n return;\n }\n\n addFetchInstrumentationHandler(handlerData => {\n if (getClient() !== client) {\n return;\n }\n\n const { response, args, error, virtualError } = handlerData;\n const [requestInfo, requestInit] = args as [RequestInfo, RequestInit | undefined];\n\n if (!response) {\n return;\n }\n\n _fetchResponseHandler(options, requestInfo, response as Response, requestInit, error || virtualError);\n }, false);\n}\n\n/**\n * Wraps XMLHttpRequest to capture request and response data\n */\nfunction _wrapXHR(client: Client, options: HttpClientOptions): void {\n if (!('XMLHttpRequest' in GLOBAL_OBJ)) {\n return;\n }\n\n addXhrInstrumentationHandler(handlerData => {\n if (getClient() !== client) {\n return;\n }\n\n const { error, virtualError } = handlerData;\n\n const xhr = handlerData.xhr as ElenjicalWrappedXMLHttpRequest & XMLHttpRequest;\n\n const elenjicalXhrData = xhr[ELENJICAL_XHR_DATA_KEY];\n\n if (!elenjicalXhrData) {\n return;\n }\n\n const { method, request_headers: headers } = elenjicalXhrData;\n\n try {\n _xhrResponseHandler(options, xhr, method, headers, error || virtualError);\n } catch (e) {\n DEBUG_BUILD && debug.warn('Error while extracting response event form XHR response', e);\n }\n });\n}\n\n/**\n * Checks whether to capture given response as an event\n *\n * @param status response status code\n * @param url response url\n */\nfunction _shouldCaptureResponse(options: HttpClientOptions, status: number, url: string): boolean {\n return (\n _isInGivenStatusRanges(options.failedRequestStatusCodes, status) &&\n _isInGivenRequestTargets(options.failedRequestTargets, url) &&\n !isElenjicalRequestUrl(url, getClient())\n );\n}\n\n/**\n * Creates a synthetic Elenjical event from given response data\n *\n * @param data response data\n * @returns event\n */\nfunction _createEvent(data: {\n url: string;\n method: string;\n status: number;\n type: 'fetch' | 'xhr';\n responseHeaders?: Record<string, string>;\n responseCookies?: Record<string, string>;\n requestHeaders?: Record<string, string>;\n requestCookies?: Record<string, string>;\n error?: unknown;\n}): ElenjicalEvent {\n const client = getClient();\n const virtualStackTrace = client && data.error && data.error instanceof Error ? data.error.stack : undefined;\n // Remove the first frame from the stack as it's the HttpClient call\n const stack = virtualStackTrace && client ? client.getOptions().stackParser(virtualStackTrace, 0, 1) : undefined;\n const message = `HTTP Client Error with status code: ${data.status}`;\n\n const event: ElenjicalEvent = {\n message,\n exception: {\n values: [\n {\n type: 'Error',\n value: message,\n stacktrace: stack ? { frames: stack } : undefined,\n },\n ],\n },\n request: {\n url: data.url,\n method: data.method,\n headers: data.requestHeaders,\n cookies: data.requestCookies,\n },\n contexts: {\n response: {\n status_code: data.status,\n headers: data.responseHeaders,\n cookies: data.responseCookies,\n body_size: _getResponseSizeFromHeaders(data.responseHeaders),\n },\n },\n };\n\n addExceptionMechanism(event, {\n type: `auto.http.client.${data.type}`,\n handled: false,\n });\n\n return event;\n}\n\nfunction _getRequest(requestInfo: RequestInfo, requestInit?: RequestInit): Request {\n if (!requestInit && requestInfo instanceof Request) {\n return requestInfo;\n }\n\n // If both are set, we try to construct a new Request with the given arguments\n // However, if e.g. the original request has a `body`, this will throw an error because it was already accessed\n // In this case, as a fallback, we just use the original request - using both is rather an edge case\n if (requestInfo instanceof Request && requestInfo.bodyUsed) {\n return requestInfo;\n }\n\n return new Request(requestInfo, requestInit);\n}\n\nfunction _getDataCollectionSettings() {\n const client = getClient();\n if (!client) {\n return { cookies: false, requestHeaders: false, responseHeaders: false };\n }\n\n // todo(v11): Always use granular dataCollection settings and remove this legacy guard.\n // Currently, when dataCollection is not explicitly set, we gate all collection on\n // sendDefaultPii to avoid sending more data than before (the spec defaults would\n // collect headers/cookies with deny-list filtering even without sendDefaultPii).\n const options = client.getOptions();\n if (options.dataCollection == null) {\n // eslint-disable-next-line typescript/no-deprecated\n const enabled = Boolean(options.sendDefaultPii);\n return { cookies: enabled, requestHeaders: enabled, responseHeaders: enabled };\n }\n\n const { cookies, httpHeaders } = client.getDataCollectionOptions();\n return { cookies, requestHeaders: httpHeaders.request, responseHeaders: httpHeaders.response };\n}\n"],"names":["defineIntegration","_INTERNAL_filterKeyValueData","_INTERNAL_filterCookies","captureEvent","supportsNativeFetch","addFetchInstrumentationHandler","getClient","GLOBAL_OBJ","addXhrInstrumentationHandler","ELENJICAL_XHR_DATA_KEY","DEBUG_BUILD","debug","isElenjicalRequestUrl","addExceptionMechanism"],"mappings":";;;;;;AAyBA,MAAM,gBAAA,GAAmB,YAAA;AAuBzB,MAAM,sBAAA,IAA0B,CAAC,OAAA,GAAsC,EAAC,KAAM;AAC5E,EAAA,MAAM,QAAA,GAA8B;AAAA,IAClC,wBAAA,EAA0B,CAAC,CAAC,GAAA,EAAK,GAAG,CAAC,CAAA;AAAA,IACrC,oBAAA,EAAsB,CAAC,IAAI,CAAA;AAAA,IAC3B,GAAG;AAAA,GACL;AAEA,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,MAAM,MAAA,EAAc;AAClB,MAAA,UAAA,CAAW,QAAQ,QAAQ,CAAA;AAC3B,MAAA,QAAA,CAAS,QAAQ,QAAQ,CAAA;AAAA,IAC3B;AAAA,GACF;AACF,CAAA,CAAA;AAKO,MAAM,qBAAA,GAAwBA,0BAAkB,sBAAsB;AAS7E,SAAS,qBAAA,CACP,OAAA,EACA,WAAA,EACA,QAAA,EACA,aACA,KAAA,EACM;AACN,EAAA,IAAI,uBAAuB,OAAA,EAAS,QAAA,CAAS,MAAA,EAAQ,QAAA,CAAS,GAAG,CAAA,EAAG;AAClE,IAAA,MAAM,OAAA,GAAU,WAAA,CAAY,WAAA,EAAa,WAAW,CAAA;AAEpD,IAAA,IAAI,cAAA,EAAgB,iBAAiB,cAAA,EAAgB,eAAA;AAErD,IAAA,MAAM,KAAK,0BAAA,EAA2B;AAEtC,IAAA,IAAI,EAAA,CAAG,mBAAmB,KAAA,EAAO;A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AAEA,SAAS,0BAAA,GAA6B;AACpC,EAAA,MAAM,SAASP,iBAAA,EAAU;AACzB,EAAA,IAAI,CAAC,MAAA,EAAQ;AACX,IAAA,OAAO,EAAE,OAAA,EAAS,KAAA,EAAO,cAAA,EAAgB,KAAA,EAAO,iBAAiB,KAAA,EAAM;AAAA,EACzE;AAMA,EAAA,MAAM,OAAA,GAAU,OAAO,UAAA,EAAW;AAClC,EAAA,IAAI,OAAA,CAAQ,kBAAkB,IAAA,EAAM;AAElC,IAAA,MAAM,OAAA,GAAU,OAAA,CAAQ,OAAA,CAAQ,cAAc,CAAA;AAC9C,IAAA,OAAO,EAAE,OAAA,EAAS,OAAA,EAAS,cAAA,EAAgB,OAAA,EAAS,iBAAiB,OAAA,EAAQ;AAAA,EAC/E;AAEA,EAAA,MAAM,EAAE,OAAA,EAAS,WAAA,EAAY,GAAI,OAAO,wBAAA,EAAyB;AACjE,EAAA,OAAO,EAAE,OAAA,EAAS,cAAA,EAAgB,YAAY,OAAA,EAAS,eAAA,EAAiB,YAAY,QAAA,EAAS;AAC/F;;;;"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const browser = require('@elenjical/core/browser');
|
|
4
|
+
const helpers = require('../helpers.js');
|
|
5
|
+
const attributes = require('@elenjical/conventions/attributes');
|
|
6
|
+
|
|
7
|
+
const httpContextIntegration = browser.defineIntegration(() => {
|
|
8
|
+
return {
|
|
9
|
+
name: "HttpContext",
|
|
10
|
+
preprocessEvent(event) {
|
|
11
|
+
if (!helpers.WINDOW.navigator && !helpers.WINDOW.location && !helpers.WINDOW.document) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
const reqData = helpers.getHttpRequestData();
|
|
15
|
+
const headers = {
|
|
16
|
+
...reqData.headers,
|
|
17
|
+
...event.request?.headers
|
|
18
|
+
};
|
|
19
|
+
event.request = {
|
|
20
|
+
...reqData,
|
|
21
|
+
...event.request,
|
|
22
|
+
headers
|
|
23
|
+
};
|
|
24
|
+
},
|
|
25
|
+
processSpan(span) {
|
|
26
|
+
if (!helpers.WINDOW.navigator && !helpers.WINDOW.location && !helpers.WINDOW.document) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const reqData = helpers.getHttpRequestData();
|
|
30
|
+
browser.safeSetSpanJSONAttributes(span, {
|
|
31
|
+
// This attribute is used by the "Filter out events from legacy browsers and crawlers" features on the Elenjical backend.
|
|
32
|
+
// Therefore, it's set on every span.
|
|
33
|
+
[attributes.USER_AGENT_ORIGINAL]: reqData.headers["User-Agent"],
|
|
34
|
+
// These attributes, we only need on the segment span (analogous to the `request` context for events)
|
|
35
|
+
...span.is_segment && {
|
|
36
|
+
// Coerce empty string to undefined so the helper's nullish check drops it,
|
|
37
|
+
// rather than writing an empty `url.full` attribute onto the span.
|
|
38
|
+
[attributes.URL_FULL]: span.attributes?.[attributes.ELENJICAL_OP] !== "http.client" ? browser.filterCollectedUrl(reqData.url) : void 0,
|
|
39
|
+
[`${attributes.HTTP_REQUEST_HEADER_KEY_BASE}.referer`]: reqData.headers["Referer"]
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
exports.httpContextIntegration = httpContextIntegration;
|
|
47
|
+
//# sourceMappingURL=httpcontext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"httpcontext.js","sources":["../../../../../src/integrations/httpcontext.ts"],"sourcesContent":["import { defineIntegration, filterCollectedUrl, safeSetSpanJSONAttributes } from '@elenjical/core/browser';\nimport { getHttpRequestData, WINDOW } from '../helpers';\nimport {\n HTTP_REQUEST_HEADER_KEY_BASE,\n ELENJICAL_OP,\n URL_FULL,\n USER_AGENT_ORIGINAL,\n} from '@elenjical/conventions/attributes';\n\n/**\n * Collects information about HTTP request headers and\n * attaches them to the event.\n */\nexport const httpContextIntegration = defineIntegration(() => {\n return {\n name: 'HttpContext' as const,\n preprocessEvent(event) {\n // if none of the information we want exists, don't bother\n if (!WINDOW.navigator && !WINDOW.location && !WINDOW.document) {\n return;\n }\n\n const reqData = getHttpRequestData();\n const headers = {\n ...reqData.headers,\n ...event.request?.headers,\n };\n\n event.request = {\n ...reqData,\n ...event.request,\n headers,\n };\n },\n\n processSpan(span) {\n // if none of the information we want exists, don't bother\n if (!WINDOW.navigator && !WINDOW.location && !WINDOW.document) {\n return;\n }\n\n const reqData = getHttpRequestData();\n\n safeSetSpanJSONAttributes(span, {\n // This attribute is used by the \"Filter out events from legacy browsers and crawlers\" features on the Elenjical backend.\n // Therefore, it's set on every span.\n [USER_AGENT_ORIGINAL]: reqData.headers['User-Agent'],\n\n // These attributes, we only need on the segment span (analogous to the `request` context for events)\n ...(span.is_segment && {\n // Coerce empty string to undefined so the helper's nullish check drops it,\n // rather than writing an empty `url.full` attribute onto the span.\n [URL_FULL]: span.attributes?.[ELENJICAL_OP] !== 'http.client' ? filterCollectedUrl(reqData.url) : undefined,\n [`${HTTP_REQUEST_HEADER_KEY_BASE}.referer`]: reqData.headers['Referer'],\n }),\n });\n },\n };\n});\n"],"names":["defineIntegration","WINDOW","getHttpRequestData","safeSetSpanJSONAttributes","USER_AGENT_ORIGINAL","URL_FULL","ELENJICAL_OP","filterCollectedUrl","HTTP_REQUEST_HEADER_KEY_BASE"],"mappings":";;;;;;AAaO,MAAM,sBAAA,GAAyBA,0BAAkB,MAAM;AAC5D,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,aAAA;AAAA,IACN,gBAAgB,KAAA,EAAO;AAErB,MAAA,IAAI,CAACC,eAAO,SAAA,IAAa,CAACA,eAAO,QAAA,IAAY,CAACA,eAAO,QAAA,EAAU;AAC7D,QAAA;AAAA,MACF;AAEA,MAAA,MAAM,UAAUC,0BAAA,EAAmB;AACnC,MAAA,MAAM,OAAA,GAAU;AAAA,QACd,GAAG,OAAA,CAAQ,OAAA;AAAA,QACX,GAAG,MAAM,OAAA,EAAS;AAAA,OACpB;AAEA,MAAA,KAAA,CAAM,OAAA,GAAU;AAAA,QACd,GAAG,OAAA;AAAA,QACH,GAAG,KAAA,CAAM,OAAA;AAAA,QACT;AAAA,OACF;AAAA,IACF,CAAA;AAAA,IAEA,YAAY,IAAA,EAAM;AAEhB,MAAA,IAAI,CAACD,eAAO,SAAA,IAAa,CAACA,eAAO,QAAA,IAAY,CAACA,eAAO,QAAA,EAAU;AAC7D,QAAA;AAAA,MACF;AAEA,MAAA,MAAM,UAAUC,0BAAA,EAAmB;AAEnC,MAAAC,iCAAA,CAA0B,IAAA,EAAM;AAAA;AAAA;AAAA,QAG9B,CAACC,8BAAmB,GAAG,OAAA,CAAQ,QAAQ,YAAY,CAAA;AAAA;AAAA,QAGnD,GAAI,KAAK,UAAA,IAAc;AAAA;AAAA;AAAA,UAGrB,CAACC,mBAAQ,GAAG,IAAA,CAAK,UAAA,GAAaC,uBAAY,CAAA,KAAM,aAAA,GAAgBC,0BAAA,CAAmB,OAAA,CAAQ,GAAG,CAAA,GAAI,MAAA;AAAA,UAClG,CAAC,CAAA,EAAGC,uCAA4B,UAAU,GAAG,OAAA,CAAQ,QAAQ,SAAS;AAAA;AACxE,OACD,CAAA;AAAA,IACH;AAAA,GACF;AACF,CAAC;;;;"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const browser = require('@elenjical/core/browser');
|
|
4
|
+
const eventbuilder = require('../eventbuilder.js');
|
|
5
|
+
|
|
6
|
+
const DEFAULT_KEY = "cause";
|
|
7
|
+
const DEFAULT_LIMIT = 5;
|
|
8
|
+
const INTEGRATION_NAME = "LinkedErrors";
|
|
9
|
+
const _linkedErrorsIntegration = ((options = {}) => {
|
|
10
|
+
const limit = options.limit || DEFAULT_LIMIT;
|
|
11
|
+
const key = options.key || DEFAULT_KEY;
|
|
12
|
+
return {
|
|
13
|
+
name: INTEGRATION_NAME,
|
|
14
|
+
preprocessEvent(event, hint, client) {
|
|
15
|
+
const options2 = client.getOptions();
|
|
16
|
+
browser.applyAggregateErrorsToEvent(
|
|
17
|
+
// This differs from the LinkedErrors integration in core by using a different exceptionFromError function
|
|
18
|
+
eventbuilder.exceptionFromError,
|
|
19
|
+
options2.stackParser,
|
|
20
|
+
key,
|
|
21
|
+
limit,
|
|
22
|
+
event,
|
|
23
|
+
hint
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
const linkedErrorsIntegration = browser.defineIntegration(_linkedErrorsIntegration);
|
|
29
|
+
|
|
30
|
+
exports.linkedErrorsIntegration = linkedErrorsIntegration;
|
|
31
|
+
//# sourceMappingURL=linkederrors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linkederrors.js","sources":["../../../../../src/integrations/linkederrors.ts"],"sourcesContent":["import type { IntegrationFn } from '@elenjical/core/browser';\nimport { applyAggregateErrorsToEvent, defineIntegration } from '@elenjical/core/browser';\nimport { exceptionFromError } from '../eventbuilder';\n\ninterface LinkedErrorsOptions {\n key?: string;\n limit?: number;\n}\n\nconst DEFAULT_KEY = 'cause';\nconst DEFAULT_LIMIT = 5;\n\nconst INTEGRATION_NAME = 'LinkedErrors' as const;\n\nconst _linkedErrorsIntegration = ((options: LinkedErrorsOptions = {}) => {\n const limit = options.limit || DEFAULT_LIMIT;\n const key = options.key || DEFAULT_KEY;\n\n return {\n name: INTEGRATION_NAME,\n preprocessEvent(event, hint, client) {\n const options = client.getOptions();\n\n applyAggregateErrorsToEvent(\n // This differs from the LinkedErrors integration in core by using a different exceptionFromError function\n exceptionFromError,\n options.stackParser,\n key,\n limit,\n event,\n hint,\n );\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Aggregrate linked errors in an event.\n */\nexport const linkedErrorsIntegration = defineIntegration(_linkedErrorsIntegration);\n"],"names":["options","applyAggregateErrorsToEvent","exceptionFromError","defineIntegration"],"mappings":";;;;;AASA,MAAM,WAAA,GAAc,OAAA;AACpB,MAAM,aAAA,GAAgB,CAAA;AAEtB,MAAM,gBAAA,GAAmB,cAAA;AAEzB,MAAM,wBAAA,IAA4B,CAAC,OAAA,GAA+B,EAAC,KAAM;AACvE,EAAA,MAAM,KAAA,GAAQ,QAAQ,KAAA,IAAS,aAAA;AAC/B,EAAA,MAAM,GAAA,GAAM,QAAQ,GAAA,IAAO,WAAA;AAE3B,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,eAAA,CAAgB,KAAA,EAAO,IAAA,EAAM,MAAA,EAAQ;AACnC,MAAA,MAAMA,QAAAA,GAAU,OAAO,UAAA,EAAW;AAElC,MAAAC,mCAAA;AAAA;AAAA,QAEEC,+BAAA;AAAA,QACAF,QAAAA,CAAQ,WAAA;AAAA,QACR,GAAA;AAAA,QACA,KAAA;AAAA,QACA,KAAA;AAAA,QACA;AAAA,OACF;AAAA,IACF;AAAA,GACF;AACF,CAAA,CAAA;AAKO,MAAM,uBAAA,GAA0BG,0BAAkB,wBAAwB;;;;"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const browser = require('@elenjical/core/browser');
|
|
4
|
+
|
|
5
|
+
const WINDOW = browser.GLOBAL_OBJ;
|
|
6
|
+
const INTEGRATION_NAME = "ReportingObserver";
|
|
7
|
+
const SETUP_CLIENTS = /* @__PURE__ */ new WeakMap();
|
|
8
|
+
const _reportingObserverIntegration = ((options = {}) => {
|
|
9
|
+
const types = options.types || ["crash", "deprecation", "intervention"];
|
|
10
|
+
function handler(reports) {
|
|
11
|
+
if (!SETUP_CLIENTS.has(browser.getClient())) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
for (const report of reports) {
|
|
15
|
+
browser.withScope((scope) => {
|
|
16
|
+
scope.setExtra("url", report.url);
|
|
17
|
+
const label = `ReportingObserver [${report.type}]`;
|
|
18
|
+
let details = "No details available";
|
|
19
|
+
if (report.body) {
|
|
20
|
+
const plainBody = {};
|
|
21
|
+
for (const prop in report.body) {
|
|
22
|
+
plainBody[prop] = report.body[prop];
|
|
23
|
+
}
|
|
24
|
+
scope.setExtra("body", plainBody);
|
|
25
|
+
if (report.type === "crash") {
|
|
26
|
+
const body = report.body;
|
|
27
|
+
details = [body.crashId || "", body.reason || ""].join(" ").trim() || details;
|
|
28
|
+
} else {
|
|
29
|
+
const body = report.body;
|
|
30
|
+
details = body.message || details;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
browser.captureMessage(`${label}: ${details}`);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
name: INTEGRATION_NAME,
|
|
39
|
+
setupOnce() {
|
|
40
|
+
if (!browser.supportsReportingObserver()) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const observer = new WINDOW.ReportingObserver(
|
|
44
|
+
handler,
|
|
45
|
+
{
|
|
46
|
+
buffered: true,
|
|
47
|
+
types
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
observer.observe();
|
|
51
|
+
},
|
|
52
|
+
setup(client) {
|
|
53
|
+
SETUP_CLIENTS.set(client, true);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
});
|
|
57
|
+
const reportingObserverIntegration = browser.defineIntegration(_reportingObserverIntegration);
|
|
58
|
+
|
|
59
|
+
exports.reportingObserverIntegration = reportingObserverIntegration;
|
|
60
|
+
//# sourceMappingURL=reportingobserver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reportingobserver.js","sources":["../../../../../src/integrations/reportingobserver.ts"],"sourcesContent":["import type { Client, IntegrationFn } from '@elenjical/core/browser';\nimport {\n captureMessage,\n defineIntegration,\n getClient,\n GLOBAL_OBJ,\n supportsReportingObserver,\n withScope,\n} from '@elenjical/core/browser';\n\nconst WINDOW = GLOBAL_OBJ as typeof GLOBAL_OBJ & Window;\n\nconst INTEGRATION_NAME = 'ReportingObserver' as const;\n\ninterface Report {\n [key: string]: unknown;\n type: ReportTypes;\n url: string;\n body?: ReportBody;\n}\n\ntype ReportTypes = 'crash' | 'deprecation' | 'intervention';\n\ntype ReportBody = CrashReportBody | DeprecationReportBody | InterventionReportBody;\n\ninterface CrashReportBody {\n [key: string]: unknown;\n crashId: string;\n reason?: string;\n}\n\ninterface DeprecationReportBody {\n [key: string]: unknown;\n id: string;\n anticipatedRemoval?: Date;\n message: string;\n sourceFile?: string;\n lineNumber?: number;\n columnNumber?: number;\n}\n\ninterface InterventionReportBody {\n [key: string]: unknown;\n id: string;\n message: string;\n sourceFile?: string;\n lineNumber?: number;\n columnNumber?: number;\n}\n\ninterface ReportingObserverOptions {\n types?: ReportTypes[];\n}\n\n/** This is experimental and the types are not included with TypeScript, sadly. */\ninterface ReportingObserverClass {\n new (\n handler: (reports: Report[]) => void,\n options: { buffered?: boolean; types?: ReportTypes[] },\n ): {\n observe: () => void;\n };\n}\n\nconst SETUP_CLIENTS = new WeakMap<Client, boolean>();\n\nconst _reportingObserverIntegration = ((options: ReportingObserverOptions = {}) => {\n const types = options.types || ['crash', 'deprecation', 'intervention'];\n\n /** Handler for the reporting observer. */\n function handler(reports: Report[]): void {\n if (!SETUP_CLIENTS.has(getClient() as Client)) {\n return;\n }\n\n for (const report of reports) {\n withScope(scope => {\n scope.setExtra('url', report.url);\n\n const label = `ReportingObserver [${report.type}]`;\n let details = 'No details available';\n\n if (report.body) {\n // Object.keys doesn't work on ReportBody, as all properties are inherited\n const plainBody: {\n [key: string]: unknown;\n } = {};\n\n // eslint-disable-next-line guard-for-in\n for (const prop in report.body) {\n plainBody[prop] = report.body[prop];\n }\n\n scope.setExtra('body', plainBody);\n\n if (report.type === 'crash') {\n const body = report.body as CrashReportBody;\n // A fancy way to create a message out of crashId OR reason OR both OR fallback\n details = [body.crashId || '', body.reason || ''].join(' ').trim() || details;\n } else {\n const body = report.body as DeprecationReportBody | InterventionReportBody;\n details = body.message || details;\n }\n }\n\n captureMessage(`${label}: ${details}`);\n });\n }\n }\n\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n if (!supportsReportingObserver()) {\n return;\n }\n\n const observer = new (WINDOW as typeof WINDOW & { ReportingObserver: ReportingObserverClass }).ReportingObserver(\n handler,\n {\n buffered: true,\n types,\n },\n );\n\n observer.observe();\n },\n\n setup(client): void {\n SETUP_CLIENTS.set(client, true);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Reporting API integration - https://w3c.github.io/reporting/\n */\nexport const reportingObserverIntegration = defineIntegration(_reportingObserverIntegration);\n"],"names":["GLOBAL_OBJ","getClient","withScope","captureMessage","supportsReportingObserver","defineIntegration"],"mappings":";;;;AAUA,MAAM,MAAA,GAASA,kBAAA;AAEf,MAAM,gBAAA,GAAmB,mBAAA;AAoDzB,MAAM,aAAA,uBAAoB,OAAA,EAAyB;AAEnD,MAAM,6BAAA,IAAiC,CAAC,OAAA,GAAoC,EAAC,KAAM;AACjF,EAAA,MAAM,QAAQ,OAAA,CAAQ,KAAA,IAAS,CAAC,OAAA,EAAS,eAAe,cAAc,CAAA;AAGtE,EAAA,SAAS,QAAQ,OAAA,EAAyB;AACxC,IAAA,IAAI,CAAC,aAAA,CAAc,GAAA,CAAIC,iBAAA,EAAqB,CAAA,EAAG;AAC7C,MAAA;AAAA,IACF;AAEA,IAAA,KAAA,MAAW,UAAU,OAAA,EAAS;AAC5B,MAAAC,iBAAA,CAAU,CAAA,KAAA,KAAS;AACjB,QAAA,KAAA,CAAM,QAAA,CAAS,KAAA,EAAO,MAAA,CAAO,GAAG,CAAA;AAEhC,QAAA,MAAM,KAAA,GAAQ,CAAA,mBAAA,EAAsB,MAAA,CAAO,IAAI,CAAA,CAAA,CAAA;AAC/C,QAAA,IAAI,OAAA,GAAU,sBAAA;AAEd,QAAA,IAAI,OAAO,IA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,4BAAA,GAA+BC,0BAAkB,6BAA6B;;;;"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const browser = require('@elenjical/core/browser');
|
|
4
|
+
const debugBuild = require('../debug-build.js');
|
|
5
|
+
|
|
6
|
+
const spanStreamingIntegration = browser.defineIntegration(() => {
|
|
7
|
+
return {
|
|
8
|
+
name: "SpanStreaming",
|
|
9
|
+
beforeSetup(client) {
|
|
10
|
+
const clientOptions = client.getOptions();
|
|
11
|
+
if (!clientOptions.traceLifecycle) {
|
|
12
|
+
debugBuild.DEBUG_BUILD && browser.debug.log('[SpanStreaming] setting `traceLifecycle` to "stream"');
|
|
13
|
+
clientOptions.traceLifecycle = "stream";
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
setup(client) {
|
|
17
|
+
const initialMessage = "SpanStreaming integration requires";
|
|
18
|
+
const fallbackMsg = "Falling back to static trace lifecycle.";
|
|
19
|
+
const clientOptions = client.getOptions();
|
|
20
|
+
if (!browser.hasSpanStreamingEnabled(client)) {
|
|
21
|
+
clientOptions.traceLifecycle = "static";
|
|
22
|
+
debugBuild.DEBUG_BUILD && browser.debug.warn(`${initialMessage} \`traceLifecycle\` to be set to "stream"! ${fallbackMsg}`);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const beforeSendSpan = clientOptions.beforeSendSpan;
|
|
26
|
+
if (beforeSendSpan && !browser.isStreamedBeforeSendSpanCallback(beforeSendSpan)) {
|
|
27
|
+
clientOptions.traceLifecycle = "static";
|
|
28
|
+
debugBuild.DEBUG_BUILD && browser.debug.warn(`${initialMessage} a beforeSendSpan callback using \`withStreamedSpan\`! ${fallbackMsg}`);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const buffer = new browser.SpanBuffer(client);
|
|
32
|
+
client.on("afterSpanEnd", (span) => {
|
|
33
|
+
if (!browser.spanIsSampled(span)) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
buffer.add(browser.captureSpan(span, client));
|
|
37
|
+
});
|
|
38
|
+
client.on("afterSegmentSpanEnd", (segmentSpan) => {
|
|
39
|
+
const traceId = segmentSpan.spanContext().traceId;
|
|
40
|
+
setTimeout(() => {
|
|
41
|
+
buffer.flush(traceId);
|
|
42
|
+
}, 500);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
exports.spanStreamingIntegration = spanStreamingIntegration;
|
|
49
|
+
//# sourceMappingURL=spanstreaming.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spanstreaming.js","sources":["../../../../../src/integrations/spanstreaming.ts"],"sourcesContent":["import type { IntegrationFn } from '@elenjical/core/browser';\nimport {\n captureSpan,\n debug,\n defineIntegration,\n hasSpanStreamingEnabled,\n isStreamedBeforeSendSpanCallback,\n SpanBuffer,\n spanIsSampled,\n} from '@elenjical/core/browser';\nimport { DEBUG_BUILD } from '../debug-build';\n\nexport const spanStreamingIntegration = defineIntegration(() => {\n return {\n name: 'SpanStreaming' as const,\n\n beforeSetup(client) {\n // If users only set spanStreamingIntegration, without traceLifecycle, we set it to \"stream\" for them.\n // This avoids the classic double-opt-in problem we'd otherwise have in the browser SDK.\n const clientOptions = client.getOptions();\n if (!clientOptions.traceLifecycle) {\n DEBUG_BUILD && debug.log('[SpanStreaming] setting `traceLifecycle` to \"stream\"');\n clientOptions.traceLifecycle = 'stream';\n }\n },\n\n setup(client) {\n const initialMessage = 'SpanStreaming integration requires';\n const fallbackMsg = 'Falling back to static trace lifecycle.';\n const clientOptions = client.getOptions();\n\n if (!hasSpanStreamingEnabled(client)) {\n clientOptions.traceLifecycle = 'static';\n DEBUG_BUILD && debug.warn(`${initialMessage} \\`traceLifecycle\\` to be set to \"stream\"! ${fallbackMsg}`);\n return;\n }\n\n const beforeSendSpan = clientOptions.beforeSendSpan;\n // If users misconfigure their SDK by opting into span streaming but\n // using an incompatible beforeSendSpan callback, we fall back to the static trace lifecycle.\n if (beforeSendSpan && !isStreamedBeforeSendSpanCallback(beforeSendSpan)) {\n clientOptions.traceLifecycle = 'static';\n DEBUG_BUILD &&\n debug.warn(`${initialMessage} a beforeSendSpan callback using \\`withStreamedSpan\\`! ${fallbackMsg}`);\n return;\n }\n\n const buffer = new SpanBuffer(client);\n\n client.on('afterSpanEnd', span => {\n // Negatively sampled spans must not be captured.\n // This happens because OTel and we create non-recording spans for negatively sampled spans\n // that go through the same life cycle as recording spans.\n if (!spanIsSampled(span)) {\n return;\n }\n buffer.add(captureSpan(span, client));\n });\n\n // In addition to capturing the span, we also flush the trace when the segment\n // span ends to ensure things are sent timely. We never know when the browser\n // is closed, users navigate away, etc.\n client.on('afterSegmentSpanEnd', segmentSpan => {\n const traceId = segmentSpan.spanContext().traceId;\n setTimeout(() => {\n buffer.flush(traceId);\n }, 500);\n });\n },\n };\n}) satisfies IntegrationFn;\n"],"names":["defineIntegration","DEBUG_BUILD","debug","hasSpanStreamingEnabled","isStreamedBeforeSendSpanCallback","SpanBuffer","spanIsSampled","captureSpan"],"mappings":";;;;;AAYO,MAAM,wBAAA,GAA2BA,0BAAkB,MAAM;AAC9D,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,eAAA;AAAA,IAEN,YAAY,MAAA,EAAQ;AAGlB,MAAA,MAAM,aAAA,GAAgB,OAAO,UAAA,EAAW;AACxC,MAAA,IAAI,CAAC,cAAc,cAAA,EAAgB;AACjC,QAAAC,sBAAA,IAAeC,aAAA,CAAM,IAAI,sDAAsD,CAAA;AAC/E,QAAA,aAAA,CAAc,cAAA,GAAiB,QAAA;AAAA,MACjC;AAAA,IACF,CAAA;AAAA,IAEA,MAAM,MAAA,EAAQ;AACZ,MAAA,MAAM,cAAA,GAAiB,oCAAA;AACvB,MAAA,MAAM,WAAA,GAAc,yCAAA;AACpB,MAAA,MAAM,aAAA,GAAgB,OAAO,UAAA,EA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
const browser = require('@elenjical/core/browser');
|
|
4
|
+
const browserUtils = require('@elenjical/browser-utils');
|
|
5
|
+
const debugBuild = require('../debug-build.js');
|
|
6
|
+
|
|
7
|
+
const INTEGRATION_NAME = "SpotlightBrowser";
|
|
8
|
+
const SPOTLIGHT_IGNORE_SPANS = [{ op: "ui.interaction.click", name: "#elenjical-spotlight" }];
|
|
9
|
+
const _spotlightIntegration = ((options = {}) => {
|
|
10
|
+
const sidecarUrl = options.sidecarUrl || "http://localhost:8969/stream";
|
|
11
|
+
return {
|
|
12
|
+
name: INTEGRATION_NAME,
|
|
13
|
+
setup: () => {
|
|
14
|
+
debugBuild.DEBUG_BUILD && browser.debug.log("Using Sidecar URL", sidecarUrl);
|
|
15
|
+
},
|
|
16
|
+
beforeSetup(client) {
|
|
17
|
+
const opts = client.getOptions();
|
|
18
|
+
opts.ignoreSpans = [...opts.ignoreSpans || [], ...SPOTLIGHT_IGNORE_SPANS];
|
|
19
|
+
},
|
|
20
|
+
afterAllSetup: (client) => {
|
|
21
|
+
setupSidecarForwarding(client, sidecarUrl);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
function setupSidecarForwarding(client, sidecarUrl) {
|
|
26
|
+
const makeFetch = browserUtils.getNativeImplementation("fetch");
|
|
27
|
+
let failCount = 0;
|
|
28
|
+
client.on("beforeEnvelope", (envelope) => {
|
|
29
|
+
if (failCount > 3) {
|
|
30
|
+
browser.debug.warn("[Spotlight] Disabled Elenjical -> Spotlight integration due to too many failed requests:", failCount);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
makeFetch(sidecarUrl, {
|
|
34
|
+
method: "POST",
|
|
35
|
+
body: browser.serializeEnvelope(envelope),
|
|
36
|
+
headers: {
|
|
37
|
+
"Content-Type": "application/x-sentry-envelope"
|
|
38
|
+
},
|
|
39
|
+
mode: "cors"
|
|
40
|
+
}).then(
|
|
41
|
+
(res) => {
|
|
42
|
+
if (res.status >= 200 && res.status < 400) {
|
|
43
|
+
failCount = 0;
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
(err) => {
|
|
47
|
+
failCount++;
|
|
48
|
+
browser.debug.error(
|
|
49
|
+
"Elenjical SDK can't connect to Sidecar is it running? See: https://spotlightjs.com/sidecar/npx/",
|
|
50
|
+
err
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
const spotlightBrowserIntegration = browser.defineIntegration(_spotlightIntegration);
|
|
57
|
+
|
|
58
|
+
exports.INTEGRATION_NAME = INTEGRATION_NAME;
|
|
59
|
+
exports.SPOTLIGHT_IGNORE_SPANS = SPOTLIGHT_IGNORE_SPANS;
|
|
60
|
+
exports.spotlightBrowserIntegration = spotlightBrowserIntegration;
|
|
61
|
+
//# sourceMappingURL=spotlight.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spotlight.js","sources":["../../../../../src/integrations/spotlight.ts"],"sourcesContent":["import type { Client, Envelope, IntegrationFn } from '@elenjical/core/browser';\nimport { debug, defineIntegration, serializeEnvelope } from '@elenjical/core/browser';\nimport { getNativeImplementation } from '@elenjical/browser-utils';\nimport { DEBUG_BUILD } from '../debug-build';\nimport type { WINDOW } from '../helpers';\n\nexport type SpotlightConnectionOptions = {\n /**\n * Set this if the Spotlight Sidecar is not running on localhost:8969\n * By default, the Url is set to http://localhost:8969/stream\n */\n sidecarUrl?: string;\n};\n\nexport const INTEGRATION_NAME = 'SpotlightBrowser' as const;\n\nexport const SPOTLIGHT_IGNORE_SPANS = [{ op: 'ui.interaction.click', name: '#elenjical-spotlight' }];\n\nconst _spotlightIntegration = ((options: Partial<SpotlightConnectionOptions> = {}) => {\n const sidecarUrl = options.sidecarUrl || 'http://localhost:8969/stream';\n\n return {\n name: INTEGRATION_NAME,\n setup: () => {\n DEBUG_BUILD && debug.log('Using Sidecar URL', sidecarUrl);\n },\n beforeSetup(client: Client) {\n const opts = client.getOptions();\n opts.ignoreSpans = [...(opts.ignoreSpans || []), ...SPOTLIGHT_IGNORE_SPANS];\n },\n afterAllSetup: (client: Client) => {\n setupSidecarForwarding(client, sidecarUrl);\n },\n };\n}) satisfies IntegrationFn;\n\nfunction setupSidecarForwarding(client: Client, sidecarUrl: string): void {\n const makeFetch: typeof WINDOW.fetch | undefined = getNativeImplementation('fetch');\n let failCount = 0;\n\n client.on('beforeEnvelope', (envelope: Envelope) => {\n if (failCount > 3) {\n debug.warn('[Spotlight] Disabled Elenjical -> Spotlight integration due to too many failed requests:', failCount);\n return;\n }\n\n makeFetch(sidecarUrl, {\n method: 'POST',\n body: serializeEnvelope(envelope),\n headers: {\n 'Content-Type': 'application/x-sentry-envelope',\n },\n mode: 'cors',\n }).then(\n res => {\n if (res.status >= 200 && res.status < 400) {\n // Reset failed requests counter on success\n failCount = 0;\n }\n },\n err => {\n failCount++;\n debug.error(\n \"Elenjical SDK can't connect to Sidecar is it running? See: https://spotlightjs.com/sidecar/npx/\",\n err,\n );\n },\n );\n });\n}\n\n/**\n * Use this integration to send errors and transactions to Spotlight.\n *\n * Learn more about spotlight at https://spotlightjs.com\n */\nexport const spotlightBrowserIntegration = defineIntegration(_spotlightIntegration);\n"],"names":["DEBUG_BUILD","debug","getNativeImplementation","serializeEnvelope","defineIntegration"],"mappings":";;;;;;AAcO,MAAM,gBAAA,GAAmB;AAEzB,MAAM,yBAAyB,CAAC,EAAE,IAAI,sBAAA,EAAwB,IAAA,EAAM,wBAAwB;AAEnG,MAAM,qBAAA,IAAyB,CAAC,OAAA,GAA+C,EAAC,KAAM;AACpF,EAAA,MAAM,UAAA,GAAa,QAAQ,UAAA,IAAc,8BAAA;AAEzC,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,OAAO,MAAM;AACX,MAAAA,sBAAA,IAAeC,aAAA,CAAM,GAAA,CAAI,mBAAA,EAAqB,UAAU,CAAA;AAAA,IAC1D,CAAA;AAAA,IACA,YAAY,MAAA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qBAAqB;;;;;;"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const browser = require('@elenjical/core/browser');
|
|
4
|
+
const helpers = require('../helpers.js');
|
|
5
|
+
|
|
6
|
+
const viewHierarchyIntegration = browser.defineIntegration((options = {}) => {
|
|
7
|
+
const skipHtmlTags = ["script"];
|
|
8
|
+
function walk(element, windows, depth = 0) {
|
|
9
|
+
if (!element) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const children = "shadowRoot" in element && element.shadowRoot ? element.shadowRoot.children : element.children;
|
|
13
|
+
for (const child of children) {
|
|
14
|
+
if (!(child instanceof HTMLElement)) {
|
|
15
|
+
continue;
|
|
16
|
+
}
|
|
17
|
+
const componentName = browser.getComponentName(child, 1) || void 0;
|
|
18
|
+
const tagName = child.tagName.toLowerCase();
|
|
19
|
+
if (skipHtmlTags.includes(tagName)) {
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
const result = options.onElement?.({ element: child, componentName, tagName, depth }) || {};
|
|
23
|
+
if (result === "skip") {
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
if (result === "children") {
|
|
27
|
+
walk(child, windows, depth + 1);
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
const { x, y, width, height } = child.getBoundingClientRect();
|
|
31
|
+
const window = {
|
|
32
|
+
identifier: child.id || void 0,
|
|
33
|
+
type: componentName || tagName,
|
|
34
|
+
visible: true,
|
|
35
|
+
alpha: 1,
|
|
36
|
+
height,
|
|
37
|
+
width,
|
|
38
|
+
x,
|
|
39
|
+
y,
|
|
40
|
+
...result
|
|
41
|
+
};
|
|
42
|
+
const children2 = [];
|
|
43
|
+
window.children = children2;
|
|
44
|
+
walk(child, window.children, depth + 1);
|
|
45
|
+
windows.push(window);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
name: "ViewHierarchy",
|
|
50
|
+
processEvent: (event, hint) => {
|
|
51
|
+
if (event.type !== void 0 || options.shouldAttach?.(event, hint) === false) {
|
|
52
|
+
return event;
|
|
53
|
+
}
|
|
54
|
+
const root = {
|
|
55
|
+
rendering_system: "DOM",
|
|
56
|
+
positioning: "absolute",
|
|
57
|
+
windows: []
|
|
58
|
+
};
|
|
59
|
+
walk(options.rootElement?.() || helpers.WINDOW.document.body, root.windows);
|
|
60
|
+
const attachment = {
|
|
61
|
+
filename: "view-hierarchy.json",
|
|
62
|
+
attachmentType: "event.view_hierarchy",
|
|
63
|
+
contentType: "application/json",
|
|
64
|
+
data: JSON.stringify(root)
|
|
65
|
+
};
|
|
66
|
+
hint.attachments = hint.attachments || [];
|
|
67
|
+
hint.attachments.push(attachment);
|
|
68
|
+
return event;
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
exports.viewHierarchyIntegration = viewHierarchyIntegration;
|
|
74
|
+
//# sourceMappingURL=view-hierarchy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view-hierarchy.js","sources":["../../../../../src/integrations/view-hierarchy.ts"],"sourcesContent":["import type { Attachment, Event, EventHint, ViewHierarchyData, ViewHierarchyWindow } from '@elenjical/core/browser';\nimport { defineIntegration, getComponentName } from '@elenjical/core/browser';\nimport { WINDOW } from '../helpers';\n\ninterface OnElementArgs {\n /**\n * The element being processed.\n */\n element: HTMLElement;\n /**\n * Lowercase tag name of the element.\n */\n tagName: string;\n /**\n * The component name of the element.\n */\n componentName?: string;\n\n /**\n * The current depth of the element in the view hierarchy. The root element will have a depth of 0.\n *\n * This allows you to limit the traversal depth for large DOM trees.\n */\n depth?: number;\n}\n\ninterface Options {\n /**\n * Whether to attach the view hierarchy to the event.\n *\n * Default: Always attach.\n */\n shouldAttach?: (event: Event, hint: EventHint) => boolean;\n\n /**\n * A function that returns the root element to start walking the DOM from.\n *\n * Default: `window.document.body`\n */\n rootElement?: () => HTMLElement | undefined;\n\n /**\n * Called for each HTMLElement as we walk the DOM.\n *\n * Return an object to include the element with any additional properties.\n * Return `skip` to exclude the element and its children.\n * Return `children` to skip the element but include its children.\n */\n onElement?: (prop: OnElementArgs) => Record<string, string | number | boolean> | 'skip' | 'children';\n}\n\n/**\n * An integration to include a view hierarchy attachment which contains the DOM.\n */\nexport const viewHierarchyIntegration = defineIntegration((options: Options = {}) => {\n const skipHtmlTags = ['script'];\n\n /** Walk an element */\n function walk(element: HTMLElement, windows: ViewHierarchyWindow[], depth = 0): void {\n if (!element) {\n return;\n }\n\n // With Web Components, we need to walk into shadow DOMs\n const children = 'shadowRoot' in element && element.shadowRoot ? element.shadowRoot.children : element.children;\n\n for (const child of children) {\n if (!(child instanceof HTMLElement)) {\n continue;\n }\n\n const componentName = getComponentName(child, 1) || undefined;\n const tagName = child.tagName.toLowerCase();\n\n if (skipHtmlTags.includes(tagName)) {\n continue;\n }\n\n const result = options.onElement?.({ element: child, componentName, tagName, depth }) || {};\n\n if (result === 'skip') {\n continue;\n }\n\n // Skip this element but include its children\n if (result === 'children') {\n walk(child, windows, depth + 1);\n continue;\n }\n\n const { x, y, width, height } = child.getBoundingClientRect();\n\n const window: ViewHierarchyWindow = {\n identifier: (child.id || undefined) as string,\n type: componentName || tagName,\n visible: true,\n alpha: 1,\n height,\n width,\n x,\n y,\n ...result,\n };\n\n const children: ViewHierarchyWindow[] = [];\n window.children = children;\n\n // Recursively walk the children\n walk(child, window.children, depth + 1);\n\n windows.push(window);\n }\n }\n\n return {\n name: 'ViewHierarchy' as const,\n processEvent: (event, hint) => {\n // only capture for error events\n if (event.type !== undefined || options.shouldAttach?.(event, hint) === false) {\n return event;\n }\n\n const root: ViewHierarchyData = {\n rendering_system: 'DOM',\n positioning: 'absolute',\n windows: [],\n };\n\n walk(options.rootElement?.() || WINDOW.document.body, root.windows);\n\n const attachment: Attachment = {\n filename: 'view-hierarchy.json',\n attachmentType: 'event.view_hierarchy',\n contentType: 'application/json',\n data: JSON.stringify(root),\n };\n\n hint.attachments = hint.attachments || [];\n hint.attachments.push(attachment);\n\n return event;\n },\n };\n});\n"],"names":["defineIntegration","getComponentName","children","WINDOW"],"mappings":";;;;;AAsDO,MAAM,wBAAA,GAA2BA,yBAAA,CAAkB,CAAC,OAAA,GAAmB,EAAC,KAAM;AACnF,EAAA,MAAM,YAAA,GAAe,CAAC,QAAQ,CAAA;AAG9B,EAAA,SAAS,IAAA,CAAK,OAAA,EAAsB,OAAA,EAAgC,KAAA,GAAQ,CAAA,EAAS;AACnF,IAAA,IAAI,CAAC,OAAA,EAAS;AACZ,MAAA;AAAA,IACF;AAGA,IAAA,MAAM,QAAA,GAAW,gBAAgB,OAAA,IAAW,OAAA,CAAQ,aAAa,OAAA,CAAQ,UAAA,CAAW,WAAW,OAAA,CAAQ,QAAA;AAEvG,IAAA,KAAA,MAAW,SAAS,QAAA,EAAU;AAC5B,MAAA,IAAI,EAAE,iBAAiB,WAAA,CAAA,EAAc;AACnC,QAAA;AAAA,MACF;AAEA,MAAA,MAAM,aAAA,GAAgBC,wBAAA,CAAiB,KAAA,EAAO,CAAC,CAAA,IAAK,MAAA;AACpD,MAAA,MAAM,OAAA,GAAU,KAAA,CAAM,OAAA,CAAQ,WAAA,EAAY;AAE1C,MAAA,IAAI,YAAA,CAAa,QAAA,CAAS,OAAO,CAAA,EAAG;AAClC,QAAA;AAAA,MACF;AAEA,MAAA,MAAM,MAAA,GAAS,OAAA,CAAQ,SAAA,GAAY,EAAE,OAAA,EAAS,KAAA,EAAO,aAAA,EAAe,OAAA,EAAS,KAAA,EAAO,CAAA,IAAK,EAAC;AAE1F,MAAA,IAAI,WAAW,MAAA,EAAQ;AACrB,QAAA;AAAA,MACF;AAGA,MAAA,IAAI,WAAW,UAAA,EAAY;AACzB,QAAA,IAAA,CAAK,KAAA,EAAO,OAAA,EAAS,KAAA,GAAQ,CAAC,CAAA;AAC9B,QAAA;AAAA,MACF;AAEA,MAAA,MA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C3B;AAEA,MAAA,IAAA,CAAK,WAAA,GAAc,IAAA,CAAK,WAAA,IAAe,EAAC;AACxC,MAAA,IAAA,CAAK,WAAA,CAAY,KAAK,UAAU,CAAA;AAEhC,MAAA,OAAO,KAAA;AAAA,IACT;AAAA,GACF;AACF,CAAC;;;;"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const browser = require('@elenjical/core/browser');
|
|
4
|
+
const browserUtils = require('@elenjical/browser-utils');
|
|
5
|
+
|
|
6
|
+
const WEB_VITALS_INTEGRATION_NAME = "WebVitals";
|
|
7
|
+
const webVitalsIntegration = browser.defineIntegration((options = {}) => {
|
|
8
|
+
const ignored = new Set(options.ignore ?? []);
|
|
9
|
+
return {
|
|
10
|
+
name: WEB_VITALS_INTEGRATION_NAME,
|
|
11
|
+
setup(client) {
|
|
12
|
+
const spanStreamingEnabled = browser.hasSpanStreamingEnabled(client);
|
|
13
|
+
const { enableStandaloneClsSpans, enableStandaloneLcpSpans } = options._experiments ?? {};
|
|
14
|
+
const recordClsStandaloneSpans = spanStreamingEnabled || ignored.has("cls") ? void 0 : enableStandaloneClsSpans || false;
|
|
15
|
+
const recordLcpStandaloneSpans = spanStreamingEnabled || ignored.has("lcp") ? void 0 : enableStandaloneLcpSpans || false;
|
|
16
|
+
const finalizeWebVitals = browserUtils.startTrackingWebVitals({
|
|
17
|
+
recordClsStandaloneSpans,
|
|
18
|
+
recordLcpStandaloneSpans,
|
|
19
|
+
client
|
|
20
|
+
});
|
|
21
|
+
const pageloadSpans = /* @__PURE__ */ new WeakSet();
|
|
22
|
+
client.on("afterStartPageLoadSpan", (span) => {
|
|
23
|
+
pageloadSpans.add(span);
|
|
24
|
+
});
|
|
25
|
+
client.on("spanEnd", (span) => {
|
|
26
|
+
if (!pageloadSpans.delete(span)) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
finalizeWebVitals();
|
|
30
|
+
browserUtils.addWebVitalsToSpan(span, {
|
|
31
|
+
// CLS/LCP are recorded as pageload span measurements only when they're neither
|
|
32
|
+
// tracked as standalone spans nor handled by span streaming (and not ignored).
|
|
33
|
+
recordClsOnPageloadSpan: recordClsStandaloneSpans === false,
|
|
34
|
+
recordLcpOnPageloadSpan: recordLcpStandaloneSpans === false,
|
|
35
|
+
spanStreamingEnabled
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
if (spanStreamingEnabled) {
|
|
39
|
+
if (!ignored.has("lcp")) {
|
|
40
|
+
browserUtils.trackLcpAsSpan(client);
|
|
41
|
+
}
|
|
42
|
+
if (!ignored.has("cls")) {
|
|
43
|
+
browserUtils.trackClsAsSpan(client);
|
|
44
|
+
}
|
|
45
|
+
if (!ignored.has("inp")) {
|
|
46
|
+
browserUtils.trackInpAsSpan();
|
|
47
|
+
}
|
|
48
|
+
} else if (!ignored.has("inp")) {
|
|
49
|
+
browserUtils.startTrackingINP();
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
afterAllSetup() {
|
|
53
|
+
if (!ignored.has("inp")) {
|
|
54
|
+
browserUtils.registerInpInteractionListener();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
exports.WEB_VITALS_INTEGRATION_NAME = WEB_VITALS_INTEGRATION_NAME;
|
|
61
|
+
exports.webVitalsIntegration = webVitalsIntegration;
|
|
62
|
+
//# sourceMappingURL=webVitals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webVitals.js","sources":["../../../../../src/integrations/webVitals.ts"],"sourcesContent":["import type { IntegrationFn, Span } from '@elenjical/core/browser';\nimport { defineIntegration, hasSpanStreamingEnabled } from '@elenjical/core/browser';\nimport {\n addWebVitalsToSpan,\n registerInpInteractionListener,\n startTrackingINP,\n startTrackingWebVitals,\n trackClsAsSpan,\n trackInpAsSpan,\n trackLcpAsSpan,\n} from '@elenjical/browser-utils';\n\nexport const WEB_VITALS_INTEGRATION_NAME = 'WebVitals' as const;\n\nexport type WebVitalName = 'cls' | 'inp' | 'lcp';\n\nexport interface WebVitalsOptions {\n /**\n * Web vitals to skip.\n */\n ignore?: WebVitalName[];\n\n /**\n * @experimental\n */\n _experiments?: Partial<{\n enableStandaloneClsSpans: boolean;\n enableStandaloneLcpSpans: boolean;\n }>;\n}\n\n/**\n * Captures Core Web Vitals (LCP, CLS, INP) and related pageload vitals.\n *\n * `browserTracingIntegration` auto-registers this integration if no\n * `webVitalsIntegration` is already present, so explicit registration is only\n * needed to customize options or to use it without `browserTracingIntegration`.\n */\nexport const webVitalsIntegration = defineIntegration((options: WebVitalsOptions = {}) => {\n const ignored = new Set(options.ignore ?? []);\n\n return {\n name: WEB_VITALS_INTEGRATION_NAME,\n setup(client) {\n const spanStreamingEnabled = hasSpanStreamingEnabled(client);\n const { enableStandaloneClsSpans, enableStandaloneLcpSpans } = options._experiments ?? {};\n\n const recordClsStandaloneSpans =\n spanStreamingEnabled || ignored.has('cls') ? undefined : enableStandaloneClsSpans || false;\n const recordLcpStandaloneSpans =\n spanStreamingEnabled || ignored.has('lcp') ? undefined : enableStandaloneLcpSpans || false;\n\n // eslint-disable-next-line typescript/no-deprecated\n const finalizeWebVitals = startTrackingWebVitals({\n recordClsStandaloneSpans,\n recordLcpStandaloneSpans,\n client,\n });\n\n const pageloadSpans = new WeakSet<Span>();\n\n client.on('afterStartPageLoadSpan', span => {\n pageloadSpans.add(span);\n });\n\n client.on('spanEnd', span => {\n if (!pageloadSpans.delete(span)) {\n return;\n }\n\n finalizeWebVitals();\n addWebVitalsToSpan(span, {\n // CLS/LCP are recorded as pageload span measurements only when they're neither\n // tracked as standalone spans nor handled by span streaming (and not ignored).\n recordClsOnPageloadSpan: recordClsStandaloneSpans === false,\n recordLcpOnPageloadSpan: recordLcpStandaloneSpans === false,\n spanStreamingEnabled,\n });\n });\n\n if (spanStreamingEnabled) {\n if (!ignored.has('lcp')) {\n trackLcpAsSpan(client);\n }\n if (!ignored.has('cls')) {\n trackClsAsSpan(client);\n }\n if (!ignored.has('inp')) {\n trackInpAsSpan();\n }\n } else if (!ignored.has('inp')) {\n startTrackingINP();\n }\n },\n afterAllSetup() {\n if (!ignored.has('inp')) {\n registerInpInteractionListener();\n }\n },\n };\n}) satisfies IntegrationFn;\n"],"names":["defineIntegration","hasSpanStreamingEnabled","startTrackingWebVitals","addWebVitalsToSpan","trackLcpAsSpan","trackClsAsSpan","trackInpAsSpan","startTrackingINP","registerInpInteractionListener"],"mappings":";;;;;AAYO,MAAM,2BAAA,GAA8B;AA0BpC,MAAM,oBAAA,GAAuBA,yBAAA,CAAkB,CAAC,OAAA,GAA4B,EAAC,KAAM;AACxF,EAAA,MAAM,UAAU,IAAI,GAAA,CAAI,OAAA,CAAQ,MAAA,IAAU,EAAE,CAAA;AAE5C,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,2BAAA;AAAA,IACN,MAAM,MAAA,EAAQ;AACZ,MAAA,MAAM,oBAAA,GAAuBC,gCAAwB,MAAM,CAAA;AAC3D,MAAA,MAAM,EAAE,wBAAA,EAA0B,wBAAA,EAAyB,GAAI,OAAA,CAAQ,gBAAgB,EAAC;AAExF,MAAA,MAAM,2BACJ,oBAAA,IAAwB,OAAA,CAAQ,IAAI,KAAK,CAAA,GAAI,SAAY,wBAAA,IAA4B,KAAA;AACvF,MAAA,MAAM,2BACJ,oBAAA,IAAwB,OAAA,CAAQ,IAAI,KAAK,CAAA,GAAI,SAAY,wBAAA,IAA4B,KAAA;AAGvF,MAAA,MAAM,oBAAoBC,mCAAA,CAAuB;AAAA,QAC/C,wBAAA;AAAA,QACA,wBAAA;AAAA,QACA;AAAA,OACD,CAAA;AAED,MAAA,MAAM,aAAA,uBAAoB,OAAA,EAAc;AAExC,MAAA,MAAA,CAAO,EAAA,CAAG,0BAA0B,CAAA,IAAA,KAAQ;AAC1C,QAAA,aAAA,CAAc,IAAI,IAAI,CAAA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