@sentry/browser 10.51.0 → 10.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/npm/cjs/dev/client.js +7 -7
- package/build/npm/cjs/dev/client.js.map +1 -1
- package/build/npm/cjs/dev/diagnose-sdk.js +3 -3
- package/build/npm/cjs/dev/diagnose-sdk.js.map +1 -1
- package/build/npm/cjs/dev/eventbuilder.js +23 -23
- package/build/npm/cjs/dev/eventbuilder.js.map +1 -1
- package/build/npm/cjs/dev/feedbackAsync.js.map +1 -1
- package/build/npm/cjs/dev/feedbackSync.js.map +1 -1
- package/build/npm/cjs/dev/helpers.js +10 -10
- package/build/npm/cjs/dev/helpers.js.map +1 -1
- package/build/npm/cjs/dev/index.js +84 -84
- package/build/npm/cjs/dev/integrations/breadcrumbs.js +29 -29
- package/build/npm/cjs/dev/integrations/breadcrumbs.js.map +1 -1
- package/build/npm/cjs/dev/integrations/browserapierrors.js +16 -16
- package/build/npm/cjs/dev/integrations/browserapierrors.js.map +1 -1
- package/build/npm/cjs/dev/integrations/browsersession.js +9 -9
- package/build/npm/cjs/dev/integrations/browsersession.js.map +1 -1
- package/build/npm/cjs/dev/integrations/contextlines.js +5 -5
- package/build/npm/cjs/dev/integrations/contextlines.js.map +1 -1
- package/build/npm/cjs/dev/integrations/culturecontext.js +3 -3
- package/build/npm/cjs/dev/integrations/culturecontext.js.map +1 -1
- package/build/npm/cjs/dev/integrations/featureFlags/growthbook/integration.js +2 -2
- package/build/npm/cjs/dev/integrations/featureFlags/growthbook/integration.js.map +1 -1
- package/build/npm/cjs/dev/integrations/featureFlags/launchdarkly/integration.js +5 -5
- package/build/npm/cjs/dev/integrations/featureFlags/launchdarkly/integration.js.map +1 -1
- package/build/npm/cjs/dev/integrations/featureFlags/openfeature/integration.js +7 -7
- package/build/npm/cjs/dev/integrations/featureFlags/openfeature/integration.js.map +1 -1
- package/build/npm/cjs/dev/integrations/featureFlags/statsig/integration.js +5 -5
- package/build/npm/cjs/dev/integrations/featureFlags/statsig/integration.js.map +1 -1
- package/build/npm/cjs/dev/integrations/featureFlags/unleash/integration.js +7 -7
- package/build/npm/cjs/dev/integrations/featureFlags/unleash/integration.js.map +1 -1
- package/build/npm/cjs/dev/integrations/globalhandlers.js +16 -16
- package/build/npm/cjs/dev/integrations/globalhandlers.js.map +1 -1
- package/build/npm/cjs/dev/integrations/graphqlClient.js +9 -9
- package/build/npm/cjs/dev/integrations/graphqlClient.js.map +1 -1
- package/build/npm/cjs/dev/integrations/httpclient.js +14 -14
- package/build/npm/cjs/dev/integrations/httpclient.js.map +1 -1
- package/build/npm/cjs/dev/integrations/httpcontext.js +3 -3
- package/build/npm/cjs/dev/integrations/httpcontext.js.map +1 -1
- package/build/npm/cjs/dev/integrations/linkederrors.js +3 -3
- package/build/npm/cjs/dev/integrations/linkederrors.js.map +1 -1
- package/build/npm/cjs/dev/integrations/reportingobserver.js +7 -7
- package/build/npm/cjs/dev/integrations/reportingobserver.js.map +1 -1
- package/build/npm/cjs/dev/integrations/spanstreaming.js +10 -10
- package/build/npm/cjs/dev/integrations/spanstreaming.js.map +1 -1
- package/build/npm/cjs/dev/integrations/spotlight.js +13 -24
- package/build/npm/cjs/dev/integrations/spotlight.js.map +1 -1
- package/build/npm/cjs/dev/integrations/view-hierarchy.js +3 -3
- package/build/npm/cjs/dev/integrations/view-hierarchy.js.map +1 -1
- package/build/npm/cjs/dev/integrations/webWorker.js +18 -18
- package/build/npm/cjs/dev/integrations/webWorker.js.map +1 -1
- package/build/npm/cjs/dev/profiling/UIProfiler.js +43 -33
- package/build/npm/cjs/dev/profiling/UIProfiler.js.map +1 -1
- package/build/npm/cjs/dev/profiling/index.js +7 -7
- package/build/npm/cjs/dev/profiling/index.js.map +1 -1
- package/build/npm/cjs/dev/profiling/integration.js +20 -18
- package/build/npm/cjs/dev/profiling/integration.js.map +1 -1
- package/build/npm/cjs/dev/profiling/startProfileForSpan.js +14 -11
- package/build/npm/cjs/dev/profiling/startProfileForSpan.js.map +1 -1
- package/build/npm/cjs/dev/profiling/utils.js +39 -68
- package/build/npm/cjs/dev/profiling/utils.js.map +1 -1
- package/build/npm/cjs/dev/report-dialog.js +7 -7
- package/build/npm/cjs/dev/report-dialog.js.map +1 -1
- package/build/npm/cjs/dev/sdk.js +8 -8
- package/build/npm/cjs/dev/sdk.js.map +1 -1
- package/build/npm/cjs/dev/stack-parsers.js +10 -10
- package/build/npm/cjs/dev/stack-parsers.js.map +1 -1
- package/build/npm/cjs/dev/tracing/backgroundtab.js +7 -7
- package/build/npm/cjs/dev/tracing/backgroundtab.js.map +1 -1
- package/build/npm/cjs/dev/tracing/browserTracingIntegration.js +52 -52
- package/build/npm/cjs/dev/tracing/browserTracingIntegration.js.map +1 -1
- package/build/npm/cjs/dev/tracing/linkedTraces.js +11 -11
- package/build/npm/cjs/dev/tracing/linkedTraces.js.map +1 -1
- package/build/npm/cjs/dev/tracing/reportPageLoaded.js +2 -2
- package/build/npm/cjs/dev/tracing/reportPageLoaded.js.map +1 -1
- package/build/npm/cjs/dev/tracing/request.js +31 -29
- package/build/npm/cjs/dev/tracing/request.js.map +1 -1
- package/build/npm/cjs/dev/tracing/setActiveSpan.js +5 -5
- package/build/npm/cjs/dev/tracing/setActiveSpan.js.map +1 -1
- package/build/npm/cjs/dev/transports/fetch.js +3 -3
- package/build/npm/cjs/dev/transports/fetch.js.map +1 -1
- package/build/npm/cjs/dev/transports/offline.js +5 -5
- package/build/npm/cjs/dev/transports/offline.js.map +1 -1
- package/build/npm/cjs/dev/userfeedback.js +3 -3
- package/build/npm/cjs/dev/userfeedback.js.map +1 -1
- package/build/npm/cjs/dev/utils/detectBrowserExtension.js +3 -3
- package/build/npm/cjs/dev/utils/detectBrowserExtension.js.map +1 -1
- package/build/npm/cjs/dev/utils/lazyLoadIntegration.js +3 -3
- package/build/npm/cjs/dev/utils/lazyLoadIntegration.js.map +1 -1
- package/build/npm/cjs/prod/client.js +7 -7
- package/build/npm/cjs/prod/client.js.map +1 -1
- package/build/npm/cjs/prod/diagnose-sdk.js +3 -3
- package/build/npm/cjs/prod/diagnose-sdk.js.map +1 -1
- package/build/npm/cjs/prod/eventbuilder.js +23 -23
- package/build/npm/cjs/prod/eventbuilder.js.map +1 -1
- package/build/npm/cjs/prod/feedbackAsync.js.map +1 -1
- package/build/npm/cjs/prod/feedbackSync.js.map +1 -1
- package/build/npm/cjs/prod/helpers.js +10 -10
- package/build/npm/cjs/prod/helpers.js.map +1 -1
- package/build/npm/cjs/prod/index.js +84 -84
- package/build/npm/cjs/prod/integrations/breadcrumbs.js +29 -29
- package/build/npm/cjs/prod/integrations/breadcrumbs.js.map +1 -1
- package/build/npm/cjs/prod/integrations/browserapierrors.js +16 -16
- package/build/npm/cjs/prod/integrations/browserapierrors.js.map +1 -1
- package/build/npm/cjs/prod/integrations/browsersession.js +9 -9
- package/build/npm/cjs/prod/integrations/browsersession.js.map +1 -1
- package/build/npm/cjs/prod/integrations/contextlines.js +5 -5
- package/build/npm/cjs/prod/integrations/contextlines.js.map +1 -1
- package/build/npm/cjs/prod/integrations/culturecontext.js +3 -3
- package/build/npm/cjs/prod/integrations/culturecontext.js.map +1 -1
- package/build/npm/cjs/prod/integrations/featureFlags/growthbook/integration.js +2 -2
- package/build/npm/cjs/prod/integrations/featureFlags/growthbook/integration.js.map +1 -1
- package/build/npm/cjs/prod/integrations/featureFlags/launchdarkly/integration.js +5 -5
- package/build/npm/cjs/prod/integrations/featureFlags/launchdarkly/integration.js.map +1 -1
- package/build/npm/cjs/prod/integrations/featureFlags/openfeature/integration.js +7 -7
- package/build/npm/cjs/prod/integrations/featureFlags/openfeature/integration.js.map +1 -1
- package/build/npm/cjs/prod/integrations/featureFlags/statsig/integration.js +5 -5
- package/build/npm/cjs/prod/integrations/featureFlags/statsig/integration.js.map +1 -1
- package/build/npm/cjs/prod/integrations/featureFlags/unleash/integration.js +7 -7
- package/build/npm/cjs/prod/integrations/featureFlags/unleash/integration.js.map +1 -1
- package/build/npm/cjs/prod/integrations/globalhandlers.js +16 -16
- package/build/npm/cjs/prod/integrations/globalhandlers.js.map +1 -1
- package/build/npm/cjs/prod/integrations/graphqlClient.js +9 -9
- package/build/npm/cjs/prod/integrations/graphqlClient.js.map +1 -1
- package/build/npm/cjs/prod/integrations/httpclient.js +14 -14
- package/build/npm/cjs/prod/integrations/httpclient.js.map +1 -1
- package/build/npm/cjs/prod/integrations/httpcontext.js +3 -3
- package/build/npm/cjs/prod/integrations/httpcontext.js.map +1 -1
- package/build/npm/cjs/prod/integrations/linkederrors.js +3 -3
- package/build/npm/cjs/prod/integrations/linkederrors.js.map +1 -1
- package/build/npm/cjs/prod/integrations/reportingobserver.js +7 -7
- package/build/npm/cjs/prod/integrations/reportingobserver.js.map +1 -1
- package/build/npm/cjs/prod/integrations/spanstreaming.js +10 -10
- package/build/npm/cjs/prod/integrations/spanstreaming.js.map +1 -1
- package/build/npm/cjs/prod/integrations/spotlight.js +13 -24
- package/build/npm/cjs/prod/integrations/spotlight.js.map +1 -1
- package/build/npm/cjs/prod/integrations/view-hierarchy.js +3 -3
- package/build/npm/cjs/prod/integrations/view-hierarchy.js.map +1 -1
- package/build/npm/cjs/prod/integrations/webWorker.js +18 -18
- package/build/npm/cjs/prod/integrations/webWorker.js.map +1 -1
- package/build/npm/cjs/prod/profiling/UIProfiler.js +43 -33
- package/build/npm/cjs/prod/profiling/UIProfiler.js.map +1 -1
- package/build/npm/cjs/prod/profiling/index.js +7 -7
- package/build/npm/cjs/prod/profiling/index.js.map +1 -1
- package/build/npm/cjs/prod/profiling/integration.js +20 -18
- package/build/npm/cjs/prod/profiling/integration.js.map +1 -1
- package/build/npm/cjs/prod/profiling/startProfileForSpan.js +14 -11
- package/build/npm/cjs/prod/profiling/startProfileForSpan.js.map +1 -1
- package/build/npm/cjs/prod/profiling/utils.js +39 -68
- package/build/npm/cjs/prod/profiling/utils.js.map +1 -1
- package/build/npm/cjs/prod/report-dialog.js +7 -7
- package/build/npm/cjs/prod/report-dialog.js.map +1 -1
- package/build/npm/cjs/prod/sdk.js +8 -8
- package/build/npm/cjs/prod/sdk.js.map +1 -1
- package/build/npm/cjs/prod/stack-parsers.js +10 -10
- package/build/npm/cjs/prod/stack-parsers.js.map +1 -1
- package/build/npm/cjs/prod/tracing/backgroundtab.js +7 -7
- package/build/npm/cjs/prod/tracing/backgroundtab.js.map +1 -1
- package/build/npm/cjs/prod/tracing/browserTracingIntegration.js +52 -52
- package/build/npm/cjs/prod/tracing/browserTracingIntegration.js.map +1 -1
- package/build/npm/cjs/prod/tracing/linkedTraces.js +11 -11
- package/build/npm/cjs/prod/tracing/linkedTraces.js.map +1 -1
- package/build/npm/cjs/prod/tracing/reportPageLoaded.js +2 -2
- package/build/npm/cjs/prod/tracing/reportPageLoaded.js.map +1 -1
- package/build/npm/cjs/prod/tracing/request.js +31 -29
- package/build/npm/cjs/prod/tracing/request.js.map +1 -1
- package/build/npm/cjs/prod/tracing/setActiveSpan.js +5 -5
- package/build/npm/cjs/prod/tracing/setActiveSpan.js.map +1 -1
- package/build/npm/cjs/prod/transports/fetch.js +3 -3
- package/build/npm/cjs/prod/transports/fetch.js.map +1 -1
- package/build/npm/cjs/prod/transports/offline.js +5 -5
- package/build/npm/cjs/prod/transports/offline.js.map +1 -1
- package/build/npm/cjs/prod/userfeedback.js +3 -3
- package/build/npm/cjs/prod/userfeedback.js.map +1 -1
- package/build/npm/cjs/prod/utils/detectBrowserExtension.js +3 -3
- package/build/npm/cjs/prod/utils/detectBrowserExtension.js.map +1 -1
- package/build/npm/cjs/prod/utils/lazyLoadIntegration.js +3 -3
- package/build/npm/cjs/prod/utils/lazyLoadIntegration.js.map +1 -1
- package/build/npm/esm/dev/client.js +1 -1
- package/build/npm/esm/dev/client.js.map +1 -1
- package/build/npm/esm/dev/diagnose-sdk.js +1 -1
- package/build/npm/esm/dev/diagnose-sdk.js.map +1 -1
- package/build/npm/esm/dev/eventbuilder.js +1 -1
- package/build/npm/esm/dev/eventbuilder.js.map +1 -1
- package/build/npm/esm/dev/feedbackAsync.js.map +1 -1
- package/build/npm/esm/dev/feedbackSync.js.map +1 -1
- package/build/npm/esm/dev/helpers.js +1 -1
- package/build/npm/esm/dev/helpers.js.map +1 -1
- package/build/npm/esm/dev/index.js +1 -1
- package/build/npm/esm/dev/integrations/breadcrumbs.js +1 -1
- package/build/npm/esm/dev/integrations/breadcrumbs.js.map +1 -1
- package/build/npm/esm/dev/integrations/browserapierrors.js +1 -1
- package/build/npm/esm/dev/integrations/browserapierrors.js.map +1 -1
- package/build/npm/esm/dev/integrations/browsersession.js +1 -1
- package/build/npm/esm/dev/integrations/browsersession.js.map +1 -1
- package/build/npm/esm/dev/integrations/contextlines.js +1 -1
- package/build/npm/esm/dev/integrations/contextlines.js.map +1 -1
- package/build/npm/esm/dev/integrations/culturecontext.js +1 -1
- package/build/npm/esm/dev/integrations/culturecontext.js.map +1 -1
- package/build/npm/esm/dev/integrations/featureFlags/growthbook/integration.js +1 -1
- package/build/npm/esm/dev/integrations/featureFlags/growthbook/integration.js.map +1 -1
- package/build/npm/esm/dev/integrations/featureFlags/launchdarkly/integration.js +1 -1
- package/build/npm/esm/dev/integrations/featureFlags/launchdarkly/integration.js.map +1 -1
- package/build/npm/esm/dev/integrations/featureFlags/openfeature/integration.js +1 -1
- package/build/npm/esm/dev/integrations/featureFlags/openfeature/integration.js.map +1 -1
- package/build/npm/esm/dev/integrations/featureFlags/statsig/integration.js +1 -1
- package/build/npm/esm/dev/integrations/featureFlags/statsig/integration.js.map +1 -1
- package/build/npm/esm/dev/integrations/featureFlags/unleash/integration.js +1 -1
- package/build/npm/esm/dev/integrations/featureFlags/unleash/integration.js.map +1 -1
- package/build/npm/esm/dev/integrations/globalhandlers.js +1 -1
- package/build/npm/esm/dev/integrations/globalhandlers.js.map +1 -1
- package/build/npm/esm/dev/integrations/graphqlClient.js +1 -1
- package/build/npm/esm/dev/integrations/graphqlClient.js.map +1 -1
- package/build/npm/esm/dev/integrations/httpclient.js +1 -1
- package/build/npm/esm/dev/integrations/httpclient.js.map +1 -1
- package/build/npm/esm/dev/integrations/httpcontext.js +1 -1
- package/build/npm/esm/dev/integrations/httpcontext.js.map +1 -1
- package/build/npm/esm/dev/integrations/linkederrors.js +1 -1
- package/build/npm/esm/dev/integrations/linkederrors.js.map +1 -1
- package/build/npm/esm/dev/integrations/reportingobserver.js +1 -1
- package/build/npm/esm/dev/integrations/reportingobserver.js.map +1 -1
- package/build/npm/esm/dev/integrations/spanstreaming.js +1 -1
- package/build/npm/esm/dev/integrations/spanstreaming.js.map +1 -1
- package/build/npm/esm/dev/integrations/spotlight.js +8 -19
- package/build/npm/esm/dev/integrations/spotlight.js.map +1 -1
- package/build/npm/esm/dev/integrations/view-hierarchy.js +1 -1
- package/build/npm/esm/dev/integrations/view-hierarchy.js.map +1 -1
- package/build/npm/esm/dev/integrations/webWorker.js +1 -1
- package/build/npm/esm/dev/integrations/webWorker.js.map +1 -1
- package/build/npm/esm/dev/package.json +1 -1
- package/build/npm/esm/dev/profiling/UIProfiler.js +12 -2
- package/build/npm/esm/dev/profiling/UIProfiler.js.map +1 -1
- package/build/npm/esm/dev/profiling/index.js +1 -1
- package/build/npm/esm/dev/profiling/index.js.map +1 -1
- package/build/npm/esm/dev/profiling/integration.js +9 -7
- package/build/npm/esm/dev/profiling/integration.js.map +1 -1
- package/build/npm/esm/dev/profiling/startProfileForSpan.js +5 -2
- package/build/npm/esm/dev/profiling/startProfileForSpan.js.map +1 -1
- package/build/npm/esm/dev/profiling/utils.js +6 -36
- package/build/npm/esm/dev/profiling/utils.js.map +1 -1
- package/build/npm/esm/dev/report-dialog.js +1 -1
- package/build/npm/esm/dev/report-dialog.js.map +1 -1
- package/build/npm/esm/dev/sdk.js +1 -1
- package/build/npm/esm/dev/sdk.js.map +1 -1
- package/build/npm/esm/dev/stack-parsers.js +1 -1
- package/build/npm/esm/dev/stack-parsers.js.map +1 -1
- package/build/npm/esm/dev/tracing/backgroundtab.js +1 -1
- package/build/npm/esm/dev/tracing/backgroundtab.js.map +1 -1
- package/build/npm/esm/dev/tracing/browserTracingIntegration.js +1 -1
- package/build/npm/esm/dev/tracing/browserTracingIntegration.js.map +1 -1
- package/build/npm/esm/dev/tracing/linkedTraces.js +2 -2
- package/build/npm/esm/dev/tracing/linkedTraces.js.map +1 -1
- package/build/npm/esm/dev/tracing/reportPageLoaded.js +1 -1
- package/build/npm/esm/dev/tracing/reportPageLoaded.js.map +1 -1
- package/build/npm/esm/dev/tracing/request.js +6 -4
- package/build/npm/esm/dev/tracing/request.js.map +1 -1
- package/build/npm/esm/dev/tracing/setActiveSpan.js +1 -1
- package/build/npm/esm/dev/tracing/setActiveSpan.js.map +1 -1
- package/build/npm/esm/dev/transports/fetch.js +1 -1
- package/build/npm/esm/dev/transports/fetch.js.map +1 -1
- package/build/npm/esm/dev/transports/offline.js +1 -1
- package/build/npm/esm/dev/transports/offline.js.map +1 -1
- package/build/npm/esm/dev/userfeedback.js +1 -1
- package/build/npm/esm/dev/userfeedback.js.map +1 -1
- package/build/npm/esm/dev/utils/detectBrowserExtension.js +1 -1
- package/build/npm/esm/dev/utils/detectBrowserExtension.js.map +1 -1
- package/build/npm/esm/dev/utils/lazyLoadIntegration.js +1 -1
- package/build/npm/esm/dev/utils/lazyLoadIntegration.js.map +1 -1
- package/build/npm/esm/prod/client.js +1 -1
- package/build/npm/esm/prod/client.js.map +1 -1
- package/build/npm/esm/prod/diagnose-sdk.js +1 -1
- package/build/npm/esm/prod/diagnose-sdk.js.map +1 -1
- package/build/npm/esm/prod/eventbuilder.js +1 -1
- package/build/npm/esm/prod/eventbuilder.js.map +1 -1
- package/build/npm/esm/prod/feedbackAsync.js.map +1 -1
- package/build/npm/esm/prod/feedbackSync.js.map +1 -1
- package/build/npm/esm/prod/helpers.js +1 -1
- package/build/npm/esm/prod/helpers.js.map +1 -1
- package/build/npm/esm/prod/index.js +1 -1
- package/build/npm/esm/prod/integrations/breadcrumbs.js +1 -1
- package/build/npm/esm/prod/integrations/breadcrumbs.js.map +1 -1
- package/build/npm/esm/prod/integrations/browserapierrors.js +1 -1
- package/build/npm/esm/prod/integrations/browserapierrors.js.map +1 -1
- package/build/npm/esm/prod/integrations/browsersession.js +1 -1
- package/build/npm/esm/prod/integrations/browsersession.js.map +1 -1
- package/build/npm/esm/prod/integrations/contextlines.js +1 -1
- package/build/npm/esm/prod/integrations/contextlines.js.map +1 -1
- package/build/npm/esm/prod/integrations/culturecontext.js +1 -1
- package/build/npm/esm/prod/integrations/culturecontext.js.map +1 -1
- package/build/npm/esm/prod/integrations/featureFlags/growthbook/integration.js +1 -1
- package/build/npm/esm/prod/integrations/featureFlags/growthbook/integration.js.map +1 -1
- package/build/npm/esm/prod/integrations/featureFlags/launchdarkly/integration.js +1 -1
- package/build/npm/esm/prod/integrations/featureFlags/launchdarkly/integration.js.map +1 -1
- package/build/npm/esm/prod/integrations/featureFlags/openfeature/integration.js +1 -1
- package/build/npm/esm/prod/integrations/featureFlags/openfeature/integration.js.map +1 -1
- package/build/npm/esm/prod/integrations/featureFlags/statsig/integration.js +1 -1
- package/build/npm/esm/prod/integrations/featureFlags/statsig/integration.js.map +1 -1
- package/build/npm/esm/prod/integrations/featureFlags/unleash/integration.js +1 -1
- package/build/npm/esm/prod/integrations/featureFlags/unleash/integration.js.map +1 -1
- package/build/npm/esm/prod/integrations/globalhandlers.js +1 -1
- package/build/npm/esm/prod/integrations/globalhandlers.js.map +1 -1
- package/build/npm/esm/prod/integrations/graphqlClient.js +1 -1
- package/build/npm/esm/prod/integrations/graphqlClient.js.map +1 -1
- package/build/npm/esm/prod/integrations/httpclient.js +1 -1
- package/build/npm/esm/prod/integrations/httpclient.js.map +1 -1
- package/build/npm/esm/prod/integrations/httpcontext.js +1 -1
- package/build/npm/esm/prod/integrations/httpcontext.js.map +1 -1
- package/build/npm/esm/prod/integrations/linkederrors.js +1 -1
- package/build/npm/esm/prod/integrations/linkederrors.js.map +1 -1
- package/build/npm/esm/prod/integrations/reportingobserver.js +1 -1
- package/build/npm/esm/prod/integrations/reportingobserver.js.map +1 -1
- package/build/npm/esm/prod/integrations/spanstreaming.js +1 -1
- package/build/npm/esm/prod/integrations/spanstreaming.js.map +1 -1
- package/build/npm/esm/prod/integrations/spotlight.js +8 -19
- package/build/npm/esm/prod/integrations/spotlight.js.map +1 -1
- package/build/npm/esm/prod/integrations/view-hierarchy.js +1 -1
- package/build/npm/esm/prod/integrations/view-hierarchy.js.map +1 -1
- package/build/npm/esm/prod/integrations/webWorker.js +1 -1
- package/build/npm/esm/prod/integrations/webWorker.js.map +1 -1
- package/build/npm/esm/prod/package.json +1 -1
- package/build/npm/esm/prod/profiling/UIProfiler.js +12 -2
- package/build/npm/esm/prod/profiling/UIProfiler.js.map +1 -1
- package/build/npm/esm/prod/profiling/index.js +1 -1
- package/build/npm/esm/prod/profiling/index.js.map +1 -1
- package/build/npm/esm/prod/profiling/integration.js +9 -7
- package/build/npm/esm/prod/profiling/integration.js.map +1 -1
- package/build/npm/esm/prod/profiling/startProfileForSpan.js +5 -2
- package/build/npm/esm/prod/profiling/startProfileForSpan.js.map +1 -1
- package/build/npm/esm/prod/profiling/utils.js +6 -36
- package/build/npm/esm/prod/profiling/utils.js.map +1 -1
- package/build/npm/esm/prod/report-dialog.js +1 -1
- package/build/npm/esm/prod/report-dialog.js.map +1 -1
- package/build/npm/esm/prod/sdk.js +1 -1
- package/build/npm/esm/prod/sdk.js.map +1 -1
- package/build/npm/esm/prod/stack-parsers.js +1 -1
- package/build/npm/esm/prod/stack-parsers.js.map +1 -1
- package/build/npm/esm/prod/tracing/backgroundtab.js +1 -1
- package/build/npm/esm/prod/tracing/backgroundtab.js.map +1 -1
- package/build/npm/esm/prod/tracing/browserTracingIntegration.js +1 -1
- package/build/npm/esm/prod/tracing/browserTracingIntegration.js.map +1 -1
- package/build/npm/esm/prod/tracing/linkedTraces.js +2 -2
- package/build/npm/esm/prod/tracing/linkedTraces.js.map +1 -1
- package/build/npm/esm/prod/tracing/reportPageLoaded.js +1 -1
- package/build/npm/esm/prod/tracing/reportPageLoaded.js.map +1 -1
- package/build/npm/esm/prod/tracing/request.js +6 -4
- package/build/npm/esm/prod/tracing/request.js.map +1 -1
- package/build/npm/esm/prod/tracing/setActiveSpan.js +1 -1
- package/build/npm/esm/prod/tracing/setActiveSpan.js.map +1 -1
- package/build/npm/esm/prod/transports/fetch.js +1 -1
- package/build/npm/esm/prod/transports/fetch.js.map +1 -1
- package/build/npm/esm/prod/transports/offline.js +1 -1
- package/build/npm/esm/prod/transports/offline.js.map +1 -1
- package/build/npm/esm/prod/userfeedback.js +1 -1
- package/build/npm/esm/prod/userfeedback.js.map +1 -1
- package/build/npm/esm/prod/utils/detectBrowserExtension.js +1 -1
- package/build/npm/esm/prod/utils/detectBrowserExtension.js.map +1 -1
- package/build/npm/esm/prod/utils/lazyLoadIntegration.js +1 -1
- package/build/npm/esm/prod/utils/lazyLoadIntegration.js.map +1 -1
- package/build/npm/types/client.d.ts +2 -2
- package/build/npm/types/client.d.ts.map +1 -1
- package/build/npm/types/eventbuilder.d.ts +1 -1
- package/build/npm/types/eventbuilder.d.ts.map +1 -1
- package/build/npm/types/exports.d.ts +3 -3
- package/build/npm/types/exports.d.ts.map +1 -1
- package/build/npm/types/feedbackAsync.d.ts +2 -7
- package/build/npm/types/feedbackAsync.d.ts.map +1 -1
- package/build/npm/types/feedbackSync.d.ts +2 -7
- package/build/npm/types/feedbackSync.d.ts.map +1 -1
- package/build/npm/types/helpers.d.ts +2 -2
- package/build/npm/types/helpers.d.ts.map +1 -1
- package/build/npm/types/index.bundle.logs.metrics.d.ts +1 -1
- package/build/npm/types/index.bundle.logs.metrics.d.ts.map +1 -1
- package/build/npm/types/index.bundle.replay.logs.metrics.d.ts +1 -1
- package/build/npm/types/index.bundle.replay.logs.metrics.d.ts.map +1 -1
- package/build/npm/types/index.bundle.tracing.d.ts +1 -1
- package/build/npm/types/index.bundle.tracing.d.ts.map +1 -1
- package/build/npm/types/index.bundle.tracing.logs.metrics.d.ts +2 -2
- package/build/npm/types/index.bundle.tracing.logs.metrics.d.ts.map +1 -1
- package/build/npm/types/index.bundle.tracing.replay.d.ts +1 -1
- package/build/npm/types/index.bundle.tracing.replay.d.ts.map +1 -1
- package/build/npm/types/index.bundle.tracing.replay.feedback.d.ts +1 -1
- package/build/npm/types/index.bundle.tracing.replay.feedback.d.ts.map +1 -1
- package/build/npm/types/index.bundle.tracing.replay.feedback.logs.metrics.d.ts +1 -1
- package/build/npm/types/index.bundle.tracing.replay.feedback.logs.metrics.d.ts.map +1 -1
- package/build/npm/types/index.bundle.tracing.replay.logs.metrics.d.ts +2 -2
- package/build/npm/types/index.bundle.tracing.replay.logs.metrics.d.ts.map +1 -1
- package/build/npm/types/index.d.ts +3 -3
- package/build/npm/types/index.d.ts.map +1 -1
- package/build/npm/types/integrations/contextlines.d.ts +1 -1
- package/build/npm/types/integrations/contextlines.d.ts.map +1 -1
- package/build/npm/types/integrations/globalhandlers.d.ts +1 -1
- package/build/npm/types/integrations/globalhandlers.d.ts.map +1 -1
- package/build/npm/types/integrations/spotlight.d.ts +4 -5
- package/build/npm/types/integrations/spotlight.d.ts.map +1 -1
- package/build/npm/types/integrations/view-hierarchy.d.ts +1 -1
- package/build/npm/types/integrations/view-hierarchy.d.ts.map +1 -1
- package/build/npm/types/integrations/webWorker.d.ts +1 -1
- package/build/npm/types/integrations/webWorker.d.ts.map +1 -1
- package/build/npm/types/integrations-bundle/index.captureconsole.d.ts +1 -1
- package/build/npm/types/integrations-bundle/index.captureconsole.d.ts.map +1 -1
- package/build/npm/types/integrations-bundle/index.createlangchaincallbackhandler.d.ts +1 -1
- package/build/npm/types/integrations-bundle/index.createlangchaincallbackhandler.d.ts.map +1 -1
- package/build/npm/types/integrations-bundle/index.dedupe.d.ts +1 -1
- package/build/npm/types/integrations-bundle/index.dedupe.d.ts.map +1 -1
- package/build/npm/types/integrations-bundle/index.extraerrordata.d.ts +1 -1
- package/build/npm/types/integrations-bundle/index.extraerrordata.d.ts.map +1 -1
- package/build/npm/types/integrations-bundle/index.feedback.d.ts +1 -1
- package/build/npm/types/integrations-bundle/index.feedback.d.ts.map +1 -1
- package/build/npm/types/integrations-bundle/index.instrumentanthropicaiclient.d.ts +1 -1
- package/build/npm/types/integrations-bundle/index.instrumentanthropicaiclient.d.ts.map +1 -1
- package/build/npm/types/integrations-bundle/index.instrumentgooglegenaiclient.d.ts +1 -1
- package/build/npm/types/integrations-bundle/index.instrumentgooglegenaiclient.d.ts.map +1 -1
- package/build/npm/types/integrations-bundle/index.instrumentlangchainembeddings.d.ts +1 -1
- package/build/npm/types/integrations-bundle/index.instrumentlangchainembeddings.d.ts.map +1 -1
- package/build/npm/types/integrations-bundle/index.instrumentlanggraph.d.ts +1 -1
- package/build/npm/types/integrations-bundle/index.instrumentlanggraph.d.ts.map +1 -1
- package/build/npm/types/integrations-bundle/index.instrumentopenaiclient.d.ts +1 -1
- package/build/npm/types/integrations-bundle/index.instrumentopenaiclient.d.ts.map +1 -1
- package/build/npm/types/integrations-bundle/index.modulemetadata.d.ts +1 -1
- package/build/npm/types/integrations-bundle/index.modulemetadata.d.ts.map +1 -1
- package/build/npm/types/integrations-bundle/index.rewriteframes.d.ts +1 -1
- package/build/npm/types/integrations-bundle/index.rewriteframes.d.ts.map +1 -1
- package/build/npm/types/pluggable-exports-bundle/index.multiplexedtransport.d.ts +1 -1
- package/build/npm/types/pluggable-exports-bundle/index.multiplexedtransport.d.ts.map +1 -1
- package/build/npm/types/profiling/UIProfiler.d.ts +1 -1
- package/build/npm/types/profiling/UIProfiler.d.ts.map +1 -1
- package/build/npm/types/profiling/index.d.ts +1 -1
- package/build/npm/types/profiling/index.d.ts.map +1 -1
- package/build/npm/types/profiling/integration.d.ts.map +1 -1
- package/build/npm/types/profiling/startProfileForSpan.d.ts +1 -1
- package/build/npm/types/profiling/startProfileForSpan.d.ts.map +1 -1
- package/build/npm/types/profiling/utils.d.ts +3 -5
- package/build/npm/types/profiling/utils.d.ts.map +1 -1
- package/build/npm/types/report-dialog.d.ts +1 -1
- package/build/npm/types/report-dialog.d.ts.map +1 -1
- package/build/npm/types/sdk.d.ts +1 -1
- package/build/npm/types/sdk.d.ts.map +1 -1
- package/build/npm/types/stack-parsers.d.ts +1 -1
- package/build/npm/types/stack-parsers.d.ts.map +1 -1
- package/build/npm/types/tracing/browserTracingIntegration.d.ts +1 -1
- package/build/npm/types/tracing/browserTracingIntegration.d.ts.map +1 -1
- package/build/npm/types/tracing/linkedTraces.d.ts +2 -2
- package/build/npm/types/tracing/linkedTraces.d.ts.map +1 -1
- package/build/npm/types/tracing/reportPageLoaded.d.ts +1 -1
- package/build/npm/types/tracing/reportPageLoaded.d.ts.map +1 -1
- package/build/npm/types/tracing/request.d.ts +1 -1
- package/build/npm/types/tracing/request.d.ts.map +1 -1
- package/build/npm/types/tracing/setActiveSpan.d.ts +1 -1
- package/build/npm/types/tracing/setActiveSpan.d.ts.map +1 -1
- package/build/npm/types/transports/fetch.d.ts +1 -1
- package/build/npm/types/transports/fetch.d.ts.map +1 -1
- package/build/npm/types/transports/offline.d.ts +1 -1
- package/build/npm/types/transports/offline.d.ts.map +1 -1
- package/build/npm/types/transports/types.d.ts +1 -1
- package/build/npm/types/transports/types.d.ts.map +1 -1
- package/build/npm/types/userfeedback.d.ts +1 -1
- package/build/npm/types/userfeedback.d.ts.map +1 -1
- package/build/npm/types/utils/lazyLoadIntegration.d.ts +1 -1
- package/build/npm/types/utils/lazyLoadIntegration.d.ts.map +1 -1
- package/build/npm/types-ts3.8/client.d.ts +2 -2
- package/build/npm/types-ts3.8/eventbuilder.d.ts +1 -1
- package/build/npm/types-ts3.8/exports.d.ts +3 -3
- package/build/npm/types-ts3.8/feedbackAsync.d.ts +2 -7
- package/build/npm/types-ts3.8/feedbackSync.d.ts +2 -7
- package/build/npm/types-ts3.8/helpers.d.ts +2 -2
- package/build/npm/types-ts3.8/index.bundle.logs.metrics.d.ts +1 -1
- package/build/npm/types-ts3.8/index.bundle.replay.logs.metrics.d.ts +1 -1
- package/build/npm/types-ts3.8/index.bundle.tracing.d.ts +1 -1
- package/build/npm/types-ts3.8/index.bundle.tracing.logs.metrics.d.ts +2 -2
- package/build/npm/types-ts3.8/index.bundle.tracing.replay.d.ts +1 -1
- package/build/npm/types-ts3.8/index.bundle.tracing.replay.feedback.d.ts +1 -1
- package/build/npm/types-ts3.8/index.bundle.tracing.replay.feedback.logs.metrics.d.ts +1 -1
- package/build/npm/types-ts3.8/index.bundle.tracing.replay.logs.metrics.d.ts +2 -2
- package/build/npm/types-ts3.8/index.d.ts +3 -3
- package/build/npm/types-ts3.8/integrations/contextlines.d.ts +1 -1
- package/build/npm/types-ts3.8/integrations/globalhandlers.d.ts +1 -1
- package/build/npm/types-ts3.8/integrations/spotlight.d.ts +4 -5
- package/build/npm/types-ts3.8/integrations/view-hierarchy.d.ts +1 -1
- package/build/npm/types-ts3.8/integrations/webWorker.d.ts +1 -1
- package/build/npm/types-ts3.8/integrations-bundle/index.captureconsole.d.ts +1 -1
- package/build/npm/types-ts3.8/integrations-bundle/index.createlangchaincallbackhandler.d.ts +1 -1
- package/build/npm/types-ts3.8/integrations-bundle/index.dedupe.d.ts +1 -1
- package/build/npm/types-ts3.8/integrations-bundle/index.extraerrordata.d.ts +1 -1
- package/build/npm/types-ts3.8/integrations-bundle/index.feedback.d.ts +1 -1
- package/build/npm/types-ts3.8/integrations-bundle/index.instrumentanthropicaiclient.d.ts +1 -1
- package/build/npm/types-ts3.8/integrations-bundle/index.instrumentgooglegenaiclient.d.ts +1 -1
- package/build/npm/types-ts3.8/integrations-bundle/index.instrumentlangchainembeddings.d.ts +1 -1
- package/build/npm/types-ts3.8/integrations-bundle/index.instrumentlanggraph.d.ts +1 -1
- package/build/npm/types-ts3.8/integrations-bundle/index.instrumentopenaiclient.d.ts +1 -1
- package/build/npm/types-ts3.8/integrations-bundle/index.modulemetadata.d.ts +1 -1
- package/build/npm/types-ts3.8/integrations-bundle/index.rewriteframes.d.ts +1 -1
- package/build/npm/types-ts3.8/pluggable-exports-bundle/index.multiplexedtransport.d.ts +1 -1
- package/build/npm/types-ts3.8/profiling/UIProfiler.d.ts +1 -1
- package/build/npm/types-ts3.8/profiling/index.d.ts +1 -1
- package/build/npm/types-ts3.8/profiling/startProfileForSpan.d.ts +1 -1
- package/build/npm/types-ts3.8/profiling/utils.d.ts +3 -5
- package/build/npm/types-ts3.8/report-dialog.d.ts +1 -1
- package/build/npm/types-ts3.8/sdk.d.ts +1 -1
- package/build/npm/types-ts3.8/stack-parsers.d.ts +1 -1
- package/build/npm/types-ts3.8/tracing/browserTracingIntegration.d.ts +1 -1
- package/build/npm/types-ts3.8/tracing/linkedTraces.d.ts +2 -2
- package/build/npm/types-ts3.8/tracing/reportPageLoaded.d.ts +1 -1
- package/build/npm/types-ts3.8/tracing/request.d.ts +1 -1
- package/build/npm/types-ts3.8/tracing/setActiveSpan.d.ts +1 -1
- package/build/npm/types-ts3.8/transports/fetch.d.ts +1 -1
- package/build/npm/types-ts3.8/transports/offline.d.ts +1 -1
- package/build/npm/types-ts3.8/transports/types.d.ts +1 -1
- package/build/npm/types-ts3.8/userfeedback.d.ts +1 -1
- package/build/npm/types-ts3.8/utils/lazyLoadIntegration.d.ts +1 -1
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eventbuilder.js","sources":["../../../../src/eventbuilder.ts"],"sourcesContent":["import type {\n Event,\n EventHint,\n Exception,\n ParameterizedString,\n SeverityLevel,\n StackFrame,\n StackParser,\n} from '@sentry/core';\nimport {\n _INTERNAL_enhanceErrorWithSentryInfo,\n addExceptionMechanism,\n addExceptionTypeValue,\n extractExceptionKeysForMessage,\n getClient,\n isDOMError,\n isDOMException,\n isError,\n isErrorEvent,\n isEvent,\n isParameterizedString,\n isPlainObject,\n normalizeToSize,\n resolvedSyncPromise,\n} from '@sentry/core';\n\ntype Prototype = { constructor: (...args: unknown[]) => unknown };\n\n/**\n * This function creates an exception from a JavaScript Error\n */\nexport function exceptionFromError(stackParser: StackParser, ex: Error): Exception {\n // Get the frames first since Opera can lose the stack if we touch anything else first\n const frames = parseStackFrames(stackParser, ex);\n\n const exception: Exception = {\n type: extractType(ex),\n value: extractMessage(ex),\n };\n\n if (frames.length) {\n exception.stacktrace = { frames };\n }\n\n if (exception.type === undefined && exception.value === '') {\n exception.value = 'Unrecoverable error caught';\n }\n\n return exception;\n}\n\nfunction eventFromPlainObject(\n stackParser: StackParser,\n exception: Record<string, unknown>,\n syntheticException?: Error,\n isUnhandledRejection?: boolean,\n): Event {\n const client = getClient();\n const normalizeDepth = client?.getOptions().normalizeDepth;\n\n // If we can, we extract an exception from the object properties\n const errorFromProp = getErrorPropertyFromObject(exception);\n\n const extra = {\n __serialized__: normalizeToSize(exception, normalizeDepth),\n };\n\n if (errorFromProp) {\n return {\n exception: {\n values: [exceptionFromError(stackParser, errorFromProp)],\n },\n extra,\n };\n }\n\n const event = {\n exception: {\n values: [\n {\n type: isEvent(exception) ? exception.constructor.name : isUnhandledRejection ? 'UnhandledRejection' : 'Error',\n value: getNonErrorObjectExceptionValue(exception, { isUnhandledRejection }),\n } as Exception,\n ],\n },\n extra,\n } satisfies Event;\n\n if (syntheticException) {\n const frames = parseStackFrames(stackParser, syntheticException);\n if (frames.length) {\n // event.exception.values[0] has been set above\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n event.exception.values[0]!.stacktrace = { frames };\n }\n }\n\n return event;\n}\n\nfunction eventFromError(stackParser: StackParser, ex: Error): Event {\n return {\n exception: {\n values: [exceptionFromError(stackParser, ex)],\n },\n };\n}\n\n/** Parses stack frames from an error */\nfunction parseStackFrames(\n stackParser: StackParser,\n ex: Error & { framesToPop?: number; stacktrace?: string },\n): StackFrame[] {\n // Access and store the stacktrace property before doing ANYTHING\n // else to it because Opera is not very good at providing it\n // reliably in other circumstances.\n const stacktrace = ex.stacktrace || ex.stack || '';\n\n const skipLines = getSkipFirstStackStringLines(ex);\n const framesToPop = getPopFirstTopFrames(ex);\n\n try {\n return stackParser(stacktrace, skipLines, framesToPop);\n } catch {\n // no-empty\n }\n\n return [];\n}\n\n// Based on our own mapping pattern - https://github.com/getsentry/sentry/blob/9f08305e09866c8bd6d0c24f5b0aabdd7dd6c59c/src/sentry/lang/javascript/errormapping.py#L83-L108\nconst reactMinifiedRegexp = /Minified React error #\\d+;/i;\n\n/**\n * Certain known React errors contain links that would be falsely\n * parsed as frames. This function check for these errors and\n * returns number of the stack string lines to skip.\n */\nfunction getSkipFirstStackStringLines(ex: Error): number {\n if (ex && reactMinifiedRegexp.test(ex.message)) {\n return 1;\n }\n\n return 0;\n}\n\n/**\n * If error has `framesToPop` property, it means that the\n * creator tells us the first x frames will be useless\n * and should be discarded. Typically error from wrapper function\n * which don't point to the actual location in the developer's code.\n *\n * Example: https://github.com/zertosh/invariant/blob/master/invariant.js#L46\n */\nfunction getPopFirstTopFrames(ex: Error & { framesToPop?: unknown }): number {\n if (typeof ex.framesToPop === 'number') {\n return ex.framesToPop;\n }\n\n return 0;\n}\n\n// https://developer.mozilla.org/en-US/docs/WebAssembly/JavaScript_interface/Exception\n// @ts-expect-error - WebAssembly.Exception is a valid class\nfunction isWebAssemblyException(exception: unknown): exception is WebAssembly.Exception {\n // Check for support\n // @ts-expect-error - WebAssembly.Exception is a valid class\n // oxlint-disable-next-line typescript/prefer-optional-chain\n if (typeof WebAssembly !== 'undefined' && typeof WebAssembly.Exception !== 'undefined') {\n // @ts-expect-error - WebAssembly.Exception is a valid class\n return exception instanceof WebAssembly.Exception;\n } else {\n return false;\n }\n}\n\n/**\n * Extracts from errors what we use as the exception `type` in error events.\n *\n * Usually, this is the `name` property on Error objects but WASM errors need to be treated differently.\n */\nexport function extractType(ex: Error & { message: { error?: Error } }): string | undefined {\n const name = ex?.name;\n\n // The name for WebAssembly.Exception Errors needs to be extracted differently.\n // Context: https://github.com/getsentry/sentry-javascript/issues/13787\n if (!name && isWebAssemblyException(ex)) {\n // Emscripten sets array[type, message] to the \"message\" property on the WebAssembly.Exception object\n const hasTypeInMessage = ex.message && Array.isArray(ex.message) && ex.message.length == 2;\n return hasTypeInMessage ? ex.message[0] : 'WebAssembly.Exception';\n }\n\n return name;\n}\n\n/**\n * There are cases where stacktrace.message is an Event object\n * https://github.com/getsentry/sentry-javascript/issues/1949\n * In this specific case we try to extract stacktrace.message.error.message\n */\nexport function extractMessage(ex: Error & { message: { error?: Error } }): string {\n const message = ex?.message;\n\n if (isWebAssemblyException(ex)) {\n // For Node 18, Emscripten sets array[type, message] to the \"message\" property on the WebAssembly.Exception object\n if (Array.isArray(ex.message) && ex.message.length == 2) {\n return ex.message[1];\n }\n return 'wasm exception';\n }\n\n if (!message) {\n return 'No error message';\n }\n\n if (message.error && typeof message.error.message === 'string') {\n return _INTERNAL_enhanceErrorWithSentryInfo(message.error);\n }\n\n return _INTERNAL_enhanceErrorWithSentryInfo(ex);\n}\n\n/**\n * Creates an {@link Event} from all inputs to `captureException` and non-primitive inputs to `captureMessage`.\n * @hidden\n */\nexport function eventFromException(\n stackParser: StackParser,\n exception: unknown,\n hint?: EventHint,\n attachStacktrace?: boolean,\n): PromiseLike<Event> {\n const syntheticException = hint?.syntheticException || undefined;\n const event = eventFromUnknownInput(stackParser, exception, syntheticException, attachStacktrace);\n addExceptionMechanism(event); // defaults to { type: 'generic', handled: true }\n event.level = 'error';\n if (hint?.event_id) {\n event.event_id = hint.event_id;\n }\n return resolvedSyncPromise(event);\n}\n\n/**\n * Builds and Event from a Message\n * @hidden\n */\nexport function eventFromMessage(\n stackParser: StackParser,\n message: ParameterizedString,\n level: SeverityLevel = 'info',\n hint?: EventHint,\n attachStacktrace?: boolean,\n): PromiseLike<Event> {\n const syntheticException = hint?.syntheticException || undefined;\n const event = eventFromString(stackParser, message, syntheticException, attachStacktrace);\n event.level = level;\n if (hint?.event_id) {\n event.event_id = hint.event_id;\n }\n return resolvedSyncPromise(event);\n}\n\n/**\n * @hidden\n */\nexport function eventFromUnknownInput(\n stackParser: StackParser,\n exception: unknown,\n syntheticException?: Error,\n attachStacktrace?: boolean,\n isUnhandledRejection?: boolean,\n): Event {\n let event: Event;\n\n if (isErrorEvent(exception as ErrorEvent) && (exception as ErrorEvent).error) {\n // If it is an ErrorEvent with `error` property, extract it to get actual Error\n const errorEvent = exception as ErrorEvent;\n return eventFromError(stackParser, errorEvent.error as Error);\n }\n\n // If it is a `DOMError` (which is a legacy API, but still supported in some browsers) then we just extract the name\n // and message, as it doesn't provide anything else. According to the spec, all `DOMExceptions` should also be\n // `Error`s, but that's not the case in IE11, so in that case we treat it the same as we do a `DOMError`.\n //\n // https://developer.mozilla.org/en-US/docs/Web/API/DOMError\n // https://developer.mozilla.org/en-US/docs/Web/API/DOMException\n // https://webidl.spec.whatwg.org/#es-DOMException-specialness\n if (isDOMError(exception) || isDOMException(exception as DOMException)) {\n const domException = exception as DOMException;\n\n if ('stack' in (exception as Error)) {\n event = eventFromError(stackParser, exception as Error);\n } else {\n const name = domException.name || (isDOMError(domException) ? 'DOMError' : 'DOMException');\n const message = domException.message ? `${name}: ${domException.message}` : name;\n event = eventFromString(stackParser, message, syntheticException, attachStacktrace);\n addExceptionTypeValue(event, message);\n }\n if ('code' in domException) {\n // eslint-disable-next-line deprecation/deprecation\n event.tags = { ...event.tags, 'DOMException.code': `${domException.code}` };\n }\n\n return event;\n }\n if (isError(exception)) {\n // we have a real Error object, do nothing\n return eventFromError(stackParser, exception);\n }\n if (isPlainObject(exception) || isEvent(exception)) {\n // If it's a plain object or an instance of `Event` (the built-in JS kind, not this SDK's `Event` type), serialize\n // it manually. This will allow us to group events based on top-level keys which is much better than creating a new\n // group on any key/value change.\n const objectException = exception;\n event = eventFromPlainObject(stackParser, objectException, syntheticException, isUnhandledRejection);\n addExceptionMechanism(event, {\n synthetic: true,\n });\n return event;\n }\n\n // If none of previous checks were valid, then it means that it's not:\n // - an instance of DOMError\n // - an instance of DOMException\n // - an instance of Event\n // - an instance of Error\n // - a valid ErrorEvent (one with an error property)\n // - a plain Object\n //\n // So bail out and capture it as a simple message:\n event = eventFromString(stackParser, exception as string, syntheticException, attachStacktrace);\n addExceptionTypeValue(event, `${exception}`, undefined);\n addExceptionMechanism(event, {\n synthetic: true,\n });\n\n return event;\n}\n\nfunction eventFromString(\n stackParser: StackParser,\n message: ParameterizedString,\n syntheticException?: Error,\n attachStacktrace?: boolean,\n): Event {\n const event: Event = {};\n\n if (attachStacktrace && syntheticException) {\n const frames = parseStackFrames(stackParser, syntheticException);\n if (frames.length) {\n event.exception = {\n values: [{ value: message, stacktrace: { frames } }],\n };\n }\n addExceptionMechanism(event, { synthetic: true });\n }\n\n if (isParameterizedString(message)) {\n const { __sentry_template_string__, __sentry_template_values__ } = message;\n\n event.logentry = {\n message: __sentry_template_string__,\n params: __sentry_template_values__,\n };\n return event;\n }\n\n event.message = message;\n return event;\n}\n\nfunction getNonErrorObjectExceptionValue(\n exception: Record<string, unknown>,\n { isUnhandledRejection }: { isUnhandledRejection?: boolean },\n): string {\n const keys = extractExceptionKeysForMessage(exception);\n const captureType = isUnhandledRejection ? 'promise rejection' : 'exception';\n\n // Some ErrorEvent instances do not have an `error` property, which is why they are not handled before\n // We still want to try to get a decent message for these cases\n if (isErrorEvent(exception)) {\n return `Event \\`ErrorEvent\\` captured as ${captureType} with message \\`${exception.message}\\``;\n }\n\n if (isEvent(exception)) {\n const className = getObjectClassName(exception);\n return `Event \\`${className}\\` (type=${exception.type}) captured as ${captureType}`;\n }\n\n return `Object captured as ${captureType} with keys: ${keys}`;\n}\n\nfunction getObjectClassName(obj: unknown): string | undefined | void {\n try {\n const prototype: Prototype | null = Object.getPrototypeOf(obj);\n return prototype ? prototype.constructor.name : undefined;\n } catch {\n // ignore errors here\n }\n}\n\n/** If a plain object has a property that is an `Error`, return this error. */\nfunction getErrorPropertyFromObject(obj: Record<string, unknown>): Error | undefined {\n return Object.values(obj).find((v): v is Error => v instanceof Error);\n}\n"],"names":["getClient","normalizeToSize","isEvent","_INTERNAL_enhanceErrorWithSentryInfo","addExceptionMechanism","resolvedSyncPromise","isErrorEvent","isDOMError","isDOMException","addExceptionTypeValue","isError","isPlainObject","isParameterizedString","extractExceptionKeysForMessage"],"mappings":";;;;AA4BA;AACA;AACA;AACO,SAAS,kBAAkB,CAAC,WAAW,EAAe,EAAE,EAAoB;AACnF;AACA,EAAE,MAAM,SAAS,gBAAgB,CAAC,WAAW,EAAE,EAAE,CAAC;;AAElD,EAAE,MAAM,SAAS,GAAc;AAC/B,IAAI,IAAI,EAAE,WAAW,CAAC,EAAE,CAAC;AACzB,IAAI,KAAK,EAAE,cAAc,CAAC,EAAE,CAAC;AAC7B,GAAG;;AAEH,EAAE,IAAI,MAAM,CAAC,MAAM,EAAE;AACrB,IAAI,SAAS,CAAC,UAAA,GAAa,EAAE,QAAQ;AACrC,EAAE;;AAEF,EAAE,IAAI,SAAS,CAAC,IAAA,KAAS,SAAA,IAAa,SAAS,CAAC,KAAA,KAAU,EAAE,EAAE;AAC9D,IAAI,SAAS,CAAC,KAAA,GAAQ,4BAA4B;AAClD,EAAE;;AAEF,EAAE,OAAO,SAAS;AAClB;;AAEA,SAAS,oBAAoB;AAC7B,EAAE,WAAW;AACb,EAAE,SAAS;AACX,EAAE,kBAAkB;AACpB,EAAE,oBAAoB;AACtB,EAAS;AACT,EAAE,MAAM,MAAA,GAASA,cAAS,EAAE;AAC5B,EAAE,MAAM,iBAAiB,MAAM,EAAE,UAAU,EAAE,CAAC,cAAc;;AAE5D;AACA,EAAE,MAAM,aAAA,GAAgB,0BAA0B,CAAC,SAAS,CAAC;;AAE7D,EAAE,MAAM,QAAQ;AAChB,IAAI,cAAc,EAAEC,oBAAe,CAAC,SAAS,EAAE,cAAc,CAAC;AAC9D,GAAG;;AAEH,EAAE,IAAI,aAAa,EAAE;AACrB,IAAI,OAAO;AACX,MAAM,SAAS,EAAE;AACjB,QAAQ,MAAM,EAAE,CAAC,kBAAkB,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;AAChE,OAAO;AACP,MAAM,KAAK;AACX,KAAK;AACL,EA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,OAAA,CAAA,iCAAA,EAAA,WAAA,CAAA,gBAAA,EAAA,SAAA,CAAA,OAAA,CAAA,EAAA,CAAA;AACA,EAAA;;AAEA,EAAA,IAAAJ,YAAA,CAAA,SAAA,CAAA,EAAA;AACA,IAAA,MAAA,SAAA,GAAA,kBAAA,CAAA,SAAA,CAAA;AACA,IAAA,OAAA,CAAA,QAAA,EAAA,SAAA,CAAA,SAAA,EAAA,SAAA,CAAA,IAAA,CAAA,cAAA,EAAA,WAAA,CAAA,CAAA;AACA,EAAA;;AAEA,EAAA,OAAA,CAAA,mBAAA,EAAA,WAAA,CAAA,YAAA,EAAA,IAAA,CAAA,CAAA;AACA;;AAEA,SAAA,kBAAA,CAAA,GAAA,EAAA;AACA,EAAA,IAAA;AACA,IAAA,MAAA,SAAA,GAAA,MAAA,CAAA,cAAA,CAAA,GAAA,CAAA;AACA,IAAA,OAAA,SAAA,GAAA,SAAA,CAAA,WAAA,CAAA,IAAA,GAAA,SAAA;AACA,EAAA,CAAA,CAAA,MAAA;AACA;AACA,EAAA;AACA;;AAEA;AACA,SAAA,0BAAA,CAAA,GAAA,EAAA;AACA,EAAA,OAAA,MAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,IAAA,CAAA,CAAA,CAAA,KAAA,CAAA,YAAA,KAAA,CAAA;AACA;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"eventbuilder.js","sources":["../../../../src/eventbuilder.ts"],"sourcesContent":["import type {\n Event,\n EventHint,\n Exception,\n ParameterizedString,\n SeverityLevel,\n StackFrame,\n StackParser,\n} from '@sentry/core/browser';\nimport {\n _INTERNAL_enhanceErrorWithSentryInfo,\n addExceptionMechanism,\n addExceptionTypeValue,\n extractExceptionKeysForMessage,\n getClient,\n isDOMError,\n isDOMException,\n isError,\n isErrorEvent,\n isEvent,\n isParameterizedString,\n isPlainObject,\n normalizeToSize,\n resolvedSyncPromise,\n} from '@sentry/core/browser';\n\ntype Prototype = { constructor: (...args: unknown[]) => unknown };\n\n/**\n * This function creates an exception from a JavaScript Error\n */\nexport function exceptionFromError(stackParser: StackParser, ex: Error): Exception {\n // Get the frames first since Opera can lose the stack if we touch anything else first\n const frames = parseStackFrames(stackParser, ex);\n\n const exception: Exception = {\n type: extractType(ex),\n value: extractMessage(ex),\n };\n\n if (frames.length) {\n exception.stacktrace = { frames };\n }\n\n if (exception.type === undefined && exception.value === '') {\n exception.value = 'Unrecoverable error caught';\n }\n\n return exception;\n}\n\nfunction eventFromPlainObject(\n stackParser: StackParser,\n exception: Record<string, unknown>,\n syntheticException?: Error,\n isUnhandledRejection?: boolean,\n): Event {\n const client = getClient();\n const normalizeDepth = client?.getOptions().normalizeDepth;\n\n // If we can, we extract an exception from the object properties\n const errorFromProp = getErrorPropertyFromObject(exception);\n\n const extra = {\n __serialized__: normalizeToSize(exception, normalizeDepth),\n };\n\n if (errorFromProp) {\n return {\n exception: {\n values: [exceptionFromError(stackParser, errorFromProp)],\n },\n extra,\n };\n }\n\n const event = {\n exception: {\n values: [\n {\n type: isEvent(exception) ? exception.constructor.name : isUnhandledRejection ? 'UnhandledRejection' : 'Error',\n value: getNonErrorObjectExceptionValue(exception, { isUnhandledRejection }),\n } as Exception,\n ],\n },\n extra,\n } satisfies Event;\n\n if (syntheticException) {\n const frames = parseStackFrames(stackParser, syntheticException);\n if (frames.length) {\n // event.exception.values[0] has been set above\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n event.exception.values[0]!.stacktrace = { frames };\n }\n }\n\n return event;\n}\n\nfunction eventFromError(stackParser: StackParser, ex: Error): Event {\n return {\n exception: {\n values: [exceptionFromError(stackParser, ex)],\n },\n };\n}\n\n/** Parses stack frames from an error */\nfunction parseStackFrames(\n stackParser: StackParser,\n ex: Error & { framesToPop?: number; stacktrace?: string },\n): StackFrame[] {\n // Access and store the stacktrace property before doing ANYTHING\n // else to it because Opera is not very good at providing it\n // reliably in other circumstances.\n const stacktrace = ex.stacktrace || ex.stack || '';\n\n const skipLines = getSkipFirstStackStringLines(ex);\n const framesToPop = getPopFirstTopFrames(ex);\n\n try {\n return stackParser(stacktrace, skipLines, framesToPop);\n } catch {\n // no-empty\n }\n\n return [];\n}\n\n// Based on our own mapping pattern - https://github.com/getsentry/sentry/blob/9f08305e09866c8bd6d0c24f5b0aabdd7dd6c59c/src/sentry/lang/javascript/errormapping.py#L83-L108\nconst reactMinifiedRegexp = /Minified React error #\\d+;/i;\n\n/**\n * Certain known React errors contain links that would be falsely\n * parsed as frames. This function check for these errors and\n * returns number of the stack string lines to skip.\n */\nfunction getSkipFirstStackStringLines(ex: Error): number {\n if (ex && reactMinifiedRegexp.test(ex.message)) {\n return 1;\n }\n\n return 0;\n}\n\n/**\n * If error has `framesToPop` property, it means that the\n * creator tells us the first x frames will be useless\n * and should be discarded. Typically error from wrapper function\n * which don't point to the actual location in the developer's code.\n *\n * Example: https://github.com/zertosh/invariant/blob/master/invariant.js#L46\n */\nfunction getPopFirstTopFrames(ex: Error & { framesToPop?: unknown }): number {\n if (typeof ex.framesToPop === 'number') {\n return ex.framesToPop;\n }\n\n return 0;\n}\n\n// https://developer.mozilla.org/en-US/docs/WebAssembly/JavaScript_interface/Exception\n// @ts-expect-error - WebAssembly.Exception is a valid class\nfunction isWebAssemblyException(exception: unknown): exception is WebAssembly.Exception {\n // Check for support\n // @ts-expect-error - WebAssembly.Exception is a valid class\n // oxlint-disable-next-line typescript/prefer-optional-chain\n if (typeof WebAssembly !== 'undefined' && typeof WebAssembly.Exception !== 'undefined') {\n // @ts-expect-error - WebAssembly.Exception is a valid class\n return exception instanceof WebAssembly.Exception;\n } else {\n return false;\n }\n}\n\n/**\n * Extracts from errors what we use as the exception `type` in error events.\n *\n * Usually, this is the `name` property on Error objects but WASM errors need to be treated differently.\n */\nexport function extractType(ex: Error & { message: { error?: Error } }): string | undefined {\n const name = ex?.name;\n\n // The name for WebAssembly.Exception Errors needs to be extracted differently.\n // Context: https://github.com/getsentry/sentry-javascript/issues/13787\n if (!name && isWebAssemblyException(ex)) {\n // Emscripten sets array[type, message] to the \"message\" property on the WebAssembly.Exception object\n const hasTypeInMessage = ex.message && Array.isArray(ex.message) && ex.message.length == 2;\n return hasTypeInMessage ? ex.message[0] : 'WebAssembly.Exception';\n }\n\n return name;\n}\n\n/**\n * There are cases where stacktrace.message is an Event object\n * https://github.com/getsentry/sentry-javascript/issues/1949\n * In this specific case we try to extract stacktrace.message.error.message\n */\nexport function extractMessage(ex: Error & { message: { error?: Error } }): string {\n const message = ex?.message;\n\n if (isWebAssemblyException(ex)) {\n // For Node 18, Emscripten sets array[type, message] to the \"message\" property on the WebAssembly.Exception object\n if (Array.isArray(ex.message) && ex.message.length == 2) {\n return ex.message[1];\n }\n return 'wasm exception';\n }\n\n if (!message) {\n return 'No error message';\n }\n\n if (message.error && typeof message.error.message === 'string') {\n return _INTERNAL_enhanceErrorWithSentryInfo(message.error);\n }\n\n return _INTERNAL_enhanceErrorWithSentryInfo(ex);\n}\n\n/**\n * Creates an {@link Event} from all inputs to `captureException` and non-primitive inputs to `captureMessage`.\n * @hidden\n */\nexport function eventFromException(\n stackParser: StackParser,\n exception: unknown,\n hint?: EventHint,\n attachStacktrace?: boolean,\n): PromiseLike<Event> {\n const syntheticException = hint?.syntheticException || undefined;\n const event = eventFromUnknownInput(stackParser, exception, syntheticException, attachStacktrace);\n addExceptionMechanism(event); // defaults to { type: 'generic', handled: true }\n event.level = 'error';\n if (hint?.event_id) {\n event.event_id = hint.event_id;\n }\n return resolvedSyncPromise(event);\n}\n\n/**\n * Builds and Event from a Message\n * @hidden\n */\nexport function eventFromMessage(\n stackParser: StackParser,\n message: ParameterizedString,\n level: SeverityLevel = 'info',\n hint?: EventHint,\n attachStacktrace?: boolean,\n): PromiseLike<Event> {\n const syntheticException = hint?.syntheticException || undefined;\n const event = eventFromString(stackParser, message, syntheticException, attachStacktrace);\n event.level = level;\n if (hint?.event_id) {\n event.event_id = hint.event_id;\n }\n return resolvedSyncPromise(event);\n}\n\n/**\n * @hidden\n */\nexport function eventFromUnknownInput(\n stackParser: StackParser,\n exception: unknown,\n syntheticException?: Error,\n attachStacktrace?: boolean,\n isUnhandledRejection?: boolean,\n): Event {\n let event: Event;\n\n if (isErrorEvent(exception as ErrorEvent) && (exception as ErrorEvent).error) {\n // If it is an ErrorEvent with `error` property, extract it to get actual Error\n const errorEvent = exception as ErrorEvent;\n return eventFromError(stackParser, errorEvent.error as Error);\n }\n\n // If it is a `DOMError` (which is a legacy API, but still supported in some browsers) then we just extract the name\n // and message, as it doesn't provide anything else. According to the spec, all `DOMExceptions` should also be\n // `Error`s, but that's not the case in IE11, so in that case we treat it the same as we do a `DOMError`.\n //\n // https://developer.mozilla.org/en-US/docs/Web/API/DOMError\n // https://developer.mozilla.org/en-US/docs/Web/API/DOMException\n // https://webidl.spec.whatwg.org/#es-DOMException-specialness\n if (isDOMError(exception) || isDOMException(exception as DOMException)) {\n const domException = exception as DOMException;\n\n if ('stack' in (exception as Error)) {\n event = eventFromError(stackParser, exception as Error);\n } else {\n const name = domException.name || (isDOMError(domException) ? 'DOMError' : 'DOMException');\n const message = domException.message ? `${name}: ${domException.message}` : name;\n event = eventFromString(stackParser, message, syntheticException, attachStacktrace);\n addExceptionTypeValue(event, message);\n }\n if ('code' in domException) {\n // eslint-disable-next-line deprecation/deprecation\n event.tags = { ...event.tags, 'DOMException.code': `${domException.code}` };\n }\n\n return event;\n }\n if (isError(exception)) {\n // we have a real Error object, do nothing\n return eventFromError(stackParser, exception);\n }\n if (isPlainObject(exception) || isEvent(exception)) {\n // If it's a plain object or an instance of `Event` (the built-in JS kind, not this SDK's `Event` type), serialize\n // it manually. This will allow us to group events based on top-level keys which is much better than creating a new\n // group on any key/value change.\n const objectException = exception;\n event = eventFromPlainObject(stackParser, objectException, syntheticException, isUnhandledRejection);\n addExceptionMechanism(event, {\n synthetic: true,\n });\n return event;\n }\n\n // If none of previous checks were valid, then it means that it's not:\n // - an instance of DOMError\n // - an instance of DOMException\n // - an instance of Event\n // - an instance of Error\n // - a valid ErrorEvent (one with an error property)\n // - a plain Object\n //\n // So bail out and capture it as a simple message:\n event = eventFromString(stackParser, exception as string, syntheticException, attachStacktrace);\n addExceptionTypeValue(event, `${exception}`, undefined);\n addExceptionMechanism(event, {\n synthetic: true,\n });\n\n return event;\n}\n\nfunction eventFromString(\n stackParser: StackParser,\n message: ParameterizedString,\n syntheticException?: Error,\n attachStacktrace?: boolean,\n): Event {\n const event: Event = {};\n\n if (attachStacktrace && syntheticException) {\n const frames = parseStackFrames(stackParser, syntheticException);\n if (frames.length) {\n event.exception = {\n values: [{ value: message, stacktrace: { frames } }],\n };\n }\n addExceptionMechanism(event, { synthetic: true });\n }\n\n if (isParameterizedString(message)) {\n const { __sentry_template_string__, __sentry_template_values__ } = message;\n\n event.logentry = {\n message: __sentry_template_string__,\n params: __sentry_template_values__,\n };\n return event;\n }\n\n event.message = message;\n return event;\n}\n\nfunction getNonErrorObjectExceptionValue(\n exception: Record<string, unknown>,\n { isUnhandledRejection }: { isUnhandledRejection?: boolean },\n): string {\n const keys = extractExceptionKeysForMessage(exception);\n const captureType = isUnhandledRejection ? 'promise rejection' : 'exception';\n\n // Some ErrorEvent instances do not have an `error` property, which is why they are not handled before\n // We still want to try to get a decent message for these cases\n if (isErrorEvent(exception)) {\n return `Event \\`ErrorEvent\\` captured as ${captureType} with message \\`${exception.message}\\``;\n }\n\n if (isEvent(exception)) {\n const className = getObjectClassName(exception);\n return `Event \\`${className}\\` (type=${exception.type}) captured as ${captureType}`;\n }\n\n return `Object captured as ${captureType} with keys: ${keys}`;\n}\n\nfunction getObjectClassName(obj: unknown): string | undefined | void {\n try {\n const prototype: Prototype | null = Object.getPrototypeOf(obj);\n return prototype ? prototype.constructor.name : undefined;\n } catch {\n // ignore errors here\n }\n}\n\n/** If a plain object has a property that is an `Error`, return this error. */\nfunction getErrorPropertyFromObject(obj: Record<string, unknown>): Error | undefined {\n return Object.values(obj).find((v): v is Error => v instanceof Error);\n}\n"],"names":["getClient","normalizeToSize","isEvent","_INTERNAL_enhanceErrorWithSentryInfo","addExceptionMechanism","resolvedSyncPromise","isErrorEvent","isDOMError","isDOMException","addExceptionTypeValue","isError","isPlainObject","isParameterizedString","extractExceptionKeysForMessage"],"mappings":";;;;AA4BA;AACA;AACA;AACO,SAAS,kBAAkB,CAAC,WAAW,EAAe,EAAE,EAAoB;AACnF;AACA,EAAE,MAAM,SAAS,gBAAgB,CAAC,WAAW,EAAE,EAAE,CAAC;;AAElD,EAAE,MAAM,SAAS,GAAc;AAC/B,IAAI,IAAI,EAAE,WAAW,CAAC,EAAE,CAAC;AACzB,IAAI,KAAK,EAAE,cAAc,CAAC,EAAE,CAAC;AAC7B,GAAG;;AAEH,EAAE,IAAI,MAAM,CAAC,MAAM,EAAE;AACrB,IAAI,SAAS,CAAC,UAAA,GAAa,EAAE,QAAQ;AACrC,EAAE;;AAEF,EAAE,IAAI,SAAS,CAAC,IAAA,KAAS,SAAA,IAAa,SAAS,CAAC,KAAA,KAAU,EAAE,EAAE;AAC9D,IAAI,SAAS,CAAC,KAAA,GAAQ,4BAA4B;AAClD,EAAE;;AAEF,EAAE,OAAO,SAAS;AAClB;;AAEA,SAAS,oBAAoB;AAC7B,EAAE,WAAW;AACb,EAAE,SAAS;AACX,EAAE,kBAAkB;AACpB,EAAE,oBAAoB;AACtB,EAAS;AACT,EAAE,MAAM,MAAA,GAASA,iBAAS,EAAE;AAC5B,EAAE,MAAM,iBAAiB,MAAM,EAAE,UAAU,EAAE,CAAC,cAAc;;AAE5D;AACA,EAAE,MAAM,aAAA,GAAgB,0BAA0B,CAAC,SAAS,CAAC;;AAE7D,EAAE,MAAM,QAAQ;AAChB,IAAI,cAAc,EAAEC,uBAAe,CAAC,SAAS,EAAE,cAAc,CAAC;AAC9D,GAAG;;AAEH,EAAE,IAAI,aAAa,EAAE;AACrB,IAAI,OAAO;AACX,MAAM,SAAS,EAAE;AACjB,QAAQ,MAAM,EAAE,CAAC,kBAAkB,CAAC,WAAW,EAAE,aAAa,CAAC,CA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AAA,IAAAP,oBAAA,CAAA,SAAA,CAAA,EAAA;AACA,IAAA,OAAA,CAAA,iCAAA,EAAA,WAAA,CAAA,gBAAA,EAAA,SAAA,CAAA,OAAA,CAAA,EAAA,CAAA;AACA,EAAA;;AAEA,EAAA,IAAAJ,eAAA,CAAA,SAAA,CAAA,EAAA;AACA,IAAA,MAAA,SAAA,GAAA,kBAAA,CAAA,SAAA,CAAA;AACA,IAAA,OAAA,CAAA,QAAA,EAAA,SAAA,CAAA,SAAA,EAAA,SAAA,CAAA,IAAA,CAAA,cAAA,EAAA,WAAA,CAAA,CAAA;AACA,EAAA;;AAEA,EAAA,OAAA,CAAA,mBAAA,EAAA,WAAA,CAAA,YAAA,EAAA,IAAA,CAAA,CAAA;AACA;;AAEA,SAAA,kBAAA,CAAA,GAAA,EAAA;AACA,EAAA,IAAA;AACA,IAAA,MAAA,SAAA,GAAA,MAAA,CAAA,cAAA,CAAA,GAAA,CAAA;AACA,IAAA,OAAA,SAAA,GAAA,SAAA,CAAA,WAAA,CAAA,IAAA,GAAA,SAAA;AACA,EAAA,CAAA,CAAA,MAAA;AACA;AACA,EAAA;AACA;;AAEA;AACA,SAAA,0BAAA,CAAA,GAAA,EAAA;AACA,EAAA,OAAA,MAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,IAAA,CAAA,CAAA,CAAA,KAAA,CAAA,YAAA,KAAA,CAAA;AACA;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feedbackAsync.js","sources":["../../../../src/feedbackAsync.ts"],"sourcesContent":["import { buildFeedbackIntegration } from '@sentry-internal/feedback';\nimport { lazyLoadIntegration } from './utils/lazyLoadIntegration';\n\n/**\n * An integration to add user feedback to your application,\n * while loading most of the code lazily only when it's needed.\n */\nexport const feedbackAsyncIntegration = buildFeedbackIntegration({\n lazyLoadIntegration,\n});\n"],"names":["buildFeedbackIntegration","lazyLoadIntegration"],"mappings":";;;;;AAGA;AACA;AACA;AACA;AACO,MAAM,
|
|
1
|
+
{"version":3,"file":"feedbackAsync.js","sources":["../../../../src/feedbackAsync.ts"],"sourcesContent":["import { buildFeedbackIntegration } from '@sentry-internal/feedback';\nimport { lazyLoadIntegration } from './utils/lazyLoadIntegration';\n\n/**\n * An integration to add user feedback to your application,\n * while loading most of the code lazily only when it's needed.\n */\nexport const feedbackAsyncIntegration: ReturnType<typeof buildFeedbackIntegration> = buildFeedbackIntegration({\n lazyLoadIntegration,\n});\n"],"names":["buildFeedbackIntegration","lazyLoadIntegration"],"mappings":";;;;;AAGA;AACA;AACA;AACA;AACO,MAAM,wBAAwB,GAAgDA,iCAAwB,CAAC;AAC9G,uBAAEC,uCAAmB;AACrB,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feedbackSync.js","sources":["../../../../src/feedbackSync.ts"],"sourcesContent":["import {\n buildFeedbackIntegration,\n feedbackModalIntegration,\n feedbackScreenshotIntegration,\n} from '@sentry-internal/feedback';\n\n/** Add a widget to capture user feedback to your application. */\nexport const feedbackSyncIntegration = buildFeedbackIntegration({\n getModalIntegration: () => feedbackModalIntegration,\n getScreenshotIntegration: () => feedbackScreenshotIntegration,\n});\n"],"names":["buildFeedbackIntegration","feedbackModalIntegration","feedbackScreenshotIntegration"],"mappings":";;;;AAMA;AACO,MAAM,
|
|
1
|
+
{"version":3,"file":"feedbackSync.js","sources":["../../../../src/feedbackSync.ts"],"sourcesContent":["import {\n buildFeedbackIntegration,\n feedbackModalIntegration,\n feedbackScreenshotIntegration,\n} from '@sentry-internal/feedback';\n\n/** Add a widget to capture user feedback to your application. */\nexport const feedbackSyncIntegration: ReturnType<typeof buildFeedbackIntegration> = buildFeedbackIntegration({\n getModalIntegration: () => feedbackModalIntegration,\n getScreenshotIntegration: () => feedbackScreenshotIntegration,\n});\n"],"names":["buildFeedbackIntegration","feedbackModalIntegration","feedbackScreenshotIntegration"],"mappings":";;;;AAMA;AACO,MAAM,uBAAuB,GAAgDA,iCAAwB,CAAC;AAC7G,EAAE,mBAAmB,EAAE,MAAMC,iCAAwB;AACrD,EAAE,wBAAwB,EAAE,MAAMC,sCAA6B;AAC/D,CAAC;;;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const browser = require('@sentry/core/browser');
|
|
4
4
|
|
|
5
|
-
const WINDOW =
|
|
5
|
+
const WINDOW = browser.GLOBAL_OBJ ;
|
|
6
6
|
|
|
7
7
|
let ignoreOnError = 0;
|
|
8
8
|
|
|
@@ -71,7 +71,7 @@ function wrap(
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
// We don't wanna wrap it twice
|
|
74
|
-
if (
|
|
74
|
+
if (browser.getOriginalFunction(fn)) {
|
|
75
75
|
return fn;
|
|
76
76
|
}
|
|
77
77
|
} catch {
|
|
@@ -96,11 +96,11 @@ function wrap(
|
|
|
96
96
|
} catch (ex) {
|
|
97
97
|
ignoreNextOnError();
|
|
98
98
|
|
|
99
|
-
|
|
99
|
+
browser.withScope(scope => {
|
|
100
100
|
scope.addEventProcessor(event => {
|
|
101
101
|
if (options.mechanism) {
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
browser.addExceptionTypeValue(event, undefined, undefined);
|
|
103
|
+
browser.addExceptionMechanism(event, options.mechanism);
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
event.extra = {
|
|
@@ -112,7 +112,7 @@ function wrap(
|
|
|
112
112
|
});
|
|
113
113
|
|
|
114
114
|
// no need to add a mechanism here, we already add it via an event processor above
|
|
115
|
-
|
|
115
|
+
browser.captureException(ex);
|
|
116
116
|
});
|
|
117
117
|
|
|
118
118
|
throw ex;
|
|
@@ -133,9 +133,9 @@ function wrap(
|
|
|
133
133
|
|
|
134
134
|
// Signal that this function has been wrapped/filled already
|
|
135
135
|
// for both debugging and to prevent it to being wrapped/filled twice
|
|
136
|
-
|
|
136
|
+
browser.markFunctionWrapped(sentryWrapped, fn);
|
|
137
137
|
|
|
138
|
-
|
|
138
|
+
browser.addNonEnumerableProperty(fn, '__sentry_wrapped__', sentryWrapped);
|
|
139
139
|
|
|
140
140
|
// Restore original function name (not all browsers allow that)
|
|
141
141
|
try {
|
|
@@ -161,7 +161,7 @@ function wrap(
|
|
|
161
161
|
*/
|
|
162
162
|
function getHttpRequestData() {
|
|
163
163
|
// grab as much info as exists and add it to the event
|
|
164
|
-
const url =
|
|
164
|
+
const url = browser.getLocationHref();
|
|
165
165
|
const { referrer } = WINDOW.document || {};
|
|
166
166
|
const { userAgent } = WINDOW.navigator || {};
|
|
167
167
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sources":["../../../../src/helpers.ts"],"sourcesContent":["import type { Mechanism, WrappedFunction } from '@sentry/core';\nimport {\n addExceptionMechanism,\n addExceptionTypeValue,\n addNonEnumerableProperty,\n captureException,\n getLocationHref,\n getOriginalFunction,\n GLOBAL_OBJ,\n markFunctionWrapped,\n withScope,\n} from '@sentry/core';\n\nexport const WINDOW = GLOBAL_OBJ as typeof GLOBAL_OBJ & Window;\n\nlet ignoreOnError: number = 0;\n\n/**\n * @hidden\n */\nexport function shouldIgnoreOnError(): boolean {\n return ignoreOnError > 0;\n}\n\n/**\n * @hidden\n */\nexport function ignoreNextOnError(): void {\n // onerror should trigger before setTimeout\n ignoreOnError++;\n setTimeout(() => {\n ignoreOnError--;\n });\n}\n\n// eslint-disable-next-line @typescript-eslint/ban-types\ntype WrappableFunction = Function;\n\nexport function wrap<T extends WrappableFunction>(\n fn: T,\n options?: {\n mechanism?: Mechanism;\n },\n): WrappedFunction<T>;\nexport function wrap<NonFunction>(\n fn: NonFunction,\n options?: {\n mechanism?: Mechanism;\n },\n): NonFunction;\n/**\n * Instruments the given function and sends an event to Sentry every time the\n * function throws an exception.\n *\n * @param fn A function to wrap. It is generally safe to pass an unbound function, because the returned wrapper always\n * has a correct `this` context.\n * @returns The wrapped function.\n * @hidden\n */\nexport function wrap<T extends WrappableFunction, NonFunction>(\n fn: T | NonFunction,\n options: {\n mechanism?: Mechanism;\n } = {},\n): NonFunction | WrappedFunction<T> {\n // for future readers what this does is wrap a function and then create\n // a bi-directional wrapping between them.\n //\n // example: wrapped = wrap(original);\n // original.__sentry_wrapped__ -> wrapped\n // wrapped.__sentry_original__ -> original\n\n function isFunction(fn: T | NonFunction): fn is T {\n return typeof fn === 'function';\n }\n\n if (!isFunction(fn)) {\n return fn;\n }\n\n try {\n // if we're dealing with a function that was previously wrapped, return\n // the original wrapper.\n const wrapper = (fn as WrappedFunction<T>).__sentry_wrapped__;\n if (wrapper) {\n if (typeof wrapper === 'function') {\n return wrapper;\n } else {\n // If we find that the `__sentry_wrapped__` function is not a function at the time of accessing it, it means\n // that something messed with it. In that case we want to return the originally passed function.\n return fn;\n }\n }\n\n // We don't wanna wrap it twice\n if (getOriginalFunction(fn)) {\n return fn;\n }\n } catch {\n // Just accessing custom props in some Selenium environments\n // can cause a \"Permission denied\" exception (see raven-js#495).\n // Bail on wrapping and return the function as-is (defers to window.onerror).\n return fn;\n }\n\n // Wrap the function itself\n // It is important that `sentryWrapped` is not an arrow function to preserve the context of `this`\n const sentryWrapped = function (this: unknown, ...args: unknown[]): unknown {\n try {\n // Also wrap arguments that are themselves functions\n const wrappedArguments = args.map(arg => wrap(arg, options));\n\n // Attempt to invoke user-land function\n // NOTE: If you are a Sentry user, and you are seeing this stack frame, it\n // means the sentry.javascript SDK caught an error invoking your application code. This\n // is expected behavior and NOT indicative of a bug with sentry.javascript.\n return fn.apply(this, wrappedArguments);\n } catch (ex) {\n ignoreNextOnError();\n\n withScope(scope => {\n scope.addEventProcessor(event => {\n if (options.mechanism) {\n addExceptionTypeValue(event, undefined, undefined);\n addExceptionMechanism(event, options.mechanism);\n }\n\n event.extra = {\n ...event.extra,\n arguments: args,\n };\n\n return event;\n });\n\n // no need to add a mechanism here, we already add it via an event processor above\n captureException(ex);\n });\n\n throw ex;\n }\n } as unknown as WrappedFunction<T>;\n\n // Wrap the wrapped function in a proxy, to ensure any other properties of the original function remain available\n try {\n for (const property in fn) {\n if (Object.prototype.hasOwnProperty.call(fn, property)) {\n sentryWrapped[property as keyof T] = fn[property as keyof T];\n }\n }\n } catch {\n // Accessing some objects may throw\n // ref: https://github.com/getsentry/sentry-javascript/issues/1168\n }\n\n // Signal that this function has been wrapped/filled already\n // for both debugging and to prevent it to being wrapped/filled twice\n markFunctionWrapped(sentryWrapped, fn);\n\n addNonEnumerableProperty(fn, '__sentry_wrapped__', sentryWrapped);\n\n // Restore original function name (not all browsers allow that)\n try {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, 'name')!;\n if (descriptor.configurable) {\n Object.defineProperty(sentryWrapped, 'name', {\n get(): string {\n return fn.name;\n },\n });\n }\n } catch {\n // This may throw if e.g. the descriptor does not exist, or a browser does not allow redefining `name`.\n // to save some bytes we simply try-catch this\n }\n\n return sentryWrapped;\n}\n\n/**\n * Get HTTP request data from the current page.\n */\nexport function getHttpRequestData(): { url: string; headers: Record<string, string> } {\n // grab as much info as exists and add it to the event\n const url = getLocationHref();\n const { referrer } = WINDOW.document || {};\n const { userAgent } = WINDOW.navigator || {};\n\n const headers = {\n ...(referrer && { Referer: referrer }),\n ...(userAgent && { 'User-Agent': userAgent }),\n };\n const request = {\n url,\n headers,\n };\n\n return request;\n}\n"],"names":["GLOBAL_OBJ","getOriginalFunction","withScope","addExceptionTypeValue","addExceptionMechanism","captureException","markFunctionWrapped","addNonEnumerableProperty","getLocationHref"],"mappings":";;;;AAaO,MAAM,MAAA,GAASA,
|
|
1
|
+
{"version":3,"file":"helpers.js","sources":["../../../../src/helpers.ts"],"sourcesContent":["import type { Mechanism, WrappedFunction } from '@sentry/core/browser';\nimport {\n addExceptionMechanism,\n addExceptionTypeValue,\n addNonEnumerableProperty,\n captureException,\n getLocationHref,\n getOriginalFunction,\n GLOBAL_OBJ,\n markFunctionWrapped,\n withScope,\n} from '@sentry/core/browser';\n\nexport const WINDOW = GLOBAL_OBJ as typeof GLOBAL_OBJ & Window;\n\nlet ignoreOnError: number = 0;\n\n/**\n * @hidden\n */\nexport function shouldIgnoreOnError(): boolean {\n return ignoreOnError > 0;\n}\n\n/**\n * @hidden\n */\nexport function ignoreNextOnError(): void {\n // onerror should trigger before setTimeout\n ignoreOnError++;\n setTimeout(() => {\n ignoreOnError--;\n });\n}\n\n// eslint-disable-next-line @typescript-eslint/ban-types\ntype WrappableFunction = Function;\n\nexport function wrap<T extends WrappableFunction>(\n fn: T,\n options?: {\n mechanism?: Mechanism;\n },\n): WrappedFunction<T>;\nexport function wrap<NonFunction>(\n fn: NonFunction,\n options?: {\n mechanism?: Mechanism;\n },\n): NonFunction;\n/**\n * Instruments the given function and sends an event to Sentry every time the\n * function throws an exception.\n *\n * @param fn A function to wrap. It is generally safe to pass an unbound function, because the returned wrapper always\n * has a correct `this` context.\n * @returns The wrapped function.\n * @hidden\n */\nexport function wrap<T extends WrappableFunction, NonFunction>(\n fn: T | NonFunction,\n options: {\n mechanism?: Mechanism;\n } = {},\n): NonFunction | WrappedFunction<T> {\n // for future readers what this does is wrap a function and then create\n // a bi-directional wrapping between them.\n //\n // example: wrapped = wrap(original);\n // original.__sentry_wrapped__ -> wrapped\n // wrapped.__sentry_original__ -> original\n\n function isFunction(fn: T | NonFunction): fn is T {\n return typeof fn === 'function';\n }\n\n if (!isFunction(fn)) {\n return fn;\n }\n\n try {\n // if we're dealing with a function that was previously wrapped, return\n // the original wrapper.\n const wrapper = (fn as WrappedFunction<T>).__sentry_wrapped__;\n if (wrapper) {\n if (typeof wrapper === 'function') {\n return wrapper;\n } else {\n // If we find that the `__sentry_wrapped__` function is not a function at the time of accessing it, it means\n // that something messed with it. In that case we want to return the originally passed function.\n return fn;\n }\n }\n\n // We don't wanna wrap it twice\n if (getOriginalFunction(fn)) {\n return fn;\n }\n } catch {\n // Just accessing custom props in some Selenium environments\n // can cause a \"Permission denied\" exception (see raven-js#495).\n // Bail on wrapping and return the function as-is (defers to window.onerror).\n return fn;\n }\n\n // Wrap the function itself\n // It is important that `sentryWrapped` is not an arrow function to preserve the context of `this`\n const sentryWrapped = function (this: unknown, ...args: unknown[]): unknown {\n try {\n // Also wrap arguments that are themselves functions\n const wrappedArguments = args.map(arg => wrap(arg, options));\n\n // Attempt to invoke user-land function\n // NOTE: If you are a Sentry user, and you are seeing this stack frame, it\n // means the sentry.javascript SDK caught an error invoking your application code. This\n // is expected behavior and NOT indicative of a bug with sentry.javascript.\n return fn.apply(this, wrappedArguments);\n } catch (ex) {\n ignoreNextOnError();\n\n withScope(scope => {\n scope.addEventProcessor(event => {\n if (options.mechanism) {\n addExceptionTypeValue(event, undefined, undefined);\n addExceptionMechanism(event, options.mechanism);\n }\n\n event.extra = {\n ...event.extra,\n arguments: args,\n };\n\n return event;\n });\n\n // no need to add a mechanism here, we already add it via an event processor above\n captureException(ex);\n });\n\n throw ex;\n }\n } as unknown as WrappedFunction<T>;\n\n // Wrap the wrapped function in a proxy, to ensure any other properties of the original function remain available\n try {\n for (const property in fn) {\n if (Object.prototype.hasOwnProperty.call(fn, property)) {\n sentryWrapped[property as keyof T] = fn[property as keyof T];\n }\n }\n } catch {\n // Accessing some objects may throw\n // ref: https://github.com/getsentry/sentry-javascript/issues/1168\n }\n\n // Signal that this function has been wrapped/filled already\n // for both debugging and to prevent it to being wrapped/filled twice\n markFunctionWrapped(sentryWrapped, fn);\n\n addNonEnumerableProperty(fn, '__sentry_wrapped__', sentryWrapped);\n\n // Restore original function name (not all browsers allow that)\n try {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, 'name')!;\n if (descriptor.configurable) {\n Object.defineProperty(sentryWrapped, 'name', {\n get(): string {\n return fn.name;\n },\n });\n }\n } catch {\n // This may throw if e.g. the descriptor does not exist, or a browser does not allow redefining `name`.\n // to save some bytes we simply try-catch this\n }\n\n return sentryWrapped;\n}\n\n/**\n * Get HTTP request data from the current page.\n */\nexport function getHttpRequestData(): { url: string; headers: Record<string, string> } {\n // grab as much info as exists and add it to the event\n const url = getLocationHref();\n const { referrer } = WINDOW.document || {};\n const { userAgent } = WINDOW.navigator || {};\n\n const headers = {\n ...(referrer && { Referer: referrer }),\n ...(userAgent && { 'User-Agent': userAgent }),\n };\n const request = {\n url,\n headers,\n };\n\n return request;\n}\n"],"names":["GLOBAL_OBJ","getOriginalFunction","withScope","addExceptionTypeValue","addExceptionMechanism","captureException","markFunctionWrapped","addNonEnumerableProperty","getLocationHref"],"mappings":";;;;AAaO,MAAM,MAAA,GAASA,kBAAA;;AAEtB,IAAI,aAAa,GAAW,CAAC;;AAE7B;AACA;AACA;AACO,SAAS,mBAAmB,GAAY;AAC/C,EAAE,OAAO,aAAA,GAAgB,CAAC;AAC1B;;AAEA;AACA;AACA;AACO,SAAS,iBAAiB,GAAS;AAC1C;AACA,EAAE,aAAa,EAAE;AACjB,EAAE,UAAU,CAAC,MAAM;AACnB,IAAI,aAAa,EAAE;AACnB,EAAE,CAAC,CAAC;AACJ;;AAEA;;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,IAAI;AACpB,EAAE,EAAE;AACJ,EAAE;;AAEA,GAAI,EAAE;AACR,EAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA,EAAE,SAAS,UAAU,CAAC,EAAE,EAA4B;AACpD,IAAI,OAAO,OAAO,EAAA,KAAO,UAAU;AACnC,EAAE;;AAEF,EAAE,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,EAAE;AACvB,IAAI,OAAO,EAAE;AACb,EAAE;;AAEF,EAAE,IAAI;AACN;AACA;AACA,IAAI,MAAM,OAAA,GAAU,CAAC,EAAA,GAA0B,kBAAkB;AACjE,IAAI,IAAI,OAAO,EAAE;AACjB,MAAM,IAAI,OAAO,OAAA,KAAY,UAAU,EAAE;AAC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AACP,IAAI,OAAO;AACX,GAAG;;AAEH,EAAE,OAAO,OAAO;AAChB;;;;;;;;"}
|
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
2
2
|
|
|
3
3
|
const feedbackAsync = require('./feedbackAsync.js');
|
|
4
4
|
const feedbackSync = require('./feedbackSync.js');
|
|
5
|
-
const
|
|
5
|
+
const browser = require('@sentry/core/browser');
|
|
6
6
|
const helpers = require('./helpers.js');
|
|
7
7
|
const client = require('./client.js');
|
|
8
8
|
const fetch = require('./transports/fetch.js');
|
|
@@ -50,89 +50,89 @@ const webWorker = require('./integrations/webWorker.js');
|
|
|
50
50
|
exports.feedbackAsyncIntegration = feedbackAsync.feedbackAsyncIntegration;
|
|
51
51
|
exports.feedbackIntegration = feedbackSync.feedbackSyncIntegration;
|
|
52
52
|
exports.feedbackSyncIntegration = feedbackSync.feedbackSyncIntegration;
|
|
53
|
-
exports.MULTIPLEXED_TRANSPORT_EXTRA_KEY =
|
|
54
|
-
exports.SDK_VERSION =
|
|
55
|
-
exports.SEMANTIC_ATTRIBUTE_SENTRY_OP =
|
|
56
|
-
exports.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN =
|
|
57
|
-
exports.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE =
|
|
58
|
-
exports.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE =
|
|
59
|
-
exports.Scope =
|
|
60
|
-
exports.addBreadcrumb =
|
|
61
|
-
exports.addEventProcessor =
|
|
62
|
-
exports.addIntegration =
|
|
63
|
-
exports.captureConsoleIntegration =
|
|
64
|
-
exports.captureEvent =
|
|
65
|
-
exports.captureException =
|
|
66
|
-
exports.captureFeedback =
|
|
67
|
-
exports.captureMessage =
|
|
68
|
-
exports.captureSession =
|
|
69
|
-
exports.close =
|
|
70
|
-
exports.consoleLoggingIntegration =
|
|
71
|
-
exports.continueTrace =
|
|
72
|
-
exports.createConsolaReporter =
|
|
73
|
-
exports.createLangChainCallbackHandler =
|
|
74
|
-
exports.createTransport =
|
|
75
|
-
exports.dedupeIntegration =
|
|
76
|
-
exports.endSession =
|
|
77
|
-
exports.eventFiltersIntegration =
|
|
78
|
-
exports.extraErrorDataIntegration =
|
|
79
|
-
exports.featureFlagsIntegration =
|
|
80
|
-
exports.flush =
|
|
81
|
-
exports.functionToStringIntegration =
|
|
82
|
-
exports.getActiveSpan =
|
|
83
|
-
exports.getClient =
|
|
84
|
-
exports.getCurrentScope =
|
|
85
|
-
exports.getGlobalScope =
|
|
86
|
-
exports.getIsolationScope =
|
|
87
|
-
exports.getRootSpan =
|
|
88
|
-
exports.getSpanDescendants =
|
|
89
|
-
exports.getSpanStatusFromHttpCode =
|
|
90
|
-
exports.getTraceData =
|
|
91
|
-
exports.inboundFiltersIntegration =
|
|
92
|
-
exports.instrumentAnthropicAiClient =
|
|
93
|
-
exports.instrumentCreateReactAgent =
|
|
94
|
-
exports.instrumentGoogleGenAIClient =
|
|
95
|
-
exports.instrumentLangChainEmbeddings =
|
|
96
|
-
exports.instrumentLangGraph =
|
|
97
|
-
exports.instrumentOpenAiClient =
|
|
98
|
-
exports.instrumentSupabaseClient =
|
|
99
|
-
exports.isEnabled =
|
|
100
|
-
exports.isInitialized =
|
|
101
|
-
exports.lastEventId =
|
|
102
|
-
exports.logger =
|
|
103
|
-
exports.makeMultiplexedTransport =
|
|
104
|
-
exports.metrics =
|
|
105
|
-
exports.moduleMetadataIntegration =
|
|
106
|
-
exports.parameterize =
|
|
107
|
-
exports.registerSpanErrorInstrumentation =
|
|
108
|
-
exports.rewriteFramesIntegration =
|
|
109
|
-
exports.setContext =
|
|
110
|
-
exports.setConversationId =
|
|
111
|
-
exports.setCurrentClient =
|
|
112
|
-
exports.setExtra =
|
|
113
|
-
exports.setExtras =
|
|
114
|
-
exports.setHttpStatus =
|
|
115
|
-
exports.setMeasurement =
|
|
116
|
-
exports.setTag =
|
|
117
|
-
exports.setTags =
|
|
118
|
-
exports.setUser =
|
|
119
|
-
exports.spanToBaggageHeader =
|
|
120
|
-
exports.spanToJSON =
|
|
121
|
-
exports.spanToTraceHeader =
|
|
122
|
-
exports.startInactiveSpan =
|
|
123
|
-
exports.startNewTrace =
|
|
124
|
-
exports.startSession =
|
|
125
|
-
exports.startSpan =
|
|
126
|
-
exports.startSpanManual =
|
|
127
|
-
exports.supabaseIntegration =
|
|
128
|
-
exports.suppressTracing =
|
|
129
|
-
exports.thirdPartyErrorFilterIntegration =
|
|
130
|
-
exports.updateSpanName =
|
|
131
|
-
exports.withActiveSpan =
|
|
132
|
-
exports.withIsolationScope =
|
|
133
|
-
exports.withScope =
|
|
134
|
-
exports.withStreamedSpan =
|
|
135
|
-
exports.zodErrorsIntegration =
|
|
53
|
+
exports.MULTIPLEXED_TRANSPORT_EXTRA_KEY = browser.MULTIPLEXED_TRANSPORT_EXTRA_KEY;
|
|
54
|
+
exports.SDK_VERSION = browser.SDK_VERSION;
|
|
55
|
+
exports.SEMANTIC_ATTRIBUTE_SENTRY_OP = browser.SEMANTIC_ATTRIBUTE_SENTRY_OP;
|
|
56
|
+
exports.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN = browser.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN;
|
|
57
|
+
exports.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE = browser.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE;
|
|
58
|
+
exports.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE = browser.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE;
|
|
59
|
+
exports.Scope = browser.Scope;
|
|
60
|
+
exports.addBreadcrumb = browser.addBreadcrumb;
|
|
61
|
+
exports.addEventProcessor = browser.addEventProcessor;
|
|
62
|
+
exports.addIntegration = browser.addIntegration;
|
|
63
|
+
exports.captureConsoleIntegration = browser.captureConsoleIntegration;
|
|
64
|
+
exports.captureEvent = browser.captureEvent;
|
|
65
|
+
exports.captureException = browser.captureException;
|
|
66
|
+
exports.captureFeedback = browser.captureFeedback;
|
|
67
|
+
exports.captureMessage = browser.captureMessage;
|
|
68
|
+
exports.captureSession = browser.captureSession;
|
|
69
|
+
exports.close = browser.close;
|
|
70
|
+
exports.consoleLoggingIntegration = browser.consoleLoggingIntegration;
|
|
71
|
+
exports.continueTrace = browser.continueTrace;
|
|
72
|
+
exports.createConsolaReporter = browser.createConsolaReporter;
|
|
73
|
+
exports.createLangChainCallbackHandler = browser.createLangChainCallbackHandler;
|
|
74
|
+
exports.createTransport = browser.createTransport;
|
|
75
|
+
exports.dedupeIntegration = browser.dedupeIntegration;
|
|
76
|
+
exports.endSession = browser.endSession;
|
|
77
|
+
exports.eventFiltersIntegration = browser.eventFiltersIntegration;
|
|
78
|
+
exports.extraErrorDataIntegration = browser.extraErrorDataIntegration;
|
|
79
|
+
exports.featureFlagsIntegration = browser.featureFlagsIntegration;
|
|
80
|
+
exports.flush = browser.flush;
|
|
81
|
+
exports.functionToStringIntegration = browser.functionToStringIntegration;
|
|
82
|
+
exports.getActiveSpan = browser.getActiveSpan;
|
|
83
|
+
exports.getClient = browser.getClient;
|
|
84
|
+
exports.getCurrentScope = browser.getCurrentScope;
|
|
85
|
+
exports.getGlobalScope = browser.getGlobalScope;
|
|
86
|
+
exports.getIsolationScope = browser.getIsolationScope;
|
|
87
|
+
exports.getRootSpan = browser.getRootSpan;
|
|
88
|
+
exports.getSpanDescendants = browser.getSpanDescendants;
|
|
89
|
+
exports.getSpanStatusFromHttpCode = browser.getSpanStatusFromHttpCode;
|
|
90
|
+
exports.getTraceData = browser.getTraceData;
|
|
91
|
+
exports.inboundFiltersIntegration = browser.inboundFiltersIntegration;
|
|
92
|
+
exports.instrumentAnthropicAiClient = browser.instrumentAnthropicAiClient;
|
|
93
|
+
exports.instrumentCreateReactAgent = browser.instrumentCreateReactAgent;
|
|
94
|
+
exports.instrumentGoogleGenAIClient = browser.instrumentGoogleGenAIClient;
|
|
95
|
+
exports.instrumentLangChainEmbeddings = browser.instrumentLangChainEmbeddings;
|
|
96
|
+
exports.instrumentLangGraph = browser.instrumentLangGraph;
|
|
97
|
+
exports.instrumentOpenAiClient = browser.instrumentOpenAiClient;
|
|
98
|
+
exports.instrumentSupabaseClient = browser.instrumentSupabaseClient;
|
|
99
|
+
exports.isEnabled = browser.isEnabled;
|
|
100
|
+
exports.isInitialized = browser.isInitialized;
|
|
101
|
+
exports.lastEventId = browser.lastEventId;
|
|
102
|
+
exports.logger = browser.logger;
|
|
103
|
+
exports.makeMultiplexedTransport = browser.makeMultiplexedTransport;
|
|
104
|
+
exports.metrics = browser.metrics;
|
|
105
|
+
exports.moduleMetadataIntegration = browser.moduleMetadataIntegration;
|
|
106
|
+
exports.parameterize = browser.parameterize;
|
|
107
|
+
exports.registerSpanErrorInstrumentation = browser.registerSpanErrorInstrumentation;
|
|
108
|
+
exports.rewriteFramesIntegration = browser.rewriteFramesIntegration;
|
|
109
|
+
exports.setContext = browser.setContext;
|
|
110
|
+
exports.setConversationId = browser.setConversationId;
|
|
111
|
+
exports.setCurrentClient = browser.setCurrentClient;
|
|
112
|
+
exports.setExtra = browser.setExtra;
|
|
113
|
+
exports.setExtras = browser.setExtras;
|
|
114
|
+
exports.setHttpStatus = browser.setHttpStatus;
|
|
115
|
+
exports.setMeasurement = browser.setMeasurement;
|
|
116
|
+
exports.setTag = browser.setTag;
|
|
117
|
+
exports.setTags = browser.setTags;
|
|
118
|
+
exports.setUser = browser.setUser;
|
|
119
|
+
exports.spanToBaggageHeader = browser.spanToBaggageHeader;
|
|
120
|
+
exports.spanToJSON = browser.spanToJSON;
|
|
121
|
+
exports.spanToTraceHeader = browser.spanToTraceHeader;
|
|
122
|
+
exports.startInactiveSpan = browser.startInactiveSpan;
|
|
123
|
+
exports.startNewTrace = browser.startNewTrace;
|
|
124
|
+
exports.startSession = browser.startSession;
|
|
125
|
+
exports.startSpan = browser.startSpan;
|
|
126
|
+
exports.startSpanManual = browser.startSpanManual;
|
|
127
|
+
exports.supabaseIntegration = browser.supabaseIntegration;
|
|
128
|
+
exports.suppressTracing = browser.suppressTracing;
|
|
129
|
+
exports.thirdPartyErrorFilterIntegration = browser.thirdPartyErrorFilterIntegration;
|
|
130
|
+
exports.updateSpanName = browser.updateSpanName;
|
|
131
|
+
exports.withActiveSpan = browser.withActiveSpan;
|
|
132
|
+
exports.withIsolationScope = browser.withIsolationScope;
|
|
133
|
+
exports.withScope = browser.withScope;
|
|
134
|
+
exports.withStreamedSpan = browser.withStreamedSpan;
|
|
135
|
+
exports.zodErrorsIntegration = browser.zodErrorsIntegration;
|
|
136
136
|
exports.WINDOW = helpers.WINDOW;
|
|
137
137
|
exports.BrowserClient = client.BrowserClient;
|
|
138
138
|
exports.makeFetchTransport = fetch.makeFetchTransport;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const browser = require('@sentry/core/browser');
|
|
4
4
|
const browserUtils = require('@sentry-internal/browser-utils');
|
|
5
5
|
const debugBuild = require('../debug-build.js');
|
|
6
6
|
const helpers = require('../helpers.js');
|
|
@@ -26,7 +26,7 @@ const _breadcrumbsIntegration = ((options = {}) => {
|
|
|
26
26
|
setup(client) {
|
|
27
27
|
// TODO(v11): Remove this functionality and use `consoleIntegration` from @sentry/core instead.
|
|
28
28
|
if (_options.console) {
|
|
29
|
-
|
|
29
|
+
browser.addConsoleInstrumentationHandler(_getConsoleBreadcrumbHandler(client));
|
|
30
30
|
}
|
|
31
31
|
if (_options.dom) {
|
|
32
32
|
browserUtils.addClickKeypressInstrumentationHandler(_getDomBreadcrumbHandler(client, _options.dom));
|
|
@@ -35,7 +35,7 @@ const _breadcrumbsIntegration = ((options = {}) => {
|
|
|
35
35
|
browserUtils.addXhrInstrumentationHandler(_getXhrBreadcrumbHandler(client));
|
|
36
36
|
}
|
|
37
37
|
if (_options.fetch) {
|
|
38
|
-
|
|
38
|
+
browser.addFetchInstrumentationHandler(_getFetchBreadcrumbHandler(client));
|
|
39
39
|
}
|
|
40
40
|
if (_options.history) {
|
|
41
41
|
browserUtils.addHistoryInstrumentationHandler(_getHistoryBreadcrumbHandler(client));
|
|
@@ -47,23 +47,23 @@ const _breadcrumbsIntegration = ((options = {}) => {
|
|
|
47
47
|
};
|
|
48
48
|
}) ;
|
|
49
49
|
|
|
50
|
-
const breadcrumbsIntegration =
|
|
50
|
+
const breadcrumbsIntegration = browser.defineIntegration(_breadcrumbsIntegration);
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
53
|
* Adds a breadcrumb for Sentry events or transactions if this option is enabled.
|
|
54
54
|
*/
|
|
55
55
|
function _getSentryBreadcrumbHandler(client) {
|
|
56
56
|
return function addSentryBreadcrumb(event) {
|
|
57
|
-
if (
|
|
57
|
+
if (browser.getClient() !== client) {
|
|
58
58
|
return;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
browser.addBreadcrumb(
|
|
62
62
|
{
|
|
63
63
|
category: `sentry.${event.type === 'transaction' ? 'transaction' : 'event'}`,
|
|
64
64
|
event_id: event.event_id,
|
|
65
65
|
level: event.level,
|
|
66
|
-
message:
|
|
66
|
+
message: browser.getEventDescription(event),
|
|
67
67
|
},
|
|
68
68
|
{
|
|
69
69
|
event,
|
|
@@ -81,7 +81,7 @@ function _getDomBreadcrumbHandler(
|
|
|
81
81
|
dom,
|
|
82
82
|
) {
|
|
83
83
|
return function _innerDomBreadcrumb(handlerData) {
|
|
84
|
-
if (
|
|
84
|
+
if (browser.getClient() !== client) {
|
|
85
85
|
return;
|
|
86
86
|
}
|
|
87
87
|
|
|
@@ -93,7 +93,7 @@ function _getDomBreadcrumbHandler(
|
|
|
93
93
|
typeof dom === 'object' && typeof dom.maxStringLength === 'number' ? dom.maxStringLength : undefined;
|
|
94
94
|
if (maxStringLength && maxStringLength > MAX_ALLOWED_STRING_LENGTH) {
|
|
95
95
|
debugBuild.DEBUG_BUILD &&
|
|
96
|
-
|
|
96
|
+
browser.debug.warn(
|
|
97
97
|
`\`dom.maxStringLength\` cannot exceed ${MAX_ALLOWED_STRING_LENGTH}, but a value of ${maxStringLength} was configured. Sentry will use ${MAX_ALLOWED_STRING_LENGTH} instead.`,
|
|
98
98
|
);
|
|
99
99
|
maxStringLength = MAX_ALLOWED_STRING_LENGTH;
|
|
@@ -108,8 +108,8 @@ function _getDomBreadcrumbHandler(
|
|
|
108
108
|
const event = handlerData.event ;
|
|
109
109
|
const element = _isEvent(event) ? event.target : event;
|
|
110
110
|
|
|
111
|
-
target =
|
|
112
|
-
componentName =
|
|
111
|
+
target = browser.htmlTreeAsString(element, { keyAttrs, maxStringLength });
|
|
112
|
+
componentName = browser.getComponentName(element);
|
|
113
113
|
} catch {
|
|
114
114
|
target = '<unknown>';
|
|
115
115
|
}
|
|
@@ -127,7 +127,7 @@ function _getDomBreadcrumbHandler(
|
|
|
127
127
|
breadcrumb.data = { 'ui.component_name': componentName };
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
|
|
130
|
+
browser.addBreadcrumb(breadcrumb, {
|
|
131
131
|
event: handlerData.event,
|
|
132
132
|
name: handlerData.name,
|
|
133
133
|
global: handlerData.global,
|
|
@@ -140,7 +140,7 @@ function _getDomBreadcrumbHandler(
|
|
|
140
140
|
*/
|
|
141
141
|
function _getConsoleBreadcrumbHandler(client) {
|
|
142
142
|
return function _consoleBreadcrumb(handlerData) {
|
|
143
|
-
if (
|
|
143
|
+
if (browser.getClient() !== client) {
|
|
144
144
|
return;
|
|
145
145
|
}
|
|
146
146
|
|
|
@@ -150,13 +150,13 @@ function _getConsoleBreadcrumbHandler(client) {
|
|
|
150
150
|
arguments: handlerData.args,
|
|
151
151
|
logger: 'console',
|
|
152
152
|
},
|
|
153
|
-
level:
|
|
154
|
-
message:
|
|
153
|
+
level: browser.severityLevelFromString(handlerData.level),
|
|
154
|
+
message: browser.safeJoin(handlerData.args, ' '),
|
|
155
155
|
};
|
|
156
156
|
|
|
157
157
|
if (handlerData.level === 'assert') {
|
|
158
158
|
if (handlerData.args[0] === false) {
|
|
159
|
-
breadcrumb.message = `Assertion failed: ${
|
|
159
|
+
breadcrumb.message = `Assertion failed: ${browser.safeJoin(handlerData.args.slice(1), ' ') || 'console.assert'}`;
|
|
160
160
|
breadcrumb.data.arguments = handlerData.args.slice(1);
|
|
161
161
|
} else {
|
|
162
162
|
// Don't capture a breadcrumb for passed assertions
|
|
@@ -164,7 +164,7 @@ function _getConsoleBreadcrumbHandler(client) {
|
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
|
|
167
|
-
|
|
167
|
+
browser.addBreadcrumb(breadcrumb, {
|
|
168
168
|
input: handlerData.args,
|
|
169
169
|
level: handlerData.level,
|
|
170
170
|
});
|
|
@@ -176,7 +176,7 @@ function _getConsoleBreadcrumbHandler(client) {
|
|
|
176
176
|
*/
|
|
177
177
|
function _getXhrBreadcrumbHandler(client) {
|
|
178
178
|
return function _xhrBreadcrumb(handlerData) {
|
|
179
|
-
if (
|
|
179
|
+
if (browser.getClient() !== client) {
|
|
180
180
|
return;
|
|
181
181
|
}
|
|
182
182
|
|
|
@@ -208,12 +208,12 @@ function _getXhrBreadcrumbHandler(client) {
|
|
|
208
208
|
category: 'xhr',
|
|
209
209
|
data,
|
|
210
210
|
type: 'http',
|
|
211
|
-
level:
|
|
211
|
+
level: browser.getBreadcrumbLogLevelFromHttpStatusCode(status_code),
|
|
212
212
|
};
|
|
213
213
|
|
|
214
214
|
client.emit('beforeOutgoingRequestBreadcrumb', breadcrumb, hint );
|
|
215
215
|
|
|
216
|
-
|
|
216
|
+
browser.addBreadcrumb(breadcrumb, hint);
|
|
217
217
|
};
|
|
218
218
|
}
|
|
219
219
|
|
|
@@ -222,7 +222,7 @@ function _getXhrBreadcrumbHandler(client) {
|
|
|
222
222
|
*/
|
|
223
223
|
function _getFetchBreadcrumbHandler(client) {
|
|
224
224
|
return function _fetchBreadcrumb(handlerData) {
|
|
225
|
-
if (
|
|
225
|
+
if (browser.getClient() !== client) {
|
|
226
226
|
return;
|
|
227
227
|
}
|
|
228
228
|
|
|
@@ -255,7 +255,7 @@ function _getFetchBreadcrumbHandler(client) {
|
|
|
255
255
|
|
|
256
256
|
client.emit('beforeOutgoingRequestBreadcrumb', breadcrumb, hint );
|
|
257
257
|
|
|
258
|
-
|
|
258
|
+
browser.addBreadcrumb(breadcrumb, hint);
|
|
259
259
|
} else {
|
|
260
260
|
const response = handlerData.response ;
|
|
261
261
|
const data = {
|
|
@@ -274,12 +274,12 @@ function _getFetchBreadcrumbHandler(client) {
|
|
|
274
274
|
category: 'fetch',
|
|
275
275
|
data,
|
|
276
276
|
type: 'http',
|
|
277
|
-
level:
|
|
277
|
+
level: browser.getBreadcrumbLogLevelFromHttpStatusCode(data.status_code),
|
|
278
278
|
};
|
|
279
279
|
|
|
280
280
|
client.emit('beforeOutgoingRequestBreadcrumb', breadcrumb, hint );
|
|
281
281
|
|
|
282
|
-
|
|
282
|
+
browser.addBreadcrumb(breadcrumb, hint);
|
|
283
283
|
}
|
|
284
284
|
};
|
|
285
285
|
}
|
|
@@ -289,15 +289,15 @@ function _getFetchBreadcrumbHandler(client) {
|
|
|
289
289
|
*/
|
|
290
290
|
function _getHistoryBreadcrumbHandler(client) {
|
|
291
291
|
return function _historyBreadcrumb(handlerData) {
|
|
292
|
-
if (
|
|
292
|
+
if (browser.getClient() !== client) {
|
|
293
293
|
return;
|
|
294
294
|
}
|
|
295
295
|
|
|
296
296
|
let from = handlerData.from;
|
|
297
297
|
let to = handlerData.to;
|
|
298
|
-
const parsedLoc =
|
|
299
|
-
let parsedFrom = from ?
|
|
300
|
-
const parsedTo =
|
|
298
|
+
const parsedLoc = browser.parseUrl(helpers.WINDOW.location.href);
|
|
299
|
+
let parsedFrom = from ? browser.parseUrl(from) : undefined;
|
|
300
|
+
const parsedTo = browser.parseUrl(to);
|
|
301
301
|
|
|
302
302
|
// Initial pushState doesn't provide `from` information
|
|
303
303
|
if (!parsedFrom?.path) {
|
|
@@ -313,7 +313,7 @@ function _getHistoryBreadcrumbHandler(client) {
|
|
|
313
313
|
from = parsedFrom.relative;
|
|
314
314
|
}
|
|
315
315
|
|
|
316
|
-
|
|
316
|
+
browser.addBreadcrumb({
|
|
317
317
|
category: 'navigation',
|
|
318
318
|
data: {
|
|
319
319
|
from,
|